import Index from"./index.js";import Document from"./document.js";import{is_string}from"./common.js";import{IntermediateSearchResults}from"./type.js";const chunk_size_reg=250000,chunk_size_map=5000,chunk_size_ctx=1000;function map_to_json(a,b=0){let c=[],d=[];b&&(b=0|chunk_size_map*(chunk_size_reg/b));for(const e of a.entries())d.push(e),d.length===b&&(c.push(d),d=[]);return d.length&&c.push(d),c}function json_to_map(a,b){b||(b=new Map);for(let c,d=0;d