1function R(n){const r=Number(n);return!Number.isFinite(r)||r<=0?0:Math.min(1,r/2)}function f(n,r){const c=Math.round(Number(n)||0),o=Math.round(Number(r)||0);return c<=0||o<=0?null:c<=1280?{width:c,height:o}:{width:1280,height:Math.round(o*1280/c)}}function g(n){return`${String(n||"video").replace(/\.[^.]+$/,"").replace(/[/\\]/g,"-").trim()||"video"}-poster.jpg`}async function p(n,r={}){const{createObjectURL:c=a=>URL.createObjectURL(a),revokeObjectURL:o=a=>URL.revokeObjectURL(a),createVideo:E=()=>document.createElement("video"),createCanvas:S=()=>document.createElement("canvas"),timeoutMs:_=1e4}=r;if(!n)return null;let s="";try{s=c(n)}catch{return null}const e=E();try{return await new Promise(a=>{let l=!1;const i=t=>{l||(l=!0,a(t))},h=setTimeout(()=>i(null),_),O=()=>{clearTimeout(h),i(null)},d=()=>{clearTimeout(h);try{const t=f(e.videoWidth,e.videoHeight);if(!t)return i(null);const u=S();u.width=t.width,u.height=t.height;const T=u.getContext("2d");if(!T)return i(null);T.drawImage(e,0,0,t.width,t.height),u.toBlob(m=>{if(!m)return i(null);i(new File([m],g(n.name),{type:"image/jpeg"}))},"image/jpeg",.82)}catch{i(null)}};e.addEventListener("error",O),e.addEventListener("seeked",d,{once:!0}),e.addEventListener("loadeddata",()=>{const t=R(e.duration);if(t<=0)return d();try{e.currentTime=t}catch{d()}},{once:!0}),e.muted=!0,e.playsInline=!0,e.preload="auto",e.src=s;try{e.load()}catch{}})}catch{return null}finally{try{o(s)}catch{}}}export{p as c,g as p};
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.