1import{n as e}from"./rolldown-runtime-hePW80VL.js";import{s as t}from"./mediaMeta-CYd0ph1V.js";var n=e({appendMediaSearchFiltersToParams:()=>l,buildMediaSearchQueryString:()=>s,parseMediaSearchFiltersFromRoute:()=>c,parseMediaSearchTagList:()=>i,serializeMediaSearchTags:()=>a});function r(e){let t=Number.parseFloat(e.trim());if(!(!Number.isFinite(t)||t<0))return Math.round(t*1024)}function i(e){return t(e)}function a(e){let t=e.map(e=>e.trim()).filter(Boolean).slice(0,10);return t.length===0?``:t.join(`#`)}function o(e){return a(i(e))||void 0}function s(e){let t=[],n=e.searchTerm.trim();n&&t.push(`search_term=${encodeURIComponent(n)}`),t.push(`offset=${e.offset}`),t.push(`num=${e.num}`),e.sort===`latest`&&t.push(`media_id_desc=1`),e.sort===`oldest`&&t.push(`media_id_asc=1`),e.sort===`fileSizeDesc`&&t.push(`file_size_desc=1`),e.sort===`fileSizeAsc`&&t.push(`file_size_asc=1`),e.uid?.trim()&&t.push(`uid=${encodeURIComponent(e.uid.trim())}`);let i=e.filters??{};i.extension?.trim()&&t.push(`extension=${encodeURIComponent(i.extension.trim())}`);let a=o(i.tag??``);a&&t.push(`tag=${encodeURIComponent(a)}`),i.mediaType?.trim()&&t.push(`media_type=${encodeURIComponent(i.mediaType.trim())}`),i.copyrightType?.trim()&&t.push(`copyright_type=${encodeURIComponent(i.copyrightType.trim())}`);let s=r(i.minSizeKb??``);s!=null&&t.push(`min_file_size=${s}`);let c=r(i.maxSizeKb??``);return c!=null&&t.push(`max_file_size=${c}`),i.title?.trim()&&t.push(`title=${encodeURIComponent(i.title.trim())}`),e.token&&t.push(`token=${encodeURIComponent(e.token)}`),t.join(`&`)}function c(e){let t=t=>typeof e[t]==`string`?e[t]:``;return{extension:t(`mext`),tag:t(`mtag`),mediaType:t(`mtype`),copyrightType:t(`mcopy`),minSizeKb:t(`msmin`),maxSizeKb:t(`msmax`),title:t(`mtitle`)}}function l(e,t){t.extension.trim()&&e.set(`mext`,t.extension.trim()),t.tag.trim()&&e.set(`mtag`,t.tag.trim()),t.mediaType.trim()&&e.set(`mtype`,t.mediaType.trim()),t.copyrightType.trim()&&e.set(`mcopy`,t.copyrightType.trim()),t.minSizeKb.trim()&&e.set(`msmin`,t.minSizeKb.trim()),t.maxSizeKb.trim()&&e.set(`msmax`,t.maxSizeKb.trim()),t.title.trim()&&e.set(`mtitle`,t.title.trim())}export{i as a,c as i,s as n,a as o,n as r,l 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.