class UserBrollFootage{static ['DEFAULT_SA'+'VE_FILENAM'+'E']='user_broll'+'_footage.j'+'son';constructor(){this['init'](),this['footages']=[],this['version']=-0x12b+-0x76+0x13*0x16;}['init'](){const v={'tUuZV':'UserBrollF'+'ootage\x20ini'+'t'};console['log'](v['tUuZV']);}['load'](v){if(!fs['existsSync'](v)){console['log']('No\x20user\x20br'+'oll\x20footag'+'e\x20data\x20fou'+'nd\x20at\x20'+v);return;}try{const U=JSON['parse'](fs['readFileSy'+'nc'](v,'utf8'));this['footages']=U['footages'],this['version']=U['version'];}catch(V){console['error']('Error\x20read'+'ing\x20user\x20b'+'roll\x20foota'+'ge\x20data\x20fr'+'om\x20'+v,V);}}async['analyzeFoo'+'tage'](v){const U=await editai_api['tagVideo'](v['images']);v['tags']=U['tags'],v['descriptio'+'n']=U['descriptio'+'n'];}['renderTabl'+'e'](v=![]){const U={'FVSks':function(V,B,G){return V(B,G);},'KqGDB':function(V,B){return V(B);},'pVtEA':'#broll-use'+'r-broll-de'+'tect-tags-'+'usage'};U['FVSks'](renderUserBrollFootageTable,this['footages'],v),U['KqGDB']($,U['pVtEA'])['text']('Monthly\x20au'+'to-detecti'+'on\x20usage:\x20'+g_user_broll_analysis_count+'/'+g_user_broll_analysis_limit+'\x20videos');}async['ingestFoot'+'age'](v,U){const V={'FQuKf':function(a,X,A,f,k){return a(X,A,f,k);},'zBucG':function(a,X){return a>X;},'UIZzY':function(a,X){return a===X;},'LKnnM':function(a,X,A){return a(X,A);},'AOdNC':'Uploading\x20'+'user\x20broll'+'\x20footage\x20d'+'ata\x20after\x20'+'ingestion'},B=this['footages']['map'](a=>a['path']),G=[];let W=!![];V['FQuKf'](ingestUserBrollFootagePaths,v,B,U,a=>{U&&(a['analysisSt'+'atus']='pending',G['unshift'](a)),this['footages']['unshift'](a),this['save'](),this['renderTabl'+'e'](!![]);})['then'](()=>{W=![];});while(W||V['zBucG'](G['length'],-0xace*0x2+0x4f6+0x10a6)){if(V['zBucG'](G['length'],-0x250d+-0x20b5+0x45c2)){const a=G['pop']();V['UIZzY'](a['analysisSt'+'atus'],'pending')&&(a['analysisSt'+'atus']='analyzing',this['renderTabl'+'e'](!![]),await V['LKnnM'](footageAnalysis,a,![]),this['save']());}else await new Promise(X=>setTimeout(X,-0x976+-0x2*0x2b8+0x12ce));}this['renderTabl'+'e'](![]),this['save']();try{editai_api['uploadFile'+'_v2'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),V['AOdNC']);}catch(X){console['error'](X,V['AOdNC']);}}['removeFoot'+'ages'](v){const U={'LitWo':function(B,G){return B<G;}},V=[];for(let B=0x8fc+0x1c78+-0x2574;U['LitWo'](B,this['footages']['length']);B++){if(v['includes'](B))continue;V['push'](this['footages'][B]);}this['footages']=V,this['save'](),this['renderTabl'+'e'](![]);}['save'](){const v={'caIGn':'Saving\x20use'+'r\x20broll\x20fo'+'otage'};console['log'](v['caIGn']);const U=path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E']),V=this['getSaveDat'+'a']();fs['writeFileS'+'ync'](U,V,'utf8'),console['log']('Saved\x20capt'+'ions\x20data\x20'+'as\x20'+U);}['getSaveDat'+'a'](){const v=JSON['parse'](JSON['stringify'](this['footages']))['map'](U=>{return delete U['images'],delete U['analysisSt'+'atus'],U;});return JSON['stringify']({'footages':v,'version':0x1});}['getSearchR'+'esultsFrom'+'PickedFoot'+'age'](v,U){const V={'uXieI':function(a,X){return a===X;},'SQvzy':function(a,X){return a!==X;},'BpaLh':function(a,X){return a<X;},'oteOr':'broll_id'},B=v[V['oteOr']],G=this['footages']['find'](a=>a['id']===B);if(!G)return console['error']('Footage\x20wi'+'th\x20ID\x20'+B+'\x20not\x20found'),null;if(!G['tags']||V['uXieI'](G['tags']['length'],0x1*0x3f1+0x3b+0x1*-0x42c))return{'hits':[G]};const W=this['footages']['filter'](a=>{if(a===G||!a['tags']||V['uXieI'](a['tags']['length'],-0x2*-0x112e+0x1888*-0x1+0x94*-0x11))return![];if(V['SQvzy'](a['orientatio'+'n'],G['orientatio'+'n'])&&U)return![];const X=a['tags']['map'](A=>A['value']['toLowerCas'+'e']());for(let A=0x26fc+-0xe99*-0x1+0x1d*-0x1d9;V['BpaLh'](A,G['tags']['length']);A++){if(X['includes'](G['tags'][A]['value']['toLowerCas'+'e']()))return!![];}return![];});return{'hits':[G,...W]};}['getFootage'+'ForApi'](v=[]){return g_user_broll_footage['footages']['filter'](U=>U['descriptio'+'n']!=undefined)['filter'](U=>!v['includes'](U['id']))['map'](U=>{return{...U,'images':[]};});}['filterExis'+'tingFiles'](v){const U=this['footages']['map'](V=>path['resolve'](V['path']));return v['map'](V=>path['resolve'](V))['filter'](V=>!U['includes'](V));}}var g_user_broll_footage=new UserBrollFootage(),g_user_broll_analysis_count=-0x58a*0x4+-0x1002*-0x1+0x626,g_user_broll_analysis_limit=-0x1caa+0x10b3+0xc5b*0x1,g_user_broll_ingest_limit=0x1217+-0x3d*-0x42+0xc7*-0x2b;new Promise(()=>{const v={'pgqUa':function(U){return U();}};g_user_broll_footage['load'](path['join'](DIR_app_data_base,UserBrollFootage['DEFAULT_SA'+'VE_FILENAM'+'E'])),v['pgqUa'](setUserBrollFootageListeners);});