@camstack/addon-admin-ui 0.1.35 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CeLhKMin.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-Cv6qLu_-.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-DXPQtD9p.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-CChEG9e0.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-OcRSBqRe.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-C1BmHlGM.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-GvBGLFI2.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-Bxv_3KWz.js} +1 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs-g85Oidc0.js +15 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs_commonjs-proxy-Bqeq2Zwj.js +1 -0
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-Dl4u0xYE.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-DC63qZbr.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-CSyOECfO.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-D2C49VyZ.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-CzO_Esxm.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-D3WbXy3O.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-xw6c6JeS.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-Csg6EbPB.js} +1 -1
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-DNpf5SLz.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CUc0oFNo.js} +2 -2
- package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-BEKtiDI3.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-vh0hhA5d.js} +1 -1
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-CpGtTxci.js +35 -0
- package/dist/assets/__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-RUDPE9aM.js +1 -0
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-Cjyt3AKP.js +1 -0
- package/dist/assets/{devices-D4k34mru.js → devices-GLp7me2a.js} +1 -1
- package/dist/assets/hostInit-Cx72YpvD.js +1 -0
- package/dist/assets/index-ByRJWRUP.js +1 -0
- package/dist/assets/index-COoei6lw.css +1 -0
- package/dist/assets/index-CtHpLu0L.js +1 -0
- package/dist/assets/{index-D92THlot.js → index-CwF7Dxf8.js} +1 -1
- package/dist/assets/{index-BI3Z7SSi.js → index-D6khiudP.js} +1 -1
- package/dist/assets/index-DNY_otk4.js +151 -0
- package/dist/assets/index-DQFO9ZU6.js +1 -0
- package/dist/assets/index-G9qsQFtk.js +1150 -0
- package/dist/assets/{index-BGZqVJZt.js → index-JJ5NLHxC.js} +1 -1
- package/dist/assets/{index-Bwcmc2hW.js → index-TiJwCuZx.js} +1 -1
- package/dist/assets/index-WrAHDGEr.js +87 -0
- package/dist/assets/index-b0D9qthW.js +1 -0
- package/dist/assets/method-access-map-DLEhlu0x.js +1 -0
- package/dist/assets/{remoteEntry-BRybuw2S.js → remoteEntry-CbhqJYoN.js} +1 -1
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DUkp33c_.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-I5siGnQL.js} +6 -6
- package/dist/index.html +6 -6
- package/dist/mf-entry-bootstrap-0.js +2 -2
- package/dist/server/addon.js +528 -96
- package/dist/server/addon.js.map +1 -1
- package/dist/sw.js +1 -1
- package/package.json +10 -2
- package/dist/assets/_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DYU-qDnu.js +0 -1
- package/dist/assets/hostInit-CBKchP1G.js +0 -1
- package/dist/assets/index-BEewR-UX.js +0 -1
- package/dist/assets/index-BhNfKRLZ.js +0 -1156
- package/dist/assets/index-BqMPfvQx.js +0 -1
- package/dist/assets/index-CP1R6E2R.js +0 -88
- package/dist/assets/index-CwjnPcOV.js +0 -152
- package/dist/assets/index-Dmon2mdO.js +0 -1
- package/dist/assets/index-KlKJOjpC.js +0 -1
- package/dist/assets/index-bBEaoekV.css +0 -1
- package/dist/assets/method-access-map-BFPyQ2-G.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as t,a as p,_ as g,s as e,r as b,l as I,n as a,b as S,c as h,d as P,u as f,e as ot,f as E,g as Pt,h as q,t as Dt,i as Mt,j as oo,k as an,m as so,Z as io,p as co,q as ro,v as lo,w as po,x as mo,y as nn,z as uo,A as go}from"./schemas-BEt-CulV.js";const ho=["onnx","coreml","openvino","tflite","pt"],vo=[{id:"overview",label:"Overview",icon:"layout-dashboard",order:-10},{id:"general",label:"General",icon:"settings",order:0},{id:"image",label:"Image",icon:"image",order:5},{id:"light",label:"Light",icon:"lightbulb",order:7},{id:"motion",label:"Motion",icon:"activity",order:10},{id:"audio",label:"Audio",icon:"mic",order:12},{id:"alarms",label:"Alarms",icon:"bell-ring",order:13},{id:"snapshot",label:"Snapshot",icon:"camera",order:15},{id:"osd",label:"OSD",icon:"type",order:18},{id:"stream-broker",label:"Stream Broker",icon:"radio",order:20},{id:"streaming",label:"Streaming",icon:"video",order:35},{id:"ptz",label:"PTZ",icon:"move",order:40},{id:"pipeline",label:"Detection Pipeline",icon:"cpu",order:39},{id:"zones",label:"Detection",icon:"shapes",order:38},{id:"live-stats",label:"Live Stats",icon:"activity",order:39},{id:"recording",label:"Recording",icon:"circle-dot",order:40},{id:"engine",label:"Inference Engine",icon:"zap",order:41},{id:"scheduler",label:"Scheduler",icon:"list-checks",order:42},{id:"decoder",label:"Decoder",icon:"film",order:43},{id:"notifications",label:"Notifications",icon:"bell",order:50},{id:"network",label:"Network",icon:"globe",order:60},{id:"storage",label:"Storage",icon:"hard-drive",order:70},{id:"advanced",label:"Advanced",icon:"wrench",order:100}],Gp=Object.fromEntries(vo.map(i=>[i.id,i]));function yo(i){return i.type==="separator"||i.type==="info"||i.type==="button"||i.type==="object-array"||i.type==="widget"||i.type==="addon-action-button"}function sa(i,s){return{...i.tabs?{tabs:[...i.tabs]}:{},sections:i.sections.map(n=>({...n,fields:n.fields.map(d=>st(d,s))}))}}function st(i,s){if(yo(i))return i;if(i.type==="group"){const y=i.fields.map(w=>st(w,s));return{...i,fields:y}}if(i.type==="sub-tabs"){const y=i.tabs.map(w=>({...w,fields:w.fields.map(A=>st(A,s))}));return{...i,tabs:y}}const n=i.key,d=Object.prototype.hasOwnProperty.call(s,n)?s[n]:void 0,l=i.default;if(i.multiple){const y=Array.isArray(d)?d:d!=null?[d]:[],k=i.multiple.itemDefault!==void 0?i.multiple.itemDefault:l!==void 0?l:So(i)==="string"?"":null,w=Math.max(i.multiple.min,y.length),A=[];for(let N=0;N<w;N++)A.push(N<y.length?y[N]:k);return{...i,value:A}}const m=d!==void 0?d:l!==void 0?l:null;if(i.type==="password")return{...i,value:""};const v=i.type==="textarea"&&i.isJson&&m!==null&&typeof m=="object"?JSON.stringify(m,null,2):m;return{...i,value:v}}function So(i){switch(i.type){case"text":case"textarea":case"password":case"color":case"probe":return"string";case"number":case"slider":return"number";case"boolean":return"boolean";default:return"other"}}const X=S(["data","media","recordings","recordings-high","recordings-low","recordings-clips","event-images","models","cache","logs","addons-data","backups"]),Vp={data:"singleton",media:"singleton",cache:"singleton",logs:"singleton","addons-data":"singleton",models:"singleton","event-images":"singleton",recordings:"multi","recordings-high":"multi","recordings-low":"multi","recordings-clips":"multi",backups:"multi"},T=t({id:e().regex(/^[a-z][a-z0-9-]*:[a-z0-9-]+$/),type:X,displayName:e().min(1),providerId:e().min(1),config:b(e(),f()),isDefault:h().default(!1),isSystem:h().default(!1),createdAt:a(),updatedAt:a()}),_=E([X,e().regex(/^[a-z][a-z0-9-]*:[a-z0-9-]+$/)]),fo=t({inputFps:a(),outputFps:a(),avgDecodeTimeMs:a(),droppedFrames:a()}),ia=t({codec:e(),maxFps:a().default(0),outputFormat:S(["jpeg","rgb","bgr","yuv420","gray"]).default("jpeg"),scale:a().default(1),width:a().optional(),height:a().optional(),deviceId:a().int().nonnegative().optional(),tag:e().optional(),frameSink:S(["callback","shm"]).default("callback")});function bo(i){return i instanceof Error?i.message:typeof i=="string"?i:String(i)}const Io=[{id:"speech",name:"Speech",icon:"🗣️"},{id:"scream",name:"Scream / Shout",icon:"😱"},{id:"crying",name:"Crying / Baby",icon:"😢"},{id:"laughter",name:"Laughter",icon:"😂"},{id:"music",name:"Music",icon:"🎵"},{id:"dog",name:"Dog",icon:"🐕"},{id:"cat",name:"Cat",icon:"🐈"},{id:"bird",name:"Bird",icon:"🐦"},{id:"animal",name:"Animal (other)",icon:"🐾"},{id:"alarm",name:"Alarm / Siren",icon:"🚨"},{id:"doorbell",name:"Doorbell / Knock",icon:"🔔"},{id:"glass_breaking",name:"Glass Breaking",icon:"💥"},{id:"gunshot",name:"Gunshot / Explosion",icon:"💣"},{id:"vehicle",name:"Vehicle",icon:"🚗"},{id:"siren",name:"Emergency Siren",icon:"🚑"},{id:"fire",name:"Fire / Smoke",icon:"🔥"},{id:"water",name:"Water",icon:"💧"},{id:"wind",name:"Wind / Weather",icon:"🌬️"},{id:"door",name:"Door",icon:"🚪"},{id:"footsteps",name:"Footsteps",icon:"👣"},{id:"crowd",name:"Crowd / Chatter",icon:"👥"},{id:"telephone",name:"Telephone",icon:"📞"},{id:"engine",name:"Engine / Motor",icon:"⚙️"},{id:"tools",name:"Tools / Construction",icon:"🔨"},{id:"silence",name:"Silence",icon:"🤫"}],ko={mapping:{Speech:"speech","Child speech, kid speaking":"speech",Conversation:"speech","Narration, monologue":"speech",Babbling:"speech",Whispering:"speech","Speech synthesizer":"speech",Humming:"speech",Rapping:"speech",Singing:"speech",Choir:"speech","Child singing":"speech",Shout:"scream",Bellow:"scream",Yell:"scream",Screaming:"scream","Children shouting":"scream",Whoop:"scream","Crying, sobbing":"crying","Baby cry, infant cry":"crying",Whimper:"crying","Wail, moan":"crying",Groan:"crying",Laughter:"laughter","Baby laughter":"laughter",Giggle:"laughter",Snicker:"laughter","Belly laugh":"laughter","Chuckle, chortle":"laughter",Music:"music","Musical instrument":"music",Guitar:"music",Piano:"music",Drum:"music","Drum kit":"music","Violin, fiddle":"music",Flute:"music",Saxophone:"music",Trumpet:"music",Synthesizer:"music","Pop music":"music","Rock music":"music","Hip hop music":"music","Classical music":"music",Jazz:"music","Electronic music":"music","Background music":"music",Dog:"dog",Bark:"dog",Yip:"dog",Howl:"dog","Bow-wow":"dog",Growling:"dog","Whimper (dog)":"dog",Cat:"cat",Purr:"cat",Meow:"cat",Hiss:"cat",Caterwaul:"cat",Bird:"bird","Bird vocalization, bird call, bird song":"bird","Chirp, tweet":"bird",Squawk:"bird",Crow:"bird",Owl:"bird","Pigeon, dove":"bird",Animal:"animal","Domestic animals, pets":"animal","Livestock, farm animals, working animals":"animal",Horse:"animal","Cattle, bovinae":"animal",Pig:"animal",Sheep:"animal",Goat:"animal",Frog:"animal",Insect:"animal",Cricket:"animal",Alarm:"alarm","Alarm clock":"alarm","Smoke detector, smoke alarm":"alarm","Fire alarm":"alarm",Buzzer:"alarm","Civil defense siren":"alarm","Car alarm":"alarm",Siren:"siren","Police car (siren)":"siren","Ambulance (siren)":"siren","Fire engine, fire truck (siren)":"siren","Emergency vehicle":"siren",Foghorn:"siren",Doorbell:"doorbell","Ding-dong":"doorbell",Knock:"doorbell",Tap:"doorbell",Glass:"glass_breaking",Shatter:"glass_breaking","Chink, clink":"glass_breaking","Gunshot, gunfire":"gunshot","Machine gun":"gunshot",Explosion:"gunshot",Fireworks:"gunshot",Firecracker:"gunshot","Artillery fire":"gunshot","Cap gun":"gunshot",Boom:"gunshot",Vehicle:"vehicle",Car:"vehicle",Truck:"vehicle",Bus:"vehicle",Motorcycle:"vehicle","Car passing by":"vehicle","Vehicle horn, car horn, honking":"vehicle","Traffic noise, roadway noise":"vehicle",Train:"vehicle",Aircraft:"vehicle",Helicopter:"vehicle",Bicycle:"vehicle",Skateboard:"vehicle",Fire:"fire",Crackle:"fire",Water:"water",Rain:"water",Raindrop:"water","Rain on surface":"water",Stream:"water",Waterfall:"water",Ocean:"water","Waves, surf":"water","Splash, splatter":"water",Wind:"wind",Thunderstorm:"wind",Thunder:"wind","Wind noise (microphone)":"wind","Rustling leaves":"wind",Door:"door","Sliding door":"door",Slam:"door","Cupboard open or close":"door","Walk, footsteps":"footsteps",Run:"footsteps",Shuffle:"footsteps",Crowd:"crowd",Chatter:"crowd",Cheering:"crowd",Applause:"crowd","Children playing":"crowd","Hubbub, speech noise, speech babble":"crowd",Telephone:"telephone","Telephone bell ringing":"telephone",Ringtone:"telephone","Telephone dialing, DTMF":"telephone","Busy signal":"telephone",Engine:"engine","Engine starting":"engine",Idling:"engine","Accelerating, revving, vroom":"engine","Light engine (high frequency)":"engine","Medium engine (mid frequency)":"engine","Heavy engine (low frequency)":"engine","Lawn mower":"engine",Chainsaw:"engine",Hammer:"tools",Jackhammer:"tools",Sawing:"tools","Power tool":"tools",Drill:"tools",Sanding:"tools",Silence:"silence"},preserveOriginal:!1},wo={mapping:{speech:"speech",child_speech:"speech",conversation:"speech",whispering:"speech",singing:"speech",humming:"speech",shout:"scream",yell:"scream",screaming:"scream",crying:"crying",baby_crying:"crying",sobbing:"crying",laughter:"laughter",baby_laughter:"laughter",giggling:"laughter",music:"music",guitar:"music",piano:"music",drums:"music",dog_bark:"dog",dog_bow_wow:"dog",dog_growling:"dog",dog_howl:"dog",cat_meow:"cat",cat_purr:"cat",cat_hiss:"cat",bird:"bird",bird_chirp:"bird",bird_squawk:"bird",animal:"animal",horse:"animal",cow_moo:"animal",insect:"animal",alarm:"alarm",smoke_alarm:"alarm",fire_alarm:"alarm",car_alarm:"alarm",siren:"siren",police_siren:"siren",ambulance_siren:"siren",doorbell:"doorbell",door_knock:"doorbell",knocking:"doorbell",glass_breaking:"glass_breaking",glass_shatter:"glass_breaking",gunshot:"gunshot",explosion:"gunshot",fireworks:"gunshot",car:"vehicle",truck:"vehicle",motorcycle:"vehicle",car_horn:"vehicle",vehicle_horn:"vehicle",traffic:"vehicle",fire:"fire",fire_crackle:"fire",water:"water",rain:"water",ocean:"water",splash:"water",wind:"wind",thunder:"wind",thunderstorm:"wind",door:"door",door_slam:"door",sliding_door:"door",footsteps:"footsteps",walking:"footsteps",running:"footsteps",crowd:"crowd",chatter:"crowd",cheering:"crowd",applause:"crowd",telephone_ring:"telephone",ringtone:"telephone",engine:"engine",engine_starting:"engine",lawn_mower:"engine",chainsaw:"engine",hammer:"tools",jackhammer:"tools",drill:"tools",power_tool:"tools",silence:"silence"},preserveOriginal:!1},Et=new Map;for(const[i,s]of Object.entries(ko.mapping))Et.set(i.toLowerCase(),s);for(const[i,s]of Object.entries(wo.mapping))Et.set(i.toLowerCase(),s);function jp(i){return Et.get(i.toLowerCase())??null}function Zp(){return Io.map(i=>i.id)}var C=(i=>(i.Camera="camera",i.Hub="hub",i.Light="light",i.Siren="siren",i.Switch="switch",i.Sensor="sensor",i.Thermostat="thermostat",i.Button="button",i.Generic="generic",i))(C||{}),on=(i=>(i.BatteryOperated="battery-operated",i.Rebootable="rebootable",i.NativeSnapshot="native-snapshot",i.DoorbellButton="doorbell-button",i.TwoWayAudio="two-way-audio",i.PanTiltZoom="pan-tilt-zoom",i.PtzAutotrack="ptz-autotrack",i.MotionTrigger="motion-trigger",i))(on||{}),Ao=(i=>(i.ChargingDC="charging-dc",i.ChargingSolar="charging-solar",i.NotCharging="not-charging",i))(Ao||{}),F=(i=>(i.Siren="siren",i.Floodlight="floodlight",i.Spotlight="spotlight",i.PirSensor="pir-sensor",i.Chime="chime",i.Autotrack="autotrack",i.Nightvision="nightvision",i.PrivacyMask="privacy-mask",i.Doorbell="doorbell",i))(F||{});const H={Siren:F.Siren,Floodlight:F.Floodlight,Spotlight:F.Spotlight,PirSensor:F.PirSensor,Chime:F.Chime,Autotrack:F.Autotrack,Nightvision:F.Nightvision,PrivacyMask:F.PrivacyMask},Yp={[H.Siren]:"Siren",[H.Floodlight]:"Floodlight",[H.Spotlight]:"Spotlight",[H.PirSensor]:"PIR",[H.Chime]:"Chime",[H.Autotrack]:"Autotracking",[H.Nightvision]:"Night Vision",[H.PrivacyMask]:"Privacy Mask"};function Qp(i,s,n){const d=`${i}:${s}`;return typeof n=="number"?`${d}:${n}`:d}function Co(i,s){return!i||i.length===0?!1:i.includes(s.when.hasFeature)}const No={id:"battery",label:"Battery-operated camera",when:{hasFeature:on.BatteryOperated},defaults:{audioMode:"disabled",detectionMode:"on-motion"},settings:{"snapshot.minRefreshIntervalSec":3600,"streamBroker.preBufferEnabled":!1}},Po=[No];function Jp(i){for(const s of Po)if(Co(i,s))return s;return null}const Oe=t({online:h(),lastChangedAt:a()}),xt={name:"device-status",scope:"device",mode:"singleton",methods:{},events:{onStatusChanged:{data:t({deviceId:a(),status:Oe})}},status:{schema:Oe,kind:"push"},runtimeState:Oe},ze=t({flags:b(e(),f()),deviceType:e().nullable(),model:e().nullable(),channelCount:a().nullable(),lastProbedAt:a(),lastFetchedAt:a()}),Tt={name:"feature-probe",scope:"device",mode:"singleton",methods:{},events:{onProbeChanged:{data:t({deviceId:a(),status:ze})}},status:{schema:ze,kind:"push"},runtimeState:ze},Do=t({id:e(),title:e(),description:e().optional(),style:S(["card","accordion"]).optional(),defaultCollapsed:h().optional(),columns:E([I(1),I(2),I(3),I(4)]).optional(),tab:e().optional(),location:S(["settings","top-tab"]).optional(),order:a().optional(),fields:p(an())}),Mo=t({id:e(),label:e(),icon:e(),order:a().optional()}),Eo=t({tabs:p(Mo).optional(),sections:p(Do)}),ca=Eo.nullable(),xo={getDeviceSettingsContribution:{input:t({deviceId:a()}),output:ca,kind:"query",auth:"protected"},getDeviceLiveContribution:{input:t({deviceId:a()}),output:ca,kind:"query",auth:"protected"},applyDeviceSettingsPatch:{input:t({deviceId:a(),patch:b(e(),f())}),output:t({success:I(!0)}),kind:"mutation",auth:"admin"}},To={getStatus:{input:t({deviceId:a()}),output:f().nullable(),kind:"query",auth:"protected"}};function Xp(i){let s=i.methods;return i.exposesDeviceSettings&&(s={...xo,...s}),i.status&&(s={...To,...s}),s}function c(i,s,n){return{input:i,output:s,kind:n?.kind??"query",auth:n?.auth??"protected",...n?.access!==void 0?{access:n.access}:{},timeoutMs:n?.timeoutMs}}function V(i){return{data:i}}function em(i){return i?.deviceConfig!==void 0}const Ro=t({className:e(),hits:a().int().nonnegative(),avgScore:a().min(0).max(1),peakScore:a().min(0).max(1)}),ra=t({ts:a().int(),windowSec:a().int().positive(),level:t({rms:a(),dbfs:a()}),peakDbfs:a(),avgDbfs:a(),current:t({className:e(),score:a().min(0).max(1),timestamp:a().int()}).nullable(),byClass:p(Ro).readonly()}),Bo=t({ts:a().int(),dbfs:a().nullable(),peakDbfs:a(),avgDbfs:a(),topClass:e().nullable(),topScore:a().min(0).max(1).nullable()}),qo=t({points:p(Bo).readonly(),effectiveSampleEveryMs:a().int().positive(),windowMsActual:a().int().nonnegative()}),sn={name:"audio-metrics",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{getCurrentSnapshot:c(t({deviceId:a()}),ra.nullable()),getHistory:c(t({deviceId:a(),windowSec:a().int().positive().optional(),sampleEveryMs:a().int().positive().optional()}),qo)},runtimeState:ra},Le=t({percentage:a().min(0).max(100),charging:S(["dc","solar","none"]),sleeping:h(),lastUpdated:a()}),cn={name:"battery",scope:"device",mode:"singleton",deviceTypes:[C.Camera,C.Sensor,C.Button,C.Switch],methods:{},events:{onStatusChanged:{data:t({deviceId:a(),status:Le})}},status:{schema:Le,kind:"push"},runtimeState:Le},da=t({percentage:a().min(0).max(100),lastChangedAt:a()}),rn={name:"brightness",scope:"device",mode:"singleton",deviceTypes:[C.Light],methods:{setBrightness:c(t({deviceId:a().int().nonnegative(),percentage:a().min(0).max(100)}),g(),{kind:"mutation",auth:"admin"})},events:{onBrightnessChanged:{data:t({deviceId:a(),percentage:a().min(0).max(100),lastChangedAt:a()})}},status:{schema:da,kind:"command-driven"},runtimeState:da},W=S(["high","mid","low"]),tm=["high","mid","low"],dn=S(["pull-rtsp","pull-rtmp","pull-http","pull-rfc4571","push-annexb"]),Rt=t({width:a().int().positive(),height:a().int().positive()}),it=t({camStreamId:e().min(1),deviceId:a().int().nonnegative(),kind:dn,url:e().optional(),codec:e().optional(),resolution:Rt.optional(),fps:a().positive().optional(),label:e().optional(),deviceFeatures:p(e()).optional(),autoEligible:h().optional(),metadata:b(e(),f()).optional()}),ke=S(["unassigned","idle","connecting","streaming","error"]),ct=t({deviceId:a().int().nonnegative(),profile:W,brokerId:e(),sourceCamStreamId:e().nullable(),status:ke,resolution:Rt.optional(),codec:e().optional(),preBufferSec:a().nonnegative().optional(),errorMessage:e().optional()}),Oo=t({id:e(),label:e(),protocol:S(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:e().optional(),resolution:t({width:a(),height:a()}).readonly().optional(),fps:a().optional(),bitrate:a().optional(),codec:e().optional(),profileHint:S(["high","mid","low"]).optional()}),am=t({type:e(),url:e(),videoCodec:e().optional(),audioCodec:e().optional(),metadata:b(e(),f()).readonly().optional()}),zo=t({type:S(["video","audio"]),data:P(Uint8Array),pts:a(),dts:a(),keyframe:h(),codec:e()}),la=t({data:P(Uint8Array),width:a(),height:a(),format:S(["jpeg","rgb","bgr","yuv420","gray"]),timestamp:a()}),rt=t({shmId:e(),slot:a().int().nonnegative(),seq:a().int().nonnegative(),width:a().int().positive(),height:a().int().positive(),format:S(["jpeg","rgb","bgr","yuv420","gray"]),pts:a(),byteLength:a().int().nonnegative(),nodeId:e(),slotCount:a().int().positive()}),Lo=S(["rgb","bgr","yuv420","gray"]),_o=t({brokerId:e(),format:Lo,maxFps:a().positive().optional(),tag:e().optional()}),Fo=t({subscriptionId:e(),maxFps:a().nonnegative()}),Uo=t({data:P(Uint8Array),sampleRate:a().int().positive(),channels:a().int().positive(),timestamp:a()}),Ho=t({brokerId:e(),tag:e().optional()}),$o=t({subscriptionId:e()}),Wo=S(["idle","connecting","streaming","error","stopped"]),Ko=t({status:Wo,inputFps:a(),decodeFps:a(),encodedSubscribers:a(),decodedSubscribers:a(),uptimeMs:a(),bitrateKbps:a(),idrIntervalMs:a(),codec:e().optional(),totalBytes:a(),packetCount:a(),rtspClients:a(),pipeClients:a(),preBufferSec:a(),preBufferMs:a(),preBufferPackets:a(),decoderNodeId:e().nullable(),audio:t({codec:e(),sampleRate:a(),channels:a(),supported:h()}).nullable().optional()}),Bt=S(["webrtc","hls","mjpeg","rtsp"]),Go=t({streamId:e(),format:Bt,url:e().nullable(),active:h()}),Vo={name:"streaming-engine",scope:"system",mode:"singleton",internal:!0,methods:{registerStream:c(t({streamId:e(),sourceUrl:e(),codec:e().optional()}),g(),{kind:"mutation"}),unregisterStream:c(t({streamId:e()}),g(),{kind:"mutation"}),getStreamUrl:c(t({streamId:e(),format:Bt}),e().nullable()),listStreams:c(g(),p(Go))}},dt=t({brokerId:e(),url:e(),mutedUrl:e(),enabled:h()}),jo=t({sessionId:e(),remoteAddr:e(),playing:h(),muted:h(),connectedAt:a(),lastRtpAt:a(),bytesSent:a()}),Zo=t({tag:e(),subscribedAt:a(),maxFps:a(),framesDelivered:a(),framesDropped:a()}),Yo=t({tag:e(),subscribedAt:a(),chunksDelivered:a()}),Qo=t({rtsp:p(jo).readonly(),decoded:p(Zo).readonly(),audio:p(Yo).readonly(),pipeClients:a(),encodedSubscribers:a()}),nm=S(["reconnecting","sleeping","offline","disabled","waking"]),Jo=S(["H264","H265","auto"]),Xo=S(["AAC","Opus","PCMU","none"]),ln=t({width:a().int().positive(),height:a().int().positive()}),es=t({deviceId:a().int().nonnegative(),videoCodec:Jo,audioCodec:Xo.optional(),maxResolution:ln.optional(),tag:e().optional()}),ts=t({url:e(),videoCodec:S(["H264","H265"]),audioCodec:e(),resolution:ln,transcoded:h(),encoder:e(),pipelineKey:e()}),as={name:"stream-broker",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{publishCameraStream:c(t({deviceId:a().int().nonnegative(),camStreamId:e().min(1),kind:dn,url:e().optional(),codec:e().optional(),resolution:Rt.optional(),fps:a().positive().optional(),label:e().optional(),deviceFeatures:p(e()).optional(),autoEligible:h().optional(),metadata:b(e(),f()).optional()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),retractCameraStream:c(t({deviceId:a().int().nonnegative(),camStreamId:e().min(1)}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),assignProfile:c(t({deviceId:a().int().nonnegative(),profile:W,camStreamId:e().min(1)}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),unassignProfile:c(t({deviceId:a().int().nonnegative(),profile:W}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),listAllCameraStreams:c(g(),p(it).readonly()),listAllProfileSlots:c(g(),p(ct).readonly()),getBrokerStats:c(t({brokerId:e()}),Ko),listClients:c(t({brokerId:e()}),Qo),killClient:c(t({brokerId:e(),channel:S(["rtsp","decoded","audio"]),handle:e()}),t({killed:h()}),{kind:"mutation",auth:"admin"}),restartProfile:c(t({deviceId:a().int().nonnegative(),profile:W}),t({success:h()}),{kind:"mutation",auth:"admin"}),getStreamUrl:c(t({streamId:e(),format:Bt}),t({url:e()})),getStreamWithCodec:c(es,ts,{kind:"mutation",auth:"admin"}),releaseStreamWithCodec:c(t({pipelineKey:e()}),t({released:h(),refcount:a().int().nonnegative()}),{kind:"mutation",auth:"admin"}),subscribeAudioChunks:c(Ho,$o,{kind:"mutation"}),pullAudioChunks:c(t({subscriptionId:e(),maxCount:a().int().positive().default(8)}),p(Uo).readonly()),unsubscribeAudioChunks:c(t({subscriptionId:e()}),t({released:h()}),{kind:"mutation"}),subscribeFrames:c(_o,Fo,{kind:"mutation"}),pullFrameHandles:c(t({subscriptionId:e(),maxCount:a().int().positive().default(4)}),p(rt).readonly()),unsubscribeFrames:c(t({subscriptionId:e()}),t({released:h()}),{kind:"mutation"}),setPreBufferDuration:c(t({brokerId:e(),seconds:a().min(0).max(30)}),g(),{kind:"mutation",auth:"admin"}),getPreBufferInfo:c(t({brokerId:e()}),t({configuredSec:a(),bufferedMs:a(),packetCount:a()})),getRtspPort:c(g(),a()),getAllRtspEntries:c(t({hostname:e().optional()}),p(dt).readonly()),getRtspEntry:c(t({brokerId:e(),hostname:e().optional()}),dt.nullable()),regenerateRtspToken:c(t({brokerId:e()}),e().nullable(),{kind:"mutation",auth:"admin"}),setRtspEnabled:c(t({brokerId:e(),enabled:h()}),g(),{kind:"mutation",auth:"admin"}),isRtspEnabled:c(t({brokerId:e()}),h())},events:{onCamStreamDemand:V(t({deviceId:a().int().nonnegative(),camStreamId:e(),profile:W})),onCamStreamIdle:V(t({deviceId:a().int().nonnegative(),camStreamId:e()})),onRequestStreamSourceRefresh:V(t({deviceId:a().int().nonnegative(),camStreamId:e(),brokerId:e()}))}},pn={name:"camera-streams",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[C.Camera],methods:{getCameraStreams:c(t({deviceId:a().int().nonnegative()}),p(it).readonly()),getBrokerStreams:c(t({deviceId:a().int().nonnegative()}),p(ct).readonly()),getRtspEntries:c(t({deviceId:a().int().nonnegative(),hostname:e().optional()}),p(dt).readonly())},events:{onCamStreamsChanged:V(t({deviceId:a().int().nonnegative(),camStreams:p(it).readonly()})),onProfileSlotsChanged:V(t({deviceId:a().int().nonnegative(),profileSlots:p(ct).readonly()}))},runtimeState:t({online:h(),slotStatuses:t({high:ke.optional(),mid:ke.optional(),low:ke.optional()}),slotErrors:t({high:e().optional(),mid:e().optional(),low:e().optional()}),lastChangedAt:a()})},ns=S(["online","sleeping","offline","unknown"]),lt=t({childNativeId:e(),name:e(),type:S(C),status:ns,metadata:t({model:e().optional(),serialNumber:e().optional(),uid:e().optional(),rtspChannel:a().int().nonnegative().optional(),isBattery:h().optional(),isDoorbell:h().optional(),isMultifocal:h().optional()}).default({}),alreadyAdopted:h(),adoptedDeviceId:a().int().nonnegative().nullable()}),pa=t({discovered:p(lt),lastDiscoveryAt:a().int().nonnegative().nullable(),lastError:e().nullable()}),mn={name:"device-discovery",scope:"device",mode:"singleton",deviceTypes:[C.Hub],status:{schema:pa,kind:"poll"},runtimeState:pa.extend({lastFetchedAt:a().int().nonnegative()}),methods:{listDiscovered:c(t({deviceId:a().int().nonnegative()}),p(lt).readonly()),refreshDiscovery:c(t({deviceId:a().int().nonnegative()}),p(lt).readonly(),{kind:"mutation",auth:"admin"}),adoptDevice:c(t({deviceId:a().int().nonnegative(),childNativeId:e(),name:e().optional()}),t({deviceId:a().int().nonnegative(),stableId:e()}),{kind:"mutation",auth:"admin"}),releaseDevice:c(t({deviceId:a().int().nonnegative(),childDeviceId:a().int().nonnegative()}),g(),{kind:"mutation",auth:"admin"})}},ma=t({lastPressedAt:a().nullable(),pressCountSinceStart:a()}),os=t({deviceId:a(),timestamp:a()}),un={name:"doorbell",scope:"device",mode:"singleton",deviceTypes:[C.Button],methods:{},events:{onPressed:{data:os}},status:{schema:ma,kind:"push"},runtimeState:ma},ss=S(["jpeg","rgb","bgr","yuv420","gray"]),we=t({data:q(),format:ss,width:a(),height:a(),timestamp:a()}),te=t({x:a(),y:a(),w:a(),h:a()}),is=t({class:e(),originalClass:e(),score:a(),bbox:te}),ua=t({data:P(Float32Array),sampleRate:a(),channels:a(),timestamp:a(),deviceId:a().optional()}),cs=t({rms:a(),dbfs:a()}),pt=t({className:e(),originalClass:e().optional(),score:a()}),De=t({bbox:te,pixelCount:a(),intensity:a()}),rs=t({detected:h(),regionCount:a(),regions:p(De).readonly(),rawRegions:p(De).readonly(),frameWidth:a(),frameHeight:a(),analysisMs:a()}),ds={name:"motion-detection",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,exposesDeviceSettings:!0,methods:{analyze:c(t({deviceId:a(),frame:we}),rs,{kind:"mutation"}),removeCamera:c(t({deviceId:a()}),g(),{kind:"mutation"}),reset:c(g(),g(),{kind:"mutation"})},events:{onMotion:{data:t({deviceId:a(),detected:h(),regionCount:a()})}}},om=t({activeCameras:a(),throttledCameras:a(),avgInferenceTimeMs:a(),queueDepth:a()}),qt=t({detectionMode:S(["disabled","always-on","on-motion"]),configuredFps:a(),actualFps:a(),queueDepth:a(),avgInferenceTimeMs:a(),droppedFrames:a(),phase:S(["idle","watching","active"])}),ls=qt.extend({deviceId:a()}),mt=S(["onnx","coreml","openvino","tflite","pt"]),ue=S(["detector","cropper","classifier","refiner","audio-classifier"]),D=t({runtime:S(["node","python"]),backend:e(),format:mt,device:e().optional()}),ps=t({id:e(),label:e(),description:e().optional()}),ms=t({engine:D,devices:p(ps).readonly(),defaultDevice:e()}),ut=Pt(()=>t({addonId:e(),addonName:e(),slot:ue,inputClasses:p(e()).readonly(),outputClasses:p(e()).readonly(),enabled:h(),modelId:e(),children:p(ut).readonly(),engine:D.optional(),group:e().optional(),settings:b(e(),f()).optional()})),Me=Pt(()=>t({addonId:e(),enabled:h(),modelId:e(),children:p(Me).readonly(),settings:b(e(),f()).optional()})),_e=t({id:e(),name:e(),createdAt:e(),updatedAt:e(),engine:D,steps:p(Me).readonly()}),us=t({id:e(),name:e(),formats:b(e(),t({downloaded:h(),sizeMB:a()}))}),gs=q(),hs=t({id:e(),name:e(),slot:ue,inputClasses:p(e()).readonly(),outputClasses:p(e()).readonly(),childSlots:p(ue).readonly(),models:p(us).readonly(),defaultModelId:e(),defaultModelIdByFormat:b(e(),e()).optional(),enabledByDefault:h().optional(),defaultConfidence:a(),group:e().optional(),configSchema:p(gs).readonly().optional()}),vs=t({id:ue,label:e(),priority:a(),parentSlot:ue.nullable(),addons:p(hs).readonly()}),ys=t({availableEngines:p(ms).readonly(),selectedEngine:D,slots:p(vs).readonly()}),Ss=t({detections:p(is).readonly(),inferenceMs:a(),modelId:e()}),ee=Pt(()=>t({addonId:e(),modelId:e(),enabled:h().default(!0),children:p(ee).optional(),settings:b(e(),f()).optional()})),fs=t({filename:e(),stepIds:p(e()).readonly().optional()}),bs=t({base64:e(),filename:e()}),Is=t({filename:e(),sizeKb:a()}),ks=t({base64:e()}),ws=t({id:e(),name:e(),description:e(),available:h(),rawLabels:p(e()).readonly().optional()}),As=t({activeBackend:e(),availableBackends:p(ws).readonly(),sampleRate:a(),chunkDurationMs:a()}),Cs=t({filePath:e(),sizeMB:a(),durationMs:a()}),Ns=t({success:h(),error:e().optional(),frame:q().optional()}),Ps=q(),Ds=q(),Ms=q(),Es=q(),xs=q(),ga=q(),Ts={name:"pipeline-executor",scope:"system",mode:"singleton",methods:{getAvailableEngines:c(g(),p(D)),getSelectedEngine:c(g(),D),getDefaultSteps:c(D,p(ut)),reprobeEngine:c(g(),D,{kind:"mutation",auth:"admin"}),getVideoPipelineSteps:c(g(),b(e(),t({modelId:e(),settings:b(e(),f()).readonly()}))),setVideoPipelineSteps:c(t({steps:b(e(),t({modelId:e(),settings:b(e(),f()).readonly()}))}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),getSchema:c(g(),ys),getGlobalSteps:c(g(),p(ut).readonly().nullable()),getGlobalPipelineConfig:c(g(),Ps),getOrchestratorConfigSchema:c(g(),Ds),listTemplates:c(g(),p(_e).readonly()),saveTemplate:c(t({name:e(),steps:p(Me).readonly(),engine:D}),_e,{kind:"mutation"}),updateTemplate:c(t({id:e(),name:e().optional(),steps:p(Me).readonly().optional()}),_e,{kind:"mutation"}),deleteTemplate:c(t({id:e()}),g(),{kind:"mutation"}),getCapabilities:c(g(),Es),getAddonModels:c(t({addonId:e()}),xs),downloadModel:c(t({addonId:e(),modelId:e(),format:mt}),Cs,{kind:"mutation"}),deleteModel:c(t({addonId:e(),modelId:e(),format:mt}),t({success:I(!0)}),{kind:"mutation"}),detect:c(t({addonId:e(),frame:we,config:b(e(),f()).optional()}),Ss),runPipeline:c(t({engine:D.optional(),steps:p(ee).min(1),frame:we.optional(),imageBase64:e().optional(),image:P(Uint8Array).optional(),referenceImage:e().optional(),deviceId:a().optional(),sessionId:e().optional()}),ga,{kind:"mutation"}),runPipelineBatch:c(t({engine:D.optional(),steps:p(ee).min(1),frames:p(we).min(1).max(255),deviceId:a().optional(),sessionId:e().optional()}),t({results:p(ga).readonly()}),{kind:"mutation"}),cacheFrameInPool:c(t({data:P(Uint8Array),width:a().int().positive(),height:a().int().positive(),format:S(["rgb","bgr","gray"])}),t({frameId:a(),width:a(),height:a()}),{kind:"mutation"}),inferCached:c(t({stepId:e(),frameId:a().int()}),b(e(),f()),{kind:"mutation"}),uncacheFrame:c(t({frameId:a().int()}),g(),{kind:"mutation"}),getEffectiveTuning:c(g(),t({batchMode:e(),windowMs:a(),maxBatchSize:a(),concurrency:a()})),listLoadedEngines:c(g(),p(t({engineKey:e(),engine:D,modelsLoaded:p(e()).readonly(),inUseByCameras:p(a()).readonly(),kind:S(["runtime","warm-override"]),poolPid:a().nullable(),idleMs:a().nullable(),idleTtlMs:a().nullable()})).readonly()),spinEngine:c(t({engine:D}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),killEngine:c(t({engine:D,force:h().optional()}),t({success:h(),reason:e().optional()}),{kind:"mutation",auth:"admin"}),listReferenceImages:c(g(),p(fs).readonly()),getReferenceImage:c(t({filename:e()}),bs.nullable()),getReferenceAudioFiles:c(g(),p(Is).readonly()),getReferenceAudio:c(t({filename:e()}),ks.nullable()),getAudioCapabilities:c(g(),As),runAudioTest:c(t({addonId:e(),modelId:e(),filename:e().optional(),settings:b(e(),f()).optional()}),Ns,{kind:"mutation"}),getDetectionConfigSchema:c(g(),Ms)}},Rs=S(["polygon","tripwire"]),Bs=t({x:a(),y:a()}),re=t({id:e(),name:e(),kind:Rs.default("polygon"),polygon:p(Bs).readonly(),color:e().default("#3b82f6")}),gn={name:"zones",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{listZones:c(t({deviceId:a()}),p(re).readonly()),addZone:c(t({deviceId:a(),zone:re}),g(),{kind:"mutation",auth:"admin"}),removeZone:c(t({deviceId:a(),zoneId:e()}),g(),{kind:"mutation",auth:"admin"}),updateZone:c(t({deviceId:a(),zone:re}),g(),{kind:"mutation",auth:"admin"})},runtimeState:t({zones:p(re).readonly()})},Y={min:0,max:6e4,default:3e4,step:500},K={min:1,max:30,default:4,step:1},G={min:1,max:30,default:10,step:1},Ot=S(["onboard","analyzer"]),qs=p(Ot),Os=t({deviceId:a(),detected:h(),source:Ot.default("analyzer"),regions:p(De).readonly().optional()}),zs=t({deviceId:a(),detectionMode:S(["disabled","always-on","on-motion"]).default("on-motion"),audioMode:S(["disabled","always-on","on-motion"]).default("always-on"),motionCooldownMs:a().min(Y.min).default(Y.default),motionFps:a().min(K.min).max(K.max).default(K.default),detectionFps:a().min(G.min).max(G.max).default(G.default),motionStreamId:e(),detectionStreamId:e(),motionSources:qs.default(["analyzer"]),pipelineEnabled:h().default(!0),engine:D.optional(),steps:p(ee).readonly().optional(),audio:t({engine:D,modelId:e(),enabled:h()}).nullable().optional(),zones:p(re).readonly().default([])}),sm=[{key:"motionSources",type:"multiselect",label:"Motion Sources",default:["analyzer"],options:[{value:"analyzer",label:"Frame-diff Analyzer (motion addon)"},{value:"onboard",label:"Camera Onboard Sensor"}]},{key:"motionFps",type:"slider",label:"Motion FPS (analyzer)",min:K.min,max:K.max,step:K.step,default:K.default,showValue:!0,unit:"fps",showWhen:{field:"motionSources",includes:"analyzer"}},{key:"detectionFps",type:"slider",label:"Detection FPS",min:G.min,max:G.max,step:G.step,default:G.default,showValue:!0,unit:"fps"},{key:"motionCooldownMs",type:"slider",label:"Motion Cooldown",description:"Time without a fresh motion event before the active phase ends. Applies to all motion sources — every motion event re-arms the timer.",min:Y.min,max:Y.max,step:Y.step,default:Y.default,showValue:!0,unit:"s",displayScale:1e3}],hn=t({nodeId:e(),attachedCameras:a(),activeCameras:a(),avgInferenceFps:a(),avgInferenceTimeMs:a(),queueDepthTotal:a(),hardware:t({hasGpu:h(),inferenceBackend:e().optional(),cpuCores:a().optional()})}),Ls=t({nodeId:e(),activeCameras:a(),throttledCameras:a(),avgInferenceTimeMs:a(),queueDepth:a()}),_s={name:"pipeline-runner",scope:"system",mode:"singleton",methods:{attachCamera:c(zs,t({success:I(!0)}),{kind:"mutation"}),detachCamera:c(t({deviceId:a()}),t({success:I(!0)}),{kind:"mutation"}),reportMotion:c(Os,t({success:I(!0)}),{kind:"mutation"}),getLocalLoad:c(g(),hn),getLocalMetrics:c(g(),Ls),getCameraMetrics:c(t({deviceId:a()}),qt.nullable()),getAllCameraMetrics:c(g(),p(ls).readonly()),getLocalCameras:c(g(),p(a()).readonly())}},ha=t({detected:h(),lastDetectedAt:a().nullable(),autoClearAfterMs:a().nullable()}),Fs=t({deviceId:a(),detected:h(),timestamp:a(),source:Ot,regions:p(De).readonly().optional()}),vn={name:"motion",scope:"device",mode:"singleton",deviceTypes:[C.Camera,C.Sensor],methods:{isDetected:c(t({deviceId:a()}),h())},events:{onMotionChanged:{data:Fs}},status:{schema:ha,kind:"push"},runtimeState:ha},yn=t({enabled:h(),lastChangedAt:a()}),Us=yn.extend({lastFetchedAt:a()}),Sn={name:"motion-trigger",scope:"device",mode:"singleton",deviceTypes:[C.Light,C.Siren,C.Switch],methods:{setMotionTrigger:c(t({deviceId:a().int().nonnegative(),enabled:h()}),g(),{kind:"mutation",auth:"admin"})},events:{onMotionTriggerChanged:{data:t({deviceId:a(),enabled:h(),lastChangedAt:a()})}},status:{schema:yn,kind:"command-driven"},runtimeState:Us},va=t({enabled:h(),sensitivity:a(),cells:p(h()),lastFetchedAt:a()}),Hs=t({gridWidth:a(),gridHeight:a(),sensitivity:t({min:a(),max:a(),step:a()})}),$s=t({enabled:h().optional(),sensitivity:a().optional(),cells:p(h()).optional()}),fn={name:"motion-zones",scope:"device",mode:"singleton",deviceTypes:[C.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/motion-zones-grid",tab:"motion",label:"Motion Zones"}},methods:{getOptions:c(t({deviceId:a()}),Hs),setZone:c(t({deviceId:a(),patch:$s}),g(),{kind:"mutation",auth:"admin"})},status:{schema:va,kind:"poll"},runtimeState:va},Ws=e().describe("Vendor target string (people/vehicle/pet); empty = camera default"),gt=t({targetType:Ws,stopDelaySeconds:a().int().min(0).max(300),disappearDelaySeconds:a().int().min(0).max(300)}),Ks=t({value:e(),label:e()}),Ae=t({enabled:h(),lastChangedAt:a(),currentSettings:gt.nullable(),supportedTargetTypes:p(Ks)}),Gs=Ae.extend({lastFetchedAt:a()}),bn={name:"ptz-autotrack",scope:"device",mode:"singleton",deviceTypes:[C.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-autotrack",tab:"ptz",topTab:!0,label:"Auto-Tracking",order:5}},methods:{getStatus:c(t({deviceId:a()}),Ae),setEnabled:c(t({deviceId:a(),enabled:h()}),g(),{kind:"mutation"}),getSettings:c(t({deviceId:a()}),gt.nullable()),setSettings:c(t({deviceId:a(),settings:gt.partial()}),g(),{kind:"mutation"})},events:{onStatusChanged:{data:t({deviceId:a(),status:Ae})}},status:{schema:Ae,kind:"command-driven"},runtimeState:Gs},Vs=S(["main","sub","ext"]),Fe=t({width:a(),height:a(),codec:S(["h264","h265"]),framerate:a(),bitrate:a(),bitrateMode:S(["vbr","cbr"]).optional(),encoderProfile:S(["high","main","baseline"]).optional(),gop:a().optional(),audio:h().optional()}),ya=t({main:Fe.optional(),sub:Fe.optional(),ext:Fe.optional(),lastFetchedAt:a()}),Ue=t({resolutions:p(t({width:a(),height:a()})),codecs:p(S(["h264","h265"])),framerates:p(a()),bitrates:p(a()),bitrateRange:Dt([a(),a()]).optional(),supportsBitrateMode:h(),supportsEncoderProfile:h(),supportsGop:h(),gop:t({min:a(),max:a(),step:a()}).optional()}),js=t({main:Ue.optional(),sub:Ue.optional(),ext:Ue.optional()}),Zs=t({width:a().optional(),height:a().optional(),codec:S(["h264","h265"]).optional(),framerate:a().optional(),bitrate:a().optional(),bitrateMode:S(["vbr","cbr"]).optional(),encoderProfile:S(["high","main","baseline"]).optional(),gop:a().optional(),audio:h().optional()}),In={name:"stream-params",scope:"device",mode:"singleton",deviceTypes:[C.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"stream-params",tab:"streaming"}},methods:{getOptions:c(t({deviceId:a()}),js),setProfile:c(t({deviceId:a(),profile:Vs,patch:Zs}),g(),{kind:"mutation",auth:"admin"}),getConfigSchema:c(t({deviceId:a()}),f().nullable())},status:{schema:ya,kind:"poll"},runtimeState:ya},Sa=t({on:h(),lastChangedAt:a()}),kn={name:"switch",scope:"device",mode:"singleton",deviceTypes:[C.Switch,C.Siren,C.Light],methods:{setState:c(t({deviceId:a(),on:h()}),g(),{kind:"mutation",auth:"admin"})},events:{onStateChanged:{data:t({deviceId:a(),on:h(),lastChangedAt:a()})}},status:{schema:Sa,kind:"command-driven"},runtimeState:Sa,settings:{bindings:[{kind:"scalar",statusPath:"on",method:"setState",valueArg:"on",field:{label:"On",kind:"boolean"}}]}},ht=t({totalObjects:a().int().nonnegative(),byClass:b(e(),a().int().nonnegative())}),Ys=ht.extend({zoneId:e(),zoneName:e(),trackIds:p(e()).readonly()}),fa=t({ts:a().int(),frameWidth:a().int().nonnegative(),frameHeight:a().int().nonnegative(),zones:p(Ys).readonly(),frame:ht,unzoned:ht}),Qs=S(["minute","5min","hour"]),He=t({from:a().int(),to:a().int(),resolution:Qs}),$e=t({ts:a().int(),count:a().int().nonnegative()}),wn={name:"zone-analytics",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{getCurrentSnapshot:c(t({deviceId:a()}),fa.nullable()),getZoneHistory:c(t({deviceId:a(),zoneId:e(),className:e().optional()}).extend(He.shape),p($e).readonly()),getCameraHistory:c(t({deviceId:a(),className:e().optional()}).extend(He.shape),p($e).readonly()),getUnzonedHistory:c(t({deviceId:a(),className:e().optional()}).extend(He.shape),p($e).readonly())},runtimeState:fa},Js=S(["include","exclude"]),de=t({id:e(),name:e().optional(),zoneIds:p(e()).min(1).readonly(),mode:Js,classFilter:p(e()).readonly().optional(),overlapThreshold:a().min(0).max(1).optional(),bboxInclusionPct:a().min(0).max(100).optional(),preferMask:h().optional(),enabled:h().default(!0)}),im=p(de).readonly(),ba=S(["motion","detection"]),An={name:"zone-rules",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{listRules:c(t({deviceId:a(),stage:ba}),p(de).readonly()),setRules:c(t({deviceId:a(),stage:ba,rules:p(de).readonly()}),g(),{kind:"mutation",auth:"admin"})},runtimeState:t({motion:p(de).readonly(),detection:p(de).readonly()})},Xs=t({connected:h(),deviceCount:a(),error:e().optional()}),cm=t({externalId:e(),name:e(),type:e(),metadata:b(e(),f()).optional()}),Ee=t({stableId:e(),type:S(C),suggestedName:e(),prefilledConfig:b(e(),f())}),xe=t({id:a(),stableId:e(),addonId:e(),type:e(),name:e(),parentDeviceId:a().nullable(),online:h(),features:p(e()),config:b(e(),f())}),vt=t({status:S(["ok","error"]),labels:p(e()).optional(),error:e().optional()}),ei=f(),Cn={name:"device-provider",scope:"system",mode:"collection",methods:{start:c(g(),g(),{kind:"mutation"}),stop:c(g(),g(),{kind:"mutation"}),getStatus:c(g(),Xs),getDevices:c(g(),p(t({id:e(),name:e(),type:e()}))),supportsDiscovery:c(t({}),h()),discoverDevices:c(t({}),p(Ee),{kind:"mutation",auth:"admin"}),adoptDiscoveredDevice:c(t({candidate:Ee}),xe,{kind:"mutation",auth:"admin"}),supportsManualCreation:c(t({}),h()),getChildCreationSchema:c(t({type:S(C)}),ei),createDevice:c(t({type:S(C),config:b(e(),f())}),xe,{kind:"mutation",auth:"admin"}),testCreationField:c(t({type:S(C),key:e(),value:f(),formValues:b(e(),f()).optional()}),vt,{kind:"mutation",auth:"admin"})}},ti=t({id:e(),label:e(),icon:e(),order:a().optional()}),ai=t({id:e(),title:e(),description:e().optional(),style:S(["card","accordion"]).optional(),defaultCollapsed:h().optional(),columns:E([I(1),I(2),I(3),I(4)]).optional(),tab:e().optional(),location:S(["settings","top-tab"]).optional(),order:a().optional(),fields:p(an())}),Q=t({tabs:p(ti).optional(),sections:p(ai)}),Ia=b(e(),f()),ka=t({success:I(!0)}),ni={name:"addon-settings",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{getGlobalSettings:c(t({addonId:e(),nodeId:e().optional(),overlay:b(e(),f()).optional()}),Q.nullable()),updateGlobalSettings:c(t({addonId:e(),nodeId:e().optional(),patch:Ia}),ka,{kind:"mutation",auth:"admin"}),getDeviceSettings:c(t({addonId:e(),deviceId:a(),nodeId:e().optional()}),Q.nullable()),updateDeviceSettings:c(t({addonId:e(),deviceId:a(),nodeId:e().optional(),patch:Ia}),ka,{kind:"mutation",auth:"admin"})}},oi=S(["info","success","warning","error"]),si=S(["active","in-progress","completed","failed","dismissed"]),ii=t({type:e(),id:e()}),We=t({id:e(),category:e(),severity:oi,title:e(),message:e(),status:si,progress:a().optional(),read:h(),createdAt:a(),updatedAt:a(),source:ii.optional(),metadata:b(e(),f()).optional()}),ci={name:"alerts",scope:"system",mode:"singleton",methods:{emit:c(We,g(),{kind:"mutation"}),update:c(t({alertId:e(),patch:We.partial()}),g(),{kind:"mutation"}),list:c(t({unreadOnly:h().optional(),limit:a().optional()}).optional(),p(We).readonly()),getUnreadCount:c(g(),a()),markRead:c(t({alertId:e()}),g(),{kind:"mutation"}),markAllRead:c(g(),g(),{kind:"mutation"}),dismiss:c(t({alertId:e()}),g(),{kind:"mutation"})}},ri={name:"storage",scope:"system",mode:"singleton",methods:{resolve:c(t({location:_,relativePath:e()}),e()),write:c(t({location:_,relativePath:e(),data:P(Uint8Array)}),g(),{kind:"mutation"}),read:c(t({location:_,relativePath:e()}),P(Uint8Array)),exists:c(t({location:_,relativePath:e()}),h()),list:c(t({location:_,prefix:e().optional()}),p(e()).readonly()),delete:c(t({location:_,relativePath:e()}),g(),{kind:"mutation"}),getAvailableSpace:c(t({location:_}),a().nullable()),beginUpload:c(t({location:_,relativePath:e(),sizeBytes:a().optional()}),t({uploadId:e()}),{kind:"mutation"}),writeChunk:c(t({uploadId:e(),offset:a(),data:P(Uint8Array)}),g(),{kind:"mutation"}),finalizeUpload:c(t({uploadId:e()}),g(),{kind:"mutation"}),abortUpload:c(t({uploadId:e()}),g(),{kind:"mutation"}),beginDownload:c(t({location:_,relativePath:e()}),t({downloadId:e(),sizeBytes:a()}),{kind:"mutation"}),readChunk:c(t({downloadId:e(),offset:a(),length:a()}),P(Uint8Array)),endDownload:c(t({downloadId:e()}),g(),{kind:"mutation"}),listLocations:c(t({type:X.optional()}),p(T).readonly()),getDefaultLocation:c(t({type:X}),T.nullable()),upsertLocation:c(T.omit({createdAt:!0,updatedAt:!0}),T,{kind:"mutation",auth:"admin"}),deleteLocation:c(t({id:e()}),g(),{kind:"mutation",auth:"admin"}),testLocation:c(t({id:e()}),t({ok:h(),error:e().optional()}),{auth:"admin"}),listProviders:c(g(),p(t({providerId:e(),displayName:e(),supportedLocationTypes:p(X).readonly(),configSchema:f()})).readonly()),testConfig:c(t({providerId:e(),config:b(e(),f())}),t({ok:h(),error:e().optional()}),{auth:"admin"})}},di=t({providerId:e().min(1),displayName:e().min(1),supportedLocationTypes:p(X).readonly(),configSchema:f()}),li=t({ok:h(),error:e().optional()}),pi=t({location:T,relativePath:e(),sizeBytes:a().optional()}),mi=t({uploadId:e()}),ui=t({uploadId:e(),offset:a(),data:P(Uint8Array)}),gi=t({uploadId:e()}),hi=t({uploadId:e()}),vi=t({location:T,relativePath:e()}),yi=t({downloadId:e(),sizeBytes:a()}),Si=t({downloadId:e(),offset:a(),length:a()}),fi=t({downloadId:e()}),bi={name:"storage-provider",scope:"system",mode:"collection",internal:!0,methods:{getProviderInfo:c(g(),di),testLocation:c(t({config:b(e(),f())}),li,{auth:"admin"}),resolve:c(t({location:T,relativePath:e()}),e()),write:c(t({location:T,relativePath:e(),data:P(Uint8Array)}),g(),{kind:"mutation"}),read:c(t({location:T,relativePath:e()}),P(Uint8Array)),exists:c(t({location:T,relativePath:e()}),h()),list:c(t({location:T,prefix:e().optional()}),p(e()).readonly()),delete:c(t({location:T,relativePath:e()}),g(),{kind:"mutation"}),getAvailableSpace:c(t({location:T}),a().nullable()),beginUpload:c(pi,mi,{kind:"mutation"}),writeChunk:c(ui,g(),{kind:"mutation"}),finalizeUpload:c(gi,g(),{kind:"mutation"}),abortUpload:c(hi,g(),{kind:"mutation"}),beginDownload:c(vi,yi,{kind:"mutation"}),readChunk:c(Si,P(Uint8Array)),endDownload:c(fi,g(),{kind:"mutation"})}},Ii=t({subId:e(),displayName:e(),description:e().optional(),kind:e(),triggerSupported:h(),restoreSupported:h()}),ki=Ii.extend({id:e(),addonId:e(),enabled:h(),retentionCount:a(),label:e().optional(),lastSuccessAt:a().optional(),lastSuccessSizeBytes:a().optional(),cron:e().optional(),nextRunAt:a().optional(),lastRunAt:a().optional()}),wi=t({id:e(),filename:e(),createdAt:a(),sizeBytes:a(),label:e().optional(),locations:p(e()).readonly()}),wa=t({id:e(),destinationId:e().optional(),label:e().optional(),createdAt:a(),sizeBytes:a(),locations:p(e()).optional()}),Ai=t({path:e(),kind:S(["file","dir","symlink"]),sizeBytes:a(),mtime:a()}),Ci=t({archiveVersion:I(1),createdAt:a(),dataDir:e(),locations:p(e()),entries:p(Ai),totalBytes:a(),totalFiles:a()}),Ni=t({name:e(),sizeBytes:a(),fileCount:a(),present:h()}),Pi={name:"backup",scope:"system",mode:"singleton",methods:{listDestinations:c(g(),p(ki).readonly(),{auth:"admin"}),trigger:c(t({destinations:p(e()).optional(),locations:p(e()).optional(),label:e().optional()}).optional(),p(wa).readonly(),{kind:"mutation",auth:"admin"}),list:c(g(),p(wa).readonly(),{auth:"admin"}),listLocations:c(g(),p(Ni).readonly(),{auth:"admin"}),getEntries:c(t({destinationId:e(),backupId:e()}),Ci.nullable(),{auth:"admin"}),restore:c(t({destinationId:e(),backupId:e(),locations:p(e()).optional()}),g(),{kind:"mutation",auth:"admin"}),delete:c(t({destinationId:e(),backupId:e()}),g(),{kind:"mutation",auth:"admin"}),listArchives:c(t({destinationId:e()}),p(wi).readonly(),{auth:"admin"}),upsertDestinationPolicy:c(t({locationId:e(),enabled:h(),retentionCount:a().int().min(1).max(1e3),label:e().optional(),cron:e().optional()}),g(),{kind:"mutation",auth:"admin"}),previewSchedule:c(t({cron:e(),count:a().int().min(1).max(20).optional()}),t({ok:h(),error:e().optional(),nextRuns:p(a()).readonly()}))}},Aa=t({where:b(e(),f()).optional(),whereIn:b(e(),p(f())).optional(),whereBetween:b(e(),Dt([f(),f()])).optional(),orderBy:t({field:e(),direction:S(["asc","desc"])}).optional(),limit:a().optional(),offset:a().optional()}),Ca=t({id:e(),data:b(e(),f())}),Di=t({name:e(),type:S(["TEXT","INTEGER","REAL","JSON","BOOLEAN"]),primaryKey:h().optional(),notNull:h().optional(),unique:h().optional()}),Mi=t({name:e(),columns:p(e()).readonly(),unique:h().optional()}),Ei={name:"settings-store",scope:"system",mode:"singleton",methods:{get:c(t({namespace:e().optional(),collection:e(),key:e()}),f()),set:c(t({namespace:e().optional(),collection:e(),key:e(),value:f()}),g(),{kind:"mutation"}),query:c(t({namespace:e().optional(),collection:e(),filter:Aa.optional()}),p(Ca).readonly()),insert:c(t({namespace:e().optional(),collection:e(),record:Ca}),g(),{kind:"mutation"}),update:c(t({namespace:e().optional(),collection:e(),id:e(),data:b(e(),f())}),g(),{kind:"mutation"}),delete:c(t({namespace:e().optional(),collection:e(),key:e()}),g(),{kind:"mutation"}),count:c(t({namespace:e().optional(),collection:e(),filter:Aa.optional()}),a()),isEmpty:c(t({namespace:e().optional(),collection:e()}),h()),declareCollection:c(t({namespace:e().optional(),collection:e(),columns:p(Di).readonly(),indexes:p(Mi).readonly().optional()}),g(),{kind:"mutation"})}},Nn=S(["debug","info","warn","error"]),Na=t({timestamp:ot(),level:Nn,scope:p(e()),message:e(),meta:b(e(),f()).optional(),tags:b(e(),e()).optional()}),xi={name:"log-destination",scope:"system",mode:"collection",internal:!0,methods:{write:c(Na,g(),{kind:"mutation"}),query:c(t({scope:p(e()).optional(),level:Nn.optional(),since:ot().optional(),until:ot().optional(),limit:a().optional(),tags:b(e(),e()).optional()}),p(Na).readonly())}},Ti=t({staticDir:e()}),Ri=t({version:e()}),Bi={name:"admin-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:c(g(),Ti),getVersion:c(g(),Ri)}},Se=S(["view","create","delete"]),Pn=E([I("*"),p(e())]),Dn=b(e(),E([I("*"),p(e())])),qi=S(["device","system"]),R=Mt("type",[t({type:I("category"),target:qi,access:p(Se).min(1)}),t({type:I("capability"),target:e(),access:p(Se).min(1)}),t({type:I("addon"),target:e(),access:p(Se).min(1)}),t({type:I("device"),targets:p(e()).min(1),access:p(Se).min(1)})]),rm=t({id:e(),username:e(),passwordHash:e(),isAdmin:h().default(!1),allowedProviders:Pn,allowedDevices:Dn,scopes:p(R).default([]),createdAt:a(),updatedAt:a()}),dm=t({id:e(),label:e(),isAdmin:h().default(!1),allowedProviders:Pn,allowedDevices:Dn,tokenHash:e(),tokenPrefix:e(),createdAt:a(),lastUsedAt:a().optional()}),lm=t({id:e(),userId:e(),name:e(),tokenHash:e(),tokenPrefix:e(),scopes:p(R),expiresAt:a().nullish(),lastUsedAt:a().nullish(),createdAt:a()}),Pa=t({userId:e(),username:e(),isAdmin:h(),provider:e(),email:e().optional(),displayName:e().optional(),hubUrl:e().optional(),scopes:p(R).optional(),redirectUri:e().optional(),integrationId:e().optional(),jti:e().optional(),sessionId:e().optional()}),Oi={name:"sso-bridge",scope:"system",mode:"singleton",internal:!0,methods:{signBridgeToken:c(t({claims:Pa,ttlSec:a().int().positive().optional()}),t({token:e()})),verifyBridgeToken:c(t({token:e()}),Pa.nullable())}},zi=t({integrationId:e(),displayName:e(),requestedScopes:p(R),allowedRedirectPrefixes:p(e()).min(1)}),Li={name:"oauth-integration",scope:"system",mode:"collection",internal:!0,methods:{getDescriptor:c(g(),zi)}},_i=t({credentialId:e(),label:e(),createdAt:a(),lastUsedAt:a().nullable(),transports:p(e()).default([])}),Fi={name:"user-passkeys",scope:"system",mode:"collection",internal:!0,methods:{beginRegistration:c(t({userId:e(),username:e()}),t({optionsJSON:b(e(),f())}),{kind:"mutation",auth:"admin",access:"create"}),finishRegistration:c(t({userId:e(),response:b(e(),f()),label:e()}),t({success:I(!0),credentialId:e()}),{kind:"mutation",auth:"admin",access:"create"}),beginAuthentication:c(t({userId:e().optional()}),t({optionsJSON:b(e(),f())}),{kind:"mutation",access:"view"}),finishAuthentication:c(t({userId:e(),response:b(e(),f())}),t({verified:h()}),{kind:"mutation",access:"view"}),listPasskeys:c(t({userId:e()}),p(_i),{auth:"admin"}),removePasskey:c(t({userId:e(),credentialId:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"delete"})}},J=oo(),Ui=t({to:E([J,p(J).min(1)]),cc:p(J).optional(),bcc:p(J).optional(),from:e().optional(),replyTo:e().optional(),subject:e(),text:e(),html:e().optional()}),Hi=t({messageId:e(),accepted:p(J).default([]),rejected:p(J).default([])}),Da=t({ready:h(),host:e(),error:e().optional(),lastVerifiedAt:a().optional()}),$i={name:"smtp-provider",scope:"system",mode:"collection",internal:!0,providerKind:"email",methods:{sendEmail:c(Ui,Hi,{kind:"mutation",auth:"admin",access:"create"}),verify:c(g(),Da,{kind:"mutation",auth:"admin",access:"view"}),getStatus:c(g(),Da,{auth:"admin"})}},Wi=S(["external","embedded"]),Ki=S(["connected","disconnected","auth-failed","unreachable","tls-error"]),Gi=t({id:e(),name:e(),url:e(),kind:Wi,status:Ki,latencyMs:a().nullable(),error:e().optional(),connectedClients:a().int().nonnegative().optional(),lastCheckedAt:a().optional()}),Vi=t({url:e(),username:e().optional(),password:e().optional(),clientIdPrefix:e().optional()}),ji=t({name:e().min(1),url:e().regex(/^(mqtt|mqtts|ws|wss):\/\//,"URL must start with mqtt(s):// or ws(s)://"),username:e().optional(),password:e().optional(),clientIdPrefix:e().optional()}),Zi=t({id:e()}),fe=t({id:e()}),Yi=Mt("ok",[t({ok:I(!0),latencyMs:a()}),t({ok:I(!1),error:e()})]),Qi=t({port:a().int().min(1).max(65535).default(1883),allowAnonymous:h().default(!1),username:e().optional(),password:e().optional()}),Ji=t({id:e(),url:e()}),Ma=t({brokerCount:a(),embeddedRunning:h()}),Xi={name:"mqtt-broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:Ma,kind:"poll"},methods:{listBrokers:c(g(),p(Gi)),getBrokerConfig:c(fe,Vi),addBroker:c(ji,Zi,{kind:"mutation"}),removeBroker:c(fe,g(),{kind:"mutation"}),testConnection:c(fe,Yi,{kind:"mutation"}),startEmbeddedBroker:c(Qi,Ji,{kind:"mutation"}),stopEmbeddedBroker:c(fe,g(),{kind:"mutation"}),getStatus:c(g(),Ma)}},ec=S(["unlinked","linked","error"]),tc=t({label:e(),value:e(),secret:h().optional()}),ac=t({qr:e().optional(),fields:p(tc).readonly().optional(),note:e().optional()}),Ea=t({linkState:ec,exposedDeviceCount:a(),error:e().optional(),setup:ac.optional()}),nc=e(),oc=t({deviceId:e(),exposedAs:e().optional(),capabilities:p(e()).optional()}),sc=t({deviceId:e(),capabilities:p(e()).optional()}),ic=t({deviceId:e()}),cc={name:"device-export",scope:"system",mode:"collection",providerKind:"device-export",status:{schema:Ea,kind:"poll"},exposesDeviceSettings:!0,methods:{getStatus:c(g(),Ea),listSupportedDeviceKinds:c(g(),p(nc)),listExposedDevices:c(g(),p(oc)),exposeDevice:c(sc,g(),{kind:"mutation"}),unexposeDevice:c(ic,g(),{kind:"mutation"})}},rc=t({id:e(),label:e(),icon:e(),path:e(),remoteName:e(),bundle:e()}),dc=t({addonId:e(),page:rc,bundleUrl:e()}),lc={name:"addon-pages",scope:"system",mode:"singleton",methods:{listPages:c(g(),p(dc).readonly())}},pc=t({id:e(),label:e(),icon:e(),path:e(),remoteName:e(),bundle:e()}),mc={name:"addon-pages-source",scope:"system",mode:"collection",internal:!0,methods:{listPages:c(g(),p(pc).readonly())}},uc=S(["device-tab","dashboard","integration-detail"]),xa=S(["xs","sm","md","lg","xl"]),gc=t({remoteName:e(),exposedModule:e(),componentKey:e().optional()}),Mn=t({tab:e(),subTab:e().optional(),label:e(),order:a().optional(),kind:I("remote"),remote:gc,stableId:e(),description:e().optional(),icon:e().optional(),bundle:e(),hosts:p(uc).readonly(),requires:t({deviceContext:h().default(!1),integrationContext:h().default(!1)}),defaultSize:xa.default("md"),allowedSizes:p(xa).readonly().default(["sm","md","lg"]),defaultColumns:a().int().min(1).max(12).default(6),defaultRows:a().int().min(1).max(12).default(1)}),hc={name:"addon-widgets-source",scope:"system",mode:"collection",internal:!0,methods:{listWidgets:c(g(),p(Mn).readonly())}},vc=Mn.extend({addonId:e(),bundleUrl:e()}),yc={name:"addon-widgets",scope:"system",mode:"singleton",methods:{listWidgets:c(g(),p(vc).readonly())}},Sc=t({method:S(["GET","POST","PUT","DELETE","PATCH"]),path:e(),access:S(["public","authenticated","admin"]).optional(),description:e().optional()}),fc=t({method:e(),path:e(),params:b(e(),e()),query:b(e(),e()),body:f(),headers:b(e(),e()),user:t({id:e(),username:e(),isAdmin:h()}).optional(),scopedToken:f().optional()}),bc=t({status:a().int(),headers:b(e(),e()),redirectUrl:e().nullable(),body:f().optional(),contentType:e().optional()}),Ic={name:"addon-routes",scope:"system",mode:"collection",internal:!0,methods:{getRoutes:c(g(),p(Sc)),invoke:c(fc,bc,{kind:"mutation"})}},pm=[{value:"auto",label:"Auto (defer to probed best)"},{value:"none",label:"Off (software)"},{value:"videotoolbox",label:"VideoToolbox (macOS)"},{value:"cuda",label:"CUDA (NVIDIA)"},{value:"nvdec",label:"NVDEC (NVIDIA legacy)"},{value:"vaapi",label:"VAAPI (Linux Intel/AMD)"},{value:"qsv",label:"QuickSync (Intel)"},{value:"d3d11va",label:"D3D11VA (Windows)"},{value:"dxva2",label:"DXVA2 (Windows legacy)"},{value:"amf",label:"AMF (AMD)"},{value:"vdpau",label:"VDPAU (Linux NVIDIA legacy)"},{value:"drm",label:"DRM (Linux generic)"}],mm={hwaccel:"auto",probedBestHwaccel:""},kc=t({sessionId:e(),slotCount:a().int(),slotByteLength:a().int(),segmentBytes:a().int(),budgetMb:a().int(),framesWritten:a().int(),getFrameHits:a().int(),getFrameMisses:a().int()}),wc={name:"decoder",scope:"system",mode:"singleton",methods:{supportsCodec:c(t({codec:e()}),h()),getInfo:c(g(),t({id:e(),name:e(),isPullMode:h().optional(),priority:a().optional()})),createSession:c(ia,t({sessionId:e(),nodeId:e()})),destroySession:c(t({sessionId:e()}),g()),pushPacket:c(t({sessionId:e(),packet:zo}),g()),openStream:c(t({sessionId:e(),url:e()}),g()),pullFrames:c(t({sessionId:e(),maxCount:a().default(1)}),p(la)),pullHandles:c(t({sessionId:e(),maxCount:a().default(1)}),p(rt)),getFrame:c(t({handle:rt}),la.nullable()),getShmStats:c(t({sessionId:e()}),kc.nullable()),updateConfig:c(t({sessionId:e(),config:ia.partial()}),g()),getStats:c(t({sessionId:e()}),fo),listActiveSessions:c(g(),p(t({sessionId:e(),codec:e(),outputFormat:e(),createdAtMs:a()})).readonly()),reprobeHwaccel:c(g(),t({backend:e()}),{kind:"mutation",auth:"admin"})}},Ac=t({streamId:e(),label:e().optional(),codec:e(),type:S(["video","audio"]),sourceUrl:e()}),Cc=t({streamId:e(),format:e(),value:e()}),Nc={name:"restreamer",scope:"system",mode:"collection",internal:!0,methods:{registerDevice:c(t({deviceId:a(),streams:p(Ac).readonly()}),g(),{kind:"mutation"}),unregisterDevice:c(t({deviceId:a()}),g(),{kind:"mutation"}),getExposedResources:c(t({deviceId:a()}),p(Cc).readonly())}},En=t({viewportWidth:a().int().positive().optional(),viewportHeight:a().int().positive().optional(),devicePixelRatio:a().positive().optional(),downlinkMbps:a().nonnegative().optional(),prefersTier:e().optional()}).partial(),Pc={name:"webrtc",scope:"system",mode:"collection",internal:!0,methods:{handleOffer:c(t({streamId:e(),sdpOffer:e()}),e(),{kind:"mutation"}),supportsStream:c(t({streamId:e()}),h()),registerStream:c(t({streamId:e(),codec:e()}),g(),{kind:"mutation"}),unregisterStream:c(t({streamId:e()}),g(),{kind:"mutation"}),createSession:c(t({streamId:e(),hints:En.optional()}),t({sessionId:e(),sdpOffer:e()}),{kind:"mutation"}),handleAnswer:c(t({sessionId:e(),sdpAnswer:e()}),g(),{kind:"mutation"}),closeSession:c(t({sessionId:e()}),g(),{kind:"mutation"}),hasAdaptiveBitrate:c(t({streamId:e()}),h())}},yt=Mt("kind",[t({kind:I("adaptive")}),t({kind:I("profile"),profile:W}),t({kind:I("cam-stream"),camStreamId:e().min(1)})]),Dc=t({id:e(),label:e(),target:yt,codec:e().nullable(),resolution:t({width:a(),height:a()}).nullable(),status:S(["idle","connecting","streaming","error","stopped"]).nullable(),inputFps:a().nullable(),decodeFps:a().nullable(),bitrateKbps:a().nullable()}),Mc={name:"webrtc-session",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[C.Camera],methods:{listStreams:c(t({deviceId:a().int().nonnegative()}),p(Dc)),createSession:c(t({deviceId:a().int().nonnegative(),target:yt,hints:En.optional()}),t({sessionId:e(),sdpOffer:e()}),{kind:"mutation"}),handleOffer:c(t({deviceId:a().int().nonnegative(),target:yt.optional(),sdpOffer:e(),sessionId:e().optional()}),t({sessionId:e(),sdpAnswer:e()}),{kind:"mutation"}),handleAnswer:c(t({deviceId:a().int().nonnegative(),sessionId:e(),sdpAnswer:e()}),g(),{kind:"mutation"}),closeSession:c(t({deviceId:a().int().nonnegative(),sessionId:e()}),g(),{kind:"mutation"}),hasAdaptiveBitrate:c(t({deviceId:a().int().nonnegative(),profile:W}),h())}},Ce=t({engine:D,steps:p(ee).readonly(),audio:t({engine:D,modelId:e(),enabled:h(),settings:b(e(),f()).readonly().optional()}).nullable().optional()}),Ke=t({id:e(),name:e(),description:e().optional(),config:Ce,createdAt:e(),updatedAt:e()}),xn=t({enabled:h(),modelId:e(),settings:b(e(),f()).readonly()}),Ta=t({addonDefaults:b(e(),xn).readonly()}),Tn=t({steps:p(ee).readonly(),audio:t({modelId:e(),enabled:h()}).nullable()}),St=t({enabled:h().optional(),modelId:e().optional(),settings:b(e(),f()).readonly().optional()}),Ec=t({pinnedAgentNodeId:e().optional(),stepToggles:b(e(),h()).optional(),stepOverridesByAgent:b(e(),b(e(),St)).optional(),pipelineByAgent:b(e(),Tn).optional()}),Ra=t({deviceId:a(),agentNodeId:e(),pinned:h(),reason:S(["manual","capacity","hardware-affinity","failover","rebalance"]),assignedAt:a()}),Ba=t({deviceId:a(),decoderNodeId:e(),pinned:h(),reason:S(["manual","co-located","capacity","hardware-affinity"])}),xc=t({nodeId:e(),online:h(),load:hn,score:a()}),Tc=t({totalAgents:a(),onlineAgents:a(),totalCameras:a(),attachedCameras:a(),activeCameras:a(),avgInferenceTimeMs:a(),queueDepth:a()}),Rc=b(e(),e()),Bc={name:"pipeline-orchestrator",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{assignPipeline:c(t({deviceId:a(),agentNodeId:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),unassignPipeline:c(t({deviceId:a()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),rebalance:c(g(),t({migrated:a()}),{kind:"mutation",auth:"admin"}),getPipelineAssignments:c(g(),p(Ra).readonly()),getPipelineAssignment:c(t({deviceId:a()}),Ra.nullable()),getAgentLoad:c(g(),p(xc).readonly()),getGlobalMetrics:c(g(),Tc),getCameraMetrics:c(t({deviceId:a()}),qt.nullable()),getCapabilityBindings:c(t({nodeId:e()}),Rc),setCapabilityBinding:c(t({nodeId:e(),capName:e(),addonId:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),assignDecoder:c(t({deviceId:a(),nodeId:e()}),g(),{kind:"mutation",auth:"admin"}),unassignDecoder:c(t({deviceId:a()}),g(),{kind:"mutation",auth:"admin"}),getDecoderAssignments:c(g(),p(Ba).readonly()),assignAudio:c(t({deviceId:a(),nodeId:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),unassignAudio:c(t({deviceId:a()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),getAudioAssignment:c(t({deviceId:a()}),t({nodeId:e(),pinned:h(),assignedAt:a()}).nullable()),getAudioNodeLoad:c(g(),p(t({nodeId:e(),deviceCount:a()}))),getAudioAssignments:c(g(),p(t({deviceId:a(),nodeId:e(),pinned:h(),assignedAt:a()}))),getDecoderAssignment:c(t({deviceId:a(),pipelineNodeId:e().optional()}),Ba),getAgentSettings:c(t({agentNodeId:e()}),Ta.nullable()),listAgentSettings:c(g(),p(t({nodeId:e(),settings:Ta})).readonly()),setAgentAddonDefaults:c(t({agentNodeId:e(),defaults:b(e(),xn)}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),removeAgentSettings:c(t({agentNodeId:e()}),t({success:h(),removed:h()}),{kind:"mutation",auth:"admin"}),getCameraSettings:c(t({deviceId:a()}),Ec.nullable()),setCameraStepToggle:c(t({deviceId:a(),addonId:e(),enabled:h().nullable()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),getCameraStepOverrides:c(t({deviceId:a()}),b(e(),b(e(),St)).nullable()),setCameraStepOverride:c(t({deviceId:a(),agentNodeId:e(),addonId:e(),patch:St.nullable()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),setCameraPipelineForAgent:c(t({deviceId:a(),agentNodeId:e(),pipeline:Tn.nullable()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),resolvePipeline:c(t({deviceId:a(),agentNodeId:e().optional()}),Ce),listTemplates:c(g(),p(Ke).readonly()),saveTemplate:c(t({name:e(),description:e().optional(),config:Ce}),Ke,{kind:"mutation",auth:"admin"}),updateTemplate:c(t({id:e(),name:e().optional(),description:e().optional(),config:Ce.optional()}),Ke,{kind:"mutation",auth:"admin"}),deleteTemplate:c(t({id:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"})}},qc=t({level:cs,classification:t({labels:p(pt).readonly(),inferenceMs:a()}).optional(),timestamp:a()}),Oc=t({minConfidence:a().min(0).max(1).default(.3),allowedClasses:p(e()).default([])}),zc=t({labels:p(pt).readonly(),rawLabels:p(pt).readonly().optional(),inferenceMs:a()}),um=[{value:"auto",label:"Auto (platform default)"},{value:"apple-soundanalysis",label:"Apple SoundAnalysis (macOS 12+)"},{value:"yamnet-onnx",label:"YAMNet ONNX (cross-platform)"}],gm={audioBackend:"auto",probedBestAudioBackend:"",selectedAudioModel:""},Lc={name:"audio-analyzer",scope:"system",mode:"singleton",methods:{analyseChunk:c(t({chunk:ua,settings:Oc}),qc.nullable(),{kind:"mutation"}),classify:c(ua,zc,{timeoutMs:3e4}),isReady:c(g(),h()),dispose:c(g(),g(),{kind:"mutation"}),reprobeAudioEngine:c(g(),t({backend:e()}),{kind:"mutation",auth:"admin"})}},_c={name:"audio-analysis",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[C.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:c(t({deviceId:a()}),q())},events:{onAudioLevel:V(t({deviceId:a(),rms:a(),dbfs:a()}))}},Re=S(["f32le","s16le"]),Fc=t({codec:e(),canDecode:h(),canEncode:h(),label:e().optional()}),Uc=t({codec:e(),sourceSampleRate:a().int().positive(),sourceChannels:a().int().positive(),extraData:P(Uint8Array).optional(),targetSampleRate:a().int().positive(),targetChannels:a().int().positive(),targetFormat:Re.optional(),idleMs:a().int().positive().optional(),tag:e().optional()}),Hc=t({codec:e(),sourceSampleRate:a().int().positive(),sourceChannels:a().int().positive(),sourceFormat:Re.optional(),targetSampleRate:a().int().positive(),targetChannels:a().int().positive(),bitrateKbps:a().int().positive().optional(),idleMs:a().int().positive().optional(),tag:e().optional()}),$c=t({data:P(Uint8Array),sampleRate:a().int().positive(),channels:a().int().positive(),format:Re,pts:a()}),qa=t({data:P(Uint8Array),codec:e(),pts:a(),frameComplete:h()}),Wc=t({sessionId:e(),kind:S(["decode","encode"]),codec:e(),sourceSampleRate:a(),sourceChannels:a(),targetSampleRate:a(),targetChannels:a(),format:Re,tag:e().optional(),createdAtMs:a(),lastActivityMs:a(),framesIn:a(),framesOut:a()}),Kc={name:"audio-codec",scope:"system",mode:"singleton",methods:{listSupportedCodecs:c(g(),p(Fc).readonly()),canHandle:c(t({codec:e(),kind:S(["decode","encode"])}),h()),createDecodeSession:c(Uc,t({sessionId:e(),nodeId:e()}),{kind:"mutation"}),createEncodeSession:c(Hc,t({sessionId:e(),nodeId:e()}),{kind:"mutation"}),closeSession:c(t({sessionId:e(),nodeId:e().optional()}),g(),{kind:"mutation"}),pushEncodedFrame:c(t({sessionId:e(),nodeId:e().optional(),data:P(Uint8Array),pts:a().optional()}),g(),{kind:"mutation"}),pullPcm:c(t({sessionId:e(),nodeId:e().optional(),maxCount:a().int().positive().default(8)}),p($c)),pushPcm:c(t({sessionId:e(),nodeId:e().optional(),data:P(Uint8Array),pts:a().optional()}),g(),{kind:"mutation"}),pullEncoded:c(t({sessionId:e(),nodeId:e().optional(),maxCount:a().int().positive().default(8)}),p(qa)),flushEncode:c(t({sessionId:e(),nodeId:e().optional()}),p(qa),{kind:"mutation"}),listActiveSessions:c(g(),p(Wc).readonly())}},Oa=t({embedding:p(a()),inferenceMs:a()}),Gc=t({modelId:e(),embeddingDim:a(),ready:h()}),Vc={name:"embedding-encoder",scope:"system",mode:"collection",internal:!0,methods:{encode:c(t({crop:P(Uint8Array),width:a(),height:a()}),Oa),encodeText:c(t({text:e()}),Oa),getInfo:c(g(),Gc)}},Ge=t({id:a(),stableId:e(),addonId:e(),type:S(C),name:e(),location:e().nullable(),disabled:h(),parentDeviceId:a().nullable(),role:e().nullable().optional(),online:h(),features:p(e()),isCamera:h(),config:b(e(),f()),metadata:b(e(),f()).nullable().optional()}),jc=t({key:e(),value:f(),description:e().optional()}),Zc=t({id:a(),stableId:e(),type:e(),name:e(),location:e().nullable(),disabled:h(),parentDeviceId:a().nullable(),role:e().nullable().optional()}),Yc=t({id:a(),stableId:e(),addonId:e(),type:e(),name:e(),location:e().nullable(),disabled:h(),parentDeviceId:a().nullable(),metadata:b(e(),f()).nullable().optional()}),Qc=f().nullable(),Jc=t({streamId:e(),width:a().optional(),height:a().optional(),codec:e().optional(),fps:a().optional(),bitrateKbps:a().optional()}),Xc=t({addonId:e(),stableId:e(),id:a(),type:e(),name:e(),location:e().nullable().optional(),disabled:h().optional(),parentDeviceId:a().nullable(),role:e().nullable().optional(),features:p(e()).optional(),config:b(e(),f())}),er=t({deviceId:a()}),tr=t({deviceId:a(),data:b(e(),f())}),ar={name:"device-manager",scope:"system",mode:"singleton",methods:{allocateDeviceId:c(t({addonId:e(),stableId:e()}),t({id:a()}),{kind:"mutation"}),registerDevice:c(Xc,g(),{kind:"mutation"}),removeDevice:c(er,g(),{kind:"mutation"}),persistConfig:c(tr,g(),{kind:"mutation"}),loadConfig:c(t({deviceId:a()}),b(e(),f())),loadRuntimeState:c(t({deviceId:a()}),b(e(),f())),loadMeta:c(t({deviceId:a()}),Yc.nullable()),setName:c(t({deviceId:a(),name:e()}),g(),{kind:"mutation",auth:"admin"}),setLocation:c(t({deviceId:a(),location:e().nullable()}),g(),{kind:"mutation",auth:"admin"}),setMetadata:c(t({deviceId:a(),patch:b(e(),f())}),g(),{kind:"mutation",auth:"admin"}),listLocations:c(g(),p(e())),addLocation:c(t({name:e()}),g(),{kind:"mutation",auth:"admin"}),removeLocation:c(t({name:e(),cascade:h().optional()}),g(),{kind:"mutation",auth:"admin"}),setDisabled:c(t({deviceId:a(),disabled:h()}),g(),{kind:"mutation",auth:"admin"}),listPersistedByAddon:c(t({addonId:e()}),p(Zc)),listAll:c(t({addonId:e().optional()}),p(Ge)),getDevice:c(t({deviceId:a()}),Ge.nullable()),getChildren:c(t({parentDeviceId:a()}),p(Ge)),getStreamSources:c(t({deviceId:a()}),p(Oo)),getConfigSchema:c(t({deviceId:a()}),p(jc)),getSettingsSchema:c(t({deviceId:a()}),Qc),updateConfig:c(t({deviceId:a(),values:b(e(),f())}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),enable:c(t({deviceId:a()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),disable:c(t({deviceId:a()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),remove:c(t({deviceId:a()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),getStreamProfileMap:c(t({deviceId:a()}),b(e(),e().nullable())),setStreamProfileMap:c(t({deviceId:a(),profileMap:b(e(),e().nullable())}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),probeStreams:c(t({deviceId:a()}),p(Jc),{kind:"mutation",auth:"admin"}),getBindings:c(t({deviceId:a()}),t({deviceId:a(),entries:p(t({capName:e(),kind:S(["native","wrapped"]),providerAddonId:e(),providerNodeId:e(),nativeAddonId:e()}))})),getAllBindings:c(t({}),p(t({deviceId:a(),entries:p(t({capName:e(),kind:S(["native","wrapped"]),providerAddonId:e(),providerNodeId:e(),nativeAddonId:e()}))}))),setWrapperActive:c(t({deviceId:a(),capName:e(),wrapperAddonId:e(),active:h()}),g(),{kind:"mutation",auth:"admin"}),listWrappersForCap:c(t({capName:e()}),p(e())),listBindableCapsForDeviceType:c(t({deviceType:e()}),p(t({capName:e(),wrappers:p(e())}))),getDeviceSettingsAggregate:c(t({deviceId:a()}),Q.nullable()),getDeviceLiveInfoAggregate:c(t({deviceId:a()}),Q.nullable()),getDeviceAggregate:c(t({deviceId:a()}),t({settings:Q.nullable(),live:Q.nullable()})),updateDeviceField:c(t({deviceId:a(),writerCapName:e(),writerAddonId:e(),key:e(),value:f()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),updateDeviceFieldsBatch:c(t({deviceId:a(),changes:p(t({writerCapName:e(),writerAddonId:e(),key:e(),value:f()}))}),t({success:I(!0),failures:p(t({writerCapName:e(),writerAddonId:e(),error:e()}))}),{kind:"mutation",auth:"admin"}),discoverDevices:c(t({addonId:e()}),p(Ee),{kind:"mutation",auth:"admin"}),adoptDevice:c(t({addonId:e(),candidate:Ee}),xe,{kind:"mutation",auth:"admin"}),getCreationSchema:c(t({addonId:e(),type:S(C)}),f().nullable()),createDevice:c(t({addonId:e(),type:S(C),config:b(e(),f())}),xe,{kind:"mutation",auth:"admin"}),testCreationField:c(t({addonId:e(),type:S(C),key:e(),value:f(),formValues:b(e(),f()).optional()}),vt,{kind:"mutation",auth:"admin"}),testField:c(t({deviceId:a(),key:e(),value:f()}),vt,{kind:"mutation",auth:"admin"}),getDeviceStatusAggregate:c(t({deviceId:a(),caps:p(e()).readonly().optional()}),b(e(),f().nullable()))}},nr={name:"device-state",scope:"system",mode:"singleton",methods:{getSnapshot:c(t({deviceId:a()}),b(e(),b(e(),f()))),getCapSlice:c(t({deviceId:a(),capName:e()}),b(e(),f()).nullable()),getAllSnapshots:c(t({}),b(e(),b(e(),b(e(),f())))),setCapSlice:c(t({deviceId:a(),capName:e(),slice:b(e(),f())}),g(),{kind:"mutation"})},events:{onChanged:V(t({deviceId:a(),capName:e(),slice:b(e(),f())}))}},Ve=t({userId:e(),username:e(),email:e().optional(),displayName:e().optional(),isAdmin:h().default(!1)}),or={name:"auth-provider",scope:"system",mode:"collection",internal:!0,methods:{validateCredentials:c(t({username:e(),password:e()}),Ve.nullable(),{kind:"mutation"}),getLoginUrl:c(t({state:e()}),e()),handleCallback:c(b(e(),e()),Ve,{kind:"mutation"}),validateToken:c(t({token:e()}),Ve.nullable())}},Te=t({url:e(),hostname:e(),port:a(),protocol:S(["http","https"])}),sr=t({connected:h(),endpoint:Te.nullable(),error:e().optional()}),ir=Te.extend({id:e(),label:e(),mode:e().optional(),sourcePort:a().optional()}),cr={name:"network-access",scope:"system",mode:"collection",providerKind:"ingress",methods:{start:c(g(),Te,{kind:"mutation"}),stop:c(g(),g(),{kind:"mutation"}),getEndpoint:c(g(),Te.nullable()),getStatus:c(g(),sr),listEndpoints:c(g(),p(ir).readonly())}},rr=t({urls:E([e(),p(e())]),username:e().optional(),credential:e().optional()}),dr={name:"turn-provider",scope:"system",mode:"collection",methods:{getTurnServers:c(g(),p(rr).readonly())}},Rn=t({base64:e(),contentType:e()}),lr=t({lastCapturedAt:a().nullable(),cacheAgeMs:a().nullable(),lastBytes:a().nullable(),lastStreamId:e().nullable()}),pr={name:"snapshot",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[C.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:c(t({deviceId:a(),streamId:e().optional(),force:h().optional()}),Rn.nullable()),invalidateCache:c(t({deviceId:a()}),g(),{kind:"mutation",auth:"admin"})},status:{schema:lr,kind:"poll"}},mr={name:"snapshot-provider",scope:"system",mode:"collection",methods:{supportsDevice:c(t({deviceId:a()}),h()),getSnapshot:c(t({deviceId:a(),streamId:e().optional()}),Rn.nullable())}},ur=t({title:e(),body:e(),imageUrl:e().optional(),deviceId:a().optional(),eventId:e().optional(),priority:S(["low","normal","high","critical"]).default("normal"),metadata:b(e(),f()).optional()}),gr={name:"notification-output",scope:"system",mode:"collection",methods:{send:c(ur,g(),{kind:"mutation"}),sendTest:c(g(),t({success:h(),error:e().optional()}),{kind:"mutation"})}},hr=t({deviceIds:p(a()).readonly().optional(),classNames:p(e()).readonly().optional(),zoneIds:p(e()).readonly().optional(),minConfidence:a().optional(),source:S(["pipeline","onboard","any"]).optional(),schedule:t({days:p(a()).readonly(),startHour:a(),endHour:a()}).optional(),cooldownSeconds:a().optional(),minDwellSeconds:a().optional()}),vr=t({title:e(),body:e(),imageMode:S(["crop","annotated","full","none"])}),za=t({id:e(),name:e(),enabled:h(),eventTypes:p(e()).readonly(),conditions:hr,outputs:p(e()).readonly(),template:vr.optional(),priority:S(["low","normal","high","critical"])}),yr=t({ruleId:e(),eventId:e(),timestamp:a(),wouldFire:h(),reason:e().optional()}),Sr=t({id:e(),ruleId:e(),ruleName:e(),eventId:e(),timestamp:a(),outputs:p(e()).readonly(),success:h(),error:e().optional(),deviceId:a().optional()}),fr=t({ruleId:e().optional(),deviceId:a().optional(),from:a().optional(),to:a().optional(),limit:a().optional()}),br={name:"advanced-notifier",scope:"system",mode:"singleton",internal:!0,methods:{getRules:c(g(),t({rules:p(za).readonly()})),upsertRule:c(t({rule:za}),t({success:I(!0)}),{kind:"mutation"}),deleteRule:c(t({ruleId:e()}),t({success:I(!0)}),{kind:"mutation"}),testRule:c(t({ruleId:e(),lookbackMinutes:a()}),t({results:p(yr).readonly()}),{kind:"mutation"}),getHistory:c(t({filter:fr.optional()}),t({entries:p(Sr).readonly()}))}},Bn=S(["continuous","motion","scheduled","composite"]),Ir=t({streamId:e(),mode:S(["always","inherit"])}),kr=t({days:p(a()).readonly(),startTime:e(),endTime:e(),mode:S(["continuous","motion"])}),ge=t({deviceId:a(),mode:Bn,streams:p(Ir).readonly(),enabled:h(),preBufferSec:a(),postBufferSec:a(),scheduleRules:p(kr).readonly().optional()}),qn=S(["recording:main","recording:mid","recording:sub","thumbnail:scrub","thumbnail:event"]),ft=t({deviceId:a(),dataCategory:qn,storageName:e(),subDirectory:e(),retentionDays:a().nullable(),retentionGb:a().nullable()}),wr=t({id:e(),deviceId:a(),streamId:e(),startTime:a(),endTime:a(),duration:a(),path:e(),storageName:e(),subDirectory:e(),sizeBytes:a(),codec:S(["h264","h265"]),hasAudio:h()}),Ar=t({deviceId:a(),timestamp:a(),path:e(),storageName:e(),subDirectory:e(),sizeBytes:a(),category:S(["scrub","event"])}),Cr=t({startTime:a(),endTime:a(),streams:p(e()).readonly()}),Nr=t({totalBytes:a(),segmentCount:a()}),Pr=t({bitrateKbps:a(),retentionDays:a().nullable(),retentionGb:a().nullable(),estimatedGb:a(),estimatedDaysAtCapacity:a().nullable()}),La=t({perStream:b(e(),Pr),thumbnails:t({estimatedGb:a()}),totalEstimatedGb:a(),motionEstimate:t({avgEventsPerDay:a(),avgDurationSec:a(),dutyCyclePercent:a()}).optional()}),Dr=t({totalEvents:a(),avgDurationSec:a(),avgEventsPerDay:a(),dutyCyclePercent:a()}),be=t({deviceId:a()}),Mr=t({deviceId:a(),policy:ge.omit({deviceId:!0}),storageOverrides:p(ft.omit({deviceId:!0})).readonly().optional(),ffmpegOverrides:b(e(),f()).optional()}),_a=t({deviceId:a(),startTime:a(),endTime:a()}),Er=t({deviceId:a(),streamId:e(),startTime:a(),endTime:a()}),xr=t({deviceId:a(),streamId:e(),startTime:a(),endTime:a(),live:h().optional()}),Tr=t({deviceId:a(),timestamp:a(),category:e().optional()}),Rr=t({deviceId:a(),streamId:e()}),Br=t({deviceId:a(),motionInput:t({avgEventsPerDay:a(),avgDurationSec:a()}).optional()}),qr=t({deviceId:a(),dataCategory:qn}),Or=t({deviceId:a(),policy:ge.omit({deviceId:!0})}),zr=t({deviceId:a(),policy:ge.omit({deviceId:!0}),ffmpegOverrides:b(e(),f()).optional()}),Lr={name:"recording-engine",scope:"system",mode:"singleton",methods:{getStatus:c(g(),t({activeRecordings:a(),totalSegments:a(),totalSizeMB:a()})),enable:c(Mr,g(),{kind:"mutation",auth:"admin"}),disable:c(be,g(),{kind:"mutation",auth:"admin"}),getConfig:c(be,ge.nullable()),updateConfig:c(zr,g(),{kind:"mutation",auth:"admin"}),getPlaylist:c(xr,e()),getThumbnail:c(Tr,Ar.nullable()),getSegments:c(Er,p(wr).readonly()),getAvailability:c(_a,p(Cr).readonly()),estimateStorage:c(Br,La),estimateGlobalStorage:c(g(),La),getStorageUsage:c(Rr,Nr),setPolicy:c(Or,g(),{kind:"mutation",auth:"admin"}),getPolicy:c(be,ge.nullable()),getPolicyStatus:c(be,t({deviceId:a(),enabled:h(),mode:Bn,activeStreams:a()}).nullable()),getRetentionConfig:c(qr,ft.nullable()),updateRetentionConfig:c(ft,g(),{kind:"mutation",auth:"admin"}),getMotionStats:c(_a,Dr)}},_r={name:"detection-pipeline",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[C.Camera],exposesDeviceSettings:!0,methods:{}},zt=S(["new","entered","left","moving","idle"]),Fr=S(["motion","object","audio"]),On=t({x:a(),y:a(),timestamp:a(),bbox:te}),Ur=t({timestamp:a(),position:On,mediaKey:e()}),je=t({trackId:e(),deviceId:a(),className:e(),label:e().optional(),firstSeen:a(),lastSeen:a(),positions:p(On).readonly(),snapshots:p(Ur).readonly(),zonesVisited:p(e()).readonly(),totalDistance:a(),state:zt,active:h()}),Lt={id:e(),deviceId:a(),timestamp:a()},Hr=t({...Lt,kind:I("motion"),regionCount:a(),regions:p(t({bbox:te,pixelCount:a(),intensity:a()})).readonly(),frameWidth:a(),frameHeight:a()}),$r=t({...Lt,kind:I("object"),trackId:e(),className:e(),label:e().optional(),confidence:a(),bbox:te,zones:p(e()).readonly(),state:zt,mediaKey:e().optional()}),Wr=t({...Lt,kind:I("audio"),rms:a(),dbfs:a(),classification:t({className:e(),originalClass:e().optional(),score:a()}).optional()}),Fa=t({key:e(),kind:S(["crop","thumbnail","snapshot"]),base64:e(),sizeBytes:a(),timestamp:a()}),Kr=1e3,Gr=5e3,bt=t({deviceId:a(),since:a().optional(),until:a().optional(),limit:a().int().min(1).max(Gr).default(Kr)}),Vr=bt.extend({classFilter:e().optional()}),jr=t({trackId:e(),className:e(),confidence:a(),bbox:te,zones:p(e()).readonly(),state:zt}),Zr={name:"pipeline-analytics",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[C.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:c(t({deviceId:a()}),p(je).readonly()),getTrack:c(t({deviceId:a(),trackId:e()}),je.nullable()),listTracks:c(t({deviceId:a(),since:a().optional(),until:a().optional(),limit:a().optional()}),p(je).readonly()),clearTracks:c(t({deviceId:a()}),g(),{kind:"mutation",auth:"admin"}),getMotionEvents:c(bt,p(Hr).readonly()),getObjectEvents:c(Vr,p($r).readonly()),getAudioEvents:c(bt,p(Wr).readonly()),getEventMedia:c(t({eventId:e()}),p(Fa).readonly()),getTrackMedia:c(t({trackId:e()}),p(Fa).readonly())},events:{onFrameTracked:{data:t({deviceId:a(),timestamp:a(),frameWidth:a(),frameHeight:a(),detections:p(jr).readonly()})},onTrackStarted:{data:t({deviceId:a(),trackId:e(),className:e()})},onTrackEnded:{data:t({deviceId:a(),trackId:e(),className:e(),durationMs:a()})},onDetectionEvent:{data:t({deviceId:a(),kind:Fr,eventId:e(),timestamp:a()})}}},Yr=t({total:a(),user:a(),system:a(),irq:a(),nice:a(),loadAvg:Dt([a(),a(),a()]),cores:a()}),Qr=t({percent:a(),totalBytes:a(),usedBytes:a(),availableBytes:a(),swapUsedBytes:a(),swapTotalBytes:a()}),Jr=t({readBytes:a(),writeBytes:a(),readOps:a(),writeOps:a(),timestampMs:a()}),Xr=t({rxBytes:a(),txBytes:a(),rxPackets:a(),txPackets:a(),rxErrors:a(),txErrors:a(),timestampMs:a()}),zn=t({utilization:a(),model:e(),memoryUsedBytes:a(),memoryTotalBytes:a(),temperature:a().nullable()}),ed=t({openFds:a(),threadCount:a(),activeHandles:a(),activeRequests:a()}),Ua=t({avg10:a(),avg60:a(),avg300:a()}),Ze=t({some:Ua,full:Ua.nullable()}),Ha=t({cpu:Yr,memory:Qr,gpu:zn.nullable(),network:Xr,disk:Jr,pressure:t({cpu:Ze.nullable(),memory:Ze.nullable(),io:Ze.nullable()}),process:ed,cpuTemperature:a().nullable(),timestampMs:a()}),td=t({path:e(),totalBytes:a(),usedBytes:a(),availableBytes:a(),percent:a()}),$a=t({pid:a(),cpu:a(),memory:a()}),ad=t({addonId:e(),nodeId:e(),role:S(["hub","worker"]),pid:a(),state:S(["starting","running","stopping","stopped","crashed"]),uptimeSec:a()}),nd=t({pid:a(),ppid:a(),pgid:a(),classification:S(["root","managed","system","ghost"]),addonId:e().nullable(),nodeId:e().nullable(),command:e(),cpuPercent:a(),memoryRssBytes:a(),uptimeSec:a(),orphaned:h()}),od=t({pid:a(),force:h().optional()}),sd=t({success:h(),reason:e().optional(),signal:S(["SIGTERM","SIGKILL"]).optional()}),id=t({cpuPercent:a(),memoryPercent:a(),memoryUsedMB:a(),memoryTotalMB:a(),diskPercent:a().optional(),temperature:a().optional(),gpuPercent:a().optional(),gpuMemoryPercent:a().optional()}),cd={name:"metrics-provider",scope:"system",mode:"singleton",methods:{collectSnapshot:c(g(),Ha),getCached:c(g(),Ha.nullable()),getCurrent:c(g(),id),getDiskSpace:c(t({dirPath:e()}),td),getGpuInfo:c(g(),zn.nullable()),getCpuTemperature:c(g(),a().nullable()),getProcessStats:c(t({pids:p(a())}),p($a)),listAddonInstances:c(g(),p(ad).readonly()),getAddonStats:c(t({addonId:e()}),$a.nullable()),listNodeProcesses:c(g(),p(nd).readonly()),killProcess:c(od,sd,{kind:"mutation",auth:"admin"})}},rd=t({id:e(),name:e()}),Ln=t({pan:a(),tilt:a(),zoom:a()}),Wa=t({pan:a().optional(),tilt:a().optional(),zoom:a().optional(),speed:a().optional()}),dd=Ln.extend({autofocus:h()}),ld=t({hasPan:h(),hasTilt:h(),hasZoom:h(),supportsPresets:h(),maxPresets:a().optional(),hasAutofocus:h()}),pd={name:"ptz",scope:"device",mode:"singleton",deviceTypes:[C.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-panel",tab:"ptz",topTab:!0,label:"PTZ",order:0}},methods:{move:c(Wa.extend({deviceId:a()}),g(),{kind:"mutation"}),continuousMove:c(Wa.extend({deviceId:a()}),g(),{kind:"mutation"}),stop:c(t({deviceId:a()}),g(),{kind:"mutation"}),getPresets:c(t({deviceId:a()}),p(rd)),goToPreset:c(t({deviceId:a(),presetId:e()}),g(),{kind:"mutation"}),savePreset:c(t({deviceId:a(),presetId:e(),name:e()}),g(),{kind:"mutation",auth:"admin"}),deletePreset:c(t({deviceId:a(),presetId:e()}),g(),{kind:"mutation",auth:"admin"}),getOptions:c(t({deviceId:a()}),ld),goHome:c(t({deviceId:a()}),g(),{kind:"mutation"}),getPosition:c(t({deviceId:a()}),Ln),setAutofocus:c(t({deviceId:a(),enabled:h()}),g(),{kind:"mutation"})},status:{schema:dd,kind:"command-driven"}},md=t({id:e(),type:e(),timestamp:a(),label:e().optional(),thumbnailUrl:e().optional(),clipUrl:e().optional(),metadata:b(e(),f()).optional()}),ud={name:"events",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{getEvents:c(t({deviceId:a(),from:a().optional(),to:a().optional(),limit:a().optional()}),p(md)),getEventThumbnail:c(t({deviceId:a(),eventId:e()}),t({base64:e(),contentType:e()}).nullable()),getEventClipUrl:c(t({deviceId:a(),eventId:e()}),e().nullable())}},gd=t({id:e(),startTs:a(),endTs:a(),durationSec:a(),sizeBytes:a().optional()}),hd={name:"recording",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{getSegments:c(t({deviceId:a(),from:a().optional(),to:a().optional()}),p(gd)),getPlaybackUrl:c(t({deviceId:a(),segmentId:e()}),e().nullable()),getThumbnailAt:c(t({deviceId:a(),timestamp:a()}),t({base64:e(),contentType:e()}).nullable())}},vd=t({id:e(),label:e(),protocol:S(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:e().optional(),resolution:t({width:a(),height:a()}).optional(),fps:a().optional(),bitrate:a().optional(),codec:e().optional(),profileHint:S(["high","mid","low"]).optional(),sdp:e().optional()}),yd=t({key:e(),value:f()}),Sd={name:"device-ops",scope:"device",mode:"singleton",methods:{getStreamSources:c(t({deviceId:a()}),p(vd)),getConfigEntries:c(t({deviceId:a()}),p(yd)),setConfig:c(t({deviceId:a(),values:b(e(),f())}),g(),{kind:"mutation"}),removeDevice:c(t({deviceId:a()}),g(),{kind:"mutation"}),getSettingsSchema:c(t({deviceId:a()}),f().nullable())}},fd=t({host:e(),port:a().int().positive().optional(),onvifPort:a().int().positive().optional(),rtspPort:a().int().positive().optional(),https:h().optional(),username:e().optional(),password:e().optional(),onvifProfile:e().optional()}),bd=t({host:e(),port:a().int().positive().nullable(),onvifPort:a().int().positive().nullable(),rtspPort:a().int().positive().nullable(),https:h().nullable(),hasUsername:h(),hasPassword:h(),onvifProfile:e().nullable()}),Id={name:"camera-credentials",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{getCredentials:c(t({deviceId:a()}),fd.nullable(),{kind:"query",auth:"admin"})},status:{schema:bd,kind:"command-driven"}},kd={name:"reboot",scope:"device",mode:"singleton",deviceTypes:[C.Camera,C.Sensor,C.Switch],methods:{reboot:c(t({deviceId:a().int().nonnegative()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"})}},wd=S(["text","timestamp","watermark"]),It=S(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","custom"]),Ad=t({id:e(),kind:wd,enabled:h(),text:e().optional(),position:It.optional(),availablePositions:p(It).readonly(),readOnly:h().optional()}),Ka=t({overlays:p(Ad).readonly()}),Cd=t({enabled:h().optional(),text:e().optional(),position:It.optional()}).partial(),Nd={name:"osd",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{setOverlay:c(t({deviceId:a(),overlayId:e(),patch:Cd}),g(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:t({deviceId:a(),status:Ka})}},status:{schema:Ka,kind:"command-driven"},settings:{bindings:[{kind:"array",statusPath:"overlays",idField:"id",method:"setOverlay",idArg:"overlayId",patchArg:"patch",sectionId:"osd",sectionTitle:"Video overlays",itemFields:{enabled:{label:i=>`${String(i.id)} enabled`,kind:"boolean"},text:{label:i=>`${String(i.id)} text`,kind:"text",when:i=>i.kind!=="timestamp"&&!i.readOnly},position:{label:i=>`${String(i.id)} position`,kind:"select",options:i=>i.availablePositions??[],when:i=>Array.isArray(i.availablePositions)&&i.availablePositions.length>0}}}]}},Pd=t({childDeviceIds:p(a()).readonly()}),Dd={name:"accessories",scope:"device",mode:"singleton",deviceTypes:[C.Camera,C.Hub],methods:{},events:{onAccessoriesChanged:{data:t({deviceId:a(),childDeviceIds:p(a()).readonly()})}},status:{schema:Pd,kind:"command-driven"}},Md=t({codecs:p(e()),sampleRate:a(),duplex:S(["half","full"]),maxBacklogMs:a()}),Ga=t({talking:h(),lastSessionAt:a().nullable(),ability:Md.nullable()}),Ed={name:"intercom",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{startSession:c(t({deviceId:a()}),t({sessionId:e(),sdpOffer:e()}),{kind:"mutation",auth:"admin"}),handleAnswer:c(t({deviceId:a(),sessionId:e(),sdpAnswer:e()}),g(),{kind:"mutation",auth:"admin"}),stopSession:c(t({deviceId:a(),sessionId:e()}),g(),{kind:"mutation",auth:"admin"}),startTalkSession:c(t({deviceId:a()}),t({sessionId:e()}),{kind:"mutation",auth:"admin"}),pushTalkPcm:c(t({deviceId:a(),pcmBase64:e(),sequenceNumber:a().int()}),t({accepted:h()}),{kind:"mutation",auth:"admin"}),endTalkSession:c(t({deviceId:a()}),g(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:t({deviceId:a(),status:Ga})}},status:{schema:Ga,kind:"command-driven"}},kt=S(["person","vehicle","animal","face","package","other"]),_n=t({class:kt,timestamp:a(),confidence:a().min(0).max(1).optional()}),xd=t({lastByClass:b(kt,_n.nullable()),supportedClasses:p(kt).readonly()}),Td={name:"native-object-detection",scope:"device",mode:"singleton",deviceTypes:[C.Camera],methods:{},events:{onDetected:{data:t({deviceId:a(),detection:_n})}},status:{schema:xd,kind:"push"}},Rd=S(ho),Bd=S(["videotoolbox","cuda","nvdec","vaapi","qsv","d3d11va","dxva2","amf","vdpau","drm","coreml","tensorrt","openvino","directml","webgpu","none"]).nullable().optional(),qd=t({preferred:p(e()).readonly()}),wt=S(["h264_videotoolbox","hevc_videotoolbox","h264_vaapi","hevc_vaapi","h264_nvenc","hevc_nvenc","h264_qsv","hevc_qsv","h264_amf","hevc_amf","libx264","libx265"]),Od=t({encoder:wt,codec:S(["H264","H265"]),family:S(["videotoolbox","vaapi","nvenc","qsv","amf","software"]),available:h(),reason:e().optional()}),Va=t({encoders:p(Od).readonly(),defaultH264:wt,defaultH265:wt,probedAt:a()}),zd=S(["darwin","linux","win32"]),Ld=S(["arm64","x64"]),_d=t({type:S(["nvidia","amd","intel","apple"]),name:e(),memoryMB:a().optional()}),Fd=t({type:S(["apple-ane","intel-npu"])}),Fn=t({platform:zd,arch:Ld,cpuModel:e(),cpuCores:a(),totalRAM_MB:a(),availableRAM_MB:a(),gpu:_d.nullable(),npu:Fd.nullable()}),ja=t({runtime:S(["node","python"]),backend:e(),format:S(["onnx","coreml","openvino"]),score:a(),reason:e(),available:h()}),Ud=t({hardware:Fn,scores:p(ja).readonly(),bestScore:ja,pythonPath:e().nullable()}),Hd=t({modelId:e(),name:e(),minRAM_MB:a(),accuracyScore:a(),formats:p(e()).readonly()}),$d=t({modelId:e(),runtime:S(["node","python"]),backend:e(),format:Rd,reason:e()}),Wd={name:"platform-probe",scope:"system",mode:"singleton",methods:{getCapabilities:c(g(),Ud),getHardware:c(g(),Fn),resolveInferenceConfig:c(t({requirements:p(Hd).readonly()}),$d),resolveHwAccel:c(t({prefer:Bd,nodeId:e().optional()}),qd),getHardwareEncoders:c(g(),Va),refreshHardwareEncoders:c(g(),Va,{kind:"mutation",auth:"admin"})}},Kd=S(["lan","wifi","docker","vpn","loopback","other"]),Un=t({name:e(),family:S(["IPv4","IPv6"]),address:e(),cidr:e(),netmask:e(),internal:h(),mac:e(),kind:Kd,preferred:h(),plausible:h(),plausibleReason:e()}),Gd=t({interfaces:p(Un).readonly(),probedAt:a()}),Vd=Un.nullable(),jd=t({label:e(),baseUrl:e(),kind:S(["lan-ipv4","lan-ipv6","public","loopback"]),interfaceKind:S(["lan","wifi","docker","vpn","other","loopback","public"]),plausible:h(),plausibleReason:e(),priority:a()}),Zd=t({endpoints:p(jd).readonly()}),Ye=t({addresses:p(e()).readonly()}),Yd={name:"local-network",scope:"system",mode:"singleton",methods:{list:c(g(),Gd),getPreferred:c(g(),Vd),getConnectionEndpoints:c(t({port:a().int().min(1).max(65535),includeLoopback:h().optional(),ipv4Only:h().optional(),scheme:S(["http","https"]).optional()}),Zd),getAllowedAddresses:c(g(),Ye),setAllowedAddresses:c(Ye,t({success:I(!0)}),{kind:"mutation"}),resetAllowlistToBestMatch:c(g(),Ye,{kind:"mutation"})}},Qd=t({id:e(),label:e(),scope:S(["mesh","public"]),url:e(),hostname:e(),port:a(),protocol:S(["http","https"])}),Jd=t({id:e(),hostname:e(),magicDns:e(),addresses:p(e()).readonly(),os:e().optional(),online:h(),lastSeenMs:a(),isSelf:h(),connection:S(["direct","relay","idle"]),relay:e().nullable(),lastHandshakeMs:a(),rxBytes:a(),txBytes:a(),tags:p(e()).readonly(),exitNodeOption:h(),advertisedRoutes:p(e()).readonly(),userLogin:e().nullable(),keyExpiry:a().nullable()}),Xd=t({joined:h(),meshIp:e(),magicDnsHostname:e(),peerCount:a(),endpoints:p(Qd).readonly(),error:e().optional(),tenantName:e(),magicDnsSuffix:e(),userLogin:e().nullable(),controlPlaneUrl:e(),keyExpiry:a().nullable(),daemonSocket:e().optional(),daemonCliPath:e().optional()}),el={name:"mesh-network",scope:"system",mode:"collection",providerKind:"mesh",methods:{getStatus:c(g(),Xd),join:c(t({authKey:e().min(8),hostname:e().optional()}),t({joined:I(!0)}),{kind:"mutation"}),startLogin:c(t({hostname:e().optional()}),t({loginUrl:e()}),{kind:"mutation"}),leave:c(g(),t({left:I(!0)}),{kind:"mutation"}),logout:c(g(),t({loggedOut:I(!0)}),{kind:"mutation"}),listPeers:c(g(),t({peers:p(Jd).readonly()})),testConnection:c(t({authKey:e().optional()}),t({ok:h(),tenant:e().optional(),daemonVersion:e().optional(),error:e().optional()}),{kind:"mutation"})}},Qe=t({id:e(),username:e(),isAdmin:h().default(!1),allowedProviders:E([p(e()),I("*")]),allowedDevices:b(e(),E([p(e()),I("*")])),scopes:p(R).default([]),totpEnabled:h().default(!1),createdAt:a(),updatedAt:a()}),tl=t({username:e(),password:e().min(6),isAdmin:h().default(!1),allowedProviders:E([p(e()),I("*")]).optional(),allowedDevices:b(e(),E([p(e()),I("*")])).optional(),scopes:p(R).optional()}),al=t({id:e(),isAdmin:h().optional(),allowedProviders:E([p(e()),I("*")]).optional(),allowedDevices:b(e(),E([p(e()),I("*")])).optional(),scopes:p(R).optional()}),At=t({id:e(),label:e(),isAdmin:h().default(!1),allowedProviders:E([p(e()),I("*")]).optional(),allowedDevices:b(e(),E([p(e()),I("*")])).optional(),tokenPrefix:e(),createdAt:a(),lastUsedAt:a().optional()}),nl=t({label:e(),isAdmin:h().default(!1),allowedProviders:E([p(e()),I("*")]).optional(),allowedDevices:b(e(),E([p(e()),I("*")])).optional()}),ol=t({token:e(),record:At}),Ct=t({id:e(),userId:e(),name:e(),tokenPrefix:e(),scopes:p(R),expiresAt:a().nullish(),lastUsedAt:a().nullish(),createdAt:a()}),sl=t({userId:e(),name:e(),scopes:p(R),expiresAt:a().optional()}),il=t({token:e(),record:Ct}),cl=t({id:e(),userId:e(),username:e(),integrationId:e(),scopes:p(R),createdAt:a(),lastUsedAt:a(),revokedAt:a().nullable()}),rl=t({secret:e(),otpauthUrl:e()}),dl=t({enabled:h(),confirmedAt:a().nullable()}),ll={name:"user-management",scope:"system",mode:"singleton",methods:{listUsers:c(g(),p(Qe),{auth:"admin"}),createUser:c(tl,Qe,{kind:"mutation",auth:"admin",access:"create"}),updateUser:c(al,t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"create"}),deleteUser:c(t({id:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),resetPassword:c(t({id:e(),newPassword:e().min(6)}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"create"}),setUserScopes:c(t({userId:e(),scopes:p(R)}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"create"}),validateCredentials:c(t({username:e(),password:e()}),Qe.extend({passwordHash:e()}).nullable(),{kind:"mutation",access:"view"}),listApiKeys:c(g(),p(At),{auth:"admin"}),createApiKey:c(nl,ol,{kind:"mutation",auth:"admin",access:"create"}),revokeApiKey:c(t({id:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateApiKey:c(t({token:e()}),At.nullable(),{kind:"mutation",access:"view"}),createScopedToken:c(sl,il,{kind:"mutation",auth:"admin",access:"create"}),revokeScopedToken:c(t({id:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateScopedToken:c(t({token:e()}),Ct.nullable(),{access:"view"}),listScopedTokens:c(t({userId:e()}),p(Ct),{auth:"admin"}),setupTotp:c(t({userId:e()}),rl,{kind:"mutation",auth:"admin",access:"create"}),confirmTotp:c(t({userId:e(),code:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"create"}),disableTotp:c(t({userId:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getTotpStatus:c(t({userId:e()}),dl,{auth:"admin"}),verifyTotp:c(t({userId:e(),code:e()}),t({valid:h()}),{kind:"mutation",access:"view"}),oauthIssueCode:c(t({integrationId:e(),userId:e(),username:e(),scopes:p(R),redirectUri:e(),hubUrl:e()}),t({code:e()}),{kind:"mutation",access:"create"}),oauthExchangeCode:c(t({code:e(),redirectUri:e()}),t({accessToken:e(),refreshToken:e(),expiresIn:a()}).nullable(),{kind:"mutation",access:"view"}),oauthRefresh:c(t({refreshToken:e()}),t({accessToken:e(),refreshToken:e(),expiresIn:a()}).nullable(),{kind:"mutation",access:"view"}),oauthVerifyAccessToken:c(t({token:e()}),t({userId:e(),username:e(),scopes:p(R)}).nullable(),{access:"view"}),listOauthSessions:c(g(),p(cl),{auth:"admin"}),revokeOauthSession:c(t({id:e()}),t({success:h()}),{kind:"mutation",auth:"admin",access:"delete"})}},Za=t({streaming:h(),notifications:h(),objectDetection:h(),remoteAccess:h(),agentCluster:h(),smartHome:h(),recordings:h(),backup:h(),repl:h()}),pl=t({status:I("ok"),uptime:a()}),ml=t({name:e(),address:e(),family:e(),internal:h()}),ul={name:"system",scope:"system",mode:"singleton",methods:{info:c(g(),Za),health:c(g(),pl),featureFlags:c(g(),Za),networkAddresses:c(g(),p(ml).readonly()),getRetentionConfig:c(g(),f().nullable(),{auth:"admin"}),setRetentionConfig:c(b(e(),f()),so(),{kind:"mutation",auth:"admin"}),forceRetentionCleanup:c(g(),g(),{kind:"mutation",auth:"admin"})}},gl=t({nominalBitrateKbps:a(),observedBitrateKbps:a(),peakBitrateKbps:a(),packetLossPercent:a(),lastUpdated:a()}),hl=t({rttMs:a(),jitterMs:a(),estimatedBandwidthKbps:a(),lastUpdated:a()}),Ya=t({deviceId:a(),streams:b(e(),gl),client:hl.optional()}),vl={name:"network-quality",scope:"system",mode:"singleton",methods:{getDeviceStats:c(t({deviceId:a()}),Ya.nullable()),getAllStats:c(g(),p(Ya).readonly()),reportClientStats:c(t({deviceId:a(),rttMs:a().min(0).max(6e4),jitterMs:a().min(0).max(1e4),estimatedBandwidthKbps:a().min(0).max(1e6)}),g(),{kind:"mutation"})}},yl=t({title:e(),message:e(),severity:S(["info","warning","critical"]),duration:a().optional(),action:t({label:e(),url:e()}).optional()}),Sl={name:"toast",scope:"system",mode:"singleton",methods:{onToast:c(g(),yl,{kind:"subscription"})}},fl=t({addonId:e(),capabilities:p(e()).readonly(),status:e()}),bl=t({pid:a(),name:e(),state:e(),cpuPercent:a(),memoryRss:a(),uptimeSeconds:a(),services:p(fl).readonly(),groupId:e().optional()}),Il=t({id:e(),name:e(),hostname:e(),platform:e(),arch:e(),cpuModel:e().nullable(),cpuCores:a(),memoryMB:a(),engines:p(e()).readonly(),isHub:h(),isOnline:h(),cpuPercent:a(),memoryPercent:a(),uptime:a(),lastSeen:e(),localIps:p(e()).readonly(),addons:p(t({id:e(),capabilities:p(e()).readonly(),status:e()})).readonly(),processes:p(bl).readonly()}),kl=t({nodeId:e(),name:e(),version:e(),status:e(),synced:h()}),wl=t({hubVersion:e(),nodes:p(kl)}),Je=t({nodeId:e(),addonId:e()}),Al=t({id:e(),status:e(),version:e().optional(),packageName:e().optional()}),ce=t({success:h()}),Cl=t({success:h(),reason:e().optional()}),Nl=t({restarted:p(e()).readonly(),failed:p(e()).readonly()}),Pl=t({nodeId:e(),name:e()}),Dl={name:"nodes",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{topology:c(g(),p(Il).readonly(),{auth:"admin"}),deployAddon:c(Je,ce,{kind:"mutation",auth:"admin"}),undeployAddon:c(Je,ce,{kind:"mutation",auth:"admin"}),restartAddon:c(Je,ce,{kind:"mutation",auth:"admin"}),restartProcess:c(t({nodeId:e(),processName:e()}),Cl,{kind:"mutation",auth:"admin"}),restartNode:c(t({nodeId:e()}),Nl,{kind:"mutation",auth:"admin"}),shutdownNode:c(t({nodeId:e()}),ce,{kind:"mutation",auth:"admin"}),renameNode:c(t({nodeId:e(),name:e().min(1).max(64)}),Pl,{kind:"mutation",auth:"admin"}),clusterAddonStatus:c(g(),b(e(),wl),{auth:"admin"}),getCapUsageGraph:c(t({windowSeconds:a().int().positive().max(300).default(60)}),p(t({callerAddonId:e(),providerAddonId:e(),capName:e(),callsPerMin:a(),lastCallAtMs:a()})).readonly(),{auth:"admin"}),getNodeAddons:c(t({nodeId:e()}),p(Al).readonly(),{auth:"admin"}),setProcessLogLevel:c(t({nodeId:e(),level:e()}),ce,{kind:"mutation",auth:"admin"}),executeQuery:c(t({nodeId:e(),addonId:e(),queryName:e(),params:b(e(),f()).optional()}),f(),{kind:"mutation",auth:"admin"})}},Qa=t({id:e(),addonId:e(),name:e(),enabled:h(),info:b(e(),f()).readonly(),createdAt:a(),updatedAt:a(),processState:e()}),Xe=t({id:e(),addonId:e(),name:e(),enabled:h(),info:b(e(),f()).readonly(),createdAt:a(),updatedAt:a()}),Ml=t({addonId:e(),name:e(),description:e(),iconUrl:e().nullable(),color:e(),instanceMode:e(),discoveryMode:e(),existingInstances:p(t({id:e(),name:e()})),canAdd:h()}),El=t({success:h(),error:e().optional()}),xl=t({addonId:e(),name:e(),enabled:h().optional(),info:b(e(),f()).optional(),settings:b(e(),f()).optional(),skipRestart:h().optional()}),Tl=t({id:e(),name:e().optional(),enabled:h().optional(),info:b(e(),f()).optional()}),Rl=t({success:h(),deletedId:e()}),Bl={name:"integrations",scope:"system",mode:"singleton",methods:{list:c(g(),p(Qa)),get:c(t({id:e()}),Qa),getByAddonId:c(t({addonId:e()}),Xe.nullable()),create:c(xl,Xe,{kind:"mutation",auth:"admin"}),update:c(Tl,Xe,{kind:"mutation",auth:"admin"}),delete:c(t({id:e()}),Rl,{kind:"mutation",auth:"admin"}),getSettings:c(t({id:e()}),b(e(),f()),{auth:"admin"}),setSettings:c(t({id:e(),settings:b(e(),f())}),t({success:h()}),{kind:"mutation",auth:"admin"}),getAvailableTypes:c(g(),p(Ml),{auth:"admin"}),testConnection:c(t({addonId:e(),settings:b(e(),f())}),El,{kind:"mutation",auth:"admin"})}},Ja=S(["debug","info","warn","error"]),Nt=S(["off","latest","beta"]),Hn=S(["off","latest","beta","inherit"]),ql=t({id:e(),name:e().optional(),version:e().optional(),description:e().optional(),icon:e().optional(),color:e().optional(),capabilities:p(f()).readonly().optional(),packageName:e(),packageVersion:e(),packageDisplayName:e().optional(),bundle:t({displayName:e(),description:e().optional(),icon:e().optional()}).optional(),protected:h().optional(),removable:h().optional()}),Ol=t({pid:a().optional(),mode:e(),state:e()}),zl=t({phase:S(["pending","healthy","failed"]),retryCount:a(),firstFailureAt:a().nullable(),lastAttemptAt:a().nullable(),lastError:t({message:e(),stack:e().optional()}).nullable(),nextRetryAt:a().nullable(),alertEmitted:h(),retrying:h(),inGracePeriod:h()}),Ll=t({manifest:ql,declaration:f().optional(),source:e(),installSource:e().optional(),process:Ol.optional(),hasBackup:h().optional(),health:zl.nullable().optional()}),_l=t({name:e(),version:e(),dir:e(),installSource:e().optional()}),Fl=t({name:e(),currentVersion:e(),latestVersion:e(),category:S(["addon","core"]),requiresRestart:h()}),Ul=t({version:e(),publishedAt:e(),deprecated:e().optional(),distTags:p(e()).readonly()}),Hl=t({name:e(),version:e(),description:e(),keywords:p(e()).readonly(),publishedAt:e(),author:e(),installed:h(),installedVersion:e().optional()}),$l=t({channel:Nt,intervalSeconds:a()}),Wl=Hn,Kl=f(),Xa=f(),Gl=f(),Vl=t({packageName:e(),fromVersion:e(),toVersion:e(),restartingAt:a()}),jl=t({packageName:e(),currentVersion:e(),latestVersion:e().nullable(),hasUpdate:h(),description:e().optional()}),Zl=t({timestamp:e(),level:e(),message:e(),scope:e().optional()}),Yl=f(),Ql=t({addonId:e().min(1),action:e().min(1),input:f()}),Jl={name:"addons",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{list:c(g(),p(Ll).readonly()),getLogs:c(t({addonId:e(),limit:a().min(1).max(500).default(100),level:Ja.optional()}),p(Yl)),listPackages:c(g(),p(_l).readonly()),installPackage:c(t({packageName:e(),version:e().optional()}),Xa,{kind:"mutation",auth:"admin"}),installFromWorkspace:c(t({packageName:e()}),Xa,{kind:"mutation",auth:"admin"}),isWorkspaceAvailable:c(g(),h()),listWorkspacePackages:c(g(),p(f()).readonly()),uninstallPackage:c(t({packageName:e()}),f(),{kind:"mutation",auth:"admin"}),reloadPackages:c(g(),Gl,{kind:"mutation",auth:"admin"}),searchAvailable:c(t({query:e().optional()}),p(Hl)),listUpdates:c(t({nodeId:e().optional()}),p(Fl).readonly(),{auth:"admin"}),updatePackage:c(t({name:e().min(1),version:e().optional(),nodeId:e().optional()}),f(),{kind:"mutation",auth:"admin"}),rollbackPackage:c(t({name:e().min(1)}),t({rolledBackTo:e().nullable()}),{kind:"mutation",auth:"admin"}),forceRefresh:c(t({nodeId:e().optional()}),f(),{kind:"mutation",auth:"admin"}),restartServer:c(t({confirm:I(!0)}),f(),{kind:"mutation",auth:"admin"}),getLastRestart:c(g(),t({kind:S(["framework-update","manual","system"]),packageName:e().optional(),fromVersion:e().optional(),toVersion:e().optional(),requestedBy:e().optional(),requestedAt:a()}).nullable(),{auth:"admin"}),listFrameworkPackages:c(g(),p(jl).readonly(),{auth:"admin"}),listCapabilityProviders:c(t({capName:e().min(1)}),p(t({addonId:e(),mode:S(["singleton","collection"]),isActive:h()})).readonly()),setCapabilityProviderEnabled:c(t({capName:e().min(1),addonId:e().min(1),enabled:h()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),updateFrameworkPackage:c(t({packageName:e().min(1),version:e().optional()}),Vl,{kind:"mutation",auth:"admin"}),getVersions:c(t({name:e()}),p(Ul).readonly()),restartAddon:c(t({addonId:e()}),Kl,{kind:"mutation",auth:"admin"}),retryLoad:c(t({packageName:e()}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),getAutoUpdateSettings:c(g(),$l,{auth:"admin"}),setAutoUpdateSettings:c(t({channel:Nt,intervalSeconds:a().min(300).max(86400).optional()}),f(),{kind:"mutation",auth:"admin"}),getAddonAutoUpdate:c(t({addonId:e()}),Wl,{auth:"admin"}),setAddonAutoUpdate:c(t({addonId:e(),channel:Hn}),f(),{kind:"mutation",auth:"admin"}),applyAutoUpdateToAll:c(t({channel:Nt}),t({success:I(!0)}),{kind:"mutation",auth:"admin"}),custom:c(Ql,f(),{kind:"mutation"}),onAddonLogs:c(t({addonId:e(),level:Ja.optional()}),Zl,{kind:"subscription"})}},Xl=["decoder","motion-detection","pipeline-executor","audio-analyzer","pipeline-analytics","notification-output"],hm=[...Xl,"pipeline-orchestrator","pipeline-runner"];class vm{disposers=[];disposed=!1;onError;constructor(s={}){this.onError=s.onError??((n,d)=>{console.error(`[DisposerChain] disposer #${d} threw`,n)})}add(s){if(this.disposed){try{const n=s();n&&typeof n.then=="function"&&n.catch(d=>this.onError(d,-1))}catch(n){this.onError(n,-1)}return()=>{}}return this.disposers.push(s),()=>{const n=this.disposers.indexOf(s);n>=0&&this.disposers.splice(n,1)}}get isDisposed(){return this.disposed}get size(){return this.disposers.length}async dispose(){if(this.disposed)return;this.disposed=!0;const s=this.disposers.slice().reverse();this.disposers=[];for(let n=0;n<s.length;n++){const d=s[n];try{const l=d();l&&typeof l.then=="function"&&await l}catch(l){this.onError(l,s.length-1-n)}}}}const ep="hub-only";function Be(i){return{placement:i.execution?.placement??ep,group:i.execution?.group}}function ym(i){const s=Be(i).placement;return s==="any-node"||s==="agent-only"}function Sm(i){return Be(i).placement==="agent-only"}function fm(i){return Be(i).group}function bm(i,s){return i.execution?.group??s}function Im(i){return Be(i).placement}var Ne=(i=>(i.SystemBoot="system.boot",i.SystemAddonsReady="system.addons-ready",i.SystemRestarting="system.restarting",i.SystemRestartCompleted="system.restart-completed",i.SystemReadyState="system.ready-state",i.AddonStarted="addon.started",i.AddonStopped="addon.stopped",i.AddonRestarted="addon.restarted",i.AddonUpdated="addon.updated",i.AddonInstalled="addon.installed",i.AddonUninstalled="addon.uninstalled",i.AddonCrashed="addon.crashed",i.AddonError="addon.error",i.AddonPageReady="addon.page-ready",i.AddonWidgetReady="addon.widget-ready",i.AddonLoadFailed="addon.load-failed",i.AddonLoadRecovered="addon.load-recovered",i.AddonRetryScheduled="addon.retry-scheduled",i.AddonRetryAttempting="addon.retry-attempting",i.DeviceRegistered="device.registered",i.DeviceUnregistered="device.unregistered",i.DeviceEnabled="device.enabled",i.DeviceDisabled="device.disabled",i.DeviceSettingsUpdated="device.settings-updated",i.DeviceBindingsChanged="device.bindings-changed",i.DeviceMetaChanged="device.meta-changed",i.DeviceStreamsRegistered="device.streams-registered",i.IntegrationEnabled="integration.enabled",i.IntegrationDisabled="integration.disabled",i.IntegrationDeleted="integration.deleted",i.ProviderStarted="provider.started",i.ProviderStopped="provider.stopped",i.ProcessCrashed="process.crashed",i.ProcessRestartScheduled="process.restart_scheduled",i.ProcessRestarted="process.restarted",i.RecordingStarted="recording.started",i.RecordingStopped="recording.stopped",i.RecordingError="recording.error",i.RecordingHealthDegraded="recording.health.degraded",i.RecordingStorageCritical="recording.storage.critical",i.RecordingSegmentWritten="recording.segment.written",i.RecordingPolicyFallback="recording.policy.fallback",i.RecordingRetentionCompleted="recording.retention.completed",i.DetectionEvent="detection.event",i.SessionTrackNew="session.track.new",i.SessionTrackExpired="session.track.expired",i.BenchmarkProgress="benchmark.progress",i.PlatformProbePhase="platform-probe.phase",i.PipelineProgress="pipeline.progress",i.PipelineTrace="pipeline.trace",i.PipelineInferenceResult="pipeline.inference-result",i.PipelineCameraAssigned="pipeline.camera-assigned",i.PipelineCameraUnassigned="pipeline.camera-unassigned",i.PipelineCameraUpdated="pipeline.camera-updated",i.PipelineRunnerLoadSnapshot="pipeline.runner-load-snapshot",i.PipelineCameraMetricsSnapshot="pipeline.camera-metrics-snapshot",i.StreamBrokerMetricsSnapshot="stream-broker.metrics-snapshot",i.StreamBrokerOnCamStreamDemand="stream-broker.onCamStreamDemand",i.StreamBrokerOnCamStreamIdle="stream-broker.onCamStreamIdle",i.StreamBrokerOnRequestStreamSourceRefresh="stream-broker.onRequestStreamSourceRefresh",i.DeviceStateChanged="device.state-changed",i.BatteryOnStatusChanged="battery.onStatusChanged",i.DoorbellOnPressed="doorbell.onPressed",i.PipelineEngineMetricsSnapshot="pipeline.engine-metrics-snapshot",i.ClusterTopologySnapshot="cluster.topology-snapshot",i.MetricsNodeResourcesSnapshot="metrics.node-resources-snapshot",i.MetricsNodeProcessesSnapshot="metrics.node-processes-snapshot",i.CapabilityBindingChanged="capability.binding-changed",i.ModelDownloadProgress="model.download.progress",i.AgentRegistered="agent.registered",i.AgentUnregistered="agent.unregistered",i.AgentOnline="agent.online",i.AgentOffline="agent.offline",i.WorkerOnline="worker.online",i.WorkerOffline="worker.offline",i.AgentTaskDispatched="agent.task.dispatched",i.AgentTaskAssigned="agent.task.assigned",i.AgentTrpcConnected="agent.trpc.connected",i.AgentWsConnected="agent.ws.connected",i.AgentWsDisconnected="agent.ws.disconnected",i.AgentBackupActivated="agent.backup.activated",i.OrchestrationSettingsUpdated="orchestration.settings-updated",i.PipelineAgentHwaccelChanged="pipeline.agent-hwaccel-changed",i.MotionAnalysis="detection.motion-analysis",i.MotionZonesRaw="detection.motion-zones-raw",i.MotionOnMotionChanged="motion.on-motion-changed",i.DetectionResult="detection.result",i.DetectionRaw="detection.raw",i.DetectionCameraNative="detection.camera-native",i.PipelineAudioInferenceResult="pipeline.audio-inference-result",i.DetectionPhaseTransition="detection.phase-transition",i.ProviderMotion="provider.motion",i.ProviderDetection="provider.detection",i.EnrichmentEmbeddingStored="enrichment.embedding.stored",i.EnrichmentSceneStateChanged="enrichment.scene.state-changed",i.EnrichmentActivitySummary="enrichment.activity.summary",i.PipelineAnalyticsTrackStarted="pipeline-analytics.track-started",i.PipelineAnalyticsTrackEnded="pipeline-analytics.track-ended",i.PipelineAnalyticsDetectionEvent="pipeline-analytics.detection-event",i.PipelineAnalyticsFrameTracked="pipeline-analytics.frame-tracked",i.FrigateLiveEvent="frigate.live-event",i.CameraStreamsProfileSlotsChanged="camera-streams.onProfileSlotsChanged",i.StreamOnline="stream.online",i.StreamOffline="stream.offline",i.NetworkTunnelStarted="network.tunnel.started",i.NetworkTunnelStopped="network.tunnel.stopped",i.LocalNetworkChanged="network.local.changed",i.BackupCompleted="backup.completed",i.BackupRestored="backup.restored",i.NotificationDispatched="notification.dispatched",i.NotificationFailed="notification.failed",i.DeviceUpdated="device.updated",i.DeviceOnline="device.online",i.DeviceOffline="device.offline",i.DeviceAwake="device.awake",i.DeviceSleeping="device.sleeping",i.RetentionCleanup="retention.cleanup",i))(Ne||{});function km(i,s){return i.category===s}function $n(i,s,n){return{id:typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2),timestamp:new Date,source:s,category:i,data:n}}function tp(i,s){const n=s.ts??Date.now();i.emit($n("system.ready-state",{type:"capability",id:s.capName,nodeId:s.sourceNodeId},{capName:s.capName,scope:s.scope,state:s.state,generation:s.generation,sourceNodeId:s.sourceNodeId,ts:n}))}class ap{_ctx=null;_config;_readinessGeneration=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,14);_registeredCapNames=[];defaults;constructor(s){this.defaults=s,this._config={...s}}get autoEmitReadiness(){return!0}get ctx(){if(!this._ctx)throw new Error(`${this.constructor.name}: ctx accessed before initialize()`);return this._ctx}get ctxIfReady(){return this._ctx}get config(){return this._config}async initialize(s){this._ctx=s,await this.resolveConfig();const n=await this.onInitialize();this.emitLifecycle(Ne.AddonStarted);const d=np(n),l=d&&"providers"in d&&d.providers?d.providers:[];return this._registeredCapNames=l.map(m=>m.capability.name),d}postBrokerStart(){this.autoEmitReadiness&&this._registeredCapNames.length>0&&this.emitReadinessForProviders("ready")}async onHubReachable(){}async shutdown(){this.emitLifecycle(Ne.AddonStopped),this.autoEmitReadiness&&this.emitReadinessForProviders("down"),await this.onShutdown();for(const s of this._subscriptions)s();this._subscriptions=[],this._ctx=null}async onShutdown(){}async onConfigChanged(){}field(s){return s}schema(s){return s}globalSettingsSchema(){return null}deviceSettingsSchema(){return null}async getGlobalSettings(s){const n=this.globalSettingsSchema();if(!n)return{sections:[]};const d=await this._ctx?.settings?.readAddonStore()??{};return sa(n,s?{...d,...s}:d)}async updateGlobalSettings(s){await this._ctx?.settings?.writeAddonStore(s),await this.resolveConfig(),await this.onConfigChanged(),this.emitLifecycle(Ne.AddonUpdated,{level:"global"}),this.maybeAutoRestart(s,this.globalSettingsSchema())}maybeAutoRestart(s,n){if(!n)return;const d=new Set;for(const u of n.sections)for(const y of u.fields)y.type==="separator"||y.type==="info"||y.requiresRestart&&d.add(y.key);if(d.size===0||!Object.keys(s).some(u=>d.has(u)))return;const m=this._ctx;if(!m)return;const v=m.id;setImmediate(()=>{m.api.addons?.restartAddon?.mutate({addonId:v}).then(()=>{m.logger.info("addon auto-restart triggered by restart-required setting change",{meta:{changedFields:Object.keys(s).filter(y=>d.has(y))}})}).catch(y=>{m.logger.error("addon auto-restart failed",{meta:{error:y instanceof Error?y.message:String(y)}})})})}async getDeviceSettings(s){const n=this.deviceSettingsSchema();if(!n)return{sections:[]};const d=await this._ctx?.settings?.readDeviceStore(s)??{};return sa(n,d)}async updateDeviceSettings(s,n){await this._ctx?.settings?.writeDeviceStore(s,n)}_subscriptions=[];watchCapability(s,n){const d=Array.isArray(s)?s:[s],l=new Set(d);this.subscribe({category:"system.ready-state"},m=>{const v=m.data;if(typeof v.capName!="string"||!l.has(v.capName)||v.scope?.type!=="node")return;const u=v.scope.nodeId;if(typeof u!="string"||u.length===0)return;const y=v.capName;v.state==="down"?n.onDown?.(u,y):v.state==="ready"&&n.onReady?.(u,y)})}subscribe(s,n){const d=this.ctx.eventBus.subscribe(s,n);this._subscriptions.push(d)}emitLifecycle(s,n){try{this._ctx?.eventBus.emit({id:`${this._ctx.id}-${Date.now()}`,timestamp:new Date,source:{type:"addon",id:this._ctx.id,nodeId:this._ctx.kernel.localNodeId??"hub"},category:s,data:n??{}})}catch{}}emitReadinessForProviders(s){const n=this._ctx;if(!n||this._registeredCapNames.length===0)return;const d=n.kernel?.localNodeId??"hub",l=d.includes("/")?d.split("/")[0]:d;for(const m of this._registeredCapNames)try{tp(n.eventBus,{capName:m,scope:{type:"node",nodeId:l},state:s,generation:this._readinessGeneration,sourceNodeId:l})}catch{}}async resolveModelsDir(){return this.ctx.api.storage.resolve.query({location:"models",relativePath:""}).catch(()=>"camstack-data/models")}get capabilities(){return this.ctx.capabilities??null}async resolveConfig(){const s=await this.readAddonStoreWithRetry(),n={...this.defaults};for(const d of Object.keys(this.defaults)){const l=s[d];if(l!=null){const m=typeof this.defaults[d];typeof l===m&&(n[d]=l)}}this._config=n}async readAddonStoreWithRetry(){const s=this._ctx?.settings;if(!s)return{};const n=[150,350,600,900];let d;for(let l=0;l<=n.length;l++)try{return await s.readAddonStore()??{}}catch(m){d=m;const v=m instanceof Error?m.message:String(m);if(!(v.includes("SqliteSettingsBackend not initialized")||v.includes("provider not available")))throw m;if(l===n.length)break;await new Promise(y=>setTimeout(y,n[l]))}return this._ctx?.logger?.warn?.("readAddonStore: settings-store unavailable after retries — using defaults",{meta:{error:d instanceof Error?d.message:String(d)}}),{}}}function np(i){if(i!=null)return Array.isArray(i)?{providers:i}:i}function wm(i,s){return{id:i,getRoutes:()=>s,invoke:async n=>{const d=op(s,n.method,n.path);if(!d)return{status:404,headers:{},redirectUrl:null,body:{error:`No route matches ${n.method} ${n.path}`}};const l={status:200,headers:{},redirectUrl:null},m=ip(l),v={params:{...n.params,...d.params},query:n.query,body:n.body,headers:n.headers,...n.user?{user:n.user}:{},...n.scopedToken!==void 0?{scopedToken:n.scopedToken}:{}};return await d.route.handler(v,m),l}}}function op(i,s,n){const d=s.toUpperCase();for(const l of i){if(l.method!==d)continue;const m=sp(l.path,n);if(m!==null)return{route:l,params:m}}return null}function sp(i,s){const n=i.split("/").filter(Boolean),d=s.split("/").filter(Boolean);if(n.length!==d.length)return null;const l={};for(let m=0;m<n.length;m++){const v=n[m],u=d[m];if(v.startsWith(":"))l[v.slice(1)]=u;else if(v!==u)return null}return l}function ip(i){const s={status(n){return i.status=n,s},code(n){return i.status=n,s},send(n){i.body=n},redirect(n){i.redirectUrl=n,i.status===200&&(i.status=302)},header(n,d){return i.headers[n.toLowerCase()]=d,s},type(n){return i.contentType=n,s}};return s}class cp extends Error{capName;scope;waitedMs;constructor(s,n,d){super(`Timed out waiting for ${s} (${le(n)}) to become ready after ${d}ms`),this.name="ReadinessTimeoutError",this.capName=s,this.scope=n,this.waitedMs=d}}function et(i,s){return`${i}|${le(s)}`}function le(i){switch(i.type){case"global":return"global";case"node":return`node:${i.nodeId}`;case"device":return`device:${i.deviceId}`}}function tt(i,s){return i.type!==s.type?!1:i.type==="global"||s.type==="global"?!0:i.type==="node"&&s.type==="node"?i.nodeId===s.nodeId:i.type==="device"&&s.type==="device"?i.deviceId===s.deviceId:!1}class Am{bus;sourceNodeId;logger;now;generation;snapshot=new Map;subscriptions=new Set;unsubscribeBus;unsubscribeAgentOffline;constructor(s){if(this.bus=s.eventBus,this.sourceNodeId=s.sourceNodeId,this.logger=s.logger,this.now=s.now??(()=>Date.now()),this.generation=s.generation??rp(),this.unsubscribeBus=this.bus.subscribe({category:"system.ready-state"},n=>this.ingest(n.data)),this.unsubscribeAgentOffline=this.bus.subscribe({category:"agent.offline"},n=>this.synthesizeDownForNode(n.data.agentId)),typeof this.bus.getRecent=="function")try{const n=this.bus.getRecent({category:"system.ready-state"});for(const d of n)this.ingest(d.data)}catch{}}close(){this.unsubscribeBus(),this.unsubscribeAgentOffline(),this.subscriptions.clear()}get(s,n){return this.snapshot.get(et(s,n))??null}getSnapshotForTransport(){return Array.from(this.snapshot.values())}hydrate(s){const n=this.now();for(const d of s){const l=et(d.capName,d.scope);if(this.snapshot.has(l))continue;const m={capName:d.capName,scope:d.scope,state:d.state,generation:d.generation,epoch:1,lastChange:n,sourceNodeId:d.sourceNodeId};this.snapshot.set(l,m),this.logger&&this.logger.debug(`readiness: ${d.capName} (${le(d.scope)}) → ${d.state} (hydrated, gen=${d.generation.slice(0,6)})`);const v={capName:d.capName,scope:d.scope,state:d.state,epoch:1,generation:d.generation,sourceNodeId:"hydrated",ts:n,durationInPrevState:0};for(const u of this.subscriptions)if(u.capName===d.capName&&tt(u.scope,d.scope))try{u.handler(v)}catch(y){this.logger?.warn(`readiness hydrate handler threw for ${d.capName}: ${y.message??String(y)}`)}}}getAll(){return new Map(this.snapshot)}emitReady(s,n){this.emitTransition(s,n,"ready")}emitStarting(s,n){this.emitTransition(s,n,"starting")}emitDown(s,n){this.emitTransition(s,n,"down")}awaitReady(s,n,d={}){const l=d.timeoutMs??Number.POSITIVE_INFINITY,m=this.now();return this.get(s,n)?.state==="ready"?Promise.resolve():d.signal?.aborted?Promise.reject(d.signal.reason??new Error("aborted")):new Promise((u,y)=>{let k=!1;const w=this.onReadyState(s,n,j=>{j.state==="ready"&&(k||(k=!0,O(),u()))}),N=!Number.isFinite(l)?null:setTimeout(()=>{k||(k=!0,O(),y(new cp(s,n,this.now()-m)))},l),x=()=>{k||(k=!0,O(),y(d.signal?.reason??new Error("aborted")))};d.signal?.addEventListener("abort",x,{once:!0});function O(){w(),N!==null&&clearTimeout(N),d.signal?.removeEventListener("abort",x)}})}onReadyState(s,n,d){const l={capName:s,scope:n,handler:d};this.subscriptions.add(l);const m=this.get(s,n);return m!==null&&queueMicrotask(()=>{this.subscriptions.has(l)&&d({capName:s,scope:n,state:m.state,epoch:m.epoch,generation:m.generation,sourceNodeId:this.sourceNodeId,ts:m.lastChange,durationInPrevState:0})}),()=>{this.subscriptions.delete(l)}}emitTransition(s,n,d){const l=this.now();this.bus.emit($n("system.ready-state",{type:"capability",id:s,nodeId:this.sourceNodeId},{capName:s,scope:n,state:d,generation:this.generation,sourceNodeId:this.sourceNodeId,ts:l}))}ingest(s){if(typeof s?.capName!="string"||s.state!=="ready"&&s.state!=="starting"&&s.state!=="down"||typeof s.generation!="string"||s.scope?.type!=="global"&&s.scope?.type!=="node"&&s.scope?.type!=="device")return;const n=et(s.capName,s.scope),d=this.snapshot.get(n)??null,l=this.now();let m;if(d===null?m=s.state==="ready"?1:0:d.generation!==s.generation&&s.state==="ready"?m=d.epoch+1:m=d.epoch,d!==null&&d.generation===s.generation&&d.state===s.state)return;const v=d===null?0:Math.max(0,l-d.lastChange),u={capName:s.capName,scope:s.scope,state:s.state,generation:s.generation,epoch:m,lastChange:l,sourceNodeId:s.sourceNodeId};this.snapshot.set(n,u);const y={capName:s.capName,scope:s.scope,state:s.state,epoch:m,generation:s.generation,sourceNodeId:s.sourceNodeId,ts:s.ts,durationInPrevState:v};this.logger&&this.logger.debug(`readiness: ${s.capName} (${le(s.scope)}) → ${s.state} epoch=${m} gen=${s.generation.slice(0,6)} (prev ${v}ms)`);for(const k of this.subscriptions)if(k.capName===s.capName&&tt(k.scope,s.scope))try{k.handler(y)}catch(w){this.logger?.warn(`readiness handler threw for ${s.capName}: ${w.message??String(w)}`)}}synthesizeDownForNode(s){const n=this.now();for(const[d,l]of this.snapshot){if(l.state==="down"||!(l.scope.type==="node"&&l.scope.nodeId===s||l.scope.type==="device"&&l.sourceNodeId===s))continue;const v=Math.max(0,n-l.lastChange),u={...l,state:"down",lastChange:n};this.snapshot.set(d,u);const y={capName:l.capName,scope:l.scope,state:"down",epoch:l.epoch,generation:l.generation,sourceNodeId:this.sourceNodeId,ts:n,durationInPrevState:v};this.logger&&this.logger.debug(`readiness: ${l.capName} (${le(l.scope)}) → down (synthesized from agent.offline ${s})`);for(const k of this.subscriptions)if(k.capName===l.capName&&tt(k.scope,l.scope))try{k.handler(y)}catch(w){this.logger?.warn(`readiness handler threw during agent.offline demux for ${l.capName}: ${w.message??String(w)}`)}}}}function rp(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2,14)}function Cm(i,s){for(const{capName:n,scope:d}of s)i.emitDown(n,d)}const Nm=["data","media","recordings","recordings-high","recordings-low","recordings-clips","event-images","models","addons-data","cache","logs","backups"],Pm={data:"db",media:"media",recordings:"recordings","recordings-high":"recordings-high","recordings-low":"recordings-low","recordings-clips":"recordings-clips","event-images":"event-images",models:"models","addons-data":"addons-data",cache:"/tmp/camstack-cache",logs:"logs",backups:"backups"},dp={high:"High",mid:"Mid",low:"Low"};function Dm(i){return dp[i]??i.charAt(0).toUpperCase()+i.slice(1)}function lp(i){return(i.width??0)*(i.height??0)}function pp(i){if(i.length===0)return[];const s=i.map((d,l)=>({s:d,i:l,px:lp(d.metadata??{})})).sort((d,l)=>l.px-d.px),n=Array.from({length:i.length});for(let d=0;d<s.length;d++){const{s:l,i:m}=s[d];let v;d===0?v="high":d===s.length-1?v="low":v="mid",n[m]={...l,quality:v}}return n}function Mm(i){const s=i.height??0,n=i.width??0;return s>=1080||n>=1920?"high":s>=480||n>=640?"mid":"low"}function Em(i){const s=i.protocols.find(l=>l.type==="rtsp"&&l.url)??i.protocols.find(l=>l.url),n=s?.type,d=n==="rtsp"?"rtsp":n==="http"||n==="flv"?"http-mjpeg":"custom";return{id:i.id,label:i.label??i.id,protocol:d,url:s?.url,profileHint:i.quality}}function B(i){return typeof i=="string"}function mp(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function up(i){return B(i)&&i.trim()?{url:i}:mp(i)&&B(i.url)&&i.url.trim()?{url:i.url,label:B(i.label)?i.label:void 0}:null}function xm(i){const s=B(i.snapshot_url)?i.snapshot_url:void 0;if(Array.isArray(i.streams)){const v=[];for(const u of i.streams){const y=up(u);y&&v.push(y)}return{streams:v,snapshot_url:s}}const n=[],d=B(i.main_stream_url)?i.main_stream_url:void 0;d&&n.push({url:d,label:B(i.main_stream_name)?i.main_stream_name:void 0});const l=B(i.sub_stream_url)?i.sub_stream_url:void 0;l&&n.push({url:l,label:B(i.sub_stream_name)?i.sub_stream_name:void 0});const m=B(i.third_stream_url)?i.third_stream_url:void 0;return m&&n.push({url:m,label:B(i.third_stream_name)?i.third_stream_name:void 0}),{streams:n,snapshot_url:s}}function Tm(i){if(i.length===0)return{};const s=pp(i),n={},d=s.find(u=>u.quality==="high"),l=s.find(u=>u.quality==="mid"),m=s.find(u=>u.quality==="low");d&&(n.high=d.id),l&&(n.mid=l.id),m&&(n.low=m.id);const v=d??l??m??s[0];return v&&(n.high||(n.high=v.id),n.mid||(n.mid=v.id),n.low||(n.low=v.id)),n}const Rm={streaming:!0,notifications:!0,objectDetection:!1,remoteAccess:!0,agentCluster:!1,smartHome:!0,recordings:!0,backup:!0,repl:!0},Bm=["face","plate"],qm=["face","plate","clip","custom"],Om={cleanupIntervalMs:3600*1e3,detectionEventsDays:30,audioLevelsDays:7,snapshotsDays:14};var gp=(i=>(i.Addon="addon",i.Core="core",i.Device="device",i.Provider="provider",i.System="system",i))(gp||{});const hp="camstack/camstack-models",zm=`https://huggingface.co/${hp}/resolve/main`,Lm={"features.streaming":!0,"features.notifications":!0,"features.objectDetection":!1,"features.remoteAccess":!0,"features.agentCluster":!1,"features.smartHome":!0,"features.recordings":!0,"features.backup":!0,"features.repl":!0,"retention.detectionEventsDays":30,"retention.audioLevelsDays":7,"logging.level":"info","logging.retentionDays":30,"eventBus.ringBufferSize":1e4,"storage.provider":"sqlite-storage","storage.locations":{data:"camstack-data/data",media:"camstack-data/media",recordings:"camstack-data/recordings",cache:"/tmp/camstack-cache",logs:"camstack-data/logs",models:"camstack-data/models"},providers:[],"recording.segmentDurationSeconds":4,"recording.defaultRetentionDays":30,"ffmpeg.binaryPath":"ffmpeg","ffmpeg.hwAccel":"auto","ffmpeg.threadCount":0,"auth.tokenExpiry":"24h"};function Wn(i){return JSON.parse(i)}function vp(i){return i===null||typeof i!="object"||Array.isArray(i)?null:{...i}}function _m(i){return Array.isArray(i)?i:[]}function Fm(i,s=""){return typeof i=="string"?i:s}function Um(i,s=0){return typeof i=="number"?i:s}function Hm(i,s=!1){return typeof i=="boolean"?i:s}function $m(i){try{return vp(Wn(i))}catch{return null}}function Wm(i){try{const s=Wn(i);return Array.isArray(s)?s:null}catch{return null}}function Km(i,s){return`https://huggingface.co/${i}/resolve/main/${s}`}function Gm(i,s){if(i.length!==s.length)return 0;let n=0,d=0,l=0;for(let v=0;v<i.length;v++)n+=i[v]*s[v],d+=i[v]*i[v],l+=s[v]*s[v];const m=Math.sqrt(d)*Math.sqrt(l);return m===0?0:n/m}class Vm{constructor(s,n){this.elementId=s,this.getBackend=typeof n=="function"?n:()=>n}cache={};listeners=new Set;loaded=!1;getBackend;async ensureLoaded(){if(this.loaded)return;const s=this.getBackend();if(!s)throw new Error(`ElementConfigStore(${this.elementId}): settings backend not available`);const n=await s.query({collection:"config",filter:{where:{id:this.elementId},limit:1}});n.length>0&&(this.cache=n[0].data??{}),this.loaded=!0}getAll(){return{...this.cache}}get(s){const n=s.split(".");let d=this.cache;for(const l of n){if(d===null||typeof d!="object"||Array.isArray(d))return;d=Reflect.get(d,l)}return d}async set(s,n){await this.ensureLoaded(),yp(this.cache,s,n),await this.persist(),this.notifyListeners()}async setAll(s){await this.ensureLoaded(),this.cache={...s},await this.persist(),this.notifyListeners()}onChange(s){return this.listeners.add(s),()=>{this.listeners.delete(s)}}async load(){await this.ensureLoaded()}async loadDefaults(s){await this.ensureLoaded(),Object.keys(this.cache).length===0&&(this.cache={...s},await this.persist())}async persist(){const s=this.getBackend();if(!s)throw new Error(`ElementConfigStore(${this.elementId}): settings backend not available — cannot persist config`);await s.set({collection:"config",key:this.elementId,value:this.cache})}notifyListeners(){const s=this.getAll();for(const n of this.listeners)try{n(s)}catch{}}}function yp(i,s,n){const d=s.split(".");let l=i;for(let m=0;m<d.length-1;m++){const v=d[m],u=l[v];if(u===null||typeof u!="object"||Array.isArray(u)){const y={};l[v]=y,l=y}else l=u}l[d[d.length-1]]=n}const Kn={cpu:"onnx",coreml:"onnx",cuda:"onnx",tensorrt:"onnx","onnx-py":"onnx",pytorch:"pt",openvino:"openvino"},Sp={onnx:"onnx",coreml:"coreml",openvino:"openvino",tflite:"tflite",pytorch:"pt"},fp={coreml:"coreml_inference.py",pytorch:"pytorch_inference.py",openvino:"openvino_inference.py"};function bp(i,s){return i==="node"?"onnx":{coreml:"coreml",openvino:"openvino",pytorch:"pytorch","onnx-py":"onnx",cpu:"onnx"}[s]??s}function jm(i,s){return i==="node"?Kn[s]??"onnx":{coreml:"coreml",openvino:"openvino",pytorch:"pt","onnx-py":"onnx",cpu:"onnx"}[s]??"onnx"}function Zm(i,s){return!i||i==="auto"?"auto":bp(i,s??"cpu")}function Ym(i){return Kn[i]??"onnx"}function Qm(i){return Sp[i]}function Jm(i){return fp[i]}function Xm(i){return i==="coreml"||i==="pytorch"||i==="openvino"}async function eu(i,s){const n=performance.now();try{return{output:s!==void 0?await Ip(i(),s):await i(),durationMs:en(performance.now()-n),ok:!0}}catch(d){return{output:void 0,durationMs:en(performance.now()-n),ok:!1,error:bo(d)}}}function en(i){return Math.round(i*100)/100}function Ip(i,s){return new Promise((n,d)=>{const l=setTimeout(()=>d(new Error(`Inference timeout after ${s}ms`)),s);i.then(m=>{clearTimeout(l),n(m)}).catch(m=>{clearTimeout(l),d(m)})})}const tu=[{id:"person",name:"Person"},{id:"bicycle",name:"Bicycle"},{id:"car",name:"Car"},{id:"motorcycle",name:"Motorcycle"},{id:"airplane",name:"Airplane"},{id:"bus",name:"Bus"},{id:"train",name:"Train"},{id:"truck",name:"Truck"},{id:"boat",name:"Boat"},{id:"traffic light",name:"Traffic Light"},{id:"fire hydrant",name:"Fire Hydrant"},{id:"stop sign",name:"Stop Sign"},{id:"parking meter",name:"Parking Meter"},{id:"bench",name:"Bench"},{id:"bird",name:"Bird"},{id:"cat",name:"Cat"},{id:"dog",name:"Dog"},{id:"horse",name:"Horse"},{id:"sheep",name:"Sheep"},{id:"cow",name:"Cow"},{id:"elephant",name:"Elephant"},{id:"bear",name:"Bear"},{id:"zebra",name:"Zebra"},{id:"giraffe",name:"Giraffe"},{id:"backpack",name:"Backpack"},{id:"umbrella",name:"Umbrella"},{id:"handbag",name:"Handbag"},{id:"tie",name:"Tie"},{id:"suitcase",name:"Suitcase"},{id:"frisbee",name:"Frisbee"},{id:"skis",name:"Skis"},{id:"snowboard",name:"Snowboard"},{id:"sports ball",name:"Sports Ball"},{id:"kite",name:"Kite"},{id:"baseball bat",name:"Baseball Bat"},{id:"baseball glove",name:"Baseball Glove"},{id:"skateboard",name:"Skateboard"},{id:"surfboard",name:"Surfboard"},{id:"tennis racket",name:"Tennis Racket"},{id:"bottle",name:"Bottle"},{id:"wine glass",name:"Wine Glass"},{id:"cup",name:"Cup"},{id:"fork",name:"Fork"},{id:"knife",name:"Knife"},{id:"spoon",name:"Spoon"},{id:"bowl",name:"Bowl"},{id:"banana",name:"Banana"},{id:"apple",name:"Apple"},{id:"sandwich",name:"Sandwich"},{id:"orange",name:"Orange"},{id:"broccoli",name:"Broccoli"},{id:"carrot",name:"Carrot"},{id:"hot dog",name:"Hot Dog"},{id:"pizza",name:"Pizza"},{id:"donut",name:"Donut"},{id:"cake",name:"Cake"},{id:"chair",name:"Chair"},{id:"couch",name:"Couch"},{id:"potted plant",name:"Potted Plant"},{id:"bed",name:"Bed"},{id:"dining table",name:"Dining Table"},{id:"toilet",name:"Toilet"},{id:"tv",name:"TV"},{id:"laptop",name:"Laptop"},{id:"mouse",name:"Mouse"},{id:"remote",name:"Remote"},{id:"keyboard",name:"Keyboard"},{id:"cell phone",name:"Cell Phone"},{id:"microwave",name:"Microwave"},{id:"oven",name:"Oven"},{id:"toaster",name:"Toaster"},{id:"sink",name:"Sink"},{id:"refrigerator",name:"Refrigerator"},{id:"book",name:"Book"},{id:"clock",name:"Clock"},{id:"vase",name:"Vase"},{id:"scissors",name:"Scissors"},{id:"teddy bear",name:"Teddy Bear"},{id:"hair drier",name:"Hair Drier"},{id:"toothbrush",name:"Toothbrush"}],au=[{id:"person",name:"Person"},{id:"vehicle",name:"Vehicle"},{id:"animal",name:"Animal"}],nu={mapping:{person:"person",bicycle:"vehicle",car:"vehicle",motorcycle:"vehicle",airplane:"vehicle",bus:"vehicle",train:"vehicle",truck:"vehicle",boat:"vehicle",bird:"animal",cat:"animal",dog:"animal",horse:"animal",sheep:"animal",cow:"animal",elephant:"animal",bear:"animal",zebra:"animal",giraffe:"animal"},preserveOriginal:!1},ou={camera:{type:"camera",label:"Camera",icon:"camera"}};class pe{schema;data;persistFn;constructor(s,n,d){this.schema=s,this.data=n,this.persistFn=d}static fromSchema(s,n,d={},l){const m=s.safeParse(d);if(m.success)return new pe(s,m.data,n);const v=new Set;for(const w of m.error.issues){const A=w.path[0];typeof A=="string"&&v.add(A)}const u={...d};for(const w of v)delete u[w];const y=s.safeParse(u);if(l?.({droppedKeys:[...v],issues:m.error.issues}),y.success)return n(y.data).catch(()=>{}),new pe(s,y.data,n);const k=s.parse({});return new pe(s,k,n)}get values(){return this.data}get(s){return this.data[s]}async set(s,n){const d=this.schema.parse({...this.data,[s]:n});this.data=d,await this.persistFn(this.data)}async setAll(s){const n=this.schema.parse({...this.data,...s});this.data=n,await this.persistFn(this.data)}async deleteKey(s){const{[s]:n,...d}=this.data,l=this.schema.parse(d);this.data=l,await this.persistFn(this.data)}entries(){const s=this.schema.shape;return Object.entries(s).map(([n,d])=>({key:n,schema:d,value:this.data[n],description:d.description}))}}class _t{writer;pendingWrites=new Set;slices;schemas=new Map;listeners=new Set;capListeners=new Map;constructor(s,n){this.writer=n,this.slices=new Map;for(const[d,l]of Object.entries(s))l&&typeof l=="object"&&!Array.isArray(l)&&this.slices.set(d,{...l})}static fromInitial(s,n){return new _t(s,n)}installCapSchema(s,n){const d=this.schemas.get(s);if(d){if(d!==n)throw new Error(`[DeviceRuntimeState] capability "${s}" registered a different runtime-state schema; each cap must declare ONE shape across every provider`);return}this.schemas.set(s,n);const l=this.slices.get(s);if(l){const m=n.safeParse(l);m.success?this.slices.set(s,m.data):this.slices.delete(s)}}getCapState(s){const n=this.slices.get(s);if(n)return Object.freeze({...n})}getCapField(s,n){return this.slices.get(s)?.[n]}setCapState(s,n){this.applyCapWrite(s,n,!1)}patchCapState(s,n){this.applyCapWrite(s,n,!0)}applyCapWrite(s,n,d){const l=this.schemas.get(s);if(!l)throw new Error(`[DeviceRuntimeState] no schema registered for cap "${s}" — did the device register it via ctx.registerNativeCap before writing?`);const m=this.slices.get(s)??{},v=d?{...m,...n}:{...n},u=l.parse(v);if(kp(m,u))return;this.slices.set(s,u),this.fireListeners([s]);const y=this.writer(s,{...u}).catch(()=>{});this.pendingWrites.add(y),y.finally(()=>{this.pendingWrites.delete(y)})}fireListeners(s){const n=this.snapshot();for(const d of this.listeners)try{d(s,n)}catch{}for(const d of s){const l=this.capListeners.get(d);if(!l)continue;const m=this.getCapState(d);for(const v of l)try{v(m)}catch{}}}subscribe(s){return this.listeners.add(s),()=>{this.listeners.delete(s)}}subscribeCap(s,n){let d=this.capListeners.get(s);d||(d=new Set,this.capListeners.set(s,d));const l=m=>{n(m)};return d.add(l),()=>{const m=this.capListeners.get(s);m&&(m.delete(l),m.size===0&&this.capListeners.delete(s))}}snapshot(){const s={};for(const[n,d]of this.slices)s[n]=Object.freeze({...d});return Object.freeze(s)}async flush(){if(this.pendingWrites.size===0)return;const s=[...this.pendingWrites];await Promise.allSettled(s)}}function kp(i,s){const n=Object.keys(i),d=Object.keys(s);if(n.length!==d.length)return!1;for(const l of n)if(i[l]!==s[l])return!1;return!0}const at="lastFetchedAt";function su(i){const{runtimeState:s,cap:n,ownDeviceId:d,refresh:l,staleMs:m,empty:v}=i,u=async()=>{const w=s.getCapState(n.name),A=typeof w?.[at]=="number"?w[at]:0;(!w||Date.now()-A>m)&&await l()},y=()=>{const w=s.getCapState(n.name);if(!w)return v();const{[at]:A,...N}=w;return N};return{ensureFresh:u,getStatus:async({deviceId:w})=>{if(w!==d)throw new Error(`${n.name}: deviceId mismatch, expected ${d}, got ${w}`);return await u(),y()}}}const wp={audioMetrics:sn,battery:cn,brightness:rn,cameraStreams:pn,deviceDiscovery:mn,deviceStatus:xt,doorbell:un,featureProbe:Tt,motion:vn,motionTrigger:Sn,motionZones:fn,ptzAutotrack:bn,streamParams:In,switch:kn,zoneAnalytics:wn,zoneRules:An,zones:gn};class iu{id;stableId;type;name;parentDeviceId;role;get online(){return this.runtimeState.getCapState("device-status")?.online??!1}set online(s){this.markOnline(s)}get state(){if(!this._stateProxyCache){const s={},n={get:(d,l)=>{const m=l;if(m in s)return s[m];const v=wp[m];if(!v)return;const u=this.sliceProxy(v);return s[m]=u,u}};this._stateProxyCache=new Proxy(s,n)}return this._stateProxyCache}_stateProxyCache;config;runtimeState;ctx;location;disabled;constructor(s,n,d){if(this.ctx=s,this.id=s.id,this.stableId=s.stableId,this.type=d.type,!s.deviceMeta)throw new Error(`BaseDevice constructor: ctx.deviceMeta is required (id=${s.id} stableId=${s.stableId})`);this.name=s.deviceMeta.name,this.location=s.deviceMeta.location,this.disabled=s.deviceMeta.disabled,this.role=d.role,this.parentDeviceId=s.parentDeviceId;const l=s.persistedConfig??{};this.config=pe.fromSchema(n,w=>s.persistConfig(w),l,({droppedKeys:w,issues:A})=>{s.logger.warn("Device config recovery: dropping invalid persisted fields",{tags:{deviceId:s.id,stableId:s.stableId},meta:{droppedKeys:[...w],firstIssue:A[0]?.message??null}})});let m=null;const v=async(w,A)=>{m||(m=s.fetchDevice(s.id)),await(await m).deviceState.setCapSlice({capName:w,slice:A})},u=s.initialRuntimeState??{};this.runtimeState=_t.fromInitial(u,v),s.bindRuntimeState?.(this.runtimeState),s.registerNativeCap?.(xt,{});const y={online:!1,lastChangedAt:Date.now()};this.runtimeState.setCapState("device-status",y),s.registerNativeCap?.(Tt,{});const k={flags:{},deviceType:null,model:null,channelCount:null,lastProbedAt:0,lastFetchedAt:0};this.runtimeState.setCapState("feature-probe",k)}async removeDevice(){}markOnline(s){if(this.online===s)return;const n={online:s,lastChangedAt:Date.now()};this.runtimeState.setCapState("device-status",n)}async refreshFeatures(){const n=this.ctx.api?.deviceManager?.registerDevice;if(n)try{await n.mutate({addonId:this.ctx.deviceMeta.addonId,stableId:this.stableId,id:this.id,type:this.type,name:this.name,parentDeviceId:this.parentDeviceId,features:[...this.features],config:{}})}catch{}}getCapSlice(s){return this.runtimeState.getCapState(s.name)??null}setCapSlice(s,n){this.runtimeState.setCapState(s.name,n)}sliceProxy(s){const n={},d={get:(l,m)=>this.runtimeState.getCapState(s.name)?.[m],set:(l,m,v)=>(this.runtimeState.patchCapState(s.name,{[m]:v}),!0),has:(l,m)=>{const v=this.runtimeState.getCapState(s.name);return v?m in v:!1},ownKeys:()=>{const l=this.runtimeState.getCapState(s.name);return l?Object.keys(l):[]},getOwnPropertyDescriptor:(l,m)=>{const v=this.runtimeState.getCapState(s.name);if(!(!v||!(m in v)))return{configurable:!0,enumerable:!0,value:v[m]}}};return new Proxy(n,d)}getSettingsUISchema(){return{sections:[]}}async applySettingsPatch(s){await this.config.setAll(s)}async onProbe(){}async onActivate(){}async reprobe(){this._kernelReprobe?await this._kernelReprobe():await this.onProbe()}_kernelReprobe;getAccessoryChildren(){return[]}getProbeFlags(){return this.runtimeState.getCapState("feature-probe")?.flags??{}}hasProbed(){return(this.runtimeState.getCapState("feature-probe")?.lastProbedAt??0)>0}}function Ap(i,s){const n={};for(const d of i.config.entries())n[d.key]=d.value;return{id:i.id,stableId:i.stableId,addonId:s,type:String(i.type),name:i.name,parentDeviceId:i.parentDeviceId,online:i.online,features:[...i.features],config:n}}class cu extends ap{async onInitialize(){return this.ctx.logger.info(`${this.providerName} Provider initialized`),[{capability:Cn,provider:this}]}async onShutdown(){const s=await this.ctx.kernel.devices?.getAll()??[];for(const n of s)try{await this.ctx.kernel.devices?.decommission(n.id)}catch(d){this.ctx.logger.warn(`${this.providerName}: decommission failed`,{tags:{deviceId:n.id,stableId:n.stableId},meta:{error:d instanceof Error?d.message:String(d)}})}this.ctx.logger.info(`${this.providerName} Provider shut down`,{meta:{decommissionedCount:s.length}})}async start(){}async stop(){}async getStatus(){return{connected:!0,deviceCount:(await this.ctx.kernel.devices?.getAll()??[]).length}}async getDevices(){return(await this.ctx.kernel.devices?.getAll()??[]).map(n=>({id:n.stableId,name:n.name,type:String(n.type)}))}async supportsDiscovery(){return!1}async discoverDevices(){return[]}async adoptDiscoveredDevice(s){throw new Error(`${this.providerName} provider does not support discovery-based adoption`)}async supportsManualCreation(){return!0}async getChildCreationSchema(s){return this.onGetCreationSchema(s.type)}async createDevice(s){const n=await this.onCreateDevice(s.type,s.config),d=this.deviceClasses[n.meta.type];if(!d)throw new Error(`${this.providerName} provider: no device class registered for type "${n.meta.type}" — add it to the deviceClasses map`);const l=this.generateStableId(n.meta.type,n.config),m=await this.ctx.kernel.devices.create(l,d,n.config,null,n.meta);if(n.onAfterCreate)try{await n.onAfterCreate(m)}catch(v){this.ctx.logger.warn("createDevice: onAfterCreate hook threw — device is already registered",{tags:{deviceId:m.id,stableId:l},meta:{error:v instanceof Error?v.message:String(v)}})}return this.toSummary(m)}generateStableId(s,n){return`${this.addonId}-${Date.now()}`}async testCreationField(s){return{status:"ok",labels:["probe not implemented"]}}async restoreDevices(s){await this.onRestoreDevices(s),s.length>0&&this.ctx.logger.info(`Restored ${s.length} ${this.providerName} device(s)`)}async onRestoreDevices(s){const n=new Set;for(const l of s){if(l.parentDeviceId!==null)continue;const m=this.deviceClasses[l.type];if(!m){this.ctx.logger.warn("No device class registered for restored type — skipping",{tags:{stableId:l.stableId},meta:{type:l.type}});continue}try{await this.ctx.kernel.devices.create(l.stableId,m,{}),n.add(l.id)}catch(v){this.ctx.logger.warn("Failed to restore device",{tags:{stableId:l.stableId},meta:{type:l.type,error:v instanceof Error?v.message:String(v)}})}}const d=s.filter(l=>l.parentDeviceId!==null);for(const l of d){const m=this.deviceClasses[l.type];if(m&&l.parentDeviceId!==null&&n.has(l.parentDeviceId))try{await this.ctx.kernel.devices.create(l.stableId,m,{},l.parentDeviceId),n.add(l.id)}catch(v){this.ctx.logger.warn("Failed to restore hub-adopted child",{tags:{stableId:l.stableId,parentDeviceId:l.parentDeviceId},meta:{type:l.type,error:v instanceof Error?v.message:String(v)}})}}}toSummary(s){return Ap(s,this.addonId)}}function me(i){return i.def}function ru(i,s="Configuration",n="main"){const d=i.map(l=>Cp(l.key,l.schema,l.description));return{sections:[{id:n,title:s,fields:d}]}}function Cp(i,s,n){const d=Pe(s),l=Ep(s),m=n??Gn(i),v={key:i,label:m,description:n,default:l};return d instanceof io?Np(i,v):d instanceof co?Pp(d,v):d instanceof ro?{...v,type:"boolean"}:d instanceof lo?Mp(d,v):d instanceof po||d instanceof mo?{...v,type:"textarea",rows:6,isJson:!0}:{...v,type:"text"}}function Np(i,s){const n=i.toLowerCase();return n.includes("password")||n.includes("secret")||n.includes("token")||n.includes("apikey")||n.includes("api_key")?{...s,type:"password",showToggle:!0}:{...s,type:"text"}}function Pp(i,s){const n=i,d=n.minValue,l=n.maxValue,m=d!=null&&isFinite(d)?d:void 0,v=l!=null&&isFinite(l)?l:void 0,u=Dp(i);return{...s,type:"number",...m!==void 0?{min:m}:{},...v!==void 0?{max:v}:{},...u!==void 0?{step:u}:{}}}function Dp(i){const n=me(i).checks??[];for(const d of n)if(d._zod?.def?.check==="multiple_of"&&d._zod.def.value!==void 0)return d._zod.def.value}function Mp(i,s){const n=i.options.map(l=>String(l));return{...s,type:"select",options:n.map(l=>({label:Gn(l),value:l}))}}function Pe(i){return i instanceof nn||i instanceof uo||i instanceof go?Pe(me(i).innerType):i}function Ep(i){if(i instanceof nn)return me(i).defaultValue}function Gn(i){return i.replace(/([A-Z])/g," $1").replace(/[_-]/g," ").replace(/^\w/,s=>s.toUpperCase()).trim()}const xp="device.state-changed";function Vn(i){const s=new Map,n=new Map;let d=null;const l=(u,y)=>`${u}:${y}`,m=()=>{d||i.live?.onEvent&&(d=i.live.onEvent.subscribe({category:xp},{onData:u=>{const y=u.data;if(!y||typeof y.deviceId!="number"||typeof y.capName!="string")return;const k=l(y.deviceId,y.capName);s.set(k,y.slice);const w=n.get(k);if(w)for(const A of w)try{A(y.slice)}catch{}}}))},v=()=>{d&&(n.size>0||(d.unsubscribe(),d=null))};return{read(u,y){return s.get(l(u,y))},async refresh(u,y){const k=await i.deviceState.getCapSlice.query({deviceId:u,capName:y}),w=l(u,y);s.set(w,k??void 0);const A=n.get(w);if(A)for(const N of A)try{N(k??void 0)}catch{}},watch(u,y,k){const w=l(u,y);let A=n.get(w);return A||(A=new Set,n.set(w,A)),A.add(k),m(),()=>{A.delete(k),A.size===0&&n.delete(w),v()}},async write(u,y,k){await i.deviceState.setCapSlice.mutate({deviceId:u,capName:y,slice:k})}}}function Tp(i,s,n){const d=(l,m)=>`${l}:${m}`;return{read(l,m){return i.get(l)?.get(m)},async refresh(){},watch(l,m,v){const u=d(l,m);let y=s.get(u);return y||(y=new Set,s.set(u,y)),y.add(v),()=>{y.delete(v),y.size===0&&s.delete(u)}},async write(l,m,v){if(!n)throw new Error("createMirrorSource: write requires an api reference — pass it as the third argument when constructing the source");await n.deviceState.setCapSlice.mutate({deviceId:l,capName:m,slice:v})}}}function M(i,s,n){const d=Rp(i)?i:Vn(i);return{get value(){return d.read(s,n)},refresh(){return d.refresh(s,n)},subscribe(l){const m=d.watch(s,n,v=>{try{l(v)}catch{}});try{l(d.read(s,n))}catch{}return d.read(s,n)===void 0&&d.refresh(s,n).catch(()=>{}),m},async set(l){await d.write(s,n,l)},async patch(l){const v={...d.read(s,n)??{},...l};await d.write(s,n,v)}}}function Rp(i){return typeof i.read=="function"&&typeof i.watch=="function"}function Bp(i,s,n){const d=i,l=n?.stateSource??Vn(i);function m(r,z){const L=typeof r=="object"&&r!==null?r:{};return z!==void 0?{...L,deviceId:s.deviceId,nodeId:z}:{...L,deviceId:s.deviceId}}function v(r,z,L,$,se){const ye=d[r]?.[z];if(!ye)throw new Error(`DeviceProxy: api has no '${r}.${z}'`);const ie=ye;return L==="mutation"?ie.mutate($):L==="subscription"?ie.subscribe($,se):ie.query($)}function u(r,z,L,$,se,ye){const ie=s.entries.find(no=>no.capName===r);return v(z,L,$,m(se,ie?.providerNodeId),ye)}function y(r,z,L,$,se){return v(r,z,L,m($,void 0),se)}const k={getStatus:r=>u("accessories","accessories","getStatus","query",r)},w={resolveDeviceSettings:r=>u("audio-analysis","audioAnalysis","resolveDeviceSettings","query",r),getDeviceSettingsContribution:r=>u("audio-analysis","audioAnalysis","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>u("audio-analysis","audioAnalysis","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>u("audio-analysis","audioAnalysis","applyDeviceSettingsPatch","mutation",r)},A={getCurrentSnapshot:r=>u("audio-metrics","audioMetrics","getCurrentSnapshot","query",r),getHistory:r=>u("audio-metrics","audioMetrics","getHistory","query",r)},N={getStatus:r=>u("battery","battery","getStatus","query",r)},x={setBrightness:r=>u("brightness","brightness","setBrightness","mutation",r),getStatus:r=>u("brightness","brightness","getStatus","query",r)},O={getCredentials:r=>u("camera-credentials","cameraCredentials","getCredentials","query",r),getStatus:r=>u("camera-credentials","cameraCredentials","getStatus","query",r)},j={getCameraStreams:r=>u("camera-streams","cameraStreams","getCameraStreams","query",r),getBrokerStreams:r=>u("camera-streams","cameraStreams","getBrokerStreams","query",r),getRtspEntries:r=>u("camera-streams","cameraStreams","getRtspEntries","query",r)},ae={getDeviceSettingsContribution:r=>u("detection-pipeline","detectionPipeline","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>u("detection-pipeline","detectionPipeline","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>u("detection-pipeline","detectionPipeline","applyDeviceSettingsPatch","mutation",r)},Z={listDiscovered:r=>u("device-discovery","deviceDiscovery","listDiscovered","query",r),refreshDiscovery:r=>u("device-discovery","deviceDiscovery","refreshDiscovery","mutation",r),adoptDevice:r=>u("device-discovery","deviceDiscovery","adoptDevice","mutation",r),releaseDevice:r=>u("device-discovery","deviceDiscovery","releaseDevice","mutation",r),getStatus:r=>u("device-discovery","deviceDiscovery","getStatus","query",r)},Ft={getStreamSources:r=>u("device-ops","deviceOps","getStreamSources","query",r),getConfigEntries:r=>u("device-ops","deviceOps","getConfigEntries","query",r),setConfig:r=>u("device-ops","deviceOps","setConfig","mutation",r),removeDevice:r=>u("device-ops","deviceOps","removeDevice","mutation",r),getSettingsSchema:r=>u("device-ops","deviceOps","getSettingsSchema","query",r)},Ut={getStatus:r=>u("device-status","deviceStatus","getStatus","query",r)},Ht={getStatus:r=>u("doorbell","doorbell","getStatus","query",r)},$t={getEvents:r=>u("events","events","getEvents","query",r),getEventThumbnail:r=>u("events","events","getEventThumbnail","query",r),getEventClipUrl:r=>u("events","events","getEventClipUrl","query",r)},Wt={getStatus:r=>u("feature-probe","featureProbe","getStatus","query",r)},Kt={startSession:r=>u("intercom","intercom","startSession","mutation",r),handleAnswer:r=>u("intercom","intercom","handleAnswer","mutation",r),stopSession:r=>u("intercom","intercom","stopSession","mutation",r),startTalkSession:r=>u("intercom","intercom","startTalkSession","mutation",r),pushTalkPcm:r=>u("intercom","intercom","pushTalkPcm","mutation",r),endTalkSession:r=>u("intercom","intercom","endTalkSession","mutation",r),getStatus:r=>u("intercom","intercom","getStatus","query",r)},Gt={isDetected:r=>u("motion","motion","isDetected","query",r),getStatus:r=>u("motion","motion","getStatus","query",r)},Vt={analyze:r=>u("motion-detection","motionDetection","analyze","mutation",r),removeCamera:r=>u("motion-detection","motionDetection","removeCamera","mutation",r),reset:r=>u("motion-detection","motionDetection","reset","mutation",r),getDeviceSettingsContribution:r=>u("motion-detection","motionDetection","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>u("motion-detection","motionDetection","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>u("motion-detection","motionDetection","applyDeviceSettingsPatch","mutation",r)},jt={setMotionTrigger:r=>u("motion-trigger","motionTrigger","setMotionTrigger","mutation",r),getStatus:r=>u("motion-trigger","motionTrigger","getStatus","query",r)},Zt={getOptions:r=>u("motion-zones","motionZones","getOptions","query",r),setZone:r=>u("motion-zones","motionZones","setZone","mutation",r),getStatus:r=>u("motion-zones","motionZones","getStatus","query",r)},Yt={getStatus:r=>u("native-object-detection","nativeObjectDetection","getStatus","query",r)},Qt={setOverlay:r=>u("osd","osd","setOverlay","mutation",r),getStatus:r=>u("osd","osd","getStatus","query",r)},Jt={getActiveTracks:r=>u("pipeline-analytics","pipelineAnalytics","getActiveTracks","query",r),getTrack:r=>u("pipeline-analytics","pipelineAnalytics","getTrack","query",r),listTracks:r=>u("pipeline-analytics","pipelineAnalytics","listTracks","query",r),clearTracks:r=>u("pipeline-analytics","pipelineAnalytics","clearTracks","mutation",r),getMotionEvents:r=>u("pipeline-analytics","pipelineAnalytics","getMotionEvents","query",r),getObjectEvents:r=>u("pipeline-analytics","pipelineAnalytics","getObjectEvents","query",r),getAudioEvents:r=>u("pipeline-analytics","pipelineAnalytics","getAudioEvents","query",r),getEventMedia:r=>u("pipeline-analytics","pipelineAnalytics","getEventMedia","query",r),getTrackMedia:r=>u("pipeline-analytics","pipelineAnalytics","getTrackMedia","query",r),getDeviceSettingsContribution:r=>u("pipeline-analytics","pipelineAnalytics","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>u("pipeline-analytics","pipelineAnalytics","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>u("pipeline-analytics","pipelineAnalytics","applyDeviceSettingsPatch","mutation",r)},Xt={move:r=>u("ptz","ptz","move","mutation",r),continuousMove:r=>u("ptz","ptz","continuousMove","mutation",r),stop:r=>u("ptz","ptz","stop","mutation",r),getPresets:r=>u("ptz","ptz","getPresets","query",r),goToPreset:r=>u("ptz","ptz","goToPreset","mutation",r),savePreset:r=>u("ptz","ptz","savePreset","mutation",r),deletePreset:r=>u("ptz","ptz","deletePreset","mutation",r),getOptions:r=>u("ptz","ptz","getOptions","query",r),goHome:r=>u("ptz","ptz","goHome","mutation",r),getPosition:r=>u("ptz","ptz","getPosition","query",r),setAutofocus:r=>u("ptz","ptz","setAutofocus","mutation",r),getStatus:r=>u("ptz","ptz","getStatus","query",r)},ea={getStatus:r=>u("ptz-autotrack","ptzAutotrack","getStatus","query",r),setEnabled:r=>u("ptz-autotrack","ptzAutotrack","setEnabled","mutation",r),getSettings:r=>u("ptz-autotrack","ptzAutotrack","getSettings","query",r),setSettings:r=>u("ptz-autotrack","ptzAutotrack","setSettings","mutation",r)},ta={reboot:r=>u("reboot","reboot","reboot","mutation",r)},aa={getSegments:r=>u("recording","recording","getSegments","query",r),getPlaybackUrl:r=>u("recording","recording","getPlaybackUrl","query",r),getThumbnailAt:r=>u("recording","recording","getThumbnailAt","query",r)},na={getSnapshot:r=>u("snapshot","snapshot","getSnapshot","query",r),invalidateCache:r=>u("snapshot","snapshot","invalidateCache","mutation",r),getStatus:r=>u("snapshot","snapshot","getStatus","query",r),getDeviceSettingsContribution:r=>u("snapshot","snapshot","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>u("snapshot","snapshot","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>u("snapshot","snapshot","applyDeviceSettingsPatch","mutation",r)},oa={getOptions:r=>u("stream-params","streamParams","getOptions","query",r),setProfile:r=>u("stream-params","streamParams","setProfile","mutation",r),getConfigSchema:r=>u("stream-params","streamParams","getConfigSchema","query",r),getStatus:r=>u("stream-params","streamParams","getStatus","query",r)},o={setState:r=>u("switch","switch","setState","mutation",r),getStatus:r=>u("switch","switch","getStatus","query",r)},U={listStreams:r=>u("webrtc-session","webrtcSession","listStreams","query",r),createSession:r=>u("webrtc-session","webrtcSession","createSession","mutation",r),handleOffer:r=>u("webrtc-session","webrtcSession","handleOffer","mutation",r),handleAnswer:r=>u("webrtc-session","webrtcSession","handleAnswer","mutation",r),closeSession:r=>u("webrtc-session","webrtcSession","closeSession","mutation",r),hasAdaptiveBitrate:r=>u("webrtc-session","webrtcSession","hasAdaptiveBitrate","query",r)},he={getCurrentSnapshot:r=>u("zone-analytics","zoneAnalytics","getCurrentSnapshot","query",r),getZoneHistory:r=>u("zone-analytics","zoneAnalytics","getZoneHistory","query",r),getCameraHistory:r=>u("zone-analytics","zoneAnalytics","getCameraHistory","query",r),getUnzonedHistory:r=>u("zone-analytics","zoneAnalytics","getUnzonedHistory","query",r)},ne={listRules:r=>u("zone-rules","zoneRules","listRules","query",r),setRules:r=>u("zone-rules","zoneRules","setRules","mutation",r)},qe={listZones:r=>u("zones","zones","listZones","query",r),addZone:r=>u("zones","zones","addZone","mutation",r),removeZone:r=>u("zones","zones","removeZone","mutation",r),updateZone:r=>u("zones","zones","updateZone","mutation",r)},ve={getDeviceSettings:r=>y("addonSettings","getDeviceSettings","query",r),updateDeviceSettings:r=>y("addonSettings","updateDeviceSettings","mutation",r)},oe={getDeviceSettingsContribution:r=>y("deviceExport","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>y("deviceExport","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>y("deviceExport","applyDeviceSettingsPatch","mutation",r)},jn={loadConfig:r=>y("deviceManager","loadConfig","query",r),loadRuntimeState:r=>y("deviceManager","loadRuntimeState","query",r),loadMeta:r=>y("deviceManager","loadMeta","query",r),setName:r=>y("deviceManager","setName","mutation",r),setLocation:r=>y("deviceManager","setLocation","mutation",r),setMetadata:r=>y("deviceManager","setMetadata","mutation",r),setDisabled:r=>y("deviceManager","setDisabled","mutation",r),getDevice:r=>y("deviceManager","getDevice","query",r),getStreamSources:r=>y("deviceManager","getStreamSources","query",r),getConfigSchema:r=>y("deviceManager","getConfigSchema","query",r),getSettingsSchema:r=>y("deviceManager","getSettingsSchema","query",r),updateConfig:r=>y("deviceManager","updateConfig","mutation",r),enable:r=>y("deviceManager","enable","mutation",r),disable:r=>y("deviceManager","disable","mutation",r),remove:r=>y("deviceManager","remove","mutation",r),getStreamProfileMap:r=>y("deviceManager","getStreamProfileMap","query",r),setStreamProfileMap:r=>y("deviceManager","setStreamProfileMap","mutation",r),probeStreams:r=>y("deviceManager","probeStreams","mutation",r),getBindings:r=>y("deviceManager","getBindings","query",r),getAllBindings:r=>y("deviceManager","getAllBindings","query",r),setWrapperActive:r=>y("deviceManager","setWrapperActive","mutation",r),getDeviceSettingsAggregate:r=>y("deviceManager","getDeviceSettingsAggregate","query",r),getDeviceLiveInfoAggregate:r=>y("deviceManager","getDeviceLiveInfoAggregate","query",r),getDeviceAggregate:r=>y("deviceManager","getDeviceAggregate","query",r),updateDeviceField:r=>y("deviceManager","updateDeviceField","mutation",r),updateDeviceFieldsBatch:r=>y("deviceManager","updateDeviceFieldsBatch","mutation",r),testField:r=>y("deviceManager","testField","mutation",r),getDeviceStatusAggregate:r=>y("deviceManager","getDeviceStatusAggregate","query",r)},Zn={getSnapshot:r=>y("deviceState","getSnapshot","query",r),getCapSlice:r=>y("deviceState","getCapSlice","query",r),setCapSlice:r=>y("deviceState","setCapSlice","mutation",r)},Yn={getDeviceStats:r=>y("networkQuality","getDeviceStats","query",r),reportClientStats:r=>y("networkQuality","reportClientStats","mutation",r)},Qn={runPipeline:r=>y("pipelineExecutor","runPipeline","mutation",r),runPipelineBatch:r=>y("pipelineExecutor","runPipelineBatch","mutation",r)},Jn={assignPipeline:r=>y("pipelineOrchestrator","assignPipeline","mutation",r),unassignPipeline:r=>y("pipelineOrchestrator","unassignPipeline","mutation",r),getPipelineAssignment:r=>y("pipelineOrchestrator","getPipelineAssignment","query",r),getCameraMetrics:r=>y("pipelineOrchestrator","getCameraMetrics","query",r),assignDecoder:r=>y("pipelineOrchestrator","assignDecoder","mutation",r),unassignDecoder:r=>y("pipelineOrchestrator","unassignDecoder","mutation",r),assignAudio:r=>y("pipelineOrchestrator","assignAudio","mutation",r),unassignAudio:r=>y("pipelineOrchestrator","unassignAudio","mutation",r),getAudioAssignment:r=>y("pipelineOrchestrator","getAudioAssignment","query",r),getAudioAssignments:r=>y("pipelineOrchestrator","getAudioAssignments","query",r),getDecoderAssignment:r=>y("pipelineOrchestrator","getDecoderAssignment","query",r),getCameraSettings:r=>y("pipelineOrchestrator","getCameraSettings","query",r),setCameraStepToggle:r=>y("pipelineOrchestrator","setCameraStepToggle","mutation",r),getCameraStepOverrides:r=>y("pipelineOrchestrator","getCameraStepOverrides","query",r),setCameraStepOverride:r=>y("pipelineOrchestrator","setCameraStepOverride","mutation",r),setCameraPipelineForAgent:r=>y("pipelineOrchestrator","setCameraPipelineForAgent","mutation",r),resolvePipeline:r=>y("pipelineOrchestrator","resolvePipeline","query",r),getDeviceSettingsContribution:r=>y("pipelineOrchestrator","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>y("pipelineOrchestrator","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>y("pipelineOrchestrator","applyDeviceSettingsPatch","mutation",r)},Xn={detachCamera:r=>y("pipelineRunner","detachCamera","mutation",r),getCameraMetrics:r=>y("pipelineRunner","getCameraMetrics","query",r)},eo={getPolicyStatus:r=>y("recordingEngine","getPolicyStatus","query",r)},to={supportsDevice:r=>y("snapshotProvider","supportsDevice","query",r),getSnapshot:r=>y("snapshotProvider","getSnapshot","query",r)},ao={publishCameraStream:r=>y("streamBroker","publishCameraStream","mutation",r),retractCameraStream:r=>y("streamBroker","retractCameraStream","mutation",r),assignProfile:r=>y("streamBroker","assignProfile","mutation",r),unassignProfile:r=>y("streamBroker","unassignProfile","mutation",r),restartProfile:r=>y("streamBroker","restartProfile","mutation",r),getDeviceSettingsContribution:r=>y("streamBroker","getDeviceSettingsContribution","query",r),getDeviceLiveContribution:r=>y("streamBroker","getDeviceLiveContribution","query",r),applyDeviceSettingsPatch:r=>y("streamBroker","applyDeviceSettingsPatch","mutation",r)};return{deviceId:s.deviceId,binding:s,state:{audioMetrics:M(l,s.deviceId,"audio-metrics"),battery:M(l,s.deviceId,"battery"),brightness:M(l,s.deviceId,"brightness"),cameraStreams:M(l,s.deviceId,"camera-streams"),deviceDiscovery:M(l,s.deviceId,"device-discovery"),deviceStatus:M(l,s.deviceId,"device-status"),doorbell:M(l,s.deviceId,"doorbell"),featureProbe:M(l,s.deviceId,"feature-probe"),motion:M(l,s.deviceId,"motion"),motionTrigger:M(l,s.deviceId,"motion-trigger"),motionZones:M(l,s.deviceId,"motion-zones"),ptzAutotrack:M(l,s.deviceId,"ptz-autotrack"),streamParams:M(l,s.deviceId,"stream-params"),switch:M(l,s.deviceId,"switch"),zoneAnalytics:M(l,s.deviceId,"zone-analytics"),zoneRules:M(l,s.deviceId,"zone-rules"),zones:M(l,s.deviceId,"zones")},accessories:k,audioAnalysis:w,audioMetrics:A,battery:N,brightness:x,cameraCredentials:O,cameraStreams:j,detectionPipeline:ae,deviceDiscovery:Z,deviceOps:Ft,deviceStatus:Ut,doorbell:Ht,events:$t,featureProbe:Wt,intercom:Kt,motion:Gt,motionDetection:Vt,motionTrigger:jt,motionZones:Zt,nativeObjectDetection:Yt,osd:Qt,pipelineAnalytics:Jt,ptz:Xt,ptzAutotrack:ea,reboot:ta,recording:aa,snapshot:na,streamParams:oa,switch:o,webrtcSession:U,zoneAnalytics:he,zoneRules:ne,zones:qe,addonSettings:ve,deviceExport:oe,deviceManager:jn,deviceState:Zn,networkQuality:Yn,pipelineExecutor:Qn,pipelineOrchestrator:Jn,pipelineRunner:Xn,recordingEngine:eo,snapshotProvider:to,streamBroker:ao}}function du(i,s,n,d,l){if(n.length===0||s.length===0)return{passed:i,excluded:[]};const m=n.filter(N=>N.enabled!==!1),v=m.filter(N=>N.mode==="include"),u=m.filter(N=>N.mode==="exclude"),y=v.length>0,k=new Map(s.map(N=>[N.id,N])),w=[],A=[];for(const N of i){const x=d(N),O=l?.(N),j=v.some(Z=>tn(Z,x,O,k)),ae=u.some(Z=>tn(Z,x,O,k));y?j&&!ae?w.push(N):A.push(N):ae?A.push(N):w.push(N)}return{passed:w,excluded:A}}function tn(i,s,n,d){if(i.classFilter&&i.classFilter.length>0&&n!==void 0&&!i.classFilter.includes(n))return!1;for(const l of i.zoneIds){const m=d.get(l);if(m&&qp(s,m.polygon))return!0}return!1}function qp(i,s){if(s.length<3)return!1;let n=!1;const{x:d,y:l}=i;for(let m=0,v=s.length-1;m<s.length;v=m++){const u=s[m],y=s[v];u.y>l!=y.y>l&&d<(y.x-u.x)*(l-u.y)/(y.y-u.y||Number.EPSILON)+u.x&&(n=!n)}return n}function lu(i){const s=i;function n(o,U,he,ne,qe){const ve=s[o]?.[U];if(!ve)throw new Error(`SystemProxy: api has no '${o}.${U}'`);const oe=ve;return he==="mutation"?oe.mutate(ne):he==="subscription"?oe.subscribe(ne,qe):oe.query(ne)}return{addonPages:{listPages:o=>n("addonPages","listPages","query",o)},addons:{list:o=>n("addons","list","query",o),getLogs:o=>n("addons","getLogs","query",o),listPackages:o=>n("addons","listPackages","query",o),installPackage:o=>n("addons","installPackage","mutation",o),installFromWorkspace:o=>n("addons","installFromWorkspace","mutation",o),isWorkspaceAvailable:o=>n("addons","isWorkspaceAvailable","query",o),listWorkspacePackages:o=>n("addons","listWorkspacePackages","query",o),uninstallPackage:o=>n("addons","uninstallPackage","mutation",o),reloadPackages:o=>n("addons","reloadPackages","mutation",o),searchAvailable:o=>n("addons","searchAvailable","query",o),listUpdates:o=>n("addons","listUpdates","query",o),updatePackage:o=>n("addons","updatePackage","mutation",o),rollbackPackage:o=>n("addons","rollbackPackage","mutation",o),forceRefresh:o=>n("addons","forceRefresh","mutation",o),restartServer:o=>n("addons","restartServer","mutation",o),getLastRestart:o=>n("addons","getLastRestart","query",o),listFrameworkPackages:o=>n("addons","listFrameworkPackages","query",o),listCapabilityProviders:o=>n("addons","listCapabilityProviders","query",o),setCapabilityProviderEnabled:o=>n("addons","setCapabilityProviderEnabled","mutation",o),updateFrameworkPackage:o=>n("addons","updateFrameworkPackage","mutation",o),getVersions:o=>n("addons","getVersions","query",o),restartAddon:o=>n("addons","restartAddon","mutation",o),retryLoad:o=>n("addons","retryLoad","mutation",o),getAutoUpdateSettings:o=>n("addons","getAutoUpdateSettings","query",o),setAutoUpdateSettings:o=>n("addons","setAutoUpdateSettings","mutation",o),getAddonAutoUpdate:o=>n("addons","getAddonAutoUpdate","query",o),setAddonAutoUpdate:o=>n("addons","setAddonAutoUpdate","mutation",o),applyAutoUpdateToAll:o=>n("addons","applyAutoUpdateToAll","mutation",o),custom:o=>n("addons","custom","mutation",o),onAddonLogs:(o,U)=>n("addons","onAddonLogs","subscription",o,U)},addonSettings:{getGlobalSettings:o=>n("addonSettings","getGlobalSettings","query",o),updateGlobalSettings:o=>n("addonSettings","updateGlobalSettings","mutation",o)},addonWidgets:{listWidgets:o=>n("addonWidgets","listWidgets","query",o)},alerts:{emit:o=>n("alerts","emit","mutation",o),update:o=>n("alerts","update","mutation",o),list:o=>n("alerts","list","query",o),getUnreadCount:o=>n("alerts","getUnreadCount","query",o),markRead:o=>n("alerts","markRead","mutation",o),markAllRead:o=>n("alerts","markAllRead","mutation",o),dismiss:o=>n("alerts","dismiss","mutation",o)},audioAnalyzer:{analyseChunk:o=>n("audioAnalyzer","analyseChunk","mutation",o),classify:o=>n("audioAnalyzer","classify","query",o),isReady:o=>n("audioAnalyzer","isReady","query",o),dispose:o=>n("audioAnalyzer","dispose","mutation",o),reprobeAudioEngine:o=>n("audioAnalyzer","reprobeAudioEngine","mutation",o)},audioCodec:{listSupportedCodecs:o=>n("audioCodec","listSupportedCodecs","query",o),canHandle:o=>n("audioCodec","canHandle","query",o),createDecodeSession:o=>n("audioCodec","createDecodeSession","mutation",o),createEncodeSession:o=>n("audioCodec","createEncodeSession","mutation",o),closeSession:o=>n("audioCodec","closeSession","mutation",o),pushEncodedFrame:o=>n("audioCodec","pushEncodedFrame","mutation",o),pullPcm:o=>n("audioCodec","pullPcm","query",o),pushPcm:o=>n("audioCodec","pushPcm","mutation",o),pullEncoded:o=>n("audioCodec","pullEncoded","query",o),flushEncode:o=>n("audioCodec","flushEncode","mutation",o),listActiveSessions:o=>n("audioCodec","listActiveSessions","query",o)},backup:{listDestinations:o=>n("backup","listDestinations","query",o),trigger:o=>n("backup","trigger","mutation",o),list:o=>n("backup","list","query",o),listLocations:o=>n("backup","listLocations","query",o),getEntries:o=>n("backup","getEntries","query",o),restore:o=>n("backup","restore","mutation",o),delete:o=>n("backup","delete","mutation",o),listArchives:o=>n("backup","listArchives","query",o),upsertDestinationPolicy:o=>n("backup","upsertDestinationPolicy","mutation",o),previewSchedule:o=>n("backup","previewSchedule","query",o)},decoder:{supportsCodec:o=>n("decoder","supportsCodec","query",o),getInfo:o=>n("decoder","getInfo","query",o),createSession:o=>n("decoder","createSession","query",o),destroySession:o=>n("decoder","destroySession","query",o),pushPacket:o=>n("decoder","pushPacket","query",o),openStream:o=>n("decoder","openStream","query",o),pullFrames:o=>n("decoder","pullFrames","query",o),pullHandles:o=>n("decoder","pullHandles","query",o),getFrame:o=>n("decoder","getFrame","query",o),getShmStats:o=>n("decoder","getShmStats","query",o),updateConfig:o=>n("decoder","updateConfig","query",o),getStats:o=>n("decoder","getStats","query",o),listActiveSessions:o=>n("decoder","listActiveSessions","query",o),reprobeHwaccel:o=>n("decoder","reprobeHwaccel","mutation",o)},deviceExport:{getStatus:o=>n("deviceExport","getStatus","query",o),listSupportedDeviceKinds:o=>n("deviceExport","listSupportedDeviceKinds","query",o),listExposedDevices:o=>n("deviceExport","listExposedDevices","query",o),exposeDevice:o=>n("deviceExport","exposeDevice","mutation",o),unexposeDevice:o=>n("deviceExport","unexposeDevice","mutation",o)},deviceManager:{allocateDeviceId:o=>n("deviceManager","allocateDeviceId","mutation",o),registerDevice:o=>n("deviceManager","registerDevice","mutation",o),removeDevice:o=>n("deviceManager","removeDevice","mutation",o),persistConfig:o=>n("deviceManager","persistConfig","mutation",o),listLocations:o=>n("deviceManager","listLocations","query",o),addLocation:o=>n("deviceManager","addLocation","mutation",o),removeLocation:o=>n("deviceManager","removeLocation","mutation",o),listPersistedByAddon:o=>n("deviceManager","listPersistedByAddon","query",o),listAll:o=>n("deviceManager","listAll","query",o),getChildren:o=>n("deviceManager","getChildren","query",o),listWrappersForCap:o=>n("deviceManager","listWrappersForCap","query",o),listBindableCapsForDeviceType:o=>n("deviceManager","listBindableCapsForDeviceType","query",o),discoverDevices:o=>n("deviceManager","discoverDevices","mutation",o),adoptDevice:o=>n("deviceManager","adoptDevice","mutation",o),getCreationSchema:o=>n("deviceManager","getCreationSchema","query",o),createDevice:o=>n("deviceManager","createDevice","mutation",o),testCreationField:o=>n("deviceManager","testCreationField","mutation",o)},deviceProvider:{start:o=>n("deviceProvider","start","mutation",o),stop:o=>n("deviceProvider","stop","mutation",o),getStatus:o=>n("deviceProvider","getStatus","query",o),getDevices:o=>n("deviceProvider","getDevices","query",o),supportsDiscovery:o=>n("deviceProvider","supportsDiscovery","query",o),discoverDevices:o=>n("deviceProvider","discoverDevices","mutation",o),adoptDiscoveredDevice:o=>n("deviceProvider","adoptDiscoveredDevice","mutation",o),supportsManualCreation:o=>n("deviceProvider","supportsManualCreation","query",o),getChildCreationSchema:o=>n("deviceProvider","getChildCreationSchema","query",o),createDevice:o=>n("deviceProvider","createDevice","mutation",o),testCreationField:o=>n("deviceProvider","testCreationField","mutation",o)},deviceState:{getAllSnapshots:o=>n("deviceState","getAllSnapshots","query",o)},integrations:{list:o=>n("integrations","list","query",o),get:o=>n("integrations","get","query",o),getByAddonId:o=>n("integrations","getByAddonId","query",o),create:o=>n("integrations","create","mutation",o),update:o=>n("integrations","update","mutation",o),delete:o=>n("integrations","delete","mutation",o),getSettings:o=>n("integrations","getSettings","query",o),setSettings:o=>n("integrations","setSettings","mutation",o),getAvailableTypes:o=>n("integrations","getAvailableTypes","query",o),testConnection:o=>n("integrations","testConnection","mutation",o)},localNetwork:{list:o=>n("localNetwork","list","query",o),getPreferred:o=>n("localNetwork","getPreferred","query",o),getConnectionEndpoints:o=>n("localNetwork","getConnectionEndpoints","query",o),getAllowedAddresses:o=>n("localNetwork","getAllowedAddresses","query",o),setAllowedAddresses:o=>n("localNetwork","setAllowedAddresses","mutation",o),resetAllowlistToBestMatch:o=>n("localNetwork","resetAllowlistToBestMatch","mutation",o)},meshNetwork:{getStatus:o=>n("meshNetwork","getStatus","query",o),join:o=>n("meshNetwork","join","mutation",o),startLogin:o=>n("meshNetwork","startLogin","mutation",o),leave:o=>n("meshNetwork","leave","mutation",o),logout:o=>n("meshNetwork","logout","mutation",o),listPeers:o=>n("meshNetwork","listPeers","query",o),testConnection:o=>n("meshNetwork","testConnection","mutation",o)},metricsProvider:{collectSnapshot:o=>n("metricsProvider","collectSnapshot","query",o),getCached:o=>n("metricsProvider","getCached","query",o),getCurrent:o=>n("metricsProvider","getCurrent","query",o),getDiskSpace:o=>n("metricsProvider","getDiskSpace","query",o),getGpuInfo:o=>n("metricsProvider","getGpuInfo","query",o),getCpuTemperature:o=>n("metricsProvider","getCpuTemperature","query",o),getProcessStats:o=>n("metricsProvider","getProcessStats","query",o),listAddonInstances:o=>n("metricsProvider","listAddonInstances","query",o),getAddonStats:o=>n("metricsProvider","getAddonStats","query",o),listNodeProcesses:o=>n("metricsProvider","listNodeProcesses","query",o),killProcess:o=>n("metricsProvider","killProcess","mutation",o)},mqttBroker:{listBrokers:o=>n("mqttBroker","listBrokers","query",o),getBrokerConfig:o=>n("mqttBroker","getBrokerConfig","query",o),addBroker:o=>n("mqttBroker","addBroker","mutation",o),removeBroker:o=>n("mqttBroker","removeBroker","mutation",o),testConnection:o=>n("mqttBroker","testConnection","mutation",o),startEmbeddedBroker:o=>n("mqttBroker","startEmbeddedBroker","mutation",o),stopEmbeddedBroker:o=>n("mqttBroker","stopEmbeddedBroker","mutation",o),getStatus:o=>n("mqttBroker","getStatus","query",o)},networkAccess:{start:o=>n("networkAccess","start","mutation",o),stop:o=>n("networkAccess","stop","mutation",o),getEndpoint:o=>n("networkAccess","getEndpoint","query",o),getStatus:o=>n("networkAccess","getStatus","query",o),listEndpoints:o=>n("networkAccess","listEndpoints","query",o)},networkQuality:{getAllStats:o=>n("networkQuality","getAllStats","query",o)},nodes:{topology:o=>n("nodes","topology","query",o),deployAddon:o=>n("nodes","deployAddon","mutation",o),undeployAddon:o=>n("nodes","undeployAddon","mutation",o),restartAddon:o=>n("nodes","restartAddon","mutation",o),restartProcess:o=>n("nodes","restartProcess","mutation",o),restartNode:o=>n("nodes","restartNode","mutation",o),shutdownNode:o=>n("nodes","shutdownNode","mutation",o),renameNode:o=>n("nodes","renameNode","mutation",o),clusterAddonStatus:o=>n("nodes","clusterAddonStatus","query",o),getCapUsageGraph:o=>n("nodes","getCapUsageGraph","query",o),getNodeAddons:o=>n("nodes","getNodeAddons","query",o),setProcessLogLevel:o=>n("nodes","setProcessLogLevel","mutation",o),executeQuery:o=>n("nodes","executeQuery","mutation",o)},notificationOutput:{send:o=>n("notificationOutput","send","mutation",o),sendTest:o=>n("notificationOutput","sendTest","mutation",o)},pipelineExecutor:{getAvailableEngines:o=>n("pipelineExecutor","getAvailableEngines","query",o),getSelectedEngine:o=>n("pipelineExecutor","getSelectedEngine","query",o),getDefaultSteps:o=>n("pipelineExecutor","getDefaultSteps","query",o),reprobeEngine:o=>n("pipelineExecutor","reprobeEngine","mutation",o),getVideoPipelineSteps:o=>n("pipelineExecutor","getVideoPipelineSteps","query",o),setVideoPipelineSteps:o=>n("pipelineExecutor","setVideoPipelineSteps","mutation",o),getSchema:o=>n("pipelineExecutor","getSchema","query",o),getGlobalSteps:o=>n("pipelineExecutor","getGlobalSteps","query",o),getGlobalPipelineConfig:o=>n("pipelineExecutor","getGlobalPipelineConfig","query",o),getOrchestratorConfigSchema:o=>n("pipelineExecutor","getOrchestratorConfigSchema","query",o),listTemplates:o=>n("pipelineExecutor","listTemplates","query",o),saveTemplate:o=>n("pipelineExecutor","saveTemplate","mutation",o),updateTemplate:o=>n("pipelineExecutor","updateTemplate","mutation",o),deleteTemplate:o=>n("pipelineExecutor","deleteTemplate","mutation",o),getCapabilities:o=>n("pipelineExecutor","getCapabilities","query",o),getAddonModels:o=>n("pipelineExecutor","getAddonModels","query",o),downloadModel:o=>n("pipelineExecutor","downloadModel","mutation",o),deleteModel:o=>n("pipelineExecutor","deleteModel","mutation",o),detect:o=>n("pipelineExecutor","detect","query",o),cacheFrameInPool:o=>n("pipelineExecutor","cacheFrameInPool","mutation",o),inferCached:o=>n("pipelineExecutor","inferCached","mutation",o),uncacheFrame:o=>n("pipelineExecutor","uncacheFrame","mutation",o),getEffectiveTuning:o=>n("pipelineExecutor","getEffectiveTuning","query",o),listLoadedEngines:o=>n("pipelineExecutor","listLoadedEngines","query",o),spinEngine:o=>n("pipelineExecutor","spinEngine","mutation",o),killEngine:o=>n("pipelineExecutor","killEngine","mutation",o),listReferenceImages:o=>n("pipelineExecutor","listReferenceImages","query",o),getReferenceImage:o=>n("pipelineExecutor","getReferenceImage","query",o),getReferenceAudioFiles:o=>n("pipelineExecutor","getReferenceAudioFiles","query",o),getReferenceAudio:o=>n("pipelineExecutor","getReferenceAudio","query",o),getAudioCapabilities:o=>n("pipelineExecutor","getAudioCapabilities","query",o),runAudioTest:o=>n("pipelineExecutor","runAudioTest","mutation",o),getDetectionConfigSchema:o=>n("pipelineExecutor","getDetectionConfigSchema","query",o)},pipelineOrchestrator:{rebalance:o=>n("pipelineOrchestrator","rebalance","mutation",o),getPipelineAssignments:o=>n("pipelineOrchestrator","getPipelineAssignments","query",o),getAgentLoad:o=>n("pipelineOrchestrator","getAgentLoad","query",o),getGlobalMetrics:o=>n("pipelineOrchestrator","getGlobalMetrics","query",o),getCapabilityBindings:o=>n("pipelineOrchestrator","getCapabilityBindings","query",o),setCapabilityBinding:o=>n("pipelineOrchestrator","setCapabilityBinding","mutation",o),getDecoderAssignments:o=>n("pipelineOrchestrator","getDecoderAssignments","query",o),getAudioNodeLoad:o=>n("pipelineOrchestrator","getAudioNodeLoad","query",o),getAgentSettings:o=>n("pipelineOrchestrator","getAgentSettings","query",o),listAgentSettings:o=>n("pipelineOrchestrator","listAgentSettings","query",o),setAgentAddonDefaults:o=>n("pipelineOrchestrator","setAgentAddonDefaults","mutation",o),removeAgentSettings:o=>n("pipelineOrchestrator","removeAgentSettings","mutation",o),listTemplates:o=>n("pipelineOrchestrator","listTemplates","query",o),saveTemplate:o=>n("pipelineOrchestrator","saveTemplate","mutation",o),updateTemplate:o=>n("pipelineOrchestrator","updateTemplate","mutation",o),deleteTemplate:o=>n("pipelineOrchestrator","deleteTemplate","mutation",o)},pipelineRunner:{attachCamera:o=>n("pipelineRunner","attachCamera","mutation",o),reportMotion:o=>n("pipelineRunner","reportMotion","mutation",o),getLocalLoad:o=>n("pipelineRunner","getLocalLoad","query",o),getLocalMetrics:o=>n("pipelineRunner","getLocalMetrics","query",o),getAllCameraMetrics:o=>n("pipelineRunner","getAllCameraMetrics","query",o),getLocalCameras:o=>n("pipelineRunner","getLocalCameras","query",o)},platformProbe:{getCapabilities:o=>n("platformProbe","getCapabilities","query",o),getHardware:o=>n("platformProbe","getHardware","query",o),resolveInferenceConfig:o=>n("platformProbe","resolveInferenceConfig","query",o),resolveHwAccel:o=>n("platformProbe","resolveHwAccel","query",o),getHardwareEncoders:o=>n("platformProbe","getHardwareEncoders","query",o),refreshHardwareEncoders:o=>n("platformProbe","refreshHardwareEncoders","mutation",o)},recordingEngine:{getStatus:o=>n("recordingEngine","getStatus","query",o),enable:o=>n("recordingEngine","enable","mutation",o),disable:o=>n("recordingEngine","disable","mutation",o),getConfig:o=>n("recordingEngine","getConfig","query",o),updateConfig:o=>n("recordingEngine","updateConfig","mutation",o),getPlaylist:o=>n("recordingEngine","getPlaylist","query",o),getThumbnail:o=>n("recordingEngine","getThumbnail","query",o),getSegments:o=>n("recordingEngine","getSegments","query",o),getAvailability:o=>n("recordingEngine","getAvailability","query",o),estimateStorage:o=>n("recordingEngine","estimateStorage","query",o),estimateGlobalStorage:o=>n("recordingEngine","estimateGlobalStorage","query",o),getStorageUsage:o=>n("recordingEngine","getStorageUsage","query",o),setPolicy:o=>n("recordingEngine","setPolicy","mutation",o),getPolicy:o=>n("recordingEngine","getPolicy","query",o),getRetentionConfig:o=>n("recordingEngine","getRetentionConfig","query",o),updateRetentionConfig:o=>n("recordingEngine","updateRetentionConfig","mutation",o),getMotionStats:o=>n("recordingEngine","getMotionStats","query",o)},settingsStore:{get:o=>n("settingsStore","get","query",o),set:o=>n("settingsStore","set","mutation",o),query:o=>n("settingsStore","query","query",o),insert:o=>n("settingsStore","insert","mutation",o),update:o=>n("settingsStore","update","mutation",o),delete:o=>n("settingsStore","delete","mutation",o),count:o=>n("settingsStore","count","query",o),isEmpty:o=>n("settingsStore","isEmpty","query",o),declareCollection:o=>n("settingsStore","declareCollection","mutation",o)},storage:{resolve:o=>n("storage","resolve","query",o),write:o=>n("storage","write","mutation",o),read:o=>n("storage","read","query",o),exists:o=>n("storage","exists","query",o),list:o=>n("storage","list","query",o),delete:o=>n("storage","delete","mutation",o),getAvailableSpace:o=>n("storage","getAvailableSpace","query",o),beginUpload:o=>n("storage","beginUpload","mutation",o),writeChunk:o=>n("storage","writeChunk","mutation",o),finalizeUpload:o=>n("storage","finalizeUpload","mutation",o),abortUpload:o=>n("storage","abortUpload","mutation",o),beginDownload:o=>n("storage","beginDownload","mutation",o),readChunk:o=>n("storage","readChunk","query",o),endDownload:o=>n("storage","endDownload","mutation",o),listLocations:o=>n("storage","listLocations","query",o),getDefaultLocation:o=>n("storage","getDefaultLocation","query",o),upsertLocation:o=>n("storage","upsertLocation","mutation",o),deleteLocation:o=>n("storage","deleteLocation","mutation",o),testLocation:o=>n("storage","testLocation","query",o),listProviders:o=>n("storage","listProviders","query",o),testConfig:o=>n("storage","testConfig","query",o)},streamBroker:{listAllCameraStreams:o=>n("streamBroker","listAllCameraStreams","query",o),listAllProfileSlots:o=>n("streamBroker","listAllProfileSlots","query",o),getBrokerStats:o=>n("streamBroker","getBrokerStats","query",o),listClients:o=>n("streamBroker","listClients","query",o),killClient:o=>n("streamBroker","killClient","mutation",o),getStreamUrl:o=>n("streamBroker","getStreamUrl","query",o),getStreamWithCodec:o=>n("streamBroker","getStreamWithCodec","mutation",o),releaseStreamWithCodec:o=>n("streamBroker","releaseStreamWithCodec","mutation",o),subscribeAudioChunks:o=>n("streamBroker","subscribeAudioChunks","mutation",o),pullAudioChunks:o=>n("streamBroker","pullAudioChunks","query",o),unsubscribeAudioChunks:o=>n("streamBroker","unsubscribeAudioChunks","mutation",o),subscribeFrames:o=>n("streamBroker","subscribeFrames","mutation",o),pullFrameHandles:o=>n("streamBroker","pullFrameHandles","query",o),unsubscribeFrames:o=>n("streamBroker","unsubscribeFrames","mutation",o),setPreBufferDuration:o=>n("streamBroker","setPreBufferDuration","mutation",o),getPreBufferInfo:o=>n("streamBroker","getPreBufferInfo","query",o),getRtspPort:o=>n("streamBroker","getRtspPort","query",o),getAllRtspEntries:o=>n("streamBroker","getAllRtspEntries","query",o),getRtspEntry:o=>n("streamBroker","getRtspEntry","query",o),regenerateRtspToken:o=>n("streamBroker","regenerateRtspToken","mutation",o),setRtspEnabled:o=>n("streamBroker","setRtspEnabled","mutation",o),isRtspEnabled:o=>n("streamBroker","isRtspEnabled","query",o)},system:{info:o=>n("system","info","query",o),health:o=>n("system","health","query",o),featureFlags:o=>n("system","featureFlags","query",o),networkAddresses:o=>n("system","networkAddresses","query",o),getRetentionConfig:o=>n("system","getRetentionConfig","query",o),setRetentionConfig:o=>n("system","setRetentionConfig","mutation",o),forceRetentionCleanup:o=>n("system","forceRetentionCleanup","mutation",o)},toast:{onToast:(o,U)=>n("toast","onToast","subscription",o,U)},turnProvider:{getTurnServers:o=>n("turnProvider","getTurnServers","query",o)},userManagement:{listUsers:o=>n("userManagement","listUsers","query",o),createUser:o=>n("userManagement","createUser","mutation",o),updateUser:o=>n("userManagement","updateUser","mutation",o),deleteUser:o=>n("userManagement","deleteUser","mutation",o),resetPassword:o=>n("userManagement","resetPassword","mutation",o),setUserScopes:o=>n("userManagement","setUserScopes","mutation",o),validateCredentials:o=>n("userManagement","validateCredentials","mutation",o),listApiKeys:o=>n("userManagement","listApiKeys","query",o),createApiKey:o=>n("userManagement","createApiKey","mutation",o),revokeApiKey:o=>n("userManagement","revokeApiKey","mutation",o),validateApiKey:o=>n("userManagement","validateApiKey","mutation",o),createScopedToken:o=>n("userManagement","createScopedToken","mutation",o),revokeScopedToken:o=>n("userManagement","revokeScopedToken","mutation",o),validateScopedToken:o=>n("userManagement","validateScopedToken","query",o),listScopedTokens:o=>n("userManagement","listScopedTokens","query",o),setupTotp:o=>n("userManagement","setupTotp","mutation",o),confirmTotp:o=>n("userManagement","confirmTotp","mutation",o),disableTotp:o=>n("userManagement","disableTotp","mutation",o),getTotpStatus:o=>n("userManagement","getTotpStatus","query",o),verifyTotp:o=>n("userManagement","verifyTotp","mutation",o),oauthIssueCode:o=>n("userManagement","oauthIssueCode","mutation",o),oauthExchangeCode:o=>n("userManagement","oauthExchangeCode","mutation",o),oauthRefresh:o=>n("userManagement","oauthRefresh","mutation",o),oauthVerifyAccessToken:o=>n("userManagement","oauthVerifyAccessToken","query",o),listOauthSessions:o=>n("userManagement","listOauthSessions","query",o),revokeOauthSession:o=>n("userManagement","revokeOauthSession","mutation",o)}}}const Op="device.state-changed",zp="capability.binding-changed",Lp="device.registered",_p="device.unregistered",Fp="device.updated";class pu{constructor(s){this.api=s,this.stateSource=Tp(this.stateMirror,this.handleListeners,this.api)}stateMirror=new Map;bindings=new Map;devices=new Map;handleListeners=new Map;globalStateListeners=new Set;capListeners=new Map;deviceListeners=new Map;addedListeners=new Set;removedListeners=new Set;pendingWaits=new Set;stateSource;bridges=[];initialized=!1;initPromise=null;async init(s=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{const n=(v,u)=>Number.isFinite(s)?new Promise((y,k)=>{const w=setTimeout(()=>k(new Error(`SystemMirror.init: '${u}' timed out after ${s}ms`)),s);v.then(A=>{clearTimeout(w),y(A)},A=>{clearTimeout(w),k(A)})}):v,[d,l,m]=await Promise.all([n(this.api.deviceManager.getAllBindings.query({}),"deviceManager.getAllBindings"),n(this.api.deviceState.getAllSnapshots.query({}),"deviceState.getAllSnapshots"),n(this.api.deviceManager.listAll.query({}),"deviceManager.listAll")]);for(const v of d)this.bindings.set(v.deviceId,v);for(const[v,u]of Object.entries(l)){const y=Number(v);if(!Number.isFinite(y))continue;const k=new Map;for(const[w,A]of Object.entries(u))k.set(w,A);this.stateMirror.set(y,k)}for(const v of m)this.devices.set(v.id,v);try{this.subscribeBus()}catch{}this.initialized=!0})();try{await this.initPromise}finally{this.initPromise=null}}}isReady(){return this.initialized}async awaitReady(){if(!this.initialized)return this.initPromise?this.initPromise:this.init()}dispose(){for(const s of this.bridges)try{s.unsubscribe()}catch{}this.bridges=[],this.handleListeners.clear(),this.globalStateListeners.clear(),this.capListeners.clear(),this.deviceListeners.clear(),this.addedListeners.clear(),this.removedListeners.clear(),this.pendingWaits.clear(),this.initialized=!1}getDeviceById(s){const n=this.bindings.get(s);return n?Bp(this.api,n,{stateSource:this.stateSource}):null}getDeviceByName(s){for(const n of this.devices.values())if(n.name===s)return this.getDeviceById(n.id);return null}getDeviceByStableId(s){for(const n of this.devices.values())if(n.stableId===s)return this.getDeviceById(n.id);return null}getDevicesByAddon(s){return this.query({addonId:s})}getDevicesByType(s){return this.query({type:s})}getDeviceInfo(s){return this.devices.get(s)??null}getAllDevices(){const s=[];for(const n of this.bindings.keys()){const d=this.getDeviceById(n);d&&s.push(d)}return s}filterByCap(s){return this.query({caps:s})}query(s={}){const n=[];for(const[d,l]of this.bindings){const m=this.devices.get(d);if(s.id!==void 0&&!Ie(d,s.id)||s.stableId!==void 0&&(!m||!Ie(m.stableId,s.stableId))||s.addonId!==void 0&&(!m||!Ie(m.addonId,s.addonId))||s.type!==void 0&&(!m||!Ie(m.type,s.type)))continue;if(s.caps!==void 0){const u=nt(s.caps),y=new Set(l.entries.map(k=>k.capName));if(!u.every(k=>y.has(k)))continue}if(s.anyCap!==void 0){const u=nt(s.anyCap),y=new Set(l.entries.map(k=>k.capName));if(!u.some(k=>y.has(k)))continue}if(s.name!==void 0&&(!m||!Up(m.name,s.name))||s.online!==void 0&&(!m||m.online!==s.online))continue;if(s.parentDeviceId!==void 0){if(!m)continue;const u=s.parentDeviceId;if((m.parentDeviceId??null)!==u)continue}if(s.feature!==void 0&&(!m||!nt(s.feature).every(y=>m.features.includes(y)))||s.isCamera!==void 0&&(!m||m.isCamera!==s.isCamera))continue;const v=this.getDeviceById(d);if(v){if(s.where&&m){if(!s.where(m,v))continue}else if(s.where&&!m)continue;n.push(v)}}return n}whereState(s,n){const d=[];for(const[l,m]of this.stateMirror){const v=m.get(s);if(!v||!n(v,l))continue;const u=this.getDeviceById(l);u&&d.push(u)}return d}mapState(s,n){const d=[];for(const[l,m]of this.stateMirror){const v=m.get(s);v&&d.push(n(v,l))}return d}findState(s,n){for(const[d,l]of this.stateMirror){const m=l.get(s);if(m&&n(m,d))return this.getDeviceById(d)}return null}countByCap(s){let n=0;for(const d of this.bindings.values())d.entries.some(l=>l.capName===s)&&n++;return n}countByState(s,n){let d=0;for(const[l,m]of this.stateMirror){const v=m.get(s);v&&n(v,l)&&d++}return d}listen(s){return this.globalStateListeners.add(s),()=>{this.globalStateListeners.delete(s)}}listenCap(s,n){let d=this.capListeners.get(s);return d||(d=new Set,this.capListeners.set(s,d)),d.add(n),()=>{d.delete(n),d.size===0&&this.capListeners.delete(s)}}listenDevice(s,n){let d=this.deviceListeners.get(s);return d||(d=new Set,this.deviceListeners.set(s,d)),d.add(n),()=>{d.delete(n),d.size===0&&this.deviceListeners.delete(s)}}onDeviceAdded(s){return this.addedListeners.add(s),()=>{this.addedListeners.delete(s)}}onDeviceRemoved(s){return this.removedListeners.add(s),()=>{this.removedListeners.delete(s)}}waitForState(s,n,d,l=3e4){return new Promise((m,v)=>{const y=(()=>{const A=this.stateMirror.get(s)?.get(n);return A&&d(A)?A:null})();if(y){m(y);return}let k=null;const w=this.listenDevice(s,(A,N,x)=>{N===n&&x&&d(x)&&(k&&clearTimeout(k),w(),m(x))});Number.isFinite(l)&&(k=setTimeout(()=>{w(),v(new Error(`waitForState timed out after ${l}ms (deviceId=${s}, capName=${n})`))},l))})}waitForDevice(s,n=3e4){return new Promise((d,l)=>{const m=this.getDeviceById(s);if(m){d(m);return}let v=null;const u=this.onDeviceAdded(y=>{if(y!==s)return;const k=this.getDeviceById(y);k&&(v&&clearTimeout(v),u(),d(k))});Number.isFinite(n)&&(v=setTimeout(()=>{u(),l(new Error(`waitForDevice timed out after ${n}ms (deviceId=${s})`))},n))})}async forEachCap(s,n){for(const d of this.filterByCap(s))await n(d)}async invokeCap(s,n,d,l={}){const m=this.filterByCap(s),v=Math.max(1,l.parallelism??m.length),u=[];for(let y=0;y<m.length;y+=v){const k=m.slice(y,y+v),w=await Promise.allSettled(k.map(async A=>{const N=A[s];if(!N||typeof N[n]!="function")throw new Error(`device '${A.deviceId}' does not expose '${s}.${n}'`);return await N[n](d)}));for(let A=0;A<w.length;A++){const N=k[A],x=w[A];x.status==="fulfilled"?u.push({deviceId:N.deviceId,ok:!0,result:x.value}):u.push({deviceId:N.deviceId,ok:!1,error:x.reason})}}return u}summary(){const s={},n={},d={};let l=0,m=0;for(const v of this.bindings.values())for(const u of v.entries)s[u.capName]=(s[u.capName]??0)+1;for(const v of this.devices.values())n[v.addonId]=(n[v.addonId]??0)+1,d[v.type]=(d[v.type]??0)+1,v.online?l++:m++;return{totalDevices:this.bindings.size,online:l,offline:m,byCap:s,byAddon:n,byType:d,statedDevices:this.stateMirror.size}}dump(s){const n=l=>{const m=this.devices.get(l)??null,v=this.bindings.get(l)??null,u={},y=this.stateMirror.get(l);if(y)for(const[k,w]of y)u[k]={...w};return{deviceId:l,info:m,binding:v?{...v,entries:v.entries.map(k=>({...k}))}:null,state:u}};if(s!==void 0)return n(s);const d=[];for(const l of this.bindings.keys())d.push(n(l));return d}getRawMirror(){return this.stateMirror}getSystemState(){const s=new Map;for(const[n,d]of this.stateMirror){const l=new Map;for(const[m,v]of d)l.set(m,{...v});s.set(n,l)}return s}subscribeBus(){if(!this.api.live?.onEvent)return;const s=this.api.live.onEvent;this.bridges.push(s.subscribe({category:Op},{onData:n=>{const d=n.data;!d||typeof d.deviceId!="number"||typeof d.capName!="string"||this.applyStateUpdate(d.deviceId,d.capName,d.slice)}})),this.bridges.push(s.subscribe({category:zp},{onData:n=>{const d=n.data,l=typeof d?.deviceId=="number"?d.deviceId:d?.source?.type==="device"&&typeof d.source.id=="number"?d.source.id:null;l!==null&&this.refreshBinding(l)}})),this.bridges.push(s.subscribe({category:Lp},{onData:n=>{const d=n.data;typeof d?.deviceId=="number"&&this.refreshDeviceMetadata(d.deviceId,"added")}})),this.bridges.push(s.subscribe({category:_p},{onData:n=>{const d=n.data;typeof d?.deviceId=="number"&&this.applyDeviceRemoval(d.deviceId)}})),this.bridges.push(s.subscribe({category:Fp},{onData:n=>{const d=n.data;typeof d?.deviceId=="number"&&this.refreshDeviceMetadata(d.deviceId,"updated")}}))}applyStateUpdate(s,n,d){let l=this.stateMirror.get(s);l||(l=new Map,this.stateMirror.set(s,l)),d===void 0?l.delete(n):l.set(n,d);const m=`${s}:${n}`,v=this.handleListeners.get(m);if(v)for(const k of v)try{k(d)}catch{}for(const k of this.globalStateListeners)try{k(s,n,d)}catch{}const u=this.capListeners.get(n);if(u)for(const k of u)try{k(s,d)}catch{}const y=this.deviceListeners.get(s);if(y)for(const k of y)try{k(s,n,d)}catch{}}applyDeviceRemoval(s){const n=this.devices.get(s)??null;this.bindings.delete(s),this.devices.delete(s),this.stateMirror.delete(s);for(const d of this.removedListeners)try{d(s,n)}catch{}}async refreshBinding(s){try{const d=(await this.api.deviceManager.getAllBindings.query({})).find(l=>l.deviceId===s);d?this.bindings.set(s,d):this.applyDeviceRemoval(s)}catch{}}async refreshDeviceMetadata(s,n){try{const l=(await this.api.deviceManager.listAll.query({})).find(v=>v.id===s);if(!l)return;const m=!this.devices.has(s);if(this.devices.set(s,l),n==="added"&&m){await this.refreshBinding(s);for(const v of this.addedListeners)try{v(s,l)}catch{}}}catch{}}}function Ie(i,s){return Array.isArray(s)?s.includes(i):i===s}function nt(i){return Array.isArray(i)?i:[i]}function Up(i,s){return typeof s=="string"?i===s:s instanceof RegExp?s.test(i):"exact"in s?i===s.exact:"contains"in s?i.toLowerCase().includes(s.contains.toLowerCase()):!1}function mu(i){return i}function uu(i,s,n){return{input:i,output:s,kind:n?.kind??"query",auth:n?.auth??"protected",scope:n?.scope??{kind:"system"}}}const Hp=[{profile:"main",prefix:"streamMain",label:"Main stream"},{profile:"sub",prefix:"streamSub",label:"Sub stream"},{profile:"ext",prefix:"streamExt",label:"Third stream"}];function $p(i,s,n){const d=[];if(s.resolutions.length>0){const l=s.resolutions.map(v=>({value:`${String(v.width)}x${String(v.height)}`,label:`${String(v.width)}×${String(v.height)}`})),m=n?`${String(n.width)}x${String(n.height)}`:void 0;m&&!l.some(v=>v.value===m)&&l.unshift({value:m,label:`${m.replace("x","×")} (current)`}),d.push({type:"select",key:`${i.prefix}_resolution`,label:"Resolution",options:l,default:m??l[0]?.value??""})}if(s.codecs.length>0&&d.push({type:"select",key:`${i.prefix}_codec`,label:"Codec",options:s.codecs.map(l=>({value:l,label:l==="h264"?"H.264":"H.265"})),default:n?.codec??s.codecs[0]}),s.framerates.length>0){const l=s.framerates.map(v=>({value:String(v),label:`${String(v)} fps`})),m=n?.framerate;m!==void 0&&!s.framerates.includes(m)&&l.unshift({value:String(m),label:`${String(m)} fps (current)`}),d.push({type:"select",key:`${i.prefix}_framerate`,label:"Frame rate",options:l,default:m!==void 0?String(m):l[0]?.value??""})}if(s.bitrates.length>0){const l=s.bitrates.map(v=>({value:String(v),label:`${String(v)} kbps`})),m=n?.bitrate;m!==void 0&&!s.bitrates.includes(m)&&l.unshift({value:String(m),label:`${String(m)} kbps (current)`}),d.push({type:"select",key:`${i.prefix}_bitrate`,label:"Bitrate",options:l,default:m!==void 0?String(m):l[0]?.value??""})}else{const l=s.bitrateRange;d.push({type:"number",key:`${i.prefix}_bitrate`,label:"Bitrate",unit:"kbps",...l?{min:l[0],max:l[1]}:{},default:n?.bitrate??l?.[0]??0})}if(s.supportsBitrateMode&&d.push({type:"select",key:`${i.prefix}_bitrateMode`,label:"Bitrate mode",options:[{value:"vbr",label:"VBR (variable)"},{value:"cbr",label:"CBR (constant)"}],default:n?.bitrateMode??"vbr"}),s.supportsEncoderProfile&&d.push({type:"select",key:`${i.prefix}_encoderProfile`,label:"Encoder profile",options:[{value:"baseline",label:"Baseline"},{value:"main",label:"Main"},{value:"high",label:"High"}],default:n?.encoderProfile??"main"}),s.supportsGop){const l=s.gop;if(l){const m=[];for(let u=l.min;u<=l.max;u+=l.step)m.push({value:String(u),label:`${String(u)} s`});const v=n?.gop;v!==void 0&&!m.some(u=>u.value===String(v))&&m.unshift({value:String(v),label:`${String(v)} s (current)`}),d.push({type:"select",key:`${i.prefix}_gop`,label:"I-frame interval (GOP)",options:m,default:v!==void 0?String(v):m[0]?.value??""})}else d.push({type:"number",key:`${i.prefix}_gop`,label:"I-frame interval (GOP)",unit:"s",min:1,default:n?.gop??1})}return d.length===0?null:{id:`stream-${i.profile}`,tab:"streaming",title:i.label,description:"Encoder parameters pushed to the camera. Option lists are read live from the camera — fields the firmware doesn't expose are hidden.",columns:2,fields:d}}function gu(i,s){const n=[];for(const d of Hp){const l=i[d.profile];if(!l)continue;const m=$p(d,l,s?.[d.profile]);m&&n.push(m)}return n.length===0?null:{sections:n}}function hu(i,s){const n={};let d=!1;const l=`${s}_resolution`;if(l in i&&typeof i[l]=="string"){const[A,N]=i[l].split("x").map(Number);Number.isFinite(A)&&Number.isFinite(N)&&(n.width=A,n.height=N,d=!0)}const m=`${s}_codec`;m in i&&(i[m]==="h264"||i[m]==="h265")&&(n.codec=i[m],d=!0);const v=`${s}_framerate`;if(v in i){const A=Number(i[v]);Number.isFinite(A)&&(n.framerate=A,d=!0)}const u=`${s}_bitrate`;if(u in i){const A=Number(i[u]);Number.isFinite(A)&&(n.bitrate=A,d=!0)}const y=`${s}_bitrateMode`;y in i&&(i[y]==="vbr"||i[y]==="cbr")&&(n.bitrateMode=i[y],d=!0);const k=`${s}_encoderProfile`;k in i&&(i[k]==="high"||i[k]==="main"||i[k]==="baseline")&&(n.encoderProfile=i[k],d=!0);const w=`${s}_gop`;if(w in i){const A=Number(i[w]);Number.isFinite(A)&&(n.gop=A,d=!0)}return d?n:null}const vu={accessories:"accessories",addonPages:"addon-pages",addonPagesSource:"addon-pages-source",addonRoutes:"addon-routes",addonSettings:"addon-settings",addonWidgets:"addon-widgets",addonWidgetsSource:"addon-widgets-source",addons:"addons",adminUi:"admin-ui",advancedNotifier:"advanced-notifier",alerts:"alerts",audioAnalysis:"audio-analysis",audioAnalyzer:"audio-analyzer",audioCodec:"audio-codec",audioMetrics:"audio-metrics",authProvider:"auth-provider",backup:"backup",battery:"battery",brightness:"brightness",cameraCredentials:"camera-credentials",cameraStreams:"camera-streams",decoder:"decoder",detectionPipeline:"detection-pipeline",deviceDiscovery:"device-discovery",deviceExport:"device-export",deviceManager:"device-manager",deviceOps:"device-ops",deviceProvider:"device-provider",deviceState:"device-state",deviceStatus:"device-status",doorbell:"doorbell",embeddingEncoder:"embedding-encoder",events:"events",featureProbe:"feature-probe",integrations:"integrations",intercom:"intercom",localNetwork:"local-network",logDestination:"log-destination",meshNetwork:"mesh-network",metricsProvider:"metrics-provider",motion:"motion",motionDetection:"motion-detection",motionTrigger:"motion-trigger",motionZones:"motion-zones",mqttBroker:"mqtt-broker",nativeObjectDetection:"native-object-detection",networkAccess:"network-access",networkQuality:"network-quality",nodes:"nodes",notificationOutput:"notification-output",oauthIntegration:"oauth-integration",osd:"osd",pipelineAnalytics:"pipeline-analytics",pipelineExecutor:"pipeline-executor",pipelineOrchestrator:"pipeline-orchestrator",pipelineRunner:"pipeline-runner",platformProbe:"platform-probe",ptz:"ptz",ptzAutotrack:"ptz-autotrack",reboot:"reboot",recording:"recording",recordingEngine:"recording-engine",restreamer:"restreamer",settingsStore:"settings-store",smtpProvider:"smtp-provider",snapshot:"snapshot",snapshotProvider:"snapshot-provider",ssoBridge:"sso-bridge",storage:"storage",storageProvider:"storage-provider",streamBroker:"stream-broker",streamParams:"stream-params",streamingEngine:"streaming-engine",switch:"switch",system:"system",toast:"toast",turnProvider:"turn-provider",userManagement:"user-management",userPasskeys:"user-passkeys",webrtc:"webrtc",webrtcSession:"webrtc-session",zoneAnalytics:"zone-analytics",zoneRules:"zone-rules",zones:"zones"},yu=[{key:"accessories",name:"accessories"},{key:"addonPages",name:"addon-pages"},{key:"addonPagesSource",name:"addon-pages-source"},{key:"addonRoutes",name:"addon-routes"},{key:"addonSettings",name:"addon-settings"},{key:"addonWidgets",name:"addon-widgets"},{key:"addonWidgetsSource",name:"addon-widgets-source"},{key:"addons",name:"addons"},{key:"adminUi",name:"admin-ui"},{key:"advancedNotifier",name:"advanced-notifier"},{key:"alerts",name:"alerts"},{key:"audioAnalysis",name:"audio-analysis"},{key:"audioAnalyzer",name:"audio-analyzer"},{key:"audioCodec",name:"audio-codec"},{key:"audioMetrics",name:"audio-metrics"},{key:"authProvider",name:"auth-provider"},{key:"backup",name:"backup"},{key:"battery",name:"battery"},{key:"brightness",name:"brightness"},{key:"cameraCredentials",name:"camera-credentials"},{key:"cameraStreams",name:"camera-streams"},{key:"decoder",name:"decoder"},{key:"detectionPipeline",name:"detection-pipeline"},{key:"deviceDiscovery",name:"device-discovery"},{key:"deviceExport",name:"device-export"},{key:"deviceManager",name:"device-manager"},{key:"deviceOps",name:"device-ops"},{key:"deviceProvider",name:"device-provider"},{key:"deviceState",name:"device-state"},{key:"deviceStatus",name:"device-status"},{key:"doorbell",name:"doorbell"},{key:"embeddingEncoder",name:"embedding-encoder"},{key:"events",name:"events"},{key:"featureProbe",name:"feature-probe"},{key:"integrations",name:"integrations"},{key:"intercom",name:"intercom"},{key:"localNetwork",name:"local-network"},{key:"logDestination",name:"log-destination"},{key:"meshNetwork",name:"mesh-network"},{key:"metricsProvider",name:"metrics-provider"},{key:"motion",name:"motion"},{key:"motionDetection",name:"motion-detection"},{key:"motionTrigger",name:"motion-trigger"},{key:"motionZones",name:"motion-zones"},{key:"mqttBroker",name:"mqtt-broker"},{key:"nativeObjectDetection",name:"native-object-detection"},{key:"networkAccess",name:"network-access"},{key:"networkQuality",name:"network-quality"},{key:"nodes",name:"nodes"},{key:"notificationOutput",name:"notification-output"},{key:"oauthIntegration",name:"oauth-integration"},{key:"osd",name:"osd"},{key:"pipelineAnalytics",name:"pipeline-analytics"},{key:"pipelineExecutor",name:"pipeline-executor"},{key:"pipelineOrchestrator",name:"pipeline-orchestrator"},{key:"pipelineRunner",name:"pipeline-runner"},{key:"platformProbe",name:"platform-probe"},{key:"ptz",name:"ptz"},{key:"ptzAutotrack",name:"ptz-autotrack"},{key:"reboot",name:"reboot"},{key:"recording",name:"recording"},{key:"recordingEngine",name:"recording-engine"},{key:"restreamer",name:"restreamer"},{key:"settingsStore",name:"settings-store"},{key:"smtpProvider",name:"smtp-provider"},{key:"snapshot",name:"snapshot"},{key:"snapshotProvider",name:"snapshot-provider"},{key:"ssoBridge",name:"sso-bridge"},{key:"storage",name:"storage"},{key:"storageProvider",name:"storage-provider"},{key:"streamBroker",name:"stream-broker"},{key:"streamParams",name:"stream-params"},{key:"streamingEngine",name:"streaming-engine"},{key:"switch",name:"switch"},{key:"system",name:"system"},{key:"toast",name:"toast"},{key:"turnProvider",name:"turn-provider"},{key:"userManagement",name:"user-management"},{key:"userPasskeys",name:"user-passkeys"},{key:"webrtc",name:"webrtc"},{key:"webrtcSession",name:"webrtc-session"},{key:"zoneAnalytics",name:"zone-analytics"},{key:"zoneRules",name:"zone-rules"},{key:"zones",name:"zones"}],Su=[Dd,lc,mc,Ic,ni,yc,hc,Jl,Bi,br,ci,_c,Lc,Kc,sn,or,Pi,cn,rn,Id,pn,wc,_r,mn,cc,ar,Sd,Cn,nr,xt,un,Vc,ud,Tt,Bl,Ed,Yd,xi,el,cd,vn,ds,Sn,fn,Xi,Td,cr,vl,Dl,gr,Li,Nd,Zr,Ts,Bc,_s,Wd,pd,bn,kd,hd,Lr,Nc,Ei,$i,pr,mr,Oi,ri,bi,as,In,Vo,kn,ul,Sl,dr,ll,Fi,Pc,Mc,wn,An,gn],fu=["accessories","battery","brightness","camera-credentials","device-discovery","device-export","device-status","doorbell","feature-probe","intercom","motion","motion-trigger","motion-zones","mqtt-broker","native-object-detection","osd","ptz","ptz-autotrack","snapshot","stream-params","switch"],bu=Object.freeze({"addonPages.listPages":{capName:"addon-pages",capScope:"system",addonId:null,access:"view"},"addonPagesSource.listPages":{capName:"addon-pages-source",capScope:"system",addonId:null,access:"view"},"addonRoutes.getRoutes":{capName:"addon-routes",capScope:"system",addonId:null,access:"view"},"addonRoutes.invoke":{capName:"addon-routes",capScope:"system",addonId:null,access:"create"},"addons.applyAutoUpdateToAll":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.custom":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.forceRefresh":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.getAddonAutoUpdate":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.getAutoUpdateSettings":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.getLastRestart":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.getLogs":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.getVersions":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.installFromWorkspace":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.installPackage":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.isWorkspaceAvailable":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.list":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.listCapabilityProviders":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.listFrameworkPackages":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.listPackages":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.listUpdates":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.listWorkspacePackages":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.onAddonLogs":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.reloadPackages":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.restartAddon":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.restartServer":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.retryLoad":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.rollbackPackage":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.searchAvailable":{capName:"addons",capScope:"system",addonId:null,access:"view"},"addons.setAddonAutoUpdate":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.setAutoUpdateSettings":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.setCapabilityProviderEnabled":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.uninstallPackage":{capName:"addons",capScope:"system",addonId:null,access:"delete"},"addons.updateFrameworkPackage":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addons.updatePackage":{capName:"addons",capScope:"system",addonId:null,access:"create"},"addonSettings.getDeviceSettings":{capName:"addon-settings",capScope:"system",addonId:null,access:"view"},"addonSettings.getGlobalSettings":{capName:"addon-settings",capScope:"system",addonId:null,access:"view"},"addonSettings.updateDeviceSettings":{capName:"addon-settings",capScope:"system",addonId:null,access:"create"},"addonSettings.updateGlobalSettings":{capName:"addon-settings",capScope:"system",addonId:null,access:"create"},"addonWidgets.listWidgets":{capName:"addon-widgets",capScope:"system",addonId:null,access:"view"},"addonWidgetsSource.listWidgets":{capName:"addon-widgets-source",capScope:"system",addonId:null,access:"view"},"adminUi.getStaticDir":{capName:"admin-ui",capScope:"system",addonId:null,access:"view"},"adminUi.getVersion":{capName:"admin-ui",capScope:"system",addonId:null,access:"view"},"advancedNotifier.deleteRule":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"delete"},"advancedNotifier.getHistory":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"view"},"advancedNotifier.getRules":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"view"},"advancedNotifier.testRule":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"create"},"advancedNotifier.upsertRule":{capName:"advanced-notifier",capScope:"system",addonId:null,access:"create"},"alerts.dismiss":{capName:"alerts",capScope:"system",addonId:null,access:"create"},"alerts.emit":{capName:"alerts",capScope:"system",addonId:null,access:"create"},"alerts.getUnreadCount":{capName:"alerts",capScope:"system",addonId:null,access:"view"},"alerts.list":{capName:"alerts",capScope:"system",addonId:null,access:"view"},"alerts.markAllRead":{capName:"alerts",capScope:"system",addonId:null,access:"create"},"alerts.markRead":{capName:"alerts",capScope:"system",addonId:null,access:"create"},"alerts.update":{capName:"alerts",capScope:"system",addonId:null,access:"create"},"audioAnalysis.resolveDeviceSettings":{capName:"audio-analysis",capScope:"device",addonId:null,access:"view"},"audioAnalyzer.analyseChunk":{capName:"audio-analyzer",capScope:"system",addonId:null,access:"create"},"audioAnalyzer.classify":{capName:"audio-analyzer",capScope:"system",addonId:null,access:"view"},"audioAnalyzer.dispose":{capName:"audio-analyzer",capScope:"system",addonId:null,access:"create"},"audioAnalyzer.isReady":{capName:"audio-analyzer",capScope:"system",addonId:null,access:"view"},"audioAnalyzer.reprobeAudioEngine":{capName:"audio-analyzer",capScope:"system",addonId:null,access:"create"},"audioCodec.canHandle":{capName:"audio-codec",capScope:"system",addonId:null,access:"view"},"audioCodec.closeSession":{capName:"audio-codec",capScope:"system",addonId:null,access:"create"},"audioCodec.createDecodeSession":{capName:"audio-codec",capScope:"system",addonId:null,access:"create"},"audioCodec.createEncodeSession":{capName:"audio-codec",capScope:"system",addonId:null,access:"create"},"audioCodec.flushEncode":{capName:"audio-codec",capScope:"system",addonId:null,access:"create"},"audioCodec.listActiveSessions":{capName:"audio-codec",capScope:"system",addonId:null,access:"view"},"audioCodec.listSupportedCodecs":{capName:"audio-codec",capScope:"system",addonId:null,access:"view"},"audioCodec.pullEncoded":{capName:"audio-codec",capScope:"system",addonId:null,access:"view"},"audioCodec.pullPcm":{capName:"audio-codec",capScope:"system",addonId:null,access:"view"},"audioCodec.pushEncodedFrame":{capName:"audio-codec",capScope:"system",addonId:null,access:"create"},"audioCodec.pushPcm":{capName:"audio-codec",capScope:"system",addonId:null,access:"create"},"audioMetrics.getCurrentSnapshot":{capName:"audio-metrics",capScope:"device",addonId:null,access:"view"},"audioMetrics.getHistory":{capName:"audio-metrics",capScope:"device",addonId:null,access:"view"},"authProvider.getLoginUrl":{capName:"auth-provider",capScope:"system",addonId:null,access:"view"},"authProvider.handleCallback":{capName:"auth-provider",capScope:"system",addonId:null,access:"create"},"authProvider.validateCredentials":{capName:"auth-provider",capScope:"system",addonId:null,access:"create"},"authProvider.validateToken":{capName:"auth-provider",capScope:"system",addonId:null,access:"view"},"backup.delete":{capName:"backup",capScope:"system",addonId:null,access:"delete"},"backup.getEntries":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.list":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.listArchives":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.listDestinations":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.listLocations":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.previewSchedule":{capName:"backup",capScope:"system",addonId:null,access:"view"},"backup.restore":{capName:"backup",capScope:"system",addonId:null,access:"create"},"backup.trigger":{capName:"backup",capScope:"system",addonId:null,access:"create"},"backup.upsertDestinationPolicy":{capName:"backup",capScope:"system",addonId:null,access:"create"},"brightness.setBrightness":{capName:"brightness",capScope:"device",addonId:null,access:"create"},"cameraCredentials.getCredentials":{capName:"camera-credentials",capScope:"device",addonId:null,access:"view"},"cameraStreams.getBrokerStreams":{capName:"camera-streams",capScope:"device",addonId:null,access:"view"},"cameraStreams.getCameraStreams":{capName:"camera-streams",capScope:"device",addonId:null,access:"view"},"cameraStreams.getRtspEntries":{capName:"camera-streams",capScope:"device",addonId:null,access:"view"},"decoder.createSession":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.destroySession":{capName:"decoder",capScope:"system",addonId:null,access:"delete"},"decoder.getFrame":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.getInfo":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.getShmStats":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.getStats":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.listActiveSessions":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.openStream":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.pullFrames":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.pullHandles":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.pushPacket":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.reprobeHwaccel":{capName:"decoder",capScope:"system",addonId:null,access:"create"},"decoder.supportsCodec":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"decoder.updateConfig":{capName:"decoder",capScope:"system",addonId:null,access:"view"},"deviceDiscovery.adoptDevice":{capName:"device-discovery",capScope:"device",addonId:null,access:"create"},"deviceDiscovery.listDiscovered":{capName:"device-discovery",capScope:"device",addonId:null,access:"view"},"deviceDiscovery.refreshDiscovery":{capName:"device-discovery",capScope:"device",addonId:null,access:"create"},"deviceDiscovery.releaseDevice":{capName:"device-discovery",capScope:"device",addonId:null,access:"create"},"deviceExport.exposeDevice":{capName:"device-export",capScope:"system",addonId:null,access:"create"},"deviceExport.getStatus":{capName:"device-export",capScope:"system",addonId:null,access:"view"},"deviceExport.listExposedDevices":{capName:"device-export",capScope:"system",addonId:null,access:"view"},"deviceExport.listSupportedDeviceKinds":{capName:"device-export",capScope:"system",addonId:null,access:"view"},"deviceExport.unexposeDevice":{capName:"device-export",capScope:"system",addonId:null,access:"create"},"deviceManager.addLocation":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.adoptDevice":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.allocateDeviceId":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.createDevice":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.disable":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.discoverDevices":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.enable":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.getAllBindings":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getBindings":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getChildren":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getConfigSchema":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getCreationSchema":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getDevice":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getDeviceAggregate":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getDeviceLiveInfoAggregate":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getDeviceSettingsAggregate":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getDeviceStatusAggregate":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getSettingsSchema":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getStreamProfileMap":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.getStreamSources":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listAll":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listBindableCapsForDeviceType":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listLocations":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listPersistedByAddon":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.listWrappersForCap":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.loadConfig":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.loadMeta":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.loadRuntimeState":{capName:"device-manager",capScope:"system",addonId:null,access:"view"},"deviceManager.persistConfig":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.probeStreams":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.registerDevice":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.remove":{capName:"device-manager",capScope:"system",addonId:null,access:"delete"},"deviceManager.removeDevice":{capName:"device-manager",capScope:"system",addonId:null,access:"delete"},"deviceManager.removeLocation":{capName:"device-manager",capScope:"system",addonId:null,access:"delete"},"deviceManager.setDisabled":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setLocation":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setMetadata":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setName":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setStreamProfileMap":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.setWrapperActive":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.testCreationField":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.testField":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.updateConfig":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.updateDeviceField":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceManager.updateDeviceFieldsBatch":{capName:"device-manager",capScope:"system",addonId:null,access:"create"},"deviceOps.getConfigEntries":{capName:"device-ops",capScope:"device",addonId:null,access:"view"},"deviceOps.getSettingsSchema":{capName:"device-ops",capScope:"device",addonId:null,access:"view"},"deviceOps.getStreamSources":{capName:"device-ops",capScope:"device",addonId:null,access:"view"},"deviceOps.removeDevice":{capName:"device-ops",capScope:"device",addonId:null,access:"delete"},"deviceOps.setConfig":{capName:"device-ops",capScope:"device",addonId:null,access:"create"},"deviceProvider.adoptDiscoveredDevice":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceProvider.createDevice":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceProvider.discoverDevices":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceProvider.getChildCreationSchema":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.getDevices":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.getStatus":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.start":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceProvider.stop":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceProvider.supportsDiscovery":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.supportsManualCreation":{capName:"device-provider",capScope:"system",addonId:null,access:"view"},"deviceProvider.testCreationField":{capName:"device-provider",capScope:"system",addonId:null,access:"create"},"deviceState.getAllSnapshots":{capName:"device-state",capScope:"system",addonId:null,access:"view"},"deviceState.getCapSlice":{capName:"device-state",capScope:"system",addonId:null,access:"view"},"deviceState.getSnapshot":{capName:"device-state",capScope:"system",addonId:null,access:"view"},"deviceState.setCapSlice":{capName:"device-state",capScope:"system",addonId:null,access:"create"},"embeddingEncoder.encode":{capName:"embedding-encoder",capScope:"system",addonId:null,access:"view"},"embeddingEncoder.encodeText":{capName:"embedding-encoder",capScope:"system",addonId:null,access:"view"},"embeddingEncoder.getInfo":{capName:"embedding-encoder",capScope:"system",addonId:null,access:"view"},"events.getEventClipUrl":{capName:"events",capScope:"device",addonId:null,access:"view"},"events.getEvents":{capName:"events",capScope:"device",addonId:null,access:"view"},"events.getEventThumbnail":{capName:"events",capScope:"device",addonId:null,access:"view"},"integrations.create":{capName:"integrations",capScope:"system",addonId:null,access:"create"},"integrations.delete":{capName:"integrations",capScope:"system",addonId:null,access:"delete"},"integrations.get":{capName:"integrations",capScope:"system",addonId:null,access:"view"},"integrations.getAvailableTypes":{capName:"integrations",capScope:"system",addonId:null,access:"view"},"integrations.getByAddonId":{capName:"integrations",capScope:"system",addonId:null,access:"view"},"integrations.getSettings":{capName:"integrations",capScope:"system",addonId:null,access:"view"},"integrations.list":{capName:"integrations",capScope:"system",addonId:null,access:"view"},"integrations.setSettings":{capName:"integrations",capScope:"system",addonId:null,access:"create"},"integrations.testConnection":{capName:"integrations",capScope:"system",addonId:null,access:"create"},"integrations.update":{capName:"integrations",capScope:"system",addonId:null,access:"create"},"intercom.endTalkSession":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.handleAnswer":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.pushTalkPcm":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.startSession":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.startTalkSession":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"intercom.stopSession":{capName:"intercom",capScope:"device",addonId:null,access:"create"},"localNetwork.getAllowedAddresses":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.getConnectionEndpoints":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.getPreferred":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.list":{capName:"local-network",capScope:"system",addonId:null,access:"view"},"localNetwork.resetAllowlistToBestMatch":{capName:"local-network",capScope:"system",addonId:null,access:"delete"},"localNetwork.setAllowedAddresses":{capName:"local-network",capScope:"system",addonId:null,access:"create"},"logDestination.query":{capName:"log-destination",capScope:"system",addonId:null,access:"view"},"logDestination.write":{capName:"log-destination",capScope:"system",addonId:null,access:"create"},"meshNetwork.getStatus":{capName:"mesh-network",capScope:"system",addonId:null,access:"view"},"meshNetwork.join":{capName:"mesh-network",capScope:"system",addonId:null,access:"create"},"meshNetwork.leave":{capName:"mesh-network",capScope:"system",addonId:null,access:"create"},"meshNetwork.listPeers":{capName:"mesh-network",capScope:"system",addonId:null,access:"view"},"meshNetwork.logout":{capName:"mesh-network",capScope:"system",addonId:null,access:"create"},"meshNetwork.startLogin":{capName:"mesh-network",capScope:"system",addonId:null,access:"create"},"meshNetwork.testConnection":{capName:"mesh-network",capScope:"system",addonId:null,access:"create"},"metricsProvider.collectSnapshot":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.getAddonStats":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.getCached":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.getCpuTemperature":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.getCurrent":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.getDiskSpace":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.getGpuInfo":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.getProcessStats":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.killProcess":{capName:"metrics-provider",capScope:"system",addonId:null,access:"create"},"metricsProvider.listAddonInstances":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"metricsProvider.listNodeProcesses":{capName:"metrics-provider",capScope:"system",addonId:null,access:"view"},"motion.isDetected":{capName:"motion",capScope:"device",addonId:null,access:"view"},"motionDetection.analyze":{capName:"motion-detection",capScope:"device",addonId:null,access:"create"},"motionDetection.removeCamera":{capName:"motion-detection",capScope:"device",addonId:null,access:"delete"},"motionDetection.reset":{capName:"motion-detection",capScope:"device",addonId:null,access:"delete"},"motionTrigger.setMotionTrigger":{capName:"motion-trigger",capScope:"device",addonId:null,access:"create"},"motionZones.getOptions":{capName:"motion-zones",capScope:"device",addonId:null,access:"view"},"motionZones.setZone":{capName:"motion-zones",capScope:"device",addonId:null,access:"create"},"mqttBroker.addBroker":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"create"},"mqttBroker.getBrokerConfig":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"view"},"mqttBroker.getStatus":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"view"},"mqttBroker.listBrokers":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"view"},"mqttBroker.removeBroker":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"delete"},"mqttBroker.startEmbeddedBroker":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"create"},"mqttBroker.stopEmbeddedBroker":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"create"},"mqttBroker.testConnection":{capName:"mqtt-broker",capScope:"system",addonId:null,access:"create"},"networkAccess.getEndpoint":{capName:"network-access",capScope:"system",addonId:null,access:"view"},"networkAccess.getStatus":{capName:"network-access",capScope:"system",addonId:null,access:"view"},"networkAccess.listEndpoints":{capName:"network-access",capScope:"system",addonId:null,access:"view"},"networkAccess.start":{capName:"network-access",capScope:"system",addonId:null,access:"create"},"networkAccess.stop":{capName:"network-access",capScope:"system",addonId:null,access:"create"},"networkQuality.getAllStats":{capName:"network-quality",capScope:"system",addonId:null,access:"view"},"networkQuality.getDeviceStats":{capName:"network-quality",capScope:"system",addonId:null,access:"view"},"networkQuality.reportClientStats":{capName:"network-quality",capScope:"system",addonId:null,access:"create"},"nodes.clusterAddonStatus":{capName:"nodes",capScope:"system",addonId:null,access:"view"},"nodes.deployAddon":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.executeQuery":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.getCapUsageGraph":{capName:"nodes",capScope:"system",addonId:null,access:"view"},"nodes.getNodeAddons":{capName:"nodes",capScope:"system",addonId:null,access:"view"},"nodes.renameNode":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.restartAddon":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.restartNode":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.restartProcess":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.setProcessLogLevel":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.shutdownNode":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"nodes.topology":{capName:"nodes",capScope:"system",addonId:null,access:"view"},"nodes.undeployAddon":{capName:"nodes",capScope:"system",addonId:null,access:"create"},"notificationOutput.send":{capName:"notification-output",capScope:"system",addonId:null,access:"create"},"notificationOutput.sendTest":{capName:"notification-output",capScope:"system",addonId:null,access:"create"},"oauthIntegration.getDescriptor":{capName:"oauth-integration",capScope:"system",addonId:null,access:"view"},"osd.setOverlay":{capName:"osd",capScope:"device",addonId:null,access:"create"},"pipelineAnalytics.clearTracks":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"delete"},"pipelineAnalytics.getActiveTracks":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getAudioEvents":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getEventMedia":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getMotionEvents":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getObjectEvents":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getTrack":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.getTrackMedia":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineAnalytics.listTracks":{capName:"pipeline-analytics",capScope:"device",addonId:null,access:"view"},"pipelineExecutor.cacheFrameInPool":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.deleteModel":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"delete"},"pipelineExecutor.deleteTemplate":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"delete"},"pipelineExecutor.detect":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.downloadModel":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.getAddonModels":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getAudioCapabilities":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getAvailableEngines":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getCapabilities":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getDefaultSteps":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getDetectionConfigSchema":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getEffectiveTuning":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getGlobalPipelineConfig":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getGlobalSteps":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getOrchestratorConfigSchema":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getReferenceAudio":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getReferenceAudioFiles":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getReferenceImage":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getSchema":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getSelectedEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.getVideoPipelineSteps":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.inferCached":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.killEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.listLoadedEngines":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.listReferenceImages":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.listTemplates":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"view"},"pipelineExecutor.reprobeEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.runAudioTest":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.runPipeline":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.runPipelineBatch":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.saveTemplate":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.setVideoPipelineSteps":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.spinEngine":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.uncacheFrame":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineExecutor.updateTemplate":{capName:"pipeline-executor",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.assignAudio":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.assignDecoder":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.assignPipeline":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.deleteTemplate":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"delete"},"pipelineOrchestrator.getAgentLoad":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAgentSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAudioAssignment":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAudioAssignments":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getAudioNodeLoad":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCameraMetrics":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCameraSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCameraStepOverrides":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getCapabilityBindings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getDecoderAssignment":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getDecoderAssignments":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getGlobalMetrics":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getPipelineAssignment":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.getPipelineAssignments":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.listAgentSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.listTemplates":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.rebalance":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.removeAgentSettings":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"delete"},"pipelineOrchestrator.resolvePipeline":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"view"},"pipelineOrchestrator.saveTemplate":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setAgentAddonDefaults":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCameraPipelineForAgent":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCameraStepOverride":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCameraStepToggle":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.setCapabilityBinding":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.unassignAudio":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.unassignDecoder":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.unassignPipeline":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineOrchestrator.updateTemplate":{capName:"pipeline-orchestrator",capScope:"system",addonId:null,access:"create"},"pipelineRunner.attachCamera":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"create"},"pipelineRunner.detachCamera":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"create"},"pipelineRunner.getAllCameraMetrics":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getCameraMetrics":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getLocalCameras":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getLocalLoad":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.getLocalMetrics":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"view"},"pipelineRunner.reportMotion":{capName:"pipeline-runner",capScope:"system",addonId:null,access:"create"},"platformProbe.getCapabilities":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"platformProbe.getHardware":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"platformProbe.getHardwareEncoders":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"platformProbe.refreshHardwareEncoders":{capName:"platform-probe",capScope:"system",addonId:null,access:"create"},"platformProbe.resolveHwAccel":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"platformProbe.resolveInferenceConfig":{capName:"platform-probe",capScope:"system",addonId:null,access:"view"},"ptz.continuousMove":{capName:"ptz",capScope:"device",addonId:null,access:"create"},"ptz.deletePreset":{capName:"ptz",capScope:"device",addonId:null,access:"delete"},"ptz.getOptions":{capName:"ptz",capScope:"device",addonId:null,access:"view"},"ptz.getPosition":{capName:"ptz",capScope:"device",addonId:null,access:"view"},"ptz.getPresets":{capName:"ptz",capScope:"device",addonId:null,access:"view"},"ptz.goHome":{capName:"ptz",capScope:"device",addonId:null,access:"create"},"ptz.goToPreset":{capName:"ptz",capScope:"device",addonId:null,access:"create"},"ptz.move":{capName:"ptz",capScope:"device",addonId:null,access:"create"},"ptz.savePreset":{capName:"ptz",capScope:"device",addonId:null,access:"create"},"ptz.setAutofocus":{capName:"ptz",capScope:"device",addonId:null,access:"create"},"ptz.stop":{capName:"ptz",capScope:"device",addonId:null,access:"create"},"ptzAutotrack.getSettings":{capName:"ptz-autotrack",capScope:"device",addonId:null,access:"view"},"ptzAutotrack.getStatus":{capName:"ptz-autotrack",capScope:"device",addonId:null,access:"view"},"ptzAutotrack.setEnabled":{capName:"ptz-autotrack",capScope:"device",addonId:null,access:"create"},"ptzAutotrack.setSettings":{capName:"ptz-autotrack",capScope:"device",addonId:null,access:"create"},"reboot.reboot":{capName:"reboot",capScope:"device",addonId:null,access:"create"},"recording.getPlaybackUrl":{capName:"recording",capScope:"device",addonId:null,access:"view"},"recording.getSegments":{capName:"recording",capScope:"device",addonId:null,access:"view"},"recording.getThumbnailAt":{capName:"recording",capScope:"device",addonId:null,access:"view"},"recordingEngine.disable":{capName:"recording-engine",capScope:"system",addonId:null,access:"create"},"recordingEngine.enable":{capName:"recording-engine",capScope:"system",addonId:null,access:"create"},"recordingEngine.estimateGlobalStorage":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.estimateStorage":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getAvailability":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getConfig":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getMotionStats":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getPlaylist":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getPolicy":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getPolicyStatus":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getRetentionConfig":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getSegments":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getStatus":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getStorageUsage":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.getThumbnail":{capName:"recording-engine",capScope:"system",addonId:null,access:"view"},"recordingEngine.setPolicy":{capName:"recording-engine",capScope:"system",addonId:null,access:"create"},"recordingEngine.updateConfig":{capName:"recording-engine",capScope:"system",addonId:null,access:"create"},"recordingEngine.updateRetentionConfig":{capName:"recording-engine",capScope:"system",addonId:null,access:"create"},"restreamer.getExposedResources":{capName:"restreamer",capScope:"system",addonId:null,access:"view"},"restreamer.registerDevice":{capName:"restreamer",capScope:"system",addonId:null,access:"create"},"restreamer.unregisterDevice":{capName:"restreamer",capScope:"system",addonId:null,access:"delete"},"settingsStore.count":{capName:"settings-store",capScope:"system",addonId:null,access:"view"},"settingsStore.declareCollection":{capName:"settings-store",capScope:"system",addonId:null,access:"create"},"settingsStore.delete":{capName:"settings-store",capScope:"system",addonId:null,access:"delete"},"settingsStore.get":{capName:"settings-store",capScope:"system",addonId:null,access:"view"},"settingsStore.insert":{capName:"settings-store",capScope:"system",addonId:null,access:"create"},"settingsStore.isEmpty":{capName:"settings-store",capScope:"system",addonId:null,access:"view"},"settingsStore.query":{capName:"settings-store",capScope:"system",addonId:null,access:"view"},"settingsStore.set":{capName:"settings-store",capScope:"system",addonId:null,access:"create"},"settingsStore.update":{capName:"settings-store",capScope:"system",addonId:null,access:"create"},"smtpProvider.getStatus":{capName:"smtp-provider",capScope:"system",addonId:null,access:"view"},"smtpProvider.sendEmail":{capName:"smtp-provider",capScope:"system",addonId:null,access:"create"},"smtpProvider.verify":{capName:"smtp-provider",capScope:"system",addonId:null,access:"view"},"snapshot.getSnapshot":{capName:"snapshot",capScope:"device",addonId:null,access:"view"},"snapshot.invalidateCache":{capName:"snapshot",capScope:"device",addonId:null,access:"create"},"snapshotProvider.getSnapshot":{capName:"snapshot-provider",capScope:"system",addonId:null,access:"view"},"snapshotProvider.supportsDevice":{capName:"snapshot-provider",capScope:"system",addonId:null,access:"view"},"ssoBridge.signBridgeToken":{capName:"sso-bridge",capScope:"system",addonId:null,access:"view"},"ssoBridge.verifyBridgeToken":{capName:"sso-bridge",capScope:"system",addonId:null,access:"view"},"storage.abortUpload":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storage.beginDownload":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storage.beginUpload":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storage.delete":{capName:"storage",capScope:"system",addonId:null,access:"delete"},"storage.deleteLocation":{capName:"storage",capScope:"system",addonId:null,access:"delete"},"storage.endDownload":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storage.exists":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.finalizeUpload":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storage.getAvailableSpace":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.getDefaultLocation":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.list":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.listLocations":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.listProviders":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.read":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.readChunk":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.resolve":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.testConfig":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.testLocation":{capName:"storage",capScope:"system",addonId:null,access:"view"},"storage.upsertLocation":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storage.write":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storage.writeChunk":{capName:"storage",capScope:"system",addonId:null,access:"create"},"storageProvider.abortUpload":{capName:"storage-provider",capScope:"system",addonId:null,access:"create"},"storageProvider.beginDownload":{capName:"storage-provider",capScope:"system",addonId:null,access:"create"},"storageProvider.beginUpload":{capName:"storage-provider",capScope:"system",addonId:null,access:"create"},"storageProvider.delete":{capName:"storage-provider",capScope:"system",addonId:null,access:"delete"},"storageProvider.endDownload":{capName:"storage-provider",capScope:"system",addonId:null,access:"create"},"storageProvider.exists":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.finalizeUpload":{capName:"storage-provider",capScope:"system",addonId:null,access:"create"},"storageProvider.getAvailableSpace":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.getProviderInfo":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.list":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.read":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.readChunk":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.resolve":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.testLocation":{capName:"storage-provider",capScope:"system",addonId:null,access:"view"},"storageProvider.write":{capName:"storage-provider",capScope:"system",addonId:null,access:"create"},"storageProvider.writeChunk":{capName:"storage-provider",capScope:"system",addonId:null,access:"create"},"streamBroker.assignProfile":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.getAllRtspEntries":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.getBrokerStats":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.getPreBufferInfo":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.getRtspEntry":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.getRtspPort":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.getStreamUrl":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.getStreamWithCodec":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.isRtspEnabled":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.killClient":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.listAllCameraStreams":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.listAllProfileSlots":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.listClients":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.publishCameraStream":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.pullAudioChunks":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.pullFrameHandles":{capName:"stream-broker",capScope:"system",addonId:null,access:"view"},"streamBroker.regenerateRtspToken":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.releaseStreamWithCodec":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.restartProfile":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.retractCameraStream":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.setPreBufferDuration":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.setRtspEnabled":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.subscribeAudioChunks":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.subscribeFrames":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.unassignProfile":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.unsubscribeAudioChunks":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamBroker.unsubscribeFrames":{capName:"stream-broker",capScope:"system",addonId:null,access:"create"},"streamingEngine.getStreamUrl":{capName:"streaming-engine",capScope:"system",addonId:null,access:"view"},"streamingEngine.listStreams":{capName:"streaming-engine",capScope:"system",addonId:null,access:"view"},"streamingEngine.registerStream":{capName:"streaming-engine",capScope:"system",addonId:null,access:"create"},"streamingEngine.unregisterStream":{capName:"streaming-engine",capScope:"system",addonId:null,access:"delete"},"streamParams.getConfigSchema":{capName:"stream-params",capScope:"device",addonId:null,access:"view"},"streamParams.getOptions":{capName:"stream-params",capScope:"device",addonId:null,access:"view"},"streamParams.setProfile":{capName:"stream-params",capScope:"device",addonId:null,access:"create"},"switch.setState":{capName:"switch",capScope:"device",addonId:null,access:"create"},"system.featureFlags":{capName:"system",capScope:"system",addonId:null,access:"view"},"system.forceRetentionCleanup":{capName:"system",capScope:"system",addonId:null,access:"create"},"system.getRetentionConfig":{capName:"system",capScope:"system",addonId:null,access:"view"},"system.health":{capName:"system",capScope:"system",addonId:null,access:"view"},"system.info":{capName:"system",capScope:"system",addonId:null,access:"view"},"system.networkAddresses":{capName:"system",capScope:"system",addonId:null,access:"view"},"system.setRetentionConfig":{capName:"system",capScope:"system",addonId:null,access:"create"},"toast.onToast":{capName:"toast",capScope:"system",addonId:null,access:"view"},"turnProvider.getTurnServers":{capName:"turn-provider",capScope:"system",addonId:null,access:"view"},"userManagement.confirmTotp":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.createApiKey":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.createScopedToken":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.createUser":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.deleteUser":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.disableTotp":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.getTotpStatus":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listApiKeys":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listOauthSessions":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listScopedTokens":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.listUsers":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.oauthExchangeCode":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.oauthIssueCode":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.oauthRefresh":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.oauthVerifyAccessToken":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.resetPassword":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.revokeApiKey":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.revokeOauthSession":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.revokeScopedToken":{capName:"user-management",capScope:"system",addonId:null,access:"delete"},"userManagement.setupTotp":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.setUserScopes":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.updateUser":{capName:"user-management",capScope:"system",addonId:null,access:"create"},"userManagement.validateApiKey":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.validateCredentials":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.validateScopedToken":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userManagement.verifyTotp":{capName:"user-management",capScope:"system",addonId:null,access:"view"},"userPasskeys.beginAuthentication":{capName:"user-passkeys",capScope:"system",addonId:null,access:"view"},"userPasskeys.beginRegistration":{capName:"user-passkeys",capScope:"system",addonId:null,access:"create"},"userPasskeys.finishAuthentication":{capName:"user-passkeys",capScope:"system",addonId:null,access:"view"},"userPasskeys.finishRegistration":{capName:"user-passkeys",capScope:"system",addonId:null,access:"create"},"userPasskeys.listPasskeys":{capName:"user-passkeys",capScope:"system",addonId:null,access:"view"},"userPasskeys.removePasskey":{capName:"user-passkeys",capScope:"system",addonId:null,access:"delete"},"webrtc.closeSession":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.createSession":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.handleAnswer":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.handleOffer":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.hasAdaptiveBitrate":{capName:"webrtc",capScope:"system",addonId:null,access:"view"},"webrtc.registerStream":{capName:"webrtc",capScope:"system",addonId:null,access:"create"},"webrtc.supportsStream":{capName:"webrtc",capScope:"system",addonId:null,access:"view"},"webrtc.unregisterStream":{capName:"webrtc",capScope:"system",addonId:null,access:"delete"},"webrtcSession.closeSession":{capName:"webrtc-session",capScope:"device",addonId:null,access:"create"},"webrtcSession.createSession":{capName:"webrtc-session",capScope:"device",addonId:null,access:"create"},"webrtcSession.handleAnswer":{capName:"webrtc-session",capScope:"device",addonId:null,access:"create"},"webrtcSession.handleOffer":{capName:"webrtc-session",capScope:"device",addonId:null,access:"create"},"webrtcSession.hasAdaptiveBitrate":{capName:"webrtc-session",capScope:"device",addonId:null,access:"view"},"webrtcSession.listStreams":{capName:"webrtc-session",capScope:"device",addonId:null,access:"view"},"zoneAnalytics.getCameraHistory":{capName:"zone-analytics",capScope:"device",addonId:null,access:"view"},"zoneAnalytics.getCurrentSnapshot":{capName:"zone-analytics",capScope:"device",addonId:null,access:"view"},"zoneAnalytics.getUnzonedHistory":{capName:"zone-analytics",capScope:"device",addonId:null,access:"view"},"zoneAnalytics.getZoneHistory":{capName:"zone-analytics",capScope:"device",addonId:null,access:"view"},"zoneRules.listRules":{capName:"zone-rules",capScope:"device",addonId:null,access:"view"},"zoneRules.setRules":{capName:"zone-rules",capScope:"device",addonId:null,access:"create"},"zones.addZone":{capName:"zones",capScope:"device",addonId:null,access:"create"},"zones.listZones":{capName:"zones",capScope:"device",addonId:null,access:"view"},"zones.removeZone":{capName:"zones",capScope:"device",addonId:null,access:"delete"},"zones.updateZone":{capName:"zones",capScope:"device",addonId:null,access:"create"}}),Iu=["addon-pages","addon-pages-source","addon-routes","addon-settings","addon-widgets","addon-widgets-source","addons","admin-ui","advanced-notifier","alerts","audio-analysis","audio-analyzer","audio-codec","audio-metrics","auth-provider","backup","brightness","camera-credentials","camera-streams","decoder","device-discovery","device-export","device-manager","device-ops","device-provider","device-state","embedding-encoder","events","integrations","intercom","local-network","log-destination","mesh-network","metrics-provider","motion","motion-detection","motion-trigger","motion-zones","mqtt-broker","network-access","network-quality","nodes","notification-output","oauth-integration","osd","pipeline-analytics","pipeline-executor","pipeline-orchestrator","pipeline-runner","platform-probe","ptz","ptz-autotrack","reboot","recording","recording-engine","restreamer","settings-store","smtp-provider","snapshot","snapshot-provider","sso-bridge","storage","storage-provider","stream-broker","stream-params","streaming-engine","switch","system","toast","turn-provider","user-management","user-passkeys","webrtc","webrtc-session","zone-analytics","zone-rules","zones"],ku=["audio-analysis","audio-metrics","brightness","camera-credentials","camera-streams","device-discovery","device-ops","events","intercom","motion","motion-detection","motion-trigger","motion-zones","osd","pipeline-analytics","ptz","ptz-autotrack","reboot","recording","snapshot","stream-params","switch","webrtc-session","zone-analytics","zone-rules","zones"],wu=["addon-pages","addon-pages-source","addon-routes","addon-settings","addon-widgets","addon-widgets-source","addons","admin-ui","advanced-notifier","alerts","audio-analyzer","audio-codec","auth-provider","backup","decoder","device-export","device-manager","device-provider","device-state","embedding-encoder","integrations","local-network","log-destination","mesh-network","metrics-provider","mqtt-broker","network-access","network-quality","nodes","notification-output","oauth-integration","pipeline-executor","pipeline-orchestrator","pipeline-runner","platform-probe","recording-engine","restreamer","settings-store","smtp-provider","snapshot-provider","sso-bridge","storage","storage-provider","stream-broker","streaming-engine","system","toast","turn-provider","user-management","user-passkeys","webrtc"],Au=[{id:"camera-viewer",label:"Camera viewer",description:"Read-only over every device — live streams, recordings, motion events, battery state. Combine with `allowedDevices` to restrict to specific cameras.",rows:[{type:"category",target:"device",access:["view"]}]},{id:"camera-operator",label:"Camera operator",description:"Everything `camera-viewer` does plus PTZ control, intercom, snapshots and recording start/stop. Cannot delete devices or recordings.",rows:[{type:"category",target:"device",access:["view","create"]}]},{id:"cli-deployer",label:"CLI deployer",description:"Push addons to the hub and tail their logs. Used by the `camstack` CLI on dev machines. No delete access — a stolen token cannot uninstall.",rows:[{type:"capability",target:"addons",access:["view","create"]}]},{id:"event-listener",label:"Event listener",description:"Subscribe to motion / audio events. Used by webhook bridges and Home Assistant integrations.",rows:[{type:"capability",target:"events",access:["view"]},{type:"capability",target:"motion-detection",access:["view"]},{type:"capability",target:"audio-analysis",access:["view"]}]}],Wp=Object.freeze({"device-export":"device-export","mesh-network":"mesh","mqtt-broker":"broker","network-access":"ingress","smtp-provider":"email"}),Cu=["device-export","mesh-network","mqtt-broker","network-access","smtp-provider"];function Nu(i){const s=[];for(const[n,d]of Object.entries(Wp))d===i&&s.push(n);return s}function Pu(i){try{const s=new URL(i);return!s.username&&!s.password?i:(s.username="",s.password="",s.toString())}catch{return i}}class Du{constructor(s){this.capacity=s,this.items=Array.from({length:s})}items;head=0;tail=0;count=0;get size(){return this.count}push(s){this.items[this.tail]=s,this.tail=(this.tail+1)%this.capacity,this.count<this.capacity?this.count++:this.head=(this.head+1)%this.capacity}drain(s){const n=[],d=Math.min(s,this.count);for(let l=0;l<d;l++)n.push(this.items[this.head]),this.items[this.head]=void 0,this.head=(this.head+1)%this.capacity;return this.count-=d,n}}function Mu(i,s,n){const d={};for(const l of Object.keys(n))d[l]=m=>i.addons.custom.mutate({addonId:s,action:l,input:m});return d}export{Yp as ACCESSORY_LABEL,Su as ALL_CAPABILITY_DEFINITIONS,wo as APPLE_SA_TO_MACRO,um as AUDIO_BACKEND_CHOICES,Io as AUDIO_MACRO_LABELS,Pd as AccessoriesStatusSchema,H as AccessoryKind,ji as AddBrokerInputSchema,Wl as AddonAutoUpdateSchema,Ll as AddonListItemSchema,pc as AddonPageDeclarationSchema,dc as AddonPageInfoSchema,xc as AgentLoadSummarySchema,We as AlertSchema,oi as AlertSeveritySchema,ii as AlertSourceSchema,si as AlertStatusSchema,dm as ApiKeyRecordSchema,At as ApiKeySummarySchema,Ai as ArchiveEntrySchema,Ci as ArchiveManifestSchema,qc as AudioAnalysisResultSchema,Oc as AudioAnalysisSettingsSchema,ua as AudioChunkInputSchema,Ro as AudioClassSummarySchema,pt as AudioClassificationLabelSchema,zc as AudioClassificationResultSchema,Fc as AudioCodecInfoSchema,Uc as AudioDecodeSessionConfigSchema,Hc as AudioEncodeSessionConfigSchema,qa as AudioEncodedChunkSchema,Wr as AudioEventSchema,cs as AudioLevelSchema,Bo as AudioMetricsHistoryPointSchema,qo as AudioMetricsHistorySchema,ra as AudioMetricsSnapshotSchema,$c as AudioPcmChunkSchema,Ve as AuthResultSchema,$l as AutoUpdateSettingsSchema,Ml as AvailableIntegrationTypeSchema,Kn as BACKEND_TO_FORMAT,No as BATTERY_DEVICE_PROFILE,ki as BackupDestinationInfoSchema,wa as BackupEntrySchema,ap as BaseAddon,iu as BaseDevice,cu as BaseDeviceProvider,Le as BatteryStatusSchema,te as BoundingBoxSchema,da as BrightnessStatusSchema,Yo as BrokerAudioClientSchema,Qo as BrokerClientsSchema,Vi as BrokerConnectionDetailsSchema,Zo as BrokerDecodedClientSchema,Gi as BrokerInfoSchema,jo as BrokerRtspClientSchema,Ko as BrokerStatsSchema,Wo as BrokerStatusSchema,tm as CAM_PROFILE_ORDER,vu as CAPABILITY_NAMES,yu as CAPABILITY_ROUTER_KEYS,fu as CAP_NAMES_WITH_STATUS,Wp as CAP_PROVIDER_KIND_MAP,tu as COCO_80_LABELS,nu as COCO_TO_MACRO,W as CamProfileSchema,dn as CamStreamKindSchema,Rt as CamStreamResolutionSchema,fd as CameraCredentialsSchema,bd as CameraCredentialsStatusSchema,qt as CameraMetricsSchema,ls as CameraMetricsWithDeviceIdSchema,it as CameraStreamSchema,qi as CapScopeSchema,Rc as CapabilityBindingsSchema,Ao as ChargingStatus,hl as ClientNetworkStatsSchema,kl as ClusterAddonNodeDeploymentSchema,wl as ClusterAddonStatusEntrySchema,Di as CollectionColumnSchema,Mi as CollectionIndexSchema,jc as ConfigEntrySchema,ai as ConfigSectionWithValuesSchema,ti as ConfigTabDeclarationSchema,nl as CreateApiKeyInputSchema,ol as CreateApiKeyResultSchema,xl as CreateIntegrationInputSchema,sl as CreateScopedTokenInputSchema,il as CreateScopedTokenResultSchema,tl as CreateUserInputSchema,Ql as CustomActionInputSchema,ep as DEFAULT_ADDON_PLACEMENT,gm as DEFAULT_AUDIO_ANALYZER_CONFIG,mm as DEFAULT_DECODER_HWACCEL_CONFIG,Rm as DEFAULT_FEATURES,Pm as DEFAULT_LOCATION_SUBDIRS,Om as DEFAULT_RETENTION,ku as DEVICE_CAP_NAMES,Po as DEVICE_PROFILES,xo as DEVICE_SETTINGS_CONTRIBUTION_METHODS,To as DEVICE_STATUS_METHOD,ou as DEVICE_TYPE_INFO,Uo as DecodedAudioChunkSchema,la as DecodedFrameSchema,Ba as DecoderAssignmentSchema,ia as DecoderSessionConfigSchema,fo as DecoderStatsSchema,Rl as DeleteIntegrationResultSchema,Ss as DetectorOutputSchema,pe as DeviceConfig,pa as DeviceDiscoveryStatusSchema,sc as DeviceExportExposeInputSchema,Ea as DeviceExportStatusSchema,ic as DeviceExportUnexposeInputSchema,on as DeviceFeature,Ge as DeviceInfoSchema,Ya as DeviceNetworkStatsSchema,F as DeviceRole,_t as DeviceRuntimeState,Oe as DeviceStatusSchema,C as DeviceType,lt as DiscoveredChildDeviceSchema,ns as DiscoveredChildStatusSchema,cm as DiscoveredDeviceSchema,vm as DisposerChain,os as DoorbellPressEventSchema,ma as DoorbellStatusSchema,Vm as ElementConfigStore,Gc as EmbeddingInfoSchema,Oa as EmbeddingResultSchema,zo as EncodedPacketSchema,vc as EnrichedWidgetMetadataSchema,Ne as EventCategory,md as EventItemSchema,Fr as EventKindSchema,gp as EventSourceType,tc as ExportSetupFieldSchema,ac as ExportSetupSchema,oc as ExposedDeviceSchema,Cc as ExposedResourceSchema,Za as FeatureManifestSchema,ze as FeatureProbeStatusSchema,Lo as FrameHandleFormatSchema,rt as FrameHandleSchema,we as FrameInputSchema,es as GetStreamWithCodecInputSchema,Tc as GlobalMetricsSchema,zm as HF_BASE_URL,hp as HF_REPO,pm as HWACCEL_OPTIONS,pl as HealthStatusSchema,$e as HistoryPointSchema,Qs as HistoryResolutionEnum,_l as InstalledPackageSchema,Xe as IntegrationLiteSchema,Qa as IntegrationWithStateSchema,Md as IntercomAbilitySchema,Ga as IntercomStatusSchema,Iu as KNOWN_CAP_NAMES,Ni as LocationStatSchema,Na as LogEntrySchema,Nn as LogLevelSchema,Zl as LogStreamEntrySchema,au as MACRO_LABELS,bu as METHOD_ACCESS_MAP,ho as MODEL_FORMATS,Fa as MediaFileSchema,Jd as MeshPeerSchema,Xd as MeshStatusSchema,Se as MethodAccessSchema,rs as MotionAnalysisResultSchema,Hr as MotionEventSchema,Fs as MotionOnMotionChangedDataSchema,De as MotionRegionSchema,Ot as MotionSourceEnum,qs as MotionSourcesSchema,ha as MotionStatusSchema,Us as MotionTriggerRuntimeStateSchema,yn as MotionTriggerStatusSchema,Hs as MotionZoneOptionsSchema,$s as MotionZonePatchSchema,va as MotionZoneStatusSchema,Ma as MqttBrokerStatusSchema,_n as NativeDetectionSchema,kt as NativeObjectClassEnum,xd as NativeObjectDetectionStatusSchema,sr as NetworkAccessStatusSchema,ml as NetworkAddressSchema,Te as NetworkEndpointSchema,Sr as NotificationHistoryEntrySchema,za as NotificationRuleSchema,ur as NotificationSchema,zi as OauthIntegrationDescriptorSchema,$r as ObjectEventSchema,om as OrchestratorMetricsSchema,wd as OsdOverlayKindEnum,Cd as OsdOverlayPatchSchema,Ad as OsdOverlaySchema,It as OsdPositionEnum,Ka as OsdStatusSchema,Xl as PIPELINE_FLOW_CAPABILITY_NAMES,hm as PIPELINE_OWNER_CAPABILITY_NAMES,Cu as PROVIDER_KIND_CAP_NAMES,fp as PYTHON_SCRIPT,Fl as PackageUpdateSchema,Ul as PackageVersionInfoSchema,_i as PasskeySummarySchema,Re as PcmSampleFormatSchema,ht as PerScopeBreakdownSchema,Ra as PipelineAssignmentSchema,ut as PipelineDefaultStepSchema,D as PipelineEngineChoiceSchema,ga as PipelineRunResultBridge,ee as PipelineStepInputSchema,nm as PlaceholderReasonSchema,Bs as PolygonPointSchema,ct as ProfileSlotSchema,ke as ProfileSlotStatusSchema,Xs as ProviderStatusSchema,Gs as PtzAutotrackRuntimeStateSchema,gt as PtzAutotrackSettingsSchema,Ae as PtzAutotrackStatusSchema,Ks as PtzAutotrackTargetOptionSchema,Wa as PtzMoveCommandSchema,Ln as PtzPositionSchema,rd as PtzPresetSchema,dd as PtzStatusSchema,Aa as QueryFilterSchema,qm as RECOGNITION_TYPES,Lm as RUNTIME_DEFAULTS,Sp as RUNTIME_TO_FORMAT,Am as ReadinessRegistry,cp as ReadinessTimeoutError,Ac as RegisteredStreamSchema,Os as ReportMotionInputSchema,Du as RingBuffer,ts as RtpSourceSchema,dt as RtspRestreamEntrySchema,zs as RunnerCameraConfigSchema,sm as RunnerCameraDeviceUIFields,hn as RunnerLocalLoadSchema,Ls as RunnerLocalMetricsSchema,Au as SCOPE_PRESETS,Vp as STORAGE_LOCATION_CARDINALITY,Nm as STORAGE_LOCATION_TYPES,Hp as STREAM_PROFILE_META,dp as STREAM_QUALITY_LABELS,Bm as SUB_DETECTION_TYPES,wu as SYSTEM_CAP_NAMES,lm as ScopedTokenSchema,Ct as ScopedTokenSummarySchema,Hl as SearchResultSchema,gd as SegmentSchema,Ui as SendEmailInputSchema,Hi as SendEmailResultSchema,Ia as SettingsPatchSchema,Ca as SettingsRecordSchema,Q as SettingsSchemaWithValuesSchema,ka as SettingsUpdateResultSchema,kc as ShmRingStatsSchema,Da as SmtpStatusSchema,Rn as SnapshotImageSchema,is as SpatialDetectionSchema,Pa as SsoBridgeClaimsSchema,Qi as StartEmbeddedInputSchema,hi as StorageAbortUploadInputSchema,vi as StorageBeginDownloadInputSchema,yi as StorageBeginDownloadResultSchema,pi as StorageBeginUploadInputSchema,mi as StorageBeginUploadResultSchema,fi as StorageEndDownloadInputSchema,gi as StorageFinalizeUploadInputSchema,_ as StorageLocationRefSchema,T as StorageLocationSchema,X as StorageLocationTypeSchema,di as StorageProviderInfoSchema,Si as StorageReadChunkInputSchema,li as StorageTestLocationResultSchema,ui as StorageWriteChunkInputSchema,Bt as StreamFormatSchema,Go as StreamInfoSchema,gl as StreamNetworkStatsSchema,js as StreamParamsOptionsSchema,ya as StreamParamsStatusSchema,Fe as StreamProfileConfigSchema,Ue as StreamProfileOptionsSchema,Zs as StreamProfilePatchSchema,Vs as StreamProfileSchema,Oo as StreamSourceEntrySchema,am as StreamSourceSchema,Ho as SubscribeAudioChunksInputSchema,$o as SubscribeAudioChunksResultSchema,_o as SubscribeFramesInputSchema,Fo as SubscribeFramesResultSchema,Sa as SwitchStatusSchema,id as SystemMetricsSchema,pu as SystemMirror,El as TestConnectionResultSchema,yl as ToastSchema,R as TokenScopeSchema,Il as TopologyNodeSchema,bl as TopologyProcessSchema,fl as TopologyServiceSchema,je as TrackSchema,zt as TrackStateSchema,jr as TrackedDetectionSchema,rr as TurnServerSchema,Tl as UpdateIntegrationInputSchema,al as UpdateUserInputSchema,rm as UserRecordSchema,Qe as UserSummarySchema,vo as WELL_KNOWN_TABS,Gp as WELL_KNOWN_TAB_MAP,Dc as WebrtcStreamChoiceSchema,yt as WebrtcStreamTargetSchema,uc as WidgetHostEnum,Mn as WidgetMetadataSchema,gc as WidgetRemoteSchema,xa as WidgetSizeEnum,ko as YAMNET_TO_MACRO,Rs as ZoneKindEnum,Js as ZoneRuleModeEnum,de as ZoneRuleSchema,ba as ZoneRuleStageEnum,im as ZoneRulesArraySchema,re as ZoneSchema,Ys as ZoneScopeBreakdownSchema,Dd as accessoriesCapability,Qp as accessoryStableId,lc as addonPagesCapability,mc as addonPagesSourceCapability,Ic as addonRoutesCapability,ni as addonSettingsCapability,yc as addonWidgetsCapability,hc as addonWidgetsSourceCapability,Jl as addonsCapability,Bi as adminUiCapability,br as advancedNotifierCapability,ci as alertsCapability,Hm as asBoolean,_m as asJsonArray,vp as asJsonObject,Um as asNumber,Fm as asString,_c as audioAnalysisCapability,Lc as audioAnalyzerCapability,Kc as audioCodecCapability,sn as audioMetricsCapability,or as authProviderCapability,Tm as autoAssignProfiles,Pi as backupCapability,cn as batteryCapability,Mu as bindAddonActions,rn as brightnessCapability,wm as buildAddonRouteProvider,gu as buildStreamParamsConfigSchema,Id as cameraCredentialsCapability,pn as cameraStreamsCapability,Mm as classifyStream,pp as classifyStreams,Gm as cosineSimilarity,Bp as createDeviceProxy,$n as createEvent,Vn as createLazyTrpcSource,Tp as createMirrorSource,su as createRuntimeStateBridge,M as createSliceHandle,lu as createSystemProxy,uu as customAction,wc as decoderCapability,mu as defineCustomActions,_r as detectionPipelineCapability,mn as deviceDiscoveryCapability,cc as deviceExportCapability,ar as deviceManagerCapability,Co as deviceMatchesProfile,Sd as deviceOpsCapability,Cn as deviceProviderCapability,nr as deviceStateCapability,xt as deviceStatusCapability,un as doorbellCapability,Vc as embeddingEncoderCapability,Cm as emitDownForOwnedCaps,tp as emitReadiness,bo as errMsg,du as evaluateZoneRules,V as event,ud as eventsCapability,Xp as expandCapMethods,Tt as featureProbeCapability,Ym as formatForBackend,Qm as formatForRuntime,Zp as getAudioMacroClassIds,Nu as getCapsByProviderKind,Km as hfModelUrl,sa as hydrateSchema,Bl as integrationsCapability,Ed as intercomCapability,Sm as isAgentOnlyPlacement,ym as isDeployableToAgent,em as isDeviceConfigCap,km as isEvent,Yd as localNetworkCapability,xi as logDestinationCapability,jp as mapAudioLabelToMacro,Pu as maskUrlCredentials,el as meshNetworkCapability,c as method,cd as metricsProviderCapability,vn as motionCapability,ds as motionDetectionCapability,Sn as motionTriggerCapability,fn as motionZonesCapability,Xi as mqttBrokerCapability,Td as nativeObjectDetectionCapability,cr as networkAccessCapability,vl as networkQualityCapability,Dl as nodesCapability,np as normalizeAddonInitResult,gr as notificationOutputCapability,Li as oauthIntegrationCapability,Nd as osdCapability,xm as parseCameraStreamConfig,Wm as parseJsonArray,$m as parseJsonObject,Wn as parseJsonUnknown,hu as parseStreamParamsFormPatch,Zr as pipelineAnalyticsCapability,Ts as pipelineExecutorCapability,Bc as pipelineOrchestratorCapability,_s as pipelineRunnerCapability,Wd as platformProbeCapability,bn as ptzAutotrackCapability,pd as ptzCapability,Jm as pythonScriptForBackend,et as readinessKey,kd as rebootCapability,hd as recordingCapability,Lr as recordingEngineCapability,Xm as requiresPython,Be as resolveAddonExecution,fm as resolveAddonGroup,Im as resolveAddonPlacement,Zm as resolveAddonRuntime,bp as resolveDetectionRuntime,Jp as resolveDeviceProfile,jm as resolveModelFormat,bm as resolveRunnerId,Nc as restreamerCapability,eu as runInferenceStep,le as scopeKey,Ei as settingsStoreCapability,$i as smtpProviderCapability,pr as snapshotCapability,mr as snapshotProviderCapability,Oi as ssoBridgeCapability,ri as storageCapability,bi as storageProviderCapability,as as streamBrokerCapability,In as streamParamsCapability,lp as streamPixels,Dm as streamQualityLabel,Vo as streamingEngineCapability,kn as switchCapability,ul as systemCapability,Ap as toDeviceSummary,Em as toStreamSourceEntry,Sl as toastCapability,dr as turnProviderCapability,ll as userManagementCapability,Fi as userPasskeysCapability,Pc as webrtcCapability,En as webrtcClientHintsSchema,Mc as webrtcSessionCapability,ru as zodEntriesToConfigUI,wn as zoneAnalyticsCapability,An as zoneRulesCapability,gn as zonesCapability};
|