OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-core / schema / spec / local / hyperdb / index.js

1 lines · javascript ref:
const{IndexEncoder:e,c:n,b4a:t}=require("hyperdb/runtime"),{version:o,getEncoding:r,setVersion:c}=require("./messages.js"),l={schema:o,db:11},d=require("../../../../lib/core/hyperdb/local/local.js"),s=new e([],{prefix:0}),u=r("@local/stats"),i={name:"@local/stats",id:0,version:0,encodeKey:e=>s.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>s.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return u.preencode(r,o),r.buffer=t.allocUnsafe(r.end),u.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){c(e);const o={start:0,end:t.byteLength,buffer:t};return u.decode(o)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},a=new e([],{prefix:1}),f=r("@local/migration-status"),g={name:"@local/migrations",id:1,version:0,encodeKey:e=>a.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>a.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return f.preencode(r,o),r.buffer=t.allocUnsafe(r.end),f.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){c(e);const o={start:0,end:t.byteLength,buffer:t};return f.decode(o)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},y=new e([],{prefix:2}),b=r("@local/room-migration-stats"),p={name:"@local/room-migration-stats",id:2,version:0,encodeKey:e=>y.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>y.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return b.preencode(r,o),r.buffer=t.allocUnsafe(r.end),b.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){c(e);const o={start:0,end:t.byteLength,buffer:t};return b.decode(o)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},m=new e([e.BUFFER],{prefix:3});function K(e){const n=e.roomKey;return void 0===n?[]:[n]}const v=r("@local/room-migration/hyperdb#3"),x=d.roomMigrationsTrigger,h={name:"@local/room-migrations",id:3,version:0,encodeKey(e){const n=[e.roomKey];return m.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>m.encodeRange({gt:e?K(e):null,lt:n?K(n):null,gte:t?K(t):null,lte:o?K(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return v.preencode(r,o),r.buffer=t.allocUnsafe(r.end),v.encode(r,o),r.buffer},trigger:x,reconstruct:function(e,n,t){const o=m.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=v.decode(r);return l.roomKey=o[0],l},reconstructKey:function(e){return{roomKey:m.decode(e)[0]}},indexes:[],decodedVersion:0},R=new e([e.UINT,e.BUFFER],{prefix:4});function w(e){const n=[],t=e.priority;if(void 0===t)return n;n.push(t);const o=e.roomKey;return void 0===o||n.push(o),n}const U={name:"@local/room-migrations-by-priority",version:0,id:4,encodeKey:e=>R.encode(w(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>R.encodeRange({gt:e?w(e):null,lt:n?w(n):null,gte:t?w(t):null,lte:o?w(o):null}),encodeValue:e=>U.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[R.encode([e.priority,e.roomKey])],reconstruct:(e,n)=>n,offset:h.indexes.length,collection:h};h.indexes.push(U);const V=new e([],{prefix:5}),F=r("@local/identity-record"),k={name:"@local/identity",id:5,version:0,encodeKey:e=>V.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>V.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return F.preencode(r,o),r.buffer=t.allocUnsafe(r.end),F.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){c(e);const o={start:0,end:t.byteLength,buffer:t};return F.decode(o)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},B=new e([e.BUFFER],{prefix:6});function E(e){const n=e.roomKey;return void 0===n?[]:[n]}const I=r("@local/room/hyperdb#6"),T=d.roomsTrigger,L={name:"@local/rooms",id:6,version:9,encodeKey(e){const n=[e.roomKey];return B.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>B.encodeRange({gt:e?E(e):null,lt:n?E(n):null,gte:t?E(t):null,lte:o?E(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return o.version=n,I.preencode(r,o),r.buffer=t.allocUnsafe(r.end),I.encode(r,o),r.buffer},trigger:T,reconstruct:function(e,n,t){const o=B.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=I.decode(r);return l.roomKey=o[0],L.decodedVersion=l.version,l},reconstructKey:function(e){return{roomKey:B.decode(e)[0]}},indexes:[],decodedVersion:0},N=new e([e.BUFFER],{prefix:7});function D(e){const n=e.discoveryKey;return void 0===n?[]:[n]}const A={name:"@local/rooms-by-discovery-key",version:0,id:7,encodeKey:e=>N.encode(D(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>N.encodeRange({gt:e?D(e):null,lt:n?D(n):null,gte:t?D(t):null,lte:o?D(o):null}),encodeValue:e=>A.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[N.encode([e.discoveryKey])],reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(A);const P=new e([e.UINT,e.BUFFER],{prefix:8}),M=d.roomsByTimestampMap;function O(e){const n=e.timestamp;return void 0===n?[]:[n]}const C={name:"@local/rooms-by-timestamp",version:0,id:8,encodeKey:e=>P.encode(O(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>P.encodeRange({gt:e?O(e):null,lt:n?O(n):null,gte:t?O(t):null,lte:o?O(o):null}),encodeValue:e=>C.collection.encodeKey(e),encodeIndexKeys(e,n){const t=M(e,n),o=new Array(t.length);for(let n=0;n<t.length;n++){const r=t[n];o[n]=P.encode([r.timestamp,e.roomKey])}return o},reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(C);const G=new e([e.UINT,e.UINT,e.BUFFER],{prefix:9}),S=d.roomsByTypeAndTimestampMap;function q(e){const n=[],t=e.type;if(void 0===t)return n;n.push(t);const o=e.timestamp;return void 0===o||n.push(o),n}const j={name:"@local/rooms-by-type-and-timestamp",version:0,id:9,encodeKey:e=>G.encode(q(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>G.encodeRange({gt:e?q(e):null,lt:n?q(n):null,gte:t?q(t):null,lte:o?q(o):null}),encodeValue:e=>j.collection.encodeKey(e),encodeIndexKeys(e,n){const t=S(e,n),o=new Array(t.length);for(let n=0;n<t.length;n++){const r=t[n];o[n]=G.encode([r.type,r.timestamp,e.roomKey])}return o},reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(j);const W=new e([e.BUFFER],{prefix:10});function z(e){const n=e.capabilities?.wakeupTopic;return void 0===n?[]:[n]}const H={name:"@local/rooms-by-wakeup-topic",version:0,id:10,encodeKey:e=>W.encode(z(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>W.encodeRange({gt:e?z(e):null,lt:n?z(n):null,gte:t?z(t):null,lte:o?z(o):null}),encodeValue:e=>H.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[W.encode([e.capabilities.wakeupTopic])],reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(H);const J=new e([e.BUFFER],{prefix:11});function Q(e){const n=e.capabilities?.mailboxKeyPair?.publicKey;return void 0===n?[]:[n]}const X={name:"@local/rooms-by-mailbox",version:0,id:11,encodeKey:e=>J.encode(Q(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>J.encodeRange({gt:e?Q(e):null,lt:n?Q(n):null,gte:t?Q(t):null,lte:o?Q(o):null}),encodeValue:e=>X.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[J.encode([e.capabilities.mailboxKeyPair.publicKey])],reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(X);const Y=new e([e.BUFFER],{prefix:12});function Z(e){const n=e.capabilities?.discoveryKeyPair?.publicKey;return void 0===n?[]:[n]}const $={name:"@local/rooms-by-discovery",version:0,id:12,encodeKey:e=>Y.encode(Z(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Y.encodeRange({gt:e?Z(e):null,lt:n?Z(n):null,gte:t?Z(t):null,lte:o?Z(o):null}),encodeValue:e=>$.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[Y.encode([e.capabilities.discoveryKeyPair.publicKey])],reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push($);const _=new e([e.BUFFER],{prefix:13});function ee(e){const n=e.roomKey;return void 0===n?[]:[n]}const ne=r("@local/room-preferences/hyperdb#13"),te={name:"@local/room-preferences",id:13,version:0,encodeKey(e){const n=[e.roomKey];return _.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>_.encodeRange({gt:e?ee(e):null,lt:n?ee(n):null,gte:t?ee(t):null,lte:o?ee(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return ne.preencode(r,o),r.buffer=t.allocUnsafe(r.end),ne.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=_.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=ne.decode(r);return l.roomKey=o[0],l},reconstructKey:function(e){return{roomKey:_.decode(e)[0]}},indexes:[],decodedVersion:0},oe=new e([e.BUFFER],{prefix:14});function re(e){const n=e.mailbox;return void 0===n?[]:[n]}const ce=r("@local/writer/hyperdb#14"),le={name:"@local/writers",id:14,version:0,encodeKey(e){const n=[e.mailbox];return oe.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>oe.encodeRange({gt:e?re(e):null,lt:n?re(n):null,gte:t?re(t):null,lte:o?re(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return ce.preencode(r,o),r.buffer=t.allocUnsafe(r.end),ce.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=oe.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=ce.decode(r);return l.mailbox=o[0],l},reconstructKey:function(e){return{mailbox:oe.decode(e)[0]}},indexes:[],decodedVersion:0},de=new e([e.BUFFER],{prefix:15}),se=d.writersByWakeupTopicMap;function ue(e){const n=e.wakeupTopic;return void 0===n?[]:[n]}const ie={name:"@local/writers-by-wakeup-topic",version:0,id:15,encodeKey:e=>de.encode(ue(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>de.encodeRange({gt:e?ue(e):null,lt:n?ue(n):null,gte:t?ue(t):null,lte:o?ue(o):null}),encodeValue:e=>ie.collection.encodeKey(e),encodeIndexKeys(e,n){const t=se(e,n),o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t[e];o[e]=de.encode([n.wakeupTopic])}return o},reconstruct:(e,n)=>n,offset:le.indexes.length,collection:le};le.indexes.push(ie);const ae=new e([e.BUFFER],{prefix:16}),fe=d.writersByRoomKeyMap;function ge(e){const n=e.roomKey;return void 0===n?[]:[n]}const ye={name:"@local/writers-by-room-key",version:0,id:16,encodeKey:e=>ae.encode(ge(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>ae.encodeRange({gt:e?ge(e):null,lt:n?ge(n):null,gte:t?ge(t):null,lte:o?ge(o):null}),encodeValue:e=>ye.collection.encodeKey(e),encodeIndexKeys(e,n){const t=fe(e,n),o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t[e];o[e]=ae.encode([n.roomKey])}return o},reconstruct:(e,n)=>n,offset:le.indexes.length,collection:le};le.indexes.push(ye);const be=new e([e.BUFFER],{prefix:17});function pe(e){const n=e.key;return void 0===n?[]:[n]}const me=r("@local/member/hyperdb#17"),Ke={name:"@local/members",id:17,version:0,encodeKey(e){const n=[e.key];return be.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>be.encodeRange({gt:e?pe(e):null,lt:n?pe(n):null,gte:t?pe(t):null,lte:o?pe(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return me.preencode(r,o),r.buffer=t.allocUnsafe(r.end),me.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=be.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=me.decode(r);return l.key=o[0],l},reconstructKey:function(e){return{key:be.decode(e)[0]}},indexes:[],decodedVersion:0},ve=new e([e.BUFFER],{prefix:18});function xe(e){const n=e.device?.key;return void 0===n?[]:[n]}const he=r("@local/device/hyperdb#18"),Re={name:"@local/devices",id:18,version:0,encodeKey(e){const n=[e.device.key];return ve.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>ve.encodeRange({gt:e?xe(e):null,lt:n?xe(n):null,gte:t?xe(t):null,lte:o?xe(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return he.preencode(r,o),r.buffer=t.allocUnsafe(r.end),he.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=ve.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=he.decode(r);return l.device.key=o[0],l},reconstructKey:function(e){return{device:{key:ve.decode(e)[0]}}},indexes:[],decodedVersion:0},we=new e([e.BUFFER],{prefix:19});function Ue(e){const n=e.memberKey;return void 0===n?[]:[n]}const Ve=r("@keet-private-id/contact/hyperdb#19"),Fe={name:"@local/contacts",id:19,version:7,encodeKey(e){const n=[e.memberKey];return we.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>we.encodeRange({gt:e?Ue(e):null,lt:n?Ue(n):null,gte:t?Ue(t):null,lte:o?Ue(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return o.version=n,Ve.preencode(r,o),r.buffer=t.allocUnsafe(r.end),Ve.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=we.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=Ve.decode(r);return l.memberKey=o[0],Fe.decodedVersion=l.version,l},reconstructKey:function(e){return{memberKey:we.decode(e)[0]}},indexes:[],decodedVersion:0},ke=new e([e.BUFFER],{prefix:20}),Be=d.blockedContactsMap;function Ee(e){const n=e.memberKey;return void 0===n?[]:[n]}const Ie={name:"@local/blocked-contacts",version:0,id:20,encodeKey:e=>ke.encode(Ee(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>ke.encodeRange({gt:e?Ee(e):null,lt:n?Ee(n):null,gte:t?Ee(t):null,lte:o?Ee(o):null}),encodeValue:e=>Ie.collection.encodeKey(e),encodeIndexKeys(e,n){const t=Be(e,n),o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t[e];o[e]=ke.encode([n.memberKey])}return o},reconstruct:(e,n)=>n,offset:Fe.indexes.length,collection:Fe};Fe.indexes.push(Ie);const Te=new e([e.UINT,e.UINT,e.UINT,e.BUFFER],{prefix:21});function Le(e){const n=[],t=e.priority;if(void 0===t)return n;n.push(t);const o=e.timestamp;if(void 0===o)return n;n.push(o);const r=e.type;if(void 0===r)return n;n.push(r);const c=e.discoveryKey;return void 0===c||n.push(c),n}const Ne=r("@local/task/hyperdb#21"),De={name:"@local/tasks",id:21,version:0,encodeKey(e){const n=[e.priority,e.timestamp,e.type,e.discoveryKey];return Te.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Te.encodeRange({gt:e?Le(e):null,lt:n?Le(n):null,gte:t?Le(t):null,lte:o?Le(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return Ne.preencode(r,o),r.buffer=t.allocUnsafe(r.end),Ne.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=Te.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=Ne.decode(r);return l.priority=o[0],l.timestamp=o[1],l.type=o[2],l.discoveryKey=o[3],l},reconstructKey:function(e){const n=Te.decode(e);return{priority:n[0],timestamp:n[1],type:n[2],discoveryKey:n[3]}},indexes:[],decodedVersion:0},Ae=new e([e.UINT,e.BUFFER],{prefix:22});function Pe(e){const n=[],t=e.type;if(void 0===t)return n;n.push(t);const o=e.discoveryKey;return void 0===o||n.push(o),n}const Me={name:"@local/tasks-by-type",version:0,id:22,encodeKey:e=>Ae.encode(Pe(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Ae.encodeRange({gt:e?Pe(e):null,lt:n?Pe(n):null,gte:t?Pe(t):null,lte:o?Pe(o):null}),encodeValue:e=>Me.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[Ae.encode([e.type,e.discoveryKey])],reconstruct:(e,n)=>n,offset:De.indexes.length,collection:De};De.indexes.push(Me);const Oe=new e([e.BUFFER,e.UINT],{prefix:23});function Ce(e){const n=[],t=e.file?.pointer?.externalBlob?.key;if(void 0===t)return n;n.push(t);const o=e.file?.pointer?.externalBlob?.blob?.blockOffset;return void 0===o||n.push(o),n}const Ge=r("@local/file/hyperdb#23"),Se={name:"@local/blob-files",id:23,version:4,encodeKey(e){const n=[e.file.pointer.externalBlob.key,e.file.pointer.externalBlob.blob.blockOffset];return Oe.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Oe.encodeRange({gt:e?Ce(e):null,lt:n?Ce(n):null,gte:t?Ce(t):null,lte:o?Ce(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return o.version=n,Ge.preencode(r,o),r.buffer=t.allocUnsafe(r.end),Ge.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=Oe.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=Ge.decode(r);return l.file.pointer.externalBlob.key=o[0],l.file.pointer.externalBlob.blob.blockOffset=o[1],Se.decodedVersion=l.version,l},reconstructKey:function(e){return{file:{pointer:{externalBlob:{blob:{blockOffset:Oe.decode(e)[1]}}}}}},indexes:[],decodedVersion:0},qe=new e([e.BUFFER,e.STRING,e.UINT],{prefix:24});function je(e){const n=[],t=e.file?.pointer?.externalDrive?.key;if(void 0===t)return n;n.push(t);const o=e.file?.pointer?.externalDrive?.path;if(void 0===o)return n;n.push(o);const r=e.file?.pointer?.externalDrive?.version;return void 0===r||n.push(r),n}const We=r("@local/file/hyperdb#24"),ze={name:"@local/drive-files",id:24,version:4,encodeKey(e){const n=[e.file.pointer.externalDrive.key,e.file.pointer.externalDrive.path,e.file.pointer.externalDrive.version];return qe.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>qe.encodeRange({gt:e?je(e):null,lt:n?je(n):null,gte:t?je(t):null,lte:o?je(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return o.version=n,We.preencode(r,o),r.buffer=t.allocUnsafe(r.end),We.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=qe.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=We.decode(r);return l.file.pointer.externalDrive.key=o[0],l.file.pointer.externalDrive.path=o[1],l.file.pointer.externalDrive.version=o[2],ze.decodedVersion=l.version,l},reconstructKey:function(e){return{file:{pointer:{externalDrive:{version:qe.decode(e)[2]}}}}},indexes:[],decodedVersion:0},He=new e([e.BUFFER,e.BUFFER,e.UINT],{prefix:25});function Je(e){const n=[],t=e.roomKey;if(void 0===t)return n;n.push(t);const o=e.file?.pointer?.externalBlob?.key;if(void 0===o)return n;n.push(o);const r=e.file?.pointer?.externalBlob?.blob?.blockOffset;return void 0===r||n.push(r),n}const Qe={name:"@local/blob-files-by-room",version:0,id:25,encodeKey:e=>He.encode(Je(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>He.encodeRange({gt:e?Je(e):null,lt:n?Je(n):null,gte:t?Je(t):null,lte:o?Je(o):null}),encodeValue:e=>Qe.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[He.encode([e.roomKey,e.file.pointer.externalBlob.key,e.file.pointer.externalBlob.blob.blockOffset])],reconstruct:(e,n)=>n,offset:Se.indexes.length,collection:Se};Se.indexes.push(Qe);const Xe=new e([e.BUFFER,e.BUFFER,e.STRING,e.UINT],{prefix:26});function Ye(e){const n=[],t=e.roomKey;if(void 0===t)return n;n.push(t);const o=e.file?.pointer?.externalDrive?.key;if(void 0===o)return n;n.push(o);const r=e.file?.pointer?.externalDrive?.path;if(void 0===r)return n;n.push(r);const c=e.file?.pointer?.externalDrive?.version;return void 0===c||n.push(c),n}const Ze={name:"@local/drive-files-by-room",version:0,id:26,encodeKey:e=>Xe.encode(Ye(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Xe.encodeRange({gt:e?Ye(e):null,lt:n?Ye(n):null,gte:t?Ye(t):null,lte:o?Ye(o):null}),encodeValue:e=>Ze.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[Xe.encode([e.roomKey,e.file.pointer.externalDrive.key,e.file.pointer.externalDrive.path,e.file.pointer.externalDrive.version])],reconstruct:(e,n)=>n,offset:ze.indexes.length,collection:ze};ze.indexes.push(Ze);const $e=new e([e.BUFFER],{prefix:27});function _e(e){const n=e.discoveryPublicKey;return void 0===n?[]:[n]}const en=r("@local/background-sync-room/hyperdb#27"),nn={name:"@local/background-sync",id:27,version:0,encodeKey(e){const n=[e.discoveryPublicKey];return $e.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>$e.encodeRange({gt:e?_e(e):null,lt:n?_e(n):null,gte:t?_e(t):null,lte:o?_e(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return en.preencode(r,o),r.buffer=t.allocUnsafe(r.end),en.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=$e.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=en.decode(r);return l.discoveryPublicKey=o[0],l},reconstructKey:function(e){return{discoveryPublicKey:$e.decode(e)[0]}},indexes:[],decodedVersion:0},tn=new e([e.UINT,e.BUFFER],{prefix:28}),on=d.dirtyByTimestampMap;function rn(e){const n=e.timestamp;return void 0===n?[]:[n]}const cn={name:"@local/background-sync-by-dirty",version:0,id:28,encodeKey:e=>tn.encode(rn(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>tn.encodeRange({gt:e?rn(e):null,lt:n?rn(n):null,gte:t?rn(t):null,lte:o?rn(o):null}),encodeValue:e=>cn.collection.encodeKey(e),encodeIndexKeys(e,n){const t=on(e,n),o=new Array(t.length);for(let n=0;n<t.length;n++){const r=t[n];o[n]=tn.encode([r.timestamp,e.discoveryPublicKey])}return o},reconstruct:(e,n)=>n,offset:nn.indexes.length,collection:nn};nn.indexes.push(cn);const ln=new e([e.BUFFER,e.BUFFER],{prefix:29});function dn(e){const n=[],t=e.key;if(void 0===t)return n;n.push(t);const o=e.responsePublicKey;return void 0===o||n.push(o),n}const sn=r("@local/writer-append/hyperdb#29"),un={name:"@local/writer-appends",id:29,version:0,encodeKey(e){const n=[e.key,e.responsePublicKey];return ln.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>ln.encodeRange({gt:e?dn(e):null,lt:n?dn(n):null,gte:t?dn(t):null,lte:o?dn(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return sn.preencode(r,o),r.buffer=t.allocUnsafe(r.end),sn.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=ln.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=sn.decode(r);return l.key=o[0],l.responsePublicKey=o[1],l},reconstructKey:function(e){const n=ln.decode(e);return{key:n[0],responsePublicKey:n[1]}},indexes:[],decodedVersion:0},an=new e([e.BUFFER],{prefix:30});function fn(e){const n=e.roomKey;return void 0===n?[]:[n]}const gn=r("@local/room-metadata/hyperdb#30"),yn={name:"@local/room-metadata",id:30,version:0,encodeKey(e){const n=[e.roomKey];return an.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>an.encodeRange({gt:e?fn(e):null,lt:n?fn(n):null,gte:t?fn(t):null,lte:o?fn(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return gn.preencode(r,o),r.buffer=t.allocUnsafe(r.end),gn.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=an.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=gn.decode(r);return l.roomKey=o[0],l},reconstructKey:function(e){return{roomKey:an.decode(e)[0]}},indexes:[],decodedVersion:0},bn=new e([],{prefix:31}),pn=r("@local/debug"),mn={name:"@local/debug",id:31,version:0,encodeKey:e=>bn.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>bn.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return pn.preencode(r,o),r.buffer=t.allocUnsafe(r.end),pn.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){c(e);const o={start:0,end:t.byteLength,buffer:t};return pn.decode(o)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},Kn=new e([e.BUFFER,e.BUFFER],{prefix:32}),vn=d.roomsByContactMap;function xn(e){const n=e.contact;return void 0===n?[]:[n]}const hn={name:"@local/rooms-by-contact",version:1,id:32,encodeKey:e=>Kn.encode(xn(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Kn.encodeRange({gt:e?xn(e):null,lt:n?xn(n):null,gte:t?xn(t):null,lte:o?xn(o):null}),encodeValue:e=>hn.collection.encodeKey(e),encodeIndexKeys(e,n){const t=vn(e,n),o=new Array(t.length);for(let n=0;n<t.length;n++){const r=t[n];o[n]=Kn.encode([r.contact,e.roomKey])}return o},reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(hn);const Rn=new e([e.BUFFER],{prefix:33});function wn(e){const n=e.roomKey;return void 0===n?[]:[n]}const Un=r("@local/unread/hyperdb#33"),Vn={name:"@local/unreads",id:33,version:0,encodeKey(e){const n=[e.roomKey];return Rn.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Rn.encodeRange({gt:e?wn(e):null,lt:n?wn(n):null,gte:t?wn(t):null,lte:o?wn(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return Un.preencode(r,o),r.buffer=t.allocUnsafe(r.end),Un.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=Rn.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=Un.decode(r);return l.roomKey=o[0],l},reconstructKey:function(e){return{roomKey:Rn.decode(e)[0]}},indexes:[],decodedVersion:0},Fn=new e([],{prefix:34}),kn=r("@local/hyperdht-record"),Bn={name:"@local/hyperdht",id:34,version:0,encodeKey:e=>Fn.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Fn.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return kn.preencode(r,o),r.buffer=t.allocUnsafe(r.end),kn.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){c(e);const o={start:0,end:t.byteLength,buffer:t};return kn.decode(o)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},En=new e([e.UINT],{prefix:35});function In(e){const n=e.timestamp;return void 0===n?[]:[n]}const Tn=r("@local/error-record/hyperdb#35"),Ln={name:"@local/errors",id:35,version:0,encodeKey(e){const n=[e.timestamp];return En.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>En.encodeRange({gt:e?In(e):null,lt:n?In(n):null,gte:t?In(t):null,lte:o?In(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:0,buffer:null};return Tn.preencode(r,o),r.buffer=t.allocUnsafe(r.end),Tn.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,n,t){const o=En.decode(n);c(e);const r={start:0,end:t.byteLength,buffer:t},l=Tn.decode(r);return l.timestamp=o[0],l},reconstructKey:function(e){return{timestamp:En.decode(e)[0]}},indexes:[],decodedVersion:0},Nn=new e([e.STRING,e.UINT],{prefix:36});function Dn(e){const n=[],t=e.code;if(void 0===t)return n;n.push(t);const o=e.timestamp;return void 0===o||n.push(o),n}const An={name:"@local/errors-by-code",version:0,id:36,encodeKey:e=>Nn.encode(Dn(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Nn.encodeRange({gt:e?Dn(e):null,lt:n?Dn(n):null,gte:t?Dn(t):null,lte:o?Dn(o):null}),encodeValue:e=>An.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[Nn.encode([e.code,e.timestamp])],reconstruct:(e,n)=>n,offset:Ln.indexes.length,collection:Ln};Ln.indexes.push(An);const Pn=new e([e.BUFFER],{prefix:37});function Mn(e){const n=e.roomKey;return void 0===n?[]:[n]}const On=r("@local/file-stats/hyperdb#37"),Cn={name:"@local/file-stats",id:37,version:2,encodeKey(e){const n=[e.roomKey];return Pn.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Pn.encodeRange({gt:e?Mn(e):null,lt:n?Mn(n):null,gte:t?Mn(t):null,lte:o?Mn(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return On.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,On.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){const r=Pn.decode(t);c(e);const l={start:0,end:o.byteLength,buffer:o},d=n.uint.decode(l);if(0!==d)throw new Error("Unknown collection type: "+d);Cn.decodedVersion=n.uint.decode(l);const s=On.decode(l);return s.roomKey=r[0],s},reconstructKey:function(e){return{roomKey:Pn.decode(e)[0]}},indexes:[],decodedVersion:0},Gn=new e([e.UINT,e.BUFFER],{prefix:38}),Sn=d.roomsByFavoriteAndTimestampMap;function qn(e){const n=e.timestamp;return void 0===n?[]:[n]}const jn={name:"@local/rooms-by-favorite-and-timestamp",version:3,id:38,encodeKey:e=>Gn.encode(qn(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Gn.encodeRange({gt:e?qn(e):null,lt:n?qn(n):null,gte:t?qn(t):null,lte:o?qn(o):null}),encodeValue:e=>jn.collection.encodeKey(e),encodeIndexKeys(e,n){const t=Sn(e,n),o=new Array(t.length);for(let n=0;n<t.length;n++){const r=t[n];o[n]=Gn.encode([r.timestamp,e.roomKey])}return o},reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(jn);const Wn=new e([e.UINT,e.BUFFER,e.UINT],{prefix:39});function zn(e){const n=[],t=e.lastAccessed;if(void 0===t)return n;n.push(t);const o=e.file?.pointer?.externalBlob?.key;if(void 0===o)return n;n.push(o);const r=e.file?.pointer?.externalBlob?.blob?.blockOffset;return void 0===r||n.push(r),n}const Hn={name:"@local/blob-files-by-last-accessed",version:4,id:39,encodeKey:e=>Wn.encode(zn(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Wn.encodeRange({gt:e?zn(e):null,lt:n?zn(n):null,gte:t?zn(t):null,lte:o?zn(o):null}),encodeValue:e=>Hn.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[Wn.encode([e.lastAccessed,e.file.pointer.externalBlob.key,e.file.pointer.externalBlob.blob.blockOffset])],reconstruct:(e,n)=>n,offset:Se.indexes.length,collection:Se};Se.indexes.push(Hn);const Jn=new e([e.UINT,e.BUFFER,e.STRING,e.UINT],{prefix:40});function Qn(e){const n=[],t=e.lastAccessed;if(void 0===t)return n;n.push(t);const o=e.file?.pointer?.externalDrive?.key;if(void 0===o)return n;n.push(o);const r=e.file?.pointer?.externalDrive?.path;if(void 0===r)return n;n.push(r);const c=e.file?.pointer?.externalDrive?.version;return void 0===c||n.push(c),n}const Xn={name:"@local/drive-files-by-last-accessed",version:4,id:40,encodeKey:e=>Jn.encode(Qn(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Jn.encodeRange({gt:e?Qn(e):null,lt:n?Qn(n):null,gte:t?Qn(t):null,lte:o?Qn(o):null}),encodeValue:e=>Xn.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[Jn.encode([e.lastAccessed,e.file.pointer.externalDrive.key,e.file.pointer.externalDrive.path,e.file.pointer.externalDrive.version])],reconstruct:(e,n)=>n,offset:ze.indexes.length,collection:ze};ze.indexes.push(Xn);const Yn=new e([],{prefix:41}),Zn=r("@local/file-gc-info"),$n={name:"@local/file-gc-info",id:41,version:4,encodeKey:e=>Yn.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Yn.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return Zn.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,Zn.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){c(e);const r={start:0,end:o.byteLength,buffer:o},l=n.uint.decode(r);if(0!==l)throw new Error("Unknown collection type: "+l);return $n.decodedVersion=n.uint.decode(r),Zn.decode(r)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},_n=new e([],{prefix:42}),et=r("@local/environment-record"),nt={name:"@local/environment",id:42,version:5,encodeKey:e=>_n.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>_n.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return et.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,et.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){c(e);const r={start:0,end:o.byteLength,buffer:o},l=n.uint.decode(r);if(0!==l)throw new Error("Unknown collection type: "+l);return nt.decodedVersion=n.uint.decode(r),et.decode(r)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},tt=new e([],{prefix:43}),ot=r("@local/ota-actions"),rt={name:"@local/ota-actions",id:43,version:6,encodeKey:e=>tt.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>tt.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return ot.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,ot.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){c(e);const r={start:0,end:o.byteLength,buffer:o},l=n.uint.decode(r);if(0!==l)throw new Error("Unknown collection type: "+l);return rt.decodedVersion=n.uint.decode(r),ot.decode(r)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},ct=new e([e.BUFFER],{prefix:44});function lt(e){const n=e.deviceKey;return void 0===n?[]:[n]}const dt=r("@local/device-attestation/hyperdb#44"),st={name:"@local/device-attestations",id:44,version:6,encodeKey(e){const n=[e.deviceKey];return ct.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>ct.encodeRange({gt:e?lt(e):null,lt:n?lt(n):null,gte:t?lt(t):null,lte:o?lt(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return dt.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,dt.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){const r=ct.decode(t);c(e);const l={start:0,end:o.byteLength,buffer:o},d=n.uint.decode(l);if(0!==d)throw new Error("Unknown collection type: "+d);st.decodedVersion=n.uint.decode(l);const s=dt.decode(l);return s.deviceKey=r[0],s},reconstructKey:function(e){return{deviceKey:ct.decode(e)[0]}},indexes:[],decodedVersion:0},ut=new e([e.BUFFER],{prefix:45}),it=d.activeContactsMap;function at(e){const n=e.memberKey;return void 0===n?[]:[n]}const ft={name:"@local/active-contacts",version:7,id:45,encodeKey:e=>ut.encode(at(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>ut.encodeRange({gt:e?at(e):null,lt:n?at(n):null,gte:t?at(t):null,lte:o?at(o):null}),encodeValue:e=>ft.collection.encodeKey(e),encodeIndexKeys(e,n){const t=it(e,n),o=new Array(t.length);for(let e=0;e<t.length;e++){const n=t[e];o[e]=ut.encode([n.memberKey])}return o},reconstruct:(e,n)=>n,offset:Fe.indexes.length,collection:Fe};Fe.indexes.push(ft);const gt=new e([],{prefix:46}),yt=r("@local/hyperswarm-record"),bt={name:"@local/hyperswarm",id:46,version:8,encodeKey:e=>gt.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>gt.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return yt.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,yt.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){c(e);const r={start:0,end:o.byteLength,buffer:o},l=n.uint.decode(r);if(0!==l)throw new Error("Unknown collection type: "+l);return bt.decodedVersion=n.uint.decode(r),yt.decode(r)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},pt=new e([e.UINT,e.BUFFER],{prefix:47}),mt=d.roomsByActiveCallMap;function Kt(e){const n=e.timestamp;return void 0===n?[]:[n]}const vt={name:"@local/rooms-by-active-call",version:9,id:47,encodeKey:e=>pt.encode(Kt(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>pt.encodeRange({gt:e?Kt(e):null,lt:n?Kt(n):null,gte:t?Kt(t):null,lte:o?Kt(o):null}),encodeValue:e=>vt.collection.encodeKey(e),encodeIndexKeys(e,n){const t=mt(e,n),o=new Array(t.length);for(let n=0;n<t.length;n++){const r=t[n];o[n]=pt.encode([r.timestamp,e.roomKey])}return o},reconstruct:(e,n)=>n,offset:L.indexes.length,collection:L};L.indexes.push(vt);const xt=new e([e.BUFFER],{prefix:48});function ht(e){const n=e.roomKey;return void 0===n?[]:[n]}const Rt=r("@local/room-update/hyperdb#48"),wt={name:"@local/room-updates",id:48,version:10,encodeKey(e){const n=[e.roomKey];return xt.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>xt.encodeRange({gt:e?ht(e):null,lt:n?ht(n):null,gte:t?ht(t):null,lte:o?ht(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return Rt.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,Rt.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){const r=xt.decode(t);c(e);const l={start:0,end:o.byteLength,buffer:o},d=n.uint.decode(l);if(0!==d)throw new Error("Unknown collection type: "+d);wt.decodedVersion=n.uint.decode(l);const s=Rt.decode(l);return s.roomKey=r[0],s},reconstructKey:function(e){return{roomKey:xt.decode(e)[0]}},indexes:[],decodedVersion:0},Ut=new e([e.UINT,e.BUFFER],{prefix:49});function Vt(e){const n=[],t=e.timestamp;if(void 0===t)return n;n.push(t);const o=e.roomKey;return void 0===o||n.push(o),n}const Ft={name:"@local/unprocessed-rooms",version:10,id:49,encodeKey:e=>Ut.encode(Vt(e)),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Ut.encodeRange({gt:e?Vt(e):null,lt:n?Vt(n):null,gte:t?Vt(t):null,lte:o?Vt(o):null}),encodeValue:e=>Ft.collection.encodeKey(e),encodeIndexKeys:(e,n)=>[Ut.encode([e.timestamp,e.roomKey])],reconstruct:(e,n)=>n,offset:wt.indexes.length,collection:wt};wt.indexes.push(Ft);const kt=new e([e.BUFFER],{prefix:50});function Bt(e){const n=e.roomKey;return void 0===n?[]:[n]}const Et=r("@local/autobee-migration/hyperdb#50"),It={name:"@local/autobee-migrations",id:50,version:10,encodeKey(e){const n=[e.roomKey];return kt.encode(n)},encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>kt.encodeRange({gt:e?Bt(e):null,lt:n?Bt(n):null,gte:t?Bt(t):null,lte:o?Bt(o):null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return Et.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,Et.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){const r=kt.decode(t);c(e);const l={start:0,end:o.byteLength,buffer:o},d=n.uint.decode(l);if(0!==d)throw new Error("Unknown collection type: "+d);It.decodedVersion=n.uint.decode(l);const s=Et.decode(l);return s.roomKey=r[0],s},reconstructKey:function(e){return{roomKey:kt.decode(e)[0]}},indexes:[],decodedVersion:0},Tt=new e([],{prefix:51}),Lt=r("@local/pending-recovery"),Nt={name:"@local/pending-recovery",id:51,version:11,encodeKey:e=>Tt.encode([]),encodeKeyRange:({gt:e,lt:n,gte:t,lte:o}={})=>Tt.encodeRange({gt:e?[]:null,lt:n?[]:null,gte:t?[]:null,lte:o?[]:null}),encodeValue(e,n,o){c(e);const r={start:0,end:2,buffer:null};return Lt.preencode(r,o),r.buffer=t.allocUnsafe(r.end),r.buffer[r.start++]=0,r.buffer[r.start++]=n,Lt.encode(r,o),r.buffer},trigger:null,reconstruct:function(e,t,o){c(e);const r={start:0,end:o.byteLength,buffer:o},l=n.uint.decode(r);if(0!==l)throw new Error("Unknown collection type: "+l);return Nt.decodedVersion=n.uint.decode(r),Lt.decode(r)},reconstructKey:function(e){return{}},indexes:[],decodedVersion:0},Dt=[i,g,p,h,k,L,te,le,Ke,Re,Fe,De,Se,ze,nn,un,yn,mn,Vn,Bn,Ln,Cn,$n,nt,rt,st,bt,wt,It,Nt],At=[U,A,C,j,H,X,$,ie,ye,Ie,Me,Qe,Ze,cn,hn,An,jn,Hn,Xn,ft,vt,Ft];module.exports={versions:l,collections:Dt,indexes:At,resolveCollection:function(e){switch(e){case"@local/stats":return i;case"@local/migrations":return g;case"@local/room-migration-stats":return p;case"@local/room-migrations":return h;case"@local/identity":return k;case"@local/rooms":return L;case"@local/room-preferences":return te;case"@local/writers":return le;case"@local/members":return Ke;case"@local/devices":return Re;case"@local/contacts":return Fe;case"@local/tasks":return De;case"@local/blob-files":return Se;case"@local/drive-files":return ze;case"@local/background-sync":return nn;case"@local/writer-appends":return un;case"@local/room-metadata":return yn;case"@local/debug":return mn;case"@local/unreads":return Vn;case"@local/hyperdht":return Bn;case"@local/errors":return Ln;case"@local/file-stats":return Cn;case"@local/file-gc-info":return $n;case"@local/environment":return nt;case"@local/ota-actions":return rt;case"@local/device-attestations":return st;case"@local/hyperswarm":return bt;case"@local/room-updates":return wt;case"@local/autobee-migrations":return It;case"@local/pending-recovery":return Nt;default:return null}},resolveIndex:function(e){switch(e){case"@local/room-migrations-by-priority":return U;case"@local/rooms-by-discovery-key":return A;case"@local/rooms-by-timestamp":return C;case"@local/rooms-by-type-and-timestamp":return j;case"@local/rooms-by-wakeup-topic":return H;case"@local/rooms-by-mailbox":return X;case"@local/rooms-by-discovery":return $;case"@local/writers-by-wakeup-topic":return ie;case"@local/writers-by-room-key":return ye;case"@local/blocked-contacts":return Ie;case"@local/tasks-by-type":return Me;case"@local/blob-files-by-room":return Qe;case"@local/drive-files-by-room":return Ze;case"@local/background-sync-by-dirty":return cn;case"@local/rooms-by-contact":return hn;case"@local/errors-by-code":return An;case"@local/rooms-by-favorite-and-timestamp":return jn;case"@local/blob-files-by-last-accessed":return Hn;case"@local/drive-files-by-last-accessed":return Xn;case"@local/active-contacts":return ft;case"@local/rooms-by-active-call":return vt;case"@local/unprocessed-rooms":return Ft;default:return null}}};