PageSourceSearch

https://okaydev.co/dist/assets/profile-renderer-Bgekj5gI.js

js okaydev.co collected 2026-09-25 20:11:32 UTC 55,698 bytes, 1 lines download raw bytes

1import{D as e}from"./default-renderer-BZKN5ad1.js";/* empty css                       *//* empty css                        *//* empty css                         */import{g as o,s as t,T as i,L as r,M as l,b as s,N as n,J as a,v as c,w as f,i as d,O as h,Q as u,h as p,R as v}from"./HeaderLogoLetters-DJI_FB9w.js";import{i as P}from"./incrementEntryViewCountFromPage-3eQx233S.js";import{r as m,t as y}from"./galleryCardTouchFocus-BfllxjdH.js";import{j as S,k as b,l as g,m as w,n as L,o as A,q as E,t as F,v as N,w as C,r as H}from"./app-Cu6dTb9L.js";import{p as k,s as V,a as T,r as q}from"./listingCoverVideoPoster-BLMhmd0Z.js";import{r as M}from"./revealListingCoverLazyFadeImages-B3dTDF0e.js";import{d as R}from"./distributeProjectAuthorCard-USTmGEds.js";import{S as O}from"./SocialPostForm-CGgbKgDy.js";import{P as _}from"./ProfileAvatarTilt-DIXvf0BJ.js";import{S as x}from"./SplitText-VLUCmDhw.js";import{S as I}from"./SocialPosts-rgMf2ipp.js";import"./lazyDialog-D7tW-HM0.js";import"./selectedMemberElement-BIB-k0h5.js";import"./patchCommentsProtect-C8m96Vr7.js";import"./mediaUploadStatusError-D6rbRcEa.js";import"./output-BQAQukZ9.js";import"./videoPosterMediabunny-CXcmZmdN.js";import"./stepTilt-Cn-xzgMk.js";o.registerPlugin(x);const D="opacity,visibility,transform";class B{constructor(e){this.root=e instanceof Element?e:null,this.shellPlayed=!1,this.ctx=null,this.contentCtx=null,this.splits=[],this.shellTl=null,this.contentTl=null}static isDesktop(){return window.matchMedia("(min-width: 1024px)").matches}shouldAnimate(){return Boolean(this.root)&&B.isDesktop()&&!t.isReducedMotion}play({includeShell:e=!0}={}){return this.root?this.shouldAnimate()?e&&!this.shellPlayed?this.playShellAndContent():(this.clearPending(),this.playContent()):(this.clearPending(),this.revealPortfolioSectionFallback(),Promise.resolve()):Promise.resolve()}playShellAndContent(){return this.killShell(),new Promise((e=>{this.ctx=o.context((()=>{const t=this.root.querySelector('[data-profile-enter="avatar"]'),i=this.root.querySelector('[data-profile-enter="name"]'),r=this.root.querySelector('[data-profile-enter="aside-rest"]'),l=this.root.querySelector(".profile-nav"),s=e=>e.classList.contains("profile-nav-share-work")||e.classList.contains("profile-nav-bento"),n=o.utils.toArray(this.root.querySelectorAll(".profile-nav .profile-nav-button[href], .profile-nav .profile-nav-share-work, .profile-nav .profile-nav-bento")).filter((e=>!e.hidden&&!e.closest("[hidden]"))),a=n.filter((e=>!s(e))),c=n.filter(s);t&&o.set(t,{autoAlpha:0}),i&&o.set(i,{autoAlpha:0}),r&&o.set(r,{autoAlpha:0}),a.length&&o.set(a,{autoAlpha:0,x:-28}),c.length&&o.set(c,{autoAlpha:0}),null==l||l.classList.add("is-enter-nav-pending"),this.prepareContentFromStates(),this.clearPending();const f=o.timeline({defaults:{ease:"power2.in",force3D:!0},onComplete:e});t&&f.to(t,{autoAlpha:1,duration:.45,ease:"power1.in",clearProps:D},0),i&&f.to(i,{autoAlpha:1,duration:.45,ease:"power1.in",clearProps:"opacity,visibility"},.16),r&&f.to(r,{autoAlpha:1,duration:.35,clearProps:D},.24);const d=n.length?.14+.55+.08*Math.max(0,n.length-1):0;let h=!1;n.length?(n.forEach(((e,o)=>{const t=s(e);f.to(e,{autoAlpha:1,...t?{}:{x:0},duration:.55,ease:"power2.out",clearProps:t?"opacity,visibility":D,onComplete:()=>{!h&&e.classList.contains("is-active")&&(h=!0,this.revealNavActiveState(l))}},.14+.08*o)})),f.call((()=>{h||this.revealNavActiveState(l)}),null,d+.02)):this.revealNavActiveState(l),this.appendContentReveal(f,{at:.22,statsAt:Math.max(0,d-.28)}),f.getChildren().length||e(),this.shellTl=f,this.shellPlayed=!0}),this.root)}))}playContent(){return this.killContent(),this.shouldAnimate()?new Promise((e=>{this.contentCtx=o.context((()=>{this.prepareContentFromStates();const t=o.timeline({defaults:{ease:"power2.in",force3D:!0},onComplete:e});this.appendContentReveal(t,{at:0,statsAt:0}),t.getChildren().length||e(),this.contentTl=t}),this.root)})):(this.revealPortfolioSectionFallback(),Promise.resolve())}prepareContentFromStates(){const e=this.root.dataset.requestedPage||"portfolio";"portfolio"!==e?"about"===e&&this.prepareAboutFromStates():this.preparePortfolioFromStates()}preparePortfolioFromStates(){const e=this.root.querySelector("#profile-portfolio");if(!(e instanceof HTMLElement))return;
1e.style.opacity="1",e.style.visibility="visible",e.style.animation="none",e.dataset.fadeStarted="true";const t=e.querySelector('[data-profile-enter="portfolio-stats"]'),i=o.utils.toArray(e.querySelectorAll('[data-profile-enter="portfolio-projects"] > .project-cover'));if(t&&o.set(t,{autoAlpha:0}),i.length&&o.set(i,{autoAlpha:0,y:16}),!t&&!i.length){const t=e.querySelector(".no-items-container");t&&o.set(t,{autoAlpha:0,y:12})}}prepareAboutFromStates(){const e=this.root.querySelector('[data-profile-enter="about-bio"]'),t=this.root.querySelector('[data-profile-enter="about-cta"]'),i=this.root.querySelector('[data-profile-enter="about-divider"]'),r=this.root.querySelector(".profile-about-section"),l=r?o.utils.toArray(r.children).filter((e=>{var o;return!(null==(o=e.classList)?void 0:o.contains("profile-about-divider"))})):[];t&&o.set(t,{autoAlpha:0}),i&&r&&!r.hidden&&o.set(i,{autoAlpha:1,scaleX:0}),l.length&&o.set(l,{autoAlpha:0}),e&&o.set(e,{autoAlpha:0})}appendContentReveal(e,o=0){var t,i;const r="number"==typeof o?{at:o,statsAt:o}:o,l=null!=(t=r.at)?t:0,s=null!=(i=r.statsAt)?i:l,n=this.root.dataset.requestedPage||"portfolio";"portfolio"!==n?"about"===n&&this.appendAboutReveal(e,l):this.appendPortfolioReveal(e,{at:l,statsAt:s})}appendPortfolioReveal(e,t={}){var i,r;const l="number"==typeof t?t:null!=(i=t.at)?i:0,s="number"==typeof t?t:null!=(r=t.statsAt)?r:l,n=this.root.querySelector("#profile-portfolio");if(!(n instanceof HTMLElement))return;const a=n.querySelector('[data-profile-enter="portfolio-stats"]'),c=o.utils.toArray(n.querySelectorAll('[data-profile-enter="portfolio-projects"] > .project-cover')),f=n.querySelector(".no-items-container"),d=()=>{n.dataset.fadeCompleted="true"};a&&e.to(a,{autoAlpha:1,duration:.55,clearProps:"opacity,visibility"},s);const h=a?s+.16:l,u={each:.08,from:"start",grid:"auto"};if(c.length)return e.to(c,{autoAlpha:1,duration:.6,ease:"power2.in",stagger:u,clearProps:"opacity,visibility",onComplete:d},h),void e.to(c,{y:0,duration:.6,ease:"power2.out",stagger:u,clearProps:"transform"},h);f?e.to(f,{autoAlpha:1,y:0,duration:.55,clearProps:D,onComplete:d},a?s:l):d()}appendAboutReveal(e,t=0){const i=this.root.querySelector('[data-profile-enter="about-bio"]'),r=this.root.querySelector('[data-profile-enter="about-cta"]'),l=this.root.querySelector('[data-profile-enter="about-divider"]'),s=this.root.querySelector(".profile-about-section"),n=s?o.utils.toArray(s.children).filter((e=>{var o;return!(null==(o=e.classList)?void 0:o.contains("profile-about-divider"))})):[];let a=t;if(i){o.set(i,{autoAlpha:1});const r=this.getAboutBioSplitTargets(i),l=[];r.forEach((e=>{var o;const t=x.create(e,{type:"lines",linesClass:"profile-about-line",aria:"auto",reduceWhiteSpace:!1});this.splits.push(t),(null==(o=t.lines)?void 0:o.length)&&(t.lines.forEach((e=>{(e.textContent||"").trim()||e.appendChild(document.createTextNode(" "))})),l.push(...t.lines))})),l.length?(o.set(l,{autoAlpha:0,y:14}),e.to(l,{autoAlpha:1,y:0,duration:.6,ease:"power2.out",stagger:{each:.04,ease:"power1.out"},clearProps:D},t),a=t+Math.min(.28,Math.max(.12,.04*(l.length-1)))):o.set(i,{autoAlpha:1,clearProps:D})}r&&e.to(r,{autoAlpha:1,duration:.55,ease:"power2.in",clearProps:"opacity,visibility"},a);const c=a+(r?.16:.1);l&&s&&"none"!==getComputedStyle(s).display&&e.to(l,{scaleX:1,duration:.6,ease:"power2.in",clearProps:"transform"},c),n.length&&e.to(n,{autoAlpha:1,duration:.55,clearProps:"opacity,visibility"},c+.14)}getAboutBioSplitTargets(e){const t=o.utils.toArray(e.children).filter((e=>e instanceof HTMLElement));if(!t.length)return[e];const i=[];return t.forEach((e=>{if(e.matches("ul, ol"))return void o.utils.toArray(e.children).forEach((e=>{e instanceof HTMLElement&&e.matches("li")&&i.push(e)}));const t=Boolean(e.querySelector("img, svg, br, video, iframe"));((e.textContent||"").trim()||t)&&i.push(e)})),i.length?i:[e]}revealPortfolioSectionFallback(){var e,o;const t=null==(o=null==(e=this.root)?void 0:e.querySelector)?void 0:o.call(e,"#profile-portfolio");t instanceof HTMLElement&&t.dataset.fadeStarted}clearPending(){var e,o;null==(o=null==(e=this.root)?void 0:e.removeAttribute)||o.call(e,"data-profile-enter-pending")}revealNavActiveState(e=(e=>null==(e=(e=>null==(e=this.root)?void 0:e.querySelector)())?void 0:e.call(_a,".profile-nav"))()){if(!(e instanceof HTMLElement))return;const o=e.querySelector("ul"),t=e.querySelector(".profile-nav-button.is-active");let i=null==o?void 0:o.querySelector(":scope > .profile-nav-active-pill");
1if(!i&&o&&(i=document.createElement("span"),i.className="profile-nav-active-pill",i.setAttribute("aria-hidden","true"),o.appendChild(i)),o instanceof HTMLElement&&t instanceof HTMLElement&&i){const e=o.getBoundingClientRect(),i=t.getBoundingClientRect();o.style.setProperty("--profile-nav-active-pill-x",`${i.left-e.left+o.scrollLeft}px`),o.style.setProperty("--profile-nav-active-pill-y",`${i.top-e.top+o.scrollTop}px`),o.style.setProperty("--profile-nav-active-pill-width",`${i.width}px`),o.style.setProperty("--profile-nav-active-pill-height",`${i.height}px`),o.style.setProperty("--profile-nav-active-pill-opacity","0")}e.classList.add("is-active-pill-ready","is-active-pill-animated"),e.classList.remove("is-enter-nav-pending"),o instanceof HTMLElement&&requestAnimationFrame((()=>{o.style.setProperty("--profile-nav-active-pill-opacity","1")}))}killShell(){var e,o;null==(e=this.shellTl)||e.kill(),this.shellTl=null,null==(o=this.ctx)||o.revert(),this.ctx=null}killContent(){var e,o;null==(e=this.contentTl)||e.kill(),this.contentTl=null,this.splits.forEach((e=>{try{e.revert()}catch(o){}})),this.splits=[],null==(o=this.contentCtx)||o.revert(),this.contentCtx=null}destroy(){var e,o,t,i;null==(i=null==(t=null==(o=null==(e=this.root)?void 0:e.querySelector)?void 0:o.call(e,".profile-nav"))?void 0:t.classList)||i.remove("is-enter-nav-pending"),this.killContent(),this.killShell(),this.clearPending(),this.shellPlayed=!1,this.root=null}}const j=["portfolio","about","social","likes","bookmarks"];class K{constructor(e=null){this.root=K.resolveRoot(e),this.initVars(),this.initAnimations(),this.initPage()}static resolveRoot(e){var o;return e instanceof Element&&(null==(o=e.matches)?void 0:o.call(e,'[data-router-view="profile"]'))?e:document.querySelector('[data-router-view="profile"]')}initVars(){var e,o,t,i;const r=this.root instanceof Element?this.root:document;this.userThemeElem=(null==(e=r.matches)?void 0:e.call(r,"[data-theme]"))?r:r.querySelector("[data-theme]"),this.userTheme=null!=(i=null==(t=null==(o=this.userThemeElem)?void 0:o.dataset)?void 0:t.theme)?i:"light",this.isDark="dark"==this.userTheme,this.dataCounts=r.querySelectorAll("[data-count]"),this.socialPostFormContainer=r.querySelector(".social-post-form"),this.profileSections=r.querySelector(".profile-sections"),this.profileNav=r.querySelector(".profile-nav"),this.profileNavStickySentinel=null,this.profileNavStickyObserver=null,this.profileNavActivePill=null,this.profileNavActivePillFrame=null,this.profileNavLinks=r.querySelectorAll(".profile-nav .profile-nav-button[href]"),this.profilePortfolioSection=r.querySelector("#profile-portfolio"),this.profileVideos=r.querySelectorAll('video[data-profile-video="true"][data-video-src]'),this.profileVideoObserver=null,this.profilePortfolioHoverVideoCleanupFns=[],this.profilePortfolioVideoObserver=null,this.profilePortfolioHoverVideoObserver=null,this.profilePortfolioPosterRestoreTimeouts=new Map,this.profilePortfolioFadeReadyHandler=null,this._profileMetricsHydratePromise=null,this._profileSectionsPointerResetTimer=null,this._profileSocialFormObserver=null,this._profileSocialFormLoadHandler=null,this._profileSectionLoader=null,this._profileSectionLoadingPromise=null,this.socialPosts=null,this.profileEnterReveal=null,this._profileSectionNavigationId=0,this._profileSectionNavigationPromise=null}initAnimations(){this.profileEnterReveal=new B(this.root)}initPage(){var e,o,t;this.addListeners(),N(this),m(),this.profileAvatarTilt=new _(this.root),R(null!=(e=this.root)?e:document),S(null!=(o=this.root)?o:document),this.playProfileEnterReveal({includeShell:!0}).then((()=>{var e,o,t,i;this.syncProfileNavActivePill(),this.centerActiveProfileNavLink(),"portfolio"!==(null==(o=null==(e=this.root)?void 0:e.dataset)?void 0:o.requestedPage)&&(null==(i=null==(t=this.root)?void 0:t.dataset)?void 0:i.requestedPage)||(this.releaseProfilePortfolioPauseIndicators(),this.nudgeVisibleProfilePortfolioAutoplayVideos())})),i.setMode(this.isDark?"dark":"light");const s=null!=(t=this.root)?t:document;r(s),l(s),P(s,{singleClientAttempt:!0,skipOptimistic:!0,buttonSelector:"[data-profile-view-count-button]",metricLabel:"Visitors"}),this.hydrateProfileMetrics(),this.dataCounts&&this.formatCounts(),this.ensureProfileSocialPostForm(),this.watchProfileSocialPostFormMount(),this.ensureProfileSocialPosts(),this.clearProfileSectionsPointerEvents(),this.syncProfileFeedItems(),this.initProfileFeedVideoPlayers(),this.bindProfileFeedShareButtons(),this.scheduleProfilePortfolioFade(),this.initProfileVideos(),this.initProfilePortfolioCoverVideos(),this.syncProfileNavLinkHashes(),this.initProfileNavStickySentinel(),this.centerActiveProfileNavLink(),this.syncProfileNavActivePill(),requestAnimationFrame((()=>{var e;S(null!=(e=this.root)?e:document),this.syncProfileNavLinkHashes(),this.ensureProfileSocialPostForm(),this.initProfileNavStickySentinel(),this.centerActiveProfileNavLink(),this.syncProfileNavActivePill()})),window.setTimeout((()=>{this.centerActiveProfileNavLink(),this.syncProfileNavActivePill()}),250)}addListeners(){const e=this;s(e,["initProfileFeedVideoPlayers","bindProfileFeedShareButtons","onServdDynamicLoaded","handleProfileFeedAfterSwap","onProfilePortfolioDomReady","handleProfileSectionNavClick","handleProfileNavLinkPointerDown","handleProfileNavLinkKeyDown","syncProfileNavLinkHashes","scheduleProfileNavActivePillSync","syncProfileNavActivePill","handleProfilePortfolioHoverCardEnter","handleProfilePortfolioHoverCardLeave","handleProfilePortfolioHoverCardFocusIn","handleProfilePortfolioHoverCardFocusOut","syncProfileFeedItems","syncProfileFeedItem","clearProfileSectionsPointerEvents","handleProfileNewPost
1Click","onProfileWindowLoad"]),window.addEventListener("servd.dynamicloaded",e.onServdDynamicLoaded),window.addEventListener("pageshow",e.clearProfileSectionsPointerEvents),window.addEventListener("popstate",e.clearProfileSectionsPointerEvents),window.addEventListener("resize",e.scheduleProfileNavActivePillSync),document.body.addEventListener("htmx:afterSwap",e.handleProfileFeedAfterSwap);const o=this.root instanceof Element?this.root:document;o.addEventListener("click",e.handleProfileSectionNavClick,!0),o.addEventListener("click",e.handleProfileNewPostClick),this._profileSocialFormLoadHandler=e.onProfileWindowLoad,window.addEventListener("load",e._profileSocialFormLoadHandler),"complete"===document.readyState&&requestAnimationFrame((()=>e.onProfileWindowLoad())),this.syncProfileNavLinkHashes(),this.profileNavLinks.forEach((o=>{o.addEventListener("pointerdown",e.handleProfileNavLinkPointerDown),o.addEventListener("keydown",e.handleProfileNavLinkKeyDown)}))}removeListeners(){const e=this;window.removeEventListener("servd.dynamicloaded",e.onServdDynamicLoaded),window.removeEventListener("pageshow",e.clearProfileSectionsPointerEvents),window.removeEventListener("popstate",e.clearProfileSectionsPointerEvents),window.removeEventListener("resize",e.scheduleProfileNavActivePillSync),document.body.removeEventListener("htmx:afterSwap",e.handleProfileFeedAfterSwap);const o=this.root instanceof Element?this.root:document;o.removeEventListener("click",e.handleProfileSectionNavClick,!0),o.removeEventListener("click",e.handleProfileNewPostClick),e._profileSocialFormLoadHandler&&(window.removeEventListener("load",e._profileSocialFormLoadHandler),e._profileSocialFormLoadHandler=null),e._profileSocialFormObserver&&(e._profileSocialFormObserver.disconnect(),e._profileSocialFormObserver=null),e._profileSectionsPointerResetTimer&&(window.clearTimeout(e._profileSectionsPointerResetTimer),e._profileSectionsPointerResetTimer=null),e.profileNavActivePillFrame&&(window.cancelAnimationFrame(e.profileNavActivePillFrame),e.profileNavActivePillFrame=null),this.removeProfileSectionLoader({immediate:!0}),this.profileNavLinks.forEach((o=>{o.removeEventListener("pointerdown",e.handleProfileNavLinkPointerDown),o.removeEventListener("keydown",e.handleProfileNavLinkKeyDown)})),this.profilePortfolioFadeReadyHandler&&(document.removeEventListener("DOMContentLoaded",this.profilePortfolioFadeReadyHandler),this.profilePortfolioFadeReadyHandler=null)}async stopPage(){this.removeListeners(),C(this),F(),u(),this.socialPostForm&&(await this.socialPostForm.destroy(),this.socialPostForm=null),this._profileSocialFormObserver&&(this._profileSocialFormObserver.disconnect(),this._profileSocialFormObserver=null),this.destroyProfileSocialPosts(),y(),this.teardownProfilePortfolioCoverVideos(),this.destroyProfileVideos(),this.destroyProfileNavStickySentinel(),this.profileAvatarTilt&&(this.profileAvatarTilt.destroy(),this.profileAvatarTilt=null),this.profileEnterReveal&&(this.profileEnterReveal.destroy(),this.profileEnterReveal=null)}async playProfileEnterReveal({includeShell:e=!1}={}){var o,t,i,r,l;if(!this.profileEnterReveal)return;const s=(null==(t=null==(o=this.root)?void 0:o.dataset)?void 0:t.requestedPage)||"portfolio";if(e&&this.profileEnterReveal.shouldAnimate()&&(null==(r=null==(i=this.profileNav)?void 0:i.classList)||r.add("is-enter-nav-pending")),"about"===s&&this.profileEnterReveal.shouldAnimate()&&this.profileEnterReveal.prepareAboutFromStates(),"about"===s&&(null==(l=document.fonts)?void 0:l.ready))try{await Promise.race([document.fonts.ready,new Promise((e=>{window.setTimeout(e,400)}))])}catch(n){}return this.profileEnterReveal.play({includeShell:e})}formatCounts(){this.dataCounts.forEach((e=>{if(e.closest(".is-metric-hydrate.is-metric-pending"))return;const o=e.dataset.count;if(void 0===o||""===o)return;const t=Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(o);e.innerText=t}))}scheduleProfilePortfolioFade(){this.profilePortfolioSection&&"true"!==this.profilePortfolioSection.dataset.fadeStarted&&("loading"===document.readyState?(this.profilePortfolioFadeReadyHandler=this.onProfilePortfolioDomReady,document.addEventListener("DOMContentLoaded",this.profilePortfolioFadeReadyHandler,{once:!0})):this.startProfilePortfolioFade())}onProfilePortfolioDomReady(){this.profilePortfolioFadeReadyHandler=null,this.startProfilePortfolioFade()}releaseProfilePortfolioPauseIndicators(){this.profilePortfolioSection&&this.profilePortfolioSection.querySelectorAll(".video-pause-indicator").forEach((e=>{e.style.removeProperty("display")}))}startProfilePortfolioFade(){var e,o;if(this.profilePortfolioSection&&"true"!==this.profilePortfolioSection.dataset.fadeStarted)return B.isDesktop()&&!t.isReducedMotion?(this.profilePortfolioSection.dataset.fadeStarted="true",this.profilePortfolioSection.style.opacity="1",this.profilePortfolioSection.style.visibility="visible",this.profilePortfolioSection.style.animation="none",void(null==(o=null==(e=this.profileEnterReveal)?void 0:e.preparePortfolioFromStates)||o.call(e))):void requestAnimationFrame((()=>{requestAnimationFrame((()=>{this.profilePortfolioSection&&"true"!==this.profilePortfolioSection.dataset.fadeStarted&&(this.profilePortfolioSection.dataset.fadeStarted="true",this.profilePortfolioSection.style.visibility="visible",this.profilePortfolioSection.style.animation="profile-portfolio-inline-fade-in 0.2s ease 0.25s forwards",this.profilePortfolioSection.addEventListener("animationend",(()=>{this.profilePortfolioSection.dataset.fadeCompleted="true",this.profilePortfolioSection.style.willChange="transform, opacity",this.releaseProfilePortfolioPauseIndicators(),this.nudgeVisibleProfilePortfolioAutoplayVideos()}),{once:!0}))}))}))}initProfileVideos(){this.profileVideos.length&&("IntersectionObserver"in window?this.profileVideoObserver||(this.profileVideoObserver=new IntersectionObserver((e=>{e.forEach((e=>{if(!e.isIntersecting)return;const o=e.target;this.hydrateProfileVideo(o),this.profileVideoObserver.unobserve(o)}))}),{rootMargin:"200px 0px"}),this.profileVideos.forEach((e=>{this.profileVideoObserver.observe(e)}))):this.profileVideos.forEach((e=>this.hydrateProfileVideo(e))))}initProfileFeedVideoPlayers(){n(this.root instanceof Element?this.root:document)}bindProfileFeedShareButtons(){var e,o;const t=this.root instanceof Element?this.root:document;null==(o=null==(e=window.__okaydevServdFinalizeRenderer)?void 0:e.b
1indProfileFeedShareButtons)||o.call(e,t)}onServdDynamicLoaded(){const e=this.root instanceof Element?this.root:document;this.initProfileFeedVideoPlayers(),this.bindProfileFeedShareButtons();const o=e.querySelectorAll('video[data-profile-video="true"][data-video-src]');this.profileVideos=o,"IntersectionObserver"in window?this.profileVideoObserver?o.forEach((e=>{"true"!==e.dataset.videoHydrated&&this.profileVideoObserver.observe(e)})):this.initProfileVideos():o.forEach((e=>this.hydrateProfileVideo(e))),m(),this.syncProfileFeedItems(),this.refreshProfilePortfolioCoverVideos(),R(e),S(e),this.syncProfileNavLinkHashes(),this.ensureProfileSocialPostForm(),this.watchProfileSocialPostFormMount(),this.ensureProfileSocialPosts(),this.centerActiveProfileNavLink(),this.syncProfileNavActivePill(),window.setTimeout((()=>{this.centerActiveProfileNavLink(),this.syncProfileNavActivePill()}),100),l(e),this.hydrateProfileMetrics()}onProfileWindowLoad(){this.ensureProfileSocialPostForm(),this.centerActiveProfileNavLink(),this.syncProfileNavActivePill(),window.setTimeout((()=>{this.centerActiveProfileNavLink(),this.syncProfileNavActivePill()}),100)}handleProfileNewPostClick(e){var o,t;if(!(null==(t=null==(o=e.target)?void 0:o.closest)?void 0:t.call(o,".profile-nav-new-post")))return;const i=Boolean(this.socialPostForm);this.ensureProfileSocialPostForm(),this.socialPostForm&&!i&&this.socialPostForm.newPostClick(e)}watchProfileSocialPostFormMount(){if(this.socialPostForm||this._profileSocialFormObserver)return;const e=(this.root instanceof Element?this.root:document).querySelector("#profile-social .profile-social-section");if(!e)return;const o=()=>{this.ensureProfileSocialPostForm(),this.socialPostForm&&this._profileSocialFormObserver&&(this._profileSocialFormObserver.disconnect(),this._profileSocialFormObserver=null)};o(),!this.socialPostForm&&"MutationObserver"in window&&(this._profileSocialFormObserver=new MutationObserver(o),this._profileSocialFormObserver.observe(e,{childList:!0,subtree:!0}))}ensureProfileSocialPostForm(){if(this.socialPostForm)return;const e=(this.root instanceof Element?this.root:document).querySelector("#profile-social .social-post-form")||document.querySelector(".social-post-form-container.is-overlay .social-post-form");e&&(this.socialPostFormContainer=e,this.socialPostForm=new O)}ensureProfileSocialPosts(){var e,o;const t=this.root instanceof Element?this.root:document;t.querySelector("#profile-social #socialFeed")?(this.socialPosts||(this.socialPosts=new I({viewRoot:t instanceof Element?t:null})),null==(o=(e=this.socialPosts).bootstrapSocialLoadMoreWhenReady)||o.call(e)):this.destroyProfileSocialPosts()}destroyProfileSocialPosts(){this.socialPosts&&(this.socialPosts.destroy(),this.socialPosts=null)}hydrateProfileMetrics(){if(this._profileMetricsHydratePromise)return this._profileMetricsHydratePromise;const e=this.root instanceof Element?this.root:document,o=e.querySelector("#profile-portfolio"),t=()=>(this._profileMetricsHydratePromise=new Promise((o=>{requestAnimationFrame((()=>{requestAnimationFrame((()=>{Promise.all([p(e,{clearLoadingAttr:!1,metricLabel:"Visitors"}),v(e)]).then(o)}))}))})).finally((()=>{this._profileMetricsHydratePromise=null})),this._profileMetricsHydratePromise);return o&&"IntersectionObserver"in window?(this._profileMetricsHydratePromise=new Promise((e=>{const i=new IntersectionObserver((o=>{o.some((e=>e.isIntersecting))&&(i.disconnect(),t().then(e))}),{rootMargin:"200px 0px"});i.observe(o)})),this._profileMetricsHydratePromise):t()}handleProfileFeedAfterSwap(e){var o,t,i,r,l,s,a,c;const f=null!=(i=null!=(t=null==(o=null==e?void 0:e.detail)?void 0:o.target)?t:null==e?void 0:e.target)?i:null;if(!(f instanceof Element&&this.root instanceof Element)||this.root.contains(f)){if(f instanceof Element){const e=null!=(r=f.closest("#likesFeed, #bookmarksFeed"))?r:f;(null==(l=e.querySelector)?void 0:l.call(e,"[data-custom-video-player]"))&&n(e),(null==(s=e.querySelector)?void 0:s.call(e,".btn-share, .overlay-share"))&&(null==(c=null==(a=window.__okaydevServdFinalizeRenderer)?void 0:a.bindShareButtons)||c.call(a,e))}this.syncProfileFeedItems()}}syncProfileFeedItems(){const e=this.root instanceof Element?this.root:document,o=!!e.querySelector("#profile-bottom.is-own-profile");e.querySelectorAll("[data-profile-feed-item]").forEach((e=>{this.syncProfileFeedItem(e,o)}))}syncProfileFeedItem(e,o=!1){if(!(e instanceof Element))return;if(!o)return void e.classList.remove("is-feed-inactive");const t=e.dataset.profileFeedType;let i=!1;if("likes"===t)i=!e.querySelector(".like-container .btn-liked");else{if("bookmarks"!==t)return;i=!e.querySelector(".bookmark-container .btn-bookmarked")}e.classList.toggle("is-feed-inactive",i)}clearProfileSectionsPointerEvents(){var e,o,t;const i=null!=(t=this.profileSections)?t:null==(o=null==(e=this.root)?void 0:e.querySelector)?void 0:o.call(e,".profile-sections");null==i||i.style.removeProperty("pointer-events"),this._profileSectionsPointerResetTimer&&(window.clearTimeout(this._profileSectionsPointerResetTimer),this._profileSectionsPointerResetTimer=null)}canHandleProfileSectionNavigation(e,{isPopstate:o=!1}={}){var i;if(!(this.root instanceof Element)||(null==(i=t.pjax)?void 0:i.running))return!1;if(!b(e,this.root))return!1;const r=g(e);
1if(!r)return!1;if("bento"===this.root.dataset.profileLayout){if(/^\/u\/[^/]+(?:\/portfolio)?\/?$/i.test(r.url.pathname))return!1}const l=this.root.dataset.requestedPage||"portfolio";if(!o&&r.subpage===l){const o=new URL(e,window.location.origin),t=new URL(window.location.href);if(o.pathname===t.pathname&&o.search===t.search)return!1}return!0}handleProfileSectionNavClick(e){var o,i;if(e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const r=null==(i=null==(o=e.target)?void 0:o.closest)?void 0:i.call(o,".profile-nav .profile-nav-button[href], .profile-description-read-more[href]");r instanceof HTMLAnchorElement&&(r.target||r.hasAttribute("download")||r.hasAttribute("data-router-disabled")||!this.canHandleProfileSectionNavigation(r.href)||(e.preventDefault(),e.stopImmediatePropagation(),this.navigateProfileSection(r.href,{trigger:r}).catch((()=>{var e,o;null==(o=null==(e=t.pjax)?void 0:e.redirect)||o.call(e,r.href,!1,r)}))))}async navigateProfileSection(e,{isPopstate:o=!1}={}){if(!this.canHandleProfileSectionNavigation(e,{isPopstate:o}))return!1;if(this._profileSectionNavigationPromise)return this._profileSectionNavigationPromise;const t=this._profileSectionNavigationId+1;return this._profileSectionNavigationId=t,this._profileSectionNavigationPromise=this.runProfileSectionNavigation(e,{isPopstate:o,navigationId:t}).finally((()=>{this._profileSectionNavigationId===t&&(this._profileSectionNavigationPromise=null)})),this._profileSectionNavigationPromise}async runProfileSectionNavigation(e,{isPopstate:o=!1,navigationId:i=0}={}){var r;const l=g(e);if(!l)throw new Error("Invalid profile section URL.");const s=t.currentPage||window.location.pathname;t.scrollCache[s]=window.scrollY;const n=this.getProfileSectionTransitionDirection(l.subpage);this.hideProfileSectionsForIncomingUrl(l.url);const a=this.showProfileSectionLoader({force:!0,transitionDirection:n}),c=await w(l.url.href),f=c.view;if(this._profileSectionNavigationId!==i)return!1;if(!(f instanceof Element))throw new Error("Profile section response did not include a profile root.");return await a,o||L(l.url.href),await this.swapProfileSectionFromIncomingView(f,{target:l,properties:c,isPopstate:o,transitionDirection:n}),A(l.url.href,c),document.title=(null==(r=c.page)?void 0:r.title)||document.title,t.currentPage=l.url.pathname,o&&l.url.pathname in t.scrollCache?window.requestAnimationFrame((()=>{window.scrollTo(0,t.scrollCache[l.url.pathname])})):o||this.scrollMobileProfileSectionIntoView(),this.clearProfileSectionsPointerEvents(),!0}scrollMobileProfileSectionIntoView(){var e;if(!window.matchMedia("(max-width: 1023px)").matches)return;const o=t.coreHeaderController;null==(e=null==o?void 0:o.beginProgrammaticScroll)||e.call(o);const i=t.isReducedMotion||window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=i?"auto":"smooth",l=()=>{const e=this.getMobileProfileSectionScrollTop();null!==e&&window.scrollTo({top:e,left:0,behavior:r})};requestAnimationFrame((()=>{requestAnimationFrame((()=>{window.setTimeout((()=>{l(),window.setTimeout((()=>{var e;null==(e=null==o?void 0:o.endProgrammaticScroll)||e.call(o)}),i?50:700)}),0)}))}))}isProfileMobileHeaderVisible(){var e;const o=document.documentElement;return o.hasAttribute("data-core-header-fixed")&&(null==(e=t.coreHeader)?void 0:e.hasAttribute("data-header-visible"))&&!o.classList.contains("is-nav-open")}getProfileNavStickyTop(){var e,o;if(this.isProfileMobileHeaderVisible()){const i=null==(o=null==(e=t.coreHeader)?void 0:e.getBoundingClientRect())?void 0:o.bottom;return Number.isFinite(i)&&i>0?i:parseFloat(getComputedStyle(document.body).getPropertyValue("--profile-nav-header-space"))||0}return parseFloat(getComputedStyle(document.body).getPropertyValue("--profile-nav-sticky-top"))||0}getProfileNavPinScrollY(){const e=this.profileNavStickySentinel;if(!(e instanceof HTMLElement))return null;const o=window.scrollY||document.documentElement.scrollTop,t=e.getBoundingClientRect().top+o;return Math.max(0,t-this.getProfileNavStickyTop())}getMobileProfileNavChromeBottom({headerVisible:e=!1}={}){const o=this.profileNav;if(!(o instanceof HTMLElement))return 0;
1const t=getComputedStyle(o),i=parseFloat(t.marginBottom)||0,r=this.profileSections instanceof Element?getComputedStyle(this.profileSections):null,l=r&&parseFloat(r.marginTop)||0,s=getComputedStyle(document.body),n=parseFloat(s.getPropertyValue("--profile-nav-sticky-top"))||0,a=parseFloat(s.getPropertyValue("--profile-nav-header-space"))||0;return(e?a:Math.max(n,0))+o.offsetHeight+i+l}getMobileProfileSectionScrollTop(){var e,o;const t=this.getProfileNavPinScrollY();if(null!==t)return t;const i=null!=(o=null==(e=this.profileSections)?void 0:e.querySelector(".profile-section"))?o:this.profileSections;if(!(i instanceof Element))return null;const r=window.scrollY||document.documentElement.scrollTop,l=i.getBoundingClientRect().top+r,s=this.isProfileMobileHeaderVisible();return Math.max(0,l-this.getMobileProfileNavChromeBottom({headerVisible:s}))}hideProfileSectionsForIncomingUrl(e){if(!(this.profileSections&&e instanceof URL))return;const o=new URL(window.location.href);e.origin===o.origin&&e.pathname!==o.pathname&&(this.profileSections.style.pointerEvents="none",this._profileSectionsPointerResetTimer&&window.clearTimeout(this._profileSectionsPointerResetTimer),this._profileSectionsPointerResetTimer=window.setTimeout((()=>{this._profileSectionsPointerResetTimer=null,this.clearProfileSectionsPointerEvents()}),2500))}getProfileSectionTransitionDirection(e){var o,t;const i=(null==(t=null==(o=this.root)?void 0:o.dataset)?void 0:t.requestedPage)||"portfolio",r=j.indexOf(i),l=j.indexOf(e);return-1===r||-1===l||r===l||l>r?1:-1}showProfileSectionLoader({animateSectionOut:e=!0,force:i=!1,transitionDirection:r=1}={}){var l,s,n,a;const c=null==(s=null==(l=this.root)?void 0:l.querySelector)?void 0:s.call(l,".profile-sections");if(!(c instanceof HTMLElement))return Promise.resolve();if(this._profileSectionLoadingPromise&&!i)return this._profileSectionLoadingPromise;this.removeProfileSectionLoader({immediate:!0});const f=document.createElement("div");f.className="profile-section-loader",f.setAttribute("role","status"),f.setAttribute("aria-live","polite");const d=document.createElement("span");d.className="profile-section-loader-spinner",d.setAttribute("aria-hidden","true");const h=document.createElement("span");if(h.className="sr-only",h.textContent="Loading profile section",f.append(d,h),f.style.setProperty("--profile-section-loader-left",`${c.offsetLeft}px`),f.style.setProperty("--profile-section-loader-top",`${c.offsetTop}px`),c.after(f),this._profileSectionLoader=f,null==(a=null==(n=this.root)?void 0:n.classList)||a.add("is-profile-section-loading"),t.isReducedMotion)return e&&(c.style.opacity="0"),this._profileSectionLoadingPromise=Promise.resolve().finally((()=>{this._profileSectionLoadingPromise=null})),this._profileSectionLoadingPromise;const u=[new Promise((e=>{o.fromTo(f,{autoAlpha:0},{autoAlpha:1,duration:.12,delay:.08,ease:"sine.out",clearProps:"opacity,visibility",onComplete:e})}))];return e&&u.unshift(this.animateProfileSectionOut(c,r)),this._profileSectionLoadingPromise=Promise.all(u).finally((()=>{this._profileSectionLoadingPromise=null})),this._profileSectionLoadingPromise}removeProfileSectionLoader({immediate:e=!1}={}){var i,r;const l=this._profileSectionLoader;if(null==(r=null==(i=this.root)?void 0:i.classList)||r.remove("is-profile-section-loading"),this._profileSectionLoader=null,!(l instanceof HTMLElement))return Promise.resolve();const s=()=>{l.remove()};return e||t.isReducedMotion?(s(),Promise.resolve()):new Promise((e=>{o.to(l,{autoAlpha:0,duration:.1,ease:"sine.out",onComplete:()=>{s(),e()}})}))}async swapProfileSectionFromIncomingView(e,{target:i,properties:r,isPopstate:l,transitionDirection:s=1}){var n,a;const c=e.querySelector(".profile-sections"),f=null==(a=null==(n=this.root)?void 0:n.querySelector)?void 0:a.call(n,".profile-sections");if(!(c instanceof HTMLElement&&f instanceof HTMLElement))throw new Error("Profile section markup missing.");const d=c.cloneNode(!0);this.patchProfileShellFromIncomingView(e,i,{patchBelowNavCtas:!1,syncSessionChrome:!1}),await this.teardownCurrentProfileSection(),f.replaceWith(d),this.profileSections=d,this.refreshProfileSectionReferences(),this.patchBelowProfileNavCtas(e,{animateReveal:!0}),S(this.root),this.hydrateSwappedProfileSection({properties:r,isPopstate:l}),this.revealPendingBelowProfileNavCtas(),this.removeProfileSectionLoader();if(B.isDesktop()&&!t.isReducedMotion&&("portfolio"===i.subpage||"about"===i.subpage))return d.style.removeProperty("pointer-events"),o.set(d,{autoAlpha:1,x:0,clearProps:"opacity,visibility,transform"}),void this.playProfileEnterReveal({includeShell:!1}).then((()=>{"portfolio"===i.subpage&&(this.releaseProfilePortfolioPauseIndicators(),this.nudgeVisibleProfilePortfolioAutoplayVideos())}));this.animateProfileSectionIn(d,s)}patchProfileShellFromIncomingView(e,o,{patchBelowNavCtas:t=!0,syncSessionChrome:i=!0}={}){this.root instanceof Element&&(this.root.dataset.requestedPage=e.dataset.requestedPage||(null==o?void 0:o.subpage)||"portfolio",this.syncProfileNavActiveState(
1o),t&&this.patchBelowProfileNavCtas(e),this.patchProfileMobileMeta(e),i&&S(this.root),this.syncProfileNavLinkHashes(),this.centerActiveProfileNavLink(),this.syncProfileNavActivePill())}syncProfileNavActiveState(e){this.profileNav&&e&&this.profileNav.querySelectorAll(".profile-nav-button[href]").forEach((o=>{if(!(o instanceof HTMLAnchorElement))return;const t=g(o.href);o.classList.toggle("is-active",Boolean(t&&t.username===e.username&&t.subpage===e.subpage))}))}patchBelowProfileNavCtas(e,{animateReveal:o=!1}={}){var t,i,r,l;const s=null==(i=null==(t=this.root)?void 0:t.querySelector)?void 0:i.call(t,".profile-nav-ctas.is-below-profile-nav"),n=e.querySelector(".profile-nav-ctas.is-below-profile-nav");if(n){const e=n.cloneNode(!0);if(o&&e instanceof HTMLElement&&(e.dataset.profileNavCtaPendingReveal="true",e.style.opacity="0",e.style.visibility="hidden",e.style.transform="none"),s)s.replaceWith(e);else{const o=null==(l=null==(r=this.root)?void 0:r.querySelector)?void 0:l.call(r,".profile-sections");null==o||o.before(e)}}else null==s||s.remove()}revealPendingBelowProfileNavCtas(){var e,i;const r=null==(i=null==(e=this.root)?void 0:e.querySelector)?void 0:i.call(e,'.profile-nav-ctas.is-below-profile-nav[data-profile-nav-cta-pending-reveal="true"]');return r instanceof HTMLElement?(delete r.dataset.profileNavCtaPendingReveal,t.isReducedMotion?(r.style.removeProperty("opacity"),r.style.removeProperty("visibility"),r.style.removeProperty("transform"),Promise.resolve()):new Promise((e=>{o.fromTo(r,{autoAlpha:0},{autoAlpha:1,duration:.16,ease:"sine.out",clearProps:"opacity,visibility,transform",onComplete:e})}))):Promise.resolve()}patchProfileMobileMeta(e){var o,t;const i=null==(t=null==(o=this.root)?void 0:o.querySelector)?void 0:t.call(o,".profile-mobile-meta"),r=e.querySelector(".profile-mobile-meta");i&&r&&i.replaceWith(r.cloneNode(!0))}async teardownCurrentProfileSection(){this.socialPostForm&&(await this.socialPostForm.destroy(),this.socialPostForm=null),this._profileSocialFormObserver&&(this._profileSocialFormObserver.disconnect(),this._profileSocialFormObserver=null),this.destroyProfileSocialPosts(),this.teardownProfilePortfolioCoverVideos(),this.destroyProfileVideos(),y(),this.profileSections&&(a(this.profileSections),E(this.profileSections))}refreshProfileSectionReferences(){const e=this.root instanceof Element?this.root:document;this.dataCounts=e.querySelectorAll("[data-count]"),this.socialPostFormContainer=e.querySelector(".social-post-form"),this.profileSections=e.querySelector(".profile-sections"),this.profilePortfolioSection=e.querySelector("#profile-portfolio"),this.profileVideos=e.querySelectorAll('video[data-profile-video="true"][data-video-src]'),this._profileMetricsHydratePromise=null,this.profilePortfolioFadeReadyHandler=null,this.profilePortfolioHoverVideoCleanupFns=[],this.profilePortfolioVideoObserver=null,this.profilePortfolioHoverVideoObserver=null}hydrateSwappedProfileSection(){var e,o,t,i,s;const n=this.root instanceof Element?this.root:document;this.primeProfileSocialLoadMoreSentinel();try{null==(t=(o=c).process)||t.call(o,null!=(e=this.profileSections)?e:n)}catch(a){}null==(s=null==(i=window.__okaydevServdFinalizeRenderer)?void 0:i.hydrateServdDynamicBlocks)||s.call(i,!0,n),delete this.root.dataset.viewCountIncrementClient,r(n),l(n),P(n,{singleClientAttempt:!0,skipOptimistic:!0,buttonSelector:"[data-profile-view-count-button]",metricLabel:"Visitors"}),this.hydrateProfileMetrics(),this.dataCounts&&this.formatCounts(),this.ensureProfileSocialPostForm(),this.watchProfileSocialPostFormMount(),this.ensureProfileSocialPosts(),this.syncProfileFeedItems(),this.initProfileFeedVideoPlayers(),this.bindProfileFeedShareButtons(),this.scheduleProfilePortfolioFade(),this.initProfileVideos(),this.initProfilePortfolioCoverVideos(),R(n),S(n),this.syncProfileNavLinkHashes(),this.centerActiveProfileNavLink(),this.syncProfileNavActivePill(),m(),f(),requestAnimationFrame((()=>{S(n),this.ensureProfileSocialPostForm(),this.ensureProfileSocialPosts(),this.initProfileFeedVideoPlayers(),this.bindProfileFeedShareButtons(),this.refreshProfilePortfolioCoverVideos(),this.centerActiveProfileNavLink(),this.syncProfileNavActivePill()}))}primeProfileSocialLoadMoreSentinel(){var e,o;const t=null==(o=null==(e=this.profileSections)?void 0:e.querySelector)?void 0:o.call(e,"#profile-social #load-more-oob[data-social-load-more-deferred]");t instanceof Element&&(t.setAttribute("s-trigger","revealed"),t.removeAttribute("data-social-load-more-deferred"),t.removeAttribute("data-hx-revealed"))}animateProfileSectionOut(e,i=1){return!t.isReducedMotion&&e instanceof HTMLElement?new Promise((t=>{o.to(e,{autoAlpha:0,x:-18*i,duration:.16,ease:"sine.inOut",force3D:!0,onComplete:t})})):Promise.resolve()}animateProfileSectionIn(e,i=1){return e instanceof HTMLElement?t.isReducedMotion?(e.style.removeProperty("pointer-events"),Promise.resolve()):(o.set(e,{autoAlpha:0,x:18*i,force3D:!0}),new Promise((t=>{o.to(e,{autoAlpha:1,x:0,duration:.18,ease:"sine.out",force3D:!0,clearProps:"opacity,visibility,transform",onComplete:t})}))):Promise.resolve()}initProfileNavStickySentinel(){if(this.destroyProfileNavStickySentinel(),!this.profileNav)return;if(!window.matchMedia("(max-width: 1023px)").matches)return;const e=document.createElement("div");
1e.className="profile-nav-sticky-sentinel",e.setAttribute("aria-hidden","true"),this.profileNav.before(e),this.profileNavStickySentinel=e,this.profileNavStickyObserver=new IntersectionObserver((([e])=>{document.body.classList.toggle("is-profile-nav-stuck",!e.isIntersecting)}),{threshold:0}),this.profileNavStickyObserver.observe(e)}destroyProfileNavStickySentinel(){var e,o;null==(e=this.profileNavStickyObserver)||e.disconnect(),this.profileNavStickyObserver=null,null==(o=this.profileNavStickySentinel)||o.remove(),this.profileNavStickySentinel=null,document.body.classList.remove("is-profile-nav-stuck")}syncProfileNavLinkHashes(){var e,o,t;this.profileNavLinks=null!=(o=null==(e=this.profileNav)?void 0:e.querySelectorAll(".profile-nav-button[href]"))?o:[],null==(t=this.profileNav)||t.querySelectorAll(".profile-nav-button[href]").forEach((e=>{if(!(e instanceof HTMLAnchorElement))return;const o=new URL(e.href,window.location.origin);o.origin===window.location.origin&&/^\/u\/[^/]+\/(?:portfolio|about|social|likes|bookmarks)\/?$/i.test(o.pathname)&&(o.hash="",e.href=`${o.pathname}${o.search}${o.hash}`)}))}scheduleProfileNavActivePillSync(){this.profileNavActivePillFrame||(this.profileNavActivePillFrame=window.requestAnimationFrame(this.syncProfileNavActivePill))}ensureProfileNavActivePill(){var e;const o=null==(e=this.profileNav)?void 0:e.querySelector("ul");if(!o)return this.profileNavActivePill=null,null;let t=o.querySelector(":scope > .profile-nav-active-pill");return t||(t=document.createElement("span"),t.className="profile-nav-active-pill",t.setAttribute("aria-hidden","true"),o.appendChild(t)),this.profileNavActivePill=t,t}syncProfileNavActivePill(){var e,o,t,i,r,l,s,n,a,c,f,d,h;this.profileNavActivePillFrame=null;const u=null==(e=this.profileNav)?void 0:e.querySelector("ul"),p=null==(o=this.profileNav)?void 0:o.querySelector(".profile-nav-button.is-active"),v=this.ensureProfileNavActivePill();if(!(u instanceof HTMLElement&&p instanceof HTMLElement&&v))return null==(t=null==u?void 0:u.style)||t.setProperty("--profile-nav-active-pill-opacity","0"),null==(r=null==(i=this.profileNav)?void 0:i.classList)||r.remove("is-active-pill-ready"),void(null==(s=null==(l=this.profileNav)?void 0:l.classList)||s.remove("is-active-pill-animated"));const P=u.getBoundingClientRect(),m=p.getBoundingClientRect();u.style.setProperty("--profile-nav-active-pill-x",`${m.left-P.left+u.scrollLeft}px`),u.style.setProperty("--profile-nav-active-pill-y",`${m.top-P.top+u.scrollTop}px`),u.style.setProperty("--profile-nav-active-pill-width",`${m.width}px`),u.style.setProperty("--profile-nav-active-pill-height",`${m.height}px`);(null==(a=null==(n=this.profileNav)?void 0:n.classList)?void 0:a.contains("is-enter-nav-pending"))?u.style.setProperty("--profile-nav-active-pill-opacity","0"):(u.style.setProperty("--profile-nav-active-pill-opacity","1"),null==(f=null==(c=this.profileNav)?void 0:c.classList)||f.add("is-active-pill-ready"),(null==(h=null==(d=this.profileNav)?void 0:d.classList)?void 0:h.contains("is-active-pill-animated"))||requestAnimationFrame((()=>{var e,o;null==(o=null==(e=this.profileNav)?void 0:e.classList)||o.add("is-active-pill-animated")})))}centerActiveProfileNavLink(){var e,o;if(!this.profileNav||window.innerWidth>1023)return;const t=this.profileNav.querySelector(".profile-nav-button.is-active");if(!t)return;const i=t.closest("li"),r=i===(null==(e=null==i?void 0:i.parentElement)?void 0:e.firstElementChild),l=i===(null==(o=null==i?void 0:i.parentElement)?void 0:o.lastElementChild);this.profileNav.classList.toggle("is-active-first",r),this.profileNav.classList.toggle("is-active-last",l);const s=this.profileNav.querySelector("ul"),n=s&&"visible"!==window.getComputedStyle(s).overflowX?s:this.profileNav,a=n.getBoundingClientRect(),c=t.getBoundingClientRect();if(r)return void n.scrollTo({left:0,top:0,behavior:"auto"});if(l){const e=window.getComputedStyle(i),o=parseFloat(e.marginRight)||0;return void n.scrollTo({left:Math.max(0,n.scrollLeft+c.right-(a.right-o)),top:0,behavior:"auto"})}const f=n.scrollLeft+c.left-a.left-(a.width-c.width)/2;n.scrollTo({left:Math.max(0,f),top:0,behavior:"auto"})}hideProfileSectionsForIncomingNav(e){this.profileSections&&e instanceof HTMLAnchorElement&&this.hideProfileSectionsForIncomingUrl(new URL(e.href,window.location.origin))}handleProfileNavLinkPointerDown(e){0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(this.syncProfileNavLinkHashes(),this.hideProfileSectionsForIncomingNav(e.currentTarget))}handleProfileNavLinkKeyDown(e){e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||"Enter"!==e.key&&" "!==e.key||(this.syncProfileNavLinkHashes(),this.hideProfileSectionsForIncomingNav(e.currentTarget))}hydrateProfileVideo(e){if(!e||"true"===e.dataset.videoHydrated)return;const o=e.dataset.videoSrc;o&&(e.src=o,e.load(),e.dataset.videoHydrated="true")}destroyProfileVideos(){this.profileVideoObserver&&(this.profileVideoObserver.disconnect(),this.profileVideoObserver=null)}initProfilePortfolioCoverVideos(){this.profilePortfolioSection&&("IntersectionObserver"in window?(this.initProfilePortfolioVideoObserver(),this.initProfilePortfolioHoverVideoObserver(),this.refreshProfilePortfolioCoverVideos()):this.profilePortfolioSection.querySelectorAll('video[playsinline][data-profile-portfolio-autoplay-once="true"]').forEach((e=>{this.syncProfilePortfolioAutoplayOncePlayback(e)})))}refreshProfilePortfolioCoverVideos(){const e=this.root instanceof Element?this.root:document;this.profilePortfolioSection=e.querySelector("#profile-portfolio"),this.profilePortfolioSection&&("true"===this.profilePortfolioSection.dataset.fadeCompleted&&this.releaseProfilePortfolioPauseIndicators(),this.revealProfilePortfolioCoverImages(),this.observeProfilePortfolioVisibleVideos(),this.initProfilePortfolioHoverVideos(),this.nudgeVisibleProfilePortfolioAutoplayVideos())}revealProfilePortfolioCoverImages(){M(this.profilePortfolioSection)}teardownProfilePortfolioCoverVideos(){var e,o;
1this.profilePortfolioPosterRestoreTimeouts.forEach((e=>{clearTimeout(e)})),this.profilePortfolioPosterRestoreTimeouts.clear(),this.profilePortfolioHoverVideoCleanupFns.forEach((e=>e())),this.profilePortfolioHoverVideoCleanupFns=[],null==(e=this.profilePortfolioHoverVideoObserver)||e.disconnect(),null==(o=this.profilePortfolioVideoObserver)||o.disconnect(),this.profilePortfolioHoverVideoObserver=null,this.profilePortfolioVideoObserver=null,this.profilePortfolioSection&&a(this.profilePortfolioSection)}initProfilePortfolioVideoObserver(){this.profilePortfolioVideoObserver||(this.profilePortfolioVideoObserver=new IntersectionObserver((e=>{e.forEach((e=>{const o=e.target;if(o instanceof HTMLVideoElement)if(e.isIntersecting){if(d(o))return void o.pause();this.syncProfilePortfolioAutoplayOncePlayback(o)}else k(o)}))}),{threshold:[0,.1,.25,.5],rootMargin:"0px 0px 10% 0px"}))}initProfilePortfolioHoverVideoObserver(){this.profilePortfolioHoverVideoObserver||(this.profilePortfolioHoverVideoObserver=new IntersectionObserver((e=>{e.forEach((e=>{const o=e.target,t=o.closest(".project-cover");if(o instanceof HTMLVideoElement&&t)if(o.dataset.profilePortfolioHoverVisible=e.isIntersecting?"true":"false",e.isIntersecting){if(d(o))return void o.pause();this.ensureProfilePortfolioVideoSource(o),this.syncProfilePortfolioHoverVideoPlaybackState(o,t)}else this.pauseProfilePortfolioVideoToPoster(o,t)}))}),{threshold:[0,.1,.25,.5],rootMargin:"0px 0px 10% 0px"}))}observeProfilePortfolioVisibleVideos(){this.profilePortfolioSection&&this.profilePortfolioVideoObserver&&this.profilePortfolioSection.querySelectorAll('video[playsinline][data-profile-portfolio-autoplay-once="true"]:not([data-profile-portfolio-autoplay-observed])').forEach((e=>{e.setAttribute("data-profile-portfolio-autoplay-observed","true"),this.profilePortfolioVideoObserver.observe(e)}))}nudgeVisibleProfilePortfolioAutoplayVideos(){this.profilePortfolioSection&&this.profilePortfolioSection.querySelectorAll('video[playsinline][data-profile-portfolio-autoplay-once="true"]').forEach((e=>{if(!(e instanceof HTMLVideoElement)||d(e))return;const o=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight||0;o.width>0&&o.height>0&&o.bottom>0&&o.top<t&&this.syncProfilePortfolioAutoplayOncePlayback(e)}))}syncProfilePortfolioAutoplayOncePlayback(e){e instanceof HTMLVideoElement&&"true"===e.dataset.profilePortfolioAutoplayOnce&&V(e)&&(d(e)||e.ended||(e.loop=!1,e.removeAttribute("loop"),this.ensureProfilePortfolioVideoSource(e,{preload:"auto"}),e.paused&&(e.dataset.profilePortfolioAutoplayOnceStarted="true",e.play().catch((()=>{})))))}initProfilePortfolioHoverVideos(){this.profilePortfolioSection&&this.profilePortfolioHoverVideoObserver&&(m(),this.profilePortfolioSection.querySelectorAll('video[playsinline][data-gallery-hover-video="true"]').forEach((e=>{if(!(e instanceof HTMLVideoElement))return;const o=e.closest(".project-cover");if(!o)return;const t=()=>{const t=!e.paused&&!e.ended;t&&this.cancelDeferredProfilePortfolioPosterRestore(e),o.classList.toggle("is-video-playing",t)},i=()=>{e.loop=!1,e.removeAttribute("loop"),"true"===e.dataset.profilePortfolioAutoplayOnce&&(e.dataset.profilePortfolioAutoplayOnceCompleted="true");const t=o.matches(".is-hover-intent, :focus, :focus-within, .is-gallery-touch-active");"true"===e.dataset.profilePortfolioHoverReplayLoop&&t&&(e.dataset.profilePortfolioHoverPlayConsumed="true"),this.pauseProfilePortfolioVideoToPoster(e,o)};o.dataset.profilePortfolioHoverPlaybackBound||(o.addEventListener("mouseleave",this.handleProfilePortfolioHoverCardLeave),o.addEventListener("focusout",this.handleProfilePortfolioHoverCardFocusOut),o.addEventListener(h,this.handleProfilePortfolioHoverCardEnter),o.dataset.profilePortfolioHoverPlaybackBound="true",this.profilePortfolioHoverVideoCleanupFns.push((()=>{o.removeEventListener("mouseleave",this.handleProfilePortfolioHoverCardLeave),o.removeEventListener("focusout",this.handleProfilePortfolioHoverCardFocusOut),o.removeEventListener(h,this.handleProfilePortfolioHoverCardEnter),delete o.dataset.profilePortfolioHoverPlaybackBound}))),"true"!==e.dataset.profilePortfolioHoverObserved&&(e.dataset.profilePortfolioHoverVisible="false",this.profilePortfolioHoverVideoObserver.observe(e),e.addEventListener("play",t),e.addEventListener("pause",t),e.addEventListener("ended",i),e.setAttribute("data-profile-portfolio-hover-observed","true"),t(),this.profilePortfolioHoverVideoCleanupFns.push((()=>{var o;null==(o=this.profilePortfolioHoverVideoObserver)||o.unobserve(e),e.removeEventListener("play",t),e.removeEventListener("pause",t),e.removeEventListener("ended",i),delete e.dataset.profilePortfolioHoverObserved,delete e.dataset.profilePortfolioHoverVisible,delete e.dataset.profilePortfolioHoverPlayConsumed,delete e.dataset.profilePortfolioHoverPlaybackActive,delete e.dataset.profilePortfolioAutoplayOnceCompleted,delete e.dataset.profilePortfolioAutoplayOnceStarted,delete e.dataset.listingCoverViewportAutoplayConsumed})))})))}ensureProfilePortfolioVideoSource(e,{preload:o="metadata"}={}){if(!(e instanceof HTMLVideoElement))return;const t=e.dataset.videoSrc;if(!t)return;if("true"===e.dataset.videoHydrated)return;const i=e.getAttribute("src");if(null!==i&&""!==i)return e.preload&&"none"!==e.preload&&"metadata"!==e.preload||(e.preload=o),void(e.dataset.videoHydrated="true");e.preload=o,e.src=t,e.load(),e.dataset.videoHydrated="true"}syncProfilePortfolioCardPlaybackState(e){e&&e.querySelectorAll('video[playsinline][data-gallery-hover-video="true"]').forEach((o=>{this.syncProfilePortfolioHoverVideoPlaybackState(o,e)}))}syncProfilePortfolioHoverVideoPlaybackState(e,o){if(!(e instanceof HTMLVideoElement&&o))return;const t="true"===e.dataset.profilePortfolioHoverReplayLoop;if(t&&(e.loop=!1,e.removeAttribute("loop")),d(e))return e.paused||e.pause(),void(t&&(e.loop=!1));const i="true"===e.dataset.profilePortfolioHoverVisible,r=o.matches(".is-hover-intent, :focus, :focus-within, .is-gallery-touch-active");
1if(t){if(i&&r){if(this.cancelDeferredProfilePortfolioPosterRestore(e),this.ensureProfilePortfolioVideoSource(e,{preload:"auto"}),"true"===e.dataset.profilePortfolioHoverPlayConsumed)return;return T(e),void(e.paused&&(e.dataset.profilePortfolioHoverPlaybackActive="true",e.play().catch((()=>{}))))}return i?void("true"===e.dataset.profilePortfolioHoverPlaybackActive&&(delete e.dataset.profilePortfolioHoverPlayConsumed,delete e.dataset.profilePortfolioHoverPlaybackActive,this.pauseProfilePortfolioVideoToPoster(e,o))):(delete e.dataset.profilePortfolioHoverPlayConsumed,delete e.dataset.profilePortfolioHoverPlaybackActive,void this.pauseProfilePortfolioVideoToPoster(e,o))}if(i&&r&&!e.ended)return this.cancelDeferredProfilePortfolioPosterRestore(e),this.ensureProfilePortfolioVideoSource(e,{preload:"auto"}),void(e.paused&&e.play().catch((()=>{})));this.pauseProfilePortfolioVideoToPoster(e,o)}pauseProfilePortfolioVideoToPoster(e,o=(null==e?void 0:e.closest(".project-cover"))){var t;if(!(e instanceof HTMLVideoElement))return;e.paused||e.pause();if(Boolean(null==(t=null==o?void 0:o.querySelector)?void 0:t.call(o,".project-video-poster"))&&o)return o.classList.toggle("is-video-playing",!1),void this.scheduleDeferredProfilePortfolioPosterRestore(e);q(e),null==o||o.classList.toggle("is-video-playing",!e.paused&&!e.ended)}cancelDeferredProfilePortfolioPosterRestore(e){if(!(e instanceof HTMLVideoElement))return;const o=this.profilePortfolioPosterRestoreTimeouts.get(e);null!=o&&(clearTimeout(o),this.profilePortfolioPosterRestoreTimeouts.delete(e))}scheduleDeferredProfilePortfolioPosterRestore(e){if(!(e instanceof HTMLVideoElement))return;this.cancelDeferredProfilePortfolioPosterRestore(e);const o=window.setTimeout((()=>{var o;if(this.profilePortfolioPosterRestoreTimeouts.delete(e),"true"===e.dataset.profilePortfolioHoverVisible){const t=e.closest(".project-cover");if((null==(o=null==t?void 0:t.matches)?void 0:o.call(t,".is-hover-intent, :focus-within, .is-gallery-touch-active"))&&"true"!==e.dataset.profilePortfolioHoverPlayConsumed&&!e.ended)return}q(e)}),350);this.profilePortfolioPosterRestoreTimeouts.set(e,o)}handleProfilePortfolioHoverCardEnter(e){this.syncProfilePortfolioCardPlaybackState(e.currentTarget)}handleProfilePortfolioHoverCardLeave(e){this.syncProfilePortfolioCardPlaybackState(e.currentTarget)}handleProfilePortfolioHoverCardFocusIn(e){this.syncProfilePortfolioCardPlaybackState(e.currentTarget)}handleProfilePortfolioHoverCardFocusOut(e){const o=e.currentTarget;(null==o?void 0:o.contains(e.relatedTarget))||(o.classList.remove("is-gallery-touch-active"),this.syncProfilePortfolioCardPlaybackState(o))}}const $=K;let U;class W extends e{onEnter(){this.ensureSocialPostsForPjaxEnter(),super.onEnter()}async onLeave(){if(U)try{await U.stopPage()}finally{U=null}await super.onLeave()}onEnterCompleted(){var e,o;super.onEnterCompleted(),U=new $(null!=(e=H(this.wrap,"profile"))?e:document.querySelector('[data-router-view="profile"]')),null==(o=this.socialPosts)||o.bootstrapSocialLoadMoreWhenReady()}onLeaveCompleted(){super.onLeaveCompleted()}}export{W as default};

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.