PageSourceSearch

https://okaydev.co/dist/assets/social-post-renderer-CgGWpVdq.js

js okaydev.co collected 2026-10-03 23:31:50 UTC 3,561 bytes, 1 lines download raw bytes

1import{r as t,D as e}from"./default-renderer-B6hd38wO.js";/* empty css               *//* empty css                        *//* empty css                         */import{T as s,b as o,f as i,h as r,X as a}from"./HeaderLogoLetters-CMLHzChc.js";import n from"./SocialPostForm-zTlFOike.js";import{i as l}from"./incrementEntryViewCountFromPage-B4JYzT2Z.js";import{s as m}from"./lazyDialog-CU88mIO4.js";import{i as c,e as h}from"./SocialPosts-Sl2W8KRq.js";import"./app-BiaPDw27.js";import"./refreshNavbarAuth-V-4DhXEm.js";import"./SplitText-VLUCmDhw.js";import"./distributeProjectAuthorCard-W_A8WnxX.js";import"./selectedMemberElement-BIB-k0h5.js";import"./loadEmojiPicker-CsEuOpyk.js";import"./mediaUploadStatusError-Wg01TlmW.js";import"./output-BQAQukZ9.js";import"./videoPosterMediabunny-za3M6-YY.js";import"./patchCommentsProtect-0fppbX_Y.js";const d=class{constructor(){this.initVars(),this.initPage()}initVars(){this.socialPostItem=document.querySelector(".social-post-item"),this.currentUserId=this.socialPostItem.dataset.uid||"guest",this.storageKey=`okaydev-social-theme-${this.currentUserId}`,this.savedTheme=localStorage.getItem(this.storageKey),this.socialPostFormContainer=document.querySelector(".social-post-form-container"),this.commentsObserver=null}initPage(){var e;s.setMode(t(this.currentUserId),{animate:!1}),this.socialPostFormContainer&&(this.socialPostForm=new n),l(null!=(e=this.socialPostItem)?e:document,{singleClientAttempt:!0}),this.bootstrapPostMetrics(),this.addListeners(),this.initComments()}addListeners(){o(this,["afterSettle"]),"undefined"!=typeof htmx&&htmx.on("htmx:afterSettle",this.afterSettle)}removeListeners(){"undefined"!=typeof htmx&&htmx.off("htmx:afterSettle",this.afterSettle)}async bootstrapPostMetrics(){var t;await i().catch((()=>{})),m(),await r(null!=(t=this.socialPostItem)?t:document)}afterSettle(t){var e,s;const o=a((null==(e=null==t?void 0:t.detail)?void 0:e.target)||(null==(s=null==t?void 0:t.detail)?void 0:s.elt));r(o)}async stopPage(){this.removeListeners(),this.socialPostForm&&await this.socialPostForm.destroy()}initComments(){const t=document.querySelector(".social-post-item");if(!t)return;c(t,{onReady:t=>{this.scheduleHighlightCodeBlocks(t);const e=t.querySelector(".social-comments");e&&this.observeCommentsContainer(e)}}),this.scheduleHighlightCodeBlocks(t);const e=t.querySelector(".social-comments");e&&this.observeCommentsContainer(e)}observeCommentsContainer(t){t&&!this.commentsObserver&&(this.scheduleHighlightCodeBlocks(t),this.commentsObserver=new MutationObserver((t=>{for(const e of t)e.addedNodes.forEach((t=>{var e,s;t instanceof Element&&((null==(e=t.matches)?void 0:e.call(t,"pre code"))||(null==(s=t.querySelector)?void 0:s.call(t,"pre code")))&&this.scheduleHighlightCodeBlocks(t)}))})),this.commentsObserver.observe(t,{childList:!0,subtree:!0}))}scheduleHighlightCodeBlocks(t){if(!t)return;const e=()=>{this.highlightCodeBlocks(t)};e(),"function"==typeof requestAnimationFrame&&requestAnimationFrame(e),setTimeout(e,50),setTimeout(e,250)}highlightCodeBlocks(t){const e=window.hljs;if(!e||!t||!t.querySelectorAll)return;const s=[...t.querySelectorAll("pre code")].filter((t=>!t.classList.contains("hljs")&&!t.dataset.highlighted));s.length&&h().then((()=>{s.forEach((t=>{try{e.highlightElement(t)}catch(s){}}))})).catch((()=>{}))}};let u;class p extends e{onEnter(){super.onEnter()}async onLeave(){if(super.onLeave(),u)try{await u.stopPage()}finally{u=null}}onEnterCompleted(){super.onEnterCompleted(),u=new d}onLeaveCompleted(){super.onLeaveCompleted()}}export{p 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.