const p=require('path');
const fs=require('fs'),BlobServer=require('hypercore-blob-server'),ReadyResource=require('ready-resource'),safetyCatch=require('safety-catch'),{
pipelinePromise,Readable}
=require('streamx'),b4a=require('b4a');
module.exports=class FileManager extends ReadyResource{
constructor(_0xb87687,_0x45308c={}){
_0x26d446={
_0x3c4cda:0xd},_0x2a452c={
_0xecae8e:0x3a8}
;
super(),this.keet=_0xb87687,this.local=_0xb87687.local,this.store=_0xb87687.store;
this.server=new BlobServer(this.store.session(),{'resolve':this._resolveEncryptionKey.bind(this)}),this._activeDownloads=new Map(),this._onerror=_0x45308c.onerror||safetyCatch,this.ready().catch(this._onerror);
}
._open(){
_0x407cdb={
_0x360b0f:0x38e,_0xdab96a:0x125},_0x208467={
_0x5af04a:0x74,_0x174a31:0x1b2}
;
return this.server.listen();
}
._close(){
_0x506bd7={
_0x1f6a5f:0x164,_0x57e9ed:0x65d},_0x1cbb8f={
_0x2f7424:0xa,_0x4515d5:0x18d,_0x1f1d5e:0x16}
;
return this.server.close();
}
async._resolveEncryptionKey(_0xc56ae7,{blob:_0x15feb2,filename:_0x461f1e,drive:_0x471d1b,version:_0x22b9a1}){
_0x5b02fd={
_0x442395:0xde,_0x22b933:0xb2,_0x1bdab9:0xc2},_0x108ec2={
_0x339f88:0x105,_0x2a3bf8:0x177,_0x34bea9:0x480},_0x3fe3f4=_0x471d1b?"@local/drive-files":"@local/blob-files";
const _0x45edef=_0x461f1e&&_0x461f1e.startsWith('/')?_0x461f1e.slice(--0x2b17):_0x461f1e,_0x311356={
'pointer':{
'externalDrive':{
'key':_0x471d1b,'path':_0x45edef,'version':_0x22b9a1},'externalBlob':{
'key':_0xc56ae7,'blob':_0x15feb2}
}
},_0x1dad3e=await this.local.get(_0x3fe3f4,{'file':_0x311356});
if(_0x1dad3e)await this.keet.internalBlobsActiveInRoom(_0x1dad3e.roomKey);
const _0x478242=_0x1dad3e?{
'key':_0xc56ae7,'encryptionKey':_0x1dad3e.encryptionKey}
:null;
return _0x478242;
}
._getLinkOptions(_0x3aced1){
_0x20bc99={
_0x1642ad:0xa6,_0xe118c5:0x18a,_0x243cda:0x682},_0x563405={
_0x1912ea:0x3ff}
;
if(!_0x3aced1.pointer.externalBlob&&!_0x3aced1.pointer.externalDrive)throw new Error("Invalid file pointer");
if(_0x3aced1.pointer.externalBlob)return{
'collection':"@local/blob-files",'key':_0x3aced1.pointer.externalBlob.key,'opts':{
'blob':_0x3aced1.pointer.externalBlob.blob,'type':_0x3aced1.metadata?..mimetype}
}
;
return{
'collection':"@local/drive-files",'key':_0x3aced1.pointer.externalDrive.key,'opts':{
'filename':_0x3aced1.pointer.externalDrive.path,'version':_0x3aced1.pointer.externalDrive.version}
}
;
}
async._clearAllFiles(_0x234323,_0x334600,_0x5b5186,{leaving:leaving=![]}={}){
_0x57e14a={
_0x58a5c7:0x1e9},_0x176e10={
_0x300e68:0x53,_0x27fec5:0x13f}
;
const _0x22bbf7=_0x334600?"@local/blob-files":"@local/drive-files",_0x4641d2=_0x334600?"@local/blob-files-by-room":"@local/drive-files-by-room";
const _0x4ace23=[];
for await(const _0x5ecfd1 of _0x234323.find(_0x4641d2,{'gte':{'roomKey':_0x5b5186},'lte':{'roomKey':_0x5b5186}})){
if(_0x5ecfd1.cleared)continue;
const {
key:_0x18c341,opts:_0x42d2d5}
=this._getLinkOptions(_0x5ecfd1.file),_0x9f77fc=this.server.clear(_0x18c341,_0x42d2d5);
_0x9f77fc.catch(safetyCatch),_0x4ace23.push(_0x9f77fc),!leaving?await _0x234323.insert(_0x22bbf7,{..._0x5ecfd1,'cleared':!![]}):await _0x234323.delete(_0x22bbf7,_0x5ecfd1);
}
return(await Promise.allSettled(_0x4ace23)).filter(_0x1267b6=>_0x1267b6.status==="fulfilled").reduce((_0x18fc8e,_0x28d649)=>_0x18fc8e+_0x28d649.value,-0x2c2);
}
async._createFile(_0x1aa76c,_0x597c0f,_0x1556a7){
_0x3844e1={
_0x191235:0x84},_0x598669={
_0x93ef50:0x17f,_0x2be71b:0x171,_0x40aa1a:0x10e},_0xd821a3={
'externalBlob':{
'key':_0x1aa76c.externalBlobs.key,'blob':_0x597c0f}
}
;
const _0x18f988={
'metadata':_0x1556a7,'pointer':_0xd821a3}
;
_0x18f988.metadata?..userdata&&(_0x18f988.metadata.userdata=b4a.from(_0x18f988.metadata.userdata,"base64"));
const _0x4ddbe0=await this.keet.internalEnterLocalTransaction();
try{
const _0x28e4a4={
'file':_0x18f988,'roomKey':_0x1aa76c.key,'encryptionKey':_0x1aa76c.encryptionKey,'cleared':![],'own':!![]}
;
await _0x4ddbe0.insert("@local/blob-files",_0x28e4a4),await this._updateFileStats(_0x4ddbe0,_0x28e4a4),await _0x4ddbe0.flush();
}finally{
await this.keet.internalExitLocalTransaction();
}
return await this.keet.internalBlobsActiveInRoom(_0x1aa76c.key),_0x18f988;
}
async.saveFile(_0x123da0,_0x5bf70a,_0xae700){
_0x440081={
_0x4ca382:0x3e,_0x4e20f0:0x1b,_0x1b94f2:0x1c1},_0x45c99a={
_0x41f561:0x102,_0x122775:0x236}
;
if(!this.opened)await this.ready();
const _0x1bd68a=p.basename(_0x5bf70a);
const _0x438dc3=this.keet.internalOpenExistingRoom(_0x123da0);
try{
const _0x2da3e3=fs.createReadStream(_0x5bf70a),_0x556dd4=_0x438dc3.externalBlobs.createWriteStream(_0xae700);
return await pipelinePromise(_0x2da3e3,_0x556dd4),this._createFile(_0x438dc3,_0x556dd4.id,{'name':_0x1bd68a,..._0xae700});
}finally{
this.keet.internalReleaseRoom(_0x438dc3);
}
}
.subscribeAddFile(_0x3d7d88,_0x4caa57,_0x211c52={}){
_0x1473bf={
_0x43f41e:0x2a3,_0x139141:0x288,_0x127f68:0x256,_0x4813c8:0x27f,_0xe72662:0x243,_0x10d277:0x24c,_0x1362b0:0x1fe,_0x48981b:0x1ee,_0x123a76:0x1ca,_0x25e7de:0x1c4,_0x4b0437:0x1c7,_0x4fa28c:0x1dd,_0x4e0b3d:0x1f5,_0x3a5d51:0x1f9,_0x482f4e:0x211,_0x79d21d:0x20d,_0x2cd3b6:0x214,_0x36db90:0x1e8,_0x11323e:0x1dc,_0x3e804b:0x201,_0x4685ba:0x1ed,_0x3d9325:0x204,_0x44fb58:0x1d9,_0x593f33:0x1da,_0xeb3a22:0x1f7,_0x38dc8c:0x1c6,_0x1dbcfe:0x198,_0x471ab6:0x2bc,_0x1a82df:0x267,_0x1cc5c:0x286,_0x541057:0x1f2,_0x5d1936:0x1d2,_0x54adf9:0x217,_0x292ed5:0x295,_0x42c717:0x251,_0x19095c:0x234,_0x184063:0x256,_0x1b803a:0x298,_0x3c59e2:0x2c2,_0x261a91:0x2a2,_0x37f807:0x1b7,_0x357bab:0x1e6,_0x32b5d5:0x1cb,_0x2c1e8f:0x1eb,_0x1269ca:0x183,_0x2c4a97:0x1ef,_0xbabdc4:0x1cf,_0x12d876:0x1aa,_0xee52ba:0x203,_0x1eb293:0x23c,_0x145436:0x21c,_0x5aa358:0x22f,_0x1e06d4:0x259,_0x25ccc7:0x21c},_0x43e80a={
_0x4c3a3c:0x221,_0x50232f:0x1e8,_0x513f97:0x217,_0x466e69:0x1ed},_0x1dc492={
_0x44465e:0x190,_0x424d1b:0xf1,_0x5b13a5:0x157},_0x3e531f={
_0x34b572:0x2fb,_0x3b89da:0x353,_0x572cac:0x2b5,_0x35a3be:0x2da,_0x11d6dc:0x292,_0x16d966:0x29d,_0x1a09f6:0x27e,_0x168667:0x271},_0xd3191b={
_0x307f29:0xfa},_0x21f3af={
_0x491a81:0x3d,_0x20234b:0x54,_0x13022d:0x2e,_0x4fbdff:0x87,_0x32f520:0x8b,_0x4f9af1:0x25},_0x1e6678={
_0x19122d:0x146,_0x3bafed:0x1e5}
;
const _0x82fe17=p.basename(_0x4caa57),_0x78635f=this,_0x4271af=new Readable();
return fs.stat(_0x4caa57,(_0x4eb743,_0x2c3270)=>{_0x4adce9={_0x16c7c4:0x2db,_0x3cf197:0x136,_0x477759:0x19e},_0x604962={_0x28b549:0x5b5},_0x498f58={_0x4b6f75:0x11,_0x15fda7:0x18c,_0x2f8861:0x19c},_0x475f99={_0x4f778b:0x133};if(_0x4271af.destroyed)return;if(_0x4eb743)return _0x4271af.destroy(_0x4eb743);let _0x4a3c11=-0x3462;const _0x450c26=_0x2c3270.size,_0x5ae6f3=fs.createReadStream(_0x4caa57),_0x2666a1=_0x78635f.keet.internalOpenExistingRoom(_0x3d7d88),_0x4c5e67=_0x2666a1.externalBlobs.createWriteStream(_0x211c52);let _0x806fc3=setInterval(()=>{if(_0x4271af.destroyed)return;if(_0x4a3c11<_0x450c26)_0x4271af.push({'bytesAdded':_0x4a3c11,'byteLength':_0x450c26,'result':null});},_0x211c52?..debounceTime??0x1f4);_0x5ae6f3.pipe(_0x4c5e67),_0x5ae6f3.on('data',_0x155d0c=>{_0x4a3c11+=_0x155d0c.byteLength;}),_0x5ae6f3.on("error",_0x43d0ac=>_0x4271af.destroy(_0x43d0ac)),_0x4c5e67.on("close",async()=>{if(_0x806fc3)clearInterval(_0x806fc3);_0x806fc3=null;if(_0x4271af.destroyed)return;try{const _0x1b3130=await _0x78635f._createFile(_0x2666a1,_0x4c5e67.id,{'name':_0x82fe17,..._0x211c52});_0x4271af.push({'bytesAdded':_0x4a3c11,'byteLength':_0x450c26,'result':_0x1b3130}),_0x4271af.push(null);}catch(_0x5a64ec){_0x4271af.destroy(_0x5a64ec);}});_0x4271af.on("error",_0x23f6b2=>{_0x5ae6f3.destroy(_0x23f6b2);}),_0x4271af.on("close",()=>{_0x12231b={_0x1e619e:0x4d1,_0x124a91:0x87};if(_0x806fc3)clearInterval(_0x806fc3);_0x806fc3=null,_0x5ae6f3.destroy(),_0x4c5e67.destroy(),_0x78635f.keet.internalReleaseRoom(_0x2666a1);});if(_0x211c52.onFileStat)_0x211c52.onFileStat();}),_0x4271af;
}
async.saveFileBlob(_0x543f5d,_0x32810b,_0x407021){
_0x48329b={
_0x315a04:0x75,_0x46d4e2:0x27,_0x243be5:0x5b7},_0x5c7818={
_0x4929d0:0x151,_0x3c9409:0x2d9}
;
if(!this.opened)await this.ready();
const _0x4a91b3=this.keet.internalOpenExistingRoom(_0x543f5d);
try{
const _0x2159ac=await _0x4a91b3.externalBlobs.put(_0x32810b);
return this._createFile(_0x4a91b3,_0x2159ac,_0x407021);
}finally{
this.keet.internalReleaseRoom(_0x4a91b3);
}
}
async.clearAllFiles(_0x3d94a7,_0x3fb9da){
_0x102c59={
_0x4111e5:0x61,_0x2bb02b:0x93},_0x3767e9={
_0x403819:0xef,_0xe7a155:0x6db,_0x4a1a62:0x1b2}
;
let _0x5b9f9c=0x0,_0x57e01d=0x0;
const _0xe81bd2=await this.keet.internalEnterLocalTransaction();
try{
_0x5b9f9c=await this._clearAllFiles(_0xe81bd2,!![],_0x3d94a7,_0x3fb9da),_0x57e01d=await this._clearAllFiles(_0xe81bd2,![],_0x3d94a7,_0x3fb9da),await _0xe81bd2.insert("@local/file-stats",{'roomKey':_0x3d94a7,'total':0x0}),await _0xe81bd2.flush();
}finally{
await this.keet.internalExitLocalTransaction();
}
return{
'bytesCleared':_0x5b9f9c+_0x57e01d}
;
}
async._ensureLocalFile(_0x47bde6,_0x2cc560,_0x446693){
_0x2bf1f1={
_0x2eeea7:0xf0,_0x169666:0xfb,_0x208531:0xf},_0x1d517c={
_0x174533:0x82,_0x321653:0x114,_0x1ed702:0xe8}
;
const _0x5aa4bd=await this.keet.internalEnterLocalTransaction();
try{
await this.keet.internalBlobsActiveInRoom(_0x2cc560);
const _0x4eb645=await _0x5aa4bd.get(_0x47bde6,{'roomKey':_0x2cc560,'file':_0x446693});
let _0x44603b=_0x4eb645?..encryptionKey;
if(!_0x44603b){
const _0x3012b2=await _0x5aa4bd.get("@local/rooms",{'roomKey':_0x2cc560});
_0x44603b=_0x3012b2?..encryptionKey;
}
const _0x20be17={
..._0x4eb645,'cleared':_0x4eb645?..cleared??![],'roomKey':_0x2cc560,'encryptionKey':_0x44603b,'file':_0x446693}
;
await _0x5aa4bd.insert(_0x47bde6,_0x20be17);
if(!_0x4eb645)await this._updateFileStats(_0x5aa4bd,_0x20be17);
return await _0x5aa4bd.flush(),_0x20be17;
}finally{
await this.keet.internalExitLocalTransaction();
}
}
async._loadBlob(_0x46b9c4,_0x5a2962){
_0x3b6046={
_0x205dad:0x14f,_0x5f272c:0x101},_0x545a56={
_0x5cef78:0x74,_0x4a7fe8:0x44d,_0x2d4c09:0x1a8}
;
const _0x8416b1=this.keet.internalOpenExistingRoom(_0x46b9c4);
try{
return await _0x8416b1.ready(),await _0x8416b1.blobs.get(_0x5a2962);
}finally{
this.keet.internalReleaseRoom(_0x8416b1);
}
}
async.getFileLink(_0x5500f3,_0x44e6cd){
_0x3e0e0c={
_0x280a44:0x145,_0x50b76f:0x476},_0x55169b={
_0x5031ee:0x1c8,_0x49feb7:0x1f0}
;
if(!this.opened)await this.ready();
if(_0x44e6cd.pointer.blob){
const _0x15cbe2=await this._loadBlob(_0x5500f3,_0x44e6cd.pointer.blob);
return this.server.getBlobLink(_0x15cbe2,{'type':_0x44e6cd.metadata?..mimetype});
}
const {
collection:_0x5e9585,key:_0x3a8534,opts:_0x235637}
=this._getLinkOptions(_0x44e6cd);
return await this._ensureLocalFile(_0x5e9585,_0x5500f3,_0x44e6cd),this.server.getLink(_0x3a8534,_0x235637);
}
async.getFileEntry(_0xdc217b,_0x16ce28,_0x20e74f={}){
_0xdc226d={
_0x57e5cf:0x1ef,_0x4ee8d7:0x37c,_0x54bb48:0xd9},_0x1e90de={
_0xbd2dd5:0x1b0,_0x163108:0x1a6}
;
if(!_0x16ce28)return null;
if(!this.opened)await this.ready();
const _0xd71d54={
'roomKey':_0xdc217b,'encryptionKey':null,'cleared':![],'httpLink':null}
;
if(!_0x16ce28.pointer.externalBlob&&!_0x16ce28.pointer.externalDrive&&!_0x16ce28.pointer.blob)return _0xd71d54;
if(_0x16ce28.pointer.blob){
const _0x22709c=_0x20e74f.loadBlob?await _0x20e74f.loadBlob(_0x16ce28.pointer.blob):await this._loadBlob(_0xdc217b,_0x16ce28.pointer.blob);
return _0xd71d54.httpLink=this.server.getBlobLink(_0x22709c,{'type':_0x16ce28.metadata?..mimetype}),_0xd71d54;
}
const {
collection:_0x2192f7,key:_0x4c3194,opts:_0x419fdb}
=this._getLinkOptions(_0x16ce28),_0x348632=await this._ensureLocalFile(_0x2192f7,_0xdc217b,_0x16ce28);
return{
..._0x348632,'httpLink':this.server.getLink(_0x4c3194,_0x419fdb)}
;
}
async.getFileEntryWithPreview(_0xd78de4,_0x5a1d6e,_0x22fabd={}){
_0x12eea0={
_0x357a3b:0x6c6},_0x35b18b={
_0x30fa21:0xd7,_0xebe653:0x6f3,_0x4d1eb2:0x63}
;
if(!this.opened)await this.ready();
const _0x578711=await this.getFileEntry(_0xd78de4,_0x5a1d6e,_0x22fabd);
if(!_0x5a1d6e.preview)return _0x578711;
const [_0x27da9a,_0xff29b4,_0x132a77]=await Promise.all([this.getFileEntry(_0xd78de4,_0x5a1d6e.preview.small,_0x22fabd),this.getFileEntry(_0xd78de4,_0x5a1d6e.preview.medium,_0x22fabd),this.getFileEntry(_0xd78de4,_0x5a1d6e.preview.large,_0x22fabd)]);
return _0x578711.preview={
'small':_0x27da9a,'medium':_0xff29b4,'large':_0x132a77},_0x578711;
}
async.getFileCleared(_0x5421a4,_0x15813b){
_0x2ef782={
_0x377fe7:0xd,_0x17662f:0x148,_0x591658:0x1b},_0x30f2c3={
_0x575a69:0x1b1,_0x30fe57:0x4c7},{
collection:_0x1e5e38}
=this._getLinkOptions(_0x15813b);
const _0x191b4e=await this.local.get(_0x1e5e38,{'file':_0x15813b});
return _0x191b4e?_0x191b4e.cleared:![];
}
async.getLocalFiles(_0x514841){
_0x23b18c={
_0x2baa99:0xc2,_0x1835bd:0x45b},_0x3dce81={
_0x499590:0x1c6,_0x5e50c4:0x5bc,_0x214849:0xf1},_0x495c9a=await Promise.all([this.local.find("@local/blob-files-by-room",{'gte':{'roomKey':_0x514841},'lte':{'roomKey':_0x514841}}).toArray(),this.local.find("@local/drive-files-by-room",{'gte':{'roomKey':_0x514841},'lte':{'roomKey':_0x514841}}).toArray()]);
return _0x495c9a.flat();
}
async.clearFile(_0xc0e4f8,_0x37a4a3){
_0x9c68df={
_0x5bd9b5:0x112,_0xecae87:0x9a,_0x2a8e70:0xeb},_0x106e54={
_0x5f1951:0x4f,_0x5f09a9:0x3b0,_0x1c6571:0x1ed}
;
if(!_0x37a4a3?..pointer?..externalBlob&&!_0x37a4a3?..pointer?..externalDrive)return;
const {
collection:_0x9b98d3,key:_0x2bf7f7,opts:_0x1541b5}
=this._getLinkOptions(_0x37a4a3),_0x5ef051=await this.keet.internalEnterLocalTransaction();
try{
const _0x411da0=await _0x5ef051.get(_0x9b98d3,{'roomKey':_0xc0e4f8,'file':_0x37a4a3});
if(!_0x411da0||_0x411da0.cleared)return;
await this.server.clear(_0x2bf7f7,_0x1541b5);
const _0x407268={
'roomKey':_0xc0e4f8,'file':_0x37a4a3,'cleared':!![]}
;
await _0x5ef051.insert(_0x9b98d3,_0x407268),await this._updateFileStats(_0x5ef051,_0x407268),await _0x5ef051.flush();
}finally{
await this.keet.internalExitLocalTransaction();
}
}
async.unclearFile(_0x1b8592,_0x15f4b6){
_0x30460b={
_0x2cc0ff:0x18e},_0x283590={
_0x326c42:0x177,_0x284858:0x75,_0x9cd815:0x7a}
;
const {
collection:_0x3c30bd}
=this._getLinkOptions(_0x15f4b6),_0x2a3d98=await this.keet.internalEnterLocalTransaction();
try{
const _0x3bd18b=await _0x2a3d98.get(_0x3c30bd,{'roomKey':_0x1b8592,'file':_0x15f4b6});
if(!_0x3bd18b||!_0x3bd18b.cleared)return;
const _0x413bb4={
'roomKey':_0x1b8592,'file':_0x15f4b6,'cleared':![]}
;
await _0x2a3d98.insert(_0x3c30bd,_0x413bb4),await this._updateFileStats(_0x2a3d98,_0x413bb4),await _0x2a3d98.flush();
}finally{
await this.keet.internalExitLocalTransaction();
}
}
async.startDownload(_0x21486f,_0x1e2866){
_0x30eabf={
_0x3862bd:0x301,_0x30d772:0x298,_0x104d52:0x307,_0x4311dc:0x29c,_0x415461:0x2a8,_0x52443d:0x28e,_0x4214bb:0x24,_0x2451fd:0x4d,_0x5c0850:0x58,_0x44f87a:0x51,_0x574e24:0x33},_0x1c272f={
_0x567cc6:0x6c6,_0xf3da93:0x187},_0x2b448f={
_0x20ba0c:0x38}
;
if(!this.opened)await this.ready();
const {
key:_0x4ab088,opts:_0x46514d}
=this._getLinkOptions(_0x1e2866),_0x3b7102=this.server.getLink(_0x4ab088,{..._0x46514d,'url':![]}),_0x336923=this.server.download(_0x4ab088,_0x46514d);
return this._activeDownloads.set(_0x3b7102,_0x336923),_0x336923.done().then(()=>{_0x55c101={_0x1ab0ef:0x2,_0x3251a1:0xee,_0x48e2e4:0x53};const _0x5e519b=this._activeDownloads.get(_0x3b7102);if(_0x5e519b!==_0x336923)return;this._activeDownloads.delete(_0x3b7102);}),_0x3b7102;
}
async.cancelDownload(_0x2ee450,_0x575154){
_0x15caf8={
_0x251d51:0x309,_0x2dba53:0x2f1,_0x462ea1:0x34e,_0xa9c41f:0x2c7,_0x392306:0x2cd,_0x20414d:0x281,_0x4b3d0e:0x481,_0x4465a6:0x477,_0x4ba4d3:0x453,_0x332c07:0x492,_0x468568:0x456,_0x43b885:0x426,_0x1959e3:0x2fe,_0x4534e0:0x2dc,_0x2435d1:0x2fc,_0x1a2934:0x4de,_0x3eded8:0x4ca,_0x4772de:0x4b4,_0x244335:0x4cc},_0x1d5e91={
_0x5180c4:0xa8},_0x59ffcf={
_0x5dfa4d:0x19d,_0x5c8039:0x5a7,_0x214d8c:0x6d},_0x13cb01={
_0x368fa6:0xfb,_0x5cb6f3:0x678}
;
if(!this.opened)await this.ready();
const _0x1eabc4=this._activeDownloads.get(_0x575154);
if(!_0x575154||!_0x1eabc4)return;
await _0x1eabc4.close().finally(()=>{const _0x57885f=this._activeDownloads.get(_0x575154);if(_0x57885f!==_0x1eabc4)return;this._activeDownloads.delete(_0x575154);});
}
async.refreshLinks(_0x18776c){
_0xe1d386={
_0x42041c:0x18a,_0x9fd390:0x249,_0x3a362a:0x3e},_0x4a20d3={
_0x42a1b2:0x1bb}
;
if(!this.opened)await this.ready();
const _0x481487=[];
for(const _0x1e158a of _0x18776c)_0x481487.push(this.server.refreshLink(_0x1e158a));
return _0x481487;
}
async.monitor(_0x33a458,_0x47a7dc){
_0x1b8dc9={
_0xcaa755:0x111,_0x361d3a:0x2cf,_0x5e50bc:0x34},_0x37338e={
_0x1e0ed7:0x80}
;
if(!this.opened)await this.ready();
const {
key:_0x5288ee,opts:_0x132560}
=this._getLinkOptions(_0x47a7dc);
return this.server.monitor(_0x5288ee,_0x132560);
}
async._updateFileStats(_0xf8843b,{roomKey:_0xf5ccc9,file:_0x3f6936,cleared:_0x2385e6}){
_0x5107a={
_0x4631d3:0xe2,_0x3840bb:0x5e7,_0x5a5924:0x174},_0x3191dc={
_0x1f91fd:0x4f,_0x264267:0x1ad,_0x4fe1fa:0x3c7}
;
const _0x49868d=_0x3f6936.pointer.externalBlob?..blob.byteLength;
if(!_0x49868d)return;
let _0x1e3f9d=await _0xf8843b.get("@local/file-stats",{'roomKey':_0xf5ccc9});
!_0x1e3f9d&&(_0x1e3f9d={'roomKey':_0xf5ccc9,'total':0x0});
const _0x5dc4e1=_0x2385e6?-_0x49868d:_0x49868d;
_0x1e3f9d.total=Math.max(_0x1e3f9d.total+_0x5dc4e1,0x0),await _0xf8843b.insert("@local/file-stats",_0x1e3f9d);
}
}
;