PageSourceSearch

https://mcap.pages.dev/assets/js/c27704bc.952b6a04.js

js mcap.pages.dev collected 2026-10-03 05:25:43 UTC 81,915 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkwebsite||=[]).push([[155],{6798(e,t,s){s.d(t,{Y:()=>i});const n=!0;class i{#e=new Uint8Array(4096);#t;#s=new TextEncoder;#n=0;constructor(){this.#t=new DataView(this.#e.buffer)}get length(){return this.#n}get buffer(){return this.#e.slice(0,this.#n)}bufferView(e,t){return new Uint8Array(this.#e.buffer,e,t)}int8(e){return this.#i(1),this.#t.setInt8(this.#n,e),this.#n+=1,this}uint8(e){return this.#i(1),this.#t.setUint8(this.#n,e),this.#n+=1,this}int16(e){return this.#i(2),this.#t.setInt16(this.#n,e,n),this.#n+=2,this}uint16(e){return this.#i(2),this.#t.setUint16(this.#n,e,n),this.#n+=2,this}int32(e){return this.#i(4),this.#t.setInt32(this.#n,e,n),this.#n+=4,this}uint32(e){return this.#i(4),this.#t.setUint32(this.#n,e,n),this.#n+=4,this}int64(e){return this.#i(8),this.#t.setBigInt64(this.#n,e,n),this.#n+=8,this}uint64(e){return this.#i(8),this.#t.setBigUint64(this.#n,e,n),this.#n+=8,this}string(e){const t=this.#s.encode(e);return this.#i(t.byteLength+4),this.uint32(t.length),this.#e.set(t,this.#n),this.#n+=t.length,this}bytes(e){return this.#i(e.byteLength),this.#e.set(e,this.#n),this.#n+=e.length,this}tupleArray(e,t,s){const n=this.#n;this.uint32(0);for(const[a,o]of s)e.call(this,a),t.call(this,o);const i=this.#n;this.#n=n;const r=i-n-4;return this.uint32(r),this.#n=i,this}seek(e){return this.#r(e),this.#n=e,this}reset(){return this.#n=0,this}#i(e){this.#r(this.#n+e)}#r(e){if(e>this.#e.byteLength){const t=Math.max(1.5*this.#e.byteLength,e),s=new Uint8Array(t);s.set(this.#e),this.#e=s,this.#t=new DataView(this.#e.buffer)}}}},6589(e,t,s){s.d(t,{l:()=>n});class n{#a;#o=new Map;#h;#d=0;#c;constructor(e,t){this.#a=e,this.#h=t}async size(){return null==this.#c&&(this.#c=await this.#a.size()),this.#c}async read(e,t,s){const n=Number(t),i=this.#o.get(e);if(null!=i&&i.byteLength>=n)return i.byteLength===n?i:i.subarray(0,n);const r=await this.#a.read(e,t,s);if(this.#d+r.byteLength<=this.#h){const t=new Uint8Array(r);return this.#o.set(e,t),this.#d+=t.byteLength,t}return r}}},7419(e,t,s){s.d(t,{v:()=>i});var n=s(9552);class i{#l=new n.w;#u;#f=0;messageStartTime=0n;messageEndTime=0n;constructor({useMessageIndex:e=!0}){e&&(this.#u=new Map)}get numMessages(){return this.#f}get buffer(){return this.#l.buffer}get byteLength(){return this.#l.length}get indices(){return this.#u?this.#u.values():[]}addSchema(e){this.#l.writeSchema(e)}addChannel(e){this.#u&&!this.#u.has(e.id)&&this.#u.set(e.id,{channelId:e.id,records:[]}),this.#l.writeChannel(e)}addMessage(e){if((0===this.#f||e.logTime<this.messageStartTime)&&(this.messageStartTime=e.logTime),(0===this.#f||e.logTime>this.messageEndTime)&&(this.messageEndTime=e.logTime),this.#u){let t=this.#u.get(e.channelId);t||(t={channelId:e.channelId,records:[]},this.#u.set(e.channelId,t)),t.records.push([e.logTime,BigInt(this.#l.length)])}this.#f+=1,this.#l.writeMessage(e)}reset(){this.messageStartTime=0n,this.messageEndTime=0n,this.#f=0,this.#u?.clear(),this.#l.reset()}}},1448(e,t,s){s.d(t,{I:()=>o});var n=s(4951),i=s(1952),r=s(3389),a=s(4356);class o{#g;#p;#m;#b;#x;#w;#k=0;constructor(e){if(this.chunkIndex=e.chunkIndex,this.#g=e.relevantChannels,this.#p=e.startTime,this.#m=e.endTime,this.#b=e.reverse,this.#x=e.readFullMessageIndexRange??!1,0n===this.chunkIndex.messageIndexLength&&(0n!==this.chunkIndex.messageStartTime||0n!==this.chunkIndex.messageEndTime))throw new Error("Encountered a chunk index without message indexes and non-zero start and end times")}compare(e){if(this.#b!==e.#b)throw new Error("Cannot compare a reversed ChunkCursor to a non-reversed ChunkCursor");let t=Number(this.#y()-e.#y());return 0===t&&(t=Number(this.chunkIndex.chunkStartOffset-e.chunkIndex.chunkStartOffset)),this.#b?-t:t}hasMoreMessages(){if(null==this.#w)throw new Error("loadMessageIndexes() must be called before hasMore()");return this.#k<this.#w.length}popMessage(){if(null==this.#w)throw new Error("loadMessageIndexes() must be called before popMessage()");if(this.#k>=this.#w.length)throw new Error(`Unexpected popMessage() call when no more messages are available, in chunk at offset ${this.chunkIndex.chunkStartOffset}`);return this.#w[this.#k++]}hasMessageIndexes(){return null!=this.#w}async loadMessageIndexes(e,t){const s=this.#b;let o,h;const d=this.#x;for(const[n,i]of this.chunkIndex.messageIndexOffsets)(null==o||i<o)&&(o=i),(d||!this.#g||this.#g.has(n))&&(null==h||i<h)&&(h=i);if(null==o||null==h)return void(this.#w=[]);const c=o+this.chunkIndex.messageIndexLength,l=await e.read(h,c-h,t),u=new DataView(l.buffer,l.byteOffset,l.byteLength),f=new n.A(u),g=[];let p;for(;p=(0,i.H)(f,!0);)"MessageIndex"===p.type&&(0===p.records.length||this.#g&&!this.#g.has(p.channelId)||g.push(p.records));if(0!==f.bytesRemaining())throw new Error(`${f.bytesRemaining()} bytes remaining in message index section`);if(this.#w=g.flat().sort(([e,t],[s,n])=>{let i=Number(e-s);return 0===i&&(i=Number(t-n)),i}),s&&this.#w.reverse(),0===this.#w.length)return;const[m]=this.#w[0];if(m<this.chunkIndex.messageStartTime)throw new Error(`Chunk at offset ${this.chunkIndex.chunkStartOffset} contains a message with logTime (${m}) earlier than chunk messageStartTime (${this.chunkIndex.messageStartTime})`);const[b]=this.#w[this.#w.length-1];if(b>this.chunkIndex.messageEndTime)throw new Error(`Chunk at offset ${this.chunkIndex.chunkStartOffset} contains a message with logTime (${b}) later than chunk messageEndTime (${this.chunkIndex.messageEndTime})`);const x=s?this.#m:this.#p,w=s?this.#p:this.#m,k=s?e=>-e:e=>e;let y,v;null!=x&&(y=(0,r.n)(this.#w,x,k)),null!=w&&(v=(0,a.p)(this.#w,w,k)),null==y&&null==v||(this.#w=this.#w.slice(y,v))}#y(){return null!=this.#w&&this.#w.length>0&&this.#k<this.#w.length?this.#w[this.#k][0]:this.#b?this.chunkIndex.messageEndTime:this.chunkIndex.messageStartTime}}},4951(e,t,s){s.d(t,{A:()=>r});var n=s(5255);const i=new TextDecoder;class r{#t;#v;
1constructor(e,t=0){this.#t=e,this.#v=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.offset=t}reset(e,t=0){this.#t=e,this.#v=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.offset=t}bytesRemaining(){return this.#v.length-this.offset}uint8(){const e=this.#t.getUint8(this.offset);return this.offset+=1,e}uint16(){const e=this.#t.getUint16(this.offset,!0);return this.offset+=2,e}uint32(){const e=this.#t.getUint32(this.offset,!0);return this.offset+=4,e}uint64(){const e=n.b.call(this.#t,this.offset,!0);return this.offset+=8,e}string(){const e=this.uint32();if(0===e)return"";if(e>this.bytesRemaining())throw new Error(`String length ${e} exceeds bounds of buffer`);return i.decode(this.u8ArrayBorrow(e))}keyValuePairs(e,t){const s=this.uint32();if(this.offset+s>this.#t.byteLength)throw new Error(`Key-value pairs length ${s} exceeds bounds of buffer`);const n=[],i=this.offset+s;try{for(;this.offset<i;)n.push([e(this),t(this)])}catch(r){throw new Error(`Error reading key-value pairs: ${r.message}`)}if(this.offset!==i)throw new Error(`Key-value pairs length (${this.offset-i+s}) greater than expected (${s})`);return n}map(e,t){const s=this.uint32();if(this.offset+s>this.#t.byteLength)throw new Error(`Map length ${s} exceeds bounds of buffer`);const n=new Map,i=this.offset+s;try{for(;this.offset<i;){const s=e(this),i=t(this),r=n.get(s);if(null!=r)throw new Error(`Duplicate key ${String(s)} (${String(r)} vs ${String(i)})`);n.set(s,i)}}catch(r){throw new Error(`Error reading map: ${r.message}`)}if(this.offset!==i)throw new Error(`Map length (${this.offset-i+s}) greater than expected (${s})`);return n}u8ArrayBorrow(e){if(!(e>=0&&e<=this.bytesRemaining()))throw new Error(`Byte array length ${e} exceeds bounds of buffer`);const t=this.#v.subarray(this.offset,this.offset+e);return this.offset+=e,t}u8ArrayCopy(e){if(!(e>=0&&e<=this.bytesRemaining()))throw new Error(`Byte array length ${e} exceeds bounds of buffer`);const t=this.#v.slice(this.offset,this.offset+e);return this.offset+=e,t}}},8446(e,t,s){s.d(t,{k:()=>c});var n=s(6796),i=s(8917),r=s(6589),a=s(1448),o=s(4951),h=s(8094),d=s(1952);class c{metadataIndexes=[];#a;#C;#S;#T;#I;#M;#B;constructor(e){this.#a=e.readable,this.chunkIndexes=e.chunkIndexes,this.attachmentIndexes=e.attachmentIndexes,this.metadataIndexes=e.metadataIndexes,this.statistics=e.statistics,this.#S=e.decompressHandlers,this.channelsById=e.channelsById,this.schemasById=e.schemasById,this.summaryOffsetsByOpcode=e.summaryOffsetsByOpcode,this.header=e.header,this.footer=e.footer,this.dataEndOffset=e.dataEndOffset,this.dataSectionCrc=e.dataSectionCrc;const t=e.messageIndexCacheSizeBytes??0;this.#C=t>0?new r.l(this.#a,t):this.#a;for(const s of e.chunkIndexes)(null==this.#T||s.messageStartTime<this.#T)&&(this.#T=s.messageStartTime),(null==this.#I||s.messageEndTime>this.#I)&&(this.#I=s.messageEndTime);for(const s of e.attachmentIndexes)(null==this.#M||s.logTime<this.#M)&&(this.#M=s.logTime),(null==this.#B||s.logTime>this.#B)&&(this.#B=s.logTime)}#E(e){return new Error(`${e} [library=${this.header.library}]`)}static async Initialize({readable:e,decompressHandlers:t,messageIndexCacheSizeBytes:s,readOptions:i}){const r=await e.size();let a,l,u,f,g;{const t=await e.read(0n,BigInt(h.ue.length+1+8),i),s=new DataView(t.buffer,t.byteOffset,t.byteLength);(0,d.Z)(new o.A(s));const n=9n+s.getBigUint64(h.ue.length+1,!0),r=await e.read(BigInt(h.ue.length),n,i);l=BigInt(h.ue.length)+n;const c=new o.A(new DataView(r.buffer,r.byteOffset,r.byteLength)),u=(0,d.H)(c,!0);if("Header"!==u?.type)throw new Error(`Unable to read header at beginning of file; found ${u?.type??"nothing"}`);if(0!==c.bytesRemaining())throw new Error(`${c.bytesRemaining()} bytes remaining after parsing header`);a=u}function p(e){return new Error(`${e} [library=${a.library}]`)}{const t=BigInt(h.ue.length+1+8+4+4),s=BigInt(29+h.ue.length);if(r<t+s)throw p(`File size (${r}) is too small to be valid MCAP`);u=r-s;const n=await e.read(u,s,i);f=new DataView(n.buffer,n.byteOffset,n.byteLength)}try{(0,d.Z)(new o.A(f,f.byteLength-h.ue.length))}catch(z){throw p(z.message)}{const e=new o.A(f),t=(0,d.H)(e,!0);if("Footer"!==t?.type)throw p(`Unable to read footer from end of file (offset ${u}); found ${t?.type??"nothing"}`);if(e.bytesRemaining()!==h.ue.length)throw p(e.bytesRemaining()-h.ue.length+" b
1ytes remaining after parsing footer");g=t}if(0n===g.summaryStart)throw p("File is not indexed");const m=new Uint8Array(25);m.set(new Uint8Array(f.buffer,f.byteOffset,m.byteLength));const b=g.summaryStart-13n;if(b<l)throw p(`Expected DataEnd position (summary start ${g.summaryStart} - 13 = ${b}) to be after Header end offset (${l})`);const x=await e.read(b,u-b,i);if(0!==g.summaryCrc){let e=(0,n.oU)();if(e=(0,n.B_)(e,x.subarray(Number(13n))),e=(0,n.B_)(e,m),e=(0,n.kh)(e),e!==g.summaryCrc)throw p(`Incorrect summary CRC ${e} (expected ${g.summaryCrc})`)}const w=new DataView(x.buffer,x.byteOffset,x.byteLength),k=new o.A(w),y=new Map,v=new Map,C=[],S=[],T=[],I=new Map;let M,B,E,A=!0;for(;E=(0,d.H)(k,!0);){if(A&&"DataEnd"!==E.type)throw p(`Expected DataEnd record to precede summary section, but found ${E.type}`);switch(A=!1,E.type){case"Schema":v.set(E.id,E);break;case"Channel":y.set(E.id,E);break;case"ChunkIndex":C.push(E);break;case"AttachmentIndex":S.push(E);break;case"MetadataIndex":T.push(E);break;case"Statistics":if(M)throw p("Duplicate Statistics record");M=E;break;case"SummaryOffset":I.set(E.groupOpcode,E);break;case"DataEnd":B=0===E.dataSectionCrc?void 0:E.dataSectionCrc;break;case"Header":case"Footer":case"Message":case"Chunk":case"MessageIndex":case"Attachment":case"Metadata":throw p(`${E.type} record not allowed in index section`)}}if(0!==k.bytesRemaining())throw p(`${k.bytesRemaining()} bytes remaining in index section`);return new c({readable:e,chunkIndexes:C,attachmentIndexes:S,metadataIndexes:T,statistics:M,decompressHandlers:t,channelsById:y,schemasById:v,summaryOffsetsByOpcode:I,header:a,footer:g,dataEndOffset:b,dataSectionCrc:B,messageIndexCacheSizeBytes:s})}async*readMessages(e={}){const{topics:t,startTime:s=this.#T,endTime:n=this.#I,reverse:r=!1,validateCrcs:h,readOptions:c}=e;if(null==s||null==n)return;let l;if(t){l=new Set;for(const e of this.channelsById.values())t.includes(e.topic)&&l.add(e.id)}const u=new i.rs((e,t)=>e.compare(t));let f,g=!0;const p=this.#C!==this.#a;for(const i of this.chunkIndexes)i.messageStartTime<=n&&i.messageEndTime>=s&&(u.push(new a.I({chunkIndex:i,relevantChannels:l,startTime:s,endTime:n,reverse:r,readFullMessageIndexRange:p})),g&&null!=f&&(g=i.messageStartTime>=f),f=i.messageEndTime);const m=new Map,b=new o.A(new DataView(new ArrayBuffer(0)));for(let i;i=u.peek();){if(!i.hasMessageIndexes()){await i.loadMessageIndexes(this.#C,c),i.hasMoreMessages()?u.replace(i):u.pop();continue}let e=m.get(i.chunkIndex.chunkStartOffset);e||(e=await this.#A(i.chunkIndex,{validateCrcs:h??!0,readOptions:c}),m.set(i.chunkIndex.chunkStartOffset,e));const[t,s]=i.popMessage();if(s>=BigInt(e.byteLength))throw this.#E(`Message offset beyond chunk bounds (log time ${t}, offset ${s}, chunk data length ${e.byteLength}) in chunk at offset ${i.chunkIndex.chunkStartOffset}`);b.reset(e,Number(s));const n=(0,d.H)(b,h??!0);if(!n)throw this.#E(`Unable to parse record at offset ${s} in chunk at offset ${i.chunkIndex.chunkStartOffset}`);if("Message"!==n.type)throw this.#E(`Unexpected record type ${n.type} in message index (time ${t}, offset ${s} in chunk at offset ${i.chunkIndex.chunkStartOffset})`);if(n.logTime!==t)throw this.#E(`Message log time ${n.logTime} did not match message index entry (${t} at offset ${s} in chunk at offset ${i.chunkIndex.chunkStartOffset})`);yield n,i.hasMoreMessages()?g||u.replace(i):(u.pop(),m.delete(i.chunkIndex.chunkStartOffset))}}async*readMetadata(e={}){const{name:t,readOptions:s}=e;for(const n of this.metadataIndexes){if(null!=t&&n.name!==t)continue;const e=await this.#a.read(n.offset,n.length,s),i=new o.A(new DataView(e.buffer,e.byteOffset,e.byteLength)),r=(0,d.H)(i,!1);if("Metadata"!==r?.type)throw this.#E(`Metadata data at offset ${n.offset} does not point to metadata record (found ${String(r?.type)})`);yield r}}async*readAttachments(e={}){const{name:t,mediaType:s,startTime:n=this.#M,endTime:i=this.#B,validateCrcs:r,readOptions:a}=e;if(null!=n&&null!=i)for(const h of this.attachmentIndexes){if(null!=t&&h.name!==t)continue;if(null!=s&&h.mediaType!==s)continue;if(h.logTime>i||h.logTime<n)continue;const e=await this.#a.read(h.offset,h.length,a),c=new o.A(new DataView(e.buffer,e.byteOffset,e.byteLength)),l=(0,d.H)(c,r??!0);
1if("Attachment"!==l?.type)throw this.#E(`Attachment data at offset ${h.offset} does not point to attachment record (found ${String(l?.type)})`);yield l}}async#A(e,t){const s=await this.#a.read(e.chunkStartOffset,e.chunkLength,t?.readOptions),i=new o.A(new DataView(s.buffer,s.byteOffset,s.byteLength)),r=(0,d.H)(i,t?.validateCrcs??!0);if("Chunk"!==r?.type)throw this.#E(`Chunk start offset ${e.chunkStartOffset} does not point to chunk record (found ${String(r?.type)})`);const a=r;let h=a.records;if(""!==a.compression&&h.byteLength>0){const e=this.#S?.[a.compression];if(!e)throw this.#E(`Unsupported compression ${a.compression}`);h=e(h,a.uncompressedSize)}if(0!==a.uncompressedCrc&&!1!==t?.validateCrcs){const e=(0,n.QR)(h);if(e!==a.uncompressedCrc)throw this.#E(`Incorrect chunk CRC ${e} (expected ${a.uncompressedCrc})`)}return new DataView(h.buffer,h.byteOffset,h.byteLength)}}},9552(e,t,s){s.d(t,{w:()=>a});var n=s(6796),i=s(6798),r=s(8094);class a{#z=new i.Y;constructor(e){this.options=e}get length(){return this.#z.length}get buffer(){return this.#z.buffer}reset(){this.#z.reset()}writeMagic(){this.#z.bytes(new Uint8Array(r.ue))}writeHeader(e){this.#z.uint8(r.pz.HEADER);const t=this.#z.length;this.#z.uint64(0n).string(e.profile).string(e.library),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeFooter(e){return this.#z.uint8(r.pz.FOOTER).uint64(20n).uint64(e.summaryStart).uint64(e.summaryOffsetStart).uint32(e.summaryCrc),20n}writeSchema(e){this.#z.uint8(r.pz.SCHEMA);const t=this.#z.length;this.#z.uint64(0n).uint16(e.id).string(e.name).string(e.encoding).uint32(e.data.byteLength).bytes(e.data),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeChannel(e){this.#z.uint8(r.pz.CHANNEL);const t=this.#z.length;this.#z.uint64(0n).uint16(e.id).uint16(e.schemaId).string(e.topic).string(e.messageEncoding).tupleArray(e=>this.#z.string(e),e=>this.#z.string(e),e.metadata),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeMessage(e){this.#z.uint8(r.pz.MESSAGE);const t=this.#z.length;this.#z.uint64(0n).uint16(e.channelId).uint32(e.sequence).uint64(e.logTime).uint64(e.publishTime).bytes(e.data);const s=this.#z.length;this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s)}writeAttachment(e){this.#z.uint8(r.pz.ATTACHMENT);const t=this.#z.length;this.#z.uint64(0n);const s=this.#z.length;this.#z.uint64(e.logTime).uint64(e.createTime).string(e.name).string(e.mediaType).uint64(BigInt(e.data.byteLength)).bytes(e.data),this.#z.uint32((0,n.QR)(this.#z.bufferView(s,this.#z.length-s))),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const i=this.#z.length;return this.#z.seek(t).uint64(BigInt(i-t-8)).seek(i),BigInt(i-t+1)}writeAttachmentIndex(e){this.#z.uint8(r.pz.ATTACHMENT_INDEX);const t=this.#z.length;this.#z.uint64(0n).uint64(e.offset).uint64(e.length).uint64(e.logTime).uint64(e.createTime).uint64(e.dataSize).string(e.name).string(e.mediaType),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeChunk(e){this.#z.uint8(r.pz.CHUNK);const t=this.#z.length;this.#z.uint64(0n).uint64(e.messageStartTime).uint64(e.messageEndTime).uint64(e.uncompressedSize).uint32(e.uncompressedCrc).string(e.compression).uint64(BigInt(e.records.byteLength)).bytes(e.records);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeChunkIndex(e){this.#z.uint8(r.pz.CHUNK_INDEX);const t=this.#z.length;this.#z.uint64(0n).uint64(e.messageStartTime).uint64(e.messageEndTime).uint64(e.chunkStartOffset).uint64(e.chunkLength).uint32(10*e.messageIndexOffsets.size);for(const[n,i]of e.messageIndexOffsets)this.#z.uint16(n).uint64(i);this.#z.uint64(e.messageIndexLength).string(e.compression).uint64(e.compressedSize).uint64(e.uncompressedSize),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeMessageIndex(e){this.#z.uint8(r.pz.MESSAGE_INDEX);const t=this.#z.length,s=16*e.records.length;this.#z.uint64(0n).uint16(e.channelId).uint32(s);for(const i of e.records)this.#z.uint64(i[0]).uint64(i[1]);!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const n=this.#z.length;return this.#z.seek(t).uint64(BigInt(n-t-8)).seek(n),BigInt(n-t+1)}writeMetadata(e){this.#z.uint8(r.pz.METADATA);const t=this.#z.length;this.#z.uint64(0n).string(e.name).tupleArray(e=>this.#z.string(e),e=>this.#z.string(e),e.metadata),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeMetadataIndex(e){this.#z.uint8(r.pz.METADATA_INDEX);const t=this.#z.length;this.#z.uint64(0n).uint64(e.offset).uint64(e.length).string(e.name),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeSummaryOffset(e){this.#z.uint8(r.pz.SUMMARY_OFFSET);const t=this.#z.length;this.#z.uint64(0n).uint8(e.groupOpcode).uint64(e.groupStart).uint64(e.groupLength),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeStatistics(e){this.#z.uint8(r.pz.STATISTICS);const t=this.#z.length;this.#z.uint64(0n).uint64(e.messageCount).uint16(e.schemaCount).uint32(e.channelCount).uint32(e.attachmentCount).uint32(e.metadataCount).uint32(e.chunkCount).uint64(e.messageStartTime).uint64(e.messageEndTime).tupleArray(e=>this.#z.uint16(e),e=>this.#z.uint64(e),e.channelMessageCounts),!0===this.options?.padRecords&&this.#z.uint8(1).uint8(255).uint8(255);const s=this.#z.length;return this.#z.seek(t).uint64(BigInt(s-t-8)).seek(s),BigInt(s-t+1)}writeDataEnd(e){return this.#z.uint8(r.pz.DATA_END).uint64(4n).uint32(e.dataSectionCrc),4n}}},6721(e,t,s){s(6796),s(4951),s(8094),s(1952)},4593(e,t,s){s.d(t,{z:()=>d});var n=s(6796),i=s(7419),r=s(8446),a=s(9552),o=s(8094),h=s(3091);class d{#R=0;#W=1;#N;#l=new a.w;#j=new Map;#$=new Map;#O=new Set;#L=new Set;#D;#U;#H;#F;#P;#_;#Y;#V=!1;#X;#q;#G;constructor(e){const{writable:t,useStatistics:s=!0,useSummaryOffsets:n=!0,useChunks:r=!0,repeatSchemas:a=!0,repeatChannels:o=!0,useAttachmentIndex:h=!0,useMetadataIndex:d=!0,useMessageIndex:c=!0,useChunkIndex:l=!0,startChannelId:u=0,chunkSize:f=1048576,compressChunk:g}=e;this.#N=t,this.#P=n,s&&(this.statistics={messageCount:0n,schemaCount:0,channelCount:0,attachmentCount:0,metadataCount:0,chunkCount:0,messageStartTime:0n,messageEndTime:0n,channelMessageCounts:new Map}),r&&(this.#D=new i.v({useMessageIndex:c})),this.#_=a,this.#Y=o,h&&(this.#q=[]),d&&(this.#G=[]),l&&(this.#X=[]),this.#R=u,this.#H=f,this.#U=g}static async InitializeForAppending(e,t){const{readOptions:s,...i}=t,a=await r.k.Initialize({readable:e,readOptions:s});await e.seek(a.dataEndOffset),await e.truncate();const o=new d({...i,writable:e});o.#V=!0,o.#F=null!=a.dataSectionCrc?(0,n.kh)(a.dataSectionCrc):void 0,o.#X=[...a.chunkIndexes],o.#q=[...a.attachmentIndexes],o.#G=[...a.metadataIndexes],o.statistics&&(a.statistics?o.statistics=a.statistics:o.statistics=void 0),o.#j=new Map(a.schemasById),o.#O=new Set(a.schemasById.keys());for(const n of a.schemasById.values())o.#W=Math.max(o.#W,n.id+1);o.#$=new Map(a.channelsById),o.#L=new Set(a.channelsById.keys());for(const n of a.channelsById.values())o.#R=Math.max(o.#R,n.id+1);return o}async start(e={profile:"",library:h.k}){if(this.#V)throw new Error("Cannot call start() when writer is in append mode");this.#F=(0,n.oU)(),this.#l.writeMagic(),this.#l.writeHeader(e),this.#F=(0,n.B_)(this.#F,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset()}async end(){await this.#K(),null!=this.#F&&(this.#F=(0,n.B_)(this.#F,this.#l.buffer)),await this.#N.write(this.#l.buffer),this.#l.reset(),this.#l.writeDataEnd({dataSectionCrc:null==this.#F?0:(0,n.kh)(this.#F)}),await this.#N.write(this.#l.buffer),this.#l.reset();const e=[],t=this.#N.position();let s=(0,n.oU)();if(this.#_){const t=this.#N.position();let s=0n;for(const e of this.#j.values())s+=this.#l.writeSchema(e);e.push({groupOpcode:o.pz.SCHEMA,groupStart:t,groupLength:s})}if(this.#Y){s=(0,n.B_)(s,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset();const t=this.#N.position();let i=0n;for(const e of this.#$.values())i+=this.#l.writeChannel(e);e.push({groupOpcode:o.pz.CHANNEL,groupStart:t,groupLength:i})}if(this.statistics){s=(0,n.B_)(s,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset();const t=this.#N.position(),i=this.#l.writeStatistics(this.statistics);e.push({groupOpcode:o.pz.STATISTICS,groupStart:t,groupLength:i})}if(s=(0,n.B_)(s,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset(),this.#G){s=(0,n.B_)(s,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset();const t=this.#N.position();let i=0n;for(const e of this.#G)i+=this.#l.writeMetadataIndex(e);e.push({groupOpcode:o.pz.METADATA_INDEX,groupStart:t,groupLength:i})}if(this.#q){s=(0,n.B_)(s,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset();const t=this.#N.position();let i=0n;for(const e of this.#q)i+=this.#l.writeAttachmentIndex(e);e.push({groupOpcode:o.pz.ATTACHMENT_INDEX,groupStart:t,groupLength:i})}if(this.#X){s=(0,n.B_)(s,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset();const t=this.#N.position();let i=0n;for(const e of this.#X)i+=this.#l.writeChunkIndex(e);e.push({groupOpcode:o.pz.CHUNK_INDEX,groupStart:t,groupLength:i})}s=(0,n.B_)(s,this.#l.buffer),await this.#N.write(this.#l.buffer),this.#l.reset();const i=this.#N.position(),r=i-t;if(this.#P)for(const n of e)0n!==n.groupLength&&this.#l.writeSummaryOffset(n);s=(0,n.B_)(s,this.#l.buffer);const a={summaryStart:0n===r?0n:t,summaryOffsetStart:this.#P?i:0n,summaryCrc:0},h=new DataView(new ArrayBuffer(25));h.setUint8(0,o.pz.FOOTER),h.setBigUint64(1,20n,!0),h.setBigUint64(9,a.summaryStart,!0),h.setBigUint64(17,a.summaryOffsetStart,!0),s=(0,n.B_)(s,h),a.summaryCrc=(0,n.kh)(s),this.#l.writeFooter(a),this.#l.writeMagic(),await this.#N.write(this.#l.buffer),this.#l.reset()}async registerSchema(e){const t=this.#W++;return this.#j.set(t,{...e,id:t}),this.statistics&&++this.statistics.schemaCount,t}async registerChannel(e){const t=this.#R++;return this.#$.set(t,{...e,id:t}),this.statistics&&++this.statistics.channelCount,t}async addMessage(e){if(this.statistics&&(0n===this.statistics.messageCount?(this.statistics.messageStartTime=e.logTime,this.statistics.messageEndTime=e.logTime):(e.logTime<this.statistics.messageStartTime&&(this.statistics.messageStartTime=e.logTime),e.logTime>this.statistics.messageEndTime&&(this.statistics.messageEndTime=e.logTime)),this.statistics.channelMessageCounts.set(e.channelId,(this.statistics.channelMessageCounts.get(e.channelId)??0n)+1n),++this.statistics.messageCount),!this.#L.has(e.channelId)){const t=this.#$.get(e.channelId);if(!t)throw new Error(`McapWriter#addMessage failed: missing channel for id ${e.channelId}`);if(0!==t.schemaId&&!this.#O.has(t.schemaId)){const e=this.#j.get(t.schemaId);if(!e)throw new Error(`McapWriter#addMessage failed: missing schema for id ${t.schemaId}`);this.#D?this.#D.addSchema(e):this.#l.writeSchema(e),this.#O.add(t.schemaId)}this.#D?this.#D.addChannel(t):this.#l.writeChannel(t),this.#L.add(e.channelId)}this.#D?this.#D.addMessage(e):this.#l.writeMessage(e),this.#D&&this.#D.byteLength>this.#H&&await this.#K()}async addAttachment(e){const t=this.#l.writeAttachment(e);
1if(this.statistics&&++this.statistics.attachmentCount,this.#q){const s=this.#N.position();this.#q.push({logTime:e.logTime,createTime:e.createTime,name:e.name,mediaType:e.mediaType,offset:s,dataSize:BigInt(e.data.byteLength),length:t})}null!=this.#F&&(this.#F=(0,n.B_)(this.#F,this.#l.buffer)),await this.#N.write(this.#l.buffer),this.#l.reset()}async addMetadata(e){const t=this.#l.writeMetadata(e);if(this.statistics&&++this.statistics.metadataCount,this.#G){const s=this.#N.position();this.#G.push({name:e.name,offset:s,length:t})}null!=this.#F&&(this.#F=(0,n.B_)(this.#F,this.#l.buffer)),await this.#N.write(this.#l.buffer),this.#l.reset()}async#K(){if(!this.#D||0===this.#D.numMessages)return;this.statistics&&++this.statistics.chunkCount;const e=this.#D.buffer,t=BigInt(e.length),s=(0,n.QR)(e);let i="",r=e;this.#U&&({compression:i,compressedData:r}=this.#U(e));const a={messageStartTime:this.#D.messageStartTime,messageEndTime:this.#D.messageEndTime,uncompressedSize:t,uncompressedCrc:s,compression:i,records:r},o=this.#N.position(),h=this.#l.writeChunk(a),d=this.#X?new Map:void 0;null!=this.#F&&(this.#F=(0,n.B_)(this.#F,this.#l.buffer)),await this.#N.write(this.#l.buffer),this.#l.reset();const c=this.#N.position();let l=0n;for(const n of this.#D.indices)d?.set(n.channelId,c+l),l+=this.#l.writeMessageIndex(n);this.#X&&this.#X.push({messageStartTime:a.messageStartTime,messageEndTime:a.messageEndTime,chunkStartOffset:o,chunkLength:h,messageIndexOffsets:d,messageIndexLength:l,compression:a.compression,compressedSize:BigInt(a.records.byteLength),uncompressedSize:a.uncompressedSize}),this.#D.reset(),null!=this.#F&&(this.#F=(0,n.B_)(this.#F,this.#l.buffer)),await this.#N.write(this.#l.buffer),this.#l.reset()}}},8094(e,t,s){s.d(t,{pz:()=>i});const n=Object.freeze([137,77,67,65,80,48,13,10]);let i=function(e){return e[e.MIN=1]="MIN",e[e.HEADER=1]="HEADER",e[e.FOOTER=2]="FOOTER",e[e.SCHEMA=3]="SCHEMA",e[e.CHANNEL=4]="CHANNEL",e[e.MESSAGE=5]="MESSAGE",e[e.CHUNK=6]="CHUNK",e[e.MESSAGE_INDEX=7]="MESSAGE_INDEX",e[e.CHUNK_INDEX=8]="CHUNK_INDEX",e[e.ATTACHMENT=9]="ATTACHMENT",e[e.ATTACHMENT_INDEX=10]="ATTACHMENT_INDEX",e[e.STATISTICS=11]="STATISTICS",e[e.METADATA=12]="METADATA",e[e.METADATA_INDEX=13]="METADATA_INDEX",e[e.SUMMARY_OFFSET=14]="SUMMARY_OFFSET",e[e.DATA_END=15]="DATA_END",e[e.MAX=15]="MAX",e}({});s.d(t,["ue",0,n])},5255(e,t,s){const n="function"==typeof DataView.prototype.getBigUint64?DataView.prototype.getBigUint64:function(e,t){const s=!0===t?this.getUint32(e,t):this.getUint32(e+4,t),n=!0===t?this.getUint32(e+4,t):this.getUint32(e,t);return BigInt(n)<<32n|BigInt(s)};s.d(t,["b",0,n])},5258(e,t,s){s(8094)},4355(e,t,s){s.d(t,{zc:()=>n.z});s(8446),s(6721),s(4951);var n=s(4593);s(9552),s(7419),s(8094),s(5258),s(1952)},1952(e,t,s){s.d(t,{H:()=>a,Z:()=>r});var n=s(6796),i=s(8094);function r(e){if(e.bytesRemaining()<i.ue.length)return;const t=e.u8ArrayBorrow(i.ue.length);if(!i.ue.every((e,s)=>e===t[s]))throw new Error(`Expected MCAP magic '${i.ue.map(e=>e.toString(16).padStart(2,"0")).join(" ")}', found '${Array.from(t,(e,s)=>t[s].toString(16).padStart(2,"0")).join(" ")}'`);return{specVersion:"0"}}function a(e,t=!1){if(e.bytesRemaining()<9)return;const s=e.offset,r=e.uint8(),a=e.uint64();if(a>Number.MAX_SAFE_INTEGER)throw new Error(`Record content length ${a} is too large`);const o=Number(a);if(e.bytesRemaining()<o)return void(e.offset=s);let h;switch(r){case i.pz.HEADER:h=function(e,t){const s=e.offset,n=e.string(),i=e.string();return e.offset=s+t,{type:"Header",profile:n,library:i}}(e,o);break;case i.pz.FOOTER:h=function(e,t){const s=e.offset,n=e.uint64(),i=e.uint64(),r=e.uint32();return e.offset=s+t,{type:"Footer",summaryStart:n,summaryOffsetStart:i,summaryCrc:r}}(e,o);break;case i.pz.SCHEMA:h=function(e,t){const s=e.offset,n=e.uint16(),i=e.string(),r=e.string(),a=e.uint32(),o=e.offset;if(t-(o-s)<a)throw new Error(`Schema data length ${a} exceeds bounds of record`);const h=e.u8ArrayCopy(a);return e.offset=s+t,{type:"Schema",id:n,encoding:r,name:i,data:h}}(e,o);break;case i.pz.CHANNEL:h=function(e,t){const s=e.offset,n=e.uint16(),i=e.uint16(),r=e.string(),a=e.string(),o=e.map(e=>e.string(),e=>e.string());return e.offset=s+t,{type:"Channel",id:n,schemaId:i,topic:r,messageEncoding:a,metadata:o}}(e,o);break;case i.pz.MESSAGE:h=function(e,t){const s=22;if(t<s)throw new Error(`Message record length ${t} is less than ${s} bytes`);const n=e.uint16(),i=e.uint32(),r=e.uint64(),a=e.uint64(),o=e.u8ArrayCopy(t-s);return{type:"Message",channelId:n,sequence:i,logTime:r,publishTime:a,data:o}}(e,o);break;case i.pz.CHUNK:h=function(e,t){const s=e.offset,n=e.uint64(),i=e.uint64(),r=e.uint64(),a=e.uint32(),o=e.string(),h=Number(e.uint64()),d=e.offset,c=d-s;if(h+c>t)throw new Error("Chunk records length exceeds remaining record size");const l=e.u8ArrayCopy(h);return e.offset=s+t,{type:"Chunk",messageStartTime:n,messageEndTime:i,compression:o,uncompressedSize:r,uncompressedCrc:a,records:l}}(e,o);break;case i.pz.MESSAGE_INDEX:h=function(e,t){const s=e.offset,n=e.uint16(),i=e.keyValuePairs(e=>e.uint64(),e=>e.uint64());return e.offset=s+t,{type:"MessageIndex",channelId:n,records:i}}(e,o);break;case i.pz.CHUNK_INDEX:h=function(e,t){const s=e.offset,n=e.uint64(),i=e.uint64(),r=e.uint64(),a=e.uint64(),o=e.map(e=>e.uint16(),e=>e.uint64()),h=e.uint64(),d=e.string(),c=e.uint64(),l=e.uint64();return e.offset=s+t,{type:"ChunkIndex",messageStartTime:n,messageEndTime:i,chunkStartOffset:r,chunkLength:a,messageIndexOffsets:o,messageIndexLength:h,compression:d,compressedSize:c,uncompressedSize:l}}(e,o);break;case i.pz.ATTACHMENT:h=function(e,t,s){const i=e.offset,r=e.uint64(),a=e.uint64(),o=e.string(),h=e.string(),d=e.uint64();if(BigInt(e.offset)+d>Number.MAX_SAFE_INTEGER)throw new Error(`Attachment too large: ${d}`);if(e.offset+Number(d)+4>i+t)throw new Error(`Attachment data length ${d}
1 exceeds bounds of record`);const c=e.u8ArrayCopy(Number(d)),l=e.offset-i,u=e.uint32();if(s&&0!==u){e.offset=i;const t=e.u8ArrayBorrow(l),s=(0,n.QR)(t);if(e.offset=i+l+4,s!==u)throw new Error(`Attachment CRC32 mismatch: expected ${u}, actual ${s}`)}return e.offset=i+t,{type:"Attachment",logTime:r,createTime:a,name:o,mediaType:h,data:c}}(e,o,t);break;case i.pz.ATTACHMENT_INDEX:h=function(e,t){const s=e.offset,n=e.uint64(),i=e.uint64(),r=e.uint64(),a=e.uint64(),o=e.uint64(),h=e.string(),d=e.string();return e.offset=s+t,{type:"AttachmentIndex",offset:n,length:i,logTime:r,createTime:a,dataSize:o,name:h,mediaType:d}}(e,o);break;case i.pz.STATISTICS:h=function(e,t){const s=e.offset,n=e.uint64(),i=e.uint16(),r=e.uint32(),a=e.uint32(),o=e.uint32(),h=e.uint32(),d=e.uint64(),c=e.uint64(),l=e.map(e=>e.uint16(),e=>e.uint64());return e.offset=s+t,{type:"Statistics",messageCount:n,schemaCount:i,channelCount:r,attachmentCount:a,metadataCount:o,chunkCount:h,messageStartTime:d,messageEndTime:c,channelMessageCounts:l}}(e,o);break;case i.pz.METADATA:h=function(e,t){const s=e.offset,n=e.string(),i=e.map(e=>e.string(),e=>e.string());return e.offset=s+t,{type:"Metadata",metadata:i,name:n}}(e,o);break;case i.pz.METADATA_INDEX:h=function(e,t){const s=e.offset,n=e.uint64(),i=e.uint64(),r=e.string();return e.offset=s+t,{type:"MetadataIndex",offset:n,length:i,name:r}}(e,o);break;case i.pz.SUMMARY_OFFSET:h=function(e,t){const s=e.offset,n=e.uint8(),i=e.uint64(),r=e.uint64();return e.offset=s+t,{type:"SummaryOffset",groupOpcode:n,groupStart:i,groupLength:r}}(e,o);break;case i.pz.DATA_END:h=function(e,t){const s=e.offset,n=e.uint32();return e.offset=s+t,{type:"DataEnd",dataSectionCrc:n}}(e,o);break;default:h=function(e,t,s){const n=e.u8ArrayBorrow(t);return{type:"Unknown",opcode:s,data:n}}(e,o,r)}return e.offset=s+9+o,h}},3389(e,t,s){function n(e,t,s){let n=0,i=e.length;if(0===i)return 0;const r=s(t);for(;n<i;){const t=n+i>>>1;s(e[t][0])<r?n=t+1:i=t}return i}s.d(t,{n:()=>n})},4356(e,t,s){function n(e,t,s){let n=0,i=e.length;if(0===i)return 0;const r=s(t);for(;n<i;){const t=n+i>>>1;s(e[t][0])<=r?n=t+1:i=t}return i}s.d(t,{p:()=>n})},3091(e,t,s){s.d(t,["k",0,"mcap-typescript/2.3.0"])},9345(e,t,s){s.r(t),s.d(t,{default:()=>B});var n=s(6602),i=s(3696),r=s(8325);class a{#Z;#Q;#J;#ee=0;#te;#se;#ne=0;#ie;constructor(e,t){this.#Z=e,this.#Q=t}openFile(e){this.cancel(),this.#re({type:"open",file:e,name:e.name})}async openReadable(e,t="MCAP source"){this.cancel();const s=this.#ne;this.#Q.onBusy("catalog");try{const n=await e.size();s===this.#ne&&this.#re({type:"open",size:n,name:t},e)}catch(n){s===this.#ne&&this.#ae(n)}}#re(e,t){this.#Q.onBusy("catalog"),this.#Q.onProgress(0);try{const s=this.#Z();this.#J=s,s.onmessage=({data:e})=>{if(this.#J===s)switch(e.type){case"read":this.#oe(s,t,e);break;case"progress":if(null!=e.id&&e.id!==this.#ee)return;this.#Q.onProgress(e.fraction);break;case"opened":this.#Q.onBusy(void 0),this.#Q.onCatalog(e.recording);break;case"preload-status":e.id===this.#ee&&this.#Q.onPreload?.(e.state);break;case"prefetched":if(e.id!==this.#ee||this.#se)return;if(!e.recording.loadedRange||this.#te&&(e.recording.loadedRange.start>this.#te.start||e.recording.loadedRange.end<this.#te.end))return;this.#te=e.recording.loadedRange,this.#Q.onWindow(e.recording);break;case"window":if(e.id!==this.#ee)return;this.#te=e.recording.loadedRange,this.#se=void 0,this.#Q.onBusy(void 0),this.#Q.onWindow(e.recording);break;case"error":if(null!=e.id&&e.id!==this.#ee)return;this.#ae(new Error(e.message))}},s.onerror=e=>{s===this.#J&&this.#ae(new Error(e.message||"The file loader stopped unexpectedly."))},s.postMessage(e)}catch(s){this.#ae(s)}}async#oe(e,t,s){try{if(!t)throw new Error("No readable supplied.");const n=await t.read(s.offset,s.size);if(e!==this.#J)return;const i=new Uint8Array(n);e.postMessage({type:"read-result",id:s.id,bytes:i},[i.buffer])}catch(n){e===this.#J&&e.postMessage({type:"read-result",id:s.id,error:n instanceof Error?n.message:String(n)})}}requestWindow(e,t){if(!this.#J)return;const s=e+t;if(this.#te&&e>=this.#te.start&&s<=this.#te.end)return void(this.#se&&(clearTimeout(this.#ie),this.#J.postMessage({type:"cancel-window",id:++this.#ee}),this.#se=void 0,this.#Q.onBusy(void 0)));if(this.#se&&e>=this.#se.start&&s<=this.#se.end)return;this.#Q.onPreload?.(void 0),this.#se={start:e,end:s};const n=++this.#ee;clearTimeout(this.#ie),this.#Q.onProgress(0),this.#Q.onBusy("window"),this.#ie=setTimeout(()=>{this.#J?.postMessage({type:"window",id:n,start:e,end:e+t})},120)}#ae(e){this.#se=void 0,this.#Q.onBusy(void 0),this.#Q.onError(e instanceof Error?e:new Error(String(e)))}cancel(){this.#ne++,this.#ee++,this.#te=void 0,this.#se=void 0,clearTimeout(this.#ie),this.#J?.terminate(),this.#J=void 0,this.#Q.onPreload?.(void 0),this.#Q.onBusy(void 0)}}var o=s(2540);function h({axis:e,label:t,value:s,min:n,max:r,onChange:a,style:h}){const d=(0,i.useRef)(void 0),c=e=>{a(Math.max(n,Math.min(r,e)))};return(0,o.jsx)("div",{className:`resize-handle resize-${e}`,style:h,role:"separator",tabIndex:0,"aria-label":t,"aria-orientation":"x"===e?"vertical":"horizontal","aria-valuemin":Math.round(n),"aria-valuemax":Math.round(r),"aria-valuenow":Math.round(s),"aria-valuetext":`${Math.round(s)} pixels`,title:`${t}. Drag or use arrow keys.`,onPointerDown:t=>
1{0===t.button&&(t.preventDefault(),t.currentTarget.focus(),t.currentTarget.setPointerCapture(t.pointerId),d.current={pointer:t.pointerId,origin:"x"===e?t.clientX:t.clientY,value:s})},onPointerMove:t=>{const s=d.current;s?.pointer===t.pointerId&&c(s.value+("x"===e?t.clientX:t.clientY)-s.origin)},onPointerUp:e=>{d.current?.pointer===e.pointerId&&(d.current=void 0,e.currentTarget.releasePointerCapture(e.pointerId))},onPointerCancel:()=>{d.current=void 0},onLostPointerCapture:()=>{d.current=void 0},onKeyDown:t=>{const i="x"===e?"ArrowLeft":"ArrowUp",a="x"===e?"ArrowRight":"ArrowDown",o=t.shiftKey?50:10;t.key===i||t.key===a?(t.preventDefault(),c(s+(t.key===a?o:-o))):"Home"!==t.key&&"End"!==t.key||(t.preventDefault(),c("Home"===t.key?n:r))}})}function d(e,t){let s=0,n=e.length;for(;s<n;){const i=s+n>>>1;e[i].time<t?s=i+1:n=i}return s}function c(e){if(e<1024)return`${e.toLocaleString()} B`;const t=["B","KiB","MiB","GiB","TiB","PiB"],s=Math.min(t.length-1,Math.floor(Math.log(e)/Math.log(1024)));return`${(e/1024**s).toFixed(1)} ${t[s]??"B"}`}function l(e){return`${e.toFixed(e<.001?9:e<1?6:3)} s`}function u(e,t){if(e<2||null==t||!Number.isFinite(t)||t<=0)return"\u2014 Hz";const s=e/t;return s>0&&s<.05?`<${.1.toLocaleString()} Hz`:`${s.toLocaleString(void 0,{maximumFractionDigits:1})} Hz`}function f(e,t){if(!e||!0===e.partial&&!e.loadedRange)return;let s=!0===e.partial?Math.max(0,e.loadedRange.start):0,n=!0===e.partial?Math.min(e.duration,e.loadedRange.end):e.duration;return t&&(s=Math.max(s,Number(t.startTime-e.startTime)/1e9),n=Math.min(n,Number(t.endTime-e.startTime)/1e9)),n<s?void 0:{start:s,end:n,duration:n-s}}function g({selection:e,recording:t}){if(!e)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h2",{children:"Inspect a message"}),(0,o.jsx)("p",{children:"Click a tick to select it. Its marker and channel stay highlighted while you inspect its details."}),(0,o.jsx)("p",{children:"Double-click a chunk to see only the channels and messages it contains."})]});const{channel:s,message:n,chunk:i,unchunked:r}=e,a=[];if(s&&a.push(["Channel ID",String(s.id)],["Topic",s.topic],["Encoding",s.encoding||"\u2014"],["Schema ID",String(s.schemaId)]),n&&a.push(["Relative log time",l(n.time)],["Log time \xb7 ns",String(n.logTime)],["Publish time \xb7 ns",String(n.publishTime)],["Sequence",String(n.sequence)],["Payload size",c(n.size)],["Belongs to",i?`Chunk #${i.id}`:"Unchunked record"]),n&&!i&&a.push(["Record file offset",c(n.offset),`${n.offset.toLocaleString()} B`]),s&&!n){const e=i?s.messages.filter(e=>e.chunkId===i.id):s.messages;a.push([i?"Channel messages in chunk":"Messages in loaded window",`${e.length.toLocaleString()} \xb7 ${u(e.length,f(t,i)?.duration)}`])}return!0===r&&t&&a.push(["Messages outside chunks",t.looseCount.toLocaleString()]),i&&t&&a.push(["Chunk",`#${i.id}`],["Compression",i.compression],["Chunk rate interval",`${(Number(i.endTime-i.startTime)/1e9).toFixed(6)} s (including silence)`],["Messages in chunk",!1===i.loaded?"Not loaded":`${i.messageCount.toLocaleString()} \xb7 ${u(i.messageCount,Number(i.endTime-i.startTime)/1e9)}`],["Start",l(Number(i.startTime-t.startTime)/1e9)],["End",l(Number(i.endTime-t.startTime)/1e9)],["File offset",c(i.offset),`${i.offset.toLocaleString()} B`],["Record size",c(i.byteLength)],["Compressed records",c(i.compressedSize)],["Uncompressed records",c(i.uncompressedSize)]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("h2",{children:n?"Selected message":i?`Chunk #${i.id}`:!0===r?"Unchunked messages":"Selected channel"}),(0,o.jsx)("dl",{children:a.map(([e,t,s])=>(0,o.jsxs)("div",{children:[(0,o.jsx)("dt",{children:e}),(0,o.jsx)("dd",{title:s,children:t})]},e))})]})}function p({start:e,span:t,duration:s,onSeek:n}){const{left:i,width:r}=function(e,t,s){const n=s>0?Math.max(0,Math.min(100,e/s*100)):0;return{left:n,width:s>0?Math.max(0,Math.min(100-n,t/s*100)):100}}(e,t,s);return(0,o.jsxs)("div",{className:"navigator",children:[(0,o.jsx)("span",{children:"0 s"}),(0,o.jsxs)("div",{className:"overview",children:[(0,o.jsx)("div",{className:"overview-track",children:(0,o.jsx)("div",{className:"viewport-range",style:{left:`${i}%`,width:`${r}%`}})}),(0,o.jsx)("input",{type:"range",min:0,max:1e4,value:s>t?Math.round(e/(s-t)*1e4):0,disabled:s<=t,"aria-label":"Pan visible time range","aria-valuetext":`${l(e)} to ${l(e+t)}`,onChange:e=>{n(Number(e.target.value)/1e4)}})]}),(0,o.jsx)("span",{children:l(s)}),(0,o.jsxs)("span",{id:"window-size",children:["Viewing ",l(e)," \u2013 ",l(e+t)]})]})}var m=s(4355);function b(e){const t=e.chunks.map(e=>({key:e.id,chunk:e,children:[]})),s=new Map(t.map(e=>[e.key,e])),n={key:"loose",children:[]};for(const i of e.channels){const e=new Map;for(const t of i.messages){const s=t.chunkId??"loose";let n=e.get(s);
1n||(n=[],e.set(s,n)),n.push(t)}for(const[t,r]of e){const e="loose"===t?n:s.get(t);if(!e)throw new Error(`Missing physical chunk ${t}.`);e.children.push({kind:"channel",channel:i,messages:r,chunk:e.chunk})}}return n.children.length>0&&t.push(n),t}function x(e,t){return`${e.id} ${e.topic}`.toLowerCase().includes(t.toLowerCase())}function w(e,t){if(e.chunk)return{start:Number(e.chunk.startTime-t)/1e9,end:Number(e.chunk.endTime-t)/1e9};let s=1/0,n=-1/0;for(const i of e.children)i.messages.length>0&&(s=Math.min(s,i.messages[0].time),n=Math.max(n,i.messages[i.messages.length-1].time));return Number.isFinite(s)?{start:s,end:n}:void 0}const k=["#5aafff","#43cb96","#d6b64c","#f17d7d","#ba8af5","#53cbd2"],y=42,v="12px ui-monospace, SFMono-Regular, Consolas, monospace";class C{#he;#de=1;#ce=1;#le=246;#ue;#fe;#ge;#pe;#me=!0;#be=0;#xe=0;#we=2;#ke;#ye=new Map;#ve=[];#Ce="channel";#Se;#Te="";#Ie=0;#Me;#Be;#Ee;#Ae;#ze;#Re=new AbortController;#We;#Ne;#je;#$e;#Oe;#Le;#De;constructor(e,t,s,n,i=()=>{},r=()=>{},a=()=>{}){this.#fe=a,this.#pe=r,this.#je=e,this.#$e=t,this.#Oe=s,this.#Le=n,this.#De=i;const o=e.getContext("2d");if(!o)throw new Error("Your browser does not support Canvas 2D.");this.#he=o,this.#ze=new ResizeObserver(()=>{this.#Ue()}),this.#ze.observe(e),e.addEventListener("wheel",e=>{e.preventDefault();const t=1===e.deltaMode?16:2===e.deltaMode?this.#ce:1;e.ctrlKey||e.metaKey?this.zoom(Math.exp(-e.deltaY*t*.008),this.#He(e.offsetX)):e.shiftKey?this.pan((0!==e.deltaY?e.deltaY:e.deltaX)*t/this.#Fe*this.#we):(this.pan(e.deltaX*t/this.#Fe*this.#we),this.#be+=e.deltaY*t,this.#Pe(),this.#_e()),this.#Ye()},{passive:!1,signal:this.#Re.signal}),e.addEventListener("dblclick",e=>{const t=this.#Ve(e.offsetX,e.offsetY)?.chunk;t&&this.focusChunk(t.id)},{signal:this.#Re.signal}),e.addEventListener("pointerdown",t=>{0===t.button&&(e.focus(),e.setPointerCapture(t.pointerId),this.#Me={x:t.offsetX,y:t.offsetY,start:this.#xe,scrollY:this.#be,moved:!1},e.style.cursor="grabbing",this.#Ye())},{signal:this.#Re.signal}),e.addEventListener("pointermove",e=>{if(this.#Me){const t=e.offsetX-this.#Me.x,s=e.offsetY-this.#Me.y;Math.abs(t)+Math.abs(s)>4&&(this.#Me.moved=!0),this.#Me.moved&&(this.#xe=this.#Me.start-t/this.#Fe*this.#we,this.#be=this.#Me.scrollY-s,this.#Pe(),this.#_e(),this.#Xe())}else this.#Ae={x:e.offsetX,y:e.offsetY},this.#Be=this.#Ve(e.offsetX,e.offsetY),this.#qe(),this.#_e()},{signal:this.#Re.signal}),e.addEventListener("pointerup",t=>{this.#Me&&!this.#Me.moved&&(this.#Ee=this.#Ve(t.offsetX,t.offsetY),this.#$e(this.#Ee),this.#_e()),this.#Me=void 0,e.style.cursor="grab",e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId)},{signal:this.#Re.signal}),e.addEventListener("pointercancel",()=>{this.#Me=void 0,e.style.cursor="grab"},{signal:this.#Re.signal}),e.addEventListener("pointerleave",()=>{this.#Be=void 0,this.#Ae=void 0,this.#Ye(),this.#_e()},{signal:this.#Re.signal}),e.addEventListener("keydown",e=>{let t=!0;"+"===e.key||"="===e.key?this.zoom(1.5):"-"===e.key?this.zoom(1/1.5):"ArrowLeft"===e.key?this.pan(.15*-this.#we):"ArrowRight"===e.key?this.pan(.15*this.#we):"ArrowDown"===e.key?(this.#be+=48,this.#Pe(),this.#_e()):"ArrowUp"===e.key?(this.#be-=48,this.#Pe(),this.#_e()):"Home"===e.key?this.fit():"Escape"===e.key?this.#We?this.exitChunk():this.clearSelection():t=!1,t&&e.preventDefault()},{signal:this.#Re.signal})}get#Fe(){return Math.max(1,this.#de-this.#le-18)}get#Ge(){return Math.max(this.#ke?.duration??0,.001)}#He(e){return Math.max(0,Math.min(1,(e-this.#le)/this.#Fe))}#Ke(e){return this.#le+(e-this.#xe)/this.#we*this.#Fe}#Xe(){this.#ge?.start===this.#xe&&this.#ge.span===this.#we&&this.#ge.duration===this.#Ge||(this.#ge={start:this.#xe,span:this.#we,duration:this.#Ge},this.#Oe(this.#xe,this.#we,this.#Ge))}#Pe(){this.#we=Math.max(Math.min(1e-6,this.#Ge),Math.min(this.#Ge,this.#we)),this.#xe=Math.max(0,Math.min(this.#Ge-this.#we,this.#xe)),this.#be=Math.max(0,Math.min(Math.max(0,48*this.#ve.length-(this.#ce-y)),this.#be))}#Ue(){const e=this.#je.getBoundingClientRect();this.#de=e.width,this.#ce=e.height,this.#Ze();const t=window.devicePixelRatio>0?window.devicePixelRatio:1;this.#je.width=Math.round(e.width*t),this.#je.height=Math.round(e.height*t),this.#he.setTransform(t,0,0,t,0,0),this.#Pe(),this.#_e()}#Ze(){const e=Math.max(1,this.#de-118);this.#le=Math.min(e,Math.max(Math.min(120,e),this.#ue??Math.min(246,Math.max(132,.28*this.#de)))),this.#fe(this.#le,e)}setLabelWidth(e){this.#ue=e,this.#Ze(),this.#Be=void 0,this.#Ye(),this.#_e()}setRecording(e){this.#ge=void 0,this.#We=void 0,this.#Ne=void 0,this.#De(void 0,this.#Ce),this.#ke=e,this.#ye=new Map(e.chunks.map(e=>[e.id,e])),this.#Se=void 0,this.#be=0,this.#xe=0,this.#we=Math.min(5,Math.max(e.duration,.001)),this.clearSelection(),this.setFilter(this.#Te),this.#Xe()}updateRecording(e){if(this.#ke=e,this.#ye=new Map(e.chunks.map(e=>[e.id,e])),this.#Se=void 0,this.#We&&(this.#We=this.#ye.get(this.#We.id)),this.#Ee){const t=e.channels.find(e=>e.id===this.#Ee?.channel?.id),s=this.#Ee.chunk?this.#ye.get(this.#Ee.chunk.id):void 0;this.#Ee={...this.#Ee,channel:t,chunk:s},this.#$e(this.#Ee)}this.#Qe(),this.#Pe(),this.#De(this.#We,this.#Ce),this.#_e()}setShowChunks({visible:e}){this.#me=e,this.#Be=void 0,this.#Ye(),this.#_e()}selectChannel(e){if(null==e)return void this.clearSelection();"chunk"===this.#Ce&&this.setGrouping("channel");const t=this.#ve.findIndex(t=>
1"channel"===t.kind&&t.channel.id===e),s=this.#ke?.channels.find(t=>t.id===e);s&&(this.#Ee={channel:s,chunk:this.#We},t>=0&&(this.#be=Math.max(0,48*t-(this.#ce-y)/2+24)),this.#Pe(),this.#$e(this.#Ee),this.#_e())}setFilter(e){this.#Te=e.toLowerCase(),this.#Qe(),this.#be=0,this.#Be=void 0,this.#Ye(),this.#Pe(),this.#_e()}#Qe(){if(!this.#ke)return this.#ve=[],void this.#pe(0);this.#We?(this.#Se??=b(this.#ke),this.#ve=this.#Se.find(e=>e.chunk?.id===this.#We.id)?.children.filter(e=>x(e.channel,this.#Te))??[]):"channel"===this.#Ce?this.#ve=this.#ke.channels.filter(e=>x(e,this.#Te)).map(e=>({kind:"channel",channel:e,messages:e.messages})):(this.#Se??=b(this.#ke),this.#ve=function(e,t){const s=e.map(e=>({...e,children:e.children.filter(e=>x(e.channel,t))})).filter(e=>!t||e.children.length>0),n=s.filter(e=>e.chunk).sort((e,t)=>{const s=e.chunk,n=t.chunk;return s.startTime<n.startTime?-1:s.startTime>n.startTime?1:s.offset!==n.offset?s.offset-n.offset:s.id-n.id}),i=[],r=[],a=(e,t)=>e.end<t.end||e.end===t.end&&e.lane<t.lane;for(const c of n){const e=c.chunk;let t;if(r[0]&&r[0].end<e.startTime){t=r[0].lane,r[0]=r[r.length-1],r.pop();let e=0;for(;2*e+1<r.length;){let t=2*e+1;if(t+1<r.length&&a(r[t+1],r[t])&&t++,!a(r[t],r[e]))break;[r[e],r[t]]=[r[t],r[e]],e=t}}else t=i.length,i.push([]);i[t].push(c),r.push({end:e.endTime,lane:t});let s=r.length-1;for(;s>0;){const e=s-1>>>1;if(!a(r[s],r[e]))break;[r[s],r[e]]=[r[e],r[s]],s=e}}const o=(e,t)=>{const s=e.flatMap(e=>e.children),n=s.flatMap(e=>e.messages).sort((e,t)=>e.time-t.time);return{kind:"group",key:t,groups:e,children:s,messages:n}},h=i.map((e,t)=>o(e,t)),d=s.find(e=>"loose"===e.key);return d&&h.push(o([d],"loose")),h}(this.#Se,this.#Te)),this.#pe(this.#ve.length)}setGrouping(e){this.#We&&this.exitChunk(),this.#Ce=e,this.#Qe(),this.#be=0,this.#Be=void 0,this.#Ye(),this.#Pe(),this.#_e(),this.#De(void 0,this.#Ce),this.#Xe()}focusChunk(e){const t=this.#ye.get(e);t&&this.#We?.id!==e&&(this.#Ne??={grouping:this.#Ce,start:this.#xe,span:this.#we,scrollY:this.#be},this.#We=t,this.#Ce="channel",this.#Qe(),this.#be=0,this.#Be=void 0,this.#Ye(),this.#xe=Number(t.startTime-this.#ke.startTime)/1e9,this.#we=Math.max(1e-6,Number(t.endTime-t.startTime)/1e9),this.#Ee={chunk:t},this.#Pe(),this.#$e(this.#Ee),this.#De(t,this.#Ce),this.#Xe(),this.#_e())}exitChunk(){this.#We&&(this.#We=void 0,this.#Ne&&(this.#Ce=this.#Ne.grouping,this.#xe=this.#Ne.start,this.#we=this.#Ne.span,this.#be=this.#Ne.scrollY),this.#Ne=void 0,this.#Qe(),this.#Pe(),this.#Be=void 0,this.#Ye(),this.#De(void 0,this.#Ce),this.#Xe(),this.#_e())}destroy(){this.#Re.abort(),this.#ze.disconnect(),0!==this.#Ie&&cancelAnimationFrame(this.#Ie),this.#Ie=0,this.#Ye(),this.#ke=void 0,this.#ve=[],this.#Se=void 0,this.#ye.clear(),this.#Ee=void 0,this.#Be=void 0,this.#We=void 0,this.#Ne=void 0}clearSelection(){this.#Ee=void 0,this.#Be=void 0,this.#Ye(),this.#$e(),this.#_e()}zoom(e,t=.5){const s=this.#xe+this.#we*t;this.#we=Math.max(1e-6,Math.min(this.#Ge,this.#we/e)),this.#xe=s-this.#we*t,this.#Pe(),this.#_e(),this.#Xe()}pan(e){this.#xe+=e,this.#Pe(),this.#_e(),this.#Xe()}seek(e){this.#xe=e*(this.#Ge-this.#we),this.#Pe(),this.#_e(),this.#Xe()}fit(){this.#we=this.#We?Math.max(1e-6,Number(this.#We.endTime-this.#We.startTime)/1e9):this.#Ge,this.#xe=this.#We?Number(this.#We.startTime-this.#ke.startTime)/1e9:0,this.#Pe(),this.#_e(),this.#Xe()}#Je(){const e=Math.max(0,Math.floor(this.#be/48));return{first:e,last:Math.min(this.#ve.length,e+Math.ceil((this.#ce-y)/48)+1)}}#Ve(e,t){if(!this.#ke||t<y)return;const s=Math.floor((t-y+this.#be)/48),n=this.#ve[s];if(!n)return;if("group"===n.kind){if(!this.#me&&e>=this.#le){const t=this.#xe+(e-this.#le)/this.#Fe*this.#we;let s,i=6;for(const r of n.children){const n=d(r.messages,t);for(const t of[r.messages[n],r.messages[n-1]])t&&Math.abs(this.#Ke(t.time)-e)<i&&(i=Math.abs(this.#Ke(t.time)-e),s={channel:r.channel,message:t,chunk:null==t.chunkId?void 0:this.#ye.get(t.chunkId)})}return s}if("loose"===n.key)return{unchunked:!0};if(e<this.#le)return;for(const t of n.groups){const s=w(t,this.#ke.startTime);if(s&&e>=this.#Ke(s.start)-2&&e<=Math.max(this.#Ke(s.start)+3,this.#Ke(s.end))+2)return{chunk:t.chunk}}return}const{channel:i,messages:r}=n;
1if(e<this.#le)return{channel:i,chunk:n.chunk};const a=this.#xe+(e-this.#le)/this.#Fe*this.#we,o=d(r,a),h=[r[o],r[o-1]].filter(e=>!!e);h.sort((e,t)=>Math.abs(e.time-a)-Math.abs(t.time-a));const c=h[0];if(c&&Math.abs(this.#Ke(c.time)-e)<6)return{channel:i,message:c,chunk:null==c.chunkId?void 0:this.#ye.get(c.chunkId)};if("chunk"===this.#Ce||this.#We)return{channel:i,chunk:n.chunk};if(!this.#me)return{channel:i};for(let d=this.#ke.chunks.length-1;d>=0;d--){const t=this.#ke.chunks[d],s=t.ranges.get(i.id);if(s&&e>=this.#Ke(s.start)-2&&e<=this.#Ke(s.end)+2)return{channel:i,chunk:t}}return{channel:i}}#Ye(){this.#Le.hidden=!0}#qe(){if(!this.#Be||!this.#Ae)return void this.#Ye();const{channel:e,message:t,chunk:s}=this.#Be;this.#Le.textContent=t?`${e?.topic??"Unknown channel"} \xb7 ${l(t.time)} \xb7 ${s?`Chunk #${s.id}`:"Unchunked"} \xb7 ${c(t.size)}`:s?`Chunk #${s.id} \xb7 ${s.compression} \xb7 ${!1===s.loaded?"Messages not loaded":`${s.messageCount.toLocaleString()} messages \xb7 ${u(s.messageCount,Number(s.endTime-s.startTime)/1e9)}`}`:!0===this.#Be.unchunked?"Unchunked messages":`${e?.id??"?"} \xb7 ${e?.topic??"Unknown channel"}`,s&&(this.#Le.textContent+=`\nCompressed: ${c(s.compressedSize)} \xb7 Uncompressed: ${c(s.uncompressedSize)}`),this.#Le.hidden=!1;const n=this.#Le.offsetWidth;this.#Le.style.left=`${Math.max(8,Math.min(this.#Ae.x+14,this.#de-n-8))}px`,this.#Le.style.top=`${Math.max(8,Math.min(this.#Ae.y+18,this.#ce-this.#Le.offsetHeight-8))}px`}#_e(){0===this.#Ie&&(this.#Ie=requestAnimationFrame(()=>{this.#Ie=0,this.#et()}))}#tt(e){const{first:t,last:s}=this.#Je(),n=[];let i=[];const r=()=>{if(0===i.length)return;const e=new Path2D,t=i[0];e.moveTo(t.left,t.top),e.lineTo(t.right,t.top);for(let s=0;s<i.length;s++){const t=i[s];e.lineTo(t.right,t.bottom);const n=i[s+1];n&&e.lineTo(n.right,t.bottom)}for(let s=i.length-1;s>=0;s--){const t=i[s];e.lineTo(t.left,t.bottom),e.lineTo(t.left,t.top);const n=i[s-1];n&&e.lineTo(n.left,t.top)}e.closePath(),n.push(e),i=[]};for(let a=t;a<s;a++){const t=this.#ve[a],s="channel"!==t.kind||("channel"!==this.#Ce||this.#We)&&t.chunk?.id!==e.id?void 0:e.ranges.get(t.channel.id);if(!s){r();continue}const n=this.#Ke(s.start),o=Math.max(n+3,this.#Ke(s.end)),h=y+48*a-this.#be;i.push({left:n,right:o,top:h,bottom:h+48})}return r(),n}#et(){const e=this.#he;e.clearRect(0,0,this.#de,this.#ce),e.fillStyle="#10151b",e.fillRect(0,0,this.#de,this.#ce);const{first:t,last:s}=this.#Je();e.save(),e.beginPath(),e.rect(this.#le,y,this.#Fe,this.#ce-y),e.clip();for(let d=t;d<s;d++){const t=y+48*d-this.#be,s=this.#ve[d],n="channel"===s.kind&&s.channel.id===this.#Ee?.channel?.id&&(!s.chunk||s.chunk.id===this.#Ee.chunk?.id);e.fillStyle=n?"#293a4c":d%2==0?"#192028":"#151b22",e.fillRect(this.#le,t+2,this.#Fe,44)}const n=this.#we/Math.max(2,Math.floor(this.#Fe/110)),i=10**Math.floor(Math.log10(n)),r=[1,2,5,10].map(e=>e*i).find(e=>e>=n)??i;e.strokeStyle="#2a323d",e.lineWidth=1;for(let d=Math.ceil(this.#xe/r)*r;d<=this.#xe+this.#we+.01*r;d+=r){const t=this.#Ke(d);e.beginPath(),e.moveTo(t,y),e.lineTo(t,this.#ce),e.stroke()}const a=this.#Ee?.chunk?.id??this.#Be?.chunk?.id,o=this.#We?[this.#We]:"channel"===this.#Ce?this.#ke?.chunks??[]:[];for(const d of this.#me?o:[]){const t=Number(d.startTime-this.#ke.startTime)/1e9;if(Number(d.endTime-this.#ke.startTime)/1e9<this.#xe||t>this.#xe+this.#we)continue;const s=k[d.id%k.length];e.fillStyle=s,e.strokeStyle=s,e.lineWidth=a===d.id?2:1;for(const n of this.#tt(d))e.globalAlpha=a===d.id?.32:null==a?.16:.06,e.fill(n),e.globalAlpha=null==a||a===d.id?.85:.3,e.stroke(n)}e.globalAlpha=1;for(let c=t;c<s;c++){const t=this.#ve[c],s=y+48*c-this.#be+24;if("group"===t.kind&&this.#me){for(const n of t.groups){const t=w(n,this.#ke.startTime);if(!t||t.end<this.#xe||t.start>this.#xe+this.#we)continue;const i=Math.max(this.#le,this.#Ke(t.start)),r=Math.min(this.#le+this.#Fe,Math.max(this.#Ke(t.start)+3,this.#Ke(t.end))),o=n.chunk?k[n.chunk.id%k.length]:"#ffb570";e.fillStyle=o,e.strokeStyle=o,e.globalAlpha=null==a||a===n.chunk?.id?.3:.12,e.fillRect(i,s-12,r-i,24),e.globalAlpha=1,e.lineWidth=a===n.chunk?.id?2:1,e.strokeRect(i+.5,s-11.5,Math.max(1,r-i-1),23),e.font=v,e.textBaseline="middle",e.fillStyle="#e3edf8";const h=n.chunk?`#${n.chunk.id}`:"Unchunked";r-i>e.measureText(h).width+20&&e.fillText(h,i+9,s)}continue}const n=t.messages,i=d(n,this.#xe),r=d(n,this.#xe+this.#we+1e-9);let o=-1/0;e.beginPath(),e.strokeStyle="#d7e5f3",e.lineWidth=1,e.globalAlpha=.75;for(let a=i;a<r;a++){const t=n[a],i=Math.round(this.#Ke(t.time))+.5;i!==o&&(o=i,e.moveTo(i,s-6),e.lineTo(i,s+6))}e.stroke(),e.beginPath(),e.strokeStyle="#ffb570",o=-1/0;for(let a=i;a<r;a++){const t=n[a];if(null!=t.chunkId)continue;const i=Math.round(this.#Ke(t.time))+.5;i!==o&&(o=i,e.moveTo(i,s-7),e.lineTo(i,s+7))}e.stroke();
1const h=this.#Ee?.message,l="channel"===t.kind?t.channel.id===this.#Ee?.channel?.id&&(!t.chunk||t.chunk.id===h?.chunkId):t.groups.some(e=>e.chunk?.id===h?.chunkId||"loose"===e.key&&null==h?.chunkId);if(h&&l&&h.time>=this.#xe&&h.time<=this.#xe+this.#we){const t=this.#Ke(h.time);e.globalAlpha=1,e.strokeStyle="#ffdc7a",e.lineWidth=3,e.beginPath(),e.moveTo(t,s-11),e.lineTo(t,s+11),e.stroke(),e.lineWidth=2,e.strokeRect(t-6,s-13,12,26)}}e.globalAlpha=1;const h=this.#Ee?.message??this.#Be?.message;h&&(e.strokeStyle="#ffffff",e.setLineDash([3,4]),e.beginPath(),e.moveTo(this.#Ke(h.time),y),e.lineTo(this.#Ke(h.time),this.#ce),e.stroke(),e.setLineDash([])),e.restore(),e.fillStyle="#111820",e.fillRect(0,0,this.#le,this.#ce),e.fillRect(0,0,this.#de,y),e.font=v,e.textBaseline="middle",e.fillStyle="#8394a8",e.fillText("channel"===this.#Ce?"CHANNEL / TOPIC":"CHUNK LANES",18,21),e.save(),e.beginPath(),e.rect(this.#le,0,this.#Fe+18,y),e.clip();for(let d=Math.ceil(this.#xe/r)*r;d<=this.#xe+this.#we+.01*r;d+=r)e.fillStyle="#93a5b9",e.fillText(`${d.toFixed(Math.max(0,Math.min(9,-Math.floor(Math.log10(r)))))} s`,this.#Ke(d)+5,21);e.restore(),e.save(),e.beginPath(),e.rect(0,y,this.#le-8,this.#ce-y),e.clip();for(let d=t;d<s;d++){const t=this.#ve[d],s=y+48*d-this.#be;e.font=v,"channel"===t.kind&&t.channel.id===this.#Ee?.channel?.id&&(e.fillStyle="#293a4c",e.fillRect(0,s+2,this.#le-8,44)),"group"!==t.kind?(e.fillStyle="#64819e",e.fillText(String(t.channel.id).padStart(2,"0"),"chunk"===this.#Ce?27:18,s+24-4),e.fillStyle="#dbe5ef",this.#st(t.channel.topic,70,s+24-4,this.#le-82),e.fillStyle="#73869a",e.fillText(`${t.messages.length.toLocaleString()} messages \xb7 ${u(t.messages.length,f(this.#ke,t.chunk)?.duration)}`,70,s+24+12)):(e.fillStyle="loose"===t.key?"#ffb570":"#93a5b9",this.#st("loose"===t.key?"Unchunked":`Lane ${t.key+1}`,18,s+24-4,this.#le-30),e.fillStyle="#8aa1b9",e.fillText(`${t.groups.length} ${"loose"===t.key?"group":1===t.groups.length?"chunk":"chunks"}`,18,s+24+12))}if(e.restore(),e.strokeStyle="#2b3542",e.beginPath(),e.moveTo(this.#le-.5,0),e.lineTo(this.#le-.5,this.#ce),e.moveTo(0,41.5),e.lineTo(this.#de,41.5),e.stroke(),0===this.#ve.length&&this.#ke&&(e.fillStyle="#93a5b9",e.font="14px system-ui",e.fillText(this.#Te?"No matching channels":"No channels in this recording",this.#le+24,85)),48*this.#ve.length>this.#ce-y){const t=this.#ce-y,s=48*this.#ve.length;e.fillStyle="#52647a",e.fillRect(this.#de-7,y+this.#be/s*t,4,Math.max(18,t*t/s))}}#st(e,t,s,n){if(this.#he.measureText(e).width<=n)return void this.#he.fillText(e,t,s);let i=e.length;for(;i>0&&this.#he.measureText(e.slice(0,i)+"\u2026").width>n;)i--;this.#he.fillText(e.slice(0,i)+"\u2026",t,s)}}function S(e,t=520,s=320,n){const i=Number.isFinite(t)?Math.max(1,t):520,r=Number.isFinite(s)?Math.max(1,s):320,a=null!=n&&Number.isFinite(n)?n:null==e?320:42+48*Math.max(1,e)+2;return Math.min(i,Math.max(r,a))}const T=(0,i.forwardRef)(function(e,t){const s=(0,i.useRef)(null),n=(0,i.useRef)(null),r=(0,i.useRef)(null),d=(0,i.useRef)(void 0),b=(0,i.useRef)(void 0),x=(0,i.useRef)(e),w=(0,i.useRef)(0),k=(0,i.useRef)(0),[y,v]=(0,i.useState)(),[T,I]=(0,i.useState)(),[M,B]=(0,i.useState)(!0),[E,A]=(0,i.useState)("channel"),[z,R]=(0,i.useState)(),[W,N]=(0,i.useState)(!0),[j,$]=(0,i.useState)(""),[O,L]=(0,i.useState)({start:0,span:0,duration:0}),[D,U]=(0,i.useState)(),[H,F]=(0,i.useState)(0),[P,_]=(0,i.useState)(),[Y,V]=(0,i.useState)(),[X,q]=(0,i.useState)(!1),[G,K]=(0,i.useState)(),Z=null!=y&&null==D&&null==Y,[Q,J]=(0,i.useState)(),[ee,te]=(0,i.useState)({width:246,max:600}),se=e.maxHeight??(null==Q?520:1200),ne=e.maxHeight??1200,ie=S(0,ne,e.minHeight,0),re=S(0,ne,e.minHeight,Number.MAX_SAFE_INTEGER),ae=S(G,se,e.minHeight,Q),oe=f(y),he=f(y,z),de=u(y?.messageCount??0,oe?.duration),ce=(0,i.useMemo)(()=>function(e){let t=0,s=0;for(const n of e)t+=n.compressedSize,s+=n.uncompressedSize;return t>0&&s>0?s/t:void 0}(y?.chunks??[]),[y?.chunks]);(0,i.useEffect)(()=>{x.current=e}),(0,i.useEffect)(()=>{const e=new C(s.current,e=>{I(e),e&&B(!0)},(e,t,s)=>{L({start:e,span:t,duration:s}),b.current?.requestWindow(e,t)},n.current,(e,t)=>{R(e),A(t)}
1,K,(e,t)=>{te({width:e,max:t})}),t=new a(x.current.createWorker,{onCatalog:t=>{V(void 0),v(t),e.setRecording(t),x.current.onLoad?.(t)},onWindow:t=>{V(void 0),v(t),e.updateRecording(t)},onProgress:F,onPreload:_,onBusy:U,onError:e=>{V(e.message),x.current.onError?.(e)}});return d.current=e,b.current=t,()=>{w.current++,t.cancel(),e.destroy(),d.current=void 0,b.current=void 0}},[]);const le=e=>{w.current++,V(void 0),b.current?.openFile(e)},ue=(e,t)=>{w.current++,V(void 0),b.current?.openReadable(e,t)};async function fe(){const e=++w.current;try{const t=await async function(){const e=[];let t=0n;const s=new m.zc({useChunks:!0,chunkSize:6e3,writable:{position:()=>t,write:async s=>{e.push(new Uint8Array(s)),t+=BigInt(s.length)}}});await s.start({profile:"",library:"mcap-inspector demo"});const n=[["/camera/image",10],["/camera/info",10],["/imu",200],["/imu/mag",50],["/tf",30],["/odom",30],["/scan",5],["/diagnostics",2],["/joint_states",40],["/navsat",1],["/pointcloud",2],["/cmd_vel",20]],i=[];for(const[r]of n)i.push(await s.registerChannel({schemaId:0,topic:r,messageEncoding:"json",metadata:new Map}));for(let r=0;r<4e3;r++)for(let e=0;e<n.length;e++){if(r%Math.round(200/n[e][1])!==e%2)continue;const t=1720000000000000000n+5000000n*BigInt(r);await s.addMessage({channelId:i[e],sequence:r,logTime:t,publishTime:t-2000000n,data:(new TextEncoder).encode(JSON.stringify({value:Math.round(100*Math.sin(r/20))}))})}return await s.end(),new File(e,"demo-robot.mcap",{type:"application/octet-stream"})}();e===w.current&&le(t)}catch(t){if(e===w.current){const e=t instanceof Error?t:new Error(String(t));V(e.message),x.current.onError?.(e)}}}function ge(){B(!1),d.current?.clearSelection()}(0,i.useEffect)(()=>{e.file&&!e.readable&&le(e.file)},[e.file,e.readable]),(0,i.useEffect)(()=>{e.readable&&ue(e.readable,e.name)},[e.readable,e.name]),(0,i.useImperativeHandle)(t,()=>({loadFile:le,loadReadable:ue,setRecording:e=>{w.current++,b.current?.cancel(),V(void 0),v(e),d.current?.setRecording(e)},focusChunk:e=>d.current?.focusChunk(e),exitChunk:()=>d.current?.exitChunk()}));const pe=z?y?.channels.filter(e=>z.ranges.has(e.id))??[]:y?.channels??[];return(0,o.jsxs)("div",{onKeyDown:e=>{"Escape"===e.key&&z&&(e.preventDefault(),d.current?.exitChunk())},onDragEnter:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),k.current++,q(!0))},onDragOver:e=>{e.dataTransfer.types.includes("Files")&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDragLeave:()=>{--k.current<=0&&(k.current=0,q(!1))},onDrop:e=>{e.preventDefault(),k.current=0,q(!1);const t=e.dataTransfer.files;t.length>1?V("Please drop one MCAP file at a time."):t[0]&&le(t[0])},children:[(0,o.jsxs)("header",{children:[(0,o.jsxs)("div",{className:"brand",children:[(0,o.jsx)("span",{className:"brand-icon","aria-hidden":"true",children:"\u25a5"}),(0,o.jsxs)("h1",{children:["MCAP ",(0,o.jsx)("span",{children:"Inspector"})]})]}),(0,o.jsxs)("div",{className:"header-actions",children:[(0,o.jsx)("span",{className:"local",children:"Files stay in your browser"}),(0,o.jsx)("button",{onClick:()=>{fe()},children:"Load demo"}),(0,o.jsx)("button",{className:"primary",onClick:()=>r.current?.click(),children:"Open MCAP \u2197"}),(0,o.jsx)("input",{ref:r,type:"file",accept:".mcap",hidden:!0,"aria-label":"Choose MCAP file",onChange:e=>{const t=e.target.files?.[0];t&&le(t),e.target.value=""}})]})]}),(0,o.jsxs)("main",{children:[(0,o.jsxs)("section",{className:"file-bar","aria-label":"Recording",children:[(0,o.jsxs)("div",{children:[(0,o.jsx)("div",{className:"eyebrow",children:"RECORDING"}),(0,o.jsx)("div",{id:"filename",children:y?.name??"No recording open"})]}),(0,o.jsx)("div",{className:"stats",children:y?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("span",{children:[(0,o.jsx)("strong",{children:y.channels.length}),"known channels"]}),(0,o.jsxs)("span",{children:[(0,o.jsx)("strong",{children:y.chunks.length}),"chunks"]}),(0,o.jsxs)("span",{children:[(0,o.jsxs)("strong",{children:[y.messageCount.toLocaleString()," \xb7 ",de]}),!0===y.partial?"loaded messages":"messages"]}),(0,o.jsxs)("span",{children:[(0,o.jsx)("strong",{children:l(y.duration)}),"duration"]}),(0,o.jsxs)("span",{children:[(0,o.jsx)("strong",{children:c(y.fileSize)}),"file size"]}
1),(0,o.jsxs)("span",{title:"Total uncompressed chunk bytes divided by stored chunk bytes, across all chunks. Excludes file headers, indexes, and unchunked messages.",children:[(0,o.jsx)("strong",{children:null==ce?"\u2014":`${ce.toFixed(2)}x`}),"compression ratio"]})]}):(0,o.jsx)("span",{children:"Select or drop an MCAP file to explore its structure."})})]}),(0,o.jsxs)("div",{className:"toolbar",children:[(0,o.jsxs)("label",{className:"search",children:[(0,o.jsx)("span",{"aria-hidden":"true",children:"\u2315"}),(0,o.jsx)("input",{value:j,placeholder:"Filter topic or channel ID","aria-label":"Filter topic or channel ID",onChange:e=>{$(e.target.value),d.current?.setFilter(e.target.value)}})]}),(0,o.jsxs)("div",{className:"grouping",role:"group","aria-label":"Group timeline by",children:[(0,o.jsx)("span",{children:"Group by"}),(0,o.jsx)("button",{"aria-pressed":"channel"===E,onClick:()=>d.current?.setGrouping("channel"),children:"Channels"}),(0,o.jsx)("button",{"aria-pressed":"chunk"===E,onClick:()=>d.current?.setGrouping("chunk"),children:"Chunks"})]}),(0,o.jsxs)("button",{"aria-pressed":W,onClick:()=>{N(!W),d.current?.setShowChunks({visible:!W})},children:["Chunk outlines ",W?"on":"off"]}),(0,o.jsxs)("div",{className:"view-controls",children:[(0,o.jsx)("button",{"aria-label":"Zoom out",onClick:()=>d.current?.zoom(1/1.8),children:"\u2212"}),(0,o.jsx)("button",{"aria-label":"Zoom in",onClick:()=>d.current?.zoom(1.8),children:"+"}),(0,o.jsx)("button",{onClick:()=>d.current?.fit(),children:z?"Fit chunk":"Fit recording"}),(0,o.jsx)("button",{"aria-pressed":M,onClick:()=>{M?ge():B(!0)},children:"Details"})]})]}),z&&(0,o.jsxs)("div",{className:"group-hint",children:[(0,o.jsx)("button",{onClick:()=>d.current?.exitChunk(),children:"\u2190 Full recording"}),(0,o.jsxs)("strong",{children:["Chunk #",z.id]}),(0,o.jsx)("span",{children:"Only messages in this chunk are shown."})]}),!z&&"chunk"===E&&(0,o.jsx)("div",{className:"group-hint",children:(0,o.jsx)("span",{children:"Sequential chunks share a lane; overlapping chunks use separate lanes. Double-click a chunk for its channel view."})}),he&&"channel"===E&&(0,o.jsx)("div",{className:"group-hint",children:(0,o.jsxs)("span",{children:["Channel rates averaged over"," ",z?"loaded chunk interval":0===he.start&&he.end===y?.duration?"full recording":"loaded interval",": ",l(he.start)," \u2013"," ",l(he.end)," (including silence)."]})}),Y&&(0,o.jsx)("div",{id:"error",role:"alert",children:Y}),(0,o.jsxs)("section",{className:"workspace",style:{"--mcap-inspector-height":`${ae}px`},children:[(0,o.jsxs)("div",{className:"plot",children:[(0,o.jsx)("canvas",{ref:s,tabIndex:0,"aria-label":"MCAP timeline. Drag to pan, scroll for channels, Shift scroll for time, Control or Command scroll to zoom. Arrow keys pan, plus and minus zoom, Home fits recording."}),Z&&(0,o.jsx)(h,{axis:"x",label:"Resize channel and topic column",value:ee.width,min:Math.min(120,ee.max),max:ee.max,style:{left:ee.width},onChange:e=>d.current?.setLabelWidth(e)}),(0,o.jsx)("div",{ref:n,className:"tooltip",hidden:!0}),!y&&"catalog"!==D&&(0,o.jsxs)("div",{className:"empty",children:[(0,o.jsx)("div",{className:"empty-mark","aria-hidden":"true",children:"\u25a5"}),(0,o.jsx)("h2",{children:"See how your recording fits together."}),(0,o.jsx)("p",{children:"Drop an MCAP file here, or choose one to begin."}),(0,o.jsx)("button",{className:"primary",onClick:()=>r.current?.click(),children:"Choose MCAP file"}),(0,o.jsx)("button",{className:"text-button",onClick:()=>{fe()},children:"Explore a demo recording"}),(0,o.jsx)("small",{children:"Messages are ticks. Colored outlines show their chunks."})]}),"catalog"===D&&(0,o.jsx)("div",{className:"loading",children:(0,o.jsxs)("div",{className:"loading-card",children:[(0,o.jsx)("h2",{children:"Reading recording structure"}),(0,o.jsx)("progress",{max:1,value:H,"aria-label":"Reading recording structure"}),(0,o.jsxs)("span",{children:[Math.round(100*H),"%"]}),(0,o.jsx)("p",{children:"Locating chunks without reading their message payloads."}),(0,o.jsx)("button",{onClick:()=>b.current?.cancel(),children:"Cancel"})]})}),"window"===D&&(0,o.jsxs)("div",{className:"window-loading",role:"status",children:[(0,o.jsxs)("span",{children:["Loading visible messages\u2026 ",Math.round(100*H),"%"]}),(0,o.jsx)("progress",{max:1,value:H,"aria-label":"Loading visible messages"})]})]}),M&&(0,o.jsxs)("aside",{"aria-label":"Details",children:[(0,o.jsxs)("div",{className:"inspector-heading",children:[(0,o.jsx)("span",{className:"eyebrow",children:"DETAILS"}),(0,o.jsx)("button",{"aria-label":"Close details",onClick:ge,children:"\xd7"})]}),(0,o.jsxs)("label",{className:"channel-picker",children:["Inspect channel",(0,o.jsxs)("select",{value:T?.channel?.id??"",onChange:e=>d.current?.selectChannel(""===e.target.value?void 0:Number(e.target.value)),children:[(0,o.jsx)("option",{value:"",children:"Choose a channel\u2026"}),pe.map(e=>(0,o.jsxs)("option",{value:e.id,children:[e.id," \xb7 ",e.topic]},e.id))]})]}),(0,o.jsx)(g,{selection:T,recording:y})]})]}),y&&(0,o.jsx)(h,{style:{visibility:Z?"visible":"hidden"},axis:"y",label:"Resize inspector height",value:ae,min:ie,max:re,onChange:J}),(0,o.jsx)(p,{...O,onSeek:e=>d.current?.seek(e)}),(0,o.jsxs)("footer",{children:[(0,o.jsx)("span",{children:"Drag to pan \xb7 Scroll for channels \xb7 Shift + scroll for time \xb7 Ctrl / \u2318 + scroll to zoom"}),(0,o.jsx)("span",{role:"status",children:D?"Loading\u2026":"loading"===P?"Preloading in the background\u2026":"complete"===P?"Recording preloaded":"paused"===P?"Preloading paused \xb7 load on demand":!0===y?.partial?"Messages load as you pan and zoom":"Ready"})]})]}),X&&(0,o.jsx)("div",{id:"drop-overlay",children:(0,o.jsxs)("div",{children:[(0,o.jsx)("span",{"aria-hidden":"true",children:"\u2193"}),(0,o.jsx)("h2",{children:"Drop your MCAP file"})]})})]})});function I(){return new Worker(new URL(s.p+s.u(316),s.b),{type:void 0})}const M=(0,i.forwardRef)(function({className:e,...t},s){const n=(0,i.useRef)(null),[a,h]=(0,i.useState)();return(0,i.useEffect)(()=>{n.current&&h(n.current.shadowRoot??n.current.attachShadow({mode:"open"}))},[]),(0,o.jsx)("div",{ref:n,className:e,role:"region","aria-label":"MCAP inspector",children:a&&(0,r.createPortal)((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("style",{children:':host {\n  display: block;\n  position: relative;\n  container-type: inline-size;\n  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;\n  color:#dce6f2;\n  background:#0c1117;\n  font-synthesis:none;\n  color-scheme:dark;\n  font-size:14px\n}\n* {\n  box-sizing:border-box\n}\nbutton,input,select {\n  font:inherit\n}\nbutton {\n  color:#c9d7e7;\n  background:#1b2531;\n  border:1px solid #334254;\n  border-radius:6px;\n  padding:8px 12px;\n  cursor:pointer;\n  white-space:nowrap\n}\nbutton:hover {\n  background:#293748;\n  border-color:#59728e\n}\nbutton:focus-visible,input:focus-visible,select:focus-visible,canvas:focus-visible,.resize-handle:focus-visible {\n  outline:2px solid #79baff;\n  outline-offset:2px\n}\nbutton.primary {\n  background:#8dc3ff;
1\n  color:#101820;\n  border-color:#8dc3ff;\n  font-weight:650\n}\nbutton.primary:hover {\n  background:#b2d7ff\n}\n.text-button {\n  background:transparent;\n  border:0;\n  color:#a6caff\n}\nheader {\n  height:76px;\n  border-bottom:1px solid #26313d;\n  display:flex;\n  align-items:center;\n  justify-content:space-between;\n  padding:0 26px;\n  gap:20px\n}\n.brand {\n  display:flex;\n  align-items:center;\n  gap:12px;\n  white-space:nowrap\n}\n.brand-icon {\n  color:#8dc3ff;\n  border:1px solid #3c6289;\n  border-radius:7px;\n  width:34px;\n  height:34px;\n  display:grid;\n  place-items:center;\n  font-size:25px\n}\nh1 {\n  font-size:18px;\n  letter-spacing:-.5px;\n  font-weight:700;\n  margin:0\n}\nh1 span {\n  font-weight:400;\n  color:#94a7bc;\n  border-left:1px solid #354354;\n  margin-left:14px;\n  padding-left:14px;\n  letter-spacing:0\n}\n.header-actions {\n  display:flex;\n  align-items:center;\n  gap:10px\n}\n.local {\n  font-size:12px;\n  color:#859bb1;\n  margin-right:10px\n}\nmain {\n  padding:24px 26px 0\n}\n.file-bar {\n  display:flex;\n  justify-content:space-between;\n  align-items:center;\n  gap:20px;\n  min-height:66px;\n  margin-bottom:22px\n}\n.eyebrow {\n  font-size:11px;\n  font-weight:600;\n  letter-spacing:1.6px;\n  color:#7e93aa\n}\n#filename {\n  font-size:19px;\n  margin-top:7px;\n  overflow-wrap:anywhere\n}\n.stats {\n  display:flex;\n  gap:24px;\n  flex-wrap:wrap;\n  color:#7e94ab;\n  font-size:12px\n}\n.stats span {\n  display:flex;\n  flex-direction:column;\n  gap:5px\n}\n.stats strong {\n  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;\n  font-size:17px;\n  font-weight:500;\n  color:#dde9f7\n}\n.toolbar {\n  display:flex;\n  align-items:center;\n  gap:16px;\n  background:#131b24;\n  padding:12px;\n  border:1px solid #293544;\n  border-radius:8px 8px 0 0;\n  flex-wrap:wrap\n}\n.search {\n  display:flex;\n  align-items:center;\n  gap:8px;\n  border:1px solid #334152;\n  background:#0e151d;\n  border-radius:5px;\n  padding:0 10px;\n  max-width:100%\n}\n.search span {\n  font-size:25px;\n  color:#758da6\n}\ninput:not([type=range]):not([type=file]) {\n  background:transparent;\n  border:0;\n  color:#dde9f7;\n  padding:8px 0;\n  min-width:0;\n  width:208px\n}\ninput::placeholder {\n  color:#7c90a6\n}\n.view-controls {\n  display:flex;\n  align-items:center;\n  gap:6px;\n  margin-left:auto\n}\nselect {\n  background:#1b2531;\n  color:#cfdaea;\n  border:1px solid #334254;\n  border-radius:5px;\n  padding:7px;\n  max-width:100%\n}\n.view-controls button {\n  padding:7px 10px\n}\n.resize-handle { touch-action:none; user-select:none; position:relative; z-index:2; }\n.resize-handle::after { content:""; position:absolute; background:#59738d; border-radius:2px; }\n.resize-handle:hover,.resize-handle:focus-visible { background:#5aafff33; }\n.resize-x { position:absolute; top:0; bottom:0; width:10px; transform:translateX(-50%); cursor:col-resize; }\n.resize-x::after { width:3px; height:28px; top:7px; left:3px; }\n.resize-y { height:12px; cursor:row-resize; background:#111820; border:1px solid #293544; border-top:0; }\n.resize-y::after { width:40px; height:3px; top:4px; left:calc(50% - 20px); }\n.workspace {\n  display:flex;\n  border:1px solid #293544;\n  border-top:0;\n  height:var(--mcap-inspector-height, 520px);\n  min-height:0\n}\n.plot {\n  flex:1;\n  position:relative;\n  min-width:0;\n  overflow:hidden\n}\ncanvas {\n  display:block;\n  width:100%;\n  height:100%;\n  cursor:grab;\n  touch-action:none\n}\naside {\n  width:270px;\n  flex-shrink:0;\n  background:#111820;\n  border-left:1px solid #2b3542;\n  padding:16px 18px;\n  overflow:auto\n}\n.inspector-heading {\n  display:flex;\n  align-items:center;\n  justify-content:space-between\n}\n.inspector-heading button {\n  background:transparent;\n  border:0;\n  padding:0 4px;\n  color:#8299b1;\n  font-size:22px\n}\nh2 {\n  font-size:18px;\n  font-weight:550;\n  letter-spacing:-.3px\n}\np {\n  font-size:14px;\n  line-height:1.7;\n  color:#a0b1c4\n}\ndl {\n  margin:16px 0\n}\ndl>div {\n  margin:0 0 12px\n}\ndt {\n  font-size:11px;\n  color:#7d91a8;\n  margin-bottom:4px\n}\ndd {\n  font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;\n  margin:0;\n  overflow-wrap:anywhere;\n  color:#cfdfef\n}\n.navigator {\n  border:1px solid #293544;\n  border-top:0;\n  background:#131b24;\n  padding:13px 16px;\n  display:flex;\n  align-items:center;\n  gap:14px;\n  border-radius:0 0 8px 8px;\n  font:12px ui-monospace,SFMono-Regular,Consolas,monospace;
1\n  color:#8fa6be\n}\n.navigator span {\n  white-space:nowrap\n}\n#window-size {\n  border-left:1px solid #334153;\n  padding-left:14px;\n  color:#bdd0e5\n}\nfooter {\n  display:flex;\n  justify-content:space-between;\n  gap:20px;\n  color:#71869d;\n  font-size:11px;\n  padding:15px 0;\n  line-height:1.7\n}\n.empty,.loading {\n  position:absolute;\n  inset:0;\n  display:flex;\n  flex-direction:column;\n  align-items:center;\n  justify-content:center;\n  background:#10151bf5;\n  text-align:center;\n  padding:24px\n}\n.empty {\n  padding-left:min(10%,80px)\n}\n.empty h2 {\n  font-size:25px;\n  margin:20px 0 0\n}\n.empty p {\n  margin:12px 0 22px\n}\n.empty small {\n  color:#6e859e;\n  font-size:12px;\n  margin-top:24px\n}\n.empty-mark {\n  font-size:48px;\n  color:#7db4ed\n}\n.loading-card {\n  width:min(360px,100%)\n}\n.loading-card h2 {\n  overflow-wrap:anywhere\n}\n.loading-card progress {\n  width:100%;\n  accent-color:#8dc3ff;\n  height:8px\n}\n.tooltip {\n  position:absolute;\n  pointer-events:none;\n  z-index:3;\n  background:#263547;\n  border:1px solid #59738d;\n  border-radius:5px;\n  padding:8px 10px;\n  font:12px/1.5 ui-monospace,SFMono-Regular,Consolas,monospace;\n  max-width:min(460px,90%);\n  white-space:pre-line;\n  box-shadow:0 4px 20px #0006\n}\n#error {\n  background:#372127;\n  border:1px solid #8c4855;\n  padding:12px 16px;\n  color:#ffb9b9;\n  overflow-wrap:anywhere\n}\n#drop-overlay {\n  position:absolute;\n  inset:12px;\n  z-index:10;\n  border:2px dashed #8dc3ff;\n  border-radius:12px;\n  background:#12243bef;\n  display:grid;\n  place-items:center;\n  text-align:center;\n  pointer-events:none\n}\n#drop-overlay span {\n  font-size:52px;\n  color:#8dc3ff\n}\n#drop-overlay h2 {\n  font-size:28px\n}\n[hidden] {\n  display:none!important\n}\n@container(min-width:1600px) {\n  aside {\n  width:300px\n}\n}\n@container(max-width:1050px) {\n  .local {\n  display:none\n}\n.stats {\n  gap:18px\n}\naside {\n  width:235px\n}\n.toolbar {\n  gap:10px\n}\n}\n@container(max-width:760px) {\n  header {\n  height:auto;\n  min-height:72px;\n  padding:16px;\n  flex-wrap:wrap;\n  gap:12px\n}\nh1 {\n  font-size:16px\n}\nmain {\n  padding:16px 12px 0\n}\n.file-bar {\n  align-items:flex-start;\n  flex-direction:column;\n  margin-bottom:16px;\n  gap:16px\n}\n.stats strong {\n  font-size:14px\n}\n.workspace {\n  height:auto;\n  display:block\n}\n.plot {\n  height:var(--mcap-inspector-height, 520px)\n}\naside {\n  width:100%;\n  border-left:0;\n  border-top:1px solid #293544;\n  max-height:320px\n}\n.toolbar {\n  gap:12px\n}\n.view-controls {\n  flex-wrap:wrap\n}\n.search {\n  flex:1\n}\n.search input {\n  width:100%\n}\n.empty h2 {\n  font-size:21px\n}\n.navigator {\n  gap:8px;\n  padding:12px 8px;\n  font-size:11px\n}\n#window-size {\n  display:none\n}\nfooter {\n  flex-direction:column;\n  gap:4px\n}\n}\n\n.grouping { display: flex; align-items: center; gap: 0; }\n.grouping > span { margin-right: 8px; color: #9eafc2; font-size: 12px; white-space: nowrap; }\n.grouping button { border-radius: 0; padding: 7px 10px; }\n.grouping button:first-of-type { border-radius: 5px 0 0 5px; }\n.grouping button:last-of-type { border-radius: 0 5px 5px 0; margin-left: -1px; }\n.grouping button[aria-pressed="true"] { background: #294b6e; border-color: #699cd0; color: #e4f0ff; z-index: 1; }\n.group-hint { padding: 9px 14px; color: #99afc7; background: #111c28; border: 1px solid #293544; border-top: 0; font-size: 12px; }\n\n.group-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }\n.group-hint span { margin-right: auto; }\n.group-hint button { font-size: 12px; padding: 4px 8px; }\n.channel-picker { display:flex; flex-direction:column; gap:8px; margin:18px 0; color:#a8bdd2; font-size:12px; }\n.overview { position:relative; flex:1; min-width:80px; height:28px; }\n.overview-track { position:absolute; inset:8px 0; background:#263647; border-radius:3px; overflow:hidden; }\n.viewport-range { position:absolute; top:0; bottom:0; background:#77b9ff; border:1px solid #d1e8ff; border-radius:2px; }\n.overview input { position:absolute; inset:0; width:100%; height:100%; margin:0; appearance:none; background:transparent; cursor:ew-resize; }\n.overview input::-webkit-slider-runnable-track { background:transparent; }\n.overview input::-moz-range-track, .overview input::-moz-range-progress { background:transparent; }\n.overview input::-webkit-slider-thumb { appearance:none; width:14px; height:24px; background:transparent; }\n.overview input::-moz-range-thumb { width:14px; height:24px; border:0; background:transparent; }\n.window-loading { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); width:min(320px,90%); padding:16px; display:flex; flex-direction:column; gap:10px; text-align:center; border:1px solid #526f8d; border-radius:8px; background:#182a3fee; color:#d4e7fc; pointer-events:none; box-shadow:0 4px 20px #0006; }\n.window-loading progress { width:100%; accent-color:#8dc3ff; }\nbutton[aria-pressed=true] { border-color:#7ebdff; background:#26435f; }\n'}),(0,o.jsx)(T,{...t,createWorker:t.createWorker??I,ref:s})]}),a)})});function B(){return(0,o.jsx)(n.A,{title:"MCAP inspector",description:"Inspect MCAP channels, messages, and overlapping chunks locally in your browser.",children:(0,o.jsx)(M,{})})}}}]);

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.