1import{c as e,l as t,o as n,s as r,t as i}from"./apiResponse-C8fEm_-L.js";var a=new Map,o=new Map,s=15e3;function c(e,t){return`${t?.method??`GET`}:${e}`}async function l(e,t,n){let r=c(e,t),i=t?.cache===`no-store`,l=n?.cacheMs??s;if(!i){let e=a.get(r);if(e&&e.expires>Date.now())return e.data}let u=o.get(r);if(u)return u;let d=fetch(e,t).then(async e=>{let t=await e.json();return e.ok&&!i&&a.set(r,{data:t,expires:Date.now()+l}),t}).finally(()=>{o.delete(r)});return o.set(r,d),d}function u(e){if(!e||typeof e!=`object`)return[];let t=e;if(t.status===`error`)return[];let n=t.data;if(n&&typeof n==`object`){let e=n.comment_list;if(Array.isArray(e))return e}return Array.isArray(t.comment_list)?t.comment_list:[]}var d={missing_argument:`缺å°å¿
è¦åæ°`,error_token:`æ æçç»å½åè¯`,content_too_long:`è¯è®ºå
容è¿é¿`,content_too_short:`è¯è®ºå
容è¿ç`,error_type:`åæ°ç±»åé误`,error_vid:`æ æçè§é¢ID`,error_bid:`æ æç卿ID`,error_vcid:`æ æçè§é¢è¯è®ºID`,error_bcid:`æ æç卿è¯è®ºID`,error_parent_vcid:`æ æçè¯è®ºID`,error_parent_bcid:`æ æçè¯è®ºID`,error_parent:`䏿¯æå¤å±åå¤`,warn:`è¯è®ºå
嫿æå
容ï¼å·²é审`,blocked:`已被ç¸å
³ç¨æ·æé»`,no_permission:`æ æå é¤è¯¥è¯è®º`,too_many_requests:`è¯è®ºè¿äºé¢ç¹ï¼è¯·ç¨ååè¯`,already_pinned:`该è¯è®ºå·²ç½®é¡¶`,pin_not_found:`该è¯è®ºæªç½®é¡¶`,pin_limit_reached:`置顶æ°é已达ä¸é`,not_root_comment:`ä»
å
è®¸ç½®é¡¶æ ¹è¯è®º`,system_error:`ç³»ç»é误ï¼è¯·ç¨åéè¯`};function f(e){return{isPinned:Number(e.is_pinned)===1||e.is_pinned===!0,pinOrder:Number(e.pin_order)||0}}function p(e){if(!e||typeof e!=`object`)return null;let t=e;if(t.status===`error`)return{ok:!1,message:h(t.message,`æä½å¤±è´¥`)};let n=t.data;if(!n||typeof n!=`object`)return{ok:!0,isPinned:1,pinOrder:0};let r=n;return{ok:!0,isPinned:Number(r.is_pinned)||1,pinOrder:Number(r.pin_order)||0}}async function m(e,t,r,i,a=`æä½å¤±è´¥`){try{let o=await fetch(e,{method:t,headers:{"Content-Type":`application/json`},body:JSON.stringify(i??{token:r}),cache:`no-store`}),s=await n(o);if(s&&typeof s==`object`&&s.status===`error`)return{ok:!1,message:String(s.message??``)||g(o,s,a)||a};let c=g(o,s,a);return c?{ok:!1,message:c}:p(s)??{ok:!0,isPinned:1,pinOrder:0}}catch{return{ok:!1,message:a}}}function h(e,t=`æä½å¤±è´¥`){return i(e,d,t)}function g(e,t,n=`æä½å¤±è´¥`){return r(e,t,{messages:d,fallback:n})}var _=3;function v(e){return new Promise(t=>{window.setTimeout(t,e)})}function y(e){return e.includes(`请ç¨å`)?e:`${e}ï¼è¯·ç¨åéè¯`}function b(e,t){if(e&&(e.status===408||e.status===429||e.status>=500))return!0;let n=t.toLowerCase();return n.includes(`failed to fetch`)||n.includes(`networkerror`)||n.includes(`network`)||n.includes(`too_many_requests`)||n.includes(`请æ±è¿äºé¢ç¹`)||n.includes(`ææ¶ä¸å¯ç¨`)||n.includes(`ç½å
³`)||n.includes(`gateway`)||n.includes(`unavailable`)||n.includes(`ç¨åéè¯`)}function x(e,t){return(t&&t.status===503?700:400)*(e+1)}async function S(e,t=`è·åè¯è®ºå¤±è´¥`){let r=y(t);for(let i=0;i<=_;i++)try{let a=await fetch(e,{cache:`no-store`}),o=await n(a),s=g(a,o,t);if(!s&&o!=null)return{ok:!0,data:o};if(r=s??y(t),i<_&&b(a,r)){await v(x(i,a));continue}return{ok:!1,message:r}}catch{if(r=y(t),i<_){await v(x(i,null));continue}return{ok:!1,message:r}}return{ok:!1,message:r}}function C(e,n){return t(`/api/comment/blogs/${encodeURIComponent(e)}`,{parent_bcid:n.parentBcid,offset:n.offset,num:n.num,cid_asc:n.cidAsc===void 0?void 0:+!!n.cidAsc,include_pinned:n.includePinned===!1?0:n.includePinned===!0?1:void 0,token:n.token})}async function w(t){try{let r=await fetch(`${e}/api/comment/blogs/${encodeURIComponent(t.bid)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:t.token,parent_bcid:t.parentBcid,content:t.content}),cache:`no-store`}),i=g(r,await n(r),`åéè¯è®ºå¤±è´¥ï¼è¯·ç¨åéè¯`);return i?{ok:!1,message:i}:{ok:!0}}catch{return{ok:!1,message:`åéè¯è®ºå¤±è´¥ï¼è¯·ç¨åéè¯`}}}async function T(t,n){return m(`${e}/api/comment/blog-comments/${encodeURIComponent(t)}/pin`,`POST`,n,{token:n},`置顶è¯è®ºå¤±è´¥`)}async function E(t,n){return m(`${e}/api/comment/blog-comments/${encodeURIComponent(t)}/pin`,`DELETE`,n,{token:n},`åæ¶ç½®é¡¶å¤±è´¥`)}async function D(t,n,r){return m(`${e}/api/comment/blog-comments/${encodeURIComponent(t)}/pin/sort`,`PUT`,n,{token:n,pin_order:r},`è°æ´ç½®é¡¶æåºå¤±è´¥`)}async function O(t,r){try{let i=await fetch(`${e}/api/comment/blog-comments/${encodeURIComponent(t)}`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:r}),cache:`no-store`}),a=g(i,await n(i),`å é¤è¯è®ºå¤±è´¥`);return a?{ok:!1,message:a}:{ok:!0}}catch{return{ok:!1,message:`å é¤è¯è®ºå¤±è´¥`}}}function k(e,n){return t(`/api/comment/videos/${encodeURIComponent(e)}`,{parent_vcid:n.parentVcid,offset:n.offset,num:n.num,cid_asc:n.cidAsc===void 0?void 0:+!!n.cidAsc,include_pinned:n.includePinned===!1?0:n.includePinned===!0?1:void 0,token:n.token})}async function A(t){try{let r=await fetch(`${e}/api/comment/videos/${encodeURIComponent(t.vid)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:t.token,parent_vcid:t.parentVcid,content:t.content}),cache:`no-store`}),i=g(r,await n(r),`åéè¯è®ºå¤±è´¥ï¼è¯·ç¨åéè¯`);return i?{ok:!1,message:i}:{ok:!0}}catch{return{ok:!1,message:`åéè¯è®ºå¤±è´¥ï¼è¯·ç¨åéè¯`}}}async function j(t,n){return m(`${e}/api/comment/video-comments/${encodeURIComponent(t)}/pin`,`POST`,n,{token:n},`置顶è¯è®ºå¤±è´¥`)}async function M(t,n){return m(`${e}/api/comment/video-comments/${encodeURIComponent(t)}/pin`,`DELETE`,n,{token:n},`åæ¶ç½®é¡¶å¤±è´¥`)}async function N(t,n,r){return m(`${e}/api/comment/video-comments/${encodeURIComponent(t)}/pin/sort`,`PUT`,n,{token:n,pin_order:r},`è°æ´ç½®é¡¶æåºå¤±è´¥`)}async function P(t,r){try{let i=await fetch(`${e}/api/comment/video-comments/${encodeURIComponent(t)}`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:r}),cache:`no-store`}),a=g(i,await n(i),`å é¤è¯è®ºå¤±è´¥`);return a?{ok:!1,message:a}:{ok:!0}}catch{return{ok:!1,message:`å é¤è¯è®ºå¤±è´¥`}}}function F(e,t,n=500){/!\[[^\]]*]\(/.test(t)?window.setTimeout(e,n):e()}export{l as _,S as a,T as c,A as d,F as f,M as g,E as h,P as i,j as l,N as m,k as n,f as o,D as p,O as r,u as s,C as t,w as u};
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.