PageSourceSearch

https://www.ottohub.cn/assets/useMdBreakpoint-sp9hdkzY.js

js ottohub.cn collected 2026-10-06 13:14:40 UTC 2,484 bytes, 1 lines download raw bytes

1import{H as e,T as t,U as n,it as r,n as i}from"./vendor-vue-Bu-KQjoC.js";import{ot as a,st as o}from"./index-BE2-dWra.js";function s(e,t=0){let n=()=>e();if(t>0){window.setTimeout(n,t);return}typeof window.requestIdleCallback==`function`?window.requestIdleCallback(n,{timeout:400}):window.setTimeout(n,16)}function c(e){window.requestAnimationFrame(()=>{window.requestAnimationFrame(e)})}var l=10;function u(e,t,n){let r=new Set(e.map(n)),i=t.filter(e=>!r.has(n(e)));return[...e,...i]}function d(e,t,n,r){return e===1?u(t,n,r):n}function f(e){let{t:n}=i(),s=o(),c=a(),u=r(null),d=t(()=>{let t=s.activeAccount?.uid,n=e.authorUid.value;return t==null||!n?!1:String(t)===String(n)}),f=t(()=>[...e.pinnedComments.value].sort((t,n)=>t.pinOrder-n.pinOrder||e.getCommentId(t).localeCompare(e.getCommentId(n)))),p=t(()=>Math.max(0,e.parentCommentCount.value-e.pinnedComments.value.length)),m=t(()=>{let t=p.value;return t<=0?+(e.pinnedComments.value.length>0):Math.ceil(t/e.pageSize.value)});function h(e){let t={pin_limit_reached:n(`comment.pin.errors.limit`),already_pinned:n(`comment.pin.errors.alreadyPinned`),pin_not_found:n(`comment.pin.errors.notFound`),not_root_comment:n(`comment.pin.errors.notRoot`),no_permission:n(`comment.pin.errors.noPermission`)};return e&&t[e]||e||n(`comment.pin.errors.failed`)}async function g(t){let r=s.activeAccount?.token,i=e.getCommentId(t);if(!(!r||!d.value||u.value)){u.value=i;try{let a=t.isPinned?await e.unpinComment(i,r):await e.pinComment(i,r);if(!a.ok){c.error(h(a.message));return}await Promise.all([e.fetchPinnedComments(),e.refreshParentComments()]),c.success(t.isPinned?n(`comment.pin.unpinSuccess`):n(`comment.pin.pinSuccess`))}finally{u.value=null}}}async function _(t,n){let r=s.activeAccount?.token,i=e.getCommentId(t);if(!r||!d.value||u.value||!t.isPinned)return;let a=f.value,o=a.findIndex(t=>e.getCommentId(t)===i);if(o<0)return;let l=o+n;if(!(l<0||l>=a.length)){u.value=i;try{let t=await e.sortPinComment(i,r,l);if(!t.ok){c.error(h(t.message));return}await e.fetchPinnedComments()}finally{u.value=null}}}return{MAX_PINNED_COMMENTS:l,pinningCommentId:u,canManagePins:d,sortedPinnedComments:f,nonPinnedCommentCount:p,parentTotalPages:m,toggleCommentPin:g,movePinnedComment:_}}function p(){let t=r(!1),i=null;function a(){t.value=i?.matches??!1}return e(()=>{i=window.matchMedia(`(min-width: 768px)`),a(),i.addEventListener(`change`,a)}),n(()=>{i?.removeEventListener(`change`,a)}),{isMd:t}}export{c as a,s as i,d as n,f as r,p as t};

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.