(function(){"use strict";self.onmessage=function(s){const{json:o}=s.data;try{const e=JSON.parse(o),a={};switch(e.type){case"fullstate":a.fullstate=e.body;break;case"agents":a.allAgents=e.body;break;case"currentSessions":a.currentSessions=e.body;break;case"settings":a.settings=e.body;break;case"agentsDownloads":a.agentsDownload=e.body;break;case"downloads":a.downloads=e.body;break;case"availableDownloads":a.availableDownloads=e.body;break;case"downloadedBuilds":a.downloadedBuilds=e.body;break;case"applications":a.applications=e.body;break;case"allApplications":a.allApplications=e.body;break;case"location":a.location=e.body;break;case"locations":a.locations=e.body;break;case"allSchedule":a.schedule=e.body;break;case"plgAgents":a.agents=e.body;break;case"builds":a.builds=e.body;break;case"videosurface":a.videoSurfaceSettings=e.body;break;case"qrss":a.qrsStoPlaygroundBindList=e.body.qrsStoPlaygroundBindList,a.qrssList=e.body.qrClients;break;case"user":a.user=e.body;break;case"amsTasks":a.amsTasks=e.body;break;case"bookedRMs":a.bookedMachines=e.body;break;case"adbDevice":a.connectedADBDevice=e.body;break;case"nativeIsntallations":a.nativeInstallations=e.body;break;case"hmdschanged":a.hmDs=e.body;break;case"healthCheckReportsChanged":a.healthCheckReports=e.body;break;case"agentsScannerInfoChanged":a.agentsScannerInfo=e.body;break;case"anchorPresets":a.anchorPresetBindings=e.body;break;case"adbdeviceconfignotcompare":a.notification={type:"Warning",text:"ADB Device config not compare with settings",tag:"adb",duration:3e3,route:"/options/adbdevice"};break;case"adbDeviceConnected":a.notification={type:"Success",text:`Device ${e.body?.serial} connected`,tag:"adb",duration:3e3};break;case"adbdevicedisonnected":a.notification={type:"Warning",text:"ADB device disconnected",tag:"adb",duration:3e3};break;case"message":a.notification={type:e.body.widgetType,text:e.body.text,tag:"message",duration:3e3};break;default:console.warn("Unknown message type:",e.type);break}self.postMessage({type:"update",data:a})}catch(e){self.postMessage({type:"error",error:e.message})}}})();
