PageSourceSearch

https://selebox.com/js/writer/social-story/progress.js?v=social-account-v2

js selebox.com collected 2026-10-07 23:58:18 UTC 1,557 bytes, 6 lines download raw bytes

1import {initialCursor} from './playback.js?v=social-story-20260926';
2const key=s=>'social_story_position:'+JSON.stringify([s.readerId||'guest',s.bookId,s.chapterId]);
3export function contentRevision(html){let h=2166136261;for(let i=0;i<html.length;i++){h^=html.charCodeAt(i);h=Math.imul(h,16777619);}return String(html.length)+':'+(h>>>0).toString(16);}
4export function validCursor(doc,c){const e=doc.events.find(e=>e.id===c?.eventId);if(!e)return !doc.events.length&&c?.eventId===null;if(!['feed','notification','dm'].includes(c.mode))return false;if(e.kind==='incoming_message')return c.mode==='notification'&&!c.messageId;if(e.kind==='conversation'){const t=doc.threads.find(t=>t.id===e.threadId);return c.mode==='feed'&&!c.messageId||['feed','dm'].includes(c.mode)&&t.messages.some(m=>m.id===c.messageId);}return c.mode==='feed'&&!c.messageId;}
5export function loadSocialProgress(scope){const first={cursor:initialCursor(scope.doc)};try{const saved=JSON.parse(localStorage.getItem(key(scope)));if(!saved)return first;if(saved.schemaVersion!==1||saved.revision!==scope.revision)return {...first,resetReason:'This chapter was updated. Start again to see the changes.'};if(!validCursor(scope.doc,saved.cursor))return {...first,resetReason:'Your previous position is no longer available. Starting this chapter again.'};return {cursor:saved.cursor};}catch{return first;}}
6export function saveSocialProgress(scope,cursor){try{localStorage.setItem(key(scope),JSON.stringify({schemaVersion:1,revision:scope.revision,cursor}));return true;}catch{return false;}}

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.