@camera.ui/server 0.0.63-internal.1 → 0.0.63
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/interface/index.html +44 -44
- package/dist/interface/js/{@primevue.CqtyCLKt.0.0.63-internal.1.js → @primevue.D_7clQ9D.0.0.63.js} +1 -1
- package/dist/interface/js/@tanstack.BSC4wwmS.0.0.63.js +1 -0
- package/dist/interface/js/{@vee-validate.DwnTmCFe.0.0.63-internal.1.js → @vee-validate.DLXLKcbH.0.0.63.js} +1 -1
- package/dist/interface/js/@vueuse.BKr_9ZHe.0.0.63.js +1 -0
- package/dist/interface/js/Adminpanel.CgnDDe0k.0.0.63.js +1 -0
- package/dist/interface/js/Camera.CyBZZ28c.0.0.63.js +1 -0
- package/dist/interface/js/{Cameras.C6k8Wc8c.0.0.63-internal.1.js → Cameras.xyNhttxc.0.0.63.js} +1 -1
- package/dist/interface/js/Cammesh.CrlhW6m8.0.0.63.js +1 -0
- package/dist/interface/js/Camview.C8yUnqeH.0.0.63.js +1 -0
- package/dist/interface/js/Config.BHb_92sr.0.0.63.js +2 -0
- package/dist/interface/js/Console.gVRCs4SQ.0.0.63.js +4 -0
- package/dist/interface/js/CuiConsole.tVTZVJ2r.0.0.63.js +1 -0
- package/dist/interface/js/CuiPluginCard.BxI4Y206.0.0.63.js +4 -0
- package/dist/interface/js/CuiTimeline.Ddo5H5eu.0.0.63.js +1 -0
- package/dist/interface/js/FirstSteps.BLNp-T2e.0.0.63.js +1 -0
- package/dist/interface/js/Plugin.BzcStDGT.0.0.63.js +1 -0
- package/dist/interface/js/Plugins.Bru4qZHM.0.0.63.js +1 -0
- package/dist/interface/js/Recordings.BfDGF8yy.0.0.63.js +1 -0
- package/dist/interface/js/Settings.A2rkEnZf.0.0.63.js +1 -0
- package/dist/interface/js/SettingsAccount.kSQHHipN.0.0.63.js +1 -0
- package/dist/interface/js/SettingsAppearance.DrK-Y9Dz.0.0.63.js +1 -0
- package/dist/interface/js/SettingsAppearance.vue_vue_type_script_setup_true_lang.rhYz8TOv.0.0.63.js +1 -0
- package/dist/interface/js/SettingsBackup.BrO__F6s.0.0.63.js +1 -0
- package/dist/interface/js/SettingsRecordings.CKLA9Mcy.0.0.63.js +1 -0
- package/dist/interface/js/SettingsRemote.Cc_G0w05.0.0.63.js +1 -0
- package/dist/interface/js/SettingsSystem.Bc3mt8Pc.0.0.63.js +1 -0
- package/dist/interface/js/SettingsUsers.DUeBe8dg.0.0.63.js +1 -0
- package/dist/interface/js/VersionsHandler.vue_vue_type_script_setup_true_lang.CQoernTX.0.0.63.js +4 -0
- package/dist/interface/js/{ace-builds.DR0QhVMd.0.0.63-internal.1.js → ace-builds.Ci20Oe4V.0.0.63.js} +2 -2
- package/dist/interface/js/ace.config.D89CcLgS.0.0.63.js +1 -0
- package/dist/interface/js/backup.DXMIOgSB.0.0.63.js +1 -0
- package/dist/interface/js/{chart.js.D_yLwuUt.0.0.63-internal.1.js → chart.js.DZ1vEHB7.0.0.63.js} +1 -1
- package/dist/interface/js/close-circle.DfpkK7eV.0.0.63.js +1 -0
- package/dist/interface/js/dnd-core.DRZXbJM9.0.0.63.js +1 -0
- package/dist/interface/js/{draggabilly.z6N0YiJq.0.0.63-internal.1.js → draggabilly.o_TJc_mc.0.0.63.js} +1 -1
- package/dist/interface/js/engine.io-client.DKSc90ta.0.0.63.js +1 -0
- package/dist/interface/js/fast-deep-equal.BkqdlJZE.0.0.63.js +1 -0
- package/dist/interface/js/{highlight.js.DPZXtNMN.0.0.63-internal.1.js → highlight.js.DyOtvXLH.0.0.63.js} +1 -1
- package/dist/interface/js/linkify-it.DGDBcHC0.0.0.63.js +1 -0
- package/dist/interface/js/{main.D15XYqzn.0.0.63-internal.1.js → main.nKfYd2aY.0.0.63.js} +3 -3
- package/dist/interface/js/{markdown-it.DIP68NWE.0.0.63-internal.1.js → markdown-it.M3A8AdOh.0.0.63.js} +1 -1
- package/dist/interface/js/{nprogress.aQm5L1--.0.0.63-internal.1.js → nprogress.IzIs0JFK.0.0.63.js} +1 -1
- package/dist/interface/js/{pinia.C-E9NxBs.0.0.63-internal.1.js → pinia.DVtqAP8S.0.0.63.js} +1 -1
- package/dist/interface/js/{primevue.BrJeQg-D.0.0.63-internal.1.js → primevue.CoZ9R2Q2.0.0.63.js} +1 -1
- package/dist/interface/js/{qrcode.iDFhGM5u.0.0.63-internal.1.js → qrcode.J-jUQ3O7.0.0.63.js} +1 -1
- package/dist/interface/js/react-dnd-touch-backend.r6ZvPP1w.0.0.63.js +1 -0
- package/dist/interface/js/refresh-rounded.Cj4edEnQ.0.0.63.js +1 -0
- package/dist/interface/js/{rxjs.CA224vHi.0.0.63-internal.1.js → rxjs.B3taOakU.0.0.63.js} +1 -1
- package/dist/interface/js/socket.io-client.CoxRrB0i.0.0.63.js +1 -0
- package/dist/interface/js/socket.io-parser.CS2MblGy.0.0.63.js +1 -0
- package/dist/interface/js/system.DjVJ4skZ.0.0.63.js +1 -0
- package/dist/interface/js/trash-fill.DQ11gskZ.0.0.63.js +1 -0
- package/dist/interface/js/{unidragger.Ce9qFTax.0.0.63-internal.1.js → unidragger.DbVT_hUC.0.0.63.js} +1 -1
- package/dist/interface/js/{vee-validate.f3lxPCeQ.0.0.63-internal.1.js → vee-validate.DJQ5Z65z.0.0.63.js} +1 -1
- package/dist/interface/js/vue-chartjs.DZnMEgA0.0.0.63.js +1 -0
- package/dist/interface/js/{vue-i18n.jMmTVww-.0.0.63-internal.1.js → vue-i18n.0nnpASs4.0.0.63.js} +1 -1
- package/dist/interface/js/vue-inline-svg.DwQ6AJRv.0.0.63.js +1 -0
- package/dist/interface/js/{vue-router.w5QQqiZH.0.0.63-internal.1.js → vue-router.CtXJ7SHU.0.0.63.js} +1 -1
- package/dist/interface/js/vue-zoomable.CyClhEiW.0.0.63.js +1 -0
- package/dist/interface/js/vue3-dnd.CJgQfdRH.0.0.63.js +1 -0
- package/dist/interface/js/zoom-out.Uoc_DZyc.0.0.63.js +1 -0
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +3 -3
- package/package.json +3 -3
- package/dist/interface/js/@tanstack.-CPyCYGF.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/@vueuse.DCl2sYi2.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Adminpanel.dCaulgaY.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Camera.B4vetGvq.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Cammesh.DNE-fP9z.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Camview.Dzn4neuZ.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Config.B3nUxiLs.0.0.63-internal.1.js +0 -2
- package/dist/interface/js/Console.D1z8d2h4.0.0.63-internal.1.js +0 -4
- package/dist/interface/js/CuiConsole.Dn9rUoHf.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/CuiPluginCard.Cw3oiVRg.0.0.63-internal.1.js +0 -4
- package/dist/interface/js/CuiTimeline.CzDqP6gl.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/FirstSteps.CxXFvcQ8.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Plugin.D02guXa1.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Plugins.BnuS6Ctu.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Recordings.cX_pQS5L.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/Settings.Ba3RiuvP.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsAccount.BslKxD4b.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsAppearance.BKZMO5li.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsAppearance.vue_vue_type_script_setup_true_lang.Ob4qnLNP.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsBackup.C_iMHLx4.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsRecordings.CCvVmc-U.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsRemote.PQLlxhbn.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsSystem.C2wWU7KL.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/SettingsUsers.ByKS5fCb.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/VersionsHandler.vue_vue_type_script_setup_true_lang.BwVudk7G.0.0.63-internal.1.js +0 -4
- package/dist/interface/js/ace.config.4JzNE3aE.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/backup.Bbjjhjzg.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/close-circle.B1uOF3rN.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/dnd-core.6p9ee2MI.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/engine.io-client.-shgo3yC.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/fast-deep-equal.BcnK3M2c.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/linkify-it.C-tqq8kS.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/react-dnd-touch-backend.CQLQFoQ5.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/refresh-rounded.DzyQW3l3.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/socket.io-client.B2bMDSrp.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/socket.io-parser.DcGq--hP.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/system.CUrUlrbh.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/trash-fill.Az0x18aS.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/vue-chartjs.C0eRyq-H.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/vue-inline-svg.CntWe0ll.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/vue-zoomable.6LMR-QhL.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/vue3-dnd.FglIoNpF.0.0.63-internal.1.js +0 -1
- package/dist/interface/js/zoom-out.lkdnezsO.0.0.63-internal.1.js +0 -1
- /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.63-internal.1.css → @xterm.DYP7pi_n.0.0.63.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.63-internal.1.css → Adminpanel.BKek2EMH.0.0.63.css} +0 -0
- /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.63-internal.1.css → Cameras.BDWZJqPN.0.0.63.css} +0 -0
- /package/dist/interface/assets/{Camview.Cvhuou6V.0.0.63-internal.1.css → Camview.Cvhuou6V.0.0.63.css} +0 -0
- /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.63-internal.1.css → CuiConsole.DCYyxdVg.0.0.63.css} +0 -0
- /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.63-internal.1.css → CuiPluginCard.yF8V0SZY.0.0.63.css} +0 -0
- /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.63-internal.1.css → CuiTimeline.BkIwlYtw.0.0.63.css} +0 -0
- /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.63-internal.1.css → Plugin.DJElsAn5.0.0.63.css} +0 -0
- /package/dist/interface/assets/{Plugins.BwPlcRrV.0.0.63-internal.1.css → Plugins.BwPlcRrV.0.0.63.css} +0 -0
- /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.63-internal.1.css → Settings.CkgfRkQr.0.0.63.css} +0 -0
- /package/dist/interface/assets/{SettingsAccount.CDZT7gN-.0.0.63-internal.1.css → SettingsAccount.CDZT7gN-.0.0.63.css} +0 -0
- /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.63-internal.1.css → SettingsBackup.CX0rT0QJ.0.0.63.css} +0 -0
- /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.63-internal.1.css → highlight.Ch2EwETz.0.0.63.css} +0 -0
- /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.63-internal.1.png → logo-256.BCQk9H1-.0.0.63.png} +0 -0
- /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.63-internal.1.png → logo-512.DLKVOU2S.0.0.63.png} +0 -0
- /package/dist/interface/assets/{logo.DmEiRk0z.0.0.63-internal.1.png → logo.DmEiRk0z.0.0.63.png} +0 -0
- /package/dist/interface/assets/{main.DYKKLRxP.0.0.63-internal.1.css → main.DYKKLRxP.0.0.63.css} +0 -0
- /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.63-internal.1.js → mode-json.Br7xisR1.0.0.63.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.63-internal.1.js → mode-yaml.CIYL8U3d.0.0.63.js} +0 -0
- /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.63-internal.1.js → worker-base.jEXLGV2h.0.0.63.js} +0 -0
- /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.63-internal.1.js → worker-json.DgwNIOck.0.0.63.js} +0 -0
- /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.63-internal.1.js → worker-yaml.B3uUYINB.0.0.63.js} +0 -0
- /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.63-internal.1.js → @babel.l0sNRNKZ.0.0.63.js} +0 -0
- /package/dist/interface/js/{@intlify.BkGPX90O.0.0.63-internal.1.js → @intlify.BkGPX90O.0.0.63.js} +0 -0
- /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.63-internal.1.js → @kurkle.D8fDXNIl.0.0.63.js} +0 -0
- /package/dist/interface/js/{@primeuix.BkBDkSvZ.0.0.63-internal.1.js → @primeuix.BkBDkSvZ.0.0.63.js} +0 -0
- /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.63-internal.1.js → @react-dnd.CcwRs9xb.0.0.63.js} +0 -0
- /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.63-internal.1.js → @socket.io.Dkula2eQ.0.0.63.js} +0 -0
- /package/dist/interface/js/{@vue.Dh6viqaK.0.0.63-internal.1.js → @vue.Dh6viqaK.0.0.63.js} +0 -0
- /package/dist/interface/js/{@xterm.CC2uq0fH.0.0.63-internal.1.js → @xterm.BXZNujCq.0.0.63.js} +0 -0
- /package/dist/interface/js/{axios.DHr9lByg.0.0.63-internal.1.js → axios.DHr9lByg.0.0.63.js} +0 -0
- /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.63-internal.1.js → birpc.l0sNRNKZ.0.0.63.js} +0 -0
- /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.63-internal.1.js → compare-versions.DqEOhma6.0.0.63.js} +0 -0
- /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.63-internal.1.js → dijkstrajs.C00ieaqj.0.0.63.js} +0 -0
- /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.63-internal.1.js → engine.io-parser.BiEtp6m2.0.0.63.js} +0 -0
- /package/dist/interface/js/{entities.C20TfXL6.0.0.63-internal.1.js → entities.C20TfXL6.0.0.63.js} +0 -0
- /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.63-internal.1.js → ev-emitter.X5f1qa-c.0.0.63.js} +0 -0
- /package/dist/interface/js/{get-size.D1dS-IaP.0.0.63-internal.1.js → get-size.D1dS-IaP.0.0.63.js} +0 -0
- /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.63-internal.1.js → hookable.l0sNRNKZ.0.0.63.js} +0 -0
- /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.63-internal.1.js → mdurl.k9Sl0PQj.0.0.63.js} +0 -0
- /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.63-internal.1.js → perfect-debounce.l0sNRNKZ.0.0.63.js} +0 -0
- /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.63-internal.1.js → primelocale.Bga3dOQu.0.0.63.js} +0 -0
- /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.63-internal.1.js → punycode.js.Dj65hjkv.0.0.63.js} +0 -0
- /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.63-internal.1.js → react-dnd-html5-backend.1HQjlkwI.0.0.63.js} +0 -0
- /package/dist/interface/js/{redux.BFxtlG_c.0.0.63-internal.1.js → redux.BFxtlG_c.0.0.63.js} +0 -0
- /package/dist/interface/js/{tslib.9k7AwCpt.0.0.63-internal.1.js → tslib.9k7AwCpt.0.0.63.js} +0 -0
- /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.63-internal.1.js → uc.micro.kMc2yuuw.0.0.63.js} +0 -0
- /package/dist/interface/js/{uuid.C6aID195.0.0.63-internal.1.js → uuid.C6aID195.0.0.63.js} +0 -0
- /package/dist/interface/js/{vue.l0sNRNKZ.0.0.63-internal.1.js → vue.l0sNRNKZ.0.0.63.js} +0 -0
- /package/dist/interface/js/{zod.sy4ilHCy.0.0.63-internal.1.js → zod.sy4ilHCy.0.0.63.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/FirstSteps.
|
|
2
|
-
var A0=Object.defineProperty;var _u=s=>{throw TypeError(s)};var M0=(s,e,t)=>e in s?A0(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var p=(s,e,t)=>M0(s,typeof e!="symbol"?e+"":e,t),Da=(s,e,t)=>e.has(s)||_u("Cannot "+t);var An=(s,e,t)=>(Da(s,e,"read from private field"),t?t.call(s):e.get(s)),Yn=(s,e,t)=>e.has(s)?_u("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),Zr=(s,e,t,n)=>(Da(s,e,"write to private field"),n?n.call(s,t):e.set(s,t),t),gt=(s,e,t)=>(Da(s,e,"access private method"),t);import{u as Ci,a as Bt,b as ut,V as $0}from"./@tanstack.-CPyCYGF.0.0.63-internal.1.js";import{T as P0,s as T0,a as Lr,b as ys,c as jr,d as Ea,e as ki,f as Fh,g as R0,h as Lh,D as yu,i as Qc,j as fo,k as I0,l as go,m as Aa,n as Kc,o as jh,p as Zc,q as qh,r as Dh,t as Gc,u as Wc,v as Jc,w as Yc,x as Bh,y as zh,z as Uh,A as O0,B as N0,C as F0,E as L0,F as j0,G as q0,H as D0,I as B0,J as z0,K as U0}from"./primevue.BrJeQg-D.0.0.63-internal.1.js";import{F as pe,c as A,d as m,e as g,B as At,r as ae,o as Sn,a4 as Ma,L as Pt,h as c,R as y,P as at,M as j,O as ce,W as ot,y as Ls,k as ne,w as Ge,t as Wt,N as $,Y as Pr,J as Ei,m as et,V as Et,I as me,ac as Vt,f as us,ab as Vh,b as Tr,A as Xs,a7 as vo,H as Qt,X as yt,Z as qt,i as mi,a5 as Xc,a0 as V0,Q as Ai,ad as el,n as Zs,G as ei,D as bu,_ as Hh,S as H0,ae as Kn,af as Rr,$ as lr,ag as Q0,a1 as K0,T as Qh,ah as Z0}from"./@vue.Dh6viqaK.0.0.63-internal.1.js";import{v as Kh,u as tl,a as G0,c as sl,b as W0,d as J0,e as Zh,o as nl,f as Gh,g as Y0,h as X0,i as ef,r as wu,j as lc,k as tf,l as ri,m as rl,n as sf,p as fn,q as nf,s as xu,t as rf,w as of,x as Eo,y as af,z as cf}from"./@vueuse.DCl2sYi2.0.0.63-internal.1.js";import{a as lf,A as uf}from"./axios.DHr9lByg.0.0.63-internal.1.js";import{u as js,c as df}from"./vue-i18n.jMmTVww-.0.0.63-internal.1.js";import{d as Mi,s as Vs,c as hf}from"./pinia.C-E9NxBs.0.0.63-internal.1.js";import{u as qr,a as $i,c as mf,b as pf}from"./vue-router.w5QQqiZH.0.0.63-internal.1.js";import{R as $a}from"./vue-inline-svg.CntWe0ll.0.0.63-internal.1.js";import{F as il,a as Lt,E as jt}from"./vee-validate.f3lxPCeQ.0.0.63-internal.1.js";import{t as Wn}from"./@vee-validate.DwnTmCFe.0.0.63-internal.1.js";import{o as bt,c as xs,u as Os,l as we,t as ff,n as xn,s as Ke,d as ur,r as ol,e as Hn,f as gf,g as Su,h as vf,i as al,j as Wh,k as Cu}from"./zod.sy4ilHCy.0.0.63-internal.1.js";import{v as hn}from"./uuid.C6aID195.0.0.63-internal.1.js";import{M as _f}from"./socket.io-client.B2bMDSrp.0.0.63-internal.1.js";import{O as yf}from"./rxjs.CA224vHi.0.0.63-internal.1.js";import{H as Gr,t as bf,y as wf,j as xf,p as Sf}from"./highlight.js.DPZXtNMN.0.0.63-internal.1.js";import{M as Cf}from"./markdown-it.DIP68NWE.0.0.63-internal.1.js";import{q as kf}from"./qrcode.iDFhGM5u.0.0.63-internal.1.js";import{D as Jh}from"./draggabilly.z6N0YiJq.0.0.63-internal.1.js";import{m as Ef}from"./vue-zoomable.6LMR-QhL.0.0.63-internal.1.js";import{e as Af,d as Mf}from"./primelocale.Bga3dOQu.0.0.63-internal.1.js";import{Y as $f,Z as Pf}from"./@primevue.CqtyCLKt.0.0.63-internal.1.js";import{a$ as Tf,b0 as Rf}from"./@primeuix.BkBDkSvZ.0.0.63-internal.1.js";import"./nprogress.aQm5L1--.0.0.63-internal.1.js";import"./@xterm.CC2uq0fH.0.0.63-internal.1.js";import"./@intlify.BkGPX90O.0.0.63-internal.1.js";import"./engine.io-client.-shgo3yC.0.0.63-internal.1.js";import"./engine.io-parser.BiEtp6m2.0.0.63-internal.1.js";import"./@socket.io.Dkula2eQ.0.0.63-internal.1.js";import"./socket.io-parser.DcGq--hP.0.0.63-internal.1.js";import"./tslib.9k7AwCpt.0.0.63-internal.1.js";import"./mdurl.k9Sl0PQj.0.0.63-internal.1.js";import"./uc.micro.kMc2yuuw.0.0.63-internal.1.js";import"./entities.C20TfXL6.0.0.63-internal.1.js";import"./linkify-it.C-tqq8kS.0.0.63-internal.1.js";import"./punycode.js.Dj65hjkv.0.0.63-internal.1.js";import"./dijkstrajs.C00ieaqj.0.0.63-internal.1.js";import"./get-size.D1dS-IaP.0.0.63-internal.1.js";import"./unidragger.Ce9qFTax.0.0.63-internal.1.js";import"./ev-emitter.X5f1qa-c.0.0.63-internal.1.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=t(r);fetch(r.href,i)}})();const If=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Of=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Nf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ff=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Lf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),jf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),qf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Df=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zf(s,e){return m(),A("svg",Bf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M5.41 7.41L10 12l-4.59 4.59L4 15.17L7.17 12L4 8.83zm13.18 9.18L14 12l4.59-4.58L20 8.83L16.83 12L20 15.17z"},null,-1)]))}const Uf=pe({name:"mdi-unfold-less-vertical",render:zf}),Vf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hf(s,e){return m(),A("svg",Vf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 18.17L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15M12 5.83L15.17 9l1.41-1.41L12 3L7.41 7.59L8.83 9z"},null,-1)]))}const Qf=pe({name:"mdi-unfold-more-horizontal",render:Hf}),Kf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zf(s,e){return m(),A("svg",Kf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13H5v-2h14z"},null,-1)]))}const Gf=pe({name:"mdi-minus",render:Zf}),Wf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jf(s,e){return m(),A("svg",Wf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"},null,-1)]))}const _o=pe({name:"mdi-close",render:Jf}),Yf={class:"fixed flex flex-row items-center z-[99999] top-0 left-[7px] gap-2 p-2 non-draggable-region"},Xf=At({__name:"CuiWindowButtons",setup(s){const e=ae(!1),t=ae(!1),n=()=>{var a;t.value||(a=window.electron)==null||a.send("change-window","minify")},r=()=>{var a;(a=window.electron)==null||a.send("change-window","close")},i=()=>{var a;(a=window.electron)==null||a.send("change-window","expand")},o=(a,l)=>{t.value=l};return Sn(()=>{var a;(a=window.electron)==null||a.on("fullscreen",o)}),Ma(()=>{var a;(a=window.electron)==null||a.removeListener("fullscreen",o)}),(a,l)=>{const u=_o,d=Gf,h=Qf,v=Uf;return Pt((m(),A("div",Yf,[g("div",{class:"close-button",onClick:r},[y(u,{color:"#7f050a",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"])]),g("div",{class:at({"disabled-button":c(t),"minify-button":!c(t)}),onClick:n},[c(t)?ce("",!0):(m(),j(d,{key:0,color:"#995712",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"]))],2),g("div",{class:"expand-button",style:ot(`${c(t)?"transform: rotate(45deg)":"transform: rotate(-45deg)"}`),onClick:i},[c(t)?(m(),j(v,{key:1,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"])):(m(),j(h,{key:0,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"]))],4)])),[[c(Kh),f=>e.value=f]])}}}),qs=(s,e)=>{const t=s.__vccOpts||s;for(const[n,r]of e)t[n]=r;return t},e1=qs(Xf,[["__scopeId","data-v-8dab6fc2"]]),t1={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s1(s,e){return m(),A("svg",t1,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 6a7.75 7.75 0 1 0 10 0m-5-2v8"},null,-1)]))}const Yh=pe({name:"tabler-power",render:s1}),n1="/assets/logo-512.DLKVOU2S.0.0.63-internal.1.png",r1=Object.freeze(Object.defineProperty({__proto__:null,default:n1},Symbol.toStringTag,{value:"Module"})),i1="/assets/logo-256.BCQk9H1-.0.0.63-internal.1.png",o1=Object.freeze(Object.defineProperty({__proto__:null,default:i1},Symbol.toStringTag,{value:"Module"})),a1="/assets/logo-512.DLKVOU2S.0.0.63-internal.1.png",c1=Object.freeze(Object.defineProperty({__proto__:null,default:a1},Symbol.toStringTag,{value:"Module"})),l1="/assets/logo.DmEiRk0z.0.0.63-internal.1.png",u1=Object.freeze(Object.defineProperty({__proto__:null,default:l1},Symbol.toStringTag,{value:"Module"})),d1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20233.63%20233.63'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:url(%23dark_wine);}.cls-2{fill:url(%23light_wine);}.cls-3{fill:none;stroke:%23000;stroke-miterlimit:10;opacity:0;}.cls-4{fill:%23c5c6c8;}.cls-5{fill:%231a1e21;stroke:%233a3a3a;stroke-width:2px;}.cls-6{fill:%23fff;}%3c/style%3e%3clinearGradient%20id='dark_wine'%20x1='87.36'%20y1='158.67'%20x2='87.36'%20y2='59.85'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23730000'/%3e%3cstop%20offset='0.49'%20stop-color='%23a51733'/%3e%3c/linearGradient%3e%3clinearGradient%20id='light_wine'%20x1='113.06'%20y1='197.59'%20x2='113.06'%20y2='80.87'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23f44a6b'/%3e%3cstop%20offset='0.28'%20stop-color='%23df294c'/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='CameraUI_U'%3e%3cpath%20id='U_Left'%20class='cls-1'%20d='M47.05,119.47s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86A49.46,49.46,0,0,0,99,158.62c9.43-.46,20.55-3.87,29.24-11.86-3.9,2.5-9.87,5.1-15.9,4.77a25.63,25.63,0,0,1-18.38-9.09c-9.39-10.31-7.62-28.35-7.75-32.68-.35-11.42.77-21.92-1.76-36.19-.46-2.64-1.79-5.19-4.55-8-1.83-1.86-8.4-5.75-13.42-5.74-7.31,0-12.95,3.71-15.38,7.84-2,3.41-3.06,4.22-4.23,25.08a217.23,217.23,0,0,0,.22,26.76Z'%20transform='translate(0.5%200.5)'/%3e%3cpath%20id='U_Right'%20class='cls-2'%20d='M144.12,89.6a16.24,16.24,0,0,1,4.06-4.9c4.16-3.4,9-3.67,10.92-3.82a19.7,19.7,0,0,1,12.53,4.58c1.19,1,6.11,5.58,7.13,17.29.73,8.51,3.31,65.93-37,87.14-4.22,2.22-18,9.25-35.66,7.38a62.43,62.43,0,0,1-20.8-6.11,65.8,65.8,0,0,1-18.89-14.23c-20.21-21.67-19.36-57.46-19.36-57.46s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86A49.46,49.46,0,0,0,99,158.62c11.66-.57,25.93-5.64,35-18.32C143.52,126.8,138.46,100.51,144.12,89.6Z'%20transform='translate(0.5%200.5)'/%3e%3c/g%3e%3cg%20id='CameraUI_Lens'%3e%3ccircle%20id='ellipse'%20class='cls-3'%20cx='116.81'%20cy='116.81'%20r='116.31'/%3e%3cg%20id='lens'%3e%3ccircle%20id='lens_bg'%20class='cls-4'%20cx='159.13'%20cy='58.39'%20r='18.66'/%3e%3cpath%20id='lens_inner'%20class='cls-5'%20d='M169.64,58.31a11,11,0,1,1-22,0c0-6.08,4.93-11.86,11-11.86S169.64,52.23,169.64,58.31Z'%20transform='translate(0.5%200.5)'/%3e%3cg%20id='reflections'%3e%3cellipse%20id='dot_1'%20class='cls-6'%20cx='174.36'%20cy='53.69'%20rx='1.84'%20ry='1.42'/%3e%3cellipse%20id='dot_2'%20class='cls-6'%20cx='174.36'%20cy='57.08'%20rx='1.84'%20ry='1.42'/%3e%3cellipse%20id='dot_3'%20class='cls-6'%20cx='174.36'%20cy='60.46'%20rx='1.84'%20ry='1.42'/%3e%3ccircle%20id='dot_4'%20class='cls-6'%20cx='164.09'%20cy='63.77'%20r='1.66'/%3e%3cpath%20id='wide_1'%20class='cls-6'%20d='M156.63,48.9c-1.07-.88-5.52,3.09-6.31,5.43a1.53,1.53,0,0,0,0,1.26c.43.69,1.73.61,2.19.54,2.68-.44,4.71-4.09,4.8-4.37A3.21,3.21,0,0,0,156.63,48.9Z'%20transform='translate(0.5%200.5)'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",h1=Object.freeze(Object.defineProperty({__proto__:null,default:d1},Symbol.toStringTag,{value:"Module"})),m1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20132.55%20158.35'%20width='132.5500030517578'%20height='158.35000610351562'%3e%3cdefs%3e%3cstyle%3e.cls-2-1{fill:url(%23dark_wine);}.cls-2-2{fill:url(%23light_wine);}.cls-2-3{fill:%23c5c6c8;}.cls-2-4{fill:%231a1e21;stroke:%233a3a3a;stroke-width:2px;}.cls-2-5{fill:%23fff;}%3c/style%3e%3clinearGradient%20id='dark_wine'%20x1='45.89'%20y1='124.26'%20x2='45.89'%20y2='25.44'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23730000'%3e%3c/stop%3e%3cstop%20offset='0.49'%20stop-color='%23a51733'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20id='light_wine'%20x1='71.59'%20y1='163.18'%20x2='71.59'%20y2='46.47'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23f44a6b'%3e%3c/stop%3e%3cstop%20offset='0.28'%20stop-color='%23df294c'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='CameraUI_U'%3e%3cpath%20id='U_Left'%20class='cls-2-1%20svg-elem-1'%20d='M5.58,85.06s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86,49.46,49.46,0,0,0,21.42,3.87c9.43-.46,20.55-3.87,29.24-11.86-3.9,2.5-9.87,5.1-15.9,4.77A25.68,25.68,0,0,1,52.44,108c-9.38-10.31-7.61-28.35-7.74-32.68-.35-11.42.77-21.92-1.76-36.19-.46-2.64-1.79-5.19-4.55-8C36.55,29.33,30,25.43,25,25.44c-7.31,0-12.95,3.72-15.38,7.84-2,3.41-3.07,4.22-4.23,25.08a217.23,217.23,0,0,0,.22,26.76Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3cpath%20id='U_Right'%20class='cls-2-2%20svg-elem-2'%20d='M102.65,55.19a16.24,16.24,0,0,1,4.06-4.9c4.16-3.4,9-3.67,10.92-3.82a19.7,19.7,0,0,1,12.53,4.58c1.19,1,6.11,5.58,7.12,17.29.74,8.51,3.32,65.93-37,87.14-4.22,2.22-18,9.26-35.66,7.38a62.43,62.43,0,0,1-20.8-6.11,65.8,65.8,0,0,1-18.89-14.23C4.73,120.85,5.58,85.06,5.58,85.06s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86,49.46,49.46,0,0,0,21.42,3.87c11.66-.57,25.93-5.64,35-18.32C102.05,92.39,97,66.1,102.65,55.19Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3c/g%3e%3cg%20id='CameraUI_Lens'%3e%3ccircle%20id='lens_bg'%20class='cls-2-3%20svg-elem-3'%20cx='112.11'%20cy='18.66'%20r='18.66'%3e%3c/circle%3e%3cpath%20id='lens_inner'%20class='cls-2-4%20svg-elem-4'%20d='M128.17,23.9a11,11,0,1,1-22,0c0-6.08,4.93-11.86,11-11.86S128.17,17.82,128.17,23.9Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3cg%20id='reflections'%3e%3cellipse%20id='dot_1'%20class='cls-2-5%20svg-elem-5'%20cx='127.34'%20cy='13.96'%20rx='1.84'%20ry='1.42'%3e%3c/ellipse%3e%3cellipse%20id='dot_2'%20class='cls-2-5%20svg-elem-6'%20cx='127.34'%20cy='17.34'%20rx='1.84'%20ry='1.42'%3e%3c/ellipse%3e%3cellipse%20id='dot_3'%20class='cls-2-5%20svg-elem-7'%20cx='127.34'%20cy='20.73'%20rx='1.84'%20ry='1.42'%3e%3c/ellipse%3e%3ccircle%20id='dot_4'%20class='cls-2-5%20svg-elem-8'%20cx='117.07'%20cy='24.04'%20r='1.66'%3e%3c/circle%3e%3cpath%20id='wide_1'%20class='cls-2-5%20svg-elem-9'%20d='M115.16,14.49c-1.07-.88-5.52,3.09-6.31,5.43a1.53,1.53,0,0,0,0,1.26c.43.69,1.73.61,2.18.54,2.69-.44,4.72-4.09,4.81-4.37A3.21,3.21,0,0,0,115.16,14.49Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",p1=Object.freeze(Object.defineProperty({__proto__:null,default:m1},Symbol.toStringTag,{value:"Module"})),f1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='-40%20-30%20300%20300'%3e%3cdefs%3e%3cstyle%3e.cls-3-1%20{fill:%20url(%23dark_wine);}%20.cls-3-2%20{fill:%20url(%23light_wine);}%20.cls-3-3%20{fill:%20none;stroke:%20%23000;stroke-miterlimit:%2010;opacity:%200;}%20.cls-3-4%20{fill:%20%23c5c6c8;}%20.cls-3-5%20{fill:%20%231a1e21;stroke:%20%233a3a3a;stroke-width:%202px;}%20.cls-3-6%20{fill:%20%23fff;}%3c/style%3e%3clinearGradient%20id='dark_wine'%20x1='220.57'%20y1='310.8'%20x2='220.57'%20y2='211.98'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23730000'%20/%3e%3cstop%20offset='0.49'%20stop-color='%23a51733'%20/%3e%3c/linearGradient%3e%3clinearGradient%20id='light_wine'%20x1='246.27'%20y1='349.71'%20x2='246.27'%20y2='233'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23f44a6b'%20/%3e%3cstop%20offset='0.28'%20stop-color='%23df294c'%20/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='CameraUI_U'%20class='cameraLetter'%3e%3cpath%20id='U_Left'%20class='cls-3-1'%20d='M180.26,271.6s7.57,16,14.11,23.42a45.43,45.43,0,0,0,16.38,11.86,49.46,49.46,0,0,0,21.42,3.87c9.42-.46,20.55-3.87,29.24-11.86-3.9,2.5-9.87,5.1-15.9,4.77a25.66,25.66,0,0,1-18.39-9.09c-9.38-10.31-7.61-28.35-7.74-32.68-.35-11.43.77-21.92-1.76-36.2-.47-2.63-1.79-5.18-4.55-8-1.84-1.86-8.41-5.75-13.43-5.74-7.3,0-12.94,3.71-15.38,7.84-2,3.41-3.06,4.22-4.22,25.08a215.27,215.27,0,0,0,.22,26.76Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3cpath%20id='U_Right'%20class='cls-3-2'%20d='M277.33,241.73a16.41,16.41,0,0,1,4.05-4.91c4.17-3.39,9-3.66,10.92-3.81a19.67,19.67,0,0,1,12.53,4.58c1.2,1,6.12,5.58,7.13,17.29.74,8.51,3.31,65.93-37,87.13-4.23,2.22-18,9.26-35.67,7.39a62.35,62.35,0,0,1-20.79-6.11,65.68,65.68,0,0,1-18.9-14.24c-20.2-21.66-19.35-57.45-19.35-57.45s7.57,16,14.11,23.42a45.43,45.43,0,0,0,16.38,11.86,49.46,49.46,0,0,0,21.42,3.87c11.66-.57,25.92-5.64,35-18.33C276.73,278.93,271.67,252.64,277.33,241.73Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3c/g%3e%3cg%20id='CameraUI_Lens'%3e%3cg%20id='lens'%20class='cameraLens'%3e%3ccircle%20id='lens_bg'%20class='cls-3-4'%20cx='159.13'%20cy='58.39'%20r='18.66'%20/%3e%3cpath%20id='lens_inner'%20class='cls-3-5'%20d='M302.85,210.44a11,11,0,1,1-22,0c0-6.08,4.93-11.86,11-11.86S302.85,204.36,302.85,210.44Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3cg%20id='reflections'%3e%3cellipse%20id='dot_1'%20class='cls-3-6'%20cx='174.36'%20cy='53.69'%20rx='1.84'%20ry='1.42'%20/%3e%3cellipse%20id='dot_2'%20class='cls-3-6'%20cx='174.36'%20cy='57.08'%20rx='1.84'%20ry='1.42'%20/%3e%3cellipse%20id='dot_3'%20class='cls-3-6'%20cx='174.36'%20cy='60.46'%20rx='1.84'%20ry='1.42'%20/%3e%3ccircle%20id='dot_4'%20class='cls-3-6'%20cx='164.09'%20cy='63.77'%20r='1.66'%20/%3e%3cpath%20id='wide_1'%20class='cls-3-6'%20d='M289.83,201c-1.07-.88-5.52,3.09-6.3,5.43a1.52,1.52,0,0,0,0,1.26c.43.69,1.72.61,2.18.53,2.68-.43,4.72-4.08,4.8-4.36A3.18,3.18,0,0,0,289.83,201Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",g1=Object.freeze(Object.defineProperty({__proto__:null,default:f1},Symbol.toStringTag,{value:"Module"}));var ku={};/*! For license information please see bundle.js.LICENSE.txt */var v1={69:s=>{var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,o=365.25*r;function a(l,u,d,h){var v=u>=1.5*d;return Math.round(l/d)+" "+h+(v?"s":"")}s.exports=function(l,u){u=u||{};var d=typeof l;if(d==="string"&&l.length>0)return function(h){if(!((h=String(h)).length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(v){var f=parseFloat(v[1]);switch((v[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}(l);if(d==="number"&&isFinite(l))return u.long?function(h){var v=Math.abs(h);return v>=r?a(h,v,r,"day"):v>=n?a(h,v,n,"hour"):v>=t?a(h,v,t,"minute"):v>=e?a(h,v,e,"second"):h+" ms"}(l):function(h){var v=Math.abs(h);return v>=r?Math.round(h/r)+"d":v>=n?Math.round(h/n)+"h":v>=t?Math.round(h/t)+"m":v>=e?Math.round(h/e)+"s":h+"ms"}(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))}},142:s=>{var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,o=365.25*r;function a(l,u,d,h){var v=u>=1.5*d;return Math.round(l/d)+" "+h+(v?"s":"")}s.exports=function(l,u){u=u||{};var d=typeof l;if(d==="string"&&l.length>0)return function(h){if(!((h=String(h)).length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(v){var f=parseFloat(v[1]);switch((v[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}(l);if(d==="number"&&isFinite(l))return u.long?function(h){var v=Math.abs(h);return v>=r?a(h,v,r,"day"):v>=n?a(h,v,n,"hour"):v>=t?a(h,v,t,"minute"):v>=e?a(h,v,e,"second"):h+" ms"}(l):function(h){var v=Math.abs(h);return v>=r?Math.round(h/r)+"d":v>=n?Math.round(h/n)+"h":v>=t?Math.round(h/t)+"m":v>=e?Math.round(h/e)+"s":h+"ms"}(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))}},287:(s,e,t)=>{s.exports=function(n){function r(a){let l,u,d,h=null;function v(...f){if(!v.enabled)return;const b=v,k=Number(new Date),z=k-(l||k);b.diff=z,b.prev=l,b.curr=k,l=k,f[0]=r.coerce(f[0]),typeof f[0]!="string"&&f.unshift("%O");let L=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(se,K)=>{if(se==="%%")return"%";L++;const N=r.formatters[K];if(typeof N=="function"){const E=f[L];se=N.call(b,E),f.splice(L,1),L--}return se}),r.formatArgs.call(b,f),(b.log||r.log).apply(b,f)}return v.namespace=a,v.useColors=r.useColors(),v.color=r.selectColor(a),v.extend=i,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(u!==r.namespaces&&(u=r.namespaces,d=r.enabled(a)),d),set:f=>{h=f}}),typeof r.init=="function"&&r.init(v),v}function i(a,l){const u=r(this.namespace+(l===void 0?":":l)+a);return u.log=this.log,u}function o(a,l){let u=0,d=0,h=-1,v=0;for(;u<a.length;)if(d<l.length&&(l[d]===a[u]||l[d]==="*"))l[d]==="*"?(h=d,v=u,d++):(u++,d++);else{if(h===-1)return!1;d=h+1,v++,u=v}for(;d<l.length&&l[d]==="*";)d++;return d===l.length}return r.debug=r,r.default=r,r.coerce=function(a){return a instanceof Error?a.stack||a.message:a},r.disable=function(){const a=[...r.names,...r.skips.map(l=>"-"+l)].join(",");return r.enable(""),a},r.enable=function(a){r.save(a),r.namespaces=a,r.names=[],r.skips=[];const l=(typeof a=="string"?a:"").trim().replace(" ",",").split(",").filter(Boolean);for(const u of l)u[0]==="-"?r.skips.push(u.slice(1)):r.names.push(u)},r.enabled=function(a){for(const l of r.skips)if(o(a,l))return!1;for(const l of r.names)if(o(a,l))return!0;return!1},r.humanize=t(142),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(a=>{r[a]=n[a]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(a){let l=0;for(let u=0;u<a.length;u++)l=(l<<5)-l+a.charCodeAt(u),l|=0;return r.colors[Math.abs(l)%r.colors.length]},r.enable(r.load()),r}},288:(s,e,t)=>{e.formatArgs=function(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+s.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;r.splice(1,0,i,"color: inherit");let o=0,a=0;r[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(o++,l==="%c"&&(a=o))}),r.splice(a,0,i)},e.save=function(r){try{r?e.storage.setItem("debug",r):e.storage.removeItem("debug")}catch{}},e.load=function(){let r;try{r=e.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=ku.DEBUG),r},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),s.exports=t(287)(e);const{formatters:n}=s.exports;n.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}},413:(s,e,t)=>{e.formatArgs=function(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+s.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;r.splice(1,0,i,"color: inherit");let o=0,a=0;r[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(o++,l==="%c"&&(a=o))}),r.splice(a,0,i)},e.save=function(r){try{r?e.storage.setItem("debug",r):e.storage.removeItem("debug")}catch{}},e.load=function(){let r;try{r=e.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=ku.DEBUG),r},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),s.exports=t(692)(e);const{formatters:n}=s.exports;n.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}},672:s=>{const e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,t=()=>e.now(),n=i=>i===1/0||(o=>o&&o===Math.floor(o)&&o>0&&isFinite(o))(i);class r{constructor({max:o=1/0,ttl:a,updateAgeOnGet:l=!1,checkAgeOnGet:u=!1,noUpdateTTL:d=!1,dispose:h,noDisposeOnSet:v=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,a!==void 0&&!n(a))throw new TypeError("ttl must be positive integer or Infinity if set");if(!n(o))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=a,this.max=o,this.updateAgeOnGet=!!l,this.checkAgeOnGet=!!u,this.noUpdateTTL=!!d,this.noDisposeOnSet=!!v,h!==void 0){if(typeof h!="function")throw new TypeError("dispose must be function if set");this.dispose=h}this.timer=void 0,this.timerExpiration=void 0}setTimer(o,a){if(this.timerExpiration<o)return;this.timer&&clearTimeout(this.timer);const l=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const u in this.expirations){this.setTimer(u,u-t());break}},a);l.unref&&l.unref(),this.timerExpiration=o,this.timer=l}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return process.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){const o=this.dispose!==r.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[a,l]of o)this.dispose(l,a,"delete")}setTTL(o,a=this.ttl){const l=this.expirationMap.get(o);if(l!==void 0){const u=this.expirations[l];!u||u.length<=1?delete this.expirations[l]:this.expirations[l]=u.filter(d=>d!==o)}if(a!==1/0){const u=Math.floor(t()+a);this.expirationMap.set(o,u),this.expirations[u]||(this.expirations[u]=[],this.setTimer(u,a)),this.expirations[u].push(o)}else this.expirationMap.set(o,1/0)}set(o,a,{ttl:l=this.ttl,noUpdateTTL:u=this.noUpdateTTL,noDisposeOnSet:d=this.noDisposeOnSet}={}){if(!n(l))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(o)){u||this.setTTL(o,l);const h=this.data.get(o);h!==a&&(this.data.set(o,a),d||this.dispose(h,o,"set"))}else this.setTTL(o,l),this.data.set(o,a);for(;this.size>this.max;)this.purgeToCapacity();return this}has(o){return this.data.has(o)}getRemainingTTL(o){const a=this.expirationMap.get(o);return a===1/0?a:a!==void 0?Math.max(0,Math.ceil(a-t())):0}get(o,{updateAgeOnGet:a=this.updateAgeOnGet,ttl:l=this.ttl,checkAgeOnGet:u=this.checkAgeOnGet}={}){const d=this.data.get(o);if(!u||this.getRemainingTTL(o)!==0)return a&&this.setTTL(o,l),d;this.delete(o)}dispose(o,a){}delete(o){const a=this.expirationMap.get(o);if(a!==void 0){const l=this.data.get(o);this.data.delete(o),this.expirationMap.delete(o);const u=this.expirations[a];return u&&(u.length<=1?delete this.expirations[a]:this.expirations[a]=u.filter(d=>d!==o)),this.dispose(l,o,"delete"),this.size===0&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(const o in this.expirations){const a=this.expirations[o];if(!(this.size-a.length>=this.max)){const l=this.size-this.max,u=[];for(const d of a.splice(0,l))u.push([d,this.data.get(d)]),this.data.delete(d),this.expirationMap.delete(d);for(const[d,h]of u)this.dispose(h,d,"evict");return}{delete this.expirations[o];const l=[];for(const u of a)l.push([u,this.data.get(u)]),this.data.delete(u),this.expirationMap.delete(u);for(const[u,d]of l)this.dispose(d,u,"evict")}}}get size(){return this.data.size}purgeStale(){const o=Math.ceil(t());for(const a in this.expirations){if(a==="Infinity"||a>o)return;const l=[...this.expirations[a]||[]],u=[];delete this.expirations[a];for(const d of l)u.push([d,this.data.get(d)]),this.data.delete(d),this.expirationMap.delete(d);for(const[d,h]of u)this.dispose(h,d,"stale")}this.size===0&&this.cancelTimer()}*entries(){for(const o in this.expirations)for(const a of this.expirations[o])yield[a,this.data.get(a)]}*keys(){for(const o in this.expirations)for(const a of this.expirations[o])yield a}*values(){for(const o in this.expirations)for(const a of this.expirations[o])yield this.data.get(a)}[Symbol.iterator](){return this.entries()}}s.exports=r},692:(s,e,t)=>{s.exports=function(n){function r(a){let l,u,d,h=null;function v(...f){if(!v.enabled)return;const b=v,k=Number(new Date),z=k-(l||k);b.diff=z,b.prev=l,b.curr=k,l=k,f[0]=r.coerce(f[0]),typeof f[0]!="string"&&f.unshift("%O");let L=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(se,K)=>{if(se==="%%")return"%";L++;const N=r.formatters[K];if(typeof N=="function"){const E=f[L];se=N.call(b,E),f.splice(L,1),L--}return se}),r.formatArgs.call(b,f),(b.log||r.log).apply(b,f)}return v.namespace=a,v.useColors=r.useColors(),v.color=r.selectColor(a),v.extend=i,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(u!==r.namespaces&&(u=r.namespaces,d=r.enabled(a)),d),set:f=>{h=f}}),typeof r.init=="function"&&r.init(v),v}function i(a,l){const u=r(this.namespace+(l===void 0?":":l)+a);return u.log=this.log,u}function o(a,l){let u=0,d=0,h=-1,v=0;for(;u<a.length;)if(d<l.length&&(l[d]===a[u]||l[d]==="*"))l[d]==="*"?(h=d,v=u,d++):(u++,d++);else{if(h===-1)return!1;d=h+1,v++,u=v}for(;d<l.length&&l[d]==="*";)d++;return d===l.length}return r.debug=r,r.default=r,r.coerce=function(a){return a instanceof Error?a.stack||a.message:a},r.disable=function(){const a=[...r.names,...r.skips.map(l=>"-"+l)].join(",");return r.enable(""),a},r.enable=function(a){r.save(a),r.namespaces=a,r.names=[],r.skips=[];const l=(typeof a=="string"?a:"").trim().replace(" ",",").split(",").filter(Boolean);for(const u of l)u[0]==="-"?r.skips.push(u.slice(1)):r.names.push(u)},r.enabled=function(a){for(const l of r.skips)if(o(a,l))return!1;for(const l of r.names)if(o(a,l))return!0;return!1},r.humanize=t(69),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(a=>{r[a]=n[a]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(a){let l=0;for(let u=0;u<a.length;u++)l=(l<<5)-l+a.charCodeAt(u),l|=0;return r.colors[Math.abs(l)%r.colors.length]},r.enable(r.load()),r}},779:(s,e,t)=>{var n;(function(r){(function(){var i=typeof globalThis=="object"?globalThis:typeof t.g=="object"?t.g:typeof self=="object"?self:typeof this=="object"?this:function(){try{return Function("return this;")()}catch{}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch{}}(),o=a(r);function a(l,u){return function(d,h){Object.defineProperty(l,d,{configurable:!0,writable:!0,value:h}),u&&u(d,h)}}i.Reflect!==void 0&&(o=a(i.Reflect,o)),function(l,u){var d=Object.prototype.hasOwnProperty,h=typeof Symbol=="function",v=h&&Symbol.toPrimitive!==void 0?Symbol.toPrimitive:"@@toPrimitive",f=h&&Symbol.iterator!==void 0?Symbol.iterator:"@@iterator",b=typeof Object.create=="function",k={__proto__:[]}instanceof Array,z=!b&&!k,L={create:b?function(){return ds(Object.create(null))}:k?function(){return ds({__proto__:null})}:function(){return ds({})},has:z?function(R,te){return d.call(R,te)}:function(R,te){return te in R},get:z?function(R,te){return d.call(R,te)?R[te]:void 0}:function(R,te){return R[te]}},se=Object.getPrototypeOf(Function),K=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:As(),N=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:fs(),E=typeof WeakMap=="function"?WeakMap:Ms(),O=h?Symbol.for("@reflect-metadata:registry"):void 0,U=Kt(),S=ps(U);function M(R,te,ve,ke){if(ge(ve)){if(!V(R))throw new TypeError;if(!_e(te))throw new TypeError;return Se(R,te)}if(!V(R))throw new TypeError;if(!wt(te))throw new TypeError;if(!wt(ke)&&!ge(ke)&&!pt(ke))throw new TypeError;return pt(ke)&&(ke=void 0),F(R,te,ve=Ue(ve),ke)}function B(R,te){function ve(ke,st){if(!wt(ke))throw new TypeError;if(!ge(st)&&!ye(st))throw new TypeError;ht(R,te,ke,st)}return ve}function W(R,te,ve,ke){if(!wt(ve))throw new TypeError;return ge(ke)||(ke=Ue(ke)),ht(R,te,ve,ke)}function I(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),D(R,te,ve)}function w(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),Y(R,te,ve)}function H(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),Te(R,te,ve)}function J(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),He(R,te,ve)}function q(R,te){if(!wt(R))throw new TypeError;return ge(te)||(te=Ue(te)),Mt(R,te)}function oe(R,te){if(!wt(R))throw new TypeError;return ge(te)||(te=Ue(te)),Qe(R,te)}function ue(R,te,ve){if(!wt(te))throw new TypeError;if(ge(ve)||(ve=Ue(ve)),!wt(te))throw new TypeError;ge(ve)||(ve=Ue(ve));var ke=os(te,ve,!1);return!ge(ke)&&ke.OrdinaryDeleteMetadata(R,te,ve)}function Se(R,te){for(var ve=R.length-1;ve>=0;--ve){var ke=(0,R[ve])(te);if(!ge(ke)&&!pt(ke)){if(!_e(ke))throw new TypeError;te=ke}}return te}function F(R,te,ve,ke){for(var st=R.length-1;st>=0;--st){var Ot=(0,R[st])(te,ve,ke);if(!ge(Ot)&&!pt(Ot)){if(!wt(Ot))throw new TypeError;ke=Ot}}return ke}function D(R,te,ve){if(Y(R,te,ve))return!0;var ke=Le(te);return!pt(ke)&&D(R,ke,ve)}function Y(R,te,ve){var ke=os(te,ve,!1);return!ge(ke)&&Yt(ke.OrdinaryHasOwnMetadata(R,te,ve))}function Te(R,te,ve){if(Y(R,te,ve))return He(R,te,ve);var ke=Le(te);return pt(ke)?void 0:Te(R,ke,ve)}function He(R,te,ve){var ke=os(te,ve,!1);if(!ge(ke))return ke.OrdinaryGetOwnMetadata(R,te,ve)}function ht(R,te,ve,ke){os(ve,ke,!0).OrdinaryDefineOwnMetadata(R,te,ve,ke)}function Mt(R,te){var ve=Qe(R,te),ke=Le(R);if(ke===null)return ve;var st=Mt(ke,te);if(st.length<=0)return ve;if(ve.length<=0)return st;for(var Ot=new N,Ht=[],Ye=0,Ce=ve;Ye<Ce.length;Ye++){var Oe=Ce[Ye];Ot.has(Oe)||(Ot.add(Oe),Ht.push(Oe))}for(var Ne=0,be=st;Ne<be.length;Ne++)Oe=be[Ne],Ot.has(Oe)||(Ot.add(Oe),Ht.push(Oe));return Ht}function Qe(R,te){var ve=os(R,te,!1);return ve?ve.OrdinaryOwnMetadataKeys(R,te):[]}function ze(R){if(R===null)return 1;switch(typeof R){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return R===null?1:6;default:return 6}}function ge(R){return R===void 0}function pt(R){return R===null}function Jt(R){return typeof R=="symbol"}function wt(R){return typeof R=="object"?R!==null:typeof R=="function"}function zt(R,te){switch(ze(R)){case 0:case 1:case 2:case 3:case 4:case 5:return R}var ve="string",ke=_t(R,v);if(ke!==void 0){var st=ke.call(R,ve);if(wt(st))throw new TypeError;return st}return nt(R)}function nt(R,te){var ve,ke;{var st=R.toString;if(X(st)&&!wt(ke=st.call(R))||X(ve=R.valueOf)&&!wt(ke=ve.call(R)))return ke}throw new TypeError}function Yt(R){return!!R}function Be(R){return""+R}function Ue(R){var te=zt(R);return Jt(te)?te:Be(te)}function V(R){return Array.isArray?Array.isArray(R):R instanceof Object?R instanceof Array:Object.prototype.toString.call(R)==="[object Array]"}function X(R){return typeof R=="function"}function _e(R){return typeof R=="function"}function ye(R){switch(ze(R)){case 3:case 4:return!0;default:return!1}}function fe(R,te){return R===te||R!=R&&te!=te}function _t(R,te){var ve=R[te];if(ve!=null){if(!X(ve))throw new TypeError;return ve}}function Tt(R){var te=_t(R,f);if(!X(te))throw new TypeError;var ve=te.call(R);if(!wt(ve))throw new TypeError;return ve}function he(R){return R.value}function ie(R){var te=R.next();return!te.done&&te}function de(R){var te=R.return;te&&te.call(R)}function Le(R){var te=Object.getPrototypeOf(R);if(typeof R!="function"||R===se||te!==se)return te;var ve=R.prototype,ke=ve&&Object.getPrototypeOf(ve);if(ke==null||ke===Object.prototype)return te;var st=ke.constructor;return typeof st!="function"||st===R?te:st}function rt(){var R,te,ve,ke;ge(O)||u.Reflect===void 0||O in u.Reflect||typeof u.Reflect.defineMetadata!="function"||(R=Zt(u.Reflect));var st=new E,Ot={registerProvider:Ht,getProvider:Ce,setProvider:Ne};return Ot;function Ht(be){if(!Object.isExtensible(Ot))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case R===be:break;case ge(te):te=be;break;case te===be:break;case ge(ve):ve=be;break;case ve===be:break;default:ke===void 0&&(ke=new N),ke.add(be)}}function Ye(be,it){if(!ge(te)){if(te.isProviderFor(be,it))return te;if(!ge(ve)){if(ve.isProviderFor(be,it))return te;if(!ge(ke))for(var _=Tt(ke);;){var x=ie(_);if(!x)return;var C=he(x);if(C.isProviderFor(be,it))return de(_),C}}}if(!ge(R)&&R.isProviderFor(be,it))return R}function Ce(be,it){var _,x=st.get(be);return ge(x)||(_=x.get(it)),ge(_)&&(ge(_=Ye(be,it))||(ge(x)&&(x=new K,st.set(be,x)),x.set(it,_))),_}function Oe(be){if(ge(be))throw new TypeError;return te===be||ve===be||!ge(ke)&&ke.has(be)}function Ne(be,it,_){if(!Oe(_))throw new Error("Metadata provider not registered.");var x=Ce(be,it);if(x!==_){if(!ge(x))return!1;var C=st.get(be);ge(C)&&(C=new K,st.set(be,C)),C.set(it,_)}return!0}}function Kt(){var R;return!ge(O)&&wt(u.Reflect)&&Object.isExtensible(u.Reflect)&&(R=u.Reflect[O]),ge(R)&&(R=rt()),!ge(O)&&wt(u.Reflect)&&Object.isExtensible(u.Reflect)&&Object.defineProperty(u.Reflect,O,{enumerable:!1,configurable:!1,writable:!1,value:R}),R}function ps(R){var te=new E,ve={isProviderFor:function(Oe,Ne){var be=te.get(Oe);return!ge(be)&&be.has(Ne)},OrdinaryDefineOwnMetadata:Ht,OrdinaryHasOwnMetadata:st,OrdinaryGetOwnMetadata:Ot,OrdinaryOwnMetadataKeys:Ye,OrdinaryDeleteMetadata:Ce};return U.registerProvider(ve),ve;function ke(Oe,Ne,be){var it=te.get(Oe),_=!1;if(ge(it)){if(!be)return;it=new K,te.set(Oe,it),_=!0}var x=it.get(Ne);if(ge(x)){if(!be)return;if(x=new K,it.set(Ne,x),!R.setProvider(Oe,Ne,ve))throw it.delete(Ne),_&&te.delete(Oe),new Error("Wrong provider for target.")}return x}function st(Oe,Ne,be){var it=ke(Ne,be,!1);return!ge(it)&&Yt(it.has(Oe))}function Ot(Oe,Ne,be){var it=ke(Ne,be,!1);if(!ge(it))return it.get(Oe)}function Ht(Oe,Ne,be,it){ke(be,it,!0).set(Oe,Ne)}function Ye(Oe,Ne){var be=[],it=ke(Oe,Ne,!1);if(ge(it))return be;for(var _=Tt(it.keys()),x=0;;){var C=ie(_);if(!C)return be.length=x,be;var P=he(C);try{be[x]=P}catch(T){try{de(_)}finally{throw T}}x++}}function Ce(Oe,Ne,be){var it=ke(Ne,be,!1);if(ge(it)||!it.delete(Oe))return!1;if(it.size===0){var _=te.get(Ne);ge(_)||(_.delete(be),_.size===0&&te.delete(_))}return!0}}function Zt(R){var te=R.defineMetadata,ve=R.hasOwnMetadata,ke=R.getOwnMetadata,st=R.getOwnMetadataKeys,Ot=R.deleteMetadata,Ht=new E,Ye={isProviderFor:function(Ce,Oe){var Ne=Ht.get(Ce);return!(ge(Ne)||!Ne.has(Oe))||!!st(Ce,Oe).length&&(ge(Ne)&&(Ne=new N,Ht.set(Ce,Ne)),Ne.add(Oe),!0)},OrdinaryDefineOwnMetadata:te,OrdinaryHasOwnMetadata:ve,OrdinaryGetOwnMetadata:ke,OrdinaryOwnMetadataKeys:st,OrdinaryDeleteMetadata:Ot};return Ye}function os(R,te,ve){var ke=U.getProvider(R,te);if(!ge(ke))return ke;if(ve){if(U.setProvider(R,te,S))return S;throw new Error("Illegal state.")}}function As(){var R={},te=[],ve=function(){function Ye(Ce,Oe,Ne){this._index=0,this._keys=Ce,this._values=Oe,this._selector=Ne}return Ye.prototype["@@iterator"]=function(){return this},Ye.prototype[f]=function(){return this},Ye.prototype.next=function(){var Ce=this._index;if(Ce>=0&&Ce<this._keys.length){var Oe=this._selector(this._keys[Ce],this._values[Ce]);return Ce+1>=this._keys.length?(this._index=-1,this._keys=te,this._values=te):this._index++,{value:Oe,done:!1}}return{value:void 0,done:!0}},Ye.prototype.throw=function(Ce){throw this._index>=0&&(this._index=-1,this._keys=te,this._values=te),Ce},Ye.prototype.return=function(Ce){return this._index>=0&&(this._index=-1,this._keys=te,this._values=te),{value:Ce,done:!0}},Ye}(),ke=function(){function Ye(){this._keys=[],this._values=[],this._cacheKey=R,this._cacheIndex=-2}return Object.defineProperty(Ye.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ye.prototype.has=function(Ce){return this._find(Ce,!1)>=0},Ye.prototype.get=function(Ce){var Oe=this._find(Ce,!1);return Oe>=0?this._values[Oe]:void 0},Ye.prototype.set=function(Ce,Oe){var Ne=this._find(Ce,!0);return this._values[Ne]=Oe,this},Ye.prototype.delete=function(Ce){var Oe=this._find(Ce,!1);if(Oe>=0){for(var Ne=this._keys.length,be=Oe+1;be<Ne;be++)this._keys[be-1]=this._keys[be],this._values[be-1]=this._values[be];return this._keys.length--,this._values.length--,fe(Ce,this._cacheKey)&&(this._cacheKey=R,this._cacheIndex=-2),!0}return!1},Ye.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=R,this._cacheIndex=-2},Ye.prototype.keys=function(){return new ve(this._keys,this._values,st)},Ye.prototype.values=function(){return new ve(this._keys,this._values,Ot)},Ye.prototype.entries=function(){return new ve(this._keys,this._values,Ht)},Ye.prototype["@@iterator"]=function(){return this.entries()},Ye.prototype[f]=function(){return this.entries()},Ye.prototype._find=function(Ce,Oe){if(!fe(this._cacheKey,Ce)){this._cacheIndex=-1;for(var Ne=0;Ne<this._keys.length;Ne++)if(fe(this._keys[Ne],Ce)){this._cacheIndex=Ne;break}}return this._cacheIndex<0&&Oe&&(this._cacheIndex=this._keys.length,this._keys.push(Ce),this._values.push(void 0)),this._cacheIndex},Ye}();return ke;function st(Ye,Ce){return Ye}function Ot(Ye,Ce){return Ce}function Ht(Ye,Ce){return[Ye,Ce]}}function fs(){return function(){function R(){this._map=new K}return Object.defineProperty(R.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),R.prototype.has=function(te){return this._map.has(te)},R.prototype.add=function(te){return this._map.set(te,te),this},R.prototype.delete=function(te){return this._map.delete(te)},R.prototype.clear=function(){this._map.clear()},R.prototype.keys=function(){return this._map.keys()},R.prototype.values=function(){return this._map.keys()},R.prototype.entries=function(){return this._map.entries()},R.prototype["@@iterator"]=function(){return this.keys()},R.prototype[f]=function(){return this.keys()},R}()}function Ms(){var R=16,te=L.create(),ve=ke();return function(){function Ce(){this._key=ke()}return Ce.prototype.has=function(Oe){var Ne=st(Oe,!1);return Ne!==void 0&&L.has(Ne,this._key)},Ce.prototype.get=function(Oe){var Ne=st(Oe,!1);return Ne!==void 0?L.get(Ne,this._key):void 0},Ce.prototype.set=function(Oe,Ne){return st(Oe,!0)[this._key]=Ne,this},Ce.prototype.delete=function(Oe){var Ne=st(Oe,!1);return Ne!==void 0&&delete Ne[this._key]},Ce.prototype.clear=function(){this._key=ke()},Ce}();function ke(){var Ce;do Ce="@@WeakMap@@"+Ye();while(L.has(te,Ce));return te[Ce]=!0,Ce}function st(Ce,Oe){if(!d.call(Ce,ve)){if(!Oe)return;Object.defineProperty(Ce,ve,{value:L.create()})}return Ce[ve]}function Ot(Ce,Oe){for(var Ne=0;Ne<Oe;++Ne)Ce[Ne]=255*Math.random()|0;return Ce}function Ht(Ce){if(typeof Uint8Array=="function"){var Oe=new Uint8Array(Ce);return typeof crypto<"u"?crypto.getRandomValues(Oe):typeof msCrypto<"u"?msCrypto.getRandomValues(Oe):Ot(Oe,Ce),Oe}return Ot(new Array(Ce),Ce)}function Ye(){var Ce=Ht(R);Ce[6]=79&Ce[6]|64,Ce[8]=191&Ce[8]|128;for(var Oe="",Ne=0;Ne<R;++Ne){var be=Ce[Ne];Ne!==4&&Ne!==6&&Ne!==8||(Oe+="-"),be<16&&(Oe+="0"),Oe+=be.toString(16).toLowerCase()}return Oe}}function ds(R){return R.__=void 0,delete R.__,R}l("decorate",M),l("metadata",B),l("defineMetadata",W),l("hasMetadata",I),l("hasOwnMetadata",w),l("getMetadata",H),l("getOwnMetadata",J),l("getMetadataKeys",q),l("getOwnMetadataKeys",oe),l("deleteMetadata",ue)}(o,i),i.Reflect===void 0&&(i.Reflect=r)})()})(n||(n={}))}},Eu={};function tn(s){var e=Eu[s];if(e!==void 0)return e.exports;var t=Eu[s]={exports:{}};return v1[s](t,t.exports,tn),t.exports}tn.n=s=>{var e=s&&s.__esModule?()=>s.default:()=>s;return tn.d(e,{a:e}),e},tn.d=(s,e)=>{for(var t in e)tn.o(e,t)&&!tn.o(s,t)&&Object.defineProperty(s,t,{enumerable:!0,get:e[t]})},tn.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),tn.o=(s,e)=>Object.prototype.hasOwnProperty.call(s,e);class _1{constructor(e){p(this,"baseURL");p(this,"abortControllers",new Set);this.baseURL=`${e}/api`}async request(e,t,n,r={}){const i=new AbortController;this.abortControllers.add(i);const o=setTimeout(()=>{i.abort(),this.abortControllers.delete(i)},15e3);try{const a=await fetch(`${this.baseURL}${t}`,{method:e,headers:{"Content-Type":"application/json",...r.headers},body:n?JSON.stringify(n):void 0,signal:i.signal,...r});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a}finally{clearTimeout(o),this.abortControllers.delete(i)}}get(e,t){return this.request("GET",e,void 0,t)}post(e,t,n){return this.request("POST",e,t,n)}}const ks={FAILED:"CONNECTION_FAILED",TIMEOUT:"CONNECTION_TIMEOUT",NOT_CONNECTED:"CONNECTION_NOT_CONNECTED",INVALID_STATE:"CONNECTION_INVALID_STATE",INTERNAL_ERROR:"CONNECTION_INTERNAL_ERROR"},Ir={MISSING:"CONFIG_MISSING",INVALID:"CONFIG_INVALID",INTERNAL_ERROR:"CONFIG_INTERNAL_ERROR"},en={INVALID_CREDENTIALS:"AUTH_INVALID_CREDENTIALS",UNAUTHORIZED:"AUTH_UNAUTHORIZED",FORBIDDEN:"AUTH_FORBIDDEN",INTERNAL_ERROR:"AUTH_INTERNAL_ERROR"},$n={REGISTRATION_FAILED:"CLIENT_REGISTRATION_FAILED",UNREGISTRATION_FAILED:"CLIENT_UNREGISTRATION_FAILED",NOT_FOUND:"CLIENT_NOT_FOUND",INVALID_STATE:"CLIENT_INVALID_STATE",INTERNAL_ERROR:"CLIENT_INTERNAL_ERROR"},zn={INVALID_FORMAT:"MESSAGE_INVALID_FORMAT",DELIVERY_FAILED:"MESSAGE_DELIVERY_FAILED",TIMEOUT:"MESSAGE_TIMEOUT",EXECUTION_FAILED:"MESSAGE_EXECUTION_FAILED",INTERNAL_ERROR:"MESSAGE_INTERNAL_ERROR"},rr={METHOD_NOT_FOUND:"RPC_METHOD_NOT_FOUND",INVALID_REQUEST:"RPC_INVALID_REQUEST",INTERNAL_ERROR:"RPC_INTERNAL_ERROR",CONNECTION_FAILED:"RPC_CONNECTION_FAILED"},Xh={INTERNAL_ERROR:"REGISTRY_INTERNAL_ERROR"},sr={JOIN_FAILED:"CLUSTER_JOIN_FAILED",SYNC_FAILED:"CLUSTER_SYNC_FAILED",COMMUNICATION_FAILED:"CLUSTER_COMMUNICATION_FAILED",INVALID_STATE:"CLUSTER_INVALID_STATE",NODE_NOT_FOUND:"CLUSTER_NODE_NOT_FOUND",INSTANCE_NOT_FOUND:"CLUSTER_INSTANCE_NOT_FOUND",INTERNAL_ERROR:"CLUSTER_INTERNAL_ERROR"};class ws extends Error{constructor(t,n,r,i){super(t);p(this,"code");p(this,"details");p(this,"cause");this.code=n,this.details=r,this.cause=i,this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),this.cause&&(this.cause={name:this.cause.name,message:this.cause.message,...this.cause instanceof ws?{code:this.cause.code,details:this.cause.details}:{code:"INTERNAL_ERROR",details:{description:this.cause.message}}})}toJSON(){return{name:this.name,message:this.message,code:this.code,details:this.details,stack:this.stack,cause:this.cause}}static fromJSON(t){return new ws(t.message,t.code,t.details,t.cause?ws.fromJSON(t.cause):void 0)}}class y1 extends ws{constructor(e,t,n){super(e,ks.INTERNAL_ERROR,t,n)}}class b1 extends ws{constructor(e,t,n){super(e,Ir.INTERNAL_ERROR,t,n)}}class w1 extends ws{constructor(e,t,n){super(e,en.INTERNAL_ERROR,t,n)}}class x1 extends ws{constructor(e,t,n){super(e,$n.INTERNAL_ERROR,t,n)}}class S1 extends ws{constructor(e,t,n){super(e,zn.INTERNAL_ERROR,t,n)}}class C1 extends ws{constructor(e,t,n){super(e,rr.INTERNAL_ERROR,t,n)}}class k1 extends ws{constructor(e,t,n){super(e,Xh.INTERNAL_ERROR,t,n)}}class E1 extends ws{constructor(e,t,n){super(e,sr.INTERNAL_ERROR,t,n)}}const lt=class lt{static create(e,t,n,r){if(t instanceof ws)return t;const i=t instanceof Error?t:new Error(String(t)),o=function(a){function l(u){let d=!1;try{typeof Buffer<"u"&&(d=u instanceof Buffer)}catch{d=!1}return u instanceof ArrayBuffer||u instanceof Uint8Array||d||ArrayBuffer.isView(u)?"<binary>":Array.isArray(u)?u.map(l):u&&typeof u=="object"?Object.fromEntries(Object.entries(u).map(([h,v])=>[h,l(v)])):u}return l(a??{})}(r);switch(e){case"connection":return new y1(n,o,i);case"config":return new b1(n,o,i);case"auth":return new w1(n,o,i);case"client":return new x1(n,o,i);case"message":return new S1(n,o,i);case"rpc":return new C1(n,o,i);case"registry":return new k1(n,o,i);case"cluster":return new E1(n,o,i)}}static async handle(e,t,n,r){try{return await e()}catch(i){throw lt.create(t,i,n,r)}}};p(lt,"connection",{connectionFailed:(e,t)=>lt.create("connection",e,"Connection failed",{description:"Failed to establish connection",code:ks.FAILED,...t}),subscribeFailed:(e,t)=>lt.create("connection",e,"Subscription failed",{description:"Failed to subscribe to subject",code:ks.INTERNAL_ERROR,...t}),requestFailed:(e,t)=>lt.create("connection",e,"Request failed",{description:"Failed to send request",code:ks.INTERNAL_ERROR,...t}),timeout:(e,t)=>lt.create("connection",e,"Connection timeout",{description:"Connection attempt timed out",code:ks.TIMEOUT,...t}),notConnected:(e,t)=>lt.create("connection",e,"Not connected",{description:"Connection is not established",code:ks.INTERNAL_ERROR,...t}),invalidState:(e,t)=>lt.create("connection",e,"Invalid connection state",{description:"Connection is in invalid state",code:ks.INVALID_STATE,...t}),internalError:(e,t)=>lt.create("connection",e,"Internal connection error",{description:"Internal connection error",code:ks.INTERNAL_ERROR,...t})}),p(lt,"config",{missing:(e,t)=>lt.create("config",e,"Missing configuration",{description:"Required configuration is missing",code:Ir.MISSING,...t}),invalid:(e,t)=>lt.create("config",e,"Invalid configuration",{description:"Invalid configuration provided",code:Ir.INVALID,...t}),internalError:(e,t)=>lt.create("config",e,"Internal configuration error",{description:"Internal configuration error",code:Ir.INTERNAL_ERROR,...t})}),p(lt,"auth",{unauthorized:(e,t)=>lt.create("auth",e,"Unauthorized",{description:"Authentication failed",code:en.UNAUTHORIZED,...t}),forbidden:(e,t)=>lt.create("auth",e,"Forbidden",{description:"Insufficient permissions",code:en.FORBIDDEN,...t}),internalError:(e,t)=>lt.create("auth",e,"Internal auth error",{description:"Internal auth error",code:en.INTERNAL_ERROR,...t})}),p(lt,"client",{registrationFailed:(e,t)=>lt.create("client",e,"Registration failed",{description:"Failed to register client",code:$n.REGISTRATION_FAILED,...t}),notFound:(e,t)=>lt.create("client",e,"Client not found",{description:"Requested client could not be found",code:$n.NOT_FOUND,...t}),invalidState:(e,t)=>lt.create("client",e,"Invalid client state",{description:"Client is in invalid state",code:$n.INVALID_STATE,...t}),internalError:(e,t)=>lt.create("client",e,"Internal client error",{description:"Internal client error",code:$n.INTERNAL_ERROR,...t})}),p(lt,"message",{invalidFormat:(e,t)=>lt.create("message",e,"Invalid message format",{description:"Failed to parse message",code:zn.INVALID_FORMAT,...t}),deliveryFailed:(e,t)=>lt.create("message",e,"Message delivery failed",{description:"Failed to deliver message",code:zn.DELIVERY_FAILED,...t}),timeout:(e,t)=>lt.create("message",e,"Message timeout",{description:"Message processing timed out",code:zn.TIMEOUT,...t}),executionFailed:(e,t)=>lt.create("message",e,"Message execution failed",{description:"Failed to execute message",code:zn.EXECUTION_FAILED,...t}),internalError:(e,t)=>lt.create("message",e,"Internal message error",{description:"Internal message error",code:zn.INTERNAL_ERROR,...t})}),p(lt,"cluster",{joinFailed:(e,t)=>lt.create("cluster",e,"Failed to join cluster",{description:"Failed to join cluster",code:sr.JOIN_FAILED,...t}),syncFailed:(e,t)=>lt.create("cluster",e,"Failed to sync cluster",{description:"Failed to sync cluster",code:sr.SYNC_FAILED,...t}),nodeNotFound:(e,t)=>lt.create("cluster",e,"Node not found",{description:"Requested node could not be found",code:sr.NODE_NOT_FOUND,...t}),instanceNotFound:(e,t)=>lt.create("cluster",e,"Instance not found",{description:"Requested instance could not be found",code:sr.INSTANCE_NOT_FOUND,...t}),communicationFailed:(e,t)=>lt.create("cluster",e,"Communication failed",{description:"Cluster communication failed",code:sr.COMMUNICATION_FAILED,...t}),invalidState:(e,t)=>lt.create("cluster",e,"Invalid cluster state",{description:"Cluster is in invalid state",code:sr.INVALID_STATE,...t}),internalError:(e,t)=>lt.create("cluster",e,"Internal cluster error",{description:"Internal cluster error",code:sr.INTERNAL_ERROR,...t})}),p(lt,"registry",{internalError:(e,t)=>lt.create("registry",e,"Internal registry error",{description:"Internal registry error",code:Xh.INTERNAL_ERROR,...t})}),p(lt,"rpc",{methodNotFound:(e,t,n)=>lt.create("rpc",t,`Method not found: ${e}`,{description:"Requested method could not be found",code:rr.METHOD_NOT_FOUND,...n}),invalidRequest:(e,t)=>lt.create("rpc",e,"Invalid request",{description:"Invalid RPC request",code:rr.INVALID_REQUEST,...t}),requestFailed:(e,t)=>lt.create("rpc",e,"RPC request failed",{description:"Failed to send RPC request",code:rr.INTERNAL_ERROR,...t}),executionFailed:(e,t)=>lt.create("rpc",e,"RPC execution failed",{description:"Failed to execute RPC request",code:rr.INTERNAL_ERROR,...t}),connectionFailed:(e,t)=>lt.create("rpc",e,"Failed to get RPC connection",{description:"Failed to get RPC connection",code:rr.CONNECTION_FAILED,...t}),internalError:(e,t)=>lt.create("rpc",e,"Internal RPC error",{description:"Internal RPC error",code:rr.INTERNAL_ERROR,...t})});let kt=lt;class ns{static getPluginToPluginSubject(e,t){return this.createRoutingPattern("plugin","plugin",e,t)}static getPluginToServiceSubject(e,t){return this.createRoutingPattern("plugin","service",e,t)}static getServiceToServiceSubject(e,t){return this.createRoutingPattern("service","service",e,t)}static getServiceToPluginSubject(e,t){return this.createRoutingPattern("service","plugin",e,t)}static getPluginToServerSubject(e,t){return this.createRoutingPattern("plugin","server",e,t)}static getServiceToServerSubject(e,t){return this.createRoutingPattern("service","server",e,t)}static getServerToPluginSubject(e,t){return this.createRoutingPattern("server","plugin",e,t)}static getServerToServiceSubject(e,t){return this.createRoutingPattern("server","service",e,t)}static createRoutingMetadata(e,t,n,r){const i={source:{type:e,id:t}};return n&&r&&(i.target={type:n,id:r}),i}static createRoutingPattern(e,t,n,r){return r?`${e}.${t}.${n}.${r}`:`${e}.${t}.${n}.*`}}class yo{static validateMetadata(e){if(!e.id)throw kt.config.invalid(void 0,{description:"Invalid ID in metadata",code:Ir.INVALID,metadata:{metadata:e}});if(!e.name)throw kt.config.invalid(void 0,{description:"Invalid name in metadata",code:Ir.INVALID,metadata:{metadata:e}})}static validateConnectionOptions(e){if(yo.validateMetadata(e.metadata),!e.endpoints||e.endpoints.length===0)throw kt.config.invalid(void 0,{description:"No NATS endpoints provided",code:Ir.INVALID,metadata:{endpoints:e.endpoints}});if(!e.auth)throw kt.config.invalid(void 0,{description:"No authentication configuration provided",code:en.INVALID_CREDENTIALS});if("server"in e.auth){const{server:t,cluster:n}=e.auth;if(!t||typeof t!="object")throw kt.config.invalid(void 0,{description:"Missing server authentication configuration",code:en.INVALID_CREDENTIALS});if(!n||typeof n!="object")throw kt.config.invalid(void 0,{description:"Missing cluster authentication configuration",code:en.INVALID_CREDENTIALS});if(typeof t.user!="string"||t.user.length===0)throw kt.config.invalid(void 0,{description:"Invalid server username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:t.user}}});if(typeof t.password!="string"||t.password.length===0)throw kt.config.invalid(void 0,{description:"Invalid server password provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{password:"***"}}});if(typeof n.user!="string"||n.user.length===0)throw kt.config.invalid(void 0,{description:"Invalid cluster username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:n.user}}});if(typeof n.password!="string"||n.password.length===0)throw kt.config.invalid(void 0,{description:"Invalid cluster password provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{password:"***"}}})}else{const{user:t,password:n}=e.auth;if(typeof t!="string"||t.length===0)throw kt.config.invalid(void 0,{description:"Invalid username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:t}}});if(typeof n!="string"||n.length===0)throw kt.config.invalid(void 0,{description:"Invalid password provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{password:"***"}}})}}}var Pi=tn(288);const rn=new Uint8Array(0),Dr=new TextEncoder,sn=new TextDecoder;function Gi(...s){const e=[];for(let t=0;t<s.length;t++)e.push(Dr.encode(s[t]));return e.length===0?rn:e.length===1?e[0]:function(...t){let n=0;for(let o=0;o<t.length;o++)n+=t[o].length;const r=new Uint8Array(n);let i=0;for(let o=0;o<t.length;o++)r.set(t[o],i),i+=t[o].length;return r}(...e)}function Au(s){return s&&s.length!==0?sn.decode(s):""}const Mu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";function A1(s){var e;(e=globalThis==null?void 0:globalThis.crypto)!=null&&e.getRandomValues?globalThis.crypto.getRandomValues(s):function(t){for(let n=0;n<t.length;n++)t[n]=Math.floor(255*Math.random())}(s)}const vr=new class{constructor(){p(this,"buf");p(this,"seq");p(this,"inc");p(this,"inited");this.buf=new Uint8Array(22),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){this.seq=Math.floor(0xcfd41b9100000*Math.random()),this.inc=Math.floor(300*Math.random()+33)}setPre(){const s=new Uint8Array(12);A1(s);for(let e=0;e<12;e++){const t=s[e]%36;this.buf[e]=Mu.charCodeAt(t)}}fillSeq(){let s=this.seq;for(let e=21;e>=12;e--)this.buf[e]=Mu.charCodeAt(s%36),s=Math.floor(s/36)}next(){return this.inited||this.init(),this.seq+=this.inc,this.seq>0xcfd41b9100000&&(this.setPre(),this.initSeqAndInc()),this.fillSeq(),String.fromCharCode.apply(String,this.buf)}reset(){this.init()}};var Pn,ii,Re;(function(s){s.Disconnect="disconnect",s.Reconnect="reconnect",s.Update="update",s.LDM="ldm",s.Error="error"})(Pn||(Pn={})),function(s){s.Reconnecting="reconnecting",s.PingTimer="pingTimer",s.StaleConnection="staleConnection",s.ClientInitiatedReconnect="client initiated reconnect"}(ii||(ii={})),function(s){s.ApiError="BAD API",s.BadAuthentication="BAD_AUTHENTICATION",s.BadCreds="BAD_CREDS",s.BadHeader="BAD_HEADER",s.BadJson="BAD_JSON",s.BadPayload="BAD_PAYLOAD",s.BadSubject="BAD_SUBJECT",s.Cancelled="CANCELLED",s.ConnectionClosed="CONNECTION_CLOSED",s.ConnectionDraining="CONNECTION_DRAINING",s.ConnectionRefused="CONNECTION_REFUSED",s.ConnectionTimeout="CONNECTION_TIMEOUT",s.Disconnect="DISCONNECT",s.InvalidOption="INVALID_OPTION",s.InvalidPayload="INVALID_PAYLOAD",s.MaxPayloadExceeded="MAX_PAYLOAD_EXCEEDED",s.NoResponders="503",s.NotFunction="NOT_FUNC",s.RequestError="REQUEST_ERROR",s.ServerOptionNotAvailable="SERVER_OPT_NA",s.SubClosed="SUB_CLOSED",s.SubDraining="SUB_DRAINING",s.Timeout="TIMEOUT",s.Tls="TLS",s.Unknown="UNKNOWN_ERROR",s.WssRequired="WSS_REQUIRED",s.JetStreamInvalidAck="JESTREAM_INVALID_ACK",s.JetStream404NoMessages="404",s.JetStream408RequestTimeout="408",s.JetStream409MaxAckPendingExceeded="409",s.JetStream409="409",s.JetStreamNotEnabled="503",s.JetStreamIdleHeartBeat="IDLE_HEARTBEAT",s.AuthorizationViolation="AUTHORIZATION_VIOLATION",s.AuthenticationExpired="AUTHENTICATION_EXPIRED",s.ProtocolError="NATS_PROTOCOL_ERR",s.PermissionsViolation="PERMISSIONS_VIOLATION",s.AuthenticationTimeout="AUTHENTICATION_TIMEOUT",s.AccountExpired="ACCOUNT_EXPIRED"}(Re||(Re={}));class em{constructor(){p(this,"messages");this.messages=new Map,this.messages.set(Re.InvalidPayload,"Invalid payload type - payloads can be 'binary', 'string', or 'json'"),this.messages.set(Re.BadJson,"Bad JSON"),this.messages.set(Re.WssRequired,"TLS is required, therefore a secure websocket connection is also required")}static getMessage(e){return M1.getMessage(e)}getMessage(e){return this.messages.get(e)||e}}const M1=new em;class Ve extends Error{constructor(t,n,r){super(t);p(this,"name");p(this,"message");p(this,"code");p(this,"permissionContext");p(this,"chainedError");p(this,"api_error");this.name="NatsError",this.message=t,this.code=n,this.chainedError=r}static errorForCode(t,n){const r=em.getMessage(t);return new Ve(r,t,n)}isAuthError(){return this.code===Re.AuthenticationExpired||this.code===Re.AuthorizationViolation||this.code===Re.AccountExpired}isAuthTimeout(){return this.code===Re.AuthenticationTimeout}isPermissionError(){return this.code===Re.PermissionsViolation}isProtocolError(){return this.code===Re.ProtocolError}isJetStreamError(){return this.api_error!==void 0}jsError(){return this.api_error?this.api_error:null}}var Ys,bn,Wi;(function(s){s[s.Exact=0]="Exact",s[s.CanonicalMIME=1]="CanonicalMIME",s[s.IgnoreCase=2]="IgnoreCase"})(Ys||(Ys={})),function(s){s.Timer="timer",s.Count="count",s.JitterTimer="jitterTimer",s.SentinelMsg="sentinelMsg"}(bn||(bn={})),function(s){s.STATS="io.nats.micro.v1.stats_response",s.INFO="io.nats.micro.v1.info_response",s.PING="io.nats.micro.v1.ping_response"}(Wi||(Wi={}));const ra="Nats-Service-Error",ia="Nats-Service-Error-Code";class oa extends Error{constructor(t,n){super(n);p(this,"code");this.code=t}static isServiceError(t){return oa.toServiceError(t)!==null}static toServiceError(t){var r,i;const n=((r=t==null?void 0:t.headers)==null?void 0:r.get(ia))||"";if(n!==""){const o=parseInt(n)||400,a=((i=t==null?void 0:t.headers)==null?void 0:i.get(ra))||"";return new oa(o,a.length?a:n)}return null}}function Qn(s=""){if(typeof(s=s||"_INBOX")!="string")throw new Error("prefix must be a string");return s.split(".").forEach(e=>{if(e==="*"||e===">")throw new Error(`inbox prefixes cannot have wildcards '${s}'`)}),`${s}.${vr.next()}`}const uc="127.0.0.1";var dr;function Pa(s,...e){for(let t=0;t<e.length;t++){const n=e[t];Object.keys(n).forEach(function(r){s[r]=n[r]})}return s}function Ao(s){return sn.decode(s).replace(/\n/g,"␊").replace(/\r/g,"␍")}function pi(s,e=!0){const t=e?Ve.errorForCode(Re.Timeout):null;let n,r;const i=new Promise((o,a)=>{n={cancel:()=>{r&&clearTimeout(r)}},r=setTimeout(()=>{a(t===null?Ve.errorForCode(Re.Timeout):t)},s)});return Object.assign(i,n)}function Ti(s=0){let e;const t=new Promise(n=>{const r=setTimeout(()=>{n()},s);e={cancel:()=>{r&&clearTimeout(r)}}});return Object.assign(t,e)}function is(){let s={};const e=new Promise((t,n)=>{s={resolve:t,reject:n}});return Object.assign(e,s)}function tm(s){for(let e=s.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[s[e],s[t]]=[s[t],s[e]]}return s}(function(s){s.PING="PING",s.STATS="STATS",s.INFO="INFO"})(dr||(dr={}));function cl(s=[0,250,250,500,500,3e3,5e3]){Array.isArray(s)||(s=[0,250,250,500,500,3e3,5e3]);const e=s.length-1;return{backoff:t=>function(n){return n===0?0:Math.floor(n/2+Math.random()*n)}(t>e?s[e]:s[t])}}function rs(s){return 1e6*s}function ll(s){return Math.floor(s/1e6)}function $u(s){let e=!0;const t=new Array(s.length);for(let n=0;n<s.length;n++){let r=s.charCodeAt(n);if(r===58||r<33||r>126)throw new Ve(`'${s[n]}' is not a valid character for a header key`,Re.BadHeader);e&&97<=r&&r<=122?r-=32:!e&&65<=r&&r<=90&&(r+=32),t[n]=r,e=r==45}return String.fromCharCode(...t)}function Zn(s=0,e=""){if(s===0&&e!==""||s>0&&e==="")throw new Error("setting status requires both code and description");return new hr(s,e)}const Ba="NATS/1.0";class hr{constructor(e=0,t=""){p(this,"_code");p(this,"headers");p(this,"_description");this._code=e,this._description=t,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(e){if(e&&this.headers.size===e.headers.size&&this._code===e._code){for(const[t,n]of this.headers){const r=e.values(t);if(n.length!==r.length)return!1;const i=[...n].sort(),o=[...r].sort();for(let a=0;a<i.length;a++)if(i[a]!==o[a])return!1}return!0}return!1}static decode(e){const t=new hr,n=sn.decode(e).split(`\r
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/FirstSteps.BLNp-T2e.0.0.63.js","js/primevue.CoZ9R2Q2.0.0.63.js","js/@primeuix.BkBDkSvZ.0.0.63.js","js/@vue.Dh6viqaK.0.0.63.js","js/@primevue.D_7clQ9D.0.0.63.js","js/vue-inline-svg.DwQ6AJRv.0.0.63.js","js/backup.DXMIOgSB.0.0.63.js","js/system.DjVJ4skZ.0.0.63.js","js/@tanstack.BSC4wwmS.0.0.63.js","js/vue-i18n.0nnpASs4.0.0.63.js","js/@intlify.BkGPX90O.0.0.63.js","js/SettingsAccount.kSQHHipN.0.0.63.js","js/vee-validate.DJQ5Z65z.0.0.63.js","js/pinia.DVtqAP8S.0.0.63.js","js/@vueuse.BKr_9ZHe.0.0.63.js","js/nprogress.IzIs0JFK.0.0.63.js","js/@xterm.BXZNujCq.0.0.63.js","assets/@xterm.DYP7pi_n.0.0.63.css","js/axios.DHr9lByg.0.0.63.js","js/vue-router.CtXJ7SHU.0.0.63.js","js/@vee-validate.DLXLKcbH.0.0.63.js","js/zod.sy4ilHCy.0.0.63.js","js/uuid.C6aID195.0.0.63.js","js/socket.io-client.CoxRrB0i.0.0.63.js","js/engine.io-client.DKSc90ta.0.0.63.js","js/engine.io-parser.BiEtp6m2.0.0.63.js","js/@socket.io.Dkula2eQ.0.0.63.js","js/socket.io-parser.CS2MblGy.0.0.63.js","js/rxjs.B3taOakU.0.0.63.js","js/tslib.9k7AwCpt.0.0.63.js","js/highlight.js.DyOtvXLH.0.0.63.js","assets/highlight.Ch2EwETz.0.0.63.css","js/markdown-it.M3A8AdOh.0.0.63.js","js/mdurl.k9Sl0PQj.0.0.63.js","js/uc.micro.kMc2yuuw.0.0.63.js","js/entities.C20TfXL6.0.0.63.js","js/linkify-it.DGDBcHC0.0.0.63.js","js/punycode.js.Dj65hjkv.0.0.63.js","js/qrcode.J-jUQ3O7.0.0.63.js","js/dijkstrajs.C00ieaqj.0.0.63.js","js/draggabilly.o_TJc_mc.0.0.63.js","js/get-size.D1dS-IaP.0.0.63.js","js/unidragger.DbVT_hUC.0.0.63.js","js/ev-emitter.X5f1qa-c.0.0.63.js","js/vue-zoomable.CyClhEiW.0.0.63.js","js/primelocale.Bga3dOQu.0.0.63.js","assets/SettingsAccount.CDZT7gN-.0.0.63.css","js/SettingsAppearance.vue_vue_type_script_setup_true_lang.rhYz8TOv.0.0.63.js","js/Cameras.xyNhttxc.0.0.63.js","js/refresh-rounded.Cj4edEnQ.0.0.63.js","js/CuiConsole.tVTZVJ2r.0.0.63.js","assets/CuiConsole.DCYyxdVg.0.0.63.css","assets/Cameras.BDWZJqPN.0.0.63.css","js/Camera.CyBZZ28c.0.0.63.js","js/CuiTimeline.Ddo5H5eu.0.0.63.js","assets/CuiTimeline.BkIwlYtw.0.0.63.css","js/Camview.C8yUnqeH.0.0.63.js","js/vue3-dnd.CJgQfdRH.0.0.63.js","js/dnd-core.DRZXbJM9.0.0.63.js","js/redux.BFxtlG_c.0.0.63.js","js/@react-dnd.CcwRs9xb.0.0.63.js","js/fast-deep-equal.BkqdlJZE.0.0.63.js","js/react-dnd-html5-backend.1HQjlkwI.0.0.63.js","js/react-dnd-touch-backend.r6ZvPP1w.0.0.63.js","assets/Camview.Cvhuou6V.0.0.63.css","js/Recordings.BfDGF8yy.0.0.63.js","js/Config.BHb_92sr.0.0.63.js","js/zoom-out.Uoc_DZyc.0.0.63.js","js/Console.gVRCs4SQ.0.0.63.js","js/Plugins.Bru4qZHM.0.0.63.js","js/CuiPluginCard.BxI4Y206.0.0.63.js","js/trash-fill.DQ11gskZ.0.0.63.js","js/VersionsHandler.vue_vue_type_script_setup_true_lang.CQoernTX.0.0.63.js","assets/CuiPluginCard.yF8V0SZY.0.0.63.css","assets/Plugins.BwPlcRrV.0.0.63.css","js/Plugin.BzcStDGT.0.0.63.js","js/close-circle.DfpkK7eV.0.0.63.js","assets/Plugin.DJElsAn5.0.0.63.css","js/Adminpanel.CgnDDe0k.0.0.63.js","js/chart.js.DZ1vEHB7.0.0.63.js","js/@kurkle.D8fDXNIl.0.0.63.js","js/vue-chartjs.DZnMEgA0.0.0.63.js","assets/Adminpanel.BKek2EMH.0.0.63.css","js/Cammesh.CrlhW6m8.0.0.63.js","js/Settings.A2rkEnZf.0.0.63.js","assets/Settings.CkgfRkQr.0.0.63.css","js/SettingsAppearance.DrK-Y9Dz.0.0.63.js","js/SettingsUsers.DUeBe8dg.0.0.63.js","js/SettingsRecordings.CKLA9Mcy.0.0.63.js","js/SettingsBackup.BrO__F6s.0.0.63.js","assets/SettingsBackup.CX0rT0QJ.0.0.63.css","js/SettingsRemote.Cc_G0w05.0.0.63.js","js/SettingsSystem.Bc3mt8Pc.0.0.63.js","js/compare-versions.DqEOhma6.0.0.63.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var A0=Object.defineProperty;var _u=s=>{throw TypeError(s)};var M0=(s,e,t)=>e in s?A0(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var p=(s,e,t)=>M0(s,typeof e!="symbol"?e+"":e,t),Da=(s,e,t)=>e.has(s)||_u("Cannot "+t);var An=(s,e,t)=>(Da(s,e,"read from private field"),t?t.call(s):e.get(s)),Yn=(s,e,t)=>e.has(s)?_u("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),Zr=(s,e,t,n)=>(Da(s,e,"write to private field"),n?n.call(s,t):e.set(s,t),t),gt=(s,e,t)=>(Da(s,e,"access private method"),t);import{u as Ci,a as Bt,b as ut,V as $0}from"./@tanstack.BSC4wwmS.0.0.63.js";import{T as P0,s as T0,a as Lr,b as ys,c as jr,d as Ea,e as ki,f as Fh,g as R0,h as Lh,D as yu,i as Qc,j as fo,k as I0,l as go,m as Aa,n as Kc,o as jh,p as Zc,q as qh,r as Dh,t as Gc,u as Wc,v as Jc,w as Yc,x as Bh,y as zh,z as Uh,A as O0,B as N0,C as F0,E as L0,F as j0,G as q0,H as D0,I as B0,J as z0,K as U0}from"./primevue.CoZ9R2Q2.0.0.63.js";import{F as pe,c as A,d as m,e as g,B as At,r as ae,o as Sn,a4 as Ma,L as Pt,h as c,R as y,P as at,M as j,O as ce,W as ot,y as Ls,k as ne,w as Ge,t as Wt,N as $,Y as Pr,J as Ei,m as et,V as Et,I as me,ac as Vt,f as us,ab as Vh,b as Tr,A as Xs,a7 as vo,H as Qt,X as yt,Z as qt,i as mi,a5 as Xc,a0 as V0,Q as Ai,ad as el,n as Zs,G as ei,D as bu,_ as Hh,S as H0,ae as Kn,af as Rr,$ as lr,ag as Q0,a1 as K0,T as Qh,ah as Z0}from"./@vue.Dh6viqaK.0.0.63.js";import{v as Kh,u as tl,a as G0,c as sl,b as W0,d as J0,e as Zh,o as nl,f as Gh,g as Y0,h as X0,i as ef,r as wu,j as lc,k as tf,l as ri,m as rl,n as sf,p as fn,q as nf,s as xu,t as rf,w as of,x as Eo,y as af,z as cf}from"./@vueuse.BKr_9ZHe.0.0.63.js";import{a as lf,A as uf}from"./axios.DHr9lByg.0.0.63.js";import{u as js,c as df}from"./vue-i18n.0nnpASs4.0.0.63.js";import{d as Mi,s as Vs,c as hf}from"./pinia.DVtqAP8S.0.0.63.js";import{u as qr,a as $i,c as mf,b as pf}from"./vue-router.CtXJ7SHU.0.0.63.js";import{R as $a}from"./vue-inline-svg.DwQ6AJRv.0.0.63.js";import{F as il,a as Lt,E as jt}from"./vee-validate.DJQ5Z65z.0.0.63.js";import{t as Wn}from"./@vee-validate.DLXLKcbH.0.0.63.js";import{o as bt,c as xs,u as Os,l as we,t as ff,n as xn,s as Ke,d as ur,r as ol,e as Hn,f as gf,g as Su,h as vf,i as al,j as Wh,k as Cu}from"./zod.sy4ilHCy.0.0.63.js";import{v as hn}from"./uuid.C6aID195.0.0.63.js";import{M as _f}from"./socket.io-client.CoxRrB0i.0.0.63.js";import{O as yf}from"./rxjs.B3taOakU.0.0.63.js";import{H as Gr,t as bf,y as wf,j as xf,p as Sf}from"./highlight.js.DyOtvXLH.0.0.63.js";import{M as Cf}from"./markdown-it.M3A8AdOh.0.0.63.js";import{q as kf}from"./qrcode.J-jUQ3O7.0.0.63.js";import{D as Jh}from"./draggabilly.o_TJc_mc.0.0.63.js";import{m as Ef}from"./vue-zoomable.CyClhEiW.0.0.63.js";import{e as Af,d as Mf}from"./primelocale.Bga3dOQu.0.0.63.js";import{Y as $f,Z as Pf}from"./@primevue.D_7clQ9D.0.0.63.js";import{a$ as Tf,b0 as Rf}from"./@primeuix.BkBDkSvZ.0.0.63.js";import"./nprogress.IzIs0JFK.0.0.63.js";import"./@xterm.BXZNujCq.0.0.63.js";import"./@intlify.BkGPX90O.0.0.63.js";import"./engine.io-client.DKSc90ta.0.0.63.js";import"./engine.io-parser.BiEtp6m2.0.0.63.js";import"./@socket.io.Dkula2eQ.0.0.63.js";import"./socket.io-parser.CS2MblGy.0.0.63.js";import"./tslib.9k7AwCpt.0.0.63.js";import"./mdurl.k9Sl0PQj.0.0.63.js";import"./uc.micro.kMc2yuuw.0.0.63.js";import"./entities.C20TfXL6.0.0.63.js";import"./linkify-it.DGDBcHC0.0.0.63.js";import"./punycode.js.Dj65hjkv.0.0.63.js";import"./dijkstrajs.C00ieaqj.0.0.63.js";import"./get-size.D1dS-IaP.0.0.63.js";import"./unidragger.DbVT_hUC.0.0.63.js";import"./ev-emitter.X5f1qa-c.0.0.63.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=t(r);fetch(r.href,i)}})();const If=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Of=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Nf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ff=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Lf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),jf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),qf=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Df=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zf(s,e){return m(),A("svg",Bf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M5.41 7.41L10 12l-4.59 4.59L4 15.17L7.17 12L4 8.83zm13.18 9.18L14 12l4.59-4.58L20 8.83L16.83 12L20 15.17z"},null,-1)]))}const Uf=pe({name:"mdi-unfold-less-vertical",render:zf}),Vf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hf(s,e){return m(),A("svg",Vf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 18.17L8.83 15l-1.41 1.41L12 21l4.59-4.59L15.17 15M12 5.83L15.17 9l1.41-1.41L12 3L7.41 7.59L8.83 9z"},null,-1)]))}const Qf=pe({name:"mdi-unfold-more-horizontal",render:Hf}),Kf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zf(s,e){return m(),A("svg",Kf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13H5v-2h14z"},null,-1)]))}const Gf=pe({name:"mdi-minus",render:Zf}),Wf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jf(s,e){return m(),A("svg",Wf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"},null,-1)]))}const _o=pe({name:"mdi-close",render:Jf}),Yf={class:"fixed flex flex-row items-center z-[99999] top-0 left-[7px] gap-2 p-2 non-draggable-region"},Xf=At({__name:"CuiWindowButtons",setup(s){const e=ae(!1),t=ae(!1),n=()=>{var a;t.value||(a=window.electron)==null||a.send("change-window","minify")},r=()=>{var a;(a=window.electron)==null||a.send("change-window","close")},i=()=>{var a;(a=window.electron)==null||a.send("change-window","expand")},o=(a,l)=>{t.value=l};return Sn(()=>{var a;(a=window.electron)==null||a.on("fullscreen",o)}),Ma(()=>{var a;(a=window.electron)==null||a.removeListener("fullscreen",o)}),(a,l)=>{const u=_o,d=Gf,h=Qf,v=Uf;return Pt((m(),A("div",Yf,[g("div",{class:"close-button",onClick:r},[y(u,{color:"#7f050a",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"])]),g("div",{class:at({"disabled-button":c(t),"minify-button":!c(t)}),onClick:n},[c(t)?ce("",!0):(m(),j(d,{key:0,color:"#995712",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"]))],2),g("div",{class:"expand-button",style:ot(`${c(t)?"transform: rotate(45deg)":"transform: rotate(-45deg)"}`),onClick:i},[c(t)?(m(),j(v,{key:1,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"])):(m(),j(h,{key:0,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"]))],4)])),[[c(Kh),f=>e.value=f]])}}}),qs=(s,e)=>{const t=s.__vccOpts||s;for(const[n,r]of e)t[n]=r;return t},e1=qs(Xf,[["__scopeId","data-v-8dab6fc2"]]),t1={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s1(s,e){return m(),A("svg",t1,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 6a7.75 7.75 0 1 0 10 0m-5-2v8"},null,-1)]))}const Yh=pe({name:"tabler-power",render:s1}),n1="/assets/logo-512.DLKVOU2S.0.0.63.png",r1=Object.freeze(Object.defineProperty({__proto__:null,default:n1},Symbol.toStringTag,{value:"Module"})),i1="/assets/logo-256.BCQk9H1-.0.0.63.png",o1=Object.freeze(Object.defineProperty({__proto__:null,default:i1},Symbol.toStringTag,{value:"Module"})),a1="/assets/logo-512.DLKVOU2S.0.0.63.png",c1=Object.freeze(Object.defineProperty({__proto__:null,default:a1},Symbol.toStringTag,{value:"Module"})),l1="/assets/logo.DmEiRk0z.0.0.63.png",u1=Object.freeze(Object.defineProperty({__proto__:null,default:l1},Symbol.toStringTag,{value:"Module"})),d1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20233.63%20233.63'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:url(%23dark_wine);}.cls-2{fill:url(%23light_wine);}.cls-3{fill:none;stroke:%23000;stroke-miterlimit:10;opacity:0;}.cls-4{fill:%23c5c6c8;}.cls-5{fill:%231a1e21;stroke:%233a3a3a;stroke-width:2px;}.cls-6{fill:%23fff;}%3c/style%3e%3clinearGradient%20id='dark_wine'%20x1='87.36'%20y1='158.67'%20x2='87.36'%20y2='59.85'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23730000'/%3e%3cstop%20offset='0.49'%20stop-color='%23a51733'/%3e%3c/linearGradient%3e%3clinearGradient%20id='light_wine'%20x1='113.06'%20y1='197.59'%20x2='113.06'%20y2='80.87'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23f44a6b'/%3e%3cstop%20offset='0.28'%20stop-color='%23df294c'/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='CameraUI_U'%3e%3cpath%20id='U_Left'%20class='cls-1'%20d='M47.05,119.47s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86A49.46,49.46,0,0,0,99,158.62c9.43-.46,20.55-3.87,29.24-11.86-3.9,2.5-9.87,5.1-15.9,4.77a25.63,25.63,0,0,1-18.38-9.09c-9.39-10.31-7.62-28.35-7.75-32.68-.35-11.42.77-21.92-1.76-36.19-.46-2.64-1.79-5.19-4.55-8-1.83-1.86-8.4-5.75-13.42-5.74-7.31,0-12.95,3.71-15.38,7.84-2,3.41-3.06,4.22-4.23,25.08a217.23,217.23,0,0,0,.22,26.76Z'%20transform='translate(0.5%200.5)'/%3e%3cpath%20id='U_Right'%20class='cls-2'%20d='M144.12,89.6a16.24,16.24,0,0,1,4.06-4.9c4.16-3.4,9-3.67,10.92-3.82a19.7,19.7,0,0,1,12.53,4.58c1.19,1,6.11,5.58,7.13,17.29.73,8.51,3.31,65.93-37,87.14-4.22,2.22-18,9.25-35.66,7.38a62.43,62.43,0,0,1-20.8-6.11,65.8,65.8,0,0,1-18.89-14.23c-20.21-21.67-19.36-57.46-19.36-57.46s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86A49.46,49.46,0,0,0,99,158.62c11.66-.57,25.93-5.64,35-18.32C143.52,126.8,138.46,100.51,144.12,89.6Z'%20transform='translate(0.5%200.5)'/%3e%3c/g%3e%3cg%20id='CameraUI_Lens'%3e%3ccircle%20id='ellipse'%20class='cls-3'%20cx='116.81'%20cy='116.81'%20r='116.31'/%3e%3cg%20id='lens'%3e%3ccircle%20id='lens_bg'%20class='cls-4'%20cx='159.13'%20cy='58.39'%20r='18.66'/%3e%3cpath%20id='lens_inner'%20class='cls-5'%20d='M169.64,58.31a11,11,0,1,1-22,0c0-6.08,4.93-11.86,11-11.86S169.64,52.23,169.64,58.31Z'%20transform='translate(0.5%200.5)'/%3e%3cg%20id='reflections'%3e%3cellipse%20id='dot_1'%20class='cls-6'%20cx='174.36'%20cy='53.69'%20rx='1.84'%20ry='1.42'/%3e%3cellipse%20id='dot_2'%20class='cls-6'%20cx='174.36'%20cy='57.08'%20rx='1.84'%20ry='1.42'/%3e%3cellipse%20id='dot_3'%20class='cls-6'%20cx='174.36'%20cy='60.46'%20rx='1.84'%20ry='1.42'/%3e%3ccircle%20id='dot_4'%20class='cls-6'%20cx='164.09'%20cy='63.77'%20r='1.66'/%3e%3cpath%20id='wide_1'%20class='cls-6'%20d='M156.63,48.9c-1.07-.88-5.52,3.09-6.31,5.43a1.53,1.53,0,0,0,0,1.26c.43.69,1.73.61,2.19.54,2.68-.44,4.71-4.09,4.8-4.37A3.21,3.21,0,0,0,156.63,48.9Z'%20transform='translate(0.5%200.5)'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",h1=Object.freeze(Object.defineProperty({__proto__:null,default:d1},Symbol.toStringTag,{value:"Module"})),m1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20132.55%20158.35'%20width='132.5500030517578'%20height='158.35000610351562'%3e%3cdefs%3e%3cstyle%3e.cls-2-1{fill:url(%23dark_wine);}.cls-2-2{fill:url(%23light_wine);}.cls-2-3{fill:%23c5c6c8;}.cls-2-4{fill:%231a1e21;stroke:%233a3a3a;stroke-width:2px;}.cls-2-5{fill:%23fff;}%3c/style%3e%3clinearGradient%20id='dark_wine'%20x1='45.89'%20y1='124.26'%20x2='45.89'%20y2='25.44'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23730000'%3e%3c/stop%3e%3cstop%20offset='0.49'%20stop-color='%23a51733'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20id='light_wine'%20x1='71.59'%20y1='163.18'%20x2='71.59'%20y2='46.47'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23f44a6b'%3e%3c/stop%3e%3cstop%20offset='0.28'%20stop-color='%23df294c'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='CameraUI_U'%3e%3cpath%20id='U_Left'%20class='cls-2-1%20svg-elem-1'%20d='M5.58,85.06s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86,49.46,49.46,0,0,0,21.42,3.87c9.43-.46,20.55-3.87,29.24-11.86-3.9,2.5-9.87,5.1-15.9,4.77A25.68,25.68,0,0,1,52.44,108c-9.38-10.31-7.61-28.35-7.74-32.68-.35-11.42.77-21.92-1.76-36.19-.46-2.64-1.79-5.19-4.55-8C36.55,29.33,30,25.43,25,25.44c-7.31,0-12.95,3.72-15.38,7.84-2,3.41-3.07,4.22-4.23,25.08a217.23,217.23,0,0,0,.22,26.76Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3cpath%20id='U_Right'%20class='cls-2-2%20svg-elem-2'%20d='M102.65,55.19a16.24,16.24,0,0,1,4.06-4.9c4.16-3.4,9-3.67,10.92-3.82a19.7,19.7,0,0,1,12.53,4.58c1.19,1,6.11,5.58,7.12,17.29.74,8.51,3.32,65.93-37,87.14-4.22,2.22-18,9.26-35.66,7.38a62.43,62.43,0,0,1-20.8-6.11,65.8,65.8,0,0,1-18.89-14.23C4.73,120.85,5.58,85.06,5.58,85.06s7.58,16,14.12,23.42a45.28,45.28,0,0,0,16.37,11.86,49.46,49.46,0,0,0,21.42,3.87c11.66-.57,25.93-5.64,35-18.32C102.05,92.39,97,66.1,102.65,55.19Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3c/g%3e%3cg%20id='CameraUI_Lens'%3e%3ccircle%20id='lens_bg'%20class='cls-2-3%20svg-elem-3'%20cx='112.11'%20cy='18.66'%20r='18.66'%3e%3c/circle%3e%3cpath%20id='lens_inner'%20class='cls-2-4%20svg-elem-4'%20d='M128.17,23.9a11,11,0,1,1-22,0c0-6.08,4.93-11.86,11-11.86S128.17,17.82,128.17,23.9Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3cg%20id='reflections'%3e%3cellipse%20id='dot_1'%20class='cls-2-5%20svg-elem-5'%20cx='127.34'%20cy='13.96'%20rx='1.84'%20ry='1.42'%3e%3c/ellipse%3e%3cellipse%20id='dot_2'%20class='cls-2-5%20svg-elem-6'%20cx='127.34'%20cy='17.34'%20rx='1.84'%20ry='1.42'%3e%3c/ellipse%3e%3cellipse%20id='dot_3'%20class='cls-2-5%20svg-elem-7'%20cx='127.34'%20cy='20.73'%20rx='1.84'%20ry='1.42'%3e%3c/ellipse%3e%3ccircle%20id='dot_4'%20class='cls-2-5%20svg-elem-8'%20cx='117.07'%20cy='24.04'%20r='1.66'%3e%3c/circle%3e%3cpath%20id='wide_1'%20class='cls-2-5%20svg-elem-9'%20d='M115.16,14.49c-1.07-.88-5.52,3.09-6.31,5.43a1.53,1.53,0,0,0,0,1.26c.43.69,1.73.61,2.18.54,2.69-.44,4.72-4.09,4.81-4.37A3.21,3.21,0,0,0,115.16,14.49Z'%20transform='translate(-5.05%20-4.82)'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",p1=Object.freeze(Object.defineProperty({__proto__:null,default:m1},Symbol.toStringTag,{value:"Module"})),f1="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='-40%20-30%20300%20300'%3e%3cdefs%3e%3cstyle%3e.cls-3-1%20{fill:%20url(%23dark_wine);}%20.cls-3-2%20{fill:%20url(%23light_wine);}%20.cls-3-3%20{fill:%20none;stroke:%20%23000;stroke-miterlimit:%2010;opacity:%200;}%20.cls-3-4%20{fill:%20%23c5c6c8;}%20.cls-3-5%20{fill:%20%231a1e21;stroke:%20%233a3a3a;stroke-width:%202px;}%20.cls-3-6%20{fill:%20%23fff;}%3c/style%3e%3clinearGradient%20id='dark_wine'%20x1='220.57'%20y1='310.8'%20x2='220.57'%20y2='211.98'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23730000'%20/%3e%3cstop%20offset='0.49'%20stop-color='%23a51733'%20/%3e%3c/linearGradient%3e%3clinearGradient%20id='light_wine'%20x1='246.27'%20y1='349.71'%20x2='246.27'%20y2='233'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23f44a6b'%20/%3e%3cstop%20offset='0.28'%20stop-color='%23df294c'%20/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20id='CameraUI_U'%20class='cameraLetter'%3e%3cpath%20id='U_Left'%20class='cls-3-1'%20d='M180.26,271.6s7.57,16,14.11,23.42a45.43,45.43,0,0,0,16.38,11.86,49.46,49.46,0,0,0,21.42,3.87c9.42-.46,20.55-3.87,29.24-11.86-3.9,2.5-9.87,5.1-15.9,4.77a25.66,25.66,0,0,1-18.39-9.09c-9.38-10.31-7.61-28.35-7.74-32.68-.35-11.43.77-21.92-1.76-36.2-.47-2.63-1.79-5.18-4.55-8-1.84-1.86-8.41-5.75-13.43-5.74-7.3,0-12.94,3.71-15.38,7.84-2,3.41-3.06,4.22-4.22,25.08a215.27,215.27,0,0,0,.22,26.76Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3cpath%20id='U_Right'%20class='cls-3-2'%20d='M277.33,241.73a16.41,16.41,0,0,1,4.05-4.91c4.17-3.39,9-3.66,10.92-3.81a19.67,19.67,0,0,1,12.53,4.58c1.2,1,6.12,5.58,7.13,17.29.74,8.51,3.31,65.93-37,87.13-4.23,2.22-18,9.26-35.67,7.39a62.35,62.35,0,0,1-20.79-6.11,65.68,65.68,0,0,1-18.9-14.24c-20.2-21.66-19.35-57.45-19.35-57.45s7.57,16,14.11,23.42a45.43,45.43,0,0,0,16.38,11.86,49.46,49.46,0,0,0,21.42,3.87c11.66-.57,25.92-5.64,35-18.33C276.73,278.93,271.67,252.64,277.33,241.73Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3c/g%3e%3cg%20id='CameraUI_Lens'%3e%3cg%20id='lens'%20class='cameraLens'%3e%3ccircle%20id='lens_bg'%20class='cls-3-4'%20cx='159.13'%20cy='58.39'%20r='18.66'%20/%3e%3cpath%20id='lens_inner'%20class='cls-3-5'%20d='M302.85,210.44a11,11,0,1,1-22,0c0-6.08,4.93-11.86,11-11.86S302.85,204.36,302.85,210.44Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3cg%20id='reflections'%3e%3cellipse%20id='dot_1'%20class='cls-3-6'%20cx='174.36'%20cy='53.69'%20rx='1.84'%20ry='1.42'%20/%3e%3cellipse%20id='dot_2'%20class='cls-3-6'%20cx='174.36'%20cy='57.08'%20rx='1.84'%20ry='1.42'%20/%3e%3cellipse%20id='dot_3'%20class='cls-3-6'%20cx='174.36'%20cy='60.46'%20rx='1.84'%20ry='1.42'%20/%3e%3ccircle%20id='dot_4'%20class='cls-3-6'%20cx='164.09'%20cy='63.77'%20r='1.66'%20/%3e%3cpath%20id='wide_1'%20class='cls-3-6'%20d='M289.83,201c-1.07-.88-5.52,3.09-6.3,5.43a1.52,1.52,0,0,0,0,1.26c.43.69,1.72.61,2.18.53,2.68-.43,4.72-4.08,4.8-4.36A3.18,3.18,0,0,0,289.83,201Z'%20transform='translate(-132.71%20-151.63)'%20/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e",g1=Object.freeze(Object.defineProperty({__proto__:null,default:f1},Symbol.toStringTag,{value:"Module"}));var ku={};/*! For license information please see bundle.js.LICENSE.txt */var v1={69:s=>{var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,o=365.25*r;function a(l,u,d,h){var v=u>=1.5*d;return Math.round(l/d)+" "+h+(v?"s":"")}s.exports=function(l,u){u=u||{};var d=typeof l;if(d==="string"&&l.length>0)return function(h){if(!((h=String(h)).length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(v){var f=parseFloat(v[1]);switch((v[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}(l);if(d==="number"&&isFinite(l))return u.long?function(h){var v=Math.abs(h);return v>=r?a(h,v,r,"day"):v>=n?a(h,v,n,"hour"):v>=t?a(h,v,t,"minute"):v>=e?a(h,v,e,"second"):h+" ms"}(l):function(h){var v=Math.abs(h);return v>=r?Math.round(h/r)+"d":v>=n?Math.round(h/n)+"h":v>=t?Math.round(h/t)+"m":v>=e?Math.round(h/e)+"s":h+"ms"}(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))}},142:s=>{var e=1e3,t=60*e,n=60*t,r=24*n,i=7*r,o=365.25*r;function a(l,u,d,h){var v=u>=1.5*d;return Math.round(l/d)+" "+h+(v?"s":"")}s.exports=function(l,u){u=u||{};var d=typeof l;if(d==="string"&&l.length>0)return function(h){if(!((h=String(h)).length>100)){var v=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);if(v){var f=parseFloat(v[1]);switch((v[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return f*o;case"weeks":case"week":case"w":return f*i;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}(l);if(d==="number"&&isFinite(l))return u.long?function(h){var v=Math.abs(h);return v>=r?a(h,v,r,"day"):v>=n?a(h,v,n,"hour"):v>=t?a(h,v,t,"minute"):v>=e?a(h,v,e,"second"):h+" ms"}(l):function(h){var v=Math.abs(h);return v>=r?Math.round(h/r)+"d":v>=n?Math.round(h/n)+"h":v>=t?Math.round(h/t)+"m":v>=e?Math.round(h/e)+"s":h+"ms"}(l);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(l))}},287:(s,e,t)=>{s.exports=function(n){function r(a){let l,u,d,h=null;function v(...f){if(!v.enabled)return;const b=v,k=Number(new Date),z=k-(l||k);b.diff=z,b.prev=l,b.curr=k,l=k,f[0]=r.coerce(f[0]),typeof f[0]!="string"&&f.unshift("%O");let L=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(se,K)=>{if(se==="%%")return"%";L++;const N=r.formatters[K];if(typeof N=="function"){const E=f[L];se=N.call(b,E),f.splice(L,1),L--}return se}),r.formatArgs.call(b,f),(b.log||r.log).apply(b,f)}return v.namespace=a,v.useColors=r.useColors(),v.color=r.selectColor(a),v.extend=i,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(u!==r.namespaces&&(u=r.namespaces,d=r.enabled(a)),d),set:f=>{h=f}}),typeof r.init=="function"&&r.init(v),v}function i(a,l){const u=r(this.namespace+(l===void 0?":":l)+a);return u.log=this.log,u}function o(a,l){let u=0,d=0,h=-1,v=0;for(;u<a.length;)if(d<l.length&&(l[d]===a[u]||l[d]==="*"))l[d]==="*"?(h=d,v=u,d++):(u++,d++);else{if(h===-1)return!1;d=h+1,v++,u=v}for(;d<l.length&&l[d]==="*";)d++;return d===l.length}return r.debug=r,r.default=r,r.coerce=function(a){return a instanceof Error?a.stack||a.message:a},r.disable=function(){const a=[...r.names,...r.skips.map(l=>"-"+l)].join(",");return r.enable(""),a},r.enable=function(a){r.save(a),r.namespaces=a,r.names=[],r.skips=[];const l=(typeof a=="string"?a:"").trim().replace(" ",",").split(",").filter(Boolean);for(const u of l)u[0]==="-"?r.skips.push(u.slice(1)):r.names.push(u)},r.enabled=function(a){for(const l of r.skips)if(o(a,l))return!1;for(const l of r.names)if(o(a,l))return!0;return!1},r.humanize=t(142),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(a=>{r[a]=n[a]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(a){let l=0;for(let u=0;u<a.length;u++)l=(l<<5)-l+a.charCodeAt(u),l|=0;return r.colors[Math.abs(l)%r.colors.length]},r.enable(r.load()),r}},288:(s,e,t)=>{e.formatArgs=function(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+s.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;r.splice(1,0,i,"color: inherit");let o=0,a=0;r[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(o++,l==="%c"&&(a=o))}),r.splice(a,0,i)},e.save=function(r){try{r?e.storage.setItem("debug",r):e.storage.removeItem("debug")}catch{}},e.load=function(){let r;try{r=e.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=ku.DEBUG),r},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),s.exports=t(287)(e);const{formatters:n}=s.exports;n.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}},413:(s,e,t)=>{e.formatArgs=function(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+s.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;r.splice(1,0,i,"color: inherit");let o=0,a=0;r[0].replace(/%[a-zA-Z%]/g,l=>{l!=="%%"&&(o++,l==="%c"&&(a=o))}),r.splice(a,0,i)},e.save=function(r){try{r?e.storage.setItem("debug",r):e.storage.removeItem("debug")}catch{}},e.load=function(){let r;try{r=e.storage.getItem("debug")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=ku.DEBUG),r},e.useColors=function(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),s.exports=t(692)(e);const{formatters:n}=s.exports;n.j=function(r){try{return JSON.stringify(r)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}},672:s=>{const e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,t=()=>e.now(),n=i=>i===1/0||(o=>o&&o===Math.floor(o)&&o>0&&isFinite(o))(i);class r{constructor({max:o=1/0,ttl:a,updateAgeOnGet:l=!1,checkAgeOnGet:u=!1,noUpdateTTL:d=!1,dispose:h,noDisposeOnSet:v=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,a!==void 0&&!n(a))throw new TypeError("ttl must be positive integer or Infinity if set");if(!n(o))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=a,this.max=o,this.updateAgeOnGet=!!l,this.checkAgeOnGet=!!u,this.noUpdateTTL=!!d,this.noDisposeOnSet=!!v,h!==void 0){if(typeof h!="function")throw new TypeError("dispose must be function if set");this.dispose=h}this.timer=void 0,this.timerExpiration=void 0}setTimer(o,a){if(this.timerExpiration<o)return;this.timer&&clearTimeout(this.timer);const l=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const u in this.expirations){this.setTimer(u,u-t());break}},a);l.unref&&l.unref(),this.timerExpiration=o,this.timer=l}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return process.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){const o=this.dispose!==r.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[a,l]of o)this.dispose(l,a,"delete")}setTTL(o,a=this.ttl){const l=this.expirationMap.get(o);if(l!==void 0){const u=this.expirations[l];!u||u.length<=1?delete this.expirations[l]:this.expirations[l]=u.filter(d=>d!==o)}if(a!==1/0){const u=Math.floor(t()+a);this.expirationMap.set(o,u),this.expirations[u]||(this.expirations[u]=[],this.setTimer(u,a)),this.expirations[u].push(o)}else this.expirationMap.set(o,1/0)}set(o,a,{ttl:l=this.ttl,noUpdateTTL:u=this.noUpdateTTL,noDisposeOnSet:d=this.noDisposeOnSet}={}){if(!n(l))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(o)){u||this.setTTL(o,l);const h=this.data.get(o);h!==a&&(this.data.set(o,a),d||this.dispose(h,o,"set"))}else this.setTTL(o,l),this.data.set(o,a);for(;this.size>this.max;)this.purgeToCapacity();return this}has(o){return this.data.has(o)}getRemainingTTL(o){const a=this.expirationMap.get(o);return a===1/0?a:a!==void 0?Math.max(0,Math.ceil(a-t())):0}get(o,{updateAgeOnGet:a=this.updateAgeOnGet,ttl:l=this.ttl,checkAgeOnGet:u=this.checkAgeOnGet}={}){const d=this.data.get(o);if(!u||this.getRemainingTTL(o)!==0)return a&&this.setTTL(o,l),d;this.delete(o)}dispose(o,a){}delete(o){const a=this.expirationMap.get(o);if(a!==void 0){const l=this.data.get(o);this.data.delete(o),this.expirationMap.delete(o);const u=this.expirations[a];return u&&(u.length<=1?delete this.expirations[a]:this.expirations[a]=u.filter(d=>d!==o)),this.dispose(l,o,"delete"),this.size===0&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(const o in this.expirations){const a=this.expirations[o];if(!(this.size-a.length>=this.max)){const l=this.size-this.max,u=[];for(const d of a.splice(0,l))u.push([d,this.data.get(d)]),this.data.delete(d),this.expirationMap.delete(d);for(const[d,h]of u)this.dispose(h,d,"evict");return}{delete this.expirations[o];const l=[];for(const u of a)l.push([u,this.data.get(u)]),this.data.delete(u),this.expirationMap.delete(u);for(const[u,d]of l)this.dispose(d,u,"evict")}}}get size(){return this.data.size}purgeStale(){const o=Math.ceil(t());for(const a in this.expirations){if(a==="Infinity"||a>o)return;const l=[...this.expirations[a]||[]],u=[];delete this.expirations[a];for(const d of l)u.push([d,this.data.get(d)]),this.data.delete(d),this.expirationMap.delete(d);for(const[d,h]of u)this.dispose(h,d,"stale")}this.size===0&&this.cancelTimer()}*entries(){for(const o in this.expirations)for(const a of this.expirations[o])yield[a,this.data.get(a)]}*keys(){for(const o in this.expirations)for(const a of this.expirations[o])yield a}*values(){for(const o in this.expirations)for(const a of this.expirations[o])yield this.data.get(a)}[Symbol.iterator](){return this.entries()}}s.exports=r},692:(s,e,t)=>{s.exports=function(n){function r(a){let l,u,d,h=null;function v(...f){if(!v.enabled)return;const b=v,k=Number(new Date),z=k-(l||k);b.diff=z,b.prev=l,b.curr=k,l=k,f[0]=r.coerce(f[0]),typeof f[0]!="string"&&f.unshift("%O");let L=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(se,K)=>{if(se==="%%")return"%";L++;const N=r.formatters[K];if(typeof N=="function"){const E=f[L];se=N.call(b,E),f.splice(L,1),L--}return se}),r.formatArgs.call(b,f),(b.log||r.log).apply(b,f)}return v.namespace=a,v.useColors=r.useColors(),v.color=r.selectColor(a),v.extend=i,v.destroy=r.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(u!==r.namespaces&&(u=r.namespaces,d=r.enabled(a)),d),set:f=>{h=f}}),typeof r.init=="function"&&r.init(v),v}function i(a,l){const u=r(this.namespace+(l===void 0?":":l)+a);return u.log=this.log,u}function o(a,l){let u=0,d=0,h=-1,v=0;for(;u<a.length;)if(d<l.length&&(l[d]===a[u]||l[d]==="*"))l[d]==="*"?(h=d,v=u,d++):(u++,d++);else{if(h===-1)return!1;d=h+1,v++,u=v}for(;d<l.length&&l[d]==="*";)d++;return d===l.length}return r.debug=r,r.default=r,r.coerce=function(a){return a instanceof Error?a.stack||a.message:a},r.disable=function(){const a=[...r.names,...r.skips.map(l=>"-"+l)].join(",");return r.enable(""),a},r.enable=function(a){r.save(a),r.namespaces=a,r.names=[],r.skips=[];const l=(typeof a=="string"?a:"").trim().replace(" ",",").split(",").filter(Boolean);for(const u of l)u[0]==="-"?r.skips.push(u.slice(1)):r.names.push(u)},r.enabled=function(a){for(const l of r.skips)if(o(a,l))return!1;for(const l of r.names)if(o(a,l))return!0;return!1},r.humanize=t(69),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(n).forEach(a=>{r[a]=n[a]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(a){let l=0;for(let u=0;u<a.length;u++)l=(l<<5)-l+a.charCodeAt(u),l|=0;return r.colors[Math.abs(l)%r.colors.length]},r.enable(r.load()),r}},779:(s,e,t)=>{var n;(function(r){(function(){var i=typeof globalThis=="object"?globalThis:typeof t.g=="object"?t.g:typeof self=="object"?self:typeof this=="object"?this:function(){try{return Function("return this;")()}catch{}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch{}}(),o=a(r);function a(l,u){return function(d,h){Object.defineProperty(l,d,{configurable:!0,writable:!0,value:h}),u&&u(d,h)}}i.Reflect!==void 0&&(o=a(i.Reflect,o)),function(l,u){var d=Object.prototype.hasOwnProperty,h=typeof Symbol=="function",v=h&&Symbol.toPrimitive!==void 0?Symbol.toPrimitive:"@@toPrimitive",f=h&&Symbol.iterator!==void 0?Symbol.iterator:"@@iterator",b=typeof Object.create=="function",k={__proto__:[]}instanceof Array,z=!b&&!k,L={create:b?function(){return ds(Object.create(null))}:k?function(){return ds({__proto__:null})}:function(){return ds({})},has:z?function(R,te){return d.call(R,te)}:function(R,te){return te in R},get:z?function(R,te){return d.call(R,te)?R[te]:void 0}:function(R,te){return R[te]}},se=Object.getPrototypeOf(Function),K=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:As(),N=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:fs(),E=typeof WeakMap=="function"?WeakMap:Ms(),O=h?Symbol.for("@reflect-metadata:registry"):void 0,U=Kt(),S=ps(U);function M(R,te,ve,ke){if(ge(ve)){if(!V(R))throw new TypeError;if(!_e(te))throw new TypeError;return Se(R,te)}if(!V(R))throw new TypeError;if(!wt(te))throw new TypeError;if(!wt(ke)&&!ge(ke)&&!pt(ke))throw new TypeError;return pt(ke)&&(ke=void 0),F(R,te,ve=Ue(ve),ke)}function B(R,te){function ve(ke,st){if(!wt(ke))throw new TypeError;if(!ge(st)&&!ye(st))throw new TypeError;ht(R,te,ke,st)}return ve}function W(R,te,ve,ke){if(!wt(ve))throw new TypeError;return ge(ke)||(ke=Ue(ke)),ht(R,te,ve,ke)}function I(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),D(R,te,ve)}function w(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),Y(R,te,ve)}function H(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),Te(R,te,ve)}function J(R,te,ve){if(!wt(te))throw new TypeError;return ge(ve)||(ve=Ue(ve)),He(R,te,ve)}function q(R,te){if(!wt(R))throw new TypeError;return ge(te)||(te=Ue(te)),Mt(R,te)}function oe(R,te){if(!wt(R))throw new TypeError;return ge(te)||(te=Ue(te)),Qe(R,te)}function ue(R,te,ve){if(!wt(te))throw new TypeError;if(ge(ve)||(ve=Ue(ve)),!wt(te))throw new TypeError;ge(ve)||(ve=Ue(ve));var ke=os(te,ve,!1);return!ge(ke)&&ke.OrdinaryDeleteMetadata(R,te,ve)}function Se(R,te){for(var ve=R.length-1;ve>=0;--ve){var ke=(0,R[ve])(te);if(!ge(ke)&&!pt(ke)){if(!_e(ke))throw new TypeError;te=ke}}return te}function F(R,te,ve,ke){for(var st=R.length-1;st>=0;--st){var Ot=(0,R[st])(te,ve,ke);if(!ge(Ot)&&!pt(Ot)){if(!wt(Ot))throw new TypeError;ke=Ot}}return ke}function D(R,te,ve){if(Y(R,te,ve))return!0;var ke=Le(te);return!pt(ke)&&D(R,ke,ve)}function Y(R,te,ve){var ke=os(te,ve,!1);return!ge(ke)&&Yt(ke.OrdinaryHasOwnMetadata(R,te,ve))}function Te(R,te,ve){if(Y(R,te,ve))return He(R,te,ve);var ke=Le(te);return pt(ke)?void 0:Te(R,ke,ve)}function He(R,te,ve){var ke=os(te,ve,!1);if(!ge(ke))return ke.OrdinaryGetOwnMetadata(R,te,ve)}function ht(R,te,ve,ke){os(ve,ke,!0).OrdinaryDefineOwnMetadata(R,te,ve,ke)}function Mt(R,te){var ve=Qe(R,te),ke=Le(R);if(ke===null)return ve;var st=Mt(ke,te);if(st.length<=0)return ve;if(ve.length<=0)return st;for(var Ot=new N,Ht=[],Ye=0,Ce=ve;Ye<Ce.length;Ye++){var Oe=Ce[Ye];Ot.has(Oe)||(Ot.add(Oe),Ht.push(Oe))}for(var Ne=0,be=st;Ne<be.length;Ne++)Oe=be[Ne],Ot.has(Oe)||(Ot.add(Oe),Ht.push(Oe));return Ht}function Qe(R,te){var ve=os(R,te,!1);return ve?ve.OrdinaryOwnMetadataKeys(R,te):[]}function ze(R){if(R===null)return 1;switch(typeof R){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return R===null?1:6;default:return 6}}function ge(R){return R===void 0}function pt(R){return R===null}function Jt(R){return typeof R=="symbol"}function wt(R){return typeof R=="object"?R!==null:typeof R=="function"}function zt(R,te){switch(ze(R)){case 0:case 1:case 2:case 3:case 4:case 5:return R}var ve="string",ke=_t(R,v);if(ke!==void 0){var st=ke.call(R,ve);if(wt(st))throw new TypeError;return st}return nt(R)}function nt(R,te){var ve,ke;{var st=R.toString;if(X(st)&&!wt(ke=st.call(R))||X(ve=R.valueOf)&&!wt(ke=ve.call(R)))return ke}throw new TypeError}function Yt(R){return!!R}function Be(R){return""+R}function Ue(R){var te=zt(R);return Jt(te)?te:Be(te)}function V(R){return Array.isArray?Array.isArray(R):R instanceof Object?R instanceof Array:Object.prototype.toString.call(R)==="[object Array]"}function X(R){return typeof R=="function"}function _e(R){return typeof R=="function"}function ye(R){switch(ze(R)){case 3:case 4:return!0;default:return!1}}function fe(R,te){return R===te||R!=R&&te!=te}function _t(R,te){var ve=R[te];if(ve!=null){if(!X(ve))throw new TypeError;return ve}}function Tt(R){var te=_t(R,f);if(!X(te))throw new TypeError;var ve=te.call(R);if(!wt(ve))throw new TypeError;return ve}function he(R){return R.value}function ie(R){var te=R.next();return!te.done&&te}function de(R){var te=R.return;te&&te.call(R)}function Le(R){var te=Object.getPrototypeOf(R);if(typeof R!="function"||R===se||te!==se)return te;var ve=R.prototype,ke=ve&&Object.getPrototypeOf(ve);if(ke==null||ke===Object.prototype)return te;var st=ke.constructor;return typeof st!="function"||st===R?te:st}function rt(){var R,te,ve,ke;ge(O)||u.Reflect===void 0||O in u.Reflect||typeof u.Reflect.defineMetadata!="function"||(R=Zt(u.Reflect));var st=new E,Ot={registerProvider:Ht,getProvider:Ce,setProvider:Ne};return Ot;function Ht(be){if(!Object.isExtensible(Ot))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case R===be:break;case ge(te):te=be;break;case te===be:break;case ge(ve):ve=be;break;case ve===be:break;default:ke===void 0&&(ke=new N),ke.add(be)}}function Ye(be,it){if(!ge(te)){if(te.isProviderFor(be,it))return te;if(!ge(ve)){if(ve.isProviderFor(be,it))return te;if(!ge(ke))for(var _=Tt(ke);;){var x=ie(_);if(!x)return;var C=he(x);if(C.isProviderFor(be,it))return de(_),C}}}if(!ge(R)&&R.isProviderFor(be,it))return R}function Ce(be,it){var _,x=st.get(be);return ge(x)||(_=x.get(it)),ge(_)&&(ge(_=Ye(be,it))||(ge(x)&&(x=new K,st.set(be,x)),x.set(it,_))),_}function Oe(be){if(ge(be))throw new TypeError;return te===be||ve===be||!ge(ke)&&ke.has(be)}function Ne(be,it,_){if(!Oe(_))throw new Error("Metadata provider not registered.");var x=Ce(be,it);if(x!==_){if(!ge(x))return!1;var C=st.get(be);ge(C)&&(C=new K,st.set(be,C)),C.set(it,_)}return!0}}function Kt(){var R;return!ge(O)&&wt(u.Reflect)&&Object.isExtensible(u.Reflect)&&(R=u.Reflect[O]),ge(R)&&(R=rt()),!ge(O)&&wt(u.Reflect)&&Object.isExtensible(u.Reflect)&&Object.defineProperty(u.Reflect,O,{enumerable:!1,configurable:!1,writable:!1,value:R}),R}function ps(R){var te=new E,ve={isProviderFor:function(Oe,Ne){var be=te.get(Oe);return!ge(be)&&be.has(Ne)},OrdinaryDefineOwnMetadata:Ht,OrdinaryHasOwnMetadata:st,OrdinaryGetOwnMetadata:Ot,OrdinaryOwnMetadataKeys:Ye,OrdinaryDeleteMetadata:Ce};return U.registerProvider(ve),ve;function ke(Oe,Ne,be){var it=te.get(Oe),_=!1;if(ge(it)){if(!be)return;it=new K,te.set(Oe,it),_=!0}var x=it.get(Ne);if(ge(x)){if(!be)return;if(x=new K,it.set(Ne,x),!R.setProvider(Oe,Ne,ve))throw it.delete(Ne),_&&te.delete(Oe),new Error("Wrong provider for target.")}return x}function st(Oe,Ne,be){var it=ke(Ne,be,!1);return!ge(it)&&Yt(it.has(Oe))}function Ot(Oe,Ne,be){var it=ke(Ne,be,!1);if(!ge(it))return it.get(Oe)}function Ht(Oe,Ne,be,it){ke(be,it,!0).set(Oe,Ne)}function Ye(Oe,Ne){var be=[],it=ke(Oe,Ne,!1);if(ge(it))return be;for(var _=Tt(it.keys()),x=0;;){var C=ie(_);if(!C)return be.length=x,be;var P=he(C);try{be[x]=P}catch(T){try{de(_)}finally{throw T}}x++}}function Ce(Oe,Ne,be){var it=ke(Ne,be,!1);if(ge(it)||!it.delete(Oe))return!1;if(it.size===0){var _=te.get(Ne);ge(_)||(_.delete(be),_.size===0&&te.delete(_))}return!0}}function Zt(R){var te=R.defineMetadata,ve=R.hasOwnMetadata,ke=R.getOwnMetadata,st=R.getOwnMetadataKeys,Ot=R.deleteMetadata,Ht=new E,Ye={isProviderFor:function(Ce,Oe){var Ne=Ht.get(Ce);return!(ge(Ne)||!Ne.has(Oe))||!!st(Ce,Oe).length&&(ge(Ne)&&(Ne=new N,Ht.set(Ce,Ne)),Ne.add(Oe),!0)},OrdinaryDefineOwnMetadata:te,OrdinaryHasOwnMetadata:ve,OrdinaryGetOwnMetadata:ke,OrdinaryOwnMetadataKeys:st,OrdinaryDeleteMetadata:Ot};return Ye}function os(R,te,ve){var ke=U.getProvider(R,te);if(!ge(ke))return ke;if(ve){if(U.setProvider(R,te,S))return S;throw new Error("Illegal state.")}}function As(){var R={},te=[],ve=function(){function Ye(Ce,Oe,Ne){this._index=0,this._keys=Ce,this._values=Oe,this._selector=Ne}return Ye.prototype["@@iterator"]=function(){return this},Ye.prototype[f]=function(){return this},Ye.prototype.next=function(){var Ce=this._index;if(Ce>=0&&Ce<this._keys.length){var Oe=this._selector(this._keys[Ce],this._values[Ce]);return Ce+1>=this._keys.length?(this._index=-1,this._keys=te,this._values=te):this._index++,{value:Oe,done:!1}}return{value:void 0,done:!0}},Ye.prototype.throw=function(Ce){throw this._index>=0&&(this._index=-1,this._keys=te,this._values=te),Ce},Ye.prototype.return=function(Ce){return this._index>=0&&(this._index=-1,this._keys=te,this._values=te),{value:Ce,done:!0}},Ye}(),ke=function(){function Ye(){this._keys=[],this._values=[],this._cacheKey=R,this._cacheIndex=-2}return Object.defineProperty(Ye.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ye.prototype.has=function(Ce){return this._find(Ce,!1)>=0},Ye.prototype.get=function(Ce){var Oe=this._find(Ce,!1);return Oe>=0?this._values[Oe]:void 0},Ye.prototype.set=function(Ce,Oe){var Ne=this._find(Ce,!0);return this._values[Ne]=Oe,this},Ye.prototype.delete=function(Ce){var Oe=this._find(Ce,!1);if(Oe>=0){for(var Ne=this._keys.length,be=Oe+1;be<Ne;be++)this._keys[be-1]=this._keys[be],this._values[be-1]=this._values[be];return this._keys.length--,this._values.length--,fe(Ce,this._cacheKey)&&(this._cacheKey=R,this._cacheIndex=-2),!0}return!1},Ye.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=R,this._cacheIndex=-2},Ye.prototype.keys=function(){return new ve(this._keys,this._values,st)},Ye.prototype.values=function(){return new ve(this._keys,this._values,Ot)},Ye.prototype.entries=function(){return new ve(this._keys,this._values,Ht)},Ye.prototype["@@iterator"]=function(){return this.entries()},Ye.prototype[f]=function(){return this.entries()},Ye.prototype._find=function(Ce,Oe){if(!fe(this._cacheKey,Ce)){this._cacheIndex=-1;for(var Ne=0;Ne<this._keys.length;Ne++)if(fe(this._keys[Ne],Ce)){this._cacheIndex=Ne;break}}return this._cacheIndex<0&&Oe&&(this._cacheIndex=this._keys.length,this._keys.push(Ce),this._values.push(void 0)),this._cacheIndex},Ye}();return ke;function st(Ye,Ce){return Ye}function Ot(Ye,Ce){return Ce}function Ht(Ye,Ce){return[Ye,Ce]}}function fs(){return function(){function R(){this._map=new K}return Object.defineProperty(R.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),R.prototype.has=function(te){return this._map.has(te)},R.prototype.add=function(te){return this._map.set(te,te),this},R.prototype.delete=function(te){return this._map.delete(te)},R.prototype.clear=function(){this._map.clear()},R.prototype.keys=function(){return this._map.keys()},R.prototype.values=function(){return this._map.keys()},R.prototype.entries=function(){return this._map.entries()},R.prototype["@@iterator"]=function(){return this.keys()},R.prototype[f]=function(){return this.keys()},R}()}function Ms(){var R=16,te=L.create(),ve=ke();return function(){function Ce(){this._key=ke()}return Ce.prototype.has=function(Oe){var Ne=st(Oe,!1);return Ne!==void 0&&L.has(Ne,this._key)},Ce.prototype.get=function(Oe){var Ne=st(Oe,!1);return Ne!==void 0?L.get(Ne,this._key):void 0},Ce.prototype.set=function(Oe,Ne){return st(Oe,!0)[this._key]=Ne,this},Ce.prototype.delete=function(Oe){var Ne=st(Oe,!1);return Ne!==void 0&&delete Ne[this._key]},Ce.prototype.clear=function(){this._key=ke()},Ce}();function ke(){var Ce;do Ce="@@WeakMap@@"+Ye();while(L.has(te,Ce));return te[Ce]=!0,Ce}function st(Ce,Oe){if(!d.call(Ce,ve)){if(!Oe)return;Object.defineProperty(Ce,ve,{value:L.create()})}return Ce[ve]}function Ot(Ce,Oe){for(var Ne=0;Ne<Oe;++Ne)Ce[Ne]=255*Math.random()|0;return Ce}function Ht(Ce){if(typeof Uint8Array=="function"){var Oe=new Uint8Array(Ce);return typeof crypto<"u"?crypto.getRandomValues(Oe):typeof msCrypto<"u"?msCrypto.getRandomValues(Oe):Ot(Oe,Ce),Oe}return Ot(new Array(Ce),Ce)}function Ye(){var Ce=Ht(R);Ce[6]=79&Ce[6]|64,Ce[8]=191&Ce[8]|128;for(var Oe="",Ne=0;Ne<R;++Ne){var be=Ce[Ne];Ne!==4&&Ne!==6&&Ne!==8||(Oe+="-"),be<16&&(Oe+="0"),Oe+=be.toString(16).toLowerCase()}return Oe}}function ds(R){return R.__=void 0,delete R.__,R}l("decorate",M),l("metadata",B),l("defineMetadata",W),l("hasMetadata",I),l("hasOwnMetadata",w),l("getMetadata",H),l("getOwnMetadata",J),l("getMetadataKeys",q),l("getOwnMetadataKeys",oe),l("deleteMetadata",ue)}(o,i),i.Reflect===void 0&&(i.Reflect=r)})()})(n||(n={}))}},Eu={};function tn(s){var e=Eu[s];if(e!==void 0)return e.exports;var t=Eu[s]={exports:{}};return v1[s](t,t.exports,tn),t.exports}tn.n=s=>{var e=s&&s.__esModule?()=>s.default:()=>s;return tn.d(e,{a:e}),e},tn.d=(s,e)=>{for(var t in e)tn.o(e,t)&&!tn.o(s,t)&&Object.defineProperty(s,t,{enumerable:!0,get:e[t]})},tn.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),tn.o=(s,e)=>Object.prototype.hasOwnProperty.call(s,e);class _1{constructor(e){p(this,"baseURL");p(this,"abortControllers",new Set);this.baseURL=`${e}/api`}async request(e,t,n,r={}){const i=new AbortController;this.abortControllers.add(i);const o=setTimeout(()=>{i.abort(),this.abortControllers.delete(i)},15e3);try{const a=await fetch(`${this.baseURL}${t}`,{method:e,headers:{"Content-Type":"application/json",...r.headers},body:n?JSON.stringify(n):void 0,signal:i.signal,...r});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a}finally{clearTimeout(o),this.abortControllers.delete(i)}}get(e,t){return this.request("GET",e,void 0,t)}post(e,t,n){return this.request("POST",e,t,n)}}const ks={FAILED:"CONNECTION_FAILED",TIMEOUT:"CONNECTION_TIMEOUT",NOT_CONNECTED:"CONNECTION_NOT_CONNECTED",INVALID_STATE:"CONNECTION_INVALID_STATE",INTERNAL_ERROR:"CONNECTION_INTERNAL_ERROR"},Ir={MISSING:"CONFIG_MISSING",INVALID:"CONFIG_INVALID",INTERNAL_ERROR:"CONFIG_INTERNAL_ERROR"},en={INVALID_CREDENTIALS:"AUTH_INVALID_CREDENTIALS",UNAUTHORIZED:"AUTH_UNAUTHORIZED",FORBIDDEN:"AUTH_FORBIDDEN",INTERNAL_ERROR:"AUTH_INTERNAL_ERROR"},$n={REGISTRATION_FAILED:"CLIENT_REGISTRATION_FAILED",UNREGISTRATION_FAILED:"CLIENT_UNREGISTRATION_FAILED",NOT_FOUND:"CLIENT_NOT_FOUND",INVALID_STATE:"CLIENT_INVALID_STATE",INTERNAL_ERROR:"CLIENT_INTERNAL_ERROR"},zn={INVALID_FORMAT:"MESSAGE_INVALID_FORMAT",DELIVERY_FAILED:"MESSAGE_DELIVERY_FAILED",TIMEOUT:"MESSAGE_TIMEOUT",EXECUTION_FAILED:"MESSAGE_EXECUTION_FAILED",INTERNAL_ERROR:"MESSAGE_INTERNAL_ERROR"},rr={METHOD_NOT_FOUND:"RPC_METHOD_NOT_FOUND",INVALID_REQUEST:"RPC_INVALID_REQUEST",INTERNAL_ERROR:"RPC_INTERNAL_ERROR",CONNECTION_FAILED:"RPC_CONNECTION_FAILED"},Xh={INTERNAL_ERROR:"REGISTRY_INTERNAL_ERROR"},sr={JOIN_FAILED:"CLUSTER_JOIN_FAILED",SYNC_FAILED:"CLUSTER_SYNC_FAILED",COMMUNICATION_FAILED:"CLUSTER_COMMUNICATION_FAILED",INVALID_STATE:"CLUSTER_INVALID_STATE",NODE_NOT_FOUND:"CLUSTER_NODE_NOT_FOUND",INSTANCE_NOT_FOUND:"CLUSTER_INSTANCE_NOT_FOUND",INTERNAL_ERROR:"CLUSTER_INTERNAL_ERROR"};class ws extends Error{constructor(t,n,r,i){super(t);p(this,"code");p(this,"details");p(this,"cause");this.code=n,this.details=r,this.cause=i,this.name=this.constructor.name,Error.captureStackTrace(this,this.constructor),this.cause&&(this.cause={name:this.cause.name,message:this.cause.message,...this.cause instanceof ws?{code:this.cause.code,details:this.cause.details}:{code:"INTERNAL_ERROR",details:{description:this.cause.message}}})}toJSON(){return{name:this.name,message:this.message,code:this.code,details:this.details,stack:this.stack,cause:this.cause}}static fromJSON(t){return new ws(t.message,t.code,t.details,t.cause?ws.fromJSON(t.cause):void 0)}}class y1 extends ws{constructor(e,t,n){super(e,ks.INTERNAL_ERROR,t,n)}}class b1 extends ws{constructor(e,t,n){super(e,Ir.INTERNAL_ERROR,t,n)}}class w1 extends ws{constructor(e,t,n){super(e,en.INTERNAL_ERROR,t,n)}}class x1 extends ws{constructor(e,t,n){super(e,$n.INTERNAL_ERROR,t,n)}}class S1 extends ws{constructor(e,t,n){super(e,zn.INTERNAL_ERROR,t,n)}}class C1 extends ws{constructor(e,t,n){super(e,rr.INTERNAL_ERROR,t,n)}}class k1 extends ws{constructor(e,t,n){super(e,Xh.INTERNAL_ERROR,t,n)}}class E1 extends ws{constructor(e,t,n){super(e,sr.INTERNAL_ERROR,t,n)}}const lt=class lt{static create(e,t,n,r){if(t instanceof ws)return t;const i=t instanceof Error?t:new Error(String(t)),o=function(a){function l(u){let d=!1;try{typeof Buffer<"u"&&(d=u instanceof Buffer)}catch{d=!1}return u instanceof ArrayBuffer||u instanceof Uint8Array||d||ArrayBuffer.isView(u)?"<binary>":Array.isArray(u)?u.map(l):u&&typeof u=="object"?Object.fromEntries(Object.entries(u).map(([h,v])=>[h,l(v)])):u}return l(a??{})}(r);switch(e){case"connection":return new y1(n,o,i);case"config":return new b1(n,o,i);case"auth":return new w1(n,o,i);case"client":return new x1(n,o,i);case"message":return new S1(n,o,i);case"rpc":return new C1(n,o,i);case"registry":return new k1(n,o,i);case"cluster":return new E1(n,o,i)}}static async handle(e,t,n,r){try{return await e()}catch(i){throw lt.create(t,i,n,r)}}};p(lt,"connection",{connectionFailed:(e,t)=>lt.create("connection",e,"Connection failed",{description:"Failed to establish connection",code:ks.FAILED,...t}),subscribeFailed:(e,t)=>lt.create("connection",e,"Subscription failed",{description:"Failed to subscribe to subject",code:ks.INTERNAL_ERROR,...t}),requestFailed:(e,t)=>lt.create("connection",e,"Request failed",{description:"Failed to send request",code:ks.INTERNAL_ERROR,...t}),timeout:(e,t)=>lt.create("connection",e,"Connection timeout",{description:"Connection attempt timed out",code:ks.TIMEOUT,...t}),notConnected:(e,t)=>lt.create("connection",e,"Not connected",{description:"Connection is not established",code:ks.INTERNAL_ERROR,...t}),invalidState:(e,t)=>lt.create("connection",e,"Invalid connection state",{description:"Connection is in invalid state",code:ks.INVALID_STATE,...t}),internalError:(e,t)=>lt.create("connection",e,"Internal connection error",{description:"Internal connection error",code:ks.INTERNAL_ERROR,...t})}),p(lt,"config",{missing:(e,t)=>lt.create("config",e,"Missing configuration",{description:"Required configuration is missing",code:Ir.MISSING,...t}),invalid:(e,t)=>lt.create("config",e,"Invalid configuration",{description:"Invalid configuration provided",code:Ir.INVALID,...t}),internalError:(e,t)=>lt.create("config",e,"Internal configuration error",{description:"Internal configuration error",code:Ir.INTERNAL_ERROR,...t})}),p(lt,"auth",{unauthorized:(e,t)=>lt.create("auth",e,"Unauthorized",{description:"Authentication failed",code:en.UNAUTHORIZED,...t}),forbidden:(e,t)=>lt.create("auth",e,"Forbidden",{description:"Insufficient permissions",code:en.FORBIDDEN,...t}),internalError:(e,t)=>lt.create("auth",e,"Internal auth error",{description:"Internal auth error",code:en.INTERNAL_ERROR,...t})}),p(lt,"client",{registrationFailed:(e,t)=>lt.create("client",e,"Registration failed",{description:"Failed to register client",code:$n.REGISTRATION_FAILED,...t}),notFound:(e,t)=>lt.create("client",e,"Client not found",{description:"Requested client could not be found",code:$n.NOT_FOUND,...t}),invalidState:(e,t)=>lt.create("client",e,"Invalid client state",{description:"Client is in invalid state",code:$n.INVALID_STATE,...t}),internalError:(e,t)=>lt.create("client",e,"Internal client error",{description:"Internal client error",code:$n.INTERNAL_ERROR,...t})}),p(lt,"message",{invalidFormat:(e,t)=>lt.create("message",e,"Invalid message format",{description:"Failed to parse message",code:zn.INVALID_FORMAT,...t}),deliveryFailed:(e,t)=>lt.create("message",e,"Message delivery failed",{description:"Failed to deliver message",code:zn.DELIVERY_FAILED,...t}),timeout:(e,t)=>lt.create("message",e,"Message timeout",{description:"Message processing timed out",code:zn.TIMEOUT,...t}),executionFailed:(e,t)=>lt.create("message",e,"Message execution failed",{description:"Failed to execute message",code:zn.EXECUTION_FAILED,...t}),internalError:(e,t)=>lt.create("message",e,"Internal message error",{description:"Internal message error",code:zn.INTERNAL_ERROR,...t})}),p(lt,"cluster",{joinFailed:(e,t)=>lt.create("cluster",e,"Failed to join cluster",{description:"Failed to join cluster",code:sr.JOIN_FAILED,...t}),syncFailed:(e,t)=>lt.create("cluster",e,"Failed to sync cluster",{description:"Failed to sync cluster",code:sr.SYNC_FAILED,...t}),nodeNotFound:(e,t)=>lt.create("cluster",e,"Node not found",{description:"Requested node could not be found",code:sr.NODE_NOT_FOUND,...t}),instanceNotFound:(e,t)=>lt.create("cluster",e,"Instance not found",{description:"Requested instance could not be found",code:sr.INSTANCE_NOT_FOUND,...t}),communicationFailed:(e,t)=>lt.create("cluster",e,"Communication failed",{description:"Cluster communication failed",code:sr.COMMUNICATION_FAILED,...t}),invalidState:(e,t)=>lt.create("cluster",e,"Invalid cluster state",{description:"Cluster is in invalid state",code:sr.INVALID_STATE,...t}),internalError:(e,t)=>lt.create("cluster",e,"Internal cluster error",{description:"Internal cluster error",code:sr.INTERNAL_ERROR,...t})}),p(lt,"registry",{internalError:(e,t)=>lt.create("registry",e,"Internal registry error",{description:"Internal registry error",code:Xh.INTERNAL_ERROR,...t})}),p(lt,"rpc",{methodNotFound:(e,t,n)=>lt.create("rpc",t,`Method not found: ${e}`,{description:"Requested method could not be found",code:rr.METHOD_NOT_FOUND,...n}),invalidRequest:(e,t)=>lt.create("rpc",e,"Invalid request",{description:"Invalid RPC request",code:rr.INVALID_REQUEST,...t}),requestFailed:(e,t)=>lt.create("rpc",e,"RPC request failed",{description:"Failed to send RPC request",code:rr.INTERNAL_ERROR,...t}),executionFailed:(e,t)=>lt.create("rpc",e,"RPC execution failed",{description:"Failed to execute RPC request",code:rr.INTERNAL_ERROR,...t}),connectionFailed:(e,t)=>lt.create("rpc",e,"Failed to get RPC connection",{description:"Failed to get RPC connection",code:rr.CONNECTION_FAILED,...t}),internalError:(e,t)=>lt.create("rpc",e,"Internal RPC error",{description:"Internal RPC error",code:rr.INTERNAL_ERROR,...t})});let kt=lt;class ns{static getPluginToPluginSubject(e,t){return this.createRoutingPattern("plugin","plugin",e,t)}static getPluginToServiceSubject(e,t){return this.createRoutingPattern("plugin","service",e,t)}static getServiceToServiceSubject(e,t){return this.createRoutingPattern("service","service",e,t)}static getServiceToPluginSubject(e,t){return this.createRoutingPattern("service","plugin",e,t)}static getPluginToServerSubject(e,t){return this.createRoutingPattern("plugin","server",e,t)}static getServiceToServerSubject(e,t){return this.createRoutingPattern("service","server",e,t)}static getServerToPluginSubject(e,t){return this.createRoutingPattern("server","plugin",e,t)}static getServerToServiceSubject(e,t){return this.createRoutingPattern("server","service",e,t)}static createRoutingMetadata(e,t,n,r){const i={source:{type:e,id:t}};return n&&r&&(i.target={type:n,id:r}),i}static createRoutingPattern(e,t,n,r){return r?`${e}.${t}.${n}.${r}`:`${e}.${t}.${n}.*`}}class yo{static validateMetadata(e){if(!e.id)throw kt.config.invalid(void 0,{description:"Invalid ID in metadata",code:Ir.INVALID,metadata:{metadata:e}});if(!e.name)throw kt.config.invalid(void 0,{description:"Invalid name in metadata",code:Ir.INVALID,metadata:{metadata:e}})}static validateConnectionOptions(e){if(yo.validateMetadata(e.metadata),!e.endpoints||e.endpoints.length===0)throw kt.config.invalid(void 0,{description:"No NATS endpoints provided",code:Ir.INVALID,metadata:{endpoints:e.endpoints}});if(!e.auth)throw kt.config.invalid(void 0,{description:"No authentication configuration provided",code:en.INVALID_CREDENTIALS});if("server"in e.auth){const{server:t,cluster:n}=e.auth;if(!t||typeof t!="object")throw kt.config.invalid(void 0,{description:"Missing server authentication configuration",code:en.INVALID_CREDENTIALS});if(!n||typeof n!="object")throw kt.config.invalid(void 0,{description:"Missing cluster authentication configuration",code:en.INVALID_CREDENTIALS});if(typeof t.user!="string"||t.user.length===0)throw kt.config.invalid(void 0,{description:"Invalid server username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:t.user}}});if(typeof t.password!="string"||t.password.length===0)throw kt.config.invalid(void 0,{description:"Invalid server password provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{password:"***"}}});if(typeof n.user!="string"||n.user.length===0)throw kt.config.invalid(void 0,{description:"Invalid cluster username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:n.user}}});if(typeof n.password!="string"||n.password.length===0)throw kt.config.invalid(void 0,{description:"Invalid cluster password provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{password:"***"}}})}else{const{user:t,password:n}=e.auth;if(typeof t!="string"||t.length===0)throw kt.config.invalid(void 0,{description:"Invalid username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:t}}});if(typeof n!="string"||n.length===0)throw kt.config.invalid(void 0,{description:"Invalid password provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{password:"***"}}})}}}var Pi=tn(288);const rn=new Uint8Array(0),Dr=new TextEncoder,sn=new TextDecoder;function Gi(...s){const e=[];for(let t=0;t<s.length;t++)e.push(Dr.encode(s[t]));return e.length===0?rn:e.length===1?e[0]:function(...t){let n=0;for(let o=0;o<t.length;o++)n+=t[o].length;const r=new Uint8Array(n);let i=0;for(let o=0;o<t.length;o++)r.set(t[o],i),i+=t[o].length;return r}(...e)}function Au(s){return s&&s.length!==0?sn.decode(s):""}const Mu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";function A1(s){var e;(e=globalThis==null?void 0:globalThis.crypto)!=null&&e.getRandomValues?globalThis.crypto.getRandomValues(s):function(t){for(let n=0;n<t.length;n++)t[n]=Math.floor(255*Math.random())}(s)}const vr=new class{constructor(){p(this,"buf");p(this,"seq");p(this,"inc");p(this,"inited");this.buf=new Uint8Array(22),this.inited=!1}init(){this.inited=!0,this.setPre(),this.initSeqAndInc(),this.fillSeq()}initSeqAndInc(){this.seq=Math.floor(0xcfd41b9100000*Math.random()),this.inc=Math.floor(300*Math.random()+33)}setPre(){const s=new Uint8Array(12);A1(s);for(let e=0;e<12;e++){const t=s[e]%36;this.buf[e]=Mu.charCodeAt(t)}}fillSeq(){let s=this.seq;for(let e=21;e>=12;e--)this.buf[e]=Mu.charCodeAt(s%36),s=Math.floor(s/36)}next(){return this.inited||this.init(),this.seq+=this.inc,this.seq>0xcfd41b9100000&&(this.setPre(),this.initSeqAndInc()),this.fillSeq(),String.fromCharCode.apply(String,this.buf)}reset(){this.init()}};var Pn,ii,Re;(function(s){s.Disconnect="disconnect",s.Reconnect="reconnect",s.Update="update",s.LDM="ldm",s.Error="error"})(Pn||(Pn={})),function(s){s.Reconnecting="reconnecting",s.PingTimer="pingTimer",s.StaleConnection="staleConnection",s.ClientInitiatedReconnect="client initiated reconnect"}(ii||(ii={})),function(s){s.ApiError="BAD API",s.BadAuthentication="BAD_AUTHENTICATION",s.BadCreds="BAD_CREDS",s.BadHeader="BAD_HEADER",s.BadJson="BAD_JSON",s.BadPayload="BAD_PAYLOAD",s.BadSubject="BAD_SUBJECT",s.Cancelled="CANCELLED",s.ConnectionClosed="CONNECTION_CLOSED",s.ConnectionDraining="CONNECTION_DRAINING",s.ConnectionRefused="CONNECTION_REFUSED",s.ConnectionTimeout="CONNECTION_TIMEOUT",s.Disconnect="DISCONNECT",s.InvalidOption="INVALID_OPTION",s.InvalidPayload="INVALID_PAYLOAD",s.MaxPayloadExceeded="MAX_PAYLOAD_EXCEEDED",s.NoResponders="503",s.NotFunction="NOT_FUNC",s.RequestError="REQUEST_ERROR",s.ServerOptionNotAvailable="SERVER_OPT_NA",s.SubClosed="SUB_CLOSED",s.SubDraining="SUB_DRAINING",s.Timeout="TIMEOUT",s.Tls="TLS",s.Unknown="UNKNOWN_ERROR",s.WssRequired="WSS_REQUIRED",s.JetStreamInvalidAck="JESTREAM_INVALID_ACK",s.JetStream404NoMessages="404",s.JetStream408RequestTimeout="408",s.JetStream409MaxAckPendingExceeded="409",s.JetStream409="409",s.JetStreamNotEnabled="503",s.JetStreamIdleHeartBeat="IDLE_HEARTBEAT",s.AuthorizationViolation="AUTHORIZATION_VIOLATION",s.AuthenticationExpired="AUTHENTICATION_EXPIRED",s.ProtocolError="NATS_PROTOCOL_ERR",s.PermissionsViolation="PERMISSIONS_VIOLATION",s.AuthenticationTimeout="AUTHENTICATION_TIMEOUT",s.AccountExpired="ACCOUNT_EXPIRED"}(Re||(Re={}));class em{constructor(){p(this,"messages");this.messages=new Map,this.messages.set(Re.InvalidPayload,"Invalid payload type - payloads can be 'binary', 'string', or 'json'"),this.messages.set(Re.BadJson,"Bad JSON"),this.messages.set(Re.WssRequired,"TLS is required, therefore a secure websocket connection is also required")}static getMessage(e){return M1.getMessage(e)}getMessage(e){return this.messages.get(e)||e}}const M1=new em;class Ve extends Error{constructor(t,n,r){super(t);p(this,"name");p(this,"message");p(this,"code");p(this,"permissionContext");p(this,"chainedError");p(this,"api_error");this.name="NatsError",this.message=t,this.code=n,this.chainedError=r}static errorForCode(t,n){const r=em.getMessage(t);return new Ve(r,t,n)}isAuthError(){return this.code===Re.AuthenticationExpired||this.code===Re.AuthorizationViolation||this.code===Re.AccountExpired}isAuthTimeout(){return this.code===Re.AuthenticationTimeout}isPermissionError(){return this.code===Re.PermissionsViolation}isProtocolError(){return this.code===Re.ProtocolError}isJetStreamError(){return this.api_error!==void 0}jsError(){return this.api_error?this.api_error:null}}var Ys,bn,Wi;(function(s){s[s.Exact=0]="Exact",s[s.CanonicalMIME=1]="CanonicalMIME",s[s.IgnoreCase=2]="IgnoreCase"})(Ys||(Ys={})),function(s){s.Timer="timer",s.Count="count",s.JitterTimer="jitterTimer",s.SentinelMsg="sentinelMsg"}(bn||(bn={})),function(s){s.STATS="io.nats.micro.v1.stats_response",s.INFO="io.nats.micro.v1.info_response",s.PING="io.nats.micro.v1.ping_response"}(Wi||(Wi={}));const ra="Nats-Service-Error",ia="Nats-Service-Error-Code";class oa extends Error{constructor(t,n){super(n);p(this,"code");this.code=t}static isServiceError(t){return oa.toServiceError(t)!==null}static toServiceError(t){var r,i;const n=((r=t==null?void 0:t.headers)==null?void 0:r.get(ia))||"";if(n!==""){const o=parseInt(n)||400,a=((i=t==null?void 0:t.headers)==null?void 0:i.get(ra))||"";return new oa(o,a.length?a:n)}return null}}function Qn(s=""){if(typeof(s=s||"_INBOX")!="string")throw new Error("prefix must be a string");return s.split(".").forEach(e=>{if(e==="*"||e===">")throw new Error(`inbox prefixes cannot have wildcards '${s}'`)}),`${s}.${vr.next()}`}const uc="127.0.0.1";var dr;function Pa(s,...e){for(let t=0;t<e.length;t++){const n=e[t];Object.keys(n).forEach(function(r){s[r]=n[r]})}return s}function Ao(s){return sn.decode(s).replace(/\n/g,"␊").replace(/\r/g,"␍")}function pi(s,e=!0){const t=e?Ve.errorForCode(Re.Timeout):null;let n,r;const i=new Promise((o,a)=>{n={cancel:()=>{r&&clearTimeout(r)}},r=setTimeout(()=>{a(t===null?Ve.errorForCode(Re.Timeout):t)},s)});return Object.assign(i,n)}function Ti(s=0){let e;const t=new Promise(n=>{const r=setTimeout(()=>{n()},s);e={cancel:()=>{r&&clearTimeout(r)}}});return Object.assign(t,e)}function is(){let s={};const e=new Promise((t,n)=>{s={resolve:t,reject:n}});return Object.assign(e,s)}function tm(s){for(let e=s.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[s[e],s[t]]=[s[t],s[e]]}return s}(function(s){s.PING="PING",s.STATS="STATS",s.INFO="INFO"})(dr||(dr={}));function cl(s=[0,250,250,500,500,3e3,5e3]){Array.isArray(s)||(s=[0,250,250,500,500,3e3,5e3]);const e=s.length-1;return{backoff:t=>function(n){return n===0?0:Math.floor(n/2+Math.random()*n)}(t>e?s[e]:s[t])}}function rs(s){return 1e6*s}function ll(s){return Math.floor(s/1e6)}function $u(s){let e=!0;const t=new Array(s.length);for(let n=0;n<s.length;n++){let r=s.charCodeAt(n);if(r===58||r<33||r>126)throw new Ve(`'${s[n]}' is not a valid character for a header key`,Re.BadHeader);e&&97<=r&&r<=122?r-=32:!e&&65<=r&&r<=90&&(r+=32),t[n]=r,e=r==45}return String.fromCharCode(...t)}function Zn(s=0,e=""){if(s===0&&e!==""||s>0&&e==="")throw new Error("setting status requires both code and description");return new hr(s,e)}const Ba="NATS/1.0";class hr{constructor(e=0,t=""){p(this,"_code");p(this,"headers");p(this,"_description");this._code=e,this._description=t,this.headers=new Map}[Symbol.iterator](){return this.headers.entries()}size(){return this.headers.size}equals(e){if(e&&this.headers.size===e.headers.size&&this._code===e._code){for(const[t,n]of this.headers){const r=e.values(t);if(n.length!==r.length)return!1;const i=[...n].sort(),o=[...r].sort();for(let a=0;a<i.length;a++)if(i[a]!==o[a])return!1}return!0}return!1}static decode(e){const t=new hr,n=sn.decode(e).split(`\r
|
|
3
3
|
`),r=n[0];if(r!==Ba){let i=r.replace(Ba,"").trim();if(i.length>0){t._code=parseInt(i,10),isNaN(t._code)&&(t._code=0);const o=t._code.toString();i=i.replace(o,""),t._description=i.trim()}}return n.length>=1&&n.slice(1).map(i=>{if(i){const o=i.indexOf(":");if(o>-1){const a=i.slice(0,o),l=i.slice(o+1).trim();t.append(a,l)}}}),t}toString(){if(this.headers.size===0&&this._code===0)return"";let e=Ba;this._code>0&&this._description!==""&&(e+=` ${this._code} ${this._description}`);for(const[t,n]of this.headers)for(let r=0;r<n.length;r++)e=`${e}\r
|
|
4
4
|
${t}: ${n[r]}`;return`${e}\r
|
|
5
5
|
\r
|
|
@@ -28,4 +28,4 @@ ${a.stack}`),l.unsubscribe(),o.reject(u)):(u=sm(d))?(a&&(u.stack+=`
|
|
|
28
28
|
|
|
29
29
|
${a.stack}`),o.reject(u)):o.resolve(d)}});return l.requestSubject=e,this.protocol.publish(e,t,{reply:i,headers:n.headers}),o}{const i=new im(this.protocol.muxSubscriptions,e,n,r);this.protocol.request(i);try{this.publish(e,t,{reply:`${this.protocol.muxSubscriptions.baseInbox}${i.token}`,headers:n.headers})}catch(a){i.cancel(a)}const o=Promise.race([i.timer,i.deferred]);return o.catch(()=>{i.cancel()}),o}}flush(){return this.isClosed()?Promise.reject(Ve.errorForCode(Re.ConnectionClosed)):this.protocol.flush()}drain(){return this.isClosed()?Promise.reject(Ve.errorForCode(Re.ConnectionClosed)):this.isDraining()?Promise.reject(Ve.errorForCode(Re.ConnectionDraining)):(this.draining=!0,this.protocol.drain())}isClosed(){return this.protocol.isClosed()}isDraining(){return this.draining}getServer(){const e=this.protocol.getServer();return e?e.listen:""}status(){const e=new Es;return e.iterClosed.then(()=>{const t=this.listeners.indexOf(e);this.listeners.splice(t,1)}),this.listeners.push(e),e}get info(){return this.protocol.isClosed()?void 0:this.protocol.info}async context(){return(await this.request("$SYS.REQ.USER.INFO")).json((e,t)=>e==="time"?new Date(Date.parse(t)):t)}stats(){return{inBytes:this.protocol.inBytes,outBytes:this.protocol.outBytes,inMsgs:this.protocol.inMsgs,outMsgs:this.protocol.outMsgs}}async jetstreamManager(e={}){const t=new pg(this,e);if(e.checkAPI!==!1)try{await t.getAccountInfo()}catch(n){const r=n;throw r.code===Re.NoResponders&&(r.code=Re.JetStreamNotEnabled),r}return t}jetstream(e={}){return new fl(this,e)}getServerVersion(){const e=this.info;return e?Or(e.version):void 0}async rtt(){if(!this.protocol._closed&&!this.protocol.connected)throw Ve.errorForCode(Re.Disconnect);const e=Date.now();return await this.flush(),Date.now()-e}get features(){return this.protocol.features}get services(){return this._services||(this._services=new vg(this)),this._services}reconnect(){return this.isClosed()?Promise.reject(Ve.errorForCode(Re.ConnectionClosed)):this.isDraining()?Promise.reject(Ve.errorForCode(Re.ConnectionDraining)):this.protocol.reconnect()}}class vg{constructor(e){p(this,"nc");this.nc=e}add(e){try{return new wo(this.nc,e).start()}catch(t){return Promise.reject(t)}}client(e,t){return new eg(this.nc,e,t)}}class _g{constructor(e,t,n){p(this,"bucket");p(this,"sm");p(this,"prefixLen");this.bucket=e,this.prefixLen=t,this.sm=n}get key(){return this.sm.subject.substring(this.prefixLen)}get value(){return this.sm.data}get delta(){return 0}get created(){return this.sm.time}get revision(){return this.sm.seq}get operation(){return this.sm.header.get(da)||"PUT"}get length(){const e=this.sm.header.get(Hs.MessageSizeHdr)||"";return e!==""?parseInt(e,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class yg{constructor(e,t,n){p(this,"bucket");p(this,"key");p(this,"sm");this.bucket=e,this.key=t,this.sm=n}get value(){return this.sm.data}get created(){return new Date(ll(this.sm.info.timestampNanos))}get revision(){return this.sm.seq}get operation(){var e;return((e=this.sm.headers)==null?void 0:e.get(da))||"PUT"}get delta(){return this.sm.info.pending}get length(){var t;const e=((t=this.sm.headers)==null?void 0:t.get(Hs.MessageSizeHdr))||"";return e!==""?parseInt(e,10):this.sm.data.length}json(){return this.sm.json()}string(){return this.sm.string()}}class hm extends F1{constructor(t,n,r){super(t.nc,n,r);p(this,"js");p(this,"monitor");this.js=t,this.monitor=null,this.sub.closed.then(()=>{this.monitor&&this.monitor.cancel()})}set info(t){this.sub.info=t}get info(){return this.sub.info}_resetOrderedConsumer(t){if(this.info===null||this.sub.isClosed())return;const n=Qn(this.js.nc.options.inboxPrefix);this.js.nc._resub(this.sub,n);const r=this.info;r.config.name=vr.next(),r.ordered_consumer_sequence.delivery_seq=0,r.flow_control.heartbeat_count=0,r.flow_control.fc_count=0,r.flow_control.consumer_restarts++,r.deliver=n,r.config.deliver_subject=n,r.config.deliver_policy=hs.StartSequence,r.config.opt_start_seq=t;const i={};i.stream_name=this.info.stream,i.config=r.config;const o=`${r.api.prefix}.CONSUMER.CREATE.${r.stream}`;this.js._request(o,i,{retries:-1}).then(a=>{const l=a;this.sub.info.last=l,this.info.config=l.config,this.info.name=l.name}).catch(a=>{const l=new Ve(`unable to recreate ordered consumer ${r.stream} at seq ${t}`,Re.RequestError,a);this.sub.callback(l,{})})}_maybeSetupHbMonitoring(){var n,r;const t=((r=(n=this.info)==null?void 0:n.config)==null?void 0:r.idle_heartbeat)||0;t&&this._setupHbMonitoring(ll(t))}_setupHbMonitoring(t,n=0){const r={cancelAfter:0,maxOut:2};n&&(r.cancelAfter=n);const i=this.sub;this.monitor=new dl(t,o=>{var u,d,h,v;const a=function(f,b,k){const z=Zn(f,b),L=new ul({hdr:1,sid:0,size:0},rn,{});return L._headers=z,L._subject=k,L}(409,`${un.IdleHeartbeatMissed}: ${o}`,this.sub.subject);if((u=this.info)==null?void 0:u.ordered){if(!this.js.nc.protocol.connected)return!1;const f=((h=(d=this.info)==null?void 0:d.ordered_consumer_sequence)==null?void 0:h.stream_seq)||0;return this._resetOrderedConsumer(f+1),(v=this.monitor)==null||v.restart(),!1}return this.sub.callback(null,a),!i.noIterator},r)}_checkHbOrderConsumer(t){const n=t.headers.get(Hs.ConsumerStalledHdr);n!==""&&this.js.nc.publish(n);const r=parseInt(t.headers.get(Hs.LastConsumerSeqHdr),10),i=this.info.ordered_consumer_sequence;return this.info.flow_control.heartbeat_count++,r!==i.delivery_seq&&this._resetOrderedConsumer(i.stream_seq+1),!1}_checkOrderedConsumer(t){const n=this.info.ordered_consumer_sequence,r=t.info.streamSequence,i=t.info.deliverySequence;return i!=n.delivery_seq+1?(this._resetOrderedConsumer(n.stream_seq+1),!1):(n.delivery_seq=i,n.stream_seq=r,!0)}async destroy(){this.isClosed()||await this.drain();const t=this.sub.info,n=t.config.durable_name||t.name,r=`${t.api.prefix}.CONSUMER.DELETE.${t.stream}.${n}`;await t.api._request(r)}async consumerInfo(){const t=this.sub.info,n=t.config.durable_name||t.name,r=`${t.api.prefix}.CONSUMER.INFO.${t.stream}.${n}`,i=await t.api._request(r);return t.last=i,i}}class bg extends hm{constructor(e,t,n){super(e,t,n)}pull(e={batch:1}){const{stream:t,config:n,name:r}=this.sub.info,i=n.durable_name??r,o={};if(o.batch=e.batch||1,o.no_wait=e.no_wait||!1,(e.max_bytes??0)>0){const u=this.js.nc.features.get(Nt.JS_PULL_MAX_BYTES);if(!u.ok)throw new Error(`max_bytes is only supported on servers ${u.min} or better`);o.max_bytes=e.max_bytes}let a=0;e.expires&&e.expires>0&&(a=e.expires,o.expires=rs(a));let l=0;if(e.idle_heartbeat&&e.idle_heartbeat>0&&(l=e.idle_heartbeat,o.idle_heartbeat=rs(l)),l&&a===0)throw new Error("idle_heartbeat requires expires");if(l>a)throw new Error("expires must be greater than idle_heartbeat");if(this.info){this.monitor&&this.monitor.cancel(),a&&l&&(this.monitor?this.monitor._change(l,a):this._setupHbMonitoring(l,a));const u=this.info.api,d=`${u.prefix}.CONSUMER.MSG.NEXT.${t}.${i}`,h=this.sub.subject;u.nc.publish(d,u.jc.encode(o),{reply:h})}}}function Ku(s){if(s!==null)switch(s.code){case Re.JetStream404NoMessages:case Re.JetStream408RequestTimeout:return null;case Re.JetStream409:return function(e){return e.code!==Re.JetStream409?!1:[un.MaxBatchExceeded,un.MaxExpiresExceeded,un.MaxBytesExceeded,un.MaxMessageSizeExceeded,un.PushConsumer,un.IdleHeartbeatMissed,un.ConsumerDeleted].find(t=>e.message.indexOf(t)!==-1)!==void 0}(s)?s:null;default:return s}return null}function wg(s){s&&s.ack()}class xg{constructor(e,t){p(this,"msg");p(this,"di");p(this,"didAck");p(this,"timeout");this.msg=e,this.didAck=!1,this.timeout=t}get subject(){return this.msg.subject}get sid(){return this.msg.sid}get data(){return this.msg.data}get headers(){return this.msg.headers}get info(){return this.di||(this.di=function(e){const t=e.split(".");if(t.length===9&&t.splice(2,0,"_",""),t.length<11||t[0]!=="$JS"||t[1]!=="ACK")throw new Error("not js message");const n={};return n.domain=t[2]==="_"?"":t[2],n.account_hash=t[3],n.stream=t[4],n.consumer=t[5],n.deliveryCount=parseInt(t[6],10),n.redeliveryCount=n.deliveryCount,n.redelivered=n.deliveryCount>1,n.streamSequence=parseInt(t[7],10),n.deliverySequence=parseInt(t[8],10),n.timestampNanos=parseInt(t[9],10),n.pending=parseInt(t[10],10),n}(this.reply)),this.di}get redelivered(){return this.info.deliveryCount>1}get reply(){return this.msg.reply||""}get seq(){return this.info.streamSequence}doAck(e){this.didAck||(this.didAck=!this.isWIP(e),this.msg.respond(e))}isWIP(e){return e.length===4&&e[0]===Li[0]&&e[1]===Li[1]&&e[2]===Li[2]&&e[3]===Li[3]}async ackAck(e){var n;(e=e||{}).timeout=e.timeout||this.timeout;const t=is();if(this.didAck)t.resolve(!1);else if(this.didAck=!0,this.msg.reply){const r=this.msg.publisher,i=!((n=r.options)!=null&&n.noAsyncTraces),o=new im(r.muxSubscriptions,this.msg.reply,{timeout:e.timeout},i);r.request(o);try{r.publish(this.msg.reply,Hu,{reply:`${r.muxSubscriptions.baseInbox}${o.token}`})}catch(a){o.cancel(a)}try{await Promise.race([o.timer,o.deferred]),t.resolve(!0)}catch(a){o.cancel(a),t.reject(a)}}else t.resolve(!1);return t}ack(){this.doAck(Hu)}nak(e){let t=ag;e&&(t=Pu().encode(`-NAK ${JSON.stringify({delay:rs(e)})}`)),this.doAck(t)}working(){this.doAck(Li)}next(e,t={batch:1}){const n={};n.batch=t.batch||1,n.no_wait=t.no_wait||!1,t.expires&&t.expires>0&&(n.expires=rs(t.expires));const r=wn().encode(n),i=fi.concat(cg,ug,r),o=e?{reply:e}:void 0;this.msg.respond(i,o)}term(e=""){let t=lg;(e==null?void 0:e.length)>0&&(t=Pu().encode(`+TERM ${e}`)),this.doAck(t)}json(){return this.msg.json()}string(){return this.msg.string()}}class Sg{constructor(){p(this,"version");p(this,"lang");p(this,"closeError");p(this,"connected");p(this,"done");p(this,"socket");p(this,"options");p(this,"socketClosed");p(this,"encrypted");p(this,"peeked");p(this,"yields");p(this,"signal");p(this,"closedNotification");this.version="1.30.3",this.lang="nats.ws",this.connected=!1,this.done=!1,this.socketClosed=!1,this.encrypted=!1,this.peeked=!1,this.yields=[],this.signal=is(),this.closedNotification=is()}async connect(e,t){const n=is();if(t.tls)return n.reject(new Ve("tls",Re.InvalidOption)),n;this.options=t;const r=e.src;if(t.wsFactory){const{socket:i,encrypted:o}=await t.wsFactory(e.src,t);this.socket=i,this.encrypted=o}else this.encrypted=r.indexOf("wss://")===0,this.socket=new WebSocket(r);return this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.isDiscarded()},this.socket.onmessage=i=>{if(this.isDiscarded())return;if(this.yields.push(new Uint8Array(i.data)),this.peeked)return void this.signal.resolve();const o=fi.concat(...this.yields),a=q1(o);if(a!==""){const l=G1.exec(a);if(!l)return t.debug&&console.error("!!!",Ao(o)),void n.reject(new Error("unexpected response from server"));try{(function(u,d){const{proto:h,tls_required:v,tls_available:f}=u;if((h===void 0||h<1)&&d.noEcho)throw new Ve("noEcho",Re.ServerOptionNotAvailable);const b=v||f||!1;if(d.tls&&!b)throw new Ve("tls",Re.ServerOptionNotAvailable)})(JSON.parse(l[1]),this.options),this.peeked=!0,this.connected=!0,this.signal.resolve(),n.resolve()}catch(u){return void n.reject(u)}}},this.socket.onclose=i=>{if(this.isDiscarded())return;let o;this.socketClosed=!0,this.done||(i.wasClean||(o=new Error(i.reason)),this._closed(o))},this.socket.onerror=i=>{if(this.isDiscarded())return;const o=i,a=new Ve(o.message,Re.Unknown,new Error(o.error));n.reject(a)},n}disconnect(){this._closed(void 0,!0)}async _closed(e,t=!0){if(!this.isDiscarded()&&this.connected&&!this.done){if(this.closeError=e,!e)for(;!this.socketClosed&&this.socket.bufferedAmount>0;)await Ti(100);this.done=!0;try{this.socket.close(e?1002:1e3,e?e.message:void 0)}catch{}t&&this.closedNotification.resolve(e)}}get isClosed(){return this.done}[Symbol.asyncIterator](){return this.iterate()}async*iterate(){for(;;){if(this.isDiscarded())return;this.yields.length===0&&await this.signal;const e=this.yields;this.yields=[];for(let t=0;t<e.length;t++)this.options.debug&&console.info(`> ${Ao(e[t])}`),yield e[t];if(this.done)break;this.yields.length===0&&(e.length=0,this.yields=e,this.signal=is())}}isEncrypted(){return this.connected&&this.encrypted}send(e){if(!this.isDiscarded())try{return this.socket.send(e.buffer),void(this.options.debug&&console.info(`< ${Ao(e)}`))}catch(t){this.options.debug&&console.error(`!!! ${Ao(e)}: ${t}`)}}close(e){return this._closed(e,!1)}closed(){return this.closedNotification}isDiscarded(){return!!this.done&&(this.discard(),!0)}discard(){var e;this.done=!0;try{(e=this.socket)==null||e.close()}catch{}}}function Cg(s,e){/^(.*:\/\/)(.*)/.test(s)||(s=typeof e=="boolean"?`${e===!0?"https":"http"}://${s}`:`https://${s}`);let t=new URL(s);const n=t.protocol.toLowerCase();let r,i;n==="ws:"&&(e=!1),n==="wss:"&&(e=!0),n!=="https:"&&n!=="http"&&(s=s.replace(/^(.*:\/\/)(.*)/gm,"$2"),t=new URL(`http://${s}`));const o=t.hostname,a=t.pathname,l=t.search||"";switch(n){case"http:":case"ws:":case"nats:":i=t.port||"80",r="ws:";break;case"https:":case"wss:":case"tls:":i=t.port||"443",r="wss:";break;default:i=t.port||e===!0?"443":"80",r=e===!0?"wss:":"ws:"}return`${r}//${o}:${i}${a}${l}`}function kg(s={}){return function(e){nn=e}({defaultPort:443,urlParseFn:Cg,factory:()=>new Sg}),gl.connect(s)}const Bn={HEALTH:{PING:"health.ping",PONG:"health.pong"},SERVER:{STATUS:"server.status",BROADCAST:"server.broadcast"},PLUGIN:{REGISTER:"plugin.register",UNREGISTER:"plugin.unregister",STATUS:"plugin.status"},SERVICE:{REGISTER:"service.register",UNREGISTER:"service.unregister",STATUS:"service.status"},METRICS:{UPDATE:"metrics.update"}},Uo="running",Sc="stopping",Xi="stopped",ji={REQUEST:"request",RESPONSE:"response",BROADCAST:"broadcast",RPC_REQUEST:"rpcrequest",RPC_RESPONSE:"rpcresponse",RPC_STREAM_REQUEST:"rpcstreamrequest"},Ga={CONNECTION:5e3,REQUEST:5e3,RPC:5e3},Eg={METRICS:6e4},Zu={MAX_RECONNECT_ATTEMPTS:-1,DELAY:2e3},Ag={TTL:3e4},Gu={requests:{total:0,active:0,errors:0,timings:new Map,inWindow:{count:0,errors:0,responseTimes:[],startTime:Date.now()}},messages:{published:0,received:0,errors:0},rpc:{total:0,active:0,errors:0},subscriptions:{active:0,messageHandlers:0,requestHandlers:0,rpcHandlers:0}},Xn=Pi("camera:ui:metrics");class Mg{constructor(){p(this,"startTime",Date.now());p(this,"metricsWindow",Ag.TTL);p(this,"metrics",{...Gu})}trackRequestStart(e){Xn("Tracking request start",e),this.metrics.requests.active++,this.metrics.requests.total++,this.metrics.requests.timings.set(e,Date.now()),this.metrics.requests.inWindow.count++}trackRequestEnd(e,t){Xn("Tracking request end",e);const n=this.metrics.requests.timings.get(e);n&&(this.metrics.requests.inWindow.responseTimes.push(Date.now()-n),this.metrics.requests.timings.delete(e)),this.metrics.requests.active--,t&&(this.metrics.requests.errors++,this.metrics.requests.inWindow.errors++)}trackPublish(){Xn("Tracking message publish"),this.metrics.messages.published++}trackReceive(){Xn("Tracking message receive"),this.metrics.messages.received++}trackMessageError(){Xn("Tracking message error"),this.metrics.messages.errors++}trackRPCStart(){Xn("Tracking RPC start"),this.metrics.rpc.active++,this.metrics.rpc.total++}trackRPCEnd(e){Xn("Tracking RPC end"),this.metrics.rpc.active--,e&&this.metrics.rpc.errors++}trackSubscriptionChange(e,t){switch(Xn("Tracking subscription change",e,t),t){case"message":this.metrics.subscriptions.messageHandlers=Math.max(0,this.metrics.subscriptions.messageHandlers+e);break;case"request":this.metrics.subscriptions.requestHandlers=Math.max(0,this.metrics.subscriptions.requestHandlers+e);break;case"rpc":case"generator":this.metrics.subscriptions.rpcHandlers=Math.max(0,this.metrics.subscriptions.rpcHandlers+e)}this.metrics.subscriptions.active=this.metrics.subscriptions.messageHandlers+this.metrics.subscriptions.requestHandlers+this.metrics.subscriptions.rpcHandlers}getMetrics(){this.cleanOldMetrics();const e=Date.now(),t=(e-this.metrics.requests.inWindow.startTime)/1e3,n=t>0?this.metrics.requests.inWindow.count/Math.max(1,t):0,r=this.metrics.requests.inWindow.responseTimes.length>0?this.metrics.requests.inWindow.responseTimes.reduce((i,o)=>i+o,0)/this.metrics.requests.inWindow.responseTimes.length:0;return{timestamp:e,startTime:this.startTime,requests:{total:this.metrics.requests.total,active:this.metrics.requests.active,errors:this.metrics.requests.errors,perSecond:Number.isFinite(n)?n:0,avgResponseTime:r},messages:{published:this.metrics.messages.published,received:this.metrics.messages.received,errors:this.metrics.messages.errors},rpc:{total:this.metrics.rpc.total,active:this.metrics.rpc.active,errors:this.metrics.rpc.errors},subscriptions:{active:this.metrics.subscriptions.active,messageHandlers:this.metrics.subscriptions.messageHandlers,requestHandlers:this.metrics.subscriptions.requestHandlers,rpcHandlers:this.metrics.subscriptions.rpcHandlers}}}resetMetrics(){this.metrics={...Gu}}cleanOldMetrics(){const e=Date.now();e-this.metrics.requests.inWindow.startTime>=this.metricsWindow&&(this.metrics.requests.inWindow={count:0,errors:0,responseTimes:[],startTime:e})}}var Cc,Fe,dn;try{Cc=new TextDecoder}catch{}var Q=0,It,cr,Ts,Un,$t,ts={},ln=0,In=0,Gs=[],Wu={useRecords:!1,mapsAsObjects:!0};class mm{}const pm=new mm;pm.name="MessagePack 0xC1";var Ju,pr=!1,fm=2;try{new Function("")}catch{fm=1/0}class gi{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.sequential&&e.trusted!==!1&&(e.trusted=!0,e.structures||e.useRecords==0||(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(Fe)return wm(()=>(Ec(),this?this.unpack(e,t):gi.prototype.unpack.call(Wu,e,t)));e.buffer||e.constructor!==ArrayBuffer||(e=typeof Buffer<"u"?Buffer.from(e):new Uint8Array(e)),typeof t=="object"?(dn=t.end||e.length,Q=t.start||0):(Q=0,dn=t>-1?t:e.length),In=0,cr=null,Ts=null,Fe=e;try{$t=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw Fe=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof gi){if(ts=this,this.structures)return It=this.structures,To(t);(!It||It.length>0)&&(It=[])}else ts=Wu,(!It||It.length>0)&&(It=[]);return To(t)}unpackMultiple(e,t){let n,r=0;try{pr=!0;let i=e.length,o=this?this.unpack(e,i):Vo.unpack(e,i);if(!t){for(n=[o];Q<i;)r=Q,n.push(To());return n}if(t(o,r,Q)===!1)return;for(;Q<i;)if(r=Q,t(To(),r,Q)===!1)return}catch(i){throw i.lastPosition=r,i.values=n,i}finally{pr=!1,Ec()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map(n=>n.slice(0)));for(let n=0,r=e.length;n<r;n++){let i=e[n];i&&(i.isShared=!0,n>=32&&(i.highByte=n-32>>5))}e.sharedLength=e.length;for(let n in t||[])if(n>=0){let r=e[n],i=t[n];i&&(r&&((e.restoreStructures||(e.restoreStructures=[]))[n]=r),e[n]=i)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function To(s){try{if(!ts.trusted&&!pr){let t=It.sharedLength||0;t<It.length&&(It.length=t)}let e;if(ts.randomAccessStructure&&Fe[Q]<64&&Fe[Q]>=32&&Ju?(e=Ju(Fe,Q,dn,ts),Fe=null,s&&s.lazy||!e||(e=e.toJSON()),Q=dn):e=ms(),Ts&&(Q=Ts.postBundlePosition,Ts=null),pr&&(It.restoreStructures=null),Q==dn)It&&It.restoreStructures&&Yu(),It=null,Fe=null,Un&&(Un=null);else{if(Q>dn)throw new Error("Unexpected end of MessagePack data");if(!pr){let t;try{t=JSON.stringify(e,(n,r)=>typeof r=="bigint"?`${r}n`:r).slice(0,100)}catch(n){t="(JSON view not available "+n+")"}throw new Error("Data read, but end of buffer not reached "+t)}}return e}catch(e){throw It&&It.restoreStructures&&Yu(),Ec(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||Q>dn)&&(e.incomplete=!0),e}}function Yu(){for(let s in It.restoreStructures)It[s]=It.restoreStructures[s];It.restoreStructures=null}function ms(){let s=Fe[Q++];if(s<160){if(s<128){if(s<64)return s;{let e=It[63&s]||ts.getStructures&&gm()[63&s];return e?(e.read||(e.read=vl(e,63&s)),e.read()):s}}if(s<144){if(s-=128,ts.mapsAsObjects){let e={};for(let t=0;t<s;t++){let n=_m();n==="__proto__"&&(n="__proto_"),e[n]=ms()}return e}{let e=new Map;for(let t=0;t<s;t++)e.set(ms(),ms());return e}}{s-=144;let e=new Array(s);for(let t=0;t<s;t++)e[t]=ms();return ts.freezeData?Object.freeze(e):e}}if(s<192){let e=s-160;if(In>=Q)return cr.slice(Q-ln,(Q+=e)-ln);if(In==0&&dn<140){let t=e<16?_l(e):vm(e);if(t!=null)return t}return kc(e)}{let e;switch(s){case 192:return null;case 193:return Ts?(e=ms(),e>0?Ts[1].slice(Ts.position1,Ts.position1+=e):Ts[0].slice(Ts.position0,Ts.position0-=e)):pm;case 194:return!1;case 195:return!0;case 196:if(e=Fe[Q++],e===void 0)throw new Error("Unexpected end of buffer");return Wa(e);case 197:return e=$t.getUint16(Q),Q+=2,Wa(e);case 198:return e=$t.getUint32(Q),Q+=4,Wa(e);case 199:return xr(Fe[Q++]);case 200:return e=$t.getUint16(Q),Q+=2,xr(e);case 201:return e=$t.getUint32(Q),Q+=4,xr(e);case 202:if(e=$t.getFloat32(Q),ts.useFloat32>2){let t=yl[(127&Fe[Q])<<1|Fe[Q+1]>>7];return Q+=4,(t*e+(e>0?.5:-.5)|0)/t}return Q+=4,e;case 203:return e=$t.getFloat64(Q),Q+=8,e;case 204:return Fe[Q++];case 205:return e=$t.getUint16(Q),Q+=2,e;case 206:return e=$t.getUint32(Q),Q+=4,e;case 207:return ts.int64AsType==="number"?(e=4294967296*$t.getUint32(Q),e+=$t.getUint32(Q+4)):ts.int64AsType==="string"?e=$t.getBigUint64(Q).toString():ts.int64AsType==="auto"?(e=$t.getBigUint64(Q),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=$t.getBigUint64(Q),Q+=8,e;case 208:return $t.getInt8(Q++);case 209:return e=$t.getInt16(Q),Q+=2,e;case 210:return e=$t.getInt32(Q),Q+=4,e;case 211:return ts.int64AsType==="number"?(e=4294967296*$t.getInt32(Q),e+=$t.getUint32(Q+4)):ts.int64AsType==="string"?e=$t.getBigInt64(Q).toString():ts.int64AsType==="auto"?(e=$t.getBigInt64(Q),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=$t.getBigInt64(Q),Q+=8,e;case 212:if(e=Fe[Q++],e==114)return rd(63&Fe[Q++]);{let t=Gs[e];if(t)return t.read?(Q++,t.read(ms())):t.noBuffer?(Q++,t()):t(Fe.subarray(Q,++Q));throw new Error("Unknown extension "+e)}case 213:return e=Fe[Q],e==114?(Q++,rd(63&Fe[Q++],Fe[Q++])):xr(2);case 214:return xr(4);case 215:return xr(8);case 216:return xr(16);case 217:return e=Fe[Q++],In>=Q?cr.slice(Q-ln,(Q+=e)-ln):Pg(e);case 218:return e=$t.getUint16(Q),In>=(Q+=2)?cr.slice(Q-ln,(Q+=e)-ln):Tg(e);case 219:return e=$t.getUint32(Q),In>=(Q+=4)?cr.slice(Q-ln,(Q+=e)-ln):Rg(e);case 220:return e=$t.getUint16(Q),Q+=2,ed(e);case 221:return e=$t.getUint32(Q),Q+=4,ed(e);case 222:return e=$t.getUint16(Q),Q+=2,td(e);case 223:return e=$t.getUint32(Q),Q+=4,td(e);default:if(s>=224)return s-256;if(s===void 0){let t=new Error("Unexpected end of MessagePack data");throw t.incomplete=!0,t}throw new Error("Unknown MessagePack token "+s)}}}const $g=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function vl(s,e){function t(){if(t.count++>fm){let r=s.read=new Function("r","return function(){return "+(ts.freezeData?"Object.freeze":"")+"({"+s.map(i=>i==="__proto__"?"__proto_:r()":$g.test(i)?i+":r()":"["+JSON.stringify(i)+"]:r()").join(",")+"})}")(ms);return s.highByte===0&&(s.read=Xu(e,s.read)),r()}let n={};for(let r=0,i=s.length;r<i;r++){let o=s[r];o==="__proto__"&&(o="__proto_"),n[o]=ms()}return ts.freezeData?Object.freeze(n):n}return t.count=0,s.highByte===0?Xu(e,t):t}const Xu=(s,e)=>function(){let t=Fe[Q++];if(t===0)return e();let n=s<32?-(s+(t<<5)):s+(t<<5),r=It[n]||gm()[n];if(!r)throw new Error("Record id is not defined for "+n);return r.read||(r.read=vl(r,s)),r.read()};function gm(){let s=wm(()=>(Fe=null,ts.getStructures()));return It=ts._mergeStructures(s,It)}var kc=xo,Pg=xo,Tg=xo,Rg=xo;function xo(s){let e;if(s<16&&(e=_l(s)))return e;if(s>64&&Cc)return Cc.decode(Fe.subarray(Q,Q+=s));const t=Q+s,n=[];for(e="";Q<t;){const r=Fe[Q++];if(128&r)if((224&r)==192){const i=63&Fe[Q++];n.push((31&r)<<6|i)}else if((240&r)==224){const i=63&Fe[Q++],o=63&Fe[Q++];n.push((31&r)<<12|i<<6|o)}else if((248&r)==240){let i=(7&r)<<18|(63&Fe[Q++])<<12|(63&Fe[Q++])<<6|63&Fe[Q++];i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i)}else n.push(r);else n.push(r);n.length>=4096&&(e+=Ss.apply(String,n),n.length=0)}return n.length>0&&(e+=Ss.apply(String,n)),e}function ed(s){let e=new Array(s);for(let t=0;t<s;t++)e[t]=ms();return ts.freezeData?Object.freeze(e):e}function td(s){if(ts.mapsAsObjects){let e={};for(let t=0;t<s;t++){let n=_m();n==="__proto__"&&(n="__proto_"),e[n]=ms()}return e}{let e=new Map;for(let t=0;t<s;t++)e.set(ms(),ms());return e}}var Ss=String.fromCharCode;function vm(s){let e=Q,t=new Array(s);for(let n=0;n<s;n++){const r=Fe[Q++];if((128&r)>0)return void(Q=e);t[n]=r}return Ss.apply(String,t)}function _l(s){if(s<4){if(s<2){if(s===0)return"";{let e=Fe[Q++];return(128&e)>1?void(Q-=1):Ss(e)}}{let e=Fe[Q++],t=Fe[Q++];if((128&e)>0||(128&t)>0)return void(Q-=2);if(s<3)return Ss(e,t);let n=Fe[Q++];return(128&n)>0?void(Q-=3):Ss(e,t,n)}}{let e=Fe[Q++],t=Fe[Q++],n=Fe[Q++],r=Fe[Q++];if((128&e)>0||(128&t)>0||(128&n)>0||(128&r)>0)return void(Q-=4);if(s<6){if(s===4)return Ss(e,t,n,r);{let i=Fe[Q++];return(128&i)>0?void(Q-=5):Ss(e,t,n,r,i)}}if(s<8){let i=Fe[Q++],o=Fe[Q++];if((128&i)>0||(128&o)>0)return void(Q-=6);if(s<7)return Ss(e,t,n,r,i,o);let a=Fe[Q++];return(128&a)>0?void(Q-=7):Ss(e,t,n,r,i,o,a)}{let i=Fe[Q++],o=Fe[Q++],a=Fe[Q++],l=Fe[Q++];if((128&i)>0||(128&o)>0||(128&a)>0||(128&l)>0)return void(Q-=8);if(s<10){if(s===8)return Ss(e,t,n,r,i,o,a,l);{let u=Fe[Q++];return(128&u)>0?void(Q-=9):Ss(e,t,n,r,i,o,a,l,u)}}if(s<12){let u=Fe[Q++],d=Fe[Q++];if((128&u)>0||(128&d)>0)return void(Q-=10);if(s<11)return Ss(e,t,n,r,i,o,a,l,u,d);let h=Fe[Q++];return(128&h)>0?void(Q-=11):Ss(e,t,n,r,i,o,a,l,u,d,h)}{let u=Fe[Q++],d=Fe[Q++],h=Fe[Q++],v=Fe[Q++];if((128&u)>0||(128&d)>0||(128&h)>0||(128&v)>0)return void(Q-=12);if(s<14){if(s===12)return Ss(e,t,n,r,i,o,a,l,u,d,h,v);{let f=Fe[Q++];return(128&f)>0?void(Q-=13):Ss(e,t,n,r,i,o,a,l,u,d,h,v,f)}}{let f=Fe[Q++],b=Fe[Q++];if((128&f)>0||(128&b)>0)return void(Q-=14);if(s<15)return Ss(e,t,n,r,i,o,a,l,u,d,h,v,f,b);let k=Fe[Q++];return(128&k)>0?void(Q-=15):Ss(e,t,n,r,i,o,a,l,u,d,h,v,f,b,k)}}}}}function sd(){let s,e=Fe[Q++];if(e<192)s=e-160;else switch(e){case 217:s=Fe[Q++];break;case 218:s=$t.getUint16(Q),Q+=2;break;case 219:s=$t.getUint32(Q),Q+=4;break;default:throw new Error("Expected string")}return xo(s)}function Wa(s){return ts.copyBuffers?Uint8Array.prototype.slice.call(Fe,Q,Q+=s):Fe.subarray(Q,Q+=s)}function xr(s){let e=Fe[Q++];if(Gs[e]){let t;return Gs[e](Fe.subarray(Q,t=Q+=s),n=>{Q=n;try{return ms()}finally{Q=t}})}throw new Error("Unknown extension type "+e)}var nd=new Array(4096);function _m(){let s=Fe[Q++];if(!(s>=160&&s<192))return Q--,ym(ms());if(s-=160,In>=Q)return cr.slice(Q-ln,(Q+=s)-ln);if(!(In==0&&dn<180))return kc(s);let e,t=4095&(s<<5^(s>1?$t.getUint16(Q):s>0?Fe[Q]:0)),n=nd[t],r=Q,i=Q+s-3,o=0;if(n&&n.bytes==s){for(;r<i;){if(e=$t.getUint32(r),e!=n[o++]){r=1879048192;break}r+=4}for(i+=3;r<i;)if(e=Fe[r++],e!=n[o++]){r=1879048192;break}if(r===i)return Q=r,n.string;i-=3,r=Q}for(n=[],nd[t]=n,n.bytes=s;r<i;)e=$t.getUint32(r),n.push(e),r+=4;for(i+=3;r<i;)e=Fe[r++],n.push(e);let a=s<16?_l(s):vm(s);return n.string=a??kc(s)}function ym(s){if(typeof s=="string")return s;if(typeof s=="number"||typeof s=="boolean"||typeof s=="bigint")return s.toString();if(s==null)return s+"";throw new Error("Invalid property type for record",typeof s)}const rd=(s,e)=>{let t=ms().map(ym),n=s;e!==void 0&&(s=s<32?-((e<<5)+s):(e<<5)+s,t.highByte=e);let r=It[s];return r&&(r.isShared||pr)&&((It.restoreStructures||(It.restoreStructures=[]))[s]=r),It[s]=t,t.read=vl(t,n),t.read()};Gs[0]=()=>{},Gs[0].noBuffer=!0,Gs[66]=s=>{let e=s.length,t=BigInt(128&s[0]?s[0]-256:s[0]);for(let n=1;n<e;n++)t<<=BigInt(8),t+=BigInt(s[n]);return t};let Ig={Error,TypeError,ReferenceError};Gs[101]=()=>{let s=ms();return(Ig[s[0]]||Error)(s[1],{cause:s[2]})},Gs[105]=s=>{if(ts.structuredClone===!1)throw new Error("Structured clone extension is disabled");let e=$t.getUint32(Q-4);Un||(Un=new Map);let t,n=Fe[Q];t=n>=144&&n<160||n==220||n==221?[]:{};let r={target:t};Un.set(e,r);let i=ms();return r.used?Object.assign(t,i):(r.target=i,i)},Gs[112]=s=>{if(ts.structuredClone===!1)throw new Error("Structured clone extension is disabled");let e=$t.getUint32(Q-4),t=Un.get(e);return t.used=!0,t.target},Gs[115]=()=>new Set(ms());const bm=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(s=>s+"Array");let Og=typeof globalThis=="object"?globalThis:window;Gs[116]=s=>{let e=s[0],t=bm[e];if(!t){if(e===16){let n=new ArrayBuffer(s.length-1);return new Uint8Array(n).set(s.subarray(1)),n}throw new Error("Could not find typed array for code "+e)}return new Og[t](Uint8Array.prototype.slice.call(s,1).buffer)},Gs[120]=()=>{let s=ms();return new RegExp(s[0],s[1])};const Ng=[];function wm(s){let e=dn,t=Q,n=ln,r=In,i=cr,o=Un,a=Ts,l=new Uint8Array(Fe.slice(0,dn)),u=It,d=It.slice(0,It.length),h=ts,v=pr,f=s();return dn=e,Q=t,ln=n,In=r,cr=i,Un=o,Ts=a,Fe=l,pr=v,(It=u).splice(0,It.length,...d),ts=h,$t=new DataView(Fe.buffer,Fe.byteOffset,Fe.byteLength),f}function Ec(){Fe=null,Un=null,It=null}Gs[98]=s=>{let e=(s[0]<<24)+(s[1]<<16)+(s[2]<<8)+s[3],t=Q;return Q+=e-s.length,Ts=Ng,(Ts=[sd(),sd()]).position0=0,Ts.position1=0,Ts.postBundlePosition=Q,Q=t,ms()},Gs[255]=s=>s.length==4?new Date(1e3*(16777216*s[0]+(s[1]<<16)+(s[2]<<8)+s[3])):s.length==8?new Date(((s[0]<<22)+(s[1]<<14)+(s[2]<<6)+(s[3]>>2))/1e6+1e3*(4294967296*(3&s[3])+16777216*s[4]+(s[5]<<16)+(s[6]<<8)+s[7])):s.length==12?new Date(((s[0]<<24)+(s[1]<<16)+(s[2]<<8)+s[3])/1e6+1e3*((128&s[4]?-281474976710656:0)+1099511627776*s[6]+4294967296*s[7]+16777216*s[8]+(s[9]<<16)+(s[10]<<8)+s[11])):new Date("invalid");const yl=new Array(147);for(let s=0;s<256;s++)yl[s]=+("1e"+Math.floor(45.15-.30103*s));var Vo=new gi({useRecords:!1});Vo.unpack,Vo.unpackMultiple,Vo.unpack;let Ho,Ac,xm,Fg=new Float32Array(1);new Uint8Array(Fg.buffer,0,4);try{Ho=new TextEncoder}catch{}const Ia=typeof Buffer<"u",Ro=Ia?function(s){return Buffer.allocUnsafeSlow(s)}:Uint8Array,Sm=Ia?Buffer:Uint8Array,id=Ia?4294967296:2144337920;let re,qi,es,Ds,Lg,G=0,cs=null;const jg=/[\u0080-\uFFFF]/,Jr=Symbol("record-id");class Cm extends gi{constructor(e){let t,n,r,i;super(e),this.offset=0;let o=Sm.prototype.utf8Write?function(w,H){return re.utf8Write(w,H,re.byteLength-H)}:!(!Ho||!Ho.encodeInto)&&function(w,H){return Ho.encodeInto(w,re.subarray(H)).written},a=this;e||(e={});let l=e&&e.sequential,u=e.structures||e.saveStructures,d=e.maxSharedStructures;if(d==null&&(d=u?32:0),d>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&e.moreTypes==null&&(this.moreTypes=!0);let h=e.maxOwnStructures;h==null&&(h=u?32:64),this.structures||e.useRecords==0||(this.structures=[]);let v=d>32||h+d>64,f=d+64,b=d+h+64;if(b>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let k=[],z=0,L=0;this.pack=this.encode=function(w,H){if(re||(re=new Ro(8192),es=re.dataView||(re.dataView=new DataView(re.buffer,0,8192)),G=0),Ds=re.length-10,Ds-G<2048?(re=new Ro(re.length),es=re.dataView||(re.dataView=new DataView(re.buffer,0,re.length)),Ds=re.length-10,G=0):G=G+7&2147483640,t=G,H&Ug&&(G+=255&H),i=a.structuredClone?new Map:null,a.bundleStrings&&typeof w!="string"?(cs=[],cs.size=1/0):cs=null,r=a.structures,r){r.uninitialized&&(r=a._mergeStructures(a.getStructures()));let q=r.sharedLength||0;if(q>d)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+r.sharedLength);if(!r.transitions){r.transitions=Object.create(null);for(let oe=0;oe<q;oe++){let ue=r[oe];if(!ue)continue;let Se,F=r.transitions;for(let D=0,Y=ue.length;D<Y;D++){let Te=ue[D];Se=F[Te],Se||(Se=F[Te]=Object.create(null)),F=Se}F[Jr]=oe+64}this.lastNamedStructuresLength=q}l||(r.nextId=q+64)}let J;n&&(n=!1);try{a.randomAccessStructure&&w&&w.constructor&&w.constructor===Object?I(w):N(w);let q=cs;if(cs&&cd(t,N,0),i&&i.idsToInsert){let oe=i.idsToInsert.sort((D,Y)=>D.offset>Y.offset?1:-1),ue=oe.length,Se=-1;for(;q&&ue>0;){let D=oe[--ue].offset+t;D<q.stringsPosition+t&&Se===-1&&(Se=0),D>q.position+t?Se>=0&&(Se+=6):(Se>=0&&(es.setUint32(q.position+t,es.getUint32(q.position+t)+Se),Se=-1),q=q.previous,ue++)}Se>=0&&q&&es.setUint32(q.position+t,es.getUint32(q.position+t)+Se),G+=6*oe.length,G>Ds&&M(G),a.offset=G;let F=function(D,Y){let Te,He=6*Y.length,ht=D.length-He;for(;Te=Y.pop();){let Mt=Te.offset,Qe=Te.id;D.copyWithin(Mt+He,Mt,ht),He-=6;let ze=Mt+He;D[ze++]=214,D[ze++]=105,D[ze++]=Qe>>24,D[ze++]=Qe>>16&255,D[ze++]=Qe>>8&255,D[ze++]=255&Qe,ht=Mt}return D}(re.subarray(t,G),oe);return i=null,F}return a.offset=G,H&Bg?(re.start=t,re.end=G,re):re.subarray(t,G)}catch(q){throw J=q,q}finally{if(r&&(se(),n&&a.saveStructures)){let q=r.sharedLength||0,oe=re.subarray(t,G),ue=Dg(r,a);if(!J)return a.saveStructures(ue,ue.isCompatible)===!1?a.pack(w,H):(a.lastNamedStructuresLength=q,re.length>1073741824&&(re=null),oe)}re.length>1073741824&&(re=null),H&zg&&(G=t)}};const se=()=>{L<10&&L++;let w=r.sharedLength||0;if(r.length>w&&!l&&(r.length=w),z>1e4)r.transitions=null,L=0,z=0,k.length>0&&(k=[]);else if(k.length>0&&!l){for(let H=0,J=k.length;H<J;H++)k[H][Jr]=0;k=[]}},K=w=>{var H=w.length;H<16?re[G++]=144|H:H<65536?(re[G++]=220,re[G++]=H>>8,re[G++]=255&H):(re[G++]=221,es.setUint32(G,H),G+=4);for(let J=0;J<H;J++)N(w[J])},N=w=>{G>Ds&&(re=M(G));var H,J=typeof w;if(J==="string"){let q,oe=w.length;if(cs&&oe>=4&&oe<4096){if((cs.size+=oe)>21760){let F,D,Y=(cs[0]?3*cs[0].length+cs[1].length:0)+10;G+Y>Ds&&(re=M(G+Y)),cs.position?(D=cs,re[G]=200,G+=3,re[G++]=98,F=G-t,G+=4,cd(t,N,0),es.setUint16(F+t-3,G-t-F)):(re[G++]=214,re[G++]=98,F=G-t,G+=4),cs=["",""],cs.previous=D,cs.size=0,cs.position=F}let Se=jg.test(w);return cs[Se?0:1]+=w,re[G++]=193,void N(Se?-oe:oe)}q=oe<32?1:oe<256?2:oe<65536?3:5;let ue=3*oe;if(G+ue>Ds&&(re=M(G+ue)),oe<64||!o){let Se,F,D,Y=G+q;for(Se=0;Se<oe;Se++)F=w.charCodeAt(Se),F<128?re[Y++]=F:F<2048?(re[Y++]=F>>6|192,re[Y++]=63&F|128):(64512&F)==55296&&(64512&(D=w.charCodeAt(Se+1)))==56320?(F=65536+((1023&F)<<10)+(1023&D),Se++,re[Y++]=F>>18|240,re[Y++]=F>>12&63|128,re[Y++]=F>>6&63|128,re[Y++]=63&F|128):(re[Y++]=F>>12|224,re[Y++]=F>>6&63|128,re[Y++]=63&F|128);H=Y-G-q}else H=o(w,G+q);H<32?re[G++]=160|H:H<256?(q<2&&re.copyWithin(G+2,G+1,G+1+H),re[G++]=217,re[G++]=H):H<65536?(q<3&&re.copyWithin(G+3,G+2,G+2+H),re[G++]=218,re[G++]=H>>8,re[G++]=255&H):(q<5&&re.copyWithin(G+5,G+3,G+3+H),re[G++]=219,es.setUint32(G,H),G+=4),G+=H}else if(J==="number")if(w>>>0===w)w<32||w<128&&this.useRecords===!1||w<64&&!this.randomAccessStructure?re[G++]=w:w<256?(re[G++]=204,re[G++]=w):w<65536?(re[G++]=205,re[G++]=w>>8,re[G++]=255&w):(re[G++]=206,es.setUint32(G,w),G+=4);else if((w|0)===w)w>=-32?re[G++]=256+w:w>=-128?(re[G++]=208,re[G++]=w+256):w>=-32768?(re[G++]=209,es.setInt16(G,w),G+=2):(re[G++]=210,es.setInt32(G,w),G+=4);else{let q;if((q=this.useFloat32)>0&&w<4294967296&&w>=-2147483648){let oe;if(re[G++]=202,es.setFloat32(G,w),q<4||((oe=w*yl[(127&re[G])<<1|re[G+1]>>7])|0)===oe)return void(G+=4);G--}re[G++]=203,es.setFloat64(G,w),G+=8}else if(J==="object"||J==="function")if(w){if(i){let oe=i.get(w);if(oe){if(!oe.id){let ue=i.idsToInsert||(i.idsToInsert=[]);oe.id=ue.push(oe)}return re[G++]=214,re[G++]=112,es.setUint32(G,oe.id),void(G+=4)}i.set(w,{offset:G-t})}let q=w.constructor;if(q===Object)S(w);else if(q===Array)K(w);else if(q===Map)if(this.mapAsEmptyObject)re[G++]=128;else{(H=w.size)<16?re[G++]=128|H:H<65536?(re[G++]=222,re[G++]=H>>8,re[G++]=255&H):(re[G++]=223,es.setUint32(G,H),G+=4);for(let[oe,ue]of w)N(oe),N(ue)}else{for(let oe=0,ue=Ac.length;oe<ue;oe++)if(w instanceof xm[oe]){let Se=Ac[oe];if(Se.write){Se.type&&(re[G++]=212,re[G++]=Se.type,re[G++]=0);let He=Se.write.call(this,w);return void(He===w?Array.isArray(w)?K(w):S(w):N(He))}let F,D=re,Y=es,Te=G;re=null;try{F=Se.pack.call(this,w,He=>(re=D,D=null,G+=He,G>Ds&&M(G),{target:re,targetView:es,position:G-He}),N)}finally{D&&(re=D,es=Y,G=Te,Ds=re.length-10)}return void(F&&(F.length+G>Ds&&M(F.length+G),G=qg(F,re,G,Se.type)))}if(Array.isArray(w))K(w);else{if(w.toJSON){const oe=w.toJSON();if(oe!==w)return N(oe)}if(J==="function")return N(this.writeFunction&&this.writeFunction(w));S(w)}}}else re[G++]=192;else if(J==="boolean")re[G++]=w?195:194;else if(J==="bigint"){if(w<BigInt(1)<<BigInt(63)&&w>=-(BigInt(1)<<BigInt(63)))re[G++]=211,es.setBigInt64(G,w);else if(w<BigInt(1)<<BigInt(64)&&w>0)re[G++]=207,es.setBigUint64(G,w);else{if(!this.largeBigIntToFloat){if(this.largeBigIntToString)return N(w.toString());if(this.useBigIntExtension&&w<BigInt(2)**BigInt(1023)&&w>-(BigInt(2)**BigInt(1023))){re[G++]=199,G++,re[G++]=66;let q,oe=[];do{let ue=w&BigInt(255);q=(ue&BigInt(128))===(w<BigInt(0)?BigInt(128):BigInt(0)),oe.push(ue),w>>=BigInt(8)}while(w!==BigInt(0)&&w!==BigInt(-1)||!q);re[G-2]=oe.length;for(let ue=oe.length;ue>0;)re[G++]=Number(oe[--ue]);return}throw new RangeError(w+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}re[G++]=203,es.setFloat64(G,Number(w))}G+=8}else{if(J!=="undefined")throw new Error("Unknown type: "+J);this.encodeUndefinedAsNil?re[G++]=192:(re[G++]=212,re[G++]=0,re[G++]=0)}},E=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?w=>{let H;if(this.skipValues){H=[];for(let oe in w)typeof w.hasOwnProperty=="function"&&!w.hasOwnProperty(oe)||this.skipValues.includes(w[oe])||H.push(oe)}else H=Object.keys(w);let J,q=H.length;if(q<16?re[G++]=128|q:q<65536?(re[G++]=222,re[G++]=q>>8,re[G++]=255&q):(re[G++]=223,es.setUint32(G,q),G+=4),this.coercibleKeyAsNumber)for(let oe=0;oe<q;oe++){J=H[oe];let ue=Number(J);N(isNaN(ue)?J:ue),N(w[J])}else for(let oe=0;oe<q;oe++)N(J=H[oe]),N(w[J])}:w=>{re[G++]=222;let H=G-t;G+=2;let J=0;for(let q in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(q))&&(N(q),N(w[q]),J++);if(J>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');re[H+++t]=J>>8,re[H+t]=255&J},O=this.useRecords===!1?E:e.progressiveRecords&&!v?w=>{let H,J,q=r.transitions||(r.transitions=Object.create(null)),oe=G++-t;for(let ue in w)if(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(ue)){if(H=q[ue],H)q=H;else{let Se=Object.keys(w),F=q;q=r.transitions;let D=0;for(let Y=0,Te=Se.length;Y<Te;Y++){let He=Se[Y];H=q[He],H||(H=q[He]=Object.create(null),D++),q=H}oe+t+1==G?(G--,B(q,Se,D)):W(q,Se,oe,D),J=!0,q=F[ue]}N(w[ue])}if(!J){let ue=q[Jr];ue?re[oe+t]=ue:W(q,Object.keys(w),oe,0)}}:w=>{let H,J=r.transitions||(r.transitions=Object.create(null)),q=0;for(let ue in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(ue))&&(H=J[ue],H||(H=J[ue]=Object.create(null),q++),J=H);let oe=J[Jr];oe?oe>=96&&v?(re[G++]=96+(31&(oe-=96)),re[G++]=oe>>5):re[G++]=oe:B(J,J.__keys__||Object.keys(w),q);for(let ue in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(ue))&&N(w[ue])},U=typeof this.useRecords=="function"&&this.useRecords,S=U?w=>{U(w)?O(w):E(w)}:O,M=w=>{let H;if(w>16777216){if(w-t>id)throw new Error("Packed buffer would be larger than maximum buffer size");H=Math.min(id,4096*Math.round(Math.max((w-t)*(w>67108864?1.25:2),4194304)/4096))}else H=1+(Math.max(w-t<<2,re.length-1)>>12)<<12;let J=new Ro(H);return es=J.dataView||(J.dataView=new DataView(J.buffer,0,H)),w=Math.min(w,re.length),re.copy?re.copy(J,0,t,w):J.set(re.slice(t,w)),G-=t,t=0,Ds=J.length-10,re=J},B=(w,H,J)=>{let q=r.nextId;q||(q=64),q<f&&this.shouldShareStructure&&!this.shouldShareStructure(H)?(q=r.nextOwnId,q<b||(q=f),r.nextOwnId=q+1):(q>=b&&(q=f),r.nextId=q+1);let oe=H.highByte=q>=96&&v?q-96>>5:-1;w[Jr]=q,w.__keys__=H,r[q-64]=H,q<f?(H.isShared=!0,r.sharedLength=q-63,n=!0,oe>=0?(re[G++]=96+(31&q),re[G++]=oe):re[G++]=q):(oe>=0?(re[G++]=213,re[G++]=114,re[G++]=96+(31&q),re[G++]=oe):(re[G++]=212,re[G++]=114,re[G++]=q),J&&(z+=L*J),k.length>=h&&(k.shift()[Jr]=0),k.push(w),N(H))},W=(w,H,J,q)=>{let oe=re,ue=G,Se=Ds,F=t;re=qi,G=0,t=0,re||(qi=re=new Ro(8192)),Ds=re.length-10,B(w,H,q),qi=re;let D=G;if(re=oe,G=ue,Ds=Se,t=F,D>1){let Y=G+D-1;Y>Ds&&M(Y);let Te=J+t;re.copyWithin(Te+D,Te+1,G),re.set(qi.slice(0,D),Te),G=Y}else re[J+t]=qi[0]},I=w=>{let H=Lg(w,re,t,G,r,M,(J,q,oe)=>{if(oe)return n=!0;G=q;let ue=re;return N(J),se(),ue!==re?{position:G,targetView:es,target:re}:G},this);if(H===0)return S(w);G=H}}useBuffer(e){re=e,re.dataView||(re.dataView=new DataView(re.buffer,re.byteOffset,re.byteLength)),G=0}set position(e){G=e}get position(){return G}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}function od(s,e,t,n){let r=s.byteLength;if(r+1<256){var{target:i,position:o}=t(4+r);i[o++]=199,i[o++]=r+1}else if(r+1<65536){var{target:i,position:o}=t(5+r);i[o++]=200,i[o++]=r+1>>8,i[o++]=r+1&255}else{var{target:i,position:o,targetView:a}=t(7+r);i[o++]=201,a.setUint32(o,r+1),o+=4}i[o++]=116,i[o++]=e,s.buffer||(s=new Uint8Array(s)),i.set(new Uint8Array(s.buffer,s.byteOffset,s.byteLength),o)}function ad(s,e){let t=s.byteLength;var n,r;if(t<256){var{target:n,position:r}=e(t+2);n[r++]=196,n[r++]=t}else if(t<65536){var{target:n,position:r}=e(t+3);n[r++]=197,n[r++]=t>>8,n[r++]=255&t}else{var{target:n,position:r,targetView:i}=e(t+5);n[r++]=198,i.setUint32(r,t),r+=4}n.set(s,r)}function qg(s,e,t,n){let r=s.length;switch(r){case 1:e[t++]=212;break;case 2:e[t++]=213;break;case 4:e[t++]=214;break;case 8:e[t++]=215;break;case 16:e[t++]=216;break;default:r<256?(e[t++]=199,e[t++]=r):r<65536?(e[t++]=200,e[t++]=r>>8,e[t++]=255&r):(e[t++]=201,e[t++]=r>>24,e[t++]=r>>16&255,e[t++]=r>>8&255,e[t++]=255&r)}return e[t++]=n,e.set(s,t),t+=r}function cd(s,e,t){if(cs.length>0){es.setUint32(cs.position+s,G+t-cs.position-s),cs.stringsPosition=G-s;let n=cs;cs=null,e(n[0]),e(n[1])}}function Dg(s,e){return s.isCompatible=t=>{let n=!t||(e.lastNamedStructuresLength||0)===t.length;return n||e._mergeStructures(t),n},s}xm=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,mm],Ac=[{pack(s,e,t){let n=s.getTime()/1e3;if((this.useTimestamp32||s.getMilliseconds()===0)&&n>=0&&n<4294967296){let{target:r,targetView:i,position:o}=e(6);r[o++]=214,r[o++]=255,i.setUint32(o,n)}else if(n>0&&n<4294967296){let{target:r,targetView:i,position:o}=e(10);r[o++]=215,r[o++]=255,i.setUint32(o,4e6*s.getMilliseconds()+(n/1e3/4294967296|0)),i.setUint32(o+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return e(0),t(this.onInvalidDate());let{target:r,targetView:i,position:o}=e(3);r[o++]=212,r[o++]=255,r[o++]=255}else{let{target:r,targetView:i,position:o}=e(15);r[o++]=199,r[o++]=12,r[o++]=255,i.setUint32(o,1e6*s.getMilliseconds()),i.setBigInt64(o+4,BigInt(Math.floor(n)))}}},{pack(s,e,t){if(this.setAsEmptyObject)return e(0),t({});let n=Array.from(s),{target:r,position:i}=e(this.moreTypes?3:0);this.moreTypes&&(r[i++]=212,r[i++]=115,r[i++]=0),t(n)}},{pack(s,e,t){let{target:n,position:r}=e(this.moreTypes?3:0);this.moreTypes&&(n[r++]=212,n[r++]=101,n[r++]=0),t([s.name,s.message,s.cause])}},{pack(s,e,t){let{target:n,position:r}=e(this.moreTypes?3:0);this.moreTypes&&(n[r++]=212,n[r++]=120,n[r++]=0),t([s.source,s.flags])}},{pack(s,e){this.moreTypes?od(s,16,e):ad(Ia?Buffer.from(s):new Uint8Array(s),e)}},{pack(s,e){let t=s.constructor;t!==Sm&&this.moreTypes?od(s,bm.indexOf(t.name),e):ad(s,e)}},{pack(s,e){let{target:t,position:n}=e(1);t[n]=193}}];let ld=new Cm({useRecords:!1});ld.pack,ld.pack;const Bg=512,zg=1024,Ug=2048,Vg=new Cm({useRecords:!1,encodeUndefinedAsNil:!0,int64AsType:"number"}),Hg=new gi({useRecords:!1,int64AsType:"number"});class Qg{constructor(e,t,n){p(this,"subject");p(this,"handlerId");p(this,"unsubscribeFn");this.subject=e,this.handlerId=t,this.unsubscribeFn=n}unsubscribe(){try{this.unsubscribeFn(this.subject,this.handlerId)}catch{}}}let Ar=256;const km=[];let Io;for(;Ar--;)km[Ar]=(Ar+256).toString(16).substring(1);function yn(s){let e=0;const t=11;if(!Io||Ar+t>512)for(Io="",Ar=0;e<256;e++)Io+=km[256*Math.random()|0];return Io.substring(Ar,Ar+++t)}const Ut=Pi("camera:ui:connection");class eo{constructor(e,t){p(this,"type");p(this,"options");p(this,"connection",null);p(this,"connectionPromise");p(this,"subscriptionGroups",new Map);p(this,"metricsTracker");p(this,"isDisconnected",!1);this.type=e,this.options=t,yo.validateConnectionOptions(t),this.metricsTracker=new Mg}async connect(){this.isConnected()||(this.connectionPromise?await this.connectionPromise:(Ut(`[${this.options.metadata.id}] Establishing connection...`),this.connectionPromise=this.establishConnection(),await this.connectionPromise,Ut(`[${this.options.metadata.id}] Connection established successfully.`)))}async disconnect(){this.isDisconnected=!0,Ut(`[${this.options.metadata.id}] Disconnecting...`),await this.drainConnection(),this.connection=null,Ut(`[${this.options.metadata.id}] Disconnected.`)}isConnected(){return this.connection!==null&&!this.connection.isClosed()&&!this.connection.isDraining()}isClosed(){return this.connection===null||this.connection.isClosed()||this.connection.isDraining()}getConnection(){if(!this.isConnected())throw kt.connection.invalidState(void 0,{description:"Connection is not established",code:ks.INVALID_STATE});return this.connection}publish(e,t,n,r){if(this.isClosed())throw Ut(`[${this.options.metadata.id}] Publish skipped: Connection closed or draining`),kt.connection.notConnected(void 0,{description:"Failed to publish message: Connection closed or draining",code:ks.NOT_CONNECTED,subject:e});const i={id:yn(),type:ji.BROADCAST,data:t,metadata:this.options.metadata,timestamp:Date.now(),routing:r,error:n};try{this.getConnection().publish(e,this.packMessage(i)),this.metricsTracker.trackPublish(),Ut("Published message to",e,i.id)}catch(o){throw this.metricsTracker.trackMessageError(),kt.message.deliveryFailed(o,{description:"Failed to publish message",code:zn.DELIVERY_FAILED,subject:e})}}async request(e,t,n,r){if(this.isClosed())throw Ut(`[${this.options.metadata.id}] Request skipped: Connection closed or draining. Subject: ${e}`),kt.connection.notConnected(void 0,{description:"Failed to send request: Connection closed or draining",code:ks.NOT_CONNECTED,subject:e});const i=yn(),o={id:i,type:ji.REQUEST,subject:e,data:t,metadata:this.options.metadata,timestamp:Date.now(),routing:r};this.metricsTracker.trackRequestStart(i);try{const a=await this.getConnection().request(e,this.packMessage(o),{timeout:n??this.getTimeoutOptions().request}),l=this.unpackMessage(a);if(this.metricsTracker.trackRequestEnd(i,!!l.error),l.error)throw ws.fromJSON(l.error);return l}catch(a){throw this.metricsTracker.trackRequestEnd(i,!0),a instanceof ws?a:kt.connection.requestFailed(a,{description:"Failed to send request or process response",code:"CONNECTION_REQUEST_FAILED",subject:e})}}async requestRPC(e,t,n){if(this.isClosed())throw Ut(`[${this.options.metadata.id}] RPC Request skipped: Connection closed or draining. Subject: ${e}`),kt.connection.notConnected(void 0,{description:"Failed to send RPC request: Connection closed or draining",code:ks.NOT_CONNECTED,subject:e});const r={id:yn(),type:ji.RPC_REQUEST,subject:e,data:t,metadata:this.options.metadata,timestamp:Date.now()};this.metricsTracker.trackRPCStart();try{const i=await this.getConnection().request(e,this.packMessage(r),{timeout:n??this.getTimeoutOptions().rpc}),o=this.unpackMessage(i);if(this.metricsTracker.trackRPCEnd(!!o.error),o.error)throw ws.fromJSON(o.error);return o}catch(i){throw this.metricsTracker.trackRPCEnd(!0),i instanceof ws?i:kt.rpc.requestFailed(i,{description:"Failed to send RPC request or process response",code:"RPC_REQUEST_FAILED",subject:e})}}handleRequest(e,t){return this.subscribe(e,t,void 0,"request")}subscribe(e,t,n=yn(),r="message"){if(this.isClosed())throw Ut(`[${this.options.metadata.id}] Subscribe skipped: Connection closed or draining. Subject: ${e}`),kt.connection.notConnected(void 0,{description:"Failed to subscribe: Connection closed or draining",code:ks.NOT_CONNECTED,subject:e});let i=this.subscriptionGroups.get(e);if(i){if(i.type!==r)throw new Error(`Cannot mix on subject ${e}`);if((r==="request"||r==="rpc"||r==="generator")&&i.handlers.size>0)throw new Error(`Request/RPC/Generator handler already registered for subject ${e}`)}else{let o;try{o=this.getConnection().subscribe(e)}catch(a){throw kt.connection.subscribeFailed(a,{description:`Failed to create NATS subscription for subject ${e}`,code:"CONNECTION_SUBSCRIBE_FAILED",subject:e,metadata:{type:r}})}i={subscription:o,handlers:new Map,type:r,refCount:0},this.subscriptionGroups.set(e,i),this.handleSubscription(o,e,i),Ut(`[${this.options.metadata.id}] Created subscription group for %s`,e)}return i.handlers.has(n)&&Ut(`[${this.options.metadata.id}] Handler %s already registered for subject %s`,n,e),i.handlers.set(n,t),i.refCount++,this.metricsTracker.trackSubscriptionChange(1,r),Ut(`[${this.options.metadata.id}] Subscribed to %s (handler: %s, type: %s, refCount: %d)`,e,n,r,i.refCount),new Qg(e,n,this.unsubscribe.bind(this))}unsubscribe(e,t){const n=this.subscriptionGroups.get(e);if(n&&n.handlers.delete(t)&&(n.refCount--,this.metricsTracker.trackSubscriptionChange(-1,n.type),n.refCount<=0))try{n.subscription.unsubscribe(),this.subscriptionGroups.delete(e)}catch{this.subscriptionGroups.delete(e)}}getMetrics(){return this.metricsTracker.getMetrics()}async establishConnection(){try{this.isDisconnected=!1;const e=this.getTimeoutOptions(),{waitForServer:t}=this.getConnectOptions(),{maxAttempts:n,delay:r,enabled:i}=this.getReconnectOptions();let o=0;for(;!this.isDisconnected;){o++;try{Ut(`[${this.options.metadata.id}] Connection attempt ${o}...`);const a=await kg({...this.getNatsAuthOptions(),name:this.options.metadata.id,servers:this.options.endpoints,tls:this.options.tls,timeout:e.connection,maxReconnectAttempts:i?n:0,reconnect:i,reconnectTimeWait:r,noEcho:!0,noAsyncTraces:!0,waitOnFirstConnect:!0});return Ut(`[${this.options.metadata.id}] NATS connect() successful.`),(async()=>{for await(const l of a.status())l.type===Pn.Reconnect&&Ut(`[${this.options.metadata.id}] Connection reconnected.`)})().catch(l=>{Ut(`[${this.options.metadata.id}] Error in status monitoring:`,l)}),a.closed().then(l=>{Ut(`[${this.options.metadata.id}] Connection closed:`,l),this.subscriptionGroups.clear(),this.metricsTracker.resetMetrics(),this.isDisconnected=!0,this.connection=null}),void(this.connection=a)}catch(a){if(this.isDisconnected)return;if(!t)throw Ut(`[${this.options.metadata.id}] Connection attempt ${o} failed:`,a),kt.connection.connectionFailed(a,{description:"Failed to connect to NATS server",code:ks.FAILED,metadata:{attempts:o}});Ut(`[${this.options.metadata.id}] Connection attempt ${o} failed:`,a),await new Promise(l=>setTimeout(l,r))}}}finally{this.connectionPromise=void 0}}async drainConnection(){if(this.connection&&!this.connection.isClosed())try{await this.connection.drain()}catch(e){Ut("Error draining connection:",e)}}async handleSubscription(e,t,n){Ut(`[${this.options.metadata.id}] Starting message loop for subscription ${t}`);for await(const r of e){if(!this.subscriptionGroups.has(t)){Ut(`[${this.options.metadata.id}] Message loop for ${t} exiting: Group removed.`);break}let i;try{i=this.unpackMessage(r);const o={subject:r.subject,timestamp:Date.now(),id:i.id};switch(this.metricsTracker.trackReceive(),n.type){case"request":this.handleRequestMessage(r,i,n);break;case"rpc":this.handleRPCMessage(r,i,n);break;case"generator":this.handleGeneratorInitiationMessage(r,i,n);break;default:this.handleNormalMessage(i,o,n)}}catch(o){this.metricsTracker.trackMessageError(),Ut(`[${this.options.metadata.id}] Error processing message for ${t}:`,o)}}Ut(`[${this.options.metadata.id}] Message loop for subscription ${t} terminated.`),this.subscriptionGroups.has(t)&&this.subscriptionGroups.delete(t)}async handleRequestMessage(e,t,n){const r=n.handlers.values().next().value;if(r)try{const i=await r(t);this.respondTo(e,i,t.id)}catch(i){this.metricsTracker.trackMessageError();const o=kt.message.executionFailed(i,{description:"Handler execution failed"});this.respondTo(e,null,t.id,o.toJSON())}}async handleRPCMessage(e,t,n){const r=n.handlers.values().next().value;if(r)try{const i=Array.isArray(t.data)?t.data:t.data!==void 0?[t.data]:[],o=await r(...i);this.respondToRPC(e,o,t.id)}catch(i){this.metricsTracker.trackMessageError();const o=kt.rpc.executionFailed(i,{description:"RPC handler execution failed"});this.respondToRPC(e,null,t.id,void 0,!0,o.toJSON())}}async handleGeneratorInitiationMessage(e,t,n){const r=n.handlers.values().next().value;if(r)try{await r(t)}catch(i){this.metricsTracker.trackMessageError(),Ut("Error processing generator request:",i)}}async handleNormalMessage(e,t,n){const r=Array.from(n.handlers.values());if(r.length===0)return;const i=[];for(const o of r)try{const a=o(e);a instanceof Promise&&i.push(a.catch(this.metricsTracker.trackMessageError.bind(this)))}catch(a){this.metricsTracker.trackMessageError(),Ut("Error in sync handler:",a)}await Promise.allSettled(i)}respondTo(e,t,n,r){try{if(this.isClosed())throw Ut(`[${this.options.metadata.id}] Respond skipped: Connection closed or draining. Subject: ${e.subject}`),kt.connection.notConnected(void 0,{description:"Failed to respond: Connection closed or draining",code:ks.NOT_CONNECTED,subject:e.subject});const i={id:yn(),type:ji.RESPONSE,requestId:n,data:t,metadata:this.options.metadata,error:r,timestamp:Date.now()};e.respond(this.packMessage(i))}catch(i){this.metricsTracker.trackMessageError(),Ut("Error sending request response:",i)}}respondToRPC(e,t,n,r,i,o){try{if(this.isClosed())throw Ut(`[${this.options.metadata.id}] RPC Respond skipped: Connection closed or draining. Subject: ${e.subject}`),kt.connection.notConnected(void 0,{description:"Failed to respond: Connection closed or draining",code:ks.NOT_CONNECTED,subject:e.subject});const a={id:yn(),type:ji.RPC_RESPONSE,requestId:n,data:t,metadata:this.options.metadata,streamId:r,done:i,error:o,timestamp:Date.now()};e.respond(this.packMessage(a))}catch(a){this.metricsTracker.trackMessageError(),Ut("Error sending RPC response:",a)}}packMessage(e){try{return t=e,Vg.pack(t)}catch(n){throw this.metricsTracker.trackMessageError(),kt.message.invalidFormat(n,{description:"Failed to pack message",code:zn.INVALID_FORMAT,metadata:{raw:e}})}var t}unpackMessage(e){try{return t=e.data,Hg.unpack(t)}catch{throw kt.message.invalidFormat(void 0,{description:"Failed to parse message",code:zn.INVALID_FORMAT,subject:e.subject,metadata:{raw:e.data}})}var t}getNatsAuthOptions(){return"server"in this.options.auth?{user:this.options.auth.server.user,pass:this.options.auth.server.password}:{user:this.options.auth.user,pass:this.options.auth.password}}getConnectOptions(){return{waitForServer:!1,...this.options.connect}}getReconnectOptions(){return{enabled:!1,maxAttempts:Zu.MAX_RECONNECT_ATTEMPTS,delay:Zu.DELAY,...this.options.reconnect}}getTimeoutOptions(){return{rpc:Ga.RPC,request:Ga.REQUEST,connection:Ga.CONNECTION,...this.options.timeout}}}class Kg{constructor(){}publish(e,t,n){this.getConnectionManager().publish(e,t,void 0,n)}async request(e,t,n,r){return this.getConnectionManager().request(e,t,n,r)}handleRequest(e,t){return this.getConnectionManager().handleRequest(e,t)}subscribe(e,t){return this.getConnectionManager().subscribe(e,t)}unsubscribe(e,t){return this.getConnectionManager().unsubscribe(e,t)}}tn(779);function Ja(s={name:void 0,public:!0}){return function(e,t){const n=typeof t=="object"?t.name:t,r=s.name??n.toString();if(typeof t=="object"){const i=e;return Reflect.defineMetadata("rpc:config",{name:r,public:s.public??!0},i,n),i}{const i=e[n];Reflect.defineMetadata("rpc:config",{name:r,public:s.public??!0},e,n),Object.defineProperty(e,n,{value:function(...o){return i.apply(this,o)},enumerable:!0,configurable:!0})}}}class Er{static extractMethods(e){const t={},n=(o,a)=>{if(!((u,d)=>typeof d=="function"&&!u.startsWith("_")&&!u.startsWith("#")&&u!=="constructor"&&!Object.prototype.hasOwnProperty.call(Object.prototype,u))(o,a))return;const l=Reflect.getMetadata("rpc:config",Object.getPrototypeOf(e),o)??Reflect.getMetadata("rpc:config",a,o);l!=null&&l.public&&(t[l.name]={name:l.name,public:!0,type:Er.getMethodType(a),method:a})};let r=e;const i=new Set;for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).forEach(o=>{if(!i.has(o)){i.add(o);const a=e[o];n(o,a)}}),r=Object.getPrototypeOf(r);return t._discover={name:"_discover",public:!0,type:"async",method:async()=>Object.entries(Er.extractMethods(e)).reduce((o,[a,l])=>(o[a]={name:a,type:l.type},o),{})},t}static isAsyncFunction(e){return!!e&&(e.constructor?e.constructor.name==="AsyncFunction":e.toString().includes("async ")&&!e.toString().includes("async*"))}static isGeneratorFunction(e){return!!e&&(e.constructor?e.constructor.name==="GeneratorFunction":e.toString().includes("function*"))}static isAsyncGeneratorFunction(e){return!!e&&(e.constructor?e.constructor.name==="AsyncGeneratorFunction":e.toString().includes("async*"))}static getMethodType(e){return Er.isAsyncGeneratorFunction(e)||Er.isGeneratorFunction(e)?"asyncGenerator":(Er.isAsyncFunction(e),"async")}}const Ft=Pi("camera:ui:rpc:generator");class Zg{constructor(e,t,n){p(this,"namespace");p(this,"mainConnection");p(this,"options");p(this,"MAX_QUEUE_SIZE",100);p(this,"pendingReadySignals",new Map);p(this,"consumerGeneratorStates",new Map);p(this,"producerGeneratorStates",new Map);p(this,"handlerSubscriptions",new Map);this.namespace=e,this.mainConnection=t,this.options=n}async*createGenerator(e,...t){var u;const n=yn(),r=`${this.namespace}.${e}.generator`,i=`${r}.stream.${n}`,o=`${r}.control.${n}`;Ft(`[C:${n}] Starting generator stream for ${e}`);let a=null,l=null;try{Ft(`[C:${n}] Creating dedicated consumer connection...`),a=new eo(this.mainConnection.type,{...this.options,metadata:{...this.options.metadata,id:`${this.options.metadata.id}-cg-${n.substring(0,8)}`},bundledConnection:!1,timeout:this.options.timeout}),await a.connect(),Ft(`[C:${n}] Dedicated consumer connection established.`);const d=a.subscribe(i,h=>this.handleStreamMessage(n,h),yn(),"generator");for(Ft(`[C:${n}] Subscribed to data stream: ${i}`),l={messageQueue:[],resolveNext:null,error:void 0,isDone:!1,streamSubscription:d,controlSubject:o,lastProcessedTime:Date.now(),isProcessing:!1,dedicatedConnection:a},this.consumerGeneratorStates.set(n,l),Ft(`[C:${n}] Sending initiation request via main connection to ${r}`),this.mainConnection.publish(r,{streamId:n,args:t});!l.isDone;){if(l.error)throw l.error;if(l.messageQueue.length>0){const v=l.messageQueue.shift();l.isProcessing=!0;try{yield v.value}finally{l.isProcessing=!1,l.lastProcessedTime=Date.now(),this.sendReadySignal(n,l.controlSubject,l.dedicatedConnection)}continue}l.isProcessing=!1;const h=await new Promise(v=>{const f=this.consumerGeneratorStates.get(n);f?f.resolveNext=v:v({done:!0,value:void 0})});if(h.done||(u=this.consumerGeneratorStates.get(n))!=null&&u.isDone)break;l=this.consumerGeneratorStates.get(n),l.isProcessing=!0;try{yield h.value.value}finally{l.isProcessing=!1,l.lastProcessedTime=Date.now(),this.sendReadySignal(n,l.controlSubject,l.dedicatedConnection)}}Ft(`[C:${n}] Consumption loop finished.`)}finally{Ft(`[C:${n}] Cleaning up consumer side...`);const d=this.consumerGeneratorStates.get(n);if(d)await this.cleanupConsumerGenerator(n,d);else if(a&&!a.isClosed()){const h=`${this.namespace}.${e}.generator.control.${n}`;await this.cleanupConsumerConnection(n,a,h)}this.consumerGeneratorStates.delete(n),Ft(`[C:${n}] Consumer cleanup finished.`)}}async handleGenerator(e,t){var i;const n=`${this.namespace}.${e}.generator`;Ft(`[P] Setting up generator handler for: ${n}`),(i=this.handlerSubscriptions.get(n))==null||i.unsubscribe();const r=this.mainConnection.subscribe(n,async o=>{var a;try{await this.handleGeneratorRequest(e,t,o)}catch(l){Ft(`[P:${((a=o.data)==null?void 0:a.streamId)||"unknown"}] Critical error setting up generator handler for ${e}:`,l)}},yn(),"generator");this.handlerSubscriptions.set(n,r)}async handleGeneratorRequest(e,t,n){var h;const r=(h=n.data)==null?void 0:h.streamId;if(!r)return void Ft(`[P:unknown] Received generator request for ${e} without streamId. Discarding.`);const i=`${this.namespace}.${e}.generator`,o=`${i}.stream.${r}`,a=`${i}.control.${r}`;Ft(`[P:${r}] Received generator request for ${e}`);let l=null,u=null,d=null;try{Ft(`[P:${r}] Creating dedicated producer connection...`),l=new eo(this.mainConnection.type,{...this.options,metadata:{...this.options.metadata,id:`${this.options.metadata.id}-pg-${r.substring(0,8)}`},bundledConnection:!1,timeout:this.options.timeout}),await l.connect(),Ft(`[P:${r}] Dedicated producer connection established.`),this.pendingReadySignals.has(r)||this.pendingReadySignals.set(r,new Set);const v=l.subscribe(a,b=>this.handleControlMessage(r,b),yn(),"generator");Ft(`[P:${r}] Subscribed to control subject: ${a}`),d=t(...n.data.args?Array.isArray(n.data.args)?n.data.args:[n.data.args]:[]),u={streamSubject:o,controlSubject:a,requestId:n.id,streamId:r,generator:d,isWaitingForClient:!1,lastSentTime:Date.now(),dedicatedConnection:l,controlSubscription:v},this.producerGeneratorStates.set(r,u),Ft(`[P:${r}] Generator handler invoked. Processing frames...`);let f=await d.next();for(;;){if(this.producerGeneratorStates.get(r)!==u){Ft(`[P:${r}] Producer state removed. Aborting loop.`);break}if(f.done){l.publish(o,{requestId:n.id,streamId:r,done:!0}),Ft(`[P:${r}] Generator completed normally.`);break}l.publish(o,{requestId:n.id,streamId:r,value:f.value,done:!1}),u.lastSentTime=Date.now(),u.isWaitingForClient=!0;const b=new Promise(L=>{var se;return(se=this.pendingReadySignals.get(r))==null?void 0:se.add(L)});let k;const z=new Promise(L=>{k=setTimeout(()=>{Ft(`[P:${r}] Ready signal timeout.`),L()},1e4)});if(await Promise.race([b.finally(()=>clearTimeout(k)),z]),clearTimeout(k),this.producerGeneratorStates.get(r)!==u){Ft(`[P:${r}] Producer state changed during wait. Aborting loop.`);break}f=await d.next()}}catch(v){if(Ft(`[P:${r}] Error during generator execution:`,v),l&&this.producerGeneratorStates.has(r)){const f=kt.rpc.internalError(v,{description:"Error processing generator request"});try{l.publish(o,{requestId:n.id,streamId:r,done:!0,error:f.toJSON()})}catch(b){Ft(`[P:${r}] Error sending error message:`,b)}}}finally{Ft(`[P:${r}] Cleaning up producer side...`);const v=this.producerGeneratorStates.get(r);v?await this.cleanupProducerGenerator(r,v):l&&!l.isClosed()&&await this.cleanupProducerConnection(l,null),this.producerGeneratorStates.delete(r),this.pendingReadySignals.delete(r),Ft(`[P:${r}] Producer side cleanup finished.`)}}async dispose(){Ft("Disposing RPCGeneratorManager..."),await Promise.allSettled([...Array.from(this.consumerGeneratorStates.entries()).map(([e,t])=>this.cleanupConsumerGenerator(e,t)),...Array.from(this.producerGeneratorStates.entries()).map(([e,t])=>this.cleanupProducerGenerator(e,t))]),this.consumerGeneratorStates.clear(),this.producerGeneratorStates.clear(),this.pendingReadySignals.clear(),this.handlerSubscriptions.forEach(e=>e.unsubscribe()),this.handlerSubscriptions.clear(),Ft("RPCGeneratorManager disposed.")}handleStreamMessage(e,t){const n=this.consumerGeneratorStates.get(e);if(n)return t.error?(n.error=ws.fromJSON(t.error),n.isDone=!0,void(n.resolveNext&&(n.resolveNext({done:!0,value:void 0}),n.resolveNext=null))):t.data.done?(n.isDone=!0,void(n.resolveNext&&(n.resolveNext({done:!0,value:t.data}),n.resolveNext=null))):void(n.resolveNext?(n.resolveNext({done:!1,value:t.data}),n.resolveNext=null):(n.messageQueue.length>=this.MAX_QUEUE_SIZE&&n.messageQueue.shift(),n.messageQueue.push(t.data)))}handleControlMessage(e,t){const n=this.producerGeneratorStates.get(e);if(n){if(t.data.type==="return"||t.data.type==="throw")this.cleanupProducerGenerator(e,n).catch(()=>{});else if(t.data.type==="ready"){n.isWaitingForClient=!1;const r=this.pendingReadySignals.get(e);r&&(r.forEach(i=>i()),r.clear())}}}sendReadySignal(e,t,n){n.isClosed()||n.publish(t,{type:"ready"})}async cleanupConsumerGenerator(e,t){this.consumerGeneratorStates.has(e)&&(this.consumerGeneratorStates.delete(e),Ft(`[C:${e}] Cleaning up consumer generator...`),t.streamSubscription.unsubscribe(),await this.cleanupConsumerConnection(e,t.dedicatedConnection,t.controlSubject))}async cleanupConsumerConnection(e,t,n){if(Ft(`[C:${e}] Cleaning up consumer connection...`),n&&!t.isClosed())try{t.publish(n,{type:"return"})}catch{}t.isClosed()||await t.disconnect().catch(r=>Ft(`[C:${e}] Error disconnecting consumer connection:`,r))}async cleanupProducerGenerator(e,t){this.producerGeneratorStates.has(e)&&(this.producerGeneratorStates.delete(e),this.pendingReadySignals.delete(e),Ft(`[P:${e}] Cleaning up producer generator...`),await t.generator.return(void 0).catch(()=>{}),await this.cleanupProducerConnection(t.dedicatedConnection,t.controlSubscription))}async cleanupProducerConnection(e,t){var r,i;const n=((i=(r=e==null?void 0:e.options)==null?void 0:r.metadata)==null?void 0:i.id)||"unknown-producer";Ft(`[P:${n}] Cleaning up producer connection...`),t==null||t.unsubscribe(),e&&!e.isClosed()&&await e.disconnect().catch(o=>Ft(`[P:${n}] Error disconnecting producer connection:`,o))}}const Bs=Pi("camera:ui:rpc");class ud{constructor(e,t,n,r){p(this,"namespace");p(this,"connection");p(this,"options");p(this,"rpcOptions");p(this,"generatorManager");p(this,"handlers",new Map);p(this,"remoteMethodTypes",new Map);this.namespace=e,this.connection=t,this.options=n,this.rpcOptions=r,this.generatorManager=new Zg(this.namespace,this.connection,this.options)}async connect(){if(this.options.bundledConnection)Bs(`[${this.namespace}] Main connection is bundled, skipping connect.`);else try{await this.connection.connect(),Bs(`[${this.namespace}] Main connection established.`)}catch(e){throw Bs(`[${this.namespace}] Failed to establish main connection:`,e),e}}async disconnect(){if(Bs(`[${this.namespace}] Disconnecting RPCConnection...`),await this.dispose(),this.options.bundledConnection)Bs(`[${this.namespace}] Skipping disconnect of bundled main connection.`);else{if(!this.connection.isClosed())try{await this.connection.disconnect(),Bs(`[${this.namespace}] Main connection disconnected.`)}catch(e){Bs(`[${this.namespace}] Error disconnecting main connection:`,e)}Bs(`[${this.namespace}] RPCConnection disconnected.`)}}isConnected(){return this.connection.isConnected()}registerHandler(e){const t=Er.extractMethods(e);Object.entries(t).forEach(([n,r])=>{const i=r.name||n;if(this.handlers.has(i))return void Bs(`[${this.namespace}] Handler for method '${i}' already registered.`);const o={handler:e,subscriptions:[]};if(this.handlers.set(i,o),Bs(`[${this.namespace}] Registering handler for method: ${i} (${r.type})`),r.type==="asyncGenerator")this.generatorManager.handleGenerator(i,r.method.bind(e));else{const a=`${this.namespace}.${i}`,l=yn();try{this.connection.subscribe(a,r.method.bind(e),l,"rpc"),o.subscriptions.push({subject:a,handlerId:l})}catch(u){Bs(`[${this.namespace}] Failed to register handler for method: "${i}":`,u),this.handlers.delete(i)}}})}async call(e,...t){var r;const n=`${this.namespace}.${e}`;return this.connection.requestRPC(n,t,(r=this.rpcOptions)==null?void 0:r.timeout).then(i=>i.data)}callGenerator(e,...t){return this.generatorManager.createGenerator(e,...t)}createProxy(){const e=new Set(["toString","toJSON","valueOf","constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","then","catch","finally"]);return new Proxy({},{get:(t,n)=>{if(typeof n!="symbol"&&!e.has(n))return(...r)=>{var o,a;return((o=r[0])==null?void 0:o.isGenerator)?(Bs("Creating generator proxy for:",n),this.callGenerator(n,...r.slice(1))):(Bs("Creating async proxy for:",n),this.connection.requestRPC(`${this.namespace}.${n}`,r,(a=this.rpcOptions)==null?void 0:a.timeout).then(l=>l.data))}}})}getConnectionManager(){return this.connection}async dispose(){Bs(`[${this.namespace}] Disposing RPCConnection resources...`),this.generatorManager&&await this.generatorManager.dispose();const e=[];this.handlers.forEach(t=>{t.subscriptions.forEach(({subject:n,handlerId:r})=>{e.push(new Promise(i=>{try{this.connection.unsubscribe(n,r)}finally{i()}}))})}),await Promise.allSettled(e),this.handlers.clear(),this.remoteMethodTypes.clear(),Bs(`[${this.namespace}] Finished disposing RPCConnection resources.`)}}class Gg extends Kg{constructor(t,n){super();p(this,"type");p(this,"options");p(this,"rpcManagers",new Map);p(this,"remoteRpcManagers",new Map);p(this,"connection");this.type=t,this.options=n,yo.validateConnectionOptions(n),this.connection=new eo(this.type,n)}sendToPlugin(t,n){const r=ns.createRoutingMetadata(this.type,this.options.metadata.id,"plugin",t);this.publish(this.getPluginSubject(t),n,r)}sendToService(t,n){const r=ns.createRoutingMetadata(this.type,this.options.metadata.id,"service",t);this.publish(this.getServiceSubject(t),n,r)}async requestFromPlugin(t,n,r){const i=ns.createRoutingMetadata(this.type,this.options.metadata.id,"plugin",t);return this.request(this.getPluginSubject(t),n,r,i)}async requestFromService(t,n,r){const i=ns.createRoutingMetadata(this.type,this.options.metadata.id,"service",t);return this.request(this.getServiceSubject(t),n,r,i)}onPluginMessage(t="*",n){const r=this.type==="plugin"?ns.getPluginToPluginSubject(t,this.options.metadata.id):this.type==="service"?ns.getPluginToServiceSubject(t,this.options.metadata.id):ns.getPluginToServerSubject(t,this.options.metadata.id);return this.handleRequest(r,async i=>await n(i.data))}onServiceMessage(t="*",n){const r=this.type==="plugin"?ns.getServiceToPluginSubject(t,this.options.metadata.id):this.type==="service"?ns.getServiceToServiceSubject(t,this.options.metadata.id):ns.getServiceToServerSubject(t,this.options.metadata.id);return this.handleRequest(r,async i=>await n(i.data))}async registerRPCHandler(t,n,r){let i=this.rpcManagers.get(t);if(i)return;const o=this.options.bundledConnection??!0?this.connection:new eo(this.type,this.options);i=new ud(t,o,this.options,r),await i.connect(),i.registerHandler(n),this.rpcManagers.set(t,i)}async unregisterRPCHandler(t){const n=this.rpcManagers.get(t);await(n==null?void 0:n.disconnect()),this.rpcManagers.delete(t)}async createRPCProxy(t,n){return(await this.createRPCConnection(t,n)).createProxy()}async createRPCConnection(t,n){try{let r=this.remoteRpcManagers.get(t);if(!r){const i=this.options.bundledConnection??!0?this.connection:new eo(this.type,this.options);r=new ud(t,i,this.options,n),await r.connect(),this.remoteRpcManagers.set(t,r)}return r}catch(r){throw kt.rpc.connectionFailed(r,{description:"Failed to connect to remote RPC",code:rr.CONNECTION_FAILED,metadata:{namespace:t,rpcOptions:n}})}}async disconnectRPCConnection(t){const n=this.remoteRpcManagers.get(t);await(n==null?void 0:n.disconnect()),this.remoteRpcManagers.delete(t)}async cleanup(){await this.cleanupRPCConnections(),await this.cleanupRemoteRPCConnections()}async cleanupRPCConnections(t){if(t){const n=this.rpcManagers.get(t);await(n==null?void 0:n.disconnect()),this.rpcManagers.delete(t)}else await Promise.allSettled([...this.rpcManagers.values()].map(n=>n.disconnect())),this.rpcManagers.clear()}async cleanupRemoteRPCConnections(t){if(t){const n=this.remoteRpcManagers.get(t);await(n==null?void 0:n.disconnect()),this.remoteRpcManagers.delete(t)}else await Promise.allSettled([...this.remoteRpcManagers.values()].map(n=>n.disconnect())),this.remoteRpcManagers.clear()}getPluginSubject(t){return this.type==="plugin"?ns.getPluginToPluginSubject(this.options.metadata.id,t):this.type==="service"?ns.getServiceToPluginSubject(this.options.metadata.id,t):ns.getServerToPluginSubject(this.options.metadata.id,t)}getServiceSubject(t){return this.type==="plugin"?ns.getPluginToServiceSubject(this.options.metadata.id,t):this.type==="service"?ns.getServiceToServiceSubject(this.options.metadata.id,t):ns.getServerToServiceSubject(this.options.metadata.id,t)}}const Oo=Pi("camera:ui:client");class Wg extends Gg{constructor(t,n,r=!1){super(t,n);p(this,"type");p(this,"options");p(this,"isProxy");p(this,"serverStatus",Xi);p(this,"registered",!1);p(this,"serverMetadata");this.type=t,this.options=n,this.isProxy=r}async connect(){await this.initialize(),this.setupSubscriptions(),Oo("Connected successfully")}async disconnect(){await super.cleanup(),await this.connection.disconnect(),this.registered=!1,Oo("Disconnected from NATS")}sendToServer(t){if(!this.serverMetadata)throw kt.client.invalidState(void 0,{description:"Server metadata is not available",code:$n.INVALID_STATE});const n=this.type==="plugin"?ns.getPluginToServerSubject(this.options.metadata.id,this.serverMetadata.id):ns.getServiceToServerSubject(this.options.metadata.id,this.serverMetadata.id),r=ns.createRoutingMetadata(this.type,this.options.metadata.id,"server",this.serverMetadata.id);this.publish(n,t,r)}async requestFromServer(t,n){if(!this.serverMetadata)throw kt.client.invalidState(void 0,{description:"Server metadata is not available",code:$n.INVALID_STATE});const r=this.type==="plugin"?ns.getPluginToServerSubject(this.options.metadata.id,this.serverMetadata.id):ns.getServiceToServerSubject(this.options.metadata.id,this.serverMetadata.id),i=ns.createRoutingMetadata(this.type,this.options.metadata.id,"server",this.serverMetadata.id);return this.request(r,t,n,i)}onServerMessage(t){if(!this.serverMetadata)throw kt.client.invalidState(void 0,{description:"Server metadata is not available",code:$n.INVALID_STATE});const n=this.type==="plugin"?ns.getServerToPluginSubject(this.serverMetadata.id,this.options.metadata.id):ns.getServerToServiceSubject(this.serverMetadata.id,this.options.metadata.id);return this.handleRequest(n,async r=>await t(r.data))}isServerRunning(){return this.serverStatus==="running"}isConnected(){return this.connection.isConnected()}isRegistered(){return this.registered}async createRPCProxy(t,n){return super.createRPCProxy(t,n)}createRPCConnection(t,n){return super.createRPCConnection(t,n)}disconnectRPCConnection(t){return super.disconnectRPCConnection(t)}getConnectionManager(){return this.connection}getRPCConnectionManagers(){const t=Array.from(this.rpcManagers.values()).map(n=>n.getConnectionManager());return[this.connection,...t]}async initialize(){await this.connection.connect(),await this.register()}setupSubscriptions(){this.isProxy||this.handleRequest(`${Bn.HEALTH.PING}.${this.options.metadata.id}`,async()=>({clientId:this.options.metadata.id})),this.subscribe(Bn.SERVER.STATUS,async t=>{Oo("Server status update:",t),this.serverStatus=t.data,this.serverStatus===Sc||this.serverStatus===Xi?this.registered=!1:this.serverStatus!==Uo||this.isRegistered()||(this.isProxy?(this.registered=!0,this.serverStatus="running"):await this.register())})}async register(){if(this.isRegistered()||this.isProxy)return;const t=this.type.toUpperCase(),n=Bn[t].REGISTER;try{const r=await this.request(n,this.options.metadata);if(r.error)throw ws.fromJSON(r.error);if(!r.data.success)throw kt.client.registrationFailed(void 0,{description:"Failed to register client",subject:n,code:$n.REGISTRATION_FAILED,metadata:{response:r,isProxy:this.isProxy,registered:this.registered,type:this.type,metadata:this.options.metadata}});this.serverMetadata=r.data.serverMetadata,this.registered=!0,this.serverStatus="running",Oo("Registration successful")}catch(r){throw this.registered=!1,kt.client.registrationFailed(r,{description:"Failed to register client",code:$n.REGISTRATION_FAILED,subject:n,metadata:{isProxy:this.isProxy,registered:this.registered,type:this.type,metadata:this.options.metadata}})}}}Pi("camera:ui:connection:state");const er=tn(413)("camera:ui:client:instance");class Jg extends Wg{constructor(t,n){super(t,n);p(this,"type");p(this,"options");p(this,"status",Xi);p(this,"error");p(this,"metricsInterval");this.type=t,this.options=n,yo.validateConnectionOptions(n)}async start(){try{if(this.status===Uo)return;await this.connect(),this.setupSubscriptions(),this.options.metrics&&this.startMetricsInterval(),this.updateStatus(Uo),this.onStart(),er(`Client ${this.options.metadata.id} started successfully`)}catch(t){throw kt.connection.connectionFailed(t,{description:"Failed to start client",code:ks.FAILED,metadata:{type:this.type,metadata:this.options.metadata}})}}async stop(){var t;try{if(this.status===Xi||this.status===Sc)return;this.stopMetricsInterval(),this.updateStatus(Sc),await((t=this.onBeforeStop)==null?void 0:t.call(this)),this.updateStatus(Xi),await this.disconnect();try{await async function(n,r,i,o){let a;const l=new Promise((u,d)=>{a=setTimeout(()=>{i==null||i(),d(new Error(o??`Operation timed out after ${r}ms`))},r)});try{const u=typeof n=="function"?n:()=>n;return await Promise.race([u(),l])}finally{clearTimeout(a)}}(this.onStop(),3e3,void 0,"Failed to stop client")}catch{}er(`Client ${this.options.metadata.name} stopped successfully`)}catch(n){throw kt.connection.connectionFailed(n,{description:"Failed to stop client",code:ks.FAILED,metadata:{type:this.type,metadata:this.options.metadata}})}}getStatus(){return{id:this.options.metadata.id,type:this.type,state:this.status,error:this.error,metadata:this.options.metadata}}isRunning(){return this.status===Uo}setupSubscriptions(){this.subscribe(`${Bn.HEALTH.PING}.${this.type}.${this.options.metadata.id}`,async()=>{const t=this.type==="plugin"?Bn.PLUGIN.STATUS:Bn.SERVICE.STATUS;this.publish(`${t}.${this.options.metadata.id}`,this.getStatus().state)})}updateStatus(t,n){if(this.status!==t){this.status=t,this.error=n,er(`Client ${this.options.metadata.name} state changed to ${t}`);try{if(this.isConnected()){const r=this.type==="plugin"?Bn.PLUGIN.STATUS:Bn.SERVICE.STATUS;this.publish(`${r}.${this.options.metadata.id}`,this.getStatus().state)}else er("Skipping status update: Not connected to server")}catch(r){er("Failed to update state:",r)}}}startMetricsInterval(){this.stopMetricsInterval(),this.metricsInterval=setInterval(()=>{try{const t=this.aggregateMetrics(),n=`${Bn.METRICS.UPDATE}.${this.type}.${this.options.metadata.id}`;this.publish(n,t),er(`Published metrics for ${this.options.metadata.id}:`,t)}catch(t){er(`Failed to publish metrics for ${this.options.metadata.id}:`,t)}},Eg.METRICS)}stopMetricsInterval(){this.metricsInterval&&(clearInterval(this.metricsInterval),this.metricsInterval=void 0)}aggregateMetrics(){const t=this.getRPCConnectionManagers();er(`Aggregating metrics from connection managers: ${t.length}`);const n={timestamp:Date.now(),startTime:Math.min(...t.map(o=>o.getMetrics().startTime)),requests:{total:0,active:0,errors:0,perSecond:0,avgResponseTime:0},messages:{published:0,received:0,errors:0},rpc:{total:0,active:0,errors:0},subscriptions:{active:0,messageHandlers:0,requestHandlers:0,rpcHandlers:0}};let r=0,i=0;for(const o of t){const a=o.getMetrics();n.requests.total+=a.requests.total,n.requests.active+=a.requests.active,n.requests.errors+=a.requests.errors;const l=a.requests.total;l>0&&(r+=l,i+=a.requests.avgResponseTime*l,n.requests.perSecond+=a.requests.perSecond),n.messages.published+=a.messages.published,n.messages.received+=a.messages.received,n.messages.errors+=a.messages.errors,n.rpc.total+=a.rpc.total,n.rpc.active+=a.rpc.active,n.rpc.errors+=a.rpc.errors,n.subscriptions.active+=a.subscriptions.active,n.subscriptions.messageHandlers+=a.subscriptions.messageHandlers,n.subscriptions.requestHandlers+=a.subscriptions.requestHandlers,n.subscriptions.rpcHandlers+=a.subscriptions.rpcHandlers}return r>0&&(n.requests.avgResponseTime=i/r),n.requests.perSecond=n.requests.perSecond/t.length,n}}class Yg extends Jg{constructor(e){super("service",e)}async onStart(){console.log("Proxy started")}async onStop(){console.log("Proxy stopped")}}class Xg{constructor(){p(this,"subscriptions",[]);p(this,"additionalSubscriptions",[])}addSubscriptions(...e){this.subscriptions.push(...e)}addAdditionalSubscriptions(...e){this.additionalSubscriptions.push(...e)}unsubscribe(){this.subscriptions.forEach(e=>e.unsubscribe())}unsubscribeAdditional(){this.additionalSubscriptions.forEach(e=>e.unsubscribe())}}function ui(s,e,t=!1){if(s===e)return!0;if((s===void 0||e===void 0||s===null||e===null)&&(s||e))return!1;const n=s==null?void 0:s.constructor.name,r=e==null?void 0:e.constructor.name;if(n!==r)return!1;if(n==="Array"&&r==="Array"){if(s.length!==e.length)return!1;if(t){const i=[...e];return s.every(o=>{const a=i.findIndex(l=>ui(o,l,t));return a!==-1&&(i.splice(a,1),!0)})}{let i=!0;for(let o=0;o<s.length;o++)if(!ui(s[o],e[o],t)){i=!1;break}return i}}if(n==="Object"&&r==="Object"){let i=!0;const o=Object.keys(s),a=Object.keys(e);if(o.length!==a.length)return!1;for(let l=0;l<o.length;l++)if(s[o[l]]&&e[o[l]]){if(s[o[l]]===e[o[l]])continue;if(!s[o[l]]||s[o[l]].constructor.name!=="Array"&&s[o[l]].constructor.name!=="Object"){if(s[o[l]]!==e[o[l]]){i=!1;break}}else if(i=ui(s[o[l]],e[o[l]],t),!i)break}else if(s[o[l]]&&!e[o[l]]||!s[o[l]]&&e[o[l]]){i=!1;break}return i}return s===e}function Ks(s){return JSON.parse(JSON.stringify(s))}var Gt,dd,hd;(function(s){s.MotionSensor="MotionSensor",s.MotionDetector="MotionDetector",s.AudioSensor="AudioSensor",s.ObjectSensor="ObjectSensor",s.ObjectDetector="ObjectDetector",s.Light="Light",s.Siren="Siren",s.Doorbell="Doorbell",s.Battery="Battery",s.PTZ="PTZ",s.PTZZoom="PTZZoom",s.PTZHome="PTZHome",s.PTZPresets="PTZPresets",s.Snapshot="Snapshot",s.StreamUrl="StreamUrl",s.Reboot="Reboot"})(Gt||(Gt={})),function(s){s.Opened="Opened",s.Closed="Closed",s.Jammed="Jammed",s.Unknown="Unknown"}(dd||(dd={})),function(s){s.MotionDetector="MotionDetector",s.ObjectDetector="ObjectDetector",s.AudioDetector="AudioDetector"}(hd||(hd={}));var ev=tn(672),tv=tn.n(ev),Mc=function(s,e){return Mc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},Mc(s,e)};function Br(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=s}Mc(s,e),s.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function sv(s,e,t,n){return new(t||(t=Promise))(function(r,i){function o(u){try{l(n.next(u))}catch(d){i(d)}}function a(u){try{l(n.throw(u))}catch(d){i(d)}}function l(u){var d;u.done?r(u.value):(d=u.value,d instanceof t?d:new t(function(h){h(d)})).then(o,a)}l((n=n.apply(s,[])).next())})}function Em(s,e){var t,n,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return function(d){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(i=0)),i;)try{if(t=1,n&&(r=2&d[0]?n.return:d[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,d[1])).done)return r;switch(n=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return i.label++,{value:d[1],done:!1};case 5:i.label++,n=d[1],d=[0];continue;case 7:d=i.ops.pop(),i.trys.pop();continue;default:if(r=i.trys,!((r=r.length>0&&r[r.length-1])||d[0]!==6&&d[0]!==2)){i=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]<r[3])){i.label=d[1];break}if(d[0]===6&&i.label<r[1]){i.label=r[1],r=d;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(d);break}r[2]&&i.ops.pop(),i.trys.pop();continue}d=e.call(s,i)}catch(h){d=[6,h],n=0}finally{t=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([l,u])}}}function ro(s){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&s[e],n=0;if(t)return t.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&n>=s.length&&(s=void 0),{value:s&&s[n++],done:!s}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function ha(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var n,r,i=t.call(s),o=[];try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(a){r={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(r)throw r.error}}return o}function ma(s,e,t){if(arguments.length===2)for(var n,r=0,i=e.length;r<i;r++)!n&&r in e||(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return s.concat(n||Array.prototype.slice.call(e))}function di(s){return this instanceof di?(this.v=s,this):new di(s)}function nv(s,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,r=t.apply(s,e||[]),i=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",function(h){return function(v){return Promise.resolve(v).then(h,u)}}),n[Symbol.asyncIterator]=function(){return this},n;function o(h,v){r[h]&&(n[h]=function(f){return new Promise(function(b,k){i.push([h,f,b,k])>1||a(h,f)})},v&&(n[h]=v(n[h])))}function a(h,v){try{(function(f){f.value instanceof di?Promise.resolve(f.value.v).then(l,u):d(i[0][2],f)})(r[h](v))}catch(f){d(i[0][3],f)}}function l(h){a("next",h)}function u(h){a("throw",h)}function d(h,v){h(v),i.shift(),i.length&&a(i[0][0],i[0][1])}}function rv(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=s[Symbol.asyncIterator];return t?t.call(s):(s=ro(s),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=s[r]&&function(i){return new Promise(function(o,a){(function(l,u,d,h){Promise.resolve(h).then(function(v){l({value:v,done:d})},u)})(o,a,(i=s[r](i)).done,i.value)})}}}function Is(s){return typeof s=="function"}function Am(s){var e=s(function(t){Error.call(t),t.stack=new Error().stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Ya=Am(function(s){return function(e){s(this),this.message=e?e.length+` errors occurred during unsubscription:
|
|
30
30
|
`+e.map(function(t,n){return n+1+") "+t.toString()}).join(`
|
|
31
|
-
`):"",this.name="UnsubscriptionError",this.errors=e}});function $c(s,e){if(s){var t=s.indexOf(e);0<=t&&s.splice(t,1)}}var Oa=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return s.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var l=ro(a),u=l.next();!u.done;u=l.next())u.value.remove(this)}catch(k){t={error:k}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}else a.remove(this);var d=this.initialTeardown;if(Is(d))try{d()}catch(k){o=k instanceof Ya?k.errors:[k]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var v=ro(h),f=v.next();!f.done;f=v.next()){var b=f.value;try{md(b)}catch(k){o=o??[],k instanceof Ya?o=ma(ma([],ha(o)),ha(k.errors)):o.push(k)}}}catch(k){r={error:k}}finally{try{f&&!f.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}}if(o)throw new Ya(o)}},s.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)md(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},s.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},s.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},s.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&$c(n,t)},s.prototype.remove=function(t){var n=this._finalizers;n&&$c(n,t),t instanceof s&&t._removeParent(this)},s.EMPTY=((e=new s).closed=!0,e),s}(),Mm=Oa.EMPTY;function $m(s){return s instanceof Oa||s&&"closed"in s&&Is(s.remove)&&Is(s.add)&&Is(s.unsubscribe)}function md(s){Is(s)?s():s.unsubscribe()}var iv={Promise:void 0},ov={setTimeout:function(s,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,ma([s,e],ha(t)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function Pm(s){ov.setTimeout(function(){throw s})}function pd(){}function Qo(s){s()}var bl=function(s){function e(t){var n=s.call(this)||this;return n.isStopped=!1,t?(n.destination=t,$m(t)&&t.add(n)):n.destination=cv,n}return Br(e,s),e.create=function(t,n,r){return new io(t,n,r)},e.prototype.next=function(t){this.isStopped?void 0:this._next(t)},e.prototype.error=function(t){this.isStopped?void 0:(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?void 0:(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Oa),av=function(){function s(e){this.partialObserver=e}return s.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){No(n)}},s.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){No(n)}else No(e)},s.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){No(t)}},s}(),io=function(s){function e(t,n,r){var i,o=s.call(this)||this;return Is(t)||!t?i={next:t??void 0,error:n??void 0,complete:r??void 0}:i=t,o.destination=new av(i),o}return Br(e,s),e}(bl);function No(s){Pm(s)}var cv={closed:!0,next:pd,error:function(s){throw s},complete:pd},Pc=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Tm(s){return s}function lv(s){return s.length===0?Tm:s.length===1?s[0]:function(e){return s.reduce(function(t,n){return n(t)},e)}}var or=function(){function s(e){e&&(this._subscribe=e)}return s.prototype.lift=function(e){var t=new s;return t.source=this,t.operator=e,t},s.prototype.subscribe=function(e,t,n){var r,i=this,o=(r=e)&&r instanceof bl||function(a){return a&&Is(a.next)&&Is(a.error)&&Is(a.complete)}(r)&&$m(r)?e:new io(e,t,n);return Qo(function(){var a=i,l=a.operator,u=a.source;o.add(l?l.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},s.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},s.prototype.forEach=function(e,t){var n=this;return new(t=fd(t))(function(r,i){var o=new io({next:function(a){try{e(a)}catch(l){i(l),o.unsubscribe()}},error:i,complete:r});n.subscribe(o)})},s.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},s.prototype[Pc]=function(){return this},s.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return lv(e)(this)},s.prototype.toPromise=function(e){var t=this;return new(e=fd(e))(function(n,r){var i;t.subscribe(function(o){return i=o},function(o){return r(o)},function(){return n(i)})})},s.create=function(e){return new s(e)},s}();function fd(s){var e;return(e=s??iv.Promise)!==null&&e!==void 0?e:Promise}var uv=Am(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Na=function(s){function e(){var t=s.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return Br(e,s),e.prototype.lift=function(t){var n=new gd(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new uv},e.prototype.next=function(t){var n=this;Qo(function(){var r,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=ro(n.currentObservers),a=o.next();!a.done;a=o.next())a.value.next(t)}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}})},e.prototype.error=function(t){var n=this;Qo(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var r=n.observers;r.length;)r.shift().error(t)}})},e.prototype.complete=function(){var t=this;Qo(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,r=this,i=r.hasError,o=r.isStopped,a=r.observers;return i||o?Mm:(this.currentObservers=null,a.push(t),new Oa(function(){n.currentObservers=null,$c(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,r=n.hasError,i=n.thrownError,o=n.isStopped;r?t.error(i):o&&t.complete()},e.prototype.asObservable=function(){var t=new or;return t.source=this,t},e.create=function(t,n){return new gd(t,n)},e}(or),gd=function(s){function e(t,n){var r=s.call(this)||this;return r.destination=t,r.source=n,r}return Br(e,s),e.prototype.next=function(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,t)},e.prototype.error=function(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&r!==void 0?r:Mm},e}(Na),gn=function(s){function e(t){var n=s.call(this)||this;return n._value=t,n}return Br(e,s),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=s.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,r=t.thrownError,i=t._value;if(n)throw r;return this._throwIfClosed(),i},e.prototype.next=function(t){s.prototype.next.call(this,this._value=t)},e}(Na),Rm={now:function(){return(Rm.delegate||Date).now()},delegate:void 0},Fo=function(s){function e(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Rm);var i=s.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return Br(e,s),e.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,l=n._windowTime;r||(i.push(t),!o&&i.push(a.now()+l)),this._trimBuffer(),s.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),r=this._infiniteTimeWindow,i=this._buffer.slice(),o=0;o<i.length&&!t.closed;o+=r?1:2)t.next(i[o]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,r=t._timestampProvider,i=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!o){for(var l=r.now(),u=0,d=1;d<i.length&&i[d]<=l;d+=2)u=d;u&&i.splice(0,u+1)}},e}(Na);function Ri(s){return function(e){if(function(t){return Is(t==null?void 0:t.lift)}(e))return e.lift(function(t){try{return s(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function vi(s,e,t,n,r){return new dv(s,e,t,n,r)}var dv=function(s){function e(t,n,r,i,o,a){var l=s.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=n?function(u){try{n(u)}catch(d){t.error(d)}}:s.prototype._next,l._error=i?function(u){try{i(u)}catch(d){t.error(d)}finally{this.unsubscribe()}}:s.prototype._error,l._complete=r?function(){try{r()}catch(u){t.error(u)}finally{this.unsubscribe()}}:s.prototype._complete,l}return Br(e,s),e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(bl);function Xa(){return Ri(function(s,e){var t,n=!1;s.subscribe(vi(e,function(r){var i=t;t=r,n&&e.next([i,r]),n=!0}))})}function ec(s,e){return Ri(function(t,n){var r=0;t.subscribe(vi(n,function(i){return s.call(e,i,r++)&&n.next(i)}))})}function Tc(s,e){return Ri(function(t,n){var r=0;t.subscribe(vi(n,function(i){n.next(s.call(e,i,r++))}))})}var hv=typeof Symbol=="function"&&Symbol.iterator?Symbol.iterator:"@@iterator";function pa(s){if(s instanceof or)return s;if(s!=null){if(function(o){return Is(o[Pc])}(s))return i=s,new or(function(o){var a=i[Pc]();if(Is(a.subscribe))return a.subscribe(o);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(function(o){return o&&typeof o.length=="number"&&typeof o!="function"}(s))return r=s,new or(function(o){for(var a=0;a<r.length&&!o.closed;a++)o.next(r[a]);o.complete()});if(Is((n=s)==null?void 0:n.then))return t=s,new or(function(o){t.then(function(a){o.closed||(o.next(a),o.complete())},function(a){return o.error(a)}).then(null,Pm)});if(function(o){return Symbol.asyncIterator&&Is(o==null?void 0:o[Symbol.asyncIterator])}(s))return vd(s);if(function(o){return Is(o==null?void 0:o[hv])}(s))return e=s,new or(function(o){var a,l;try{for(var u=ro(e),d=u.next();!d.done;d=u.next()){var h=d.value;if(o.next(h),o.closed)return}}catch(v){a={error:v}}finally{try{d&&!d.done&&(l=u.return)&&l.call(u)}finally{if(a)throw a.error}}o.complete()});if(function(o){return Is(o==null?void 0:o.getReader)}(s))return vd(function(o){return nv(this,arguments,function(){var a,l,u;return Em(this,function(d){switch(d.label){case 0:a=o.getReader(),d.label=1;case 1:d.trys.push([1,,9,10]),d.label=2;case 2:return[4,di(a.read())];case 3:return l=d.sent(),u=l.value,l.done?[4,di(void 0)]:[3,5];case 4:return[2,d.sent()];case 5:return[4,di(u)];case 6:return[4,d.sent()];case 7:return d.sent(),[3,2];case 8:return[3,10];case 9:return a.releaseLock(),[7];case 10:return[2]}})})}(s))}var e,t,n,r,i;throw function(o){return new TypeError("You provided "+(o!==null&&typeof o=="object"?"an invalid object":"'"+o+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(s)}function vd(s){return new or(function(e){(function(t,n){var r,i,o,a;return sv(this,void 0,void 0,function(){var l,u;return Em(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),r=rv(t),d.label=1;case 1:return[4,r.next()];case 2:if((i=d.sent()).done)return[3,4];if(l=i.value,n.next(l),n.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),o={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),i&&!i.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})})(s,e).catch(function(t){return e.error(t)})})}function Lo(s){s===void 0&&(s={});var e=s.connector,t=e===void 0?function(){return new Na}:e,n=s.resetOnError,r=n===void 0||n,i=s.resetOnComplete,o=i===void 0||i,a=s.resetOnRefCountZero,l=a===void 0||a;return function(u){var d,h,v,f=0,b=!1,k=!1,z=function(){h==null||h.unsubscribe(),h=void 0},L=function(){z(),d=v=void 0,b=k=!1},se=function(){var K=d;L(),K==null||K.unsubscribe()};return Ri(function(K,N){f++,k||b||z();var E=v=v??t();N.add(function(){--f!==0||k||b||(h=tc(se,l))}),E.subscribe(N),!d&&f>0&&(d=new io({next:function(O){return E.next(O)},error:function(O){k=!0,z(),h=tc(L,r,O),E.error(O)},complete:function(){b=!0,z(),h=tc(L,o),E.complete()}}),pa(K).subscribe(d))})(u)}}function tc(s,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e!==!0){if(e!==!1){var r=new io({next:function(){r.unsubscribe(),s()}});return pa(e.apply(void 0,ma([],ha(t)))).subscribe(r)}}else s()}function Im(s,e,t){return t===void 0&&(t=1/0),Is(e)?Im(function(n,r){return Tc(function(i,o){return e(n,i,r,o)})(pa(s(n,r)))},t):(typeof e=="number"&&(t=e),Ri(function(n,r){return function(i,o,a,l,u,d,h,v){var f=[],b=0,k=0,z=!1,L=function(){!z||f.length||b||o.complete()},se=function(N){return b<l?K(N):f.push(N)},K=function(N){d&&o.next(N),b++;var E=!1;pa(a(N,k++)).subscribe(vi(o,function(O){u==null||u(O),d?se(O):o.next(O)},function(){E=!0},void 0,function(){if(E)try{b--;for(var O=function(){var U=f.shift();h?function(S,M,B,W,I){W===void 0&&(W=0),I===void 0&&(I=!1);var w=M.schedule(function(){B(),I?S.add(this.schedule(null,W)):this.unsubscribe()},W);S.add(w)}(o,h,function(){return K(U)}):K(U)};f.length&&b<l;)O();L()}catch(U){o.error(U)}}))};return i.subscribe(vi(o,se,function(){z=!0,L()})),function(){v==null||v()}}(n,r,s,t)}))}function mv(s,e){return s===e}const pv=s=>s==="person"?"person":s==="motion"?"motion":new Set(["bird","cat","dog","horse","sheep","cow","elephant","bear","zebra","giraffe","teddy bear"]).has(s)?"animal":new Set(["bicycle","car","motorcycle","airplane","bus","train","truck","boat"]).has(s)?"vehicle":"other";function _d(s){return s.map(e=>({...e,label:pv(e.label)}))}class fv{constructor(e=100){p(this,"cells",new Map);p(this,"cellSize");this.cellSize=e}getCellsForBox(e,t=0){const n=Math.floor((e[0]-t)/this.cellSize),r=Math.floor((e[1]-t)/this.cellSize),i=Math.floor((e[2]+t)/this.cellSize),o=Math.floor((e[3]+t)/this.cellSize),a=[];for(let l=n;l<=i;l++)for(let u=r;u<=o;u++)a.push(`${l},${u}`);return a}insert(e){const t=e.boundingBox,n=this.getCellsForBox(t);for(const r of n)this.cells.has(r)||this.cells.set(r,[]),this.cells.get(r).push(e)}search(e,t=0){const n=this.getCellsForBox(e,t),r=new Set;for(const i of n){const o=this.cells.get(i)??[];for(const a of o)r.add(a)}return Array.from(r)}}function gv(s,e){const t=Math.max(s[0],e[0]),n=Math.max(s[1],e[1]),r=Math.min(s[2],e[2]),i=Math.min(s[3],e[3]);if(r<t||i<n)return 0;const o=(r-t)*(i-n);return o/((s[2]-s[0])*(s[3]-s[1])+(e[2]-e[0])*(e[3]-e[1])-o)}function yd(s){return s[0]<s[2]&&s[1]<s[3]}function bd(s,e=.01,t=100){if(s.length===0)return[];const n=new fv(t),r=new Set,i=[],o=s.map(l=>({...l,id:l.id??Math.random().toString(36).slice(2,9)}));for(const l of o)n.insert(l);for(const l of o){if(r.has(l.id))continue;const u={...l};let d=u.confidence;const h=[u.boundingBox],v=Math.max(t,10),f=n.search(u.boundingBox,v);for(const b of f){if(b.id===u.id||r.has(b.id)||b.label!==u.label)continue;const k=gv(u.boundingBox,b.boundingBox),z=Math.abs(u.boundingBox[0]-b.boundingBox[0])<=t&&Math.abs(u.boundingBox[1]-b.boundingBox[1])<=t;(k>e||z)&&(h.push(b.boundingBox),r.add(b.id),d=Math.max(d,b.confidence))}if(h.length>1){const b=(a=h,[Math.max(0,Math.round(Math.min(...a.map(k=>k[0])))),Math.max(0,Math.round(Math.min(...a.map(k=>k[1])))),Math.min(1e3,Math.round(Math.max(...a.map(k=>k[2])))),Math.min(1e3,Math.round(Math.max(...a.map(k=>k[3]))))]);yd(b)&&(u.boundingBox=b,u.confidence=d)}yd(u.boundingBox)&&i.push(u),r.add(u.id)}var a;return i}function wd(s,e){return[[s[0],s[1]],[s[2],s[1]],[s[2],s[3]],[s[0],s[3]]].every(t=>wl(t,e))}function vv(s,e){const t=[[s[0],s[1]],[s[2],s[1]],[s[2],s[3]],[s[0],s[3]]];return!Om(s,e)&&t.every(n=>!wl(n,e))}function wl(s,e){const[t,n]=s;let r=!1;for(let i=0;i<e.length;i++){const o=(i+1)%e.length,[a,l]=e[i],[u,d]=e[o];if(t>=Math.min(a,u)&&t<=Math.max(a,u)&&n>=Math.min(l,d)&&n<=Math.max(l,d))if(Math.abs(a-u)<1e-6){if(Math.abs(t-a)<1e-6)return!0}else{const h=(d-l)/(u-a),v=h*t+(l-h*a);if(Math.abs(n-v)<1e-6)return!0}l>n!=d>n&&t<(u-a)*(n-l)/(d-l)+a&&(r=!r)}return r}function _v(s,e,t,n){const r=(n[1]-t[1])*(e[0]-s[0])-(n[0]-t[0])*(e[1]-s[1]);if(r===0)return!1;const i=((n[0]-t[0])*(s[1]-t[1])-(n[1]-t[1])*(s[0]-t[0]))/r,o=((e[0]-s[0])*(s[1]-t[1])-(e[1]-s[1])*(s[0]-t[0]))/r;return i>=0&&i<=1&&o>=0&&o<=1}function Om(s,e){const t=[[s[0],s[1]],[s[2],s[1]],[s[2],s[3]],[s[0],s[3]],[s[0],s[1]]];if(t.some(n=>wl(n,e))||e.some(n=>n[0]>=s[0]&&n[0]<=s[2]&&n[1]>=s[1]&&n[1]<=s[3]))return!0;for(let n=0;n<t.length-1;n++)for(let r=0;r<e.length-1;r++)if(_v(t[n],t[n+1],e[r],e[r+1]))return!0;return!1}const xd=(s,e)=>{const{origWidth:t,origHeight:n}=e,r=s.points.map(([a,l])=>[a*t/100,l*n/100]);var i,o;return r.length>0&&(i=r[0],o=r[r.length-1],i[0]!==o[0]||i[1]!==o[1])&&r.push(r[0]),{...s,points:r}},Sd=(s,e,t)=>{if(e.length===0)return[];if(s.length===0)return[];const n=new Set;for(const r of e)r.classes.length>0&&r.classes.forEach(i=>n.add(i));return s.filter(r=>{if(r.confidence<t.object.confidence||!n.has(r.label))return!1;const i=(l=>{const{origWidth:u,origHeight:d,inputWidth:h,inputHeight:v}=l;let[f,b,k,z]=l.boundingBox;return f=f*u/h,b=b*d/v,k=k*u/h,z=z*d/v,f=Math.max(0,Math.min(f,u)),b=Math.max(0,Math.min(b,d)),k=Math.max(0,Math.min(k,u)),z=Math.max(0,Math.min(z,d)),{...l,boundingBox:[f,b,k,z]}})(r);for(const l of e){if(!l.isPrivacyMask)continue;const u=xd(l,i);if(wd(i.boundingBox,u.points))return!1}let o=!1,a=!1;for(const l of e){if(l.isPrivacyMask||!l.classes.includes(r.label))continue;const u=xd(l,i),d=Om(i.boundingBox,u.points),h=wd(i.boundingBox,u.points);if(l.filter==="include"){if(o=!0,l.type==="contain"&&h||l.type==="intersect"&&(d||h)){a=!0;break}}else if(l.type==="contain"){if(!vv(i.boundingBox,u.points))return!1}else if(d||h)return!1}return!o||a})};var tt,Ko,Zo,Go,Wo,Jo,Yo,Xo,Rc,nr,Mn;class yv extends Xg{constructor(t,n){super();Yn(this,tt);p(this,"logger");p(this,"snapshotCache");p(this,"cameraSubject");p(this,"cameraState",new gn(!1));p(this,"frameWorkerState",new gn(!1));p(this,"lightState",new gn(gt(this,tt,Jo).call(this,{state:!1},!0)));p(this,"motionState",new gn(gt(this,tt,Zo).call(this,{detections:[],state:!1},!0)));p(this,"audioState",new gn(gt(this,tt,Ko).call(this,{state:!1,db:0},!0)));p(this,"objectState",new gn(gt(this,tt,Go).call(this,{detections:[]},!0)));p(this,"doorbellState",new gn(gt(this,tt,Wo).call(this,{state:!1},!0)));p(this,"sirenState",new gn(gt(this,tt,Yo).call(this,{state:!1,level:0},!0)));p(this,"batteryState",new gn(gt(this,tt,Xo).call(this,{level:100,charging:!1,lowBattery:!1},!0)));p(this,"capabilities",new gn([]));p(this,"onConnected",gt(this,tt,Mn).call(this,this.cameraState));p(this,"onFrameWorkerConnected",gt(this,tt,Mn).call(this,this.frameWorkerState));p(this,"onLightSwitched",gt(this,tt,Mn).call(this,this.lightState));p(this,"onMotionDetected",gt(this,tt,Mn).call(this,this.motionState));p(this,"onAudioDetected",gt(this,tt,Mn).call(this,this.audioState));p(this,"onObjectDetected",gt(this,tt,Mn).call(this,this.objectState));p(this,"onDoorbellPressed",gt(this,tt,Mn).call(this,this.doorbellState));p(this,"onSirenDetected",gt(this,tt,Mn).call(this,this.sirenState));p(this,"onBatteryChanged",gt(this,tt,Mn).call(this,this.batteryState));this.logger=n,this.cameraSubject=new gn(t),this.snapshotCache=new(tv())({max:100,ttl:1e3*this.snapshotTTL}),t.pluginInfo||this.cameraState.next(!0)}get cameraObject(){return Ks(this.cameraSubject.getValue())}get id(){return this.cameraSubject.getValue()._id}get nativeId(){return this.cameraSubject.getValue().nativeId}get pluginInfo(){return this.cameraSubject.getValue().pluginInfo}get connected(){return this.cameraState.getValue()}get frameWorkerConnected(){return this.frameWorkerState.getValue()}get disabled(){return this.cameraSubject.getValue().disabled}get name(){return this.cameraSubject.getValue().name}get type(){return this.cameraSubject.getValue().type}get info(){return Ks(this.cameraSubject.getValue().info)}get isCloud(){return this.cameraSubject.getValue().isCloud}get hasLight(){return this.hasCapability(Gt.Light)}get hasSiren(){return this.hasCapability(Gt.Siren)}get hasDoorbell(){return this.hasCapability(Gt.Doorbell)}get hasBattery(){return this.hasCapability(Gt.Battery)}get hasAudioDetector(){return this.hasCapability(Gt.AudioSensor)}get hasMotionDetector(){return this.hasCapability(Gt.MotionSensor)||this.hasCapability(Gt.MotionDetector)}get hasObjectDetector(){return this.hasCapability(Gt.ObjectSensor)||this.hasCapability(Gt.ObjectDetector)}get hasPtz(){return this.hasCapability(Gt.PTZ)}get snapshotTTL(){return this.cameraSubject.getValue().snapshotTTL}get detectionZones(){return Ks(this.cameraSubject.getValue().detectionZones)}get detectionSettings(){return Ks(this.cameraSubject.getValue().detectionSettings)}get frameWorkerSettings(){return Ks(this.cameraSubject.getValue().frameWorkerSettings)}get streamSource(){return this.highResolutionSource??this.midResolutionSource??this.lowResolutionSource}get snapshotSource(){return this.sources.find(t=>t.role=="snapshot")??this.sources.find(t=>t.useForSnapshot)}get highResolutionSource(){return this.sources.find(t=>t.role==="high-resolution")}get midResolutionSource(){return this.sources.find(t=>t.role==="mid-resolution")}get lowResolutionSource(){return this.sources.find(t=>t.role==="low-resolution")}get interfaces(){return this.cameraInterfaces}getCapabilities(){return Ks(this.capabilities.getValue().map(t=>t.capabilities).flat())}hasCapability(t){return this.getCapabilities().some(n=>n===t)}getValue(t){switch(t){case"light":return Ks(this.lightState.getValue());case"motion":return Ks(this.motionState.getValue());case"audio":return Ks(this.audioState.getValue());case"object":return Ks(this.objectState.getValue());case"doorbell":return Ks(this.doorbellState.getValue());case"siren":return Ks(this.sirenState.getValue());case"battery":return Ks(this.batteryState.getValue());default:throw new Error(`Unknown state: ${t}`)}}onStateChange(t){return this[`${t}State`].pipe(Xa(),ec(([n,r])=>this.stateChanged(n,r,t)),Tc(([n,r])=>({oldState:n,newState:r})),Lo({connector:()=>new Fo(1)}))}onPropertyChange(t){return this.cameraSubject.pipe(Xa(),Im(([n,r])=>(Array.isArray(t)?t:[t]).map(i=>({property:i,oldData:n[i],newData:r[i]}))),ec(({oldData:n,newData:r})=>!ui(n,r,!0)),Lo({connector:()=>new Fo(1)}))}onCapabilitiesChange(){return this.capabilities.pipe(Xa(),ec(([t,n])=>!ui(t,n,!0)),Tc(([t,n])=>({oldCapabilities:t.map(r=>r.capabilities).flat(),newCapabilities:n.map(r=>r.capabilities).flat()})),Lo({connector:()=>new Fo(1)}))}removeAllListeners(){this.lightState.complete(),this.motionState.complete(),this.audioState.complete(),this.objectState.complete(),this.doorbellState.complete(),this.sirenState.complete(),this.batteryState.complete(),this.cameraSubject.complete(),this.cameraState.complete(),this.frameWorkerState.complete(),this.capabilities.complete(),this.snapshotCache.clear()}updateCamera(t){t.snapshotTTL!==this.snapshotTTL&&this.snapshotCache.clear(),this.cameraSubject.next(t)}updateCameraState(t){this.cameraState.next(t)}updateFrameWorkerState(t){this.frameWorkerState.next(t)}updateCapabilities(t){this.capabilities.next(t)}updateStateInternal(t,n,r,i){let o,a=!1;if(r)a=!0,o=n;else{const l=this.checkStateInternal(t,n,i);a=l.changed,o=l.event}if(a)switch(t){case"light":this.lightState.next(gt(this,tt,Jo).call(this,o));break;case"motion":this.motionState.next(gt(this,tt,Zo).call(this,o));break;case"audio":this.audioState.next(gt(this,tt,Ko).call(this,o));break;case"object":this.objectState.next(gt(this,tt,Go).call(this,o));break;case"doorbell":this.doorbellState.next(gt(this,tt,Wo).call(this,o));break;case"siren":this.sirenState.next(gt(this,tt,Yo).call(this,o));break;case"battery":this.batteryState.next(gt(this,tt,Xo).call(this,o))}}checkStateInternal(t,n,r){let i,o=!1;switch(t){case"audio":const a=n;i=gt(this,tt,Ko).call(this,a),o=this.stateChanged(this.getValue("audio"),i,"audio");break;case"light":const l=n;i=gt(this,tt,Jo).call(this,l),o=this.stateChanged(this.getValue("light"),i,"light");break;case"motion":const u=n;if(u.state||(u.detections=[]),!r&&u.detections){const b=u.detections.length>0;u.detections=_d(u.detections),u.detections=bd(u.detections),u.detections=Sd(u.detections,this.detectionZones,this.detectionSettings),b&&u.detections.length===0&&(u.state=!1)}i=gt(this,tt,Zo).call(this,u),o=this.stateChanged(this.getValue("motion"),i,"motion");break;case"object":const d=n;r||(d.detections=_d(d.detections),d.detections=bd(d.detections),d.detections=Sd(d.detections,this.detectionZones,this.detectionSettings)),i=gt(this,tt,Go).call(this,d),o=this.stateChanged(this.getValue("object"),i,"object");break;case"doorbell":const h=n;i=gt(this,tt,Wo).call(this,h),o=this.stateChanged(this.getValue("doorbell"),i,"doorbell");break;case"siren":const v=n;i=gt(this,tt,Yo).call(this,v),o=this.stateChanged(this.getValue("siren"),i,"siren");break;case"battery":const f=n;i=gt(this,tt,Xo).call(this,f),o=this.stateChanged(this.getValue("battery"),i,"battery");break;default:throw new Error(`Unknown state: ${t}`)}return{changed:o,event:i}}stateChanged(t,n,r){return t===void 0||n===void 0||r===void 0||r==="audio"&&!this.hasAudioDetector||r==="motion"&&!this.hasMotionDetector||r==="object"&&!this.hasObjectDetector||r==="siren"&&!this.hasSiren||r==="battery"&&!this.hasBattery||r==="doorbell"&&!this.hasDoorbell||r==="light"&&!this.hasLight?!1:!ui(gt(this,tt,Rc).call(this,t),gt(this,tt,Rc).call(this,n),!0)}}tt=new WeakSet,Ko=function(t,n=!1){let r,i;if(n||(r=this.getValue("audio"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t))i=t;else{const o={...t,timestamp:Date.now()};i={...o,db:o.db??(r==null?void 0:r.db)??0,lastEvent:r}}return i},Zo=function(t,n=!1){let r,i;return n||(r=this.getValue("motion"),r!=null&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Go=function(t,n=!1){let r,i;return n||(r=this.getValue("object"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Wo=function(t,n=!1){let r,i;return n||(r=this.getValue("doorbell"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Jo=function(t,n=!1){let r,i;return n||(r=this.getValue("light"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Yo=function(t,n=!1){let r,i;if(n||(r=this.getValue("siren"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t))i=t;else{const o={...t,timestamp:Date.now()};i={...o,level:o.level??(r==null?void 0:r.level)??0,lastEvent:r}}return i},Xo=function(t,n=!1){let r,i;return n||(r=this.getValue("battery"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),charging:t.charging??(r==null?void 0:r.charging)??!1,lowBattery:t.lowBattery??(r==null?void 0:r.lowBattery)??!1,lastEvent:r},i},Rc=function(t){const n=Ks(t);return"timestamp"in n&&delete n.timestamp,"lastEvent"in n&&delete n.lastEvent,n},nr=function(t){return"timestamp"in t},Mn=function(t){return t.pipe((r===void 0&&(r=Tm),n=n??mv,Ri(function(i,o){var a,l=!0;i.subscribe(vi(o,function(u){var d=r(u);!l&&n(a,d)||(l=!1,a=d,o.next(u))}))})),Lo({connector:()=>new Fo(1)}));var n,r};class oo{static coreManagerNamespaces(){return{coreManagerSubject:"coreManager.subscriber",coreManagerRpc:"coreManager.rpc"}}static deviceManagerNamespaces(){return{deviceManagerSubject:"deviceManager.subscriber",deviceManagerRpc:"deviceManager.rpc"}}static frameWorkerNamespaces(e){return{frameWorkerChildRpc:`camera.${e}.frameWorker.child.rpc`,frameWorkerChild:`camera.${e}.frameWorker.child`}}static pluginNamespaces(e){return{pluginDeviceManagerSubject:`plugin.${e}.deviceManager.subscriber`,pluginChildRpc:`plugin.${e}.child.rpc`,pluginChild:`plugin.${e}.child`,pluginStorageRpc:`plugin.${e}.storage.rpc`}}static cameraNamespaces(e){return{cameraSubject:`camera.${e}.subscriber`,cameraMotionFrameSubject:`camera.${e}.motionFrame.subscriber`,cameraControllerRpc:`camera.${e}.controller.rpc`}}static pluginCameraNamespaces(e,t){return{cameraInterfacesRpc:`plugin.${e}.camera.${t}.cameraInterfaces.rpc`,cameraStorageRpc:`plugin.${e}.camera.${t}.cameraStorage.rpc`}}}var sc=function(s,e,t,n){var r,i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},jn=function(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)},ho,Mr,mo,po,$r,hi,ta;class ea{constructor(e,t,n,r){Yn(this,hi);p(this,"interfaces");Yn(this,ho);Yn(this,Mr);Yn(this,mo);Yn(this,po);Yn(this,$r,[]);Zr(this,ho,e),Zr(this,Mr,t),Zr(this,mo,n),Zr(this,po,r)}async streamUrl(e){const t=An(this,Mr).getValue().find(n=>n.capabilities.some(r=>r===Gt.StreamUrl));if(!t)throw new Error("No capability found for streamUrl");return this.interfaces&&"streamUrl"in this.interfaces?this.interfaces.streamUrl(e):(await gt(this,hi,ta).call(this,t.pluginId)).streamUrl(e)}async snapshot(e,t){const n=An(this,Mr).getValue().find(r=>r.capabilities.some(i=>i===Gt.Snapshot));if(!n)throw new Error("No capability found for snapshot");return this.interfaces&&"snapshot"in this.interfaces?this.interfaces.snapshot(e,t):(await gt(this,hi,ta).call(this,n.pluginId)).snapshot(e,t)}async ptzCommand(e){const t=An(this,Mr).getValue().find(n=>n.capabilities.some(r=>r===Gt.PTZ));if(!t)throw new Error("No capability found for PTZ");return this.interfaces&&"ptzCommand"in this.interfaces?this.interfaces.ptzCommand(e):(await gt(this,hi,ta).call(this,t.pluginId)).ptzCommand(e)}async disconnect(){await Promise.allSettled(An(this,$r).map(e=>e.connection.disconnect())),Zr(this,$r,[])}}ho=new WeakMap,Mr=new WeakMap,mo=new WeakMap,po=new WeakMap,$r=new WeakMap,hi=new WeakSet,ta=async function(e){var r;if(e===((r=An(this,po))==null?void 0:r.id))throw new Error("Can not create camera proxy for the same plugin");const t=oo.pluginCameraNamespaces(e,An(this,mo)).cameraInterfacesRpc,n=await An(this,ho).createRPCConnection(t);return An(this,$r).some(i=>i.namespace===t)||An(this,$r).push({namespace:t,connection:n}),n.createProxy()};sc([Ja({public:!0}),jn("design:type",Function),jn("design:paramtypes",[String]),jn("design:returntype",Promise)],ea.prototype,"streamUrl",null),sc([Ja({public:!0}),jn("design:type",Function),jn("design:paramtypes",[String,Boolean]),jn("design:returntype",Promise)],ea.prototype,"snapshot",null),sc([Ja({public:!0}),jn("design:type",Function),jn("design:paramtypes",[Object]),jn("design:returntype",Promise)],ea.prototype,"ptzCommand",null);const Cd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let nc;const bv=new Uint8Array(16),Ps=[];for(let s=0;s<256;++s)Ps.push((s+256).toString(16).slice(1));function wv(s,e=0){return(Ps[s[e+0]]+Ps[s[e+1]]+Ps[s[e+2]]+Ps[s[e+3]]+"-"+Ps[s[e+4]]+Ps[s[e+5]]+"-"+Ps[s[e+6]]+Ps[s[e+7]]+"-"+Ps[s[e+8]]+Ps[s[e+9]]+"-"+Ps[s[e+10]]+Ps[s[e+11]]+Ps[s[e+12]]+Ps[s[e+13]]+Ps[s[e+14]]+Ps[s[e+15]]).toLowerCase()}const mn=function(s,e,t){var r;if(Cd.randomUUID&&!s)return Cd.randomUUID();const n=(s=s||{}).random??((r=s.rng)==null?void 0:r.call(s))??function(){if(!nc){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");nc=crypto.getRandomValues.bind(crypto)}return nc(bv)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,wv(n)};var Dt,kd;(function(s){s.assertEqual=e=>e,s.assertIs=function(e){},s.assertNever=function(e){throw new Error},s.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},s.getValidEnumValues=e=>{const t=s.objectKeys(e).filter(r=>typeof e[e[r]]!="number"),n={};for(const r of t)n[r]=e[r];return s.objectValues(n)},s.objectValues=e=>s.objectKeys(e).map(function(t){return e[t]}),s.objectKeys=typeof Object.keys=="function"?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},s.find=(e,t)=>{for(const n of e)if(t(n))return n},s.isInteger=typeof Number.isInteger=="function"?e=>Number.isInteger(e):e=>typeof e=="number"&&isFinite(e)&&Math.floor(e)===e,s.joinValues=function(e,t=" | "){return e.map(n=>typeof n=="string"?`'${n}'`:n).join(t)},s.jsonStringifyReplacer=(e,t)=>typeof t=="bigint"?t.toString():t})(Dt||(Dt={})),function(s){s.mergeShapes=(e,t)=>({...e,...t})}(kd||(kd={}));const Ze=Dt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ir=s=>{switch(typeof s){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return isNaN(s)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(s)?Ze.array:s===null?Ze.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?Ze.promise:typeof Map<"u"&&s instanceof Map?Ze.map:typeof Set<"u"&&s instanceof Set?Ze.set:typeof Date<"u"&&s instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}},$e=Dt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Gn extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},n={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let a=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(this),n}static assert(e){if(!(e instanceof Gn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Dt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Gn.create=s=>new Gn(s);const Ic=(s,e)=>{let t;switch(s.code){case $e.invalid_type:t=s.received===Ze.undefined?"Required":`Expected ${s.expected}, received ${s.received}`;break;case $e.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,Dt.jsonStringifyReplacer)}`;break;case $e.unrecognized_keys:t=`Unrecognized key(s) in object: ${Dt.joinValues(s.keys,", ")}`;break;case $e.invalid_union:t="Invalid input";break;case $e.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Dt.joinValues(s.options)}`;break;case $e.invalid_enum_value:t=`Invalid enum value. Expected ${Dt.joinValues(s.options)}, received '${s.received}'`;break;case $e.invalid_arguments:t="Invalid function arguments";break;case $e.invalid_return_type:t="Invalid function return type";break;case $e.invalid_date:t="Invalid date";break;case $e.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:Dt.assertNever(s.validation):t=s.validation!=="regex"?`Invalid ${s.validation}`:"Invalid";break;case $e.too_small:t=s.type==="array"?`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:"Invalid input";break;case $e.too_big:t=s.type==="array"?`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:"Invalid input";break;case $e.custom:t="Invalid input";break;case $e.invalid_intersection_types:t="Intersection results could not be merged";break;case $e.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case $e.not_finite:t="Number must be finite";break;default:t=e.defaultError,Dt.assertNever(s)}return{message:t}};let xv=Ic;function Sv(){return xv}const Cv=s=>{const{data:e,path:t,errorMaps:n,issueData:r}=s,i=[...t,...r.path||[]],o={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:e,defaultError:a}).message;return{...r,path:i,message:a}};function De(s,e){const t=Sv(),n=Cv({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===Ic?void 0:Ic].filter(r=>!!r)});s.common.issues.push(n)}class Qs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return vt;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const i=await r.key,o=await r.value;n.push({key:i,value:o})}return Qs.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:i,value:o}=r;if(i.status==="aborted"||o.status==="aborted")return vt;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value==="__proto__"||o.value===void 0&&!r.alwaysSet||(n[i.value]=o.value)}return{status:e.value,value:n}}}const vt=Object.freeze({status:"aborted"}),Oc=s=>({status:"dirty",value:s}),pn=s=>({status:"valid",value:s}),Ed=s=>s.status==="aborted",Ad=s=>s.status==="dirty",_i=s=>s.status==="valid",fa=s=>typeof Promise<"u"&&s instanceof Promise;function ga(s,e,t,n){if(typeof e=="function"?s!==e||!0:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(s)}function Nm(s,e,t,n,r){if(typeof e=="function"?s!==e||!0:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(s,t),t}var Je,Ki,Zi;typeof SuppressedError=="function"&&SuppressedError,function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message}(Je||(Je={}));class Nn{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Md=(s,e)=>{if(_i(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Gn(s.common.issues);return this._error=t,this._error}}};function Ct(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=s;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>{var a,l;const{message:u}=s;return i.code==="invalid_enum_value"?{message:u??o.defaultError}:o.data===void 0?{message:(a=u??n)!==null&&a!==void 0?a:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(l=u??t)!==null&&l!==void 0?l:o.defaultError}},description:r}}class Rt{get description(){return this._def.description}_getType(e){return ir(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Qs,ctx:{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(fa(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0&&n,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Md(r,i)}"~validate"(e){var t,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return _i(i)?{value:i.value}:{issues:r.common.issues}}catch(i){!((n=(t=i==null?void 0:i.message)===null||t===void 0?void 0:t.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>_i(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(fa(r)?r:Promise.resolve(r));return Md(n,i)}refine(e,t){const n=r=>typeof t=="string"||t===void 0?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,i)=>{const o=e(r),a=()=>i.addIssue({code:$e.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>!!l||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new si({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return gr.create(this,this._def)}nullable(){return wi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return On.create(this)}promise(){return ba.create(this,this._def)}or(e){return _a.create([this,e],this._def)}and(e){return ya.create(this,e,this._def)}transform(e){return new si({...Ct(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new jc({...Ct(this._def),innerType:this,defaultValue:t,typeName:dt.ZodDefault})}brand(){return new Vv({typeName:dt.ZodBranded,type:this,...Ct(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new qc({...Ct(this._def),innerType:this,catchValue:t,typeName:dt.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Sl.create(this,e)}readonly(){return Dc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kv=/^c[^\s-]{8,}$/i,Ev=/^[0-9a-z]+$/,Av=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$v=/^[a-z0-9_-]{21}$/i,Pv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Rv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let rc;const Iv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ov=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Nv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qv=new RegExp(`^${Fm}$`);function Lm(s){let e="[0-5]\\d";return s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s.precision?"+":"?"}`}function Dv(s){let e=`${Fm}T${Lm(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Bv(s,e){if(!Pv.test(s))return!1;try{const[t]=s.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return typeof r=="object"&&r!==null&&!(!r.typ||!r.alg)&&(!e||r.alg===e)}catch{return!1}}function zv(s,e){return!(e!=="v4"&&e||!Ov.test(s))||!(e!=="v6"&&e||!Fv.test(s))}class Vn extends Rt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ze.string){const o=this._getOrReturnCtx(e);return De(o,{code:$e.invalid_type,expected:Ze.string,received:o.parsedType}),vt}const t=new Qs;let n;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,l=e.data.length<o.value;(a||l)&&(n=this._getOrReturnCtx(e,n),a?De(n,{code:$e.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&De(n,{code:$e.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),t.dirty())}else if(o.kind==="email")Rv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"email",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="emoji")rc||(rc=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),rc.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"emoji",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="uuid")Mv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"uuid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="nanoid")$v.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"nanoid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="cuid")kv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"cuid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="cuid2")Ev.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"cuid2",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="ulid")Av.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"ulid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),De(n,{validation:"url",code:$e.invalid_string,message:o.message}),t.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"regex",code:$e.invalid_string,message:o.message}),t.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),t.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:{startsWith:o.value},message:o.message}),t.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:{endsWith:o.value},message:o.message}),t.dirty()):o.kind==="datetime"?Dv(o).test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:"datetime",message:o.message}),t.dirty()):o.kind==="date"?qv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:"date",message:o.message}),t.dirty()):o.kind==="time"?new RegExp(`^${Lm(o)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:"time",message:o.message}),t.dirty()):o.kind==="duration"?Tv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"duration",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="ip"?(r=e.data,((i=o.version)!=="v4"&&i||!Iv.test(r))&&(i!=="v6"&&i||!Nv.test(r))&&(n=this._getOrReturnCtx(e,n),De(n,{validation:"ip",code:$e.invalid_string,message:o.message}),t.dirty())):o.kind==="jwt"?Bv(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"jwt",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="cidr"?zv(e.data,o.version)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"cidr",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64"?Lv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"base64",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64url"?jv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"base64url",code:$e.invalid_string,message:o.message}),t.dirty()):Dt.assertNever(o);var r,i;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:$e.invalid_string,...Je.errToObj(n)})}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Je.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Je.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Je.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Je.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Je.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Je.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Je.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Je.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Je.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Je.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Je.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Je.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Je.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0&&t,local:(n=e==null?void 0:e.local)!==null&&n!==void 0&&n,...Je.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,...Je.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Je.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Je.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Je.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Je.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Je.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Je.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Je.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Je.errToObj(t)})}nonempty(e){return this.min(1,Je.errToObj(e))}trim(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}function Uv(s,e){const t=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n;return parseInt(s.toFixed(r).replace(".",""))%parseInt(e.toFixed(r).replace(".",""))/Math.pow(10,r)}Vn.create=s=>{var e;return new Vn({checks:[],typeName:dt.ZodString,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Ct(s)})};class yi extends Rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ze.number){const r=this._getOrReturnCtx(e);return De(r,{code:$e.invalid_type,expected:Ze.number,received:r.parsedType}),vt}let t;const n=new Qs;for(const r of this._def.checks)r.kind==="int"?Dt.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),De(t,{code:$e.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?Uv(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),De(t,{code:$e.not_finite,message:r.message}),n.dirty()):Dt.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Je.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Je.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Je.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Je.toString(t))}setLimit(e,t,n,r){return new yi({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Je.toString(r)}]})}_addCheck(e){return new yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Je.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Je.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Dt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}yi.create=s=>new yi({checks:[],typeName:dt.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...Ct(s)});class ao extends Rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ze.bigint)return this._getInvalidInput(e);let t;const n=new Qs;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Dt.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.bigint,received:t.parsedType}),vt}gte(e,t){return this.setLimit("min",e,!0,Je.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Je.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Je.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Je.toString(t))}setLimit(e,t,n,r){return new ao({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Je.toString(r)}]})}_addCheck(e){return new ao({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ao.create=s=>{var e;return new ao({checks:[],typeName:dt.ZodBigInt,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Ct(s)})};class Nc extends Rt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ze.boolean){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.boolean,received:t.parsedType}),vt}return pn(e.data)}}Nc.create=s=>new Nc({typeName:dt.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...Ct(s)});class va extends Rt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ze.date){const r=this._getOrReturnCtx(e);return De(r,{code:$e.invalid_type,expected:Ze.date,received:r.parsedType}),vt}if(isNaN(e.data.getTime()))return De(this._getOrReturnCtx(e),{code:$e.invalid_date}),vt;const t=new Qs;let n;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Dt.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new va({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Je.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Je.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}va.create=s=>new va({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:dt.ZodDate,...Ct(s)});class $d extends Rt{_parse(e){if(this._getType(e)!==Ze.symbol){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.symbol,received:t.parsedType}),vt}return pn(e.data)}}$d.create=s=>new $d({typeName:dt.ZodSymbol,...Ct(s)});class Pd extends Rt{_parse(e){if(this._getType(e)!==Ze.undefined){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.undefined,received:t.parsedType}),vt}return pn(e.data)}}Pd.create=s=>new Pd({typeName:dt.ZodUndefined,...Ct(s)});class Td extends Rt{_parse(e){if(this._getType(e)!==Ze.null){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.null,received:t.parsedType}),vt}return pn(e.data)}}Td.create=s=>new Td({typeName:dt.ZodNull,...Ct(s)});class co extends Rt{constructor(){super(...arguments),this._any=!0}_parse(e){return pn(e.data)}}co.create=s=>new co({typeName:dt.ZodAny,...Ct(s)});class Rd extends Rt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pn(e.data)}}Rd.create=s=>new Rd({typeName:dt.ZodUnknown,...Ct(s)});class fr extends Rt{_parse(e){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.never,received:t.parsedType}),vt}}fr.create=s=>new fr({typeName:dt.ZodNever,...Ct(s)});class Id extends Rt{_parse(e){if(this._getType(e)!==Ze.undefined){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.void,received:t.parsedType}),vt}return pn(e.data)}}Id.create=s=>new Id({typeName:dt.ZodVoid,...Ct(s)});class On extends Rt{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Ze.array)return De(t,{code:$e.invalid_type,expected:Ze.array,received:t.parsedType}),vt;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(o||a)&&(De(t,{code:o?$e.too_big:$e.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(De(t,{code:$e.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(De(t,{code:$e.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>r.type._parseAsync(new Nn(t,o,t.path,a)))).then(o=>Qs.mergeArray(n,o));const i=[...t.data].map((o,a)=>r.type._parseSync(new Nn(t,o,t.path,a)));return Qs.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new On({...this._def,minLength:{value:e,message:Je.toString(t)}})}max(e,t){return new On({...this._def,maxLength:{value:e,message:Je.toString(t)}})}length(e,t){return new On({...this._def,exactLength:{value:e,message:Je.toString(t)}})}nonempty(e){return this.min(1,e)}}function Xr(s){if(s instanceof _s){const e={};for(const t in s.shape){const n=s.shape[t];e[t]=gr.create(Xr(n))}return new _s({...s._def,shape:()=>e})}return s instanceof On?new On({...s._def,type:Xr(s.element)}):s instanceof gr?gr.create(Xr(s.unwrap())):s instanceof wi?wi.create(Xr(s.unwrap())):s instanceof Nr?Nr.create(s.items.map(e=>Xr(e))):s}On.create=(s,e)=>new On({type:s,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...Ct(e)});class _s extends Rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Dt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Ze.object){const l=this._getOrReturnCtx(e);return De(l,{code:$e.invalid_type,expected:Ze.object,received:l.parsedType}),vt}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof fr&&this._def.unknownKeys==="strip"))for(const l in n.data)i.includes(l)||o.push(l);const a=[];for(const l of i){const u=r[l],d=n.data[l];a.push({key:{status:"valid",value:l},value:u._parse(new Nn(n,d,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof fr){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of o)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(l==="strict")o.length>0&&(De(n,{code:$e.unrecognized_keys,keys:o}),t.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of o){const d=n.data[u];a.push({key:{status:"valid",value:u},value:l._parse(new Nn(n,d,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of a){const d=await u.key,h=await u.value;l.push({key:d,value:h,alwaysSet:u.alwaysSet})}return l}).then(l=>Qs.mergeObjectSync(t,l)):Qs.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Je.errToObj,new _s({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var r,i,o,a;const l=(o=(i=(r=this._def).errorMap)===null||i===void 0?void 0:i.call(r,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(a=Je.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new _s({...this._def,unknownKeys:"strip"})}passthrough(){return new _s({...this._def,unknownKeys:"passthrough"})}extend(e){return new _s({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _s({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:dt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _s({...this._def,catchall:e})}pick(e){const t={};return Dt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new _s({...this._def,shape:()=>t})}omit(e){const t={};return Dt.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new _s({...this._def,shape:()=>t})}deepPartial(){return Xr(this)}partial(e){const t={};return Dt.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}),new _s({...this._def,shape:()=>t})}required(e){const t={};return Dt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof gr;)r=r._def.innerType;t[n]=r}}),new _s({...this._def,shape:()=>t})}keyof(){return jm(Dt.objectKeys(this.shape))}}_s.create=(s,e)=>new _s({shape:()=>s,unknownKeys:"strip",catchall:fr.create(),typeName:dt.ZodObject,...Ct(e)}),_s.strictCreate=(s,e)=>new _s({shape:()=>s,unknownKeys:"strict",catchall:fr.create(),typeName:dt.ZodObject,...Ct(e)}),_s.lazycreate=(s,e)=>new _s({shape:s,unknownKeys:"strip",catchall:fr.create(),typeName:dt.ZodObject,...Ct(e)});class _a extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async r=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(function(r){for(const o of r)if(o.result.status==="valid")return o.result;for(const o of r)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=r.map(o=>new Gn(o.ctx.common.issues));return De(t,{code:$e.invalid_union,unionErrors:i}),vt});{let r;const i=[];for(const a of n){const l={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status!=="dirty"||r||(r={result:u,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const o=i.map(a=>new Gn(a));return De(t,{code:$e.invalid_union,unionErrors:o}),vt}}get options(){return this._def.options}}_a.create=(s,e)=>new _a({options:s,typeName:dt.ZodUnion,...Ct(e)});function Fc(s,e){const t=ir(s),n=ir(e);if(s===e)return{valid:!0,data:s};if(t===Ze.object&&n===Ze.object){const r=Dt.objectKeys(e),i=Dt.objectKeys(s).filter(a=>r.indexOf(a)!==-1),o={...s,...e};for(const a of i){const l=Fc(s[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}if(t===Ze.array&&n===Ze.array){if(s.length!==e.length)return{valid:!1};const r=[];for(let i=0;i<s.length;i++){const o=Fc(s[i],e[i]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return t===Ze.date&&n===Ze.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class ya extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(i,o)=>{if(Ed(i)||Ed(o))return vt;const a=Fc(i.value,o.value);return a.valid?((Ad(i)||Ad(o))&&t.dirty(),{status:t.value,value:a.data}):(De(n,{code:$e.invalid_intersection_types}),vt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>r(i,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ya.create=(s,e,t)=>new ya({left:s,right:e,typeName:dt.ZodIntersection,...Ct(t)});class Nr extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.array)return De(n,{code:$e.invalid_type,expected:Ze.array,received:n.parsedType}),vt;if(n.data.length<this._def.items.length)return De(n,{code:$e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&n.data.length>this._def.items.length&&(De(n,{code:$e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((i,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Nn(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(r).then(i=>Qs.mergeArray(t,i)):Qs.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Nr({...this._def,rest:e})}}Nr.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nr({items:s,typeName:dt.ZodTuple,rest:null,...Ct(e)})};class xl extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.object)return De(n,{code:$e.invalid_type,expected:Ze.object,received:n.parsedType}),vt;const r=[],i=this._def.keyType,o=this._def.valueType;for(const a in n.data)r.push({key:i._parse(new Nn(n,a,n.path,a)),value:o._parse(new Nn(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Qs.mergeObjectAsync(t,r):Qs.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new xl(t instanceof Rt?{keyType:e,valueType:t,typeName:dt.ZodRecord,...Ct(n)}:{keyType:Vn.create(),valueType:e,typeName:dt.ZodRecord,...Ct(t)})}}class Od extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.map)return De(n,{code:$e.invalid_type,expected:Ze.map,received:n.parsedType}),vt;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:r._parse(new Nn(n,a,n.path,[u,"key"])),value:i._parse(new Nn(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return vt;u.status!=="dirty"&&d.status!=="dirty"||t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}})}{const a=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return vt;u.status!=="dirty"&&d.status!=="dirty"||t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}}}}Od.create=(s,e,t)=>new Od({valueType:e,keyType:s,typeName:dt.ZodMap,...Ct(t)});class lo extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.set)return De(n,{code:$e.invalid_type,expected:Ze.set,received:n.parsedType}),vt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(De(n,{code:$e.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(De(n,{code:$e.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return vt;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const a=[...n.data.values()].map((l,u)=>i._parse(new Nn(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,t){return new lo({...this._def,minSize:{value:e,message:Je.toString(t)}})}max(e,t){return new lo({...this._def,maxSize:{value:e,message:Je.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}lo.create=(s,e)=>new lo({valueType:s,minSize:null,maxSize:null,typeName:dt.ZodSet,...Ct(e)});class Nd extends Rt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Nd.create=(s,e)=>new Nd({getter:s,typeName:dt.ZodLazy,...Ct(e)});class Lc extends Rt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return De(t,{received:t.data,code:$e.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function jm(s,e){return new bi({values:s,typeName:dt.ZodEnum,...Ct(e)})}Lc.create=(s,e)=>new Lc({value:s,typeName:dt.ZodLiteral,...Ct(e)});class bi extends Rt{constructor(){super(...arguments),Ki.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return De(t,{expected:Dt.joinValues(n),received:t.parsedType,code:$e.invalid_type}),vt}if(ga(this,Ki)||Nm(this,Ki,new Set(this._def.values)),!ga(this,Ki).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return De(t,{received:t.data,code:$e.invalid_enum_value,options:n}),vt}return pn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return bi.create(e,{...this._def,...t})}exclude(e,t=this._def){return bi.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Ki=new WeakMap,bi.create=jm;class Fd extends Rt{constructor(){super(...arguments),Zi.set(this,void 0)}_parse(e){const t=Dt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Ze.string&&n.parsedType!==Ze.number){const r=Dt.objectValues(t);return De(n,{expected:Dt.joinValues(r),received:n.parsedType,code:$e.invalid_type}),vt}if(ga(this,Zi)||Nm(this,Zi,new Set(Dt.getValidEnumValues(this._def.values))),!ga(this,Zi).has(e.data)){const r=Dt.objectValues(t);return De(n,{received:n.data,code:$e.invalid_enum_value,options:r}),vt}return pn(e.data)}get enum(){return this._def.values}}Zi=new WeakMap,Fd.create=(s,e)=>new Fd({values:s,typeName:dt.ZodNativeEnum,...Ct(e)});class ba extends Rt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.promise&&t.common.async===!1)return De(t,{code:$e.invalid_type,expected:Ze.promise,received:t.parsedType}),vt;const n=t.parsedType===Ze.promise?t.data:Promise.resolve(t.data);return pn(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ba.create=(s,e)=>new ba({type:s,typeName:dt.ZodPromise,...Ct(e)});class si extends Rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:o=>{De(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){const o=r.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return vt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?vt:l.status==="dirty"||t.value==="dirty"?Oc(l.value):l});{if(t.value==="aborted")return vt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?vt:a.status==="dirty"||t.value==="dirty"?Oc(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?vt:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?vt:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform"){if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!_i(o))return o;const a=r.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>_i(o)?Promise.resolve(r.transform(o.value,i)).then(a=>({status:t.value,value:a})):o)}Dt.assertNever(r)}}si.create=(s,e,t)=>new si({schema:s,typeName:dt.ZodEffects,effect:e,...Ct(t)}),si.createWithPreprocess=(s,e,t)=>new si({schema:e,effect:{type:"preprocess",transform:s},typeName:dt.ZodEffects,...Ct(t)});class gr extends Rt{_parse(e){return this._getType(e)===Ze.undefined?pn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}gr.create=(s,e)=>new gr({innerType:s,typeName:dt.ZodOptional,...Ct(e)});class wi extends Rt{_parse(e){return this._getType(e)===Ze.null?pn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wi.create=(s,e)=>new wi({innerType:s,typeName:dt.ZodNullable,...Ct(e)});class jc extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Ze.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}jc.create=(s,e)=>new jc({innerType:s,typeName:dt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ct(e)});class qc extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return fa(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Gn(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Gn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}qc.create=(s,e)=>new qc({innerType:s,typeName:dt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ct(e)});class Ld extends Rt{_parse(e){if(this._getType(e)!==Ze.nan){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.nan,received:t.parsedType}),vt}return{status:"valid",value:e.data}}}Ld.create=s=>new Ld({typeName:dt.ZodNaN,...Ct(s)});class Vv extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Sl extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?vt:r.status==="dirty"?(t.dirty(),Oc(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?vt:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new Sl({in:e,out:t,typeName:dt.ZodPipeline})}}class Dc extends Rt{_parse(e){const t=this._def.innerType._parse(e),n=r=>(_i(r)&&(r.value=Object.freeze(r.value)),r);return fa(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}}function jd(s,e){const t=typeof s=="function"?s(e):typeof s=="string"?{message:s}:s;return typeof t=="string"?{message:t}:t}function qn(s,e={},t){return s?co.create().superRefine((n,r)=>{var i,o;const a=s(n);if(a instanceof Promise)return a.then(l=>{var u,d;if(!l){const h=jd(e,n),v=(d=(u=h.fatal)!==null&&u!==void 0?u:t)===null||d===void 0||d;r.addIssue({code:"custom",...h,fatal:v})}});if(!a){const l=jd(e,n),u=(o=(i=l.fatal)!==null&&i!==void 0?i:t)===null||o===void 0||o;r.addIssue({code:"custom",...l,fatal:u})}}):co.create()}Dc.create=(s,e)=>new Dc({innerType:s,typeName:dt.ZodReadonly,...Ct(e)});var dt;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(dt||(dt={}));const We=Vn.create,Fn=yi.create,Rs=Nc.create,Di=co.create,xt=(fr.create,On.create,_s.create),Ns=_a.create,Hv=(ya.create,Nr.create),Bc=xl.create,xe=Lc.create,Qv=(bi.create,ba.create,gr.create);wi.create;function qd(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Dd=xt({enabled:Rs().default(!1)}).strict(),Kv=Ns([xe("animal"),xe("person"),xe("vehicle"),xe("other"),xe("motion")]),Cl=Hv([Fn(),Fn()]),Bd=xt({name:We().trim().min(1,"Zone Name is required"),points:Cl.array().min(3,"At least 3 points are required"),type:Ns([xe("intersect"),xe("contain")]),filter:Ns([xe("include"),xe("exclude")]),classes:Kv.array(),isPrivacyMask:Rs(),color:We().trim().regex(/^#([0-9A-Fa-f]{3}){1,2}$/,"Must be a valid hex color (e.g. #FF0000 or #F00)").default("#df2a4c")}).array(),zd=xt({motion:xt({timeout:Fn().min(10,"Minimum 10 seconds")}),object:xt({confidence:Fn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),qm=Ns([xe("high-resolution"),xe("mid-resolution"),xe("low-resolution"),xe("snapshot")]),Zv=Ns([xe("high-resolution"),xe("mid-resolution"),xe("low-resolution"),xe("auto")]),Gv=Ns([xe("bubble://"),xe("cui://"),xe("doorbird://"),xe("dvrip://"),xe("echo:"),xe("eseecloud://"),xe("exec:"),xe("expr:"),xe("ffmpeg:"),xe("flussonic://"),xe("gopro://"),xe("hass:"),xe("homekit://"),xe("http://"),xe("https://"),xe("httpx://"),xe("isapi://"),xe("ivideon:"),xe("kasa://"),xe("nest:"),xe("onvif://"),xe("ring:"),xe("roborock://"),xe("rtmp://"),xe("rtsp://"),xe("rtspx://"),xe("tapo://"),xe("tcp://"),xe("tuya://"),xe("webrtc:"),xe("webtorrent:")]).options.map(s=>s.value),Wv=new RegExp(`^(${Gv.join("|")})`),Dm=We().refine(s=>{if(!Wv.test(s))return!1;try{return new URL(s),!0}catch{return!1}},{message:"Invalid URL format or unsupported protocol"}),Jv=xt({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:qm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Dm.array().min(1,"At least one valid URL is required")}).strict(),Yv=xt({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:qm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Dm.array().min(1,"At least one valid URL is required")}).strict(),Sr=xt({id:We(),name:We().trim()}),Ud=xt({hub:Sr.array().optional(),cameraController:Sr.optional(),motionDetection:Sr.optional(),audioDetection:Sr.optional(),objectDetection:Sr.optional(),ptz:Sr.optional(),plugins:Sr.array()}).strict(),Xv=Ns([xe("auto"),xe("mse"),xe("webrtc"),xe("webrtc/tcp")]),e_=Ns([xe("16:9"),xe("8:3"),xe("4:3"),xe("auto")]),Vd=xt({decoder:Ns([xe("pillow"),xe("wasm"),xe("rust"),xe("gpu")]),fps:Fn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Ns([xe("640x480"),xe("640x360"),xe("320x240"),xe("320x180")])}),Hd=Ns([xe("camera"),xe("doorbell")]),Qd=xt({streamingMode:Xv,streamingSource:Zv,aspectRatio:e_}),Kd=xt({model:We().trim().optional(),manufacturer:We().trim().optional(),hardware:We().trim().optional(),serialNumber:We().trim().optional(),firmwareVersion:We().trim().optional(),supportUrl:We().trim().optional()}),t_=(xt({name:We().trim().min(1,"Camera name is required"),url:We().trim().url().min(1,"Camera URL is required"),type:Ns([xe("Google"),xe("Ring"),xe("HomeKit"),xe("Onvif"),xe("Hass"),xe("GoPro"),xe("Roborock"),xe("FFmpeg"),xe("DVRip"),xe("Webtorrent")]),username:We().trim().optional(),email:We().trim().email().optional(),password:We().trim().optional(),pin:We().trim().length(8,{message:"PIN must be 8 characters long"}).optional(),clientId:We().trim().optional(),clientSecret:We().trim().optional(),refreshToken:We().trim().optional(),projectId:We().trim().optional()}).strict().refine(s=>s.type!=="HomeKit"||!!s.pin,{message:"PIN is required for HomeKit cameras",path:["pin"]}).refine(s=>s.type!=="Google"||!!s.clientId,{message:"Client ID is required for Google cameras",path:["clientId"]}).refine(s=>s.type!=="Google"||!!s.clientSecret,{message:"Client Secret is required for Google cameras",path:["clientSecret"]}).refine(s=>s.type!=="Google"||!!s.projectId,{message:"Project ID is required for Google cameras",path:["projectId"]}).refine(s=>s.type!=="Google"||!!s.refreshToken,{message:"Refresh Token is required for Google cameras",path:["refreshToken"]}).refine(s=>s.type!=="Ring"||!!s.email,{message:"Email is required",path:["email"]}).refine(s=>s.type!=="Roborock"||!!s.username,{message:"Username is required",path:["username"]}).refine(s=>s.type!=="Roborock"&&s.type!=="Ring"||!!s.password,{message:"Password is required",path:["password"]}),xt({id:We(),name:We()}).strict()),s_=(xt({_id:We().default(mn()).transform(()=>mn()),nativeId:We().trim().optional(),pluginInfo:t_.optional(),disabled:Rs().default(!1),name:We().trim().min(1,"Camera name is required"),type:Hd.default("camera"),isCloud:Rs().default(!1),snapshotTTL:Fn().min(30,"Minimum cache time must be 30").default(600),info:Kd.default({model:"IP Camera",manufacturer:"camera.ui",hardware:"Camera",serialNumber:"Unknown",firmwareVersion:"Unknown",supportUrl:"Unknown"}),sources:Jv.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(e=>e.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.hotMode),{message:"Snapshot source can not be used with hotMode"}),extensions:Ud.default({hub:[],plugins:[]}),recording:Dd.default({enabled:!1}),interface:Qd.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:Bd.default([]),detectionSettings:zd.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:Vd.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||qd(e)?{...s,isCloud:!0}:s}),xt({disabled:Rs().optional(),type:Hd.optional(),name:We().trim().min(1,"Camera name is required").optional(),isCloud:Rs().optional(),snapshotTTL:Fn().min(30,"Minimum cache time must be 30").optional(),info:Kd.partial().optional(),sources:Yv.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(e=>e.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.hotMode),{message:"Snapshot source can not be used with hotMode"}).optional(),extensions:Ud.partial().optional(),interface:Qd.partial().optional(),recording:Dd.partial().optional(),detectionZones:Bd.optional(),detectionSettings:zd.partial().optional(),frameWorkerSettings:Vd.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||qd(e))return{...s,isCloud:!0}}return s}),xt({url:We().trim()}).strict(),/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/);var Zd,Gd;(function(s){s.READY="ready",s.STARTING="starting",s.STARTED="started",s.STOPPING="stopping",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown",s.DISABLED="disabled"})(Zd||(Zd={})),function(s){s.START="start",s.STOP="stop"}(Gd||(Gd={}));const Wd=["image/jpeg","image/png"],Jd=2097152,Yd=["video/mp4","video/quicktime"],Xd=10485760,eh=["audio/mpeg","audio/wav","audio/ogg"],th=2097152,n_=(xt({pluginname:We().trim().refine(s=>s_.test(s),"Not a valid plugin name"),pluginversion:We().trim().optional().default("latest")}).strict(),xt({actionId:We(),payload:Di()}).strict(),Bc(Di(),Di()),xt({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=Jd:s.size<=Jd,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Wd.includes(s.mimetype):Wd.includes(s.type),".jpeg and .png files are accepted"),metadata:qn().transform(s=>JSON.parse(s.value)),config:qn().transform(s=>JSON.parse(s.value))}),xt({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=th:s.size<=th,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?eh.includes(s.mimetype):eh.includes(s.type),".mp3, .wav and .ogg files are accepted"),metadata:qn().transform(s=>JSON.parse(s.value)),config:qn().transform(s=>JSON.parse(s.value))}),xt({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=Xd:s.size<=Xd,"Max file size is 5 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Yd.includes(s.mimetype):Yd.includes(s.type),".mp4 files are accepted"),config:qn().transform(s=>JSON.parse(s.value))}),Bc(We(),Di()),xt({key:We()}).strict(),xt({key:We(),payload:Di()}).strict(),xt({version:We().trim().optional().default("latest")}).strict(),xt({mode:Ns([xe("disabled"),xe("port-forward"),xe("router-forward"),xe("cloudflare"),xe("custom-domain")]).default("disabled"),cloudflare:xt({tunnelToken:We().trim(),customDomain:We().trim(),tunnelUrl:We().trim(),tunnelCredentials:xt({username:We().trim(),password:We().trim()}).partial()}).partial().strict(),customDomain:xt({url:We().trim().optional()}).partial().strict()}).strict()),sh=(xt({serverAddresses:We().trim().ip().array().default([]),remoteAccess:n_}).strict(),["image/jpeg","image/jpg","image/png"]),nh=5242880,Bm=xt({index:Fn(),cameraId:We()}),zm=Ns([xe(1),xe(4),xe(6),xe(7),xe(9),xe(10),xe(12),xe(13),xe(15),xe(16),xe(20),xe(26)]),r_=Ns([xe("dnd"),xe("view")]),i_=xt({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Layout name is required"),viewSize:zm,cameras:Bm.array(),type:r_}),o_=(xt({name:We().trim().min(1,"Layout name is required"),viewSize:zm,cameras:Bm.array()}).partial().optional(),xt({views:i_.array()})),a_=xt({_id:We().default(mn()).transform(()=>mn()),cameraId:We(),points:Cl}),c_=(xt({cameraId:We(),points:Cl}).partial().optional(),xt({shortcuts:a_.array()})),rh=xt({camview:o_,cameras:Bc(We().trim(),c_)});xt({_id:We().default(mn()).transform(()=>mn()),username:We().trim().min(1,"Username is required"),password:We().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters"),passwordConfirm:We().trim().min(1,"Please confirm your password"),role:Ns([xe("admin"),xe("user")]),sessionTimer:Fn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").default(14400),rememberMe:Rs().default(!1),singleSession:Rs().default(!1),firstLogin:Rs().default(!0),preferences:rh.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),xt({username:We().trim().min(1,"Username is required"),password:We().trim().min(1,"Password is required"),rememberMe:Rs().default(!1)}).strict(),xt({username:We().trim().min(1,"Username is required").optional(),password:We().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters").optional(),passwordConfirm:We().trim().optional(),role:Ns([xe("admin"),xe("user")]).optional(),sessionTimer:Fn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").optional(),upload:Qv(qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=nh:s.size<=nh,"Max file size is 5MB.").refine(s=>(e=>e.mimetype!==void 0)(s)?sh.includes(s.mimetype):sh.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:Rs().optional(),singleSession:Rs().optional(),firstLogin:Rs().optional(),preferences:rh.partial().optional()}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"});var ih;(function(s){s.READY="ready",s.RESTARTING="restarting",s.STARTING="starting",s.STARTED="started",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown"})(ih||(ih={}));class l_ extends EventTarget{constructor(t,n,r,i,o){super();p(this,"cameraDevice");p(this,"logger");p(this,"config");p(this,"token");p(this,"initialOptions");p(this,"videoPlayer");p(this,"CONFIG",{WEBRTC:{RECONNECT_TIMER:1e3,TIMEOUT_TIMER:1e4,ICE_SERVERS:[{urls:"stun:stun.l.google.com:19302"}]},QUALITY:{METRICS_INTERVAL:5e3,METRICS_WINDOW:6e4,STABILITY_PERIOD:3e4,PACKET_LOSS_THRESHOLD:.05,FRAME_DROP_THRESHOLD:.1,QUALITY_CHANGE_COOLDOWN:5e3},MEDIA:{BUFFER_SIZE:2097152,DEFAULT_CODECS:["avc1.640029","avc1.64002A","avc1.640033","hvc1.1.6.L153.B0","mp4a.40.2","mp4a.40.5","flac","opus"]}});p(this,"ws");p(this,"pc",null);p(this,"micTransceiver",null);p(this,"mediaSource",null);p(this,"sourceBuffer",null);p(this,"buf",new Uint8Array(0));p(this,"bufLen",0);p(this,"codecList");p(this,"streamProbe");p(this,"metrics",[]);p(this,"metricsInterval");p(this,"lastQualityChange",0);p(this,"isMonitoring",!1);p(this,"wsReconnectTimer");p(this,"wsReconnectTimeout");p(this,"webrtcConnectTimeout");p(this,"webrtcReconnectTimeout");p(this,"firstFrameReceived",!1);p(this,"animationFrameId");p(this,"userRequestedMode");p(this,"internalMode");p(this,"activeMode");p(this,"isAutoSwitchingInProgress",!1);p(this,"_closed",!0);p(this,"_hasBackchannel",!1);p(this,"_hasAudio",!0);p(this,"_hasVideo",!0);p(this,"_finishLoading",!1);p(this,"userRequestedRole");p(this,"effectiveRole");p(this,"_streamingSource");this.cameraDevice=t,this.config=n,this.token=r,this.logger=i,this.initialOptions={...o},this.videoPlayer=o.videoElement,this.CONFIG.WEBRTC.RECONNECT_TIMER=o.webrtcConnectTimeout??this.CONFIG.WEBRTC.RECONNECT_TIMER,this.userRequestedMode=o.mode,this.userRequestedRole=o.role,this.internalMode=o.mode,this.activeMode=o.mode==="auto"?"webrtc":o.mode,this.setActiveMode(this.activeMode,!0),this.effectiveRole=o.role==="auto"?"low-resolution":o.role,this.buf=new Uint8Array(this.CONFIG.MEDIA.BUFFER_SIZE),this.codecList=this.createCodecsList()}get streamingSource(){return this._streamingSource}get closed(){return this._closed}get hasBackchannel(){return this._hasBackchannel}get hasAudio(){return this._hasAudio}get hasVideo(){return this._hasVideo}get finishLoading(){return this._finishLoading}get mode(){return this.userRequestedMode}get currentMode(){return this.activeMode}get currentResolution(){return this.effectiveRole}get logPrefix(){const t=new Date,n=t.toLocaleTimeString()+"."+t.getMilliseconds().toString().padStart(3,"0");return this.userRequestedMode==="auto"?`[${n}] [${this.cameraDevice.name}] [auto→${this.activeMode}]`:`[${n}] [${this.cameraDevice.name}] [${this.activeMode}]`}get wsUrl(){const t=new URL(this.config.endpoint),n=t.port!=="",r=t.protocol==="https:"?"wss:":"ws:",i=n?t.port:t.protocol==="https:"?"443":"80";return`${r}//${t.hostname}:${i}/go2rtc?src=${this.createWsSourceName()}&token=${this.token}`}async start(t){console.log(this.logPrefix,"Starting session..."),this.reset(),this._closed=!1,this.videoPlayer.addEventListener("loadeddata",this.onLoadedData.bind(this)),t&&(this.userRequestedMode=t,this.internalMode=t,this.setActiveMode(t==="auto"?"webrtc":t)),await this.initializeStreamingSource(),this.streamProbe=await this.probeStream(),this.streamProbe&&this.userRequestedMode==="auto"&&this.selectInitialMode(),this.connectWs()}close(){this._closed||(console.log(this.logPrefix,"Closing session..."),this._closed=!0,this.stopQualityMonitoring(),this.reset(),this.disconnectWs())}async restart(t,n=!1){console.log(this.logPrefix,"Restarting session..."),n?this.dispatchEvent(new Event("onSourceChange")):this.dispatchEvent(new Event("reconnect")),this.close(),await new Promise(r=>setTimeout(r,1e3)),await this.start(t)}async toggleMicrophone(t){if(this.micTransceiver)try{await this.micTransceiver.sender.replaceTrack(t)}catch(n){if(!this.micTransceiver||!t)return;console.error(this.logPrefix,"Microphone error:",n)}}async toggleRole(t){var n;if(this.userRequestedRole!==t)if(console.log(this.logPrefix,`Switching source resolution to "${t}"...`),this.userRequestedRole=t,t==="auto")await this.initializeAdaptiveStreaming();else{this.effectiveRole=t;const{source:r}=this.getSourceForResolution(t);((n=this._streamingSource)==null?void 0:n._id)!==r._id&&(this._streamingSource=r,await this.restart(void 0,!0))}}async toggleMode(t){this.userRequestedMode!==t&&(console.log(this.logPrefix,`Switching transport mode to "${t}"...`),this.userRequestedMode=t,this.internalMode=t,this.setActiveMode(t==="auto"?"webrtc":t),await this.restart())}async initializeStreamingSource(){if(this.userRequestedRole==="auto")await this.initializeAdaptiveStreaming();else{const{source:t}=this.getSourceForResolution(this.userRequestedRole);if(this._streamingSource=t,this.userRequestedMode==="auto"&&t){const n=await this.probeStream();n&&(this.checkWebRTCCompatibility(n).compatible||(console.log(`${this.logPrefix} Source not compatible with WebRTC, starting with MSE...`),this.setActiveMode("mse")))}}}checkWebRTCCompatibility(t){const n=t.audio.filter(u=>u.direction==="sendonly"),r=t.video.filter(u=>u.direction==="sendonly"),i=n.some(u=>this.isWebRtcCompatibleAudioCodec(u.codec)),o=r.some(u=>this.isWebRtcCompatibleVideoCodec(u.codec)),a=n.length>0,l=r.length>0;return{compatible:(!a||i)&&(!l||o),audioCompatible:i,videoCompatible:o}}async initializeAdaptiveStreaming(){this.userRequestedRole==="auto"&&(await this.setStreamResolution(this.effectiveRole,void 0,!0),this.startQualityMonitoring())}selectInitialMode(){if(!this.streamProbe||this.userRequestedMode!=="auto")return;const t=this.checkWebRTCCompatibility(this.streamProbe);if(t.compatible)this.internalMode="auto";else{if(t.videoCompatible){if(!t.audioCompatible){const n=this.streamProbe.audio.filter(r=>r.direction==="sendonly");console.warn(this.logPrefix,`Incompatible audio codec(s): "${n.map(r=>r.codec).join(", ")}" - Using MSE directly`)}}else{const n=this.streamProbe.video.filter(r=>r.direction==="sendonly");console.warn(this.logPrefix,`Incompatible video codec(s): "${n.map(r=>r.codec).join(", ")}" - Using MSE directly`)}this.setActiveMode("mse")}}connectWs(){this.ws=new WebSocket(this.wsUrl),this.ws.binaryType="arraybuffer",this.ws.addEventListener("open",this.onWsOpen.bind(this)),this.ws.addEventListener("close",this.onWsClose.bind(this)),this.ws.addEventListener("message",this.onWsMessage.bind(this))}disconnectWs(){this.ws&&(this.ws.removeEventListener("open",this.onWsOpen.bind(this)),this.ws.removeEventListener("close",this.onWsClose.bind(this)),this.ws.removeEventListener("message",this.onWsMessage.bind(this)),this.ws.close(),this.ws=void 0)}reset(){var t;(t=this.videoPlayer)==null||t.removeEventListener("loadeddata",this.onLoadedData.bind(this)),clearTimeout(this.wsReconnectTimeout),clearTimeout(this.webrtcConnectTimeout),clearTimeout(this.webrtcReconnectTimeout),this._finishLoading=!1,this.firstFrameReceived=!1,this.isAutoSwitchingInProgress=!1,this.micTransceiver&&(this.micTransceiver.sender.replaceTrack(null).catch(()=>{}),this.micTransceiver=null),this.pc&&(this.pc.getTransceivers().forEach(n=>{var r,i;return(i=(r=n.sender)==null?void 0:r.track)==null?void 0:i.stop()}),this.pc.close(),this.pc=null),this.videoPlayer.srcObject=null,this.videoPlayer.src="",this.videoPlayer.poster="",this.animationFrameId!==void 0&&("cancelVideoFrameCallback"in this.videoPlayer?this.videoPlayer.cancelVideoFrameCallback(this.animationFrameId):cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}onWsOpen(){switch(this.internalMode){case"webrtc":case"webrtc/tcp":console.log(this.logPrefix,"Requesting WebRTC session..."),this.requestWebrtc();break;case"mse":console.log(this.logPrefix,"Requesting MSE session..."),this.requestMse();break;case"auto":console.log(this.logPrefix,"Requesting auto session (both WebRTC and MSE)..."),this.requestAuto();break;default:console.error(this.logPrefix,"Unknown mode!"),this.dispatchEvent(new ErrorEvent("error",{message:"Unknown mode!"}))}}onWsClose(){this._closed||this.wsReconnectTimer===void 0||(clearTimeout(this.wsReconnectTimeout),this.wsReconnectTimeout=setTimeout(()=>{this.restart()},this.wsReconnectTimer))}onWsMessage(t){if(typeof t.data=="string"){const n=JSON.parse(t.data);if(n.type)switch(n.type){case"mse":this.onMseData(n);break;case"webrtc/candidate":case"webrtc/answer":this.onWebrtcData(n);break;case"error":this.handleStreamError(n)}}else this.onMseBuffer(t.data),this.onFirstFrame()}handleStreamError(t){this.isAutoSwitchingInProgress||this.internalMode==="auto"||(this.dispatchEvent(new ErrorEvent("error",{error:t,message:t.value})),this.close())}async requestWebrtc(t){t||this.reset(),t&&this.mediaSource||(this.webrtcConnectTimeout=setTimeout(()=>{if(console.log(this.logPrefix,"WebRTC connection timeout"),this.pc&&this.pc.connectionState!=="connected")if(this.pc.close(),this.pc=null,this.userRequestedMode==="auto"){if(this.mediaSource&&this.sourceBuffer&&this._finishLoading)return console.log(this.logPrefix,"WebRTC timed out but MSE is working - staying with MSE"),this.setActiveMode("mse"),void(this.isAutoSwitchingInProgress=!1);this.setActiveMode("mse"),this.requestMse()}else this.userRequestedMode==="webrtc"?this.restart("mse"):this.restart()},this.CONFIG.WEBRTC.TIMEOUT_TIMER)),this.pc=new RTCPeerConnection({bundlePolicy:"max-bundle",iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"}),this.pc.onicecandidate=r=>{var o,a;if(this.activeMode==="webrtc/tcp"&&((o=r.candidate)==null?void 0:o.protocol)==="udp")return;const i=((a=r.candidate)==null?void 0:a.toJSON().candidate)??"";i&&this.send({type:"webrtc/candidate",value:i})},this.pc.onconnectionstatechange=async()=>{var r,i,o,a;if(console.log(this.logPrefix,"onconnectionstatechange:",(r=this.pc)==null?void 0:r.connectionState),((i=this.pc)==null?void 0:i.connectionState)==="connected"){clearTimeout(this.webrtcConnectTimeout);const l=new MediaStream(this.pc.getTransceivers().filter(d=>d.currentDirection==="recvonly").map(d=>d.receiver.track)),u=l.getVideoTracks().length>0;this.userRequestedMode==="auto"?this.mediaSource&&this.sourceBuffer&&this._finishLoading&&this.activeMode==="mse"?u?(console.log(this.logPrefix,"WebRTC connected successfully - switching from MSE to WebRTC"),await this.switchToWebRTC(l)):console.log(this.logPrefix,"WebRTC connected but no video - staying with MSE"):u?(this.setActiveMode("webrtc"),this.videoPlayer.srcObject=l,this.onFinishLoading(void 0,"webrtc"),this.onFirstFrameWebrtc(l)):console.log(this.logPrefix,"WebRTC connected but no video - waiting for MSE"):(this.videoPlayer.srcObject=l,this.onFinishLoading(void 0,"webrtc"),this.onFirstFrameWebrtc(l))}else((o=this.pc)==null?void 0:o.connectionState)!=="failed"&&((a=this.pc)==null?void 0:a.connectionState)!=="disconnected"||(clearTimeout(this.webrtcConnectTimeout),clearTimeout(this.webrtcReconnectTimeout),this.webrtcReconnectTimeout=setTimeout(()=>{var l,u,d;if(((l=this.pc)==null?void 0:l.connectionState)==="failed"||((u=this.pc)==null?void 0:u.connectionState)==="disconnected"){if(this.userRequestedMode==="auto"&&this.mediaSource&&this.sourceBuffer&&this._finishLoading)return console.log(this.logPrefix,"WebRTC failed but MSE is working - staying with MSE"),this.setActiveMode("mse"),(d=this.pc)==null||d.close(),this.pc=null,void(this.isAutoSwitchingInProgress=!1);this.userRequestedMode==="auto"?(console.warn(this.logPrefix,"WebRTC failed - switching to MSE"),this.setActiveMode("mse"),this.restart()):this.activeMode==="webrtc"?(console.warn(this.logPrefix,"WebRTC failed - switching to MSE fallback"),this.restart("mse")):this.restart()}},this.CONFIG.WEBRTC.RECONNECT_TIMER))},this.pc.oniceconnectionstatechange=()=>{var r;console.log(this.logPrefix,"iceconnectionstatechange",(r=this.pc)==null?void 0:r.iceConnectionState)},this.pc.onicecandidateerror=r=>{console.log(this.logPrefix,"onicecandidateerror",r)},this.pc.onsignalingstatechange=()=>{var r;console.log(this.logPrefix,"onsignalingstatechange",(r=this.pc)==null?void 0:r.signalingState)},this.pc.onicegatheringstatechange=()=>{var r;console.log(this.logPrefix,"onicegatheringstatechange",(r=this.pc)==null?void 0:r.iceGatheringState)},this.pc.onnegotiationneeded=r=>{console.log(this.logPrefix,"onnegotiationneeded",r)},this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.addTransceiver("audio",{direction:"recvonly"}),this.micTransceiver=this.pc.addTransceiver("audio",{direction:"sendonly"});const n=await this.pc.createOffer();await this.pc.setLocalDescription(n),console.log(this.logPrefix,"Offer:",{type:n.type,sdp:n.sdp}),n.sdp?this.send({type:"webrtc/offer",value:n.sdp}):this.dispatchEvent(new ErrorEvent("error",{message:"Failed to create offer"}))}async onWebrtcData(t){var n,r;try{switch(t.type){case"webrtc/candidate":if(!t.value||this.activeMode==="webrtc/tcp"&&t.value.indexOf(" udp ")>0)return;await((n=this.pc)==null?void 0:n.addIceCandidate({candidate:t.value,sdpMid:"0"}));break;case"webrtc/answer":console.log(this.logPrefix,"Answer:",{type:"answer",sdp:t.value}),await((r=this.pc)==null?void 0:r.setRemoteDescription({type:"answer",sdp:t.value}))}}catch(i){this.dispatchEvent(new ErrorEvent("error",{error:i,message:i.message}))}}requestMse(){this.userRequestedMode==="auto"&&this.pc||this.reset();const t="ManagedMediaSource"in window;let n;if(t)n=window.ManagedMediaSource;else{if(!("MediaSource"in window))return void this.dispatchEvent(new ErrorEvent("error",{message:"MediaSource not supported"}));n=window.MediaSource}this.mediaSource=new n,this.mediaSource.addEventListener("sourceopen",()=>{t||URL.revokeObjectURL(this.videoPlayer.src),this.send({type:"mse",value:this.parseCodecs(n.isTypeSupported.bind(this))})},{once:!0}),t?(this.videoPlayer.disableRemotePlayback=!0,this.videoPlayer.srcObject=this.mediaSource):(this.videoPlayer.src=URL.createObjectURL(this.mediaSource),this.videoPlayer.srcObject=null),this.play()}onMseData(t){if(this.mediaSource&&this.mediaSource.readyState==="open")if(this.userRequestedMode==="auto"&&this.pc&&this.pc.connectionState!=="failed"||this.setActiveMode("mse"),this.bufLen=0,this.buf=new Uint8Array(this.CONFIG.MEDIA.BUFFER_SIZE),this.sourceBuffer=this.mediaSource.addSourceBuffer(t.value),this.sourceBuffer.mode="segments",this.sourceBuffer.addEventListener("updateend",()=>{var n,r;if(this.sourceBuffer&&!this.sourceBuffer.updating&&this.bufLen>0)try{const i=this.buf.slice(0,this.bufLen);this.sourceBuffer.appendBuffer(i),this.bufLen=0}catch{}if(this.sourceBuffer&&!this.sourceBuffer.updating&&((n=this.sourceBuffer.buffered)!=null&&n.length)){const i=this.sourceBuffer.buffered.end(this.sourceBuffer.buffered.length-1),o=i-5,a=this.sourceBuffer.buffered.start(0);o>a&&(this.sourceBuffer.remove(a,o),(r=this.mediaSource)==null||r.setLiveSeekableRange(o,i)),this.videoPlayer.currentTime<o&&(this.videoPlayer.currentTime=o);const l=i-this.videoPlayer.currentTime;this.videoPlayer.playbackRate=l>.1?l:.1}}),this.userRequestedMode==="auto"){if(this.pc&&this.pc.connectionState==="connected")return void console.log(this.logPrefix,"MSE ready but WebRTC already connected");console.log(this.logPrefix,"MSE ready - using while waiting for WebRTC"),this.setActiveMode("mse"),this.onFinishLoading(void 0,"mse")}else this.onFinishLoading(void 0,"mse")}async onMseBuffer(t){var n,r,i;if(((n=this.mediaSource)==null?void 0:n.readyState)!=="closed")if((r=this.sourceBuffer)!=null&&r.updating||this.bufLen>0){const o=new Uint8Array(t);this.buf.set(o,this.bufLen),this.bufLen+=o.byteLength}else try{(i=this.sourceBuffer)==null||i.appendBuffer(t)}catch{}else this._closed||this.internalMode==="auto"||(this.dispatchEvent(new ErrorEvent("error",{message:"MediaSource closed"})),this.userRequestedMode==="auto"?(this.setActiveMode("webrtc"),this.restart()):this.restart("webrtc"))}requestAuto(){if(this.isAutoSwitchingInProgress=!0,this.streamProbe&&!this.checkWebRTCCompatibility(this.streamProbe).compatible)return console.log(this.logPrefix,"Stream not compatible with WebRTC, using MSE only"),void this.requestMse();console.log(this.logPrefix,"Starting both WebRTC and MSE transports in parallel"),this.requestMse(),this.requestWebrtc(!0)}send(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(t))}async switchToWebRTC(t){this.setActiveMode("webrtc"),this.videoPlayer.srcObject=t,this.play(),this.onFinishLoading(!0,"webrtc"),this.onFirstFrameWebrtc(t),this.mediaSource&&(this.mediaSource.readyState==="open"&&this.mediaSource.endOfStream(),this.mediaSource=null,this.sourceBuffer=null),this.disconnectWs()}async play(){try{await this.videoPlayer.play()}catch(t){if(!this.videoPlayer.muted)return this.videoPlayer.muted=!0,this.play();this.logger.warn(this.cameraDevice.name,t)}}startQualityMonitoring(){this.isMonitoring||this.userRequestedRole!=="auto"||(clearInterval(this.metricsInterval),this.isMonitoring=!0,this.metrics=[],this.metricsInterval=setInterval(async()=>{if(this._closed)return void this.stopQualityMonitoring();const t=await this.gatherMetrics();if(t){this.metrics.push(t);const n=Date.now()-this.CONFIG.QUALITY.METRICS_WINDOW;this.metrics=this.metrics.filter(r=>r.timestamp>n),this.userRequestedRole==="auto"&&this.analyzeAndAdaptQuality()}},this.CONFIG.QUALITY.METRICS_INTERVAL))}stopQualityMonitoring(){clearInterval(this.metricsInterval),this.metricsInterval=void 0,this.isMonitoring=!1,this.metrics=[]}async gatherMetrics(){if(this._closed)return null;if(this.pc&&this.activeMode==="webrtc")try{const t=await this.pc.getStats(),n={packetsLost:0,packetsReceived:0,framesDropped:0,framesReceived:0,timestamp:Date.now()};for(const[,r]of t.entries())r.type==="inbound-rtp"&&r.kind==="video"?(n.packetsLost=r.packetsLost,n.packetsReceived=r.packetsReceived):r.type==="media-source"&&r.kind==="video"&&(n.framesDropped=r.framesDropped,n.framesReceived=r.framesReceived);return n}catch(t){return console.warn(`${this.logPrefix} Error gathering WebRTC metrics:`,t),null}else if(this.activeMode==="mse"&&this.videoPlayer)try{const t=this.videoPlayer.getVideoPlaybackQuality();return{packetsLost:0,packetsReceived:0,framesDropped:t.droppedVideoFrames,framesReceived:t.totalVideoFrames,timestamp:Date.now()}}catch(t){return console.warn(`${this.logPrefix} Error gathering MSE metrics:`,t),null}return null}analyzeQualityMetrics(){if(Date.now()-this.lastQualityChange<this.CONFIG.QUALITY.QUALITY_CHANGE_COOLDOWN)return{packetLossRate:0,frameDropRate:0,isStable:!0};if(this.metrics.length<2)return{packetLossRate:0,frameDropRate:0,isStable:!0};const t=this.metrics[this.metrics.length-1],n=this.metrics[0],r=(t.packetsLost-n.packetsLost)/Math.max(t.packetsReceived-n.packetsReceived,1),i=(t.framesDropped-n.framesDropped)/Math.max(t.framesReceived-n.framesReceived,1);return{packetLossRate:r,frameDropRate:i,isStable:r<this.CONFIG.QUALITY.PACKET_LOSS_THRESHOLD&&i<this.CONFIG.QUALITY.FRAME_DROP_THRESHOLD}}async analyzeAndAdaptQuality(){if(this.userRequestedRole!=="auto"||this._closed)return;const t=this.analyzeQualityMetrics(),n=Date.now()-this.lastQualityChange;if(t.isStable){if(t.isStable&&n>this.CONFIG.QUALITY.STABILITY_PERIOD){const r=t.packetLossRate,i=t.frameDropRate;r<this.CONFIG.QUALITY.PACKET_LOSS_THRESHOLD/2&&i<this.CONFIG.QUALITY.FRAME_DROP_THRESHOLD/2&&(this.effectiveRole==="low-resolution"?await this.setStreamResolution("mid-resolution","upgrade"):this.effectiveRole==="mid-resolution"&&await this.setStreamResolution("high-resolution","upgrade"))}}else this.effectiveRole==="high-resolution"?await this.setStreamResolution("mid-resolution","downgrade"):this.effectiveRole==="mid-resolution"&&await this.setStreamResolution("low-resolution","downgrade")}async setStreamResolution(t,n,r){var l;if(this._closed)return;const{source:i,sourceResolution:o,isRequestedSource:a}=this.getSourceForResolution(t);if(i._id!==((l=this._streamingSource)==null?void 0:l._id)){if(n==="upgrade"?console.log(`${this.logPrefix} Quality stable, upgrading to "${t}" source...`):n==="downgrade"&&console.log(`${this.logPrefix} Quality unstable, downgrading to "${t}" source...`),console.log(a||r?`${this.logPrefix} Switching to "${o}" source...`:`${this.logPrefix} Source "${t}" not available, switching to next best available: ${o}`),this.effectiveRole=o,this._streamingSource=i,this.lastQualityChange=Date.now(),!r&&this.userRequestedMode==="auto"){const u=await this.probeStream();if(u){const d=this.checkWebRTCCompatibility(u);if(this.activeMode.startsWith("webrtc")&&!d.compatible)return console.log(`${this.logPrefix} New source not compatible with WebRTC, switching to MSE...`),this.isAutoSwitchingInProgress=!0,void await this.restart("mse",!0);if(this.activeMode==="mse"&&d.compatible)return console.log(`${this.logPrefix} New source compatible with WebRTC, switching back...`),this.isAutoSwitchingInProgress=!0,void await this.restart("webrtc",!0)}}r||await this.restart(this.activeMode,!0)}else this.effectiveRole=r||a?o:t}getSourceForResolution(t){const n=["high-resolution","mid-resolution","low-resolution"],r=this.cameraDevice.sources.map(u=>u.role).filter(u=>n.includes(u)),i=r.reduce((u,d)=>n.indexOf(u)>n.indexOf(d)?u:d,"low-resolution"),o=this.cameraDevice.sources.find(u=>u.role===t),a=this.cameraDevice.sources.find(u=>u.role===i),l=o??a??this.cameraDevice.streamSource;if(this._streamingSource){if(this._streamingSource.role===t)return{source:this._streamingSource,sourceResolution:t,isRequestedSource:!0};const u=n.indexOf(t);if(u===-1)return{source:l,sourceResolution:l.role,isRequestedSource:!0};for(let d=u;d<n.length;d++){const h=n[d],v=`${h.split("-")[0]}ResolutionSource`,f=this.cameraDevice[v];if(f)return f._id===this._streamingSource._id?{source:this._streamingSource,sourceResolution:this._streamingSource.role,isRequestedSource:this._streamingSource.role===t}:{source:f,sourceResolution:h,isRequestedSource:h===t}}}return{source:l,sourceResolution:l.role,isRequestedSource:!1}}onFirstFrameWebrtc(t){const n=this.isAutoSwitchingInProgress,r=t.getVideoTracks()[0];if((!this.firstFrameReceived||n)&&r)if("requestVideoFrameCallback"in this.videoPlayer)this.animationFrameId=this.videoPlayer.requestVideoFrameCallback(()=>{this.onFirstFrame(n)});else{const i=()=>{this.videoPlayer.readyState>=2&&this.videoPlayer.videoWidth>0?this.onFirstFrame(n):this.animationFrameId=requestAnimationFrame(i)};this.animationFrameId=requestAnimationFrame(i)}}setActiveMode(t,n){(this.activeMode!==t||n)&&(this.activeMode=t,this.dispatchEvent(new Event("onModeChange")))}onFirstFrame(t){this.firstFrameReceived&&!t||(console.log(this.logPrefix,"First frame received"),this.firstFrameReceived=!0,this.dispatchEvent(new Event("onFirstFrame")))}onLoadedData(){console.log(this.logPrefix,"Loaded data"),this.dispatchEvent(new Event("onLoadedData"))}onFinishLoading(t,n){this._finishLoading&&!t||(this._finishLoading=!0,this.dispatchEvent(new Event("onFinishLoading"))),n&&n!=="auto"&&this.setActiveMode(n)}createCodecsList(){const t=[...this.CONFIG.MEDIA.DEFAULT_CODECS],n=typeof window>"u"?null:/Version\/(\d+).+Safari/.exec(navigator.userAgent);if(n!=null&&n[1]){const r=n[1]<"13"?"mp4a.40.2":n[1]<"14"?"flac":"opus";t.splice(t.indexOf(r))}return t}parseCodecs(t){return this.codecList.filter(n=>["video","audio","microphone"].includes(n.indexOf("vc1")>0?"video":"audio")).filter(n=>t(`video/mp4; codecs="${n}"`)).join()}async probeStream(){try{if(!this.streamingSource)throw new Error("No streaming source set");const t=await this.cameraDevice.probeStream(this.streamingSource._id,{video:!0,audio:["pcma","opus"],microphone:!0});return console.log(this.logPrefix,"Stream probe:",t),t&&(this._hasBackchannel=t.audio.some(n=>n.direction==="recvonly"),this._hasAudio=t.audio.filter(n=>n.direction==="sendonly").length>0,this._hasVideo=t.video.filter(n=>n.direction==="sendonly").length>0,this.dispatchEvent(new Event("onStreamProbe"))),t}catch(t){return void console.error("Error probing stream",t)}}isWebRtcCompatibleAudioCodec(t){return["opus","G722","PCMU","PCMA"].includes(t)}isWebRtcCompatibleVideoCodec(t){return["H264","VP8","VP9"].includes(t)||t==="H265"&&this.isWebRTCH265Supported()}createWsSourceName(){if(!this.cameraDevice||!this.streamingSource)throw new Error("Camera device or streaming source not set");return`${this.cameraDevice.name.replace(/ /g,"_").toLowerCase()}_${this.streamingSource.name.replace(/ /g,"_").toLowerCase()}`}isWebRTCH265Supported(){var t;try{console.log(this.logPrefix,"Checking for H.265 support...",RTCRtpSender==null?void 0:RTCRtpSender.getCapabilities("video"));const n=(t=RTCRtpSender==null?void 0:RTCRtpSender.getCapabilities("video"))==null?void 0:t.codecs;return!!n&&n.some(r=>r.mimeType.toLowerCase().includes("h265")||r.mimeType.toLowerCase().includes("hevc"))}catch{return!1}}}class u_ extends yv{constructor(t,n,r,i,o){super(i,o);p(this,"proxy");p(this,"config");p(this,"token");p(this,"subscription");p(this,"namespaces");p(this,"cameraInterfaces");this.proxy=t,this.config=n,this.token=r,this.namespaces=oo.cameraNamespaces(this.id),this.cameraInterfaces=new ea(this.proxy,this.capabilities,this.id)}get sources(){return JSON.parse(JSON.stringify(this.cameraSubject.getValue().sources)).map(t=>({...t,snapshot:async n=>this.snapshot(t._id,n),probeStream:async(n,r=!1)=>this.probeStream(t._id,n,r)}))}async init(){var t;(t=this.subscription)==null||t.unsubscribe(),this.subscription=this.proxy.subscribe(this.namespaces.cameraSubject,this.onEventMessage.bind(this)),await this.refreshStates()}async close(){await this.cleanup()}createWebRTCSession(t){return new l_(this,this.config,this.token,this.logger,t)}async refreshStates(){const t=await this.cameraControllerProxy(),n=await t.refreshStates();super.updateCamera(n.camera),super.updateCameraState(n.cameraState),super.updateFrameWorkerState(n.frameWorkerState),super.updateCapabilities(n.capabilities);for(const[r,i]of Object.entries(n.states))super.updateStateInternal(r,i,!0)}async cleanup(){var t;this.removeAllListeners(),this.unsubscribe(),(t=this.subscription)==null||t.unsubscribe(),this.subscription=void 0,await this.disconnectRpc()}async snapshot(t,n){const r=this.snapshotCache.get(t);if(!n&&r)return r;const i=await this.cameraControllerProxy(),o=await i.snapshot(t,n);return o&&o.byteLength>0?(this.snapshotCache.set(t,o),o):void 0}async probeStream(t,n,r=!1){return(await this.cameraControllerProxy()).probeStream(t,n,r)}async onEventMessage(t){const n=t.data;if("type"in n)switch(n.type){case"removed":this.cleanup();break;case"updated":super.updateCamera(n.data);break;case"cameraState":super.updateCameraState(n.data);break;case"frameWorkerState":super.updateFrameWorkerState(n.data);break;case"capabilities":super.updateCapabilities(n.data)}else{const r=n.stateName,i=n.data.newEvent;super.updateStateInternal(r,i,!0)}}async cameraControllerProxy(){return await this.proxy.createRPCProxy(this.namespaces.cameraControllerRpc,{timeout:1e4})}async disconnectRpc(){await this.proxy.disconnectRPCConnection(this.namespaces.cameraControllerRpc),await this.cameraInterfaces.disconnect()}}class d_{constructor(e){p(this,"proxy");p(this,"namespaces");p(this,"rpcConnections",new Map);this.proxy=e,this.namespaces=oo.coreManagerNamespaces()}async connectToPlugin(e){const t=await this.coreManagerProxy(),n=await t.getPlugin(e);if(n){const r=oo.pluginNamespaces(n.id);try{let i;return this.rpcConnections.has(r.pluginChildRpc)?(i=this.rpcConnections.get(r.pluginChildRpc),await i.connect()):(i=await this.proxy.createRPCConnection(r.pluginChildRpc),this.rpcConnections.set(r.pluginChildRpc,i)),i.createProxy()}catch{return}}}async getFFmpegPath(){return await(await this.coreManagerProxy()).getFFmpegPath()}async getHwaccelInfo(e){return await(await this.coreManagerProxy()).getHwaccelInfo(e)}async getServerAddresses(){return await(await this.coreManagerProxy()).getServerAddresses()}async getIceServers(){return await(await this.coreManagerProxy()).getIceServers()}async coreManagerProxy(){return await this.proxy.createRPCProxy(this.namespaces.coreManagerRpc)}}class h_{constructor(e,t,n,r){p(this,"proxy");p(this,"config");p(this,"token");p(this,"logger");p(this,"namespaces");this.proxy=e,this.config=t,this.token=n,this.logger=r,this.namespaces=oo.deviceManagerNamespaces()}async getCamera(e){const t=await this.deviceManagerProxy(),n=await t.getCamera(e,"@camera.ui/client");if(n){const r=new u_(this.proxy,this.config,this.token,n,this.logger);return await r.init(),r}}async deviceManagerProxy(){return await this.proxy.createRPCProxy(this.namespaces.deviceManagerRpc)}}class m_{constructor(e){p(this,"interceptor");p(this,"config");p(this,"logger");p(this,"proxy");p(this,"token");p(this,"_api");this.config=e,this.logger=e.logger??{...console,attention:console.warn,success:console.log},this.interceptor=new _1(e.endpoint)}get api(){return this._api}async connect(){if(this._api)return this._api;this.token=await this.login(),this.proxy=new Yg({endpoints:this.getNatsEndpoint(this.token),tls:void 0,auth:{user:"secret",password:"secret"},metadata:{id:"@camera-ui/browser-client",name:"@camera-ui/browser-client"},connect:{waitForServer:!0},reconnect:{enabled:!0},metrics:!1,bundledConnection:!0}),await this.proxy.start();const e=new d_(this.proxy),t=new h_(this.proxy,this.config,this.token,this.logger);return this._api={coreManager:e,deviceManager:t},this._api}async disconnect(){var e;if(await((e=this.proxy)==null?void 0:e.stop()),this.token)try{await this.interceptor.post("/auth/logout",void 0,{headers:{Authorization:`Bearer ${this.token}`}})}catch{}this._api=void 0,this.token=void 0}async updateCredentials(e){this.config={...this.config,...e}}async login(){if(this.config.username&&this.config.password)try{return(await(await this.interceptor.post("/auth/login",{username:this.config.username,password:this.config.password})).json()).access_token}catch(e){throw new Error(`Invalid credentials: ${e.message}`)}else{if(this.config.skipCheck)return this.config.token;try{return await this.interceptor.get("/auth/check",{headers:{Authorization:`Bearer ${this.config.token}`}}),this.config.token}catch(e){throw new Error(`Invalid token: ${e.message}`)}}}getNatsEndpoint(e){const t=new URL(this.config.endpoint),n=t.port!=="",r=t.protocol==="https:"?"wss:":"ws:",i=n?t.port:t.protocol==="https:"?"443":"80";return[`${r}//${t.hostname}:${i}/proxy?token=${e}`]}}const Ie=lf.create({baseURL:`${location.origin}/api`});Ie.interceptors.request.use(s=>{const{accessToken:e}=Fs();return e&&(s.headers.Authorization=`Bearer ${e}`),s},s=>Promise.reject(s));Ie.interceptors.response.use(s=>s,async s=>{var n,r,i,o,a,l;const e=s.config,t=((r=(n=s.response)==null?void 0:n.data)==null?void 0:r.message)==="Token expired"||((a=(o=(i=s.response)==null?void 0:i.data)==null?void 0:o.message)==null?void 0:a.name)==="TokenExpiredError";if(((l=s.response)==null?void 0:l.status)===401&&t&&!e._retry){e._retry=!0;try{const{refreshToken:u}=Fs();return await u(),Ie(e)}catch(u){return Promise.reject(u)}}return Promise.reject(s)});const Cn=()=>({add:e=>{P0.emit("add",e)}}),Um=async s=>(await Ie.get("/auth/check",{signal:s})).data,p_=async({parameter:s,signal:e})=>(await Ie.get("/auth/tokens",{params:s,signal:e})).data,Vm=async({loginInformation:s})=>(await Ie.post("/auth/login",s)).data,Hm=async()=>(await Ie.post("/auth/logout")).data,f_=async({id:s,access_token:e})=>(await Ie.post(`/auth/logout/${s}`,null,{params:{token:e}})).data,Qm=async({refresh_token:s})=>(await Ie.post("/auth/refresh",{refresh_token:s})).data;class a9{constructor(){p(this,"_queryClient",Ci());p(this,"authStore",Fs());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"checkQuery",enabled:!0},{name:"listQuery",enabled:!0}]))}get queryClient(){return this._queryClient}checkQuery(){var e;return Bt({queryKey:["auth",(e=this.authStore.user)==null?void 0:e.username],queryFn:({signal:t})=>Um(t),enabled:()=>this.queryActivator.value.some(t=>t.name==="checkQuery"&&t.enabled)})}listQuery(e){return Bt({queryKey:["tokensList",e],queryFn:({signal:t})=>p_({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="listQuery"&&t.enabled)})}loginQuery(){return ut({mutationFn:Vm})}logoutQuery(){return ut({mutationFn:Hm})}logoutTokenQuery(){return ut({mutationFn:f_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["tokensList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_logged_out"),life:3e3})}})}refreshQuery(){return ut({mutationFn:Qm})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const g_=async({userData:s})=>(await Ie.post("/users",s)).data,v_=async({username:s,signal:e})=>(await Ie.get(`/users/${s}`,{signal:e})).data,__=async({parameter:s,signal:e})=>(await Ie.get("/users",{params:s,signal:e})).data,wa=async({username:s,userData:e})=>(await Ie.patch(`/users/${s}`,e)).data,y_=async({username:s})=>(await Ie.delete(`/users/${s}`)).data,b_=async()=>(await Ie.delete("/users")).data,w_=async({username:s,cameraname:e,shortcutData:t})=>(await Ie.post(`/users/${s}/preferences/cameras/${e}/shortcuts`,t)).data,x_=async({username:s,cameraname:e,shortcutid:t,signal:n})=>(await Ie.get(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,{signal:n})).data,S_=async({username:s,cameraname:e,signal:t})=>(await Ie.get(`/users/${s}/preferences/cameras/${e}/shortcuts`,{signal:t})).data,C_=async({username:s,cameraname:e,shortcutid:t,shortcutData:n})=>(await Ie.patch(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,n)).data,k_=async({username:s,cameraname:e,shortcutid:t})=>(await Ie.delete(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`)).data,E_=async({username:s,cameraname:e})=>(await Ie.delete(`/users/${s}/preferences/cameras/${e}/shortcuts`)).data,A_=async({username:s,viewData:e})=>(await Ie.post(`/users/${s}/preferences/camview/views`,e)).data,M_=async({username:s,viewid:e,signal:t})=>(await Ie.get(`/users/${s}/preferences/camview/views/${e}`,{signal:t})).data,$_=async({username:s,parameter:e,signal:t})=>(await Ie.get(`/users/${s}/preferences/camview/views`,{params:e,signal:t})).data,oh=async({username:s,viewid:e,viewData:t})=>(await Ie.patch(`/users/${s}/preferences/camview/views/${e}`,t)).data,P_=async({username:s,viewid:e})=>(await Ie.delete(`/users/${s}/preferences/camview/views/${e}`)).data,T_=async({username:s})=>(await Ie.delete(`/users/${s}/preferences/camview/views`)).data;class R_{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"getUserQuery",enabled:!0},{name:"getUsersQuery",enabled:!0},{name:"getShortcutQuery",enabled:!0},{name:"getShortcutsQuery",enabled:!0},{name:"getViewQuery",enabled:!0},{name:"getViewsQuery",enabled:!0}]))}get queryClient(){return this._queryClient}createUserQuery(){return ut({mutationFn:g_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["usersList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_added"),life:3e3})}})}getUserQuery(e){return Bt({queryKey:["users",e],queryFn:({signal:t})=>v_({username:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getUserQuery"&&t.enabled)})}getUsersQuery(e){return Bt({queryKey:["usersList",e],queryFn:({signal:t})=>__({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getUsersQuery"&&t.enabled)})}patchUserQuery(){return ut({mutationFn:async({username:e,userData:t,formData:n})=>{await wa({username:e,userData:t}),n&&await wa({username:e,userData:n})},onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["users",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_updated"),life:3e3})}})}removeUserQuery(){return ut({mutationFn:y_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["usersList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_removed"),life:3e3})}})}removeUsersQuery(){return ut({mutationFn:b_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["usersList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.users_removed"),life:3e3})}})}createShortcutQuery(){return ut({mutationFn:w_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})}})}getShortcutQuery(e,t,n){return Bt({queryKey:["shortcutsList",e,t,n],queryFn:({signal:r})=>x_({username:c(e),cameraname:c(t),shortcutid:c(n),signal:r}),enabled:()=>this.queryActivator.value.some(r=>r.name==="getShortcutQuery"&&r.enabled)})}getShortcutsQuery(e,t){return Bt({queryKey:["shortcutsList",e,t],queryFn:({signal:n})=>S_({username:c(e),cameraname:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getShortcutsQuery"&&n.enabled)})}patchShortcutQuery(){return ut({mutationFn:C_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})},onError:e=>{console.log(e),this.toast.add({severity:"error",summary:this.t("components.toast.title_error"),detail:this.t("components.toast.error_see_console"),life:3e3})}})}removeShortcutQuery(){return ut({mutationFn:k_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})},onError:e=>{console.log(e),this.toast.add({severity:"error",summary:this.t("components.toast.title_error"),detail:this.t("components.toast.error_see_console"),life:3e3})}})}removeShortcutsQuery(){return ut({mutationFn:E_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})},onError:e=>{console.log(e),this.toast.add({severity:"error",summary:this.t("components.toast.title_error"),detail:this.t("components.toast.error_see_console"),life:3e3})}})}createViewQuery(){return ut({mutationFn:A_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.view_added"),life:3e3})}})}getViewQuery(e,t){return Bt({queryKey:["viewsList",e],queryFn:({signal:n})=>M_({username:c(e),viewid:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getUserQuery"&&n.enabled)})}getViewsQuery(e,t){return Bt({queryKey:["viewsList",e,t],queryFn:({signal:n})=>$_({username:c(e),parameter:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getViewsQuery"&&n.enabled)})}patchViewQuery(){return ut({mutationFn:oh,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.view_updated"),life:3e3})}})}patchViewQuerySilent(){return ut({mutationFn:oh,onSuccess:async(e,t)=>{await this._queryClient.invalidateQueries({queryKey:["viewsList",t.username]})}})}removeViewQuery(){return ut({mutationFn:P_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.view_removed"),life:3e3})}})}removeViewsQuery(){return ut({mutationFn:T_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.views_removed"),life:3e3})}})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}function kl(s,e,t,n=[]){if(Array.isArray(s)&&Array.isArray(e)){const r=t?t(s,e,void 0,s,e,n):void 0;return r!==void 0?r:[...s,...e]}if(typeof e!="object")return s;for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=s[r],o=e[r];n.push({key:r,sourceObject:s,targetObject:e}),Array.isArray(i)&&Array.isArray(o)?s[r]=[...i,...o]:typeof i=="object"&&i!==null&&typeof o=="object"&&o!==null?s[r]=kl({...i},o,t,n):s[r]=o,n.pop()}return s}function I_(s){return new Promise(e=>setTimeout(e,s))}function sa(s,e,t=!1){if(s===e)return!0;if((s===void 0||e===void 0||s===null||e===null)&&(s||e))return!1;const n=s==null?void 0:s.constructor.name,r=e==null?void 0:e.constructor.name;if(n!==r)return!1;if(n==="Array"&&r==="Array"){if(s.length!==e.length)return!1;if(t){const i=[...e];return s.every(o=>{const a=i.findIndex(l=>sa(o,l,t));return a===-1?!1:(i.splice(a,1),!0)})}else{let i=!0;for(let o=0;o<s.length;o++)if(!sa(s[o],e[o],t)){i=!1;break}return i}}if(n==="Object"&&r==="Object"){let i=!0;const o=Object.keys(s),a=Object.keys(e);if(o.length!==a.length)return!1;for(let l=0;l<o.length;l++)if(s[o[l]]&&e[o[l]]){if(s[o[l]]===e[o[l]])continue;if(s[o[l]]&&(s[o[l]].constructor.name==="Array"||s[o[l]].constructor.name==="Object")){if(i=sa(s[o[l]],e[o[l]],t),!i)break}else if(s[o[l]]!==e[o[l]]){i=!1;break}}else if(s[o[l]]&&!e[o[l]]||!s[o[l]]&&e[o[l]]){i=!1;break}return i}return s===e}const Fs=Mi("auth",()=>{const s=$i(),e=qr(),t=tl("user",null,{serializer:{read:K=>K?JSON.parse(K):null,write:K=>JSON.stringify(K)}}),n=Ls(null),r=Ls(null),i=Ls(null),o=ae(!1),a=ae(!1),l=ae(!1),u=ne(()=>t.value!==null),d=ne(()=>r.value!==null&&!i.value&&!o.value),h=ne(()=>{var K;return((K=t.value)==null?void 0:K.access_token)??null});Ge(s,()=>{a.value=!1},{deep:!0}),Ge(t,K=>{!a.value&&!sa(K,t.value)&&k()},{deep:!0});const v=async K=>{if(r.value)return r.value;o.value=!0,i.value=null;try{n.value||(n.value=new m_({endpoint:window.origin,token:K,skipCheck:!0,logger:{...console,attention:console.warn,success:console.log}}));const N=await n.value.connect();return r.value=N,N}catch(N){const E=N instanceof Error?N:new Error(String(N));throw i.value=E,E}finally{o.value=!1}},f=async()=>{n.value&&(await n.value.disconnect(),n.value=null,r.value=null,i.value=null,o.value=!1)},b=async K=>{if(!u.value){l.value=!1,a.value=!0;try{const N=await Vm({loginInformation:K});t.value=N,await v(N.access_token),e.push("/cameras")}finally{a.value=!1}}},k=async()=>{!u.value||l.value||(l.value=!0,a.value=!0,await f(),L(),await Hm(),t.value=null,e.push("/"),window.location.reload(),a.value=!1)},z=async()=>{if(!t.value)return;const K=await Qm({refresh_token:t.value.refresh_token});n.value&&await n.value.updateCredentials({endpoint:window.origin,token:K.access_token}),t.value.access_token=K.access_token},L=async()=>{try{if("serviceWorker"in navigator){const N=await(await navigator.serviceWorker.ready).pushManager.getSubscription();N&&await N.unsubscribe()}}catch{}},se=async(K,N)=>{t.value&&(K&&await wa({username:t.value.username,userData:K}),N&&await wa({username:t.value.username,userData:N}))};return u.value&&h.value&&v(h.value).catch(K=>{console.error("Error initializing API:",K)}),{isLoggedIn:u,isApiReady:d,loginLoading:a,api:r,apiError:i,accessToken:h,user:t,login:b,logout:k,refreshToken:z,updateUser:se,initializeApi:v,disconnectApi:f}}),Bi=(s,e="ddd., D. MMM. YY")=>(typeof s=="number"&&(s=new Date(s)),G0(s,e).value),Fr=(s="logo-512.png")=>{var r,i,o,a;if(s.startsWith("data:")||s.startsWith("blob:")||s.startsWith("http:")||s.startsWith("https:"))return s;if(s.startsWith(location.origin))return location.origin+s;if((s==="ERROR"||s==="")&&(s="logo-256.png"),s==="avatar"){const l=Fs(),u=(r=l.user)==null?void 0:r.avatar,d=(i=l.user)==null?void 0:i._id,h=(o=l.user)==null?void 0:o.access_token;if(h&&u)return`${location.origin}/api/files/${d}_avatar.jpeg?token=${h}`;s="logo-256.png"}if(s.includes("avatar")){const u=(a=Fs().user)==null?void 0:a.access_token;if(u)return`${location.origin}/api/files/${s}?token=${u}`;s="logo-256.png"}const t=`/src/assets/images/${s}`,n=Object.assign({"/src/assets/css/extras.css":Of,"/src/assets/css/inter.css":Nf,"/src/assets/css/main.css":Ff,"/src/assets/css/markdown.css":Lf,"/src/assets/css/tailwind.css":If,"/src/assets/css/theme.css":jf,"/src/assets/css/transitions.css":qf,"/src/assets/css/utils.css":Df,"/src/assets/images/error-256.png":r1,"/src/assets/images/logo-256.png":o1,"/src/assets/images/logo-512.png":c1,"/src/assets/images/logo.png":u1,"/src/assets/images/logo.svg":h1,"/src/assets/images/logo_animated.svg":p1,"/src/assets/images/logo_loading_circle.svg":g1});return n[t]?n[t].default:""},c9=async s=>new Promise(e=>{var n;s.preventDefault();const t=(n=s.target)==null?void 0:n.files;if(t){const r=t[0],i=new FileReader;r?(i.onload=o=>{var l,u;const a=(l=o.target)!=null&&l.result?(u=o.target)==null?void 0:u.result:void 0;e(a)},i.readAsDataURL(r)):e(void 0)}}),O_=(s=10)=>{const e=()=>Math.floor(Math.random()*25+10).toString(36);return Array.from({length:s},e).join("")};function xi(s,e=new WeakMap){if(typeof s!="object"||s===null)return s;if(e.has(s))return e.get(s);if(Array.isArray(s)){const n=[];return e.set(s,n),s.forEach((r,i)=>{n[i]=xi(r,e)}),n}const t={};return e.set(s,t),Object.keys(s).forEach(n=>{t[n]=xi(s[n],e)}),t}const Km=s=>{switch(s){case"error":return"error";case"info":return"info";case"success":return"success";case"warning":return"warn";default:return"info"}},l9=s=>{s||(s=new Date);const e=new Date(s);return e.setMilliseconds(0),e},u9=s=>{s||(s=new Date);const e=new Date(s);return e.setSeconds(0,0),e.setMilliseconds(0),e},N_=["src","alt"],F_=["src","alt","width","height"],L_=At({__name:"CuiImage",props:{src:{},alt:{default:"Image"},width:{default:"100%"},height:{default:"100%"},aspectRatio:{},cover:{type:Boolean},imageContainerClass:{},imageContainerStyle:{}},setup(s){const e=s,{src:t,width:n,height:r,aspectRatio:i,cover:o,imageContainerClass:a,imageContainerStyle:l}=Wt(e),u=ae(!1),d=ae(!1),h=ne(()=>d.value?Fr():Fr(t.value)),v=()=>{u.value=!0,d.value=!1},f=()=>{u.value=!1,d.value=!0},b=k=>k?typeof k=="number"?`${k}px`:k:"auto";return(k,z)=>{const L=Lr,se=T0;return m(),j(se,{alt:k.alt,class:"w-full h-full flex items-center justify-center"},{image:$(()=>[!c(u)&&!c(d)?(m(),j(L,{key:0,"stroke-width":"6",class:"w-[50%] h-[50%] max-w-[30px] max-h-[30px]"})):ce("",!0),Pt(g("div",{class:at(c(a)),style:ot(c(l))},[c(d)?ce("",!0):Pt((m(),A("img",{key:0,src:c(h),alt:k.alt,style:ot({width:b(c(n)),height:b(c(r)),aspectRatio:c(i),objectFit:c(o)?"cover":"contain"}),onLoad:v,onError:f},null,44,N_)),[[Pr,c(u)]]),c(d)?(m(),A("img",{key:1,src:c(h),alt:k.alt,width:c(n),height:c(r),class:"contain",style:ot({aspectRatio:c(i)})},null,12,F_)):ce("",!0)],6),[[Pr,c(u)||c(d)]])]),_:1},8,["alt"])}}}),Fa=qs(L_,[["__scopeId","data-v-6696d637"]]),j_=At({__name:"CuiAvatar",props:{src:{},showBorder:{type:Boolean,default:!0},size:{default:22}},setup(s){const e=s,{showBorder:t,size:n,src:r}=Wt(e);return(i,o)=>{const a=Fa;return m(),A("div",{class:at(["bg-neutral-900 overflow-hidden rounded-full",{"avatar-border":c(t)}])},[y(a,{src:c(r),height:c(n),width:c(n),cover:"","image-container-class":"w-full h-full"},null,8,["src","height","width"])],2)}}}),Zm=qs(j_,[["__scopeId","data-v-82af9e29"]]),q_={class:"flex items-center justify-center absolute left-3 h-full"},D_={key:0,class:"flex items-center shrink-0"},B_={key:1,class:"shrink-0"},z_={key:2,class:"shrink-0"},U_={key:0,class:"overflow-hidden flex-1 ml-10"},V_={class:"flex flex-row items-center justify-between"},H_={class:"text-start flex-1"},Q_={key:0,class:"text-xs text-muted"},K_=At({__name:"CuiNavItem",props:{label:{},to:{},expanded:{type:Boolean},description:{},icon:{},iconSize:{default:24},iconClass:{},labelClass:{},activeIcon:{},avatar:{},avatarSize:{default:24},showLogout:{type:Boolean},darkMode:{type:Boolean},buttonProps:{},showTooltip:{type:Boolean},fallbackActivePath:{}},setup(s){const e=Fs(),t=$i(),n=s,{icon:r,iconSize:i,iconClass:o,activeIcon:a,avatarSize:l,avatar:u,labelClass:d,label:h,description:v,expanded:f,to:b,showLogout:k,darkMode:z,buttonProps:L,showTooltip:se,fallbackActivePath:K}=Wt(n),N=ne(()=>t.path===b.value||b.value!=="/"&&(t.path.startsWith(b.value+"/")||t.path.startsWith((K.value??b.value)+"/"))),E=()=>{e.logout()};return(O,U)=>{const S=Zm,M=Yh,B=ys,W=Ei("RouterLink"),I=jr;return m(),j(W,{to:c(b)},{default:$(({isActive:w})=>[Pt((m(),j(B,et({text:"",severity:"secondary",class:["cui-button navitem-button w-full h-full flex items-center relative",{"dark-mode":c(z),"!text-primary navitem-active":(w||c(N))&&!c(u),"hover:!text-color active:!text-color focus:!text-color":!w&&!c(N)}],fluid:""},c(L)),{default:$(()=>[g("div",q_,[c(u)?(m(),A("div",D_,[y(S,{src:c(Fr)(c(u)),size:c(l),style:ot({width:`${c(l)}px`,height:`${c(l)}px`})},null,8,["src","size","style"])])):c(r)&&!w&&!c(N)||!c(a)?(m(),A("div",B_,[y(c(r),{class:at(c(o)),style:ot({width:`${c(i)}px`,height:`${c(i)}px`})},null,8,["class","style"])])):c(a)&&(w||c(N))?(m(),A("div",z_,[y(c(a),{style:ot({width:`${c(i)}px`,height:`${c(i)}px`})},null,8,["style"])])):ce("",!0)]),y(Et,{name:"fade"},{default:$(()=>[c(f)?(m(),A("div",U_,[g("div",V_,[g("div",H_,[g("div",{class:at(["text-sm max-w-100 truncate font-semibold",[c(d),{"text-color font-bold":c(u)}]])},me(c(h)),3),c(v)?(m(),A("div",Q_,me(c(v)),1)):ce("",!0)]),c(k)?(m(),j(B,{key:0,text:"",rounded:"",class:"dark-mode cui-icon-md",onClick:E},{icon:$(()=>[y(M,{width:"100%",height:"100%"})]),_:1})):ce("",!0)])])):ce("",!0)]),_:1})]),_:2},1040,["class"])),[[I,{value:c(se)&&!c(f)?c(h):"",pt:{root:{class:"dark-mode"}}}]])]),_:1},8,["to"])}}}),Gm=qs(K_,[["__scopeId","data-v-13c365f7"]]),Z_="modulepreload",G_=function(s){return"/"+s},ah={},vs=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let o=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=o(t.map(u=>{if(u=G_(u),u in ah)return;ah[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const v=document.createElement("link");if(v.rel=d?"stylesheet":Z_,d||(v.as="script"),v.crossOrigin="",v.href=u,l&&v.setAttribute("nonce",l),document.head.appendChild(v),d)return new Promise((f,b)=>{v.addEventListener("load",f),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},W_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J_(s,e){return m(),A("svg",W_,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m4 10l-.707.707L2.586 10l.707-.707zm17 8a1 1 0 1 1-2 0zM8.293 15.707l-5-5l1.414-1.414l5 5zm-5-6.414l5-5l1.414 1.414l-5 5zM4 9h10v2H4zm17 7v2h-2v-2zm-7-7a7 7 0 0 1 7 7h-2a5 5 0 0 0-5-5z"},null,-1)]))}const Y_=pe({name:"lets-icons-back",render:J_}),X_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e2(s,e){return m(),A("svg",X_,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8z"},null,-1)]))}const t2=pe({name:"mdi-home",render:e2}),s2={class:"relative flex items-center justify-center draggable-region"},n2={class:"container mx-auto px-6 relative z-10"},r2={class:"text-center"},i2={class:"text-8xl font-bold mb-4 relative flex items-center justify-center"},o2={class:"relative w-24 h-24 mx-2 group"},a2={class:"relative z-1 scale-150 non-draggable-region"},c2={class:"text-muted max-w-md mx-auto mb-8"},l2={class:"flex items-center justify-center gap-4"},u2={class:"text-white"},d2=At({__name:"404",setup(s){return(e,t)=>{const n=t2,r=ys,i=Ei("RouterLink"),o=Y_;return m(),A("div",s2,[g("div",n2,[g("div",r2,[g("h1",i2,[t[1]||(t[1]=g("span",null,"4",-1)),g("div",o2,[g("div",a2,[y(c($a),{src:c(Fr)("logo_animated.svg"),width:"95px",height:"80px",title:"camera.ui","aria-label":"camera.ui",class:"transform transition-transform duration-300 group-hover:scale-110"},null,8,["src"])])]),t[2]||(t[2]=g("span",null,"4",-1))]),t[3]||(t[3]=g("h2",{class:"text-3xl font-semibold mb-4"},"Oops!",-1)),g("p",c2,me(e.$t("views.404.error_message")),1),g("div",l2,[y(i,{to:"/"},{default:$(()=>[y(r,{class:"cui-button flex items-center gap-2 non-draggable-region"},{default:$(()=>[y(n,{class:"text-white"}),g("span",u2,me(e.$t("components.form.button.home")),1)]),_:1})]),_:1}),y(r,{severity:"secondary",class:"cui-button flex items-center gap-2 non-draggable-region",onClick:t[0]||(t[0]=a=>e.$router.back())},{default:$(()=>[y(o,{class:"text-muted"}),g("span",null,me(e.$t("components.form.button.back")),1)]),_:1})])])])])}}}),h2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m2(s,e){return m(),A("svg",h2,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.1.1 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.1 16.1 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.02.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02M8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12m6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12"},null,-1)]))}const p2=pe({name:"ic-baseline-discord",render:m2}),f2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g2(s,e){return m(),A("svg",f2,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"},null,-1)]))}const v2=pe({name:"mdi-github",render:g2});function Wm(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Jm=bt({enabled:xs().default(!1)}).strict(),_2=Os([we("animal"),we("person"),we("vehicle"),we("other"),we("motion")]),El=ff([xn(),xn()]),Al=bt({name:Ke().trim().min(1,"Zone Name is required"),points:El.array().min(3,"At least 3 points are required"),type:Os([we("intersect"),we("contain")]),filter:Os([we("include"),we("exclude")]),classes:_2.array(),isPrivacyMask:xs(),color:Ke().trim().regex(/^#([0-9A-Fa-f]{3}){1,2}$/,"Must be a valid hex color (e.g. #FF0000 or #F00)").default("#df2a4c")}).array(),Ym=bt({motion:bt({timeout:xn().min(10,"Minimum 10 seconds")}),object:bt({confidence:xn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),Ml=Os([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("snapshot")]),y2=Os([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("auto")]),Xm=Os([we("bubble://"),we("cui://"),we("doorbird://"),we("dvrip://"),we("echo:"),we("eseecloud://"),we("exec:"),we("expr:"),we("ffmpeg:"),we("flussonic://"),we("gopro://"),we("hass:"),we("homekit://"),we("http://"),we("https://"),we("httpx://"),we("isapi://"),we("ivideon:"),we("kasa://"),we("nest:"),we("onvif://"),we("ring:"),we("roborock://"),we("rtmp://"),we("rtsp://"),we("rtspx://"),we("tapo://"),we("tcp://"),we("tuya://"),we("webrtc:"),we("webtorrent:")]),b2=Xm.options.map(s=>s.value),w2=new RegExp(`^(${b2.join("|")})`),ep=Ke().refine(s=>{if(!w2.test(s))return!1;try{return new URL(s),!0}catch{return!1}},{message:"Invalid URL format or unsupported protocol"}),x2=bt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Ml,useForSnapshot:xs().default(!1),hotMode:xs().default(!1),urls:ep.array().min(1,"At least one valid URL is required")}).strict(),S2=bt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Ml,useForSnapshot:xs().default(!1),hotMode:xs().default(!1),urls:ep.array().min(1,"At least one valid URL is required")}).strict(),Cr=bt({id:Ke(),name:Ke().trim()}),tp=bt({hub:Cr.array().optional(),cameraController:Cr.optional(),motionDetection:Cr.optional(),audioDetection:Cr.optional(),objectDetection:Cr.optional(),ptz:Cr.optional(),plugins:Cr.array()}).strict(),C2=Os([we("auto"),we("mse"),we("webrtc"),we("webrtc/tcp")]),k2=Os([we("16:9"),we("8:3"),we("4:3"),we("auto")]),sp=bt({decoder:Os([we("pillow"),we("wasm"),we("rust"),we("gpu")]),fps:xn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Os([we("640x480"),we("640x360"),we("320x240"),we("320x180")])}),np=Os([we("camera"),we("doorbell")]),rp=bt({streamingMode:C2,streamingSource:y2,aspectRatio:k2}),ip=bt({model:Ke().trim().optional(),manufacturer:Ke().trim().optional(),hardware:Ke().trim().optional(),serialNumber:Ke().trim().optional(),firmwareVersion:Ke().trim().optional(),supportUrl:Ke().trim().optional()}),E2=bt({name:Ke().trim().min(1,"Camera name is required"),url:Ke().trim().url().min(1,"Camera URL is required"),type:Os([we("Google"),we("Ring"),we("HomeKit"),we("Onvif"),we("Hass"),we("GoPro"),we("Roborock"),we("FFmpeg"),we("DVRip"),we("Webtorrent")]),username:Ke().trim().optional(),email:Ke().trim().email().optional(),password:Ke().trim().optional(),pin:Ke().trim().length(8,{message:"PIN must be 8 characters long"}).optional(),clientId:Ke().trim().optional(),clientSecret:Ke().trim().optional(),refreshToken:Ke().trim().optional(),projectId:Ke().trim().optional()}).strict().refine(s=>s.type==="HomeKit"?!!s.pin:!0,{message:"PIN is required for HomeKit cameras",path:["pin"]}).refine(s=>s.type==="Google"?!!s.clientId:!0,{message:"Client ID is required for Google cameras",path:["clientId"]}).refine(s=>s.type==="Google"?!!s.clientSecret:!0,{message:"Client Secret is required for Google cameras",path:["clientSecret"]}).refine(s=>s.type==="Google"?!!s.projectId:!0,{message:"Project ID is required for Google cameras",path:["projectId"]}).refine(s=>s.type==="Google"?!!s.refreshToken:!0,{message:"Refresh Token is required for Google cameras",path:["refreshToken"]}).refine(s=>s.type==="Ring"?!!s.email:!0,{message:"Email is required",path:["email"]}).refine(s=>s.type==="Roborock"?!!s.username:!0,{message:"Username is required",path:["username"]}).refine(s=>s.type==="Roborock"||s.type==="Ring"?!!s.password:!0,{message:"Password is required",path:["password"]}),A2=bt({id:Ke(),name:Ke()}).strict(),M2=bt({_id:Ke().default(hn()).transform(()=>hn()),nativeId:Ke().trim().optional(),pluginInfo:A2.optional(),disabled:xs().default(!1),name:Ke().trim().min(1,"Camera name is required"),type:np.default("camera"),isCloud:xs().default(!1),snapshotTTL:xn().min(30,"Minimum cache time must be 30").default(600),info:ip.default({model:"IP Camera",manufacturer:"camera.ui",hardware:"Camera",serialNumber:"Unknown",firmwareVersion:"Unknown",supportUrl:"Unknown"}),sources:x2.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(t=>t.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.hotMode),{message:"Snapshot source can not be used with hotMode"}),extensions:tp.default({hub:[],plugins:[]}),recording:Jm.default({enabled:!1}),interface:rp.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:Al.default([]),detectionSettings:Ym.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:sp.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||Wm(e)?{...s,isCloud:!0}:s}),$2=bt({disabled:xs().optional(),type:np.optional(),name:Ke().trim().min(1,"Camera name is required").optional(),isCloud:xs().optional(),snapshotTTL:xn().min(30,"Minimum cache time must be 30").optional(),info:ip.partial().optional(),sources:S2.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(t=>t.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.hotMode),{message:"Snapshot source can not be used with hotMode"}).optional(),extensions:tp.partial().optional(),interface:rp.partial().optional(),recording:Jm.partial().optional(),detectionZones:Al.optional(),detectionSettings:Ym.partial().optional(),frameWorkerSettings:sp.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||Wm(e))return{...s,isCloud:!0}}return s});bt({url:Ke().trim()}).strict();const P2=/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/;var T2=(s=>(s.READY="ready",s.STARTING="starting",s.STARTED="started",s.STOPPING="stopping",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown",s.DISABLED="disabled",s))(T2||{});const ch=["image/jpeg","image/png"],lh=1024*1024*2,uh=["video/mp4","video/quicktime"],dh=1024*1024*10,hh=["audio/mpeg","audio/wav","audio/ogg"],mh=1024*1024*2;bt({pluginname:Ke().trim().refine(s=>P2.test(s),"Not a valid plugin name"),pluginversion:Ke().trim().optional().default("latest")}).strict();bt({actionId:Ke(),payload:ur()}).strict();ol(ur(),ur());bt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=lh:s.size<=lh,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?ch.includes(s.mimetype):ch.includes(s.type),".jpeg and .png files are accepted"),metadata:Hn().transform(s=>JSON.parse(s.value)),config:Hn().transform(s=>JSON.parse(s.value))});bt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=mh:s.size<=mh,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?hh.includes(s.mimetype):hh.includes(s.type),".mp3, .wav and .ogg files are accepted"),metadata:Hn().transform(s=>JSON.parse(s.value)),config:Hn().transform(s=>JSON.parse(s.value))});bt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=dh:s.size<=dh,"Max file size is 5 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?uh.includes(s.mimetype):uh.includes(s.type),".mp4 files are accepted"),config:Hn().transform(s=>JSON.parse(s.value))});ol(Ke(),ur());bt({key:Ke()}).strict();bt({key:Ke(),payload:ur()}).strict();bt({version:Ke().trim().optional().default("latest")}).strict();const R2=bt({mode:Os([we("disabled"),we("port-forward"),we("router-forward"),we("cloudflare"),we("custom-domain")]).default("disabled"),cloudflare:bt({tunnelToken:Ke().trim(),customDomain:Ke().trim(),tunnelUrl:Ke().trim(),tunnelCredentials:bt({username:Ke().trim(),password:Ke().trim()}).partial()}).partial().strict(),customDomain:bt({url:Ke().trim().optional()}).partial().strict()}).strict(),d9=bt({serverAddresses:Ke().trim().ip().array().default([]),remoteAccess:R2}).strict(),ph=["image/jpeg","image/jpg","image/png"],fh=1024*1024*5,op=bt({index:xn(),cameraId:Ke()}),ap=Os([we(1),we(4),we(6),we(7),we(9),we(10),we(12),we(13),we(15),we(16),we(20),we(26)]),I2=Os([we("dnd"),we("view")]),cp=bt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Layout name is required"),viewSize:ap,cameras:op.array(),type:I2});bt({name:Ke().trim().min(1,"Layout name is required"),viewSize:ap,cameras:op.array()}).partial().optional();const O2=bt({views:cp.array()}),N2=bt({_id:Ke().default(hn()).transform(()=>hn()),cameraId:Ke(),points:El});bt({cameraId:Ke(),points:El}).partial().optional();const F2=bt({shortcuts:N2.array()}),lp=bt({camview:O2,cameras:ol(Ke().trim(),F2)}),L2=bt({_id:Ke().default(hn()).transform(()=>hn()),username:Ke().trim().min(1,"Username is required"),password:Ke().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters"),passwordConfirm:Ke().trim().min(1,"Please confirm your password"),role:Os([we("admin"),we("user")]),sessionTimer:xn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").default(14400),rememberMe:xs().default(!1),singleSession:xs().default(!1),firstLogin:xs().default(!0),preferences:lp.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),j2=bt({username:Ke().trim().min(1,"Username is required"),password:Ke().trim().min(1,"Password is required"),rememberMe:xs().default(!1)}).strict(),q2=bt({username:Ke().trim().min(1,"Username is required").optional(),password:Ke().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters").optional(),passwordConfirm:Ke().trim().optional(),role:Os([we("admin"),we("user")]).optional(),sessionTimer:xn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").optional(),upload:gf(Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=fh:s.size<=fh,"Max file size is 5MB.").refine(s=>(t=>t.mimetype!==void 0)(s)?ph.includes(s.mimetype):ph.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:xs().optional(),singleSession:xs().optional(),firstLogin:xs().optional(),preferences:lp.partial().optional()}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"});function na(s,e,t=!1){if(s===e)return!0;if((s===void 0||e===void 0||s===null||e===null)&&(s||e))return!1;const n=s==null?void 0:s.constructor.name,r=e==null?void 0:e.constructor.name;if(n!==r)return!1;if(n==="Array"&&r==="Array"){if(s.length!==e.length)return!1;if(t){const i=[...e];return s.every(o=>{const a=i.findIndex(l=>na(o,l,t));return a===-1?!1:(i.splice(a,1),!0)})}else{let i=!0;for(let o=0;o<s.length;o++)if(!na(s[o],e[o],t)){i=!1;break}return i}}if(n==="Object"&&r==="Object"){let i=!0;const o=Object.keys(s),a=Object.keys(e);if(o.length!==a.length)return!1;for(let l=0;l<o.length;l++)if(s[o[l]]&&e[o[l]]){if(s[o[l]]===e[o[l]])continue;if(s[o[l]]&&(s[o[l]].constructor.name==="Array"||s[o[l]].constructor.name==="Object")){if(i=na(s[o[l]],e[o[l]],t),!i)break}else if(s[o[l]]!==e[o[l]]){i=!1;break}}else if(s[o[l]]&&!e[o[l]]||!s[o[l]]&&e[o[l]]){i=!1;break}return i}return s===e}const ar=s=>s.type==="string"&&!("enum"in s),gh=s=>s.type==="number",vh=s=>s.type==="boolean",xa=s=>s.type==="string"&&"enum"in s,_h=s=>s.type==="array",zr=s=>s.type==="button",Ur=s=>s.type==="submit",D2=s=>ar(s)&&(!s.format||s.format!=="qrCode"&&s.format!=="image"),B2=(s,e)=>{if(!s||Object.keys(s).length===0)return!0;const t=e.filter(n=>!zr(n)&&!Ur(n));for(const n of t){const r=ni(s,n.key),i=$l(n);if(r!==void 0&&!na(r,i,!0))return!1}return!0},$l=s=>{if("defaultValue"in s&&s.defaultValue!==void 0)return s.defaultValue;switch(s.type){case"string":return xa(s)?s.multiple?[]:s.required?s.enum[0]:"":"";case"number":return 0;case"boolean":return!1;case"array":return[];default:return}},z2=s=>{const e={};for(const t of s)zr(t)||Ur(t)||(e[t.key]=$l(t));return e},ni=(s={},e)=>{if(!e.includes(".")&&!e.includes("["))return s[e];const t=e.split(".").reduce((r,i)=>{if(i.includes("[")){const[o,a]=i.split("[");r.push(o,a.slice(0,-1))}else r.push(i);return r},[]);let n=s;for(const r of t){if(n==null)return;n=n[r]}return n},ic=(s,e,t)=>{if(!e.includes(".")&&!e.includes("[")){s[e]=t;return}const n=e.split(".").reduce((o,a)=>{if(a.includes("[")){const[l,u]=a.split("[");o.push(l,u.slice(0,-1))}else o.push(a);return o},[]),r=n.pop();if(!r)return;let i=s;for(const o of n){if(i[o]===void 0||i[o]===null){const a=n[n.indexOf(o)+1];i[o]=isNaN(Number(a))?{}:[]}i=i[o]}i[r]=t},h9=(s,e)=>{const t={};for(const n of s)if("store"in n&&n.store&&!zr(n)&&!Ur(n)){const r=ni(e,n.key);r!==void 0&&(t[n.key]=r)}return t},up=(s,e)=>e?s.filter(t=>"group"in t&&t.group===e):s,U2=(s,e)=>{const t=up(s,e);return t.length>0&&t.every(n=>"readonly"in n&&n.readonly)},V2=(s,e)=>{const t=up(s,e);return t.length>0&&t.some(n=>"store"in n&&n.store)},H2=(s,e)=>{if(!e)return!0;const t={"date-time":n=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?(Z|[+-]\d{2}:\d{2})?$/.test(n),date:n=>/^\d{4}-\d{2}-\d{2}$/.test(n),time:n=>/^([01]?[0-9]|2[0-3]):([0-5][0-9])(:([0-5][0-9]))?$/.test(n),email:n=>/^\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b$/.test(n),uuid:n=>/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/.test(n),ipv4:n=>/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/.test(n),ipv6:n=>/^\s*([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})\s*$/.test(n)};return e in t?t[e](s):!0},dp=s=>{if(zr(s)||Ur(s))return ur();switch(s.type){case"string":if(xa(s))if(s.multiple){let i=Su(Ke().trim().refine(o=>s.enum.includes(o),{message:"Invalid selection"}));return s.required&&(i=i.min(1,{message:"Required"})),s.required?i:i.optional()}else{const i=vf(s.enum);return s.required?i:i.optional()}let e=Ke().trim();return s.required&&(e=e.nonempty("Required")),s.minLength!==void 0&&(e=e.min(s.minLength)),s.maxLength!==void 0&&(e=e.max(s.maxLength)),s.format&&(e=e.refine(i=>!i||i.trim()===""||H2(i,s.format),{message:`Invalid ${s.format} format`})),s.required?e:e.optional();case"number":let t=xn();return s.minimum!==void 0&&(t=t.min(s.minimum)),s.maximum!==void 0&&(t=t.max(s.maximum)),s.required&&(t=t.refine(i=>i!=null,{message:"Required"})),s.required?t:t.optional();case"boolean":return s.required?xs():xs().optional();case"array":const n=dp(s.items),r=Su(n);return s.required?r:r.optional();default:return s.required?ur():ur().optional()}},Q2=s=>{const e={};return s.forEach(t=>{!zr(t)&&!Ur(t)&&(e[t.key]=dp(t))}),bt(e)},K2=Wn(j2),m9=Wn(L2),p9=Wn(q2),f9=Wn(cp),Z2={class:"flex justify-center items-center draggable-region"},G2={class:"card-background border-color relative w-full md:w-[400px] rounded-none md:rounded-2xl md:border-[1px] shadow-none md:shadow-xl h-full md:h-auto md:my-4"},W2={class:"flex flex-col h-full p-10 non-draggable-region"},J2={class:"flex flex-col items-center justify-center mb-10"},Y2={class:"flex flex-col gap-10 md:gap-6 w-full mt-10 md:mt-0"},X2={for:"username",class:"cui-label"},ey={for:"password",class:"cui-label"},ty={class:"flex flex-col gap-6 mt-10"},sy={class:"flex items-center field-checkbox-gap"},ny={for:"rememberMe",class:"cui-label-checkbox"},ry={class:"flex justify-end items-center gap-1"},iy=At({__name:"Login",setup(s){const e=Cn(),t=Fs(),{t:n}=js(),{loginLoading:r}=Vs(t),i=Vt("formRef"),o=ae(""),a=ae(""),l=ae(!1),u=async()=>{var h;const d=await((h=i.value)==null?void 0:h.validate());if(d!=null&&d.valid&&d.values)try{await t.login({username:o.value,password:a.value,rememberMe:l.value})}catch(v){console.error(v),e.add({severity:"error",summary:n("components.toast.title_error"),detail:v.message,life:3e3}),r.value=!1}};return(d,h)=>{const v=ki,f=Fh,b=R0,k=ys,z=Ea,L=v2,se=p2;return m(),A("div",Z2,[g("div",G2,[g("div",W2,[g("div",J2,[y(c($a),{src:c(Fr)("logo_animated.svg"),height:"60px",title:"camera.ui","aria-label":"camera.ui",class:"hover:scale-105 active:scale-105 focus:scale-105 transition-all"},null,8,["src"]),h[3]||(h[3]=g("span",{class:"text-2xl ml-3 mt-2 font-bold text-color"},"camera.ui",-1))]),y(c(il),{ref_key:"formRef",ref:i,"validation-schema":c(K2),class:"flex flex-col h-full",onSubmit:u},{default:$(()=>[g("div",Y2,[y(c(Lt),{modelValue:c(o),"onUpdate:modelValue":h[0]||(h[0]=K=>us(o)?o.value=K:null),modelModifiers:{trim:!0},name:"username",as:"div",class:"flex flex-col field-gap"},{default:$(({field:K,errors:N})=>[g("label",X2,me(d.$t("components.form.label.username")),1),y(v,et({invalid:N.length>0,type:"text",size:"large",loading:c(r),fluid:""},K),null,16,["invalid","loading"]),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"username",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:c(a),"onUpdate:modelValue":h[1]||(h[1]=K=>us(a)?a.value=K:null),name:"password",as:"div",class:"flex flex-col field-gap"},{default:$(({field:K,errors:N})=>[g("label",ey,me(d.$t("components.form.label.password")),1),y(f,et({invalid:N.length>0,size:"large",loading:c(r),feedback:!1,"toggle-mask":"",fluid:""},K),null,16,["invalid","loading"]),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"password",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])]),g("div",ty,[y(c(Lt),{"model-value":c(l),name:"rememberMe",type:"checkbox","checked-value":!0,"unchecked-value":!1,as:"div",class:"flex flex-col field-gap"},{default:$(({field:K,errors:N})=>[g("div",sy,[y(b,et({"model-value":c(l)},K,{invalid:N.length>0,class:"mr-2",binary:"",loading:c(r),onValueChange:h[2]||(h[2]=E=>l.value=E)}),null,16,["model-value","invalid","loading"]),g("label",ny,me(d.$t("components.form.label.remember_me")),1)]),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"rememberMe",class:"cui-input-checkbox-error"})]),_:1})]),_:1},8,["model-value"]),y(k,{type:"submit",class:"text-white font-semibold cui-button-large",loading:c(r),label:d.$t("components.form.button.login"),fluid:""},null,8,["loading","label"])])]),_:1},8,["validation-schema"]),y(z,{class:"mt-15"}),g("div",ry,[y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(L,{class:"text-muted",width:"100%",height:"100%"})]),_:1}),y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(se,{class:"text-muted",width:"100%",height:"100%"})]),_:1})])]),h[4]||(h[4]=g("div",{class:"bg-primary-500 opacity-0 md:opacity-100 absolute blur-3xl w-[200px] h-[30px] left-[50%] -translate-x-[50%] bottom-0 -z-1"},null,-1))])])}}}),hp=Mi("loading",()=>({routerLoading:ae(!1)})),oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ay(s,e){return m(),A("svg",oy,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M9 13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2zM9 3a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"})],-1)]))}const yh=pe({name:"mingcute-grid-fill",render:ay}),cy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ly(s,e){return m(),A("svg",cy,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M9 13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 1.995 1.85L21 15v4a2 2 0 0 1-1.85 1.995L19 21h-4a2 2 0 0 1-1.995-1.85L13 19v-4a2 2 0 0 1 1.85-1.995L15 13zM9 15H5v4h4zm10 0h-4v4h4zm0-12a2 2 0 0 1 1.995 1.85L21 5v4a2 2 0 0 1-1.85 1.995L19 11h-4a2 2 0 0 1-1.995-1.85L13 9V5a2 2 0 0 1 1.85-1.995L15 3zM9 3a2 2 0 0 1 1.995 1.85L11 5v4a2 2 0 0 1-1.85 1.995L9 11H5a2 2 0 0 1-1.995-1.85L3 9V5a2 2 0 0 1 1.85-1.995L5 3zm10 2h-4v4h4zM9 5H5v4h4z"})],-1)]))}const bh=pe({name:"mingcute-grid-line",render:ly}),uy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dy(s,e){return m(),A("svg",uy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.916 9.564a1 1 0 0 0-.513-1.316L7.328 2.492c-.995-.438-2.22.051-2.645 1.042l-2.21 5.154a2 2 0 0 0 1.052 2.624L9.563 13.9L8.323 17H4v-3H2v8h2v-3h4.323c.823 0 1.552-.494 1.856-1.258l1.222-3.054l5.205 2.23a1 1 0 0 0 1.31-.517l.312-.71l1.701.68l2-5l-1.536-.613zm-4.434 5.126L4.313 9.475l2.208-5.152l12.162 5.354z"},null,-1)]))}const wh=pe({name:"bx-cctv",render:dy}),hy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function my(s,e){return m(),A("svg",hy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M18.618 7.462L6.403 2.085a1 1 0 0 0-.77-.016a1 1 0 0 0-.552.537l-3 7a1 1 0 0 0 .525 1.313L9.563 13.9L8.323 17H4v-3H2v8h2v-3h4.323c.823 0 1.552-.494 1.856-1.258l1.222-3.054l3.419 1.465a1 1 0 0 0 1.311-.518l3-6.857a1 1 0 0 0-.513-1.316m1.312 8.91l-1.858-.742l1.998-5l1.858.741z"},null,-1)]))}const zc=pe({name:"bxs-cctv",render:my}),py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fy(s,e){return m(),A("svg",py,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M21 10V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h6v-1.87l8.39-8.39c.44-.44 1-.68 1.61-.74m-7-5.5l5.5 5.5H14zm8.85 9.69l-.98.98l-2.04-2.04l.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72m-3.72-.36l2.04 2.04L15.04 22H13v-2.04z"},null,-1)]))}const xh=pe({name:"mdi-note-edit",render:fy}),gy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vy(s,e){return m(),A("svg",gy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h6v-1.87l.13-.13H5V5h7v7zM14 4.5l5.5 5.5H14zm5.13 9.33l2.04 2.04L15.04 22H13v-2.04zm3.72.36l-.98.98l-2.04-2.04l.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72"},null,-1)]))}const Sh=pe({name:"mdi-note-edit-outline",render:vy}),_y={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yy(s,e){return m(),A("svg",_y,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h3a1 1 0 0 0 1-1V5a2 2 0 0 1 4 0v1a1 1 0 0 0 1 1h3a1 1 0 0 1 1 1v3a1 1 0 0 0 1 1h1a2 2 0 0 1 0 4h-1a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"},null,-1)]))}const Ch=pe({name:"tabler-puzzle",render:yy}),by={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wy(s,e){return m(),A("svg",by,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 2a3 3 0 0 1 2.995 2.824L13 5v1h3a2 2 0 0 1 1.995 1.85L18 8v3h1a3 3 0 0 1 .176 5.995L19 17h-1v3a2 2 0 0 1-1.85 1.995L16 22h-3a2 2 0 0 1-1.995-1.85L11 20v-1a1 1 0 0 0-1.993-.117L9 19v1a2 2 0 0 1-1.85 1.995L7 22H4a2 2 0 0 1-1.995-1.85L2 20v-3a2 2 0 0 1 1.85-1.995L4 15h1a1 1 0 0 0 .117-1.993L5 13H4a2 2 0 0 1-1.995-1.85L2 11V8a2 2 0 0 1 1.85-1.995L4 6h3V5a3 3 0 0 1 3-3"},null,-1)]))}const Uc=pe({name:"tabler-puzzle-filled",render:wy}),xy={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function Sy(s,e){return m(),A("svg",xy,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"4"},[g("rect",{width:"40",height:"32",x:"4",y:"8",rx:"2"}),g("path",{"stroke-linecap":"round",d:"m12 18l7 6l-7 6m11 2h13"})],-1)]))}const kh=pe({name:"icon-park-outline-terminal",render:Sy}),Cy={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},ky=["id"],Ey=["mask"];function Ay(s,e){return m(),A("svg",Cy,[g("defs",null,[g("mask",{id:s.idMap.ipSTerminal0},e[0]||(e[0]=[g("g",{fill:"none","stroke-linejoin":"round","stroke-width":"4"},[g("rect",{width:"40",height:"32",x:"4",y:"8",fill:"#fff",stroke:"#fff",rx:"2"}),g("path",{stroke:"#000","stroke-linecap":"round",d:"m12 18l7 6l-7 6m11 2h13"})],-1)]),8,ky)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSTerminal0+")"},null,8,Ey)])}const Eh=pe({name:"icon-park-solid-terminal",render:Ay,setup(){return{idMap:{ipSTerminal0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),My={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $y(s,e){return m(),A("svg",My,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M5 3a3 3 0 0 0-3 3v10a2 2 0 0 0 2 2V6a1 1 0 0 1 1-1h14a2 2 0 0 0-2-2zm0 5a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v11.333a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2zm15 0H7v7.848L10.848 12a1.25 1.25 0 0 1 1.768 0l3.241 3.24l.884-.883a1.25 1.25 0 0 1 1.768 0L20 15.848zm-2 3a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0"})],-1)]))}const oc=pe({name:"mingcute-photo-album-fill",render:$y}),Py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ty(s,e){return m(),A("svg",Py,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M20 6a2 2 0 0 1 2 2v11.333a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zm-8.268 7.944L7.136 18.54l-.066.06l-.07.054v.68h13v-.68l-.07-.053l-.066-.06l-2.24-2.24l-.353.354l.055.055a1 1 0 0 1-1.32 1.497l-.094-.083zM17 3a2 2 0 0 1 1.995 1.85L19 5H5a1 1 0 0 0-.993.883L4 6v12a2 2 0 0 1-1.995-1.85L2 16V6a3 3 0 0 1 2.824-2.995L5 3zm3 5H7v7.848L10.848 12a1.25 1.25 0 0 1 1.768 0l3.241 3.24l.884-.883a1.25 1.25 0 0 1 1.768 0L20 15.848zm-3.5 1.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3"})],-1)]))}const ac=pe({name:"mingcute-photo-album-line",render:Ty}),Ry={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Iy(s,e){return m(),A("svg",Ry,e[0]||(e[0]=[g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.464 3.464C2 4.93 2 7.286 2 12s0 7.071 1.464 8.535C4.93 22 7.286 22 12 22s7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536C19.072 2 16.714 2 12 2S4.929 2 3.464 3.464m14.112 7.016a.75.75 0 0 0-1.152-.96l-1.797 2.156c-.37.445-.599.716-.786.885a.8.8 0 0 1-.163.122l-.011.005l-.008-.004l-.003-.001a.8.8 0 0 1-.164-.122c-.187-.17-.415-.44-.786-.885l-.292-.35c-.328-.395-.625-.75-.901-1c-.301-.272-.68-.514-1.18-.514s-.878.242-1.18.514c-.276.25-.572.605-.9 1l-1.83 2.194a.75.75 0 1 0 1.153.96l1.797-2.156c.37-.445.599-.716.786-.885a.8.8 0 0 1 .163-.122l.007-.003l.004-.002l.011.005a.8.8 0 0 1 .164.122c.187.17.415.44.786.885l.292.35c.329.395.625.75.901 1c.301.272.68.514 1.18.514s.878-.242 1.18-.514c.276-.25.572-.605.9-1z","clip-rule":"evenodd"},null,-1)]))}const Ah=pe({name:"solar-graph-bold",render:Iy}),Oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ny(s,e){return m(),A("svg",Oy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17.576 10.48a.75.75 0 0 0-1.152-.96l-1.797 2.156c-.37.445-.599.716-.786.885a.8.8 0 0 1-.163.122l-.011.005l-.011-.005a.8.8 0 0 1-.164-.122c-.187-.17-.415-.44-.786-.885l-.292-.35c-.328-.395-.625-.75-.901-1c-.301-.272-.68-.514-1.18-.514s-.878.242-1.18.514c-.276.25-.572.605-.9 1l-1.83 2.194a.75.75 0 1 0 1.153.96l1.797-2.156c.37-.445.599-.716.786-.885a.8.8 0 0 1 .163-.122l.011-.005l.011.005a.8.8 0 0 1 .164.122c.187.17.415.44.786.885l.292.35c.329.395.625.75.901 1c.301.272.68.514 1.18.514s.878-.242 1.18-.514c.276-.25.572-.605.9-1z"},null,-1),g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11.943 1.25c-2.309 0-4.118 0-5.53.19c-1.444.194-2.584.6-3.479 1.494c-.895.895-1.3 2.035-1.494 3.48c-.19 1.411-.19 3.22-.19 5.529v.114c0 2.309 0 4.118.19 5.53c.194 1.444.6 2.584 1.494 3.479c.895.895 2.035 1.3 3.48 1.494c1.411.19 3.22.19 5.529.19h.114c2.309 0 4.118 0 5.53-.19c1.444-.194 2.584-.6 3.479-1.494c.895-.895 1.3-2.035 1.494-3.48c.19-1.411.19-3.22.19-5.529v-.114c0-2.309 0-4.118-.19-5.53c-.194-1.444-.6-2.584-1.494-3.479c-.895-.895-2.035-1.3-3.48-1.494c-1.411-.19-3.22-.19-5.529-.19zM3.995 3.995c.57-.57 1.34-.897 2.619-1.069c1.3-.174 3.008-.176 5.386-.176s4.086.002 5.386.176c1.279.172 2.05.5 2.62 1.069c.569.57.896 1.34 1.068 2.619c.174 1.3.176 3.008.176 5.386s-.002 4.086-.176 5.386c-.172 1.279-.5 2.05-1.069 2.62c-.57.569-1.34.896-2.619 1.068c-1.3.174-3.008.176-5.386.176s-4.086-.002-5.386-.176c-1.279-.172-2.05-.5-2.62-1.069c-.569-.57-.896-1.34-1.068-2.619c-.174-1.3-.176-3.008-.176-5.386s.002-4.086.176-5.386c.172-1.279.5-2.05 1.069-2.62","clip-rule":"evenodd"},null,-1)]))}const Mh=pe({name:"solar-graph-outline",render:Ny}),Fy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ly(s,e){return m(),A("svg",Fy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 3c-1.654 0-3 1.346-3 3c0 .502.136.968.354 1.385l-1.116 1.302A4 4 0 0 0 13 8c-.739 0-1.425.216-2.02.566L9.566 7.152A3.45 3.45 0 0 0 10 5.5C10 3.57 8.43 2 6.5 2S3 3.57 3 5.5S4.57 9 6.5 9c.601 0 1.158-.166 1.652-.434L9.566 9.98A3.97 3.97 0 0 0 9 12c0 .997.38 1.899.985 2.601l-1.692 1.692l.025.025A2.96 2.96 0 0 0 7 16c-1.654 0-3 1.346-3 3s1.346 3 3 3s3-1.346 3-3c0-.476-.121-.919-.318-1.318l.025.025l1.954-1.954c.421.15.867.247 1.339.247c2.206 0 4-1.794 4-4a3.96 3.96 0 0 0-.439-1.785l1.253-1.462c.364.158.764.247 1.186.247c1.654 0 3-1.346 3-3s-1.346-3-3-3M7 20a1 1 0 1 1 0-2a1 1 0 0 1 0 2M5 5.5C5 4.673 5.673 4 6.5 4S8 4.673 8 5.5S7.327 7 6.5 7S5 6.327 5 5.5m8 8.5c-1.103 0-2-.897-2-2s.897-2 2-2s2 .897 2 2s-.897 2-2 2m6-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2"},null,-1)]))}const $h=pe({name:"bx-network-chart",render:Ly}),jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qy(s,e){return m(),A("svg",jy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19.5 3A2.5 2.5 0 0 0 17 5.5c0 .357.078.696.214 1.005l-1.955 2.199A4 4 0 0 0 13 8c-.74 0-1.424.216-2.019.566L8.707 6.293l-.023.023C8.88 5.918 9 5.475 9 5a3 3 0 1 0-3 3c.475 0 .917-.12 1.316-.316l-.023.023L9.567 9.98A3.96 3.96 0 0 0 9 12c0 .997.38 1.899.985 2.601l-2.577 2.576A2.5 2.5 0 0 0 6.5 17C5.122 17 4 18.121 4 19.5S5.122 22 6.5 22S9 20.879 9 19.5c0-.321-.066-.626-.177-.909l2.838-2.838c.421.15.867.247 1.339.247c2.206 0 4-1.794 4-4c0-.636-.163-1.229-.428-1.764l2.117-2.383c.256.088.526.147.811.147C20.879 8 22 6.879 22 5.5S20.879 3 19.5 3M13 14c-1.103 0-2-.897-2-2s.897-2 2-2s2 .897 2 2s-.897 2-2 2"},null,-1)]))}const Ph=pe({name:"bxs-network-chart",render:qy}),Dy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function By(s,e){return m(),A("svg",Dy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97s-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1s.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64z"},null,-1)]))}const Sa=pe({name:"mdi-cog",render:By}),zy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Uy(s,e){return m(),A("svg",zy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z"},null,-1)]))}const Vc=pe({name:"mdi-cog-outline",render:Uy}),Vy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hy(s,e){return m(),A("svg",Vy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 19.2c-2.5 0-4.71-1.28-6-3.2c.03-2 4-3.1 6-3.1s5.97 1.1 6 3.1a7.23 7.23 0 0 1-6 3.2M12 5a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3m0-3A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10c0-5.53-4.5-10-10-10"},null,-1)]))}const Qy=pe({name:"mdi-account-circle",render:Hy}),Ky={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zy(s,e){return m(),A("svg",Ky,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2M7.07 18.28c.43-.9 3.05-1.78 4.93-1.78s4.5.88 4.93 1.78A7.9 7.9 0 0 1 12 20c-1.86 0-3.57-.64-4.93-1.72m11.29-1.45c-1.43-1.74-4.9-2.33-6.36-2.33s-4.93.59-6.36 2.33A7.93 7.93 0 0 1 4 12c0-4.41 3.59-8 8-8s8 3.59 8 8c0 1.82-.62 3.5-1.64 4.83M12 6c-1.94 0-3.5 1.56-3.5 3.5S10.06 13 12 13s3.5-1.56 3.5-3.5S13.94 6 12 6m0 5a1.5 1.5 0 0 1-1.5-1.5A1.5 1.5 0 0 1 12 8a1.5 1.5 0 0 1 1.5 1.5A1.5 1.5 0 0 1 12 11"},null,-1)]))}const Gy=pe({name:"mdi-account-circle-outline",render:Zy}),Wy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jy(s,e){return m(),A("svg",Wy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.97 7.27a.996.996 0 0 0 0-1.41l-2.83-2.83a.996.996 0 0 0-1.41 0l-4.49 4.49l-3.89-3.89c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l3.89 3.89L3 16.76V21h4.24l4.52-4.52l3.89 3.89c.95.95 2.23.6 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83l-3.89-3.89zM5.04 6.94l1.89-1.9L8.2 6.31L7.02 7.5l1.41 1.41l1.19-1.19l1.2 1.2l-1.9 1.9zm11.23 7.44l-1.19 1.19l1.41 1.41l1.19-1.19l1.27 1.27l-1.9 1.9l-3.89-3.89l1.9-1.9zM6.41 19H5v-1.41l9.61-9.61l1.3 1.3l.11.11zm9.61-12.44l1.41-1.41l1.41 1.41l-1.41 1.41z"},null,-1)]))}const Yy=pe({name:"ic-outline-design-services",render:Jy}),Xy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eb(s,e){return m(),A("svg",Xy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m16.24 11.51l1.57-1.57l-3.75-3.75l-1.57 1.57l-4.14-4.13c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l4.13 4.13l-4.6 4.61q-.15.15-.15.36v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15l4.62-4.62l4.13 4.13c1.32 1.32 2.76.07 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83zm-7.06-.44L5.04 6.94l1.89-1.9L8.2 6.31l-.47.49a.996.996 0 1 0 1.41 1.41l.48-.48l1.45 1.45zm7.88 7.89l-4.13-4.13l1.9-1.9l1.45 1.45l-.48.48a.996.996 0 1 0 1.41 1.41l.48-.48l1.27 1.27zm3.65-11.92a.996.996 0 0 0 0-1.41l-2.34-2.34c-.47-.47-1.12-.29-1.41 0l-1.83 1.83l3.75 3.75z"},null,-1)]))}const tb=pe({name:"ic-round-design-services",render:eb}),sb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nb(s,e){return m(),A("svg",sb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M16 17v2H2v-2s0-4 7-4s7 4 7 4m-3.5-9.5A3.5 3.5 0 1 0 9 11a3.5 3.5 0 0 0 3.5-3.5m3.44 5.5A5.32 5.32 0 0 1 18 17v2h4v-2s0-3.63-6.06-4M15 4a3.4 3.4 0 0 0-1.93.59a5 5 0 0 1 0 5.82A3.4 3.4 0 0 0 15 11a3.5 3.5 0 0 0 0-7"},null,-1)]))}const rb=pe({name:"mdi-users",render:nb}),ib={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ob(s,e){return m(),A("svg",ib,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M13.07 10.41a5 5 0 0 0 0-5.82A3.4 3.4 0 0 1 15 4a3.5 3.5 0 0 1 0 7a3.4 3.4 0 0 1-1.93-.59M5.5 7.5A3.5 3.5 0 1 1 9 11a3.5 3.5 0 0 1-3.5-3.5m2 0A1.5 1.5 0 1 0 9 6a1.5 1.5 0 0 0-1.5 1.5M16 17v2H2v-2s0-4 7-4s7 4 7 4m-2 0c-.14-.78-1.33-2-5-2s-4.93 1.31-5 2m11.95-4A5.32 5.32 0 0 1 18 17v2h4v-2s0-3.63-6.06-4Z"},null,-1)]))}const ab=pe({name:"mdi-users-outline",render:ob}),cb={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function lb(s,e){return m(),A("svg",cb,e[0]||(e[0]=[Vh('<path fill="currentColor" d="M6 22h24v2H6z" class="clr-i-outline clr-i-outline-path-1"></path><path fill="currentColor" d="M26 26h4v2h-4z" class="clr-i-outline clr-i-outline-path-2"></path><path fill="currentColor" d="M13 9.92L17 6v13a1 1 0 1 0 2 0V6l4 3.95a1 1 0 1 0 1.38-1.45L18 2.16L11.61 8.5A1 1 0 0 0 13 9.92" class="clr-i-outline clr-i-outline-path-3"></path><path fill="currentColor" d="M30.84 13.37A1.94 1.94 0 0 0 28.93 12H21v2h7.95c1.05 2.94 2.77 7.65 3.05 8.48V30H4v-7.52C4.28 21.65 7.05 14 7.05 14H15v-2H7.07a1.92 1.92 0 0 0-1.9 1.32C2 22 2 22.1 2 22.33V30a2 2 0 0 0 2 2h28a2 2 0 0 0 2-2v-7.67c0-.23 0-.33-3.16-8.96" class="clr-i-outline clr-i-outline-path-4"></path><path fill="none" d="M0 0h36v36H0z"></path>',5)]))}const ub=pe({name:"clarity-backup-restore-line",render:lb}),db={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function hb(s,e){return m(),A("svg",db,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M2 24v6a2 2 0 0 0 2 2h28a2 2 0 0 0 2-2v-6Zm28 5h-4v-2h4Z",class:"clr-i-solid clr-i-solid-path-1"},null,-1),g("path",{fill:"currentColor",d:"M30.84 13.37A1.94 1.94 0 0 0 28.93 12H21v6a3 3 0 1 1-6 0v-6H7.07a1.92 1.92 0 0 0-1.9 1.32c-2.31 6.36-2.93 8.11-3.1 8.68h31.86c-.16-.57-.79-2.31-3.09-8.63",class:"clr-i-solid clr-i-solid-path-2"},null,-1),g("path",{fill:"currentColor",d:"M13 9.92L17 6v12a1 1 0 1 0 2 0V6l4 3.95a1 1 0 1 0 1.38-1.45L18 2.16L11.61 8.5A1 1 0 0 0 13 9.92",class:"clr-i-solid clr-i-solid-path-3"},null,-1),g("path",{fill:"none",d:"M0 0h36v36H0z"},null,-1)]))}const mb=pe({name:"clarity-backup-restore-solid",render:hb}),pb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fb(s,e){return m(),A("svg",pb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.5 20q-2.275 0-3.887-1.575T1 14.575q0-1.95 1.175-3.475T5.25 9.15q.625-2.3 2.5-3.725T12 4q2.925 0 4.963 2.038T19 11q1.725.2 2.863 1.488T23 15.5q0 1.875-1.312 3.188T18.5 20z"},null,-1)]))}const gb=pe({name:"material-symbols-cloud",render:fb}),vb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _b(s,e){return m(),A("svg",vb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.5 20q-2.275 0-3.887-1.575T1 14.575q0-1.95 1.175-3.475T5.25 9.15q.625-2.3 2.5-3.725T12 4q2.925 0 4.963 2.038T19 11q1.725.2 2.863 1.488T23 15.5q0 1.875-1.312 3.188T18.5 20zm0-2h12q1.05 0 1.775-.725T21 15.5t-.725-1.775T18.5 13H17v-2q0-2.075-1.463-3.538T12 6T8.463 7.463T7 11h-.5q-1.45 0-2.475 1.025T3 14.5t1.025 2.475T6.5 18m5.5-6"},null,-1)]))}const yb=pe({name:"material-symbols-cloud-outline",render:_b}),bb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wb(s,e){return m(),A("svg",bb,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M18.5 4a1.5 1.5 0 0 0-3 0v.5H4a1.5 1.5 0 1 0 0 3h11.5V8a1.5 1.5 0 0 0 3 0v-.5H20a1.5 1.5 0 0 0 0-3h-1.5zM4 10.5a1.5 1.5 0 0 0 0 3h1.5v.5a1.5 1.5 0 0 0 3 0v-.5H20a1.5 1.5 0 0 0 0-3H8.5V10a1.5 1.5 0 1 0-3 0v.5zM2.5 18A1.5 1.5 0 0 1 4 16.5h11.5V16a1.5 1.5 0 0 1 3 0v.5H20a1.5 1.5 0 0 1 0 3h-1.5v.5a1.5 1.5 0 0 1-3 0v-.5H4A1.5 1.5 0 0 1 2.5 18"})],-1)]))}const xb=pe({name:"mingcute-settings-2-fill",render:wb}),Sb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Cb(s,e){return m(),A("svg",Sb,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M18 4a1 1 0 1 0-2 0v1H4a1 1 0 0 0 0 2h12v1a1 1 0 1 0 2 0V7h2a1 1 0 1 0 0-2h-2zM4 11a1 1 0 1 0 0 2h2v1a1 1 0 1 0 2 0v-1h12a1 1 0 1 0 0-2H8v-1a1 1 0 0 0-2 0v1zm-1 7a1 1 0 0 1 1-1h12v-1a1 1 0 1 1 2 0v1h2a1 1 0 1 1 0 2h-2v1a1 1 0 1 1-2 0v-1H4a1 1 0 0 1-1-1"})],-1)]))}const kb=pe({name:"mingcute-settings-2-line",render:Cb}),Eb=sl(J0),Ab=sl(W0);function Vr(){const{angle:s}=Eb(),e=Ab({listenOrientation:!0}),t=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=360}),n=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=450}),r=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<640}),i=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<768}),o=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>768&&d<1024}),a=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1024}),l=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1280}),u=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1536});return{xxsBreakpoint:t,xsBreakpoint:n,smBreakpoint:r,mdBreakpoint:i,xmdBreakpoint:o,lgBreakpoint:a,xlBreakpoint:l,xxlBreakpoint:u}}const{mdBreakpoint:$s,smBreakpoint:cc}=Vr(),uo=[{name:"NotFound",path:"/:pathMatch(.*)*",component:d2,meta:{name:"notfound",auth:{requiresAuth:!1,role:"none"}}},{name:"Login",path:"/login",alias:"/",component:iy,meta:{name:"login",auth:{requiresAuth:!1,role:"none"},ui:{background:ne(()=>$s.value?"var(--card-background)":void 0)}}},{name:"FirstSteps",path:"/first-steps",component:()=>vs(()=>import("./FirstSteps.CxXFvcQ8.0.0.63-internal.1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])),meta:{name:"firststeps",auth:{requiresAuth:!0,role:"user"}}},{name:"Cameras",path:"/cameras",component:()=>vs(()=>import("./Cameras.C6k8Wc8c.0.0.63-internal.1.js"),__vite__mapDeps([48,1,2,3,4,49,14,15,16,17,50,51,12,9,10,13,8,18,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,52])),meta:{name:"cameras",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{showTitle:!0,padding:ne(()=>!cc.value),fullwidth:ne(()=>cc.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:wh,active:zc}},bottombar:{icon:{default:wh,active:zc}}}},{name:"Camera",path:"/cameras/:cameraname",component:()=>vs(()=>import("./Camera.B4vetGvq.0.0.63-internal.1.js"),__vite__mapDeps([53,54,1,2,3,4,9,10,14,15,16,17,55,19,8,18,13,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"camera",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{disableScroll:ne(()=>$s.value),ignoreSafeAreaBottom:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:ne(()=>!$s.value)}}},{name:"Camview",path:"/camview",component:()=>vs(()=>import("./Camview.Dzn4neuZ.0.0.63-internal.1.js"),__vite__mapDeps([56,1,2,3,4,54,9,10,14,15,16,17,55,57,58,59,60,61,62,63,13,12,8,18,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,64])),meta:{name:"camview",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{disableScroll:ne(()=>!cc.value)},background:"#000000",showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:bh,active:yh}},bottombar:{icon:{default:bh,active:yh}}}},{name:"Recordings",path:"/recordings",component:()=>vs(()=>import("./Recordings.cX_pQS5L.0.0.63-internal.1.js"),__vite__mapDeps([65,3,8,1,2,4,14,15,16,17,18,9,10,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"recordings",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:ac,active:oc}},bottombar:{icon:{default:ac,active:oc}}}},{name:"Config",path:"/config",component:()=>vs(()=>import("./Config.B3nUxiLs.0.0.63-internal.1.js"),__vite__mapDeps([66,1,2,3,4,13,14,15,16,17,67,8,9,10,7,18,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"config",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{disableScroll:!0},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:Sh,active:xh}},profileMenu:{icon:{default:Sh,active:xh}}}},{name:"Console",path:"/console",component:()=>vs(()=>import("./Console.D1z8d2h4.0.0.63-internal.1.js"),__vite__mapDeps([68,1,2,3,4,67,7,8,9,10,50,16,17,14,15,51,13,18,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"console",auth:{requiresAuth:!0,role:"admin"},ui:{background:"#000000",containerSettings:{disableScroll:!0},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:kh,active:Eh}},profileMenu:{icon:{default:kh,active:Eh}}}},{name:"Plugins",path:"/plugins",component:()=>vs(()=>import("./Plugins.BnuS6Ctu.0.0.63-internal.1.js"),__vite__mapDeps([69,1,2,3,4,49,70,71,50,16,17,14,15,51,72,30,31,32,33,34,35,36,37,7,8,9,10,19,73,18,13,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45,74])),meta:{name:"plugins",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:Ch,active:Uc}},profileMenu:{icon:{default:Ch,active:Uc}}}},{name:"ScopedPlugin",path:"/plugins/:scope/:pluginname",component:()=>vs(()=>import("./Plugin.D02guXa1.0.0.63-internal.1.js"),__vite__mapDeps([75,1,2,3,4,76,9,10,70,71,50,16,17,14,15,51,72,30,31,32,33,34,35,36,37,7,8,19,73,18,13,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45,77])),meta:{name:"plugin",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Plugin",path:"/plugins/:pluginname",component:()=>vs(()=>import("./Plugin.D02guXa1.0.0.63-internal.1.js"),__vite__mapDeps([75,1,2,3,4,76,9,10,70,71,50,16,17,14,15,51,72,30,31,32,33,34,35,36,37,7,8,19,73,18,13,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45,77])),meta:{name:"plugin",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Adminpanel",path:"/admin",component:()=>vs(()=>import("./Adminpanel.dCaulgaY.0.0.63-internal.1.js"),__vite__mapDeps([78,1,2,3,4,79,80,81,13,8,9,10,7,14,15,16,17,18,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,82])),meta:{name:"adminpanel",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:Mh,active:Ah}},profileMenu:{icon:{default:Mh,active:Ah}}}},{name:"Cammesh",path:"/cammesh",component:()=>vs(()=>import("./Cammesh.DNE-fP9z.0.0.63-internal.1.js"),__vite__mapDeps([83,3,8,1,2,4,14,15,16,17,18,9,10,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"cammesh",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:$h,active:Ph}},profileMenu:{icon:{default:$h,active:Ph}}}},{name:"Settings",path:"/settings",component:()=>vs(()=>import("./Settings.Ba3RiuvP.0.0.63-internal.1.js"),__vite__mapDeps([84,1,2,3,4,19,14,15,16,17,8,18,9,10,13,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,85])),meta:{name:"settings",path:"/settings/account",auth:{requiresAuth:!0,role:"user"},navbar:{position:"bottom",icon:{default:Vc,active:Sa}},bottombar:{icon:{default:Vc,active:Sa}}},children:[{name:"SettingsAccount",path:"account",component:()=>vs(()=>import("./SettingsAccount.BslKxD4b.0.0.63-internal.1.js"),__vite__mapDeps([11,1,2,3,4,12,9,10,13,8,14,15,16,17,18,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])),meta:{name:"account",description:"account_description",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Gy,active:Qy}}}},{name:"SettingsAppearance",path:"appearance",component:()=>vs(()=>import("./SettingsAppearance.BKZMO5li.0.0.63-internal.1.js"),__vite__mapDeps([86,47,1,2,3,4,13,8,14,15,16,17,18,9,10,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"appearance",description:"appearance_description",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Yy,active:tb}}}},{name:"SettingsUsers",path:"user",component:()=>vs(()=>import("./SettingsUsers.ByKS5fCb.0.0.63-internal.1.js"),__vite__mapDeps([87,1,2,3,4,71,12,9,10,8,14,15,16,17,18,13,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"user",description:"user_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ab,active:rb}}}},{name:"SettingsRecordings",path:"recordings",component:()=>vs(()=>import("./SettingsRecordings.CCvVmc-U.0.0.63-internal.1.js"),__vite__mapDeps([88,3,8,1,2,4,14,15,16,17,18,9,10,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"recordings",description:"recordings_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ac,active:oc}}}},{name:"SettingsBackup",path:"backup",component:()=>vs(()=>import("./SettingsBackup.C_iMHLx4.0.0.63-internal.1.js"),__vite__mapDeps([89,1,2,3,4,76,6,7,8,9,10,14,15,16,17,18,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,90])),meta:{name:"backup",description:"backup_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ub,active:mb}}}},{name:"SettingsRemote",path:"remote",component:()=>vs(()=>import("./SettingsRemote.PQLlxhbn.0.0.63-internal.1.js"),__vite__mapDeps([91,1,2,3,4,12,7,8,9,10,20,21,14,15,16,17,18,13,19,5,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"remote",description:"remote_access_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:yb,active:gb}}}},{name:"SettingsSystem",path:"system",component:()=>vs(()=>import("./SettingsSystem.C2wWU7KL.0.0.63-internal.1.js"),__vite__mapDeps([92,1,2,3,4,8,7,9,10,72,50,16,17,14,15,51,30,31,32,33,34,35,36,37,93,18,13,19,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45])),meta:{name:"system",description:"system_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:kb,active:xb}}}}]}],La=mf({history:pf("/"),routes:uo,scrollBehavior:async()=>(await I_(10),{top:0,left:0,behavior:"smooth"})});La.absUrl=(s="#",e=!0)=>{const t=document.createElement("a");t.href=s,t.target=e&&s!=="#"?"_blank":"",e&&(t.rel="noopener noreferrer"),t.click()};La.beforeEach(async(s,e,t)=>{var l;const n=Ci(),r=Fs(),i=hp(),o=s.name.toLowerCase(),a=localStorage.getItem("lastPage");if(i.routerLoading=!0,r.user){await n.cancelQueries(void 0,{revert:!1});try{s.path!=="/settings"&&await Um()}catch(u){console.error(u),await r.logout();return}r.user.firstLogin&&s.path!=="/first-steps"?t("/first-steps"):!r.user.firstLogin&&s.path==="/first-steps"||(l=s.meta.auth)!=null&&l.requiresAuth&&s.meta.auth.role&&r.user.role!==s.meta.auth.role&&r.user.role!=="admin"&&r.user.role!=="master"?t("/cameras"):o==="login"&&a&&a!=="/"?t(a):s.path==="/settings"?t("/settings/account"):t()}else o!=="login"?t("/"):t();i.routerLoading=!1});La.afterEach(s=>{const e=["login","notfound","firststeps"],t=s.name.toLowerCase();e.includes(t)||localStorage.setItem("lastPage",s.path)});const ka=class ka{constructor(){}static get manager(){return this._manager||this.createManager(),this._manager}static createManager(){ka._manager=new _f(window.origin,{reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.5,timeout:2e4,autoConnect:!0,transports:["websocket","polling"],rejectUnauthorized:!1,secure:!0})}};p(ka,"_manager");let Hc=ka;const Pl=Mi("socket",()=>{const s=ae(new Map),e=ae(!1),t=ae(!0),n=()=>{const h=Fs(),v=s.value.get("/camera.ui");return v||i("/camera.ui",h)},r=h=>{const v=Fs(),f=s.value.get(h);return f||i(h,v)},i=(h,v)=>{const f=Ls(a(h,v));return o(f.value,h,v),s.value.set(h,f.value),f.value},o=(h,v,f)=>{h.socket.on("connect",()=>{var b;(b=h.connected)==null||b.next()}),v==="/camera.ui"&&(h.socket.on("connect",()=>{t.value?(e.value=!0,t.value=!1):d()}),h.socket.on("disconnect",()=>{e.value=!1}),h.socket.on("unauthenticated",()=>{e.value=!1,f.logout()}),h.socket.on("invalidToken",b=>{f.accessToken===b&&(e.value=!1,f.logout())})),h.end=b=>{var k;v==="/camera.ui"&&(e.value=!1),h.socket.emit("end",b),h.socket.removeAllListeners(),(k=h.connected)==null||k.complete()},h.disconnect=b=>{var k;v==="/camera.ui"&&(e.value=!1),(k=h.end)==null||k.call(h,b),h.socket.disconnect(),s.value.delete(v)}},a=(h,v)=>{const f=`Bearer ${v.accessToken}`,b=Hc.manager.socket(h,{auth:{token:f}});return{socket:b,request:(z,L)=>new yf(se=>{b.emit(z,L,K=>{typeof K=="object"&&K.error?se.error(K):se.next(K),se.complete()})})}},l=ne(()=>h=>s.value.get(h)),u=h=>{s.value.forEach(v=>{var f;(f=v.disconnect)==null||f.call(v,h)}),e.value=!1},d=()=>{window.location.reload()};return{isConnected:e,namespaceConnectionCache:s,connect:n,connectToNamespace:r,getExistingNamespace:l,disconnect:u}}),g9=["account","appearance","user","recordings","backup","system"],Tl=Mi("ui",()=>{const s=tl("ui",{cameras:{showEvents:!0},camview:{dragDisabled:!1},config:{zoom:12},console:{zoom:12},interface:{showBottomBarOnMobile:!0,selectedSettingsView:"account",navbarStayCollapsed:!1}});return s.value.cameras||(s.value.cameras={showEvents:!0}),s.value.cameras.showEvents===void 0&&(s.value.cameras.showEvents=!0),s.value.camview||(s.value.camview={dragDisabled:!1}),s.value.camview.dragDisabled===void 0&&(s.value.camview.dragDisabled=!1),s.value.config||(s.value.config={zoom:12}),s.value.console.zoom===void 0&&(s.value.console.zoom=12),s.value.console||(s.value.console={zoom:12}),s.value.interface.showBottomBarOnMobile===void 0&&(s.value.interface.showBottomBarOnMobile=!0),s.value.interface||(s.value.interface={showBottomBarOnMobile:!0,selectedSettingsView:"account",navbarStayCollapsed:!1}),!s.value.interface.showBottomBarOnMobile===void 0&&(s.value.interface.showBottomBarOnMobile=!0),s.value.interface.selectedSettingsView||(s.value.interface.selectedSettingsView="account"),s.value.interface.navbarStayCollapsed||(s.value.interface.navbarStayCollapsed=!1),{uiSettings:s}}),vn={CLOSED:0,MINIFIED:80,EXPANDED:288},Mb=Symbol("cui-app-bus"),zi=Tr({navbarState:void 0,subbarState:void 0}),Rl=()=>{const s=Zh(Mb);return s.on(({subbarState:e,navbarState:t})=>{e&&e!==zi.subbarState&&(zi.subbarState=e),t&&t!==zi.navbarState&&(zi.navbarState=t)}),{state:zi,bus:s}},ja=()=>{const s=Tl(),e=$i(),{state:t}=Rl(),{mdBreakpoint:n,xsBreakpoint:r,xlBreakpoint:i}=Vr(),{uiSettings:o}=Vs(s),a=ne(()=>u.value?o.value.interface.navbarStayCollapsed&&t.navbarState!=="opened"?n.value?"closed":"minified":i.value?"opened":t.navbarState?t.navbarState:n.value?"closed":"minified":void 0),l=ne(()=>e.path.includes("/settings")?i.value?"opened":t.subbarState?t.subbarState:"closed":void 0),u=ne(()=>{var v;return!!Xs((v=e.meta.ui)==null?void 0:v.showNavbar)}),d=ne(()=>{var v;return!!(Xs((v=e.meta.ui)==null?void 0:v.showBottombar)&&o.value.interface.showBottomBarOnMobile&&r.value)}),h=ne(()=>{var v;return!!Xs((v=e.meta.ui)==null?void 0:v.showTopbar)});return{navbarState:a,subbarState:l,showBottombar:d,showNavbar:u,showTopbar:h}},Si=(s,e,t)=>{var a,l,u,d,h;s=s??$i();const{user:n}=Vs(Fs()),r=!((a=s==null?void 0:s.meta)!=null&&a.auth)||((l=s==null?void 0:s.meta)==null?void 0:l.auth.requiresAuth)===!1,i=e??((d=(u=s.meta)==null?void 0:u.auth)==null?void 0:d.role)??"user",o=((h=n.value)==null?void 0:h.role)??"user";return r||i==="none"?!0:i==="user"?t?o==="user":o==="user"||o==="admin"||o==="master":i==="admin"?o==="admin"||o==="master":i==="master"?o==="master":!1},$b={class:"pl-safe pt-safe h-full flex flex-col"},Pb={class:"overflow-hidden w-full pr-4"},Tb={key:0,class:"ml-2 w-full flex flex-row items-center"},Rb={class:"flex flex-col flex-1 my-4 px-[0.9rem]"},Ib={class:"flex flex-col space-y-1"},Ob={class:"flex flex-col space-y-1 pb-safe"},Nb={key:0,class:"dark-mode text-muted pl-3 uppercase text-xs font-bold"},Fb=At({__name:"CuiNavbar",setup(s,{expose:e}){const t=qr(),n=Fs(),r=Tl(),i=Pl(),{bus:o}=Rl(),{mdBreakpoint:a,xlBreakpoint:l}=Vr(),{navbarState:u}=ja(),{uiSettings:d}=Vs(r),{user:h}=Vs(n),v=Vt("navbarRef"),f=ae("closed"),b=Ls(),k=ae(!1),z=ae(!1),L=ae(!1),se=ae(!1);nl(v,I=>{const w=I.target,H=w.closest("#menu-icon"),J=w.closest("#submenu-icon"),q=w.closest("#navbar-icon");!H&&!J&&!q&&S()});const K=ne(()=>d.value.interface.selectedSettingsView),N=ne(()=>uo.filter(I=>{var w,H;return((H=(w=I.meta)==null?void 0:w.navbar)==null?void 0:H.position)==="top"&&I.meta&&Si(I)})),E=ne(()=>uo.filter(I=>{var w,H;return((H=(w=I.meta)==null?void 0:w.navbar)==null?void 0:H.position)==="bottom"&&Si(I)})),O=ne(()=>d.value.interface.navbarStayCollapsed&&f.value!=="opened"?"closed":l.value?"opened":f.value),U=ne(()=>O.value==="closed"?a.value?vn.CLOSED:vn.MINIFIED:vn.EXPANDED);Ge(u,I=>{I&&I!==f.value&&(f.value=I==="minified"||I==="closed"?"closed":"opened")}),Ge(t.currentRoute,(I,w)=>{I.path!==w.path&&S()}),Ge(h,()=>{var I,w,H,J;((I=h.value)==null?void 0:I.role)==="admin"||((w=h.value)==null?void 0:w.role)==="master"?(b.value=i.connectToNamespace("/server"),b.value.socket.on("plugin-updates",q=>{z.value=q.length>0||!1}),b.value.socket.on("server-updates",q=>{k.value=q.updateAvailable||q.betaUpdateAvailable||!1}),b.value.request("get-updates").subscribe(q=>{z.value=q.plugins.length>0||!1,k.value=q.server.updateAvailable||q.server.betaUpdateAvailable||!1})):(J=(H=b.value)==null?void 0:H.disconnect)==null||J.call(H)},{deep:!0,immediate:!0}),Ge(L,I=>{I&&B()});const S=()=>{o.emit({navbarState:"closed"})},M=(I,w)=>{L.value&&w.channel==="update-check"&&w.status==="available"&&(k.value=!0)},B=async()=>{if(L.value){window.electron.removeListener("app-status",M),window.electron.on("app-status",M),window.electron.send("check-for-updates");try{const I=await window.electron.invoke("get-update-available");k.value=I.isUpdateAvailable}catch{}}},W=()=>{const I=document.querySelector('meta[name="electron-server"]'),w=I!==null&&I.getAttribute("content")==="true";L.value=window.electron!==void 0,se.value=w,setTimeout(()=>{L.value=window.electron!==void 0,se.value=w},100)};return Sn(()=>{W()}),vo(()=>{var I;(I=window.electron)==null||I.removeListener("app-status",M)}),e({navbarState:O}),(I,w)=>{var Se,F;const H=Ei("RouterLink"),J=_o,q=ys,oe=Lh,ue=Gm;return m(),A("nav",{ref_key:"navbarRef",ref:v,class:at(["navbar-background fixed h-full transition-[width] duration-300 overflow-x-hidden overflow-y-scroll shadow-black/50 overflow-hidden border-r-[1px] border-base-color",{"shadow-xl":c(a)&&c(U)===c(vn).EXPANDED}]),style:ot({left:c(U)===0?"-1px":"0px",width:`calc(${c(U)}px + env(safe-area-inset-left, 0px))`,clipPath:"inset(0)"})},[w[3]||(w[3]=g("div",{class:"fixed blur-2xl h-[20px] w-full -z-1 opacity-70 bg-primary-500"},null,-1)),g("div",$b,[g("div",{class:at(["w-full flex items-center shrink-0 h-[60px]",{"mt-[25px]":c(L)}])},[y(H,{to:"/cameras",class:"pl-6"},{default:$(()=>[y(c($a),{src:c(Fr)("logo_animated.svg"),width:"32px",height:"32px",title:"camera.ui","aria-label":"camera.ui",class:"hover:scale-105 active:scale-105 focus:scale-105 transition-all"},null,8,["src"])]),_:1}),g("div",Pb,[y(Et,{name:"fade"},{default:$(()=>[c(U)===c(vn).EXPANDED?(m(),A("div",Tb,[y(H,{to:"/cameras",class:"text-white font-bold text-lg text-shadow"},{default:$(()=>w[0]||(w[0]=[Qt("camera.ui")])),_:1}),c(O)==="opened"&&c(a)?(m(),j(q,{key:0,id:"navbar-icon",class:"dark-mode ml-auto cui-icon-md text-white",text:"",rounded:"",onClick:S},{icon:$(()=>[y(J,{width:"100%",height:"100%"})]),_:1})):ce("",!0)])):ce("",!0)]),_:1})])],2),g("div",Rb,[g("div",Ib,[(m(!0),A(yt,null,qt(c(N),D=>(m(),A("div",{key:D.name,class:"w-full h-[50px] relative"},[c(z)&&D.name==="Plugins"?(m(),j(oe,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ce("",!0),y(ue,{icon:D.meta.navbar.icon.default,"active-icon":D.meta.navbar.icon.active,to:D.path,label:I.$t(`navigation.${D.name.toLowerCase()}`),expanded:c(U)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(U)===c(vn).EXPANDED}])},null,8,["icon","active-icon","to","label","expanded","class"])]))),128))]),w[2]||(w[2]=g("div",{class:"flex-1 mt-10"},null,-1)),g("div",Ob,[y(Et,{name:"fade"},{default:$(()=>[c(O)==="opened"?(m(),A("span",Nb,me(I.$t("navigation.extras")),1)):ce("",!0)]),_:1}),(m(!0),A(yt,null,qt(c(E),D=>(m(),A("div",{key:D.name,class:"w-full h-[50px] relative"},[c(k)&&D.name==="Settings"?(m(),j(oe,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ce("",!0),y(ue,{icon:D.meta.navbar.icon.default,"active-icon":D.meta.navbar.icon.active,to:D.path==="/settings"?`/settings/${c(K)}`:D.path,"fallback-active-path":D.path,label:I.$t(`navigation.${D.name.toLowerCase()}`),expanded:c(U)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(U)===c(vn).EXPANDED}])},null,8,["icon","active-icon","to","fallback-active-path","label","expanded","class"])]))),128)),w[1]||(w[1]=g("div",{class:"my-2",style:{borderTop:"1px solid #313131"}},null,-1)),y(ue,{avatar:"avatar",label:((Se=c(h))==null?void 0:Se.username)??"unknown",description:((F=c(h))==null?void 0:F.role)??"unknown",expanded:c(U)===c(vn).EXPANDED,"show-logout":"",to:"/settings/account","dark-mode":"","avatar-size":22,class:at(["w-[50px] h-[50px]",{"w-full":c(U)===c(vn).EXPANDED}])},null,8,["label","description","expanded","class"])])])])],6)}}}),Lb={HEIGHT:60},jb={class:"px-2 h-full pb-safe-offset-1 flex items-center justify-around"},qb=At({__name:"CuiBottombar",setup(s,{expose:e}){const t=Vt("bottombarRef"),n=ne(()=>uo.filter(r=>{var i;return((i=r.meta)==null?void 0:i.bottombar)&&r.meta.auth&&Si(r)}));return e({bottombarRef:t}),(r,i)=>{const o=Gm;return m(),A("nav",{ref_key:"bottombarRef",ref:t,class:"cui-bottombar bottombar-background fixed bottom-0 left-0 right-0 border-t-[1px] border-color bottombar-background",style:ot({height:`calc(${c(Lb).HEIGHT}px + env(safe-area-inset-bottom, 0px))`})},[g("div",jb,[(m(!0),A(yt,null,qt(c(n),a=>(m(),j(o,{key:a.name,icon:a.meta.bottombar.icon.default,"active-icon":a.meta.bottombar.icon.active,to:a.path,label:"",expanded:!1,"icon-class":"text-color",class:"w-[50px] h-[50px] transition-all duration-300"},null,8,["icon","active-icon","to"]))),128))]),i[0]||(i[0]=g("div",{class:"fixed blur-2xl h-[20px] w-full opacity-70 bg-primary-500",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) - 40px)"}},null,-1))],4)}}}),Db=qs(qb,[["__scopeId","data-v-78d01fd3"]]),Bb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zb(s,e){return m(),A("svg",Bb,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6h18m-2 0v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6m3 0V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2m-6 5v6m4-6v6"},null,-1)]))}const Ub=pe({name:"lucide-trash2",render:zb}),Vb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hb(s,e){return m(),A("svg",Vb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M8.352 20.242A4.63 4.63 0 0 0 12 22a4.63 4.63 0 0 0 3.648-1.758a27.2 27.2 0 0 1-7.296 0M18.75 9v.704c0 .845.24 1.671.692 2.374l1.108 1.723c1.011 1.574.239 3.713-1.52 4.21a25.8 25.8 0 0 1-14.06 0c-1.759-.497-2.531-2.636-1.52-4.21l1.108-1.723a4.4 4.4 0 0 0 .693-2.374V9c0-3.866 3.022-7 6.749-7s6.75 3.134 6.75 7"},null,-1)]))}const Qb=pe({name:"solar-bell-bold",render:Hb}),Kb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zb(s,e){return m(),A("svg",Kb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"},null,-1)]))}const Gb=pe({name:"material-symbols-close-rounded",render:Zb}),Wb={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function Jb(s,e){return m(),A("svg",Wb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.78 12.78a.75.75 0 0 1-1.06 0L4.47 8.53a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.042.018a.75.75 0 0 1 .018 1.042L6.06 8l3.72 3.72a.75.75 0 0 1 0 1.06"},null,-1)]))}const Yb=pe({name:"octicon-chevron-left16",render:Jb}),mp=Symbol("DialogStepper");function Xb(s){const e=ae(s),t=ae(void 0),n={},r=(f,b)=>{n[f]||(n[f]=[]),n[f].push(b)},i=(f,b)=>{const k=n[f];if(k){const z=k.indexOf(b);z!==-1&&k.splice(z,1)}},o=(f,b)=>{const k=n[f];k&&k.forEach(z=>{z(b)})},a=ne(()=>!t.value),v={currentTab:t,tabs:e,isMainTab:a,goToTab:f=>{const b=e.value.find(k=>k.id===f);b&&(t.value=f,o("tabChange",b))},goToMainTab:()=>{t.value=void 0,o("tabChange",void 0)},registerTab:f=>{e.value.some(b=>b.id===f.id)||e.value.push(f)},updateTabConfig:(f,b)=>{const k=e.value.findIndex(z=>z.id===f);k!==-1&&(e.value[k]={...e.value[k],...b},b.title&&o("updateTabTitle",{tabId:f,title:b.title}))},on:r,off:i,emit:o};return Xc(mp,v),v}function v9(){const s=mi(mp);if(!s)throw new Error("useCuiDialogStepperContext must be used within a dialog that uses useCuiDialogStepper");return s}const e5={class:"p-dialog-header justify-start gap-1"},t5={key:0,class:"p-dialog-header-actions"},s5={class:"p-dialog-title"},n5={class:"p-dialog-header-actions ml-auto"},r5={key:0},i5=["innerHTML"],o5={class:"flex items-center justify-center shrink-0 w-full p-5 not-md:pb-safe-offset-5 mt-5 self-end",style:{background:"var(--border-color)"}},a5=At({__name:"CuiDialog",setup(s){Gr.registerLanguage("typescript",bf),Gr.registerLanguage("yaml",wf),Gr.registerLanguage("json",xf),Gr.registerLanguage("python",Sf);const e=Cn(),{t}=js(),n=mi("dialogRef"),r=Wt(n.value.data),{contentText:i,contentProps:o,loading:a,disabled:l,cancelButtonProps:u,confirmButtonProps:d,hideCancelButton:h,hideConfirmButton:v,dialogContentClass:f,dialogContentStyle:b,cancelText:k,confirmText:z,stayActive:L,src:se,title:K,fullscreen:N,tabs:E,markdown:O}=r;Xc("dialogRefProps",r);const U=ae(!1),S=ae(null),M=ae(!1),B=ae(K.value);let W;const I=n.value.options.templates,w=ne(()=>{var Y;return!!(U.value||a!=null&&a.value||Xs((Y=S.value)==null?void 0:Y.isLoading))}),H=ne(()=>E.value!==void 0&&E.value.length>0),J=ne(()=>k!=null&&k.value?k.value:t("components.form.button.close")),q=ne(()=>z!=null&&z.value?z.value:t("components.form.button.save")),oe=ne(()=>({...u==null?void 0:u.value,label:J.value,loading:void 0,size:"small",severity:u!=null&&u.value&&"severity"in u.value?u.value.severity:"secondary",class:void 0})),ue=ne(()=>({...d==null?void 0:d.value,label:q.value,loading:void 0,size:"small",severity:d!=null&&d.value&&"severity"in d.value?d.value.severity:"success",class:"ml-auto",disabled:l.value}));H.value&&(W=Xb(E.value??[]),Ge(W.isMainTab,Y=>{M.value=!Y},{immediate:!0}),W.on("updateTabTitle",({tabId:Y,title:Te})=>{(W==null?void 0:W.currentTab.value)===Y&&(K!=null&&K.value)&&(B.value=Te)}),W.on("tabChange",Y=>{B.value=(Y==null?void 0:Y.title)??K.value}));const Se=Cf("commonmark",{highlight(Y,Te){if(Te&&Gr.getLanguage(Te))try{return'<pre><code class="hljs">'+Gr.highlight(Y,{language:Te,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+Se.utils.escapeHtml(Y)+"</code></pre>"}}),F=async()=>{var Y,Te;try{U.value=!0;const He=await((Te=(Y=S.value)==null?void 0:Y.onCancel)==null?void 0:Te.call(Y));n.value.close({status:"cancel",data:He})}catch(He){console.error(He),e.add({severity:"error",summary:t("components.toast.title_error"),detail:He.message,life:3e3})}finally{U.value=!1}},D=async()=>{var Y,Te,He,ht;try{U.value=!0;const Mt=await((Te=(Y=S.value)==null?void 0:Y.onConfirm)==null?void 0:Te.call(Y));if(Mt===null)return;L!=null&&L.value?(ht=(He=n.value.options).onConfirm)==null||ht.call(He,Mt):n.value.close({status:"confirm",data:Mt})}catch(Mt){console.error(Mt),e.add({severity:"error",summary:t("components.toast.title_error"),detail:Mt.message,life:3e3})}finally{U.value=!1}};return(Y,Te)=>{var ze;const He=Yb,ht=ys,Mt=Gb,Qe=Fa;return m(),A(yt,null,[g("div",e5,[y(Et,{name:"slide-left"},{default:$(()=>{var ge;return[c(M)?(m(),A("div",t5,[y(ht,{severity:"secondary",text:"",rounded:"",class:"p-dialog-back-button",onClick:(ge=c(W))==null?void 0:ge.goToMainTab},{icon:$(()=>[y(He,{width:"100%",height:"100%"})]),_:1},8,["onClick"])])):ce("",!0)]}),_:1}),g("span",s5,me(c(B)),1),g("div",n5,[y(ht,{severity:"secondary",text:"",rounded:"",class:"p-dialog-close-button",onClick:c(n).close},{icon:$(()=>[y(Mt,{width:"100%",height:"100%"})]),_:1},8,["onClick"])])]),g("div",{class:at(["flex justify-center w-full overflow-y-auto px-5 text-balance",{"h-full":c(N)},c(f)]),style:ot(c(b))},[c(i)&&!c(O)?(m(),A("span",r5,me(c(i)),1)):c(i)&&c(O)?(m(),A("div",{key:1,class:"w-full markdown-body",innerHTML:c(Se).render(c(i))},null,8,i5)):c(se)?(m(),j(Qe,{key:2,src:c(se),"image-container-class":"w-full h-full"},null,8,["src"])):(m(),j(Ai((ze=c(I))==null?void 0:ze.content),et({key:3,ref_key:"componentRef",ref:S,class:"w-full h-full relative"},c(o),V0(c(n).options.events||{})),null,16))],6),Te[1]||(Te[1]=g("div",{class:"mt-auto"},null,-1)),g("div",o5,[c(h)?ce("",!0):(m(),j(ht,et({key:0},c(oe),{class:"cui-button-medium",onClick:F}),null,16)),Te[0]||(Te[0]=g("div",{class:"ml-auto"},null,-1)),c(v)?ce("",!0):(m(),j(ht,et({key:1},c(ue),{loading:c(w),disabled:c(l),class:"cui-button-medium",onClick:D}),null,16,["loading","disabled"]))])],64)}}}),Ui={modal:!0,closable:!0,blockScroll:!0,draggable:!1,dismissableMask:!0,baseZIndex:1100,showHeader:!1},jo={pt:{root:{class:"p-dialog-maximized pt-safe border-none"}}},qo={pt:{root:{class:"shadow-xl shadow-black/30 overflow-hidden"}}},tr={mobile:{textDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo},imageDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo},componentDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo},stepperDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo}},desktop:{textDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"auto"},...qo},imageDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"70vw"},...qo},componentDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"70vw"},...qo},stepperDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"70vw"},...qo}}};function c5(){return{open:(e,t)=>{const n={content:e&&pe(e),options:t||{},data:t&&t.data,close:r=>{yu.emit("close",{instance:n,params:r})}};return yu.emit("open",{instance:n}),n}}}function Il(){const s=c5(),{mdBreakpoint:e}=Vr(),t=(u,d)=>{const h=Tr({...u});kl(h.options.props,d)},n=(u,d)=>(Ge(e,h=>{if(h)switch(d){case"text":t(u,tr.mobile.textDialog);break;case"image":t(u,tr.mobile.imageDialog);break;case"component":t(u,tr.mobile.componentDialog);break;case"stepper":t(u,tr.mobile.stepperDialog);break}else switch(d){case"text":t(u,tr.desktop.textDialog);break;case"image":t(u,tr.desktop.imageDialog);break;case"component":t(u,tr.desktop.componentDialog);break;case"stepper":t(u,tr.desktop.stepperDialog);break}},{immediate:!0}),u);function r(u,d,h){const{component:v,data:f,onConfirm:b,onCancel:k,onSettled:z,events:L,...se}=d,K={content:v?pe(v):void 0},N=s.open(a5,{data:Wt(Tr({confirmText:f.confirmText??void 0,cancelText:f.cancelText??void 0,hideConfirmButton:f.hideConfirmButton??!1,hideCancelButton:f.hideCancelButton??!1,loading:f.loading??!1,disabled:f.disabled??!1,confirmButtonProps:f.confirmButtonProps??void 0,cancelButtonProps:f.cancelButtonProps??void 0,dialogContentClass:f.dialogContentClass??void 0,dialogContentStyle:f.dialogContentStyle??void 0,stayActive:f.stayActive??!1,fullscreen:f.fullscreen??!1,contentText:f.contentText??void 0,src:f.src??void 0,markdown:f.markdown??!1,contentProps:f.contentProps??void 0,tabs:f.tabs??void 0,...f})),props:h,templates:K,...se,events:L,onConfirm:b,onCancel:k,onClose:E=>{var O,U;if(((O=E==null?void 0:E.data)==null?void 0:O.status)==="confirm"){const{status:S,...M}=E.data;b==null||b((M==null?void 0:M.data)??M)}else k==null||k();z==null||z(((U=E==null?void 0:E.data)==null?void 0:U.data)??(E==null?void 0:E.data))}});return f.fullscreen?N:n(N,u)}function i(u){const{data:d,...h}=u,v=structuredClone(Ui);return v.style={...Ui.style,width:"auto",minWidth:"400px"},d.fullscreen&&(v.style={...v.style,maxWidth:"none",maxHeight:"none"},v.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("text",{data:d,...h},v)}function o(u){const{data:d,...h}=u,v=structuredClone(Ui);return d.fullscreen&&(v.style={...v.style,maxWidth:"none",maxHeight:"none"},v.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("image",{data:d,...h},v)}function a(u,d){const{data:h,...v}=d,f=structuredClone(Ui);return h.fullscreen&&(f.style={...f.style,maxWidth:"none",maxHeight:"none"},f.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("component",{component:u,data:h,...v},f)}function l(u,d){const{data:h,...v}=d,f=structuredClone(Ui);return h.fullscreen&&(f.style={...f.style,maxWidth:"none",maxHeight:"none"},f.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("stepper",{component:u,data:h,...v},f)}return{openTextDialog:i,openImageDialog:o,openComponentDialog:a,openStepperDialog:l}}const l5=sl(Gh);function Ol(){const s=ne(()=>typeof window>"u"?!1:[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(k=>navigator.userAgent.match(k))),e=ne(()=>typeof window>"u"?!1:[/Android/i].some(k=>navigator.userAgent.match(k))),t=ne(()=>typeof window>"u"?!1:n.value||r.value),n=ne(()=>typeof window>"u"?!1:[/iPhone/i].some(k=>navigator.userAgent.match(k))),r=ne(()=>typeof window>"u"?!1:[/Macintosh/i].some(k=>navigator.userAgent.match(k)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1)),i=ne(()=>{var k;if(typeof window>"u")return[0,0];const b=/OS [\d_]+/i;return n.value?((k=navigator.userAgent.match(b))==null?void 0:k[0].substr(3).split("_").map(z=>parseInt(z)))||[0,0]:[0,0]}),o=ne(()=>typeof window>"u"?!1:[/Safari/i].some(k=>navigator.userAgent.match(k))),a=ne(()=>{if(typeof window>"u")return null;const b=/Version\/(\d+).+Safari/;return navigator.userAgent.match(b)}),l=ne(()=>typeof window>"u"?!1:[/Firefox/i].some(k=>navigator.userAgent.match(k))),u=ne(()=>typeof window>"u"?!1:[/Chrome/i].some(k=>navigator.userAgent.match(k))),d=ne(()=>{let b=!1;if("maxTouchPoints"in navigator)b=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)navigator!==null&&(b=navigator.msMaxTouchPoints>0);else{const k=matchMedia("(pointer:coarse)");if(k&&k.media==="(pointer:coarse)")b=!!k.matches;else if("orientation"in window)b=!0;else{const z=navigator.userAgent;b=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(z)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(z)}}return b}),h=ne(()=>l5("(display-mode: standalone)").value||window.navigator.standalone||document.referrer.includes("android-app://")),v=ne(()=>{const b=typeof document.body.requestFullscreen<"u"||typeof document.body.mozRequestFullScreen<"u"||typeof document.body.webkitRequestFullscreen<"u"||typeof document.body.msRequestFullscreen<"u"||typeof document.exitFullscreen<"u"||typeof document.mozCancelFullScreen<"u"||typeof document.webkitExitFullscreen<"u",[k,z]=i.value,L=k&&k>=17&&z&&z>=2;return!!(b||!n.value||n.value&&L)}),f=ne(()=>{const b="pictureInPictureEnabled"in document;return t.value&&h.value?!1:b});return{isPWA:h,isMobile:s,isAndroid:e,isIos:t,isIphone:n,isIpad:r,iosVersion:i,isSafari:o,safariVersion:a,isFirefox:l,isChrome:u,isTouch:d,isPipSupported:f,isFsSupported:v}}const u5={class:"flex justify-between items-center mb-4 h-9"},d5={class:"flex items-center gap-2"},h5={class:"text-base font-semibold"},m5={class:"overflow-y-auto",style:{maxHeight:"234px"}},p5={class:"flex gap-3"},f5={class:"flex-1 min-w-0"},g5={class:"flex justify-between items-center"},v5={class:"font-semibold text-sm text-color truncate max-w-[200px]"},_5={class:"text-xs text-muted shrink-0"},y5={class:"text-xs text-muted mt-1 text-left line-clamp-2 overflow-hidden"},b5={key:0,class:"text-center py-8 text-muted text-sm"},w5=At({__name:"CuiNotificationMenu",setup(s){const{t:e}=js(),t=qr(),n=Pl(),r=Il(),{isTouch:i}=Ol(),o=Ls(),a=Vt("notificationsMenuRef"),l=ae([]),u=ae({}),d=ae(!1),h=ae(!1);Ge(d,S=>{S&&O()});const v=(S,[M])=>{var oe,ue;if(!M.isIntersecting){(oe=u.value[S])==null||oe.resetFn(),(ue=u.value[S])==null||ue.stopFn(),delete u.value[S];return}if(u.value[S])return;const B=M.target;if(!B.parentElement)return;const I=nl(B,()=>{u.value[S]&&u.value[S].resetFn()});let w;const H=i.value?X0:ef,{direction:J,stop:q}=H(B,{threshold:10,disableTextSelect:!0,onSwipe(){var Se,F;for(const D in u.value)D!==S&&((Se=u.value[D])==null||Se.resetFn());J.value==="left"?u.value[S]={left:"-75px",opacity:1,deleteOpacity:1,isSwiping:!0,resetFn(){this.left="0",this.opacity=1,this.deleteOpacity=0},stopFn:()=>{delete u.value[S],q(),I(),clearTimeout(w)}}:(F=u.value[S])==null||F.resetFn()},onSwipeEnd(){clearTimeout(w),w=setTimeout(()=>{u.value[S]&&(u.value[S].isSwiping=!1)},10)}})},f=S=>{var M;(M=a.value)==null||M.toggle(S)},b=S=>{const M=Date.now()-S,B=Math.floor(M/(1e3*60)),W=Math.floor(M/(1e3*60*60)),I=Math.floor(M/(1e3*60*60*24));return B<60?`${B}${e("components.notification_menu.short_minutes")}`:W<24?`${W}${e("components.notification_menu.short_hours")}`:I<7?`${I}${e("components.notification_menu.short_days")}`:I<30?`${Math.floor(I/7)}${e("components.notification_menu.short_weeks")}`:I<365?`${Math.floor(I/30)}${e("components.notification_menu.short_months")}`:`${Math.floor(I/365)}${e("components.notification_menu.short_years")}`},k=S=>{var B;const M=S.link;(B=a.value)==null||B.hide(),z(S),M&&t.push({path:M})},z=S=>{var M;if(S){const B=u.value[S._id];B==null||B.stopFn();const W=l.value.findIndex(I=>I._id===S._id);W!==-1&&(l.value.splice(W,1),(M=o.value)==null||M.socket.emit("remove-notification",S._id))}},L=()=>{var S,M;for(const B in u.value)(S=u.value[B])==null||S.stopFn();l.value.splice(0,l.value.length),(M=o.value)==null||M.socket.emit("clear-notifications")},se=S=>{switch(S){case"info":return"rgb(33, 150, 243)";case"warn":return"rgb(251, 140, 0)";case"error":return"rgb(176, 0, 32)";default:return"rgb(69, 69, 69)"}},K=S=>{const M=u.value[S._id];M!=null&&M.isSwiping||r.openTextDialog({data:{title:S.title,contentText:S.text,confirmText:S!=null&&S.link?e("components.form.button.go_to_message"):e("components.form.button.mark_as_read")},onConfirm:()=>k(S),onCancel:()=>z(S)})},N=()=>{var S,M;for(const B in u.value)(S=u.value[B])==null||S.resetFn(),(M=u.value[B])==null||M.stopFn()},E=(S,M)=>{if(d.value&&M.channel==="update-check"&&M.status==="available"){const B={_id:"system-update",title:"Update",text:"New camera.ui app update available",type:"info",link:"/settings/system",timestamp:Date.now()};if(l.value.find(W=>W._id===B._id))return;l.value.push(B)}},O=async()=>{if(d.value){window.electron.removeListener("app-status",E),window.electron.on("app-status",E),window.electron.send("check-for-updates");try{if((await window.electron.invoke("get-update-available")).isUpdateAvailable){const M={_id:"system-update",title:"Update",text:"New camera.ui app update available",type:"info",link:"/settings/system",timestamp:Date.now()};if(l.value.find(B=>B._id===M._id))return;l.value.push(M)}}catch{}}};el(()=>{o.value=n.connectToNamespace("/notifications"),o.value.request("get-notifications").subscribe(S=>{l.value=S}),o.value.socket.on("notifications",S=>{l.value=S}),o.value.socket.on("remove-notification",S=>{const M=l.value.findIndex(B=>B._id===S||B.title===S);M!==-1&&l.value.splice(M,1)}),o.value.socket.on("clear-notifications",()=>{l.value=[]})});const U=()=>{const S=document.querySelector('meta[name="electron-server"]'),M=S!==null&&S.getAttribute("content")==="true";d.value=window.electron!==void 0,h.value=M,setTimeout(()=>{d.value=window.electron!==void 0,h.value=M},100)};return Sn(()=>{U()}),vo(()=>{var S,M,B;(M=(S=o.value)==null?void 0:S.end)==null||M.call(S),(B=window.electron)==null||B.removeListener("app-status",E)}),(S,M)=>{const B=Qb,W=Lh,I=ys,w=Ub,H=Ea,J=Qc;return m(),A(yt,null,[y(I,{severity:"secondary",text:"",class:"cui-button p-2 text-color non-draggable-region",onClick:f},{icon:$(()=>[y(B,{class:"w-6 h-6"}),c(l).length?(m(),j(W,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] right-[10px] top-[7px]"})):ce("",!0)]),_:1}),y(J,{ref_key:"notificationsMenuRef",ref:a,"append-to":"self",class:"w-[20rem] cui-rounded-corner shadow-lg notification-menu isolate overscroll-contain non-draggable-region",onHide:N},{default:$(()=>[g("div",u5,[g("div",d5,[g("h3",h5,me(S.$t("components.notification_menu.notifications")),1),y(W,{class:"rounded-full text-xs p-1"},{default:$(()=>[Qt(me(c(l).length>99?"99+":c(l).length),1)]),_:1})]),c(l).length?(m(),j(I,{key:0,severity:"danger",text:"",rounded:"",class:"p-2 cui-icon-md",onClick:L},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:1})):ce("",!0)]),g("div",m5,[(m(!0),A(yt,null,qt(c(l),q=>{var oe,ue,Se;return m(),A("div",{key:q._id,class:"relative overflow-hidden"},[Pt((m(),A("div",{class:"relative transition-all duration-200",style:ot({left:((oe=c(u)[q._id])==null?void 0:oe.left)||"0",opacity:((ue=c(u)[q._id])==null?void 0:ue.opacity)||1})},[y(I,{severity:"secondary",text:"",class:"cui-button p-2 block w-full",onClick:F=>K(q)},{default:$(()=>[g("div",p5,[g("div",{class:"w-2 h-2 rounded-full mt-2",style:ot({backgroundColor:se(q.type)})},null,4),g("div",f5,[g("div",g5,[g("h4",v5,me(q.title),1),g("span",_5,me(b(q.timestamp)),1)]),g("p",y5,me(q.text),1)])])]),_:2},1032,["onClick"])],4)),[[c(Y0),F=>v(q._id,F)]]),g("div",{class:"absolute right-0 top-0 h-full flex items-center pr-4",style:ot({opacity:((Se=c(u)[q._id])==null?void 0:Se.deleteOpacity)||0})},[y(I,{severity:"danger",class:"cui-icon-sm",text:"",rounded:"",onClick:F=>z(q)},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:2},1032,["onClick"])],4),c(l).indexOf(q)!==c(l).length-1?(m(),j(H,{key:0,class:"my-0 py-1"})):ce("",!0)])}),128))]),c(l).length===0?(m(),A("div",b5,me(S.$t("components.notification_menu.no_notifications")),1)):ce("",!0)]),_:1},512)],64)}}}),x5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S5(s,e){return m(),A("svg",x5,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12t-1.463 3.538T12 17M2 13q-.425 0-.712-.288T1 12t.288-.712T2 11h2q.425 0 .713.288T5 12t-.288.713T4 13zm18 0q-.425 0-.712-.288T19 12t.288-.712T20 11h2q.425 0 .713.288T23 12t-.288.713T22 13zm-8-8q-.425 0-.712-.288T11 4V2q0-.425.288-.712T12 1t.713.288T13 2v2q0 .425-.288.713T12 5m0 18q-.425 0-.712-.288T11 22v-2q0-.425.288-.712T12 19t.713.288T13 20v2q0 .425-.288.713T12 23M5.65 7.05L4.575 6q-.3-.275-.288-.7t.288-.725q.3-.3.725-.3t.7.3L7.05 5.65q.275.3.275.7t-.275.7t-.687.288t-.713-.288M18 19.425l-1.05-1.075q-.275-.3-.275-.712t.275-.688q.275-.3.688-.287t.712.287L19.425 18q.3.275.288.7t-.288.725q-.3.3-.725.3t-.7-.3M16.95 7.05q-.3-.275-.288-.687t.288-.713L18 4.575q.275-.3.7-.288t.725.288q.3.3.3.725t-.3.7L18.35 7.05q-.3.275-.7.275t-.7-.275M4.575 19.425q-.3-.3-.3-.725t.3-.7l1.075-1.05q.3-.275.712-.275t.688.275q.3.275.288.688t-.288.712L6 19.425q-.275.3-.7.288t-.725-.288"},null,-1)]))}const C5=pe({name:"material-symbols-light-mode-rounded",render:S5}),k5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E5(s,e){return m(),A("svg",k5,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 21q-3.75 0-6.375-2.625T3 12t2.625-6.375T12 3q.35 0 .688.025t.662.075q-1.025.725-1.638 1.888T11.1 7.5q0 2.25 1.575 3.825T16.5 12.9q1.375 0 2.525-.613T20.9 10.65q.05.325.075.662T21 12q0 3.75-2.625 6.375T12 21"},null,-1)]))}const A5=pe({name:"material-symbols-dark-mode",render:E5}),M5={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},$5=["id"],P5=["mask"];function T5(s,e){return m(),A("svg",M5,[g("defs",null,[g("mask",{id:s.idMap.ipSDarkMode0},e[0]||(e[0]=[g("g",{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":"10","stroke-width":"4"},[g("path",{fill:"#fff",stroke:"#fff",d:"m24.003 4l5.27 5.27h9.457v9.456l5.27 5.27l-5.27 5.278v9.456h-9.456L24.004 44l-5.278-5.27H9.27v-9.456L4 23.997l5.27-5.27V9.27h9.456z"}),g("path",{fill:"#000",stroke:"#000",d:"M27 17c0 8-5 9-10 9c0 4 6.5 8 12 4s2-13-2-13"})],-1)]),8,$5)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSDarkMode0+")"},null,8,P5)])}const R5=pe({name:"icon-park-solid-dark-mode",render:T5,setup(){return{idMap:{ipSDarkMode0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Nl=Mi("theme",()=>{const s=localStorage.getItem("theme"),e=s?JSON.parse(s):{theme:"dark",autoMode:!0},t=wu(e.theme,{onBeforeChange(){if(!r.value)return!1},onChanged(h){e.theme=h,localStorage.setItem("theme",JSON.stringify(e))}}),n=wu(e.autoMode,{onBeforeChange(h){if(h&&!r.value)return!1},onChanged(h){e.autoMode=h,localStorage.setItem("theme",JSON.stringify(e))}}),r=ae(!0),i=Tr(["light","dark"]);Ge(n,h=>{h&&(t.value=o())}),Ge(t,h=>{Zs(()=>{l(h),r.value=!0}),r.value=!1});const o=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",a=()=>n.value?o():t.value,l=h=>{switch(document.documentElement.setAttribute("data-mode",h),h){case"light":document.documentElement.classList.remove("dark-mode");break;case"dark":document.documentElement.classList.add("dark-mode");break}},u=()=>{n.value?(n.value=!1,t.value="light"):t.value==="light"?t.value="dark":n.value=!0},d=Gh("(prefers-color-scheme: dark)");return Ge(d,h=>{n.value&&(t.value=h?"dark":"light")}),l(a()),{colors:i,theme:t,autoMode:n,setAppTheme:l,getSystemMode:o,toggleTheme:u}}),I5=At({__name:"CuiThemeSwitch",setup(s){const e=Nl(),{theme:t,autoMode:n}=Vs(e),r=()=>{e.toggleTheme()};return(i,o)=>{const a=R5,l=A5,u=C5,d=ys;return m(),j(d,{severity:"secondary",text:"",class:"cui-button p-2 text-color",onClick:r},{default:$(()=>[c(n)?(m(),j(a,{key:0,class:"w-6 h-6"})):c(t)==="dark"?(m(),j(l,{key:1,class:"w-6 h-6"})):c(t)==="light"?(m(),j(u,{key:2,class:"w-6 h-6"})):ce("",!0)]),_:1})}}}),O5={class:"relative flex overflow-hidden items-center justify-center w-5 h-5"},N5={class:"flex flex-col justify-between w-4 h-3 transform transition-all duration-100 origin-center overflow-hidden"},F5=At({__name:"CuiNavbarToggle",setup(s){const e=Tl(),{bus:t}=Rl(),{navbarState:n}=ja(),{xlBreakpoint:r}=Vr(),{uiSettings:i}=Vs(e),o=ae("closed"),a=ne(()=>o.value==="opened");Ge(n,u=>{u&&u!==o.value&&(o.value=u==="minified"||u==="closed"?"closed":"opened")});const l=()=>{t.emit({navbarState:o.value==="opened"?"closed":"opened"})};return(u,d)=>{const h=ys;return!c(r)||c(i).interface.navbarStayCollapsed?(m(),j(h,{key:0,id:"menu-icon",class:"cui-button relative group p-2 transition-colors duration-100",severity:"secondary",text:"",onClick:l},{default:$(()=>[g("div",O5,[g("div",N5,[g("div",{class:at(["h-0.5 w-2 transform transition-all duration-100 origin-center",{"w-4 rotate-45 translate-y-[5px]":c(a)}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["h-0.5 w-4 rounded transform transition-all duration-100",{"opacity-0":c(a)}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["h-0.5 w-3 transform transition-all duration-100 origin-center",{"w-4 -rotate-45 -translate-y-[5px]":c(a)}]),style:{backgroundColor:"var(--text-color)"}},null,2)])])]),_:1})):ce("",!0)}}}),L5={class:"group relative flex items-center"},j5={key:0,class:"flex items-center mr-3 pointer-events-auto"},q5={class:"flex-1 min-w-0 text-left"},D5={class:"text-sm font-medium truncate"},B5=["is-exact-active"],z5=["is-exact-active"],U5=At({__name:"CuiListItem",props:{active:{type:Boolean},disabled:{type:Boolean},to:{},activeClass:{},buttonProps:{},tooltip:{}},emits:["click"],setup(s,{emit:e}){const t=e,n=s,{disabled:r,active:i,to:o,activeClass:a,buttonProps:l,tooltip:u}=Wt(n),[d,h]=lc(),[v,f]=lc(),b=k=>{r.value||t("click",k)};return(k,z)=>{const L=ys,se=Ei("RouterLink"),K=jr;return m(),A("div",L5,[y(c(v),null,{default:$(({isExactActive:N})=>[g("div",{class:at(["relative z-10 flex items-center w-full px-3 py-2 pointer-events-none",{"opacity-80 text-muted pointer-events-none disabled cursor-not-allowed":c(r)}])},[k.$slots.prepend?(m(),A("div",j5,[ei(k.$slots,"prepend",{isExactActive:N??!1},void 0,!0)])):ce("",!0),g("div",q5,[g("div",D5,[ei(k.$slots,"default",{isExactActive:N??!1},void 0,!0)]),k.$slots.subtitle?(m(),A("div",{key:0,"is-exact-active":N??!1,class:"text-sm text-muted mt-0.5"},[ei(k.$slots,"subtitle",{},void 0,!0)],8,B5)):ce("",!0)]),k.$slots.append?(m(),A("div",{key:1,"is-exact-active":N??!1,class:"flex items-center ml-3 pointer-events-auto"},[ei(k.$slots,"append",{},void 0,!0)],8,z5)):ce("",!0)],2)]),_:3}),y(c(d),null,{default:$(({isExactActive:N})=>[Pt(y(L,et({text:"",fluid:"",disabled:c(r),severity:"contrast",class:["cui-button absolute inset-0",[{active:c(i)||N,"cursor-not-allowed disabled":c(r)},c(i)||N?c(a):void 0]]},c(l),{onClick:b}),null,16,["disabled","class"]),[[K,{value:c(u)}]]),y(c(f),{"is-exact-active":N},null,8,["is-exact-active"])]),_:1}),c(o)?(m(),j(se,{key:0,to:c(o),class:"block transition-all duration-300"},{default:$(({isExactActive:N})=>[y(c(h),{"is-exact-active":N},null,8,["is-exact-active"])]),_:1},8,["to"])):(m(),j(c(h),{key:1}))])}}}),pp=qs(U5,[["__scopeId","data-v-115e51ef"]]),V5={key:0,class:"flex flex-col gap-1"},H5={key:2,class:"flex flex-col gap-1"},Q5={key:4,class:"flex flex-col gap-1"},fp=At({__name:"CuiMenu",props:{items:{},autoHide:{type:Boolean,default:!0},popover:{},sortList:{type:Boolean}},emits:["show","hide","click:menu-item"],setup(s,{expose:e,emit:t}){const n=t,r=s,{items:i,autoHide:o,popover:a,sortList:l}=Wt(r),u=Vt("menuRef"),d=ae(!1),h=ae(),[v,f]=lc(),b=ne(()=>{const S=i.value.filter(M=>!M.hide);return l.value?S.sort((M,B)=>M.key&&B.key?M.key.localeCompare(B.key):M.label&&B.label?M.label.localeCompare(B.label):0):S}),k=ne(()=>b.value.filter(S=>S.position==="header")),z=ne(()=>b.value.filter(S=>S.position==="footer")),L=ne(()=>b.value.filter(S=>!S.position)),se=S=>{var M;o.value&&O(),(M=S.onClick)==null||M.call(S,bu(h.value)),n("click:menu-item",S)},K=()=>{d.value=!0,n("show")},N=()=>{h.value=void 0,d.value=!1,n("hide")},E=(S,M,B)=>{var W;h.value=B,(W=u.value)==null||W.toggle(S,M)},O=()=>{var S;(S=u.value)==null||S.hide()},U=(S,M)=>{var B;(B=u.value)==null||B.show(S,M)};return e({menu:u,isOpen:d,data:bu(h),toggleMenu:E,hide:O,show:U}),(S,M)=>{const B=Zm,W=fo,I=pp,w=Ea,H=Qc;return m(),j(H,et({ref_key:"menuRef",ref:u,class:"shadow-lg cui-rounded-corner"},c(a),{onShow:K,onHide:N}),{default:$(()=>[y(c(v),null,{default:$(({item:J})=>[(m(),j(I,{key:J.key,to:J.to,class:"min-h-10","active-class":"!bg-primary-500/10",disabled:J.disabled,"button-props":J.buttonProps,tooltip:J.tooltip,onClick:q=>se(J)},Hh({default:$(({isExactActive:q})=>[g("span",et(J.labelProps,{class:{"text-primary":q||J.active,"!font-bold":J.avatarProps,"opacity-70":!J.disabled}}),me(J.label),17)]),_:2},[J.avatarProps||J.icon?{name:"prepend",fn:$(({isExactActive:q})=>[J.avatarProps?(m(),j(B,H0(et({key:0},J.avatarProps)),null,16)):ce("",!0),J.icon?(m(),j(Ai(J.icon),et({key:1},J.iconProps,{class:{"text-primary":q||J.active,"opacity-70":!J.disabled}}),null,16,["class"])):ce("",!0)]),key:"0"}:void 0,J.description?{name:"subtitle",fn:$(()=>[g("span",et(J.descriptionProps,{class:{"opacity-70":!J.disabled}}),me(J.description),17)]),key:"1"}:void 0,J.toggle?{name:"append",fn:$(()=>[y(W,{"model-value":J.toggleState,disabled:J.disabled,"onUpdate:modelValue":q=>se(J)},null,8,["model-value","disabled","onUpdate:modelValue"])]),key:"2"}:void 0]),1032,["to","disabled","button-props","tooltip","onClick"]))]),_:1}),c(k).length?(m(),A("div",V5,[(m(!0),A(yt,null,qt(c(k),(J,q)=>(m(),j(c(f),{key:q,item:J},null,8,["item"]))),128))])):ce("",!0),c(k).length&&c(L).length?(m(),j(w,{key:1,class:"m-0 py-3"})):ce("",!0),c(L).length?(m(),A("div",H5,[(m(!0),A(yt,null,qt(c(L),(J,q)=>(m(),j(c(f),{key:q,item:J},null,8,["item"]))),128))])):ce("",!0),c(L).length&&c(z).length?(m(),j(w,{key:3,class:"m-0 py-3"})):ce("",!0),c(z).length?(m(),A("div",Q5,[(m(!0),A(yt,null,qt(c(z),(J,q)=>(m(),j(c(f),{key:q,item:J},null,8,["item"]))),128))])):ce("",!0)]),_:1},16)}}}),K5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z5(s,e){return m(),A("svg",K5,e[0]||(e[0]=[Vh('<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path d="M11 21H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v7"></path><path stroke-linejoin="round" d="M2 7h20M5 5.01l.01-.011M8 5.01l.01-.011M11 5.01l.01-.011m10.657 11.668C21.047 15.097 19.635 14 17.99 14c-1.758 0-3.252 1.255-3.793 3"></path><path stroke-linejoin="round" d="M19.995 16.772H21.4a.6.6 0 0 0 .6-.6V14.55m-7.666 4.783C14.953 20.903 16.366 22 18.01 22c1.758 0 3.252-1.255 3.793-3"></path><path stroke-linejoin="round" d="M16.005 19.228H14.6a.6.6 0 0 0-.6.6v1.622"></path></g>',1)]))}const G5=pe({name:"iconoir-reload-window",render:Z5}),W5={class:"relative w-6 h-6"},J5=At({__name:"CuiProfileMenu",setup(s){const{t:e}=js(),t=Fs(),{user:n}=Vs(t),r=Vt("menuRef"),i=ne(()=>uo.filter(l=>{var u;return((u=l.meta)==null?void 0:u.profileMenu)&&l.meta.auth&&Si(l)})),o=ne(()=>{var h,v;const l={label:(h=n.value)==null?void 0:h.username,description:(v=n.value)==null?void 0:v.role,to:"/settings/account",position:"header",avatarProps:{src:"avatar",size:35,style:{width:"35px",height:"35px"}}},u=[...i.value.map(f=>({label:e(`navigation.${f.name.toLowerCase()}`),icon:f.meta.profileMenu.icon.default,to:f.path})),{label:e("components.user_menu.reload"),icon:G5,onClick:a}],d={label:e("components.user_menu.logout"),icon:Yh,position:"footer",iconProps:{class:"!text-primary"},labelProps:{class:"!text-primary"},buttonProps:{class:"hover:!bg-primary-500/10 active:!bg-primary-500/10 focus:!bg-primary-500/10"},onClick:t.logout};return[l,...u,d]}),a=()=>{window.location.reload()};return(l,u)=>{var v;const d=ys,h=fp;return m(),A(yt,null,[y(d,{severity:"secondary",text:"",class:"cui-button p-2 text-color",onClick:(v=c(r))==null?void 0:v.toggleMenu},{default:$(()=>{var f,b,k;return[g("div",W5,[g("div",{class:at(["absolute top-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center",{"w-4 h-[2px] rotate-45 top-1/2 -translate-y-1/2 rounded-none":(f=c(r))==null?void 0:f.isOpen}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full transition-all duration-100",{"opacity-0 scale-0":(b=c(r))==null?void 0:b.isOpen}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center",{"w-4 h-[2px] -rotate-45 bottom-1/2 translate-y-1/2 rounded-none":(k=c(r))==null?void 0:k.isOpen}]),style:{backgroundColor:"var(--text-color)"}},null,2)])]}),_:1},8,["onClick"]),y(h,{ref_key:"menuRef",ref:r,items:c(o),popover:{appendTo:"self",pt:{root:{class:"w-[18rem] profile-menu"}}}},null,8,["items"])],64)}}}),Y5={HEIGHT:60},X5={class:"flex flex-row items-center flex-1 p-2"},ew=At({__name:"CuiTopbar",setup(s){const{showBottombar:e}=ja();return(t,n)=>{const r=J5,i=F5,o=I5,a=w5;return m(),A("header",{class:"cui-topbar fixed flex flex-row items-center right-0 pt-safe pr-safe draggable-region",style:ot({height:`calc(${c(Y5).HEIGHT}px + env(safe-area-inset-top, 0px))`})},[g("div",X5,[c(e)?(m(),j(r,{key:0,class:"non-draggable-region"})):(m(),j(i,{key:1,class:"non-draggable-region"})),y(o,{class:"ml-auto non-draggable-region"}),("useCuiPermission"in t?t.useCuiPermission:c(Si))(void 0,"admin")?(m(),j(a,{key:2})):ce("",!0)])],4)}}}),tw=qs(ew,[["__scopeId","data-v-162b131f"]]),sw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nw(s,e){return m(),A("svg",sw,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4m-8-2l8-8m0 0v5m0-5h-5"},null,-1)]))}const rw=pe({name:"majesticons-open",render:nw}),gp=At({__name:"CuiChipGroup",props:Kn({selectedClass:{},disabled:{type:Boolean},mandatory:{type:Boolean},multiple:{type:Boolean}},{modelValue:{required:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const e=Rr(s,"modelValue"),t=s,{selectedClass:n,disabled:r,mandatory:i,multiple:o}=Wt(t);return Xc("chipGroup",{modelValue:e,selectedClass:n,disabled:r,mandatory:i,updateSelected:l=>{if(!r.value)if(o.value){let u=[...Array.isArray(e.value)?e.value:[]];u.includes(l)?(!i.value||u.length>1)&&(u=u.filter(d=>d!==l)):u.push(l),e.value=u}else e.value===l?i.value||(e.value=void 0):e.value=l}}),(l,u)=>(m(),A("div",{class:at(["flex flex-wrap gap-2",{"opacity-60 pointer-events-none":c(r)}])},[ei(l.$slots,"default")],2))}}),iw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ow(s,e){return m(),A("svg",iw,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z"},null,-1)]))}const vp=pe({name:"mdi-check",render:ow}),aw={key:0,class:"absolute left-1 top-1/2 transform -translate-y-1/2 flex items-center justify-center cui-icon-sm"},cw=At({__name:"CuiChip",props:{value:{},removable:{type:Boolean},disabled:{type:Boolean},size:{},filter:{type:Boolean}},setup(s){const e=s,{value:t,removable:n,disabled:r,size:i,filter:o}=Wt(e),a=mi("chipGroup"),l=ne(()=>r.value||(a==null?void 0:a.disabled.value)),u=ne(()=>{if(!a)return!1;const v=a.modelValue.value;return Array.isArray(v)?v.includes(t.value):v===t.value}),d=ne(()=>u.value?a==null?void 0:a.selectedClass.value:void 0),h=()=>{l.value||a==null||a.updateSelected(t.value)};return(v,f)=>{const b=vp,k=I0;return m(),j(k,{removable:c(n),disabled:c(l),class:at(["cui-chip inline-flex cursor-pointer transition-all rounded-full py-1 px-2 relative",[{"cui-chip-selected":c(u),"cui-chip-disabled":c(l),"cui-chip-small":c(i)==="small","cui-chip-medium":c(i)==="medium","cui-chip-large":c(i)==="large","pl-7":c(o)&&c(u)},c(d)]]),onClick:h},{default:$(()=>[y(Et,{name:"fade"},{default:$(()=>[c(o)&&c(u)?(m(),A("div",aw,[y(b,{width:"100%",height:"100%"})])):ce("",!0)]),_:1}),ei(v.$slots,"default",{},void 0,!0)]),_:3},8,["removable","disabled","class"])}}}),_p=qs(cw,[["__scopeId","data-v-3b79f904"]]),lw=async({cameraData:s})=>(await Ie.post("/cameras",s)).data,uw=async({cameraData:s})=>(await Ie.post("/cameras/pair",s)).data,dw=async({cameraData:s})=>(await Ie.post("/cameras/preview",s)).data,yp=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}`,{signal:e})).data,hw=async({cameraname:s})=>(await Ie.delete(`/cameras/${s}/log`)).data,mw=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}/log/download`,{signal:e})).data,pw=async({cameraname:s,sourcename:e,probeConfig:t,signal:n})=>(await Ie.get(`/cameras/${s}/probe/${e}`,{params:{...t},signal:n})).data,fw=async({cameraname:s,forceNew:e,signal:t})=>(await Ie.get(`/cameras/${s}/snapshot`,{signal:t,params:{forceNew:e}})).data,gw=async({parameter:s,signal:e})=>(await Ie.get("/cameras",{params:s,signal:e})).data,vw=async({type:s,src:e,signal:t})=>(await Ie.get("/cameras/discover",{params:{type:s,src:e},signal:t})).data,_w=async({cameraname:s,cameraData:e})=>(await Ie.patch(`/cameras/${s}`,e)).data,yw=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}/extensions`,{signal:e})).data,bw=async({cameraname:s,pluginname:e,signal:t})=>(await Ie.get(`/cameras/${s}/${e}/config`,{signal:t})).data,ww=async({cameraname:s,pluginname:e,configData:t})=>(await Ie.patch(`/cameras/${s}/${e}/config`,t)).data,xw=async({cameraname:s,pluginname:e,configData:t})=>(await Ie.put(`/cameras/${s}/${e}/config`,t)).data,Sw=async({cameraname:s,pluginname:e,configData:t})=>(await Ie.post(`/cameras/${s}/${e}/config`,t)).data,Cw=async({cameraname:s,pluginname:e,type:t})=>(await Ie.put(`/cameras/${s}/${e}/enable`,null,{params:{type:t}})).data,kw=async({cameraname:s,pluginname:e,type:t})=>(await Ie.put(`/cameras/${s}/${e}/disable`,null,{params:{type:t}})).data,Ew=async({cameraname:s,pluginname:e,type:t})=>(await Ie.post(`/cameras/${s}/${e}`,null,{params:{type:t}})).data,Aw=async({cameraname:s,pluginname:e,type:t})=>(await Ie.delete(`/cameras/${s}/${e}`,{params:{type:t}})).data,Mw=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}/zones`,{signal:e})).data,$w=async({cameraname:s,zoneData:e})=>(await Ie.patch(`/cameras/${s}/zones`,e)).data,Pw=async({cameraname:s})=>(await Ie.delete(`/cameras/${s}`)).data,Tw=async()=>(await Ie.delete("/cameras")).data;class Jn{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"getCameraQuery",enabled:!0},{name:"getCamerasQuery",enabled:!0},{name:"discoverCamerasQuery",enabled:!0},{name:"getCameraSnapshotQuery",enabled:!0},{name:"getCameraExtensionsQuery",enabled:!0},{name:"getCameraExtensionConfigQuery",enabled:!0},{name:"getZonesQuery",enabled:!0},{name:"probeCameraSourceQuery",enabled:!0},{name:"downloadLogQuery",enabled:!0}]))}get queryClient(){return this._queryClient}createCameraQuery(){return ut({mutationFn:lw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_added"),life:3e3})}})}pairCameraQuery(){return ut({mutationFn:uw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_added"),life:3e3})}})}previewCameraQuery(){return ut({mutationFn:dw})}getCameraQuery(e){return Bt({queryKey:["cameras",e],queryFn:({signal:t})=>yp({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraQuery"&&t.enabled)})}getCameraExtensionsQuery(e){return Bt({queryKey:["camerasExtensions",e],queryFn:({signal:t})=>yw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraExtensionsQuery"&&t.enabled)})}probeCameraSourceQuery(e,t,n){return Bt({queryKey:["cameras",e,"probe",t],queryFn:({signal:r})=>pw({cameraname:c(e),sourcename:c(t),probeConfig:c(n),signal:r}),enabled:()=>this.queryActivator.value.some(r=>r.name==="probeCameraSourceQuery"&&r.enabled)})}getCameraSnapshotQuery(e,t){return Bt({queryKey:["camerasSnapshot",e],queryFn:({signal:n})=>fw({cameraname:c(e),forceNew:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getCameraSnapshotQuery"&&n.enabled),retry:!1})}getCamerasQuery(e){return Bt({queryKey:["camerasList",e],queryFn:({signal:t})=>gw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getCamerasQuery"&&t.enabled)})}discoverCamerasQuery(e){return Bt({queryKey:["cameras","discover",e],queryFn:({signal:t})=>vw({...c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="discoverCamerasQuery"&&t.enabled)})}patchCameraQuery(){return ut({mutationFn:_w,onSuccess:async(e,t)=>{if(t.cameraData.name&&t.cameraData.name!==t.cameraname){const r=t.cameraname;await this._queryClient.invalidateQueries({queryKey:[r]}),await this._queryClient.refetchQueries({queryKey:["camerasList"]})}else await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]});this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_updated"),life:3e3})}})}getCameraExtensionConfigQuery(e,t,n){return Bt({queryKey:["cameras","extensions",e,t],queryFn:({signal:r})=>bw({cameraname:c(e),pluginname:c(t),signal:r}),enabled:()=>this.queryActivator.value.some(r=>r.name==="getCameraExtensionConfigQuery"&&r.enabled),refetchInterval(){if(n.value)return 15e3},retry:10,retryDelay:500,staleTime:0})}patchCameraExtensionConfigQuery(){return ut({mutationFn:ww,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}setCameraExtensionConfigQuery(){return ut({mutationFn:xw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}submitCameraExtensionConfigQuery(){return ut({mutationFn:Sw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}enableCameraExtensionQuery(){return ut({mutationFn:Cw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}disableCameraExtensionQuery(){return ut({mutationFn:kw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}addCameraExtensionQuery(){return ut({mutationFn:Ew,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}getZonesQuery(e){return Bt({queryKey:["cameras",e,"zones"],queryFn:({signal:t})=>Mw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getZonesQuery"&&t.enabled)})}patchZonesQuery(){return ut({mutationFn:$w,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.zone_updated"),life:3e3})}})}removeCameraExtensionQuery(){return ut({mutationFn:Aw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}removeCameraQuery(){return ut({mutationFn:Pw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_removed"),life:3e3})}})}removeCamerasQuery(){return ut({mutationFn:Tw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.cameras_removed"),life:3e3})}})}downloadLogQuery(e){return Bt({queryKey:["logs",e],queryFn:({signal:t})=>mw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return ut({mutationFn:hw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["logs",t.cameraname],exact:!0}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.log_cleared"),life:3e3})}})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const Rw=async({pluginData:s})=>(await Ie.post("/plugins",s)).data,Iw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}`,{signal:e})).data,Ow=async({pluginname:s,signal:e})=>(await Ie.get(`/plugins/${s}/versions`,{signal:e})).data,Nw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/update`,{signal:e})).data,Fw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/logo`,{signal:e})).data,Lw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/config`,{signal:e})).data,jw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/contract`,{signal:e})).data,qw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/readme`,{signal:e})).data,Dw=async({pluginName:s,query:e,signal:t})=>(await Ie.get(`/plugins/${s}/changelog`,{params:e,signal:t})).data,Bw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/interface`,{signal:e})).data,zw=async({parameter:s,signal:e})=>(await Ie.get("/plugins",{params:s,signal:e})).data,Uw=async({parameter:s,signal:e})=>(await Ie.get("/plugins/extensions",{params:s,signal:e})).data,Vw=async({pluginName:s})=>(await Ie.delete(`/plugins/${s}/log`)).data,Hw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/log/download`,{signal:e})).data,Qw=async({parameter:s,signal:e})=>(await Ie.get("/plugins/progress",{params:s,signal:e})).data,Kw=async({query:s,parameter:e,signal:t})=>(await Ie.get("/plugins/search",{params:{...s,...e},signal:t})).data,Zw=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/enable`)).data,Gw=async({pluginName:s,configData:e})=>(await Ie.patch(`/plugins/${s}/config`,e)).data,Ww=async({pluginname:s,configData:e})=>(await Ie.put(`/plugins/${s}/config`,e)).data,Jw=async({pluginname:s,configData:e})=>(await Ie.post(`/plugins/${s}/config`,e)).data,Yw=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/disable`)).data,Xw=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/start`)).data,e3=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/stop`)).data,t3=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/restart`)).data,s3=async({pluginName:s,formData:e})=>(await Ie.post(`/plugins/${s}/detect/motion`,e,{responseType:"arraybuffer"})).data,n3=async({pluginName:s,formData:e})=>(await Ie.post(`/plugins/${s}/detect/objects`,e)).data,r3=async({pluginName:s,formData:e})=>(await Ie.post(`/plugins/${s}/detect/audio`,e)).data,i3=async({pluginName:s,removeStorage:e})=>(await Ie.delete(`/plugins/${s}`,{params:{removeStorage:e}})).data,o3=async()=>(await Ie.delete("/plugins")).data;class bp{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"getPluginQuery",enabled:!0},{name:"getPluginsQuery",enabled:!0},{name:"getPluginsExtensionsQuery",enabled:!0},{name:"searchPluginsQuery",enabled:!0},{name:"getPluginVersionsQuery",enabled:!0},{name:"getPluginUpdateQuery",enabled:!0},{name:"getPluginLogoQuery",enabled:!0},{name:"getPluginConfigQuery",enabled:!0},{name:"getPluginContractQuery",enabled:!0},{name:"getPluginReadmeQuery",enabled:!0},{name:"getPluginInterfaceQuery",enabled:!0},{name:"getPluginChangelogQuery",enabled:!0},{name:"getPluginsProgressQuery",enabled:!0},{name:"installPluginQuery",enabled:!0},{name:"enablePluginQuery",enabled:!0},{name:"disablePluginQuery",enabled:!0},{name:"patchPluginConfigQuery",enabled:!0},{name:"setPluginConfigQuery",enabled:!0},{name:"submitPluginConfigQuery",enabled:!0},{name:"startPluginQuery",enabled:!0},{name:"stopPluginQuery",enabled:!0},{name:"restartPluginQuery",enabled:!0},{name:"detectMotionQuery",enabled:!0},{name:"detectObjectsQuery",enabled:!0},{name:"detectAudioQuery",enabled:!0},{name:"uninstallPluginQuery",enabled:!0},{name:"uninstallPluginsQuery",enabled:!0},{name:"downloadLogQuery",enabled:!0}]))}get queryClient(){return this._queryClient}installPluginQuery(){return ut({mutationFn:Rw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["plugins"]}),await this._queryClient.refetchQueries({queryKey:["pluginsSearch"]}),await this._queryClient.refetchQueries({queryKey:["pluginsProgress"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_installed"),life:3e3})}})}getPluginQuery(e){return Bt({queryKey:["plugins",e],queryFn:({signal:t})=>Iw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginQuery"&&t.enabled)})}getPluginsQuery(e){return Bt({queryKey:["pluginsList",e],queryFn:({signal:t})=>zw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsQuery"&&t.enabled)})}getPluginsExtensionsQuery(e){return Bt({queryKey:["extensionsList",e],queryFn:({signal:t})=>Uw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsExtensionsQuery"&&t.enabled)})}getPluginsProgressQuery(e){return Bt({queryKey:["pluginsProgress",e],queryFn:({signal:t})=>Qw({parameter:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsProgressQuery"&&t.enabled)})}searchPluginsQuery(e,t){return Bt({queryKey:["pluginsSearch",e,t],queryFn:({signal:n})=>Kw({query:c(e),parameter:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="searchPluginsQuery"&&n.enabled)})}getPluginVersionsQuery(e){return Bt({queryKey:["plugins",e,"versions"],queryFn:({signal:t})=>Ow({pluginname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginVersionsQuery"&&t.enabled)})}getPluginUpdateQuery(e){return Bt({queryKey:["plugins",e,"update"],queryFn:({signal:t})=>Nw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginUpdateQuery"&&t.enabled)})}getPluginLogoQuery(e){return Bt({queryKey:["plugins",e,"logo"],queryFn:({signal:t})=>Fw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginLogoQuery"&&t.enabled)})}getPluginConfigQuery(e){return Bt({queryKey:["plugins",e,"config"],queryFn:({signal:t})=>Lw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginConfigQuery"&&t.enabled)})}getPluginContractQuery(e){return Bt({queryKey:["plugins",e,"contract"],queryFn:({signal:t})=>jw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginContractQuery"&&t.enabled)})}getPluginReadmeQuery(e){return Bt({queryKey:["plugins",e,"readme"],queryFn:({signal:t})=>qw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginReadmeQuery"&&t.enabled)})}getPluginInterfaceQuery(e){return Bt({queryKey:["plugins",e,"interface"],queryFn:({signal:t})=>Bw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginInterfaceQuery"&&t.enabled)})}getPluginChangelogQuery(e,t){return Bt({queryKey:["plugins",e,"changelog"],queryFn:({signal:n})=>Dw({pluginName:c(e),query:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getPluginChangelogQuery"&&n.enabled)})}patchPluginConfigQuery(){return ut({mutationFn:Gw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_config_updated"),life:3e3})}})}startPluginQuery(){return ut({mutationFn:Xw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_started"),life:3e3})}})}stopPluginQuery(){return ut({mutationFn:e3,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_stopped"),life:3e3})}})}restartPluginQuery(){return ut({mutationFn:t3,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_restarted"),life:3e3})}})}detectMotionQuery(){return ut({mutationFn:s3})}detectObjectsQuery(){return ut({mutationFn:n3})}detectAudioQuery(){return ut({mutationFn:r3})}setPluginConfigQuery(){return ut({mutationFn:Ww,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}submitPluginConfigQuery(){return ut({mutationFn:Jw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}enablePluginQuery(){return ut({mutationFn:Zw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_enabled"),life:3e3})}})}disablePluginQuery(){return ut({mutationFn:Yw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_disabled"),life:3e3})}})}uninstallPluginQuery(){return ut({mutationFn:i3,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["pluginsSearch"]}),await this._queryClient.refetchQueries({queryKey:["pluginsProgress"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_removed"),life:3e3})}})}uninstallPluginsQuery(){return ut({mutationFn:o3,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["pluginsSearch"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugins_removed"),life:3e3})}})}downloadLogQuery(e){return Bt({queryKey:["logs",e],queryFn:({signal:t})=>Hw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return ut({mutationFn:Vw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["logs",t.pluginName],exact:!0}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.log_cleared"),life:3e3})}})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const a3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c3(s,e){return m(),A("svg",a3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17 13h-4v4h-2v-4H7v-2h4V7h2v4h4m-5-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"},null,-1)]))}const wp=pe({name:"mdi-plus-circle",render:c3}),l3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u3(s,e){return m(),A("svg",l3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"},null,-1)]))}const d3=pe({name:"mdi-information",render:u3}),h3={key:0,class:"flex flex-col field-gap"},m3=["for"],p3={key:1,class:"flex flex-col field-gap"},f3=["for"],g3=["for"],v3=["for"],_3={class:"flex items-center gap-4"},y3={class:"flex flex-col field-switch-gap"},b3=["for"],w3=["for"],x3={class:"flex gap-2 items-center w-full"},S3={class:"text-color"},C3={class:"w-full h-full flex flex-col gap-6"},k3={class:"flex flex-row w-full items-center justify-center mt-3"},E3=At({__name:"CuiSchemaField",props:Kn({schemaField:{},configKey:{},arrayItem:{},loading:{type:Boolean,default:!1}},{modelValue:{type:Object,required:!0},modelModifiers:{}}),emits:Kn(["onAction","onSubmit","onTrigger"],["update:modelValue"]),setup(s,{emit:e}){const t=Nl(),n=e,r=Rr(s,"modelValue"),i=s,{theme:o}=Vs(t),{schemaField:a,configKey:l,arrayItem:u,loading:d}=Wt(i),h=ae(0),v=ae(0),f=ae(a.value.opened?[l.value]:[]);Ge(r,()=>{h.value++},{deep:!0});const b=tf(async()=>{if(ar(a.value)&&a.value.format==="qrCode"){let N;return o.value==="dark"?N={dark:"#FFFFFFFF",light:"#FF000000"}:N={dark:"#404040FF",light:"#FFFFFFFF"},await kf.toDataURL(K.value||"",{margin:.5,type:"image/png",color:N,scale:10})}},void 0,{lazy:!0}),k=ne(()=>{if(ar(a.value)&&a.value.format==="image")return K.value}),z=(N,E)=>{const O=ni(N,E);return Array.isArray(O)?O:[]},L=N=>{const E=ni(r.value,N),O=Array.isArray(E)?[...E]:[];_h(a.value)&&a.value.items&&(O.push($l(a.value.items)),ic(r.value,N,O),v.value++)},se=(N,E)=>{const O=ni(r.value,N);if(Array.isArray(O)){const U=[...O];U.splice(E,1),ic(r.value,N,U),v.value++,n("onTrigger")}},K=ne({get:()=>(h.value,ni(r.value,l.value)),set:N=>{const E=a.value;let O=N;xa(E)?E.multiple?O=Array.isArray(N)?N:[N]:O=N&&N.toString():ar(E)?O=N!=null?N.toString():"":gh(E)?O=typeof N=="number"?N:parseFloat(N)||0:vh(E)&&(O=N==="true"||N===!0),ic(r.value,l.value,O),h.value++}});return(N,E)=>{const O=Fa,U=ki,S=Fh,M=_o,B=ys,W=Aa,I=go,w=Kc,H=jh,J=fo,q=Zc,oe=qh,ue=d3,Se=Jc,F=Ei("CuiSchemaField",!0),D=wp,Y=Yc,Te=Wc,He=Gc,ht=Dh,Mt=jr;return m(),A("div",null,[c(ar)(c(a))&&c(a).format==="qrCode"?(m(),A("div",h3,[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,m3),y(O,{src:c(b),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):ce("",!0),c(ar)(c(a))&&c(a).format==="image"?(m(),A("div",p3,[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,f3),y(O,{src:c(k),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):c(D2)(c(a))?(m(),j(c(Lt),{key:2,modelValue:c(K),"onUpdate:modelValue":E[1]||(E[1]=Qe=>us(K)?K.value=Qe:null),modelModifiers:{trim:!0},name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,g3),y(I,null,{default:$(()=>[c(a).format!=="password"?(m(),j(U,et({key:0},Qe,{invalid:ze.length>0,readonly:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),type:"text"}),null,16,["invalid","readonly","placeholder","loading"])):(m(),j(S,et({key:1,"model-value":c(K),invalid:ze.length>0,readonly:c(a).readonly},Qe,{feedback:!1,"toggle-mask":""}),null,16,["model-value","invalid","readonly"])),c(u)?(m(),j(W,{key:2},{default:$(()=>[y(B,{text:"",severity:"secondary",loading:c(d),onClick:E[0]||(E[0]=ge=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M)]),_:1},8,["loading"])]),_:1})):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!ze.length&&c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)]),_:1},8,["modelValue","name"])):c(gh)(c(a))?(m(),j(c(Lt),{key:3,"model-value":c(K),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,v3),y(I,null,{default:$(()=>[y(H,et(Qe,{modelValue:c(K),"onUpdate:modelValue":E[2]||(E[2]=ge=>us(K)?K.value=ge:null),invalid:ze.length>0,readonly:c(a).readonly,step:c(a).step||1,min:c(a).minimum,max:c(a).maximum,"use-grouping":!1,loading:c(d),onValueChange:E[3]||(E[3]=ge=>K.value=ge),onInput:E[4]||(E[4]=ge=>K.value=ge.value)}),null,16,["modelValue","invalid","readonly","step","min","max","loading"]),c(u)?(m(),j(W,{key:0},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[5]||(E[5]=ge=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M)]),_:1},8,["loading"])]),_:1})):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!ze.length&&c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)]),_:1},8,["model-value","name"])):c(vh)(c(a))?(m(),j(c(Lt),{key:4,"model-value":c(K),value:!0,"unchecked-value":!1,type:"checkbox",name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("div",_3,[g("div",y3,[g("label",{for:c(l),class:"cui-label-switch"},me(c(a).title),9,b3),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-switch-error"},null,8,["name"])]),_:1})]),y(J,et({"model-value":c(K)},Qe,{invalid:ze.length>0,loading:c(d),class:"ml-auto shrink-0",onValueChange:E[6]||(E[6]=ge=>K.value=ge)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value","name"])):c(xa)(c(a))?(m(),j(c(Lt),{key:5,"model-value":c(K),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,w3),y(I,null,{default:$(()=>[c(a).multiple?(m(),j(oe,et({key:1},Qe,{"model-value":c(K),options:c(a).enum,invalid:ze.length>0,disabled:c(a).readonly,placeholder:c(a).placeholder,"show-clear":!c(a).required&&!c(a).readonly,"show-toggle-all":!1,"max-selected-labels":3,loading:c(d),onValueChange:E[8]||(E[8]=ge=>K.value=ge)}),null,16,["model-value","options","invalid","disabled","placeholder","show-clear","loading"])):(m(),j(q,et({key:0},Qe,{"model-value":c(K),options:c(a).enum,invalid:ze.length>0,disabled:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),onValueChange:E[7]||(E[7]=ge=>K.value=ge)}),null,16,["model-value","options","invalid","disabled","placeholder","loading"])),c(u)?(m(),j(W,{key:2},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[9]||(E[9]=ge=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M)]),_:1},8,["loading"])]),_:1})):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!ze.length&&c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)]),_:1},8,["model-value","name"])):c(zr)(c(a))?(m(),A(yt,{key:6},[y(B,{fluid:"",class:"mt-3 mb-1 cui-button-medium",severity:c(a).color??"secondary",loading:c(d),label:c(a).title,onClick:E[10]||(E[10]=lr(Qe=>n("onAction",{key:c(l)}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)],64)):c(Ur)(c(a))?(m(),A(yt,{key:7},[y(B,{fluid:"",class:"mt-3 mb-1 cui-button-medium",severity:c(a).color??"secondary",loading:c(d),label:c(a).title,onClick:E[11]||(E[11]=lr(Qe=>n("onSubmit",{key:c(a).key}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)],64)):c(_h)(c(a))&&c(a).items?(m(),j(ht,{key:8,class:"cui-card border-color-inner",pt:{body:{class:"p-1"}}},{content:$(()=>[(m(),j(He,{key:c(v),value:c(f),"onUpdate:value":E[18]||(E[18]=Qe=>us(f)?f.value=Qe:null),multiple:""},{default:$(()=>[y(Te,{value:c(l)??"0",class:"border-none"},{default:$(()=>[y(Se,null,{default:$(()=>[g("div",x3,[c(a).description?Pt((m(),j(ue,{key:0,class:"text-muted"},null,512)),[[Mt,{value:c(a).description}]]):ce("",!0),g("span",S3,me(c(a).title||c(l)),1),c(u)?(m(),j(B,{key:1,text:"",rounded:"",severity:"danger",class:"cui-icon-md ml-auto mr-2",loading:c(d),onClick:E[12]||(E[12]=Qe=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M,{width:"100%",height:"100%"})]),_:1},8,["loading"])):ce("",!0)])]),_:1}),y(Y,null,{default:$(()=>[g("div",C3,[(m(!0),A(yt,null,qt(z(r.value,c(l)),(Qe,ze)=>(m(),j(F,{key:`item-${ze}`,modelValue:r.value,"onUpdate:modelValue":E[13]||(E[13]=ge=>r.value=ge),"schema-field":c(a).items,"config-key":`${c(l)}[${ze}]`,"array-item":{key:c(l),index:ze},loading:c(d),onOnAction:E[14]||(E[14]=ge=>n("onAction",ge)),onOnSubmit:E[15]||(E[15]=ge=>n("onSubmit",ge)),onOnTrigger:E[16]||(E[16]=()=>v.value++)},null,8,["modelValue","schema-field","config-key","array-item","loading"]))),128)),g("div",k3,[y(B,{text:"",rounded:"",class:"cui-icon-md",loading:c(d),onClick:E[17]||(E[17]=lr(Qe=>L(c(l)),["prevent"]))},{icon:$(()=>[y(D,{width:"100%",height:"100%"})]),_:1},8,["loading"])])])]),_:1})]),_:1},8,["value"])]),_:1},8,["value"]))]),_:1})):ce("",!0)])}}}),A3={key:0,class:"flex flex-col gap-6"},M3={key:1,class:"flex flex-col gap-6"},xp=At({__name:"CuiSchema",props:{schemaForm:{},loading:{type:Boolean,default:!1},disableButton:{type:Boolean},saveButton:{type:Boolean,default:!0},saveButtonLabel:{},saveButtonColor:{},showButton:{type:Boolean,default:!1}},emits:["onSubmit","onAction","onFormSubmit","changeGroup"],setup(s,{expose:e,emit:t}){const n=t,r=s,{schemaForm:i,loading:o,saveButton:a,saveButtonLabel:l,showButton:u,disableButton:d,saveButtonColor:h}=Wt(r),v=Vt("formRef"),f=ae(""),b=ae(!1),k=ae({});Ge([i,v],([])=>{v.value&&(!B2(v.value.values,i.value.schema)||b.value)&&(k.value=v.value.values),i.value.config&&Object.keys(i.value.config).length?k.value=xi(i.value.config):k.value=z2(i.value.schema)},{immediate:!0,deep:!0});const z=ne(()=>{const I=Q2(i.value.schema);return Wn(I)}),L=ne(()=>{const I=[];return i.value.schema.forEach(w=>{w.group&&!w.hidden&&!I.includes(w.group)&&I.push(w.group)}),I.length&&!f.value&&(f.value=I[0]),I}),se=ne(()=>U2(i.value.schema,f.value)),K=ne(()=>V2(i.value.schema,f.value));Ge(f,I=>{I&&n("changeGroup",I)});const N=I=>i.value.schema.filter(w=>(w.group===I||!w.group&&I===L.value[0])&&!w.hidden),E=I=>{const w=ar(I)&&I.format==="qrCode",H=ar(I)&&I.format==="image",J=zr(I)||Ur(I);return!w&&!H&&!J},O=I=>!I.hidden||I.hidden&&E(I),U=async()=>{var I;return await((I=v.value)==null?void 0:I.validate())},S=I=>{n("onAction",I)},M=async I=>{const w=await U();w!=null&&w.valid&&(w!=null&&w.values)?(b.value=!1,n("onSubmit",{key:I.key,payload:w.values})):(b.value=!0,console.error("result",w))},B=async()=>{const I=await U();I!=null&&I.valid&&(I!=null&&I.values)?(b.value=!1,n("onFormSubmit",I.values)):(b.value=!0,console.error("Form validation failed:",I))};return e({reset:()=>{var I;(I=v.value)==null||I.resetForm()}}),(I,w)=>{const H=_p,J=gp,q=E3,oe=Uh,ue=zh,Se=Bh,F=ys;return m(),A("div",null,[y(c(il),{ref_key:"formRef",ref:v,"validation-schema":c(z),onSubmit:B},{default:$(()=>[c(L).length?(m(),A("div",A3,[y(J,{modelValue:c(f),"onUpdate:modelValue":w[0]||(w[0]=D=>us(f)?f.value=D:null),mandatory:""},{default:$(()=>[(m(!0),A(yt,null,qt(c(L),D=>(m(),j(H,{key:D,size:"small",value:D},{default:$(()=>[Qt(me(D),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),y(Se,{value:c(f),"onUpdate:value":w[2]||(w[2]=D=>us(f)?f.value=D:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(ue,{class:"p-0"},{default:$(()=>[(m(!0),A(yt,null,qt(c(L),(D,Y)=>(m(),j(oe,{key:Y,value:D,"as-child":""},{default:$(Te=>[Pt(g("div",et({class:Te.class,ref_for:!0},Te.a11yAttrs,{class:"flex flex-col gap-6"}),[(m(!0),A(yt,null,qt(N(D),He=>(m(),A(yt,{key:He.key},[O(He)&&(He.group===D||!He.group&&Y===0)?Pt((m(),j(q,{key:0,modelValue:c(k),"onUpdate:modelValue":w[1]||(w[1]=ht=>us(k)?k.value=ht:null),"schema-field":He,"config-key":He.key,loading:c(o),onOnAction:S,onOnSubmit:M},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!He.hidden]]):ce("",!0)],64))),128))],16),[[Pr,Te.active]])]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])])):(m(),A("div",M3,[(m(!0),A(yt,null,qt(c(i).schema,D=>(m(),A(yt,{key:D.key},[O(D)?Pt((m(),j(q,{key:0,modelValue:c(k),"onUpdate:modelValue":w[3]||(w[3]=Y=>us(k)?k.value=Y:null),"schema-field":D,"config-key":D.key,loading:c(o),onOnAction:S,onOnSubmit:M},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!D.hidden]]):ce("",!0)],64))),128))])),!c(se)&&c(K)&&c(a)||c(u)?(m(),j(F,{key:2,fluid:"",class:"mt-7 cui-button-medium",severity:c(h),type:"submit",loading:c(o),disabled:c(d),label:c(l)||I.$t("components.form.button.save")},null,8,["severity","loading","disabled","label"])):ce("",!0)]),_:1},8,["validation-schema"])])}}}),$3=At({__name:"PluginSchema",props:{schemaConfig:{},pluginName:{},cameraName:{},buttonKey:{}},setup(s,{expose:e}){const t=new bp,n=new Jn,r=Cn(),{t:i}=js(),o=mi("dialogRef"),a=mi("dialogRefProps"),l=s,{schemaConfig:u,pluginName:d,cameraName:h,buttonKey:v}=Wt(l),f=ae({schema:[],config:{}}),{mutate:b,isPending:k}=t.submitPluginConfigQuery(),{mutateAsync:z,isPending:L}=t.setPluginConfigQuery(),{mutate:se,isPending:K}=n.submitCameraExtensionConfigQuery(),{mutateAsync:N,isPending:E}=n.setCameraExtensionConfigQuery(),O=ne(()=>{var M;return!!((M=a.loading)!=null&&M.value||k.value||L.value||K.value||E.value)});Ge(u,M=>{f.value=M},{deep:!0,immediate:!0});const U=async M=>{h.value?await N({cameraname:h.value,pluginname:d.value,configData:{key:M.key}}):await z({pluginname:d.value,configData:{key:M.key}})},S=async M=>{console.log("onFormSubmit",M);const B={...u.value.config,...M};console.log("onFormSubmit payload",B);const W=I=>{if(I!=null&&I.toast){const w=Km(I.toast.type);r.add({severity:w,summary:i(`components.toast.title_${w}`),detail:I.toast.message,life:3e3})}I!=null&&I.schema&&Object.keys(I.schema).length&&f.value?f.value.schema=I.schema:o.value.close()};h.value?se({cameraname:h.value,pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:W}):b({pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:W})};return e({isLoading:O}),(M,B)=>{const W=xp;return m(),j(W,{"schema-form":c(f),loading:c(O),"show-button":"",onOnAction:U,onOnFormSubmit:S},null,8,["schema-form","loading"])}}}),P3={class:"p-4 flex flex-col gap-2"},T3={class:"cui-label"},R3={key:0,class:"flex flex-col gap-2"},I3={class:"cui-label"},O3={key:6,class:"text-sm text-muted text-center min-h-[30px]"},N3={class:"cui-label"},F3={key:7,class:"w-full flex items-center justify-center my-5"},L3={key:1,class:"text-sm text-muted text-center"},j3={key:1,class:"flex flex-col gap-2"},q3={class:"cui-label"},D3={key:0,class:"w-full flex items-center justify-center"},B3={key:1,class:"text-sm text-muted text-center"},z3={key:1,class:"w-full h-full"},U3={class:"cui-list-item"},V3=At({__name:"Plugins",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Jn,n=new bp,r=Cn(),i=Il(),{t:o}=js(),a=s,{camera:l,loading:u}=Wt(a),d=Vt("schemaRef"),h=ae("hub"),v=ae(["hub","motionDetection","objectDetection","audioDetection","ptz","more"]),f=ae(""),b=ae(),k=ae(),z=ae(),L=ae(),se=ae(),K=ae(),N=ae(!0);t.toggleQueryActivator("getCameraExtensionConfigQuery",!1);const{data:E}=n.getPluginsQuery({page:1,pageSize:-1}),{data:O,isFetching:U,suspense:S}=t.getCameraExtensionsQuery(l.value.name),{data:M,isFetching:B}=t.getCameraExtensionConfigQuery(l.value.name,f,N),{data:W,isFetching:I}=n.getPluginsExtensionsQuery({page:1,pageSize:-1}),{mutate:w,isPending:H}=t.submitCameraExtensionConfigQuery(),{mutateAsync:J,isPending:q}=t.patchCameraExtensionConfigQuery(),{mutateAsync:oe,isPending:ue}=t.setCameraExtensionConfigQuery(),{mutateAsync:Se,isPending:F}=t.addCameraExtensionQuery(),{mutateAsync:D,isPending:Y}=t.removeCameraExtensionQuery(),{mutateAsync:Te,isPending:He}=t.enableCameraExtensionQuery(),{mutateAsync:ht,isPending:Mt}=t.disableCameraExtensionQuery(),Qe=ne(()=>U.value||I.value||F.value||Y.value||He.value||Mt.value),ze=ne(()=>Qe.value||u.value||H.value||q.value||ue.value),ge=ne(()=>{const he=h.value==="cameraController"&&pt.value,ie=h.value==="hub"&&Jt.value.length,de=h.value==="motionDetection"&&wt.value.length,Le=h.value==="audioDetection"&&zt.value.length,rt=h.value==="objectDetection"&&nt.value.length,Kt=h.value==="ptz"&&Yt.value.length;return!ie&&!de&&!Le&&!rt&&!Kt&&!he}),pt=ne(()=>{var ie;const he=((ie=W.value)==null?void 0:ie.result.filter(de=>{var Le;return de.type.includes("cameraController")&&de.pluginName===((Le=l.value.pluginInfo)==null?void 0:Le.name)}))||[];return he.length&&E.value&&E.value.result.some(de=>de.pluginName===he[0].pluginName&&Ue(de.pluginName))?(b.value=he[0].pluginName,f.value=he[0].pluginName):b.value=void 0,he[0]}),Jt=ne(()=>{var ie;const he=((ie=O.value)==null?void 0:ie.filter(de=>de.type.includes("hub")))||[];return he.length&&E.value&&E.value.result.some(de=>de.pluginName===he[0].pluginName&&Ue(de.pluginName))?(k.value=he[0].pluginName,f.value=he[0].pluginName):k.value=void 0,V(he)}),wt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("motionDetection")))||[];return he.length&&Ue(l.value.extensions.motionDetection)?z.value=(de=l.value.extensions.motionDetection)==null?void 0:de.name:z.value=void 0,V(he)}),zt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("audioDetection")))||[];return he.length&&Ue(l.value.extensions.audioDetection)?L.value=(de=l.value.extensions.audioDetection)==null?void 0:de.name:L.value=void 0,V(he)}),nt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("objectDetection")))||[];return he.length&&Ue(l.value.extensions.objectDetection)?se.value=(de=l.value.extensions.objectDetection)==null?void 0:de.name:se.value=void 0,V(he)}),Yt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("ptz")))||[];return he.length&&Ue(l.value.extensions.ptz)?K.value=(de=l.value.extensions.ptz)==null?void 0:de.name:K.value=void 0,V(he)}),Be=ne(()=>{var de,Le;const he=((de=E.value)==null?void 0:de.result)||[];return(((Le=W.value)==null?void 0:Le.result)||[]).filter(rt=>{const Kt=he.find(Zt=>Zt.pluginName===rt.pluginName);return((Kt==null?void 0:Kt["camera.ui"].extensions)??[]).filter(Zt=>Zt!=="cameraController").length>0})});Ge(b,(he,ie)=>{he&&he!==ie&&X()}),Ge(k,(he,ie)=>{he&&he!==ie&&X(he)}),Ge(z,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"motionDetection"):he&&ye(he,!0,"motionDetection"))}),Ge(se,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"objectDetection"):he&&ye(he,!0,"objectDetection"))}),Ge(K,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"ptz"):he&&ye(he,!0,"ptz"))}),Ge(L,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"audioDetection"):he&&ye(he,!0,"audioDetection"))});const Ue=he=>{const ie=typeof he=="string"?he:he==null?void 0:he.name;if(ie&&E.value&&E.value.result.some(de=>de.pluginName===ie&&!de.disabled))return ie},V=he=>he.sort((ie,de)=>!Ue(ie.pluginName)&&Ue(de.pluginName)?1:Ue(ie.pluginName)&&!Ue(de.pluginName)?-1:ie.displayName.localeCompare(de.displayName)),X=he=>{var ie,de;if(t.toggleQueryActivator("getCameraExtensionConfigQuery",!1),he!==void 0)f.value=he;else switch(h.value){case"hub":f.value=Ue((ie=Jt.value[0])==null?void 0:ie.pluginName)||"";break;case"motionDetection":f.value=Ue(l.value.extensions.motionDetection)||"";break;case"audioDetection":f.value=Ue(l.value.extensions.audioDetection)||"";break;case"objectDetection":f.value=Ue(l.value.extensions.objectDetection)||"";break;case"ptz":f.value=Ue(l.value.extensions.ptz)||"";break;case"cameraController":f.value=Ue((de=pt.value)==null?void 0:de.pluginName)||"";break;default:f.value="";break}f.value&&f.value!==""&&t.toggleQueryActivator("getCameraExtensionConfigQuery",!0)},_e=async he=>{var ie;if(O.value)if(O.value.some(de=>de.pluginName===he.pluginName)){for(const de of he.type)await D({cameraname:l.value.name,pluginname:he.pluginName,type:de});(ie=d.value)==null||ie.reset()}else for(const de of he.type)await Se({cameraname:l.value.name,pluginname:he.pluginName,type:de})},ye=async(he,ie,de)=>{var rt;const Le=de in l.value.extensions?l.value.extensions[de]:void 0;l.value&&(ie?(Le==null?void 0:Le.name)!==he&&(await Te({cameraname:l.value.name,pluginname:he,type:de}),Zs(()=>X(he))):(Le==null?void 0:Le.name)===he&&(await ht({cameraname:l.value.name,pluginname:he,type:de}),(rt=d.value)==null||rt.reset(),Zs(()=>X())))},fe=async(he,ie)=>{await oe({cameraname:l.value.name,pluginname:ie,configData:{key:he.key}})},_t=(he,ie)=>{w({cameraname:l.value.name,pluginname:ie,configData:{key:he.key,payload:he.payload}},{onSuccess:de=>{if(de!=null&&de.toast){const Le=Km(de.toast.type);r.add({severity:Le,summary:o(`components.toast.title_${Le}`),detail:de.toast.message,life:3e3})}de!=null&&de.schema&&Object.keys(de.schema).length&&i.openComponentDialog($3,{data:{title:o("components.dialog.title.config"),hideConfirmButton:!0,contentProps:{schemaConfig:{schema:de.schema,config:he.payload},pluginName:ie,cameraName:l.value.name,buttonKey:he.key}}})}})},Tt=async(he,ie)=>{await J({cameraname:l.value.name,pluginname:he,configData:ie})};return el(async()=>{l.value.pluginInfo&&(v.value.unshift("cameraController"),h.value="cameraController"),await S(),X()}),(he,ie)=>{var Ms,ds;const de=_p,Le=gp,rt=Ea,Kt=Lr,ps=fo,Zt=pp,os=rw,As=ys,fs=jr;return m(),A("div",P3,[g("span",T3,me(he.$t("components.camera_options.categories")),1),y(Le,{modelValue:c(h),"onUpdate:modelValue":[ie[0]||(ie[0]=R=>us(h)?h.value=R:null),ie[1]||(ie[1]=R=>X())],disabled:c(Qe),mandatory:""},{default:$(()=>[(m(!0),A(yt,null,qt(c(v),R=>(m(),j(de,{key:R,size:"small",disabled:c(ze),value:R},{default:$(()=>[Qt(me(he.$t(`components.camera_options.chip_${R}`)),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"]),y(rt,{class:"m-0 py-3"}),c(h)!=="more"?(m(),A("div",R3,[g("span",I3,me(he.$t("components.camera_options.chip_plugins")),1),c(h)==="cameraController"&&c(pt)?(m(),j(Le,{key:0,modelValue:c(b),"onUpdate:modelValue":ie[2]||(ie[2]=R=>us(b)?b.value=R:null),disabled:c(Qe),mandatory:"",class:"min-h-[30px]"},{default:$(()=>[(m(),j(de,{key:c(pt).pluginName,size:"small",disabled:!Ue(c(pt).pluginName)||c(ze),value:c(pt).pluginName},{default:$(()=>[Qt(me(c(pt).displayName),1)]),_:1},8,["disabled","value"]))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="hub"&&c(Jt).length?(m(),j(Le,{key:1,modelValue:c(k),"onUpdate:modelValue":ie[3]||(ie[3]=R=>us(k)?k.value=R:null),disabled:c(Qe),mandatory:"",class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(Jt),R=>(m(),j(de,{key:R.pluginName,size:"small",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="motionDetection"&&c(wt).length?(m(),j(Le,{key:2,modelValue:c(z),"onUpdate:modelValue":ie[4]||(ie[4]=R=>us(z)?z.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(wt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="objectDetection"&&c(nt).length?(m(),j(Le,{key:3,modelValue:c(se),"onUpdate:modelValue":ie[5]||(ie[5]=R=>us(se)?se.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(nt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="audioDetection"&&c(zt).length?(m(),j(Le,{key:4,modelValue:c(L),"onUpdate:modelValue":ie[6]||(ie[6]=R=>us(L)?L.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(zt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="ptz"&&c(Yt).length?(m(),j(Le,{key:5,modelValue:c(K),"onUpdate:modelValue":ie[7]||(ie[7]=R=>us(K)?K.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(Yt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):c(ge)?(m(),A("span",O3,me(he.$t("components.camera_options.no_plugins_enabled")),1)):ce("",!0),y(rt,{class:"m-0 py-3"}),g("span",N3,me(he.$t("components.camera_options.plugin_settings")),1),c(B)||!c(f)||!c(M)||!((Ms=c(M))!=null&&Ms.schema)||((ds=c(M))==null?void 0:ds.schema.length)===0?(m(),A("div",F3,[c(B)?(m(),j(Kt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),A("span",L3,me(he.$t("components.camera_options.no_config")),1))])):(m(),j(xp,{ref_key:"schemaRef",ref:d,key:c(f),"schema-form":{schema:c(M).schema,config:c(M).config},loading:c(ze),onOnFormSubmit:ie[8]||(ie[8]=R=>Tt(c(f),R)),onOnSubmit:ie[9]||(ie[9]=R=>_t(R,c(f))),onOnAction:ie[10]||(ie[10]=R=>fe(R,c(f)))},null,8,["schema-form","loading"]))])):c(h)==="more"?(m(),A("div",j3,[g("span",q3,me(he.$t("components.camera_options.manage_plugins")),1),c(I)||!c(Be).length?(m(),A("div",D3,[c(I)?(m(),j(Kt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),A("span",B3,me(he.$t("components.camera_options.no_plugins_found")),1))])):(m(),A("div",z3,[(m(!0),A(yt,null,qt(c(Be),R=>Pt((m(),A("div",{key:R.pluginName,class:"cui-list-item"},[y(Zt,{disabled:c(Qe)||!Ue(R.pluginName),class:"h-14",onClick:te=>he.$router.push(`/plugins/${R.pluginName}`)},{append:$(()=>{var te;return[y(ps,{"model-value":(te=c(O))==null?void 0:te.some(ve=>ve.pluginName===R.pluginName),disabled:c(Qe)||!Ue(R.pluginName),"onUpdate:modelValue":ve=>_e(R)},null,8,["model-value","disabled","onUpdate:modelValue"])]}),default:$(()=>[g("span",null,me(R.displayName),1)]),_:2},1032,["disabled","onClick"])])),[[fs,{value:Ue(R.pluginName)===void 0?he.$t("components.form.tooltip.disabled"):""},void 0,{top:!0}]])),128))])),g("div",U3,[y(Zt,{class:"h-14",onClick:ie[11]||(ie[11]=R=>he.$router.push("/plugins"))},{append:$(()=>[y(As,{text:"",rounded:"",severity:"secondary",class:"cui-icon-md"},{icon:$(()=>[y(os,{width:"100%",height:"100%"})]),_:1})]),default:$(()=>[g("span",null,me(he.$t("components.camera_options.more_plugins")),1)]),_:1})])])):ce("",!0)])}}}),H3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q3(s,e){return m(),A("svg",H3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H5V5h14zm-2-2H7V7h10z"},null,-1)]))}const K3=pe({name:"mdi-checkbox-intermediate",render:Q3}),Z3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G3(s,e){return m(),A("svg",Z3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M3.14 1A2.14 2.14 0 0 0 1 3.14V5h2V3h2V1zM7 1v2h3V1zm5 0v2h2v2h2V3.14C16 1.96 15.04 1 13.86 1zM1 7v3h2V7zm8 0c-1.11 0-2 .89-2 2v7h6.86A2.14 2.14 0 0 0 16 13.86V7zm9 0v2h2v2h2V9c0-1.11-.89-2-2-2zM9 9h5v5H9zm-8 3v1.86C1 15.04 1.96 16 3.14 16H5v-2H3v-2zm19 1v3h2v-3zM7 18v2c0 1.11.89 2 2 2h2v-2H9v-2zm13 0v2h-2v2h2c1.11 0 2-.89 2-2v-2zm-7 2v2h3v-2z"},null,-1)]))}const W3=pe({name:"mdi-vector-intersection",render:G3}),J3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y3(s,e){return m(),A("svg",J3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6zm14 11H6V8h12z"},null,-1)]))}const X3=pe({name:"mdi-rectangle-outline",render:Y3}),e4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t4(s,e){return m(),A("svg",e4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6z"},null,-1)]))}const s4=pe({name:"mdi-rectangle",render:t4}),n4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r4(s,e){return m(),A("svg",n4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m6.03 12.03l2 3.47l-2.53 3.18L2 12.62zM17 18v-2.71c.88-.39 1.5-1.26 1.5-2.29c0-.57-.2-1.1-.53-1.5l1.97-1.15c1.01-.59 1.36-1.88.77-2.89l-1.38-2.4a2.125 2.125 0 0 0-2.89-.78L8.31 9c-.95.53-1.28 1.75-.73 2.71l1.5 2.6c.55.95 1.78 1.28 2.73.73l1.88-1.08c.25.59.72 1.07 1.31 1.33V18c0 1.1.9 2 2 2h5v-2z"},null,-1)]))}const i4=pe({name:"mdi-cctv",render:r4}),o4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function a4(s,e){return m(),A("svg",o4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.84 22.73L18.11 20H17c-1.1 0-2-.9-2-2v-1.11l-2.34-2.34l-.85.49c-.95.55-2.18.22-2.73-.73l-1.5-2.6c-.4-.71-.33-1.53.1-2.14L1.11 3l1.28-1.27l19.72 19.73zM18.5 13c0-.57-.2-1.1-.53-1.5l1.97-1.15c1.01-.59 1.36-1.88.77-2.89l-1.38-2.4a2.125 2.125 0 0 0-2.89-.78l-5.67 3.29l7.09 7.09c.4-.44.64-1.02.64-1.66M2 12.62l3.5 6.06l2.53-3.18l-2-3.47z"},null,-1)]))}const c4=pe({name:"mdi-cctv-off",render:a4}),l4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u4(s,e){return m(),A("svg",l4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m0 2c-1.9 0-3.6.6-4.9 1.7l11.2 11.2c1-1.4 1.7-3.1 1.7-4.9c0-4.4-3.6-8-8-8m4.9 14.3L5.7 7.1C4.6 8.4 4 10.1 4 12c0 4.4 3.6 8 8 8c1.9 0 3.6-.6 4.9-1.7"},null,-1)]))}const d4=pe({name:"mdi-cancel",render:u4}),h4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m4(s,e){return m(),A("svg",h4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"},null,-1)]))}const p4=pe({name:"mdi-undo",render:m4}),f4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g4(s,e){return m(),A("svg",f4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3zm0 5h2v9H9zm4 0h2v9h-2z"},null,-1)]))}const v4=pe({name:"mdi-trash-can",render:g4}),_4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y4(s,e){return m(),A("svg",_4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83l3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75z"},null,-1)]))}const b4=pe({name:"mdi-pencil",render:y4}),w4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x4(s,e){return m(),A("svg",w4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"},null,-1)]))}const S4=pe({name:"mdi-plus",render:x4}),C4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k4(s,e){return m(),A("svg",C4,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M13 4a1 1 0 1 0-2 0v17a1 1 0 1 0 2 0zM7 4h3v5H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m-2 6h5v5H5a2 2 0 0 1-2-2v-1a2 2 0 0 1 2-2m9 0v5h2a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2zm-6 6h2v5H8a2 2 0 0 1-2-2v-1a2 2 0 0 1 2-2m6 0v5h5a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2zm0-12v5h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"})],-1)]))}const E4=pe({name:"mingcute-timeline-fill",render:k4}),A4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function M4(s,e){return m(),A("svg",A4,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M13 4a1 1 0 1 0-2 0v17a1 1 0 1 0 2 0zM7 4h3v2H7v1h3v2H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m11 3h-4v2h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4v2h4zm-8 3H5a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h5v-2H5v-1h5zm4 0v2h2v1h-2v2h2a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2zm-4 6H8a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h2v-2H8v-1h2zm4 0v2h5v1h-5v2h5a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2z"})],-1)]))}const $4=pe({name:"mingcute-timeline-line",render:M4}),P4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T4(s,e){return m(),A("svg",P4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9 11.5A2.5 2.5 0 0 0 11.5 9A2.5 2.5 0 0 0 9 6.5A2.5 2.5 0 0 0 6.5 9A2.5 2.5 0 0 0 9 11.5M9 2c3.86 0 7 3.13 7 7c0 5.25-7 13-7 13S2 14.25 2 9a7 7 0 0 1 7-7m6 15h3v-3h2v3h3v2h-3v3h-2v-3h-3z"},null,-1)]))}const R4=pe({name:"mdi-map-marker-add",render:T4}),I4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O4(s,e){return m(),A("svg",I4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M15 17h3v-3h2v3h3v2h-3v3h-2v-3h-3zM9 6.5c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5S6.5 10.4 6.5 9S7.6 6.5 9 6.5M9 2c3.9 0 7 3.1 7 7c0 5.2-7 13-7 13S2 14.2 2 9c0-3.9 3.1-7 7-7m0 2C6.2 4 4 6.2 4 9c0 1 0 3 5 9.7C14 12 14 10 14 9c0-2.8-2.2-5-5-5"},null,-1)]))}const N4=pe({name:"mdi-map-marker-add-outline",render:O4}),F4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L4(s,e){return m(),A("svg",F4,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M19.26 16.877c.413.402.74.932.74 1.596c0 .753-.426 1.339-.9 1.745c-.48.408-1.114.731-1.81.983c-1.402.505-3.272.799-5.29.799s-3.888-.294-5.29-.8c-.696-.25-1.33-.574-1.809-.982c-.475-.406-.901-.992-.901-1.745c0-.663.327-1.194.74-1.596A9.97 9.97 0 0 0 12 20c2.859 0 5.438-1.2 7.26-3.123M12 2a8 8 0 1 1 0 16a8 8 0 0 1 0-16m0 4a4 4 0 1 0 0 8a4 4 0 0 0 0-8m0 2a2 2 0 1 1 0 4a2 2 0 0 1 0-4"})],-1)]))}const Sp=pe({name:"mingcute-computer-camera-fill",render:L4}),j4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q4(s,e){return m(),A("svg",j4,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M6.593 16.744a1 1 0 0 1-.246 1.393a1.3 1.3 0 0 0-.319.294l-.024.042l.035.058c.03.04.078.095.16.165c.23.196.62.417 1.19.623C8.523 19.728 10.153 20 12 20c1.848 0 3.478-.272 4.61-.68c.57-.207.961-.428 1.19-.624a1 1 0 0 0 .16-.165l.036-.058l-.024-.04a1.2 1.2 0 0 0-.314-.293a1 1 0 1 1 1.151-1.635c.598.421 1.191 1.074 1.191 1.968c0 .753-.426 1.339-.9 1.744c-.48.41-1.114.732-1.81.984c-1.402.505-3.272.799-5.29.799s-3.888-.294-5.29-.8c-.696-.25-1.33-.574-1.809-.983c-.475-.405-.901-.99-.901-1.744c0-.898.598-1.553 1.2-1.975a1 1 0 0 1 1.393.246M12 2a8 8 0 1 1 0 16a8 8 0 0 1 0-16m0 2a6 6 0 1 0 0 12a6 6 0 0 0 0-12m0 2a4 4 0 1 1 0 8a4 4 0 0 1 0-8m0 2a2 2 0 1 0 0 4a2 2 0 0 0 0-4"})],-1)]))}const D4=pe({name:"mingcute-computer-camera-line",render:q4}),B4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z4(s,e){return m(),A("svg",B4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M2 6V4q0-.825.588-1.412T4 2h2q.425 0 .713.288T7 3t-.288.713T6 4H4v2q0 .425-.288.713T3 7t-.712-.288T2 6m2 16q-.825 0-1.412-.587T2 20v-2q0-.425.288-.712T3 17t.713.288T4 18v2h2q.425 0 .713.288T7 21t-.288.713T6 22zm16 0h-2q-.425 0-.712-.288T17 21t.288-.712T18 20h2v-2q0-.425.288-.712T21 17t.713.288T22 18v2q0 .825-.587 1.413T20 22m0-16V4h-2q-.425 0-.712-.288T17 3t.288-.712T18 2h2q.825 0 1.413.588T22 4v2q0 .425-.288.713T21 7t-.712-.288T20 6m-6.5 3.5q-.825 0-1.412-.587T11.5 7.5t.588-1.412T13.5 5.5t1.413.588T15.5 7.5t-.587 1.413T13.5 9.5m-.7 8.5h-4l1-5.1l-1.8.7V16q0 .425-.288.712T7 17t-.712-.288T6 16v-3.05q0-.3.163-.537t.437-.363l3.35-1.45q.875-.375 1.288-.487T12 10q.525 0 .975.275T13.7 11l1 1.6q.525.85 1.363 1.475T18 14.9q.425.075.713.375T19 16t-.288.7t-.687.225q-1.35-.2-2.525-.837t-2-1.588z"},null,-1)]))}const U4=pe({name:"material-symbols-detection-and-zone-rounded",render:z4}),V4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function H4(s,e){return m(),A("svg",V4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32h209.1C339.6 12.9 360.3 0 384 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4v113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.5c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V119.4zM119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4v113.1c9.7 5.6 17.8 13.7 23.4 23.4h209.1c5.6-9.7 13.7-17.8 23.4-23.4V119.4c-9.7-5.6-17.8-13.7-23.4-23.4zm192 384c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V352h64v40.6c9.7 5.6 17.8 13.7 23.4 23.4h209.1c5.6-9.7 13.7-17.8 23.4-23.4V279.5c-9.7-5.6-17.8-13.7-23.4-23.4h-46c-5.4-15.4-14.6-28.9-26.5-39.6v-24.4h72.6c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4v113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H311.5z"},null,-1)]))}const Q4=pe({name:"fa6-solid-object-ungroup",render:H4}),K4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function Z4(s,e){return m(),A("svg",K4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M48.2 66.8c-.1-.8-.2-1.7-.2-2.5v-.2c0-8.8 7.2-16 16-16c.9 0 1.9.1 2.8.2C74.3 49.5 80 56.1 80 64c0 8.8-7.2 16-16 16c-7.9 0-14.5-5.7-15.8-13.2M0 64c0 26.9 16.5 49.9 40 59.3v105.3C16.5 238.1 0 261.1 0 288c0 35.3 28.7 64 64 64c26.9 0 49.9-16.5 59.3-40h201.3c9.5 23.5 32.5 40 59.3 40c35.3 0 64-28.7 64-64c0-26.9-16.5-49.9-40-59.3V123.4c23.5-9.5 40-32.5 40-59.3c0-35.3-28.7-64-64-64c-26.9 0-49.9 16.5-59.3 40L123.3 40C113.9 16.5 90.9 0 64 0C28.7 0 0 28.7 0 64m368 0a16 16 0 1 1 32 0a16 16 0 1 1-32 0m-43.3 24c6.5 16 19.3 28.9 35.3 35.3v105.3c-16 6.5-28.9 19.3-35.3 35.3H123.4c-6.5-16-19.3-28.9-35.3-35.3V123.3c16-6.5 28.9-19.3 35.3-35.3zM384 272a16 16 0 1 1 0 32a16 16 0 1 1 0-32M80 288c0 7.9-5.7 14.5-13.2 15.8c-.8.1-1.7.2-2.5.2h-.2c-8.8 0-16-7.2-16-16c0-.9.1-1.9.2-2.8c1.2-7.5 7.8-13.2 15.7-13.2c8.8 0 16 7.2 16 16m391.3-40h45.4c6.5 16 19.3 28.9 35.3 35.3v105.3c-16 6.5-28.9 19.3-35.3 35.3H315.4c-6.5-16-19.3-28.9-35.3-35.3v-36.7h-48v36.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64c26.9 0 49.9-16.5 59.3-40h201.3c9.5 23.5 32.5 40 59.3 40c35.3 0 64-28.7 64-64c0-26.9-16.5-49.9-40-59.3V283.3c23.5-9.5 40-32.5 40-59.3c0-35.3-28.7-64-64-64c-26.9 0-49.9 16.5-59.3 40H448v16.4c9.8 8.8 17.8 19.5 23.3 31.6m88.9-26.7a16 16 0 1 1 31.5 5.5a16 16 0 1 1-31.5-5.5M271.8 450.7a16 16 0 1 1-31.5-5.5a16 16 0 1 1 31.5 5.5m307-18.5a16 16 0 1 1-5.5 31.5a16 16 0 1 1 5.5-31.5"},null,-1)]))}const G4=pe({name:"fa6-regular-object-ungroup",render:Z4}),W4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J4(s,e){return m(),A("svg",W4,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-width":"1.5"},[g("path",{d:"M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z"}),g("circle",{cx:"12",cy:"12",r:"4"})],-1)]))}const Y4=pe({name:"solar-camera-square-linear",render:J4}),X4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e6(s,e){return m(),A("svg",X4,e[0]||(e[0]=[g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M15.75 6a3.75 3.75 0 1 0-7.5 0a3.75 3.75 0 0 0 7.5 0M12 3.75a2.25 2.25 0 1 1 0 4.5a2.25 2.25 0 0 1 0-4.5M9.25 18a3.75 3.75 0 1 0-7.5 0a3.75 3.75 0 0 0 7.5 0M5.5 15.75a2.25 2.25 0 1 1 0 4.5a2.25 2.25 0 0 1 0-4.5m13-1.5a3.75 3.75 0 1 1 0 7.5a3.75 3.75 0 0 1 0-7.5M20.75 18a2.25 2.25 0 1 0-4.5 0a2.25 2.25 0 0 0 4.5 0","clip-rule":"evenodd"},null,-1),g("path",{fill:"currentColor",d:"M7.205 7.562a.75.75 0 0 0-.993-1.124A8.73 8.73 0 0 0 3.25 13a.75.75 0 0 0 1.5 0a7.23 7.23 0 0 1 2.455-5.438m10.583-1.124a.75.75 0 0 0-.993 1.124A7.23 7.23 0 0 1 19.25 13a.75.75 0 0 0 1.5 0a8.73 8.73 0 0 0-2.962-6.562m-7.601 13.584a.75.75 0 1 0-.374 1.452a8.8 8.8 0 0 0 4.374 0a.75.75 0 1 0-.374-1.452A7.3 7.3 0 0 1 12 20.25a7.3 7.3 0 0 1-1.813-.228"},null,-1)]))}const t6=pe({name:"solar-share-circle-outline",render:e6}),Fl=At({__name:"CuiSnapshot",props:{cameraName:{},src:{},loading:{type:Boolean},showLoadingScreen:{type:Boolean,default:!0},width:{default:"100%"},height:{default:"100%"},imageWidth:{},imageHeight:{},imageContainerClass:{},imageContainerStyle:{}},setup(s,{expose:e}){const t=new Jn,n=s,{cameraName:r,loading:i,src:o,width:a,height:l,imageHeight:u,imageWidth:d,imageContainerClass:h,imageContainerStyle:v,showLoadingScreen:f}=Wt(n),b=ae(!1);o.value&&t.toggleQueryActivator("getCameraSnapshotQuery",!1);const{data:k,isFetching:z,refetch:L,isRefetching:se}=t.getCameraSnapshotQuery(r,b),K=ne(()=>(i.value||z.value||se.value)&&f.value),N=ne(()=>{if(o.value)return o.value;if(k.value)return`data:image/jpeg;base64,${k.value}`});return e({download:()=>{if(N.value){const U=`${r.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,S=document.createElement("a");S.setAttribute("download",U),S.href=N.value,document.body.appendChild(S),S.click(),S.remove()}},refresh:()=>{b.value=!0,L(),b.value=!1},isLoading:K,snapshotSrc:N}),(U,S)=>{const M=Lr,B=Fa;return m(),A("div",{class:"w-full h-full flex items-center justify-center bg-black aspect-video",style:ot({width:`${c(a)}`,height:`${c(l)}`})},[c(K)?(m(),j(M,{key:0,class:"m-0 max-w-[30px] max-h-[30px]","stroke-width":"5",style:ot({width:`calc(${c(a)} / 2)`,height:`calc(${c(l)} / 2)`})},null,8,["style"])):(m(),j(B,{key:1,src:c(N),"aspect-ratio":"16/9",cover:"",width:c(d),height:c(u),"image-container-class":c(h),"image-container-style":c(v)},null,8,["src","width","height","image-container-class","image-container-style"]))],4)}}}),s6=["d"],n6=At({__name:"CuiPolygon",props:{cameraZones:{}},setup(s){const e=s,{cameraZones:t}=Wt(e),n=Vt("zoneRef"),r=ri(n),i=o=>{if(!o)return"";const a=o.map(u=>{const d=Math.round(u[0]/100*r.width.value),h=Math.round(u[1]/100*r.height.value);return`${d},${h}`});if(a.length===0)return"";let l=`M ${a[0]}`;for(let u=1;u<a.length;u++)l+=` L ${a[u]}`;return l+=" Z",l};return(o,a)=>(m(),A("svg",{ref_key:"zoneRef",ref:n,width:"100%",height:"100%",class:"zones-container polygon-container"},[(m(!0),A(yt,null,qt(c(t),(l,u)=>(m(),A("path",{key:u,d:i(l.points.map(d=>d)),class:at({dash:l.type==="intersect"&&!l.isPrivacyMask}),style:ot({fill:l.isPrivacyMask?"rgba(16, 16, 16, 0.9)":l.filter==="exclude"?"transparent":`${l.color}4D`,stroke:l.isPrivacyMask?"#333333":l.color,"stroke-width":"2"})},null,14,s6))),128))],512))}}),r6=qs(n6,[["__scopeId","data-v-bcfe05d5"]]),i6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function o6(s,e){return m(),A("svg",i6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M3 14s-1 0-1-1s1-4 6-4s6 3 6 4s-1 1-1 1zm5-6a3 3 0 1 0 0-6a3 3 0 0 0 0 6"},null,-1)]))}const a6=pe({name:"bi-person-fill",render:o6}),c6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l6(s,e){return m(),A("svg",c6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.25 5.25c0-1.422 1.028-2.75 2.5-2.75s2.5 1.328 2.5 2.75S10.222 8 8.75 8s-2.5-1.328-2.5-2.75M1 8.75C1 7.328 2.028 6 3.5 6S6 7.328 6 8.75S4.972 11.5 3.5 11.5S1 10.172 1 8.75M12 10a7 7 0 0 0-7 7c0 1.36.72 2.388 1.7 3.044c.963.645 2.198.956 3.378.956h3.844c1.18 0 2.415-.311 3.377-.956C18.28 19.388 19 18.361 19 17a7 7 0 0 0-7-7m.75-4.75c0-1.422 1.028-2.75 2.5-2.75s2.5 1.328 2.5 2.75S16.722 8 15.25 8s-2.5-1.328-2.5-2.75M18 8.75C18 7.328 19.028 6 20.5 6S23 7.328 23 8.75s-1.028 2.75-2.5 2.75S18 10.172 18 8.75"},null,-1)]))}const u6=pe({name:"fluent-animal-paw-print-24-filled",render:l6}),d6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function h6(s,e){return m(),A("svg",d6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m3.044 6l-.01.074A1.5 1.5 0 0 0 2 7.5v3A1.5 1.5 0 0 0 3.5 12h9a1.5 1.5 0 0 0 1.5-1.5v-3a1.5 1.5 0 0 0-1.04-1.428L12.951 6h.549a.5.5 0 0 0 0-1h-.677l-.16-1.253A2 2 0 0 0 10.68 2H5.319a2 2 0 0 0-1.984 1.744L3.173 5H2.5a.5.5 0 0 0 0 1zm2.275-3h5.36a1 1 0 0 1 .992.873L11.943 6h-7.89l.274-2.128A1 1 0 0 1 5.319 3M5.25 9.749a.749.749 0 1 1 0-1.498a.749.749 0 0 1 0 1.498m5.498 0a.749.749 0 1 1 0-1.498a.749.749 0 0 1 0 1.498M12.497 13h-1.5v.25a.75.75 0 0 0 1.5 0zM5 13H3.5v.25a.75.75 0 0 0 1.5 0z"},null,-1)]))}const m6=pe({name:"fluent-vehicle-car-16-filled",render:h6}),p6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f6(s,e){return m(),A("svg",p6,e[0]||(e[0]=[g("g",{fill:"currentColor"},[g("path",{d:"M15.25 6.5a2.25 2.25 0 1 0 0-4.5a2.25 2.25 0 0 0 0 4.5m-2.867-.001c-1.495-.21-4.912.397-6.32 4.15a1 1 0 1 0 1.873.702c.584-1.555 1.636-2.316 2.574-2.655l-1.17 3.006q-.029.075-.045.15a1 1 0 0 0 .164.91l3.562 4.607l.231 3.693a1 1 0 1 0 1.996-.124l-.27-4.307l-2.092-2.707l1.373-2.661l.093.134a2 2 0 0 0 2.42.711l2.115-.886a1 1 0 0 0-.773-1.844l-2.115.886l-1.606-2.335a3.04 3.04 0 0 0-1.661-1.36a1.4 1.4 0 0 0-.35-.07"}),g("path",{d:"m8.45 16.45l.827-2.452l1.469 1.9l-.402 1.191a2 2 0 0 1-2.032 1.356l-2.88-.197a1 1 0 1 1 .136-1.996z"})],-1)]))}const g6=pe({name:"healthicons-running-24px",render:f6}),v6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _6(s,e){return m(),A("svg",v6,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[g("path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3zM7 16.5l-4.74-2.85M7 16.5l5-3m-5 3v5.17m5-8.17V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5zm5 3l-5-3m5 3l4.74-2.85M17 16.5v5.17"}),g("path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3l5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0zM12 8L7.26 5.15M12 8l4.74-2.85M12 13.5V8"})],-1)]))}const y6=pe({name:"lucide-boxes",render:_6}),b6={class:"w-full h-full"},w6={key:1,class:"label-text"},x6=At({__name:"CuiBBoxPlayground",props:{showIcon:{type:Boolean,default:!0},showLabel:{type:Boolean,default:!1},showConfidence:{type:Boolean,default:!0},detections:{default(){return[]}},classes:{default(){return["animal","person","vehicle","motion","other"]}}},setup(s,{expose:e}){const t=s,{detections:n,classes:r,showConfidence:i,showIcon:o,showLabel:a}=Wt(t),l=Vt("containerRef"),u=Ls([]),{width:d,height:h}=rl(l),v={motion:{color:"#A855F7",icon:g6},animal:{color:"#22C55E",icon:u6},person:{color:"#3B82F6",icon:a6},vehicle:{color:"#EF4444",icon:m6},other:{color:"#CAC443",icon:y6}},f=ne(()=>Math.min(d.value||800,h.value||600)),b=ne(()=>f.value<200?.8:1),k=ne(()=>S=>{if(!u.value.length||!d.value)return 0;const{inputWidth:M}=u.value[0];return Math.round(S*d.value/M)}),z=ne(()=>S=>{if(!u.value.length||!h.value)return 0;const{inputHeight:M}=u.value[0];return Math.round(S*h.value/M)}),L=ne(()=>(S,M)=>k.value(M)-k.value(S)),se=ne(()=>(S,M)=>z.value(M)-z.value(S)),K=ne(()=>S=>{const M=L.value(S.boundingBox[0],S.boundingBox[2]),B=se.value(S.boundingBox[1],S.boundingBox[3]),W=M<200?.3:M<400?.25:.2;return Math.min(M,B)*W}),N=ne(()=>S=>{const M=z.value(S.boundingBox[1]),B=30*b.value;return M<B}),E=ne(()=>S=>k.value(S.boundingBox[0])>d.value*.7),O=S=>{u.value=S.filter(M=>r.value.includes(M.label))},U=()=>{u.value=[]};return Ge(n,S=>{S.length&&O(S)},{immediate:!0}),e({draw:O,clear:U}),(S,M)=>(m(),A("div",{ref_key:"containerRef",ref:l,class:"bbox-container"},[(m(!0),A(yt,null,qt(c(u),B=>{var W,I;return m(),A("div",{key:B.id,class:"bbox-corners",style:ot({left:`${c(k)(B.boundingBox[0])}px`,top:`${c(z)(B.boundingBox[1])}px`,width:`${c(L)(B.boundingBox[0],B.boundingBox[2])}px`,height:`${c(se)(B.boundingBox[1],B.boundingBox[3])}px`})},[g("div",b6,[(m(),A(yt,null,qt(["tl","tr","bl","br"],w=>{var H;return g("div",{key:w,class:at(["corner-lines",w]),style:ot({"--corner-color":((H=v[B.label])==null?void 0:H.color)||v.other.color,"--corner-size":`${c(K)(B)}px`})},M[0]||(M[0]=[g("div",{class:"line horizontal"},null,-1),g("div",{class:"line vertical"},null,-1)]),6)}),64))]),c(a)||c(i)||c(o)?(m(),A("div",{key:0,class:at(["label z-1",{"label-bottom":c(N)(B),"label-right":c(E)(B)}]),style:ot({backgroundColor:((W=v[B.label])==null?void 0:W.color)||v.other.color,fontSize:`${12*c(b)}px`,padding:`${4*c(b)}px ${8*c(b)}px`,gap:`${4*c(b)}px`})},[c(o)?(m(),j(Ai(((I=v[B.label])==null?void 0:I.icon)||v.other.icon),{key:0})):ce("",!0),c(a)&&c(f)>250?(m(),A("span",w6,me(B.label),1)):ce("",!0),c(i)&&c(f)>250?(m(),A("span",{key:2,class:"confidence",style:ot({fontSize:`${11*c(b)}px`})},me((B.confidence*100).toFixed(1))+"% ",5)):ce("",!0)],6)):ce("",!0)],4)}),128))],512))}}),S6=qs(x6,[["__scopeId","data-v-870e7d93"]]),C6={class:"snapshot-hover-container flex items-center justify-center aspect-video"},k6={class:"shortcut-menu"},E6=At({__name:"CuiCameraShortcuts",props:{cameraName:{},addingShortcuts:{type:Boolean}},setup(s){var Ue;const e=new Jn,t=new R_,n=Fs(),r=qr(),i=s,{cameraName:o,addingShortcuts:a}=Wt(i),{user:l}=Vs(n),u=Vt("placeholderRef"),d=Vt("shortcutContainerRef"),h=Vt("camerasMenuRef"),v=Ls({}),f=Ls({}),b=Ls({}),k=ae({}),z=ae(!1),L=ae(),se=ae(!1),K=ae(!1),N=ae([]),E=ae({}),O=ae(!1),U=rl(d);e.toggleQueryActivator("getCamerasQuery",!1);const{data:S,isFetching:M}=e.getCameraQuery(o),{data:B,isFetching:W}=e.getCamerasQuery({page:1,pageSize:-1}),{data:I,isFetching:w}=t.getShortcutsQuery(((Ue=l.value)==null?void 0:Ue.username)||"",o),{mutate:H,isPending:J}=t.patchShortcutQuery(),{mutate:q,isPending:oe}=t.createShortcutQuery(),{mutate:ue,isPending:Se}=t.removeShortcutQuery(),F=ne(()=>M.value||w.value||J.value||W.value||oe.value||Se.value),D=ne(()=>{var V;return(V=B.value)!=null&&V.result?B.value.result.filter(X=>X.name!==o.value):[]}),Y=ne(()=>{var V;return((V=l.value)==null?void 0:V.username)??""});Ge([I,S],()=>{I.value&&S.value&&(N.value=xi(I.value))},{immediate:!0,deep:!0}),Ge([U.width,U.height],()=>{K.value=!0,Zs(()=>{ge()})}),Ge(N,()=>{Zs(()=>{pt()})},{deep:!0,immediate:!0}),Ge(K,V=>{V&&(L.value=void 0)});const Te=V=>{se.value||(L.value=void 0),O.value=V,e.toggleQueryActivator("getCamerasQuery",V)};Ge([u,L],([V,X])=>{V&&X&&setTimeout(()=>{var _e;(_e=h.value)==null||_e.show({currentTarget:V})},50)},{deep:!0}),Ge(E,()=>{Object.entries(E.value).forEach(([V,X])=>{var _e,ye;if(X&&f.value[V]){const fe=v.value[V];fe&&((_e=f.value[V])==null||_e.show({currentTarget:fe}))}else(ye=f.value[V])==null||ye.hide()})},{deep:!0});const He=(V,X)=>{z.value||(e.toggleQueryActivator("getCamerasQuery",X),E.value[V]=z.value?!1:X,Object.entries(E.value).forEach(([_e,ye])=>{_e!==V&&ye&&(E.value[_e]=!1)}))},ht=V=>{z.value||zt(V)},Mt=(V,X)=>{V||(E.value[X._id]?(He(X._id,!1),Be(X.cameraId)):He(X._id,!0))},Qe=()=>{Object.entries(b.value).forEach(([V,X])=>{const _e=d.value;if(!_e)return;const ye=_e.getBoundingClientRect(),fe=X.element.getBoundingClientRect(),_t=(fe.left-ye.left)/ye.width*100,Tt=(fe.top-ye.top)/ye.height*100;k.value[V]={x:Math.max(0,Math.min(_t,100)),y:Math.max(0,Math.min(Tt,100))}})},ze=()=>{Object.entries(b.value).forEach(([V,X])=>{const _e=k.value[V];if(!_e)return;const ye=d.value;if(!ye)return;const fe=ye.getBoundingClientRect(),_t=X.element.getBoundingClientRect(),Tt=fe.width-_t.width,he=fe.height-_t.height,ie=Math.max(0,Math.min(_e.x/100*fe.width,Tt)),de=Math.max(0,Math.min(_e.y/100*fe.height,he));X.setPosition(ie,de)}),K.value=!1},ge=()=>{Object.entries(k.value).forEach(([V,X])=>{k.value[V]={x:Math.max(0,Math.min(X.x,100)),y:Math.max(0,Math.min(X.y,100))}}),ze()},pt=()=>{for(const[V,X]of Object.entries(b.value))N.value.find(_e=>_e._id===V)||(X.destroy(),delete b.value[V],delete k.value[V]);for(const[V]of Object.entries(k.value))N.value.find(X=>X._id===V)||delete k.value[V];for(const[V,X]of Object.entries(v.value)){const _e=N.value.find(ye=>ye._id===V);if(X&&_e&&d.value){b.value[_e._id]&&b.value[_e._id].destroy();const ye=new Jh(X,{containment:d.value});b.value[_e._id]=ye;const[fe,_t]=_e.points,Tt=d.value.getBoundingClientRect(),he=fe/100*Tt.width,ie=_t/100*Tt.height;ye.setPosition(he,ie),k.value[_e._id]={x:fe,y:_t},ye.on("dragMove",()=>{z.value=!0;const de=f.value[V];de==null||de.alignOverlay()}),ye.on("dragEnd",()=>{setTimeout(()=>{z.value=!1},50),Qe();const de=k.value[_e._id];H({username:Y.value,cameraname:o.value,shortcutid:_e._id,shortcutData:{points:[de.x,de.y]}})})}}ze()},Jt=V=>{if(!a.value||!d.value)return;se.value=!0;const X=d.value.getBoundingClientRect(),_e=35,ye=35;L.value={x:Math.max(0,Math.min(V.clientX-X.left-_e/2,X.width-_e)),y:Math.max(0,Math.min(V.clientY-X.top-ye/2,X.height-ye))}},wt=async V=>{if(!u.value||!d.value)return;const X=d.value,_e=u.value,ye=X.getBoundingClientRect(),fe=_e.getBoundingClientRect(),_t=fe.left-ye.left,Tt=fe.top-ye.top,he=_t/ye.width*100,ie=Tt/ye.height*100;q({username:Y.value,cameraname:o.value,shortcutData:{_id:"",points:[he,ie],cameraId:V._id}},{onSettled:()=>{var de;se.value=!1,L.value=void 0,(de=h.value)==null||de.hide()}})},zt=V=>{const X=b.value[V._id];X==null||X.destroy(),ue({username:Y.value,cameraname:o.value,shortcutid:V._id})},nt=(V,X)=>{v.value[X]=V},Yt=(V,X)=>{f.value[X]=V},Be=async V=>{if(z.value)return;const X=new AbortController,ye=(await yp({cameraname:V,signal:X.signal})).name;ye&&r.push(`/cameras/${ye}`)};return Q0(()=>{v.value={}}),Sn(()=>{Zs(()=>{pt()})}),vo(()=>{Object.values(b.value).forEach(V=>V.destroy())}),(V,X)=>{const _e=Sp,ye=ys,fe=Lr,_t=Ap,Tt=Qc,he=Fl;return m(),A("div",{ref_key:"shortcutContainerRef",ref:d,class:at(["shortcut-container",{"!pointer-events-auto":c(a)}]),style:ot({cursor:c(a)?"pointer":"default"}),onClick:lr(Jt,["self"])},[(m(!0),A(yt,null,qt(c(N),ie=>Pt((m(),A("div",{ref_for:!0,ref:de=>nt(de,ie._id),key:ie._id,class:"draggable absolute pointer-events-auto",style:ot({background:c(E)[ie._id]?"#545454":void 0})},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(_e,{width:"100%",height:"100%"})]),_:1}),y(Tt,{ref_for:!0,ref:de=>Yt(de,ie._id),class:"shadow-lg cui-rounded-corner overflow-hidden",pt:{content:{class:"p-0"}}},{default:$(()=>{var de;return[g("div",C6,[(de=c(B))!=null&&de.result.find(Le=>Le._id===ie.cameraId)?(m(),j(_t,{key:1,"source-role":"low-resolution","camera-info":c(B).result.find(Le=>Le._id===ie.cameraId),toolbar:!1,control:!1,subcontrol:!1,"live-indicator-overlay":""},null,8,["camera-info"])):(m(),j(fe,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])]}),_:2},1536)],4)),[[c(Kh),[de=>He(ie._id,de),{delayEnter:0,delayLeave:1e3}]],[c(sf),[()=>ht(ie),{distanceThreshold:24,delay:500,onMouseUp:(de,Le,rt)=>Mt(rt,ie)}]]])),128)),c(L)?(m(),A("div",{key:0,ref_key:"placeholderRef",ref:u,class:"draggable absolute pointer-events-auto",style:ot(`left: ${c(L).x}px; top: ${c(L).y}px;`)},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(_e,{width:"100%",height:"100%"})]),_:1})],4)):ce("",!0),c(a)&&!c(z)&&!c(K)?(m(),j(Tt,{key:1,ref_key:"camerasMenuRef",ref:h,class:"shadow-lg cui-rounded-corner","auto-z-index":!0,"append-to":"body",onShow:X[0]||(X[0]=ie=>O.value=!0),onHide:X[1]||(X[1]=ie=>Te(!1))},{default:$(()=>[g("div",k6,[(m(!0),A(yt,null,qt(c(D),ie=>(m(),j(he,{key:ie._id,class:"shortcut-menu-item","camera-name":ie.name,width:"100%",loading:c(F),onClick:lr(de=>wt(ie),["prevent"])},null,8,["camera-name","loading","onClick"]))),128))])]),_:1},512)):ce("",!0)],6)}}}),A6=qs(E6,[["__scopeId","data-v-98006b6f"]]),M6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $6(s,e){return m(),A("svg",M6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)]))}const P6=pe({name:"ion-chevron-forward-outline",render:$6}),T6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function R6(s,e){return m(),A("svg",T6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M328 112L184 256l144 144"},null,-1)]))}const I6=pe({name:"ion-chevron-back-outline",render:R6}),O6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function N6(s,e){return m(),A("svg",O6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m112 184l144 144l144-144"},null,-1)]))}const F6=pe({name:"ion-chevron-down-outline",render:N6}),L6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function j6(s,e){return m(),A("svg",L6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m112 328l144-144l144 144"},null,-1)]))}const q6=pe({name:"ion-chevron-up-outline",render:j6}),D6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B6(s,e){return m(),A("svg",D6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M18 12.998H6a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2"},null,-1)]))}const z6=pe({name:"ic-round-minus",render:B6}),U6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V6(s,e){return m(),A("svg",U6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M18 12.998h-5v5a1 1 0 0 1-2 0v-5H6a1 1 0 0 1 0-2h5v-5a1 1 0 0 1 2 0v5h5a1 1 0 0 1 0 2"},null,-1)]))}const H6=pe({name:"ic-round-plus",render:V6});function Ll(s){const e=ae(),t=ae(!1),n=ae(!1),r=ae(),i=ae(),o=ae(),a=ae(),l=ae(),u=ae(),d=ae(),h=ae([]),v=ne(()=>t.value),f=ne(()=>n.value),b=ne(()=>h.value.includes(Gt.Light)),k=ne(()=>h.value.includes(Gt.Siren)),z=ne(()=>h.value.includes(Gt.Doorbell)),L=ne(()=>h.value.includes(Gt.Battery)),se=ne(()=>h.value.includes(Gt.AudioSensor)),K=ne(()=>h.value.includes(Gt.MotionSensor)||h.value.includes(Gt.MotionDetector)),N=ne(()=>h.value.includes(Gt.ObjectSensor)||h.value.includes(Gt.ObjectDetector)),E=ne(()=>h.value.includes(Gt.PTZ));return Ge(s,O=>{if(!O)return;e.value=O.cameraSubject.value,t.value=O.connected,n.value=O.frameWorkerConnected,h.value=O.getCapabilities(),r.value=O.getValue("light"),i.value=O.getValue("motion"),o.value=O.getValue("audio"),a.value=O.getValue("object"),l.value=O.getValue("doorbell"),u.value=O.getValue("siren"),d.value=O.getValue("battery");const U=fn(O.cameraSubject);Ge(U,ue=>{ue&&(e.value=ue)});const S=fn(O.onConnected);Ge(S,ue=>{t.value=!!ue});const M=fn(O.onFrameWorkerConnected);Ge(M,ue=>{n.value=!!ue});const B=fn(O.capabilities);Ge(B,ue=>{ue&&(h.value=ue.map(Se=>Se.capabilities).flat())});const W=fn(O.onLightSwitched);Ge(W,ue=>{r.value=ue});const I=fn(O.onMotionDetected);Ge(I,ue=>{i.value=ue});const w=fn(O.onAudioDetected);Ge(w,ue=>{o.value=ue});const H=fn(O.onObjectDetected);Ge(H,ue=>{a.value=ue});const J=fn(O.onDoorbellPressed);Ge(J,ue=>{l.value=ue});const q=fn(O.onSirenDetected);Ge(q,ue=>{u.value=ue});const oe=fn(O.onBatteryChanged);Ge(oe,ue=>{d.value=ue})},{immediate:!0}),{cameraObject:e,connected:v,frameWorkerConnected:f,hasLight:b,hasSiren:k,hasDoorbell:z,hasBattery:L,hasAudioDetector:se,hasMotionDetector:K,hasObjectDetector:N,hasPtz:E,capabilities:h,lightState:r,motionState:i,audioState:o,objectState:a,doorbellState:l,sirenState:u,batteryState:d}}const Q6={class:"relative w-full h-full"},K6={class:"absolute top-1 text-muted"},Z6={class:"absolute bottom-1 text-muted"},G6={class:"absolute left-1 text-muted"},W6={class:"absolute right-1 text-muted"},Th=100,kr=2e3,as=.05,Rh=.05,J6=.03,Y6=At({__name:"CuiCameraPTZ",props:{cameraDevice:{},size:{default:"small"}},emits:["panTiltChange","zoomChange"],setup(s,{expose:e,emit:t}){const n=t,r=s,{cameraDevice:i,size:o}=Wt(r),{capabilities:a}=Ll(i),l=Vt("panTiltRef"),u=Vt("zoomRef"),d=Tr({x:0,y:0}),h=Tr({x:0,y:0}),v=Tr({x:0,y:0}),f=ae(!1),b=ae(!1),k=ae(0),z=ae(0),L=ae(0),se=ae(!1),K=ae(0),N=ae(0),E=ae(0),O=ae(0),U=ae(0),S=ae(0),M=ae(0),B=ae("none"),W=ae(0),I=ae(0),w=ae(0),H=ae(null),J=ae(Date.now()),q=ne(()=>f.value||b.value),oe=ne(()=>o.value==="small"?45:60),ue=ne(()=>o.value==="small"?10:15),Se=ne(()=>se.value),F=Be=>Math.round(Be*100)/100,D=Be=>F(Math.max(0,Math.min(1,Be))),Y=async Be=>{const Ue=Date.now();if(!(se.value&&Ue-K.value<Th)){"pan"in Be&&Be.pan!==void 0&&(Be.pan=F(Be.pan)),"tilt"in Be&&Be.tilt!==void 0&&(Be.tilt=F(Be.tilt)),"zoom"in Be&&Be.zoom!==void 0&&(Be.zoom=D(Be.zoom)),se.value=!0,K.value=Ue;try{await i.value.interfaces.ptzCommand(Be)}catch(V){console.error("PTZ command failed:",V)}finally{se.value=!1}}},Te=()=>{const Be=Date.now(),Ue=(Be-J.value)/1e3;J.value=Be;let V=!1;if(f.value&&(Math.abs(U.value)>=as||Math.abs(S.value)>=as)){const X=U.value*Rh*Ue*5,_e=S.value*Rh*Ue*5;W.value=Math.max(-1,Math.min(1,W.value+X)),I.value=Math.max(-1,Math.min(1,I.value+_e));const ye=F(W.value),fe=F(I.value);(h.x!==ye||h.y!==fe)&&(h.x=ye,h.y=fe,n("panTiltChange",{x:h.x,y:h.y}),V=!0)}if(b.value&&Math.abs(M.value)>=as){const X=M.value*J6*Ue*10;w.value=Math.max(0,Math.min(1,w.value+X));const _e=F(w.value);z.value!==_e&&(z.value=_e,n("zoomChange",_e),V=!0)}if(V&&q.value&&Date.now()-K.value>=Th*2){if(f.value&&(Math.abs(U.value)>=as||Math.abs(S.value)>=as)){const _e=F(U.value),ye=F(S.value);B.value==="pan"?Y({type:"continuous",pan:_e,tilt:0,timeout:kr}):B.value==="tilt"?Y({type:"continuous",pan:0,tilt:ye,timeout:kr}):Y({type:"continuous",pan:_e,tilt:ye,timeout:kr})}else if(b.value&&Math.abs(M.value)>=as){const _e=D(Math.abs(M.value)),ye=M.value>0;Y({type:"continuous",zoom:ye?_e:-_e,timeout:kr})}}q.value&&(H.value=requestAnimationFrame(Te))},He=()=>{H.value!==null&&cancelAnimationFrame(H.value),J.value=Date.now(),H.value=requestAnimationFrame(Te)},ht=()=>{H.value!==null&&(cancelAnimationFrame(H.value),H.value=null)},Mt=async()=>{await new Promise(Be=>setTimeout(Be,50)),!q.value&&(Math.abs(N.value)>=as||Math.abs(E.value)>=as||Math.abs(O.value)>=as)&&(U.value=0,S.value=0,M.value=0,B.value="none",N.value=0,E.value=0,O.value=0,await Y({type:"stop"}),ht())},Qe=Be=>{b.value=!0,J.value=Date.now(),w.value=z.value,He(),Be instanceof MouseEvent?ze(Be.clientY):ze(Be.touches[0].clientY)},ze=async Be=>{if(!u.value||!b.value)return;const Ue=u.value.getBoundingClientRect(),V=Ue.top+Ue.height/2,X=oe.value;let _e=Be-V;_e=Math.max(-X,Math.min(X,_e)),k.value=_e;const ye=-_e/X;M.value=ye;const fe=F(ye);if(Math.abs(fe)>=as&&Math.abs(fe-O.value)>=as){O.value=fe;const _t=fe>0,Tt=D(Math.abs(fe));await Y({type:"continuous",zoom:_t?Tt:-Tt,timeout:kr})}else b.value&&Math.abs(fe)<as&&Math.abs(O.value)>=as&&(M.value=0,O.value=0,await Y({type:"stop"}))},ge=Be=>{f.value=!0,J.value=Date.now(),He(),Be instanceof MouseEvent?pt(Be.clientX,Be.clientY):pt(Be.touches[0].clientX,Be.touches[0].clientY)},pt=async(Be,Ue)=>{if(!l.value||!f.value)return;const V=l.value.getBoundingClientRect(),X=V.width/2,_e=V.height/2;let ye=Be-V.left-X,fe=Ue-V.top-_e;const _t=Math.min(X,_e)-ue.value,Tt=Math.sqrt(ye*ye+fe*fe);Tt>_t&&(ye=ye/Tt*_t,fe=fe/Tt*_t),d.x=ye,d.y=fe;const he=ye/_t,ie=-fe/_t,de=Math.abs(he),Le=Math.abs(ie);de>=as||Le>=as?de>Le?(B.value="pan",U.value=he,S.value=0):(B.value="tilt",U.value=0,S.value=ie):(B.value="none",U.value=0,S.value=0),(de>as||Le>as)&&(v.x=U.value,v.y=S.value);const rt=Math.abs(U.value-N.value),Kt=Math.abs(S.value-E.value),ps=rt>=as||Kt>=as,Zt=Math.abs(U.value)>=as||Math.abs(S.value)>=as;if(Zt&&ps){N.value=U.value,E.value=S.value;const os=F(U.value),As=F(S.value);B.value==="pan"?await Y({type:"continuous",pan:os,tilt:0,timeout:kr}):B.value==="tilt"&&await Y({type:"continuous",pan:0,tilt:As,timeout:kr})}else f.value&&!Zt&&(Math.abs(N.value)>=as||Math.abs(E.value)>=as)&&(U.value=0,S.value=0,B.value="none",N.value=0,E.value=0,await Y({type:"stop"}))},Jt=Be=>{f.value&&pt(Be.clientX,Be.clientY),b.value&&ze(Be.clientY)},wt=Be=>{Be.preventDefault(),f.value&&pt(Be.touches[0].clientX,Be.touches[0].clientY),b.value&&ze(Be.touches[0].clientY)},zt=()=>{f.value&&(f.value=!1,d.x=0,d.y=0),b.value&&(L.value=z.value,b.value=!1,k.value=0),Mt()},nt=async(Be,Ue)=>{await Y({type:"preset",preset:Be,speed:Ue})},Yt=async Be=>{await Y({type:"home",speed:Be})};return Sn(()=>{window.addEventListener("mousemove",Jt),window.addEventListener("mouseup",zt),window.addEventListener("touchmove",wt,{passive:!1}),window.addEventListener("touchend",zt)}),vo(()=>{window.removeEventListener("mousemove",Jt),window.removeEventListener("mouseup",zt),window.removeEventListener("touchmove",wt),window.removeEventListener("touchend",zt),ht(),Y({type:"stop"})}),e({goToPreset:nt,goToHome:Yt,isLoading:Se}),(Be,Ue)=>{const V=H6,X=z6,_e=q6,ye=F6,fe=I6,_t=P6;return m(),A("div",Q6,[c(a).includes(c(Gt).PTZZoom)?(m(),A("div",{key:0,ref_key:"zoomRef",ref:u,class:at(["pointer-events-auto",["absolute left-4 bottom-4 bg-black/70 rounded-full flex flex-col items-center justify-center border border-white/10 shadow-md",c(o)==="small"?"w-12 h-36":"w-16 h-48"]]),onMousedown:Qe,onTouchstart:lr(Qe,["prevent"])},[g("div",{class:at(["absolute top-4 text-muted",c(o)==="small"?"text-base":"text-lg"])},[y(V)],2),g("div",{class:at(["absolute bottom-4 text-muted",c(o)==="small"?"text-base":"text-lg"])},[y(X)],2),g("div",{class:at(["bg-white rounded-full absolute cursor-grab active:cursor-grabbing shadow-lg",c(o)==="small"?"w-8 h-8":"w-10 h-10"]),style:ot({transform:`translateY(${c(k)}px)`})},null,6)],34)):ce("",!0),c(a).includes(c(Gt).PTZ)?(m(),A("div",{key:1,ref_key:"panTiltRef",ref:l,class:at(["pointer-events-auto",["absolute right-4 bottom-4 bg-black/70 rounded-full flex items-center justify-center border border-white/10 shadow-md",c(o)==="small"?"w-24 h-24":"w-32 h-32"]]),onMousedown:ge,onTouchstart:lr(ge,["prevent"])},[g("div",K6,[y(_e)]),g("div",Z6,[y(ye)]),g("div",G6,[y(fe)]),g("div",W6,[y(_t)]),g("div",{class:at(["bg-white rounded-full absolute cursor-grab active:cursor-grabbing shadow-lg transform -translate-x-1/2 -translate-y-1/2",c(o)==="small"?"w-8 h-8":"w-10 h-10"]),style:ot({left:`calc(50% + ${c(d).x}px)`,top:`calc(50% + ${c(d).y}px)`})},null,6)],34)):ce("",!0)])}}}),X6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e8(s,e){return m(),A("svg",X6,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M17.5 6.5H20a1.5 1.5 0 0 1 0 3h-3A2.5 2.5 0 0 1 14.5 7V4a1.5 1.5 0 0 1 3 0zM4 6.5h2.5V4a1.5 1.5 0 1 1 3 0v3A2.5 2.5 0 0 1 7 9.5H4a1.5 1.5 0 1 1 0-3m0 11h2.5V20a1.5 1.5 0 0 0 3 0v-3A2.5 2.5 0 0 0 7 14.5H4a1.5 1.5 0 0 0 0 3m16 0h-2.5V20a1.5 1.5 0 0 1-3 0v-3a2.5 2.5 0 0 1 2.5-2.5h3a1.5 1.5 0 0 1 0 3"})],-1)]))}const t8=pe({name:"mingcute-fullscreen-exit-fill",render:e8}),s8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function n8(s,e){return m(),A("svg",s8,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M18.5 5.5H16a1.5 1.5 0 0 1 0-3h3A2.5 2.5 0 0 1 21.5 5v3a1.5 1.5 0 0 1-3 0zM8 5.5H5.5V8a1.5 1.5 0 1 1-3 0V5A2.5 2.5 0 0 1 5 2.5h3a1.5 1.5 0 1 1 0 3m0 13H5.5V16a1.5 1.5 0 0 0-3 0v3A2.5 2.5 0 0 0 5 21.5h3a1.5 1.5 0 0 0 0-3m8 0h2.5V16a1.5 1.5 0 0 1 3 0v3a2.5 2.5 0 0 1-2.5 2.5h-3a1.5 1.5 0 0 1 0-3"})],-1)]))}const r8=pe({name:"mingcute-fullscreen-fill",render:n8}),i8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function o8(s,e){return m(),A("svg",i8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M3.5 2A2.5 2.5 0 0 0 1 4.5v5A2.5 2.5 0 0 0 3.5 12H7v-2a2 2 0 0 1 2-2h5V4.5A2.5 2.5 0 0 0 11.5 2zM8 10a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1z"},null,-1)]))}const a8=pe({name:"fluent-picture-in-picture16-filled",render:o8}),c8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function l8(s,e){return m(),A("svg",c8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M1 4.5A2.5 2.5 0 0 1 3.5 2h8A2.5 2.5 0 0 1 14 4.5V8h-1V4.5A1.5 1.5 0 0 0 11.5 3h-8A1.5 1.5 0 0 0 2 4.5v5A1.5 1.5 0 0 0 3.5 11H7v1H3.5A2.5 2.5 0 0 1 1 9.5zM9 9a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1z"},null,-1)]))}const u8=pe({name:"fluent-picture-in-picture16-regular",render:l8}),d8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h8(s,e){return m(),A("svg",d8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M13.986 14.776a.73.73 0 0 1-.66-.4a.74.74 0 0 1 .3-1a2.45 2.45 0 0 0 1-1.001a.739.739 0 0 1 1.359.127a.75.75 0 0 1-.048.563a3.85 3.85 0 0 1-1.611 1.61a.7.7 0 0 1-.34.1"},null,-1),g("path",{fill:"currentColor",d:"M19.409 10.644a7.55 7.55 0 0 1-.7 3.141a7.48 7.48 0 0 1-4.823 4.003a6.4 6.4 0 0 1-1.151.2v2.511h2.892a.75.75 0 0 1 0 1.501H8.342a.75.75 0 0 1 0-1.5h2.892v-2.512a6 6 0 0 1-.57-.07a.752.752 0 0 1 .27-1.481q.442.078.89.08h.33a5.5 5.5 0 0 0 1.341-.19a5.9 5.9 0 0 0 2.282-1.18a5.9 5.9 0 0 0 2.13-4.543a.75.75 0 0 1 1.502 0zM20.52 4.56l-4.363 4.353l-5.623 5.623l-6.004 6.003a.8.8 0 0 1-.53.22a.75.75 0 0 1-.53-.22a.74.74 0 0 1 0-1.06l3.462-3.462l-.18-.2a7.3 7.3 0 0 1-2.172-5.183a.75.75 0 0 1 .74-.76a.76.76 0 0 1 .751.75a5.92 5.92 0 0 0 1.771 4.172l.14.16l.85-.84a4 4 0 0 1-.65-.77a3.66 3.66 0 0 1-.59-1.892V5.851a4.13 4.13 0 0 1 1.45-2.872a4.92 4.92 0 0 1 5.894 0a4.13 4.13 0 0 1 1.441 2.802v.79l3.092-3.091a.74.74 0 0 1 1.06 0a.75.75 0 0 1-.01 1.08"},null,-1)]))}const m8=pe({name:"mage-microphone-mute-fill",render:h8}),p8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f8(s,e){return m(),A("svg",p8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M16.43 5.838v5.57a4.43 4.43 0 0 1-8.78 0v-5.57a4.43 4.43 0 0 1 8.78 0"},null,-1),g("path",{fill:"currentColor",d:"M12.79 17.998v2.5h2.89a.75.75 0 0 1 0 1.5H8.4a.75.75 0 1 1 0-1.5h2.85v-2.5a7.4 7.4 0 0 1-6.67-7.38a.75.75 0 0 1 1.5 0a5.92 5.92 0 1 0 11.84 0a.75.75 0 0 1 1.5 0a7.4 7.4 0 0 1-6.67 7.38z"},null,-1)]))}const g8=pe({name:"mage-microphone-fill",render:f8}),v8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function _8(s,e){return m(),A("svg",v8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124M11.28 5.72a.75.75 0 1 0-1.06 1.06L11.44 8l-1.22 1.22a.75.75 0 1 0 1.06 1.06l1.22-1.22l1.22 1.22a.75.75 0 1 0 1.06-1.06L13.56 8l1.22-1.22a.75.75 0 0 0-1.06-1.06L12.5 6.94z"},null,-1)]))}const y8=pe({name:"heroicons-speaker-x-mark16-solid",render:_8}),b8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function w8(s,e){return m(),A("svg",b8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124m5.393.984a.75.75 0 1 0-1.06 1.06a5.5 5.5 0 0 1 0 7.78a.75.75 0 1 0 1.06 1.06a7 7 0 0 0 0-9.9"},null,-1),g("path",{fill:"currentColor",d:"M10.828 5.172a.75.75 0 1 0-1.06 1.06a2.5 2.5 0 0 1 0 3.536a.75.75 0 1 0 1.06 1.06a4 4 0 0 0 0-5.656"},null,-1)]))}const x8=pe({name:"heroicons-speaker-wave16-solid",render:w8}),S8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C8(s,e){return m(),A("svg",S8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 12v10H8v-8H6v-2zm8 2v6c0 1.11-.89 2-2 2h-2a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-4 0v6h2v-6zM11.5 3c2.65 0 5.05 1 6.9 2.6L21 3v7h-7l2.62-2.62C15.23 6.22 13.46 5.5 11.5 5.5c-3.54 0-6.55 2.31-7.6 5.5l-2.37-.78C2.92 6.03 6.85 3 11.5 3"},null,-1)]))}const k8=pe({name:"mdi-fast-forward10",render:C8}),E8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A8(s,e){return m(),A("svg",E8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17.276 5.47c.435.16.724.575.724 1.039V17.49c0 .464-.29.879-.724 1.039a3.7 3.7 0 0 1-2.552 0A1.11 1.11 0 0 1 14 17.491V6.51c0-.464.29-.879.724-1.04a3.7 3.7 0 0 1 2.552 0m-8 0c.435.16.724.575.724 1.039V17.49c0 .464-.29.879-.724 1.039a3.7 3.7 0 0 1-2.552 0A1.11 1.11 0 0 1 6 17.491V6.51c0-.464.29-.879.724-1.04a3.7 3.7 0 0 1 2.552 0"},null,-1)]))}const M8=pe({name:"basil-pause-solid",render:A8}),$8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P8(s,e){return m(),A("svg",$8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19.266 13.516a1.917 1.917 0 0 0 0-3.032A35.8 35.8 0 0 0 9.35 5.068l-.653-.232c-1.248-.443-2.567.401-2.736 1.69a42.5 42.5 0 0 0 0 10.948c.17 1.289 1.488 2.133 2.736 1.69l.653-.232a35.8 35.8 0 0 0 9.916-5.416"},null,-1)]))}const T8=pe({name:"basil-play-solid",render:P8}),R8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function I8(s,e){return m(),A("svg",R8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12.5 3c4.65 0 8.58 3.03 9.97 7.22L20.1 11c-1.05-3.19-4.06-5.5-7.6-5.5c-1.96 0-3.73.72-5.12 1.88L10 10H3V3l2.6 2.6C7.45 4 9.85 3 12.5 3M10 12v10H8v-8H6v-2zm8 2v6c0 1.11-.89 2-2 2h-2a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-4 0v6h2v-6z"},null,-1)]))}const O8=pe({name:"mdi-rewind10",render:I8}),N8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function F8(s,e){return m(),A("svg",N8,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-width":"2",d:"M8.5 5.5L12 2l3.5 3.5M22 12H2m3.5-3.5L2 12l3.5 3.5m13 0L22 12l-3.5-3.5M12 22V2M8.5 18.5L12 22l3.5-3.5"},null,-1)]))}const L8=pe({name:"grommet-icons-pan",render:F8}),j8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q8(s,e){return m(),A("svg",j8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 19v-9q0-.475.213-.9t.587-.7l6-4.5q.525-.4 1.2-.4t1.2.4l6 4.5q.375.275.588.7T20 10v9q0 .825-.588 1.413T18 21h-3q-.425 0-.712-.288T14 20v-5q0-.425-.288-.712T13 14h-2q-.425 0-.712.288T10 15v5q0 .425-.288.713T9 21H6q-.825 0-1.412-.587T4 19"},null,-1)]))}const D8=pe({name:"material-symbols-home-rounded",render:q8}),B8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z8(s,e){return m(),A("svg",B8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 .36A5.4 5.4 0 0 0 6.62 5.3a5.4 5.4 0 0 0-1.22-.14a5.4 5.4 0 0 0-2.143 10.357a5.4 5.4 0 0 0-.737 2.723a5.4 5.4 0 0 0 9.54 3.466a5.4 5.4 0 0 0 8.833-6.137a5.4 5.4 0 0 0-3.505-10.152A5.4 5.4 0 0 0 12 .36M6.283 7.228h10.592c.746 0 1.352.605 1.352 1.349v7.646a1.35 1.35 0 0 1-1.352 1.348h-3.608l-7.24 3.55l1.1-3.55h-.844a1.35 1.35 0 0 1-1.352-1.348V8.577c0-.744.606-1.349 1.352-1.349"},null,-1)]))}const U8=pe({name:"simple-icons-webrtc",render:z8}),V8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H8(s,e){return m(),A("svg",V8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17.41 2H6.59A4.58 4.58 0 0 0 2 6.59v10.82A4.58 4.58 0 0 0 6.59 22h10.82A4.58 4.58 0 0 0 22 17.41V6.59A4.58 4.58 0 0 0 17.41 2m-2.653 12.447a1.924 1.924 0 0 1-1.924 1.923h-5.86a1.924 1.924 0 0 1-1.923-1.923v-4.87a1.923 1.923 0 0 1 1.927-1.924h5.856a1.925 1.925 0 0 1 1.924 1.924zm4.2.74a.771.771 0 0 1-1.266.59l-2.211-1.854a.85.85 0 0 1-.3-.653v-2.52a.85.85 0 0 1 .31-.657l2.206-1.82a.769.769 0 0 1 1.26.594z"},null,-1)]))}const Q8=pe({name:"cbi-iosfacetime",render:H8}),K8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z8(s,e){return m(),A("svg",K8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10.4 13.45h3.2l.6 1.625q.075.2.238.313t.362.112q.35 0 .538-.275t.062-.6l-2.55-6.7q-.075-.2-.237-.312T12.25 7.5h-.5q-.2 0-.363.113t-.237.312L8.625 14.65q-.125.3.05.575t.525.275q.2 0 .363-.112t.237-.313zm.4-1.15L11.95 9h.1l1.15 3.3zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12q0-.8.125-1.6T2.5 8.825q.125-.4.513-.537t.737.062q.375.2.538.588t.037.812q-.15.55-.238 1.113T4 12q0 3.35 2.325 5.675T12 20t5.675-2.325T20 12t-2.325-5.675T12 4q-.6 0-1.187.087T9.65 4.35q-.425.125-.8-.025T8.3 3.8t-.013-.762t.563-.513q.75-.275 1.55-.4T12 2q2.075 0 3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22M5.5 7q-.625 0-1.062-.437T4 5.5t.438-1.062T5.5 4t1.063.438T7 5.5t-.437 1.063T5.5 7m6.5 5"},null,-1)]))}const G8=pe({name:"material-symbols-motion-photos-auto-outline-rounded",render:Z8}),W8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J8(s,e){return m(),A("svg",W8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m8.471 7.237l3.056 12.992c.233.993 1.63 1.04 1.929.065l2.945-9.58l.384 1.527a1 1 0 0 0 .97.756H21a1 1 0 1 0 0-2h-2.466l-1.069-4.241c-.247-.981-1.628-1.017-1.925-.05l-2.912 9.472L9.475 2.771c-.24-1.02-1.688-1.03-1.943-.014l-2.065 8.24H3a1 1 0 0 0 0 2h3.247a1 1 0 0 0 .97-.757z"},null,-1)]))}const Y8=pe({name:"fluent-pulse24-filled",render:J8}),X8={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function ex(s,e){return m(),A("svg",X8,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"4"},[g("path",{fill:"currentColor",d:"M16.866 7.47A18 18 0 0 0 16 13c0 9.941 8.059 18 18 18a17.9 17.9 0 0 0 7.134-1.47C38.801 36.767 32.012 42 24 42c-9.941 0-18-8.059-18-18c0-7.407 4.473-13.768 10.866-16.53Z"}),g("path",{"stroke-linecap":"round",d:"M31.66 10H41l-10 8h10"})],-1)]))}const tx=pe({name:"icon-park-solid-sleep",render:ex}),sx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nx(s,e){return m(),A("svg",sx,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2a7 7 0 0 1 7 7a7 7 0 0 1-7 7a7 7 0 0 1-7-7a7 7 0 0 1 7-7m0 2a5 5 0 0 0-5 5a5 5 0 0 0 5 5a5 5 0 0 0 5-5a5 5 0 0 0-5-5m0 2a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3M6 22a2 2 0 0 1-2-2c0-.38.1-.73.29-1.03l1.82-3.16A9 9 0 0 0 12 18c2.25 0 4.31-.83 5.89-2.19l1.82 3.16c.19.3.29.65.29 1.03a2 2 0 0 1-2 2z"},null,-1)]))}const rx=pe({name:"mdi-webcam",render:nx}),ix={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ox(s,e){return m(),A("svg",ix,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057M10.25 8a.75.75 0 0 0-1.5 0v8a.75.75 0 0 0 1.5 0v-3.25h3.5V16a.75.75 0 0 0 1.5 0V8a.75.75 0 0 0-1.5 0v3.25h-3.5z"},null,-1)]))}const ax=pe({name:"mynaui-letter-h-square-solid",render:ox}),cx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lx(s,e){return m(),A("svg",cx,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057m.233 5.3A.75.75 0 0 0 8.25 8v8a.75.75 0 0 0 1.5 0v-5.75l1.65 2.2a.75.75 0 0 0 1.2 0l1.65-2.2V16a.75.75 0 0 0 1.5 0V8a.75.75 0 0 0-1.35-.45l-2.4 3.2z"},null,-1)]))}const ux=pe({name:"mynaui-letter-m-square-solid",render:lx}),dx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hx(s,e){return m(),A("svg",dx,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057M10.25 8a.75.75 0 0 0-1.5 0v7.5c0 .414.336.75.75.75H15a.75.75 0 0 0 0-1.5h-4.75z"},null,-1)]))}const mx=pe({name:"mynaui-letter-l-square-solid",render:hx}),px={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fx(s,e){return m(),A("svg",px,e[0]||(e[0]=[g("g",{fill:"currentColor"},[g("path",{d:"M12.918 12.083h-1.836L12 9.636z"}),g("path",{d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057m3.335 4.987a.75.75 0 0 0-1.404 0l-3 8a.75.75 0 1 0 1.404.526l.818-2.18h2.96l.818 2.18a.75.75 0 1 0 1.404-.526z"})],-1)]))}const gx=pe({name:"mynaui-letter-a-square-solid",render:fx}),vx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _x(s,e){return m(),A("svg",vx,e[0]||(e[0]=[g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M18 2.75a.75.75 0 0 1 0-1.5h4a.75.75 0 0 1 .53 1.28l-2.72 2.72H22a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1-.53-1.28l2.72-2.72zm-4.5 6a.75.75 0 0 1 0-1.5h3a.75.75 0 0 1 .53 1.28l-1.72 1.72h1.19a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1-.53-1.28l1.72-1.72z","clip-rule":"evenodd"},null,-1),g("path",{fill:"currentColor",d:"M12 22c5.523 0 10-4.477 10-10c0-.463-.694-.54-.933-.143a6.5 6.5 0 1 1-8.924-8.924C12.54 2.693 12.463 2 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10"},null,-1)]))}const yx=pe({name:"solar-moon-sleep-bold",render:_x}),bx=Symbol("cui-camera-drawer"),Do=Zh(bx),Cp={position:"right",showCloseIcon:!1,modal:!0,dismissable:!0,baseZIndex:1e3,blockScroll:!0,pt:{root:{class:"w-full sm:w-[400px]"}}},kp=()=>{const s=ae(!1),e=ne(()=>s.value),t=(r,i)=>{Do.emit({type:"open",options:r,props:{...Cp,...i}}),s.value=!0},n=()=>{Do.emit({type:"close"}),s.value=!1};return Do.on(r=>{switch(r.type){case"close":s.value=!1;break;case"open":s.value=!0;break}}),{open:t,close:n,isOpen:e,getEventBus:()=>Do}};async function Ep(){const s=Fs(),{api:e,isApiReady:t}=Vs(s);return t.value?e.value:new Promise((n,r)=>{const i=Ge(t,o=>{o&&e.value&&(i(),n(e.value))});setTimeout(()=>{i(),r(new Error("Timeout waiting for API"))},15e3)})}const wx={key:"sleep",class:"absolute left-0 right-0 top-0 bottom-0 bg-black/80 flex items-center justify-center z-7"},xx={class:"flex flex-col items-center justify-center text-center"},Sx={key:0,class:"text-white/80 text-sm max-w-xs mt-3"},Cx={key:"loading",class:"absolute w-full h-full flex flex-col items-center justify-center z-6 pointer-events-none"},kx={key:0,class:"mt-3 text-white text-sm text-shadow"},Ex={key:"overlay",class:"absolute w-full p-4 flex items-center justify-between gap-2 z-6 pointer-events-none"},Ax={key:1,class:"text-sm font-semibold p-2 bg-black/60 rounded-xl text-white"},Mx={id:"timeline-container",key:"timeline",class:"absolute w-full h-full z-5 pointer-events-none"},$x={key:5,class:"absolute top-0 left-0 w-full h-full z-5 pointer-events-none"},Px=["data-player-id","muted"],Tx={class:"flex items-center gap-2"},Rx={key:1,class:"w-[10px] h-[10px] rounded-full bg-red-500"},Ix={class:"text-base font-semibold"},Ih=6,Ox=5e3,Oh=5e3,Nx=1e4,Fx=1e3,Lx=At({__name:"CuiCameraCard",props:Kn({cameraInfo:{},expandableCard:{type:Boolean,default:!1},flatCard:{type:Boolean,default:!1},cardProps:{},control:{type:Boolean,default:!0},controlFastForwardButton:{type:Boolean,default:!0},controlFsButton:{type:Boolean,default:!0},controlMicrophoneButton:{type:Boolean,default:!0},controlPipButton:{type:Boolean,default:!0},controlPlayPauseButton:{type:Boolean,default:!0},controlRewindButton:{type:Boolean,default:!0},controlSpeakerButton:{type:Boolean,default:!0},subcontrol:{type:Boolean,default:!0},subcontrolActivityModeButton:{type:Boolean,default:!0},subcontrolPtzButton:{type:Boolean,default:!0},subcontrolQualityButton:{type:Boolean,default:!0},subcontrolStreamingModeButton:{type:Boolean,default:!0},cameraNameOverlay:{type:Boolean,default:!0},liveIndicatorOverlay:{type:Boolean,default:!1},modeOverlay:{type:Boolean},toolbar:{type:Boolean,default:!0},toolbarClass:{},toolbarDetectionButton:{type:Boolean,default:!0},toolbarSettingsButton:{type:Boolean,default:!0},toolbarShareButton:{type:Boolean,default:!0},toolbarShortcutsButton:{type:Boolean,default:!0},toolbarSnapshotButton:{type:Boolean,default:!0},toolbarStyle:{},toolbarTimelineButton:{type:Boolean,default:!0},toolbarZoneButton:{type:Boolean,default:!0}},{activityMode:{default:"always-on"},activityModeModifiers:{},sourceRole:{},sourceRoleModifiers:{},streamingMode:{},streamingModeModifiers:{}}),emits:Kn(["streamFinishedLoading","expand"],["update:activityMode","update:sourceRole","update:streamingMode"]),setup(s,{expose:e,emit:t}){const n=new Jn,r=kp(),{mdBreakpoint:i}=Vr(),{isFsSupported:o,isIos:a,isPipSupported:l}=Ol(),{t:u}=js(),d=t,h=Rr(s,"activityMode"),v=Rr(s,"sourceRole"),f=Rr(s,"streamingMode"),b=s,{cameraInfo:k,expandableCard:z,flatCard:L,cardProps:se,cameraNameOverlay:K,liveIndicatorOverlay:N,control:E,controlFastForwardButton:O,controlFsButton:U,controlMicrophoneButton:S,controlPipButton:M,controlPlayPauseButton:B,controlRewindButton:W,controlSpeakerButton:I,subcontrol:w,subcontrolActivityModeButton:H,subcontrolPtzButton:J,subcontrolQualityButton:q,subcontrolStreamingModeButton:oe,toolbar:ue,toolbarClass:Se,toolbarDetectionButton:F,toolbarSettingsButton:D,toolbarShareButton:Y,toolbarShortcutsButton:Te,toolbarSnapshotButton:He,toolbarStyle:ht,toolbarTimelineButton:Mt,toolbarZoneButton:Qe}=Wt(b),ze=Vt("snapshotRef"),ge=Vt("menuRef"),pt=Vt("motionDetectionCanvasRef"),Jt=Vt("objectDetectionCanvasRef"),wt=Vt("ptzRef"),zt=Vt("playerContainerRef"),nt=Vt("videoPlayerRef"),Yt=Ls(),{cameraObject:Be,motionState:Ue,objectState:V,hasPtz:X,hasMotionDetector:_e,hasObjectDetector:ye}=Ll(Yt),fe=Ls(null),_t=Ls(),Tt=ae(!1),he=ae(!1),ie=ae(!1),de=ae("loading"),Le=ae(!1),rt=ae(!1),Kt=ae(!1),ps=ae(!1),Zt=ae(!1),os=ae({x:0,y:0}),As=ae(1),fs=ae(!1),Ms=ae(!1),ds=ae(!1),R=ae(!1),te=ae(!1),ve=ae(!0),ke=ae(!1),st=ae(!0),Ot=ae(!1),Ht=ae(!1),Ye=ae(!1),Ce=ae(["animal","motion","other","person","vehicle"]),Oe=O_();let Ne,be,it;n.toggleQueryActivator("getCameraQuery",!1);const{data:_,isFetching:x,suspense:C}=n.getCameraQuery(typeof k.value=="string"?k.value:""),P=nf(),T=xu(zt,{delayLeave:1e3}),Z=xu(zt,{delayLeave:0}),Me=ri(zt),{isFullscreen:Pe,toggle:le}=rf(a.value?nt:zt),{idle:Ee,reset:ft}=of(Ox,{initialState:!1});Eo(nt,"enterpictureinpicture",()=>Ht.value=!0),Eo(nt,"leavepictureinpicture",()=>Ht.value=!1),Eo(nt,"pause",()=>{ke.value=!1,Zt.value||Co()}),Eo(nt,"play",()=>{Zt.value=!1,ke.value=!0});const Xe=ne(()=>(T.value||ve.value)&&E.value&&!fs.value),mt=ne(()=>typeof k.value=="string"&&x.value||!ie.value||Le.value),ls=ne(()=>he.value&&de.value!=="error"),bs=ne(()=>!!navigator.mediaDevices&&Tt.value&&(de.value==="webrtc"||de.value==="webrtc/tcp")),Ii=ne(()=>Ye.value||!ie.value),kn=ne(()=>{var ee;return f.value??((ee=So.value)==null?void 0:ee.interface.streamingMode)??"webrtc"}),on=ne(()=>{var ee;return v.value??((ee=So.value)==null?void 0:ee.interface.streamingSource)??"high-resolution"}),jl=ne(()=>K.value&&Xe.value&&!i.value&&Me.width.value>=350),$p=ne(()=>E.value&&Xe.value&&!rt.value&&Me.width.value>=150),Pp=ne(()=>w.value&&Xe.value&&!rt.value&&Me.width.value>=150),Oi=ne(()=>ds.value&&Me.width.value>=350&&X.value),ql=ne(()=>{var Ae;let ee=(Ae=So.value)==null?void 0:Ae.interface.aspectRatio;return ee=!ee||ee==="auto"?"16:9":ee,ee.replace(":","/")}),So=ne(()=>typeof k.value=="string"?_.value:k.value),En=ne(()=>typeof k.value=="string"?k.value:k.value.name),Tp=ne(()=>[{key:"animal",label:"Animal",toggle:!0,toggleState:Ce.value.includes("animal"),disabled:!Ni.value.includes("animal"),onClick:()=>Qr("animal")},{key:"motion",label:"Motion",toggle:!0,toggleState:Ce.value.includes("motion"),disabled:!Ni.value.includes("motion"),onClick:()=>Qr("motion")},{key:"other",label:"Other",toggle:!0,toggleState:Ce.value.includes("other"),disabled:!Ni.value.includes("other"),onClick:()=>Qr("other")},{key:"person",label:"Person",toggle:!0,toggleState:Ce.value.includes("person"),disabled:!Ni.value.includes("person"),onClick:()=>Qr("person")},{key:"vehicle",label:"Vehicle",toggle:!0,toggleState:Ce.value.includes("vehicle"),disabled:!Ni.value.includes("vehicle"),onClick:()=>Qr("vehicle")}]),Rp=ne(()=>{var Ae;const ee={body:{class:"w-full h-full p-0 overflow-hidden justify-center"},root:{class:{}}};return L.value&&(ee.root.class={...ee.root.class,"!rounded-none !border-0":!0}),kl(ee,(Ae=se.value)==null?void 0:Ae.pt)}),Dl=ne(()=>{const ee=Me.width.value;return ee?ee<=150?.4:ee<250?.5:ee<350?.7:ee<450?.85:1:1}),Ip=ne(()=>{const ee=Me.height.value,Ae=Dl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),Op=ne(()=>{const ee=Me.height.value,Ae=Dl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),ct=ne(()=>{const ee=Me.width.value;return ee?ee<=150?8:ee<225?10:ee<250?12:ee<350?14:ee<450?16:18:18}),an=ne(()=>{const ee=Me.width.value;return ee?ee<=170?18:ee<225?20:ee<250?22:ee<350?28:ee<450?34:40:40}),Ws=ne(()=>`${an.value}px`),Ni=ne(()=>{var Ae;const ee=new Set(((Ae=So.value)==null?void 0:Ae.detectionZones.map(St=>St.classes).flat())??[]);return _e.value||ee.delete("motion"),ye.value||(ee.delete("animal"),ee.delete("person"),ee.delete("vehicle"),ee.delete("other")),Array.from(ee)});Ge(P,ee=>{var Ae,St;ee==="hidden"?(clearTimeout(be),be=setTimeout(()=>{Hr()},Nx)):(clearTimeout(be),(Ae=fe.value)!=null&&Ae.finishLoading?Co():(yr(),(St=fe.value)==null||St.start()))}),Ge(Le,async ee=>{ee&&await qa(!1,!1)}),Ge(ie,ee=>{ee||qp(),d("streamFinishedLoading",ee)}),Ge(de,ee=>{clearInterval(it),ee==="mse"&&(it=setInterval(Dp,Fx))}),Ge(h,()=>{Wl()}),Ge(Ee,ee=>{h.value==="standby"&&ee&&(rt.value=!0,Hr())}),Ge(Ue,()=>{var ee,Ae,St;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Jl(((Ae=Ue.value)==null?void 0:Ae.detections)??[]),Xl("motion",((St=Ue.value)==null?void 0:St.detections)??[]))},{deep:!0}),Ge(V,()=>{var ee,Ae,St;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Jl(((Ae=V.value)==null?void 0:Ae.detections)??[]),Xl("object",((St=V.value)==null?void 0:St.detections)??[]))},{deep:!0});const Np=async()=>{if(!nt.value)throw new Error("Video player not found!");typeof k.value=="string"&&await C();const ee=await Ep();if(Yt.value=await ee.deviceManager.getCamera(En.value),!Yt.value)throw new Error("Camera not found!");fe.value=Yt.value.createWebRTCSession({role:on.value,mode:kn.value,videoElement:nt.value,webrtcConnectTimeout:2e3}),fe.value.addEventListener("error",Ul),fe.value.addEventListener("reconnect",yr),fe.value.addEventListener("onModeChange",Vl),fe.value.addEventListener("onSourceChange",Hl),fe.value.addEventListener("onStreamProbe",Ql),fe.value.addEventListener("onFinishLoading",Kl),fe.value.addEventListener("onFirstFrame",Zl),fe.value.addEventListener("onLoadedData",Gl),Wl(!0)},Fp=()=>{var ee;if(kn.value==="auto"){const Ae=(ee=fe.value)!=null&&ee.currentMode?u(`components.player.streaming_mode_${fe.value.currentMode}`):u("components.player.streaming_mode_unknown");return`${u("components.player.streaming_mode_auto")}: ${Ae}`}else return kn.value.startsWith("webrtc")?u("components.player.streaming_mode_webrtc"):kn.value==="mse"?u("components.player.streaming_mode_mse"):u("components.player.streaming_mode_unknown")},Lp=()=>{var ee;if(on.value==="auto"){const Ae=(ee=fe.value)!=null&&ee.currentResolution?u(`components.player.source_role_${fe.value.currentResolution.split("-")[0]}`):u("components.player.source_role_unknown");return`${u("components.player.source_role_auto")}: ${Ae}`}else return on.value==="high-resolution"?u("components.player.source_role_high"):on.value==="mid-resolution"?u("components.player.source_role_mid"):on.value==="low-resolution"?u("components.player.source_role_low"):u("components.player.source_role_unknown")},Bl=ee=>{if(!nt.value||!zt.value||!T.value){os.value={x:0,y:0},As.value=1;return}const Ae=zt.value.getBoundingClientRect(),St=nt.value.getBoundingClientRect(),gs=Math.max(0,(St.width-Ae.width)/2),ss=Math.max(0,(St.height-Ae.height)/2),br=Math.max(-gs,Math.min(gs,ee.pan.x)),wr=Math.max(-ss,Math.min(ss,ee.pan.y));(ee.pan.x!==br||ee.pan.y!==wr)&&(os.value={x:br,y:wr});const Kr=1,Xt=Ih-1;ee.zoom>Xt?ee.type==="dblClick"?Zs(()=>{As.value=Kr}):Zs(()=>{As.value=Xt}):ee.zoom===1&&setTimeout(()=>{os.value={x:0,y:0}},10)},zl=()=>{z.value&&!rt.value&&d("expand")},Ul=ee=>{console.error(En.value,ee),de.value="error",ie.value=!1,Le.value=!1},yr=()=>{de.value="reconnecting",ie.value=!1,Le.value=!0},Vl=()=>{de.value=fe.value.currentMode,Le.value=!1,ie.value=!1},Hl=()=>{de.value="adapting",Kt.value=!0},Ql=()=>{de.value=fe.value.currentMode,Tt.value=fe.value.hasBackchannel,he.value=fe.value.hasAudio},Kl=()=>{de.value=fe.value.currentMode,Le.value=!1},Zl=()=>{de.value=fe.value.currentMode,ie.value=!0,Kt.value=!1},Gl=()=>{de.value=fe.value.currentMode,ie.value=!0,Kt.value=!1},Wl=ee=>{var Ae,St,gs,ss;clearTimeout(Ne),h.value==="always-on"?(rt.value=!1,(Ae=fe.value)!=null&&Ae.finishLoading||(ee||yr(),(St=fe.value)==null||St.start())):h.value==="standby"?rt.value||(ft(),(gs=fe.value)!=null&&gs.finishLoading||(yr(),(ss=fe.value)==null||ss.start())):h.value==="activity"&&(ps.value||(rt.value=!0,Hr()))},Jl=ee=>{var Ae,St;h.value==="activity"&&(!!(ee!=null&&ee.length&&ee.some(ss=>Ce.value.includes(ss.label)))?(ps.value=!0,clearTimeout(Ne),(rt.value||!((Ae=fe.value)!=null&&Ae.finishLoading))&&(rt.value=!1,yr(),(St=fe.value)==null||St.start())):(clearTimeout(Ne),Ne=setTimeout(()=>{ps.value||(rt.value=!0,Hr())},Oh),ps.value=!1))},jp=()=>{var ee;rt.value&&(rt.value=!1,yr(),(ee=fe.value)==null||ee.start(),h.value==="standby"?ft():h.value==="activity"&&(clearTimeout(Ne),ps.value||(Ne=setTimeout(()=>{rt.value=!0,Hr()},Oh))))},Hr=()=>{var ee;(ee=fe.value)==null||ee.close(),ie.value=!1},Yl=()=>{var ee;if(nt.value){const Ae=document.createElement("canvas");Ae.width=nt.value.videoWidth,Ae.height=nt.value.videoHeight,(ee=Ae.getContext("2d"))==null||ee.drawImage(nt.value,0,0,Ae.width,Ae.height);const St=Ae.toDataURL("image/png"),gs=`${En.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,ss=document.createElement("a");ss.setAttribute("download",gs),ss.href=St,document.body.appendChild(ss),ss.click(),ss.remove()}},qp=()=>{var ee,Ae;(ee=pt.value)==null||ee.clear(),(Ae=Jt.value)==null||Ae.clear()},Xl=(ee,Ae)=>{var St,gs;ie.value&&(ee==="motion"?(St=pt.value)==null||St.draw(Ae):ee==="object"&&((gs=Jt.value)==null||gs.draw(Ae)))},Co=async()=>{if(nt.value)try{await nt.value.play()}catch(ee){if(nt.value&&!nt.value.muted)return nt.value.muted=!0,Co();console.warn(En.value,ee)}},Dp=()=>{if(nt.value&&de.value==="mse"&&!Le.value&&ie.value&&nt.value.buffered.length>0){const ee=nt.value.buffered.end(nt.value.buffered.length-1);ee-nt.value.currentTime>1&&(nt.value.currentTime=ee)}},Qr=ee=>{const Ae=Ce.value.indexOf(ee);Ae>-1?Ce.value.splice(Ae,1):Ce.value.push(ee)},eu=ee=>{ee=ee??!te.value,te.value=ee},tu=ee=>{st.value=ee!==void 0?ee:!st.value},qa=async(ee,Ae=!1)=>{var St,gs;if((St=fe.value)!=null&&St.currentMode.includes("webrtc"))if(Ot.value=ee!==void 0?ee:!Ot.value,Ot.value)try{_t.value=await navigator.mediaDevices.getUserMedia({audio:!0});const ss=_t.value.getAudioTracks()[0];st.value=!Ae,await fe.value.toggleMicrophone(ss)}catch(ss){console.warn(En.value,ss)}else(gs=_t.value)==null||gs.getTracks().forEach(ss=>ss.stop()),_t.value=void 0,await fe.value.toggleMicrophone(null)},su=ee=>{h.value=ee||(h.value==="always-on"?"standby":h.value==="standby"?"activity":"always-on")},nu=async ee=>{var St;let Ae=on.value;Ae=ee||(Ae==="auto"?"low-resolution":Ae==="low-resolution"?"mid-resolution":Ae==="mid-resolution"?"high-resolution":"auto"),await((St=fe.value)==null?void 0:St.toggleRole(Ae)),v.value=Ae},ru=async ee=>{var St;let Ae=kn.value;Ae=ee||(Ae==="auto"?"webrtc":Ae==="webrtc"?"mse":"auto"),await((St=fe.value)==null?void 0:St.toggleMode(Ae)),f.value=Ae},iu=()=>{var ee;document.pictureInPictureElement?document.exitPictureInPicture():document.pictureInPictureEnabled&&((ee=nt.value)==null||ee.requestPictureInPicture())},ou=()=>{nt.value&&(ke.value?(Zt.value=!0,nt.value.pause()):Co())},au=()=>{o.value?le():Pe.value=!Pe.value},cu=()=>{Ms.value=!Ms.value},lu=()=>{ds.value=!ds.value},uu=()=>{fs.value=!fs.value},du=()=>{R.value=!R.value},hu=()=>{},mu=()=>{},Bp=ee=>{Ye.value=ee};return el(()=>{typeof k.value=="string"&&n.toggleQueryActivator("getCameraQuery",!0)}),Sn(async()=>{try{await Np(),setTimeout(()=>{ve.value=!1},1500)}catch(ee){console.error(ee)}}),Ma(()=>{var ee,Ae,St,gs,ss,br,wr,Kr,Xt;clearTimeout(Ne),(ee=fe.value)==null||ee.removeEventListener("error",Ul),(Ae=fe.value)==null||Ae.removeEventListener("reconnect",yr),(St=fe.value)==null||St.removeEventListener("onModeChange",Vl),(gs=fe.value)==null||gs.removeEventListener("onSourceChange",Hl),(ss=fe.value)==null||ss.removeEventListener("onStreamProbe",Ql),(br=fe.value)==null||br.removeEventListener("onFinishLoading",Kl),(wr=fe.value)==null||wr.removeEventListener("onFirstFrame",Zl),(Kr=fe.value)==null||Kr.removeEventListener("onLoadedData",Gl),Hr(),(Xt=Yt.value)==null||Xt.close()}),e({togglePlay:ou,toggleSourceRole:nu,togglePictureInPicture:iu,toggleActivityMode:su,toggleAddingShortcuts:uu,toggleStreamingMode:ru,toggleFs:au,toggleMute:tu,toggleMicrophone:qa,toggleShortcuts:cu,togglePtz:lu,toggleFastForward:mu,toggleRewind:hu,toggleZones:eu,toggleDetectionClass:Qr,toggleTimeline:du,timelineScroll:Bp,captureScreenshot:Yl}),(ee,Ae)=>{const St=yx,gs=Lr,ss=gx,br=mx,wr=ux,Kr=ax,Xt=ys,zp=rx,Up=tx,Vp=Y8,Hp=G8,Qp=Q8,Kp=U8,Zp=D8,Gp=L8,Wp=O8,Jp=T8,Yp=M8,Xp=k8,e0=x8,t0=y8,s0=g8,n0=m8,r0=u8,i0=a8,o0=r8,a0=t8,c0=Y6,l0=A6,pu=S6,u0=r6,d0=Fl,h0=t6,m0=Y4,p0=G4,f0=Q4,g0=U4,v0=D4,_0=Sp,y0=N4,b0=R4,w0=$4,x0=E4,S0=Vc,C0=Sa,k0=Dh,E0=fp,Js=jr;return m(),A("div",null,[y(k0,{class:"cui-card",pt:c(Rp)},{content:$(()=>{var fu;return[g("div",{id:"video-container",ref_key:"playerContainerRef",ref:zt,class:"bg-black flex items-center justify-center relative",onClick:jp},[y(K0,{name:"fade",tag:"div",class:"w-full relative",style:ot({aspectRatio:c(ql)})},{default:$(()=>{var ko,gu;return[c(rt)?(m(),A("div",wx,[g("div",xx,[y(St,{class:"text-white w-[50px] h-[50px]"}),c(Me).width.value>=350?(m(),A("p",Sx,me(ee.$t("components.player.stream_paused")),1)):ce("",!0)])])):ce("",!0),c(mt)&&!c(rt)?(m(),A("div",Cx,[y(gs,{class:"w-[30px] h-[30px] m-0","stroke-width":"5"}),c(Le)?(m(),A("span",kx,me(ee.$t("components.player.reconnecting"))+"...",1)):ce("",!0)])):ce("",!0),!c(rt)&&(c(jl)||c(N))?(m(),A("div",Ex,[c(N)?(m(),A("div",{key:0,class:at(["w-[10px] h-[10px] rounded-full shadow-md",{"bg-red-500":c(ie),"bg-gray-500":!c(ie)}])},null,2)):ce("",!0),c(jl)?(m(),A("span",Ax,me(c(En)),1)):ce("",!0)])):ce("",!0),c(Pp)?(m(),A("div",{key:"subcontrol",class:"absolute top-4 right-4 cui-rounded-corner overflow-hidden bg-black/60 flex flex-row items-center justify-center shadow-md z-6 dark-mode",style:ot({top:c(Op),height:c(Ws)})},[c(q)&&!c(ds)?Pt((m(),j(Xt,{key:0,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[0]||(Ae[0]=Ln=>nu())},{icon:$(()=>[c(on)==="auto"?(m(),j(ss,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):c(on)==="low-resolution"?(m(),j(br,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):c(on)==="mid-resolution"?(m(),j(wr,{key:2,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Kr,{key:3,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Lp()},void 0,{top:!0}]]):ce("",!0),c(H)&&!c(ds)?Pt((m(),j(Xt,{key:1,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[1]||(Ae[1]=Ln=>su())},{icon:$(()=>[h.value==="always-on"?(m(),j(zp,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):h.value==="standby"?(m(),j(Up,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Vp,{key:2,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:h.value==="always-on"?ee.$t("components.player.activity_mode_always_on"):h.value==="standby"?ee.$t("components.player.activity_mode_standby"):ee.$t("components.player.activity_mode_activity")},void 0,{top:!0}]]):ce("",!0),c(oe)&&!c(ds)?Pt((m(),j(Xt,{key:2,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[2]||(Ae[2]=Ln=>ru())},{icon:$(()=>[c(kn)==="auto"?(m(),j(Hp,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):c(kn)==="mse"?(m(),j(Qp,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Kp,{key:2,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Fp()},void 0,{top:!0}]]):ce("",!0),c(ds)&&c(X)&&c(Me).width.value>=350?Pt((m(),j(Xt,{key:3,disabled:c(mt)||((ko=c(wt))==null?void 0:ko.isLoading),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[3]||(Ae[3]=Ln=>{var vu;return(vu=c(wt))==null?void 0:vu.goToHome()})},{icon:$(()=>[y(Zp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz_go_to_home")},void 0,{top:!0}]]):ce("",!0),c(J)&&c(Me).width.value>=350&&c(X)?Pt((m(),j(Xt,{key:4,disabled:c(mt)||c(R),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:lu},{icon:$(()=>[y(Gp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz")},void 0,{top:!0}]]):ce("",!0)],4)):ce("",!0),c($p)&&!c(R)&&!c(Oi)?(m(),A("div",{key:"control",class:"absolute left-[50%] -translate-x-[50%] cui-rounded-corner overflow-hidden bg-black/60 flex flex-row items-center justify-center shadow-md z-6 dark-mode",style:ot({bottom:c(Ip),height:c(Ws)})},[c(W)?(m(),j(Xt,{key:0,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",onClick:hu},{icon:$(()=>[y(Wp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1})):ce("",!0),c(B)?(m(),j(Xt,{key:1,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:ou},{icon:$(()=>[c(ke)?(m(),j(Yp,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Jp,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(O)?(m(),j(Xt,{key:2,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:mu},{icon:$(()=>[y(Xp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1},8,["style"])):ce("",!0),c(I)?(m(),j(Xt,{key:3,disabled:!c(ls)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[4]||(Ae[4]=Ln=>tu())},{icon:$(()=>[c(st)?(m(),j(t0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(e0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(S)?(m(),j(Xt,{key:4,disabled:!c(bs)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[5]||(Ae[5]=Ln=>qa(void 0,!0))},{icon:$(()=>[c(Ot)?(m(),j(s0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(n0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(M)?(m(),j(Xt,{key:5,disabled:!c(l)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:iu},{icon:$(()=>[c(Ht)?(m(),j(i0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(r0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(U)?(m(),j(Xt,{key:6,disabled:!c(o)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:au},{icon:$(()=>[c(Pe)?(m(),j(a0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(o0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0)],4)):ce("",!0),Pt(g("div",Mx,null,512),[[Pr,c(R)&&!c(Oi)&&!c(rt)]]),c(Oi)&&!c(R)&&!c(rt)&&c(Yt)?(m(),A("div",$x,[y(c0,{ref_key:"ptzRef",ref:wt,"camera-device":c(Yt)},null,8,["camera-device"])])):ce("",!0),(c(Ms)||c(fs))&&!c(rt)?(m(),j(l0,{key:6,"camera-name":c(En),"adding-shortcuts":c(fs),class:"z-4 pointer-events-none"},null,8,["camera-name","adding-shortcuts"])):ce("",!0),c(_e)&&!c(rt)?(m(),j(pu,{key:7,ref_key:"motionDetectionCanvasRef",ref:pt,classes:c(Ce),class:"z-3 pointer-events-none"},null,8,["classes"])):ce("",!0),c(ye)&&!c(rt)?(m(),j(pu,{key:8,ref_key:"objectDetectionCanvasRef",ref:Jt,classes:c(Ce),class:"z-3 pointer-events-none"},null,8,["classes"])):ce("",!0),c(te)&&!c(rt)?(m(),j(u0,{key:9,"camera-zones":((gu=c(Be))==null?void 0:gu.detectionZones)??[],class:"z-2 pointer-events-none"},null,8,["camera-zones"])):ce("",!0),Pt(y(d0,{key:"snapshot",ref_key:"snapshotRef",ref:ze,"camera-name":c(En),"show-loading-screen":!1,class:at(["object-contain absolute cursor-[inherit] z-1",{"cursor-pointer":c(z)}]),"image-container-class":"w-full h-full",onClick:zl},null,8,["camera-name","class"]),[[Pr,(!c(ie)||c(rt)||c(Kt))&&!c(Ht)]]),y(c(Ef),{key:"zoomable",pan:c(os),"onUpdate:pan":Ae[6]||(Ae[6]=Ln=>us(os)?os.value=Ln:null),zoom:c(As),"onUpdate:zoom":Ae[7]||(Ae[7]=Ln=>us(As)?As.value=Ln:null),disabled:!c(Z)||c(R)||c(Oi)||c(rt),"enable-control-button":!1,"dbl-click-enabled":!1,"min-zoom":1,"max-zoom":Ih,selector:c(Z)?`[data-player-id='${c(Oe)}']`:"disabled","zoom-origin":"pointer",class:"h-full w-full items-center justfiy-center",onPanned:Bl,onZoom:Bl},{default:$(()=>[g("video",{ref_key:"videoPlayerRef",ref:nt,"data-player-id":c(Oe),playsinline:"",autoplay:"",preload:"auto",muted:c(st),class:at(["w-full cursor-[inherit] object-fill",{"cursor-pointer":c(z),"object-contain":c(Pe)}]),style:ot({aspectRatio:c(ql)}),onClick:zl},null,14,Px)]),_:1},8,["pan","zoom","disabled","selector"])]}),_:1},8,["style"])],512),c(ue)?(m(),A("div",{key:0,class:at(["relative w-full h-[60px] camera-toolbar-background border-t-[1px] border-color flex items-center justify-between py-2 px-4 gap-1 z-1",c(Se)]),style:ot([c(ht)])},[g("div",Tx,[c(Ii)?(m(),j(gs,{key:0,"stroke-width":"5",class:"w-[10px] h-[10px]"})):(m(),A("div",Rx)),g("span",Ix,me(c(En)),1)]),Ae[10]||(Ae[10]=g("div",{class:"ml-auto"},null,-1)),c(Y)?Pt((m(),j(Xt,{key:0,fluid:"",text:"",severity:"contrast",class:"cui-icon-lg not-hover:text-surface-400"},{icon:$(()=>[y(h0,{width:"100%",height:"100%"})]),_:1})),[[Js,{value:ee.$t("components.player.share_camera")},void 0,{top:!0}]]):ce("",!0),c(He)?Pt((m(),j(Xt,{key:1,fluid:"",text:"",severity:"contrast",class:"cui-icon-lg not-hover:text-surface-400",onClick:Yl},{icon:$(()=>[y(m0,{width:"100%",height:"100%"})]),_:1})),[[Js,{value:ee.$t("components.player.capture_snapshot")},void 0,{top:!0}]]):ce("",!0),c(Qe)?Pt((m(),j(Xt,{key:2,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(te)}]),onClick:Ae[8]||(Ae[8]=ko=>eu())},{icon:$(()=>[c(te)?(m(),j(f0,{key:1,width:"100%",height:"100%"})):(m(),j(p0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(te)?ee.$t("components.player.hide_zones"):ee.$t("components.player.show_zones")},void 0,{top:!0}]]):ce("",!0),c(F)&&(c(_e)||c(ye))?Pt((m(),j(Xt,{key:3,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(Ce).length}]),onClick:(fu=c(ge))==null?void 0:fu.toggleMenu},{icon:$(()=>[y(g0,{width:"100%",height:"100%"})]),_:1},8,["class","onClick"])),[[Js,{value:ee.$t("components.player.detections")},void 0,{top:!0}]]):ce("",!0),c(Te)?Pt((m(),j(Xt,{key:4,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(Ms)||c(fs)}]),onClick:cu},{icon:$(()=>[!c(Ms)&&!c(fs)?(m(),j(v0,{key:0,width:"100%",height:"100%"})):(m(),j(_0,{key:1,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(Ms)?ee.$t("components.player.hide_shortcuts"):ee.$t("components.player.show_shortcuts")},void 0,{top:!0}]]):ce("",!0),c(Te)?Pt((m(),j(Xt,{key:5,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(fs)}]),onClick:uu},{icon:$(()=>[c(fs)?(m(),j(b0,{key:1,width:"100%",height:"100%"})):(m(),j(y0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(fs)?ee.$t("components.player.save_shortcuts"):ee.$t("components.player.add_shortcuts")},void 0,{top:!0}]]):ce("",!0),c(Mt)?Pt((m(),j(Xt,{key:6,disabled:c(Oi),fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(R)}]),onClick:du},{icon:$(()=>[c(R)?(m(),j(x0,{key:1,width:"100%",height:"100%"})):(m(),j(w0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["disabled","class"])),[[Js,{value:c(R)?ee.$t("components.player.hide_timeline"):ee.$t("components.player.show_timeline")},void 0,{top:!0}]]):ce("",!0),c(D)&&("useCuiPermission"in ee?ee.useCuiPermission:c(Si))(void 0,"admin")?Pt((m(),j(Xt,{key:7,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(r).isOpen.value}]),onClick:Ae[9]||(Ae[9]=ko=>c(r).open({cameraName:c(En)}))},{icon:$(()=>[c(r).isOpen.value?(m(),j(C0,{key:1,width:"100%",height:"100%"})):(m(),j(S0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:ee.$t("components.player.settings")},void 0,{top:!0}]]):ce("",!0)],6)):ce("",!0)]}),_:1},8,["pt"]),y(E0,{ref_key:"menuRef",ref:ge,items:c(Tp),"sort-list":"","auto-hide":!1},null,8,["items"])])}}}),Ap=qs(Lx,[["__scopeId","data-v-d1d904d2"]]),jx=al({protocol:Xm,url:Wh().trim().min(1,"Camera Source is required").array().nonempty("Camera Source is required")}).strict(),qx=al({name:Wh().trim().min(1,"Camera Source Name is required"),urls:jx.array(),role:Ml,useForSnapshot:Cu().default(!1),hotMode:Cu().default(!1)}).strict(),Dx=al({...M2.innerType().shape,sources:qx.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(t=>t.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.hotMode),{message:"Snapshot source can not be used with hotMode"})}).strict(),_9=Wn(Dx),y9=Wn(E2),Bx=Wn($2),zx=Wn(Al),Ux={class:"w-full h-full relative"},Vx={class:"flex flex-col justify-center items-center"},Hx={class:"relative w-full"},Qx={class:"w-full flex flex-col items-center justify-center gap-6"},Kx={class:"relative w-full flex flex-col items-center justify-center"},Zx={class:"absolute top-0 left-0 right-0 bottom-0"},Gx={class:"playground-container flex w-full h-full"},Wx={class:"sandbox w-full h-full"},Jx={class:"handles"},Yx=["data-id","data-point","data-point-index","data-zone-index","onDblclick"],Xx={class:"clipboard"},eS={width:"100%",height:"100%",class:"polygon-container"},tS=["d","onClick","onDblclick","onMousedown","onTouchstart"],sS={class:"flex flex-col gap-6 zone-buttons justify-center items-center"},nS=["for"],rS=["for"],iS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},oS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},aS=At({__name:"ZoneEditor",props:{cameraName:{},zones:{}},setup(s,{expose:e}){const t=new Jn,n=Cn(),{t:r}=js(),i=s,o=mi("dialogRefProps"),{cameraName:a,zones:l}=Wt(i),u=Vt("draggablesRef"),d=Vt("outsideRef"),h=Vt("playerRef"),v=Ls([]),f=ae([]),b=ae(!1),k=ae([]),z=ae(void 0),L=ae(-1),se=ae(-1),K=ae(["animal","vehicle","person","other","motion"]);let N=!1;const E={x:0,y:0},O=rl(h);nl(d,V=>{const X=V.target,_e=X.closest(".polygon"),ye=X.closest(".edit-button"),fe=X.closest(".remove-button"),_t=X.closest(".handle"),Tt=X.closest(".zone-buttons"),he=X.closest(".p-multiselect-list"),ie=X.closest(".p-colorpicker-panel");!_e&&!ye&&!fe&&!_t&&!b.value&&!Tt&&!he&&!ie&&(L.value=-1)});const{mutateAsync:U,isPending:S}=t.patchZonesQuery(),M=ne(()=>{var V;return!!((V=o.loading)!=null&&V.value||S.value)}),B=ne(()=>{var X;const V=[];return b.value&&V.push("customizing"),(X=f.value)!=null&&X.length||V.push("start"),V.join(" ")});Ge(se,()=>{se.value=-1}),Ge(L,(V,X)=>{var _e,ye;if(V===-1&&((_e=f.value)!=null&&_e.length)&&f.value[X]){L.value=X;return}V===-1&&((ye=f.value)!=null&&ye.length)&&(se.value=0)}),Ge(l,()=>{f.value=xi(l.value),W()},{deep:!0,immediate:!0});function W(){if(f.value){if(f.value.length===0){k.value=[];return}k.value=f.value.flatMap((V,X)=>V.points.map((_e,ye)=>({_id:`${V.name}-${ye}`,zoneIndex:X,pointIndex:ye,point:[_e[0],_e[1]]})))}}Ge([O.width,O.height],()=>{Jt()});const I=V=>{if("touches"in V){const X=V.touches[0];return{x:X.clientX,y:X.clientY}}return{x:V.clientX,y:V.clientY}},w=(V,X)=>{if(V.stopPropagation(),!h.value)return;Te(b.value),N=!0,L.value=X;const _e=h.value.getBoundingClientRect(),{x:ye,y:fe}=I(V);E.x=(ye-_e.left)/_e.width*100,E.y=(fe-_e.top)/_e.height*100},H=V=>{if(!N||!h.value||L.value===-1||!f.value.length)return;const X=h.value.getBoundingClientRect(),{x:_e,y:ye}=I(V),fe=(_e-X.left)/X.width*100,_t=(ye-X.top)/X.height*100,Tt=fe-E.x,he=_t-E.y,ie=f.value[L.value].points;let de=!1;for(let Le=0;Le<ie.length;Le++){const rt=ie[Le][0]+Tt,Kt=ie[Le][1]+he;if(rt<0||rt>100||Kt<0||Kt>100){de=!0;break}}if(!de)for(let Le=0;Le<ie.length;Le++){ie[Le][0]+=Tt,ie[Le][1]+=he,ie[Le][0]=Math.max(0,Math.min(100,ie[Le][0])),ie[Le][1]=Math.max(0,Math.min(100,ie[Le][1]));const rt=ie[Le][0]/100*X.width,Kt=ie[Le][1]/100*X.height,ps=v.value.find(Zt=>Zt.id===`${f.value[L.value].name}-${Le}`);ps==null||ps.setPosition(rt,Kt)}E.x=fe,E.y=_t},J=()=>{setTimeout(()=>{N=!1},100)},q=()=>{!f.value.length||L.value===-1||(f.value[L.value].isPrivacyMask=!f.value[L.value].isPrivacyMask)},oe=()=>{f.value[L.value]&&(f.value[L.value].filter=f.value[L.value].filter==="include"?"exclude":"include")},ue=()=>{f.value[L.value]&&(f.value[L.value].type=f.value[L.value].type==="intersect"?"contain":"intersect")},Se=V=>{if(!b.value||N)return;const X=z.value!==void 0?z.value:f.value.length,_e=Math.min(Math.max(Math.round((V.offsetX-10)/O.width.value*100),0),100),ye=Math.min(Math.max(Math.round((V.offsetY-10)/O.height.value*100),0),100);if(z.value===void 0){const fe=`zone-${Date.now()}`;f.value.push({name:fe,points:[],filter:"include",type:"contain",classes:["animal","motion","person","vehicle"],isPrivacyMask:!1,color:ze()}),z.value=f.value.length-1}f.value[X].points.push([_e,ye]),W(),Zs(()=>{const fe=f.value[X].points.length-1;F({_id:`${f.value[X].name}-${fe}`,zoneIndex:X,pointIndex:fe,point:[_e,ye]})})},F=V=>{var _e;if(V.zoneIndex===void 0||V.pointIndex===void 0)return;const X=(_e=u.value)==null?void 0:_e.filter(ye=>ye.dataset.pointIndex===V.pointIndex.toString()&&ye.dataset.zoneIndex===V.zoneIndex.toString());!X||X.length===0||nt(X[0],V.point)},D=V=>{if(!f.value.length)return;const X=Math.round(V.point[0]/O.width.value*100),_e=Math.round(V.point[1]/O.height.value*100);f.value[V.zoneIndex].points[V.pointIndex]=[X,_e]},Y=()=>{b.value=!0,z.value=void 0},Te=V=>{var _e;if(z.value===void 0){b.value=!1;return}b.value=V||!1;const X=z.value;!f.value[X]||!f.value[X].points||(f.value[X].points.length<3?(f.value.splice(X,1),W()):((_e=u.value)==null||_e.forEach(ye=>Be(ye)),L.value=X),z.value=void 0)},He=()=>{b.value=!0,z.value=L.value},ht=()=>{L.value===-1||!f.value.length||(f.value.splice(L.value,1),L.value=Math.max(-1,L.value-1),W(),Zs(()=>{Jt()}))},Mt=()=>{var V;if((V=f.value)!=null&&V.length){if(b.value&&z.value!==void 0){const X=f.value[z.value];X.points.length&&(X.points.pop(),X.points.length===0&&(f.value.splice(z.value,1),z.value=void 0),W());return}f.value.length>0&&(f.value.pop(),W(),Zs(()=>{Jt()}))}},Qe=()=>{N=!1,b.value=!1,z.value=void 0,f.value&&(f.value.length=0,k.value=[],Zs(()=>{wt()}))},ze=()=>{const V=Math.floor(Math.random()*256),X=Math.floor(Math.random()*256),_e=Math.floor(Math.random()*256);return"#"+[V,X,_e].map(ye=>ye.toString(16).padStart(2,"0")).join("")},ge=V=>{if(!V||!V.length)return"";const X=V.map(ye=>{const fe=Math.round(ye[0]/100*O.width.value),_t=Math.round(ye[1]/100*O.height.value);return`${fe+10},${_t+10}`});if(X.length===0)return"";let _e=`M ${X[0]}`;for(let ye=1;ye<X.length;ye++)_e+=` L ${X[ye]}`;return _e+=" Z",_e},pt=V=>{b.value||(L.value=V)},Jt=()=>{var V;wt(),(V=u.value)==null||V.forEach(X=>{if(!X.dataset.zoneIndex||!X.dataset.pointIndex)return;const _e=parseInt(X.dataset.zoneIndex),ye=parseInt(X.dataset.pointIndex);if(!f.value[_e]||!f.value[_e].points[ye])return;const fe=f.value[_e].points[ye];fe&&(nt(X,fe),Be(X))})},wt=()=>{v.value.forEach(V=>V.destroy()),v.value=[]},zt=V=>{!f.value.length||!f.value[V.zoneIndex]||f.value[V.zoneIndex].points.length<4||(f.value[V.zoneIndex].points.splice(V.pointIndex,1),W(),Zs(()=>{Jt()}))},nt=(V,X)=>{Object.assign(V.style,Yt(X))},Yt=V=>({left:Math.round(V[0]/100*O.width.value)+"px",top:Math.round(V[1]/100*O.height.value)+"px"}),Be=V=>{V.classList.add("draggable");const X=new Jh(V,{containment:!0,grid:[0,0]}).on("pointerDown",()=>{var _e;(_e=document.querySelectorAll(`[data-point="${V.dataset.zoneIndex}-${V.dataset.pointIndex}"]`)[0])==null||_e.classList.add("changing")}).on("dragMove",()=>{if(!V.dataset.zoneIndex||!V.dataset.pointIndex||!V.dataset.id)return;const _e=X.position.x,ye=X.position.y;D({_id:V.dataset.id,point:[_e,ye],pointIndex:parseInt(V.dataset.pointIndex),zoneIndex:parseInt(V.dataset.zoneIndex)})}).on("pointerUp",()=>{document.querySelectorAll(".point").forEach(_e=>_e.classList.remove("changing"))});X.id=V.dataset.id,v.value.push(X)},Ue=async()=>{if(f.value.length)try{const V=await zx.parse(f.value);if(!V.value)return n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",V.errors),null;await U({cameraname:a.value,zoneData:f.value})}catch(V){return console.error("Error saving zones:",V),n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.save_failed"),life:3e3}),null}};return Sn(async()=>{var V;setTimeout(()=>{Jt()}),(V=f.value)!=null&&V.length&&(L.value=0)}),e({isLoading:M,onConfirm:Ue}),(V,X)=>{var ve,ke,st,Ot,Ht,Ye,Ce,Oe,Ne;const _e=Ap,ye=qh,fe=go,_t=ki,Tt=O0,he=Aa,ie=S4,de=ys,Le=vp,rt=b4,Kt=v4,ps=p4,Zt=d4,os=c4,As=i4,fs=s4,Ms=X3,ds=W3,R=K3,te=jr;return m(),A("div",Ux,[g("div",Vx,[g("div",Hx,[g("div",{ref_key:"outsideRef",ref:d},null,512),g("div",Qx,[g("div",Kx,[g("div",Zx,[g("div",Gx,[g("section",{class:at(["playground w-full h-full",c(B)]),onClick:Se},[g("div",Wx,[g("div",Jx,[(m(!0),A(yt,null,qt(c(k),be=>(m(),A("div",{key:be._id,ref_for:!0,ref_key:"draggablesRef",ref:u,class:"handle","data-id":be._id,"data-point":`${be.zoneIndex}-${be.pointIndex}`,"data-point-index":be.pointIndex,"data-zone-index":be.zoneIndex,onDblclick:lr(it=>zt(be),["prevent"])},X[3]||(X[3]=[g("div",{class:"delete-point"},null,-1)]),40,Yx))),128)),g("div",Xx,[(m(),A("svg",eS,[(m(!0),A(yt,null,qt(c(f),(be,it)=>(m(),A("path",{key:be.name,d:ge(be.points),class:at(["cursor-pointer",{dash:be.type==="intersect"&&!be.isPrivacyMask,selected:c(L)===it}]),style:ot({fill:be.isPrivacyMask?"rgba(16, 16, 16, 0.9)":be.filter==="exclude"?"transparent":`${be.color}4D`,stroke:be.isPrivacyMask?"#333333":be.color,"stroke-width":"2"}),onClick:_=>pt(it),onDblclick:()=>be.isPrivacyMask=!be.isPrivacyMask,onMousedown:_=>w(_,it),onMousemove:H,onMouseup:J,onTouchstart:_=>w(_,it),onTouchmove:H,onTouchend:J},null,46,tS))),128))]))])]),X[4]||(X[4]=g("div",{class:"shadowboard on"},null,-1))])],2)])]),g("div",{ref_key:"playerRef",ref:h,class:"w-full h-full flex flex-col items-center justify-center",style:{width:"calc(100% - 20px)","margin-top":"10px","margin-bottom":"10px"}},[y(_e,{"camera-info":c(a),"source-role":"low-resolution","streaming-mode":"webrtc",toolbar:!1,control:!1,subcontrol:!1,"flat-card":"",class:"w-full h-full border-[1px] border-color-inner"},null,8,["camera-info"])],512)]),g("div",sS,[y(c(Lt),{"model-value":(ve=c(f)[c(L)])==null?void 0:ve.classes,name:`zone[${c(L)}].classes`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:be,errors:it})=>[g("label",{for:`zone[${c(L)}].classes`,class:"cui-label"},me(V.$t("components.form.label.classes")),9,nS),y(fe,null,{default:$(()=>{var _,x;return[y(ye,et(be,{"model-value":(_=c(f)[c(L)])==null?void 0:_.classes,options:c(K),disabled:(x=c(f)[c(L)])==null?void 0:x.isPrivacyMask,invalid:it.length>0,loading:c(M),"max-selected-labels":2,"show-toggle-all":!1,"show-clear":"",type:"text",onValueChange:X[0]||(X[0]=C=>c(f)[c(L)].classes=C)}),null,16,["model-value","options","disabled","invalid","loading"])]}),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`zone[${c(L)}].classes`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),y(c(Lt),{"model-value":(ke=c(f)[c(L)])==null?void 0:ke.color,name:`zone[${c(L)}].color`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:be,errors:it})=>[g("label",{for:`zone[${c(L)}].color`,class:"cui-label"},me(V.$t("components.form.label.color")),9,rS),y(fe,null,{default:$(()=>{var _;return[y(_t,et(be,{disabled:(_=c(f)[c(L)])==null?void 0:_.isPrivacyMask,invalid:it.length>0,loading:c(M),readonly:"",type:"text"}),null,16,["disabled","invalid","loading"]),y(he,null,{default:$(()=>{var x,C;return[(m(),j(Tt,{key:c(L),"model-value":(x=c(f)[c(L)])==null?void 0:x.color,format:"hex",disabled:(C=c(f)[c(L)])==null?void 0:C.isPrivacyMask,onValueChange:X[1]||(X[1]=P=>P?c(f)[c(L)].color=`#${P}`:null)},null,8,["model-value","disabled"]))]}),_:1})]}),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`zone[${c(L)}].color`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),g("div",iS,[c(b)?Pt((m(),j(de,{key:1,disabled:c(z)!==void 0&&((Ot=(st=c(f)[c(z)])==null?void 0:st.points)==null?void 0:Ot.length)<3,loading:c(M),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:X[2]||(X[2]=be=>Te(!1))},{icon:$(()=>[y(Le,{width:"20px",height:"20px"})]),_:1},8,["disabled","loading"])),[[te,{value:V.$t("components.form.tooltip.finish")},void 0,{top:!0}]]):Pt((m(),j(de,{key:0,loading:c(M),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Y},{icon:$(()=>[y(ie,{width:"20px",height:"20px"})]),_:1},8,["loading"])),[[te,{value:V.$t("components.form.tooltip.new")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length||c(L)<0||c(b),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:He},{icon:$(()=>[y(rt,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.edit")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length||c(L)<0,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ht},{icon:$(()=>[y(Kt,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.delete")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Mt},{icon:$(()=>[y(ps,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.undo")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Qe},{icon:$(()=>[y(Zt,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.clear")},void 0,{top:!0}]])]),g("div",oS,[Pt((m(),j(de,{loading:c(M),disabled:!(c(f).length&&c(L)>=0&&c(f)[c(L)]),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:q},{icon:$(()=>{var be;return[(be=c(f)[c(L)])!=null&&be.isPrivacyMask?(m(),j(os,{key:0,width:"20px",height:"20px"})):(m(),j(As,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[te,{value:(Ht=c(f)[c(L)])!=null&&Ht.isPrivacyMask?V.$t("components.form.tooltip.privacy_mask"):V.$t("components.form.tooltip.public_mask")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:(Ye=c(f)[c(L)])==null?void 0:Ye.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:oe},{icon:$(()=>{var be;return[((be=c(f)[c(L)])==null?void 0:be.filter)==="include"?(m(),j(fs,{key:0,width:"20px",height:"20px"})):(m(),j(Ms,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[te,{value:((Ce=c(f)[c(L)])==null?void 0:Ce.filter)==="include"?V.$t("components.form.tooltip.include"):V.$t("components.form.tooltip.exclude")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:(Oe=c(f)[c(L)])==null?void 0:Oe.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ue},{icon:$(()=>{var be;return[((be=c(f)[c(L)])==null?void 0:be.type)==="intersect"?(m(),j(ds,{key:0,width:"20px",height:"20px"})):(m(),j(R,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[te,{value:((Ne=c(f)[c(L)])==null?void 0:Ne.type)==="intersect"?V.$t("components.form.tooltip.intersect"):V.$t("components.form.tooltip.contain")},void 0,{top:!0}]])])])])])])])}}}),cS=qs(aS,[["__scopeId","data-v-51a8517c"]]),lS={class:"text-color font-normal"},uS={class:"flex flex-col gap-6"},dS={for:"name",class:"cui-label"},hS={for:"type",class:"cui-label"},mS={class:"flex items-center gap-4"},pS={class:"flex flex-col field-switch-gap"},fS={for:"disabled",class:"cui-label-switch"},gS={class:"text-color font-normal"},vS={class:"flex flex-col gap-6"},_S={for:"info.manufacturer",class:"cui-label"},yS={for:"info.model",class:"cui-label"},bS={for:"info.hardware",class:"cui-label"},wS={for:"info.serialNumber",class:"cui-label"},xS={for:"info.firmwareVersion",class:"cui-label"},SS={for:"info.supportUrl",class:"cui-label"},CS={class:"text-color font-normal"},kS={class:"flex flex-col gap-6"},ES={for:"interface.streamingMode",class:"cui-label"},AS={for:"interface.streamingSource",class:"cui-label"},MS={for:"interface.aspectRatio",class:"cui-label"},$S={class:"text-color font-normal"},PS={class:"flex flex-col gap-6"},TS={for:"detectionSettings.motion.timeout",class:"cui-label"},RS={for:"detectionSettings.object.confidence",class:"cui-label"},IS={class:"text-color font-normal"},OS={class:"flex flex-col gap-6 w-full items-center justify-center"},NS={class:"text-color font-normal"},FS={class:"flex flex-col gap-6"},LS={for:"snapshotTTL",class:"cui-label"},jS={class:"text-color font-normal"},qS={class:"flex flex-col gap-6"},DS={for:"frameWorkerSettings.decoder",class:"cui-label"},BS={for:"frameWorkerSettings.resolution",class:"cui-label"},zS={for:"frameWorkerSettings.fps",class:"cui-label"},US=At({__name:"Settings",props:Kn({camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:Kn(["close"],["update:modelValue"]),setup(s,{emit:e}){const t=new Jn,n=$i(),r=qr(),i=Il(),{t:o}=js(),a=Rr(s,"modelValue"),l=e,u=s,{camera:d,loading:h}=Wt(u),v=ae(["camera","doorbell"]),f=ae(["auto","mse","webrtc","webrtc/tcp"]),b=ae(["auto","high-resolution","mid-resolution","low-resolution"]),k=ae(["16:9","8:3","4:3","auto"]),z=ae(["pillow","wasm","rust","gpu"]),L=ae(["640x480","640x360","320x240","320x180"]),{mutateAsync:se,isPending:K}=t.removeCameraQuery(),N=ne(()=>h.value||K.value),E=()=>{i.openTextDialog({data:{title:o("components.dialog.title.confirm"),confirmText:o("components.form.button.remove"),contentText:o("components.dialog.message.confirm_remove"),confirmButtonProps:{severity:"danger"}},onConfirm:async()=>{try{await se({cameraname:d.value.name}),n.path.includes(d.value.name)&&r.push({path:"/cameras"}),l("close")}catch{}}})},O=(U=[])=>{i.openComponentDialog(cS,{data:{title:o("components.zone_editor.edit_zones"),loading:N,contentProps:{cameraName:d.value.name,zones:U}}})};return(U,S)=>{const M=Jc,B=ki,W=go,I=Zc,w=Kc,H=fo,J=ys,q=Yc,oe=Wc,ue=jh,Se=Gc;return m(),j(Se,{multiple:"",class:"p-4"},{default:$(()=>[y(oe,{value:"general"},{default:$(()=>[y(M,{class:"px-0 pt-0"},{default:$(()=>[g("span",lS,me(U.$t("components.camera_options.general")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",uS,[y(c(Lt),{modelValue:a.value.name,"onUpdate:modelValue":S[0]||(S[0]=F=>a.value.name=F),modelModifiers:{trim:!0},name:"name",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",dS,me(U.$t("components.form.label.name")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"name",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{"model-value":a.value.type,name:"type",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",hS,me(U.$t("components.form.label.type")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.type,options:c(v),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[1]||(S[1]=Y=>a.value.type=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"type",class:"cui-input-error"})]),_:1})]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.disabled,value:!0,"unchecked-value":!1,type:"checkbox",name:"disabled",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("div",mS,[g("div",pS,[g("label",fS,me(U.$t("components.form.label.disabled")),1),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.disable_camera")),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"disabled",class:"cui-input-switch-error"})]),_:1})]),y(H,et({"model-value":a.value.disabled},F,{invalid:D.length>0,loading:c(N),class:"ml-auto shrink-0",onValueChange:S[2]||(S[2]=Y=>a.value.disabled=Y)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value"]),y(J,{fluid:"",severity:"danger",loading:c(N),class:"cui-button-medium",label:U.$t("components.form.button.remove"),onClick:S[3]||(S[3]=F=>E())},null,8,["loading","label"])])]),_:1})]),_:1}),y(oe,{value:"branding"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",gS,me(U.$t("components.camera_options.branding")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",vS,[y(c(Lt),{modelValue:a.value.info.manufacturer,"onUpdate:modelValue":S[4]||(S[4]=F=>a.value.info.manufacturer=F),modelModifiers:{trim:!0},name:"info.manufacturer",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",_S,me(U.$t("components.form.label.manufacturer")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.manufacturer",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.model,"onUpdate:modelValue":S[5]||(S[5]=F=>a.value.info.model=F),modelModifiers:{trim:!0},name:"info.model",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",yS,me(U.$t("components.form.label.model")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.model",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.hardware,"onUpdate:modelValue":S[6]||(S[6]=F=>a.value.info.hardware=F),modelModifiers:{trim:!0},name:"info.hardware",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",bS,me(U.$t("components.form.label.hardware_version")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.hardware",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.serialNumber,"onUpdate:modelValue":S[7]||(S[7]=F=>a.value.info.serialNumber=F),modelModifiers:{trim:!0},name:"info.serialNumber",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",wS,me(U.$t("components.form.label.serial_number")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.serialNumber",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.firmwareVersion,"onUpdate:modelValue":S[8]||(S[8]=F=>a.value.info.firmwareVersion=F),modelModifiers:{trim:!0},name:"info.firmwareVersion",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",xS,me(U.$t("components.form.label.firmware_version")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.firmwareVersion",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.supportUrl,"onUpdate:modelValue":S[9]||(S[9]=F=>a.value.info.supportUrl=F),modelModifiers:{trim:!0},name:"info.supportUrl",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",SS,me(U.$t("components.form.label.support_url")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.supportUrl",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])])]),_:1})]),_:1}),y(oe,{value:"interface"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",CS,me(U.$t("components.camera_options.interface")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",kS,[y(c(Lt),{"model-value":a.value.interface.streamingMode,name:"interface.streamingMode",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",ES,me(U.$t("components.form.label.streaming_mode")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.interface.streamingMode,options:c(f),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[10]||(S[10]=Y=>a.value.interface.streamingMode=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"interface.streamingMode",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.streaming_mode")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.interface.streamingSource,name:"interface.streamingSource",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",AS,me(U.$t("components.form.label.streaming_source")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.interface.streamingSource,options:c(b),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[11]||(S[11]=Y=>a.value.interface.streamingSource=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"interface.streamingSource",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.streaming_source")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.interface.aspectRatio,name:"interface.aspectRatio",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",MS,me(U.$t("components.form.label.aspect_ratio")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.interface.aspectRatio,options:c(k),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[12]||(S[12]=Y=>a.value.interface.aspectRatio=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"interface.aspectRatio",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.aspect_ratio")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(oe,{value:"detection"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",$S,me(U.$t("components.camera_options.detection")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",PS,[y(c(Lt),{"model-value":a.value.detectionSettings.motion.timeout,name:"detectionSettings.motion.timeout",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",TS,me(U.$t("components.form.label.motion_duration")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.detectionSettings.motion.timeout},F,{invalid:D.length>0,loading:c(N),"show-buttons":"","use-grouping":!1,onValueChange:S[13]||(S[13]=Y=>a.value.detectionSettings.motion.timeout=Y),onInput:S[14]||(S[14]=Y=>a.value.detectionSettings.motion.timeout=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"detectionSettings.motion.timeout",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.motion_duration")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.detectionSettings.object.confidence,name:"detectionSettings.object.confidence",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",RS,me(U.$t("components.form.label.confidence")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.detectionSettings.object.confidence},F,{invalid:D.length>0,loading:c(N),"show-buttons":"",step:.01,max:1,mode:"decimal","use-grouping":!1,onValueChange:S[15]||(S[15]=Y=>a.value.detectionSettings.object.confidence=Y),onInput:S[16]||(S[16]=Y=>a.value.detectionSettings.object.confidence=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"detectionSettings.object.confidence",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.confidence")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(oe,{value:"zones"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",IS,me(U.$t("components.camera_options.zones")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",OS,[y(J,{fluid:"",class:"cui-button-medium",loading:c(N),label:U.$t("components.form.button.edit_zones"),onClick:S[17]||(S[17]=F=>O(c(d).detectionZones))},null,8,["loading","label"])])]),_:1})]),_:1}),y(oe,{value:"snapshot"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",NS,me(U.$t("components.camera_options.snapshot")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",FS,[y(c(Lt),{"model-value":a.value.snapshotTTL,name:"snapshotTTL",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",LS,me(U.$t("components.form.label.cache_time")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.snapshotTTL},F,{invalid:D.length>0,loading:c(N),"show-buttons":"","use-grouping":!1,onValueChange:S[18]||(S[18]=Y=>a.value.snapshotTTL=Y),onInput:S[19]||(S[19]=Y=>a.value.snapshotTTL=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"snapshotTTL",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.cache_time")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(oe,{value:"frameworker"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",jS,me(U.$t("components.camera_options.frame_worker")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",qS,[y(c(Lt),{"model-value":a.value.frameWorkerSettings.decoder,name:"frameWorkerSettings.decoder",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",DS,me(U.$t("components.form.label.decoder")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.frameWorkerSettings.decoder,options:c(z),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[20]||(S[20]=Y=>a.value.frameWorkerSettings.decoder=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"frameWorkerSettings.decoder",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.frameworker_decoder")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.frameWorkerSettings.resolution,name:"frameWorkerSettings.resolution",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",BS,me(U.$t("components.form.label.resolution")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.frameWorkerSettings.resolution,options:c(L),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[21]||(S[21]=Y=>a.value.frameWorkerSettings.resolution=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"frameWorkerSettings.resolution",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.frameworker_resolution")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.frameWorkerSettings.fps,name:"frameWorkerSettings.fps",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",zS,me(U.$t("components.form.label.fps")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.frameWorkerSettings.fps},F,{invalid:D.length>0,loading:c(N),min:0,"show-buttons":"","use-grouping":!1,onValueChange:S[22]||(S[22]=Y=>a.value.frameWorkerSettings.fps=Y),onInput:S[23]||(S[23]=Y=>a.value.frameWorkerSettings.fps=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"frameWorkerSettings.fps",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.frameworker_fps")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})}}}),VS={class:"relative"},HS=At({__name:"CuiActionButton",props:{label:{},icon:{},buttonProps:{},tooltipProps:{},actionText:{},actionDuration:{default:1500}},emits:["action"],setup(s,{emit:e}){const t=s,n=e,{label:r,icon:i,buttonProps:o,actionText:a,actionDuration:l,tooltipProps:u}=Wt(t),d=Vt("buttonRef"),h=ae(!1),v=ri(d);let f;const b=ne(()=>({top:`${v.top.value}px`,left:`${v.left.value}px`,transform:"translate(-50%, -100%)",marginTop:"-8px"})),k=z=>{h.value=!1,clearTimeout(f),n("action",z),h.value=!0,f=setTimeout(()=>{h.value=!1},l.value)};return Ma(()=>{f&&clearTimeout(f)}),(z,L)=>{const se=ys;return m(),A("div",{ref_key:"buttonRef",ref:d,class:"relative"},[y(se,et(c(o),{label:c(r),onClick:k}),Hh({_:2},[c(i)?{name:"icon",fn:$(()=>[g("div",VS,[(m(),j(Ai(c(i))))])]),key:"0"}:void 0]),1040,["label"]),(m(),j(Qh,{to:"body"},[y(Et,{name:"fade"},{default:$(()=>[c(h)?(m(),j(se,et({key:0,as:"div"},c(u),{class:"fixed text-xs px-2 py-1 rounded whitespace-nowrap z-[99999] cursor-default pointer-events-none",style:c(b),label:c(a)}),null,16,["style","label"])):ce("",!0)]),_:1})]))],512)}}}),QS={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function KS(s,e){return m(),A("svg",QS,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 4.085V10.5a2.5 2.5 0 0 0 2.336 2.495L6.5 13h4.414A1.5 1.5 0 0 1 9.5 14H6a3 3 0 0 1-3-3V5.5a1.5 1.5 0 0 1 1-1.415M11.5 2A1.5 1.5 0 0 1 13 3.5v7a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 5 10.5v-7A1.5 1.5 0 0 1 6.5 2z"},null,-1)]))}const Nh=pe({name:"fluent-copy-16-filled",render:KS}),ZS={class:"flex flex-col field-gap"},GS={class:"cui-label"},WS={class:"cui-label"},JS={class:"cui-label"},YS={key:0,class:"flex flex-col field-gap"},XS={class:"cui-label"},e7={key:1,class:"flex flex-col field-gap"},t7={class:"cui-label"},s7=At({__name:"CameraSource",props:{cameraName:{},source:{},loading:{type:Boolean}},setup(s){const e=new Jn,t=s,{cameraName:n,source:r,loading:i}=Wt(t),{data:o,isFetching:a}=e.probeCameraSourceQuery(n.value,r.value.name,{video:!0,audio:!0,microphone:!0}),{copy:l}=af({legacy:!0}),u=ne(()=>!!(i.value||a.value)),d=ne(()=>{var f;return((f=o.value)==null?void 0:f.probe.consumers.filter(b=>b.format_name!=="probe").length)||0}),h=ne(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(L=>L.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(L=>L.codec.codec_type==="video");return(b==null?void 0:b.map(L=>L.codec.codec_name))||[]}),v=ne(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(L=>L.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(L=>L.codec.codec_type==="audio");return(b==null?void 0:b.map(L=>L.codec.codec_name))||[]});return(f,b)=>{const k=ki,z=go,L=HS,se=Aa;return m(),A(yt,null,[g("div",ZS,[g("label",GS,me(f.$t("components.form.label.connections")),1),y(z,null,{default:$(()=>[y(k,{value:c(d),loading:c(u),readonly:"",type:"text"},null,8,["value","loading"])]),_:1})]),(m(!0),A(yt,null,qt(c(h),(K,N)=>(m(),A("div",{key:N,class:"flex flex-col field-gap"},[g("label",WS,me(f.$t("components.form.label.video_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":K,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),(m(!0),A(yt,null,qt(c(v),(K,N)=>(m(),A("div",{key:N,class:"flex flex-col field-gap"},[g("label",JS,me(f.$t("components.form.label.audio_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":K,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),c(r).role!=="snapshot"?(m(),A("div",YS,[g("label",XS,me(f.$t("components.form.label.rtsp_url")),1),y(z,null,{default:$(()=>{var K;return[y(k,{"model-value":(K=c(o))==null?void 0:K.rtspUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(se,null,{default:$(()=>{var N;return[y(L,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Nh),"button-props":{severity:"secondary",disabled:!((N=c(o))!=null&&N.rtspUrl),loading:c(u),text:!0},onAction:b[0]||(b[0]=E=>c(l)(c(o).rtspUrl))},null,8,["action-text","icon","button-props"])]}),_:1})]}),_:1})])):ce("",!0),c(r).role!=="snapshot"?(m(),A("div",e7,[g("label",t7,me(f.$t("components.form.label.onvif_url")),1),y(z,null,{default:$(()=>{var K;return[y(k,{"model-value":(K=c(o))==null?void 0:K.onvifUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(se,null,{default:$(()=>{var N;return[y(L,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Nh),"button-props":{severity:"secondary",disabled:!((N=c(o))!=null&&N.onvifUrl),loading:c(u),text:!0},onAction:b[1]||(b[1]=E=>c(l)(c(o).onvifUrl))},null,8,["action-text","icon","button-props"])]}),_:1})]}),_:1})])):ce("",!0)],64)}}}),n7={class:"flex gap-2 items-center w-full"},r7={class:"text-color font-normal"},i7={class:"flex flex-col gap-6"},o7=["for"],a7=["for"],c7={class:"flex items-center gap-4"},l7={class:"flex flex-col field-switch-gap"},u7=["for"],d7={class:"flex items-center gap-4"},h7={class:"flex flex-col field-switch-gap"},m7=["for"],p7={class:"flex flex-col gap-6"},f7=["for"],g7={class:"w-full flex items-center justify-center my-3"},v7=At({__name:"Sources",props:Kn({camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:Kn(["close"],["update:modelValue"]),setup(s,{emit:e}){const t=Rr(s,"modelValue"),n=s,{camera:r,loading:i}=Wt(n),o=ae(["high-resolution","mid-resolution","low-resolution","snapshot"]),a=h=>{t.value.sources[h].urls.push("")},l=h=>{t.value.sources.splice(h,1)},u=(h,v)=>{t.value.sources[h].urls.splice(v,1)},d=()=>{t.value&&t.value.sources.push({_id:"",name:"",role:null,urls:[],useForSnapshot:!1,hotMode:!1})};return(h,v)=>{const f=_o,b=ys,k=Jc,z=ki,L=go,se=s7,K=Zc,N=Kc,E=fo,O=Aa,U=Yc,S=Wc,M=Gc,B=wp;return m(),A(yt,null,[y(M,{multiple:"",class:"p-4"},{default:$(()=>[(m(!0),A(yt,null,qt(t.value.sources,(W,I)=>(m(),j(S,{key:I,value:I},{default:$(()=>[y(k,{class:at({"px-0 pt-0":I===0,"px-0":I!==0})},{default:$(()=>[g("div",n7,[g("span",r7,me(h.$t("components.camera_options.source")+": "+W.name.replace(/ /g,"_").toLowerCase()),1),y(b,{text:"",rounded:"",loading:c(i),disabled:t.value.sources.length<2,severity:"danger",class:"cui-icon-md ml-auto mr-2",onClick:w=>l(I)},{icon:$(()=>[y(f,{width:"100%",height:"100%"})]),_:2},1032,["loading","disabled","onClick"])])]),_:2},1032,["class"]),y(U,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",i7,[y(c(Lt),{modelValue:W.name,"onUpdate:modelValue":w=>W.name=w,modelModifiers:{trim:!0},name:`sources[${I}].name`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("label",{for:`sources[${I}].name`,class:"cui-label"},me(h.$t("components.form.label.source_name")),9,o7),y(L,null,{default:$(()=>[y(z,et({ref_for:!0},w,{invalid:H.length>0,loading:c(i),readonly:c(r).sources.some(J=>J.name===W.name),type:"text"}),null,16,["invalid","loading","readonly"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].name`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),W._id?(m(),j(se,{key:0,"camera-name":c(r).name,source:W,loading:c(i)},null,8,["camera-name","source","loading"])):ce("",!0),y(c(Lt),{"model-value":W.role,name:`sources[${I}].role`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("label",{for:`sources[${I}].role`,class:"cui-label"},me(h.$t("components.form.label.source_role")),9,a7),y(L,null,{default:$(()=>[y(K,et({"model-value":W.role,ref_for:!0},w,{options:c(o).filter(J=>!t.value.sources.some(q=>q.role===J&&q._id!==W._id)),invalid:H.length>0,loading:c(i),onValueChange:J=>W.role=J}),null,16,["model-value","options","invalid","loading","onValueChange"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].role`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["model-value","name"]),W.role!=="snapshot"&&t.value.sources.length>1&&!t.value.sources.some(w=>(w.useForSnapshot||w.role==="snapshot")&&w._id!==W._id)?(m(),j(c(Lt),{key:1,"model-value":W.useForSnapshot,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${I}].useForSnapshot`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("div",c7,[g("div",l7,[g("label",{for:`sources[${I}].useForSnapshot`,class:"cui-label-switch"},me(h.$t("components.form.label.use_for_snapshot")),9,u7),y(N,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(h.$t("components.form.hint.use_for_snapshot")),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].useForSnapshot`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,et({"model-value":W.useForSnapshot,ref_for:!0},w,{invalid:H.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>W.useForSnapshot=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ce("",!0),W.role!=="snapshot"?(m(),j(c(Lt),{key:2,"model-value":W.hotMode,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${I}].hotMode`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("div",d7,[g("div",h7,[g("label",{for:`sources[${I}].hotMode`,class:"cui-label-switch"},me(h.$t("components.form.label.hot_mode")),9,m7),y(N,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(h.$t("components.form.hint.hot_mode")),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].hotMode`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,et({"model-value":W.hotMode,ref_for:!0},w,{invalid:H.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>W.hotMode=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ce("",!0),g("div",p7,[g("label",{for:`sources[${I}].urls[]`,class:"cui-label"},me(h.$t("components.form.label.sources")),9,f7),(m(!0),A(yt,null,qt(W.urls,(w,H)=>(m(),j(c(Lt),{key:H,modelValue:W.urls[H],"onUpdate:modelValue":J=>W.urls[H]=J,modelModifiers:{trim:!0},name:`sources[${I}].urls[${H}]`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:J,errors:q})=>[y(L,null,{default:$(()=>[y(z,et({ref_for:!0},J,{invalid:q.length>0,loading:c(i),type:"text"}),null,16,["invalid","loading"]),W.urls.length>1?(m(),j(O,{key:0},{default:$(()=>[y(b,{text:"",severity:"secondary",loading:c(i),onClick:oe=>u(I,H)},{icon:$(()=>[y(f)]),_:2},1032,["loading","onClick"])]),_:2},1024)):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].urls[${H}]`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","name"]))),128)),y(b,{loading:c(i),label:h.$t("components.form.button.add_source"),class:"ml-auto cui-button-medium",onClick:w=>a(I)},null,8,["loading","label","onClick"])])])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1}),g("div",g7,[y(b,{text:"",rounded:"",loading:c(i),class:"cui-icon-xl",onClick:d},{icon:$(()=>[y(B,{width:"100%",height:"100%"})]),_:1},8,["loading"])])],64)}}}),_7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y7(s,e){return m(),A("svg",_7,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2C9.76 2 7.78 3.05 6.5 4.68l9.81 9.82C17.94 13.21 19 11.24 19 9a7 7 0 0 0-7-7M3.28 4L2 5.27L5.04 8.3C5 8.53 5 8.76 5 9c0 2.38 1.19 4.47 3 5.74V17a1 1 0 0 0 1 1h5.73l4 4L20 20.72zM9 20v1a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-1z"},null,-1)]))}const b7=pe({name:"mdi-lightbulb-off",render:y7}),w7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x7(s,e){return m(),A("svg",w7,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 6a6 6 0 0 1 6 6c0 2.22-1.21 4.16-3 5.2V19a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-1.8c-1.79-1.04-3-2.98-3-5.2a6 6 0 0 1 6-6m2 15v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-1zm6-10h3v2h-3zM1 11h3v2H1zM13 1v3h-2V1zM4.92 3.5l2.13 2.14l-1.42 1.41L3.5 4.93zm12.03 2.13l2.12-2.13l1.43 1.43l-2.13 2.12z"},null,-1)]))}const S7=pe({name:"mdi-lightbulb-on",render:x7}),C7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function k7(s,e){return m(),A("svg",C7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1)]))}const E7=pe({name:"flat-color-icons-empty-battery",render:k7}),A7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function M7(s,e){return m(),A("svg",A7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#8BC34A",d:"M34 44H14c-1.1 0-2-.9-2-2v-9h24v9c0 1.1-.9 2-2 2"},null,-1)]))}const $7=pe({name:"flat-color-icons-low-battery",render:M7}),P7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function T7(s,e){return m(),A("svg",P7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#8BC34A",d:"M34 44H14c-1.1 0-2-.9-2-2V23h24v19c0 1.1-.9 2-2 2"},null,-1)]))}const R7=pe({name:"flat-color-icons-middle-battery",render:T7}),I7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function O7(s,e){return m(),A("svg",I7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#8BC34A",d:"M34 44H14c-1.1 0-2-.9-2-2V13h24v29c0 1.1-.9 2-2 2"},null,-1)]))}const N7=pe({name:"flat-color-icons-high-battery",render:O7}),F7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function L7(s,e){return m(),A("svg",F7,e[0]||(e[0]=[g("g",{fill:"#8BC34A"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1)]))}const j7=pe({name:"flat-color-icons-full-battery",render:L7}),q7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function D7(s,e){return m(),A("svg",q7,e[0]||(e[0]=[g("g",{fill:"#8BC34A"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#FFEB3B",d:"M30 24h-5.5l2.2-11L18 26h5.5l-2.2 11z"},null,-1)]))}const B7=pe({name:"flat-color-icons-charge-battery",render:D7}),z7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U7(s,e){return m(),A("svg",z7,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.5 20q-2.28 0-3.89-1.57Q1 16.85 1 14.58q0-1.95 1.17-3.48q1.18-1.53 3.08-1.95q.63-2.3 2.5-3.72Q9.63 4 12 4q2.93 0 4.96 2.04Q19 8.07 19 11q1.73.2 2.86 1.5q1.14 1.28 1.14 3q0 1.88-1.31 3.19T18.5 20Z"},null,-1)]))}const V7=pe({name:"mdi-cloud",render:U7}),H7={key:0,class:"flex items-center justify-center h-full"},Q7={key:1},K7={class:"flex flex-col p-4"},Z7={class:"camera-info flex justify-between items-center text-sm"},G7={class:"font-bold"},W7={class:"flex items-center gap-2"},J7={class:"camera-info flex justify-between items-center text-sm"},Y7={class:"font-bold"},X7={class:"flex items-center"},eC={key:0,class:"camera-info flex justify-between items-center text-sm"},tC={class:"font-bold"},sC={class:"flex items-center gap-2"},nC={key:0},rC={key:1,class:"camera-info flex justify-between items-center text-sm"},iC={class:"font-bold"},oC={class:"flex items-center"},aC={key:2,class:"camera-info flex justify-between items-center text-sm"},cC={class:"font-bold"},lC={class:"flex items-center"},uC={key:1},dC={key:2},hC={key:3,class:"camera-info flex justify-between items-center text-sm"},mC={class:"font-bold"},pC={class:"flex items-center"},fC={key:1},gC={key:2},vC={key:4,class:"camera-info flex justify-between items-center text-sm"},_C={class:"font-bold"},yC={class:"flex items-center"},bC={key:1},wC={key:2},xC={key:5,class:"camera-info flex justify-between items-center text-sm"},SC={class:"font-bold"},CC={class:"flex items-center"},kC={key:1},EC={key:2},AC={key:6,class:"camera-info flex justify-between items-center text-sm"},MC={class:"font-bold"},$C={class:"flex items-center"},PC={key:1},TC={key:2},RC=At({__name:"Overview",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=s,{cameraDevice:n,loading:r,latestSnapshotSrc:i}=Wt(t),{cameraObject:o,hasBattery:a,hasLight:l,hasAudioDetector:u,hasDoorbell:d,hasMotionDetector:h,hasObjectDetector:v,hasSiren:f,lightState:b,batteryState:k,motionState:z,objectState:L,audioState:se,doorbellState:K,sirenState:N}=Ll(n),E=ne(()=>r.value);return(O,U)=>{var Se,F,D,Y,Te,He,ht,Mt,Qe,ze;const S=Lr,M=Fl,B=V7,W=B7,I=j7,w=N7,H=R7,J=$7,q=E7,oe=S7,ue=b7;return c(o)?(m(),A("div",Q7,[y(M,{"camera-name":c(o).name,src:c(i),class:"w-full aspect-video bg-black","image-container-class":"w-full h-full"},null,8,["camera-name","src"]),g("div",K7,[g("div",Z7,[g("span",G7,me(O.$t("components.camera_options.name")),1),g("div",W7,[g("span",null,me(c(o).name),1),c(o).isCloud?(m(),j(B,{key:0,class:"w-5 h-5"})):ce("",!0)])]),g("div",J7,[g("span",Y7,me(O.$t("components.camera_options.plugin")),1),g("div",X7,[c(E)?(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"})):ce("",!0),g("span",null,me(((Se=c(o).pluginInfo)==null?void 0:Se.name)??O.$t("components.camera_options.native")),1)])]),c(a)?(m(),A("div",eC,[g("span",tC,me(O.$t("components.camera_options.battery_state")),1),g("div",sC,[c(k)!==void 0?(m(),A("span",nC,me(c(k).level)+"%",1)):ce("",!0),c(k)?c(k).charging?(m(),j(W,{key:2,class:"w-5 h-5"})):c(k).level===100?(m(),j(I,{key:3,class:"w-5 h-5"})):c(k).level>=75?(m(),j(w,{key:4,class:"w-5 h-5"})):c(k).level>=50?(m(),j(H,{key:5,class:"w-5 h-5"})):c(k).level>=25?(m(),j(J,{key:6,class:"w-5 h-5"})):(m(),j(q,{key:7,class:"w-5 h-5"})):(m(),j(S,{key:1,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(l)?(m(),A("div",rC,[g("span",iC,me(O.$t("components.camera_options.light_state")),1),g("div",oC,[c(b)?c(b).state?(m(),j(oe,{key:1,class:"text-yellow-400 w-5 h-5"})):(m(),j(ue,{key:2,class:"text-muted w-5 h-5"})):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(u)?(m(),A("div",aC,[g("span",cC,me(O.$t("components.camera_options.audio_state")),1),g("div",lC,[c(se)?c(se).state||(F=c(se).lastEvent)!=null&&F.state?(m(),A("span",uC,me(c(Bi)(c(se).state?c(se).timestamp:c(se).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",dC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(d)?(m(),A("div",hC,[g("span",mC,me(O.$t("components.camera_options.doorbell_state")),1),g("div",pC,[c(K)?c(K).state||(D=c(K).lastEvent)!=null&&D.state?(m(),A("span",fC,me(c(Bi)(c(K).state?c(K).timestamp:c(K).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",gC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(h)?(m(),A("div",vC,[g("span",_C,me(O.$t("components.camera_options.motion_state")),1),g("div",yC,[c(z)?c(z).state||(Y=c(z).detections)!=null&&Y.length||(Te=c(z).lastEvent)!=null&&Te.state||(ht=(He=c(z).lastEvent)==null?void 0:He.detections)!=null&&ht.length?(m(),A("span",bC,me(c(Bi)(c(z).state||(Mt=c(z).detections)!=null&&Mt.length?c(z).timestamp:c(z).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",wC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(v)?(m(),A("div",xC,[g("span",SC,me(O.$t("components.camera_options.object_state")),1),g("div",CC,[c(L)?c(L).detections.length||(Qe=c(L).lastEvent)!=null&&Qe.detections.length?(m(),A("span",kC,me(c(Bi)(c(L).detections.length?c(L).timestamp:c(L).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",EC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(f)?(m(),A("div",AC,[g("span",MC,me(O.$t("components.camera_options.siren_state")),1),g("div",$C,[c(N)?c(N).state||(ze=c(N).lastEvent)!=null&&ze.state?(m(),A("span",PC,me(c(Bi)(c(N).state?c(N).timestamp:c(N).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",TC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0)])])):(m(),A("div",H7,[y(S,{"stroke-width":"5",class:"w-[30px] h-[30px]"})]))}}}),IC=qs(RC,[["__scopeId","data-v-95baba33"]]),OC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NC(s,e){return m(),A("svg",OC,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},[g("path",{"stroke-width":"3",d:"M5 10h.01M5 16h.01"}),g("path",{"stroke-width":"2",d:"m10 17l4-10m2 10l4-10"})],-1)]))}const FC=pe({name:"humbleicons-url",render:NC}),LC={class:"flex items-center w-full h-[45px] border-b-[1px] border-color px-3"},jC={class:"font-semibold text-lg truncate"},qC=["onClick"],DC={class:"text-xs truncate"},BC={class:"w-full h-full max-h-full overflow-y-scroll"},zC={key:0,class:"flex w-full h-full items-center justify-center mt-5"},UC={key:1,class:"w-full h-full"},VC={key:0,class:"w-full flex items-center justify-center p-4 h-[70px]"},HC=At({__name:"CameraOptions",props:{cameraName:{},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Jn,n=Cn(),{t:r}=js(),i=e,o=s,{cameraName:a,latestSnapshotSrc:l}=Wt(o),u=Vt("formRef"),d=Ls(),h=ae(),v=ae("overview"),f=ae([{name:"overview",icon:zc},{name:"sources",icon:FC},{name:"settings",icon:Sa},{name:"plugins",icon:Uc}]),{data:b,isFetching:k,suspense:z}=t.getCameraQuery(a),{mutate:L,isPending:se}=t.patchCameraQuery(),K=ne(()=>k.value||se.value),N=ne(()=>v.value==="sources"||v.value==="settings");Ge(b,O=>{O&&(h.value=xi(O))},{deep:!0,immediate:!0});const E=async()=>{var U;const O=await((U=u.value)==null?void 0:U.validate());O!=null&&O.valid&&O.values?L({cameraname:a.value,cameraData:O.values}):(n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",O))};return Sn(async()=>{if(await z(),!b.value)return;const O=await Ep();d.value=await O.deviceManager.getCamera(b.value.name)}),Ma(()=>{var O;(O=d.value)==null||O.close()}),(O,U)=>{const S=_o,M=ys,B=F0,W=N0,I=Lr,w=IC,H=v7,J=US,q=V3,oe=Uh,ue=zh,Se=Bh;return m(),A(yt,null,[g("div",LC,[g("span",jC,me(c(a)),1),y(M,{text:"",rounded:"",severity:"secondary",class:"ml-auto cui-icon-md shrink-0",onClick:U[0]||(U[0]=F=>i("close"))},{icon:$(()=>[y(S,{width:"100%",height:"100%"})]),_:1})]),y(c(il),{ref_key:"formRef",ref:u,class:"w-full",style:ot({height:`calc(100% - 45px - ${c(N)?"70px":"0px"})`}),"validation-schema":c(Bx)},{default:$(()=>[y(Se,{value:c(v),"onUpdate:value":U[7]||(U[7]=F=>us(v)?v.value=F:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(W,{class:"justify-between",pt:{tablist:{class:"h-[65px]"},activeBar:{class:"!w-auto"}}},{default:$(()=>[(m(!0),A(yt,null,qt(c(f),(F,D)=>(m(),j(B,{key:D,value:F.name,"as-child":""},{default:$(Y=>[g("div",et({ref_for:!0},Y.a11yAttrs,{class:["flex flex-col items-center justify-center flex-1 content-background !py-3",[{"hover:!text-color active:!text-color focus:!text-color":!Y.active},Y.class]],onClick:Y.onClick}),[(m(),j(Ai(F.icon),{class:"w-5 h-5"})),g("span",DC,me(O.$t(`components.options_sidebar.segment_tab_${F.name}`)),1)],16,qC)]),_:2},1032,["value"]))),128))]),_:1}),y(ue,{class:"p-0 h-[calc(100%-65px)]"},{default:$(()=>[g("div",BC,[(m(!0),A(yt,null,qt(c(f),(F,D)=>(m(),j(oe,{key:D,value:F.name,"as-child":""},{default:$(Y=>[Y.active?(m(),A("div",et({key:0,class:Y.class,ref_for:!0},Y.a11yAttrs),[!c(h)||!c(b)||!c(d)?(m(),A("div",zC,[y(I,{"stroke-width":"5",class:"w-[30px] h-[30px]"})])):(m(),A("div",UC,[c(v)==="overview"?(m(),j(w,{key:0,camera:c(b),"camera-device":c(d),loading:c(K),"latest-snapshot-src":c(l),onClose:U[1]||(U[1]=Te=>i("close"))},null,8,["camera","camera-device","loading","latest-snapshot-src"])):ce("",!0),c(v)==="sources"?(m(),j(H,{key:1,modelValue:c(h),"onUpdate:modelValue":U[2]||(U[2]=Te=>us(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(K),onClose:U[3]||(U[3]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ce("",!0),c(v)==="settings"?(m(),j(J,{key:2,modelValue:c(h),"onUpdate:modelValue":U[4]||(U[4]=Te=>us(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(K),onClose:U[5]||(U[5]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ce("",!0),c(v)==="plugins"?(m(),j(q,{key:3,camera:c(b),"camera-device":c(d),loading:c(K),onClose:U[6]||(U[6]=Te=>i("close"))},null,8,["camera","camera-device","loading"])):ce("",!0)]))],16)):ce("",!0)]),_:2},1032,["value"]))),128))])]),_:1})]),_:1},8,["value"]),c(N)?(m(),A("div",VC,[y(M,{fluid:"",severity:"success",class:"cui-button-medium",label:O.$t("components.form.button.save"),onClick:E},null,8,["label"])])):ce("",!0)]),_:1},8,["style","validation-schema"])],64)}}}),QC={class:"w-full h-full p-safe !pb-0 md:!pl-0"},KC={class:"w-full h-full border-0 md:border-r-[1px] border-color overflow-y-auto pb-safe"},ZC=At({__name:"CuiCameraDrawer",setup(s){const e=qr(),t=kp(),n=t.getEventBus(),r=ae(!1),i=ae(),o=ae(),a=ne(()=>Cp.pt);Ge(e.currentRoute,(u,d)=>{u.path!==d.path&&t.close()});const l=()=>{r.value=!1,t.close()};return Sn(()=>{n.on(u=>{u.type==="open"?(i.value=u.options,o.value=u.props,r.value=!0):u.type==="close"&&(r.value=!1,i.value=void 0)})}),(u,d)=>{const h=HC,v=L0;return m(),j(v,et({visible:c(r),"onUpdate:visible":d[0]||(d[0]=f=>us(r)?r.value=f:null)},c(o),{class:"border-0 md:border-l-[1px]",pt:c(a),onHide:l}),{container:$(({closeCallback:f})=>[g("div",QC,[g("div",KC,[c(i)?(m(),j(h,et({key:0},c(i),{onClose:f}),null,16,["onClose"])):ce("",!0)])])]),_:1},16,["visible","pt"])}}}),GC={class:"loader flex flex-col justify-center items-center"},WC={key:0,class:"absolute flex flex-col items-center justify-center pb-safe bottom-10"},JC={key:0,class:"offline"},YC={key:1,class:"text-center text-white text-sm font-bold mt-2"},XC=At({__name:"CuiLoadingScreen",props:{reload:{type:Boolean,default:!1},height:{default:"200px"},width:{default:"200px"},text:{},icon:{}},setup(s){const e=s,{reload:t,width:n,height:r,text:i,icon:o}=Wt(e);let a,l;const u=()=>{clearInterval(a),clearTimeout(l)};return Sn(()=>{u(),t.value&&(a=setInterval(()=>{const d=document.getElementById("lens");d==null||d.classList.remove("cameraLens");const h=document.getElementById("CameraUI_U");h==null||h.classList.remove("cameraLetter"),l=setTimeout(()=>{d==null||d.classList.add("cameraLens"),h==null||h.classList.add("cameraLetter")},100)},2300))}),vo(()=>{u()}),(d,h)=>(m(),A("div",GC,[y(c($a),{src:c(Fr)("logo_loading_circle.svg"),width:c(n),height:c(r),title:"camera.ui","aria-label":"camera.ui"},null,8,["src","width","height"]),c(o)||c(i)?(m(),A("div",WC,[c(o)?(m(),A("div",JC,[(m(),j(Ai(c(o)),{class:"w-8 h-8 text-primary"}))])):ce("",!0),c(i)?(m(),A("div",YC,me(c(i)),1)):ce("",!0)])):ce("",!0)]))}}),ek=qs(XC,[["__scopeId","data-v-d2a6a09b"]]),tk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sk(s,e){return m(),A("svg",tk,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 3h8l-4 6h4L6 21l4-9H6z"},null,-1)]))}const nk=pe({name:"gridicons-offline",render:sk}),rk={components:{camera_draggable:{no_cameras:"Keine Kameras verfügbar"},camera_events:{no_events:"Keine Ereignisse verfügbar"},camera_options:{advanced:"Erweitert",audio_state:"Audiozustand",battery_state:"Batteriezustand",branding:"Branding",categories:"Kategorien",chip_audioDetection:"Geräuscherkennung",chip_cameraController:"Kamera",chip_hub:"Hub",chip_more:"Mehr",chip_motionDetection:"Bewegungserkennung",chip_objectDetection:"Objekterkennung",chip_plugins:"Plugins",chip_ptz:"PTZ",detection:"Erkennung",doorbell_state:"Türklingelzustand",enabled_extension:"Aktivierte Erweiterung",frame_worker:"Frame Worker",general:"Allgemein",interface:"Interface",light_state:"Lichtzustand",manage_plugins:"Plugins verwalten",model:"Modell",more_plugins:"Mehr Plugins",motion_detection:"Bewegungserkennung",motion_state:"Bewegungszustand",name:"Name",native:"Nativ",no_config:"Keine Konfiguration verfügbar",no_plugins_enabled:"Keine Plugins aktiviert",no_plugins_found:"Keine Plugins gefunden",object_detection:"Objekterkennung",object_state:"Objektzustand",plugin:"Plugin",plugin_settings:"Plugin Einstellungen",recordings:"Aufnahmeeinstellungen",settings:"Einstellungen",siren_state:"Sirenenzustand",source:"Quelle",snapshot:"Snapshot",streaming_mode:"Streaming Modus",unknown:"Unbekannt",zones:"Zonen"},camera_table:{cameras:"Kameras",name:"Name",offline:"Offline",online:"Online",status:"Status"},charts:{no_data:"Keine Daten verfügbar"},detection_interface:{audio_detected:"Audio erkannt",audio_not_detected:"Audio nicht erkannt",audio_required:"Audio Datei erforderlich",detect:"Erkennen",drop_or_select_audio_to_detect:"Audio ablegen oder auswählen, um Geräusche zu erkennen",drop_or_select_image_to_detect_objects:"Bild ablegen oder auswählen, um Objekte zu erkennen",drop_or_select_video_to_detect_motion:"Video ablegen oder auswählen, um Bewegung zu erkennen",file_size_error:"Dateigröße zu groß",image_required:"Image required",interface_config:"Interface-Konfiguration",no_interface_config:"Keine Interface-Konfiguration verfügbar",only_one_audio_allowed:"Es ist nur ein Audio erlaubt",only_one_image_allowed:"Es ist nur ein Bild erlaubt",only_one_video_allowed:"Es ist nur ein Video erlaubt",video_required:"Video required"},dialog:{components:{new_camera:{add_camera:"Kamera hinzufügen",add_camera_description:"Fügen Sie eine Kamera hinzu, die mit Ihrem lokalen Netzwerk verbunden ist",camera:"Kamera",discover_cameras:"Kameras suchen",discover_cameras_description:"Suchen Sie nach Kameras in Ihrem lokalen Netzwerk",no_cameras_found:"Keine Kameras gefunden",protocol_info:"Informationen zum gewählten Protokoll",scan_again:"Erneut scannen",search_camera:"Kamera suchen",source:"Quelle",test_source:"Kameraquelle testen",title:"Neue Kamera",unknown:"Unbekannt"}},message:{confirm_clear_log:"Sind Sie sicher, dass Sie das Protokoll löschen möchten?",confirm_remove:"Sind Sie sicher, dass Sie diese Kamera entfernen möchten?",confirm_remove_layout:"Sind Sie sicher, dass Sie dieses Layout entfernen möchten?",confirm_reset_server:"Sind Sie sicher, dass Sie den Server zurücksetzen möchten?",confirm_restart_go2rtc:"Sind Sie sicher, dass Sie Go2RTC neu starten möchten?",confirm_restart_plugin:"Sind Sie sicher, dass Sie dieses Plugin neu starten möchten?",confirm_restart_server:"Sind Sie sicher, dass Sie den Server neu starten möchten?",confirm_restore:"Sind Sie sicher, dass Sie dieses Backup wiederherstellen möchten?",confirm_uninstall_plugin:"Sind Sie sicher, dass Sie dieses Plugin deinstallieren möchten?",intercom_info:"Sprechen Sie gleichzeitig mit allen Kameras, die eine Sprechanlage haben"},title:{config:"Konfiguration",confirm:"Bestätigen",create_new_user:"Neuer Benuter",edit_dnd:"DND bearbeiten",edit_layout:"Layout bearbeiten",edit_user:"Benutzer bearbeiten",edit_view:"Ansicht bearbeiten",information:"Information",install:"Installieren",install_version:"Version installieren",intercom:"Gegensprechanlage",log:"Log",new_dnd:"Neue DND",new_view:"Neue Ansicht",new_zone:"Neue Zone",plugin_config:"Plugin-Konfiguration",preview:"Vorschau",remove_layout:"Layout entfernen",reset_server:"Server zurücksetzen",restart:"Neustart",result:"Ergebnis",search_plugin:"Plugin suchen",update:"Aktualisieren",unknown:"Unbekannt",zone:"Zone",zone_editor:"Zonen-Editor"}},form:{button:{add:"Hinzufügen",add_source:"Quelle hinzufügen",add_view:"Ansicht hinzufügen",back:"Zurück",cancel:"Abbrechen",change_view:"Ansicht wechseln",clear:"Löschen",close:"Schließen",continue:"Fortfahren",create_new_user:"Neuen Benutzer erstellen",download:"Herunterladen",download_backup_archive:"Backup-Archiv herunterladen",download_cert:"Zertifikat herunterladen",edit:"Bearbeiten",edit_zones:"Zonen bearbeiten",finish:"Fertig",go_to_message:"Zur Nachricht gehen",home:"Startseite",install:"Installieren",login:"Anmelden",logout:"Abmelden",logout_all:"Alle abmelden",manage:"Verwalten",mark_as_read:"Als gelesen markieren",new:"Neu",new_zone:"Neue Zone",next:"Weiter",open_editor:"Editor öffnen",previous:"Zurück",reinstall:"Neu installieren",remove:"Entfernen",reset:"Zurücksetzen",restart:"Neustarten",restore_backup_archive:"Backup-Archiv wiederherstellen",restore_and_restart:"Wiederherstellen und neustarten",save:"Speichern",save_and_restart:"Speichern und neustarten",submit:"Absenden",test_connection:"Verbindung testen",undo:"Rückgängig",uninstall:"Deinstallieren",update:"Aktualisieren",upload:"Hochladen"},error:{no_cameras_selected:"Keine Kameras ausgewählt",no_view_selected:"Keine Ansicht ausgewählt"},hint:{aspect_ratio:"Zwingt das Seitenverhältnis der Kamera auf den gewählten Wert",cache_time:"Zeit in Millisekunden, die der Cache für die Kamerabilder verwendet",confidence:"Die benötigte Konfidenz für die Erkennung eines Objekts",default_settings_page:"Die Standardseite, die beim Öffnen der Einstellungen angezeigt wird",disable_camera:"Deaktiviert die Kamera und stoppt alle Aktivitäten. Die Kamera wird weiterhin angezeigt",frameworker_decoder:"Der Decoder, der für den Frame Worker verwendet wird",frameworker_fps:"Die Anzahl der Frames pro Sekunde, welche für den Frame Worker verwendet werden. '0' verwendet die native Framerate",frameworker_resolution:"Die Auflösung der Kamera, welche für den Frame Worker verwendet wird",hot_mode:"Lässt die Verbindung zur Kamera aktiv, um die Verzögerung zu minimieren",motion_duration:"Zeit in Sekunden, die die Kamera benötigt, um nach einer Bewegungserkennung wieder in den normalen Modus zurückzukehren",navbar_stay_collapsed:"Lässt die Navbar eingeklappt, auch auf größeren Bildschirmen",remember_me:"Erlaubt, dass die Sitzung nicht abläuft",session_timer:"Die Zeit in Millisekunden, bevor die Sitzung abläuft",show_bottombar_on_mobile:"Zeigt die untere Leiste auf Mobilgeräten",show_camera_events:"Zeigt die Kameraereignisse in der Kameraansicht",single_session:"Erlaubt nur eine aktive Sitzung pro Benutzer",streaming_mode:"Stream Transport Protokoll für die Benutzeroberfläche. In 'auto' wird der beste Modus automatisch ausgewählt",streaming_source:"Kameraquelle für den Stream. In 'auto' wird die beste Quelle automatisch ausgewählt",system_preference:"Systemeinstellung für die Benutzeroberfläche",use_for_snapshot:"Verwendet diese Quelle für Snapshots (wenn sonst keine geeignete Quelle existiert)"},label:{actions:"Aktionen",aspect_ratio:"Seitenverhältnis",audio_codec:"Audio-Codec",cache_time:"Cache Zeit",camera:"Kamera",cameras:"Kameras",changelog:"Änderungsprotokoll",classes:"Klassen",color:"Farbe",confidence:"Konfidenz",connections:"Verbindungen",custom_domain:"Benutzerdefinierte Domain",decoder:"Decoder",default_settings_page:"Standard Einstellungsseite",disabled:"Deaktiviert",enabled:"Aktiviert",firmware_version:"Firmware Version",fps:"FPS",frame_worker:"Frame Worker",hardware_version:"Hardware Version",hot_mode:"Hot Modus",language:"Sprache",layout_name:"Layoutname",manufacturer:"Hersteller",model:"Modell",motion_duration:"Bewegungsdauer",name:"Name",navbar_stay_collapsed:"Navbar eingeklappt lassen",new_password:"Neues Passwort",new_password_confirm:"Neues Passwort bestätigen",onvif_url:"ONVIF URL",password:"Passwort",pin:"PIN",plugin_version:"Plugin-Version",recording:"Aufnahme",remember_me:"Erinnere mich",remote_access_mode:"Remote Zugriffsmodus",remove_storage:"Speicher entfernen",resolution:"Auflösung",role:"Rolle",rtsp_url:"RTSP-URL",select_all:"Alle auswählen",select_cameras:"Kameras auswählen",serial_number:"Seriennummer",server_addresses:"Server-Adressen",server_version:"Server-Version",session_timer:"Sitzungstimer",settings:"Einstellungen",show_bottombar_on_mobile:"Bottombar auf Mobilgeräten anzeigen",show_camera_events:"Kameraereignisse anzeigen",single_session:"Einzelne Sitzung",source:"Quelle",source_label:"Quellenbezeichnung",source_name:"Quellenname",source_role:"Quellenrolle",sources:"Quellen",snapshot_url:"Snapshot URL",streaming_mode:"Streaming Modus",streaming_source:"Streaming Quelle",support_url:"Support URL",system_preference:"Systemeinstellung",theme:"Thema",type:"Typ",url:"URL",use_for_snapshot:"Für Snapshot verwenden",username:"Benutzername",version:"Version",video_codec:"Video-Codec",views:"Ansichten",zone_name:"Zonenname"},tooltip:{activity_mode_activity:"Aktivität",activity_mode_always_on:"Immer An",activity_mode_standby:"Standby",clear:"Säubern",contain:"Enthalten",copied:"Kopiert",delete:"Löschen",disable_drag:"Ziehen deaktivieren",disabled:"Deaktiviert",download:"Herunterladen",edit:"Bearbeiten",enable_drag:"Ziehen aktivieren",exclude:"Ausschließen",finish:"Fertig",fullscreen_off:"Vollbildmodus ausschalten",fullscreen_on:"Vollbildmodus einschalten",hide_timeline:"Zeitleiste ausblenden",include:"Einschließen",intercom:"Gegensprechanlage",intersect:"Schneiden",logout:"Abmelden",mode:"Modus",mute:"Stumm",new:"Neu",privacy_mask:"Privatsphärenmaske",public_mask:"Öffentliche Maske",resolution:"Auflösung",restart:"Neustarten",show_timeline:"Zeitleiste anzeigen",source_role_auto:"Auto",source_role_low:"Niedrige Auflösung",source_role_mid:"Mittlere Auflösung",source_role_high:"Hohe Auflösung",source_role_snapshot:"Snapshot",source_role_unknown:"Unbekannt",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unbekannt",streaming_mode_webrtc:"WebRTC ",undo:"Rückgängig",unmute:"Stummschalten aufheben",update_available:"Aktualisierung verfügbar",zoom_in:"Vergrößern",zoom_out:"Verkleinern"}},notification_menu:{clear_notifications:"Benachrichtigungen löschen",debug:"Debug",error:"Fehler",info:"Info",no_notifications:"Keine Benachrichtigungen",notifications:"Benachrichtigungen",short_days:"Tg.",short_hours:"Std.",short_minutes:"Min.",short_months:"M.",short_years:"J.",verbose:"Ausführlich",warn:"Warnung"},options_sidebar:{segment_tab_default:"Standard",segment_tab_overview:"Übersicht",segment_tab_plugins:"Plugins",segment_tab_settings:"Einstellungen",segment_tab_sources:"Quellen"},player:{add_shortcuts:"Shortcuts hinzufügen",activity_mode_activity:"Aktivität",activity_mode_always_on:"Immer An",activity_mode_standby:"Standby",capture_snapshot:"Snapshot aufnehmen",detections:"Erkennungen",hide_shortcuts:"Shortcuts ausblenden",hide_timeline:"Zeitleiste ausblenden",hide_zones:"Zonen ausblenden",live:"Live",log:"Log",ptz:"PTZ",ptz_go_to_home:"Zurück zur Startposition",reconnecting:"Wiederverbinden...",refresh_snapshot:"Snapshot aktualisieren",save_shortcuts:"Shortcuts speichern",settings:"Einstellungen",share_camera:"Kamera teilen",show_shortcuts:"Shortcuts anzeigen",show_timeline:"Zeitleiste anzeigen",show_zones:"Zonen anzeigen",source_role_auto:"Auto",source_role_low:"Niedrige Auflösung",source_role_mid:"Mittlere Auflösung",source_role_high:"Hohe Auflösung",source_role_snapshot:"Snapshot",source_role_unknown:"Unbekannt",stream_paused:"Stream pausiert, um Ressourcen zu schonen. Klicken Sie auf den Stream, um fortzufahren.",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unbekannt",streaming_mode_webrtc:"WebRTC ",zoom_in:"Zoom rein",zoom_out:"Zoom raus"},plugin_card:{author:"Autor",installed:"Installiert",no_description:"Keine Beschreibung verfügbar",restart:"Neustart",select_version:"Version auswählen",settings:"Einstellungen",start:"Start",status_disabled:"Deaktiviert",status_error:"Fehler",status_ready:"Bereit",status_started:"Gestartet",status_starting:"Startet",status_stopped:"Gestoppt",status_unknown:"Unbekannt",stop:"Stop",uninstall:"Deinstallieren",update:"Aktualisieren",update_available:"Aktualisierung verfügbar",updated:"Aktualisiert",version:"Version"},plugin_search:{plugins:"Plugins",refresh:"Aktualisieren"},plugin_types:{hub:"Hub",cameraController:"Kamera-Controller",motionDetection:"Bewegungserkennung",objectDetection:"Objekterkennung",audioDetection:"Geräuscherkennung",ptz:"PTZ"},process_table:{status_error:"Fehler",status_ready:"Bereit",status_started:"Gestartet",status_starting:"Startet",status_stopped:"Gestoppt",status_stopping:"Stoppt",status_unknown:"Unbekannt",system:"System",title_cpu:"CPU",title_cpu_load:"CPU-Auslastung",title_memory:"Speicher",title_memory_load:"Speicherauslastung",title_name:"Name",title_pid:"PID"},timeline:{live:"Live"},topbar:{syncing_data:"Daten synchronisieren..."},toast:{backup_downloaded:"Backup-Datei erfolgreich heruntergeladen",backup_restored:"Backup-Datei erfolgreich wiederhergestellt",camera_added:"Kamera erfolgreich hinzugefügt",camera_removed:"Kamera erfolgreich entfernt",camera_updated:"Kamera erfolgreich aktualisiert",cameras_removed:"Kameras erfolgreich entfernt",config_deleted:"Konfiguration erfolgreich gelöscht",config_go2rtc_deleted:"Go2RTC-Konfiguration erfolgreich gelöscht",config_go2rtc_updated:"Go2RTC-Konfiguration erfolgreich aktualisiert",config_updated:"Konfiguration erfolgreich aktualisiert",error_see_console:"Fehler, siehe Konsole",frame_worker_restarted:"Frame Worker erfolgreich neugestartet",go2rtc_restarted:"Go2RTC erfolgreich neugestartet",log_cleared:"Log erfolgreich gelöscht",no_version_selected:"Keine Version ausgewählt",plugin_config_updated:"Plugin-Konfiguration erfolgreich aktualisiert",plugin_disabled:"Plugin erfolgreich deaktiviert",plugin_enabled:"Plugin erfolgreich aktiviert",plugin_installed:"Plugin erfolgreich installiert",plugin_removed:"Plugin erfolgreich entfernt",plugin_request_sent:"Plugin-Anfrage erfolgreich gesendet",plugin_restarted:"Plugin erfolgreich neugestartet",plugin_settings_updated:"Plugin-Einstellungen erfolgreich aktualisiert",plugin_started:"Plugin erfolgreich gestartet",plugin_stopped:"Plugin erfolgreich gestoppt",plugins_removed:"Plugins erfolgreich entfernt",profile_updated:"Profil erfolgreich aktualisiert",server_resetted:"Server erfolgreich zurückgesetzt",server_restarted:"Server erfolgreich neugestartet",server_updated:"Server erfolgreich aktualisiert",title_error:"Fehler",title_info:"Info",title_success:"Erfolgreich",title_warn:"Warnung",user_added:"Benutzer erfolgreich hinzugefügt",user_logged_out:"Benutzer erfolgreich abgemeldet",user_removed:"Benutzer erfolgreich entfernt",user_updated:"Benutzer erfolgreich aktualisiert",users_removed:"Benutzer erfolgreich entfernt",view_added:"Ansicht erfolgreich hinzugefügt",validation_failed:"Validierung fehlgeschlagen. Überprüfen Sie die Konsole für weitere Informationen",view_removed:"Ansicht erfolgreich entfernt",view_updated:"Ansicht erfolgreich aktualisiert",views_removed:"Ansichten erfolgreich entfernt",zone_updated:"Zone erfolgreich aktualisiert",zone_removed:"Zone erfolgreich entfernt"},upload_files:{drop_or_select_file:"Datei ablegen oder auswählen",only_one_file_allowed:"Es ist nur eine Datei erlaubt"},user_menu:{account:"Konto",admin_panel:"Admin Panel",config:"Konfiguration",console:"Logs",logout:"Abmelden",plugins:"Plugins",reload:"Neu laden"},user_table:{title_address:"Adresse",title_device:"Gerät",title_username:"Benutzername",you:"Du"},view_box:{available_streams:"Verfügbare Streams"},zone_editor:{edit_zones:"Zonen bearbeiten",zone:"Zone"}},general:{loading:"Laden...",role_admin:"Admin",role_user:"Benutzer"},navigation:{account:"Konto",adminpanel:"Admin-Panel",appearance:"Erscheinungsbild",backup:"Backup",cameras:"Kameras",cammesh:"Cammesh",camview:"Kameransicht",config:"Konfiguration",console:"Logs",extras:"Extras",nvr:"NVR",plugins:"Plugins",recordings:"Aufnahmen",remote:"Remote Zugriff",settings:"Einstellungen",system:"System",user:"Benutzer"},navigation_description:{account_description:"Verwalten Sie Kontoeinstellungen und Erfahrungen.",appearance_description:"Verwalten Sie das Erscheinungsbild und die Benutzeroberfläche der App.",backup_description:"Verwalten, planen Sie Backups und stellen Sie Daten wieder her.",nvr_description:"Verwalten Sie das Netzwerk-Videorekorder-System.",recordings_description:"Verwalten Sie Aufnahmen und Speicheroptionen.",remote_access_description:"Verwalten Sie den Remote-Zugriff und die Verbindungseinstellungen.",system_description:"Verwalten Sie das System, überwachen Sie den Status und die Aufgaben.",user_description:"Verwalten Sie Benutzer, Rollen und Berechtigungen."},views:{404:{error_message:"Wir haben überall gesucht, aber diese Seite scheint Verstecken zu spielen... und sie gewinnt! Lass uns dich zurück an einen Ort bringen, der existiert."},adminpanel:{core:"Core",frameworker:"Frameworker",general:"Allgemein",logged_in_users:"Derzeit angemeldete Benutzer",plugins:"Plugins",title:"Admin Panel"},camera:{detections:"Erkennungen",timeline:"Zeitleiste",title:"Kamera"},cameras:{add_camera:"Kamera hinzufügen",events:"Ereignisse",new_camera:"Neue Kamera",no_cameras:"Keine Kameras verfügbar",title:"Kameras"},cammesh:{title:"Cammesh"},camview:{all_cameras:"Alle Kameras",cameras:"Kameras",new_dnd:"Neue DND",new_view:"Neue Ansicht",no_dnds_configured:"Keine DNDs konfiguriert",no_views_configured:"Keine Ansichten konfiguriert",title:"Camview"},config:{title:"Konfiguration"},console:{title:"Logs"},firststeps:{complete:"Fertig",enjoy:"Viel Spaß!",finish_message:"Sie haben die ersten Schritte erfolgreich abgeschlossen. Sie können nun die Anwendung nutzen.",from_backup:"Aus Backup wiederherstellen",new_installation:"Neue Installation",slogan:"Die moderne Lösung für professionelle Videoüberwachung.",start:"Start",start_message:"Bitte wählen Sie, ob Sie eine neue Installation starten oder ein Backup wiederherstellen möchten.",step_account:"Konto",step_appearance:"Erscheinungsbild",step_finish:"Fertig",step_welcome:"Willkommen",title:"Erste Schritte",welcome_to:"Willkommen bei"},login:{title:"Anmelden"},plugin:{changelog:"Änderungsprotokoll",disabled_info:"Plugin ist deaktiviert",no_cameras:"Keine Kamera verfügbar",no_changelog:"Kein Änderungsprotokoll verfügbar",no_readme:"Keine Leseanleitung verfügbar",plugin_is_disabled:"Plugin ist deaktiviert",readme:"Leseanleitung",segment_tab_cameras:"Kameras",segment_tab_interface:"Interface",segment_tab_plugins:"Plugins",segment_tab_settings:"Einstellungen",settings:"Einstellungen",title:"Plugin"},plugins:{no_plugins:"Keine Plugins verfügbar",search_plugins:"Plugins suchen",title:"Plugins"},recordings:{title:"Aufnahmen"},settings:{app:"App",available_updates:"Verfügbare Aktualisierungen",available_updates_info:"Es sind Aktualisierungen für camera.ui verfügbar.",certificate:"Zertifikat",certificate_info:"Laden Sie hier das SSL-Zertifikat der Webseite herunter. Durch das Hinzufügen dieses Zertifikats zu Ihrem Keychain oder Ihrer Zertifikatsverwaltung wird die Seite als sicher erkannt. Dies verbessert die Browsererfahrung und vermeidet Sicherheitswarnungen.",connection:"Verbindung",create_backup:"Backup erstellen",create_backup_info:"Laden Sie ein Sicherungsarchiv Ihrere gesamten camera.ui Umgebung herunter. Dadurch wird der Inhalt Ihres camera.ui Speicherungsverzeichnisses gesichert. Diesen können Sie später auf jeder Plattform wiederherstellen auf der camera.ui läuft.",edit:"Bearbeiten",interface:"Interface",locale:"Sprache",network:"Netzwerk",network_info:"Konfigurieren Sie hier die IP-Adressen, die der Server für die WebRTC-Kommunikation mit den Kameras verwendet. Diese Einstellung ermöglicht eine stabile und effiziente Verbindung zwischen Ihrem System und den angeschlossenen Kameras.",not_available_updates_info:"Ihre camera.ui Version ist auf dem neuesten Stand.",password:"Passwort",profile:"Profil",registered_users:"Registrierte Benutzer",remote_access_info:"Konfigurieren Sie hier die Remote-Zugriffseinstellungen. Diese Einstellungen ermöglichen es Ihnen, von überall auf Ihre camera.ui Umgebung zuzugreifen.",remote_access_settings:"Remote Zugriff Einstellungen",remove:"Entfernen",reset_server:"Server zurücksetzen",reset_server_info:"Durch Klicken auf diesen Button setzen Sie die Konfiguration auf die Standardwerte zurück. Dies entfernt alle Ihre Einstellungen und Daten. Diese Aktion kann nicht rückgängig gemacht werden.",restart_server:"Server neustarten",restart_server_info:"Durch Klicken auf diesen Button starten Sie den Server neu. Ein Ladebildschirm wird angezeigt, bis der Neustart abgeschlossen ist. Anschließend wird die Seite automatisch aktualisiert und steht Ihnen wieder zur Verfügung.",restore_backup:"Backup wiederherstellen",restore_backup_info:"Stellen Sie ein Sicherungsarchiv wieder her, das Sie zuvor mit camera.ui erstellt haben. Ihre camera.ui Konfiguration, Datenbank, Benutzerkonten und Medien werden wiederhergestellt.",search_by_name:"Nach Namen suchen",searching_updates:"Suche nach Aktualisierungen...",server:"Server",sheduled_backup:"Geplantes Backup",sheduled_backup_info:"Planen Sie ein Backup der aktuellen Konfiguration",status:"Status",theme:"Thema",title:"Einstellungen",title_account:"Konto",title_appearance:"Erscheinungsbild",title_backup:"Backup",title_go2rtc:"Go2RTC",title_remote:"Remote Zugriff",title_nvr:"NVR",title_recordings:"Aufnahmen",title_system:"System",title_user:"Benutzer",unknown:"Unbekannt",update_available:"Aktualisierung verfügbar",version:"Version"}}},ik={components:{camera_draggable:{no_cameras:"No cameras available"},camera_events:{no_events:"No events available"},camera_options:{advanced:"Advanced",audio_state:"Audio state",battery_state:"Battery state",branding:"Branding",categories:"Categories",chip_audioDetection:"Audio detection",chip_cameraController:"Camera",chip_hub:"Hub",chip_more:"More",chip_motionDetection:"Motion detection",chip_objectDetection:"Object detection",chip_plugins:"Plugins",chip_ptz:"PTZ",detection:"Detection",doorbell_state:"Doorbell state",enabled_extension:"Enabled extension",frame_worker:"Frame Worker",general:"General",interface:"Interface",light_state:"Light state",manage_plugins:"Manage plugins",model:"Model",more_plugins:"More plugins",motion_detection:"Motion detection",motion_state:"Motion state",name:"Name",native:"Native",no_config:"No configuration available",no_plugins_enabled:"No plugins enabled",no_plugins_found:"No plugins found",object_detection:"Object detection",object_state:"Object state",plugin:"Plugin",plugin_settings:"Plugin settings",recordings:"Recordings",settings:"Settings",siren_state:"Siren state",source:"Source",snapshot:"Snapshot",streaming_mode:"Streaming mode",unknown:"Unknown",zones:"Zones"},camera_table:{cameras:"Cameras",name:"Name",offline:"Offline",online:"Online",status:"Status"},charts:{no_data:"No data available"},detection_interface:{audio_detected:"Audio detected",audio_not_detected:"Audio not detected",audio_required:"Audio required",detect:"Detect",drop_or_select_audio_to_detect:"Drop or select audio to detect",drop_or_select_image_to_detect_objects:"Drop or select image to detect objects",drop_or_select_video_to_detect_motion:"Drop or select video to detect motion",file_size_error:"File size error",image_required:"Image required",interface_config:"Interface configuration",no_interface_config:"No interface configuration available",only_one_audio_allowed:"Es ist nur ein Audio erlaubt",only_one_image_allowed:"Only one image allowed",only_one_video_allowed:"Only one video allowed",video_required:"Video required"},dialog:{components:{new_camera:{add_camera:"Add camera",add_camera_description:"Add a camera connected to your local network",camera:"Camera",discover_cameras:"Discover cameras",discover_cameras_description:"Search for cameras in your local network",no_cameras_found:"No cameras found",protocol_info:"Information about the selected protocol",scan_again:"Scan again",search_camera:"Search camera",source:"Source",test_source:"Test camera source",title:"New camera",unknown:"Unknown"}},message:{confirm_clear_log:"Are you sure you want to clear the log?",confirm_remove:"Are you sure you want to remove this camera?",confirm_remove_layout:"Are you sure you want to remove this layout?",confirm_reset_server:"Are you sure you want to reset the server?",confirm_restart_go2rtc:"Are you sure you want to restart the Go2RTC?",confirm_restart_plugin:"Are you sure you want to restart this plugin?",confirm_restart_server:"Are you sure you want to restart the server?",confirm_restore:"Are you sure you want to restore this backup?",confirm_uninstall_plugin:"Are you sure you want to uninstall this plugin?",intercom_info:"Speak simultaneously to all cameras that have intercom"},title:{config:"Configuration",confirm:"Confirm",create_new_user:"New user",edit_dnd:"Edit DND",edit_layout:"Edit layout",edit_user:"Edit user",edit_view:"Edit view",information:"Information",install:"Install",install_version:"Install version",intercom:"Intercom",log:"Log",new_dnd:"New DND",new_view:"New view",new_zone:"New zone",plugin_config:"Plugin config",preview:"Preview",remove_layout:"Remove layout",reset_server:"Reset server",restart:"Restart",result:"Result",search_plugin:"Search plugin",update:"Update",unknown:"Unknown",zone:"Zone",zone_editor:"Zone editor"}},form:{button:{add:"Add",add_source:"Add source",add_view:"Add view",back:"Back",cancel:"Cancel",change_view:"Change view",clear:"Clear",close:"Close",continue:"Continue",create_new_user:"Create new user",download:"Download",download_backup_archive:"Download backup archive",download_cert:"Download certificate",edit:"Edit",edit_zones:"Edit zones",finish:"Finish",go_to_message:"Go to message",home:"Home",install:"Install",login:"Login",logout:"Logout",logout_all:"Logout all",manage:"Manage",mark_as_read:"Mark as read",new:"New",new_zone:"New zone",next:"Next",open_editor:"Open editor",previous:"Previous",reinstall:"Reinstall",remove:"Remove",reset:"Reset",restart:"Restart",restore_backup_archive:"Restore backup archive",restore_and_restart:"Restore and restart",save:"Save",save_and_restart:"Save and restart",submit:"Submit",test_connection:"Test connection",update:"Update",undo:"Undo",uninstall:"Uninstall",upload:"Upload"},error:{no_cameras_selected:"No cameras selected",no_view_selected:"No view selected"},hint:{aspect_ratio:"Forces the camera aspect ratio to the selected value",cache_time:"Time in milliseconds used for the camera image cache",confidence:"The required confidence level for object detection",default_settings_page:"The default page shown when opening settings",disable_camera:"Deactivates the camera and stops all activities. The camera will still be displayed",frameworker_decoder:"The decoder used for the frame worker",frameworker_fps:"The number of frames per second used for the frame worker. '0' uses the native frame rate",frameworker_resolution:"The camera resolution used for the frame worker",hot_mode:"Keeps the connection to the camera active to minimize delay",motion_duration:"Time in seconds the camera needs to return to normal mode after motion detection",navbar_stay_collapsed:"Keeps the navbar collapsed, even on larger screens",remember_me:"Allows the session not to expire",session_timer:"Time in milliseconds before the session expires",show_bottombar_on_mobile:"Shows the bottom bar on mobile devices",show_camera_events:"Shows camera events in the camera view",single_session:"Allows only one active session per user",streaming_mode:"Stream transport protocol for the user interface. In 'auto' mode, the best mode is automatically selected",streaming_source:"Camera source for the stream. In 'auto' mode, the best source is automatically selected",system_preference:"System setting for the user interface",use_for_snapshot:"Uses this source for snapshots (if no other suitable source exists)"},label:{actions:"Actions",aspect_ratio:"Aspect ratio",audio_codec:"Audio codec",cache_time:"Cache time",camera:"Camera",cameras:"Cameras",changelog:"Changelog",classes:"Classes",color:"Color",confidence:"Confidence",connections:"Connections",custom_domain:"Custom domain",decoder:"Decoder",default_settings_page:"Default Settings page",disabled:"Disabled",enabled:"Enabled",firmware_version:"Firmware version",fps:"FPS",frame_worker:"Frame Worker",hardware_version:"Hardware version",hot_mode:"Hot mode",language:"Language",layout_name:"Layout name",manufacturer:"Manufacturer",model:"Model",motion_duration:"Motion duration",name:"Name",navbar_stay_collapsed:"Stay navbar collapsed",new_password:"New password",new_password_confirm:"Confirm new password",onvif_url:"ONVIF URL",password:"Password",pin:"PIN",plugin_version:"Plugin version",recording:"Recording",remember_me:"Remember me",remote_access_mode:"Remote access mode",remove_storage:"Remove storage",resolution:"Resolution",role:"Role",rtsp_url:"RTSP URL",select_all:"Select all",select_cameras:"Select cameras",serial_number:"Serial number",server_addresses:"Server addresses",server_version:"Server version",session_timer:"Session timer",settings:"Settings",show_bottombar_on_mobile:"Show bottombar on mobile",show_camera_events:"Show camera events",single_session:"Single Session",source:"Source",source_label:"Source label",source_name:"Source name",source_role:"Source role",sources:"Sources",snapshot_url:"Snapshot URL",streaming_mode:"Streaming mode",streaming_source:"Streaming source",support_url:"Support URL",system_preference:"System preference",theme:"Theme",type:"Type",url:"URL",use_for_snapshot:"Use for snapshot",username:"Username",version:"Version",video_codec:"Video codec",views:"Views",zone_name:"Zone name"},tooltip:{activity_mode_activity:"Activity",activity_mode_always_on:"Always On",activity_mode_standby:"Standby",clear:"Clear",contain:"Contain",copied:"Copied",delete:"Delete",disable_drag:"Disable drag",disabled:"Disabled",download:"Download",edit:"Edit",enable_drag:"Enable drag",exclude:"Exclude",finish:"Finish",fullscreen_off:"Fullscreen off",fullscreen_on:"Fullscreen on",hide_timeline:"Hide timeline",include:"Include",intercom:"Intercom",intersect:"Intersect",logout:"Logout",mode:"Mode",mute:"Mute",new:"New",privacy_mask:"Privacy mask",public_mask:"Public mask",resolution:"Resolution",restart:"Restart",show_timeline:"Show timeline",source_role_auto:"Auto",source_role_low:"Low Resolution",source_role_mid:"Mid Resolution",source_role_high:"High Resolution",source_role_snapshot:"Snapshot",source_role_unknown:"Unknown",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unknown",streaming_mode_webrtc:"WebRTC ",undo:"Undo",unmute:"Unmute",update_available:"Update available",zoom_in:"Zoom in",zoom_out:"Zoom out"}},notification_menu:{clear_notifications:"Clear notifications",debug:"Debug",error:"Error",info:"Info",no_notifications:"No notifications",notifications:"Notifications",short_days:"d",short_hours:"hr",short_minutes:"min",short_months:"mo",short_years:"yr",verbose:"Verbose",warn:"Warning"},options_sidebar:{segment_tab_default:"Default",segment_tab_overview:"Overview",segment_tab_plugins:"Plugins",segment_tab_settings:"Settings",segment_tab_sources:"Sources"},player:{add_shortcuts:"Add shortcuts",capture_snapshot:"Capture snapshot",activity_mode_activity:"Activity",activity_mode_always_on:"Always On",activity_mode_standby:"Standby",detections:"Detections",hide_shortcuts:"Hide shortcuts",hide_timeline:"Hide timeline",hide_zones:"Hide zones",live:"Live",log:"Log",ptz:"PTZ",ptz_go_to_home:"Go to home",reconnecting:"Reconnecting...",refresh_snapshot:"Refresh snapshot",save_shortcuts:"Save shortcuts",settings:"Settings",share_camera:"Share Camera",show_shortcuts:"Show shortcuts",show_timeline:"Show timeline",show_zones:"Show zones",source_role_auto:"Auto",source_role_low:"Low Resolution",source_role_mid:"Mid Resolution",source_role_high:"High Resolution",source_role_snapshot:"Snapshot",source_role_unknown:"Unknown",stream_paused:"Stream paused to conserve resources. Click on stream to resume.",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unknown",streaming_mode_webrtc:"WebRTC ",zoom_in:"Zoom in",zoom_out:"Zoom out"},plugin_card:{author:"Author",installed:"Installed",no_description:"No description available",restart:"Restart",select_version:"Select version",settings:"Settings",start:"Start",status_disabled:"Disabled",status_error:"Error",status_ready:"Ready",status_started:"Started",status_starting:"Starting",status_stopped:"Stopped",status_unknown:"Unknown",stop:"Stop",uninstall:"Uninstall",update:"Update",update_available:"Update available",updated:"Updated",version:"Version"},plugin_search:{plugins:"Plugins",refresh:"Refresh"},plugin_types:{hub:"Hub",cameraController:"Camera Controller",motionDetection:"Motion Detection",objectDetection:"Object Detection",audioDetection:"Audio Detection",ptz:"PTZ"},process_table:{status_error:"Error",status_ready:"Ready",status_started:"Started",status_starting:"Starting",status_stopped:"Stopped",status_stopping:"Stopping",status_unknown:"Unknown",system:"System",title_cpu:"CPU",title_cpu_load:"CPU load",title_memory:"Memory",title_memory_load:"Memory load",title_name:"Name",title_pid:"PID"},timeline:{live:"Live"},topbar:{syncing_data:"Syncing data..."},toast:{backup_downloaded:"Backup file download successfully",backup_restored:"Backup file restored successfully",camera_added:"Camera added successfully",camera_removed:"Camera removed successfully",camera_updated:"Camera updated successfully",cameras_removed:"Cameras removed successfully",config_deleted:"Configuration deleted successfully",config_go2rtc_deleted:"Go2RTC configuration deleted successfully",config_go2rtc_updated:"Go2RTC configuration updated successfully",config_updated:"Configuration updated successfully",error_see_console:"Error, see console",frame_worker_restarted:"Frame worker restarted successfully",go2rtc_restarted:"Go2RTC restarted successfully",log_cleared:"Log cleared successfully",no_version_selected:"No version selected",plugin_config_updated:"Plugin configuration updated successfully",plugin_disabled:"Plugin disabled successfully",plugin_enabled:"Plugin enabled successfully",plugin_installed:"Plugin installed successfully",plugin_removed:"Plugin removed successfully",plugin_request_sent:"Plugin request send successfully",plugin_restarted:"Plugin restarted successfully",plugin_settings_updated:"Plugin settings updated successfully",plugin_started:"Plugin started successfully",plugin_stopped:"Plugin stopped successfully",plugins_removed:"Plugins removed successfully",profile_updated:"Profile updated successfully",server_resetted:"Server resetted successfully",server_restarted:"Server restarted successfully",server_updated:"Server updated successfully",title_error:"Error",title_info:"Info",title_success:"Success",title_warn:"Warning",user_added:"User added successfully",user_logged_out:"User logged out successfully",user_removed:"User removed successfully",user_updated:"User updated successfully",users_removed:"Users removed successfully",validation_failed:"Validation failed. Check console for more information",view_added:"View added successfully",view_removed:"View removed successfully",view_updated:"View updated successfully",views_removed:"Views removed successfully",zone_updated:"Zone updated successfully",zone_removed:"Zone removed successfully"},upload_files:{drop_or_select_file:"Drop or select file",only_one_file_allowed:"Only one file allowed"},user_menu:{account:"Account",admin_panel:"Adminpanel",config:"Configuration",console:"Logs",logout:"Logout",plugins:"Plugins",reload:"Reload"},user_table:{title_address:"Address",title_device:"Device",title_username:"Username",you:"You"},view_box:{available_streams:"Available streams"},zone_editor:{edit_zones:"Zonen bearbeiten",zone:"Zone"}},general:{loading:"Loading...",role_admin:"Admin",role_user:"User"},navigation:{account:"Account",adminpanel:"Adminpanel",appearance:"Appearance",backup:"Backup",cameras:"Cameras",cammesh:"Cammesh",camview:"Camview",config:"Configuration",console:"Logs",extras:"Extras",nvr:"NVR",plugins:"Plugins",recordings:"Recordings",remote:"Remote Access",settings:"Settings",system:"System",user:"Users"},navigation_description:{account_description:"Manage account settings & experience.",appearance_description:"Manage app appearance & interface.",backup_description:"Manage, schedule backups & restore data.",nvr_description:"Manage Network Video Recorder system.",recordings_description:"Manage recordings & storage options.",remote_access_description:"Manage remote access and connection settings.",system_description:"Manage system, monitor status & tasks.",user_description:"Manage users, roles & permissions."},views:{404:{error_message:"We've looked everywhere, but this page seems to be playing hide and seek... and it's winning! Let's get you back to somewhere that exists."},adminpanel:{core:"Core",frameworker:"Frameworker",general:"General",logged_in_users:"Logged in users",plugins:"Plugins",title:"Adminpanel"},camera:{detections:"Detections",timeline:"Timeline",title:"Camera"},cameras:{add_camera:"Add camera",events:"Events",new_camera:"New camera",no_cameras:"No cameras available",title:"Cameras"},cammesh:{title:"Cammesh"},camview:{all_cameras:"All cameras",cameras:"Cameras",new_dnd:"New DND",new_view:"New View",no_dnds_configured:"No DNDs configured",no_views_configured:"No views configured",title:"Camview"},config:{title:"Configuration"},console:{title:"Logs"},firststeps:{complete:"Complete",enjoy:"Enjoy!",finish_message:"You have successfully completed the first steps. You can now start using the application.",from_backup:"Restore from Backup",new_installation:"New Installation",slogan:"The modern solution for professional video surveillance.",start:"Start",start_message:"Please choose whether you want to start a new installation or restore from a backup.",step_account:"Account",step_appearance:"Appearance",step_finish:"Finish",step_welcome:"Welcome",title:"First steps",welcome_to:"Welcome to"},login:{title:"Login"},plugin:{changelog:"Changelog",disabled_info:"Plugin is disabled",no_cameras:"No cameras available",no_changelog:"No changelog available",no_readme:"No readme available",plugin_is_disabled:"Plugin is disabled",readme:"Readme",segment_tab_cameras:"Cameras",segment_tab_interface:"Interface",segment_tab_plugins:"Plugins",segment_tab_settings:"Settings",settings:"Settings",title:"Plugin"},plugins:{no_plugins:"No plugins available",search_plugins:"Search plugins",title:"Plugins"},recordings:{title:"Recordings"},settings:{app:"App",available_updates:"Available updates",available_updates_info:"Updates are available for camera.ui.",certificate:"Certificate",certificate_info:"Download the SSL certificate of the website here. By adding this certificate to your keychain or certificate management, the site is recognized as secure. This improves the browser experience and avoids security warnings.",connection:"Connection",create_backup:"Create backup",create_backup_info:"Create a backup of the current configuration. Download a backup archive of your entire camera.ui environment. This will backup the contents of your camera.ui storage directory. You can restore this later on any platform where camera.ui is running.",edit:"Edit",interface:"Interface",locale:"Locale",network:"Network",network_info:"Configure here the IP addresses the server uses for WebRTC communication with the cameras. This setting allows for a stable and efficient connection between your system and the connected cameras.",not_available_updates_info:"You are using the latest version of camera.ui",password:"Password",profile:"Profile",registered_users:"Registered users",remote_access_info:"Configure the remote access settings here. These settings allow you to access your camera.ui environment from anywhere.",remote_access_settings:"Remote access settings",remove:"Remove",reset_server:"Reset server",reset_server_info:"By clicking this button you reset the configuration to the default values. This removes all your settings and data. This action cannot be undone.",restart_server:"Restart server",restart_server_info:"By clicking this button you restart the server. A loading screen will be displayed until the restart is complete. The page will then be automatically refreshed and available to you again.",restore_backup:"Restore backup",restore_backup_info:"Restore a backup archive you previously created with camera.ui. Your camera.ui configuration, database, user accounts, and media will be restored.",search_by_name:"Search by name",searching_updates:"Searching for updates...",server:"Server",sheduled_backup:"Sheduled backup",sheduled_backup_info:"Shedule a backup of the current configuration",status:"Status",theme:"Theme",title:"Settings",title_account:"Account",title_appearance:"Appearance",title_backup:"Backup",title_go2rtc:"Go2RTC",title_nvr:"NVR",title_recordings:"Recordings",title_remote:"Remote Access",title_system:"System",title_user:"User",unknown:"Unknown",update_available:"Update available",version:"Version"}}},ok={de:rk,en:ik},ak=["af","ar","ar-ae","ar-bh","ar-dz","ar-eg","ar-iq","ar-jo","ar-kw","ar-lb","ar-ly","ar-ma","ar-om","ar-qa","ar-sa","ar-sy","ar-tn","ar-ye","as","ast","az","be","bg","bn","br","bs","ca","ce","ch","co","cr","cs","cv","cy","da","de","de-at","de-ch","de-de","de-li","de-lu","el","en","en-au","en-bz","en-ca","en-gb","en-ie","en-jm","en-nz","en-ph","en-tt","en-us","en-za","en-zw","eo","es","es-ar","es-bo","es-cl","es-co","es-cr","es-do","es-ec","es-es","es-gt","es-hn","es-mx","es-ni","es-pa","es-pe","es-pr","es-py","es-sv","es-uy","es-ve","et","eu","fa","fa-ir","fi","fj","fo","fr","fr-be","fr-ca","fr-ch","fr-fr","fr-lu","fr-mc","fur","fy","ga","gd","gd-ie","gl","gu","he","hi","hr","hsb","ht","hu","hy","id","is","it","it-ch","iu","ja","ji","ka","kk","km","kn","ko","ko-kp","ko-kr","ks","ky","la","lb","lt","lv","mi","mk","ml","mo","mr","ms","mt","my","nb","ne","ng","nl","nl-be","nn","no","nv","oc","om","or","pa","pa-in","pa-pk","pl","pt","pt-br","qu","rm","ro","ro-mo","ru","ru-mo","sa","sb","sc","sd","sg","si","sk","sl","so","sq","sr","sv","sv-fi","sv-sv","sw","sx","sz","ta","te","th","tig","tk","tlh","tn","tr","ts","tt","uk","ur","ve","vi","vo","wa","xh","zh","zh-cn","zh-hk","zh-sg","zh-tw","zu"],Ca="en",Mp=["de","en"],ck=s=>{var t;const e=n=>lk(ak.find(r=>r===(n==null?void 0:n.toLowerCase())));return(t=window.navigator)!=null&&t.language?e(window.navigator.language):e("en")},lk=s=>{if(!s)return Ca;switch(s){case Mp.find(e=>e===s):return s;default:return Ca}},uk=df({locale:ck(),fallbackLocale:Ca,legacy:!1,globalInjection:!0,messages:ok}),dk={de:Mf,en:Af},hk=Mi("locale",()=>{const s=tl("locale",Ca),e=ae(Mp),t=$f(),n=js();Ge(s,o=>{r(o),i(o)});const r=o=>{var a;(a=window.electron)==null||a.send("change-language",o),n.locale.value=o},i=async o=>{const a=dk[o];a&&(t.config.locale=a)};return r(s.value),i(s.value),{languages:e,locale:s,setI18Nlocale:r,setPrimeVueLocale:i}}),mk={key:1},pk=At({__name:"App",setup(s){const{navbarState:e,subbarState:t,showBottombar:n,showNavbar:r,showTopbar:i}=ja(),o=Ci(),a=$i(),l=qr(),u=Cn(),d=Nl(),h=hp(),v=Fs(),f=Pl(),{mdBreakpoint:b}=Vr(),{isPWA:k}=Ol(),{t:z}=js();hk();const{theme:L}=Vs(d),{routerLoading:se}=Vs(h),{isLoggedIn:K}=Vs(v),{isConnected:N}=Vs(f),E=Vt("navbarRef"),O=Vt("topbarRef"),U=Vt("bottombarRef"),S=ae(!0),M=ae(!0),B=Ls(),W=ae(!1),I=ae(!1),w=ri(E),H=ri(O),J=ri(U);o.setDefaultOptions({queries:{refetchOnWindowFocus:!1,gcTime:5*60*1e3,staleTime:1e4,networkMode:"always",retry:(F,D)=>{var Y,Te,He;if(D instanceof uf&&((Y=D.response)==null?void 0:Y.status)===401)return Fs().logout(),!1;if(F===0){const ht=((He=(Te=D.response)==null?void 0:Te.data)==null?void 0:He.message)??D.message??D;u.add({severity:"error",summary:z("components.toast.title_error"),detail:ht,life:3e3}),console.error(ht)}return F<2}},mutations:{retry:0,networkMode:"always",onError:F=>{var Y,Te,He,ht;const D=((Te=(Y=F.response)==null?void 0:Y.data)==null?void 0:Te.message)??F.message??F;u.add({severity:"error",summary:z("components.toast.title_error"),detail:D,life:3e3}),console.error(((ht=(He=F.response)==null?void 0:He.data)==null?void 0:ht.message)??F.message??F)}}});const q=ne(()=>{var Y,Te;let F="var(--ground-background)";const D=Xs((Y=a==null?void 0:a.meta.ui)==null?void 0:Y.background);return(Te=a==null?void 0:a.meta.ui)!=null&&Te.showTopbar?F="var(--topbar-background)":D&&(F=D),F}),oe=ne(()=>{var Y,Te;const F=O.value?`${H.height.value}px`:"env(safe-area-inset-top, 0px)",D=U.value?`${J.height.value}px`:Xs((Te=(Y=a.meta.ui)==null?void 0:Y.containerSettings)==null?void 0:Te.ignoreSafeAreaBottom)?"0px":"env(safe-area-inset-bottom, 0px)";return k.value?`calc(100vh - ${F} - ${D})`:`calc(100dvh - ${F} - ${D})`}),ue=ne(()=>{var F;return((F=a.meta.auth)==null?void 0:F.requiresAuth)&&!K.value||S.value});Ge(M,(F,D)=>{D===!1&&F===!0&&o.refetchQueries()}),Ge(K,F=>{F?B.value=f.connect():(B.value=void 0,f.disconnect())},{immediate:!0}),Ge(N,F=>{K.value?M.value=F:M.value=!0}),Ge(se,F=>{const{isLoading:D}=cf(0,{parent:"body"});D.value=F},{immediate:!0}),Ge([q,L],()=>{Zs(()=>{var D,Y;if(/^var\([^)]+\)$/.test(q.value)){const Te=window.getComputedStyle(document.body),He=q.value.split("var(")[1].split(")")[0],ht=Te.getPropertyValue(He);(D=document.querySelector('meta[name="theme-color"]'))==null||D.setAttribute("content",ht)}else(Y=document.querySelector('meta[name="theme-color"]'))==null||Y.setAttribute("content",q.value)})},{immediate:!0}),Ge(a,F=>{var D,Y;Xs((Y=(D=F.meta.ui)==null?void 0:D.containerSettings)==null?void 0:Y.disableScroll)?(document.body.classList.add("disable-overflow-scroll"),document.documentElement.classList.add("disable-overflow-scroll")):(document.body.classList.remove("disable-overflow-scroll"),document.documentElement.classList.remove("disable-overflow-scroll"))},{immediate:!0,deep:!0});const Se=()=>{const F=document.querySelector('meta[name="electron-server"]'),D=F!==null&&F.getAttribute("content")==="true";W.value=window.electron!==void 0,I.value=D,setTimeout(()=>{W.value=window.electron!==void 0,I.value=D},100)};return Sn(async()=>{await l.isReady(),S.value=!1,Se()}),(F,D)=>{var wt,zt,nt,Yt,Be,Ue,V,X,_e,ye,fe;const Y=ek,Te=j0,He=q0,ht=D0,Mt=ZC,Qe=tw,ze=Db,ge=Fb,pt=Ei("RouterView"),Jt=e1;return c(ue)||!c(M)?(m(),A("div",{key:0,class:"flex w-full h-full justify-center items-center absolute z-50",style:ot({minHeight:c(k)?"100vh !important":"100dvh !important"})},[y(Y,{reload:"",icon:!c(M)&&c(K)?c(nk):void 0},null,8,["icon"])],4)):(m(),A("div",mk,[y(Te,{position:"bottom-right"}),y(He),y(ht),y(Mt),c(i)?(m(),j(Qe,{key:0,ref_key:"topbarRef",ref:O,style:ot({left:c(b)?"0px":`${c(w).width.value}px`}),class:"z-2 top-0"},null,8,["style"])):ce("",!0),c(n)?(m(),j(ze,{key:1,ref_key:"bottombarRef",ref:U,class:"z-2"},null,512)):ce("",!0),c(r)?(m(),j(ge,{key:2,ref_key:"navbarRef",ref:E,class:"z-3 top-0 left-0"},null,512)):ce("",!0),g("main",{id:"container",class:"relative w-dvw z-1",style:ot({paddingTop:c(O)?`${c(H).height.value}px`:"env(safe-area-inset-top, 0px)",paddingLeft:c(E)&&!c(b)?`${c(w).width.value}px`:"env(safe-area-inset-left, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingBottom:c(U)?`${c(J).height.value}px`:("toValue"in F?F.toValue:c(Xs))((zt=(wt=F.$route.meta.ui)==null?void 0:wt.containerSettings)==null?void 0:zt.ignoreSafeAreaBottom)?"0px":"env(safe-area-inset-bottom, 0px)"})},[g("div",{class:at(["w-full max-w-full h-full grid",{"p-4":("toValue"in F?F.toValue:c(Xs))((Yt=(nt=F.$route.meta.ui)==null?void 0:nt.containerSettings)==null?void 0:Yt.padding)}]),style:ot({minHeight:c(oe),maxHeight:("toValue"in F?F.toValue:c(Xs))((Ue=(Be=F.$route.meta.ui)==null?void 0:Be.containerSettings)==null?void 0:Ue.disableScroll)?c(oe):void 0,height:("toValue"in F?F.toValue:c(Xs))((X=(V=F.$route.meta.ui)==null?void 0:V.containerSettings)==null?void 0:X.disableScroll)?c(oe):void 0,overflow:("toValue"in F?F.toValue:c(Xs))((ye=(_e=F.$route.meta.ui)==null?void 0:_e.containerSettings)==null?void 0:ye.disableScroll)?"hidden":void 0})},[y(pt,{class:"w-full h-full relative overflow-x-hidden"})],6)],4),c(W)?(m(),j(Jt,{key:3})):ce("",!0),c(e)==="opened"||c(t)==="opened"&&c(b)?(m(),j(Qh,{key:4,to:c(e)==="opened"?"#app":"#container",defer:""},[c(b)?(m(),A("div",{key:0,class:at(["fixed top-0 left-0 right-0 bottom-0 w-full h-full bg-black/50 z-1",{"z-2":c(e)==="opened"}])},null,2)):ce("",!0)],8,["to"])):ce("",!0),g("div",{class:"fixed-bg",style:ot({background:("toValue"in F?F.toValue:c(Xs))((fe=F.$route.meta.ui)==null?void 0:fe.background)})},null,4)]))}}}),fk=qs(pk,[["__scopeId","data-v-6277ff0b"]]),gk=hf(),vk=Tf(Rf,{primitive:{borderRadius:{none:"0",xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"}},semantic:{transitionDuration:"0.2s",focusRing:{width:"1px",style:"solid",color:"{primary.color}",offset:"2px",shadow:"none"},disabledOpacity:"0.6",iconSize:"1rem",anchorGutter:"2px",primary:{50:"#fdf4f6",100:"#f7ccd4",200:"#f1a3b2",300:"#eb7b90",400:"#e5526e",500:"#df2a4c",600:"#be2441",700:"#9c1d35",800:"#7b172a",900:"#59111e",950:"#380b13"},formField:{paddingX:"0.75rem",paddingY:"0.5rem",sm:{fontSize:"0.875rem",paddingX:"0.625rem",paddingY:"0.375rem"},lg:{fontSize:"1.125rem",paddingX:"0.875rem",paddingY:"0.625rem"},borderRadius:"{border.radius.md}",focusRing:{width:"0",style:"none",color:"transparent",offset:"0",shadow:"none"},transitionDuration:"{transition.duration}"},list:{padding:"0.25rem 0.25rem",gap:"2px",header:{padding:"0.5rem 1rem 0.25rem 1rem"},option:{padding:"0.5rem 0.75rem",borderRadius:"{border.radius.sm}"},optionGroup:{padding:"0.5rem 0.75rem",fontWeight:"600"}},content:{borderRadius:"{border.radius.md}"},mask:{transitionDuration:"0.15s"},navigation:{list:{padding:"0.25rem 0.25rem",gap:"2px"},item:{padding:"0.5rem 0.75rem",borderRadius:"{border.radius.sm}",gap:"0.5rem"},submenuLabel:{padding:"0.5rem 0.75rem",fontWeight:"600"},submenuIcon:{size:"0.875rem"}},overlay:{select:{borderRadius:"{border.radius.md}",shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"},popover:{borderRadius:"{border.radius.md}",padding:"0.75rem",shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"},modal:{borderRadius:"{border.radius.xl}",padding:"1.25rem",shadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"},navigation:{shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"}},colorScheme:{light:{surface:{0:"#ffffff",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",850:"#0f172a",900:"#0f172a",925:"#0c1421",950:"#020617",1e3:"#000000"},primary:{color:"{primary.500}",contrastColor:"#ffffff",hoverColor:"{primary.600}",activeColor:"{primary.700}"},highlight:{background:"{primary.50}",focusBackground:"{primary.100}",color:"{primary.700}",focusColor:"{primary.800}"},mask:{background:"rgba(0,0,0,0.4)",color:"{surface.200}"},formField:{background:"{surface.50}",disabledBackground:"{surface.200}",filledBackground:"{surface.50}",filledHoverBackground:"{surface.50}",filledFocusBackground:"{surface.50}",borderColor:"{surface.300}",hoverBorderColor:"{surface.400}",focusBorderColor:"{primary.color}",invalidBorderColor:"{red.400}",color:"{surface.700}",disabledColor:"{surface.500}",placeholderColor:"{surface.500}",invalidPlaceholderColor:"{red.600}",floatLabelColor:"{surface.500}",floatLabelFocusColor:"{primary.600}",floatLabelActiveColor:"{surface.500}",floatLabelInvalidColor:"{form.field.invalid.placeholder.color}",iconColor:"{surface.400}",shadow:"0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"},text:{color:"{surface.700}",hoverColor:"{surface.800}",mutedColor:"{surface.500}",hoverMutedColor:"{surface.600}"},content:{background:"{surface.0}",hoverBackground:"{surface.100}",borderColor:"{surface.200}",color:"{text.color}",hoverColor:"{text.hover.color}"},overlay:{select:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"},popover:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"},modal:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"}},list:{option:{focusBackground:"{surface.100}",selectedBackground:"{highlight.background}",selectedFocusBackground:"{highlight.focus.background}",color:"{text.color}",focusColor:"{text.hover.color}",selectedColor:"{highlight.color}",selectedFocusColor:"{highlight.focus.color}",icon:{color:"{surface.400}",focusColor:"{surface.500}"}},optionGroup:{background:"transparent",color:"{text.muted.color}"}},navigation:{item:{focusBackground:"{surface.100}",activeBackground:"{surface.100}",color:"{text.color}",focusColor:"{text.hover.color}",activeColor:"{text.hover.color}",icon:{color:"{surface.400}",focusColor:"{surface.500}",activeColor:"{surface.500}"}},submenuLabel:{background:"transparent",color:"{text.muted.color}"},submenuIcon:{color:"{surface.400}",focusColor:"{surface.500}",activeColor:"{surface.500}"}}},dark:{surface:{0:"#ffffff",50:"#f5f5f5",100:"#d1d1d1",200:"#adadad",300:"#898989",400:"#646464",500:"#404040",600:"#363636",700:"#2d2d2d",800:"#232323",850:"#1d1d1d",900:"#1a1a1a",925:"#161616",950:"#101010",1e3:"#0d0d0d"},primary:{color:"{primary.500}",contrastColor:"{surface.900}",hoverColor:"{primary.600}",activeColor:"{primary.700}"},highlight:{background:"color-mix(in srgb, {primary.400}, transparent 84%)",focusBackground:"color-mix(in srgb, {primary.400}, transparent 76%)",color:"rgba(255,255,255,.87)",focusColor:"rgba(255,255,255,.87)"},mask:{background:"rgba(0,0,0,0.6)",color:"{surface.200}"},formField:{background:"{surface.925}",disabledBackground:"{surface.700}",filledBackground:"{surface.800}",filledHoverBackground:"{surface.800}",filledFocusBackground:"{surface.800}",borderColor:"{surface.800}",hoverBorderColor:"{surface.500}",focusBorderColor:"{primary.color}",invalidBorderColor:"{red.300}",color:"{surface.0}",disabledColor:"{surface.400}",placeholderColor:"{surface.400}",invalidPlaceholderColor:"{red.400}",floatLabelColor:"{surface.400}",floatLabelFocusColor:"{primary.color}",floatLabelActiveColor:"{surface.400}",floatLabelInvalidColor:"{form.field.invalid.placeholder.color}",iconColor:"{surface.400}",shadow:"0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"},text:{color:"{surface.0}",hoverColor:"{surface.0}",mutedColor:"{surface.400}",hoverMutedColor:"{surface.300}"},content:{background:"{surface.900}",hoverBackground:"{surface.800}",borderColor:"{surface.700}",color:"{text.color}",hoverColor:"{text.hover.color}"},overlay:{select:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"},popover:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"},modal:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"}},list:{option:{focusBackground:"{surface.800}",selectedBackground:"{highlight.background}",selectedFocusBackground:"{highlight.focus.background}",color:"{text.color}",focusColor:"{text.hover.color}",selectedColor:"{highlight.color}",selectedFocusColor:"{highlight.focus.color}",icon:{color:"{surface.500}",focusColor:"{surface.400}"}},optionGroup:{background:"transparent",color:"{text.muted.color}"}},navigation:{item:{focusBackground:"{surface.800}",activeBackground:"{surface.800}",color:"{text.color}",focusColor:"{text.hover.color}",activeColor:"{text.hover.color}",icon:{color:"{surface.500}",focusColor:"{surface.400}",activeColor:"{surface.400}"}},submenuLabel:{background:"transparent",color:"{text.muted.color}"},submenuIcon:{color:"{surface.500}",focusColor:"{surface.400}",activeColor:"{surface.400}"}}}}}}),_k=()=>{const s=Z0(fk);return s.directive("tooltip",jr),s.use(La).use(gk).use(uk).use(B0).use(z0).use(U0).use(Pf,{theme:{preset:vk,options:{cssLayer:{name:"primevue",order:"theme, base, primevue"},darkModeSelector:".dark-mode"}}}).use($0),s},yk=_k();yk.mount("#app");export{Bi as $,S4 as A,Lb as B,Jn as C,fp as D,f9 as E,pp as F,t8 as G,r8 as H,G8 as I,U8 as J,Q8 as K,rx as L,g8 as M,tx as N,gx as O,mx as P,ux as Q,ax as R,Sa as S,Y5 as T,R_ as U,U4 as V,$4 as W,E4 as X,b4 as Y,l9 as Z,Fa as _,Il as a,u9 as a0,Nl as a1,vs as a2,Ie as a3,bp as a4,v2 as a5,S6 as a6,hh as a7,uh as a8,ch as a9,mh as aa,dh as ab,fh as ac,xp as ad,Ep as ae,Km as af,$3 as ag,h9 as ah,hd as ai,Uc as aj,T2 as ak,a9 as al,Rl as am,uo as an,p9 as ao,Zm as ap,c9 as aq,hk as ar,g9 as as,m9 as at,d9 as au,Si as b,Cn as c,xi as d,Ol as e,Pl as f,Fr as g,Vr as h,_o as i,zc as j,y9 as k,_9 as l,d3 as m,wp as n,v9 as o,kp as p,Tl as q,O_ as r,I_ as s,ja as t,Fs as u,kh as v,Fl as w,kl as x,Ap as y,qs as z};
|
|
31
|
+
`):"",this.name="UnsubscriptionError",this.errors=e}});function $c(s,e){if(s){var t=s.indexOf(e);0<=t&&s.splice(t,1)}}var Oa=function(){function s(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return s.prototype.unsubscribe=function(){var t,n,r,i,o;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var l=ro(a),u=l.next();!u.done;u=l.next())u.value.remove(this)}catch(k){t={error:k}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}else a.remove(this);var d=this.initialTeardown;if(Is(d))try{d()}catch(k){o=k instanceof Ya?k.errors:[k]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var v=ro(h),f=v.next();!f.done;f=v.next()){var b=f.value;try{md(b)}catch(k){o=o??[],k instanceof Ya?o=ma(ma([],ha(o)),ha(k.errors)):o.push(k)}}}catch(k){r={error:k}}finally{try{f&&!f.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}}if(o)throw new Ya(o)}},s.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)md(t);else{if(t instanceof s){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(t)}},s.prototype._hasParent=function(t){var n=this._parentage;return n===t||Array.isArray(n)&&n.includes(t)},s.prototype._addParent=function(t){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(t),n):n?[n,t]:t},s.prototype._removeParent=function(t){var n=this._parentage;n===t?this._parentage=null:Array.isArray(n)&&$c(n,t)},s.prototype.remove=function(t){var n=this._finalizers;n&&$c(n,t),t instanceof s&&t._removeParent(this)},s.EMPTY=((e=new s).closed=!0,e),s}(),Mm=Oa.EMPTY;function $m(s){return s instanceof Oa||s&&"closed"in s&&Is(s.remove)&&Is(s.add)&&Is(s.unsubscribe)}function md(s){Is(s)?s():s.unsubscribe()}var iv={Promise:void 0},ov={setTimeout:function(s,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];return setTimeout.apply(void 0,ma([s,e],ha(t)))},clearTimeout:function(s){return clearTimeout(s)},delegate:void 0};function Pm(s){ov.setTimeout(function(){throw s})}function pd(){}function Qo(s){s()}var bl=function(s){function e(t){var n=s.call(this)||this;return n.isStopped=!1,t?(n.destination=t,$m(t)&&t.add(n)):n.destination=cv,n}return Br(e,s),e.create=function(t,n,r){return new io(t,n,r)},e.prototype.next=function(t){this.isStopped?void 0:this._next(t)},e.prototype.error=function(t){this.isStopped?void 0:(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?void 0:(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Oa),av=function(){function s(e){this.partialObserver=e}return s.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){No(n)}},s.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){No(n)}else No(e)},s.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){No(t)}},s}(),io=function(s){function e(t,n,r){var i,o=s.call(this)||this;return Is(t)||!t?i={next:t??void 0,error:n??void 0,complete:r??void 0}:i=t,o.destination=new av(i),o}return Br(e,s),e}(bl);function No(s){Pm(s)}var cv={closed:!0,next:pd,error:function(s){throw s},complete:pd},Pc=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Tm(s){return s}function lv(s){return s.length===0?Tm:s.length===1?s[0]:function(e){return s.reduce(function(t,n){return n(t)},e)}}var or=function(){function s(e){e&&(this._subscribe=e)}return s.prototype.lift=function(e){var t=new s;return t.source=this,t.operator=e,t},s.prototype.subscribe=function(e,t,n){var r,i=this,o=(r=e)&&r instanceof bl||function(a){return a&&Is(a.next)&&Is(a.error)&&Is(a.complete)}(r)&&$m(r)?e:new io(e,t,n);return Qo(function(){var a=i,l=a.operator,u=a.source;o.add(l?l.call(o,u):u?i._subscribe(o):i._trySubscribe(o))}),o},s.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},s.prototype.forEach=function(e,t){var n=this;return new(t=fd(t))(function(r,i){var o=new io({next:function(a){try{e(a)}catch(l){i(l),o.unsubscribe()}},error:i,complete:r});n.subscribe(o)})},s.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},s.prototype[Pc]=function(){return this},s.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return lv(e)(this)},s.prototype.toPromise=function(e){var t=this;return new(e=fd(e))(function(n,r){var i;t.subscribe(function(o){return i=o},function(o){return r(o)},function(){return n(i)})})},s.create=function(e){return new s(e)},s}();function fd(s){var e;return(e=s??iv.Promise)!==null&&e!==void 0?e:Promise}var uv=Am(function(s){return function(){s(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Na=function(s){function e(){var t=s.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return Br(e,s),e.prototype.lift=function(t){var n=new gd(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new uv},e.prototype.next=function(t){var n=this;Qo(function(){var r,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var o=ro(n.currentObservers),a=o.next();!a.done;a=o.next())a.value.next(t)}catch(l){r={error:l}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}})},e.prototype.error=function(t){var n=this;Qo(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var r=n.observers;r.length;)r.shift().error(t)}})},e.prototype.complete=function(){var t=this;Qo(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),s.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,r=this,i=r.hasError,o=r.isStopped,a=r.observers;return i||o?Mm:(this.currentObservers=null,a.push(t),new Oa(function(){n.currentObservers=null,$c(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,r=n.hasError,i=n.thrownError,o=n.isStopped;r?t.error(i):o&&t.complete()},e.prototype.asObservable=function(){var t=new or;return t.source=this,t},e.create=function(t,n){return new gd(t,n)},e}(or),gd=function(s){function e(t,n){var r=s.call(this)||this;return r.destination=t,r.source=n,r}return Br(e,s),e.prototype.next=function(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.next)===null||r===void 0||r.call(n,t)},e.prototype.error=function(t){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.error)===null||r===void 0||r.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,r;return(r=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&r!==void 0?r:Mm},e}(Na),gn=function(s){function e(t){var n=s.call(this)||this;return n._value=t,n}return Br(e,s),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var n=s.prototype._subscribe.call(this,t);return!n.closed&&t.next(this._value),n},e.prototype.getValue=function(){var t=this,n=t.hasError,r=t.thrownError,i=t._value;if(n)throw r;return this._throwIfClosed(),i},e.prototype.next=function(t){s.prototype.next.call(this,this._value=t)},e}(Na),Rm={now:function(){return(Rm.delegate||Date).now()},delegate:void 0},Fo=function(s){function e(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Rm);var i=s.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return Br(e,s),e.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,a=n._timestampProvider,l=n._windowTime;r||(i.push(t),!o&&i.push(a.now()+l)),this._trimBuffer(),s.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),r=this._infiniteTimeWindow,i=this._buffer.slice(),o=0;o<i.length&&!t.closed;o+=r?1:2)t.next(i[o]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,r=t._timestampProvider,i=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*n;if(n<1/0&&a<i.length&&i.splice(0,i.length-a),!o){for(var l=r.now(),u=0,d=1;d<i.length&&i[d]<=l;d+=2)u=d;u&&i.splice(0,u+1)}},e}(Na);function Ri(s){return function(e){if(function(t){return Is(t==null?void 0:t.lift)}(e))return e.lift(function(t){try{return s(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function vi(s,e,t,n,r){return new dv(s,e,t,n,r)}var dv=function(s){function e(t,n,r,i,o,a){var l=s.call(this,t)||this;return l.onFinalize=o,l.shouldUnsubscribe=a,l._next=n?function(u){try{n(u)}catch(d){t.error(d)}}:s.prototype._next,l._error=i?function(u){try{i(u)}catch(d){t.error(d)}finally{this.unsubscribe()}}:s.prototype._error,l._complete=r?function(){try{r()}catch(u){t.error(u)}finally{this.unsubscribe()}}:s.prototype._complete,l}return Br(e,s),e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;s.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(bl);function Xa(){return Ri(function(s,e){var t,n=!1;s.subscribe(vi(e,function(r){var i=t;t=r,n&&e.next([i,r]),n=!0}))})}function ec(s,e){return Ri(function(t,n){var r=0;t.subscribe(vi(n,function(i){return s.call(e,i,r++)&&n.next(i)}))})}function Tc(s,e){return Ri(function(t,n){var r=0;t.subscribe(vi(n,function(i){n.next(s.call(e,i,r++))}))})}var hv=typeof Symbol=="function"&&Symbol.iterator?Symbol.iterator:"@@iterator";function pa(s){if(s instanceof or)return s;if(s!=null){if(function(o){return Is(o[Pc])}(s))return i=s,new or(function(o){var a=i[Pc]();if(Is(a.subscribe))return a.subscribe(o);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(function(o){return o&&typeof o.length=="number"&&typeof o!="function"}(s))return r=s,new or(function(o){for(var a=0;a<r.length&&!o.closed;a++)o.next(r[a]);o.complete()});if(Is((n=s)==null?void 0:n.then))return t=s,new or(function(o){t.then(function(a){o.closed||(o.next(a),o.complete())},function(a){return o.error(a)}).then(null,Pm)});if(function(o){return Symbol.asyncIterator&&Is(o==null?void 0:o[Symbol.asyncIterator])}(s))return vd(s);if(function(o){return Is(o==null?void 0:o[hv])}(s))return e=s,new or(function(o){var a,l;try{for(var u=ro(e),d=u.next();!d.done;d=u.next()){var h=d.value;if(o.next(h),o.closed)return}}catch(v){a={error:v}}finally{try{d&&!d.done&&(l=u.return)&&l.call(u)}finally{if(a)throw a.error}}o.complete()});if(function(o){return Is(o==null?void 0:o.getReader)}(s))return vd(function(o){return nv(this,arguments,function(){var a,l,u;return Em(this,function(d){switch(d.label){case 0:a=o.getReader(),d.label=1;case 1:d.trys.push([1,,9,10]),d.label=2;case 2:return[4,di(a.read())];case 3:return l=d.sent(),u=l.value,l.done?[4,di(void 0)]:[3,5];case 4:return[2,d.sent()];case 5:return[4,di(u)];case 6:return[4,d.sent()];case 7:return d.sent(),[3,2];case 8:return[3,10];case 9:return a.releaseLock(),[7];case 10:return[2]}})})}(s))}var e,t,n,r,i;throw function(o){return new TypeError("You provided "+(o!==null&&typeof o=="object"?"an invalid object":"'"+o+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(s)}function vd(s){return new or(function(e){(function(t,n){var r,i,o,a;return sv(this,void 0,void 0,function(){var l,u;return Em(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),r=rv(t),d.label=1;case 1:return[4,r.next()];case 2:if((i=d.sent()).done)return[3,4];if(l=i.value,n.next(l),n.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=d.sent(),o={error:u},[3,11];case 6:return d.trys.push([6,,9,10]),i&&!i.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return n.complete(),[2]}})})})(s,e).catch(function(t){return e.error(t)})})}function Lo(s){s===void 0&&(s={});var e=s.connector,t=e===void 0?function(){return new Na}:e,n=s.resetOnError,r=n===void 0||n,i=s.resetOnComplete,o=i===void 0||i,a=s.resetOnRefCountZero,l=a===void 0||a;return function(u){var d,h,v,f=0,b=!1,k=!1,z=function(){h==null||h.unsubscribe(),h=void 0},L=function(){z(),d=v=void 0,b=k=!1},se=function(){var K=d;L(),K==null||K.unsubscribe()};return Ri(function(K,N){f++,k||b||z();var E=v=v??t();N.add(function(){--f!==0||k||b||(h=tc(se,l))}),E.subscribe(N),!d&&f>0&&(d=new io({next:function(O){return E.next(O)},error:function(O){k=!0,z(),h=tc(L,r,O),E.error(O)},complete:function(){b=!0,z(),h=tc(L,o),E.complete()}}),pa(K).subscribe(d))})(u)}}function tc(s,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e!==!0){if(e!==!1){var r=new io({next:function(){r.unsubscribe(),s()}});return pa(e.apply(void 0,ma([],ha(t)))).subscribe(r)}}else s()}function Im(s,e,t){return t===void 0&&(t=1/0),Is(e)?Im(function(n,r){return Tc(function(i,o){return e(n,i,r,o)})(pa(s(n,r)))},t):(typeof e=="number"&&(t=e),Ri(function(n,r){return function(i,o,a,l,u,d,h,v){var f=[],b=0,k=0,z=!1,L=function(){!z||f.length||b||o.complete()},se=function(N){return b<l?K(N):f.push(N)},K=function(N){d&&o.next(N),b++;var E=!1;pa(a(N,k++)).subscribe(vi(o,function(O){u==null||u(O),d?se(O):o.next(O)},function(){E=!0},void 0,function(){if(E)try{b--;for(var O=function(){var U=f.shift();h?function(S,M,B,W,I){W===void 0&&(W=0),I===void 0&&(I=!1);var w=M.schedule(function(){B(),I?S.add(this.schedule(null,W)):this.unsubscribe()},W);S.add(w)}(o,h,function(){return K(U)}):K(U)};f.length&&b<l;)O();L()}catch(U){o.error(U)}}))};return i.subscribe(vi(o,se,function(){z=!0,L()})),function(){v==null||v()}}(n,r,s,t)}))}function mv(s,e){return s===e}const pv=s=>s==="person"?"person":s==="motion"?"motion":new Set(["bird","cat","dog","horse","sheep","cow","elephant","bear","zebra","giraffe","teddy bear"]).has(s)?"animal":new Set(["bicycle","car","motorcycle","airplane","bus","train","truck","boat"]).has(s)?"vehicle":"other";function _d(s){return s.map(e=>({...e,label:pv(e.label)}))}class fv{constructor(e=100){p(this,"cells",new Map);p(this,"cellSize");this.cellSize=e}getCellsForBox(e,t=0){const n=Math.floor((e[0]-t)/this.cellSize),r=Math.floor((e[1]-t)/this.cellSize),i=Math.floor((e[2]+t)/this.cellSize),o=Math.floor((e[3]+t)/this.cellSize),a=[];for(let l=n;l<=i;l++)for(let u=r;u<=o;u++)a.push(`${l},${u}`);return a}insert(e){const t=e.boundingBox,n=this.getCellsForBox(t);for(const r of n)this.cells.has(r)||this.cells.set(r,[]),this.cells.get(r).push(e)}search(e,t=0){const n=this.getCellsForBox(e,t),r=new Set;for(const i of n){const o=this.cells.get(i)??[];for(const a of o)r.add(a)}return Array.from(r)}}function gv(s,e){const t=Math.max(s[0],e[0]),n=Math.max(s[1],e[1]),r=Math.min(s[2],e[2]),i=Math.min(s[3],e[3]);if(r<t||i<n)return 0;const o=(r-t)*(i-n);return o/((s[2]-s[0])*(s[3]-s[1])+(e[2]-e[0])*(e[3]-e[1])-o)}function yd(s){return s[0]<s[2]&&s[1]<s[3]}function bd(s,e=.01,t=100){if(s.length===0)return[];const n=new fv(t),r=new Set,i=[],o=s.map(l=>({...l,id:l.id??Math.random().toString(36).slice(2,9)}));for(const l of o)n.insert(l);for(const l of o){if(r.has(l.id))continue;const u={...l};let d=u.confidence;const h=[u.boundingBox],v=Math.max(t,10),f=n.search(u.boundingBox,v);for(const b of f){if(b.id===u.id||r.has(b.id)||b.label!==u.label)continue;const k=gv(u.boundingBox,b.boundingBox),z=Math.abs(u.boundingBox[0]-b.boundingBox[0])<=t&&Math.abs(u.boundingBox[1]-b.boundingBox[1])<=t;(k>e||z)&&(h.push(b.boundingBox),r.add(b.id),d=Math.max(d,b.confidence))}if(h.length>1){const b=(a=h,[Math.max(0,Math.round(Math.min(...a.map(k=>k[0])))),Math.max(0,Math.round(Math.min(...a.map(k=>k[1])))),Math.min(1e3,Math.round(Math.max(...a.map(k=>k[2])))),Math.min(1e3,Math.round(Math.max(...a.map(k=>k[3]))))]);yd(b)&&(u.boundingBox=b,u.confidence=d)}yd(u.boundingBox)&&i.push(u),r.add(u.id)}var a;return i}function wd(s,e){return[[s[0],s[1]],[s[2],s[1]],[s[2],s[3]],[s[0],s[3]]].every(t=>wl(t,e))}function vv(s,e){const t=[[s[0],s[1]],[s[2],s[1]],[s[2],s[3]],[s[0],s[3]]];return!Om(s,e)&&t.every(n=>!wl(n,e))}function wl(s,e){const[t,n]=s;let r=!1;for(let i=0;i<e.length;i++){const o=(i+1)%e.length,[a,l]=e[i],[u,d]=e[o];if(t>=Math.min(a,u)&&t<=Math.max(a,u)&&n>=Math.min(l,d)&&n<=Math.max(l,d))if(Math.abs(a-u)<1e-6){if(Math.abs(t-a)<1e-6)return!0}else{const h=(d-l)/(u-a),v=h*t+(l-h*a);if(Math.abs(n-v)<1e-6)return!0}l>n!=d>n&&t<(u-a)*(n-l)/(d-l)+a&&(r=!r)}return r}function _v(s,e,t,n){const r=(n[1]-t[1])*(e[0]-s[0])-(n[0]-t[0])*(e[1]-s[1]);if(r===0)return!1;const i=((n[0]-t[0])*(s[1]-t[1])-(n[1]-t[1])*(s[0]-t[0]))/r,o=((e[0]-s[0])*(s[1]-t[1])-(e[1]-s[1])*(s[0]-t[0]))/r;return i>=0&&i<=1&&o>=0&&o<=1}function Om(s,e){const t=[[s[0],s[1]],[s[2],s[1]],[s[2],s[3]],[s[0],s[3]],[s[0],s[1]]];if(t.some(n=>wl(n,e))||e.some(n=>n[0]>=s[0]&&n[0]<=s[2]&&n[1]>=s[1]&&n[1]<=s[3]))return!0;for(let n=0;n<t.length-1;n++)for(let r=0;r<e.length-1;r++)if(_v(t[n],t[n+1],e[r],e[r+1]))return!0;return!1}const xd=(s,e)=>{const{origWidth:t,origHeight:n}=e,r=s.points.map(([a,l])=>[a*t/100,l*n/100]);var i,o;return r.length>0&&(i=r[0],o=r[r.length-1],i[0]!==o[0]||i[1]!==o[1])&&r.push(r[0]),{...s,points:r}},Sd=(s,e,t)=>{if(e.length===0)return[];if(s.length===0)return[];const n=new Set;for(const r of e)r.classes.length>0&&r.classes.forEach(i=>n.add(i));return s.filter(r=>{if(r.confidence<t.object.confidence||!n.has(r.label))return!1;const i=(l=>{const{origWidth:u,origHeight:d,inputWidth:h,inputHeight:v}=l;let[f,b,k,z]=l.boundingBox;return f=f*u/h,b=b*d/v,k=k*u/h,z=z*d/v,f=Math.max(0,Math.min(f,u)),b=Math.max(0,Math.min(b,d)),k=Math.max(0,Math.min(k,u)),z=Math.max(0,Math.min(z,d)),{...l,boundingBox:[f,b,k,z]}})(r);for(const l of e){if(!l.isPrivacyMask)continue;const u=xd(l,i);if(wd(i.boundingBox,u.points))return!1}let o=!1,a=!1;for(const l of e){if(l.isPrivacyMask||!l.classes.includes(r.label))continue;const u=xd(l,i),d=Om(i.boundingBox,u.points),h=wd(i.boundingBox,u.points);if(l.filter==="include"){if(o=!0,l.type==="contain"&&h||l.type==="intersect"&&(d||h)){a=!0;break}}else if(l.type==="contain"){if(!vv(i.boundingBox,u.points))return!1}else if(d||h)return!1}return!o||a})};var tt,Ko,Zo,Go,Wo,Jo,Yo,Xo,Rc,nr,Mn;class yv extends Xg{constructor(t,n){super();Yn(this,tt);p(this,"logger");p(this,"snapshotCache");p(this,"cameraSubject");p(this,"cameraState",new gn(!1));p(this,"frameWorkerState",new gn(!1));p(this,"lightState",new gn(gt(this,tt,Jo).call(this,{state:!1},!0)));p(this,"motionState",new gn(gt(this,tt,Zo).call(this,{detections:[],state:!1},!0)));p(this,"audioState",new gn(gt(this,tt,Ko).call(this,{state:!1,db:0},!0)));p(this,"objectState",new gn(gt(this,tt,Go).call(this,{detections:[]},!0)));p(this,"doorbellState",new gn(gt(this,tt,Wo).call(this,{state:!1},!0)));p(this,"sirenState",new gn(gt(this,tt,Yo).call(this,{state:!1,level:0},!0)));p(this,"batteryState",new gn(gt(this,tt,Xo).call(this,{level:100,charging:!1,lowBattery:!1},!0)));p(this,"capabilities",new gn([]));p(this,"onConnected",gt(this,tt,Mn).call(this,this.cameraState));p(this,"onFrameWorkerConnected",gt(this,tt,Mn).call(this,this.frameWorkerState));p(this,"onLightSwitched",gt(this,tt,Mn).call(this,this.lightState));p(this,"onMotionDetected",gt(this,tt,Mn).call(this,this.motionState));p(this,"onAudioDetected",gt(this,tt,Mn).call(this,this.audioState));p(this,"onObjectDetected",gt(this,tt,Mn).call(this,this.objectState));p(this,"onDoorbellPressed",gt(this,tt,Mn).call(this,this.doorbellState));p(this,"onSirenDetected",gt(this,tt,Mn).call(this,this.sirenState));p(this,"onBatteryChanged",gt(this,tt,Mn).call(this,this.batteryState));this.logger=n,this.cameraSubject=new gn(t),this.snapshotCache=new(tv())({max:100,ttl:1e3*this.snapshotTTL}),t.pluginInfo||this.cameraState.next(!0)}get cameraObject(){return Ks(this.cameraSubject.getValue())}get id(){return this.cameraSubject.getValue()._id}get nativeId(){return this.cameraSubject.getValue().nativeId}get pluginInfo(){return this.cameraSubject.getValue().pluginInfo}get connected(){return this.cameraState.getValue()}get frameWorkerConnected(){return this.frameWorkerState.getValue()}get disabled(){return this.cameraSubject.getValue().disabled}get name(){return this.cameraSubject.getValue().name}get type(){return this.cameraSubject.getValue().type}get info(){return Ks(this.cameraSubject.getValue().info)}get isCloud(){return this.cameraSubject.getValue().isCloud}get hasLight(){return this.hasCapability(Gt.Light)}get hasSiren(){return this.hasCapability(Gt.Siren)}get hasDoorbell(){return this.hasCapability(Gt.Doorbell)}get hasBattery(){return this.hasCapability(Gt.Battery)}get hasAudioDetector(){return this.hasCapability(Gt.AudioSensor)}get hasMotionDetector(){return this.hasCapability(Gt.MotionSensor)||this.hasCapability(Gt.MotionDetector)}get hasObjectDetector(){return this.hasCapability(Gt.ObjectSensor)||this.hasCapability(Gt.ObjectDetector)}get hasPtz(){return this.hasCapability(Gt.PTZ)}get snapshotTTL(){return this.cameraSubject.getValue().snapshotTTL}get detectionZones(){return Ks(this.cameraSubject.getValue().detectionZones)}get detectionSettings(){return Ks(this.cameraSubject.getValue().detectionSettings)}get frameWorkerSettings(){return Ks(this.cameraSubject.getValue().frameWorkerSettings)}get streamSource(){return this.highResolutionSource??this.midResolutionSource??this.lowResolutionSource}get snapshotSource(){return this.sources.find(t=>t.role=="snapshot")??this.sources.find(t=>t.useForSnapshot)}get highResolutionSource(){return this.sources.find(t=>t.role==="high-resolution")}get midResolutionSource(){return this.sources.find(t=>t.role==="mid-resolution")}get lowResolutionSource(){return this.sources.find(t=>t.role==="low-resolution")}get interfaces(){return this.cameraInterfaces}getCapabilities(){return Ks(this.capabilities.getValue().map(t=>t.capabilities).flat())}hasCapability(t){return this.getCapabilities().some(n=>n===t)}getValue(t){switch(t){case"light":return Ks(this.lightState.getValue());case"motion":return Ks(this.motionState.getValue());case"audio":return Ks(this.audioState.getValue());case"object":return Ks(this.objectState.getValue());case"doorbell":return Ks(this.doorbellState.getValue());case"siren":return Ks(this.sirenState.getValue());case"battery":return Ks(this.batteryState.getValue());default:throw new Error(`Unknown state: ${t}`)}}onStateChange(t){return this[`${t}State`].pipe(Xa(),ec(([n,r])=>this.stateChanged(n,r,t)),Tc(([n,r])=>({oldState:n,newState:r})),Lo({connector:()=>new Fo(1)}))}onPropertyChange(t){return this.cameraSubject.pipe(Xa(),Im(([n,r])=>(Array.isArray(t)?t:[t]).map(i=>({property:i,oldData:n[i],newData:r[i]}))),ec(({oldData:n,newData:r})=>!ui(n,r,!0)),Lo({connector:()=>new Fo(1)}))}onCapabilitiesChange(){return this.capabilities.pipe(Xa(),ec(([t,n])=>!ui(t,n,!0)),Tc(([t,n])=>({oldCapabilities:t.map(r=>r.capabilities).flat(),newCapabilities:n.map(r=>r.capabilities).flat()})),Lo({connector:()=>new Fo(1)}))}removeAllListeners(){this.lightState.complete(),this.motionState.complete(),this.audioState.complete(),this.objectState.complete(),this.doorbellState.complete(),this.sirenState.complete(),this.batteryState.complete(),this.cameraSubject.complete(),this.cameraState.complete(),this.frameWorkerState.complete(),this.capabilities.complete(),this.snapshotCache.clear()}updateCamera(t){t.snapshotTTL!==this.snapshotTTL&&this.snapshotCache.clear(),this.cameraSubject.next(t)}updateCameraState(t){this.cameraState.next(t)}updateFrameWorkerState(t){this.frameWorkerState.next(t)}updateCapabilities(t){this.capabilities.next(t)}updateStateInternal(t,n,r,i){let o,a=!1;if(r)a=!0,o=n;else{const l=this.checkStateInternal(t,n,i);a=l.changed,o=l.event}if(a)switch(t){case"light":this.lightState.next(gt(this,tt,Jo).call(this,o));break;case"motion":this.motionState.next(gt(this,tt,Zo).call(this,o));break;case"audio":this.audioState.next(gt(this,tt,Ko).call(this,o));break;case"object":this.objectState.next(gt(this,tt,Go).call(this,o));break;case"doorbell":this.doorbellState.next(gt(this,tt,Wo).call(this,o));break;case"siren":this.sirenState.next(gt(this,tt,Yo).call(this,o));break;case"battery":this.batteryState.next(gt(this,tt,Xo).call(this,o))}}checkStateInternal(t,n,r){let i,o=!1;switch(t){case"audio":const a=n;i=gt(this,tt,Ko).call(this,a),o=this.stateChanged(this.getValue("audio"),i,"audio");break;case"light":const l=n;i=gt(this,tt,Jo).call(this,l),o=this.stateChanged(this.getValue("light"),i,"light");break;case"motion":const u=n;if(u.state||(u.detections=[]),!r&&u.detections){const b=u.detections.length>0;u.detections=_d(u.detections),u.detections=bd(u.detections),u.detections=Sd(u.detections,this.detectionZones,this.detectionSettings),b&&u.detections.length===0&&(u.state=!1)}i=gt(this,tt,Zo).call(this,u),o=this.stateChanged(this.getValue("motion"),i,"motion");break;case"object":const d=n;r||(d.detections=_d(d.detections),d.detections=bd(d.detections),d.detections=Sd(d.detections,this.detectionZones,this.detectionSettings)),i=gt(this,tt,Go).call(this,d),o=this.stateChanged(this.getValue("object"),i,"object");break;case"doorbell":const h=n;i=gt(this,tt,Wo).call(this,h),o=this.stateChanged(this.getValue("doorbell"),i,"doorbell");break;case"siren":const v=n;i=gt(this,tt,Yo).call(this,v),o=this.stateChanged(this.getValue("siren"),i,"siren");break;case"battery":const f=n;i=gt(this,tt,Xo).call(this,f),o=this.stateChanged(this.getValue("battery"),i,"battery");break;default:throw new Error(`Unknown state: ${t}`)}return{changed:o,event:i}}stateChanged(t,n,r){return t===void 0||n===void 0||r===void 0||r==="audio"&&!this.hasAudioDetector||r==="motion"&&!this.hasMotionDetector||r==="object"&&!this.hasObjectDetector||r==="siren"&&!this.hasSiren||r==="battery"&&!this.hasBattery||r==="doorbell"&&!this.hasDoorbell||r==="light"&&!this.hasLight?!1:!ui(gt(this,tt,Rc).call(this,t),gt(this,tt,Rc).call(this,n),!0)}}tt=new WeakSet,Ko=function(t,n=!1){let r,i;if(n||(r=this.getValue("audio"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t))i=t;else{const o={...t,timestamp:Date.now()};i={...o,db:o.db??(r==null?void 0:r.db)??0,lastEvent:r}}return i},Zo=function(t,n=!1){let r,i;return n||(r=this.getValue("motion"),r!=null&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Go=function(t,n=!1){let r,i;return n||(r=this.getValue("object"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Wo=function(t,n=!1){let r,i;return n||(r=this.getValue("doorbell"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Jo=function(t,n=!1){let r,i;return n||(r=this.getValue("light"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),lastEvent:r},i},Yo=function(t,n=!1){let r,i;if(n||(r=this.getValue("siren"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t))i=t;else{const o={...t,timestamp:Date.now()};i={...o,level:o.level??(r==null?void 0:r.level)??0,lastEvent:r}}return i},Xo=function(t,n=!1){let r,i;return n||(r=this.getValue("battery"),r&&r.lastEvent&&delete r.lastEvent),gt(this,tt,nr).call(this,t)?i=t:i={...t,timestamp:Date.now(),charging:t.charging??(r==null?void 0:r.charging)??!1,lowBattery:t.lowBattery??(r==null?void 0:r.lowBattery)??!1,lastEvent:r},i},Rc=function(t){const n=Ks(t);return"timestamp"in n&&delete n.timestamp,"lastEvent"in n&&delete n.lastEvent,n},nr=function(t){return"timestamp"in t},Mn=function(t){return t.pipe((r===void 0&&(r=Tm),n=n??mv,Ri(function(i,o){var a,l=!0;i.subscribe(vi(o,function(u){var d=r(u);!l&&n(a,d)||(l=!1,a=d,o.next(u))}))})),Lo({connector:()=>new Fo(1)}));var n,r};class oo{static coreManagerNamespaces(){return{coreManagerSubject:"coreManager.subscriber",coreManagerRpc:"coreManager.rpc"}}static deviceManagerNamespaces(){return{deviceManagerSubject:"deviceManager.subscriber",deviceManagerRpc:"deviceManager.rpc"}}static frameWorkerNamespaces(e){return{frameWorkerChildRpc:`camera.${e}.frameWorker.child.rpc`,frameWorkerChild:`camera.${e}.frameWorker.child`}}static pluginNamespaces(e){return{pluginDeviceManagerSubject:`plugin.${e}.deviceManager.subscriber`,pluginChildRpc:`plugin.${e}.child.rpc`,pluginChild:`plugin.${e}.child`,pluginStorageRpc:`plugin.${e}.storage.rpc`}}static cameraNamespaces(e){return{cameraSubject:`camera.${e}.subscriber`,cameraMotionFrameSubject:`camera.${e}.motionFrame.subscriber`,cameraControllerRpc:`camera.${e}.controller.rpc`}}static pluginCameraNamespaces(e,t){return{cameraInterfacesRpc:`plugin.${e}.camera.${t}.cameraInterfaces.rpc`,cameraStorageRpc:`plugin.${e}.camera.${t}.cameraStorage.rpc`}}}var sc=function(s,e,t,n){var r,i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,n);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},jn=function(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)},ho,Mr,mo,po,$r,hi,ta;class ea{constructor(e,t,n,r){Yn(this,hi);p(this,"interfaces");Yn(this,ho);Yn(this,Mr);Yn(this,mo);Yn(this,po);Yn(this,$r,[]);Zr(this,ho,e),Zr(this,Mr,t),Zr(this,mo,n),Zr(this,po,r)}async streamUrl(e){const t=An(this,Mr).getValue().find(n=>n.capabilities.some(r=>r===Gt.StreamUrl));if(!t)throw new Error("No capability found for streamUrl");return this.interfaces&&"streamUrl"in this.interfaces?this.interfaces.streamUrl(e):(await gt(this,hi,ta).call(this,t.pluginId)).streamUrl(e)}async snapshot(e,t){const n=An(this,Mr).getValue().find(r=>r.capabilities.some(i=>i===Gt.Snapshot));if(!n)throw new Error("No capability found for snapshot");return this.interfaces&&"snapshot"in this.interfaces?this.interfaces.snapshot(e,t):(await gt(this,hi,ta).call(this,n.pluginId)).snapshot(e,t)}async ptzCommand(e){const t=An(this,Mr).getValue().find(n=>n.capabilities.some(r=>r===Gt.PTZ));if(!t)throw new Error("No capability found for PTZ");return this.interfaces&&"ptzCommand"in this.interfaces?this.interfaces.ptzCommand(e):(await gt(this,hi,ta).call(this,t.pluginId)).ptzCommand(e)}async disconnect(){await Promise.allSettled(An(this,$r).map(e=>e.connection.disconnect())),Zr(this,$r,[])}}ho=new WeakMap,Mr=new WeakMap,mo=new WeakMap,po=new WeakMap,$r=new WeakMap,hi=new WeakSet,ta=async function(e){var r;if(e===((r=An(this,po))==null?void 0:r.id))throw new Error("Can not create camera proxy for the same plugin");const t=oo.pluginCameraNamespaces(e,An(this,mo)).cameraInterfacesRpc,n=await An(this,ho).createRPCConnection(t);return An(this,$r).some(i=>i.namespace===t)||An(this,$r).push({namespace:t,connection:n}),n.createProxy()};sc([Ja({public:!0}),jn("design:type",Function),jn("design:paramtypes",[String]),jn("design:returntype",Promise)],ea.prototype,"streamUrl",null),sc([Ja({public:!0}),jn("design:type",Function),jn("design:paramtypes",[String,Boolean]),jn("design:returntype",Promise)],ea.prototype,"snapshot",null),sc([Ja({public:!0}),jn("design:type",Function),jn("design:paramtypes",[Object]),jn("design:returntype",Promise)],ea.prototype,"ptzCommand",null);const Cd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let nc;const bv=new Uint8Array(16),Ps=[];for(let s=0;s<256;++s)Ps.push((s+256).toString(16).slice(1));function wv(s,e=0){return(Ps[s[e+0]]+Ps[s[e+1]]+Ps[s[e+2]]+Ps[s[e+3]]+"-"+Ps[s[e+4]]+Ps[s[e+5]]+"-"+Ps[s[e+6]]+Ps[s[e+7]]+"-"+Ps[s[e+8]]+Ps[s[e+9]]+"-"+Ps[s[e+10]]+Ps[s[e+11]]+Ps[s[e+12]]+Ps[s[e+13]]+Ps[s[e+14]]+Ps[s[e+15]]).toLowerCase()}const mn=function(s,e,t){var r;if(Cd.randomUUID&&!s)return Cd.randomUUID();const n=(s=s||{}).random??((r=s.rng)==null?void 0:r.call(s))??function(){if(!nc){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");nc=crypto.getRandomValues.bind(crypto)}return nc(bv)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,wv(n)};var Dt,kd;(function(s){s.assertEqual=e=>e,s.assertIs=function(e){},s.assertNever=function(e){throw new Error},s.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},s.getValidEnumValues=e=>{const t=s.objectKeys(e).filter(r=>typeof e[e[r]]!="number"),n={};for(const r of t)n[r]=e[r];return s.objectValues(n)},s.objectValues=e=>s.objectKeys(e).map(function(t){return e[t]}),s.objectKeys=typeof Object.keys=="function"?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},s.find=(e,t)=>{for(const n of e)if(t(n))return n},s.isInteger=typeof Number.isInteger=="function"?e=>Number.isInteger(e):e=>typeof e=="number"&&isFinite(e)&&Math.floor(e)===e,s.joinValues=function(e,t=" | "){return e.map(n=>typeof n=="string"?`'${n}'`:n).join(t)},s.jsonStringifyReplacer=(e,t)=>typeof t=="bigint"?t.toString():t})(Dt||(Dt={})),function(s){s.mergeShapes=(e,t)=>({...e,...t})}(kd||(kd={}));const Ze=Dt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ir=s=>{switch(typeof s){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return isNaN(s)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(s)?Ze.array:s===null?Ze.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?Ze.promise:typeof Map<"u"&&s instanceof Map?Ze.map:typeof Set<"u"&&s instanceof Set?Ze.set:typeof Date<"u"&&s instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}},$e=Dt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Gn extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(i){return i.message},n={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let a=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(this),n}static assert(e){if(!(e instanceof Gn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Dt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Gn.create=s=>new Gn(s);const Ic=(s,e)=>{let t;switch(s.code){case $e.invalid_type:t=s.received===Ze.undefined?"Required":`Expected ${s.expected}, received ${s.received}`;break;case $e.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,Dt.jsonStringifyReplacer)}`;break;case $e.unrecognized_keys:t=`Unrecognized key(s) in object: ${Dt.joinValues(s.keys,", ")}`;break;case $e.invalid_union:t="Invalid input";break;case $e.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Dt.joinValues(s.options)}`;break;case $e.invalid_enum_value:t=`Invalid enum value. Expected ${Dt.joinValues(s.options)}, received '${s.received}'`;break;case $e.invalid_arguments:t="Invalid function arguments";break;case $e.invalid_return_type:t="Invalid function return type";break;case $e.invalid_date:t="Invalid date";break;case $e.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:Dt.assertNever(s.validation):t=s.validation!=="regex"?`Invalid ${s.validation}`:"Invalid";break;case $e.too_small:t=s.type==="array"?`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:"Invalid input";break;case $e.too_big:t=s.type==="array"?`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:"Invalid input";break;case $e.custom:t="Invalid input";break;case $e.invalid_intersection_types:t="Intersection results could not be merged";break;case $e.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case $e.not_finite:t="Number must be finite";break;default:t=e.defaultError,Dt.assertNever(s)}return{message:t}};let xv=Ic;function Sv(){return xv}const Cv=s=>{const{data:e,path:t,errorMaps:n,issueData:r}=s,i=[...t,...r.path||[]],o={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:e,defaultError:a}).message;return{...r,path:i,message:a}};function De(s,e){const t=Sv(),n=Cv({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===Ic?void 0:Ic].filter(r=>!!r)});s.common.issues.push(n)}class Qs{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return vt;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const i=await r.key,o=await r.value;n.push({key:i,value:o})}return Qs.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:i,value:o}=r;if(i.status==="aborted"||o.status==="aborted")return vt;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value==="__proto__"||o.value===void 0&&!r.alwaysSet||(n[i.value]=o.value)}return{status:e.value,value:n}}}const vt=Object.freeze({status:"aborted"}),Oc=s=>({status:"dirty",value:s}),pn=s=>({status:"valid",value:s}),Ed=s=>s.status==="aborted",Ad=s=>s.status==="dirty",_i=s=>s.status==="valid",fa=s=>typeof Promise<"u"&&s instanceof Promise;function ga(s,e,t,n){if(typeof e=="function"?s!==e||!0:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(s)}function Nm(s,e,t,n,r){if(typeof e=="function"?s!==e||!0:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(s,t),t}var Je,Ki,Zi;typeof SuppressedError=="function"&&SuppressedError,function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message}(Je||(Je={}));class Nn{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Md=(s,e)=>{if(_i(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Gn(s.common.issues);return this._error=t,this._error}}};function Ct(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=s;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(i,o)=>{var a,l;const{message:u}=s;return i.code==="invalid_enum_value"?{message:u??o.defaultError}:o.data===void 0?{message:(a=u??n)!==null&&a!==void 0?a:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(l=u??t)!==null&&l!==void 0?l:o.defaultError}},description:r}}class Rt{get description(){return this._def.description}_getType(e){return ir(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Qs,ctx:{common:e.parent.common,data:e.data,parsedType:ir(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(fa(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0&&n,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)},i=this._parseSync({data:e,path:r.path,parent:r});return Md(r,i)}"~validate"(e){var t,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return _i(i)?{value:i.value}:{issues:r.common.issues}}catch(i){!((n=(t=i==null?void 0:i.message)===null||t===void 0?void 0:t.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>_i(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ir(e)},r=this._parse({data:e,path:n.path,parent:n}),i=await(fa(r)?r:Promise.resolve(r));return Md(n,i)}refine(e,t){const n=r=>typeof t=="string"||t===void 0?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,i)=>{const o=e(r),a=()=>i.addIssue({code:$e.custom,...n(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>!!l||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new si({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return gr.create(this,this._def)}nullable(){return wi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return On.create(this)}promise(){return ba.create(this,this._def)}or(e){return _a.create([this,e],this._def)}and(e){return ya.create(this,e,this._def)}transform(e){return new si({...Ct(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new jc({...Ct(this._def),innerType:this,defaultValue:t,typeName:dt.ZodDefault})}brand(){return new Vv({typeName:dt.ZodBranded,type:this,...Ct(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new qc({...Ct(this._def),innerType:this,catchValue:t,typeName:dt.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Sl.create(this,e)}readonly(){return Dc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kv=/^c[^\s-]{8,}$/i,Ev=/^[0-9a-z]+$/,Av=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$v=/^[a-z0-9_-]{21}$/i,Pv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Rv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let rc;const Iv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ov=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Nv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fv=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Lv=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qv=new RegExp(`^${Fm}$`);function Lm(s){let e="[0-5]\\d";return s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s.precision?"+":"?"}`}function Dv(s){let e=`${Fm}T${Lm(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Bv(s,e){if(!Pv.test(s))return!1;try{const[t]=s.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return typeof r=="object"&&r!==null&&!(!r.typ||!r.alg)&&(!e||r.alg===e)}catch{return!1}}function zv(s,e){return!(e!=="v4"&&e||!Ov.test(s))||!(e!=="v6"&&e||!Fv.test(s))}class Vn extends Rt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Ze.string){const o=this._getOrReturnCtx(e);return De(o,{code:$e.invalid_type,expected:Ze.string,received:o.parsedType}),vt}const t=new Qs;let n;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if(o.kind==="max")e.data.length>o.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),t.dirty());else if(o.kind==="length"){const a=e.data.length>o.value,l=e.data.length<o.value;(a||l)&&(n=this._getOrReturnCtx(e,n),a?De(n,{code:$e.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&De(n,{code:$e.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),t.dirty())}else if(o.kind==="email")Rv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"email",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="emoji")rc||(rc=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),rc.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"emoji",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="uuid")Mv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"uuid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="nanoid")$v.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"nanoid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="cuid")kv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"cuid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="cuid2")Ev.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"cuid2",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="ulid")Av.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"ulid",code:$e.invalid_string,message:o.message}),t.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),De(n,{validation:"url",code:$e.invalid_string,message:o.message}),t.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"regex",code:$e.invalid_string,message:o.message}),t.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),t.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:{startsWith:o.value},message:o.message}),t.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:{endsWith:o.value},message:o.message}),t.dirty()):o.kind==="datetime"?Dv(o).test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:"datetime",message:o.message}),t.dirty()):o.kind==="date"?qv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:"date",message:o.message}),t.dirty()):o.kind==="time"?new RegExp(`^${Lm(o)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{code:$e.invalid_string,validation:"time",message:o.message}),t.dirty()):o.kind==="duration"?Tv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"duration",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="ip"?(r=e.data,((i=o.version)!=="v4"&&i||!Iv.test(r))&&(i!=="v6"&&i||!Nv.test(r))&&(n=this._getOrReturnCtx(e,n),De(n,{validation:"ip",code:$e.invalid_string,message:o.message}),t.dirty())):o.kind==="jwt"?Bv(e.data,o.alg)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"jwt",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="cidr"?zv(e.data,o.version)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"cidr",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64"?Lv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"base64",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64url"?jv.test(e.data)||(n=this._getOrReturnCtx(e,n),De(n,{validation:"base64url",code:$e.invalid_string,message:o.message}),t.dirty()):Dt.assertNever(o);var r,i;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:$e.invalid_string,...Je.errToObj(n)})}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Je.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Je.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Je.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Je.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Je.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Je.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Je.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Je.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Je.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Je.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Je.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Je.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Je.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0&&t,local:(n=e==null?void 0:e.local)!==null&&n!==void 0&&n,...Je.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:(e==null?void 0:e.precision)===void 0?null:e==null?void 0:e.precision,...Je.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Je.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Je.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Je.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Je.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Je.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Je.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Je.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Je.errToObj(t)})}nonempty(e){return this.min(1,Je.errToObj(e))}trim(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}function Uv(s,e){const t=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n;return parseInt(s.toFixed(r).replace(".",""))%parseInt(e.toFixed(r).replace(".",""))/Math.pow(10,r)}Vn.create=s=>{var e;return new Vn({checks:[],typeName:dt.ZodString,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Ct(s)})};class yi extends Rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Ze.number){const r=this._getOrReturnCtx(e);return De(r,{code:$e.invalid_type,expected:Ze.number,received:r.parsedType}),vt}let t;const n=new Qs;for(const r of this._def.checks)r.kind==="int"?Dt.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),De(t,{code:$e.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?Uv(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),De(t,{code:$e.not_finite,message:r.message}),n.dirty()):Dt.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Je.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Je.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Je.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Je.toString(t))}setLimit(e,t,n,r){return new yi({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Je.toString(r)}]})}_addCheck(e){return new yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Je.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Je.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Je.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Je.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Je.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Dt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}yi.create=s=>new yi({checks:[],typeName:dt.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...Ct(s)});class ao extends Rt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Ze.bigint)return this._getInvalidInput(e);let t;const n=new Qs;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),De(t,{code:$e.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Dt.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.bigint,received:t.parsedType}),vt}gte(e,t){return this.setLimit("min",e,!0,Je.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Je.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Je.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Je.toString(t))}setLimit(e,t,n,r){return new ao({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Je.toString(r)}]})}_addCheck(e){return new ao({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Je.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Je.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Je.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ao.create=s=>{var e;return new ao({checks:[],typeName:dt.ZodBigInt,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Ct(s)})};class Nc extends Rt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Ze.boolean){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.boolean,received:t.parsedType}),vt}return pn(e.data)}}Nc.create=s=>new Nc({typeName:dt.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...Ct(s)});class va extends Rt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Ze.date){const r=this._getOrReturnCtx(e);return De(r,{code:$e.invalid_type,expected:Ze.date,received:r.parsedType}),vt}if(isNaN(e.data.getTime()))return De(this._getOrReturnCtx(e),{code:$e.invalid_date}),vt;const t=new Qs;let n;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),De(n,{code:$e.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Dt.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new va({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Je.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Je.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}va.create=s=>new va({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:dt.ZodDate,...Ct(s)});class $d extends Rt{_parse(e){if(this._getType(e)!==Ze.symbol){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.symbol,received:t.parsedType}),vt}return pn(e.data)}}$d.create=s=>new $d({typeName:dt.ZodSymbol,...Ct(s)});class Pd extends Rt{_parse(e){if(this._getType(e)!==Ze.undefined){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.undefined,received:t.parsedType}),vt}return pn(e.data)}}Pd.create=s=>new Pd({typeName:dt.ZodUndefined,...Ct(s)});class Td extends Rt{_parse(e){if(this._getType(e)!==Ze.null){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.null,received:t.parsedType}),vt}return pn(e.data)}}Td.create=s=>new Td({typeName:dt.ZodNull,...Ct(s)});class co extends Rt{constructor(){super(...arguments),this._any=!0}_parse(e){return pn(e.data)}}co.create=s=>new co({typeName:dt.ZodAny,...Ct(s)});class Rd extends Rt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pn(e.data)}}Rd.create=s=>new Rd({typeName:dt.ZodUnknown,...Ct(s)});class fr extends Rt{_parse(e){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.never,received:t.parsedType}),vt}}fr.create=s=>new fr({typeName:dt.ZodNever,...Ct(s)});class Id extends Rt{_parse(e){if(this._getType(e)!==Ze.undefined){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.void,received:t.parsedType}),vt}return pn(e.data)}}Id.create=s=>new Id({typeName:dt.ZodVoid,...Ct(s)});class On extends Rt{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Ze.array)return De(t,{code:$e.invalid_type,expected:Ze.array,received:t.parsedType}),vt;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(o||a)&&(De(t,{code:o?$e.too_big:$e.too_small,minimum:a?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(De(t,{code:$e.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(De(t,{code:$e.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>r.type._parseAsync(new Nn(t,o,t.path,a)))).then(o=>Qs.mergeArray(n,o));const i=[...t.data].map((o,a)=>r.type._parseSync(new Nn(t,o,t.path,a)));return Qs.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new On({...this._def,minLength:{value:e,message:Je.toString(t)}})}max(e,t){return new On({...this._def,maxLength:{value:e,message:Je.toString(t)}})}length(e,t){return new On({...this._def,exactLength:{value:e,message:Je.toString(t)}})}nonempty(e){return this.min(1,e)}}function Xr(s){if(s instanceof _s){const e={};for(const t in s.shape){const n=s.shape[t];e[t]=gr.create(Xr(n))}return new _s({...s._def,shape:()=>e})}return s instanceof On?new On({...s._def,type:Xr(s.element)}):s instanceof gr?gr.create(Xr(s.unwrap())):s instanceof wi?wi.create(Xr(s.unwrap())):s instanceof Nr?Nr.create(s.items.map(e=>Xr(e))):s}On.create=(s,e)=>new On({type:s,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...Ct(e)});class _s extends Rt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Dt.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Ze.object){const l=this._getOrReturnCtx(e);return De(l,{code:$e.invalid_type,expected:Ze.object,received:l.parsedType}),vt}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof fr&&this._def.unknownKeys==="strip"))for(const l in n.data)i.includes(l)||o.push(l);const a=[];for(const l of i){const u=r[l],d=n.data[l];a.push({key:{status:"valid",value:l},value:u._parse(new Nn(n,d,n.path,l)),alwaysSet:l in n.data})}if(this._def.catchall instanceof fr){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of o)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(l==="strict")o.length>0&&(De(n,{code:$e.unrecognized_keys,keys:o}),t.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of o){const d=n.data[u];a.push({key:{status:"valid",value:u},value:l._parse(new Nn(n,d,n.path,u)),alwaysSet:u in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of a){const d=await u.key,h=await u.value;l.push({key:d,value:h,alwaysSet:u.alwaysSet})}return l}).then(l=>Qs.mergeObjectSync(t,l)):Qs.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return Je.errToObj,new _s({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var r,i,o,a;const l=(o=(i=(r=this._def).errorMap)===null||i===void 0?void 0:i.call(r,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(a=Je.errToObj(e).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new _s({...this._def,unknownKeys:"strip"})}passthrough(){return new _s({...this._def,unknownKeys:"passthrough"})}extend(e){return new _s({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _s({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:dt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _s({...this._def,catchall:e})}pick(e){const t={};return Dt.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new _s({...this._def,shape:()=>t})}omit(e){const t={};return Dt.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new _s({...this._def,shape:()=>t})}deepPartial(){return Xr(this)}partial(e){const t={};return Dt.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}),new _s({...this._def,shape:()=>t})}required(e){const t={};return Dt.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof gr;)r=r._def.innerType;t[n]=r}}),new _s({...this._def,shape:()=>t})}keyof(){return jm(Dt.objectKeys(this.shape))}}_s.create=(s,e)=>new _s({shape:()=>s,unknownKeys:"strip",catchall:fr.create(),typeName:dt.ZodObject,...Ct(e)}),_s.strictCreate=(s,e)=>new _s({shape:()=>s,unknownKeys:"strict",catchall:fr.create(),typeName:dt.ZodObject,...Ct(e)}),_s.lazycreate=(s,e)=>new _s({shape:s,unknownKeys:"strip",catchall:fr.create(),typeName:dt.ZodObject,...Ct(e)});class _a extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async r=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(function(r){for(const o of r)if(o.result.status==="valid")return o.result;for(const o of r)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=r.map(o=>new Gn(o.ctx.common.issues));return De(t,{code:$e.invalid_union,unionErrors:i}),vt});{let r;const i=[];for(const a of n){const l={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status!=="dirty"||r||(r={result:u,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const o=i.map(a=>new Gn(a));return De(t,{code:$e.invalid_union,unionErrors:o}),vt}}get options(){return this._def.options}}_a.create=(s,e)=>new _a({options:s,typeName:dt.ZodUnion,...Ct(e)});function Fc(s,e){const t=ir(s),n=ir(e);if(s===e)return{valid:!0,data:s};if(t===Ze.object&&n===Ze.object){const r=Dt.objectKeys(e),i=Dt.objectKeys(s).filter(a=>r.indexOf(a)!==-1),o={...s,...e};for(const a of i){const l=Fc(s[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}if(t===Ze.array&&n===Ze.array){if(s.length!==e.length)return{valid:!1};const r=[];for(let i=0;i<s.length;i++){const o=Fc(s[i],e[i]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return t===Ze.date&&n===Ze.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class ya extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(i,o)=>{if(Ed(i)||Ed(o))return vt;const a=Fc(i.value,o.value);return a.valid?((Ad(i)||Ad(o))&&t.dirty(),{status:t.value,value:a.data}):(De(n,{code:$e.invalid_intersection_types}),vt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>r(i,o)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ya.create=(s,e,t)=>new ya({left:s,right:e,typeName:dt.ZodIntersection,...Ct(t)});class Nr extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.array)return De(n,{code:$e.invalid_type,expected:Ze.array,received:n.parsedType}),vt;if(n.data.length<this._def.items.length)return De(n,{code:$e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&n.data.length>this._def.items.length&&(De(n,{code:$e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((i,o)=>{const a=this._def.items[o]||this._def.rest;return a?a._parse(new Nn(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(r).then(i=>Qs.mergeArray(t,i)):Qs.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Nr({...this._def,rest:e})}}Nr.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nr({items:s,typeName:dt.ZodTuple,rest:null,...Ct(e)})};class xl extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.object)return De(n,{code:$e.invalid_type,expected:Ze.object,received:n.parsedType}),vt;const r=[],i=this._def.keyType,o=this._def.valueType;for(const a in n.data)r.push({key:i._parse(new Nn(n,a,n.path,a)),value:o._parse(new Nn(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Qs.mergeObjectAsync(t,r):Qs.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new xl(t instanceof Rt?{keyType:e,valueType:t,typeName:dt.ZodRecord,...Ct(n)}:{keyType:Vn.create(),valueType:e,typeName:dt.ZodRecord,...Ct(t)})}}class Od extends Rt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.map)return De(n,{code:$e.invalid_type,expected:Ze.map,received:n.parsedType}),vt;const r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:r._parse(new Nn(n,a,n.path,[u,"key"])),value:i._parse(new Nn(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,d=await l.value;if(u.status==="aborted"||d.status==="aborted")return vt;u.status!=="dirty"&&d.status!=="dirty"||t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}})}{const a=new Map;for(const l of o){const u=l.key,d=l.value;if(u.status==="aborted"||d.status==="aborted")return vt;u.status!=="dirty"&&d.status!=="dirty"||t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}}}}Od.create=(s,e,t)=>new Od({valueType:e,keyType:s,typeName:dt.ZodMap,...Ct(t)});class lo extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Ze.set)return De(n,{code:$e.invalid_type,expected:Ze.set,received:n.parsedType}),vt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(De(n,{code:$e.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(De(n,{code:$e.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const d of l){if(d.status==="aborted")return vt;d.status==="dirty"&&t.dirty(),u.add(d.value)}return{status:t.value,value:u}}const a=[...n.data.values()].map((l,u)=>i._parse(new Nn(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,t){return new lo({...this._def,minSize:{value:e,message:Je.toString(t)}})}max(e,t){return new lo({...this._def,maxSize:{value:e,message:Je.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}lo.create=(s,e)=>new lo({valueType:s,minSize:null,maxSize:null,typeName:dt.ZodSet,...Ct(e)});class Nd extends Rt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Nd.create=(s,e)=>new Nd({getter:s,typeName:dt.ZodLazy,...Ct(e)});class Lc extends Rt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return De(t,{received:t.data,code:$e.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function jm(s,e){return new bi({values:s,typeName:dt.ZodEnum,...Ct(e)})}Lc.create=(s,e)=>new Lc({value:s,typeName:dt.ZodLiteral,...Ct(e)});class bi extends Rt{constructor(){super(...arguments),Ki.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return De(t,{expected:Dt.joinValues(n),received:t.parsedType,code:$e.invalid_type}),vt}if(ga(this,Ki)||Nm(this,Ki,new Set(this._def.values)),!ga(this,Ki).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return De(t,{received:t.data,code:$e.invalid_enum_value,options:n}),vt}return pn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return bi.create(e,{...this._def,...t})}exclude(e,t=this._def){return bi.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Ki=new WeakMap,bi.create=jm;class Fd extends Rt{constructor(){super(...arguments),Zi.set(this,void 0)}_parse(e){const t=Dt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Ze.string&&n.parsedType!==Ze.number){const r=Dt.objectValues(t);return De(n,{expected:Dt.joinValues(r),received:n.parsedType,code:$e.invalid_type}),vt}if(ga(this,Zi)||Nm(this,Zi,new Set(Dt.getValidEnumValues(this._def.values))),!ga(this,Zi).has(e.data)){const r=Dt.objectValues(t);return De(n,{received:n.data,code:$e.invalid_enum_value,options:r}),vt}return pn(e.data)}get enum(){return this._def.values}}Zi=new WeakMap,Fd.create=(s,e)=>new Fd({values:s,typeName:dt.ZodNativeEnum,...Ct(e)});class ba extends Rt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Ze.promise&&t.common.async===!1)return De(t,{code:$e.invalid_type,expected:Ze.promise,received:t.parsedType}),vt;const n=t.parsedType===Ze.promise?t.data:Promise.resolve(t.data);return pn(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ba.create=(s,e)=>new ba({type:s,typeName:dt.ZodPromise,...Ct(e)});class si extends Rt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:o=>{De(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){const o=r.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return vt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?vt:l.status==="dirty"||t.value==="dirty"?Oc(l.value):l});{if(t.value==="aborted")return vt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?vt:a.status==="dirty"||t.value==="dirty"?Oc(a.value):a}}if(r.type==="refinement"){const o=a=>{const l=r.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?vt:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?vt:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(r.type==="transform"){if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!_i(o))return o;const a=r.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>_i(o)?Promise.resolve(r.transform(o.value,i)).then(a=>({status:t.value,value:a})):o)}Dt.assertNever(r)}}si.create=(s,e,t)=>new si({schema:s,typeName:dt.ZodEffects,effect:e,...Ct(t)}),si.createWithPreprocess=(s,e,t)=>new si({schema:e,effect:{type:"preprocess",transform:s},typeName:dt.ZodEffects,...Ct(t)});class gr extends Rt{_parse(e){return this._getType(e)===Ze.undefined?pn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}gr.create=(s,e)=>new gr({innerType:s,typeName:dt.ZodOptional,...Ct(e)});class wi extends Rt{_parse(e){return this._getType(e)===Ze.null?pn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wi.create=(s,e)=>new wi({innerType:s,typeName:dt.ZodNullable,...Ct(e)});class jc extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Ze.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}jc.create=(s,e)=>new jc({innerType:s,typeName:dt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ct(e)});class qc extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return fa(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Gn(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Gn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}qc.create=(s,e)=>new qc({innerType:s,typeName:dt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ct(e)});class Ld extends Rt{_parse(e){if(this._getType(e)!==Ze.nan){const t=this._getOrReturnCtx(e);return De(t,{code:$e.invalid_type,expected:Ze.nan,received:t.parsedType}),vt}return{status:"valid",value:e.data}}}Ld.create=s=>new Ld({typeName:dt.ZodNaN,...Ct(s)});class Vv extends Rt{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Sl extends Rt{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?vt:r.status==="dirty"?(t.dirty(),Oc(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?vt:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new Sl({in:e,out:t,typeName:dt.ZodPipeline})}}class Dc extends Rt{_parse(e){const t=this._def.innerType._parse(e),n=r=>(_i(r)&&(r.value=Object.freeze(r.value)),r);return fa(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}}function jd(s,e){const t=typeof s=="function"?s(e):typeof s=="string"?{message:s}:s;return typeof t=="string"?{message:t}:t}function qn(s,e={},t){return s?co.create().superRefine((n,r)=>{var i,o;const a=s(n);if(a instanceof Promise)return a.then(l=>{var u,d;if(!l){const h=jd(e,n),v=(d=(u=h.fatal)!==null&&u!==void 0?u:t)===null||d===void 0||d;r.addIssue({code:"custom",...h,fatal:v})}});if(!a){const l=jd(e,n),u=(o=(i=l.fatal)!==null&&i!==void 0?i:t)===null||o===void 0||o;r.addIssue({code:"custom",...l,fatal:u})}}):co.create()}Dc.create=(s,e)=>new Dc({innerType:s,typeName:dt.ZodReadonly,...Ct(e)});var dt;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(dt||(dt={}));const We=Vn.create,Fn=yi.create,Rs=Nc.create,Di=co.create,xt=(fr.create,On.create,_s.create),Ns=_a.create,Hv=(ya.create,Nr.create),Bc=xl.create,xe=Lc.create,Qv=(bi.create,ba.create,gr.create);wi.create;function qd(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Dd=xt({enabled:Rs().default(!1)}).strict(),Kv=Ns([xe("animal"),xe("person"),xe("vehicle"),xe("other"),xe("motion")]),Cl=Hv([Fn(),Fn()]),Bd=xt({name:We().trim().min(1,"Zone Name is required"),points:Cl.array().min(3,"At least 3 points are required"),type:Ns([xe("intersect"),xe("contain")]),filter:Ns([xe("include"),xe("exclude")]),classes:Kv.array(),isPrivacyMask:Rs(),color:We().trim().regex(/^#([0-9A-Fa-f]{3}){1,2}$/,"Must be a valid hex color (e.g. #FF0000 or #F00)").default("#df2a4c")}).array(),zd=xt({motion:xt({timeout:Fn().min(10,"Minimum 10 seconds")}),object:xt({confidence:Fn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),qm=Ns([xe("high-resolution"),xe("mid-resolution"),xe("low-resolution"),xe("snapshot")]),Zv=Ns([xe("high-resolution"),xe("mid-resolution"),xe("low-resolution"),xe("auto")]),Gv=Ns([xe("bubble://"),xe("cui://"),xe("doorbird://"),xe("dvrip://"),xe("echo:"),xe("eseecloud://"),xe("exec:"),xe("expr:"),xe("ffmpeg:"),xe("flussonic://"),xe("gopro://"),xe("hass:"),xe("homekit://"),xe("http://"),xe("https://"),xe("httpx://"),xe("isapi://"),xe("ivideon:"),xe("kasa://"),xe("nest:"),xe("onvif://"),xe("ring:"),xe("roborock://"),xe("rtmp://"),xe("rtsp://"),xe("rtspx://"),xe("tapo://"),xe("tcp://"),xe("tuya://"),xe("webrtc:"),xe("webtorrent:")]).options.map(s=>s.value),Wv=new RegExp(`^(${Gv.join("|")})`),Dm=We().refine(s=>{if(!Wv.test(s))return!1;try{return new URL(s),!0}catch{return!1}},{message:"Invalid URL format or unsupported protocol"}),Jv=xt({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:qm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Dm.array().min(1,"At least one valid URL is required")}).strict(),Yv=xt({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:qm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Dm.array().min(1,"At least one valid URL is required")}).strict(),Sr=xt({id:We(),name:We().trim()}),Ud=xt({hub:Sr.array().optional(),cameraController:Sr.optional(),motionDetection:Sr.optional(),audioDetection:Sr.optional(),objectDetection:Sr.optional(),ptz:Sr.optional(),plugins:Sr.array()}).strict(),Xv=Ns([xe("auto"),xe("mse"),xe("webrtc"),xe("webrtc/tcp")]),e_=Ns([xe("16:9"),xe("8:3"),xe("4:3"),xe("auto")]),Vd=xt({decoder:Ns([xe("pillow"),xe("wasm"),xe("rust"),xe("gpu")]),fps:Fn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Ns([xe("640x480"),xe("640x360"),xe("320x240"),xe("320x180")])}),Hd=Ns([xe("camera"),xe("doorbell")]),Qd=xt({streamingMode:Xv,streamingSource:Zv,aspectRatio:e_}),Kd=xt({model:We().trim().optional(),manufacturer:We().trim().optional(),hardware:We().trim().optional(),serialNumber:We().trim().optional(),firmwareVersion:We().trim().optional(),supportUrl:We().trim().optional()}),t_=(xt({name:We().trim().min(1,"Camera name is required"),url:We().trim().url().min(1,"Camera URL is required"),type:Ns([xe("Google"),xe("Ring"),xe("HomeKit"),xe("Onvif"),xe("Hass"),xe("GoPro"),xe("Roborock"),xe("FFmpeg"),xe("DVRip"),xe("Webtorrent")]),username:We().trim().optional(),email:We().trim().email().optional(),password:We().trim().optional(),pin:We().trim().length(8,{message:"PIN must be 8 characters long"}).optional(),clientId:We().trim().optional(),clientSecret:We().trim().optional(),refreshToken:We().trim().optional(),projectId:We().trim().optional()}).strict().refine(s=>s.type!=="HomeKit"||!!s.pin,{message:"PIN is required for HomeKit cameras",path:["pin"]}).refine(s=>s.type!=="Google"||!!s.clientId,{message:"Client ID is required for Google cameras",path:["clientId"]}).refine(s=>s.type!=="Google"||!!s.clientSecret,{message:"Client Secret is required for Google cameras",path:["clientSecret"]}).refine(s=>s.type!=="Google"||!!s.projectId,{message:"Project ID is required for Google cameras",path:["projectId"]}).refine(s=>s.type!=="Google"||!!s.refreshToken,{message:"Refresh Token is required for Google cameras",path:["refreshToken"]}).refine(s=>s.type!=="Ring"||!!s.email,{message:"Email is required",path:["email"]}).refine(s=>s.type!=="Roborock"||!!s.username,{message:"Username is required",path:["username"]}).refine(s=>s.type!=="Roborock"&&s.type!=="Ring"||!!s.password,{message:"Password is required",path:["password"]}),xt({id:We(),name:We()}).strict()),s_=(xt({_id:We().default(mn()).transform(()=>mn()),nativeId:We().trim().optional(),pluginInfo:t_.optional(),disabled:Rs().default(!1),name:We().trim().min(1,"Camera name is required"),type:Hd.default("camera"),isCloud:Rs().default(!1),snapshotTTL:Fn().min(30,"Minimum cache time must be 30").default(600),info:Kd.default({model:"IP Camera",manufacturer:"camera.ui",hardware:"Camera",serialNumber:"Unknown",firmwareVersion:"Unknown",supportUrl:"Unknown"}),sources:Jv.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(e=>e.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.hotMode),{message:"Snapshot source can not be used with hotMode"}),extensions:Ud.default({hub:[],plugins:[]}),recording:Dd.default({enabled:!1}),interface:Qd.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:Bd.default([]),detectionSettings:zd.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:Vd.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||qd(e)?{...s,isCloud:!0}:s}),xt({disabled:Rs().optional(),type:Hd.optional(),name:We().trim().min(1,"Camera name is required").optional(),isCloud:Rs().optional(),snapshotTTL:Fn().min(30,"Minimum cache time must be 30").optional(),info:Kd.partial().optional(),sources:Yv.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(e=>e.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(e=>e.role==="snapshot").every(e=>!e.hotMode),{message:"Snapshot source can not be used with hotMode"}).optional(),extensions:Ud.partial().optional(),interface:Qd.partial().optional(),recording:Dd.partial().optional(),detectionZones:Bd.optional(),detectionSettings:zd.partial().optional(),frameWorkerSettings:Vd.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||qd(e))return{...s,isCloud:!0}}return s}),xt({url:We().trim()}).strict(),/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/);var Zd,Gd;(function(s){s.READY="ready",s.STARTING="starting",s.STARTED="started",s.STOPPING="stopping",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown",s.DISABLED="disabled"})(Zd||(Zd={})),function(s){s.START="start",s.STOP="stop"}(Gd||(Gd={}));const Wd=["image/jpeg","image/png"],Jd=2097152,Yd=["video/mp4","video/quicktime"],Xd=10485760,eh=["audio/mpeg","audio/wav","audio/ogg"],th=2097152,n_=(xt({pluginname:We().trim().refine(s=>s_.test(s),"Not a valid plugin name"),pluginversion:We().trim().optional().default("latest")}).strict(),xt({actionId:We(),payload:Di()}).strict(),Bc(Di(),Di()),xt({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=Jd:s.size<=Jd,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Wd.includes(s.mimetype):Wd.includes(s.type),".jpeg and .png files are accepted"),metadata:qn().transform(s=>JSON.parse(s.value)),config:qn().transform(s=>JSON.parse(s.value))}),xt({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=th:s.size<=th,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?eh.includes(s.mimetype):eh.includes(s.type),".mp3, .wav and .ogg files are accepted"),metadata:qn().transform(s=>JSON.parse(s.value)),config:qn().transform(s=>JSON.parse(s.value))}),xt({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=Xd:s.size<=Xd,"Max file size is 5 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Yd.includes(s.mimetype):Yd.includes(s.type),".mp4 files are accepted"),config:qn().transform(s=>JSON.parse(s.value))}),Bc(We(),Di()),xt({key:We()}).strict(),xt({key:We(),payload:Di()}).strict(),xt({version:We().trim().optional().default("latest")}).strict(),xt({mode:Ns([xe("disabled"),xe("port-forward"),xe("router-forward"),xe("cloudflare"),xe("custom-domain")]).default("disabled"),cloudflare:xt({tunnelToken:We().trim(),customDomain:We().trim(),tunnelUrl:We().trim(),tunnelCredentials:xt({username:We().trim(),password:We().trim()}).partial()}).partial().strict(),customDomain:xt({url:We().trim().optional()}).partial().strict()}).strict()),sh=(xt({serverAddresses:We().trim().ip().array().default([]),remoteAccess:n_}).strict(),["image/jpeg","image/jpg","image/png"]),nh=5242880,Bm=xt({index:Fn(),cameraId:We()}),zm=Ns([xe(1),xe(4),xe(6),xe(7),xe(9),xe(10),xe(12),xe(13),xe(15),xe(16),xe(20),xe(26)]),r_=Ns([xe("dnd"),xe("view")]),i_=xt({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Layout name is required"),viewSize:zm,cameras:Bm.array(),type:r_}),o_=(xt({name:We().trim().min(1,"Layout name is required"),viewSize:zm,cameras:Bm.array()}).partial().optional(),xt({views:i_.array()})),a_=xt({_id:We().default(mn()).transform(()=>mn()),cameraId:We(),points:Cl}),c_=(xt({cameraId:We(),points:Cl}).partial().optional(),xt({shortcuts:a_.array()})),rh=xt({camview:o_,cameras:Bc(We().trim(),c_)});xt({_id:We().default(mn()).transform(()=>mn()),username:We().trim().min(1,"Username is required"),password:We().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters"),passwordConfirm:We().trim().min(1,"Please confirm your password"),role:Ns([xe("admin"),xe("user")]),sessionTimer:Fn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").default(14400),rememberMe:Rs().default(!1),singleSession:Rs().default(!1),firstLogin:Rs().default(!0),preferences:rh.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),xt({username:We().trim().min(1,"Username is required"),password:We().trim().min(1,"Password is required"),rememberMe:Rs().default(!1)}).strict(),xt({username:We().trim().min(1,"Username is required").optional(),password:We().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters").optional(),passwordConfirm:We().trim().optional(),role:Ns([xe("admin"),xe("user")]).optional(),sessionTimer:Fn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").optional(),upload:Qv(qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=nh:s.size<=nh,"Max file size is 5MB.").refine(s=>(e=>e.mimetype!==void 0)(s)?sh.includes(s.mimetype):sh.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:Rs().optional(),singleSession:Rs().optional(),firstLogin:Rs().optional(),preferences:rh.partial().optional()}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"});var ih;(function(s){s.READY="ready",s.RESTARTING="restarting",s.STARTING="starting",s.STARTED="started",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown"})(ih||(ih={}));class l_ extends EventTarget{constructor(t,n,r,i,o){super();p(this,"cameraDevice");p(this,"logger");p(this,"config");p(this,"token");p(this,"initialOptions");p(this,"videoPlayer");p(this,"CONFIG",{WEBRTC:{RECONNECT_TIMER:1e3,TIMEOUT_TIMER:1e4,ICE_SERVERS:[{urls:"stun:stun.l.google.com:19302"}]},QUALITY:{METRICS_INTERVAL:5e3,METRICS_WINDOW:6e4,STABILITY_PERIOD:3e4,PACKET_LOSS_THRESHOLD:.05,FRAME_DROP_THRESHOLD:.1,QUALITY_CHANGE_COOLDOWN:5e3},MEDIA:{BUFFER_SIZE:2097152,DEFAULT_CODECS:["avc1.640029","avc1.64002A","avc1.640033","hvc1.1.6.L153.B0","mp4a.40.2","mp4a.40.5","flac","opus"]}});p(this,"ws");p(this,"pc",null);p(this,"micTransceiver",null);p(this,"mediaSource",null);p(this,"sourceBuffer",null);p(this,"buf",new Uint8Array(0));p(this,"bufLen",0);p(this,"codecList");p(this,"streamProbe");p(this,"metrics",[]);p(this,"metricsInterval");p(this,"lastQualityChange",0);p(this,"isMonitoring",!1);p(this,"wsReconnectTimer");p(this,"wsReconnectTimeout");p(this,"webrtcConnectTimeout");p(this,"webrtcReconnectTimeout");p(this,"firstFrameReceived",!1);p(this,"animationFrameId");p(this,"userRequestedMode");p(this,"internalMode");p(this,"activeMode");p(this,"isAutoSwitchingInProgress",!1);p(this,"_closed",!0);p(this,"_hasBackchannel",!1);p(this,"_hasAudio",!0);p(this,"_hasVideo",!0);p(this,"_finishLoading",!1);p(this,"userRequestedRole");p(this,"effectiveRole");p(this,"_streamingSource");this.cameraDevice=t,this.config=n,this.token=r,this.logger=i,this.initialOptions={...o},this.videoPlayer=o.videoElement,this.CONFIG.WEBRTC.RECONNECT_TIMER=o.webrtcConnectTimeout??this.CONFIG.WEBRTC.RECONNECT_TIMER,this.userRequestedMode=o.mode,this.userRequestedRole=o.role,this.internalMode=o.mode,this.activeMode=o.mode==="auto"?"webrtc":o.mode,this.setActiveMode(this.activeMode,!0),this.effectiveRole=o.role==="auto"?"low-resolution":o.role,this.buf=new Uint8Array(this.CONFIG.MEDIA.BUFFER_SIZE),this.codecList=this.createCodecsList()}get streamingSource(){return this._streamingSource}get closed(){return this._closed}get hasBackchannel(){return this._hasBackchannel}get hasAudio(){return this._hasAudio}get hasVideo(){return this._hasVideo}get finishLoading(){return this._finishLoading}get mode(){return this.userRequestedMode}get currentMode(){return this.activeMode}get currentResolution(){return this.effectiveRole}get logPrefix(){const t=new Date,n=t.toLocaleTimeString()+"."+t.getMilliseconds().toString().padStart(3,"0");return this.userRequestedMode==="auto"?`[${n}] [${this.cameraDevice.name}] [auto→${this.activeMode}]`:`[${n}] [${this.cameraDevice.name}] [${this.activeMode}]`}get wsUrl(){const t=new URL(this.config.endpoint),n=t.port!=="",r=t.protocol==="https:"?"wss:":"ws:",i=n?t.port:t.protocol==="https:"?"443":"80";return`${r}//${t.hostname}:${i}/go2rtc?src=${this.createWsSourceName()}&token=${this.token}`}async start(t){console.log(this.logPrefix,"Starting session..."),this.reset(),this._closed=!1,this.videoPlayer.addEventListener("loadeddata",this.onLoadedData.bind(this)),t&&(this.userRequestedMode=t,this.internalMode=t,this.setActiveMode(t==="auto"?"webrtc":t)),await this.initializeStreamingSource(),this.streamProbe=await this.probeStream(),this.streamProbe&&this.userRequestedMode==="auto"&&this.selectInitialMode(),this.connectWs()}close(){this._closed||(console.log(this.logPrefix,"Closing session..."),this._closed=!0,this.stopQualityMonitoring(),this.reset(),this.disconnectWs())}async restart(t,n=!1){console.log(this.logPrefix,"Restarting session..."),n?this.dispatchEvent(new Event("onSourceChange")):this.dispatchEvent(new Event("reconnect")),this.close(),await new Promise(r=>setTimeout(r,1e3)),await this.start(t)}async toggleMicrophone(t){if(this.micTransceiver)try{await this.micTransceiver.sender.replaceTrack(t)}catch(n){if(!this.micTransceiver||!t)return;console.error(this.logPrefix,"Microphone error:",n)}}async toggleRole(t){var n;if(this.userRequestedRole!==t)if(console.log(this.logPrefix,`Switching source resolution to "${t}"...`),this.userRequestedRole=t,t==="auto")await this.initializeAdaptiveStreaming();else{this.effectiveRole=t;const{source:r}=this.getSourceForResolution(t);((n=this._streamingSource)==null?void 0:n._id)!==r._id&&(this._streamingSource=r,await this.restart(void 0,!0))}}async toggleMode(t){this.userRequestedMode!==t&&(console.log(this.logPrefix,`Switching transport mode to "${t}"...`),this.userRequestedMode=t,this.internalMode=t,this.setActiveMode(t==="auto"?"webrtc":t),await this.restart())}async initializeStreamingSource(){if(this.userRequestedRole==="auto")await this.initializeAdaptiveStreaming();else{const{source:t}=this.getSourceForResolution(this.userRequestedRole);if(this._streamingSource=t,this.userRequestedMode==="auto"&&t){const n=await this.probeStream();n&&(this.checkWebRTCCompatibility(n).compatible||(console.log(`${this.logPrefix} Source not compatible with WebRTC, starting with MSE...`),this.setActiveMode("mse")))}}}checkWebRTCCompatibility(t){const n=t.audio.filter(u=>u.direction==="sendonly"),r=t.video.filter(u=>u.direction==="sendonly"),i=n.some(u=>this.isWebRtcCompatibleAudioCodec(u.codec)),o=r.some(u=>this.isWebRtcCompatibleVideoCodec(u.codec)),a=n.length>0,l=r.length>0;return{compatible:(!a||i)&&(!l||o),audioCompatible:i,videoCompatible:o}}async initializeAdaptiveStreaming(){this.userRequestedRole==="auto"&&(await this.setStreamResolution(this.effectiveRole,void 0,!0),this.startQualityMonitoring())}selectInitialMode(){if(!this.streamProbe||this.userRequestedMode!=="auto")return;const t=this.checkWebRTCCompatibility(this.streamProbe);if(t.compatible)this.internalMode="auto";else{if(t.videoCompatible){if(!t.audioCompatible){const n=this.streamProbe.audio.filter(r=>r.direction==="sendonly");console.warn(this.logPrefix,`Incompatible audio codec(s): "${n.map(r=>r.codec).join(", ")}" - Using MSE directly`)}}else{const n=this.streamProbe.video.filter(r=>r.direction==="sendonly");console.warn(this.logPrefix,`Incompatible video codec(s): "${n.map(r=>r.codec).join(", ")}" - Using MSE directly`)}this.setActiveMode("mse")}}connectWs(){this.ws=new WebSocket(this.wsUrl),this.ws.binaryType="arraybuffer",this.ws.addEventListener("open",this.onWsOpen.bind(this)),this.ws.addEventListener("close",this.onWsClose.bind(this)),this.ws.addEventListener("message",this.onWsMessage.bind(this))}disconnectWs(){this.ws&&(this.ws.removeEventListener("open",this.onWsOpen.bind(this)),this.ws.removeEventListener("close",this.onWsClose.bind(this)),this.ws.removeEventListener("message",this.onWsMessage.bind(this)),this.ws.close(),this.ws=void 0)}reset(){var t;(t=this.videoPlayer)==null||t.removeEventListener("loadeddata",this.onLoadedData.bind(this)),clearTimeout(this.wsReconnectTimeout),clearTimeout(this.webrtcConnectTimeout),clearTimeout(this.webrtcReconnectTimeout),this._finishLoading=!1,this.firstFrameReceived=!1,this.isAutoSwitchingInProgress=!1,this.micTransceiver&&(this.micTransceiver.sender.replaceTrack(null).catch(()=>{}),this.micTransceiver=null),this.pc&&(this.pc.getTransceivers().forEach(n=>{var r,i;return(i=(r=n.sender)==null?void 0:r.track)==null?void 0:i.stop()}),this.pc.close(),this.pc=null),this.videoPlayer.srcObject=null,this.videoPlayer.src="",this.videoPlayer.poster="",this.animationFrameId!==void 0&&("cancelVideoFrameCallback"in this.videoPlayer?this.videoPlayer.cancelVideoFrameCallback(this.animationFrameId):cancelAnimationFrame(this.animationFrameId),this.animationFrameId=void 0)}onWsOpen(){switch(this.internalMode){case"webrtc":case"webrtc/tcp":console.log(this.logPrefix,"Requesting WebRTC session..."),this.requestWebrtc();break;case"mse":console.log(this.logPrefix,"Requesting MSE session..."),this.requestMse();break;case"auto":console.log(this.logPrefix,"Requesting auto session (both WebRTC and MSE)..."),this.requestAuto();break;default:console.error(this.logPrefix,"Unknown mode!"),this.dispatchEvent(new ErrorEvent("error",{message:"Unknown mode!"}))}}onWsClose(){this._closed||this.wsReconnectTimer===void 0||(clearTimeout(this.wsReconnectTimeout),this.wsReconnectTimeout=setTimeout(()=>{this.restart()},this.wsReconnectTimer))}onWsMessage(t){if(typeof t.data=="string"){const n=JSON.parse(t.data);if(n.type)switch(n.type){case"mse":this.onMseData(n);break;case"webrtc/candidate":case"webrtc/answer":this.onWebrtcData(n);break;case"error":this.handleStreamError(n)}}else this.onMseBuffer(t.data),this.onFirstFrame()}handleStreamError(t){this.isAutoSwitchingInProgress||this.internalMode==="auto"||(this.dispatchEvent(new ErrorEvent("error",{error:t,message:t.value})),this.close())}async requestWebrtc(t){t||this.reset(),t&&this.mediaSource||(this.webrtcConnectTimeout=setTimeout(()=>{if(console.log(this.logPrefix,"WebRTC connection timeout"),this.pc&&this.pc.connectionState!=="connected")if(this.pc.close(),this.pc=null,this.userRequestedMode==="auto"){if(this.mediaSource&&this.sourceBuffer&&this._finishLoading)return console.log(this.logPrefix,"WebRTC timed out but MSE is working - staying with MSE"),this.setActiveMode("mse"),void(this.isAutoSwitchingInProgress=!1);this.setActiveMode("mse"),this.requestMse()}else this.userRequestedMode==="webrtc"?this.restart("mse"):this.restart()},this.CONFIG.WEBRTC.TIMEOUT_TIMER)),this.pc=new RTCPeerConnection({bundlePolicy:"max-bundle",iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"}),this.pc.onicecandidate=r=>{var o,a;if(this.activeMode==="webrtc/tcp"&&((o=r.candidate)==null?void 0:o.protocol)==="udp")return;const i=((a=r.candidate)==null?void 0:a.toJSON().candidate)??"";i&&this.send({type:"webrtc/candidate",value:i})},this.pc.onconnectionstatechange=async()=>{var r,i,o,a;if(console.log(this.logPrefix,"onconnectionstatechange:",(r=this.pc)==null?void 0:r.connectionState),((i=this.pc)==null?void 0:i.connectionState)==="connected"){clearTimeout(this.webrtcConnectTimeout);const l=new MediaStream(this.pc.getTransceivers().filter(d=>d.currentDirection==="recvonly").map(d=>d.receiver.track)),u=l.getVideoTracks().length>0;this.userRequestedMode==="auto"?this.mediaSource&&this.sourceBuffer&&this._finishLoading&&this.activeMode==="mse"?u?(console.log(this.logPrefix,"WebRTC connected successfully - switching from MSE to WebRTC"),await this.switchToWebRTC(l)):console.log(this.logPrefix,"WebRTC connected but no video - staying with MSE"):u?(this.setActiveMode("webrtc"),this.videoPlayer.srcObject=l,this.onFinishLoading(void 0,"webrtc"),this.onFirstFrameWebrtc(l)):console.log(this.logPrefix,"WebRTC connected but no video - waiting for MSE"):(this.videoPlayer.srcObject=l,this.onFinishLoading(void 0,"webrtc"),this.onFirstFrameWebrtc(l))}else((o=this.pc)==null?void 0:o.connectionState)!=="failed"&&((a=this.pc)==null?void 0:a.connectionState)!=="disconnected"||(clearTimeout(this.webrtcConnectTimeout),clearTimeout(this.webrtcReconnectTimeout),this.webrtcReconnectTimeout=setTimeout(()=>{var l,u,d;if(((l=this.pc)==null?void 0:l.connectionState)==="failed"||((u=this.pc)==null?void 0:u.connectionState)==="disconnected"){if(this.userRequestedMode==="auto"&&this.mediaSource&&this.sourceBuffer&&this._finishLoading)return console.log(this.logPrefix,"WebRTC failed but MSE is working - staying with MSE"),this.setActiveMode("mse"),(d=this.pc)==null||d.close(),this.pc=null,void(this.isAutoSwitchingInProgress=!1);this.userRequestedMode==="auto"?(console.warn(this.logPrefix,"WebRTC failed - switching to MSE"),this.setActiveMode("mse"),this.restart()):this.activeMode==="webrtc"?(console.warn(this.logPrefix,"WebRTC failed - switching to MSE fallback"),this.restart("mse")):this.restart()}},this.CONFIG.WEBRTC.RECONNECT_TIMER))},this.pc.oniceconnectionstatechange=()=>{var r;console.log(this.logPrefix,"iceconnectionstatechange",(r=this.pc)==null?void 0:r.iceConnectionState)},this.pc.onicecandidateerror=r=>{console.log(this.logPrefix,"onicecandidateerror",r)},this.pc.onsignalingstatechange=()=>{var r;console.log(this.logPrefix,"onsignalingstatechange",(r=this.pc)==null?void 0:r.signalingState)},this.pc.onicegatheringstatechange=()=>{var r;console.log(this.logPrefix,"onicegatheringstatechange",(r=this.pc)==null?void 0:r.iceGatheringState)},this.pc.onnegotiationneeded=r=>{console.log(this.logPrefix,"onnegotiationneeded",r)},this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.addTransceiver("audio",{direction:"recvonly"}),this.micTransceiver=this.pc.addTransceiver("audio",{direction:"sendonly"});const n=await this.pc.createOffer();await this.pc.setLocalDescription(n),console.log(this.logPrefix,"Offer:",{type:n.type,sdp:n.sdp}),n.sdp?this.send({type:"webrtc/offer",value:n.sdp}):this.dispatchEvent(new ErrorEvent("error",{message:"Failed to create offer"}))}async onWebrtcData(t){var n,r;try{switch(t.type){case"webrtc/candidate":if(!t.value||this.activeMode==="webrtc/tcp"&&t.value.indexOf(" udp ")>0)return;await((n=this.pc)==null?void 0:n.addIceCandidate({candidate:t.value,sdpMid:"0"}));break;case"webrtc/answer":console.log(this.logPrefix,"Answer:",{type:"answer",sdp:t.value}),await((r=this.pc)==null?void 0:r.setRemoteDescription({type:"answer",sdp:t.value}))}}catch(i){this.dispatchEvent(new ErrorEvent("error",{error:i,message:i.message}))}}requestMse(){this.userRequestedMode==="auto"&&this.pc||this.reset();const t="ManagedMediaSource"in window;let n;if(t)n=window.ManagedMediaSource;else{if(!("MediaSource"in window))return void this.dispatchEvent(new ErrorEvent("error",{message:"MediaSource not supported"}));n=window.MediaSource}this.mediaSource=new n,this.mediaSource.addEventListener("sourceopen",()=>{t||URL.revokeObjectURL(this.videoPlayer.src),this.send({type:"mse",value:this.parseCodecs(n.isTypeSupported.bind(this))})},{once:!0}),t?(this.videoPlayer.disableRemotePlayback=!0,this.videoPlayer.srcObject=this.mediaSource):(this.videoPlayer.src=URL.createObjectURL(this.mediaSource),this.videoPlayer.srcObject=null),this.play()}onMseData(t){if(this.mediaSource&&this.mediaSource.readyState==="open")if(this.userRequestedMode==="auto"&&this.pc&&this.pc.connectionState!=="failed"||this.setActiveMode("mse"),this.bufLen=0,this.buf=new Uint8Array(this.CONFIG.MEDIA.BUFFER_SIZE),this.sourceBuffer=this.mediaSource.addSourceBuffer(t.value),this.sourceBuffer.mode="segments",this.sourceBuffer.addEventListener("updateend",()=>{var n,r;if(this.sourceBuffer&&!this.sourceBuffer.updating&&this.bufLen>0)try{const i=this.buf.slice(0,this.bufLen);this.sourceBuffer.appendBuffer(i),this.bufLen=0}catch{}if(this.sourceBuffer&&!this.sourceBuffer.updating&&((n=this.sourceBuffer.buffered)!=null&&n.length)){const i=this.sourceBuffer.buffered.end(this.sourceBuffer.buffered.length-1),o=i-5,a=this.sourceBuffer.buffered.start(0);o>a&&(this.sourceBuffer.remove(a,o),(r=this.mediaSource)==null||r.setLiveSeekableRange(o,i)),this.videoPlayer.currentTime<o&&(this.videoPlayer.currentTime=o);const l=i-this.videoPlayer.currentTime;this.videoPlayer.playbackRate=l>.1?l:.1}}),this.userRequestedMode==="auto"){if(this.pc&&this.pc.connectionState==="connected")return void console.log(this.logPrefix,"MSE ready but WebRTC already connected");console.log(this.logPrefix,"MSE ready - using while waiting for WebRTC"),this.setActiveMode("mse"),this.onFinishLoading(void 0,"mse")}else this.onFinishLoading(void 0,"mse")}async onMseBuffer(t){var n,r,i;if(((n=this.mediaSource)==null?void 0:n.readyState)!=="closed")if((r=this.sourceBuffer)!=null&&r.updating||this.bufLen>0){const o=new Uint8Array(t);this.buf.set(o,this.bufLen),this.bufLen+=o.byteLength}else try{(i=this.sourceBuffer)==null||i.appendBuffer(t)}catch{}else this._closed||this.internalMode==="auto"||(this.dispatchEvent(new ErrorEvent("error",{message:"MediaSource closed"})),this.userRequestedMode==="auto"?(this.setActiveMode("webrtc"),this.restart()):this.restart("webrtc"))}requestAuto(){if(this.isAutoSwitchingInProgress=!0,this.streamProbe&&!this.checkWebRTCCompatibility(this.streamProbe).compatible)return console.log(this.logPrefix,"Stream not compatible with WebRTC, using MSE only"),void this.requestMse();console.log(this.logPrefix,"Starting both WebRTC and MSE transports in parallel"),this.requestMse(),this.requestWebrtc(!0)}send(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(t))}async switchToWebRTC(t){this.setActiveMode("webrtc"),this.videoPlayer.srcObject=t,this.play(),this.onFinishLoading(!0,"webrtc"),this.onFirstFrameWebrtc(t),this.mediaSource&&(this.mediaSource.readyState==="open"&&this.mediaSource.endOfStream(),this.mediaSource=null,this.sourceBuffer=null),this.disconnectWs()}async play(){try{await this.videoPlayer.play()}catch(t){if(!this.videoPlayer.muted)return this.videoPlayer.muted=!0,this.play();this.logger.warn(this.cameraDevice.name,t)}}startQualityMonitoring(){this.isMonitoring||this.userRequestedRole!=="auto"||(clearInterval(this.metricsInterval),this.isMonitoring=!0,this.metrics=[],this.metricsInterval=setInterval(async()=>{if(this._closed)return void this.stopQualityMonitoring();const t=await this.gatherMetrics();if(t){this.metrics.push(t);const n=Date.now()-this.CONFIG.QUALITY.METRICS_WINDOW;this.metrics=this.metrics.filter(r=>r.timestamp>n),this.userRequestedRole==="auto"&&this.analyzeAndAdaptQuality()}},this.CONFIG.QUALITY.METRICS_INTERVAL))}stopQualityMonitoring(){clearInterval(this.metricsInterval),this.metricsInterval=void 0,this.isMonitoring=!1,this.metrics=[]}async gatherMetrics(){if(this._closed)return null;if(this.pc&&this.activeMode==="webrtc")try{const t=await this.pc.getStats(),n={packetsLost:0,packetsReceived:0,framesDropped:0,framesReceived:0,timestamp:Date.now()};for(const[,r]of t.entries())r.type==="inbound-rtp"&&r.kind==="video"?(n.packetsLost=r.packetsLost,n.packetsReceived=r.packetsReceived):r.type==="media-source"&&r.kind==="video"&&(n.framesDropped=r.framesDropped,n.framesReceived=r.framesReceived);return n}catch(t){return console.warn(`${this.logPrefix} Error gathering WebRTC metrics:`,t),null}else if(this.activeMode==="mse"&&this.videoPlayer)try{const t=this.videoPlayer.getVideoPlaybackQuality();return{packetsLost:0,packetsReceived:0,framesDropped:t.droppedVideoFrames,framesReceived:t.totalVideoFrames,timestamp:Date.now()}}catch(t){return console.warn(`${this.logPrefix} Error gathering MSE metrics:`,t),null}return null}analyzeQualityMetrics(){if(Date.now()-this.lastQualityChange<this.CONFIG.QUALITY.QUALITY_CHANGE_COOLDOWN)return{packetLossRate:0,frameDropRate:0,isStable:!0};if(this.metrics.length<2)return{packetLossRate:0,frameDropRate:0,isStable:!0};const t=this.metrics[this.metrics.length-1],n=this.metrics[0],r=(t.packetsLost-n.packetsLost)/Math.max(t.packetsReceived-n.packetsReceived,1),i=(t.framesDropped-n.framesDropped)/Math.max(t.framesReceived-n.framesReceived,1);return{packetLossRate:r,frameDropRate:i,isStable:r<this.CONFIG.QUALITY.PACKET_LOSS_THRESHOLD&&i<this.CONFIG.QUALITY.FRAME_DROP_THRESHOLD}}async analyzeAndAdaptQuality(){if(this.userRequestedRole!=="auto"||this._closed)return;const t=this.analyzeQualityMetrics(),n=Date.now()-this.lastQualityChange;if(t.isStable){if(t.isStable&&n>this.CONFIG.QUALITY.STABILITY_PERIOD){const r=t.packetLossRate,i=t.frameDropRate;r<this.CONFIG.QUALITY.PACKET_LOSS_THRESHOLD/2&&i<this.CONFIG.QUALITY.FRAME_DROP_THRESHOLD/2&&(this.effectiveRole==="low-resolution"?await this.setStreamResolution("mid-resolution","upgrade"):this.effectiveRole==="mid-resolution"&&await this.setStreamResolution("high-resolution","upgrade"))}}else this.effectiveRole==="high-resolution"?await this.setStreamResolution("mid-resolution","downgrade"):this.effectiveRole==="mid-resolution"&&await this.setStreamResolution("low-resolution","downgrade")}async setStreamResolution(t,n,r){var l;if(this._closed)return;const{source:i,sourceResolution:o,isRequestedSource:a}=this.getSourceForResolution(t);if(i._id!==((l=this._streamingSource)==null?void 0:l._id)){if(n==="upgrade"?console.log(`${this.logPrefix} Quality stable, upgrading to "${t}" source...`):n==="downgrade"&&console.log(`${this.logPrefix} Quality unstable, downgrading to "${t}" source...`),console.log(a||r?`${this.logPrefix} Switching to "${o}" source...`:`${this.logPrefix} Source "${t}" not available, switching to next best available: ${o}`),this.effectiveRole=o,this._streamingSource=i,this.lastQualityChange=Date.now(),!r&&this.userRequestedMode==="auto"){const u=await this.probeStream();if(u){const d=this.checkWebRTCCompatibility(u);if(this.activeMode.startsWith("webrtc")&&!d.compatible)return console.log(`${this.logPrefix} New source not compatible with WebRTC, switching to MSE...`),this.isAutoSwitchingInProgress=!0,void await this.restart("mse",!0);if(this.activeMode==="mse"&&d.compatible)return console.log(`${this.logPrefix} New source compatible with WebRTC, switching back...`),this.isAutoSwitchingInProgress=!0,void await this.restart("webrtc",!0)}}r||await this.restart(this.activeMode,!0)}else this.effectiveRole=r||a?o:t}getSourceForResolution(t){const n=["high-resolution","mid-resolution","low-resolution"],r=this.cameraDevice.sources.map(u=>u.role).filter(u=>n.includes(u)),i=r.reduce((u,d)=>n.indexOf(u)>n.indexOf(d)?u:d,"low-resolution"),o=this.cameraDevice.sources.find(u=>u.role===t),a=this.cameraDevice.sources.find(u=>u.role===i),l=o??a??this.cameraDevice.streamSource;if(this._streamingSource){if(this._streamingSource.role===t)return{source:this._streamingSource,sourceResolution:t,isRequestedSource:!0};const u=n.indexOf(t);if(u===-1)return{source:l,sourceResolution:l.role,isRequestedSource:!0};for(let d=u;d<n.length;d++){const h=n[d],v=`${h.split("-")[0]}ResolutionSource`,f=this.cameraDevice[v];if(f)return f._id===this._streamingSource._id?{source:this._streamingSource,sourceResolution:this._streamingSource.role,isRequestedSource:this._streamingSource.role===t}:{source:f,sourceResolution:h,isRequestedSource:h===t}}}return{source:l,sourceResolution:l.role,isRequestedSource:!1}}onFirstFrameWebrtc(t){const n=this.isAutoSwitchingInProgress,r=t.getVideoTracks()[0];if((!this.firstFrameReceived||n)&&r)if("requestVideoFrameCallback"in this.videoPlayer)this.animationFrameId=this.videoPlayer.requestVideoFrameCallback(()=>{this.onFirstFrame(n)});else{const i=()=>{this.videoPlayer.readyState>=2&&this.videoPlayer.videoWidth>0?this.onFirstFrame(n):this.animationFrameId=requestAnimationFrame(i)};this.animationFrameId=requestAnimationFrame(i)}}setActiveMode(t,n){(this.activeMode!==t||n)&&(this.activeMode=t,this.dispatchEvent(new Event("onModeChange")))}onFirstFrame(t){this.firstFrameReceived&&!t||(console.log(this.logPrefix,"First frame received"),this.firstFrameReceived=!0,this.dispatchEvent(new Event("onFirstFrame")))}onLoadedData(){console.log(this.logPrefix,"Loaded data"),this.dispatchEvent(new Event("onLoadedData"))}onFinishLoading(t,n){this._finishLoading&&!t||(this._finishLoading=!0,this.dispatchEvent(new Event("onFinishLoading"))),n&&n!=="auto"&&this.setActiveMode(n)}createCodecsList(){const t=[...this.CONFIG.MEDIA.DEFAULT_CODECS],n=typeof window>"u"?null:/Version\/(\d+).+Safari/.exec(navigator.userAgent);if(n!=null&&n[1]){const r=n[1]<"13"?"mp4a.40.2":n[1]<"14"?"flac":"opus";t.splice(t.indexOf(r))}return t}parseCodecs(t){return this.codecList.filter(n=>["video","audio","microphone"].includes(n.indexOf("vc1")>0?"video":"audio")).filter(n=>t(`video/mp4; codecs="${n}"`)).join()}async probeStream(){try{if(!this.streamingSource)throw new Error("No streaming source set");const t=await this.cameraDevice.probeStream(this.streamingSource._id,{video:!0,audio:["pcma","opus"],microphone:!0});return console.log(this.logPrefix,"Stream probe:",t),t&&(this._hasBackchannel=t.audio.some(n=>n.direction==="recvonly"),this._hasAudio=t.audio.filter(n=>n.direction==="sendonly").length>0,this._hasVideo=t.video.filter(n=>n.direction==="sendonly").length>0,this.dispatchEvent(new Event("onStreamProbe"))),t}catch(t){return void console.error("Error probing stream",t)}}isWebRtcCompatibleAudioCodec(t){return["opus","G722","PCMU","PCMA"].includes(t)}isWebRtcCompatibleVideoCodec(t){return["H264","VP8","VP9"].includes(t)||t==="H265"&&this.isWebRTCH265Supported()}createWsSourceName(){if(!this.cameraDevice||!this.streamingSource)throw new Error("Camera device or streaming source not set");return`${this.cameraDevice.name.replace(/ /g,"_").toLowerCase()}_${this.streamingSource.name.replace(/ /g,"_").toLowerCase()}`}isWebRTCH265Supported(){var t;try{console.log(this.logPrefix,"Checking for H.265 support...",RTCRtpSender==null?void 0:RTCRtpSender.getCapabilities("video"));const n=(t=RTCRtpSender==null?void 0:RTCRtpSender.getCapabilities("video"))==null?void 0:t.codecs;return!!n&&n.some(r=>r.mimeType.toLowerCase().includes("h265")||r.mimeType.toLowerCase().includes("hevc"))}catch{return!1}}}class u_ extends yv{constructor(t,n,r,i,o){super(i,o);p(this,"proxy");p(this,"config");p(this,"token");p(this,"subscription");p(this,"namespaces");p(this,"cameraInterfaces");this.proxy=t,this.config=n,this.token=r,this.namespaces=oo.cameraNamespaces(this.id),this.cameraInterfaces=new ea(this.proxy,this.capabilities,this.id)}get sources(){return JSON.parse(JSON.stringify(this.cameraSubject.getValue().sources)).map(t=>({...t,snapshot:async n=>this.snapshot(t._id,n),probeStream:async(n,r=!1)=>this.probeStream(t._id,n,r)}))}async init(){var t;(t=this.subscription)==null||t.unsubscribe(),this.subscription=this.proxy.subscribe(this.namespaces.cameraSubject,this.onEventMessage.bind(this)),await this.refreshStates()}async close(){await this.cleanup()}createWebRTCSession(t){return new l_(this,this.config,this.token,this.logger,t)}async refreshStates(){const t=await this.cameraControllerProxy(),n=await t.refreshStates();super.updateCamera(n.camera),super.updateCameraState(n.cameraState),super.updateFrameWorkerState(n.frameWorkerState),super.updateCapabilities(n.capabilities);for(const[r,i]of Object.entries(n.states))super.updateStateInternal(r,i,!0)}async cleanup(){var t;this.removeAllListeners(),this.unsubscribe(),(t=this.subscription)==null||t.unsubscribe(),this.subscription=void 0,await this.disconnectRpc()}async snapshot(t,n){const r=this.snapshotCache.get(t);if(!n&&r)return r;const i=await this.cameraControllerProxy(),o=await i.snapshot(t,n);return o&&o.byteLength>0?(this.snapshotCache.set(t,o),o):void 0}async probeStream(t,n,r=!1){return(await this.cameraControllerProxy()).probeStream(t,n,r)}async onEventMessage(t){const n=t.data;if("type"in n)switch(n.type){case"removed":this.cleanup();break;case"updated":super.updateCamera(n.data);break;case"cameraState":super.updateCameraState(n.data);break;case"frameWorkerState":super.updateFrameWorkerState(n.data);break;case"capabilities":super.updateCapabilities(n.data)}else{const r=n.stateName,i=n.data.newEvent;super.updateStateInternal(r,i,!0)}}async cameraControllerProxy(){return await this.proxy.createRPCProxy(this.namespaces.cameraControllerRpc,{timeout:1e4})}async disconnectRpc(){await this.proxy.disconnectRPCConnection(this.namespaces.cameraControllerRpc),await this.cameraInterfaces.disconnect()}}class d_{constructor(e){p(this,"proxy");p(this,"namespaces");p(this,"rpcConnections",new Map);this.proxy=e,this.namespaces=oo.coreManagerNamespaces()}async connectToPlugin(e){const t=await this.coreManagerProxy(),n=await t.getPlugin(e);if(n){const r=oo.pluginNamespaces(n.id);try{let i;return this.rpcConnections.has(r.pluginChildRpc)?(i=this.rpcConnections.get(r.pluginChildRpc),await i.connect()):(i=await this.proxy.createRPCConnection(r.pluginChildRpc),this.rpcConnections.set(r.pluginChildRpc,i)),i.createProxy()}catch{return}}}async getFFmpegPath(){return await(await this.coreManagerProxy()).getFFmpegPath()}async getHwaccelInfo(e){return await(await this.coreManagerProxy()).getHwaccelInfo(e)}async getServerAddresses(){return await(await this.coreManagerProxy()).getServerAddresses()}async getIceServers(){return await(await this.coreManagerProxy()).getIceServers()}async coreManagerProxy(){return await this.proxy.createRPCProxy(this.namespaces.coreManagerRpc)}}class h_{constructor(e,t,n,r){p(this,"proxy");p(this,"config");p(this,"token");p(this,"logger");p(this,"namespaces");this.proxy=e,this.config=t,this.token=n,this.logger=r,this.namespaces=oo.deviceManagerNamespaces()}async getCamera(e){const t=await this.deviceManagerProxy(),n=await t.getCamera(e,"@camera.ui/client");if(n){const r=new u_(this.proxy,this.config,this.token,n,this.logger);return await r.init(),r}}async deviceManagerProxy(){return await this.proxy.createRPCProxy(this.namespaces.deviceManagerRpc)}}class m_{constructor(e){p(this,"interceptor");p(this,"config");p(this,"logger");p(this,"proxy");p(this,"token");p(this,"_api");this.config=e,this.logger=e.logger??{...console,attention:console.warn,success:console.log},this.interceptor=new _1(e.endpoint)}get api(){return this._api}async connect(){if(this._api)return this._api;this.token=await this.login(),this.proxy=new Yg({endpoints:this.getNatsEndpoint(this.token),tls:void 0,auth:{user:"secret",password:"secret"},metadata:{id:"@camera-ui/browser-client",name:"@camera-ui/browser-client"},connect:{waitForServer:!0},reconnect:{enabled:!0},metrics:!1,bundledConnection:!0}),await this.proxy.start();const e=new d_(this.proxy),t=new h_(this.proxy,this.config,this.token,this.logger);return this._api={coreManager:e,deviceManager:t},this._api}async disconnect(){var e;if(await((e=this.proxy)==null?void 0:e.stop()),this.token)try{await this.interceptor.post("/auth/logout",void 0,{headers:{Authorization:`Bearer ${this.token}`}})}catch{}this._api=void 0,this.token=void 0}async updateCredentials(e){this.config={...this.config,...e}}async login(){if(this.config.username&&this.config.password)try{return(await(await this.interceptor.post("/auth/login",{username:this.config.username,password:this.config.password})).json()).access_token}catch(e){throw new Error(`Invalid credentials: ${e.message}`)}else{if(this.config.skipCheck)return this.config.token;try{return await this.interceptor.get("/auth/check",{headers:{Authorization:`Bearer ${this.config.token}`}}),this.config.token}catch(e){throw new Error(`Invalid token: ${e.message}`)}}}getNatsEndpoint(e){const t=new URL(this.config.endpoint),n=t.port!=="",r=t.protocol==="https:"?"wss:":"ws:",i=n?t.port:t.protocol==="https:"?"443":"80";return[`${r}//${t.hostname}:${i}/proxy?token=${e}`]}}const Ie=lf.create({baseURL:`${location.origin}/api`});Ie.interceptors.request.use(s=>{const{accessToken:e}=Fs();return e&&(s.headers.Authorization=`Bearer ${e}`),s},s=>Promise.reject(s));Ie.interceptors.response.use(s=>s,async s=>{var n,r,i,o,a,l;const e=s.config,t=((r=(n=s.response)==null?void 0:n.data)==null?void 0:r.message)==="Token expired"||((a=(o=(i=s.response)==null?void 0:i.data)==null?void 0:o.message)==null?void 0:a.name)==="TokenExpiredError";if(((l=s.response)==null?void 0:l.status)===401&&t&&!e._retry){e._retry=!0;try{const{refreshToken:u}=Fs();return await u(),Ie(e)}catch(u){return Promise.reject(u)}}return Promise.reject(s)});const Cn=()=>({add:e=>{P0.emit("add",e)}}),Um=async s=>(await Ie.get("/auth/check",{signal:s})).data,p_=async({parameter:s,signal:e})=>(await Ie.get("/auth/tokens",{params:s,signal:e})).data,Vm=async({loginInformation:s})=>(await Ie.post("/auth/login",s)).data,Hm=async()=>(await Ie.post("/auth/logout")).data,f_=async({id:s,access_token:e})=>(await Ie.post(`/auth/logout/${s}`,null,{params:{token:e}})).data,Qm=async({refresh_token:s})=>(await Ie.post("/auth/refresh",{refresh_token:s})).data;class a9{constructor(){p(this,"_queryClient",Ci());p(this,"authStore",Fs());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"checkQuery",enabled:!0},{name:"listQuery",enabled:!0}]))}get queryClient(){return this._queryClient}checkQuery(){var e;return Bt({queryKey:["auth",(e=this.authStore.user)==null?void 0:e.username],queryFn:({signal:t})=>Um(t),enabled:()=>this.queryActivator.value.some(t=>t.name==="checkQuery"&&t.enabled)})}listQuery(e){return Bt({queryKey:["tokensList",e],queryFn:({signal:t})=>p_({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="listQuery"&&t.enabled)})}loginQuery(){return ut({mutationFn:Vm})}logoutQuery(){return ut({mutationFn:Hm})}logoutTokenQuery(){return ut({mutationFn:f_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["tokensList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_logged_out"),life:3e3})}})}refreshQuery(){return ut({mutationFn:Qm})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const g_=async({userData:s})=>(await Ie.post("/users",s)).data,v_=async({username:s,signal:e})=>(await Ie.get(`/users/${s}`,{signal:e})).data,__=async({parameter:s,signal:e})=>(await Ie.get("/users",{params:s,signal:e})).data,wa=async({username:s,userData:e})=>(await Ie.patch(`/users/${s}`,e)).data,y_=async({username:s})=>(await Ie.delete(`/users/${s}`)).data,b_=async()=>(await Ie.delete("/users")).data,w_=async({username:s,cameraname:e,shortcutData:t})=>(await Ie.post(`/users/${s}/preferences/cameras/${e}/shortcuts`,t)).data,x_=async({username:s,cameraname:e,shortcutid:t,signal:n})=>(await Ie.get(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,{signal:n})).data,S_=async({username:s,cameraname:e,signal:t})=>(await Ie.get(`/users/${s}/preferences/cameras/${e}/shortcuts`,{signal:t})).data,C_=async({username:s,cameraname:e,shortcutid:t,shortcutData:n})=>(await Ie.patch(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,n)).data,k_=async({username:s,cameraname:e,shortcutid:t})=>(await Ie.delete(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`)).data,E_=async({username:s,cameraname:e})=>(await Ie.delete(`/users/${s}/preferences/cameras/${e}/shortcuts`)).data,A_=async({username:s,viewData:e})=>(await Ie.post(`/users/${s}/preferences/camview/views`,e)).data,M_=async({username:s,viewid:e,signal:t})=>(await Ie.get(`/users/${s}/preferences/camview/views/${e}`,{signal:t})).data,$_=async({username:s,parameter:e,signal:t})=>(await Ie.get(`/users/${s}/preferences/camview/views`,{params:e,signal:t})).data,oh=async({username:s,viewid:e,viewData:t})=>(await Ie.patch(`/users/${s}/preferences/camview/views/${e}`,t)).data,P_=async({username:s,viewid:e})=>(await Ie.delete(`/users/${s}/preferences/camview/views/${e}`)).data,T_=async({username:s})=>(await Ie.delete(`/users/${s}/preferences/camview/views`)).data;class R_{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"getUserQuery",enabled:!0},{name:"getUsersQuery",enabled:!0},{name:"getShortcutQuery",enabled:!0},{name:"getShortcutsQuery",enabled:!0},{name:"getViewQuery",enabled:!0},{name:"getViewsQuery",enabled:!0}]))}get queryClient(){return this._queryClient}createUserQuery(){return ut({mutationFn:g_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["usersList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_added"),life:3e3})}})}getUserQuery(e){return Bt({queryKey:["users",e],queryFn:({signal:t})=>v_({username:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getUserQuery"&&t.enabled)})}getUsersQuery(e){return Bt({queryKey:["usersList",e],queryFn:({signal:t})=>__({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getUsersQuery"&&t.enabled)})}patchUserQuery(){return ut({mutationFn:async({username:e,userData:t,formData:n})=>{await wa({username:e,userData:t}),n&&await wa({username:e,userData:n})},onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["users",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_updated"),life:3e3})}})}removeUserQuery(){return ut({mutationFn:y_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["usersList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.user_removed"),life:3e3})}})}removeUsersQuery(){return ut({mutationFn:b_,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["usersList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.users_removed"),life:3e3})}})}createShortcutQuery(){return ut({mutationFn:w_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})}})}getShortcutQuery(e,t,n){return Bt({queryKey:["shortcutsList",e,t,n],queryFn:({signal:r})=>x_({username:c(e),cameraname:c(t),shortcutid:c(n),signal:r}),enabled:()=>this.queryActivator.value.some(r=>r.name==="getShortcutQuery"&&r.enabled)})}getShortcutsQuery(e,t){return Bt({queryKey:["shortcutsList",e,t],queryFn:({signal:n})=>S_({username:c(e),cameraname:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getShortcutsQuery"&&n.enabled)})}patchShortcutQuery(){return ut({mutationFn:C_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})},onError:e=>{console.log(e),this.toast.add({severity:"error",summary:this.t("components.toast.title_error"),detail:this.t("components.toast.error_see_console"),life:3e3})}})}removeShortcutQuery(){return ut({mutationFn:k_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})},onError:e=>{console.log(e),this.toast.add({severity:"error",summary:this.t("components.toast.title_error"),detail:this.t("components.toast.error_see_console"),life:3e3})}})}removeShortcutsQuery(){return ut({mutationFn:E_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})},onError:e=>{console.log(e),this.toast.add({severity:"error",summary:this.t("components.toast.title_error"),detail:this.t("components.toast.error_see_console"),life:3e3})}})}createViewQuery(){return ut({mutationFn:A_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.view_added"),life:3e3})}})}getViewQuery(e,t){return Bt({queryKey:["viewsList",e],queryFn:({signal:n})=>M_({username:c(e),viewid:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getUserQuery"&&n.enabled)})}getViewsQuery(e,t){return Bt({queryKey:["viewsList",e,t],queryFn:({signal:n})=>$_({username:c(e),parameter:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getViewsQuery"&&n.enabled)})}patchViewQuery(){return ut({mutationFn:oh,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.view_updated"),life:3e3})}})}patchViewQuerySilent(){return ut({mutationFn:oh,onSuccess:async(e,t)=>{await this._queryClient.invalidateQueries({queryKey:["viewsList",t.username]})}})}removeViewQuery(){return ut({mutationFn:P_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.view_removed"),life:3e3})}})}removeViewsQuery(){return ut({mutationFn:T_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["viewsList",t.username]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.views_removed"),life:3e3})}})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}function kl(s,e,t,n=[]){if(Array.isArray(s)&&Array.isArray(e)){const r=t?t(s,e,void 0,s,e,n):void 0;return r!==void 0?r:[...s,...e]}if(typeof e!="object")return s;for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=s[r],o=e[r];n.push({key:r,sourceObject:s,targetObject:e}),Array.isArray(i)&&Array.isArray(o)?s[r]=[...i,...o]:typeof i=="object"&&i!==null&&typeof o=="object"&&o!==null?s[r]=kl({...i},o,t,n):s[r]=o,n.pop()}return s}function I_(s){return new Promise(e=>setTimeout(e,s))}function sa(s,e,t=!1){if(s===e)return!0;if((s===void 0||e===void 0||s===null||e===null)&&(s||e))return!1;const n=s==null?void 0:s.constructor.name,r=e==null?void 0:e.constructor.name;if(n!==r)return!1;if(n==="Array"&&r==="Array"){if(s.length!==e.length)return!1;if(t){const i=[...e];return s.every(o=>{const a=i.findIndex(l=>sa(o,l,t));return a===-1?!1:(i.splice(a,1),!0)})}else{let i=!0;for(let o=0;o<s.length;o++)if(!sa(s[o],e[o],t)){i=!1;break}return i}}if(n==="Object"&&r==="Object"){let i=!0;const o=Object.keys(s),a=Object.keys(e);if(o.length!==a.length)return!1;for(let l=0;l<o.length;l++)if(s[o[l]]&&e[o[l]]){if(s[o[l]]===e[o[l]])continue;if(s[o[l]]&&(s[o[l]].constructor.name==="Array"||s[o[l]].constructor.name==="Object")){if(i=sa(s[o[l]],e[o[l]],t),!i)break}else if(s[o[l]]!==e[o[l]]){i=!1;break}}else if(s[o[l]]&&!e[o[l]]||!s[o[l]]&&e[o[l]]){i=!1;break}return i}return s===e}const Fs=Mi("auth",()=>{const s=$i(),e=qr(),t=tl("user",null,{serializer:{read:K=>K?JSON.parse(K):null,write:K=>JSON.stringify(K)}}),n=Ls(null),r=Ls(null),i=Ls(null),o=ae(!1),a=ae(!1),l=ae(!1),u=ne(()=>t.value!==null),d=ne(()=>r.value!==null&&!i.value&&!o.value),h=ne(()=>{var K;return((K=t.value)==null?void 0:K.access_token)??null});Ge(s,()=>{a.value=!1},{deep:!0}),Ge(t,K=>{!a.value&&!sa(K,t.value)&&k()},{deep:!0});const v=async K=>{if(r.value)return r.value;o.value=!0,i.value=null;try{n.value||(n.value=new m_({endpoint:window.origin,token:K,skipCheck:!0,logger:{...console,attention:console.warn,success:console.log}}));const N=await n.value.connect();return r.value=N,N}catch(N){const E=N instanceof Error?N:new Error(String(N));throw i.value=E,E}finally{o.value=!1}},f=async()=>{n.value&&(await n.value.disconnect(),n.value=null,r.value=null,i.value=null,o.value=!1)},b=async K=>{if(!u.value){l.value=!1,a.value=!0;try{const N=await Vm({loginInformation:K});t.value=N,await v(N.access_token),e.push("/cameras")}finally{a.value=!1}}},k=async()=>{!u.value||l.value||(l.value=!0,a.value=!0,await f(),L(),await Hm(),t.value=null,e.push("/"),window.location.reload(),a.value=!1)},z=async()=>{if(!t.value)return;const K=await Qm({refresh_token:t.value.refresh_token});n.value&&await n.value.updateCredentials({endpoint:window.origin,token:K.access_token}),t.value.access_token=K.access_token},L=async()=>{try{if("serviceWorker"in navigator){const N=await(await navigator.serviceWorker.ready).pushManager.getSubscription();N&&await N.unsubscribe()}}catch{}},se=async(K,N)=>{t.value&&(K&&await wa({username:t.value.username,userData:K}),N&&await wa({username:t.value.username,userData:N}))};return u.value&&h.value&&v(h.value).catch(K=>{console.error("Error initializing API:",K)}),{isLoggedIn:u,isApiReady:d,loginLoading:a,api:r,apiError:i,accessToken:h,user:t,login:b,logout:k,refreshToken:z,updateUser:se,initializeApi:v,disconnectApi:f}}),Bi=(s,e="ddd., D. MMM. YY")=>(typeof s=="number"&&(s=new Date(s)),G0(s,e).value),Fr=(s="logo-512.png")=>{var r,i,o,a;if(s.startsWith("data:")||s.startsWith("blob:")||s.startsWith("http:")||s.startsWith("https:"))return s;if(s.startsWith(location.origin))return location.origin+s;if((s==="ERROR"||s==="")&&(s="logo-256.png"),s==="avatar"){const l=Fs(),u=(r=l.user)==null?void 0:r.avatar,d=(i=l.user)==null?void 0:i._id,h=(o=l.user)==null?void 0:o.access_token;if(h&&u)return`${location.origin}/api/files/${d}_avatar.jpeg?token=${h}`;s="logo-256.png"}if(s.includes("avatar")){const u=(a=Fs().user)==null?void 0:a.access_token;if(u)return`${location.origin}/api/files/${s}?token=${u}`;s="logo-256.png"}const t=`/src/assets/images/${s}`,n=Object.assign({"/src/assets/css/extras.css":Of,"/src/assets/css/inter.css":Nf,"/src/assets/css/main.css":Ff,"/src/assets/css/markdown.css":Lf,"/src/assets/css/tailwind.css":If,"/src/assets/css/theme.css":jf,"/src/assets/css/transitions.css":qf,"/src/assets/css/utils.css":Df,"/src/assets/images/error-256.png":r1,"/src/assets/images/logo-256.png":o1,"/src/assets/images/logo-512.png":c1,"/src/assets/images/logo.png":u1,"/src/assets/images/logo.svg":h1,"/src/assets/images/logo_animated.svg":p1,"/src/assets/images/logo_loading_circle.svg":g1});return n[t]?n[t].default:""},c9=async s=>new Promise(e=>{var n;s.preventDefault();const t=(n=s.target)==null?void 0:n.files;if(t){const r=t[0],i=new FileReader;r?(i.onload=o=>{var l,u;const a=(l=o.target)!=null&&l.result?(u=o.target)==null?void 0:u.result:void 0;e(a)},i.readAsDataURL(r)):e(void 0)}}),O_=(s=10)=>{const e=()=>Math.floor(Math.random()*25+10).toString(36);return Array.from({length:s},e).join("")};function xi(s,e=new WeakMap){if(typeof s!="object"||s===null)return s;if(e.has(s))return e.get(s);if(Array.isArray(s)){const n=[];return e.set(s,n),s.forEach((r,i)=>{n[i]=xi(r,e)}),n}const t={};return e.set(s,t),Object.keys(s).forEach(n=>{t[n]=xi(s[n],e)}),t}const Km=s=>{switch(s){case"error":return"error";case"info":return"info";case"success":return"success";case"warning":return"warn";default:return"info"}},l9=s=>{s||(s=new Date);const e=new Date(s);return e.setMilliseconds(0),e},u9=s=>{s||(s=new Date);const e=new Date(s);return e.setSeconds(0,0),e.setMilliseconds(0),e},N_=["src","alt"],F_=["src","alt","width","height"],L_=At({__name:"CuiImage",props:{src:{},alt:{default:"Image"},width:{default:"100%"},height:{default:"100%"},aspectRatio:{},cover:{type:Boolean},imageContainerClass:{},imageContainerStyle:{}},setup(s){const e=s,{src:t,width:n,height:r,aspectRatio:i,cover:o,imageContainerClass:a,imageContainerStyle:l}=Wt(e),u=ae(!1),d=ae(!1),h=ne(()=>d.value?Fr():Fr(t.value)),v=()=>{u.value=!0,d.value=!1},f=()=>{u.value=!1,d.value=!0},b=k=>k?typeof k=="number"?`${k}px`:k:"auto";return(k,z)=>{const L=Lr,se=T0;return m(),j(se,{alt:k.alt,class:"w-full h-full flex items-center justify-center"},{image:$(()=>[!c(u)&&!c(d)?(m(),j(L,{key:0,"stroke-width":"6",class:"w-[50%] h-[50%] max-w-[30px] max-h-[30px]"})):ce("",!0),Pt(g("div",{class:at(c(a)),style:ot(c(l))},[c(d)?ce("",!0):Pt((m(),A("img",{key:0,src:c(h),alt:k.alt,style:ot({width:b(c(n)),height:b(c(r)),aspectRatio:c(i),objectFit:c(o)?"cover":"contain"}),onLoad:v,onError:f},null,44,N_)),[[Pr,c(u)]]),c(d)?(m(),A("img",{key:1,src:c(h),alt:k.alt,width:c(n),height:c(r),class:"contain",style:ot({aspectRatio:c(i)})},null,12,F_)):ce("",!0)],6),[[Pr,c(u)||c(d)]])]),_:1},8,["alt"])}}}),Fa=qs(L_,[["__scopeId","data-v-6696d637"]]),j_=At({__name:"CuiAvatar",props:{src:{},showBorder:{type:Boolean,default:!0},size:{default:22}},setup(s){const e=s,{showBorder:t,size:n,src:r}=Wt(e);return(i,o)=>{const a=Fa;return m(),A("div",{class:at(["bg-neutral-900 overflow-hidden rounded-full",{"avatar-border":c(t)}])},[y(a,{src:c(r),height:c(n),width:c(n),cover:"","image-container-class":"w-full h-full"},null,8,["src","height","width"])],2)}}}),Zm=qs(j_,[["__scopeId","data-v-82af9e29"]]),q_={class:"flex items-center justify-center absolute left-3 h-full"},D_={key:0,class:"flex items-center shrink-0"},B_={key:1,class:"shrink-0"},z_={key:2,class:"shrink-0"},U_={key:0,class:"overflow-hidden flex-1 ml-10"},V_={class:"flex flex-row items-center justify-between"},H_={class:"text-start flex-1"},Q_={key:0,class:"text-xs text-muted"},K_=At({__name:"CuiNavItem",props:{label:{},to:{},expanded:{type:Boolean},description:{},icon:{},iconSize:{default:24},iconClass:{},labelClass:{},activeIcon:{},avatar:{},avatarSize:{default:24},showLogout:{type:Boolean},darkMode:{type:Boolean},buttonProps:{},showTooltip:{type:Boolean},fallbackActivePath:{}},setup(s){const e=Fs(),t=$i(),n=s,{icon:r,iconSize:i,iconClass:o,activeIcon:a,avatarSize:l,avatar:u,labelClass:d,label:h,description:v,expanded:f,to:b,showLogout:k,darkMode:z,buttonProps:L,showTooltip:se,fallbackActivePath:K}=Wt(n),N=ne(()=>t.path===b.value||b.value!=="/"&&(t.path.startsWith(b.value+"/")||t.path.startsWith((K.value??b.value)+"/"))),E=()=>{e.logout()};return(O,U)=>{const S=Zm,M=Yh,B=ys,W=Ei("RouterLink"),I=jr;return m(),j(W,{to:c(b)},{default:$(({isActive:w})=>[Pt((m(),j(B,et({text:"",severity:"secondary",class:["cui-button navitem-button w-full h-full flex items-center relative",{"dark-mode":c(z),"!text-primary navitem-active":(w||c(N))&&!c(u),"hover:!text-color active:!text-color focus:!text-color":!w&&!c(N)}],fluid:""},c(L)),{default:$(()=>[g("div",q_,[c(u)?(m(),A("div",D_,[y(S,{src:c(Fr)(c(u)),size:c(l),style:ot({width:`${c(l)}px`,height:`${c(l)}px`})},null,8,["src","size","style"])])):c(r)&&!w&&!c(N)||!c(a)?(m(),A("div",B_,[y(c(r),{class:at(c(o)),style:ot({width:`${c(i)}px`,height:`${c(i)}px`})},null,8,["class","style"])])):c(a)&&(w||c(N))?(m(),A("div",z_,[y(c(a),{style:ot({width:`${c(i)}px`,height:`${c(i)}px`})},null,8,["style"])])):ce("",!0)]),y(Et,{name:"fade"},{default:$(()=>[c(f)?(m(),A("div",U_,[g("div",V_,[g("div",H_,[g("div",{class:at(["text-sm max-w-100 truncate font-semibold",[c(d),{"text-color font-bold":c(u)}]])},me(c(h)),3),c(v)?(m(),A("div",Q_,me(c(v)),1)):ce("",!0)]),c(k)?(m(),j(B,{key:0,text:"",rounded:"",class:"dark-mode cui-icon-md",onClick:E},{icon:$(()=>[y(M,{width:"100%",height:"100%"})]),_:1})):ce("",!0)])])):ce("",!0)]),_:1})]),_:2},1040,["class"])),[[I,{value:c(se)&&!c(f)?c(h):"",pt:{root:{class:"dark-mode"}}}]])]),_:1},8,["to"])}}}),Gm=qs(K_,[["__scopeId","data-v-13c365f7"]]),Z_="modulepreload",G_=function(s){return"/"+s},ah={},vs=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let o=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));r=o(t.map(u=>{if(u=G_(u),u in ah)return;ah[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${h}`))return;const v=document.createElement("link");if(v.rel=d?"stylesheet":Z_,d||(v.as="script"),v.crossOrigin="",v.href=u,l&&v.setAttribute("nonce",l),document.head.appendChild(v),d)return new Promise((f,b)=>{v.addEventListener("load",f),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return r.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},W_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J_(s,e){return m(),A("svg",W_,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m4 10l-.707.707L2.586 10l.707-.707zm17 8a1 1 0 1 1-2 0zM8.293 15.707l-5-5l1.414-1.414l5 5zm-5-6.414l5-5l1.414 1.414l-5 5zM4 9h10v2H4zm17 7v2h-2v-2zm-7-7a7 7 0 0 1 7 7h-2a5 5 0 0 0-5-5z"},null,-1)]))}const Y_=pe({name:"lets-icons-back",render:J_}),X_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e2(s,e){return m(),A("svg",X_,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8z"},null,-1)]))}const t2=pe({name:"mdi-home",render:e2}),s2={class:"relative flex items-center justify-center draggable-region"},n2={class:"container mx-auto px-6 relative z-10"},r2={class:"text-center"},i2={class:"text-8xl font-bold mb-4 relative flex items-center justify-center"},o2={class:"relative w-24 h-24 mx-2 group"},a2={class:"relative z-1 scale-150 non-draggable-region"},c2={class:"text-muted max-w-md mx-auto mb-8"},l2={class:"flex items-center justify-center gap-4"},u2={class:"text-white"},d2=At({__name:"404",setup(s){return(e,t)=>{const n=t2,r=ys,i=Ei("RouterLink"),o=Y_;return m(),A("div",s2,[g("div",n2,[g("div",r2,[g("h1",i2,[t[1]||(t[1]=g("span",null,"4",-1)),g("div",o2,[g("div",a2,[y(c($a),{src:c(Fr)("logo_animated.svg"),width:"95px",height:"80px",title:"camera.ui","aria-label":"camera.ui",class:"transform transition-transform duration-300 group-hover:scale-110"},null,8,["src"])])]),t[2]||(t[2]=g("span",null,"4",-1))]),t[3]||(t[3]=g("h2",{class:"text-3xl font-semibold mb-4"},"Oops!",-1)),g("p",c2,me(e.$t("views.404.error_message")),1),g("div",l2,[y(i,{to:"/"},{default:$(()=>[y(r,{class:"cui-button flex items-center gap-2 non-draggable-region"},{default:$(()=>[y(n,{class:"text-white"}),g("span",u2,me(e.$t("components.form.button.home")),1)]),_:1})]),_:1}),y(r,{severity:"secondary",class:"cui-button flex items-center gap-2 non-draggable-region",onClick:t[0]||(t[0]=a=>e.$router.back())},{default:$(()=>[y(o,{class:"text-muted"}),g("span",null,me(e.$t("components.form.button.back")),1)]),_:1})])])])])}}}),h2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m2(s,e){return m(),A("svg",h2,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.1.1 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.1 16.1 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.02.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02M8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12m6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12"},null,-1)]))}const p2=pe({name:"ic-baseline-discord",render:m2}),f2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g2(s,e){return m(),A("svg",f2,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"},null,-1)]))}const v2=pe({name:"mdi-github",render:g2});function Wm(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Jm=bt({enabled:xs().default(!1)}).strict(),_2=Os([we("animal"),we("person"),we("vehicle"),we("other"),we("motion")]),El=ff([xn(),xn()]),Al=bt({name:Ke().trim().min(1,"Zone Name is required"),points:El.array().min(3,"At least 3 points are required"),type:Os([we("intersect"),we("contain")]),filter:Os([we("include"),we("exclude")]),classes:_2.array(),isPrivacyMask:xs(),color:Ke().trim().regex(/^#([0-9A-Fa-f]{3}){1,2}$/,"Must be a valid hex color (e.g. #FF0000 or #F00)").default("#df2a4c")}).array(),Ym=bt({motion:bt({timeout:xn().min(10,"Minimum 10 seconds")}),object:bt({confidence:xn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),Ml=Os([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("snapshot")]),y2=Os([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("auto")]),Xm=Os([we("bubble://"),we("cui://"),we("doorbird://"),we("dvrip://"),we("echo:"),we("eseecloud://"),we("exec:"),we("expr:"),we("ffmpeg:"),we("flussonic://"),we("gopro://"),we("hass:"),we("homekit://"),we("http://"),we("https://"),we("httpx://"),we("isapi://"),we("ivideon:"),we("kasa://"),we("nest:"),we("onvif://"),we("ring:"),we("roborock://"),we("rtmp://"),we("rtsp://"),we("rtspx://"),we("tapo://"),we("tcp://"),we("tuya://"),we("webrtc:"),we("webtorrent:")]),b2=Xm.options.map(s=>s.value),w2=new RegExp(`^(${b2.join("|")})`),ep=Ke().refine(s=>{if(!w2.test(s))return!1;try{return new URL(s),!0}catch{return!1}},{message:"Invalid URL format or unsupported protocol"}),x2=bt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Ml,useForSnapshot:xs().default(!1),hotMode:xs().default(!1),urls:ep.array().min(1,"At least one valid URL is required")}).strict(),S2=bt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Ml,useForSnapshot:xs().default(!1),hotMode:xs().default(!1),urls:ep.array().min(1,"At least one valid URL is required")}).strict(),Cr=bt({id:Ke(),name:Ke().trim()}),tp=bt({hub:Cr.array().optional(),cameraController:Cr.optional(),motionDetection:Cr.optional(),audioDetection:Cr.optional(),objectDetection:Cr.optional(),ptz:Cr.optional(),plugins:Cr.array()}).strict(),C2=Os([we("auto"),we("mse"),we("webrtc"),we("webrtc/tcp")]),k2=Os([we("16:9"),we("8:3"),we("4:3"),we("auto")]),sp=bt({decoder:Os([we("pillow"),we("wasm"),we("rust"),we("gpu")]),fps:xn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Os([we("640x480"),we("640x360"),we("320x240"),we("320x180")])}),np=Os([we("camera"),we("doorbell")]),rp=bt({streamingMode:C2,streamingSource:y2,aspectRatio:k2}),ip=bt({model:Ke().trim().optional(),manufacturer:Ke().trim().optional(),hardware:Ke().trim().optional(),serialNumber:Ke().trim().optional(),firmwareVersion:Ke().trim().optional(),supportUrl:Ke().trim().optional()}),E2=bt({name:Ke().trim().min(1,"Camera name is required"),url:Ke().trim().url().min(1,"Camera URL is required"),type:Os([we("Google"),we("Ring"),we("HomeKit"),we("Onvif"),we("Hass"),we("GoPro"),we("Roborock"),we("FFmpeg"),we("DVRip"),we("Webtorrent")]),username:Ke().trim().optional(),email:Ke().trim().email().optional(),password:Ke().trim().optional(),pin:Ke().trim().length(8,{message:"PIN must be 8 characters long"}).optional(),clientId:Ke().trim().optional(),clientSecret:Ke().trim().optional(),refreshToken:Ke().trim().optional(),projectId:Ke().trim().optional()}).strict().refine(s=>s.type==="HomeKit"?!!s.pin:!0,{message:"PIN is required for HomeKit cameras",path:["pin"]}).refine(s=>s.type==="Google"?!!s.clientId:!0,{message:"Client ID is required for Google cameras",path:["clientId"]}).refine(s=>s.type==="Google"?!!s.clientSecret:!0,{message:"Client Secret is required for Google cameras",path:["clientSecret"]}).refine(s=>s.type==="Google"?!!s.projectId:!0,{message:"Project ID is required for Google cameras",path:["projectId"]}).refine(s=>s.type==="Google"?!!s.refreshToken:!0,{message:"Refresh Token is required for Google cameras",path:["refreshToken"]}).refine(s=>s.type==="Ring"?!!s.email:!0,{message:"Email is required",path:["email"]}).refine(s=>s.type==="Roborock"?!!s.username:!0,{message:"Username is required",path:["username"]}).refine(s=>s.type==="Roborock"||s.type==="Ring"?!!s.password:!0,{message:"Password is required",path:["password"]}),A2=bt({id:Ke(),name:Ke()}).strict(),M2=bt({_id:Ke().default(hn()).transform(()=>hn()),nativeId:Ke().trim().optional(),pluginInfo:A2.optional(),disabled:xs().default(!1),name:Ke().trim().min(1,"Camera name is required"),type:np.default("camera"),isCloud:xs().default(!1),snapshotTTL:xn().min(30,"Minimum cache time must be 30").default(600),info:ip.default({model:"IP Camera",manufacturer:"camera.ui",hardware:"Camera",serialNumber:"Unknown",firmwareVersion:"Unknown",supportUrl:"Unknown"}),sources:x2.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(t=>t.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.hotMode),{message:"Snapshot source can not be used with hotMode"}),extensions:tp.default({hub:[],plugins:[]}),recording:Jm.default({enabled:!1}),interface:rp.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:Al.default([]),detectionSettings:Ym.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:sp.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||Wm(e)?{...s,isCloud:!0}:s}),$2=bt({disabled:xs().optional(),type:np.optional(),name:Ke().trim().min(1,"Camera name is required").optional(),isCloud:xs().optional(),snapshotTTL:xn().min(30,"Minimum cache time must be 30").optional(),info:ip.partial().optional(),sources:S2.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(t=>t.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.hotMode),{message:"Snapshot source can not be used with hotMode"}).optional(),extensions:tp.partial().optional(),interface:rp.partial().optional(),recording:Jm.partial().optional(),detectionZones:Al.optional(),detectionSettings:Ym.partial().optional(),frameWorkerSettings:sp.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||Wm(e))return{...s,isCloud:!0}}return s});bt({url:Ke().trim()}).strict();const P2=/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/;var T2=(s=>(s.READY="ready",s.STARTING="starting",s.STARTED="started",s.STOPPING="stopping",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown",s.DISABLED="disabled",s))(T2||{});const ch=["image/jpeg","image/png"],lh=1024*1024*2,uh=["video/mp4","video/quicktime"],dh=1024*1024*10,hh=["audio/mpeg","audio/wav","audio/ogg"],mh=1024*1024*2;bt({pluginname:Ke().trim().refine(s=>P2.test(s),"Not a valid plugin name"),pluginversion:Ke().trim().optional().default("latest")}).strict();bt({actionId:Ke(),payload:ur()}).strict();ol(ur(),ur());bt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=lh:s.size<=lh,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?ch.includes(s.mimetype):ch.includes(s.type),".jpeg and .png files are accepted"),metadata:Hn().transform(s=>JSON.parse(s.value)),config:Hn().transform(s=>JSON.parse(s.value))});bt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=mh:s.size<=mh,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?hh.includes(s.mimetype):hh.includes(s.type),".mp3, .wav and .ogg files are accepted"),metadata:Hn().transform(s=>JSON.parse(s.value)),config:Hn().transform(s=>JSON.parse(s.value))});bt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=dh:s.size<=dh,"Max file size is 5 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?uh.includes(s.mimetype):uh.includes(s.type),".mp4 files are accepted"),config:Hn().transform(s=>JSON.parse(s.value))});ol(Ke(),ur());bt({key:Ke()}).strict();bt({key:Ke(),payload:ur()}).strict();bt({version:Ke().trim().optional().default("latest")}).strict();const R2=bt({mode:Os([we("disabled"),we("port-forward"),we("router-forward"),we("cloudflare"),we("custom-domain")]).default("disabled"),cloudflare:bt({tunnelToken:Ke().trim(),customDomain:Ke().trim(),tunnelUrl:Ke().trim(),tunnelCredentials:bt({username:Ke().trim(),password:Ke().trim()}).partial()}).partial().strict(),customDomain:bt({url:Ke().trim().optional()}).partial().strict()}).strict(),d9=bt({serverAddresses:Ke().trim().ip().array().default([]),remoteAccess:R2}).strict(),ph=["image/jpeg","image/jpg","image/png"],fh=1024*1024*5,op=bt({index:xn(),cameraId:Ke()}),ap=Os([we(1),we(4),we(6),we(7),we(9),we(10),we(12),we(13),we(15),we(16),we(20),we(26)]),I2=Os([we("dnd"),we("view")]),cp=bt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Layout name is required"),viewSize:ap,cameras:op.array(),type:I2});bt({name:Ke().trim().min(1,"Layout name is required"),viewSize:ap,cameras:op.array()}).partial().optional();const O2=bt({views:cp.array()}),N2=bt({_id:Ke().default(hn()).transform(()=>hn()),cameraId:Ke(),points:El});bt({cameraId:Ke(),points:El}).partial().optional();const F2=bt({shortcuts:N2.array()}),lp=bt({camview:O2,cameras:ol(Ke().trim(),F2)}),L2=bt({_id:Ke().default(hn()).transform(()=>hn()),username:Ke().trim().min(1,"Username is required"),password:Ke().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters"),passwordConfirm:Ke().trim().min(1,"Please confirm your password"),role:Os([we("admin"),we("user")]),sessionTimer:xn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").default(14400),rememberMe:xs().default(!1),singleSession:xs().default(!1),firstLogin:xs().default(!0),preferences:lp.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),j2=bt({username:Ke().trim().min(1,"Username is required"),password:Ke().trim().min(1,"Password is required"),rememberMe:xs().default(!1)}).strict(),q2=bt({username:Ke().trim().min(1,"Username is required").optional(),password:Ke().trim().min(10,"Password must be at least 10 characters long").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/,`Password must contain at least one special character (!@#$%^&*()_+-=[]{};:'"\\|,.<>/?)`).max(32,"Password cannot be more than 32 characters").optional(),passwordConfirm:Ke().trim().optional(),role:Os([we("admin"),we("user")]).optional(),sessionTimer:xn().min(3600,"Session timer must not be less than 3600 seconds (1h)").max(86400,"Session timer must not be greater than 86400 seconds (24h)").optional(),upload:gf(Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=fh:s.size<=fh,"Max file size is 5MB.").refine(s=>(t=>t.mimetype!==void 0)(s)?ph.includes(s.mimetype):ph.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:xs().optional(),singleSession:xs().optional(),firstLogin:xs().optional(),preferences:lp.partial().optional()}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"});function na(s,e,t=!1){if(s===e)return!0;if((s===void 0||e===void 0||s===null||e===null)&&(s||e))return!1;const n=s==null?void 0:s.constructor.name,r=e==null?void 0:e.constructor.name;if(n!==r)return!1;if(n==="Array"&&r==="Array"){if(s.length!==e.length)return!1;if(t){const i=[...e];return s.every(o=>{const a=i.findIndex(l=>na(o,l,t));return a===-1?!1:(i.splice(a,1),!0)})}else{let i=!0;for(let o=0;o<s.length;o++)if(!na(s[o],e[o],t)){i=!1;break}return i}}if(n==="Object"&&r==="Object"){let i=!0;const o=Object.keys(s),a=Object.keys(e);if(o.length!==a.length)return!1;for(let l=0;l<o.length;l++)if(s[o[l]]&&e[o[l]]){if(s[o[l]]===e[o[l]])continue;if(s[o[l]]&&(s[o[l]].constructor.name==="Array"||s[o[l]].constructor.name==="Object")){if(i=na(s[o[l]],e[o[l]],t),!i)break}else if(s[o[l]]!==e[o[l]]){i=!1;break}}else if(s[o[l]]&&!e[o[l]]||!s[o[l]]&&e[o[l]]){i=!1;break}return i}return s===e}const ar=s=>s.type==="string"&&!("enum"in s),gh=s=>s.type==="number",vh=s=>s.type==="boolean",xa=s=>s.type==="string"&&"enum"in s,_h=s=>s.type==="array",zr=s=>s.type==="button",Ur=s=>s.type==="submit",D2=s=>ar(s)&&(!s.format||s.format!=="qrCode"&&s.format!=="image"),B2=(s,e)=>{if(!s||Object.keys(s).length===0)return!0;const t=e.filter(n=>!zr(n)&&!Ur(n));for(const n of t){const r=ni(s,n.key),i=$l(n);if(r!==void 0&&!na(r,i,!0))return!1}return!0},$l=s=>{if("defaultValue"in s&&s.defaultValue!==void 0)return s.defaultValue;switch(s.type){case"string":return xa(s)?s.multiple?[]:s.required?s.enum[0]:"":"";case"number":return 0;case"boolean":return!1;case"array":return[];default:return}},z2=s=>{const e={};for(const t of s)zr(t)||Ur(t)||(e[t.key]=$l(t));return e},ni=(s={},e)=>{if(!e.includes(".")&&!e.includes("["))return s[e];const t=e.split(".").reduce((r,i)=>{if(i.includes("[")){const[o,a]=i.split("[");r.push(o,a.slice(0,-1))}else r.push(i);return r},[]);let n=s;for(const r of t){if(n==null)return;n=n[r]}return n},ic=(s,e,t)=>{if(!e.includes(".")&&!e.includes("[")){s[e]=t;return}const n=e.split(".").reduce((o,a)=>{if(a.includes("[")){const[l,u]=a.split("[");o.push(l,u.slice(0,-1))}else o.push(a);return o},[]),r=n.pop();if(!r)return;let i=s;for(const o of n){if(i[o]===void 0||i[o]===null){const a=n[n.indexOf(o)+1];i[o]=isNaN(Number(a))?{}:[]}i=i[o]}i[r]=t},h9=(s,e)=>{const t={};for(const n of s)if("store"in n&&n.store&&!zr(n)&&!Ur(n)){const r=ni(e,n.key);r!==void 0&&(t[n.key]=r)}return t},up=(s,e)=>e?s.filter(t=>"group"in t&&t.group===e):s,U2=(s,e)=>{const t=up(s,e);return t.length>0&&t.every(n=>"readonly"in n&&n.readonly)},V2=(s,e)=>{const t=up(s,e);return t.length>0&&t.some(n=>"store"in n&&n.store)},H2=(s,e)=>{if(!e)return!0;const t={"date-time":n=>/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d+)?(Z|[+-]\d{2}:\d{2})?$/.test(n),date:n=>/^\d{4}-\d{2}-\d{2}$/.test(n),time:n=>/^([01]?[0-9]|2[0-3]):([0-5][0-9])(:([0-5][0-9]))?$/.test(n),email:n=>/^\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b$/.test(n),uuid:n=>/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/.test(n),ipv4:n=>/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/.test(n),ipv6:n=>/^\s*([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})\s*$/.test(n)};return e in t?t[e](s):!0},dp=s=>{if(zr(s)||Ur(s))return ur();switch(s.type){case"string":if(xa(s))if(s.multiple){let i=Su(Ke().trim().refine(o=>s.enum.includes(o),{message:"Invalid selection"}));return s.required&&(i=i.min(1,{message:"Required"})),s.required?i:i.optional()}else{const i=vf(s.enum);return s.required?i:i.optional()}let e=Ke().trim();return s.required&&(e=e.nonempty("Required")),s.minLength!==void 0&&(e=e.min(s.minLength)),s.maxLength!==void 0&&(e=e.max(s.maxLength)),s.format&&(e=e.refine(i=>!i||i.trim()===""||H2(i,s.format),{message:`Invalid ${s.format} format`})),s.required?e:e.optional();case"number":let t=xn();return s.minimum!==void 0&&(t=t.min(s.minimum)),s.maximum!==void 0&&(t=t.max(s.maximum)),s.required&&(t=t.refine(i=>i!=null,{message:"Required"})),s.required?t:t.optional();case"boolean":return s.required?xs():xs().optional();case"array":const n=dp(s.items),r=Su(n);return s.required?r:r.optional();default:return s.required?ur():ur().optional()}},Q2=s=>{const e={};return s.forEach(t=>{!zr(t)&&!Ur(t)&&(e[t.key]=dp(t))}),bt(e)},K2=Wn(j2),m9=Wn(L2),p9=Wn(q2),f9=Wn(cp),Z2={class:"flex justify-center items-center draggable-region"},G2={class:"card-background border-color relative w-full md:w-[400px] rounded-none md:rounded-2xl md:border-[1px] shadow-none md:shadow-xl h-full md:h-auto md:my-4"},W2={class:"flex flex-col h-full p-10 non-draggable-region"},J2={class:"flex flex-col items-center justify-center mb-10"},Y2={class:"flex flex-col gap-10 md:gap-6 w-full mt-10 md:mt-0"},X2={for:"username",class:"cui-label"},ey={for:"password",class:"cui-label"},ty={class:"flex flex-col gap-6 mt-10"},sy={class:"flex items-center field-checkbox-gap"},ny={for:"rememberMe",class:"cui-label-checkbox"},ry={class:"flex justify-end items-center gap-1"},iy=At({__name:"Login",setup(s){const e=Cn(),t=Fs(),{t:n}=js(),{loginLoading:r}=Vs(t),i=Vt("formRef"),o=ae(""),a=ae(""),l=ae(!1),u=async()=>{var h;const d=await((h=i.value)==null?void 0:h.validate());if(d!=null&&d.valid&&d.values)try{await t.login({username:o.value,password:a.value,rememberMe:l.value})}catch(v){console.error(v),e.add({severity:"error",summary:n("components.toast.title_error"),detail:v.message,life:3e3}),r.value=!1}};return(d,h)=>{const v=ki,f=Fh,b=R0,k=ys,z=Ea,L=v2,se=p2;return m(),A("div",Z2,[g("div",G2,[g("div",W2,[g("div",J2,[y(c($a),{src:c(Fr)("logo_animated.svg"),height:"60px",title:"camera.ui","aria-label":"camera.ui",class:"hover:scale-105 active:scale-105 focus:scale-105 transition-all"},null,8,["src"]),h[3]||(h[3]=g("span",{class:"text-2xl ml-3 mt-2 font-bold text-color"},"camera.ui",-1))]),y(c(il),{ref_key:"formRef",ref:i,"validation-schema":c(K2),class:"flex flex-col h-full",onSubmit:u},{default:$(()=>[g("div",Y2,[y(c(Lt),{modelValue:c(o),"onUpdate:modelValue":h[0]||(h[0]=K=>us(o)?o.value=K:null),modelModifiers:{trim:!0},name:"username",as:"div",class:"flex flex-col field-gap"},{default:$(({field:K,errors:N})=>[g("label",X2,me(d.$t("components.form.label.username")),1),y(v,et({invalid:N.length>0,type:"text",size:"large",loading:c(r),fluid:""},K),null,16,["invalid","loading"]),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"username",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:c(a),"onUpdate:modelValue":h[1]||(h[1]=K=>us(a)?a.value=K:null),name:"password",as:"div",class:"flex flex-col field-gap"},{default:$(({field:K,errors:N})=>[g("label",ey,me(d.$t("components.form.label.password")),1),y(f,et({invalid:N.length>0,size:"large",loading:c(r),feedback:!1,"toggle-mask":"",fluid:""},K),null,16,["invalid","loading"]),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"password",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])]),g("div",ty,[y(c(Lt),{"model-value":c(l),name:"rememberMe",type:"checkbox","checked-value":!0,"unchecked-value":!1,as:"div",class:"flex flex-col field-gap"},{default:$(({field:K,errors:N})=>[g("div",sy,[y(b,et({"model-value":c(l)},K,{invalid:N.length>0,class:"mr-2",binary:"",loading:c(r),onValueChange:h[2]||(h[2]=E=>l.value=E)}),null,16,["model-value","invalid","loading"]),g("label",ny,me(d.$t("components.form.label.remember_me")),1)]),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"rememberMe",class:"cui-input-checkbox-error"})]),_:1})]),_:1},8,["model-value"]),y(k,{type:"submit",class:"text-white font-semibold cui-button-large",loading:c(r),label:d.$t("components.form.button.login"),fluid:""},null,8,["loading","label"])])]),_:1},8,["validation-schema"]),y(z,{class:"mt-15"}),g("div",ry,[y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(L,{class:"text-muted",width:"100%",height:"100%"})]),_:1}),y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(se,{class:"text-muted",width:"100%",height:"100%"})]),_:1})])]),h[4]||(h[4]=g("div",{class:"bg-primary-500 opacity-0 md:opacity-100 absolute blur-3xl w-[200px] h-[30px] left-[50%] -translate-x-[50%] bottom-0 -z-1"},null,-1))])])}}}),hp=Mi("loading",()=>({routerLoading:ae(!1)})),oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ay(s,e){return m(),A("svg",oy,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M9 13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2zM9 3a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"})],-1)]))}const yh=pe({name:"mingcute-grid-fill",render:ay}),cy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ly(s,e){return m(),A("svg",cy,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M9 13a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2zm10 0a2 2 0 0 1 1.995 1.85L21 15v4a2 2 0 0 1-1.85 1.995L19 21h-4a2 2 0 0 1-1.995-1.85L13 19v-4a2 2 0 0 1 1.85-1.995L15 13zM9 15H5v4h4zm10 0h-4v4h4zm0-12a2 2 0 0 1 1.995 1.85L21 5v4a2 2 0 0 1-1.85 1.995L19 11h-4a2 2 0 0 1-1.995-1.85L13 9V5a2 2 0 0 1 1.85-1.995L15 3zM9 3a2 2 0 0 1 1.995 1.85L11 5v4a2 2 0 0 1-1.85 1.995L9 11H5a2 2 0 0 1-1.995-1.85L3 9V5a2 2 0 0 1 1.85-1.995L5 3zm10 2h-4v4h4zM9 5H5v4h4z"})],-1)]))}const bh=pe({name:"mingcute-grid-line",render:ly}),uy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dy(s,e){return m(),A("svg",uy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.916 9.564a1 1 0 0 0-.513-1.316L7.328 2.492c-.995-.438-2.22.051-2.645 1.042l-2.21 5.154a2 2 0 0 0 1.052 2.624L9.563 13.9L8.323 17H4v-3H2v8h2v-3h4.323c.823 0 1.552-.494 1.856-1.258l1.222-3.054l5.205 2.23a1 1 0 0 0 1.31-.517l.312-.71l1.701.68l2-5l-1.536-.613zm-4.434 5.126L4.313 9.475l2.208-5.152l12.162 5.354z"},null,-1)]))}const wh=pe({name:"bx-cctv",render:dy}),hy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function my(s,e){return m(),A("svg",hy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M18.618 7.462L6.403 2.085a1 1 0 0 0-.77-.016a1 1 0 0 0-.552.537l-3 7a1 1 0 0 0 .525 1.313L9.563 13.9L8.323 17H4v-3H2v8h2v-3h4.323c.823 0 1.552-.494 1.856-1.258l1.222-3.054l3.419 1.465a1 1 0 0 0 1.311-.518l3-6.857a1 1 0 0 0-.513-1.316m1.312 8.91l-1.858-.742l1.998-5l1.858.741z"},null,-1)]))}const zc=pe({name:"bxs-cctv",render:my}),py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fy(s,e){return m(),A("svg",py,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M21 10V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h6v-1.87l8.39-8.39c.44-.44 1-.68 1.61-.74m-7-5.5l5.5 5.5H14zm8.85 9.69l-.98.98l-2.04-2.04l.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72m-3.72-.36l2.04 2.04L15.04 22H13v-2.04z"},null,-1)]))}const xh=pe({name:"mdi-note-edit",render:fy}),gy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vy(s,e){return m(),A("svg",gy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h6v-1.87l.13-.13H5V5h7v7zM14 4.5l5.5 5.5H14zm5.13 9.33l2.04 2.04L15.04 22H13v-2.04zm3.72.36l-.98.98l-2.04-2.04l.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72"},null,-1)]))}const Sh=pe({name:"mdi-note-edit-outline",render:vy}),_y={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yy(s,e){return m(),A("svg",_y,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h3a1 1 0 0 0 1-1V5a2 2 0 0 1 4 0v1a1 1 0 0 0 1 1h3a1 1 0 0 1 1 1v3a1 1 0 0 0 1 1h1a2 2 0 0 1 0 4h-1a1 1 0 0 0-1 1v3a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-1a2 2 0 0 0-4 0v1a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-3a1 1 0 0 1 1-1h1a2 2 0 0 0 0-4H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1"},null,-1)]))}const Ch=pe({name:"tabler-puzzle",render:yy}),by={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wy(s,e){return m(),A("svg",by,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 2a3 3 0 0 1 2.995 2.824L13 5v1h3a2 2 0 0 1 1.995 1.85L18 8v3h1a3 3 0 0 1 .176 5.995L19 17h-1v3a2 2 0 0 1-1.85 1.995L16 22h-3a2 2 0 0 1-1.995-1.85L11 20v-1a1 1 0 0 0-1.993-.117L9 19v1a2 2 0 0 1-1.85 1.995L7 22H4a2 2 0 0 1-1.995-1.85L2 20v-3a2 2 0 0 1 1.85-1.995L4 15h1a1 1 0 0 0 .117-1.993L5 13H4a2 2 0 0 1-1.995-1.85L2 11V8a2 2 0 0 1 1.85-1.995L4 6h3V5a3 3 0 0 1 3-3"},null,-1)]))}const Uc=pe({name:"tabler-puzzle-filled",render:wy}),xy={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function Sy(s,e){return m(),A("svg",xy,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"4"},[g("rect",{width:"40",height:"32",x:"4",y:"8",rx:"2"}),g("path",{"stroke-linecap":"round",d:"m12 18l7 6l-7 6m11 2h13"})],-1)]))}const kh=pe({name:"icon-park-outline-terminal",render:Sy}),Cy={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},ky=["id"],Ey=["mask"];function Ay(s,e){return m(),A("svg",Cy,[g("defs",null,[g("mask",{id:s.idMap.ipSTerminal0},e[0]||(e[0]=[g("g",{fill:"none","stroke-linejoin":"round","stroke-width":"4"},[g("rect",{width:"40",height:"32",x:"4",y:"8",fill:"#fff",stroke:"#fff",rx:"2"}),g("path",{stroke:"#000","stroke-linecap":"round",d:"m12 18l7 6l-7 6m11 2h13"})],-1)]),8,ky)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSTerminal0+")"},null,8,Ey)])}const Eh=pe({name:"icon-park-solid-terminal",render:Ay,setup(){return{idMap:{ipSTerminal0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),My={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $y(s,e){return m(),A("svg",My,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M5 3a3 3 0 0 0-3 3v10a2 2 0 0 0 2 2V6a1 1 0 0 1 1-1h14a2 2 0 0 0-2-2zm0 5a2 2 0 0 1 2-2h13a2 2 0 0 1 2 2v11.333a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2zm15 0H7v7.848L10.848 12a1.25 1.25 0 0 1 1.768 0l3.241 3.24l.884-.883a1.25 1.25 0 0 1 1.768 0L20 15.848zm-2 3a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0"})],-1)]))}const oc=pe({name:"mingcute-photo-album-fill",render:$y}),Py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ty(s,e){return m(),A("svg",Py,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M20 6a2 2 0 0 1 2 2v11.333a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zm-8.268 7.944L7.136 18.54l-.066.06l-.07.054v.68h13v-.68l-.07-.053l-.066-.06l-2.24-2.24l-.353.354l.055.055a1 1 0 0 1-1.32 1.497l-.094-.083zM17 3a2 2 0 0 1 1.995 1.85L19 5H5a1 1 0 0 0-.993.883L4 6v12a2 2 0 0 1-1.995-1.85L2 16V6a3 3 0 0 1 2.824-2.995L5 3zm3 5H7v7.848L10.848 12a1.25 1.25 0 0 1 1.768 0l3.241 3.24l.884-.883a1.25 1.25 0 0 1 1.768 0L20 15.848zm-3.5 1.5a1.5 1.5 0 1 1 0 3a1.5 1.5 0 0 1 0-3"})],-1)]))}const ac=pe({name:"mingcute-photo-album-line",render:Ty}),Ry={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Iy(s,e){return m(),A("svg",Ry,e[0]||(e[0]=[g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.464 3.464C2 4.93 2 7.286 2 12s0 7.071 1.464 8.535C4.93 22 7.286 22 12 22s7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536C19.072 2 16.714 2 12 2S4.929 2 3.464 3.464m14.112 7.016a.75.75 0 0 0-1.152-.96l-1.797 2.156c-.37.445-.599.716-.786.885a.8.8 0 0 1-.163.122l-.011.005l-.008-.004l-.003-.001a.8.8 0 0 1-.164-.122c-.187-.17-.415-.44-.786-.885l-.292-.35c-.328-.395-.625-.75-.901-1c-.301-.272-.68-.514-1.18-.514s-.878.242-1.18.514c-.276.25-.572.605-.9 1l-1.83 2.194a.75.75 0 1 0 1.153.96l1.797-2.156c.37-.445.599-.716.786-.885a.8.8 0 0 1 .163-.122l.007-.003l.004-.002l.011.005a.8.8 0 0 1 .164.122c.187.17.415.44.786.885l.292.35c.329.395.625.75.901 1c.301.272.68.514 1.18.514s.878-.242 1.18-.514c.276-.25.572-.605.9-1z","clip-rule":"evenodd"},null,-1)]))}const Ah=pe({name:"solar-graph-bold",render:Iy}),Oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ny(s,e){return m(),A("svg",Oy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17.576 10.48a.75.75 0 0 0-1.152-.96l-1.797 2.156c-.37.445-.599.716-.786.885a.8.8 0 0 1-.163.122l-.011.005l-.011-.005a.8.8 0 0 1-.164-.122c-.187-.17-.415-.44-.786-.885l-.292-.35c-.328-.395-.625-.75-.901-1c-.301-.272-.68-.514-1.18-.514s-.878.242-1.18.514c-.276.25-.572.605-.9 1l-1.83 2.194a.75.75 0 1 0 1.153.96l1.797-2.156c.37-.445.599-.716.786-.885a.8.8 0 0 1 .163-.122l.011-.005l.011.005a.8.8 0 0 1 .164.122c.187.17.415.44.786.885l.292.35c.329.395.625.75.901 1c.301.272.68.514 1.18.514s.878-.242 1.18-.514c.276-.25.572-.605.9-1z"},null,-1),g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M11.943 1.25c-2.309 0-4.118 0-5.53.19c-1.444.194-2.584.6-3.479 1.494c-.895.895-1.3 2.035-1.494 3.48c-.19 1.411-.19 3.22-.19 5.529v.114c0 2.309 0 4.118.19 5.53c.194 1.444.6 2.584 1.494 3.479c.895.895 2.035 1.3 3.48 1.494c1.411.19 3.22.19 5.529.19h.114c2.309 0 4.118 0 5.53-.19c1.444-.194 2.584-.6 3.479-1.494c.895-.895 1.3-2.035 1.494-3.48c.19-1.411.19-3.22.19-5.529v-.114c0-2.309 0-4.118-.19-5.53c-.194-1.444-.6-2.584-1.494-3.479c-.895-.895-2.035-1.3-3.48-1.494c-1.411-.19-3.22-.19-5.529-.19zM3.995 3.995c.57-.57 1.34-.897 2.619-1.069c1.3-.174 3.008-.176 5.386-.176s4.086.002 5.386.176c1.279.172 2.05.5 2.62 1.069c.569.57.896 1.34 1.068 2.619c.174 1.3.176 3.008.176 5.386s-.002 4.086-.176 5.386c-.172 1.279-.5 2.05-1.069 2.62c-.57.569-1.34.896-2.619 1.068c-1.3.174-3.008.176-5.386.176s-4.086-.002-5.386-.176c-1.279-.172-2.05-.5-2.62-1.069c-.569-.57-.896-1.34-1.068-2.619c-.174-1.3-.176-3.008-.176-5.386s.002-4.086.176-5.386c.172-1.279.5-2.05 1.069-2.62","clip-rule":"evenodd"},null,-1)]))}const Mh=pe({name:"solar-graph-outline",render:Ny}),Fy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ly(s,e){return m(),A("svg",Fy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 3c-1.654 0-3 1.346-3 3c0 .502.136.968.354 1.385l-1.116 1.302A4 4 0 0 0 13 8c-.739 0-1.425.216-2.02.566L9.566 7.152A3.45 3.45 0 0 0 10 5.5C10 3.57 8.43 2 6.5 2S3 3.57 3 5.5S4.57 9 6.5 9c.601 0 1.158-.166 1.652-.434L9.566 9.98A3.97 3.97 0 0 0 9 12c0 .997.38 1.899.985 2.601l-1.692 1.692l.025.025A2.96 2.96 0 0 0 7 16c-1.654 0-3 1.346-3 3s1.346 3 3 3s3-1.346 3-3c0-.476-.121-.919-.318-1.318l.025.025l1.954-1.954c.421.15.867.247 1.339.247c2.206 0 4-1.794 4-4a3.96 3.96 0 0 0-.439-1.785l1.253-1.462c.364.158.764.247 1.186.247c1.654 0 3-1.346 3-3s-1.346-3-3-3M7 20a1 1 0 1 1 0-2a1 1 0 0 1 0 2M5 5.5C5 4.673 5.673 4 6.5 4S8 4.673 8 5.5S7.327 7 6.5 7S5 6.327 5 5.5m8 8.5c-1.103 0-2-.897-2-2s.897-2 2-2s2 .897 2 2s-.897 2-2 2m6-7a1 1 0 1 1 0-2a1 1 0 0 1 0 2"},null,-1)]))}const $h=pe({name:"bx-network-chart",render:Ly}),jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qy(s,e){return m(),A("svg",jy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19.5 3A2.5 2.5 0 0 0 17 5.5c0 .357.078.696.214 1.005l-1.955 2.199A4 4 0 0 0 13 8c-.74 0-1.424.216-2.019.566L8.707 6.293l-.023.023C8.88 5.918 9 5.475 9 5a3 3 0 1 0-3 3c.475 0 .917-.12 1.316-.316l-.023.023L9.567 9.98A3.96 3.96 0 0 0 9 12c0 .997.38 1.899.985 2.601l-2.577 2.576A2.5 2.5 0 0 0 6.5 17C5.122 17 4 18.121 4 19.5S5.122 22 6.5 22S9 20.879 9 19.5c0-.321-.066-.626-.177-.909l2.838-2.838c.421.15.867.247 1.339.247c2.206 0 4-1.794 4-4c0-.636-.163-1.229-.428-1.764l2.117-2.383c.256.088.526.147.811.147C20.879 8 22 6.879 22 5.5S20.879 3 19.5 3M13 14c-1.103 0-2-.897-2-2s.897-2 2-2s2 .897 2 2s-.897 2-2 2"},null,-1)]))}const Ph=pe({name:"bxs-network-chart",render:qy}),Dy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function By(s,e){return m(),A("svg",Dy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 15.5A3.5 3.5 0 0 1 8.5 12A3.5 3.5 0 0 1 12 8.5a3.5 3.5 0 0 1 3.5 3.5a3.5 3.5 0 0 1-3.5 3.5m7.43-2.53c.04-.32.07-.64.07-.97s-.03-.66-.07-1l2.11-1.63c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.31-.61-.22l-2.49 1c-.52-.39-1.06-.73-1.69-.98l-.37-2.65A.506.506 0 0 0 14 2h-4c-.25 0-.46.18-.5.42l-.37 2.65c-.63.25-1.17.59-1.69.98l-2.49-1c-.22-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64L4.57 11c-.04.34-.07.67-.07 1s.03.65.07.97l-2.11 1.66c-.19.15-.25.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1.01c.52.4 1.06.74 1.69.99l.37 2.65c.04.24.25.42.5.42h4c.25 0 .46-.18.5-.42l.37-2.65c.63-.26 1.17-.59 1.69-.99l2.49 1.01c.22.08.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64z"},null,-1)]))}const Sa=pe({name:"mdi-cog",render:By}),zy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Uy(s,e){return m(),A("svg",zy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z"},null,-1)]))}const Vc=pe({name:"mdi-cog-outline",render:Uy}),Vy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hy(s,e){return m(),A("svg",Vy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 19.2c-2.5 0-4.71-1.28-6-3.2c.03-2 4-3.1 6-3.1s5.97 1.1 6 3.1a7.23 7.23 0 0 1-6 3.2M12 5a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3m0-3A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10c0-5.53-4.5-10-10-10"},null,-1)]))}const Qy=pe({name:"mdi-account-circle",render:Hy}),Ky={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zy(s,e){return m(),A("svg",Ky,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2M7.07 18.28c.43-.9 3.05-1.78 4.93-1.78s4.5.88 4.93 1.78A7.9 7.9 0 0 1 12 20c-1.86 0-3.57-.64-4.93-1.72m11.29-1.45c-1.43-1.74-4.9-2.33-6.36-2.33s-4.93.59-6.36 2.33A7.93 7.93 0 0 1 4 12c0-4.41 3.59-8 8-8s8 3.59 8 8c0 1.82-.62 3.5-1.64 4.83M12 6c-1.94 0-3.5 1.56-3.5 3.5S10.06 13 12 13s3.5-1.56 3.5-3.5S13.94 6 12 6m0 5a1.5 1.5 0 0 1-1.5-1.5A1.5 1.5 0 0 1 12 8a1.5 1.5 0 0 1 1.5 1.5A1.5 1.5 0 0 1 12 11"},null,-1)]))}const Gy=pe({name:"mdi-account-circle-outline",render:Zy}),Wy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jy(s,e){return m(),A("svg",Wy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.97 7.27a.996.996 0 0 0 0-1.41l-2.83-2.83a.996.996 0 0 0-1.41 0l-4.49 4.49l-3.89-3.89c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l3.89 3.89L3 16.76V21h4.24l4.52-4.52l3.89 3.89c.95.95 2.23.6 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83l-3.89-3.89zM5.04 6.94l1.89-1.9L8.2 6.31L7.02 7.5l1.41 1.41l1.19-1.19l1.2 1.2l-1.9 1.9zm11.23 7.44l-1.19 1.19l1.41 1.41l1.19-1.19l1.27 1.27l-1.9 1.9l-3.89-3.89l1.9-1.9zM6.41 19H5v-1.41l9.61-9.61l1.3 1.3l.11.11zm9.61-12.44l1.41-1.41l1.41 1.41l-1.41 1.41z"},null,-1)]))}const Yy=pe({name:"ic-outline-design-services",render:Jy}),Xy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eb(s,e){return m(),A("svg",Xy,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m16.24 11.51l1.57-1.57l-3.75-3.75l-1.57 1.57l-4.14-4.13c-.78-.78-2.05-.78-2.83 0l-1.9 1.9c-.78.78-.78 2.05 0 2.83l4.13 4.13l-4.6 4.61q-.15.15-.15.36v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15l4.62-4.62l4.13 4.13c1.32 1.32 2.76.07 2.83 0l1.9-1.9c.78-.78.78-2.05 0-2.83zm-7.06-.44L5.04 6.94l1.89-1.9L8.2 6.31l-.47.49a.996.996 0 1 0 1.41 1.41l.48-.48l1.45 1.45zm7.88 7.89l-4.13-4.13l1.9-1.9l1.45 1.45l-.48.48a.996.996 0 1 0 1.41 1.41l.48-.48l1.27 1.27zm3.65-11.92a.996.996 0 0 0 0-1.41l-2.34-2.34c-.47-.47-1.12-.29-1.41 0l-1.83 1.83l3.75 3.75z"},null,-1)]))}const tb=pe({name:"ic-round-design-services",render:eb}),sb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nb(s,e){return m(),A("svg",sb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M16 17v2H2v-2s0-4 7-4s7 4 7 4m-3.5-9.5A3.5 3.5 0 1 0 9 11a3.5 3.5 0 0 0 3.5-3.5m3.44 5.5A5.32 5.32 0 0 1 18 17v2h4v-2s0-3.63-6.06-4M15 4a3.4 3.4 0 0 0-1.93.59a5 5 0 0 1 0 5.82A3.4 3.4 0 0 0 15 11a3.5 3.5 0 0 0 0-7"},null,-1)]))}const rb=pe({name:"mdi-users",render:nb}),ib={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ob(s,e){return m(),A("svg",ib,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M13.07 10.41a5 5 0 0 0 0-5.82A3.4 3.4 0 0 1 15 4a3.5 3.5 0 0 1 0 7a3.4 3.4 0 0 1-1.93-.59M5.5 7.5A3.5 3.5 0 1 1 9 11a3.5 3.5 0 0 1-3.5-3.5m2 0A1.5 1.5 0 1 0 9 6a1.5 1.5 0 0 0-1.5 1.5M16 17v2H2v-2s0-4 7-4s7 4 7 4m-2 0c-.14-.78-1.33-2-5-2s-4.93 1.31-5 2m11.95-4A5.32 5.32 0 0 1 18 17v2h4v-2s0-3.63-6.06-4Z"},null,-1)]))}const ab=pe({name:"mdi-users-outline",render:ob}),cb={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function lb(s,e){return m(),A("svg",cb,e[0]||(e[0]=[Vh('<path fill="currentColor" d="M6 22h24v2H6z" class="clr-i-outline clr-i-outline-path-1"></path><path fill="currentColor" d="M26 26h4v2h-4z" class="clr-i-outline clr-i-outline-path-2"></path><path fill="currentColor" d="M13 9.92L17 6v13a1 1 0 1 0 2 0V6l4 3.95a1 1 0 1 0 1.38-1.45L18 2.16L11.61 8.5A1 1 0 0 0 13 9.92" class="clr-i-outline clr-i-outline-path-3"></path><path fill="currentColor" d="M30.84 13.37A1.94 1.94 0 0 0 28.93 12H21v2h7.95c1.05 2.94 2.77 7.65 3.05 8.48V30H4v-7.52C4.28 21.65 7.05 14 7.05 14H15v-2H7.07a1.92 1.92 0 0 0-1.9 1.32C2 22 2 22.1 2 22.33V30a2 2 0 0 0 2 2h28a2 2 0 0 0 2-2v-7.67c0-.23 0-.33-3.16-8.96" class="clr-i-outline clr-i-outline-path-4"></path><path fill="none" d="M0 0h36v36H0z"></path>',5)]))}const ub=pe({name:"clarity-backup-restore-line",render:lb}),db={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function hb(s,e){return m(),A("svg",db,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M2 24v6a2 2 0 0 0 2 2h28a2 2 0 0 0 2-2v-6Zm28 5h-4v-2h4Z",class:"clr-i-solid clr-i-solid-path-1"},null,-1),g("path",{fill:"currentColor",d:"M30.84 13.37A1.94 1.94 0 0 0 28.93 12H21v6a3 3 0 1 1-6 0v-6H7.07a1.92 1.92 0 0 0-1.9 1.32c-2.31 6.36-2.93 8.11-3.1 8.68h31.86c-.16-.57-.79-2.31-3.09-8.63",class:"clr-i-solid clr-i-solid-path-2"},null,-1),g("path",{fill:"currentColor",d:"M13 9.92L17 6v12a1 1 0 1 0 2 0V6l4 3.95a1 1 0 1 0 1.38-1.45L18 2.16L11.61 8.5A1 1 0 0 0 13 9.92",class:"clr-i-solid clr-i-solid-path-3"},null,-1),g("path",{fill:"none",d:"M0 0h36v36H0z"},null,-1)]))}const mb=pe({name:"clarity-backup-restore-solid",render:hb}),pb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fb(s,e){return m(),A("svg",pb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.5 20q-2.275 0-3.887-1.575T1 14.575q0-1.95 1.175-3.475T5.25 9.15q.625-2.3 2.5-3.725T12 4q2.925 0 4.963 2.038T19 11q1.725.2 2.863 1.488T23 15.5q0 1.875-1.312 3.188T18.5 20z"},null,-1)]))}const gb=pe({name:"material-symbols-cloud",render:fb}),vb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _b(s,e){return m(),A("svg",vb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.5 20q-2.275 0-3.887-1.575T1 14.575q0-1.95 1.175-3.475T5.25 9.15q.625-2.3 2.5-3.725T12 4q2.925 0 4.963 2.038T19 11q1.725.2 2.863 1.488T23 15.5q0 1.875-1.312 3.188T18.5 20zm0-2h12q1.05 0 1.775-.725T21 15.5t-.725-1.775T18.5 13H17v-2q0-2.075-1.463-3.538T12 6T8.463 7.463T7 11h-.5q-1.45 0-2.475 1.025T3 14.5t1.025 2.475T6.5 18m5.5-6"},null,-1)]))}const yb=pe({name:"material-symbols-cloud-outline",render:_b}),bb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wb(s,e){return m(),A("svg",bb,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M18.5 4a1.5 1.5 0 0 0-3 0v.5H4a1.5 1.5 0 1 0 0 3h11.5V8a1.5 1.5 0 0 0 3 0v-.5H20a1.5 1.5 0 0 0 0-3h-1.5zM4 10.5a1.5 1.5 0 0 0 0 3h1.5v.5a1.5 1.5 0 0 0 3 0v-.5H20a1.5 1.5 0 0 0 0-3H8.5V10a1.5 1.5 0 1 0-3 0v.5zM2.5 18A1.5 1.5 0 0 1 4 16.5h11.5V16a1.5 1.5 0 0 1 3 0v.5H20a1.5 1.5 0 0 1 0 3h-1.5v.5a1.5 1.5 0 0 1-3 0v-.5H4A1.5 1.5 0 0 1 2.5 18"})],-1)]))}const xb=pe({name:"mingcute-settings-2-fill",render:wb}),Sb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Cb(s,e){return m(),A("svg",Sb,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M18 4a1 1 0 1 0-2 0v1H4a1 1 0 0 0 0 2h12v1a1 1 0 1 0 2 0V7h2a1 1 0 1 0 0-2h-2zM4 11a1 1 0 1 0 0 2h2v1a1 1 0 1 0 2 0v-1h12a1 1 0 1 0 0-2H8v-1a1 1 0 0 0-2 0v1zm-1 7a1 1 0 0 1 1-1h12v-1a1 1 0 1 1 2 0v1h2a1 1 0 1 1 0 2h-2v1a1 1 0 1 1-2 0v-1H4a1 1 0 0 1-1-1"})],-1)]))}const kb=pe({name:"mingcute-settings-2-line",render:Cb}),Eb=sl(J0),Ab=sl(W0);function Vr(){const{angle:s}=Eb(),e=Ab({listenOrientation:!0}),t=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=360}),n=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=450}),r=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<640}),i=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<768}),o=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>768&&d<1024}),a=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1024}),l=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1280}),u=ne(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1536});return{xxsBreakpoint:t,xsBreakpoint:n,smBreakpoint:r,mdBreakpoint:i,xmdBreakpoint:o,lgBreakpoint:a,xlBreakpoint:l,xxlBreakpoint:u}}const{mdBreakpoint:$s,smBreakpoint:cc}=Vr(),uo=[{name:"NotFound",path:"/:pathMatch(.*)*",component:d2,meta:{name:"notfound",auth:{requiresAuth:!1,role:"none"}}},{name:"Login",path:"/login",alias:"/",component:iy,meta:{name:"login",auth:{requiresAuth:!1,role:"none"},ui:{background:ne(()=>$s.value?"var(--card-background)":void 0)}}},{name:"FirstSteps",path:"/first-steps",component:()=>vs(()=>import("./FirstSteps.BLNp-T2e.0.0.63.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47])),meta:{name:"firststeps",auth:{requiresAuth:!0,role:"user"}}},{name:"Cameras",path:"/cameras",component:()=>vs(()=>import("./Cameras.xyNhttxc.0.0.63.js"),__vite__mapDeps([48,1,2,3,4,49,14,15,16,17,50,51,12,9,10,13,8,18,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,52])),meta:{name:"cameras",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{showTitle:!0,padding:ne(()=>!cc.value),fullwidth:ne(()=>cc.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:wh,active:zc}},bottombar:{icon:{default:wh,active:zc}}}},{name:"Camera",path:"/cameras/:cameraname",component:()=>vs(()=>import("./Camera.CyBZZ28c.0.0.63.js"),__vite__mapDeps([53,54,1,2,3,4,9,10,14,15,16,17,55,19,8,18,13,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"camera",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{disableScroll:ne(()=>$s.value),ignoreSafeAreaBottom:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:ne(()=>!$s.value)}}},{name:"Camview",path:"/camview",component:()=>vs(()=>import("./Camview.C8yUnqeH.0.0.63.js"),__vite__mapDeps([56,1,2,3,4,54,9,10,14,15,16,17,55,57,58,59,60,61,62,63,13,12,8,18,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,64])),meta:{name:"camview",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{disableScroll:ne(()=>!cc.value)},background:"#000000",showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:bh,active:yh}},bottombar:{icon:{default:bh,active:yh}}}},{name:"Recordings",path:"/recordings",component:()=>vs(()=>import("./Recordings.BfDGF8yy.0.0.63.js"),__vite__mapDeps([65,3,8,1,2,4,14,15,16,17,18,9,10,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"recordings",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:ac,active:oc}},bottombar:{icon:{default:ac,active:oc}}}},{name:"Config",path:"/config",component:()=>vs(()=>import("./Config.BHb_92sr.0.0.63.js"),__vite__mapDeps([66,1,2,3,4,13,14,15,16,17,67,8,9,10,7,18,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"config",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{disableScroll:!0},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:Sh,active:xh}},profileMenu:{icon:{default:Sh,active:xh}}}},{name:"Console",path:"/console",component:()=>vs(()=>import("./Console.gVRCs4SQ.0.0.63.js"),__vite__mapDeps([68,1,2,3,4,67,7,8,9,10,50,16,17,14,15,51,13,18,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"console",auth:{requiresAuth:!0,role:"admin"},ui:{background:"#000000",containerSettings:{disableScroll:!0},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:kh,active:Eh}},profileMenu:{icon:{default:kh,active:Eh}}}},{name:"Plugins",path:"/plugins",component:()=>vs(()=>import("./Plugins.Bru4qZHM.0.0.63.js"),__vite__mapDeps([69,1,2,3,4,49,70,71,50,16,17,14,15,51,72,30,31,32,33,34,35,36,37,7,8,9,10,19,73,18,13,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45,74])),meta:{name:"plugins",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:Ch,active:Uc}},profileMenu:{icon:{default:Ch,active:Uc}}}},{name:"ScopedPlugin",path:"/plugins/:scope/:pluginname",component:()=>vs(()=>import("./Plugin.BzcStDGT.0.0.63.js"),__vite__mapDeps([75,1,2,3,4,76,9,10,70,71,50,16,17,14,15,51,72,30,31,32,33,34,35,36,37,7,8,19,73,18,13,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45,77])),meta:{name:"plugin",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Plugin",path:"/plugins/:pluginname",component:()=>vs(()=>import("./Plugin.BzcStDGT.0.0.63.js"),__vite__mapDeps([75,1,2,3,4,76,9,10,70,71,50,16,17,14,15,51,72,30,31,32,33,34,35,36,37,7,8,19,73,18,13,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45,77])),meta:{name:"plugin",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Adminpanel",path:"/admin",component:()=>vs(()=>import("./Adminpanel.CgnDDe0k.0.0.63.js"),__vite__mapDeps([78,1,2,3,4,79,80,81,13,8,9,10,7,14,15,16,17,18,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,82])),meta:{name:"adminpanel",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:Mh,active:Ah}},profileMenu:{icon:{default:Mh,active:Ah}}}},{name:"Cammesh",path:"/cammesh",component:()=>vs(()=>import("./Cammesh.CrlhW6m8.0.0.63.js"),__vite__mapDeps([83,3,8,1,2,4,14,15,16,17,18,9,10,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"cammesh",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{showTitle:!0,padding:!0,fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:$h,active:Ph}},profileMenu:{icon:{default:$h,active:Ph}}}},{name:"Settings",path:"/settings",component:()=>vs(()=>import("./Settings.A2rkEnZf.0.0.63.js"),__vite__mapDeps([84,1,2,3,4,19,14,15,16,17,8,18,9,10,13,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,85])),meta:{name:"settings",path:"/settings/account",auth:{requiresAuth:!0,role:"user"},navbar:{position:"bottom",icon:{default:Vc,active:Sa}},bottombar:{icon:{default:Vc,active:Sa}}},children:[{name:"SettingsAccount",path:"account",component:()=>vs(()=>import("./SettingsAccount.kSQHHipN.0.0.63.js"),__vite__mapDeps([11,1,2,3,4,12,9,10,13,8,14,15,16,17,18,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46])),meta:{name:"account",description:"account_description",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Gy,active:Qy}}}},{name:"SettingsAppearance",path:"appearance",component:()=>vs(()=>import("./SettingsAppearance.DrK-Y9Dz.0.0.63.js"),__vite__mapDeps([86,47,1,2,3,4,13,8,14,15,16,17,18,9,10,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"appearance",description:"appearance_description",auth:{requiresAuth:!0,role:"user"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Yy,active:tb}}}},{name:"SettingsUsers",path:"user",component:()=>vs(()=>import("./SettingsUsers.DUeBe8dg.0.0.63.js"),__vite__mapDeps([87,1,2,3,4,71,12,9,10,8,14,15,16,17,18,13,19,5,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"user",description:"user_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ab,active:rb}}}},{name:"SettingsRecordings",path:"recordings",component:()=>vs(()=>import("./SettingsRecordings.CKLA9Mcy.0.0.63.js"),__vite__mapDeps([88,3,8,1,2,4,14,15,16,17,18,9,10,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"recordings",description:"recordings_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ac,active:oc}}}},{name:"SettingsBackup",path:"backup",component:()=>vs(()=>import("./SettingsBackup.BrO__F6s.0.0.63.js"),__vite__mapDeps([89,1,2,3,4,76,6,7,8,9,10,14,15,16,17,18,13,19,5,12,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,90])),meta:{name:"backup",description:"backup_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ub,active:mb}}}},{name:"SettingsRemote",path:"remote",component:()=>vs(()=>import("./SettingsRemote.Cc_G0w05.0.0.63.js"),__vite__mapDeps([91,1,2,3,4,12,7,8,9,10,20,21,14,15,16,17,18,13,19,5,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),meta:{name:"remote",description:"remote_access_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:yb,active:gb}}}},{name:"SettingsSystem",path:"system",component:()=>vs(()=>import("./SettingsSystem.Bc3mt8Pc.0.0.63.js"),__vite__mapDeps([92,1,2,3,4,8,7,9,10,72,50,16,17,14,15,51,30,31,32,33,34,35,36,37,93,18,13,19,5,12,20,21,22,23,24,25,26,27,28,29,38,39,40,41,42,43,44,45])),meta:{name:"system",description:"system_description",auth:{requiresAuth:!0,role:"admin"},ui:{containerSettings:{fullwidth:ne(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:kb,active:xb}}}}]}],La=mf({history:pf("/"),routes:uo,scrollBehavior:async()=>(await I_(10),{top:0,left:0,behavior:"smooth"})});La.absUrl=(s="#",e=!0)=>{const t=document.createElement("a");t.href=s,t.target=e&&s!=="#"?"_blank":"",e&&(t.rel="noopener noreferrer"),t.click()};La.beforeEach(async(s,e,t)=>{var l;const n=Ci(),r=Fs(),i=hp(),o=s.name.toLowerCase(),a=localStorage.getItem("lastPage");if(i.routerLoading=!0,r.user){await n.cancelQueries(void 0,{revert:!1});try{s.path!=="/settings"&&await Um()}catch(u){console.error(u),await r.logout();return}r.user.firstLogin&&s.path!=="/first-steps"?t("/first-steps"):!r.user.firstLogin&&s.path==="/first-steps"||(l=s.meta.auth)!=null&&l.requiresAuth&&s.meta.auth.role&&r.user.role!==s.meta.auth.role&&r.user.role!=="admin"&&r.user.role!=="master"?t("/cameras"):o==="login"&&a&&a!=="/"?t(a):s.path==="/settings"?t("/settings/account"):t()}else o!=="login"?t("/"):t();i.routerLoading=!1});La.afterEach(s=>{const e=["login","notfound","firststeps"],t=s.name.toLowerCase();e.includes(t)||localStorage.setItem("lastPage",s.path)});const ka=class ka{constructor(){}static get manager(){return this._manager||this.createManager(),this._manager}static createManager(){ka._manager=new _f(window.origin,{reconnection:!0,reconnectionAttempts:1/0,reconnectionDelay:1e3,reconnectionDelayMax:5e3,randomizationFactor:.5,timeout:2e4,autoConnect:!0,transports:["websocket","polling"],rejectUnauthorized:!1,secure:!0})}};p(ka,"_manager");let Hc=ka;const Pl=Mi("socket",()=>{const s=ae(new Map),e=ae(!1),t=ae(!0),n=()=>{const h=Fs(),v=s.value.get("/camera.ui");return v||i("/camera.ui",h)},r=h=>{const v=Fs(),f=s.value.get(h);return f||i(h,v)},i=(h,v)=>{const f=Ls(a(h,v));return o(f.value,h,v),s.value.set(h,f.value),f.value},o=(h,v,f)=>{h.socket.on("connect",()=>{var b;(b=h.connected)==null||b.next()}),v==="/camera.ui"&&(h.socket.on("connect",()=>{t.value?(e.value=!0,t.value=!1):d()}),h.socket.on("disconnect",()=>{e.value=!1}),h.socket.on("unauthenticated",()=>{e.value=!1,f.logout()}),h.socket.on("invalidToken",b=>{f.accessToken===b&&(e.value=!1,f.logout())})),h.end=b=>{var k;v==="/camera.ui"&&(e.value=!1),h.socket.emit("end",b),h.socket.removeAllListeners(),(k=h.connected)==null||k.complete()},h.disconnect=b=>{var k;v==="/camera.ui"&&(e.value=!1),(k=h.end)==null||k.call(h,b),h.socket.disconnect(),s.value.delete(v)}},a=(h,v)=>{const f=`Bearer ${v.accessToken}`,b=Hc.manager.socket(h,{auth:{token:f}});return{socket:b,request:(z,L)=>new yf(se=>{b.emit(z,L,K=>{typeof K=="object"&&K.error?se.error(K):se.next(K),se.complete()})})}},l=ne(()=>h=>s.value.get(h)),u=h=>{s.value.forEach(v=>{var f;(f=v.disconnect)==null||f.call(v,h)}),e.value=!1},d=()=>{window.location.reload()};return{isConnected:e,namespaceConnectionCache:s,connect:n,connectToNamespace:r,getExistingNamespace:l,disconnect:u}}),g9=["account","appearance","user","recordings","backup","system"],Tl=Mi("ui",()=>{const s=tl("ui",{cameras:{showEvents:!0},camview:{dragDisabled:!1},config:{zoom:12},console:{zoom:12},interface:{showBottomBarOnMobile:!0,selectedSettingsView:"account",navbarStayCollapsed:!1}});return s.value.cameras||(s.value.cameras={showEvents:!0}),s.value.cameras.showEvents===void 0&&(s.value.cameras.showEvents=!0),s.value.camview||(s.value.camview={dragDisabled:!1}),s.value.camview.dragDisabled===void 0&&(s.value.camview.dragDisabled=!1),s.value.config||(s.value.config={zoom:12}),s.value.console.zoom===void 0&&(s.value.console.zoom=12),s.value.console||(s.value.console={zoom:12}),s.value.interface.showBottomBarOnMobile===void 0&&(s.value.interface.showBottomBarOnMobile=!0),s.value.interface||(s.value.interface={showBottomBarOnMobile:!0,selectedSettingsView:"account",navbarStayCollapsed:!1}),!s.value.interface.showBottomBarOnMobile===void 0&&(s.value.interface.showBottomBarOnMobile=!0),s.value.interface.selectedSettingsView||(s.value.interface.selectedSettingsView="account"),s.value.interface.navbarStayCollapsed||(s.value.interface.navbarStayCollapsed=!1),{uiSettings:s}}),vn={CLOSED:0,MINIFIED:80,EXPANDED:288},Mb=Symbol("cui-app-bus"),zi=Tr({navbarState:void 0,subbarState:void 0}),Rl=()=>{const s=Zh(Mb);return s.on(({subbarState:e,navbarState:t})=>{e&&e!==zi.subbarState&&(zi.subbarState=e),t&&t!==zi.navbarState&&(zi.navbarState=t)}),{state:zi,bus:s}},ja=()=>{const s=Tl(),e=$i(),{state:t}=Rl(),{mdBreakpoint:n,xsBreakpoint:r,xlBreakpoint:i}=Vr(),{uiSettings:o}=Vs(s),a=ne(()=>u.value?o.value.interface.navbarStayCollapsed&&t.navbarState!=="opened"?n.value?"closed":"minified":i.value?"opened":t.navbarState?t.navbarState:n.value?"closed":"minified":void 0),l=ne(()=>e.path.includes("/settings")?i.value?"opened":t.subbarState?t.subbarState:"closed":void 0),u=ne(()=>{var v;return!!Xs((v=e.meta.ui)==null?void 0:v.showNavbar)}),d=ne(()=>{var v;return!!(Xs((v=e.meta.ui)==null?void 0:v.showBottombar)&&o.value.interface.showBottomBarOnMobile&&r.value)}),h=ne(()=>{var v;return!!Xs((v=e.meta.ui)==null?void 0:v.showTopbar)});return{navbarState:a,subbarState:l,showBottombar:d,showNavbar:u,showTopbar:h}},Si=(s,e,t)=>{var a,l,u,d,h;s=s??$i();const{user:n}=Vs(Fs()),r=!((a=s==null?void 0:s.meta)!=null&&a.auth)||((l=s==null?void 0:s.meta)==null?void 0:l.auth.requiresAuth)===!1,i=e??((d=(u=s.meta)==null?void 0:u.auth)==null?void 0:d.role)??"user",o=((h=n.value)==null?void 0:h.role)??"user";return r||i==="none"?!0:i==="user"?t?o==="user":o==="user"||o==="admin"||o==="master":i==="admin"?o==="admin"||o==="master":i==="master"?o==="master":!1},$b={class:"pl-safe pt-safe h-full flex flex-col"},Pb={class:"overflow-hidden w-full pr-4"},Tb={key:0,class:"ml-2 w-full flex flex-row items-center"},Rb={class:"flex flex-col flex-1 my-4 px-[0.9rem]"},Ib={class:"flex flex-col space-y-1"},Ob={class:"flex flex-col space-y-1 pb-safe"},Nb={key:0,class:"dark-mode text-muted pl-3 uppercase text-xs font-bold"},Fb=At({__name:"CuiNavbar",setup(s,{expose:e}){const t=qr(),n=Fs(),r=Tl(),i=Pl(),{bus:o}=Rl(),{mdBreakpoint:a,xlBreakpoint:l}=Vr(),{navbarState:u}=ja(),{uiSettings:d}=Vs(r),{user:h}=Vs(n),v=Vt("navbarRef"),f=ae("closed"),b=Ls(),k=ae(!1),z=ae(!1),L=ae(!1),se=ae(!1);nl(v,I=>{const w=I.target,H=w.closest("#menu-icon"),J=w.closest("#submenu-icon"),q=w.closest("#navbar-icon");!H&&!J&&!q&&S()});const K=ne(()=>d.value.interface.selectedSettingsView),N=ne(()=>uo.filter(I=>{var w,H;return((H=(w=I.meta)==null?void 0:w.navbar)==null?void 0:H.position)==="top"&&I.meta&&Si(I)})),E=ne(()=>uo.filter(I=>{var w,H;return((H=(w=I.meta)==null?void 0:w.navbar)==null?void 0:H.position)==="bottom"&&Si(I)})),O=ne(()=>d.value.interface.navbarStayCollapsed&&f.value!=="opened"?"closed":l.value?"opened":f.value),U=ne(()=>O.value==="closed"?a.value?vn.CLOSED:vn.MINIFIED:vn.EXPANDED);Ge(u,I=>{I&&I!==f.value&&(f.value=I==="minified"||I==="closed"?"closed":"opened")}),Ge(t.currentRoute,(I,w)=>{I.path!==w.path&&S()}),Ge(h,()=>{var I,w,H,J;((I=h.value)==null?void 0:I.role)==="admin"||((w=h.value)==null?void 0:w.role)==="master"?(b.value=i.connectToNamespace("/server"),b.value.socket.on("plugin-updates",q=>{z.value=q.length>0||!1}),b.value.socket.on("server-updates",q=>{k.value=q.updateAvailable||q.betaUpdateAvailable||!1}),b.value.request("get-updates").subscribe(q=>{z.value=q.plugins.length>0||!1,k.value=q.server.updateAvailable||q.server.betaUpdateAvailable||!1})):(J=(H=b.value)==null?void 0:H.disconnect)==null||J.call(H)},{deep:!0,immediate:!0}),Ge(L,I=>{I&&B()});const S=()=>{o.emit({navbarState:"closed"})},M=(I,w)=>{L.value&&w.channel==="update-check"&&w.status==="available"&&(k.value=!0)},B=async()=>{if(L.value){window.electron.removeListener("app-status",M),window.electron.on("app-status",M),window.electron.send("check-for-updates");try{const I=await window.electron.invoke("get-update-available");k.value=I.isUpdateAvailable}catch{}}},W=()=>{const I=document.querySelector('meta[name="electron-server"]'),w=I!==null&&I.getAttribute("content")==="true";L.value=window.electron!==void 0,se.value=w,setTimeout(()=>{L.value=window.electron!==void 0,se.value=w},100)};return Sn(()=>{W()}),vo(()=>{var I;(I=window.electron)==null||I.removeListener("app-status",M)}),e({navbarState:O}),(I,w)=>{var Se,F;const H=Ei("RouterLink"),J=_o,q=ys,oe=Lh,ue=Gm;return m(),A("nav",{ref_key:"navbarRef",ref:v,class:at(["navbar-background fixed h-full transition-[width] duration-300 overflow-x-hidden overflow-y-scroll shadow-black/50 overflow-hidden border-r-[1px] border-base-color",{"shadow-xl":c(a)&&c(U)===c(vn).EXPANDED}]),style:ot({left:c(U)===0?"-1px":"0px",width:`calc(${c(U)}px + env(safe-area-inset-left, 0px))`,clipPath:"inset(0)"})},[w[3]||(w[3]=g("div",{class:"fixed blur-2xl h-[20px] w-full -z-1 opacity-70 bg-primary-500"},null,-1)),g("div",$b,[g("div",{class:at(["w-full flex items-center shrink-0 h-[60px]",{"mt-[25px]":c(L)}])},[y(H,{to:"/cameras",class:"pl-6"},{default:$(()=>[y(c($a),{src:c(Fr)("logo_animated.svg"),width:"32px",height:"32px",title:"camera.ui","aria-label":"camera.ui",class:"hover:scale-105 active:scale-105 focus:scale-105 transition-all"},null,8,["src"])]),_:1}),g("div",Pb,[y(Et,{name:"fade"},{default:$(()=>[c(U)===c(vn).EXPANDED?(m(),A("div",Tb,[y(H,{to:"/cameras",class:"text-white font-bold text-lg text-shadow"},{default:$(()=>w[0]||(w[0]=[Qt("camera.ui")])),_:1}),c(O)==="opened"&&c(a)?(m(),j(q,{key:0,id:"navbar-icon",class:"dark-mode ml-auto cui-icon-md text-white",text:"",rounded:"",onClick:S},{icon:$(()=>[y(J,{width:"100%",height:"100%"})]),_:1})):ce("",!0)])):ce("",!0)]),_:1})])],2),g("div",Rb,[g("div",Ib,[(m(!0),A(yt,null,qt(c(N),D=>(m(),A("div",{key:D.name,class:"w-full h-[50px] relative"},[c(z)&&D.name==="Plugins"?(m(),j(oe,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ce("",!0),y(ue,{icon:D.meta.navbar.icon.default,"active-icon":D.meta.navbar.icon.active,to:D.path,label:I.$t(`navigation.${D.name.toLowerCase()}`),expanded:c(U)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(U)===c(vn).EXPANDED}])},null,8,["icon","active-icon","to","label","expanded","class"])]))),128))]),w[2]||(w[2]=g("div",{class:"flex-1 mt-10"},null,-1)),g("div",Ob,[y(Et,{name:"fade"},{default:$(()=>[c(O)==="opened"?(m(),A("span",Nb,me(I.$t("navigation.extras")),1)):ce("",!0)]),_:1}),(m(!0),A(yt,null,qt(c(E),D=>(m(),A("div",{key:D.name,class:"w-full h-[50px] relative"},[c(k)&&D.name==="Settings"?(m(),j(oe,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ce("",!0),y(ue,{icon:D.meta.navbar.icon.default,"active-icon":D.meta.navbar.icon.active,to:D.path==="/settings"?`/settings/${c(K)}`:D.path,"fallback-active-path":D.path,label:I.$t(`navigation.${D.name.toLowerCase()}`),expanded:c(U)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(U)===c(vn).EXPANDED}])},null,8,["icon","active-icon","to","fallback-active-path","label","expanded","class"])]))),128)),w[1]||(w[1]=g("div",{class:"my-2",style:{borderTop:"1px solid #313131"}},null,-1)),y(ue,{avatar:"avatar",label:((Se=c(h))==null?void 0:Se.username)??"unknown",description:((F=c(h))==null?void 0:F.role)??"unknown",expanded:c(U)===c(vn).EXPANDED,"show-logout":"",to:"/settings/account","dark-mode":"","avatar-size":22,class:at(["w-[50px] h-[50px]",{"w-full":c(U)===c(vn).EXPANDED}])},null,8,["label","description","expanded","class"])])])])],6)}}}),Lb={HEIGHT:60},jb={class:"px-2 h-full pb-safe-offset-1 flex items-center justify-around"},qb=At({__name:"CuiBottombar",setup(s,{expose:e}){const t=Vt("bottombarRef"),n=ne(()=>uo.filter(r=>{var i;return((i=r.meta)==null?void 0:i.bottombar)&&r.meta.auth&&Si(r)}));return e({bottombarRef:t}),(r,i)=>{const o=Gm;return m(),A("nav",{ref_key:"bottombarRef",ref:t,class:"cui-bottombar bottombar-background fixed bottom-0 left-0 right-0 border-t-[1px] border-color bottombar-background",style:ot({height:`calc(${c(Lb).HEIGHT}px + env(safe-area-inset-bottom, 0px))`})},[g("div",jb,[(m(!0),A(yt,null,qt(c(n),a=>(m(),j(o,{key:a.name,icon:a.meta.bottombar.icon.default,"active-icon":a.meta.bottombar.icon.active,to:a.path,label:"",expanded:!1,"icon-class":"text-color",class:"w-[50px] h-[50px] transition-all duration-300"},null,8,["icon","active-icon","to"]))),128))]),i[0]||(i[0]=g("div",{class:"fixed blur-2xl h-[20px] w-full opacity-70 bg-primary-500",style:{bottom:"calc(env(safe-area-inset-bottom, 0px) - 40px)"}},null,-1))],4)}}}),Db=qs(qb,[["__scopeId","data-v-78d01fd3"]]),Bb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zb(s,e){return m(),A("svg",Bb,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6h18m-2 0v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6m3 0V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2m-6 5v6m4-6v6"},null,-1)]))}const Ub=pe({name:"lucide-trash2",render:zb}),Vb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Hb(s,e){return m(),A("svg",Vb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M8.352 20.242A4.63 4.63 0 0 0 12 22a4.63 4.63 0 0 0 3.648-1.758a27.2 27.2 0 0 1-7.296 0M18.75 9v.704c0 .845.24 1.671.692 2.374l1.108 1.723c1.011 1.574.239 3.713-1.52 4.21a25.8 25.8 0 0 1-14.06 0c-1.759-.497-2.531-2.636-1.52-4.21l1.108-1.723a4.4 4.4 0 0 0 .693-2.374V9c0-3.866 3.022-7 6.749-7s6.75 3.134 6.75 7"},null,-1)]))}const Qb=pe({name:"solar-bell-bold",render:Hb}),Kb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Zb(s,e){return m(),A("svg",Kb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"},null,-1)]))}const Gb=pe({name:"material-symbols-close-rounded",render:Zb}),Wb={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function Jb(s,e){return m(),A("svg",Wb,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.78 12.78a.75.75 0 0 1-1.06 0L4.47 8.53a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.042.018a.75.75 0 0 1 .018 1.042L6.06 8l3.72 3.72a.75.75 0 0 1 0 1.06"},null,-1)]))}const Yb=pe({name:"octicon-chevron-left16",render:Jb}),mp=Symbol("DialogStepper");function Xb(s){const e=ae(s),t=ae(void 0),n={},r=(f,b)=>{n[f]||(n[f]=[]),n[f].push(b)},i=(f,b)=>{const k=n[f];if(k){const z=k.indexOf(b);z!==-1&&k.splice(z,1)}},o=(f,b)=>{const k=n[f];k&&k.forEach(z=>{z(b)})},a=ne(()=>!t.value),v={currentTab:t,tabs:e,isMainTab:a,goToTab:f=>{const b=e.value.find(k=>k.id===f);b&&(t.value=f,o("tabChange",b))},goToMainTab:()=>{t.value=void 0,o("tabChange",void 0)},registerTab:f=>{e.value.some(b=>b.id===f.id)||e.value.push(f)},updateTabConfig:(f,b)=>{const k=e.value.findIndex(z=>z.id===f);k!==-1&&(e.value[k]={...e.value[k],...b},b.title&&o("updateTabTitle",{tabId:f,title:b.title}))},on:r,off:i,emit:o};return Xc(mp,v),v}function v9(){const s=mi(mp);if(!s)throw new Error("useCuiDialogStepperContext must be used within a dialog that uses useCuiDialogStepper");return s}const e5={class:"p-dialog-header justify-start gap-1"},t5={key:0,class:"p-dialog-header-actions"},s5={class:"p-dialog-title"},n5={class:"p-dialog-header-actions ml-auto"},r5={key:0},i5=["innerHTML"],o5={class:"flex items-center justify-center shrink-0 w-full p-5 not-md:pb-safe-offset-5 mt-5 self-end",style:{background:"var(--border-color)"}},a5=At({__name:"CuiDialog",setup(s){Gr.registerLanguage("typescript",bf),Gr.registerLanguage("yaml",wf),Gr.registerLanguage("json",xf),Gr.registerLanguage("python",Sf);const e=Cn(),{t}=js(),n=mi("dialogRef"),r=Wt(n.value.data),{contentText:i,contentProps:o,loading:a,disabled:l,cancelButtonProps:u,confirmButtonProps:d,hideCancelButton:h,hideConfirmButton:v,dialogContentClass:f,dialogContentStyle:b,cancelText:k,confirmText:z,stayActive:L,src:se,title:K,fullscreen:N,tabs:E,markdown:O}=r;Xc("dialogRefProps",r);const U=ae(!1),S=ae(null),M=ae(!1),B=ae(K.value);let W;const I=n.value.options.templates,w=ne(()=>{var Y;return!!(U.value||a!=null&&a.value||Xs((Y=S.value)==null?void 0:Y.isLoading))}),H=ne(()=>E.value!==void 0&&E.value.length>0),J=ne(()=>k!=null&&k.value?k.value:t("components.form.button.close")),q=ne(()=>z!=null&&z.value?z.value:t("components.form.button.save")),oe=ne(()=>({...u==null?void 0:u.value,label:J.value,loading:void 0,size:"small",severity:u!=null&&u.value&&"severity"in u.value?u.value.severity:"secondary",class:void 0})),ue=ne(()=>({...d==null?void 0:d.value,label:q.value,loading:void 0,size:"small",severity:d!=null&&d.value&&"severity"in d.value?d.value.severity:"success",class:"ml-auto",disabled:l.value}));H.value&&(W=Xb(E.value??[]),Ge(W.isMainTab,Y=>{M.value=!Y},{immediate:!0}),W.on("updateTabTitle",({tabId:Y,title:Te})=>{(W==null?void 0:W.currentTab.value)===Y&&(K!=null&&K.value)&&(B.value=Te)}),W.on("tabChange",Y=>{B.value=(Y==null?void 0:Y.title)??K.value}));const Se=Cf("commonmark",{highlight(Y,Te){if(Te&&Gr.getLanguage(Te))try{return'<pre><code class="hljs">'+Gr.highlight(Y,{language:Te,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+Se.utils.escapeHtml(Y)+"</code></pre>"}}),F=async()=>{var Y,Te;try{U.value=!0;const He=await((Te=(Y=S.value)==null?void 0:Y.onCancel)==null?void 0:Te.call(Y));n.value.close({status:"cancel",data:He})}catch(He){console.error(He),e.add({severity:"error",summary:t("components.toast.title_error"),detail:He.message,life:3e3})}finally{U.value=!1}},D=async()=>{var Y,Te,He,ht;try{U.value=!0;const Mt=await((Te=(Y=S.value)==null?void 0:Y.onConfirm)==null?void 0:Te.call(Y));if(Mt===null)return;L!=null&&L.value?(ht=(He=n.value.options).onConfirm)==null||ht.call(He,Mt):n.value.close({status:"confirm",data:Mt})}catch(Mt){console.error(Mt),e.add({severity:"error",summary:t("components.toast.title_error"),detail:Mt.message,life:3e3})}finally{U.value=!1}};return(Y,Te)=>{var ze;const He=Yb,ht=ys,Mt=Gb,Qe=Fa;return m(),A(yt,null,[g("div",e5,[y(Et,{name:"slide-left"},{default:$(()=>{var ge;return[c(M)?(m(),A("div",t5,[y(ht,{severity:"secondary",text:"",rounded:"",class:"p-dialog-back-button",onClick:(ge=c(W))==null?void 0:ge.goToMainTab},{icon:$(()=>[y(He,{width:"100%",height:"100%"})]),_:1},8,["onClick"])])):ce("",!0)]}),_:1}),g("span",s5,me(c(B)),1),g("div",n5,[y(ht,{severity:"secondary",text:"",rounded:"",class:"p-dialog-close-button",onClick:c(n).close},{icon:$(()=>[y(Mt,{width:"100%",height:"100%"})]),_:1},8,["onClick"])])]),g("div",{class:at(["flex justify-center w-full overflow-y-auto px-5 text-balance",{"h-full":c(N)},c(f)]),style:ot(c(b))},[c(i)&&!c(O)?(m(),A("span",r5,me(c(i)),1)):c(i)&&c(O)?(m(),A("div",{key:1,class:"w-full markdown-body",innerHTML:c(Se).render(c(i))},null,8,i5)):c(se)?(m(),j(Qe,{key:2,src:c(se),"image-container-class":"w-full h-full"},null,8,["src"])):(m(),j(Ai((ze=c(I))==null?void 0:ze.content),et({key:3,ref_key:"componentRef",ref:S,class:"w-full h-full relative"},c(o),V0(c(n).options.events||{})),null,16))],6),Te[1]||(Te[1]=g("div",{class:"mt-auto"},null,-1)),g("div",o5,[c(h)?ce("",!0):(m(),j(ht,et({key:0},c(oe),{class:"cui-button-medium",onClick:F}),null,16)),Te[0]||(Te[0]=g("div",{class:"ml-auto"},null,-1)),c(v)?ce("",!0):(m(),j(ht,et({key:1},c(ue),{loading:c(w),disabled:c(l),class:"cui-button-medium",onClick:D}),null,16,["loading","disabled"]))])],64)}}}),Ui={modal:!0,closable:!0,blockScroll:!0,draggable:!1,dismissableMask:!0,baseZIndex:1100,showHeader:!1},jo={pt:{root:{class:"p-dialog-maximized pt-safe border-none"}}},qo={pt:{root:{class:"shadow-xl shadow-black/30 overflow-hidden"}}},tr={mobile:{textDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo},imageDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo},componentDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo},stepperDialog:{style:{maxWidth:"100%",maxHeight:"100%"},...jo}},desktop:{textDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"auto"},...qo},imageDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"70vw"},...qo},componentDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"70vw"},...qo},stepperDialog:{style:{maxWidth:"70vw",maxHeight:"90vh",width:"70vw"},...qo}}};function c5(){return{open:(e,t)=>{const n={content:e&&pe(e),options:t||{},data:t&&t.data,close:r=>{yu.emit("close",{instance:n,params:r})}};return yu.emit("open",{instance:n}),n}}}function Il(){const s=c5(),{mdBreakpoint:e}=Vr(),t=(u,d)=>{const h=Tr({...u});kl(h.options.props,d)},n=(u,d)=>(Ge(e,h=>{if(h)switch(d){case"text":t(u,tr.mobile.textDialog);break;case"image":t(u,tr.mobile.imageDialog);break;case"component":t(u,tr.mobile.componentDialog);break;case"stepper":t(u,tr.mobile.stepperDialog);break}else switch(d){case"text":t(u,tr.desktop.textDialog);break;case"image":t(u,tr.desktop.imageDialog);break;case"component":t(u,tr.desktop.componentDialog);break;case"stepper":t(u,tr.desktop.stepperDialog);break}},{immediate:!0}),u);function r(u,d,h){const{component:v,data:f,onConfirm:b,onCancel:k,onSettled:z,events:L,...se}=d,K={content:v?pe(v):void 0},N=s.open(a5,{data:Wt(Tr({confirmText:f.confirmText??void 0,cancelText:f.cancelText??void 0,hideConfirmButton:f.hideConfirmButton??!1,hideCancelButton:f.hideCancelButton??!1,loading:f.loading??!1,disabled:f.disabled??!1,confirmButtonProps:f.confirmButtonProps??void 0,cancelButtonProps:f.cancelButtonProps??void 0,dialogContentClass:f.dialogContentClass??void 0,dialogContentStyle:f.dialogContentStyle??void 0,stayActive:f.stayActive??!1,fullscreen:f.fullscreen??!1,contentText:f.contentText??void 0,src:f.src??void 0,markdown:f.markdown??!1,contentProps:f.contentProps??void 0,tabs:f.tabs??void 0,...f})),props:h,templates:K,...se,events:L,onConfirm:b,onCancel:k,onClose:E=>{var O,U;if(((O=E==null?void 0:E.data)==null?void 0:O.status)==="confirm"){const{status:S,...M}=E.data;b==null||b((M==null?void 0:M.data)??M)}else k==null||k();z==null||z(((U=E==null?void 0:E.data)==null?void 0:U.data)??(E==null?void 0:E.data))}});return f.fullscreen?N:n(N,u)}function i(u){const{data:d,...h}=u,v=structuredClone(Ui);return v.style={...Ui.style,width:"auto",minWidth:"400px"},d.fullscreen&&(v.style={...v.style,maxWidth:"none",maxHeight:"none"},v.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("text",{data:d,...h},v)}function o(u){const{data:d,...h}=u,v=structuredClone(Ui);return d.fullscreen&&(v.style={...v.style,maxWidth:"none",maxHeight:"none"},v.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("image",{data:d,...h},v)}function a(u,d){const{data:h,...v}=d,f=structuredClone(Ui);return h.fullscreen&&(f.style={...f.style,maxWidth:"none",maxHeight:"none"},f.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("component",{component:u,data:h,...v},f)}function l(u,d){const{data:h,...v}=d,f=structuredClone(Ui);return h.fullscreen&&(f.style={...f.style,maxWidth:"none",maxHeight:"none"},f.pt={root:{class:"p-dialog-maximized pt-safe border-none"}}),r("stepper",{component:u,data:h,...v},f)}return{openTextDialog:i,openImageDialog:o,openComponentDialog:a,openStepperDialog:l}}const l5=sl(Gh);function Ol(){const s=ne(()=>typeof window>"u"?!1:[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i].some(k=>navigator.userAgent.match(k))),e=ne(()=>typeof window>"u"?!1:[/Android/i].some(k=>navigator.userAgent.match(k))),t=ne(()=>typeof window>"u"?!1:n.value||r.value),n=ne(()=>typeof window>"u"?!1:[/iPhone/i].some(k=>navigator.userAgent.match(k))),r=ne(()=>typeof window>"u"?!1:[/Macintosh/i].some(k=>navigator.userAgent.match(k)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1)),i=ne(()=>{var k;if(typeof window>"u")return[0,0];const b=/OS [\d_]+/i;return n.value?((k=navigator.userAgent.match(b))==null?void 0:k[0].substr(3).split("_").map(z=>parseInt(z)))||[0,0]:[0,0]}),o=ne(()=>typeof window>"u"?!1:[/Safari/i].some(k=>navigator.userAgent.match(k))),a=ne(()=>{if(typeof window>"u")return null;const b=/Version\/(\d+).+Safari/;return navigator.userAgent.match(b)}),l=ne(()=>typeof window>"u"?!1:[/Firefox/i].some(k=>navigator.userAgent.match(k))),u=ne(()=>typeof window>"u"?!1:[/Chrome/i].some(k=>navigator.userAgent.match(k))),d=ne(()=>{let b=!1;if("maxTouchPoints"in navigator)b=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)navigator!==null&&(b=navigator.msMaxTouchPoints>0);else{const k=matchMedia("(pointer:coarse)");if(k&&k.media==="(pointer:coarse)")b=!!k.matches;else if("orientation"in window)b=!0;else{const z=navigator.userAgent;b=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(z)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(z)}}return b}),h=ne(()=>l5("(display-mode: standalone)").value||window.navigator.standalone||document.referrer.includes("android-app://")),v=ne(()=>{const b=typeof document.body.requestFullscreen<"u"||typeof document.body.mozRequestFullScreen<"u"||typeof document.body.webkitRequestFullscreen<"u"||typeof document.body.msRequestFullscreen<"u"||typeof document.exitFullscreen<"u"||typeof document.mozCancelFullScreen<"u"||typeof document.webkitExitFullscreen<"u",[k,z]=i.value,L=k&&k>=17&&z&&z>=2;return!!(b||!n.value||n.value&&L)}),f=ne(()=>{const b="pictureInPictureEnabled"in document;return t.value&&h.value?!1:b});return{isPWA:h,isMobile:s,isAndroid:e,isIos:t,isIphone:n,isIpad:r,iosVersion:i,isSafari:o,safariVersion:a,isFirefox:l,isChrome:u,isTouch:d,isPipSupported:f,isFsSupported:v}}const u5={class:"flex justify-between items-center mb-4 h-9"},d5={class:"flex items-center gap-2"},h5={class:"text-base font-semibold"},m5={class:"overflow-y-auto",style:{maxHeight:"234px"}},p5={class:"flex gap-3"},f5={class:"flex-1 min-w-0"},g5={class:"flex justify-between items-center"},v5={class:"font-semibold text-sm text-color truncate max-w-[200px]"},_5={class:"text-xs text-muted shrink-0"},y5={class:"text-xs text-muted mt-1 text-left line-clamp-2 overflow-hidden"},b5={key:0,class:"text-center py-8 text-muted text-sm"},w5=At({__name:"CuiNotificationMenu",setup(s){const{t:e}=js(),t=qr(),n=Pl(),r=Il(),{isTouch:i}=Ol(),o=Ls(),a=Vt("notificationsMenuRef"),l=ae([]),u=ae({}),d=ae(!1),h=ae(!1);Ge(d,S=>{S&&O()});const v=(S,[M])=>{var oe,ue;if(!M.isIntersecting){(oe=u.value[S])==null||oe.resetFn(),(ue=u.value[S])==null||ue.stopFn(),delete u.value[S];return}if(u.value[S])return;const B=M.target;if(!B.parentElement)return;const I=nl(B,()=>{u.value[S]&&u.value[S].resetFn()});let w;const H=i.value?X0:ef,{direction:J,stop:q}=H(B,{threshold:10,disableTextSelect:!0,onSwipe(){var Se,F;for(const D in u.value)D!==S&&((Se=u.value[D])==null||Se.resetFn());J.value==="left"?u.value[S]={left:"-75px",opacity:1,deleteOpacity:1,isSwiping:!0,resetFn(){this.left="0",this.opacity=1,this.deleteOpacity=0},stopFn:()=>{delete u.value[S],q(),I(),clearTimeout(w)}}:(F=u.value[S])==null||F.resetFn()},onSwipeEnd(){clearTimeout(w),w=setTimeout(()=>{u.value[S]&&(u.value[S].isSwiping=!1)},10)}})},f=S=>{var M;(M=a.value)==null||M.toggle(S)},b=S=>{const M=Date.now()-S,B=Math.floor(M/(1e3*60)),W=Math.floor(M/(1e3*60*60)),I=Math.floor(M/(1e3*60*60*24));return B<60?`${B}${e("components.notification_menu.short_minutes")}`:W<24?`${W}${e("components.notification_menu.short_hours")}`:I<7?`${I}${e("components.notification_menu.short_days")}`:I<30?`${Math.floor(I/7)}${e("components.notification_menu.short_weeks")}`:I<365?`${Math.floor(I/30)}${e("components.notification_menu.short_months")}`:`${Math.floor(I/365)}${e("components.notification_menu.short_years")}`},k=S=>{var B;const M=S.link;(B=a.value)==null||B.hide(),z(S),M&&t.push({path:M})},z=S=>{var M;if(S){const B=u.value[S._id];B==null||B.stopFn();const W=l.value.findIndex(I=>I._id===S._id);W!==-1&&(l.value.splice(W,1),(M=o.value)==null||M.socket.emit("remove-notification",S._id))}},L=()=>{var S,M;for(const B in u.value)(S=u.value[B])==null||S.stopFn();l.value.splice(0,l.value.length),(M=o.value)==null||M.socket.emit("clear-notifications")},se=S=>{switch(S){case"info":return"rgb(33, 150, 243)";case"warn":return"rgb(251, 140, 0)";case"error":return"rgb(176, 0, 32)";default:return"rgb(69, 69, 69)"}},K=S=>{const M=u.value[S._id];M!=null&&M.isSwiping||r.openTextDialog({data:{title:S.title,contentText:S.text,confirmText:S!=null&&S.link?e("components.form.button.go_to_message"):e("components.form.button.mark_as_read")},onConfirm:()=>k(S),onCancel:()=>z(S)})},N=()=>{var S,M;for(const B in u.value)(S=u.value[B])==null||S.resetFn(),(M=u.value[B])==null||M.stopFn()},E=(S,M)=>{if(d.value&&M.channel==="update-check"&&M.status==="available"){const B={_id:"system-update",title:"Update",text:"New camera.ui app update available",type:"info",link:"/settings/system",timestamp:Date.now()};if(l.value.find(W=>W._id===B._id))return;l.value.push(B)}},O=async()=>{if(d.value){window.electron.removeListener("app-status",E),window.electron.on("app-status",E),window.electron.send("check-for-updates");try{if((await window.electron.invoke("get-update-available")).isUpdateAvailable){const M={_id:"system-update",title:"Update",text:"New camera.ui app update available",type:"info",link:"/settings/system",timestamp:Date.now()};if(l.value.find(B=>B._id===M._id))return;l.value.push(M)}}catch{}}};el(()=>{o.value=n.connectToNamespace("/notifications"),o.value.request("get-notifications").subscribe(S=>{l.value=S}),o.value.socket.on("notifications",S=>{l.value=S}),o.value.socket.on("remove-notification",S=>{const M=l.value.findIndex(B=>B._id===S||B.title===S);M!==-1&&l.value.splice(M,1)}),o.value.socket.on("clear-notifications",()=>{l.value=[]})});const U=()=>{const S=document.querySelector('meta[name="electron-server"]'),M=S!==null&&S.getAttribute("content")==="true";d.value=window.electron!==void 0,h.value=M,setTimeout(()=>{d.value=window.electron!==void 0,h.value=M},100)};return Sn(()=>{U()}),vo(()=>{var S,M,B;(M=(S=o.value)==null?void 0:S.end)==null||M.call(S),(B=window.electron)==null||B.removeListener("app-status",E)}),(S,M)=>{const B=Qb,W=Lh,I=ys,w=Ub,H=Ea,J=Qc;return m(),A(yt,null,[y(I,{severity:"secondary",text:"",class:"cui-button p-2 text-color non-draggable-region",onClick:f},{icon:$(()=>[y(B,{class:"w-6 h-6"}),c(l).length?(m(),j(W,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] right-[10px] top-[7px]"})):ce("",!0)]),_:1}),y(J,{ref_key:"notificationsMenuRef",ref:a,"append-to":"self",class:"w-[20rem] cui-rounded-corner shadow-lg notification-menu isolate overscroll-contain non-draggable-region",onHide:N},{default:$(()=>[g("div",u5,[g("div",d5,[g("h3",h5,me(S.$t("components.notification_menu.notifications")),1),y(W,{class:"rounded-full text-xs p-1"},{default:$(()=>[Qt(me(c(l).length>99?"99+":c(l).length),1)]),_:1})]),c(l).length?(m(),j(I,{key:0,severity:"danger",text:"",rounded:"",class:"p-2 cui-icon-md",onClick:L},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:1})):ce("",!0)]),g("div",m5,[(m(!0),A(yt,null,qt(c(l),q=>{var oe,ue,Se;return m(),A("div",{key:q._id,class:"relative overflow-hidden"},[Pt((m(),A("div",{class:"relative transition-all duration-200",style:ot({left:((oe=c(u)[q._id])==null?void 0:oe.left)||"0",opacity:((ue=c(u)[q._id])==null?void 0:ue.opacity)||1})},[y(I,{severity:"secondary",text:"",class:"cui-button p-2 block w-full",onClick:F=>K(q)},{default:$(()=>[g("div",p5,[g("div",{class:"w-2 h-2 rounded-full mt-2",style:ot({backgroundColor:se(q.type)})},null,4),g("div",f5,[g("div",g5,[g("h4",v5,me(q.title),1),g("span",_5,me(b(q.timestamp)),1)]),g("p",y5,me(q.text),1)])])]),_:2},1032,["onClick"])],4)),[[c(Y0),F=>v(q._id,F)]]),g("div",{class:"absolute right-0 top-0 h-full flex items-center pr-4",style:ot({opacity:((Se=c(u)[q._id])==null?void 0:Se.deleteOpacity)||0})},[y(I,{severity:"danger",class:"cui-icon-sm",text:"",rounded:"",onClick:F=>z(q)},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:2},1032,["onClick"])],4),c(l).indexOf(q)!==c(l).length-1?(m(),j(H,{key:0,class:"my-0 py-1"})):ce("",!0)])}),128))]),c(l).length===0?(m(),A("div",b5,me(S.$t("components.notification_menu.no_notifications")),1)):ce("",!0)]),_:1},512)],64)}}}),x5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S5(s,e){return m(),A("svg",x5,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 17q-2.075 0-3.537-1.463T7 12t1.463-3.537T12 7t3.538 1.463T17 12t-1.463 3.538T12 17M2 13q-.425 0-.712-.288T1 12t.288-.712T2 11h2q.425 0 .713.288T5 12t-.288.713T4 13zm18 0q-.425 0-.712-.288T19 12t.288-.712T20 11h2q.425 0 .713.288T23 12t-.288.713T22 13zm-8-8q-.425 0-.712-.288T11 4V2q0-.425.288-.712T12 1t.713.288T13 2v2q0 .425-.288.713T12 5m0 18q-.425 0-.712-.288T11 22v-2q0-.425.288-.712T12 19t.713.288T13 20v2q0 .425-.288.713T12 23M5.65 7.05L4.575 6q-.3-.275-.288-.7t.288-.725q.3-.3.725-.3t.7.3L7.05 5.65q.275.3.275.7t-.275.7t-.687.288t-.713-.288M18 19.425l-1.05-1.075q-.275-.3-.275-.712t.275-.688q.275-.3.688-.287t.712.287L19.425 18q.3.275.288.7t-.288.725q-.3.3-.725.3t-.7-.3M16.95 7.05q-.3-.275-.288-.687t.288-.713L18 4.575q.275-.3.7-.288t.725.288q.3.3.3.725t-.3.7L18.35 7.05q-.3.275-.7.275t-.7-.275M4.575 19.425q-.3-.3-.3-.725t.3-.7l1.075-1.05q.3-.275.712-.275t.688.275q.3.275.288.688t-.288.712L6 19.425q-.275.3-.7.288t-.725-.288"},null,-1)]))}const C5=pe({name:"material-symbols-light-mode-rounded",render:S5}),k5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E5(s,e){return m(),A("svg",k5,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 21q-3.75 0-6.375-2.625T3 12t2.625-6.375T12 3q.35 0 .688.025t.662.075q-1.025.725-1.638 1.888T11.1 7.5q0 2.25 1.575 3.825T16.5 12.9q1.375 0 2.525-.613T20.9 10.65q.05.325.075.662T21 12q0 3.75-2.625 6.375T12 21"},null,-1)]))}const A5=pe({name:"material-symbols-dark-mode",render:E5}),M5={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},$5=["id"],P5=["mask"];function T5(s,e){return m(),A("svg",M5,[g("defs",null,[g("mask",{id:s.idMap.ipSDarkMode0},e[0]||(e[0]=[g("g",{fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-miterlimit":"10","stroke-width":"4"},[g("path",{fill:"#fff",stroke:"#fff",d:"m24.003 4l5.27 5.27h9.457v9.456l5.27 5.27l-5.27 5.278v9.456h-9.456L24.004 44l-5.278-5.27H9.27v-9.456L4 23.997l5.27-5.27V9.27h9.456z"}),g("path",{fill:"#000",stroke:"#000",d:"M27 17c0 8-5 9-10 9c0 4 6.5 8 12 4s2-13-2-13"})],-1)]),8,$5)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSDarkMode0+")"},null,8,P5)])}const R5=pe({name:"icon-park-solid-dark-mode",render:T5,setup(){return{idMap:{ipSDarkMode0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Nl=Mi("theme",()=>{const s=localStorage.getItem("theme"),e=s?JSON.parse(s):{theme:"dark",autoMode:!0},t=wu(e.theme,{onBeforeChange(){if(!r.value)return!1},onChanged(h){e.theme=h,localStorage.setItem("theme",JSON.stringify(e))}}),n=wu(e.autoMode,{onBeforeChange(h){if(h&&!r.value)return!1},onChanged(h){e.autoMode=h,localStorage.setItem("theme",JSON.stringify(e))}}),r=ae(!0),i=Tr(["light","dark"]);Ge(n,h=>{h&&(t.value=o())}),Ge(t,h=>{Zs(()=>{l(h),r.value=!0}),r.value=!1});const o=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",a=()=>n.value?o():t.value,l=h=>{switch(document.documentElement.setAttribute("data-mode",h),h){case"light":document.documentElement.classList.remove("dark-mode");break;case"dark":document.documentElement.classList.add("dark-mode");break}},u=()=>{n.value?(n.value=!1,t.value="light"):t.value==="light"?t.value="dark":n.value=!0},d=Gh("(prefers-color-scheme: dark)");return Ge(d,h=>{n.value&&(t.value=h?"dark":"light")}),l(a()),{colors:i,theme:t,autoMode:n,setAppTheme:l,getSystemMode:o,toggleTheme:u}}),I5=At({__name:"CuiThemeSwitch",setup(s){const e=Nl(),{theme:t,autoMode:n}=Vs(e),r=()=>{e.toggleTheme()};return(i,o)=>{const a=R5,l=A5,u=C5,d=ys;return m(),j(d,{severity:"secondary",text:"",class:"cui-button p-2 text-color",onClick:r},{default:$(()=>[c(n)?(m(),j(a,{key:0,class:"w-6 h-6"})):c(t)==="dark"?(m(),j(l,{key:1,class:"w-6 h-6"})):c(t)==="light"?(m(),j(u,{key:2,class:"w-6 h-6"})):ce("",!0)]),_:1})}}}),O5={class:"relative flex overflow-hidden items-center justify-center w-5 h-5"},N5={class:"flex flex-col justify-between w-4 h-3 transform transition-all duration-100 origin-center overflow-hidden"},F5=At({__name:"CuiNavbarToggle",setup(s){const e=Tl(),{bus:t}=Rl(),{navbarState:n}=ja(),{xlBreakpoint:r}=Vr(),{uiSettings:i}=Vs(e),o=ae("closed"),a=ne(()=>o.value==="opened");Ge(n,u=>{u&&u!==o.value&&(o.value=u==="minified"||u==="closed"?"closed":"opened")});const l=()=>{t.emit({navbarState:o.value==="opened"?"closed":"opened"})};return(u,d)=>{const h=ys;return!c(r)||c(i).interface.navbarStayCollapsed?(m(),j(h,{key:0,id:"menu-icon",class:"cui-button relative group p-2 transition-colors duration-100",severity:"secondary",text:"",onClick:l},{default:$(()=>[g("div",O5,[g("div",N5,[g("div",{class:at(["h-0.5 w-2 transform transition-all duration-100 origin-center",{"w-4 rotate-45 translate-y-[5px]":c(a)}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["h-0.5 w-4 rounded transform transition-all duration-100",{"opacity-0":c(a)}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["h-0.5 w-3 transform transition-all duration-100 origin-center",{"w-4 -rotate-45 -translate-y-[5px]":c(a)}]),style:{backgroundColor:"var(--text-color)"}},null,2)])])]),_:1})):ce("",!0)}}}),L5={class:"group relative flex items-center"},j5={key:0,class:"flex items-center mr-3 pointer-events-auto"},q5={class:"flex-1 min-w-0 text-left"},D5={class:"text-sm font-medium truncate"},B5=["is-exact-active"],z5=["is-exact-active"],U5=At({__name:"CuiListItem",props:{active:{type:Boolean},disabled:{type:Boolean},to:{},activeClass:{},buttonProps:{},tooltip:{}},emits:["click"],setup(s,{emit:e}){const t=e,n=s,{disabled:r,active:i,to:o,activeClass:a,buttonProps:l,tooltip:u}=Wt(n),[d,h]=lc(),[v,f]=lc(),b=k=>{r.value||t("click",k)};return(k,z)=>{const L=ys,se=Ei("RouterLink"),K=jr;return m(),A("div",L5,[y(c(v),null,{default:$(({isExactActive:N})=>[g("div",{class:at(["relative z-10 flex items-center w-full px-3 py-2 pointer-events-none",{"opacity-80 text-muted pointer-events-none disabled cursor-not-allowed":c(r)}])},[k.$slots.prepend?(m(),A("div",j5,[ei(k.$slots,"prepend",{isExactActive:N??!1},void 0,!0)])):ce("",!0),g("div",q5,[g("div",D5,[ei(k.$slots,"default",{isExactActive:N??!1},void 0,!0)]),k.$slots.subtitle?(m(),A("div",{key:0,"is-exact-active":N??!1,class:"text-sm text-muted mt-0.5"},[ei(k.$slots,"subtitle",{},void 0,!0)],8,B5)):ce("",!0)]),k.$slots.append?(m(),A("div",{key:1,"is-exact-active":N??!1,class:"flex items-center ml-3 pointer-events-auto"},[ei(k.$slots,"append",{},void 0,!0)],8,z5)):ce("",!0)],2)]),_:3}),y(c(d),null,{default:$(({isExactActive:N})=>[Pt(y(L,et({text:"",fluid:"",disabled:c(r),severity:"contrast",class:["cui-button absolute inset-0",[{active:c(i)||N,"cursor-not-allowed disabled":c(r)},c(i)||N?c(a):void 0]]},c(l),{onClick:b}),null,16,["disabled","class"]),[[K,{value:c(u)}]]),y(c(f),{"is-exact-active":N},null,8,["is-exact-active"])]),_:1}),c(o)?(m(),j(se,{key:0,to:c(o),class:"block transition-all duration-300"},{default:$(({isExactActive:N})=>[y(c(h),{"is-exact-active":N},null,8,["is-exact-active"])]),_:1},8,["to"])):(m(),j(c(h),{key:1}))])}}}),pp=qs(U5,[["__scopeId","data-v-115e51ef"]]),V5={key:0,class:"flex flex-col gap-1"},H5={key:2,class:"flex flex-col gap-1"},Q5={key:4,class:"flex flex-col gap-1"},fp=At({__name:"CuiMenu",props:{items:{},autoHide:{type:Boolean,default:!0},popover:{},sortList:{type:Boolean}},emits:["show","hide","click:menu-item"],setup(s,{expose:e,emit:t}){const n=t,r=s,{items:i,autoHide:o,popover:a,sortList:l}=Wt(r),u=Vt("menuRef"),d=ae(!1),h=ae(),[v,f]=lc(),b=ne(()=>{const S=i.value.filter(M=>!M.hide);return l.value?S.sort((M,B)=>M.key&&B.key?M.key.localeCompare(B.key):M.label&&B.label?M.label.localeCompare(B.label):0):S}),k=ne(()=>b.value.filter(S=>S.position==="header")),z=ne(()=>b.value.filter(S=>S.position==="footer")),L=ne(()=>b.value.filter(S=>!S.position)),se=S=>{var M;o.value&&O(),(M=S.onClick)==null||M.call(S,bu(h.value)),n("click:menu-item",S)},K=()=>{d.value=!0,n("show")},N=()=>{h.value=void 0,d.value=!1,n("hide")},E=(S,M,B)=>{var W;h.value=B,(W=u.value)==null||W.toggle(S,M)},O=()=>{var S;(S=u.value)==null||S.hide()},U=(S,M)=>{var B;(B=u.value)==null||B.show(S,M)};return e({menu:u,isOpen:d,data:bu(h),toggleMenu:E,hide:O,show:U}),(S,M)=>{const B=Zm,W=fo,I=pp,w=Ea,H=Qc;return m(),j(H,et({ref_key:"menuRef",ref:u,class:"shadow-lg cui-rounded-corner"},c(a),{onShow:K,onHide:N}),{default:$(()=>[y(c(v),null,{default:$(({item:J})=>[(m(),j(I,{key:J.key,to:J.to,class:"min-h-10","active-class":"!bg-primary-500/10",disabled:J.disabled,"button-props":J.buttonProps,tooltip:J.tooltip,onClick:q=>se(J)},Hh({default:$(({isExactActive:q})=>[g("span",et(J.labelProps,{class:{"text-primary":q||J.active,"!font-bold":J.avatarProps,"opacity-70":!J.disabled}}),me(J.label),17)]),_:2},[J.avatarProps||J.icon?{name:"prepend",fn:$(({isExactActive:q})=>[J.avatarProps?(m(),j(B,H0(et({key:0},J.avatarProps)),null,16)):ce("",!0),J.icon?(m(),j(Ai(J.icon),et({key:1},J.iconProps,{class:{"text-primary":q||J.active,"opacity-70":!J.disabled}}),null,16,["class"])):ce("",!0)]),key:"0"}:void 0,J.description?{name:"subtitle",fn:$(()=>[g("span",et(J.descriptionProps,{class:{"opacity-70":!J.disabled}}),me(J.description),17)]),key:"1"}:void 0,J.toggle?{name:"append",fn:$(()=>[y(W,{"model-value":J.toggleState,disabled:J.disabled,"onUpdate:modelValue":q=>se(J)},null,8,["model-value","disabled","onUpdate:modelValue"])]),key:"2"}:void 0]),1032,["to","disabled","button-props","tooltip","onClick"]))]),_:1}),c(k).length?(m(),A("div",V5,[(m(!0),A(yt,null,qt(c(k),(J,q)=>(m(),j(c(f),{key:q,item:J},null,8,["item"]))),128))])):ce("",!0),c(k).length&&c(L).length?(m(),j(w,{key:1,class:"m-0 py-3"})):ce("",!0),c(L).length?(m(),A("div",H5,[(m(!0),A(yt,null,qt(c(L),(J,q)=>(m(),j(c(f),{key:q,item:J},null,8,["item"]))),128))])):ce("",!0),c(L).length&&c(z).length?(m(),j(w,{key:3,class:"m-0 py-3"})):ce("",!0),c(z).length?(m(),A("div",Q5,[(m(!0),A(yt,null,qt(c(z),(J,q)=>(m(),j(c(f),{key:q,item:J},null,8,["item"]))),128))])):ce("",!0)]),_:1},16)}}}),K5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z5(s,e){return m(),A("svg",K5,e[0]||(e[0]=[Vh('<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.5"><path d="M11 21H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v7"></path><path stroke-linejoin="round" d="M2 7h20M5 5.01l.01-.011M8 5.01l.01-.011M11 5.01l.01-.011m10.657 11.668C21.047 15.097 19.635 14 17.99 14c-1.758 0-3.252 1.255-3.793 3"></path><path stroke-linejoin="round" d="M19.995 16.772H21.4a.6.6 0 0 0 .6-.6V14.55m-7.666 4.783C14.953 20.903 16.366 22 18.01 22c1.758 0 3.252-1.255 3.793-3"></path><path stroke-linejoin="round" d="M16.005 19.228H14.6a.6.6 0 0 0-.6.6v1.622"></path></g>',1)]))}const G5=pe({name:"iconoir-reload-window",render:Z5}),W5={class:"relative w-6 h-6"},J5=At({__name:"CuiProfileMenu",setup(s){const{t:e}=js(),t=Fs(),{user:n}=Vs(t),r=Vt("menuRef"),i=ne(()=>uo.filter(l=>{var u;return((u=l.meta)==null?void 0:u.profileMenu)&&l.meta.auth&&Si(l)})),o=ne(()=>{var h,v;const l={label:(h=n.value)==null?void 0:h.username,description:(v=n.value)==null?void 0:v.role,to:"/settings/account",position:"header",avatarProps:{src:"avatar",size:35,style:{width:"35px",height:"35px"}}},u=[...i.value.map(f=>({label:e(`navigation.${f.name.toLowerCase()}`),icon:f.meta.profileMenu.icon.default,to:f.path})),{label:e("components.user_menu.reload"),icon:G5,onClick:a}],d={label:e("components.user_menu.logout"),icon:Yh,position:"footer",iconProps:{class:"!text-primary"},labelProps:{class:"!text-primary"},buttonProps:{class:"hover:!bg-primary-500/10 active:!bg-primary-500/10 focus:!bg-primary-500/10"},onClick:t.logout};return[l,...u,d]}),a=()=>{window.location.reload()};return(l,u)=>{var v;const d=ys,h=fp;return m(),A(yt,null,[y(d,{severity:"secondary",text:"",class:"cui-button p-2 text-color",onClick:(v=c(r))==null?void 0:v.toggleMenu},{default:$(()=>{var f,b,k;return[g("div",W5,[g("div",{class:at(["absolute top-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center",{"w-4 h-[2px] rotate-45 top-1/2 -translate-y-1/2 rounded-none":(f=c(r))==null?void 0:f.isOpen}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-1.5 h-1.5 rounded-full transition-all duration-100",{"opacity-0 scale-0":(b=c(r))==null?void 0:b.isOpen}]),style:{backgroundColor:"var(--text-color)"}},null,2),g("div",{class:at(["absolute bottom-0.5 left-1/2 -translate-x-1/2 w-1.5 h-1.5 rounded-full transform transition-all duration-100 origin-center",{"w-4 h-[2px] -rotate-45 bottom-1/2 translate-y-1/2 rounded-none":(k=c(r))==null?void 0:k.isOpen}]),style:{backgroundColor:"var(--text-color)"}},null,2)])]}),_:1},8,["onClick"]),y(h,{ref_key:"menuRef",ref:r,items:c(o),popover:{appendTo:"self",pt:{root:{class:"w-[18rem] profile-menu"}}}},null,8,["items"])],64)}}}),Y5={HEIGHT:60},X5={class:"flex flex-row items-center flex-1 p-2"},ew=At({__name:"CuiTopbar",setup(s){const{showBottombar:e}=ja();return(t,n)=>{const r=J5,i=F5,o=I5,a=w5;return m(),A("header",{class:"cui-topbar fixed flex flex-row items-center right-0 pt-safe pr-safe draggable-region",style:ot({height:`calc(${c(Y5).HEIGHT}px + env(safe-area-inset-top, 0px))`})},[g("div",X5,[c(e)?(m(),j(r,{key:0,class:"non-draggable-region"})):(m(),j(i,{key:1,class:"non-draggable-region"})),y(o,{class:"ml-auto non-draggable-region"}),("useCuiPermission"in t?t.useCuiPermission:c(Si))(void 0,"admin")?(m(),j(a,{key:2})):ce("",!0)])],4)}}}),tw=qs(ew,[["__scopeId","data-v-162b131f"]]),sw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nw(s,e){return m(),A("svg",sw,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4m-8-2l8-8m0 0v5m0-5h-5"},null,-1)]))}const rw=pe({name:"majesticons-open",render:nw}),gp=At({__name:"CuiChipGroup",props:Kn({selectedClass:{},disabled:{type:Boolean},mandatory:{type:Boolean},multiple:{type:Boolean}},{modelValue:{required:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(s){const e=Rr(s,"modelValue"),t=s,{selectedClass:n,disabled:r,mandatory:i,multiple:o}=Wt(t);return Xc("chipGroup",{modelValue:e,selectedClass:n,disabled:r,mandatory:i,updateSelected:l=>{if(!r.value)if(o.value){let u=[...Array.isArray(e.value)?e.value:[]];u.includes(l)?(!i.value||u.length>1)&&(u=u.filter(d=>d!==l)):u.push(l),e.value=u}else e.value===l?i.value||(e.value=void 0):e.value=l}}),(l,u)=>(m(),A("div",{class:at(["flex flex-wrap gap-2",{"opacity-60 pointer-events-none":c(r)}])},[ei(l.$slots,"default")],2))}}),iw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ow(s,e){return m(),A("svg",iw,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z"},null,-1)]))}const vp=pe({name:"mdi-check",render:ow}),aw={key:0,class:"absolute left-1 top-1/2 transform -translate-y-1/2 flex items-center justify-center cui-icon-sm"},cw=At({__name:"CuiChip",props:{value:{},removable:{type:Boolean},disabled:{type:Boolean},size:{},filter:{type:Boolean}},setup(s){const e=s,{value:t,removable:n,disabled:r,size:i,filter:o}=Wt(e),a=mi("chipGroup"),l=ne(()=>r.value||(a==null?void 0:a.disabled.value)),u=ne(()=>{if(!a)return!1;const v=a.modelValue.value;return Array.isArray(v)?v.includes(t.value):v===t.value}),d=ne(()=>u.value?a==null?void 0:a.selectedClass.value:void 0),h=()=>{l.value||a==null||a.updateSelected(t.value)};return(v,f)=>{const b=vp,k=I0;return m(),j(k,{removable:c(n),disabled:c(l),class:at(["cui-chip inline-flex cursor-pointer transition-all rounded-full py-1 px-2 relative",[{"cui-chip-selected":c(u),"cui-chip-disabled":c(l),"cui-chip-small":c(i)==="small","cui-chip-medium":c(i)==="medium","cui-chip-large":c(i)==="large","pl-7":c(o)&&c(u)},c(d)]]),onClick:h},{default:$(()=>[y(Et,{name:"fade"},{default:$(()=>[c(o)&&c(u)?(m(),A("div",aw,[y(b,{width:"100%",height:"100%"})])):ce("",!0)]),_:1}),ei(v.$slots,"default",{},void 0,!0)]),_:3},8,["removable","disabled","class"])}}}),_p=qs(cw,[["__scopeId","data-v-3b79f904"]]),lw=async({cameraData:s})=>(await Ie.post("/cameras",s)).data,uw=async({cameraData:s})=>(await Ie.post("/cameras/pair",s)).data,dw=async({cameraData:s})=>(await Ie.post("/cameras/preview",s)).data,yp=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}`,{signal:e})).data,hw=async({cameraname:s})=>(await Ie.delete(`/cameras/${s}/log`)).data,mw=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}/log/download`,{signal:e})).data,pw=async({cameraname:s,sourcename:e,probeConfig:t,signal:n})=>(await Ie.get(`/cameras/${s}/probe/${e}`,{params:{...t},signal:n})).data,fw=async({cameraname:s,forceNew:e,signal:t})=>(await Ie.get(`/cameras/${s}/snapshot`,{signal:t,params:{forceNew:e}})).data,gw=async({parameter:s,signal:e})=>(await Ie.get("/cameras",{params:s,signal:e})).data,vw=async({type:s,src:e,signal:t})=>(await Ie.get("/cameras/discover",{params:{type:s,src:e},signal:t})).data,_w=async({cameraname:s,cameraData:e})=>(await Ie.patch(`/cameras/${s}`,e)).data,yw=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}/extensions`,{signal:e})).data,bw=async({cameraname:s,pluginname:e,signal:t})=>(await Ie.get(`/cameras/${s}/${e}/config`,{signal:t})).data,ww=async({cameraname:s,pluginname:e,configData:t})=>(await Ie.patch(`/cameras/${s}/${e}/config`,t)).data,xw=async({cameraname:s,pluginname:e,configData:t})=>(await Ie.put(`/cameras/${s}/${e}/config`,t)).data,Sw=async({cameraname:s,pluginname:e,configData:t})=>(await Ie.post(`/cameras/${s}/${e}/config`,t)).data,Cw=async({cameraname:s,pluginname:e,type:t})=>(await Ie.put(`/cameras/${s}/${e}/enable`,null,{params:{type:t}})).data,kw=async({cameraname:s,pluginname:e,type:t})=>(await Ie.put(`/cameras/${s}/${e}/disable`,null,{params:{type:t}})).data,Ew=async({cameraname:s,pluginname:e,type:t})=>(await Ie.post(`/cameras/${s}/${e}`,null,{params:{type:t}})).data,Aw=async({cameraname:s,pluginname:e,type:t})=>(await Ie.delete(`/cameras/${s}/${e}`,{params:{type:t}})).data,Mw=async({cameraname:s,signal:e})=>(await Ie.get(`/cameras/${s}/zones`,{signal:e})).data,$w=async({cameraname:s,zoneData:e})=>(await Ie.patch(`/cameras/${s}/zones`,e)).data,Pw=async({cameraname:s})=>(await Ie.delete(`/cameras/${s}`)).data,Tw=async()=>(await Ie.delete("/cameras")).data;class Jn{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"getCameraQuery",enabled:!0},{name:"getCamerasQuery",enabled:!0},{name:"discoverCamerasQuery",enabled:!0},{name:"getCameraSnapshotQuery",enabled:!0},{name:"getCameraExtensionsQuery",enabled:!0},{name:"getCameraExtensionConfigQuery",enabled:!0},{name:"getZonesQuery",enabled:!0},{name:"probeCameraSourceQuery",enabled:!0},{name:"downloadLogQuery",enabled:!0}]))}get queryClient(){return this._queryClient}createCameraQuery(){return ut({mutationFn:lw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_added"),life:3e3})}})}pairCameraQuery(){return ut({mutationFn:uw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_added"),life:3e3})}})}previewCameraQuery(){return ut({mutationFn:dw})}getCameraQuery(e){return Bt({queryKey:["cameras",e],queryFn:({signal:t})=>yp({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraQuery"&&t.enabled)})}getCameraExtensionsQuery(e){return Bt({queryKey:["camerasExtensions",e],queryFn:({signal:t})=>yw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraExtensionsQuery"&&t.enabled)})}probeCameraSourceQuery(e,t,n){return Bt({queryKey:["cameras",e,"probe",t],queryFn:({signal:r})=>pw({cameraname:c(e),sourcename:c(t),probeConfig:c(n),signal:r}),enabled:()=>this.queryActivator.value.some(r=>r.name==="probeCameraSourceQuery"&&r.enabled)})}getCameraSnapshotQuery(e,t){return Bt({queryKey:["camerasSnapshot",e],queryFn:({signal:n})=>fw({cameraname:c(e),forceNew:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getCameraSnapshotQuery"&&n.enabled),retry:!1})}getCamerasQuery(e){return Bt({queryKey:["camerasList",e],queryFn:({signal:t})=>gw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getCamerasQuery"&&t.enabled)})}discoverCamerasQuery(e){return Bt({queryKey:["cameras","discover",e],queryFn:({signal:t})=>vw({...c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="discoverCamerasQuery"&&t.enabled)})}patchCameraQuery(){return ut({mutationFn:_w,onSuccess:async(e,t)=>{if(t.cameraData.name&&t.cameraData.name!==t.cameraname){const r=t.cameraname;await this._queryClient.invalidateQueries({queryKey:[r]}),await this._queryClient.refetchQueries({queryKey:["camerasList"]})}else await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]});this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_updated"),life:3e3})}})}getCameraExtensionConfigQuery(e,t,n){return Bt({queryKey:["cameras","extensions",e,t],queryFn:({signal:r})=>bw({cameraname:c(e),pluginname:c(t),signal:r}),enabled:()=>this.queryActivator.value.some(r=>r.name==="getCameraExtensionConfigQuery"&&r.enabled),refetchInterval(){if(n.value)return 15e3},retry:10,retryDelay:500,staleTime:0})}patchCameraExtensionConfigQuery(){return ut({mutationFn:ww,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}setCameraExtensionConfigQuery(){return ut({mutationFn:xw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}submitCameraExtensionConfigQuery(){return ut({mutationFn:Sw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["cameras","extensions",t.cameraname]}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}enableCameraExtensionQuery(){return ut({mutationFn:Cw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}disableCameraExtensionQuery(){return ut({mutationFn:kw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}addCameraExtensionQuery(){return ut({mutationFn:Ew,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}getZonesQuery(e){return Bt({queryKey:["cameras",e,"zones"],queryFn:({signal:t})=>Mw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getZonesQuery"&&t.enabled)})}patchZonesQuery(){return ut({mutationFn:$w,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.zone_updated"),life:3e3})}})}removeCameraExtensionQuery(){return ut({mutationFn:Aw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}removeCameraQuery(){return ut({mutationFn:Pw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.camera_removed"),life:3e3})}})}removeCamerasQuery(){return ut({mutationFn:Tw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["camerasList"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.cameras_removed"),life:3e3})}})}downloadLogQuery(e){return Bt({queryKey:["logs",e],queryFn:({signal:t})=>mw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return ut({mutationFn:hw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["logs",t.cameraname],exact:!0}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.log_cleared"),life:3e3})}})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const Rw=async({pluginData:s})=>(await Ie.post("/plugins",s)).data,Iw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}`,{signal:e})).data,Ow=async({pluginname:s,signal:e})=>(await Ie.get(`/plugins/${s}/versions`,{signal:e})).data,Nw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/update`,{signal:e})).data,Fw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/logo`,{signal:e})).data,Lw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/config`,{signal:e})).data,jw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/contract`,{signal:e})).data,qw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/readme`,{signal:e})).data,Dw=async({pluginName:s,query:e,signal:t})=>(await Ie.get(`/plugins/${s}/changelog`,{params:e,signal:t})).data,Bw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/interface`,{signal:e})).data,zw=async({parameter:s,signal:e})=>(await Ie.get("/plugins",{params:s,signal:e})).data,Uw=async({parameter:s,signal:e})=>(await Ie.get("/plugins/extensions",{params:s,signal:e})).data,Vw=async({pluginName:s})=>(await Ie.delete(`/plugins/${s}/log`)).data,Hw=async({pluginName:s,signal:e})=>(await Ie.get(`/plugins/${s}/log/download`,{signal:e})).data,Qw=async({parameter:s,signal:e})=>(await Ie.get("/plugins/progress",{params:s,signal:e})).data,Kw=async({query:s,parameter:e,signal:t})=>(await Ie.get("/plugins/search",{params:{...s,...e},signal:t})).data,Zw=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/enable`)).data,Gw=async({pluginName:s,configData:e})=>(await Ie.patch(`/plugins/${s}/config`,e)).data,Ww=async({pluginname:s,configData:e})=>(await Ie.put(`/plugins/${s}/config`,e)).data,Jw=async({pluginname:s,configData:e})=>(await Ie.post(`/plugins/${s}/config`,e)).data,Yw=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/disable`)).data,Xw=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/start`)).data,e3=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/stop`)).data,t3=async({pluginName:s})=>(await Ie.put(`/plugins/${s}/restart`)).data,s3=async({pluginName:s,formData:e})=>(await Ie.post(`/plugins/${s}/detect/motion`,e,{responseType:"arraybuffer"})).data,n3=async({pluginName:s,formData:e})=>(await Ie.post(`/plugins/${s}/detect/objects`,e)).data,r3=async({pluginName:s,formData:e})=>(await Ie.post(`/plugins/${s}/detect/audio`,e)).data,i3=async({pluginName:s,removeStorage:e})=>(await Ie.delete(`/plugins/${s}`,{params:{removeStorage:e}})).data,o3=async()=>(await Ie.delete("/plugins")).data;class bp{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",ae([{name:"getPluginQuery",enabled:!0},{name:"getPluginsQuery",enabled:!0},{name:"getPluginsExtensionsQuery",enabled:!0},{name:"searchPluginsQuery",enabled:!0},{name:"getPluginVersionsQuery",enabled:!0},{name:"getPluginUpdateQuery",enabled:!0},{name:"getPluginLogoQuery",enabled:!0},{name:"getPluginConfigQuery",enabled:!0},{name:"getPluginContractQuery",enabled:!0},{name:"getPluginReadmeQuery",enabled:!0},{name:"getPluginInterfaceQuery",enabled:!0},{name:"getPluginChangelogQuery",enabled:!0},{name:"getPluginsProgressQuery",enabled:!0},{name:"installPluginQuery",enabled:!0},{name:"enablePluginQuery",enabled:!0},{name:"disablePluginQuery",enabled:!0},{name:"patchPluginConfigQuery",enabled:!0},{name:"setPluginConfigQuery",enabled:!0},{name:"submitPluginConfigQuery",enabled:!0},{name:"startPluginQuery",enabled:!0},{name:"stopPluginQuery",enabled:!0},{name:"restartPluginQuery",enabled:!0},{name:"detectMotionQuery",enabled:!0},{name:"detectObjectsQuery",enabled:!0},{name:"detectAudioQuery",enabled:!0},{name:"uninstallPluginQuery",enabled:!0},{name:"uninstallPluginsQuery",enabled:!0},{name:"downloadLogQuery",enabled:!0}]))}get queryClient(){return this._queryClient}installPluginQuery(){return ut({mutationFn:Rw,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["plugins"]}),await this._queryClient.refetchQueries({queryKey:["pluginsSearch"]}),await this._queryClient.refetchQueries({queryKey:["pluginsProgress"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_installed"),life:3e3})}})}getPluginQuery(e){return Bt({queryKey:["plugins",e],queryFn:({signal:t})=>Iw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginQuery"&&t.enabled)})}getPluginsQuery(e){return Bt({queryKey:["pluginsList",e],queryFn:({signal:t})=>zw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsQuery"&&t.enabled)})}getPluginsExtensionsQuery(e){return Bt({queryKey:["extensionsList",e],queryFn:({signal:t})=>Uw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsExtensionsQuery"&&t.enabled)})}getPluginsProgressQuery(e){return Bt({queryKey:["pluginsProgress",e],queryFn:({signal:t})=>Qw({parameter:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsProgressQuery"&&t.enabled)})}searchPluginsQuery(e,t){return Bt({queryKey:["pluginsSearch",e,t],queryFn:({signal:n})=>Kw({query:c(e),parameter:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="searchPluginsQuery"&&n.enabled)})}getPluginVersionsQuery(e){return Bt({queryKey:["plugins",e,"versions"],queryFn:({signal:t})=>Ow({pluginname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginVersionsQuery"&&t.enabled)})}getPluginUpdateQuery(e){return Bt({queryKey:["plugins",e,"update"],queryFn:({signal:t})=>Nw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginUpdateQuery"&&t.enabled)})}getPluginLogoQuery(e){return Bt({queryKey:["plugins",e,"logo"],queryFn:({signal:t})=>Fw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginLogoQuery"&&t.enabled)})}getPluginConfigQuery(e){return Bt({queryKey:["plugins",e,"config"],queryFn:({signal:t})=>Lw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginConfigQuery"&&t.enabled)})}getPluginContractQuery(e){return Bt({queryKey:["plugins",e,"contract"],queryFn:({signal:t})=>jw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginContractQuery"&&t.enabled)})}getPluginReadmeQuery(e){return Bt({queryKey:["plugins",e,"readme"],queryFn:({signal:t})=>qw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginReadmeQuery"&&t.enabled)})}getPluginInterfaceQuery(e){return Bt({queryKey:["plugins",e,"interface"],queryFn:({signal:t})=>Bw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginInterfaceQuery"&&t.enabled)})}getPluginChangelogQuery(e,t){return Bt({queryKey:["plugins",e,"changelog"],queryFn:({signal:n})=>Dw({pluginName:c(e),query:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getPluginChangelogQuery"&&n.enabled)})}patchPluginConfigQuery(){return ut({mutationFn:Gw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_config_updated"),life:3e3})}})}startPluginQuery(){return ut({mutationFn:Xw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_started"),life:3e3})}})}stopPluginQuery(){return ut({mutationFn:e3,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_stopped"),life:3e3})}})}restartPluginQuery(){return ut({mutationFn:t3,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_restarted"),life:3e3})}})}detectMotionQuery(){return ut({mutationFn:s3})}detectObjectsQuery(){return ut({mutationFn:n3})}detectAudioQuery(){return ut({mutationFn:r3})}setPluginConfigQuery(){return ut({mutationFn:Ww,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}submitPluginConfigQuery(){return ut({mutationFn:Jw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}enablePluginQuery(){return ut({mutationFn:Zw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_enabled"),life:3e3})}})}disablePluginQuery(){return ut({mutationFn:Yw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginName]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_disabled"),life:3e3})}})}uninstallPluginQuery(){return ut({mutationFn:i3,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["pluginsSearch"]}),await this._queryClient.refetchQueries({queryKey:["pluginsProgress"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugin_removed"),life:3e3})}})}uninstallPluginsQuery(){return ut({mutationFn:o3,onSuccess:async()=>{await this._queryClient.refetchQueries({queryKey:["pluginsList"]}),await this._queryClient.refetchQueries({queryKey:["pluginsSearch"]}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.plugins_removed"),life:3e3})}})}downloadLogQuery(e){return Bt({queryKey:["logs",e],queryFn:({signal:t})=>Hw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return ut({mutationFn:Vw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["logs",t.pluginName],exact:!0}),this.toast.add({severity:"success",summary:this.t("components.toast.title_success"),detail:this.t("components.toast.log_cleared"),life:3e3})}})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const a3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c3(s,e){return m(),A("svg",a3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17 13h-4v4h-2v-4H7v-2h4V7h2v4h4m-5-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"},null,-1)]))}const wp=pe({name:"mdi-plus-circle",render:c3}),l3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u3(s,e){return m(),A("svg",l3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 0 0 2 12a10 10 0 0 0 10 10a10 10 0 0 0 10-10A10 10 0 0 0 12 2"},null,-1)]))}const d3=pe({name:"mdi-information",render:u3}),h3={key:0,class:"flex flex-col field-gap"},m3=["for"],p3={key:1,class:"flex flex-col field-gap"},f3=["for"],g3=["for"],v3=["for"],_3={class:"flex items-center gap-4"},y3={class:"flex flex-col field-switch-gap"},b3=["for"],w3=["for"],x3={class:"flex gap-2 items-center w-full"},S3={class:"text-color"},C3={class:"w-full h-full flex flex-col gap-6"},k3={class:"flex flex-row w-full items-center justify-center mt-3"},E3=At({__name:"CuiSchemaField",props:Kn({schemaField:{},configKey:{},arrayItem:{},loading:{type:Boolean,default:!1}},{modelValue:{type:Object,required:!0},modelModifiers:{}}),emits:Kn(["onAction","onSubmit","onTrigger"],["update:modelValue"]),setup(s,{emit:e}){const t=Nl(),n=e,r=Rr(s,"modelValue"),i=s,{theme:o}=Vs(t),{schemaField:a,configKey:l,arrayItem:u,loading:d}=Wt(i),h=ae(0),v=ae(0),f=ae(a.value.opened?[l.value]:[]);Ge(r,()=>{h.value++},{deep:!0});const b=tf(async()=>{if(ar(a.value)&&a.value.format==="qrCode"){let N;return o.value==="dark"?N={dark:"#FFFFFFFF",light:"#FF000000"}:N={dark:"#404040FF",light:"#FFFFFFFF"},await kf.toDataURL(K.value||"",{margin:.5,type:"image/png",color:N,scale:10})}},void 0,{lazy:!0}),k=ne(()=>{if(ar(a.value)&&a.value.format==="image")return K.value}),z=(N,E)=>{const O=ni(N,E);return Array.isArray(O)?O:[]},L=N=>{const E=ni(r.value,N),O=Array.isArray(E)?[...E]:[];_h(a.value)&&a.value.items&&(O.push($l(a.value.items)),ic(r.value,N,O),v.value++)},se=(N,E)=>{const O=ni(r.value,N);if(Array.isArray(O)){const U=[...O];U.splice(E,1),ic(r.value,N,U),v.value++,n("onTrigger")}},K=ne({get:()=>(h.value,ni(r.value,l.value)),set:N=>{const E=a.value;let O=N;xa(E)?E.multiple?O=Array.isArray(N)?N:[N]:O=N&&N.toString():ar(E)?O=N!=null?N.toString():"":gh(E)?O=typeof N=="number"?N:parseFloat(N)||0:vh(E)&&(O=N==="true"||N===!0),ic(r.value,l.value,O),h.value++}});return(N,E)=>{const O=Fa,U=ki,S=Fh,M=_o,B=ys,W=Aa,I=go,w=Kc,H=jh,J=fo,q=Zc,oe=qh,ue=d3,Se=Jc,F=Ei("CuiSchemaField",!0),D=wp,Y=Yc,Te=Wc,He=Gc,ht=Dh,Mt=jr;return m(),A("div",null,[c(ar)(c(a))&&c(a).format==="qrCode"?(m(),A("div",h3,[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,m3),y(O,{src:c(b),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):ce("",!0),c(ar)(c(a))&&c(a).format==="image"?(m(),A("div",p3,[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,f3),y(O,{src:c(k),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):c(D2)(c(a))?(m(),j(c(Lt),{key:2,modelValue:c(K),"onUpdate:modelValue":E[1]||(E[1]=Qe=>us(K)?K.value=Qe:null),modelModifiers:{trim:!0},name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,g3),y(I,null,{default:$(()=>[c(a).format!=="password"?(m(),j(U,et({key:0},Qe,{invalid:ze.length>0,readonly:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),type:"text"}),null,16,["invalid","readonly","placeholder","loading"])):(m(),j(S,et({key:1,"model-value":c(K),invalid:ze.length>0,readonly:c(a).readonly},Qe,{feedback:!1,"toggle-mask":""}),null,16,["model-value","invalid","readonly"])),c(u)?(m(),j(W,{key:2},{default:$(()=>[y(B,{text:"",severity:"secondary",loading:c(d),onClick:E[0]||(E[0]=ge=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M)]),_:1},8,["loading"])]),_:1})):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!ze.length&&c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)]),_:1},8,["modelValue","name"])):c(gh)(c(a))?(m(),j(c(Lt),{key:3,"model-value":c(K),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,v3),y(I,null,{default:$(()=>[y(H,et(Qe,{modelValue:c(K),"onUpdate:modelValue":E[2]||(E[2]=ge=>us(K)?K.value=ge:null),invalid:ze.length>0,readonly:c(a).readonly,step:c(a).step||1,min:c(a).minimum,max:c(a).maximum,"use-grouping":!1,loading:c(d),onValueChange:E[3]||(E[3]=ge=>K.value=ge),onInput:E[4]||(E[4]=ge=>K.value=ge.value)}),null,16,["modelValue","invalid","readonly","step","min","max","loading"]),c(u)?(m(),j(W,{key:0},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[5]||(E[5]=ge=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M)]),_:1},8,["loading"])]),_:1})):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!ze.length&&c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)]),_:1},8,["model-value","name"])):c(vh)(c(a))?(m(),j(c(Lt),{key:4,"model-value":c(K),value:!0,"unchecked-value":!1,type:"checkbox",name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("div",_3,[g("div",y3,[g("label",{for:c(l),class:"cui-label-switch"},me(c(a).title),9,b3),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-switch-error"},null,8,["name"])]),_:1})]),y(J,et({"model-value":c(K)},Qe,{invalid:ze.length>0,loading:c(d),class:"ml-auto shrink-0",onValueChange:E[6]||(E[6]=ge=>K.value=ge)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value","name"])):c(xa)(c(a))?(m(),j(c(Lt),{key:5,"model-value":c(K),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Qe,errors:ze})=>[g("label",{for:c(l),class:"cui-label"},me(c(a).title),9,w3),y(I,null,{default:$(()=>[c(a).multiple?(m(),j(oe,et({key:1},Qe,{"model-value":c(K),options:c(a).enum,invalid:ze.length>0,disabled:c(a).readonly,placeholder:c(a).placeholder,"show-clear":!c(a).required&&!c(a).readonly,"show-toggle-all":!1,"max-selected-labels":3,loading:c(d),onValueChange:E[8]||(E[8]=ge=>K.value=ge)}),null,16,["model-value","options","invalid","disabled","placeholder","show-clear","loading"])):(m(),j(q,et({key:0},Qe,{"model-value":c(K),options:c(a).enum,invalid:ze.length>0,disabled:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),onValueChange:E[7]||(E[7]=ge=>K.value=ge)}),null,16,["model-value","options","invalid","disabled","placeholder","loading"])),c(u)?(m(),j(W,{key:2},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[9]||(E[9]=ge=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M)]),_:1},8,["loading"])]),_:1})):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!ze.length&&c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)]),_:1},8,["model-value","name"])):c(zr)(c(a))?(m(),A(yt,{key:6},[y(B,{fluid:"",class:"mt-3 mb-1 cui-button-medium",severity:c(a).color??"secondary",loading:c(d),label:c(a).title,onClick:E[10]||(E[10]=lr(Qe=>n("onAction",{key:c(l)}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)],64)):c(Ur)(c(a))?(m(),A(yt,{key:7},[y(B,{fluid:"",class:"mt-3 mb-1 cui-button-medium",severity:c(a).color??"secondary",loading:c(d),label:c(a).title,onClick:E[11]||(E[11]=lr(Qe=>n("onSubmit",{key:c(a).key}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(c(a).description),1)]),_:1})):ce("",!0)],64)):c(_h)(c(a))&&c(a).items?(m(),j(ht,{key:8,class:"cui-card border-color-inner",pt:{body:{class:"p-1"}}},{content:$(()=>[(m(),j(He,{key:c(v),value:c(f),"onUpdate:value":E[18]||(E[18]=Qe=>us(f)?f.value=Qe:null),multiple:""},{default:$(()=>[y(Te,{value:c(l)??"0",class:"border-none"},{default:$(()=>[y(Se,null,{default:$(()=>[g("div",x3,[c(a).description?Pt((m(),j(ue,{key:0,class:"text-muted"},null,512)),[[Mt,{value:c(a).description}]]):ce("",!0),g("span",S3,me(c(a).title||c(l)),1),c(u)?(m(),j(B,{key:1,text:"",rounded:"",severity:"danger",class:"cui-icon-md ml-auto mr-2",loading:c(d),onClick:E[12]||(E[12]=Qe=>se(c(u).key,c(u).index))},{icon:$(()=>[y(M,{width:"100%",height:"100%"})]),_:1},8,["loading"])):ce("",!0)])]),_:1}),y(Y,null,{default:$(()=>[g("div",C3,[(m(!0),A(yt,null,qt(z(r.value,c(l)),(Qe,ze)=>(m(),j(F,{key:`item-${ze}`,modelValue:r.value,"onUpdate:modelValue":E[13]||(E[13]=ge=>r.value=ge),"schema-field":c(a).items,"config-key":`${c(l)}[${ze}]`,"array-item":{key:c(l),index:ze},loading:c(d),onOnAction:E[14]||(E[14]=ge=>n("onAction",ge)),onOnSubmit:E[15]||(E[15]=ge=>n("onSubmit",ge)),onOnTrigger:E[16]||(E[16]=()=>v.value++)},null,8,["modelValue","schema-field","config-key","array-item","loading"]))),128)),g("div",k3,[y(B,{text:"",rounded:"",class:"cui-icon-md",loading:c(d),onClick:E[17]||(E[17]=lr(Qe=>L(c(l)),["prevent"]))},{icon:$(()=>[y(D,{width:"100%",height:"100%"})]),_:1},8,["loading"])])])]),_:1})]),_:1},8,["value"])]),_:1},8,["value"]))]),_:1})):ce("",!0)])}}}),A3={key:0,class:"flex flex-col gap-6"},M3={key:1,class:"flex flex-col gap-6"},xp=At({__name:"CuiSchema",props:{schemaForm:{},loading:{type:Boolean,default:!1},disableButton:{type:Boolean},saveButton:{type:Boolean,default:!0},saveButtonLabel:{},saveButtonColor:{},showButton:{type:Boolean,default:!1}},emits:["onSubmit","onAction","onFormSubmit","changeGroup"],setup(s,{expose:e,emit:t}){const n=t,r=s,{schemaForm:i,loading:o,saveButton:a,saveButtonLabel:l,showButton:u,disableButton:d,saveButtonColor:h}=Wt(r),v=Vt("formRef"),f=ae(""),b=ae(!1),k=ae({});Ge([i,v],([])=>{v.value&&(!B2(v.value.values,i.value.schema)||b.value)&&(k.value=v.value.values),i.value.config&&Object.keys(i.value.config).length?k.value=xi(i.value.config):k.value=z2(i.value.schema)},{immediate:!0,deep:!0});const z=ne(()=>{const I=Q2(i.value.schema);return Wn(I)}),L=ne(()=>{const I=[];return i.value.schema.forEach(w=>{w.group&&!w.hidden&&!I.includes(w.group)&&I.push(w.group)}),I.length&&!f.value&&(f.value=I[0]),I}),se=ne(()=>U2(i.value.schema,f.value)),K=ne(()=>V2(i.value.schema,f.value));Ge(f,I=>{I&&n("changeGroup",I)});const N=I=>i.value.schema.filter(w=>(w.group===I||!w.group&&I===L.value[0])&&!w.hidden),E=I=>{const w=ar(I)&&I.format==="qrCode",H=ar(I)&&I.format==="image",J=zr(I)||Ur(I);return!w&&!H&&!J},O=I=>!I.hidden||I.hidden&&E(I),U=async()=>{var I;return await((I=v.value)==null?void 0:I.validate())},S=I=>{n("onAction",I)},M=async I=>{const w=await U();w!=null&&w.valid&&(w!=null&&w.values)?(b.value=!1,n("onSubmit",{key:I.key,payload:w.values})):(b.value=!0,console.error("result",w))},B=async()=>{const I=await U();I!=null&&I.valid&&(I!=null&&I.values)?(b.value=!1,n("onFormSubmit",I.values)):(b.value=!0,console.error("Form validation failed:",I))};return e({reset:()=>{var I;(I=v.value)==null||I.resetForm()}}),(I,w)=>{const H=_p,J=gp,q=E3,oe=Uh,ue=zh,Se=Bh,F=ys;return m(),A("div",null,[y(c(il),{ref_key:"formRef",ref:v,"validation-schema":c(z),onSubmit:B},{default:$(()=>[c(L).length?(m(),A("div",A3,[y(J,{modelValue:c(f),"onUpdate:modelValue":w[0]||(w[0]=D=>us(f)?f.value=D:null),mandatory:""},{default:$(()=>[(m(!0),A(yt,null,qt(c(L),D=>(m(),j(H,{key:D,size:"small",value:D},{default:$(()=>[Qt(me(D),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),y(Se,{value:c(f),"onUpdate:value":w[2]||(w[2]=D=>us(f)?f.value=D:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(ue,{class:"p-0"},{default:$(()=>[(m(!0),A(yt,null,qt(c(L),(D,Y)=>(m(),j(oe,{key:Y,value:D,"as-child":""},{default:$(Te=>[Pt(g("div",et({class:Te.class,ref_for:!0},Te.a11yAttrs,{class:"flex flex-col gap-6"}),[(m(!0),A(yt,null,qt(N(D),He=>(m(),A(yt,{key:He.key},[O(He)&&(He.group===D||!He.group&&Y===0)?Pt((m(),j(q,{key:0,modelValue:c(k),"onUpdate:modelValue":w[1]||(w[1]=ht=>us(k)?k.value=ht:null),"schema-field":He,"config-key":He.key,loading:c(o),onOnAction:S,onOnSubmit:M},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!He.hidden]]):ce("",!0)],64))),128))],16),[[Pr,Te.active]])]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])])):(m(),A("div",M3,[(m(!0),A(yt,null,qt(c(i).schema,D=>(m(),A(yt,{key:D.key},[O(D)?Pt((m(),j(q,{key:0,modelValue:c(k),"onUpdate:modelValue":w[3]||(w[3]=Y=>us(k)?k.value=Y:null),"schema-field":D,"config-key":D.key,loading:c(o),onOnAction:S,onOnSubmit:M},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!D.hidden]]):ce("",!0)],64))),128))])),!c(se)&&c(K)&&c(a)||c(u)?(m(),j(F,{key:2,fluid:"",class:"mt-7 cui-button-medium",severity:c(h),type:"submit",loading:c(o),disabled:c(d),label:c(l)||I.$t("components.form.button.save")},null,8,["severity","loading","disabled","label"])):ce("",!0)]),_:1},8,["validation-schema"])])}}}),$3=At({__name:"PluginSchema",props:{schemaConfig:{},pluginName:{},cameraName:{},buttonKey:{}},setup(s,{expose:e}){const t=new bp,n=new Jn,r=Cn(),{t:i}=js(),o=mi("dialogRef"),a=mi("dialogRefProps"),l=s,{schemaConfig:u,pluginName:d,cameraName:h,buttonKey:v}=Wt(l),f=ae({schema:[],config:{}}),{mutate:b,isPending:k}=t.submitPluginConfigQuery(),{mutateAsync:z,isPending:L}=t.setPluginConfigQuery(),{mutate:se,isPending:K}=n.submitCameraExtensionConfigQuery(),{mutateAsync:N,isPending:E}=n.setCameraExtensionConfigQuery(),O=ne(()=>{var M;return!!((M=a.loading)!=null&&M.value||k.value||L.value||K.value||E.value)});Ge(u,M=>{f.value=M},{deep:!0,immediate:!0});const U=async M=>{h.value?await N({cameraname:h.value,pluginname:d.value,configData:{key:M.key}}):await z({pluginname:d.value,configData:{key:M.key}})},S=async M=>{console.log("onFormSubmit",M);const B={...u.value.config,...M};console.log("onFormSubmit payload",B);const W=I=>{if(I!=null&&I.toast){const w=Km(I.toast.type);r.add({severity:w,summary:i(`components.toast.title_${w}`),detail:I.toast.message,life:3e3})}I!=null&&I.schema&&Object.keys(I.schema).length&&f.value?f.value.schema=I.schema:o.value.close()};h.value?se({cameraname:h.value,pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:W}):b({pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:W})};return e({isLoading:O}),(M,B)=>{const W=xp;return m(),j(W,{"schema-form":c(f),loading:c(O),"show-button":"",onOnAction:U,onOnFormSubmit:S},null,8,["schema-form","loading"])}}}),P3={class:"p-4 flex flex-col gap-2"},T3={class:"cui-label"},R3={key:0,class:"flex flex-col gap-2"},I3={class:"cui-label"},O3={key:6,class:"text-sm text-muted text-center min-h-[30px]"},N3={class:"cui-label"},F3={key:7,class:"w-full flex items-center justify-center my-5"},L3={key:1,class:"text-sm text-muted text-center"},j3={key:1,class:"flex flex-col gap-2"},q3={class:"cui-label"},D3={key:0,class:"w-full flex items-center justify-center"},B3={key:1,class:"text-sm text-muted text-center"},z3={key:1,class:"w-full h-full"},U3={class:"cui-list-item"},V3=At({__name:"Plugins",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Jn,n=new bp,r=Cn(),i=Il(),{t:o}=js(),a=s,{camera:l,loading:u}=Wt(a),d=Vt("schemaRef"),h=ae("hub"),v=ae(["hub","motionDetection","objectDetection","audioDetection","ptz","more"]),f=ae(""),b=ae(),k=ae(),z=ae(),L=ae(),se=ae(),K=ae(),N=ae(!0);t.toggleQueryActivator("getCameraExtensionConfigQuery",!1);const{data:E}=n.getPluginsQuery({page:1,pageSize:-1}),{data:O,isFetching:U,suspense:S}=t.getCameraExtensionsQuery(l.value.name),{data:M,isFetching:B}=t.getCameraExtensionConfigQuery(l.value.name,f,N),{data:W,isFetching:I}=n.getPluginsExtensionsQuery({page:1,pageSize:-1}),{mutate:w,isPending:H}=t.submitCameraExtensionConfigQuery(),{mutateAsync:J,isPending:q}=t.patchCameraExtensionConfigQuery(),{mutateAsync:oe,isPending:ue}=t.setCameraExtensionConfigQuery(),{mutateAsync:Se,isPending:F}=t.addCameraExtensionQuery(),{mutateAsync:D,isPending:Y}=t.removeCameraExtensionQuery(),{mutateAsync:Te,isPending:He}=t.enableCameraExtensionQuery(),{mutateAsync:ht,isPending:Mt}=t.disableCameraExtensionQuery(),Qe=ne(()=>U.value||I.value||F.value||Y.value||He.value||Mt.value),ze=ne(()=>Qe.value||u.value||H.value||q.value||ue.value),ge=ne(()=>{const he=h.value==="cameraController"&&pt.value,ie=h.value==="hub"&&Jt.value.length,de=h.value==="motionDetection"&&wt.value.length,Le=h.value==="audioDetection"&&zt.value.length,rt=h.value==="objectDetection"&&nt.value.length,Kt=h.value==="ptz"&&Yt.value.length;return!ie&&!de&&!Le&&!rt&&!Kt&&!he}),pt=ne(()=>{var ie;const he=((ie=W.value)==null?void 0:ie.result.filter(de=>{var Le;return de.type.includes("cameraController")&&de.pluginName===((Le=l.value.pluginInfo)==null?void 0:Le.name)}))||[];return he.length&&E.value&&E.value.result.some(de=>de.pluginName===he[0].pluginName&&Ue(de.pluginName))?(b.value=he[0].pluginName,f.value=he[0].pluginName):b.value=void 0,he[0]}),Jt=ne(()=>{var ie;const he=((ie=O.value)==null?void 0:ie.filter(de=>de.type.includes("hub")))||[];return he.length&&E.value&&E.value.result.some(de=>de.pluginName===he[0].pluginName&&Ue(de.pluginName))?(k.value=he[0].pluginName,f.value=he[0].pluginName):k.value=void 0,V(he)}),wt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("motionDetection")))||[];return he.length&&Ue(l.value.extensions.motionDetection)?z.value=(de=l.value.extensions.motionDetection)==null?void 0:de.name:z.value=void 0,V(he)}),zt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("audioDetection")))||[];return he.length&&Ue(l.value.extensions.audioDetection)?L.value=(de=l.value.extensions.audioDetection)==null?void 0:de.name:L.value=void 0,V(he)}),nt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("objectDetection")))||[];return he.length&&Ue(l.value.extensions.objectDetection)?se.value=(de=l.value.extensions.objectDetection)==null?void 0:de.name:se.value=void 0,V(he)}),Yt=ne(()=>{var ie,de;const he=((ie=O.value)==null?void 0:ie.filter(Le=>Le.type.includes("ptz")))||[];return he.length&&Ue(l.value.extensions.ptz)?K.value=(de=l.value.extensions.ptz)==null?void 0:de.name:K.value=void 0,V(he)}),Be=ne(()=>{var de,Le;const he=((de=E.value)==null?void 0:de.result)||[];return(((Le=W.value)==null?void 0:Le.result)||[]).filter(rt=>{const Kt=he.find(Zt=>Zt.pluginName===rt.pluginName);return((Kt==null?void 0:Kt["camera.ui"].extensions)??[]).filter(Zt=>Zt!=="cameraController").length>0})});Ge(b,(he,ie)=>{he&&he!==ie&&X()}),Ge(k,(he,ie)=>{he&&he!==ie&&X(he)}),Ge(z,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"motionDetection"):he&&ye(he,!0,"motionDetection"))}),Ge(se,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"objectDetection"):he&&ye(he,!0,"objectDetection"))}),Ge(K,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"ptz"):he&&ye(he,!0,"ptz"))}),Ge(L,(he,ie)=>{he!==ie&&(!he&&ie?ye(ie,!1,"audioDetection"):he&&ye(he,!0,"audioDetection"))});const Ue=he=>{const ie=typeof he=="string"?he:he==null?void 0:he.name;if(ie&&E.value&&E.value.result.some(de=>de.pluginName===ie&&!de.disabled))return ie},V=he=>he.sort((ie,de)=>!Ue(ie.pluginName)&&Ue(de.pluginName)?1:Ue(ie.pluginName)&&!Ue(de.pluginName)?-1:ie.displayName.localeCompare(de.displayName)),X=he=>{var ie,de;if(t.toggleQueryActivator("getCameraExtensionConfigQuery",!1),he!==void 0)f.value=he;else switch(h.value){case"hub":f.value=Ue((ie=Jt.value[0])==null?void 0:ie.pluginName)||"";break;case"motionDetection":f.value=Ue(l.value.extensions.motionDetection)||"";break;case"audioDetection":f.value=Ue(l.value.extensions.audioDetection)||"";break;case"objectDetection":f.value=Ue(l.value.extensions.objectDetection)||"";break;case"ptz":f.value=Ue(l.value.extensions.ptz)||"";break;case"cameraController":f.value=Ue((de=pt.value)==null?void 0:de.pluginName)||"";break;default:f.value="";break}f.value&&f.value!==""&&t.toggleQueryActivator("getCameraExtensionConfigQuery",!0)},_e=async he=>{var ie;if(O.value)if(O.value.some(de=>de.pluginName===he.pluginName)){for(const de of he.type)await D({cameraname:l.value.name,pluginname:he.pluginName,type:de});(ie=d.value)==null||ie.reset()}else for(const de of he.type)await Se({cameraname:l.value.name,pluginname:he.pluginName,type:de})},ye=async(he,ie,de)=>{var rt;const Le=de in l.value.extensions?l.value.extensions[de]:void 0;l.value&&(ie?(Le==null?void 0:Le.name)!==he&&(await Te({cameraname:l.value.name,pluginname:he,type:de}),Zs(()=>X(he))):(Le==null?void 0:Le.name)===he&&(await ht({cameraname:l.value.name,pluginname:he,type:de}),(rt=d.value)==null||rt.reset(),Zs(()=>X())))},fe=async(he,ie)=>{await oe({cameraname:l.value.name,pluginname:ie,configData:{key:he.key}})},_t=(he,ie)=>{w({cameraname:l.value.name,pluginname:ie,configData:{key:he.key,payload:he.payload}},{onSuccess:de=>{if(de!=null&&de.toast){const Le=Km(de.toast.type);r.add({severity:Le,summary:o(`components.toast.title_${Le}`),detail:de.toast.message,life:3e3})}de!=null&&de.schema&&Object.keys(de.schema).length&&i.openComponentDialog($3,{data:{title:o("components.dialog.title.config"),hideConfirmButton:!0,contentProps:{schemaConfig:{schema:de.schema,config:he.payload},pluginName:ie,cameraName:l.value.name,buttonKey:he.key}}})}})},Tt=async(he,ie)=>{await J({cameraname:l.value.name,pluginname:he,configData:ie})};return el(async()=>{l.value.pluginInfo&&(v.value.unshift("cameraController"),h.value="cameraController"),await S(),X()}),(he,ie)=>{var Ms,ds;const de=_p,Le=gp,rt=Ea,Kt=Lr,ps=fo,Zt=pp,os=rw,As=ys,fs=jr;return m(),A("div",P3,[g("span",T3,me(he.$t("components.camera_options.categories")),1),y(Le,{modelValue:c(h),"onUpdate:modelValue":[ie[0]||(ie[0]=R=>us(h)?h.value=R:null),ie[1]||(ie[1]=R=>X())],disabled:c(Qe),mandatory:""},{default:$(()=>[(m(!0),A(yt,null,qt(c(v),R=>(m(),j(de,{key:R,size:"small",disabled:c(ze),value:R},{default:$(()=>[Qt(me(he.$t(`components.camera_options.chip_${R}`)),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"]),y(rt,{class:"m-0 py-3"}),c(h)!=="more"?(m(),A("div",R3,[g("span",I3,me(he.$t("components.camera_options.chip_plugins")),1),c(h)==="cameraController"&&c(pt)?(m(),j(Le,{key:0,modelValue:c(b),"onUpdate:modelValue":ie[2]||(ie[2]=R=>us(b)?b.value=R:null),disabled:c(Qe),mandatory:"",class:"min-h-[30px]"},{default:$(()=>[(m(),j(de,{key:c(pt).pluginName,size:"small",disabled:!Ue(c(pt).pluginName)||c(ze),value:c(pt).pluginName},{default:$(()=>[Qt(me(c(pt).displayName),1)]),_:1},8,["disabled","value"]))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="hub"&&c(Jt).length?(m(),j(Le,{key:1,modelValue:c(k),"onUpdate:modelValue":ie[3]||(ie[3]=R=>us(k)?k.value=R:null),disabled:c(Qe),mandatory:"",class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(Jt),R=>(m(),j(de,{key:R.pluginName,size:"small",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="motionDetection"&&c(wt).length?(m(),j(Le,{key:2,modelValue:c(z),"onUpdate:modelValue":ie[4]||(ie[4]=R=>us(z)?z.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(wt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="objectDetection"&&c(nt).length?(m(),j(Le,{key:3,modelValue:c(se),"onUpdate:modelValue":ie[5]||(ie[5]=R=>us(se)?se.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(nt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="audioDetection"&&c(zt).length?(m(),j(Le,{key:4,modelValue:c(L),"onUpdate:modelValue":ie[6]||(ie[6]=R=>us(L)?L.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(zt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ce("",!0),c(h)==="ptz"&&c(Yt).length?(m(),j(Le,{key:5,modelValue:c(K),"onUpdate:modelValue":ie[7]||(ie[7]=R=>us(K)?K.value=R:null),disabled:c(Qe),class:"min-h-[30px]"},{default:$(()=>[(m(!0),A(yt,null,qt(c(Yt),R=>(m(),j(de,{key:R.pluginName,size:"small",filter:"",disabled:!Ue(R.pluginName)||c(ze),value:R.pluginName},{default:$(()=>[Qt(me(R.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):c(ge)?(m(),A("span",O3,me(he.$t("components.camera_options.no_plugins_enabled")),1)):ce("",!0),y(rt,{class:"m-0 py-3"}),g("span",N3,me(he.$t("components.camera_options.plugin_settings")),1),c(B)||!c(f)||!c(M)||!((Ms=c(M))!=null&&Ms.schema)||((ds=c(M))==null?void 0:ds.schema.length)===0?(m(),A("div",F3,[c(B)?(m(),j(Kt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),A("span",L3,me(he.$t("components.camera_options.no_config")),1))])):(m(),j(xp,{ref_key:"schemaRef",ref:d,key:c(f),"schema-form":{schema:c(M).schema,config:c(M).config},loading:c(ze),onOnFormSubmit:ie[8]||(ie[8]=R=>Tt(c(f),R)),onOnSubmit:ie[9]||(ie[9]=R=>_t(R,c(f))),onOnAction:ie[10]||(ie[10]=R=>fe(R,c(f)))},null,8,["schema-form","loading"]))])):c(h)==="more"?(m(),A("div",j3,[g("span",q3,me(he.$t("components.camera_options.manage_plugins")),1),c(I)||!c(Be).length?(m(),A("div",D3,[c(I)?(m(),j(Kt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),A("span",B3,me(he.$t("components.camera_options.no_plugins_found")),1))])):(m(),A("div",z3,[(m(!0),A(yt,null,qt(c(Be),R=>Pt((m(),A("div",{key:R.pluginName,class:"cui-list-item"},[y(Zt,{disabled:c(Qe)||!Ue(R.pluginName),class:"h-14",onClick:te=>he.$router.push(`/plugins/${R.pluginName}`)},{append:$(()=>{var te;return[y(ps,{"model-value":(te=c(O))==null?void 0:te.some(ve=>ve.pluginName===R.pluginName),disabled:c(Qe)||!Ue(R.pluginName),"onUpdate:modelValue":ve=>_e(R)},null,8,["model-value","disabled","onUpdate:modelValue"])]}),default:$(()=>[g("span",null,me(R.displayName),1)]),_:2},1032,["disabled","onClick"])])),[[fs,{value:Ue(R.pluginName)===void 0?he.$t("components.form.tooltip.disabled"):""},void 0,{top:!0}]])),128))])),g("div",U3,[y(Zt,{class:"h-14",onClick:ie[11]||(ie[11]=R=>he.$router.push("/plugins"))},{append:$(()=>[y(As,{text:"",rounded:"",severity:"secondary",class:"cui-icon-md"},{icon:$(()=>[y(os,{width:"100%",height:"100%"})]),_:1})]),default:$(()=>[g("span",null,me(he.$t("components.camera_options.more_plugins")),1)]),_:1})])])):ce("",!0)])}}}),H3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q3(s,e){return m(),A("svg",H3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2m0 16H5V5h14zm-2-2H7V7h10z"},null,-1)]))}const K3=pe({name:"mdi-checkbox-intermediate",render:Q3}),Z3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G3(s,e){return m(),A("svg",Z3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M3.14 1A2.14 2.14 0 0 0 1 3.14V5h2V3h2V1zM7 1v2h3V1zm5 0v2h2v2h2V3.14C16 1.96 15.04 1 13.86 1zM1 7v3h2V7zm8 0c-1.11 0-2 .89-2 2v7h6.86A2.14 2.14 0 0 0 16 13.86V7zm9 0v2h2v2h2V9c0-1.11-.89-2-2-2zM9 9h5v5H9zm-8 3v1.86C1 15.04 1.96 16 3.14 16H5v-2H3v-2zm19 1v3h2v-3zM7 18v2c0 1.11.89 2 2 2h2v-2H9v-2zm13 0v2h-2v2h2c1.11 0 2-.89 2-2v-2zm-7 2v2h3v-2z"},null,-1)]))}const W3=pe({name:"mdi-vector-intersection",render:G3}),J3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y3(s,e){return m(),A("svg",J3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6zm14 11H6V8h12z"},null,-1)]))}const X3=pe({name:"mdi-rectangle-outline",render:Y3}),e4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t4(s,e){return m(),A("svg",e4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6z"},null,-1)]))}const s4=pe({name:"mdi-rectangle",render:t4}),n4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function r4(s,e){return m(),A("svg",n4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m6.03 12.03l2 3.47l-2.53 3.18L2 12.62zM17 18v-2.71c.88-.39 1.5-1.26 1.5-2.29c0-.57-.2-1.1-.53-1.5l1.97-1.15c1.01-.59 1.36-1.88.77-2.89l-1.38-2.4a2.125 2.125 0 0 0-2.89-.78L8.31 9c-.95.53-1.28 1.75-.73 2.71l1.5 2.6c.55.95 1.78 1.28 2.73.73l1.88-1.08c.25.59.72 1.07 1.31 1.33V18c0 1.1.9 2 2 2h5v-2z"},null,-1)]))}const i4=pe({name:"mdi-cctv",render:r4}),o4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function a4(s,e){return m(),A("svg",o4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.84 22.73L18.11 20H17c-1.1 0-2-.9-2-2v-1.11l-2.34-2.34l-.85.49c-.95.55-2.18.22-2.73-.73l-1.5-2.6c-.4-.71-.33-1.53.1-2.14L1.11 3l1.28-1.27l19.72 19.73zM18.5 13c0-.57-.2-1.1-.53-1.5l1.97-1.15c1.01-.59 1.36-1.88.77-2.89l-1.38-2.4a2.125 2.125 0 0 0-2.89-.78l-5.67 3.29l7.09 7.09c.4-.44.64-1.02.64-1.66M2 12.62l3.5 6.06l2.53-3.18l-2-3.47z"},null,-1)]))}const c4=pe({name:"mdi-cctv-off",render:a4}),l4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u4(s,e){return m(),A("svg",l4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m0 2c-1.9 0-3.6.6-4.9 1.7l11.2 11.2c1-1.4 1.7-3.1 1.7-4.9c0-4.4-3.6-8-8-8m4.9 14.3L5.7 7.1C4.6 8.4 4 10.1 4 12c0 4.4 3.6 8 8 8c1.9 0 3.6-.6 4.9-1.7"},null,-1)]))}const d4=pe({name:"mdi-cancel",render:u4}),h4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m4(s,e){return m(),A("svg",h4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88c3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"},null,-1)]))}const p4=pe({name:"mdi-undo",render:m4}),f4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g4(s,e){return m(),A("svg",f4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3zm0 5h2v9H9zm4 0h2v9h-2z"},null,-1)]))}const v4=pe({name:"mdi-trash-can",render:g4}),_4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y4(s,e){return m(),A("svg",_4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83l3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75z"},null,-1)]))}const b4=pe({name:"mdi-pencil",render:y4}),w4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x4(s,e){return m(),A("svg",w4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"},null,-1)]))}const S4=pe({name:"mdi-plus",render:x4}),C4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k4(s,e){return m(),A("svg",C4,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M13 4a1 1 0 1 0-2 0v17a1 1 0 1 0 2 0zM7 4h3v5H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m-2 6h5v5H5a2 2 0 0 1-2-2v-1a2 2 0 0 1 2-2m9 0v5h2a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2zm-6 6h2v5H8a2 2 0 0 1-2-2v-1a2 2 0 0 1 2-2m6 0v5h5a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2zm0-12v5h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"})],-1)]))}const E4=pe({name:"mingcute-timeline-fill",render:k4}),A4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function M4(s,e){return m(),A("svg",A4,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.594 23.258l-.012.002l-.071.035l-.02.004l-.014-.004l-.071-.036q-.016-.004-.024.006l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.016-.018m.264-.113l-.014.002l-.184.093l-.01.01l-.003.011l.018.43l.005.012l.008.008l.201.092q.019.005.029-.008l.004-.014l-.034-.614q-.005-.019-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.003-.011l.018-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M13 4a1 1 0 1 0-2 0v17a1 1 0 1 0 2 0zM7 4h3v2H7v1h3v2H7a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2m11 3h-4v2h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4v2h4zm-8 3H5a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h5v-2H5v-1h5zm4 0v2h2v1h-2v2h2a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2zm-4 6H8a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h2v-2H8v-1h2zm4 0v2h5v1h-5v2h5a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2z"})],-1)]))}const $4=pe({name:"mingcute-timeline-line",render:M4}),P4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T4(s,e){return m(),A("svg",P4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9 11.5A2.5 2.5 0 0 0 11.5 9A2.5 2.5 0 0 0 9 6.5A2.5 2.5 0 0 0 6.5 9A2.5 2.5 0 0 0 9 11.5M9 2c3.86 0 7 3.13 7 7c0 5.25-7 13-7 13S2 14.25 2 9a7 7 0 0 1 7-7m6 15h3v-3h2v3h3v2h-3v3h-2v-3h-3z"},null,-1)]))}const R4=pe({name:"mdi-map-marker-add",render:T4}),I4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O4(s,e){return m(),A("svg",I4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M15 17h3v-3h2v3h3v2h-3v3h-2v-3h-3zM9 6.5c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5S6.5 10.4 6.5 9S7.6 6.5 9 6.5M9 2c3.9 0 7 3.1 7 7c0 5.2-7 13-7 13S2 14.2 2 9c0-3.9 3.1-7 7-7m0 2C6.2 4 4 6.2 4 9c0 1 0 3 5 9.7C14 12 14 10 14 9c0-2.8-2.2-5-5-5"},null,-1)]))}const N4=pe({name:"mdi-map-marker-add-outline",render:O4}),F4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L4(s,e){return m(),A("svg",F4,e[0]||(e[0]=[g("g",{fill:"none"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M19.26 16.877c.413.402.74.932.74 1.596c0 .753-.426 1.339-.9 1.745c-.48.408-1.114.731-1.81.983c-1.402.505-3.272.799-5.29.799s-3.888-.294-5.29-.8c-.696-.25-1.33-.574-1.809-.982c-.475-.406-.901-.992-.901-1.745c0-.663.327-1.194.74-1.596A9.97 9.97 0 0 0 12 20c2.859 0 5.438-1.2 7.26-3.123M12 2a8 8 0 1 1 0 16a8 8 0 0 1 0-16m0 4a4 4 0 1 0 0 8a4 4 0 0 0 0-8m0 2a2 2 0 1 1 0 4a2 2 0 0 1 0-4"})],-1)]))}const Sp=pe({name:"mingcute-computer-camera-fill",render:L4}),j4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q4(s,e){return m(),A("svg",j4,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M6.593 16.744a1 1 0 0 1-.246 1.393a1.3 1.3 0 0 0-.319.294l-.024.042l.035.058c.03.04.078.095.16.165c.23.196.62.417 1.19.623C8.523 19.728 10.153 20 12 20c1.848 0 3.478-.272 4.61-.68c.57-.207.961-.428 1.19-.624a1 1 0 0 0 .16-.165l.036-.058l-.024-.04a1.2 1.2 0 0 0-.314-.293a1 1 0 1 1 1.151-1.635c.598.421 1.191 1.074 1.191 1.968c0 .753-.426 1.339-.9 1.744c-.48.41-1.114.732-1.81.984c-1.402.505-3.272.799-5.29.799s-3.888-.294-5.29-.8c-.696-.25-1.33-.574-1.809-.983c-.475-.405-.901-.99-.901-1.744c0-.898.598-1.553 1.2-1.975a1 1 0 0 1 1.393.246M12 2a8 8 0 1 1 0 16a8 8 0 0 1 0-16m0 2a6 6 0 1 0 0 12a6 6 0 0 0 0-12m0 2a4 4 0 1 1 0 8a4 4 0 0 1 0-8m0 2a2 2 0 1 0 0 4a2 2 0 0 0 0-4"})],-1)]))}const D4=pe({name:"mingcute-computer-camera-line",render:q4}),B4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z4(s,e){return m(),A("svg",B4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M2 6V4q0-.825.588-1.412T4 2h2q.425 0 .713.288T7 3t-.288.713T6 4H4v2q0 .425-.288.713T3 7t-.712-.288T2 6m2 16q-.825 0-1.412-.587T2 20v-2q0-.425.288-.712T3 17t.713.288T4 18v2h2q.425 0 .713.288T7 21t-.288.713T6 22zm16 0h-2q-.425 0-.712-.288T17 21t.288-.712T18 20h2v-2q0-.425.288-.712T21 17t.713.288T22 18v2q0 .825-.587 1.413T20 22m0-16V4h-2q-.425 0-.712-.288T17 3t.288-.712T18 2h2q.825 0 1.413.588T22 4v2q0 .425-.288.713T21 7t-.712-.288T20 6m-6.5 3.5q-.825 0-1.412-.587T11.5 7.5t.588-1.412T13.5 5.5t1.413.588T15.5 7.5t-.587 1.413T13.5 9.5m-.7 8.5h-4l1-5.1l-1.8.7V16q0 .425-.288.712T7 17t-.712-.288T6 16v-3.05q0-.3.163-.537t.437-.363l3.35-1.45q.875-.375 1.288-.487T12 10q.525 0 .975.275T13.7 11l1 1.6q.525.85 1.363 1.475T18 14.9q.425.075.713.375T19 16t-.288.7t-.687.225q-1.35-.2-2.525-.837t-2-1.588z"},null,-1)]))}const U4=pe({name:"material-symbols-detection-and-zone-rounded",render:z4}),V4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function H4(s,e){return m(),A("svg",V4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M32 119.4C12.9 108.4 0 87.7 0 64C0 28.7 28.7 0 64 0c23.7 0 44.4 12.9 55.4 32h209.1C339.6 12.9 360.3 0 384 0c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4v113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H119.5c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V119.4zM119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4v113.1c9.7 5.6 17.8 13.7 23.4 23.4h209.1c5.6-9.7 13.7-17.8 23.4-23.4V119.4c-9.7-5.6-17.8-13.7-23.4-23.4zm192 384c-11.1 19.1-31.7 32-55.4 32c-35.3 0-64-28.7-64-64c0-23.7 12.9-44.4 32-55.4V352h64v40.6c9.7 5.6 17.8 13.7 23.4 23.4h209.1c5.6-9.7 13.7-17.8 23.4-23.4V279.5c-9.7-5.6-17.8-13.7-23.4-23.4h-46c-5.4-15.4-14.6-28.9-26.5-39.6v-24.4h72.6c11.1-19.1 31.7-32 55.4-32c35.3 0 64 28.7 64 64c0 23.7-12.9 44.4-32 55.4v113.1c19.1 11.1 32 31.7 32 55.4c0 35.3-28.7 64-64 64c-23.7 0-44.4-12.9-55.4-32H311.5z"},null,-1)]))}const Q4=pe({name:"fa6-solid-object-ungroup",render:H4}),K4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function Z4(s,e){return m(),A("svg",K4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M48.2 66.8c-.1-.8-.2-1.7-.2-2.5v-.2c0-8.8 7.2-16 16-16c.9 0 1.9.1 2.8.2C74.3 49.5 80 56.1 80 64c0 8.8-7.2 16-16 16c-7.9 0-14.5-5.7-15.8-13.2M0 64c0 26.9 16.5 49.9 40 59.3v105.3C16.5 238.1 0 261.1 0 288c0 35.3 28.7 64 64 64c26.9 0 49.9-16.5 59.3-40h201.3c9.5 23.5 32.5 40 59.3 40c35.3 0 64-28.7 64-64c0-26.9-16.5-49.9-40-59.3V123.4c23.5-9.5 40-32.5 40-59.3c0-35.3-28.7-64-64-64c-26.9 0-49.9 16.5-59.3 40L123.3 40C113.9 16.5 90.9 0 64 0C28.7 0 0 28.7 0 64m368 0a16 16 0 1 1 32 0a16 16 0 1 1-32 0m-43.3 24c6.5 16 19.3 28.9 35.3 35.3v105.3c-16 6.5-28.9 19.3-35.3 35.3H123.4c-6.5-16-19.3-28.9-35.3-35.3V123.3c16-6.5 28.9-19.3 35.3-35.3zM384 272a16 16 0 1 1 0 32a16 16 0 1 1 0-32M80 288c0 7.9-5.7 14.5-13.2 15.8c-.8.1-1.7.2-2.5.2h-.2c-8.8 0-16-7.2-16-16c0-.9.1-1.9.2-2.8c1.2-7.5 7.8-13.2 15.7-13.2c8.8 0 16 7.2 16 16m391.3-40h45.4c6.5 16 19.3 28.9 35.3 35.3v105.3c-16 6.5-28.9 19.3-35.3 35.3H315.4c-6.5-16-19.3-28.9-35.3-35.3v-36.7h-48v36.7c-23.5 9.5-40 32.5-40 59.3c0 35.3 28.7 64 64 64c26.9 0 49.9-16.5 59.3-40h201.3c9.5 23.5 32.5 40 59.3 40c35.3 0 64-28.7 64-64c0-26.9-16.5-49.9-40-59.3V283.3c23.5-9.5 40-32.5 40-59.3c0-35.3-28.7-64-64-64c-26.9 0-49.9 16.5-59.3 40H448v16.4c9.8 8.8 17.8 19.5 23.3 31.6m88.9-26.7a16 16 0 1 1 31.5 5.5a16 16 0 1 1-31.5-5.5M271.8 450.7a16 16 0 1 1-31.5-5.5a16 16 0 1 1 31.5 5.5m307-18.5a16 16 0 1 1-5.5 31.5a16 16 0 1 1 5.5-31.5"},null,-1)]))}const G4=pe({name:"fa6-regular-object-ungroup",render:Z4}),W4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J4(s,e){return m(),A("svg",W4,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-width":"1.5"},[g("path",{d:"M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2s7.071 0 8.535 1.464C22 4.93 22 7.286 22 12s0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z"}),g("circle",{cx:"12",cy:"12",r:"4"})],-1)]))}const Y4=pe({name:"solar-camera-square-linear",render:J4}),X4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e6(s,e){return m(),A("svg",X4,e[0]||(e[0]=[g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M15.75 6a3.75 3.75 0 1 0-7.5 0a3.75 3.75 0 0 0 7.5 0M12 3.75a2.25 2.25 0 1 1 0 4.5a2.25 2.25 0 0 1 0-4.5M9.25 18a3.75 3.75 0 1 0-7.5 0a3.75 3.75 0 0 0 7.5 0M5.5 15.75a2.25 2.25 0 1 1 0 4.5a2.25 2.25 0 0 1 0-4.5m13-1.5a3.75 3.75 0 1 1 0 7.5a3.75 3.75 0 0 1 0-7.5M20.75 18a2.25 2.25 0 1 0-4.5 0a2.25 2.25 0 0 0 4.5 0","clip-rule":"evenodd"},null,-1),g("path",{fill:"currentColor",d:"M7.205 7.562a.75.75 0 0 0-.993-1.124A8.73 8.73 0 0 0 3.25 13a.75.75 0 0 0 1.5 0a7.23 7.23 0 0 1 2.455-5.438m10.583-1.124a.75.75 0 0 0-.993 1.124A7.23 7.23 0 0 1 19.25 13a.75.75 0 0 0 1.5 0a8.73 8.73 0 0 0-2.962-6.562m-7.601 13.584a.75.75 0 1 0-.374 1.452a8.8 8.8 0 0 0 4.374 0a.75.75 0 1 0-.374-1.452A7.3 7.3 0 0 1 12 20.25a7.3 7.3 0 0 1-1.813-.228"},null,-1)]))}const t6=pe({name:"solar-share-circle-outline",render:e6}),Fl=At({__name:"CuiSnapshot",props:{cameraName:{},src:{},loading:{type:Boolean},showLoadingScreen:{type:Boolean,default:!0},width:{default:"100%"},height:{default:"100%"},imageWidth:{},imageHeight:{},imageContainerClass:{},imageContainerStyle:{}},setup(s,{expose:e}){const t=new Jn,n=s,{cameraName:r,loading:i,src:o,width:a,height:l,imageHeight:u,imageWidth:d,imageContainerClass:h,imageContainerStyle:v,showLoadingScreen:f}=Wt(n),b=ae(!1);o.value&&t.toggleQueryActivator("getCameraSnapshotQuery",!1);const{data:k,isFetching:z,refetch:L,isRefetching:se}=t.getCameraSnapshotQuery(r,b),K=ne(()=>(i.value||z.value||se.value)&&f.value),N=ne(()=>{if(o.value)return o.value;if(k.value)return`data:image/jpeg;base64,${k.value}`});return e({download:()=>{if(N.value){const U=`${r.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,S=document.createElement("a");S.setAttribute("download",U),S.href=N.value,document.body.appendChild(S),S.click(),S.remove()}},refresh:()=>{b.value=!0,L(),b.value=!1},isLoading:K,snapshotSrc:N}),(U,S)=>{const M=Lr,B=Fa;return m(),A("div",{class:"w-full h-full flex items-center justify-center bg-black aspect-video",style:ot({width:`${c(a)}`,height:`${c(l)}`})},[c(K)?(m(),j(M,{key:0,class:"m-0 max-w-[30px] max-h-[30px]","stroke-width":"5",style:ot({width:`calc(${c(a)} / 2)`,height:`calc(${c(l)} / 2)`})},null,8,["style"])):(m(),j(B,{key:1,src:c(N),"aspect-ratio":"16/9",cover:"",width:c(d),height:c(u),"image-container-class":c(h),"image-container-style":c(v)},null,8,["src","width","height","image-container-class","image-container-style"]))],4)}}}),s6=["d"],n6=At({__name:"CuiPolygon",props:{cameraZones:{}},setup(s){const e=s,{cameraZones:t}=Wt(e),n=Vt("zoneRef"),r=ri(n),i=o=>{if(!o)return"";const a=o.map(u=>{const d=Math.round(u[0]/100*r.width.value),h=Math.round(u[1]/100*r.height.value);return`${d},${h}`});if(a.length===0)return"";let l=`M ${a[0]}`;for(let u=1;u<a.length;u++)l+=` L ${a[u]}`;return l+=" Z",l};return(o,a)=>(m(),A("svg",{ref_key:"zoneRef",ref:n,width:"100%",height:"100%",class:"zones-container polygon-container"},[(m(!0),A(yt,null,qt(c(t),(l,u)=>(m(),A("path",{key:u,d:i(l.points.map(d=>d)),class:at({dash:l.type==="intersect"&&!l.isPrivacyMask}),style:ot({fill:l.isPrivacyMask?"rgba(16, 16, 16, 0.9)":l.filter==="exclude"?"transparent":`${l.color}4D`,stroke:l.isPrivacyMask?"#333333":l.color,"stroke-width":"2"})},null,14,s6))),128))],512))}}),r6=qs(n6,[["__scopeId","data-v-bcfe05d5"]]),i6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function o6(s,e){return m(),A("svg",i6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M3 14s-1 0-1-1s1-4 6-4s6 3 6 4s-1 1-1 1zm5-6a3 3 0 1 0 0-6a3 3 0 0 0 0 6"},null,-1)]))}const a6=pe({name:"bi-person-fill",render:o6}),c6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function l6(s,e){return m(),A("svg",c6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.25 5.25c0-1.422 1.028-2.75 2.5-2.75s2.5 1.328 2.5 2.75S10.222 8 8.75 8s-2.5-1.328-2.5-2.75M1 8.75C1 7.328 2.028 6 3.5 6S6 7.328 6 8.75S4.972 11.5 3.5 11.5S1 10.172 1 8.75M12 10a7 7 0 0 0-7 7c0 1.36.72 2.388 1.7 3.044c.963.645 2.198.956 3.378.956h3.844c1.18 0 2.415-.311 3.377-.956C18.28 19.388 19 18.361 19 17a7 7 0 0 0-7-7m.75-4.75c0-1.422 1.028-2.75 2.5-2.75s2.5 1.328 2.5 2.75S16.722 8 15.25 8s-2.5-1.328-2.5-2.75M18 8.75C18 7.328 19.028 6 20.5 6S23 7.328 23 8.75s-1.028 2.75-2.5 2.75S18 10.172 18 8.75"},null,-1)]))}const u6=pe({name:"fluent-animal-paw-print-24-filled",render:l6}),d6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function h6(s,e){return m(),A("svg",d6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m3.044 6l-.01.074A1.5 1.5 0 0 0 2 7.5v3A1.5 1.5 0 0 0 3.5 12h9a1.5 1.5 0 0 0 1.5-1.5v-3a1.5 1.5 0 0 0-1.04-1.428L12.951 6h.549a.5.5 0 0 0 0-1h-.677l-.16-1.253A2 2 0 0 0 10.68 2H5.319a2 2 0 0 0-1.984 1.744L3.173 5H2.5a.5.5 0 0 0 0 1zm2.275-3h5.36a1 1 0 0 1 .992.873L11.943 6h-7.89l.274-2.128A1 1 0 0 1 5.319 3M5.25 9.749a.749.749 0 1 1 0-1.498a.749.749 0 0 1 0 1.498m5.498 0a.749.749 0 1 1 0-1.498a.749.749 0 0 1 0 1.498M12.497 13h-1.5v.25a.75.75 0 0 0 1.5 0zM5 13H3.5v.25a.75.75 0 0 0 1.5 0z"},null,-1)]))}const m6=pe({name:"fluent-vehicle-car-16-filled",render:h6}),p6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f6(s,e){return m(),A("svg",p6,e[0]||(e[0]=[g("g",{fill:"currentColor"},[g("path",{d:"M15.25 6.5a2.25 2.25 0 1 0 0-4.5a2.25 2.25 0 0 0 0 4.5m-2.867-.001c-1.495-.21-4.912.397-6.32 4.15a1 1 0 1 0 1.873.702c.584-1.555 1.636-2.316 2.574-2.655l-1.17 3.006q-.029.075-.045.15a1 1 0 0 0 .164.91l3.562 4.607l.231 3.693a1 1 0 1 0 1.996-.124l-.27-4.307l-2.092-2.707l1.373-2.661l.093.134a2 2 0 0 0 2.42.711l2.115-.886a1 1 0 0 0-.773-1.844l-2.115.886l-1.606-2.335a3.04 3.04 0 0 0-1.661-1.36a1.4 1.4 0 0 0-.35-.07"}),g("path",{d:"m8.45 16.45l.827-2.452l1.469 1.9l-.402 1.191a2 2 0 0 1-2.032 1.356l-2.88-.197a1 1 0 1 1 .136-1.996z"})],-1)]))}const g6=pe({name:"healthicons-running-24px",render:f6}),v6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _6(s,e){return m(),A("svg",v6,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[g("path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3zM7 16.5l-4.74-2.85M7 16.5l5-3m-5 3v5.17m5-8.17V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5zm5 3l-5-3m5 3l4.74-2.85M17 16.5v5.17"}),g("path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3l5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0zM12 8L7.26 5.15M12 8l4.74-2.85M12 13.5V8"})],-1)]))}const y6=pe({name:"lucide-boxes",render:_6}),b6={class:"w-full h-full"},w6={key:1,class:"label-text"},x6=At({__name:"CuiBBoxPlayground",props:{showIcon:{type:Boolean,default:!0},showLabel:{type:Boolean,default:!1},showConfidence:{type:Boolean,default:!0},detections:{default(){return[]}},classes:{default(){return["animal","person","vehicle","motion","other"]}}},setup(s,{expose:e}){const t=s,{detections:n,classes:r,showConfidence:i,showIcon:o,showLabel:a}=Wt(t),l=Vt("containerRef"),u=Ls([]),{width:d,height:h}=rl(l),v={motion:{color:"#A855F7",icon:g6},animal:{color:"#22C55E",icon:u6},person:{color:"#3B82F6",icon:a6},vehicle:{color:"#EF4444",icon:m6},other:{color:"#CAC443",icon:y6}},f=ne(()=>Math.min(d.value||800,h.value||600)),b=ne(()=>f.value<200?.8:1),k=ne(()=>S=>{if(!u.value.length||!d.value)return 0;const{inputWidth:M}=u.value[0];return Math.round(S*d.value/M)}),z=ne(()=>S=>{if(!u.value.length||!h.value)return 0;const{inputHeight:M}=u.value[0];return Math.round(S*h.value/M)}),L=ne(()=>(S,M)=>k.value(M)-k.value(S)),se=ne(()=>(S,M)=>z.value(M)-z.value(S)),K=ne(()=>S=>{const M=L.value(S.boundingBox[0],S.boundingBox[2]),B=se.value(S.boundingBox[1],S.boundingBox[3]),W=M<200?.3:M<400?.25:.2;return Math.min(M,B)*W}),N=ne(()=>S=>{const M=z.value(S.boundingBox[1]),B=30*b.value;return M<B}),E=ne(()=>S=>k.value(S.boundingBox[0])>d.value*.7),O=S=>{u.value=S.filter(M=>r.value.includes(M.label))},U=()=>{u.value=[]};return Ge(n,S=>{S.length&&O(S)},{immediate:!0}),e({draw:O,clear:U}),(S,M)=>(m(),A("div",{ref_key:"containerRef",ref:l,class:"bbox-container"},[(m(!0),A(yt,null,qt(c(u),B=>{var W,I;return m(),A("div",{key:B.id,class:"bbox-corners",style:ot({left:`${c(k)(B.boundingBox[0])}px`,top:`${c(z)(B.boundingBox[1])}px`,width:`${c(L)(B.boundingBox[0],B.boundingBox[2])}px`,height:`${c(se)(B.boundingBox[1],B.boundingBox[3])}px`})},[g("div",b6,[(m(),A(yt,null,qt(["tl","tr","bl","br"],w=>{var H;return g("div",{key:w,class:at(["corner-lines",w]),style:ot({"--corner-color":((H=v[B.label])==null?void 0:H.color)||v.other.color,"--corner-size":`${c(K)(B)}px`})},M[0]||(M[0]=[g("div",{class:"line horizontal"},null,-1),g("div",{class:"line vertical"},null,-1)]),6)}),64))]),c(a)||c(i)||c(o)?(m(),A("div",{key:0,class:at(["label z-1",{"label-bottom":c(N)(B),"label-right":c(E)(B)}]),style:ot({backgroundColor:((W=v[B.label])==null?void 0:W.color)||v.other.color,fontSize:`${12*c(b)}px`,padding:`${4*c(b)}px ${8*c(b)}px`,gap:`${4*c(b)}px`})},[c(o)?(m(),j(Ai(((I=v[B.label])==null?void 0:I.icon)||v.other.icon),{key:0})):ce("",!0),c(a)&&c(f)>250?(m(),A("span",w6,me(B.label),1)):ce("",!0),c(i)&&c(f)>250?(m(),A("span",{key:2,class:"confidence",style:ot({fontSize:`${11*c(b)}px`})},me((B.confidence*100).toFixed(1))+"% ",5)):ce("",!0)],6)):ce("",!0)],4)}),128))],512))}}),S6=qs(x6,[["__scopeId","data-v-870e7d93"]]),C6={class:"snapshot-hover-container flex items-center justify-center aspect-video"},k6={class:"shortcut-menu"},E6=At({__name:"CuiCameraShortcuts",props:{cameraName:{},addingShortcuts:{type:Boolean}},setup(s){var Ue;const e=new Jn,t=new R_,n=Fs(),r=qr(),i=s,{cameraName:o,addingShortcuts:a}=Wt(i),{user:l}=Vs(n),u=Vt("placeholderRef"),d=Vt("shortcutContainerRef"),h=Vt("camerasMenuRef"),v=Ls({}),f=Ls({}),b=Ls({}),k=ae({}),z=ae(!1),L=ae(),se=ae(!1),K=ae(!1),N=ae([]),E=ae({}),O=ae(!1),U=rl(d);e.toggleQueryActivator("getCamerasQuery",!1);const{data:S,isFetching:M}=e.getCameraQuery(o),{data:B,isFetching:W}=e.getCamerasQuery({page:1,pageSize:-1}),{data:I,isFetching:w}=t.getShortcutsQuery(((Ue=l.value)==null?void 0:Ue.username)||"",o),{mutate:H,isPending:J}=t.patchShortcutQuery(),{mutate:q,isPending:oe}=t.createShortcutQuery(),{mutate:ue,isPending:Se}=t.removeShortcutQuery(),F=ne(()=>M.value||w.value||J.value||W.value||oe.value||Se.value),D=ne(()=>{var V;return(V=B.value)!=null&&V.result?B.value.result.filter(X=>X.name!==o.value):[]}),Y=ne(()=>{var V;return((V=l.value)==null?void 0:V.username)??""});Ge([I,S],()=>{I.value&&S.value&&(N.value=xi(I.value))},{immediate:!0,deep:!0}),Ge([U.width,U.height],()=>{K.value=!0,Zs(()=>{ge()})}),Ge(N,()=>{Zs(()=>{pt()})},{deep:!0,immediate:!0}),Ge(K,V=>{V&&(L.value=void 0)});const Te=V=>{se.value||(L.value=void 0),O.value=V,e.toggleQueryActivator("getCamerasQuery",V)};Ge([u,L],([V,X])=>{V&&X&&setTimeout(()=>{var _e;(_e=h.value)==null||_e.show({currentTarget:V})},50)},{deep:!0}),Ge(E,()=>{Object.entries(E.value).forEach(([V,X])=>{var _e,ye;if(X&&f.value[V]){const fe=v.value[V];fe&&((_e=f.value[V])==null||_e.show({currentTarget:fe}))}else(ye=f.value[V])==null||ye.hide()})},{deep:!0});const He=(V,X)=>{z.value||(e.toggleQueryActivator("getCamerasQuery",X),E.value[V]=z.value?!1:X,Object.entries(E.value).forEach(([_e,ye])=>{_e!==V&&ye&&(E.value[_e]=!1)}))},ht=V=>{z.value||zt(V)},Mt=(V,X)=>{V||(E.value[X._id]?(He(X._id,!1),Be(X.cameraId)):He(X._id,!0))},Qe=()=>{Object.entries(b.value).forEach(([V,X])=>{const _e=d.value;if(!_e)return;const ye=_e.getBoundingClientRect(),fe=X.element.getBoundingClientRect(),_t=(fe.left-ye.left)/ye.width*100,Tt=(fe.top-ye.top)/ye.height*100;k.value[V]={x:Math.max(0,Math.min(_t,100)),y:Math.max(0,Math.min(Tt,100))}})},ze=()=>{Object.entries(b.value).forEach(([V,X])=>{const _e=k.value[V];if(!_e)return;const ye=d.value;if(!ye)return;const fe=ye.getBoundingClientRect(),_t=X.element.getBoundingClientRect(),Tt=fe.width-_t.width,he=fe.height-_t.height,ie=Math.max(0,Math.min(_e.x/100*fe.width,Tt)),de=Math.max(0,Math.min(_e.y/100*fe.height,he));X.setPosition(ie,de)}),K.value=!1},ge=()=>{Object.entries(k.value).forEach(([V,X])=>{k.value[V]={x:Math.max(0,Math.min(X.x,100)),y:Math.max(0,Math.min(X.y,100))}}),ze()},pt=()=>{for(const[V,X]of Object.entries(b.value))N.value.find(_e=>_e._id===V)||(X.destroy(),delete b.value[V],delete k.value[V]);for(const[V]of Object.entries(k.value))N.value.find(X=>X._id===V)||delete k.value[V];for(const[V,X]of Object.entries(v.value)){const _e=N.value.find(ye=>ye._id===V);if(X&&_e&&d.value){b.value[_e._id]&&b.value[_e._id].destroy();const ye=new Jh(X,{containment:d.value});b.value[_e._id]=ye;const[fe,_t]=_e.points,Tt=d.value.getBoundingClientRect(),he=fe/100*Tt.width,ie=_t/100*Tt.height;ye.setPosition(he,ie),k.value[_e._id]={x:fe,y:_t},ye.on("dragMove",()=>{z.value=!0;const de=f.value[V];de==null||de.alignOverlay()}),ye.on("dragEnd",()=>{setTimeout(()=>{z.value=!1},50),Qe();const de=k.value[_e._id];H({username:Y.value,cameraname:o.value,shortcutid:_e._id,shortcutData:{points:[de.x,de.y]}})})}}ze()},Jt=V=>{if(!a.value||!d.value)return;se.value=!0;const X=d.value.getBoundingClientRect(),_e=35,ye=35;L.value={x:Math.max(0,Math.min(V.clientX-X.left-_e/2,X.width-_e)),y:Math.max(0,Math.min(V.clientY-X.top-ye/2,X.height-ye))}},wt=async V=>{if(!u.value||!d.value)return;const X=d.value,_e=u.value,ye=X.getBoundingClientRect(),fe=_e.getBoundingClientRect(),_t=fe.left-ye.left,Tt=fe.top-ye.top,he=_t/ye.width*100,ie=Tt/ye.height*100;q({username:Y.value,cameraname:o.value,shortcutData:{_id:"",points:[he,ie],cameraId:V._id}},{onSettled:()=>{var de;se.value=!1,L.value=void 0,(de=h.value)==null||de.hide()}})},zt=V=>{const X=b.value[V._id];X==null||X.destroy(),ue({username:Y.value,cameraname:o.value,shortcutid:V._id})},nt=(V,X)=>{v.value[X]=V},Yt=(V,X)=>{f.value[X]=V},Be=async V=>{if(z.value)return;const X=new AbortController,ye=(await yp({cameraname:V,signal:X.signal})).name;ye&&r.push(`/cameras/${ye}`)};return Q0(()=>{v.value={}}),Sn(()=>{Zs(()=>{pt()})}),vo(()=>{Object.values(b.value).forEach(V=>V.destroy())}),(V,X)=>{const _e=Sp,ye=ys,fe=Lr,_t=Ap,Tt=Qc,he=Fl;return m(),A("div",{ref_key:"shortcutContainerRef",ref:d,class:at(["shortcut-container",{"!pointer-events-auto":c(a)}]),style:ot({cursor:c(a)?"pointer":"default"}),onClick:lr(Jt,["self"])},[(m(!0),A(yt,null,qt(c(N),ie=>Pt((m(),A("div",{ref_for:!0,ref:de=>nt(de,ie._id),key:ie._id,class:"draggable absolute pointer-events-auto",style:ot({background:c(E)[ie._id]?"#545454":void 0})},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(_e,{width:"100%",height:"100%"})]),_:1}),y(Tt,{ref_for:!0,ref:de=>Yt(de,ie._id),class:"shadow-lg cui-rounded-corner overflow-hidden",pt:{content:{class:"p-0"}}},{default:$(()=>{var de;return[g("div",C6,[(de=c(B))!=null&&de.result.find(Le=>Le._id===ie.cameraId)?(m(),j(_t,{key:1,"source-role":"low-resolution","camera-info":c(B).result.find(Le=>Le._id===ie.cameraId),toolbar:!1,control:!1,subcontrol:!1,"live-indicator-overlay":""},null,8,["camera-info"])):(m(),j(fe,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])]}),_:2},1536)],4)),[[c(Kh),[de=>He(ie._id,de),{delayEnter:0,delayLeave:1e3}]],[c(sf),[()=>ht(ie),{distanceThreshold:24,delay:500,onMouseUp:(de,Le,rt)=>Mt(rt,ie)}]]])),128)),c(L)?(m(),A("div",{key:0,ref_key:"placeholderRef",ref:u,class:"draggable absolute pointer-events-auto",style:ot(`left: ${c(L).x}px; top: ${c(L).y}px;`)},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(_e,{width:"100%",height:"100%"})]),_:1})],4)):ce("",!0),c(a)&&!c(z)&&!c(K)?(m(),j(Tt,{key:1,ref_key:"camerasMenuRef",ref:h,class:"shadow-lg cui-rounded-corner","auto-z-index":!0,"append-to":"body",onShow:X[0]||(X[0]=ie=>O.value=!0),onHide:X[1]||(X[1]=ie=>Te(!1))},{default:$(()=>[g("div",k6,[(m(!0),A(yt,null,qt(c(D),ie=>(m(),j(he,{key:ie._id,class:"shortcut-menu-item","camera-name":ie.name,width:"100%",loading:c(F),onClick:lr(de=>wt(ie),["prevent"])},null,8,["camera-name","loading","onClick"]))),128))])]),_:1},512)):ce("",!0)],6)}}}),A6=qs(E6,[["__scopeId","data-v-98006b6f"]]),M6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $6(s,e){return m(),A("svg",M6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)]))}const P6=pe({name:"ion-chevron-forward-outline",render:$6}),T6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function R6(s,e){return m(),A("svg",T6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"M328 112L184 256l144 144"},null,-1)]))}const I6=pe({name:"ion-chevron-back-outline",render:R6}),O6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function N6(s,e){return m(),A("svg",O6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m112 184l144 144l144-144"},null,-1)]))}const F6=pe({name:"ion-chevron-down-outline",render:N6}),L6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function j6(s,e){return m(),A("svg",L6,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m112 328l144-144l144 144"},null,-1)]))}const q6=pe({name:"ion-chevron-up-outline",render:j6}),D6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B6(s,e){return m(),A("svg",D6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M18 12.998H6a1 1 0 0 1 0-2h12a1 1 0 0 1 0 2"},null,-1)]))}const z6=pe({name:"ic-round-minus",render:B6}),U6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V6(s,e){return m(),A("svg",U6,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M18 12.998h-5v5a1 1 0 0 1-2 0v-5H6a1 1 0 0 1 0-2h5v-5a1 1 0 0 1 2 0v5h5a1 1 0 0 1 0 2"},null,-1)]))}const H6=pe({name:"ic-round-plus",render:V6});function Ll(s){const e=ae(),t=ae(!1),n=ae(!1),r=ae(),i=ae(),o=ae(),a=ae(),l=ae(),u=ae(),d=ae(),h=ae([]),v=ne(()=>t.value),f=ne(()=>n.value),b=ne(()=>h.value.includes(Gt.Light)),k=ne(()=>h.value.includes(Gt.Siren)),z=ne(()=>h.value.includes(Gt.Doorbell)),L=ne(()=>h.value.includes(Gt.Battery)),se=ne(()=>h.value.includes(Gt.AudioSensor)),K=ne(()=>h.value.includes(Gt.MotionSensor)||h.value.includes(Gt.MotionDetector)),N=ne(()=>h.value.includes(Gt.ObjectSensor)||h.value.includes(Gt.ObjectDetector)),E=ne(()=>h.value.includes(Gt.PTZ));return Ge(s,O=>{if(!O)return;e.value=O.cameraSubject.value,t.value=O.connected,n.value=O.frameWorkerConnected,h.value=O.getCapabilities(),r.value=O.getValue("light"),i.value=O.getValue("motion"),o.value=O.getValue("audio"),a.value=O.getValue("object"),l.value=O.getValue("doorbell"),u.value=O.getValue("siren"),d.value=O.getValue("battery");const U=fn(O.cameraSubject);Ge(U,ue=>{ue&&(e.value=ue)});const S=fn(O.onConnected);Ge(S,ue=>{t.value=!!ue});const M=fn(O.onFrameWorkerConnected);Ge(M,ue=>{n.value=!!ue});const B=fn(O.capabilities);Ge(B,ue=>{ue&&(h.value=ue.map(Se=>Se.capabilities).flat())});const W=fn(O.onLightSwitched);Ge(W,ue=>{r.value=ue});const I=fn(O.onMotionDetected);Ge(I,ue=>{i.value=ue});const w=fn(O.onAudioDetected);Ge(w,ue=>{o.value=ue});const H=fn(O.onObjectDetected);Ge(H,ue=>{a.value=ue});const J=fn(O.onDoorbellPressed);Ge(J,ue=>{l.value=ue});const q=fn(O.onSirenDetected);Ge(q,ue=>{u.value=ue});const oe=fn(O.onBatteryChanged);Ge(oe,ue=>{d.value=ue})},{immediate:!0}),{cameraObject:e,connected:v,frameWorkerConnected:f,hasLight:b,hasSiren:k,hasDoorbell:z,hasBattery:L,hasAudioDetector:se,hasMotionDetector:K,hasObjectDetector:N,hasPtz:E,capabilities:h,lightState:r,motionState:i,audioState:o,objectState:a,doorbellState:l,sirenState:u,batteryState:d}}const Q6={class:"relative w-full h-full"},K6={class:"absolute top-1 text-muted"},Z6={class:"absolute bottom-1 text-muted"},G6={class:"absolute left-1 text-muted"},W6={class:"absolute right-1 text-muted"},Th=100,kr=2e3,as=.05,Rh=.05,J6=.03,Y6=At({__name:"CuiCameraPTZ",props:{cameraDevice:{},size:{default:"small"}},emits:["panTiltChange","zoomChange"],setup(s,{expose:e,emit:t}){const n=t,r=s,{cameraDevice:i,size:o}=Wt(r),{capabilities:a}=Ll(i),l=Vt("panTiltRef"),u=Vt("zoomRef"),d=Tr({x:0,y:0}),h=Tr({x:0,y:0}),v=Tr({x:0,y:0}),f=ae(!1),b=ae(!1),k=ae(0),z=ae(0),L=ae(0),se=ae(!1),K=ae(0),N=ae(0),E=ae(0),O=ae(0),U=ae(0),S=ae(0),M=ae(0),B=ae("none"),W=ae(0),I=ae(0),w=ae(0),H=ae(null),J=ae(Date.now()),q=ne(()=>f.value||b.value),oe=ne(()=>o.value==="small"?45:60),ue=ne(()=>o.value==="small"?10:15),Se=ne(()=>se.value),F=Be=>Math.round(Be*100)/100,D=Be=>F(Math.max(0,Math.min(1,Be))),Y=async Be=>{const Ue=Date.now();if(!(se.value&&Ue-K.value<Th)){"pan"in Be&&Be.pan!==void 0&&(Be.pan=F(Be.pan)),"tilt"in Be&&Be.tilt!==void 0&&(Be.tilt=F(Be.tilt)),"zoom"in Be&&Be.zoom!==void 0&&(Be.zoom=D(Be.zoom)),se.value=!0,K.value=Ue;try{await i.value.interfaces.ptzCommand(Be)}catch(V){console.error("PTZ command failed:",V)}finally{se.value=!1}}},Te=()=>{const Be=Date.now(),Ue=(Be-J.value)/1e3;J.value=Be;let V=!1;if(f.value&&(Math.abs(U.value)>=as||Math.abs(S.value)>=as)){const X=U.value*Rh*Ue*5,_e=S.value*Rh*Ue*5;W.value=Math.max(-1,Math.min(1,W.value+X)),I.value=Math.max(-1,Math.min(1,I.value+_e));const ye=F(W.value),fe=F(I.value);(h.x!==ye||h.y!==fe)&&(h.x=ye,h.y=fe,n("panTiltChange",{x:h.x,y:h.y}),V=!0)}if(b.value&&Math.abs(M.value)>=as){const X=M.value*J6*Ue*10;w.value=Math.max(0,Math.min(1,w.value+X));const _e=F(w.value);z.value!==_e&&(z.value=_e,n("zoomChange",_e),V=!0)}if(V&&q.value&&Date.now()-K.value>=Th*2){if(f.value&&(Math.abs(U.value)>=as||Math.abs(S.value)>=as)){const _e=F(U.value),ye=F(S.value);B.value==="pan"?Y({type:"continuous",pan:_e,tilt:0,timeout:kr}):B.value==="tilt"?Y({type:"continuous",pan:0,tilt:ye,timeout:kr}):Y({type:"continuous",pan:_e,tilt:ye,timeout:kr})}else if(b.value&&Math.abs(M.value)>=as){const _e=D(Math.abs(M.value)),ye=M.value>0;Y({type:"continuous",zoom:ye?_e:-_e,timeout:kr})}}q.value&&(H.value=requestAnimationFrame(Te))},He=()=>{H.value!==null&&cancelAnimationFrame(H.value),J.value=Date.now(),H.value=requestAnimationFrame(Te)},ht=()=>{H.value!==null&&(cancelAnimationFrame(H.value),H.value=null)},Mt=async()=>{await new Promise(Be=>setTimeout(Be,50)),!q.value&&(Math.abs(N.value)>=as||Math.abs(E.value)>=as||Math.abs(O.value)>=as)&&(U.value=0,S.value=0,M.value=0,B.value="none",N.value=0,E.value=0,O.value=0,await Y({type:"stop"}),ht())},Qe=Be=>{b.value=!0,J.value=Date.now(),w.value=z.value,He(),Be instanceof MouseEvent?ze(Be.clientY):ze(Be.touches[0].clientY)},ze=async Be=>{if(!u.value||!b.value)return;const Ue=u.value.getBoundingClientRect(),V=Ue.top+Ue.height/2,X=oe.value;let _e=Be-V;_e=Math.max(-X,Math.min(X,_e)),k.value=_e;const ye=-_e/X;M.value=ye;const fe=F(ye);if(Math.abs(fe)>=as&&Math.abs(fe-O.value)>=as){O.value=fe;const _t=fe>0,Tt=D(Math.abs(fe));await Y({type:"continuous",zoom:_t?Tt:-Tt,timeout:kr})}else b.value&&Math.abs(fe)<as&&Math.abs(O.value)>=as&&(M.value=0,O.value=0,await Y({type:"stop"}))},ge=Be=>{f.value=!0,J.value=Date.now(),He(),Be instanceof MouseEvent?pt(Be.clientX,Be.clientY):pt(Be.touches[0].clientX,Be.touches[0].clientY)},pt=async(Be,Ue)=>{if(!l.value||!f.value)return;const V=l.value.getBoundingClientRect(),X=V.width/2,_e=V.height/2;let ye=Be-V.left-X,fe=Ue-V.top-_e;const _t=Math.min(X,_e)-ue.value,Tt=Math.sqrt(ye*ye+fe*fe);Tt>_t&&(ye=ye/Tt*_t,fe=fe/Tt*_t),d.x=ye,d.y=fe;const he=ye/_t,ie=-fe/_t,de=Math.abs(he),Le=Math.abs(ie);de>=as||Le>=as?de>Le?(B.value="pan",U.value=he,S.value=0):(B.value="tilt",U.value=0,S.value=ie):(B.value="none",U.value=0,S.value=0),(de>as||Le>as)&&(v.x=U.value,v.y=S.value);const rt=Math.abs(U.value-N.value),Kt=Math.abs(S.value-E.value),ps=rt>=as||Kt>=as,Zt=Math.abs(U.value)>=as||Math.abs(S.value)>=as;if(Zt&&ps){N.value=U.value,E.value=S.value;const os=F(U.value),As=F(S.value);B.value==="pan"?await Y({type:"continuous",pan:os,tilt:0,timeout:kr}):B.value==="tilt"&&await Y({type:"continuous",pan:0,tilt:As,timeout:kr})}else f.value&&!Zt&&(Math.abs(N.value)>=as||Math.abs(E.value)>=as)&&(U.value=0,S.value=0,B.value="none",N.value=0,E.value=0,await Y({type:"stop"}))},Jt=Be=>{f.value&&pt(Be.clientX,Be.clientY),b.value&&ze(Be.clientY)},wt=Be=>{Be.preventDefault(),f.value&&pt(Be.touches[0].clientX,Be.touches[0].clientY),b.value&&ze(Be.touches[0].clientY)},zt=()=>{f.value&&(f.value=!1,d.x=0,d.y=0),b.value&&(L.value=z.value,b.value=!1,k.value=0),Mt()},nt=async(Be,Ue)=>{await Y({type:"preset",preset:Be,speed:Ue})},Yt=async Be=>{await Y({type:"home",speed:Be})};return Sn(()=>{window.addEventListener("mousemove",Jt),window.addEventListener("mouseup",zt),window.addEventListener("touchmove",wt,{passive:!1}),window.addEventListener("touchend",zt)}),vo(()=>{window.removeEventListener("mousemove",Jt),window.removeEventListener("mouseup",zt),window.removeEventListener("touchmove",wt),window.removeEventListener("touchend",zt),ht(),Y({type:"stop"})}),e({goToPreset:nt,goToHome:Yt,isLoading:Se}),(Be,Ue)=>{const V=H6,X=z6,_e=q6,ye=F6,fe=I6,_t=P6;return m(),A("div",Q6,[c(a).includes(c(Gt).PTZZoom)?(m(),A("div",{key:0,ref_key:"zoomRef",ref:u,class:at(["pointer-events-auto",["absolute left-4 bottom-4 bg-black/70 rounded-full flex flex-col items-center justify-center border border-white/10 shadow-md",c(o)==="small"?"w-12 h-36":"w-16 h-48"]]),onMousedown:Qe,onTouchstart:lr(Qe,["prevent"])},[g("div",{class:at(["absolute top-4 text-muted",c(o)==="small"?"text-base":"text-lg"])},[y(V)],2),g("div",{class:at(["absolute bottom-4 text-muted",c(o)==="small"?"text-base":"text-lg"])},[y(X)],2),g("div",{class:at(["bg-white rounded-full absolute cursor-grab active:cursor-grabbing shadow-lg",c(o)==="small"?"w-8 h-8":"w-10 h-10"]),style:ot({transform:`translateY(${c(k)}px)`})},null,6)],34)):ce("",!0),c(a).includes(c(Gt).PTZ)?(m(),A("div",{key:1,ref_key:"panTiltRef",ref:l,class:at(["pointer-events-auto",["absolute right-4 bottom-4 bg-black/70 rounded-full flex items-center justify-center border border-white/10 shadow-md",c(o)==="small"?"w-24 h-24":"w-32 h-32"]]),onMousedown:ge,onTouchstart:lr(ge,["prevent"])},[g("div",K6,[y(_e)]),g("div",Z6,[y(ye)]),g("div",G6,[y(fe)]),g("div",W6,[y(_t)]),g("div",{class:at(["bg-white rounded-full absolute cursor-grab active:cursor-grabbing shadow-lg transform -translate-x-1/2 -translate-y-1/2",c(o)==="small"?"w-8 h-8":"w-10 h-10"]),style:ot({left:`calc(50% + ${c(d).x}px)`,top:`calc(50% + ${c(d).y}px)`})},null,6)],34)):ce("",!0)])}}}),X6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function e8(s,e){return m(),A("svg",X6,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M17.5 6.5H20a1.5 1.5 0 0 1 0 3h-3A2.5 2.5 0 0 1 14.5 7V4a1.5 1.5 0 0 1 3 0zM4 6.5h2.5V4a1.5 1.5 0 1 1 3 0v3A2.5 2.5 0 0 1 7 9.5H4a1.5 1.5 0 1 1 0-3m0 11h2.5V20a1.5 1.5 0 0 0 3 0v-3A2.5 2.5 0 0 0 7 14.5H4a1.5 1.5 0 0 0 0 3m16 0h-2.5V20a1.5 1.5 0 0 1-3 0v-3a2.5 2.5 0 0 1 2.5-2.5h3a1.5 1.5 0 0 1 0 3"})],-1)]))}const t8=pe({name:"mingcute-fullscreen-exit-fill",render:e8}),s8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function n8(s,e){return m(),A("svg",s8,e[0]||(e[0]=[g("g",{fill:"none","fill-rule":"evenodd"},[g("path",{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),g("path",{fill:"currentColor",d:"M18.5 5.5H16a1.5 1.5 0 0 1 0-3h3A2.5 2.5 0 0 1 21.5 5v3a1.5 1.5 0 0 1-3 0zM8 5.5H5.5V8a1.5 1.5 0 1 1-3 0V5A2.5 2.5 0 0 1 5 2.5h3a1.5 1.5 0 1 1 0 3m0 13H5.5V16a1.5 1.5 0 0 0-3 0v3A2.5 2.5 0 0 0 5 21.5h3a1.5 1.5 0 0 0 0-3m8 0h2.5V16a1.5 1.5 0 0 1 3 0v3a2.5 2.5 0 0 1-2.5 2.5h-3a1.5 1.5 0 0 1 0-3"})],-1)]))}const r8=pe({name:"mingcute-fullscreen-fill",render:n8}),i8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function o8(s,e){return m(),A("svg",i8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M3.5 2A2.5 2.5 0 0 0 1 4.5v5A2.5 2.5 0 0 0 3.5 12H7v-2a2 2 0 0 1 2-2h5V4.5A2.5 2.5 0 0 0 11.5 2zM8 10a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1z"},null,-1)]))}const a8=pe({name:"fluent-picture-in-picture16-filled",render:o8}),c8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function l8(s,e){return m(),A("svg",c8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M1 4.5A2.5 2.5 0 0 1 3.5 2h8A2.5 2.5 0 0 1 14 4.5V8h-1V4.5A1.5 1.5 0 0 0 11.5 3h-8A1.5 1.5 0 0 0 2 4.5v5A1.5 1.5 0 0 0 3.5 11H7v1H3.5A2.5 2.5 0 0 1 1 9.5zM9 9a1 1 0 0 0-1 1v3a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1z"},null,-1)]))}const u8=pe({name:"fluent-picture-in-picture16-regular",render:l8}),d8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h8(s,e){return m(),A("svg",d8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M13.986 14.776a.73.73 0 0 1-.66-.4a.74.74 0 0 1 .3-1a2.45 2.45 0 0 0 1-1.001a.739.739 0 0 1 1.359.127a.75.75 0 0 1-.048.563a3.85 3.85 0 0 1-1.611 1.61a.7.7 0 0 1-.34.1"},null,-1),g("path",{fill:"currentColor",d:"M19.409 10.644a7.55 7.55 0 0 1-.7 3.141a7.48 7.48 0 0 1-4.823 4.003a6.4 6.4 0 0 1-1.151.2v2.511h2.892a.75.75 0 0 1 0 1.501H8.342a.75.75 0 0 1 0-1.5h2.892v-2.512a6 6 0 0 1-.57-.07a.752.752 0 0 1 .27-1.481q.442.078.89.08h.33a5.5 5.5 0 0 0 1.341-.19a5.9 5.9 0 0 0 2.282-1.18a5.9 5.9 0 0 0 2.13-4.543a.75.75 0 0 1 1.502 0zM20.52 4.56l-4.363 4.353l-5.623 5.623l-6.004 6.003a.8.8 0 0 1-.53.22a.75.75 0 0 1-.53-.22a.74.74 0 0 1 0-1.06l3.462-3.462l-.18-.2a7.3 7.3 0 0 1-2.172-5.183a.75.75 0 0 1 .74-.76a.76.76 0 0 1 .751.75a5.92 5.92 0 0 0 1.771 4.172l.14.16l.85-.84a4 4 0 0 1-.65-.77a3.66 3.66 0 0 1-.59-1.892V5.851a4.13 4.13 0 0 1 1.45-2.872a4.92 4.92 0 0 1 5.894 0a4.13 4.13 0 0 1 1.441 2.802v.79l3.092-3.091a.74.74 0 0 1 1.06 0a.75.75 0 0 1-.01 1.08"},null,-1)]))}const m8=pe({name:"mage-microphone-mute-fill",render:h8}),p8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f8(s,e){return m(),A("svg",p8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M16.43 5.838v5.57a4.43 4.43 0 0 1-8.78 0v-5.57a4.43 4.43 0 0 1 8.78 0"},null,-1),g("path",{fill:"currentColor",d:"M12.79 17.998v2.5h2.89a.75.75 0 0 1 0 1.5H8.4a.75.75 0 1 1 0-1.5h2.85v-2.5a7.4 7.4 0 0 1-6.67-7.38a.75.75 0 0 1 1.5 0a5.92 5.92 0 1 0 11.84 0a.75.75 0 0 1 1.5 0a7.4 7.4 0 0 1-6.67 7.38z"},null,-1)]))}const g8=pe({name:"mage-microphone-fill",render:f8}),v8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function _8(s,e){return m(),A("svg",v8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124M11.28 5.72a.75.75 0 1 0-1.06 1.06L11.44 8l-1.22 1.22a.75.75 0 1 0 1.06 1.06l1.22-1.22l1.22 1.22a.75.75 0 1 0 1.06-1.06L13.56 8l1.22-1.22a.75.75 0 0 0-1.06-1.06L12.5 6.94z"},null,-1)]))}const y8=pe({name:"heroicons-speaker-x-mark16-solid",render:_8}),b8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function w8(s,e){return m(),A("svg",b8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124m5.393.984a.75.75 0 1 0-1.06 1.06a5.5 5.5 0 0 1 0 7.78a.75.75 0 1 0 1.06 1.06a7 7 0 0 0 0-9.9"},null,-1),g("path",{fill:"currentColor",d:"M10.828 5.172a.75.75 0 1 0-1.06 1.06a2.5 2.5 0 0 1 0 3.536a.75.75 0 1 0 1.06 1.06a4 4 0 0 0 0-5.656"},null,-1)]))}const x8=pe({name:"heroicons-speaker-wave16-solid",render:w8}),S8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C8(s,e){return m(),A("svg",S8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 12v10H8v-8H6v-2zm8 2v6c0 1.11-.89 2-2 2h-2a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-4 0v6h2v-6zM11.5 3c2.65 0 5.05 1 6.9 2.6L21 3v7h-7l2.62-2.62C15.23 6.22 13.46 5.5 11.5 5.5c-3.54 0-6.55 2.31-7.6 5.5l-2.37-.78C2.92 6.03 6.85 3 11.5 3"},null,-1)]))}const k8=pe({name:"mdi-fast-forward10",render:C8}),E8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function A8(s,e){return m(),A("svg",E8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17.276 5.47c.435.16.724.575.724 1.039V17.49c0 .464-.29.879-.724 1.039a3.7 3.7 0 0 1-2.552 0A1.11 1.11 0 0 1 14 17.491V6.51c0-.464.29-.879.724-1.04a3.7 3.7 0 0 1 2.552 0m-8 0c.435.16.724.575.724 1.039V17.49c0 .464-.29.879-.724 1.039a3.7 3.7 0 0 1-2.552 0A1.11 1.11 0 0 1 6 17.491V6.51c0-.464.29-.879.724-1.04a3.7 3.7 0 0 1 2.552 0"},null,-1)]))}const M8=pe({name:"basil-pause-solid",render:A8}),$8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function P8(s,e){return m(),A("svg",$8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19.266 13.516a1.917 1.917 0 0 0 0-3.032A35.8 35.8 0 0 0 9.35 5.068l-.653-.232c-1.248-.443-2.567.401-2.736 1.69a42.5 42.5 0 0 0 0 10.948c.17 1.289 1.488 2.133 2.736 1.69l.653-.232a35.8 35.8 0 0 0 9.916-5.416"},null,-1)]))}const T8=pe({name:"basil-play-solid",render:P8}),R8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function I8(s,e){return m(),A("svg",R8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12.5 3c4.65 0 8.58 3.03 9.97 7.22L20.1 11c-1.05-3.19-4.06-5.5-7.6-5.5c-1.96 0-3.73.72-5.12 1.88L10 10H3V3l2.6 2.6C7.45 4 9.85 3 12.5 3M10 12v10H8v-8H6v-2zm8 2v6c0 1.11-.89 2-2 2h-2a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2m-4 0v6h2v-6z"},null,-1)]))}const O8=pe({name:"mdi-rewind10",render:I8}),N8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function F8(s,e){return m(),A("svg",N8,e[0]||(e[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-width":"2",d:"M8.5 5.5L12 2l3.5 3.5M22 12H2m3.5-3.5L2 12l3.5 3.5m13 0L22 12l-3.5-3.5M12 22V2M8.5 18.5L12 22l3.5-3.5"},null,-1)]))}const L8=pe({name:"grommet-icons-pan",render:F8}),j8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q8(s,e){return m(),A("svg",j8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 19v-9q0-.475.213-.9t.587-.7l6-4.5q.525-.4 1.2-.4t1.2.4l6 4.5q.375.275.588.7T20 10v9q0 .825-.588 1.413T18 21h-3q-.425 0-.712-.288T14 20v-5q0-.425-.288-.712T13 14h-2q-.425 0-.712.288T10 15v5q0 .425-.288.713T9 21H6q-.825 0-1.412-.587T4 19"},null,-1)]))}const D8=pe({name:"material-symbols-home-rounded",render:q8}),B8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z8(s,e){return m(),A("svg",B8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 .36A5.4 5.4 0 0 0 6.62 5.3a5.4 5.4 0 0 0-1.22-.14a5.4 5.4 0 0 0-2.143 10.357a5.4 5.4 0 0 0-.737 2.723a5.4 5.4 0 0 0 9.54 3.466a5.4 5.4 0 0 0 8.833-6.137a5.4 5.4 0 0 0-3.505-10.152A5.4 5.4 0 0 0 12 .36M6.283 7.228h10.592c.746 0 1.352.605 1.352 1.349v7.646a1.35 1.35 0 0 1-1.352 1.348h-3.608l-7.24 3.55l1.1-3.55h-.844a1.35 1.35 0 0 1-1.352-1.348V8.577c0-.744.606-1.349 1.352-1.349"},null,-1)]))}const U8=pe({name:"simple-icons-webrtc",render:z8}),V8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H8(s,e){return m(),A("svg",V8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M17.41 2H6.59A4.58 4.58 0 0 0 2 6.59v10.82A4.58 4.58 0 0 0 6.59 22h10.82A4.58 4.58 0 0 0 22 17.41V6.59A4.58 4.58 0 0 0 17.41 2m-2.653 12.447a1.924 1.924 0 0 1-1.924 1.923h-5.86a1.924 1.924 0 0 1-1.923-1.923v-4.87a1.923 1.923 0 0 1 1.927-1.924h5.856a1.925 1.925 0 0 1 1.924 1.924zm4.2.74a.771.771 0 0 1-1.266.59l-2.211-1.854a.85.85 0 0 1-.3-.653v-2.52a.85.85 0 0 1 .31-.657l2.206-1.82a.769.769 0 0 1 1.26.594z"},null,-1)]))}const Q8=pe({name:"cbi-iosfacetime",render:H8}),K8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z8(s,e){return m(),A("svg",K8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10.4 13.45h3.2l.6 1.625q.075.2.238.313t.362.112q.35 0 .538-.275t.062-.6l-2.55-6.7q-.075-.2-.237-.312T12.25 7.5h-.5q-.2 0-.363.113t-.237.312L8.625 14.65q-.125.3.05.575t.525.275q.2 0 .363-.112t.237-.313zm.4-1.15L11.95 9h.1l1.15 3.3zM12 22q-2.075 0-3.9-.788t-3.175-2.137T2.788 15.9T2 12q0-.8.125-1.6T2.5 8.825q.125-.4.513-.537t.737.062q.375.2.538.588t.037.812q-.15.55-.238 1.113T4 12q0 3.35 2.325 5.675T12 20t5.675-2.325T20 12t-2.325-5.675T12 4q-.6 0-1.187.087T9.65 4.35q-.425.125-.8-.025T8.3 3.8t-.013-.762t.563-.513q.75-.275 1.55-.4T12 2q2.075 0 3.9.788t3.175 2.137T21.213 8.1T22 12t-.788 3.9t-2.137 3.175t-3.175 2.138T12 22M5.5 7q-.625 0-1.062-.437T4 5.5t.438-1.062T5.5 4t1.063.438T7 5.5t-.437 1.063T5.5 7m6.5 5"},null,-1)]))}const G8=pe({name:"material-symbols-motion-photos-auto-outline-rounded",render:Z8}),W8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J8(s,e){return m(),A("svg",W8,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"m8.471 7.237l3.056 12.992c.233.993 1.63 1.04 1.929.065l2.945-9.58l.384 1.527a1 1 0 0 0 .97.756H21a1 1 0 1 0 0-2h-2.466l-1.069-4.241c-.247-.981-1.628-1.017-1.925-.05l-2.912 9.472L9.475 2.771c-.24-1.02-1.688-1.03-1.943-.014l-2.065 8.24H3a1 1 0 0 0 0 2h3.247a1 1 0 0 0 .97-.757z"},null,-1)]))}const Y8=pe({name:"fluent-pulse24-filled",render:J8}),X8={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function ex(s,e){return m(),A("svg",X8,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"4"},[g("path",{fill:"currentColor",d:"M16.866 7.47A18 18 0 0 0 16 13c0 9.941 8.059 18 18 18a17.9 17.9 0 0 0 7.134-1.47C38.801 36.767 32.012 42 24 42c-9.941 0-18-8.059-18-18c0-7.407 4.473-13.768 10.866-16.53Z"}),g("path",{"stroke-linecap":"round",d:"M31.66 10H41l-10 8h10"})],-1)]))}const tx=pe({name:"icon-park-solid-sleep",render:ex}),sx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nx(s,e){return m(),A("svg",sx,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2a7 7 0 0 1 7 7a7 7 0 0 1-7 7a7 7 0 0 1-7-7a7 7 0 0 1 7-7m0 2a5 5 0 0 0-5 5a5 5 0 0 0 5 5a5 5 0 0 0 5-5a5 5 0 0 0-5-5m0 2a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3M6 22a2 2 0 0 1-2-2c0-.38.1-.73.29-1.03l1.82-3.16A9 9 0 0 0 12 18c2.25 0 4.31-.83 5.89-2.19l1.82 3.16c.19.3.29.65.29 1.03a2 2 0 0 1-2 2z"},null,-1)]))}const rx=pe({name:"mdi-webcam",render:nx}),ix={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ox(s,e){return m(),A("svg",ix,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057M10.25 8a.75.75 0 0 0-1.5 0v8a.75.75 0 0 0 1.5 0v-3.25h3.5V16a.75.75 0 0 0 1.5 0V8a.75.75 0 0 0-1.5 0v3.25h-3.5z"},null,-1)]))}const ax=pe({name:"mynaui-letter-h-square-solid",render:ox}),cx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lx(s,e){return m(),A("svg",cx,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057m.233 5.3A.75.75 0 0 0 8.25 8v8a.75.75 0 0 0 1.5 0v-5.75l1.65 2.2a.75.75 0 0 0 1.2 0l1.65-2.2V16a.75.75 0 0 0 1.5 0V8a.75.75 0 0 0-1.35-.45l-2.4 3.2z"},null,-1)]))}const ux=pe({name:"mynaui-letter-m-square-solid",render:lx}),dx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hx(s,e){return m(),A("svg",dx,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057M10.25 8a.75.75 0 0 0-1.5 0v7.5c0 .414.336.75.75.75H15a.75.75 0 0 0 0-1.5h-4.75z"},null,-1)]))}const mx=pe({name:"mynaui-letter-l-square-solid",render:hx}),px={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fx(s,e){return m(),A("svg",px,e[0]||(e[0]=[g("g",{fill:"currentColor"},[g("path",{d:"M12.918 12.083h-1.836L12 9.636z"}),g("path",{d:"M9.367 2.25h5.266c1.092 0 1.958 0 2.655.057c.714.058 1.317.18 1.869.46a4.75 4.75 0 0 1 2.075 2.077c.281.55.403 1.154.461 1.868c.057.697.057 1.563.057 2.655v5.266c0 1.092 0 1.958-.057 2.655c-.058.714-.18 1.317-.46 1.869a4.75 4.75 0 0 1-2.076 2.075c-.552.281-1.155.403-1.869.461c-.697.057-1.563.057-2.655.057H9.367c-1.092 0-1.958 0-2.655-.057c-.714-.058-1.317-.18-1.868-.46a4.75 4.75 0 0 1-2.076-2.076c-.281-.552-.403-1.155-.461-1.869c-.057-.697-.057-1.563-.057-2.655V9.367c0-1.092 0-1.958.057-2.655c.058-.714.18-1.317.46-1.868a4.75 4.75 0 0 1 2.077-2.076c.55-.281 1.154-.403 1.868-.461c.697-.057 1.563-.057 2.655-.057m3.335 4.987a.75.75 0 0 0-1.404 0l-3 8a.75.75 0 1 0 1.404.526l.818-2.18h2.96l.818 2.18a.75.75 0 1 0 1.404-.526z"})],-1)]))}const gx=pe({name:"mynaui-letter-a-square-solid",render:fx}),vx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _x(s,e){return m(),A("svg",vx,e[0]||(e[0]=[g("path",{fill:"currentColor","fill-rule":"evenodd",d:"M18 2.75a.75.75 0 0 1 0-1.5h4a.75.75 0 0 1 .53 1.28l-2.72 2.72H22a.75.75 0 0 1 0 1.5h-4a.75.75 0 0 1-.53-1.28l2.72-2.72zm-4.5 6a.75.75 0 0 1 0-1.5h3a.75.75 0 0 1 .53 1.28l-1.72 1.72h1.19a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1-.53-1.28l1.72-1.72z","clip-rule":"evenodd"},null,-1),g("path",{fill:"currentColor",d:"M12 22c5.523 0 10-4.477 10-10c0-.463-.694-.54-.933-.143a6.5 6.5 0 1 1-8.924-8.924C12.54 2.693 12.463 2 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10"},null,-1)]))}const yx=pe({name:"solar-moon-sleep-bold",render:_x}),bx=Symbol("cui-camera-drawer"),Do=Zh(bx),Cp={position:"right",showCloseIcon:!1,modal:!0,dismissable:!0,baseZIndex:1e3,blockScroll:!0,pt:{root:{class:"w-full sm:w-[400px]"}}},kp=()=>{const s=ae(!1),e=ne(()=>s.value),t=(r,i)=>{Do.emit({type:"open",options:r,props:{...Cp,...i}}),s.value=!0},n=()=>{Do.emit({type:"close"}),s.value=!1};return Do.on(r=>{switch(r.type){case"close":s.value=!1;break;case"open":s.value=!0;break}}),{open:t,close:n,isOpen:e,getEventBus:()=>Do}};async function Ep(){const s=Fs(),{api:e,isApiReady:t}=Vs(s);return t.value?e.value:new Promise((n,r)=>{const i=Ge(t,o=>{o&&e.value&&(i(),n(e.value))});setTimeout(()=>{i(),r(new Error("Timeout waiting for API"))},15e3)})}const wx={key:"sleep",class:"absolute left-0 right-0 top-0 bottom-0 bg-black/80 flex items-center justify-center z-7"},xx={class:"flex flex-col items-center justify-center text-center"},Sx={key:0,class:"text-white/80 text-sm max-w-xs mt-3"},Cx={key:"loading",class:"absolute w-full h-full flex flex-col items-center justify-center z-6 pointer-events-none"},kx={key:0,class:"mt-3 text-white text-sm text-shadow"},Ex={key:"overlay",class:"absolute w-full p-4 flex items-center justify-between gap-2 z-6 pointer-events-none"},Ax={key:1,class:"text-sm font-semibold p-2 bg-black/60 rounded-xl text-white"},Mx={id:"timeline-container",key:"timeline",class:"absolute w-full h-full z-5 pointer-events-none"},$x={key:5,class:"absolute top-0 left-0 w-full h-full z-5 pointer-events-none"},Px=["data-player-id","muted"],Tx={class:"flex items-center gap-2"},Rx={key:1,class:"w-[10px] h-[10px] rounded-full bg-red-500"},Ix={class:"text-base font-semibold"},Ih=6,Ox=5e3,Oh=5e3,Nx=1e4,Fx=1e3,Lx=At({__name:"CuiCameraCard",props:Kn({cameraInfo:{},expandableCard:{type:Boolean,default:!1},flatCard:{type:Boolean,default:!1},cardProps:{},control:{type:Boolean,default:!0},controlFastForwardButton:{type:Boolean,default:!0},controlFsButton:{type:Boolean,default:!0},controlMicrophoneButton:{type:Boolean,default:!0},controlPipButton:{type:Boolean,default:!0},controlPlayPauseButton:{type:Boolean,default:!0},controlRewindButton:{type:Boolean,default:!0},controlSpeakerButton:{type:Boolean,default:!0},subcontrol:{type:Boolean,default:!0},subcontrolActivityModeButton:{type:Boolean,default:!0},subcontrolPtzButton:{type:Boolean,default:!0},subcontrolQualityButton:{type:Boolean,default:!0},subcontrolStreamingModeButton:{type:Boolean,default:!0},cameraNameOverlay:{type:Boolean,default:!0},liveIndicatorOverlay:{type:Boolean,default:!1},modeOverlay:{type:Boolean},toolbar:{type:Boolean,default:!0},toolbarClass:{},toolbarDetectionButton:{type:Boolean,default:!0},toolbarSettingsButton:{type:Boolean,default:!0},toolbarShareButton:{type:Boolean,default:!0},toolbarShortcutsButton:{type:Boolean,default:!0},toolbarSnapshotButton:{type:Boolean,default:!0},toolbarStyle:{},toolbarTimelineButton:{type:Boolean,default:!0},toolbarZoneButton:{type:Boolean,default:!0}},{activityMode:{default:"always-on"},activityModeModifiers:{},sourceRole:{},sourceRoleModifiers:{},streamingMode:{},streamingModeModifiers:{}}),emits:Kn(["streamFinishedLoading","expand"],["update:activityMode","update:sourceRole","update:streamingMode"]),setup(s,{expose:e,emit:t}){const n=new Jn,r=kp(),{mdBreakpoint:i}=Vr(),{isFsSupported:o,isIos:a,isPipSupported:l}=Ol(),{t:u}=js(),d=t,h=Rr(s,"activityMode"),v=Rr(s,"sourceRole"),f=Rr(s,"streamingMode"),b=s,{cameraInfo:k,expandableCard:z,flatCard:L,cardProps:se,cameraNameOverlay:K,liveIndicatorOverlay:N,control:E,controlFastForwardButton:O,controlFsButton:U,controlMicrophoneButton:S,controlPipButton:M,controlPlayPauseButton:B,controlRewindButton:W,controlSpeakerButton:I,subcontrol:w,subcontrolActivityModeButton:H,subcontrolPtzButton:J,subcontrolQualityButton:q,subcontrolStreamingModeButton:oe,toolbar:ue,toolbarClass:Se,toolbarDetectionButton:F,toolbarSettingsButton:D,toolbarShareButton:Y,toolbarShortcutsButton:Te,toolbarSnapshotButton:He,toolbarStyle:ht,toolbarTimelineButton:Mt,toolbarZoneButton:Qe}=Wt(b),ze=Vt("snapshotRef"),ge=Vt("menuRef"),pt=Vt("motionDetectionCanvasRef"),Jt=Vt("objectDetectionCanvasRef"),wt=Vt("ptzRef"),zt=Vt("playerContainerRef"),nt=Vt("videoPlayerRef"),Yt=Ls(),{cameraObject:Be,motionState:Ue,objectState:V,hasPtz:X,hasMotionDetector:_e,hasObjectDetector:ye}=Ll(Yt),fe=Ls(null),_t=Ls(),Tt=ae(!1),he=ae(!1),ie=ae(!1),de=ae("loading"),Le=ae(!1),rt=ae(!1),Kt=ae(!1),ps=ae(!1),Zt=ae(!1),os=ae({x:0,y:0}),As=ae(1),fs=ae(!1),Ms=ae(!1),ds=ae(!1),R=ae(!1),te=ae(!1),ve=ae(!0),ke=ae(!1),st=ae(!0),Ot=ae(!1),Ht=ae(!1),Ye=ae(!1),Ce=ae(["animal","motion","other","person","vehicle"]),Oe=O_();let Ne,be,it;n.toggleQueryActivator("getCameraQuery",!1);const{data:_,isFetching:x,suspense:C}=n.getCameraQuery(typeof k.value=="string"?k.value:""),P=nf(),T=xu(zt,{delayLeave:1e3}),Z=xu(zt,{delayLeave:0}),Me=ri(zt),{isFullscreen:Pe,toggle:le}=rf(a.value?nt:zt),{idle:Ee,reset:ft}=of(Ox,{initialState:!1});Eo(nt,"enterpictureinpicture",()=>Ht.value=!0),Eo(nt,"leavepictureinpicture",()=>Ht.value=!1),Eo(nt,"pause",()=>{ke.value=!1,Zt.value||Co()}),Eo(nt,"play",()=>{Zt.value=!1,ke.value=!0});const Xe=ne(()=>(T.value||ve.value)&&E.value&&!fs.value),mt=ne(()=>typeof k.value=="string"&&x.value||!ie.value||Le.value),ls=ne(()=>he.value&&de.value!=="error"),bs=ne(()=>!!navigator.mediaDevices&&Tt.value&&(de.value==="webrtc"||de.value==="webrtc/tcp")),Ii=ne(()=>Ye.value||!ie.value),kn=ne(()=>{var ee;return f.value??((ee=So.value)==null?void 0:ee.interface.streamingMode)??"webrtc"}),on=ne(()=>{var ee;return v.value??((ee=So.value)==null?void 0:ee.interface.streamingSource)??"high-resolution"}),jl=ne(()=>K.value&&Xe.value&&!i.value&&Me.width.value>=350),$p=ne(()=>E.value&&Xe.value&&!rt.value&&Me.width.value>=150),Pp=ne(()=>w.value&&Xe.value&&!rt.value&&Me.width.value>=150),Oi=ne(()=>ds.value&&Me.width.value>=350&&X.value),ql=ne(()=>{var Ae;let ee=(Ae=So.value)==null?void 0:Ae.interface.aspectRatio;return ee=!ee||ee==="auto"?"16:9":ee,ee.replace(":","/")}),So=ne(()=>typeof k.value=="string"?_.value:k.value),En=ne(()=>typeof k.value=="string"?k.value:k.value.name),Tp=ne(()=>[{key:"animal",label:"Animal",toggle:!0,toggleState:Ce.value.includes("animal"),disabled:!Ni.value.includes("animal"),onClick:()=>Qr("animal")},{key:"motion",label:"Motion",toggle:!0,toggleState:Ce.value.includes("motion"),disabled:!Ni.value.includes("motion"),onClick:()=>Qr("motion")},{key:"other",label:"Other",toggle:!0,toggleState:Ce.value.includes("other"),disabled:!Ni.value.includes("other"),onClick:()=>Qr("other")},{key:"person",label:"Person",toggle:!0,toggleState:Ce.value.includes("person"),disabled:!Ni.value.includes("person"),onClick:()=>Qr("person")},{key:"vehicle",label:"Vehicle",toggle:!0,toggleState:Ce.value.includes("vehicle"),disabled:!Ni.value.includes("vehicle"),onClick:()=>Qr("vehicle")}]),Rp=ne(()=>{var Ae;const ee={body:{class:"w-full h-full p-0 overflow-hidden justify-center"},root:{class:{}}};return L.value&&(ee.root.class={...ee.root.class,"!rounded-none !border-0":!0}),kl(ee,(Ae=se.value)==null?void 0:Ae.pt)}),Dl=ne(()=>{const ee=Me.width.value;return ee?ee<=150?.4:ee<250?.5:ee<350?.7:ee<450?.85:1:1}),Ip=ne(()=>{const ee=Me.height.value,Ae=Dl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),Op=ne(()=>{const ee=Me.height.value,Ae=Dl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),ct=ne(()=>{const ee=Me.width.value;return ee?ee<=150?8:ee<225?10:ee<250?12:ee<350?14:ee<450?16:18:18}),an=ne(()=>{const ee=Me.width.value;return ee?ee<=170?18:ee<225?20:ee<250?22:ee<350?28:ee<450?34:40:40}),Ws=ne(()=>`${an.value}px`),Ni=ne(()=>{var Ae;const ee=new Set(((Ae=So.value)==null?void 0:Ae.detectionZones.map(St=>St.classes).flat())??[]);return _e.value||ee.delete("motion"),ye.value||(ee.delete("animal"),ee.delete("person"),ee.delete("vehicle"),ee.delete("other")),Array.from(ee)});Ge(P,ee=>{var Ae,St;ee==="hidden"?(clearTimeout(be),be=setTimeout(()=>{Hr()},Nx)):(clearTimeout(be),(Ae=fe.value)!=null&&Ae.finishLoading?Co():(yr(),(St=fe.value)==null||St.start()))}),Ge(Le,async ee=>{ee&&await qa(!1,!1)}),Ge(ie,ee=>{ee||qp(),d("streamFinishedLoading",ee)}),Ge(de,ee=>{clearInterval(it),ee==="mse"&&(it=setInterval(Dp,Fx))}),Ge(h,()=>{Wl()}),Ge(Ee,ee=>{h.value==="standby"&&ee&&(rt.value=!0,Hr())}),Ge(Ue,()=>{var ee,Ae,St;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Jl(((Ae=Ue.value)==null?void 0:Ae.detections)??[]),Xl("motion",((St=Ue.value)==null?void 0:St.detections)??[]))},{deep:!0}),Ge(V,()=>{var ee,Ae,St;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Jl(((Ae=V.value)==null?void 0:Ae.detections)??[]),Xl("object",((St=V.value)==null?void 0:St.detections)??[]))},{deep:!0});const Np=async()=>{if(!nt.value)throw new Error("Video player not found!");typeof k.value=="string"&&await C();const ee=await Ep();if(Yt.value=await ee.deviceManager.getCamera(En.value),!Yt.value)throw new Error("Camera not found!");fe.value=Yt.value.createWebRTCSession({role:on.value,mode:kn.value,videoElement:nt.value,webrtcConnectTimeout:2e3}),fe.value.addEventListener("error",Ul),fe.value.addEventListener("reconnect",yr),fe.value.addEventListener("onModeChange",Vl),fe.value.addEventListener("onSourceChange",Hl),fe.value.addEventListener("onStreamProbe",Ql),fe.value.addEventListener("onFinishLoading",Kl),fe.value.addEventListener("onFirstFrame",Zl),fe.value.addEventListener("onLoadedData",Gl),Wl(!0)},Fp=()=>{var ee;if(kn.value==="auto"){const Ae=(ee=fe.value)!=null&&ee.currentMode?u(`components.player.streaming_mode_${fe.value.currentMode}`):u("components.player.streaming_mode_unknown");return`${u("components.player.streaming_mode_auto")}: ${Ae}`}else return kn.value.startsWith("webrtc")?u("components.player.streaming_mode_webrtc"):kn.value==="mse"?u("components.player.streaming_mode_mse"):u("components.player.streaming_mode_unknown")},Lp=()=>{var ee;if(on.value==="auto"){const Ae=(ee=fe.value)!=null&&ee.currentResolution?u(`components.player.source_role_${fe.value.currentResolution.split("-")[0]}`):u("components.player.source_role_unknown");return`${u("components.player.source_role_auto")}: ${Ae}`}else return on.value==="high-resolution"?u("components.player.source_role_high"):on.value==="mid-resolution"?u("components.player.source_role_mid"):on.value==="low-resolution"?u("components.player.source_role_low"):u("components.player.source_role_unknown")},Bl=ee=>{if(!nt.value||!zt.value||!T.value){os.value={x:0,y:0},As.value=1;return}const Ae=zt.value.getBoundingClientRect(),St=nt.value.getBoundingClientRect(),gs=Math.max(0,(St.width-Ae.width)/2),ss=Math.max(0,(St.height-Ae.height)/2),br=Math.max(-gs,Math.min(gs,ee.pan.x)),wr=Math.max(-ss,Math.min(ss,ee.pan.y));(ee.pan.x!==br||ee.pan.y!==wr)&&(os.value={x:br,y:wr});const Kr=1,Xt=Ih-1;ee.zoom>Xt?ee.type==="dblClick"?Zs(()=>{As.value=Kr}):Zs(()=>{As.value=Xt}):ee.zoom===1&&setTimeout(()=>{os.value={x:0,y:0}},10)},zl=()=>{z.value&&!rt.value&&d("expand")},Ul=ee=>{console.error(En.value,ee),de.value="error",ie.value=!1,Le.value=!1},yr=()=>{de.value="reconnecting",ie.value=!1,Le.value=!0},Vl=()=>{de.value=fe.value.currentMode,Le.value=!1,ie.value=!1},Hl=()=>{de.value="adapting",Kt.value=!0},Ql=()=>{de.value=fe.value.currentMode,Tt.value=fe.value.hasBackchannel,he.value=fe.value.hasAudio},Kl=()=>{de.value=fe.value.currentMode,Le.value=!1},Zl=()=>{de.value=fe.value.currentMode,ie.value=!0,Kt.value=!1},Gl=()=>{de.value=fe.value.currentMode,ie.value=!0,Kt.value=!1},Wl=ee=>{var Ae,St,gs,ss;clearTimeout(Ne),h.value==="always-on"?(rt.value=!1,(Ae=fe.value)!=null&&Ae.finishLoading||(ee||yr(),(St=fe.value)==null||St.start())):h.value==="standby"?rt.value||(ft(),(gs=fe.value)!=null&&gs.finishLoading||(yr(),(ss=fe.value)==null||ss.start())):h.value==="activity"&&(ps.value||(rt.value=!0,Hr()))},Jl=ee=>{var Ae,St;h.value==="activity"&&(!!(ee!=null&&ee.length&&ee.some(ss=>Ce.value.includes(ss.label)))?(ps.value=!0,clearTimeout(Ne),(rt.value||!((Ae=fe.value)!=null&&Ae.finishLoading))&&(rt.value=!1,yr(),(St=fe.value)==null||St.start())):(clearTimeout(Ne),Ne=setTimeout(()=>{ps.value||(rt.value=!0,Hr())},Oh),ps.value=!1))},jp=()=>{var ee;rt.value&&(rt.value=!1,yr(),(ee=fe.value)==null||ee.start(),h.value==="standby"?ft():h.value==="activity"&&(clearTimeout(Ne),ps.value||(Ne=setTimeout(()=>{rt.value=!0,Hr()},Oh))))},Hr=()=>{var ee;(ee=fe.value)==null||ee.close(),ie.value=!1},Yl=()=>{var ee;if(nt.value){const Ae=document.createElement("canvas");Ae.width=nt.value.videoWidth,Ae.height=nt.value.videoHeight,(ee=Ae.getContext("2d"))==null||ee.drawImage(nt.value,0,0,Ae.width,Ae.height);const St=Ae.toDataURL("image/png"),gs=`${En.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,ss=document.createElement("a");ss.setAttribute("download",gs),ss.href=St,document.body.appendChild(ss),ss.click(),ss.remove()}},qp=()=>{var ee,Ae;(ee=pt.value)==null||ee.clear(),(Ae=Jt.value)==null||Ae.clear()},Xl=(ee,Ae)=>{var St,gs;ie.value&&(ee==="motion"?(St=pt.value)==null||St.draw(Ae):ee==="object"&&((gs=Jt.value)==null||gs.draw(Ae)))},Co=async()=>{if(nt.value)try{await nt.value.play()}catch(ee){if(nt.value&&!nt.value.muted)return nt.value.muted=!0,Co();console.warn(En.value,ee)}},Dp=()=>{if(nt.value&&de.value==="mse"&&!Le.value&&ie.value&&nt.value.buffered.length>0){const ee=nt.value.buffered.end(nt.value.buffered.length-1);ee-nt.value.currentTime>1&&(nt.value.currentTime=ee)}},Qr=ee=>{const Ae=Ce.value.indexOf(ee);Ae>-1?Ce.value.splice(Ae,1):Ce.value.push(ee)},eu=ee=>{ee=ee??!te.value,te.value=ee},tu=ee=>{st.value=ee!==void 0?ee:!st.value},qa=async(ee,Ae=!1)=>{var St,gs;if((St=fe.value)!=null&&St.currentMode.includes("webrtc"))if(Ot.value=ee!==void 0?ee:!Ot.value,Ot.value)try{_t.value=await navigator.mediaDevices.getUserMedia({audio:!0});const ss=_t.value.getAudioTracks()[0];st.value=!Ae,await fe.value.toggleMicrophone(ss)}catch(ss){console.warn(En.value,ss)}else(gs=_t.value)==null||gs.getTracks().forEach(ss=>ss.stop()),_t.value=void 0,await fe.value.toggleMicrophone(null)},su=ee=>{h.value=ee||(h.value==="always-on"?"standby":h.value==="standby"?"activity":"always-on")},nu=async ee=>{var St;let Ae=on.value;Ae=ee||(Ae==="auto"?"low-resolution":Ae==="low-resolution"?"mid-resolution":Ae==="mid-resolution"?"high-resolution":"auto"),await((St=fe.value)==null?void 0:St.toggleRole(Ae)),v.value=Ae},ru=async ee=>{var St;let Ae=kn.value;Ae=ee||(Ae==="auto"?"webrtc":Ae==="webrtc"?"mse":"auto"),await((St=fe.value)==null?void 0:St.toggleMode(Ae)),f.value=Ae},iu=()=>{var ee;document.pictureInPictureElement?document.exitPictureInPicture():document.pictureInPictureEnabled&&((ee=nt.value)==null||ee.requestPictureInPicture())},ou=()=>{nt.value&&(ke.value?(Zt.value=!0,nt.value.pause()):Co())},au=()=>{o.value?le():Pe.value=!Pe.value},cu=()=>{Ms.value=!Ms.value},lu=()=>{ds.value=!ds.value},uu=()=>{fs.value=!fs.value},du=()=>{R.value=!R.value},hu=()=>{},mu=()=>{},Bp=ee=>{Ye.value=ee};return el(()=>{typeof k.value=="string"&&n.toggleQueryActivator("getCameraQuery",!0)}),Sn(async()=>{try{await Np(),setTimeout(()=>{ve.value=!1},1500)}catch(ee){console.error(ee)}}),Ma(()=>{var ee,Ae,St,gs,ss,br,wr,Kr,Xt;clearTimeout(Ne),(ee=fe.value)==null||ee.removeEventListener("error",Ul),(Ae=fe.value)==null||Ae.removeEventListener("reconnect",yr),(St=fe.value)==null||St.removeEventListener("onModeChange",Vl),(gs=fe.value)==null||gs.removeEventListener("onSourceChange",Hl),(ss=fe.value)==null||ss.removeEventListener("onStreamProbe",Ql),(br=fe.value)==null||br.removeEventListener("onFinishLoading",Kl),(wr=fe.value)==null||wr.removeEventListener("onFirstFrame",Zl),(Kr=fe.value)==null||Kr.removeEventListener("onLoadedData",Gl),Hr(),(Xt=Yt.value)==null||Xt.close()}),e({togglePlay:ou,toggleSourceRole:nu,togglePictureInPicture:iu,toggleActivityMode:su,toggleAddingShortcuts:uu,toggleStreamingMode:ru,toggleFs:au,toggleMute:tu,toggleMicrophone:qa,toggleShortcuts:cu,togglePtz:lu,toggleFastForward:mu,toggleRewind:hu,toggleZones:eu,toggleDetectionClass:Qr,toggleTimeline:du,timelineScroll:Bp,captureScreenshot:Yl}),(ee,Ae)=>{const St=yx,gs=Lr,ss=gx,br=mx,wr=ux,Kr=ax,Xt=ys,zp=rx,Up=tx,Vp=Y8,Hp=G8,Qp=Q8,Kp=U8,Zp=D8,Gp=L8,Wp=O8,Jp=T8,Yp=M8,Xp=k8,e0=x8,t0=y8,s0=g8,n0=m8,r0=u8,i0=a8,o0=r8,a0=t8,c0=Y6,l0=A6,pu=S6,u0=r6,d0=Fl,h0=t6,m0=Y4,p0=G4,f0=Q4,g0=U4,v0=D4,_0=Sp,y0=N4,b0=R4,w0=$4,x0=E4,S0=Vc,C0=Sa,k0=Dh,E0=fp,Js=jr;return m(),A("div",null,[y(k0,{class:"cui-card",pt:c(Rp)},{content:$(()=>{var fu;return[g("div",{id:"video-container",ref_key:"playerContainerRef",ref:zt,class:"bg-black flex items-center justify-center relative",onClick:jp},[y(K0,{name:"fade",tag:"div",class:"w-full relative",style:ot({aspectRatio:c(ql)})},{default:$(()=>{var ko,gu;return[c(rt)?(m(),A("div",wx,[g("div",xx,[y(St,{class:"text-white w-[50px] h-[50px]"}),c(Me).width.value>=350?(m(),A("p",Sx,me(ee.$t("components.player.stream_paused")),1)):ce("",!0)])])):ce("",!0),c(mt)&&!c(rt)?(m(),A("div",Cx,[y(gs,{class:"w-[30px] h-[30px] m-0","stroke-width":"5"}),c(Le)?(m(),A("span",kx,me(ee.$t("components.player.reconnecting"))+"...",1)):ce("",!0)])):ce("",!0),!c(rt)&&(c(jl)||c(N))?(m(),A("div",Ex,[c(N)?(m(),A("div",{key:0,class:at(["w-[10px] h-[10px] rounded-full shadow-md",{"bg-red-500":c(ie),"bg-gray-500":!c(ie)}])},null,2)):ce("",!0),c(jl)?(m(),A("span",Ax,me(c(En)),1)):ce("",!0)])):ce("",!0),c(Pp)?(m(),A("div",{key:"subcontrol",class:"absolute top-4 right-4 cui-rounded-corner overflow-hidden bg-black/60 flex flex-row items-center justify-center shadow-md z-6 dark-mode",style:ot({top:c(Op),height:c(Ws)})},[c(q)&&!c(ds)?Pt((m(),j(Xt,{key:0,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[0]||(Ae[0]=Ln=>nu())},{icon:$(()=>[c(on)==="auto"?(m(),j(ss,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):c(on)==="low-resolution"?(m(),j(br,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):c(on)==="mid-resolution"?(m(),j(wr,{key:2,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Kr,{key:3,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Lp()},void 0,{top:!0}]]):ce("",!0),c(H)&&!c(ds)?Pt((m(),j(Xt,{key:1,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[1]||(Ae[1]=Ln=>su())},{icon:$(()=>[h.value==="always-on"?(m(),j(zp,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):h.value==="standby"?(m(),j(Up,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Vp,{key:2,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:h.value==="always-on"?ee.$t("components.player.activity_mode_always_on"):h.value==="standby"?ee.$t("components.player.activity_mode_standby"):ee.$t("components.player.activity_mode_activity")},void 0,{top:!0}]]):ce("",!0),c(oe)&&!c(ds)?Pt((m(),j(Xt,{key:2,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[2]||(Ae[2]=Ln=>ru())},{icon:$(()=>[c(kn)==="auto"?(m(),j(Hp,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):c(kn)==="mse"?(m(),j(Qp,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Kp,{key:2,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Fp()},void 0,{top:!0}]]):ce("",!0),c(ds)&&c(X)&&c(Me).width.value>=350?Pt((m(),j(Xt,{key:3,disabled:c(mt)||((ko=c(wt))==null?void 0:ko.isLoading),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[3]||(Ae[3]=Ln=>{var vu;return(vu=c(wt))==null?void 0:vu.goToHome()})},{icon:$(()=>[y(Zp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz_go_to_home")},void 0,{top:!0}]]):ce("",!0),c(J)&&c(Me).width.value>=350&&c(X)?Pt((m(),j(Xt,{key:4,disabled:c(mt)||c(R),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:lu},{icon:$(()=>[y(Gp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz")},void 0,{top:!0}]]):ce("",!0)],4)):ce("",!0),c($p)&&!c(R)&&!c(Oi)?(m(),A("div",{key:"control",class:"absolute left-[50%] -translate-x-[50%] cui-rounded-corner overflow-hidden bg-black/60 flex flex-row items-center justify-center shadow-md z-6 dark-mode",style:ot({bottom:c(Ip),height:c(Ws)})},[c(W)?(m(),j(Xt,{key:0,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",onClick:hu},{icon:$(()=>[y(Wp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1})):ce("",!0),c(B)?(m(),j(Xt,{key:1,disabled:c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:ou},{icon:$(()=>[c(ke)?(m(),j(Yp,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(Jp,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(O)?(m(),j(Xt,{key:2,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:mu},{icon:$(()=>[y(Xp,{width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])]),_:1},8,["style"])):ce("",!0),c(I)?(m(),j(Xt,{key:3,disabled:!c(ls)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[4]||(Ae[4]=Ln=>tu())},{icon:$(()=>[c(st)?(m(),j(t0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(e0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(S)?(m(),j(Xt,{key:4,disabled:!c(bs)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:Ae[5]||(Ae[5]=Ln=>qa(void 0,!0))},{icon:$(()=>[c(Ot)?(m(),j(s0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(n0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(M)?(m(),j(Xt,{key:5,disabled:!c(l)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:iu},{icon:$(()=>[c(Ht)?(m(),j(i0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(r0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0),c(U)?(m(),j(Xt,{key:6,disabled:!c(o)||c(mt),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:au},{icon:$(()=>[c(Pe)?(m(),j(a0,{key:1,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"])):(m(),j(o0,{key:0,width:`${c(ct)}px`,height:`${c(ct)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ce("",!0)],4)):ce("",!0),Pt(g("div",Mx,null,512),[[Pr,c(R)&&!c(Oi)&&!c(rt)]]),c(Oi)&&!c(R)&&!c(rt)&&c(Yt)?(m(),A("div",$x,[y(c0,{ref_key:"ptzRef",ref:wt,"camera-device":c(Yt)},null,8,["camera-device"])])):ce("",!0),(c(Ms)||c(fs))&&!c(rt)?(m(),j(l0,{key:6,"camera-name":c(En),"adding-shortcuts":c(fs),class:"z-4 pointer-events-none"},null,8,["camera-name","adding-shortcuts"])):ce("",!0),c(_e)&&!c(rt)?(m(),j(pu,{key:7,ref_key:"motionDetectionCanvasRef",ref:pt,classes:c(Ce),class:"z-3 pointer-events-none"},null,8,["classes"])):ce("",!0),c(ye)&&!c(rt)?(m(),j(pu,{key:8,ref_key:"objectDetectionCanvasRef",ref:Jt,classes:c(Ce),class:"z-3 pointer-events-none"},null,8,["classes"])):ce("",!0),c(te)&&!c(rt)?(m(),j(u0,{key:9,"camera-zones":((gu=c(Be))==null?void 0:gu.detectionZones)??[],class:"z-2 pointer-events-none"},null,8,["camera-zones"])):ce("",!0),Pt(y(d0,{key:"snapshot",ref_key:"snapshotRef",ref:ze,"camera-name":c(En),"show-loading-screen":!1,class:at(["object-contain absolute cursor-[inherit] z-1",{"cursor-pointer":c(z)}]),"image-container-class":"w-full h-full",onClick:zl},null,8,["camera-name","class"]),[[Pr,(!c(ie)||c(rt)||c(Kt))&&!c(Ht)]]),y(c(Ef),{key:"zoomable",pan:c(os),"onUpdate:pan":Ae[6]||(Ae[6]=Ln=>us(os)?os.value=Ln:null),zoom:c(As),"onUpdate:zoom":Ae[7]||(Ae[7]=Ln=>us(As)?As.value=Ln:null),disabled:!c(Z)||c(R)||c(Oi)||c(rt),"enable-control-button":!1,"dbl-click-enabled":!1,"min-zoom":1,"max-zoom":Ih,selector:c(Z)?`[data-player-id='${c(Oe)}']`:"disabled","zoom-origin":"pointer",class:"h-full w-full items-center justfiy-center",onPanned:Bl,onZoom:Bl},{default:$(()=>[g("video",{ref_key:"videoPlayerRef",ref:nt,"data-player-id":c(Oe),playsinline:"",autoplay:"",preload:"auto",muted:c(st),class:at(["w-full cursor-[inherit] object-fill",{"cursor-pointer":c(z),"object-contain":c(Pe)}]),style:ot({aspectRatio:c(ql)}),onClick:zl},null,14,Px)]),_:1},8,["pan","zoom","disabled","selector"])]}),_:1},8,["style"])],512),c(ue)?(m(),A("div",{key:0,class:at(["relative w-full h-[60px] camera-toolbar-background border-t-[1px] border-color flex items-center justify-between py-2 px-4 gap-1 z-1",c(Se)]),style:ot([c(ht)])},[g("div",Tx,[c(Ii)?(m(),j(gs,{key:0,"stroke-width":"5",class:"w-[10px] h-[10px]"})):(m(),A("div",Rx)),g("span",Ix,me(c(En)),1)]),Ae[10]||(Ae[10]=g("div",{class:"ml-auto"},null,-1)),c(Y)?Pt((m(),j(Xt,{key:0,fluid:"",text:"",severity:"contrast",class:"cui-icon-lg not-hover:text-surface-400"},{icon:$(()=>[y(h0,{width:"100%",height:"100%"})]),_:1})),[[Js,{value:ee.$t("components.player.share_camera")},void 0,{top:!0}]]):ce("",!0),c(He)?Pt((m(),j(Xt,{key:1,fluid:"",text:"",severity:"contrast",class:"cui-icon-lg not-hover:text-surface-400",onClick:Yl},{icon:$(()=>[y(m0,{width:"100%",height:"100%"})]),_:1})),[[Js,{value:ee.$t("components.player.capture_snapshot")},void 0,{top:!0}]]):ce("",!0),c(Qe)?Pt((m(),j(Xt,{key:2,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(te)}]),onClick:Ae[8]||(Ae[8]=ko=>eu())},{icon:$(()=>[c(te)?(m(),j(f0,{key:1,width:"100%",height:"100%"})):(m(),j(p0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(te)?ee.$t("components.player.hide_zones"):ee.$t("components.player.show_zones")},void 0,{top:!0}]]):ce("",!0),c(F)&&(c(_e)||c(ye))?Pt((m(),j(Xt,{key:3,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(Ce).length}]),onClick:(fu=c(ge))==null?void 0:fu.toggleMenu},{icon:$(()=>[y(g0,{width:"100%",height:"100%"})]),_:1},8,["class","onClick"])),[[Js,{value:ee.$t("components.player.detections")},void 0,{top:!0}]]):ce("",!0),c(Te)?Pt((m(),j(Xt,{key:4,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(Ms)||c(fs)}]),onClick:cu},{icon:$(()=>[!c(Ms)&&!c(fs)?(m(),j(v0,{key:0,width:"100%",height:"100%"})):(m(),j(_0,{key:1,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(Ms)?ee.$t("components.player.hide_shortcuts"):ee.$t("components.player.show_shortcuts")},void 0,{top:!0}]]):ce("",!0),c(Te)?Pt((m(),j(Xt,{key:5,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(fs)}]),onClick:uu},{icon:$(()=>[c(fs)?(m(),j(b0,{key:1,width:"100%",height:"100%"})):(m(),j(y0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(fs)?ee.$t("components.player.save_shortcuts"):ee.$t("components.player.add_shortcuts")},void 0,{top:!0}]]):ce("",!0),c(Mt)?Pt((m(),j(Xt,{key:6,disabled:c(Oi),fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(R)}]),onClick:du},{icon:$(()=>[c(R)?(m(),j(x0,{key:1,width:"100%",height:"100%"})):(m(),j(w0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["disabled","class"])),[[Js,{value:c(R)?ee.$t("components.player.hide_timeline"):ee.$t("components.player.show_timeline")},void 0,{top:!0}]]):ce("",!0),c(D)&&("useCuiPermission"in ee?ee.useCuiPermission:c(Si))(void 0,"admin")?Pt((m(),j(Xt,{key:7,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(r).isOpen.value}]),onClick:Ae[9]||(Ae[9]=ko=>c(r).open({cameraName:c(En)}))},{icon:$(()=>[c(r).isOpen.value?(m(),j(C0,{key:1,width:"100%",height:"100%"})):(m(),j(S0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:ee.$t("components.player.settings")},void 0,{top:!0}]]):ce("",!0)],6)):ce("",!0)]}),_:1},8,["pt"]),y(E0,{ref_key:"menuRef",ref:ge,items:c(Tp),"sort-list":"","auto-hide":!1},null,8,["items"])])}}}),Ap=qs(Lx,[["__scopeId","data-v-d1d904d2"]]),jx=al({protocol:Xm,url:Wh().trim().min(1,"Camera Source is required").array().nonempty("Camera Source is required")}).strict(),qx=al({name:Wh().trim().min(1,"Camera Source Name is required"),urls:jx.array(),role:Ml,useForSnapshot:Cu().default(!1),hotMode:Cu().default(!1)}).strict(),Dx=al({...M2.innerType().shape,sources:qx.array().refine(s=>s.some(e=>e.role==="high-resolution"||e.role==="mid-resolution"||e.role==="low-resolution"),{path:["sources[].role"],message:'One of the roles "high-resolution", "mid-resolution" or "low-resolution" is required'}).refine(s=>s.filter(t=>t.useForSnapshot).length<=1,{message:"Only one source can be used for snapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.useForSnapshot),{message:"Snapshot source can not be used with useForSnapshot",path:["sources"]}).refine(s=>s.filter(t=>t.role==="snapshot").every(t=>!t.hotMode),{message:"Snapshot source can not be used with hotMode"})}).strict(),_9=Wn(Dx),y9=Wn(E2),Bx=Wn($2),zx=Wn(Al),Ux={class:"w-full h-full relative"},Vx={class:"flex flex-col justify-center items-center"},Hx={class:"relative w-full"},Qx={class:"w-full flex flex-col items-center justify-center gap-6"},Kx={class:"relative w-full flex flex-col items-center justify-center"},Zx={class:"absolute top-0 left-0 right-0 bottom-0"},Gx={class:"playground-container flex w-full h-full"},Wx={class:"sandbox w-full h-full"},Jx={class:"handles"},Yx=["data-id","data-point","data-point-index","data-zone-index","onDblclick"],Xx={class:"clipboard"},eS={width:"100%",height:"100%",class:"polygon-container"},tS=["d","onClick","onDblclick","onMousedown","onTouchstart"],sS={class:"flex flex-col gap-6 zone-buttons justify-center items-center"},nS=["for"],rS=["for"],iS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},oS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},aS=At({__name:"ZoneEditor",props:{cameraName:{},zones:{}},setup(s,{expose:e}){const t=new Jn,n=Cn(),{t:r}=js(),i=s,o=mi("dialogRefProps"),{cameraName:a,zones:l}=Wt(i),u=Vt("draggablesRef"),d=Vt("outsideRef"),h=Vt("playerRef"),v=Ls([]),f=ae([]),b=ae(!1),k=ae([]),z=ae(void 0),L=ae(-1),se=ae(-1),K=ae(["animal","vehicle","person","other","motion"]);let N=!1;const E={x:0,y:0},O=rl(h);nl(d,V=>{const X=V.target,_e=X.closest(".polygon"),ye=X.closest(".edit-button"),fe=X.closest(".remove-button"),_t=X.closest(".handle"),Tt=X.closest(".zone-buttons"),he=X.closest(".p-multiselect-list"),ie=X.closest(".p-colorpicker-panel");!_e&&!ye&&!fe&&!_t&&!b.value&&!Tt&&!he&&!ie&&(L.value=-1)});const{mutateAsync:U,isPending:S}=t.patchZonesQuery(),M=ne(()=>{var V;return!!((V=o.loading)!=null&&V.value||S.value)}),B=ne(()=>{var X;const V=[];return b.value&&V.push("customizing"),(X=f.value)!=null&&X.length||V.push("start"),V.join(" ")});Ge(se,()=>{se.value=-1}),Ge(L,(V,X)=>{var _e,ye;if(V===-1&&((_e=f.value)!=null&&_e.length)&&f.value[X]){L.value=X;return}V===-1&&((ye=f.value)!=null&&ye.length)&&(se.value=0)}),Ge(l,()=>{f.value=xi(l.value),W()},{deep:!0,immediate:!0});function W(){if(f.value){if(f.value.length===0){k.value=[];return}k.value=f.value.flatMap((V,X)=>V.points.map((_e,ye)=>({_id:`${V.name}-${ye}`,zoneIndex:X,pointIndex:ye,point:[_e[0],_e[1]]})))}}Ge([O.width,O.height],()=>{Jt()});const I=V=>{if("touches"in V){const X=V.touches[0];return{x:X.clientX,y:X.clientY}}return{x:V.clientX,y:V.clientY}},w=(V,X)=>{if(V.stopPropagation(),!h.value)return;Te(b.value),N=!0,L.value=X;const _e=h.value.getBoundingClientRect(),{x:ye,y:fe}=I(V);E.x=(ye-_e.left)/_e.width*100,E.y=(fe-_e.top)/_e.height*100},H=V=>{if(!N||!h.value||L.value===-1||!f.value.length)return;const X=h.value.getBoundingClientRect(),{x:_e,y:ye}=I(V),fe=(_e-X.left)/X.width*100,_t=(ye-X.top)/X.height*100,Tt=fe-E.x,he=_t-E.y,ie=f.value[L.value].points;let de=!1;for(let Le=0;Le<ie.length;Le++){const rt=ie[Le][0]+Tt,Kt=ie[Le][1]+he;if(rt<0||rt>100||Kt<0||Kt>100){de=!0;break}}if(!de)for(let Le=0;Le<ie.length;Le++){ie[Le][0]+=Tt,ie[Le][1]+=he,ie[Le][0]=Math.max(0,Math.min(100,ie[Le][0])),ie[Le][1]=Math.max(0,Math.min(100,ie[Le][1]));const rt=ie[Le][0]/100*X.width,Kt=ie[Le][1]/100*X.height,ps=v.value.find(Zt=>Zt.id===`${f.value[L.value].name}-${Le}`);ps==null||ps.setPosition(rt,Kt)}E.x=fe,E.y=_t},J=()=>{setTimeout(()=>{N=!1},100)},q=()=>{!f.value.length||L.value===-1||(f.value[L.value].isPrivacyMask=!f.value[L.value].isPrivacyMask)},oe=()=>{f.value[L.value]&&(f.value[L.value].filter=f.value[L.value].filter==="include"?"exclude":"include")},ue=()=>{f.value[L.value]&&(f.value[L.value].type=f.value[L.value].type==="intersect"?"contain":"intersect")},Se=V=>{if(!b.value||N)return;const X=z.value!==void 0?z.value:f.value.length,_e=Math.min(Math.max(Math.round((V.offsetX-10)/O.width.value*100),0),100),ye=Math.min(Math.max(Math.round((V.offsetY-10)/O.height.value*100),0),100);if(z.value===void 0){const fe=`zone-${Date.now()}`;f.value.push({name:fe,points:[],filter:"include",type:"contain",classes:["animal","motion","person","vehicle"],isPrivacyMask:!1,color:ze()}),z.value=f.value.length-1}f.value[X].points.push([_e,ye]),W(),Zs(()=>{const fe=f.value[X].points.length-1;F({_id:`${f.value[X].name}-${fe}`,zoneIndex:X,pointIndex:fe,point:[_e,ye]})})},F=V=>{var _e;if(V.zoneIndex===void 0||V.pointIndex===void 0)return;const X=(_e=u.value)==null?void 0:_e.filter(ye=>ye.dataset.pointIndex===V.pointIndex.toString()&&ye.dataset.zoneIndex===V.zoneIndex.toString());!X||X.length===0||nt(X[0],V.point)},D=V=>{if(!f.value.length)return;const X=Math.round(V.point[0]/O.width.value*100),_e=Math.round(V.point[1]/O.height.value*100);f.value[V.zoneIndex].points[V.pointIndex]=[X,_e]},Y=()=>{b.value=!0,z.value=void 0},Te=V=>{var _e;if(z.value===void 0){b.value=!1;return}b.value=V||!1;const X=z.value;!f.value[X]||!f.value[X].points||(f.value[X].points.length<3?(f.value.splice(X,1),W()):((_e=u.value)==null||_e.forEach(ye=>Be(ye)),L.value=X),z.value=void 0)},He=()=>{b.value=!0,z.value=L.value},ht=()=>{L.value===-1||!f.value.length||(f.value.splice(L.value,1),L.value=Math.max(-1,L.value-1),W(),Zs(()=>{Jt()}))},Mt=()=>{var V;if((V=f.value)!=null&&V.length){if(b.value&&z.value!==void 0){const X=f.value[z.value];X.points.length&&(X.points.pop(),X.points.length===0&&(f.value.splice(z.value,1),z.value=void 0),W());return}f.value.length>0&&(f.value.pop(),W(),Zs(()=>{Jt()}))}},Qe=()=>{N=!1,b.value=!1,z.value=void 0,f.value&&(f.value.length=0,k.value=[],Zs(()=>{wt()}))},ze=()=>{const V=Math.floor(Math.random()*256),X=Math.floor(Math.random()*256),_e=Math.floor(Math.random()*256);return"#"+[V,X,_e].map(ye=>ye.toString(16).padStart(2,"0")).join("")},ge=V=>{if(!V||!V.length)return"";const X=V.map(ye=>{const fe=Math.round(ye[0]/100*O.width.value),_t=Math.round(ye[1]/100*O.height.value);return`${fe+10},${_t+10}`});if(X.length===0)return"";let _e=`M ${X[0]}`;for(let ye=1;ye<X.length;ye++)_e+=` L ${X[ye]}`;return _e+=" Z",_e},pt=V=>{b.value||(L.value=V)},Jt=()=>{var V;wt(),(V=u.value)==null||V.forEach(X=>{if(!X.dataset.zoneIndex||!X.dataset.pointIndex)return;const _e=parseInt(X.dataset.zoneIndex),ye=parseInt(X.dataset.pointIndex);if(!f.value[_e]||!f.value[_e].points[ye])return;const fe=f.value[_e].points[ye];fe&&(nt(X,fe),Be(X))})},wt=()=>{v.value.forEach(V=>V.destroy()),v.value=[]},zt=V=>{!f.value.length||!f.value[V.zoneIndex]||f.value[V.zoneIndex].points.length<4||(f.value[V.zoneIndex].points.splice(V.pointIndex,1),W(),Zs(()=>{Jt()}))},nt=(V,X)=>{Object.assign(V.style,Yt(X))},Yt=V=>({left:Math.round(V[0]/100*O.width.value)+"px",top:Math.round(V[1]/100*O.height.value)+"px"}),Be=V=>{V.classList.add("draggable");const X=new Jh(V,{containment:!0,grid:[0,0]}).on("pointerDown",()=>{var _e;(_e=document.querySelectorAll(`[data-point="${V.dataset.zoneIndex}-${V.dataset.pointIndex}"]`)[0])==null||_e.classList.add("changing")}).on("dragMove",()=>{if(!V.dataset.zoneIndex||!V.dataset.pointIndex||!V.dataset.id)return;const _e=X.position.x,ye=X.position.y;D({_id:V.dataset.id,point:[_e,ye],pointIndex:parseInt(V.dataset.pointIndex),zoneIndex:parseInt(V.dataset.zoneIndex)})}).on("pointerUp",()=>{document.querySelectorAll(".point").forEach(_e=>_e.classList.remove("changing"))});X.id=V.dataset.id,v.value.push(X)},Ue=async()=>{if(f.value.length)try{const V=await zx.parse(f.value);if(!V.value)return n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",V.errors),null;await U({cameraname:a.value,zoneData:f.value})}catch(V){return console.error("Error saving zones:",V),n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.save_failed"),life:3e3}),null}};return Sn(async()=>{var V;setTimeout(()=>{Jt()}),(V=f.value)!=null&&V.length&&(L.value=0)}),e({isLoading:M,onConfirm:Ue}),(V,X)=>{var ve,ke,st,Ot,Ht,Ye,Ce,Oe,Ne;const _e=Ap,ye=qh,fe=go,_t=ki,Tt=O0,he=Aa,ie=S4,de=ys,Le=vp,rt=b4,Kt=v4,ps=p4,Zt=d4,os=c4,As=i4,fs=s4,Ms=X3,ds=W3,R=K3,te=jr;return m(),A("div",Ux,[g("div",Vx,[g("div",Hx,[g("div",{ref_key:"outsideRef",ref:d},null,512),g("div",Qx,[g("div",Kx,[g("div",Zx,[g("div",Gx,[g("section",{class:at(["playground w-full h-full",c(B)]),onClick:Se},[g("div",Wx,[g("div",Jx,[(m(!0),A(yt,null,qt(c(k),be=>(m(),A("div",{key:be._id,ref_for:!0,ref_key:"draggablesRef",ref:u,class:"handle","data-id":be._id,"data-point":`${be.zoneIndex}-${be.pointIndex}`,"data-point-index":be.pointIndex,"data-zone-index":be.zoneIndex,onDblclick:lr(it=>zt(be),["prevent"])},X[3]||(X[3]=[g("div",{class:"delete-point"},null,-1)]),40,Yx))),128)),g("div",Xx,[(m(),A("svg",eS,[(m(!0),A(yt,null,qt(c(f),(be,it)=>(m(),A("path",{key:be.name,d:ge(be.points),class:at(["cursor-pointer",{dash:be.type==="intersect"&&!be.isPrivacyMask,selected:c(L)===it}]),style:ot({fill:be.isPrivacyMask?"rgba(16, 16, 16, 0.9)":be.filter==="exclude"?"transparent":`${be.color}4D`,stroke:be.isPrivacyMask?"#333333":be.color,"stroke-width":"2"}),onClick:_=>pt(it),onDblclick:()=>be.isPrivacyMask=!be.isPrivacyMask,onMousedown:_=>w(_,it),onMousemove:H,onMouseup:J,onTouchstart:_=>w(_,it),onTouchmove:H,onTouchend:J},null,46,tS))),128))]))])]),X[4]||(X[4]=g("div",{class:"shadowboard on"},null,-1))])],2)])]),g("div",{ref_key:"playerRef",ref:h,class:"w-full h-full flex flex-col items-center justify-center",style:{width:"calc(100% - 20px)","margin-top":"10px","margin-bottom":"10px"}},[y(_e,{"camera-info":c(a),"source-role":"low-resolution","streaming-mode":"webrtc",toolbar:!1,control:!1,subcontrol:!1,"flat-card":"",class:"w-full h-full border-[1px] border-color-inner"},null,8,["camera-info"])],512)]),g("div",sS,[y(c(Lt),{"model-value":(ve=c(f)[c(L)])==null?void 0:ve.classes,name:`zone[${c(L)}].classes`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:be,errors:it})=>[g("label",{for:`zone[${c(L)}].classes`,class:"cui-label"},me(V.$t("components.form.label.classes")),9,nS),y(fe,null,{default:$(()=>{var _,x;return[y(ye,et(be,{"model-value":(_=c(f)[c(L)])==null?void 0:_.classes,options:c(K),disabled:(x=c(f)[c(L)])==null?void 0:x.isPrivacyMask,invalid:it.length>0,loading:c(M),"max-selected-labels":2,"show-toggle-all":!1,"show-clear":"",type:"text",onValueChange:X[0]||(X[0]=C=>c(f)[c(L)].classes=C)}),null,16,["model-value","options","disabled","invalid","loading"])]}),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`zone[${c(L)}].classes`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),y(c(Lt),{"model-value":(ke=c(f)[c(L)])==null?void 0:ke.color,name:`zone[${c(L)}].color`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:be,errors:it})=>[g("label",{for:`zone[${c(L)}].color`,class:"cui-label"},me(V.$t("components.form.label.color")),9,rS),y(fe,null,{default:$(()=>{var _;return[y(_t,et(be,{disabled:(_=c(f)[c(L)])==null?void 0:_.isPrivacyMask,invalid:it.length>0,loading:c(M),readonly:"",type:"text"}),null,16,["disabled","invalid","loading"]),y(he,null,{default:$(()=>{var x,C;return[(m(),j(Tt,{key:c(L),"model-value":(x=c(f)[c(L)])==null?void 0:x.color,format:"hex",disabled:(C=c(f)[c(L)])==null?void 0:C.isPrivacyMask,onValueChange:X[1]||(X[1]=P=>P?c(f)[c(L)].color=`#${P}`:null)},null,8,["model-value","disabled"]))]}),_:1})]}),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`zone[${c(L)}].color`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),g("div",iS,[c(b)?Pt((m(),j(de,{key:1,disabled:c(z)!==void 0&&((Ot=(st=c(f)[c(z)])==null?void 0:st.points)==null?void 0:Ot.length)<3,loading:c(M),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:X[2]||(X[2]=be=>Te(!1))},{icon:$(()=>[y(Le,{width:"20px",height:"20px"})]),_:1},8,["disabled","loading"])),[[te,{value:V.$t("components.form.tooltip.finish")},void 0,{top:!0}]]):Pt((m(),j(de,{key:0,loading:c(M),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Y},{icon:$(()=>[y(ie,{width:"20px",height:"20px"})]),_:1},8,["loading"])),[[te,{value:V.$t("components.form.tooltip.new")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length||c(L)<0||c(b),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:He},{icon:$(()=>[y(rt,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.edit")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length||c(L)<0,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ht},{icon:$(()=>[y(Kt,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.delete")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Mt},{icon:$(()=>[y(ps,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.undo")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Qe},{icon:$(()=>[y(Zt,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[te,{value:V.$t("components.form.tooltip.clear")},void 0,{top:!0}]])]),g("div",oS,[Pt((m(),j(de,{loading:c(M),disabled:!(c(f).length&&c(L)>=0&&c(f)[c(L)]),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:q},{icon:$(()=>{var be;return[(be=c(f)[c(L)])!=null&&be.isPrivacyMask?(m(),j(os,{key:0,width:"20px",height:"20px"})):(m(),j(As,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[te,{value:(Ht=c(f)[c(L)])!=null&&Ht.isPrivacyMask?V.$t("components.form.tooltip.privacy_mask"):V.$t("components.form.tooltip.public_mask")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:(Ye=c(f)[c(L)])==null?void 0:Ye.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:oe},{icon:$(()=>{var be;return[((be=c(f)[c(L)])==null?void 0:be.filter)==="include"?(m(),j(fs,{key:0,width:"20px",height:"20px"})):(m(),j(Ms,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[te,{value:((Ce=c(f)[c(L)])==null?void 0:Ce.filter)==="include"?V.$t("components.form.tooltip.include"):V.$t("components.form.tooltip.exclude")},void 0,{top:!0}]]),Pt((m(),j(de,{loading:c(M),disabled:(Oe=c(f)[c(L)])==null?void 0:Oe.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ue},{icon:$(()=>{var be;return[((be=c(f)[c(L)])==null?void 0:be.type)==="intersect"?(m(),j(ds,{key:0,width:"20px",height:"20px"})):(m(),j(R,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[te,{value:((Ne=c(f)[c(L)])==null?void 0:Ne.type)==="intersect"?V.$t("components.form.tooltip.intersect"):V.$t("components.form.tooltip.contain")},void 0,{top:!0}]])])])])])])])}}}),cS=qs(aS,[["__scopeId","data-v-51a8517c"]]),lS={class:"text-color font-normal"},uS={class:"flex flex-col gap-6"},dS={for:"name",class:"cui-label"},hS={for:"type",class:"cui-label"},mS={class:"flex items-center gap-4"},pS={class:"flex flex-col field-switch-gap"},fS={for:"disabled",class:"cui-label-switch"},gS={class:"text-color font-normal"},vS={class:"flex flex-col gap-6"},_S={for:"info.manufacturer",class:"cui-label"},yS={for:"info.model",class:"cui-label"},bS={for:"info.hardware",class:"cui-label"},wS={for:"info.serialNumber",class:"cui-label"},xS={for:"info.firmwareVersion",class:"cui-label"},SS={for:"info.supportUrl",class:"cui-label"},CS={class:"text-color font-normal"},kS={class:"flex flex-col gap-6"},ES={for:"interface.streamingMode",class:"cui-label"},AS={for:"interface.streamingSource",class:"cui-label"},MS={for:"interface.aspectRatio",class:"cui-label"},$S={class:"text-color font-normal"},PS={class:"flex flex-col gap-6"},TS={for:"detectionSettings.motion.timeout",class:"cui-label"},RS={for:"detectionSettings.object.confidence",class:"cui-label"},IS={class:"text-color font-normal"},OS={class:"flex flex-col gap-6 w-full items-center justify-center"},NS={class:"text-color font-normal"},FS={class:"flex flex-col gap-6"},LS={for:"snapshotTTL",class:"cui-label"},jS={class:"text-color font-normal"},qS={class:"flex flex-col gap-6"},DS={for:"frameWorkerSettings.decoder",class:"cui-label"},BS={for:"frameWorkerSettings.resolution",class:"cui-label"},zS={for:"frameWorkerSettings.fps",class:"cui-label"},US=At({__name:"Settings",props:Kn({camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:Kn(["close"],["update:modelValue"]),setup(s,{emit:e}){const t=new Jn,n=$i(),r=qr(),i=Il(),{t:o}=js(),a=Rr(s,"modelValue"),l=e,u=s,{camera:d,loading:h}=Wt(u),v=ae(["camera","doorbell"]),f=ae(["auto","mse","webrtc","webrtc/tcp"]),b=ae(["auto","high-resolution","mid-resolution","low-resolution"]),k=ae(["16:9","8:3","4:3","auto"]),z=ae(["pillow","wasm","rust","gpu"]),L=ae(["640x480","640x360","320x240","320x180"]),{mutateAsync:se,isPending:K}=t.removeCameraQuery(),N=ne(()=>h.value||K.value),E=()=>{i.openTextDialog({data:{title:o("components.dialog.title.confirm"),confirmText:o("components.form.button.remove"),contentText:o("components.dialog.message.confirm_remove"),confirmButtonProps:{severity:"danger"}},onConfirm:async()=>{try{await se({cameraname:d.value.name}),n.path.includes(d.value.name)&&r.push({path:"/cameras"}),l("close")}catch{}}})},O=(U=[])=>{i.openComponentDialog(cS,{data:{title:o("components.zone_editor.edit_zones"),loading:N,contentProps:{cameraName:d.value.name,zones:U}}})};return(U,S)=>{const M=Jc,B=ki,W=go,I=Zc,w=Kc,H=fo,J=ys,q=Yc,oe=Wc,ue=jh,Se=Gc;return m(),j(Se,{multiple:"",class:"p-4"},{default:$(()=>[y(oe,{value:"general"},{default:$(()=>[y(M,{class:"px-0 pt-0"},{default:$(()=>[g("span",lS,me(U.$t("components.camera_options.general")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",uS,[y(c(Lt),{modelValue:a.value.name,"onUpdate:modelValue":S[0]||(S[0]=F=>a.value.name=F),modelModifiers:{trim:!0},name:"name",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",dS,me(U.$t("components.form.label.name")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"name",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{"model-value":a.value.type,name:"type",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",hS,me(U.$t("components.form.label.type")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.type,options:c(v),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[1]||(S[1]=Y=>a.value.type=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"type",class:"cui-input-error"})]),_:1})]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.disabled,value:!0,"unchecked-value":!1,type:"checkbox",name:"disabled",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("div",mS,[g("div",pS,[g("label",fS,me(U.$t("components.form.label.disabled")),1),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.disable_camera")),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"disabled",class:"cui-input-switch-error"})]),_:1})]),y(H,et({"model-value":a.value.disabled},F,{invalid:D.length>0,loading:c(N),class:"ml-auto shrink-0",onValueChange:S[2]||(S[2]=Y=>a.value.disabled=Y)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value"]),y(J,{fluid:"",severity:"danger",loading:c(N),class:"cui-button-medium",label:U.$t("components.form.button.remove"),onClick:S[3]||(S[3]=F=>E())},null,8,["loading","label"])])]),_:1})]),_:1}),y(oe,{value:"branding"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",gS,me(U.$t("components.camera_options.branding")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",vS,[y(c(Lt),{modelValue:a.value.info.manufacturer,"onUpdate:modelValue":S[4]||(S[4]=F=>a.value.info.manufacturer=F),modelModifiers:{trim:!0},name:"info.manufacturer",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",_S,me(U.$t("components.form.label.manufacturer")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.manufacturer",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.model,"onUpdate:modelValue":S[5]||(S[5]=F=>a.value.info.model=F),modelModifiers:{trim:!0},name:"info.model",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",yS,me(U.$t("components.form.label.model")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.model",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.hardware,"onUpdate:modelValue":S[6]||(S[6]=F=>a.value.info.hardware=F),modelModifiers:{trim:!0},name:"info.hardware",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",bS,me(U.$t("components.form.label.hardware_version")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.hardware",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.serialNumber,"onUpdate:modelValue":S[7]||(S[7]=F=>a.value.info.serialNumber=F),modelModifiers:{trim:!0},name:"info.serialNumber",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",wS,me(U.$t("components.form.label.serial_number")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.serialNumber",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.firmwareVersion,"onUpdate:modelValue":S[8]||(S[8]=F=>a.value.info.firmwareVersion=F),modelModifiers:{trim:!0},name:"info.firmwareVersion",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",xS,me(U.$t("components.form.label.firmware_version")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.firmwareVersion",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Lt),{modelValue:a.value.info.supportUrl,"onUpdate:modelValue":S[9]||(S[9]=F=>a.value.info.supportUrl=F),modelModifiers:{trim:!0},name:"info.supportUrl",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",SS,me(U.$t("components.form.label.support_url")),1),y(W,null,{default:$(()=>[y(B,et(F,{invalid:D.length>0,loading:c(N),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"info.supportUrl",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])])]),_:1})]),_:1}),y(oe,{value:"interface"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",CS,me(U.$t("components.camera_options.interface")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",kS,[y(c(Lt),{"model-value":a.value.interface.streamingMode,name:"interface.streamingMode",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",ES,me(U.$t("components.form.label.streaming_mode")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.interface.streamingMode,options:c(f),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[10]||(S[10]=Y=>a.value.interface.streamingMode=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"interface.streamingMode",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.streaming_mode")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.interface.streamingSource,name:"interface.streamingSource",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",AS,me(U.$t("components.form.label.streaming_source")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.interface.streamingSource,options:c(b),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[11]||(S[11]=Y=>a.value.interface.streamingSource=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"interface.streamingSource",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.streaming_source")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.interface.aspectRatio,name:"interface.aspectRatio",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",MS,me(U.$t("components.form.label.aspect_ratio")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.interface.aspectRatio,options:c(k),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[12]||(S[12]=Y=>a.value.interface.aspectRatio=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"interface.aspectRatio",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.aspect_ratio")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(oe,{value:"detection"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",$S,me(U.$t("components.camera_options.detection")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",PS,[y(c(Lt),{"model-value":a.value.detectionSettings.motion.timeout,name:"detectionSettings.motion.timeout",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",TS,me(U.$t("components.form.label.motion_duration")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.detectionSettings.motion.timeout},F,{invalid:D.length>0,loading:c(N),"show-buttons":"","use-grouping":!1,onValueChange:S[13]||(S[13]=Y=>a.value.detectionSettings.motion.timeout=Y),onInput:S[14]||(S[14]=Y=>a.value.detectionSettings.motion.timeout=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"detectionSettings.motion.timeout",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.motion_duration")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.detectionSettings.object.confidence,name:"detectionSettings.object.confidence",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",RS,me(U.$t("components.form.label.confidence")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.detectionSettings.object.confidence},F,{invalid:D.length>0,loading:c(N),"show-buttons":"",step:.01,max:1,mode:"decimal","use-grouping":!1,onValueChange:S[15]||(S[15]=Y=>a.value.detectionSettings.object.confidence=Y),onInput:S[16]||(S[16]=Y=>a.value.detectionSettings.object.confidence=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"detectionSettings.object.confidence",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.confidence")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(oe,{value:"zones"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",IS,me(U.$t("components.camera_options.zones")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",OS,[y(J,{fluid:"",class:"cui-button-medium",loading:c(N),label:U.$t("components.form.button.edit_zones"),onClick:S[17]||(S[17]=F=>O(c(d).detectionZones))},null,8,["loading","label"])])]),_:1})]),_:1}),y(oe,{value:"snapshot"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",NS,me(U.$t("components.camera_options.snapshot")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",FS,[y(c(Lt),{"model-value":a.value.snapshotTTL,name:"snapshotTTL",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",LS,me(U.$t("components.form.label.cache_time")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.snapshotTTL},F,{invalid:D.length>0,loading:c(N),"show-buttons":"","use-grouping":!1,onValueChange:S[18]||(S[18]=Y=>a.value.snapshotTTL=Y),onInput:S[19]||(S[19]=Y=>a.value.snapshotTTL=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"snapshotTTL",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.cache_time")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(oe,{value:"frameworker"},{default:$(()=>[y(M,{class:"px-0"},{default:$(()=>[g("span",jS,me(U.$t("components.camera_options.frame_worker")),1)]),_:1}),y(q,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",qS,[y(c(Lt),{"model-value":a.value.frameWorkerSettings.decoder,name:"frameWorkerSettings.decoder",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",DS,me(U.$t("components.form.label.decoder")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.frameWorkerSettings.decoder,options:c(z),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[20]||(S[20]=Y=>a.value.frameWorkerSettings.decoder=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"frameWorkerSettings.decoder",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.frameworker_decoder")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.frameWorkerSettings.resolution,name:"frameWorkerSettings.resolution",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",BS,me(U.$t("components.form.label.resolution")),1),y(W,null,{default:$(()=>[y(I,et(F,{"model-value":a.value.frameWorkerSettings.resolution,options:c(L),invalid:D.length>0,loading:c(N),type:"text",onValueChange:S[21]||(S[21]=Y=>a.value.frameWorkerSettings.resolution=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"frameWorkerSettings.resolution",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.frameworker_resolution")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Lt),{"model-value":a.value.frameWorkerSettings.fps,name:"frameWorkerSettings.fps",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:D})=>[g("label",zS,me(U.$t("components.form.label.fps")),1),y(W,null,{default:$(()=>[y(ue,et({"model-value":a.value.frameWorkerSettings.fps},F,{invalid:D.length>0,loading:c(N),min:0,"show-buttons":"","use-grouping":!1,onValueChange:S[22]||(S[22]=Y=>a.value.frameWorkerSettings.fps=Y),onInput:S[23]||(S[23]=Y=>a.value.frameWorkerSettings.fps=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:"frameWorkerSettings.fps",class:"cui-input-error"})]),_:1}),D.length?ce("",!0):(m(),j(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Qt(me(U.$t("components.form.hint.frameworker_fps")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})}}}),VS={class:"relative"},HS=At({__name:"CuiActionButton",props:{label:{},icon:{},buttonProps:{},tooltipProps:{},actionText:{},actionDuration:{default:1500}},emits:["action"],setup(s,{emit:e}){const t=s,n=e,{label:r,icon:i,buttonProps:o,actionText:a,actionDuration:l,tooltipProps:u}=Wt(t),d=Vt("buttonRef"),h=ae(!1),v=ri(d);let f;const b=ne(()=>({top:`${v.top.value}px`,left:`${v.left.value}px`,transform:"translate(-50%, -100%)",marginTop:"-8px"})),k=z=>{h.value=!1,clearTimeout(f),n("action",z),h.value=!0,f=setTimeout(()=>{h.value=!1},l.value)};return Ma(()=>{f&&clearTimeout(f)}),(z,L)=>{const se=ys;return m(),A("div",{ref_key:"buttonRef",ref:d,class:"relative"},[y(se,et(c(o),{label:c(r),onClick:k}),Hh({_:2},[c(i)?{name:"icon",fn:$(()=>[g("div",VS,[(m(),j(Ai(c(i))))])]),key:"0"}:void 0]),1040,["label"]),(m(),j(Qh,{to:"body"},[y(Et,{name:"fade"},{default:$(()=>[c(h)?(m(),j(se,et({key:0,as:"div"},c(u),{class:"fixed text-xs px-2 py-1 rounded whitespace-nowrap z-[99999] cursor-default pointer-events-none",style:c(b),label:c(a)}),null,16,["style","label"])):ce("",!0)]),_:1})]))],512)}}}),QS={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function KS(s,e){return m(),A("svg",QS,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 4.085V10.5a2.5 2.5 0 0 0 2.336 2.495L6.5 13h4.414A1.5 1.5 0 0 1 9.5 14H6a3 3 0 0 1-3-3V5.5a1.5 1.5 0 0 1 1-1.415M11.5 2A1.5 1.5 0 0 1 13 3.5v7a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 5 10.5v-7A1.5 1.5 0 0 1 6.5 2z"},null,-1)]))}const Nh=pe({name:"fluent-copy-16-filled",render:KS}),ZS={class:"flex flex-col field-gap"},GS={class:"cui-label"},WS={class:"cui-label"},JS={class:"cui-label"},YS={key:0,class:"flex flex-col field-gap"},XS={class:"cui-label"},e7={key:1,class:"flex flex-col field-gap"},t7={class:"cui-label"},s7=At({__name:"CameraSource",props:{cameraName:{},source:{},loading:{type:Boolean}},setup(s){const e=new Jn,t=s,{cameraName:n,source:r,loading:i}=Wt(t),{data:o,isFetching:a}=e.probeCameraSourceQuery(n.value,r.value.name,{video:!0,audio:!0,microphone:!0}),{copy:l}=af({legacy:!0}),u=ne(()=>!!(i.value||a.value)),d=ne(()=>{var f;return((f=o.value)==null?void 0:f.probe.consumers.filter(b=>b.format_name!=="probe").length)||0}),h=ne(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(L=>L.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(L=>L.codec.codec_type==="video");return(b==null?void 0:b.map(L=>L.codec.codec_name))||[]}),v=ne(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(L=>L.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(L=>L.codec.codec_type==="audio");return(b==null?void 0:b.map(L=>L.codec.codec_name))||[]});return(f,b)=>{const k=ki,z=go,L=HS,se=Aa;return m(),A(yt,null,[g("div",ZS,[g("label",GS,me(f.$t("components.form.label.connections")),1),y(z,null,{default:$(()=>[y(k,{value:c(d),loading:c(u),readonly:"",type:"text"},null,8,["value","loading"])]),_:1})]),(m(!0),A(yt,null,qt(c(h),(K,N)=>(m(),A("div",{key:N,class:"flex flex-col field-gap"},[g("label",WS,me(f.$t("components.form.label.video_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":K,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),(m(!0),A(yt,null,qt(c(v),(K,N)=>(m(),A("div",{key:N,class:"flex flex-col field-gap"},[g("label",JS,me(f.$t("components.form.label.audio_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":K,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),c(r).role!=="snapshot"?(m(),A("div",YS,[g("label",XS,me(f.$t("components.form.label.rtsp_url")),1),y(z,null,{default:$(()=>{var K;return[y(k,{"model-value":(K=c(o))==null?void 0:K.rtspUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(se,null,{default:$(()=>{var N;return[y(L,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Nh),"button-props":{severity:"secondary",disabled:!((N=c(o))!=null&&N.rtspUrl),loading:c(u),text:!0},onAction:b[0]||(b[0]=E=>c(l)(c(o).rtspUrl))},null,8,["action-text","icon","button-props"])]}),_:1})]}),_:1})])):ce("",!0),c(r).role!=="snapshot"?(m(),A("div",e7,[g("label",t7,me(f.$t("components.form.label.onvif_url")),1),y(z,null,{default:$(()=>{var K;return[y(k,{"model-value":(K=c(o))==null?void 0:K.onvifUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(se,null,{default:$(()=>{var N;return[y(L,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Nh),"button-props":{severity:"secondary",disabled:!((N=c(o))!=null&&N.onvifUrl),loading:c(u),text:!0},onAction:b[1]||(b[1]=E=>c(l)(c(o).onvifUrl))},null,8,["action-text","icon","button-props"])]}),_:1})]}),_:1})])):ce("",!0)],64)}}}),n7={class:"flex gap-2 items-center w-full"},r7={class:"text-color font-normal"},i7={class:"flex flex-col gap-6"},o7=["for"],a7=["for"],c7={class:"flex items-center gap-4"},l7={class:"flex flex-col field-switch-gap"},u7=["for"],d7={class:"flex items-center gap-4"},h7={class:"flex flex-col field-switch-gap"},m7=["for"],p7={class:"flex flex-col gap-6"},f7=["for"],g7={class:"w-full flex items-center justify-center my-3"},v7=At({__name:"Sources",props:Kn({camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:Kn(["close"],["update:modelValue"]),setup(s,{emit:e}){const t=Rr(s,"modelValue"),n=s,{camera:r,loading:i}=Wt(n),o=ae(["high-resolution","mid-resolution","low-resolution","snapshot"]),a=h=>{t.value.sources[h].urls.push("")},l=h=>{t.value.sources.splice(h,1)},u=(h,v)=>{t.value.sources[h].urls.splice(v,1)},d=()=>{t.value&&t.value.sources.push({_id:"",name:"",role:null,urls:[],useForSnapshot:!1,hotMode:!1})};return(h,v)=>{const f=_o,b=ys,k=Jc,z=ki,L=go,se=s7,K=Zc,N=Kc,E=fo,O=Aa,U=Yc,S=Wc,M=Gc,B=wp;return m(),A(yt,null,[y(M,{multiple:"",class:"p-4"},{default:$(()=>[(m(!0),A(yt,null,qt(t.value.sources,(W,I)=>(m(),j(S,{key:I,value:I},{default:$(()=>[y(k,{class:at({"px-0 pt-0":I===0,"px-0":I!==0})},{default:$(()=>[g("div",n7,[g("span",r7,me(h.$t("components.camera_options.source")+": "+W.name.replace(/ /g,"_").toLowerCase()),1),y(b,{text:"",rounded:"",loading:c(i),disabled:t.value.sources.length<2,severity:"danger",class:"cui-icon-md ml-auto mr-2",onClick:w=>l(I)},{icon:$(()=>[y(f,{width:"100%",height:"100%"})]),_:2},1032,["loading","disabled","onClick"])])]),_:2},1032,["class"]),y(U,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",i7,[y(c(Lt),{modelValue:W.name,"onUpdate:modelValue":w=>W.name=w,modelModifiers:{trim:!0},name:`sources[${I}].name`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("label",{for:`sources[${I}].name`,class:"cui-label"},me(h.$t("components.form.label.source_name")),9,o7),y(L,null,{default:$(()=>[y(z,et({ref_for:!0},w,{invalid:H.length>0,loading:c(i),readonly:c(r).sources.some(J=>J.name===W.name),type:"text"}),null,16,["invalid","loading","readonly"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].name`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),W._id?(m(),j(se,{key:0,"camera-name":c(r).name,source:W,loading:c(i)},null,8,["camera-name","source","loading"])):ce("",!0),y(c(Lt),{"model-value":W.role,name:`sources[${I}].role`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("label",{for:`sources[${I}].role`,class:"cui-label"},me(h.$t("components.form.label.source_role")),9,a7),y(L,null,{default:$(()=>[y(K,et({"model-value":W.role,ref_for:!0},w,{options:c(o).filter(J=>!t.value.sources.some(q=>q.role===J&&q._id!==W._id)),invalid:H.length>0,loading:c(i),onValueChange:J=>W.role=J}),null,16,["model-value","options","invalid","loading","onValueChange"])]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].role`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["model-value","name"]),W.role!=="snapshot"&&t.value.sources.length>1&&!t.value.sources.some(w=>(w.useForSnapshot||w.role==="snapshot")&&w._id!==W._id)?(m(),j(c(Lt),{key:1,"model-value":W.useForSnapshot,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${I}].useForSnapshot`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("div",c7,[g("div",l7,[g("label",{for:`sources[${I}].useForSnapshot`,class:"cui-label-switch"},me(h.$t("components.form.label.use_for_snapshot")),9,u7),y(N,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(h.$t("components.form.hint.use_for_snapshot")),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].useForSnapshot`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,et({"model-value":W.useForSnapshot,ref_for:!0},w,{invalid:H.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>W.useForSnapshot=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ce("",!0),W.role!=="snapshot"?(m(),j(c(Lt),{key:2,"model-value":W.hotMode,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${I}].hotMode`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:H})=>[g("div",d7,[g("div",h7,[g("label",{for:`sources[${I}].hotMode`,class:"cui-label-switch"},me(h.$t("components.form.label.hot_mode")),9,m7),y(N,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Qt(me(h.$t("components.form.hint.hot_mode")),1)]),_:1}),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].hotMode`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,et({"model-value":W.hotMode,ref_for:!0},w,{invalid:H.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>W.hotMode=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ce("",!0),g("div",p7,[g("label",{for:`sources[${I}].urls[]`,class:"cui-label"},me(h.$t("components.form.label.sources")),9,f7),(m(!0),A(yt,null,qt(W.urls,(w,H)=>(m(),j(c(Lt),{key:H,modelValue:W.urls[H],"onUpdate:modelValue":J=>W.urls[H]=J,modelModifiers:{trim:!0},name:`sources[${I}].urls[${H}]`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:J,errors:q})=>[y(L,null,{default:$(()=>[y(z,et({ref_for:!0},J,{invalid:q.length>0,loading:c(i),type:"text"}),null,16,["invalid","loading"]),W.urls.length>1?(m(),j(O,{key:0},{default:$(()=>[y(b,{text:"",severity:"secondary",loading:c(i),onClick:oe=>u(I,H)},{icon:$(()=>[y(f)]),_:2},1032,["loading","onClick"])]),_:2},1024)):ce("",!0)]),_:2},1024),y(Et,{name:"fade"},{default:$(()=>[y(c(jt),{name:`sources[${I}].urls[${H}]`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","name"]))),128)),y(b,{loading:c(i),label:h.$t("components.form.button.add_source"),class:"ml-auto cui-button-medium",onClick:w=>a(I)},null,8,["loading","label","onClick"])])])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1}),g("div",g7,[y(b,{text:"",rounded:"",loading:c(i),class:"cui-icon-xl",onClick:d},{icon:$(()=>[y(B,{width:"100%",height:"100%"})]),_:1},8,["loading"])])],64)}}}),_7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y7(s,e){return m(),A("svg",_7,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 2C9.76 2 7.78 3.05 6.5 4.68l9.81 9.82C17.94 13.21 19 11.24 19 9a7 7 0 0 0-7-7M3.28 4L2 5.27L5.04 8.3C5 8.53 5 8.76 5 9c0 2.38 1.19 4.47 3 5.74V17a1 1 0 0 0 1 1h5.73l4 4L20 20.72zM9 20v1a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-1z"},null,-1)]))}const b7=pe({name:"mdi-lightbulb-off",render:y7}),w7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x7(s,e){return m(),A("svg",w7,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M12 6a6 6 0 0 1 6 6c0 2.22-1.21 4.16-3 5.2V19a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1v-1.8c-1.79-1.04-3-2.98-3-5.2a6 6 0 0 1 6-6m2 15v1a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-1zm6-10h3v2h-3zM1 11h3v2H1zM13 1v3h-2V1zM4.92 3.5l2.13 2.14l-1.42 1.41L3.5 4.93zm12.03 2.13l2.12-2.13l1.43 1.43l-2.13 2.12z"},null,-1)]))}const S7=pe({name:"mdi-lightbulb-on",render:x7}),C7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function k7(s,e){return m(),A("svg",C7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1)]))}const E7=pe({name:"flat-color-icons-empty-battery",render:k7}),A7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function M7(s,e){return m(),A("svg",A7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#8BC34A",d:"M34 44H14c-1.1 0-2-.9-2-2v-9h24v9c0 1.1-.9 2-2 2"},null,-1)]))}const $7=pe({name:"flat-color-icons-low-battery",render:M7}),P7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function T7(s,e){return m(),A("svg",P7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#8BC34A",d:"M34 44H14c-1.1 0-2-.9-2-2V23h24v19c0 1.1-.9 2-2 2"},null,-1)]))}const R7=pe({name:"flat-color-icons-middle-battery",render:T7}),I7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function O7(s,e){return m(),A("svg",I7,e[0]||(e[0]=[g("g",{fill:"#CFD8DC"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#8BC34A",d:"M34 44H14c-1.1 0-2-.9-2-2V13h24v29c0 1.1-.9 2-2 2"},null,-1)]))}const N7=pe({name:"flat-color-icons-high-battery",render:O7}),F7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function L7(s,e){return m(),A("svg",F7,e[0]||(e[0]=[g("g",{fill:"#8BC34A"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1)]))}const j7=pe({name:"flat-color-icons-full-battery",render:L7}),q7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function D7(s,e){return m(),A("svg",q7,e[0]||(e[0]=[g("g",{fill:"#8BC34A"},[g("path",{d:"M34 44H14c-1.1 0-2-.9-2-2V8c0-1.1.9-2 2-2h20c1.1 0 2 .9 2 2v34c0 1.1-.9 2-2 2"}),g("path",{d:"M28 13h-8c-.6 0-1-.4-1-1V5c0-.6.4-1 1-1h8c.6 0 1 .4 1 1v7c0 .6-.4 1-1 1"})],-1),g("path",{fill:"#FFEB3B",d:"M30 24h-5.5l2.2-11L18 26h5.5l-2.2 11z"},null,-1)]))}const B7=pe({name:"flat-color-icons-charge-battery",render:D7}),z7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U7(s,e){return m(),A("svg",z7,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M6.5 20q-2.28 0-3.89-1.57Q1 16.85 1 14.58q0-1.95 1.17-3.48q1.18-1.53 3.08-1.95q.63-2.3 2.5-3.72Q9.63 4 12 4q2.93 0 4.96 2.04Q19 8.07 19 11q1.73.2 2.86 1.5q1.14 1.28 1.14 3q0 1.88-1.31 3.19T18.5 20Z"},null,-1)]))}const V7=pe({name:"mdi-cloud",render:U7}),H7={key:0,class:"flex items-center justify-center h-full"},Q7={key:1},K7={class:"flex flex-col p-4"},Z7={class:"camera-info flex justify-between items-center text-sm"},G7={class:"font-bold"},W7={class:"flex items-center gap-2"},J7={class:"camera-info flex justify-between items-center text-sm"},Y7={class:"font-bold"},X7={class:"flex items-center"},eC={key:0,class:"camera-info flex justify-between items-center text-sm"},tC={class:"font-bold"},sC={class:"flex items-center gap-2"},nC={key:0},rC={key:1,class:"camera-info flex justify-between items-center text-sm"},iC={class:"font-bold"},oC={class:"flex items-center"},aC={key:2,class:"camera-info flex justify-between items-center text-sm"},cC={class:"font-bold"},lC={class:"flex items-center"},uC={key:1},dC={key:2},hC={key:3,class:"camera-info flex justify-between items-center text-sm"},mC={class:"font-bold"},pC={class:"flex items-center"},fC={key:1},gC={key:2},vC={key:4,class:"camera-info flex justify-between items-center text-sm"},_C={class:"font-bold"},yC={class:"flex items-center"},bC={key:1},wC={key:2},xC={key:5,class:"camera-info flex justify-between items-center text-sm"},SC={class:"font-bold"},CC={class:"flex items-center"},kC={key:1},EC={key:2},AC={key:6,class:"camera-info flex justify-between items-center text-sm"},MC={class:"font-bold"},$C={class:"flex items-center"},PC={key:1},TC={key:2},RC=At({__name:"Overview",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=s,{cameraDevice:n,loading:r,latestSnapshotSrc:i}=Wt(t),{cameraObject:o,hasBattery:a,hasLight:l,hasAudioDetector:u,hasDoorbell:d,hasMotionDetector:h,hasObjectDetector:v,hasSiren:f,lightState:b,batteryState:k,motionState:z,objectState:L,audioState:se,doorbellState:K,sirenState:N}=Ll(n),E=ne(()=>r.value);return(O,U)=>{var Se,F,D,Y,Te,He,ht,Mt,Qe,ze;const S=Lr,M=Fl,B=V7,W=B7,I=j7,w=N7,H=R7,J=$7,q=E7,oe=S7,ue=b7;return c(o)?(m(),A("div",Q7,[y(M,{"camera-name":c(o).name,src:c(i),class:"w-full aspect-video bg-black","image-container-class":"w-full h-full"},null,8,["camera-name","src"]),g("div",K7,[g("div",Z7,[g("span",G7,me(O.$t("components.camera_options.name")),1),g("div",W7,[g("span",null,me(c(o).name),1),c(o).isCloud?(m(),j(B,{key:0,class:"w-5 h-5"})):ce("",!0)])]),g("div",J7,[g("span",Y7,me(O.$t("components.camera_options.plugin")),1),g("div",X7,[c(E)?(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"})):ce("",!0),g("span",null,me(((Se=c(o).pluginInfo)==null?void 0:Se.name)??O.$t("components.camera_options.native")),1)])]),c(a)?(m(),A("div",eC,[g("span",tC,me(O.$t("components.camera_options.battery_state")),1),g("div",sC,[c(k)!==void 0?(m(),A("span",nC,me(c(k).level)+"%",1)):ce("",!0),c(k)?c(k).charging?(m(),j(W,{key:2,class:"w-5 h-5"})):c(k).level===100?(m(),j(I,{key:3,class:"w-5 h-5"})):c(k).level>=75?(m(),j(w,{key:4,class:"w-5 h-5"})):c(k).level>=50?(m(),j(H,{key:5,class:"w-5 h-5"})):c(k).level>=25?(m(),j(J,{key:6,class:"w-5 h-5"})):(m(),j(q,{key:7,class:"w-5 h-5"})):(m(),j(S,{key:1,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(l)?(m(),A("div",rC,[g("span",iC,me(O.$t("components.camera_options.light_state")),1),g("div",oC,[c(b)?c(b).state?(m(),j(oe,{key:1,class:"text-yellow-400 w-5 h-5"})):(m(),j(ue,{key:2,class:"text-muted w-5 h-5"})):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(u)?(m(),A("div",aC,[g("span",cC,me(O.$t("components.camera_options.audio_state")),1),g("div",lC,[c(se)?c(se).state||(F=c(se).lastEvent)!=null&&F.state?(m(),A("span",uC,me(c(Bi)(c(se).state?c(se).timestamp:c(se).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",dC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(d)?(m(),A("div",hC,[g("span",mC,me(O.$t("components.camera_options.doorbell_state")),1),g("div",pC,[c(K)?c(K).state||(D=c(K).lastEvent)!=null&&D.state?(m(),A("span",fC,me(c(Bi)(c(K).state?c(K).timestamp:c(K).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",gC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(h)?(m(),A("div",vC,[g("span",_C,me(O.$t("components.camera_options.motion_state")),1),g("div",yC,[c(z)?c(z).state||(Y=c(z).detections)!=null&&Y.length||(Te=c(z).lastEvent)!=null&&Te.state||(ht=(He=c(z).lastEvent)==null?void 0:He.detections)!=null&&ht.length?(m(),A("span",bC,me(c(Bi)(c(z).state||(Mt=c(z).detections)!=null&&Mt.length?c(z).timestamp:c(z).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",wC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(v)?(m(),A("div",xC,[g("span",SC,me(O.$t("components.camera_options.object_state")),1),g("div",CC,[c(L)?c(L).detections.length||(Qe=c(L).lastEvent)!=null&&Qe.detections.length?(m(),A("span",kC,me(c(Bi)(c(L).detections.length?c(L).timestamp:c(L).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",EC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0),c(f)?(m(),A("div",AC,[g("span",MC,me(O.$t("components.camera_options.siren_state")),1),g("div",$C,[c(N)?c(N).state||(ze=c(N).lastEvent)!=null&&ze.state?(m(),A("span",PC,me(c(Bi)(c(N).state?c(N).timestamp:c(N).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),A("span",TC,"-")):(m(),j(S,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ce("",!0)])])):(m(),A("div",H7,[y(S,{"stroke-width":"5",class:"w-[30px] h-[30px]"})]))}}}),IC=qs(RC,[["__scopeId","data-v-95baba33"]]),OC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function NC(s,e){return m(),A("svg",OC,e[0]||(e[0]=[g("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},[g("path",{"stroke-width":"3",d:"M5 10h.01M5 16h.01"}),g("path",{"stroke-width":"2",d:"m10 17l4-10m2 10l4-10"})],-1)]))}const FC=pe({name:"humbleicons-url",render:NC}),LC={class:"flex items-center w-full h-[45px] border-b-[1px] border-color px-3"},jC={class:"font-semibold text-lg truncate"},qC=["onClick"],DC={class:"text-xs truncate"},BC={class:"w-full h-full max-h-full overflow-y-scroll"},zC={key:0,class:"flex w-full h-full items-center justify-center mt-5"},UC={key:1,class:"w-full h-full"},VC={key:0,class:"w-full flex items-center justify-center p-4 h-[70px]"},HC=At({__name:"CameraOptions",props:{cameraName:{},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Jn,n=Cn(),{t:r}=js(),i=e,o=s,{cameraName:a,latestSnapshotSrc:l}=Wt(o),u=Vt("formRef"),d=Ls(),h=ae(),v=ae("overview"),f=ae([{name:"overview",icon:zc},{name:"sources",icon:FC},{name:"settings",icon:Sa},{name:"plugins",icon:Uc}]),{data:b,isFetching:k,suspense:z}=t.getCameraQuery(a),{mutate:L,isPending:se}=t.patchCameraQuery(),K=ne(()=>k.value||se.value),N=ne(()=>v.value==="sources"||v.value==="settings");Ge(b,O=>{O&&(h.value=xi(O))},{deep:!0,immediate:!0});const E=async()=>{var U;const O=await((U=u.value)==null?void 0:U.validate());O!=null&&O.valid&&O.values?L({cameraname:a.value,cameraData:O.values}):(n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",O))};return Sn(async()=>{if(await z(),!b.value)return;const O=await Ep();d.value=await O.deviceManager.getCamera(b.value.name)}),Ma(()=>{var O;(O=d.value)==null||O.close()}),(O,U)=>{const S=_o,M=ys,B=F0,W=N0,I=Lr,w=IC,H=v7,J=US,q=V3,oe=Uh,ue=zh,Se=Bh;return m(),A(yt,null,[g("div",LC,[g("span",jC,me(c(a)),1),y(M,{text:"",rounded:"",severity:"secondary",class:"ml-auto cui-icon-md shrink-0",onClick:U[0]||(U[0]=F=>i("close"))},{icon:$(()=>[y(S,{width:"100%",height:"100%"})]),_:1})]),y(c(il),{ref_key:"formRef",ref:u,class:"w-full",style:ot({height:`calc(100% - 45px - ${c(N)?"70px":"0px"})`}),"validation-schema":c(Bx)},{default:$(()=>[y(Se,{value:c(v),"onUpdate:value":U[7]||(U[7]=F=>us(v)?v.value=F:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(W,{class:"justify-between",pt:{tablist:{class:"h-[65px]"},activeBar:{class:"!w-auto"}}},{default:$(()=>[(m(!0),A(yt,null,qt(c(f),(F,D)=>(m(),j(B,{key:D,value:F.name,"as-child":""},{default:$(Y=>[g("div",et({ref_for:!0},Y.a11yAttrs,{class:["flex flex-col items-center justify-center flex-1 content-background !py-3",[{"hover:!text-color active:!text-color focus:!text-color":!Y.active},Y.class]],onClick:Y.onClick}),[(m(),j(Ai(F.icon),{class:"w-5 h-5"})),g("span",DC,me(O.$t(`components.options_sidebar.segment_tab_${F.name}`)),1)],16,qC)]),_:2},1032,["value"]))),128))]),_:1}),y(ue,{class:"p-0 h-[calc(100%-65px)]"},{default:$(()=>[g("div",BC,[(m(!0),A(yt,null,qt(c(f),(F,D)=>(m(),j(oe,{key:D,value:F.name,"as-child":""},{default:$(Y=>[Y.active?(m(),A("div",et({key:0,class:Y.class,ref_for:!0},Y.a11yAttrs),[!c(h)||!c(b)||!c(d)?(m(),A("div",zC,[y(I,{"stroke-width":"5",class:"w-[30px] h-[30px]"})])):(m(),A("div",UC,[c(v)==="overview"?(m(),j(w,{key:0,camera:c(b),"camera-device":c(d),loading:c(K),"latest-snapshot-src":c(l),onClose:U[1]||(U[1]=Te=>i("close"))},null,8,["camera","camera-device","loading","latest-snapshot-src"])):ce("",!0),c(v)==="sources"?(m(),j(H,{key:1,modelValue:c(h),"onUpdate:modelValue":U[2]||(U[2]=Te=>us(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(K),onClose:U[3]||(U[3]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ce("",!0),c(v)==="settings"?(m(),j(J,{key:2,modelValue:c(h),"onUpdate:modelValue":U[4]||(U[4]=Te=>us(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(K),onClose:U[5]||(U[5]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ce("",!0),c(v)==="plugins"?(m(),j(q,{key:3,camera:c(b),"camera-device":c(d),loading:c(K),onClose:U[6]||(U[6]=Te=>i("close"))},null,8,["camera","camera-device","loading"])):ce("",!0)]))],16)):ce("",!0)]),_:2},1032,["value"]))),128))])]),_:1})]),_:1},8,["value"]),c(N)?(m(),A("div",VC,[y(M,{fluid:"",severity:"success",class:"cui-button-medium",label:O.$t("components.form.button.save"),onClick:E},null,8,["label"])])):ce("",!0)]),_:1},8,["style","validation-schema"])],64)}}}),QC={class:"w-full h-full p-safe !pb-0 md:!pl-0"},KC={class:"w-full h-full border-0 md:border-r-[1px] border-color overflow-y-auto pb-safe"},ZC=At({__name:"CuiCameraDrawer",setup(s){const e=qr(),t=kp(),n=t.getEventBus(),r=ae(!1),i=ae(),o=ae(),a=ne(()=>Cp.pt);Ge(e.currentRoute,(u,d)=>{u.path!==d.path&&t.close()});const l=()=>{r.value=!1,t.close()};return Sn(()=>{n.on(u=>{u.type==="open"?(i.value=u.options,o.value=u.props,r.value=!0):u.type==="close"&&(r.value=!1,i.value=void 0)})}),(u,d)=>{const h=HC,v=L0;return m(),j(v,et({visible:c(r),"onUpdate:visible":d[0]||(d[0]=f=>us(r)?r.value=f:null)},c(o),{class:"border-0 md:border-l-[1px]",pt:c(a),onHide:l}),{container:$(({closeCallback:f})=>[g("div",QC,[g("div",KC,[c(i)?(m(),j(h,et({key:0},c(i),{onClose:f}),null,16,["onClose"])):ce("",!0)])])]),_:1},16,["visible","pt"])}}}),GC={class:"loader flex flex-col justify-center items-center"},WC={key:0,class:"absolute flex flex-col items-center justify-center pb-safe bottom-10"},JC={key:0,class:"offline"},YC={key:1,class:"text-center text-white text-sm font-bold mt-2"},XC=At({__name:"CuiLoadingScreen",props:{reload:{type:Boolean,default:!1},height:{default:"200px"},width:{default:"200px"},text:{},icon:{}},setup(s){const e=s,{reload:t,width:n,height:r,text:i,icon:o}=Wt(e);let a,l;const u=()=>{clearInterval(a),clearTimeout(l)};return Sn(()=>{u(),t.value&&(a=setInterval(()=>{const d=document.getElementById("lens");d==null||d.classList.remove("cameraLens");const h=document.getElementById("CameraUI_U");h==null||h.classList.remove("cameraLetter"),l=setTimeout(()=>{d==null||d.classList.add("cameraLens"),h==null||h.classList.add("cameraLetter")},100)},2300))}),vo(()=>{u()}),(d,h)=>(m(),A("div",GC,[y(c($a),{src:c(Fr)("logo_loading_circle.svg"),width:c(n),height:c(r),title:"camera.ui","aria-label":"camera.ui"},null,8,["src","width","height"]),c(o)||c(i)?(m(),A("div",WC,[c(o)?(m(),A("div",JC,[(m(),j(Ai(c(o)),{class:"w-8 h-8 text-primary"}))])):ce("",!0),c(i)?(m(),A("div",YC,me(c(i)),1)):ce("",!0)])):ce("",!0)]))}}),ek=qs(XC,[["__scopeId","data-v-d2a6a09b"]]),tk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sk(s,e){return m(),A("svg",tk,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 3h8l-4 6h4L6 21l4-9H6z"},null,-1)]))}const nk=pe({name:"gridicons-offline",render:sk}),rk={components:{camera_draggable:{no_cameras:"Keine Kameras verfügbar"},camera_events:{no_events:"Keine Ereignisse verfügbar"},camera_options:{advanced:"Erweitert",audio_state:"Audiozustand",battery_state:"Batteriezustand",branding:"Branding",categories:"Kategorien",chip_audioDetection:"Geräuscherkennung",chip_cameraController:"Kamera",chip_hub:"Hub",chip_more:"Mehr",chip_motionDetection:"Bewegungserkennung",chip_objectDetection:"Objekterkennung",chip_plugins:"Plugins",chip_ptz:"PTZ",detection:"Erkennung",doorbell_state:"Türklingelzustand",enabled_extension:"Aktivierte Erweiterung",frame_worker:"Frame Worker",general:"Allgemein",interface:"Interface",light_state:"Lichtzustand",manage_plugins:"Plugins verwalten",model:"Modell",more_plugins:"Mehr Plugins",motion_detection:"Bewegungserkennung",motion_state:"Bewegungszustand",name:"Name",native:"Nativ",no_config:"Keine Konfiguration verfügbar",no_plugins_enabled:"Keine Plugins aktiviert",no_plugins_found:"Keine Plugins gefunden",object_detection:"Objekterkennung",object_state:"Objektzustand",plugin:"Plugin",plugin_settings:"Plugin Einstellungen",recordings:"Aufnahmeeinstellungen",settings:"Einstellungen",siren_state:"Sirenenzustand",source:"Quelle",snapshot:"Snapshot",streaming_mode:"Streaming Modus",unknown:"Unbekannt",zones:"Zonen"},camera_table:{cameras:"Kameras",name:"Name",offline:"Offline",online:"Online",status:"Status"},charts:{no_data:"Keine Daten verfügbar"},detection_interface:{audio_detected:"Audio erkannt",audio_not_detected:"Audio nicht erkannt",audio_required:"Audio Datei erforderlich",detect:"Erkennen",drop_or_select_audio_to_detect:"Audio ablegen oder auswählen, um Geräusche zu erkennen",drop_or_select_image_to_detect_objects:"Bild ablegen oder auswählen, um Objekte zu erkennen",drop_or_select_video_to_detect_motion:"Video ablegen oder auswählen, um Bewegung zu erkennen",file_size_error:"Dateigröße zu groß",image_required:"Image required",interface_config:"Interface-Konfiguration",no_interface_config:"Keine Interface-Konfiguration verfügbar",only_one_audio_allowed:"Es ist nur ein Audio erlaubt",only_one_image_allowed:"Es ist nur ein Bild erlaubt",only_one_video_allowed:"Es ist nur ein Video erlaubt",video_required:"Video required"},dialog:{components:{new_camera:{add_camera:"Kamera hinzufügen",add_camera_description:"Fügen Sie eine Kamera hinzu, die mit Ihrem lokalen Netzwerk verbunden ist",camera:"Kamera",discover_cameras:"Kameras suchen",discover_cameras_description:"Suchen Sie nach Kameras in Ihrem lokalen Netzwerk",no_cameras_found:"Keine Kameras gefunden",protocol_info:"Informationen zum gewählten Protokoll",scan_again:"Erneut scannen",search_camera:"Kamera suchen",source:"Quelle",test_source:"Kameraquelle testen",title:"Neue Kamera",unknown:"Unbekannt"}},message:{confirm_clear_log:"Sind Sie sicher, dass Sie das Protokoll löschen möchten?",confirm_remove:"Sind Sie sicher, dass Sie diese Kamera entfernen möchten?",confirm_remove_layout:"Sind Sie sicher, dass Sie dieses Layout entfernen möchten?",confirm_reset_server:"Sind Sie sicher, dass Sie den Server zurücksetzen möchten?",confirm_restart_go2rtc:"Sind Sie sicher, dass Sie Go2RTC neu starten möchten?",confirm_restart_plugin:"Sind Sie sicher, dass Sie dieses Plugin neu starten möchten?",confirm_restart_server:"Sind Sie sicher, dass Sie den Server neu starten möchten?",confirm_restore:"Sind Sie sicher, dass Sie dieses Backup wiederherstellen möchten?",confirm_uninstall_plugin:"Sind Sie sicher, dass Sie dieses Plugin deinstallieren möchten?",intercom_info:"Sprechen Sie gleichzeitig mit allen Kameras, die eine Sprechanlage haben"},title:{config:"Konfiguration",confirm:"Bestätigen",create_new_user:"Neuer Benuter",edit_dnd:"DND bearbeiten",edit_layout:"Layout bearbeiten",edit_user:"Benutzer bearbeiten",edit_view:"Ansicht bearbeiten",information:"Information",install:"Installieren",install_version:"Version installieren",intercom:"Gegensprechanlage",log:"Log",new_dnd:"Neue DND",new_view:"Neue Ansicht",new_zone:"Neue Zone",plugin_config:"Plugin-Konfiguration",preview:"Vorschau",remove_layout:"Layout entfernen",reset_server:"Server zurücksetzen",restart:"Neustart",result:"Ergebnis",search_plugin:"Plugin suchen",update:"Aktualisieren",unknown:"Unbekannt",zone:"Zone",zone_editor:"Zonen-Editor"}},form:{button:{add:"Hinzufügen",add_source:"Quelle hinzufügen",add_view:"Ansicht hinzufügen",back:"Zurück",cancel:"Abbrechen",change_view:"Ansicht wechseln",clear:"Löschen",close:"Schließen",continue:"Fortfahren",create_new_user:"Neuen Benutzer erstellen",download:"Herunterladen",download_backup_archive:"Backup-Archiv herunterladen",download_cert:"Zertifikat herunterladen",edit:"Bearbeiten",edit_zones:"Zonen bearbeiten",finish:"Fertig",go_to_message:"Zur Nachricht gehen",home:"Startseite",install:"Installieren",login:"Anmelden",logout:"Abmelden",logout_all:"Alle abmelden",manage:"Verwalten",mark_as_read:"Als gelesen markieren",new:"Neu",new_zone:"Neue Zone",next:"Weiter",open_editor:"Editor öffnen",previous:"Zurück",reinstall:"Neu installieren",remove:"Entfernen",reset:"Zurücksetzen",restart:"Neustarten",restore_backup_archive:"Backup-Archiv wiederherstellen",restore_and_restart:"Wiederherstellen und neustarten",save:"Speichern",save_and_restart:"Speichern und neustarten",submit:"Absenden",test_connection:"Verbindung testen",undo:"Rückgängig",uninstall:"Deinstallieren",update:"Aktualisieren",upload:"Hochladen"},error:{no_cameras_selected:"Keine Kameras ausgewählt",no_view_selected:"Keine Ansicht ausgewählt"},hint:{aspect_ratio:"Zwingt das Seitenverhältnis der Kamera auf den gewählten Wert",cache_time:"Zeit in Millisekunden, die der Cache für die Kamerabilder verwendet",confidence:"Die benötigte Konfidenz für die Erkennung eines Objekts",default_settings_page:"Die Standardseite, die beim Öffnen der Einstellungen angezeigt wird",disable_camera:"Deaktiviert die Kamera und stoppt alle Aktivitäten. Die Kamera wird weiterhin angezeigt",frameworker_decoder:"Der Decoder, der für den Frame Worker verwendet wird",frameworker_fps:"Die Anzahl der Frames pro Sekunde, welche für den Frame Worker verwendet werden. '0' verwendet die native Framerate",frameworker_resolution:"Die Auflösung der Kamera, welche für den Frame Worker verwendet wird",hot_mode:"Lässt die Verbindung zur Kamera aktiv, um die Verzögerung zu minimieren",motion_duration:"Zeit in Sekunden, die die Kamera benötigt, um nach einer Bewegungserkennung wieder in den normalen Modus zurückzukehren",navbar_stay_collapsed:"Lässt die Navbar eingeklappt, auch auf größeren Bildschirmen",remember_me:"Erlaubt, dass die Sitzung nicht abläuft",session_timer:"Die Zeit in Millisekunden, bevor die Sitzung abläuft",show_bottombar_on_mobile:"Zeigt die untere Leiste auf Mobilgeräten",show_camera_events:"Zeigt die Kameraereignisse in der Kameraansicht",single_session:"Erlaubt nur eine aktive Sitzung pro Benutzer",streaming_mode:"Stream Transport Protokoll für die Benutzeroberfläche. In 'auto' wird der beste Modus automatisch ausgewählt",streaming_source:"Kameraquelle für den Stream. In 'auto' wird die beste Quelle automatisch ausgewählt",system_preference:"Systemeinstellung für die Benutzeroberfläche",use_for_snapshot:"Verwendet diese Quelle für Snapshots (wenn sonst keine geeignete Quelle existiert)"},label:{actions:"Aktionen",aspect_ratio:"Seitenverhältnis",audio_codec:"Audio-Codec",cache_time:"Cache Zeit",camera:"Kamera",cameras:"Kameras",changelog:"Änderungsprotokoll",classes:"Klassen",color:"Farbe",confidence:"Konfidenz",connections:"Verbindungen",custom_domain:"Benutzerdefinierte Domain",decoder:"Decoder",default_settings_page:"Standard Einstellungsseite",disabled:"Deaktiviert",enabled:"Aktiviert",firmware_version:"Firmware Version",fps:"FPS",frame_worker:"Frame Worker",hardware_version:"Hardware Version",hot_mode:"Hot Modus",language:"Sprache",layout_name:"Layoutname",manufacturer:"Hersteller",model:"Modell",motion_duration:"Bewegungsdauer",name:"Name",navbar_stay_collapsed:"Navbar eingeklappt lassen",new_password:"Neues Passwort",new_password_confirm:"Neues Passwort bestätigen",onvif_url:"ONVIF URL",password:"Passwort",pin:"PIN",plugin_version:"Plugin-Version",recording:"Aufnahme",remember_me:"Erinnere mich",remote_access_mode:"Remote Zugriffsmodus",remove_storage:"Speicher entfernen",resolution:"Auflösung",role:"Rolle",rtsp_url:"RTSP-URL",select_all:"Alle auswählen",select_cameras:"Kameras auswählen",serial_number:"Seriennummer",server_addresses:"Server-Adressen",server_version:"Server-Version",session_timer:"Sitzungstimer",settings:"Einstellungen",show_bottombar_on_mobile:"Bottombar auf Mobilgeräten anzeigen",show_camera_events:"Kameraereignisse anzeigen",single_session:"Einzelne Sitzung",source:"Quelle",source_label:"Quellenbezeichnung",source_name:"Quellenname",source_role:"Quellenrolle",sources:"Quellen",snapshot_url:"Snapshot URL",streaming_mode:"Streaming Modus",streaming_source:"Streaming Quelle",support_url:"Support URL",system_preference:"Systemeinstellung",theme:"Thema",type:"Typ",url:"URL",use_for_snapshot:"Für Snapshot verwenden",username:"Benutzername",version:"Version",video_codec:"Video-Codec",views:"Ansichten",zone_name:"Zonenname"},tooltip:{activity_mode_activity:"Aktivität",activity_mode_always_on:"Immer An",activity_mode_standby:"Standby",clear:"Säubern",contain:"Enthalten",copied:"Kopiert",delete:"Löschen",disable_drag:"Ziehen deaktivieren",disabled:"Deaktiviert",download:"Herunterladen",edit:"Bearbeiten",enable_drag:"Ziehen aktivieren",exclude:"Ausschließen",finish:"Fertig",fullscreen_off:"Vollbildmodus ausschalten",fullscreen_on:"Vollbildmodus einschalten",hide_timeline:"Zeitleiste ausblenden",include:"Einschließen",intercom:"Gegensprechanlage",intersect:"Schneiden",logout:"Abmelden",mode:"Modus",mute:"Stumm",new:"Neu",privacy_mask:"Privatsphärenmaske",public_mask:"Öffentliche Maske",resolution:"Auflösung",restart:"Neustarten",show_timeline:"Zeitleiste anzeigen",source_role_auto:"Auto",source_role_low:"Niedrige Auflösung",source_role_mid:"Mittlere Auflösung",source_role_high:"Hohe Auflösung",source_role_snapshot:"Snapshot",source_role_unknown:"Unbekannt",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unbekannt",streaming_mode_webrtc:"WebRTC ",undo:"Rückgängig",unmute:"Stummschalten aufheben",update_available:"Aktualisierung verfügbar",zoom_in:"Vergrößern",zoom_out:"Verkleinern"}},notification_menu:{clear_notifications:"Benachrichtigungen löschen",debug:"Debug",error:"Fehler",info:"Info",no_notifications:"Keine Benachrichtigungen",notifications:"Benachrichtigungen",short_days:"Tg.",short_hours:"Std.",short_minutes:"Min.",short_months:"M.",short_years:"J.",verbose:"Ausführlich",warn:"Warnung"},options_sidebar:{segment_tab_default:"Standard",segment_tab_overview:"Übersicht",segment_tab_plugins:"Plugins",segment_tab_settings:"Einstellungen",segment_tab_sources:"Quellen"},player:{add_shortcuts:"Shortcuts hinzufügen",activity_mode_activity:"Aktivität",activity_mode_always_on:"Immer An",activity_mode_standby:"Standby",capture_snapshot:"Snapshot aufnehmen",detections:"Erkennungen",hide_shortcuts:"Shortcuts ausblenden",hide_timeline:"Zeitleiste ausblenden",hide_zones:"Zonen ausblenden",live:"Live",log:"Log",ptz:"PTZ",ptz_go_to_home:"Zurück zur Startposition",reconnecting:"Wiederverbinden...",refresh_snapshot:"Snapshot aktualisieren",save_shortcuts:"Shortcuts speichern",settings:"Einstellungen",share_camera:"Kamera teilen",show_shortcuts:"Shortcuts anzeigen",show_timeline:"Zeitleiste anzeigen",show_zones:"Zonen anzeigen",source_role_auto:"Auto",source_role_low:"Niedrige Auflösung",source_role_mid:"Mittlere Auflösung",source_role_high:"Hohe Auflösung",source_role_snapshot:"Snapshot",source_role_unknown:"Unbekannt",stream_paused:"Stream pausiert, um Ressourcen zu schonen. Klicken Sie auf den Stream, um fortzufahren.",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unbekannt",streaming_mode_webrtc:"WebRTC ",zoom_in:"Zoom rein",zoom_out:"Zoom raus"},plugin_card:{author:"Autor",installed:"Installiert",no_description:"Keine Beschreibung verfügbar",restart:"Neustart",select_version:"Version auswählen",settings:"Einstellungen",start:"Start",status_disabled:"Deaktiviert",status_error:"Fehler",status_ready:"Bereit",status_started:"Gestartet",status_starting:"Startet",status_stopped:"Gestoppt",status_unknown:"Unbekannt",stop:"Stop",uninstall:"Deinstallieren",update:"Aktualisieren",update_available:"Aktualisierung verfügbar",updated:"Aktualisiert",version:"Version"},plugin_search:{plugins:"Plugins",refresh:"Aktualisieren"},plugin_types:{hub:"Hub",cameraController:"Kamera-Controller",motionDetection:"Bewegungserkennung",objectDetection:"Objekterkennung",audioDetection:"Geräuscherkennung",ptz:"PTZ"},process_table:{status_error:"Fehler",status_ready:"Bereit",status_started:"Gestartet",status_starting:"Startet",status_stopped:"Gestoppt",status_stopping:"Stoppt",status_unknown:"Unbekannt",system:"System",title_cpu:"CPU",title_cpu_load:"CPU-Auslastung",title_memory:"Speicher",title_memory_load:"Speicherauslastung",title_name:"Name",title_pid:"PID"},timeline:{live:"Live"},topbar:{syncing_data:"Daten synchronisieren..."},toast:{backup_downloaded:"Backup-Datei erfolgreich heruntergeladen",backup_restored:"Backup-Datei erfolgreich wiederhergestellt",camera_added:"Kamera erfolgreich hinzugefügt",camera_removed:"Kamera erfolgreich entfernt",camera_updated:"Kamera erfolgreich aktualisiert",cameras_removed:"Kameras erfolgreich entfernt",config_deleted:"Konfiguration erfolgreich gelöscht",config_go2rtc_deleted:"Go2RTC-Konfiguration erfolgreich gelöscht",config_go2rtc_updated:"Go2RTC-Konfiguration erfolgreich aktualisiert",config_updated:"Konfiguration erfolgreich aktualisiert",error_see_console:"Fehler, siehe Konsole",frame_worker_restarted:"Frame Worker erfolgreich neugestartet",go2rtc_restarted:"Go2RTC erfolgreich neugestartet",log_cleared:"Log erfolgreich gelöscht",no_version_selected:"Keine Version ausgewählt",plugin_config_updated:"Plugin-Konfiguration erfolgreich aktualisiert",plugin_disabled:"Plugin erfolgreich deaktiviert",plugin_enabled:"Plugin erfolgreich aktiviert",plugin_installed:"Plugin erfolgreich installiert",plugin_removed:"Plugin erfolgreich entfernt",plugin_request_sent:"Plugin-Anfrage erfolgreich gesendet",plugin_restarted:"Plugin erfolgreich neugestartet",plugin_settings_updated:"Plugin-Einstellungen erfolgreich aktualisiert",plugin_started:"Plugin erfolgreich gestartet",plugin_stopped:"Plugin erfolgreich gestoppt",plugins_removed:"Plugins erfolgreich entfernt",profile_updated:"Profil erfolgreich aktualisiert",server_resetted:"Server erfolgreich zurückgesetzt",server_restarted:"Server erfolgreich neugestartet",server_updated:"Server erfolgreich aktualisiert",title_error:"Fehler",title_info:"Info",title_success:"Erfolgreich",title_warn:"Warnung",user_added:"Benutzer erfolgreich hinzugefügt",user_logged_out:"Benutzer erfolgreich abgemeldet",user_removed:"Benutzer erfolgreich entfernt",user_updated:"Benutzer erfolgreich aktualisiert",users_removed:"Benutzer erfolgreich entfernt",view_added:"Ansicht erfolgreich hinzugefügt",validation_failed:"Validierung fehlgeschlagen. Überprüfen Sie die Konsole für weitere Informationen",view_removed:"Ansicht erfolgreich entfernt",view_updated:"Ansicht erfolgreich aktualisiert",views_removed:"Ansichten erfolgreich entfernt",zone_updated:"Zone erfolgreich aktualisiert",zone_removed:"Zone erfolgreich entfernt"},upload_files:{drop_or_select_file:"Datei ablegen oder auswählen",only_one_file_allowed:"Es ist nur eine Datei erlaubt"},user_menu:{account:"Konto",admin_panel:"Admin Panel",config:"Konfiguration",console:"Logs",logout:"Abmelden",plugins:"Plugins",reload:"Neu laden"},user_table:{title_address:"Adresse",title_device:"Gerät",title_username:"Benutzername",you:"Du"},view_box:{available_streams:"Verfügbare Streams"},zone_editor:{edit_zones:"Zonen bearbeiten",zone:"Zone"}},general:{loading:"Laden...",role_admin:"Admin",role_user:"Benutzer"},navigation:{account:"Konto",adminpanel:"Admin-Panel",appearance:"Erscheinungsbild",backup:"Backup",cameras:"Kameras",cammesh:"Cammesh",camview:"Kameransicht",config:"Konfiguration",console:"Logs",extras:"Extras",nvr:"NVR",plugins:"Plugins",recordings:"Aufnahmen",remote:"Remote Zugriff",settings:"Einstellungen",system:"System",user:"Benutzer"},navigation_description:{account_description:"Verwalten Sie Kontoeinstellungen und Erfahrungen.",appearance_description:"Verwalten Sie das Erscheinungsbild und die Benutzeroberfläche der App.",backup_description:"Verwalten, planen Sie Backups und stellen Sie Daten wieder her.",nvr_description:"Verwalten Sie das Netzwerk-Videorekorder-System.",recordings_description:"Verwalten Sie Aufnahmen und Speicheroptionen.",remote_access_description:"Verwalten Sie den Remote-Zugriff und die Verbindungseinstellungen.",system_description:"Verwalten Sie das System, überwachen Sie den Status und die Aufgaben.",user_description:"Verwalten Sie Benutzer, Rollen und Berechtigungen."},views:{404:{error_message:"Wir haben überall gesucht, aber diese Seite scheint Verstecken zu spielen... und sie gewinnt! Lass uns dich zurück an einen Ort bringen, der existiert."},adminpanel:{core:"Core",frameworker:"Frameworker",general:"Allgemein",logged_in_users:"Derzeit angemeldete Benutzer",plugins:"Plugins",title:"Admin Panel"},camera:{detections:"Erkennungen",timeline:"Zeitleiste",title:"Kamera"},cameras:{add_camera:"Kamera hinzufügen",events:"Ereignisse",new_camera:"Neue Kamera",no_cameras:"Keine Kameras verfügbar",title:"Kameras"},cammesh:{title:"Cammesh"},camview:{all_cameras:"Alle Kameras",cameras:"Kameras",new_dnd:"Neue DND",new_view:"Neue Ansicht",no_dnds_configured:"Keine DNDs konfiguriert",no_views_configured:"Keine Ansichten konfiguriert",title:"Camview"},config:{title:"Konfiguration"},console:{title:"Logs"},firststeps:{complete:"Fertig",enjoy:"Viel Spaß!",finish_message:"Sie haben die ersten Schritte erfolgreich abgeschlossen. Sie können nun die Anwendung nutzen.",from_backup:"Aus Backup wiederherstellen",new_installation:"Neue Installation",slogan:"Die moderne Lösung für professionelle Videoüberwachung.",start:"Start",start_message:"Bitte wählen Sie, ob Sie eine neue Installation starten oder ein Backup wiederherstellen möchten.",step_account:"Konto",step_appearance:"Erscheinungsbild",step_finish:"Fertig",step_welcome:"Willkommen",title:"Erste Schritte",welcome_to:"Willkommen bei"},login:{title:"Anmelden"},plugin:{changelog:"Änderungsprotokoll",disabled_info:"Plugin ist deaktiviert",no_cameras:"Keine Kamera verfügbar",no_changelog:"Kein Änderungsprotokoll verfügbar",no_readme:"Keine Leseanleitung verfügbar",plugin_is_disabled:"Plugin ist deaktiviert",readme:"Leseanleitung",segment_tab_cameras:"Kameras",segment_tab_interface:"Interface",segment_tab_plugins:"Plugins",segment_tab_settings:"Einstellungen",settings:"Einstellungen",title:"Plugin"},plugins:{no_plugins:"Keine Plugins verfügbar",search_plugins:"Plugins suchen",title:"Plugins"},recordings:{title:"Aufnahmen"},settings:{app:"App",available_updates:"Verfügbare Aktualisierungen",available_updates_info:"Es sind Aktualisierungen für camera.ui verfügbar.",certificate:"Zertifikat",certificate_info:"Laden Sie hier das SSL-Zertifikat der Webseite herunter. Durch das Hinzufügen dieses Zertifikats zu Ihrem Keychain oder Ihrer Zertifikatsverwaltung wird die Seite als sicher erkannt. Dies verbessert die Browsererfahrung und vermeidet Sicherheitswarnungen.",connection:"Verbindung",create_backup:"Backup erstellen",create_backup_info:"Laden Sie ein Sicherungsarchiv Ihrere gesamten camera.ui Umgebung herunter. Dadurch wird der Inhalt Ihres camera.ui Speicherungsverzeichnisses gesichert. Diesen können Sie später auf jeder Plattform wiederherstellen auf der camera.ui läuft.",edit:"Bearbeiten",interface:"Interface",locale:"Sprache",network:"Netzwerk",network_info:"Konfigurieren Sie hier die IP-Adressen, die der Server für die WebRTC-Kommunikation mit den Kameras verwendet. Diese Einstellung ermöglicht eine stabile und effiziente Verbindung zwischen Ihrem System und den angeschlossenen Kameras.",not_available_updates_info:"Ihre camera.ui Version ist auf dem neuesten Stand.",password:"Passwort",profile:"Profil",registered_users:"Registrierte Benutzer",remote_access_info:"Konfigurieren Sie hier die Remote-Zugriffseinstellungen. Diese Einstellungen ermöglichen es Ihnen, von überall auf Ihre camera.ui Umgebung zuzugreifen.",remote_access_settings:"Remote Zugriff Einstellungen",remove:"Entfernen",reset_server:"Server zurücksetzen",reset_server_info:"Durch Klicken auf diesen Button setzen Sie die Konfiguration auf die Standardwerte zurück. Dies entfernt alle Ihre Einstellungen und Daten. Diese Aktion kann nicht rückgängig gemacht werden.",restart_server:"Server neustarten",restart_server_info:"Durch Klicken auf diesen Button starten Sie den Server neu. Ein Ladebildschirm wird angezeigt, bis der Neustart abgeschlossen ist. Anschließend wird die Seite automatisch aktualisiert und steht Ihnen wieder zur Verfügung.",restore_backup:"Backup wiederherstellen",restore_backup_info:"Stellen Sie ein Sicherungsarchiv wieder her, das Sie zuvor mit camera.ui erstellt haben. Ihre camera.ui Konfiguration, Datenbank, Benutzerkonten und Medien werden wiederhergestellt.",search_by_name:"Nach Namen suchen",searching_updates:"Suche nach Aktualisierungen...",server:"Server",sheduled_backup:"Geplantes Backup",sheduled_backup_info:"Planen Sie ein Backup der aktuellen Konfiguration",status:"Status",theme:"Thema",title:"Einstellungen",title_account:"Konto",title_appearance:"Erscheinungsbild",title_backup:"Backup",title_go2rtc:"Go2RTC",title_remote:"Remote Zugriff",title_nvr:"NVR",title_recordings:"Aufnahmen",title_system:"System",title_user:"Benutzer",unknown:"Unbekannt",update_available:"Aktualisierung verfügbar",version:"Version"}}},ik={components:{camera_draggable:{no_cameras:"No cameras available"},camera_events:{no_events:"No events available"},camera_options:{advanced:"Advanced",audio_state:"Audio state",battery_state:"Battery state",branding:"Branding",categories:"Categories",chip_audioDetection:"Audio detection",chip_cameraController:"Camera",chip_hub:"Hub",chip_more:"More",chip_motionDetection:"Motion detection",chip_objectDetection:"Object detection",chip_plugins:"Plugins",chip_ptz:"PTZ",detection:"Detection",doorbell_state:"Doorbell state",enabled_extension:"Enabled extension",frame_worker:"Frame Worker",general:"General",interface:"Interface",light_state:"Light state",manage_plugins:"Manage plugins",model:"Model",more_plugins:"More plugins",motion_detection:"Motion detection",motion_state:"Motion state",name:"Name",native:"Native",no_config:"No configuration available",no_plugins_enabled:"No plugins enabled",no_plugins_found:"No plugins found",object_detection:"Object detection",object_state:"Object state",plugin:"Plugin",plugin_settings:"Plugin settings",recordings:"Recordings",settings:"Settings",siren_state:"Siren state",source:"Source",snapshot:"Snapshot",streaming_mode:"Streaming mode",unknown:"Unknown",zones:"Zones"},camera_table:{cameras:"Cameras",name:"Name",offline:"Offline",online:"Online",status:"Status"},charts:{no_data:"No data available"},detection_interface:{audio_detected:"Audio detected",audio_not_detected:"Audio not detected",audio_required:"Audio required",detect:"Detect",drop_or_select_audio_to_detect:"Drop or select audio to detect",drop_or_select_image_to_detect_objects:"Drop or select image to detect objects",drop_or_select_video_to_detect_motion:"Drop or select video to detect motion",file_size_error:"File size error",image_required:"Image required",interface_config:"Interface configuration",no_interface_config:"No interface configuration available",only_one_audio_allowed:"Es ist nur ein Audio erlaubt",only_one_image_allowed:"Only one image allowed",only_one_video_allowed:"Only one video allowed",video_required:"Video required"},dialog:{components:{new_camera:{add_camera:"Add camera",add_camera_description:"Add a camera connected to your local network",camera:"Camera",discover_cameras:"Discover cameras",discover_cameras_description:"Search for cameras in your local network",no_cameras_found:"No cameras found",protocol_info:"Information about the selected protocol",scan_again:"Scan again",search_camera:"Search camera",source:"Source",test_source:"Test camera source",title:"New camera",unknown:"Unknown"}},message:{confirm_clear_log:"Are you sure you want to clear the log?",confirm_remove:"Are you sure you want to remove this camera?",confirm_remove_layout:"Are you sure you want to remove this layout?",confirm_reset_server:"Are you sure you want to reset the server?",confirm_restart_go2rtc:"Are you sure you want to restart the Go2RTC?",confirm_restart_plugin:"Are you sure you want to restart this plugin?",confirm_restart_server:"Are you sure you want to restart the server?",confirm_restore:"Are you sure you want to restore this backup?",confirm_uninstall_plugin:"Are you sure you want to uninstall this plugin?",intercom_info:"Speak simultaneously to all cameras that have intercom"},title:{config:"Configuration",confirm:"Confirm",create_new_user:"New user",edit_dnd:"Edit DND",edit_layout:"Edit layout",edit_user:"Edit user",edit_view:"Edit view",information:"Information",install:"Install",install_version:"Install version",intercom:"Intercom",log:"Log",new_dnd:"New DND",new_view:"New view",new_zone:"New zone",plugin_config:"Plugin config",preview:"Preview",remove_layout:"Remove layout",reset_server:"Reset server",restart:"Restart",result:"Result",search_plugin:"Search plugin",update:"Update",unknown:"Unknown",zone:"Zone",zone_editor:"Zone editor"}},form:{button:{add:"Add",add_source:"Add source",add_view:"Add view",back:"Back",cancel:"Cancel",change_view:"Change view",clear:"Clear",close:"Close",continue:"Continue",create_new_user:"Create new user",download:"Download",download_backup_archive:"Download backup archive",download_cert:"Download certificate",edit:"Edit",edit_zones:"Edit zones",finish:"Finish",go_to_message:"Go to message",home:"Home",install:"Install",login:"Login",logout:"Logout",logout_all:"Logout all",manage:"Manage",mark_as_read:"Mark as read",new:"New",new_zone:"New zone",next:"Next",open_editor:"Open editor",previous:"Previous",reinstall:"Reinstall",remove:"Remove",reset:"Reset",restart:"Restart",restore_backup_archive:"Restore backup archive",restore_and_restart:"Restore and restart",save:"Save",save_and_restart:"Save and restart",submit:"Submit",test_connection:"Test connection",update:"Update",undo:"Undo",uninstall:"Uninstall",upload:"Upload"},error:{no_cameras_selected:"No cameras selected",no_view_selected:"No view selected"},hint:{aspect_ratio:"Forces the camera aspect ratio to the selected value",cache_time:"Time in milliseconds used for the camera image cache",confidence:"The required confidence level for object detection",default_settings_page:"The default page shown when opening settings",disable_camera:"Deactivates the camera and stops all activities. The camera will still be displayed",frameworker_decoder:"The decoder used for the frame worker",frameworker_fps:"The number of frames per second used for the frame worker. '0' uses the native frame rate",frameworker_resolution:"The camera resolution used for the frame worker",hot_mode:"Keeps the connection to the camera active to minimize delay",motion_duration:"Time in seconds the camera needs to return to normal mode after motion detection",navbar_stay_collapsed:"Keeps the navbar collapsed, even on larger screens",remember_me:"Allows the session not to expire",session_timer:"Time in milliseconds before the session expires",show_bottombar_on_mobile:"Shows the bottom bar on mobile devices",show_camera_events:"Shows camera events in the camera view",single_session:"Allows only one active session per user",streaming_mode:"Stream transport protocol for the user interface. In 'auto' mode, the best mode is automatically selected",streaming_source:"Camera source for the stream. In 'auto' mode, the best source is automatically selected",system_preference:"System setting for the user interface",use_for_snapshot:"Uses this source for snapshots (if no other suitable source exists)"},label:{actions:"Actions",aspect_ratio:"Aspect ratio",audio_codec:"Audio codec",cache_time:"Cache time",camera:"Camera",cameras:"Cameras",changelog:"Changelog",classes:"Classes",color:"Color",confidence:"Confidence",connections:"Connections",custom_domain:"Custom domain",decoder:"Decoder",default_settings_page:"Default Settings page",disabled:"Disabled",enabled:"Enabled",firmware_version:"Firmware version",fps:"FPS",frame_worker:"Frame Worker",hardware_version:"Hardware version",hot_mode:"Hot mode",language:"Language",layout_name:"Layout name",manufacturer:"Manufacturer",model:"Model",motion_duration:"Motion duration",name:"Name",navbar_stay_collapsed:"Stay navbar collapsed",new_password:"New password",new_password_confirm:"Confirm new password",onvif_url:"ONVIF URL",password:"Password",pin:"PIN",plugin_version:"Plugin version",recording:"Recording",remember_me:"Remember me",remote_access_mode:"Remote access mode",remove_storage:"Remove storage",resolution:"Resolution",role:"Role",rtsp_url:"RTSP URL",select_all:"Select all",select_cameras:"Select cameras",serial_number:"Serial number",server_addresses:"Server addresses",server_version:"Server version",session_timer:"Session timer",settings:"Settings",show_bottombar_on_mobile:"Show bottombar on mobile",show_camera_events:"Show camera events",single_session:"Single Session",source:"Source",source_label:"Source label",source_name:"Source name",source_role:"Source role",sources:"Sources",snapshot_url:"Snapshot URL",streaming_mode:"Streaming mode",streaming_source:"Streaming source",support_url:"Support URL",system_preference:"System preference",theme:"Theme",type:"Type",url:"URL",use_for_snapshot:"Use for snapshot",username:"Username",version:"Version",video_codec:"Video codec",views:"Views",zone_name:"Zone name"},tooltip:{activity_mode_activity:"Activity",activity_mode_always_on:"Always On",activity_mode_standby:"Standby",clear:"Clear",contain:"Contain",copied:"Copied",delete:"Delete",disable_drag:"Disable drag",disabled:"Disabled",download:"Download",edit:"Edit",enable_drag:"Enable drag",exclude:"Exclude",finish:"Finish",fullscreen_off:"Fullscreen off",fullscreen_on:"Fullscreen on",hide_timeline:"Hide timeline",include:"Include",intercom:"Intercom",intersect:"Intersect",logout:"Logout",mode:"Mode",mute:"Mute",new:"New",privacy_mask:"Privacy mask",public_mask:"Public mask",resolution:"Resolution",restart:"Restart",show_timeline:"Show timeline",source_role_auto:"Auto",source_role_low:"Low Resolution",source_role_mid:"Mid Resolution",source_role_high:"High Resolution",source_role_snapshot:"Snapshot",source_role_unknown:"Unknown",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unknown",streaming_mode_webrtc:"WebRTC ",undo:"Undo",unmute:"Unmute",update_available:"Update available",zoom_in:"Zoom in",zoom_out:"Zoom out"}},notification_menu:{clear_notifications:"Clear notifications",debug:"Debug",error:"Error",info:"Info",no_notifications:"No notifications",notifications:"Notifications",short_days:"d",short_hours:"hr",short_minutes:"min",short_months:"mo",short_years:"yr",verbose:"Verbose",warn:"Warning"},options_sidebar:{segment_tab_default:"Default",segment_tab_overview:"Overview",segment_tab_plugins:"Plugins",segment_tab_settings:"Settings",segment_tab_sources:"Sources"},player:{add_shortcuts:"Add shortcuts",capture_snapshot:"Capture snapshot",activity_mode_activity:"Activity",activity_mode_always_on:"Always On",activity_mode_standby:"Standby",detections:"Detections",hide_shortcuts:"Hide shortcuts",hide_timeline:"Hide timeline",hide_zones:"Hide zones",live:"Live",log:"Log",ptz:"PTZ",ptz_go_to_home:"Go to home",reconnecting:"Reconnecting...",refresh_snapshot:"Refresh snapshot",save_shortcuts:"Save shortcuts",settings:"Settings",share_camera:"Share Camera",show_shortcuts:"Show shortcuts",show_timeline:"Show timeline",show_zones:"Show zones",source_role_auto:"Auto",source_role_low:"Low Resolution",source_role_mid:"Mid Resolution",source_role_high:"High Resolution",source_role_snapshot:"Snapshot",source_role_unknown:"Unknown",stream_paused:"Stream paused to conserve resources. Click on stream to resume.",streaming_mode_auto:"Auto",streaming_mode_mse:"MSE",streaming_mode_unknown:"Unknown",streaming_mode_webrtc:"WebRTC ",zoom_in:"Zoom in",zoom_out:"Zoom out"},plugin_card:{author:"Author",installed:"Installed",no_description:"No description available",restart:"Restart",select_version:"Select version",settings:"Settings",start:"Start",status_disabled:"Disabled",status_error:"Error",status_ready:"Ready",status_started:"Started",status_starting:"Starting",status_stopped:"Stopped",status_unknown:"Unknown",stop:"Stop",uninstall:"Uninstall",update:"Update",update_available:"Update available",updated:"Updated",version:"Version"},plugin_search:{plugins:"Plugins",refresh:"Refresh"},plugin_types:{hub:"Hub",cameraController:"Camera Controller",motionDetection:"Motion Detection",objectDetection:"Object Detection",audioDetection:"Audio Detection",ptz:"PTZ"},process_table:{status_error:"Error",status_ready:"Ready",status_started:"Started",status_starting:"Starting",status_stopped:"Stopped",status_stopping:"Stopping",status_unknown:"Unknown",system:"System",title_cpu:"CPU",title_cpu_load:"CPU load",title_memory:"Memory",title_memory_load:"Memory load",title_name:"Name",title_pid:"PID"},timeline:{live:"Live"},topbar:{syncing_data:"Syncing data..."},toast:{backup_downloaded:"Backup file download successfully",backup_restored:"Backup file restored successfully",camera_added:"Camera added successfully",camera_removed:"Camera removed successfully",camera_updated:"Camera updated successfully",cameras_removed:"Cameras removed successfully",config_deleted:"Configuration deleted successfully",config_go2rtc_deleted:"Go2RTC configuration deleted successfully",config_go2rtc_updated:"Go2RTC configuration updated successfully",config_updated:"Configuration updated successfully",error_see_console:"Error, see console",frame_worker_restarted:"Frame worker restarted successfully",go2rtc_restarted:"Go2RTC restarted successfully",log_cleared:"Log cleared successfully",no_version_selected:"No version selected",plugin_config_updated:"Plugin configuration updated successfully",plugin_disabled:"Plugin disabled successfully",plugin_enabled:"Plugin enabled successfully",plugin_installed:"Plugin installed successfully",plugin_removed:"Plugin removed successfully",plugin_request_sent:"Plugin request send successfully",plugin_restarted:"Plugin restarted successfully",plugin_settings_updated:"Plugin settings updated successfully",plugin_started:"Plugin started successfully",plugin_stopped:"Plugin stopped successfully",plugins_removed:"Plugins removed successfully",profile_updated:"Profile updated successfully",server_resetted:"Server resetted successfully",server_restarted:"Server restarted successfully",server_updated:"Server updated successfully",title_error:"Error",title_info:"Info",title_success:"Success",title_warn:"Warning",user_added:"User added successfully",user_logged_out:"User logged out successfully",user_removed:"User removed successfully",user_updated:"User updated successfully",users_removed:"Users removed successfully",validation_failed:"Validation failed. Check console for more information",view_added:"View added successfully",view_removed:"View removed successfully",view_updated:"View updated successfully",views_removed:"Views removed successfully",zone_updated:"Zone updated successfully",zone_removed:"Zone removed successfully"},upload_files:{drop_or_select_file:"Drop or select file",only_one_file_allowed:"Only one file allowed"},user_menu:{account:"Account",admin_panel:"Adminpanel",config:"Configuration",console:"Logs",logout:"Logout",plugins:"Plugins",reload:"Reload"},user_table:{title_address:"Address",title_device:"Device",title_username:"Username",you:"You"},view_box:{available_streams:"Available streams"},zone_editor:{edit_zones:"Zonen bearbeiten",zone:"Zone"}},general:{loading:"Loading...",role_admin:"Admin",role_user:"User"},navigation:{account:"Account",adminpanel:"Adminpanel",appearance:"Appearance",backup:"Backup",cameras:"Cameras",cammesh:"Cammesh",camview:"Camview",config:"Configuration",console:"Logs",extras:"Extras",nvr:"NVR",plugins:"Plugins",recordings:"Recordings",remote:"Remote Access",settings:"Settings",system:"System",user:"Users"},navigation_description:{account_description:"Manage account settings & experience.",appearance_description:"Manage app appearance & interface.",backup_description:"Manage, schedule backups & restore data.",nvr_description:"Manage Network Video Recorder system.",recordings_description:"Manage recordings & storage options.",remote_access_description:"Manage remote access and connection settings.",system_description:"Manage system, monitor status & tasks.",user_description:"Manage users, roles & permissions."},views:{404:{error_message:"We've looked everywhere, but this page seems to be playing hide and seek... and it's winning! Let's get you back to somewhere that exists."},adminpanel:{core:"Core",frameworker:"Frameworker",general:"General",logged_in_users:"Logged in users",plugins:"Plugins",title:"Adminpanel"},camera:{detections:"Detections",timeline:"Timeline",title:"Camera"},cameras:{add_camera:"Add camera",events:"Events",new_camera:"New camera",no_cameras:"No cameras available",title:"Cameras"},cammesh:{title:"Cammesh"},camview:{all_cameras:"All cameras",cameras:"Cameras",new_dnd:"New DND",new_view:"New View",no_dnds_configured:"No DNDs configured",no_views_configured:"No views configured",title:"Camview"},config:{title:"Configuration"},console:{title:"Logs"},firststeps:{complete:"Complete",enjoy:"Enjoy!",finish_message:"You have successfully completed the first steps. You can now start using the application.",from_backup:"Restore from Backup",new_installation:"New Installation",slogan:"The modern solution for professional video surveillance.",start:"Start",start_message:"Please choose whether you want to start a new installation or restore from a backup.",step_account:"Account",step_appearance:"Appearance",step_finish:"Finish",step_welcome:"Welcome",title:"First steps",welcome_to:"Welcome to"},login:{title:"Login"},plugin:{changelog:"Changelog",disabled_info:"Plugin is disabled",no_cameras:"No cameras available",no_changelog:"No changelog available",no_readme:"No readme available",plugin_is_disabled:"Plugin is disabled",readme:"Readme",segment_tab_cameras:"Cameras",segment_tab_interface:"Interface",segment_tab_plugins:"Plugins",segment_tab_settings:"Settings",settings:"Settings",title:"Plugin"},plugins:{no_plugins:"No plugins available",search_plugins:"Search plugins",title:"Plugins"},recordings:{title:"Recordings"},settings:{app:"App",available_updates:"Available updates",available_updates_info:"Updates are available for camera.ui.",certificate:"Certificate",certificate_info:"Download the SSL certificate of the website here. By adding this certificate to your keychain or certificate management, the site is recognized as secure. This improves the browser experience and avoids security warnings.",connection:"Connection",create_backup:"Create backup",create_backup_info:"Create a backup of the current configuration. Download a backup archive of your entire camera.ui environment. This will backup the contents of your camera.ui storage directory. You can restore this later on any platform where camera.ui is running.",edit:"Edit",interface:"Interface",locale:"Locale",network:"Network",network_info:"Configure here the IP addresses the server uses for WebRTC communication with the cameras. This setting allows for a stable and efficient connection between your system and the connected cameras.",not_available_updates_info:"You are using the latest version of camera.ui",password:"Password",profile:"Profile",registered_users:"Registered users",remote_access_info:"Configure the remote access settings here. These settings allow you to access your camera.ui environment from anywhere.",remote_access_settings:"Remote access settings",remove:"Remove",reset_server:"Reset server",reset_server_info:"By clicking this button you reset the configuration to the default values. This removes all your settings and data. This action cannot be undone.",restart_server:"Restart server",restart_server_info:"By clicking this button you restart the server. A loading screen will be displayed until the restart is complete. The page will then be automatically refreshed and available to you again.",restore_backup:"Restore backup",restore_backup_info:"Restore a backup archive you previously created with camera.ui. Your camera.ui configuration, database, user accounts, and media will be restored.",search_by_name:"Search by name",searching_updates:"Searching for updates...",server:"Server",sheduled_backup:"Sheduled backup",sheduled_backup_info:"Shedule a backup of the current configuration",status:"Status",theme:"Theme",title:"Settings",title_account:"Account",title_appearance:"Appearance",title_backup:"Backup",title_go2rtc:"Go2RTC",title_nvr:"NVR",title_recordings:"Recordings",title_remote:"Remote Access",title_system:"System",title_user:"User",unknown:"Unknown",update_available:"Update available",version:"Version"}}},ok={de:rk,en:ik},ak=["af","ar","ar-ae","ar-bh","ar-dz","ar-eg","ar-iq","ar-jo","ar-kw","ar-lb","ar-ly","ar-ma","ar-om","ar-qa","ar-sa","ar-sy","ar-tn","ar-ye","as","ast","az","be","bg","bn","br","bs","ca","ce","ch","co","cr","cs","cv","cy","da","de","de-at","de-ch","de-de","de-li","de-lu","el","en","en-au","en-bz","en-ca","en-gb","en-ie","en-jm","en-nz","en-ph","en-tt","en-us","en-za","en-zw","eo","es","es-ar","es-bo","es-cl","es-co","es-cr","es-do","es-ec","es-es","es-gt","es-hn","es-mx","es-ni","es-pa","es-pe","es-pr","es-py","es-sv","es-uy","es-ve","et","eu","fa","fa-ir","fi","fj","fo","fr","fr-be","fr-ca","fr-ch","fr-fr","fr-lu","fr-mc","fur","fy","ga","gd","gd-ie","gl","gu","he","hi","hr","hsb","ht","hu","hy","id","is","it","it-ch","iu","ja","ji","ka","kk","km","kn","ko","ko-kp","ko-kr","ks","ky","la","lb","lt","lv","mi","mk","ml","mo","mr","ms","mt","my","nb","ne","ng","nl","nl-be","nn","no","nv","oc","om","or","pa","pa-in","pa-pk","pl","pt","pt-br","qu","rm","ro","ro-mo","ru","ru-mo","sa","sb","sc","sd","sg","si","sk","sl","so","sq","sr","sv","sv-fi","sv-sv","sw","sx","sz","ta","te","th","tig","tk","tlh","tn","tr","ts","tt","uk","ur","ve","vi","vo","wa","xh","zh","zh-cn","zh-hk","zh-sg","zh-tw","zu"],Ca="en",Mp=["de","en"],ck=s=>{var t;const e=n=>lk(ak.find(r=>r===(n==null?void 0:n.toLowerCase())));return(t=window.navigator)!=null&&t.language?e(window.navigator.language):e("en")},lk=s=>{if(!s)return Ca;switch(s){case Mp.find(e=>e===s):return s;default:return Ca}},uk=df({locale:ck(),fallbackLocale:Ca,legacy:!1,globalInjection:!0,messages:ok}),dk={de:Mf,en:Af},hk=Mi("locale",()=>{const s=tl("locale",Ca),e=ae(Mp),t=$f(),n=js();Ge(s,o=>{r(o),i(o)});const r=o=>{var a;(a=window.electron)==null||a.send("change-language",o),n.locale.value=o},i=async o=>{const a=dk[o];a&&(t.config.locale=a)};return r(s.value),i(s.value),{languages:e,locale:s,setI18Nlocale:r,setPrimeVueLocale:i}}),mk={key:1},pk=At({__name:"App",setup(s){const{navbarState:e,subbarState:t,showBottombar:n,showNavbar:r,showTopbar:i}=ja(),o=Ci(),a=$i(),l=qr(),u=Cn(),d=Nl(),h=hp(),v=Fs(),f=Pl(),{mdBreakpoint:b}=Vr(),{isPWA:k}=Ol(),{t:z}=js();hk();const{theme:L}=Vs(d),{routerLoading:se}=Vs(h),{isLoggedIn:K}=Vs(v),{isConnected:N}=Vs(f),E=Vt("navbarRef"),O=Vt("topbarRef"),U=Vt("bottombarRef"),S=ae(!0),M=ae(!0),B=Ls(),W=ae(!1),I=ae(!1),w=ri(E),H=ri(O),J=ri(U);o.setDefaultOptions({queries:{refetchOnWindowFocus:!1,gcTime:5*60*1e3,staleTime:1e4,networkMode:"always",retry:(F,D)=>{var Y,Te,He;if(D instanceof uf&&((Y=D.response)==null?void 0:Y.status)===401)return Fs().logout(),!1;if(F===0){const ht=((He=(Te=D.response)==null?void 0:Te.data)==null?void 0:He.message)??D.message??D;u.add({severity:"error",summary:z("components.toast.title_error"),detail:ht,life:3e3}),console.error(ht)}return F<2}},mutations:{retry:0,networkMode:"always",onError:F=>{var Y,Te,He,ht;const D=((Te=(Y=F.response)==null?void 0:Y.data)==null?void 0:Te.message)??F.message??F;u.add({severity:"error",summary:z("components.toast.title_error"),detail:D,life:3e3}),console.error(((ht=(He=F.response)==null?void 0:He.data)==null?void 0:ht.message)??F.message??F)}}});const q=ne(()=>{var Y,Te;let F="var(--ground-background)";const D=Xs((Y=a==null?void 0:a.meta.ui)==null?void 0:Y.background);return(Te=a==null?void 0:a.meta.ui)!=null&&Te.showTopbar?F="var(--topbar-background)":D&&(F=D),F}),oe=ne(()=>{var Y,Te;const F=O.value?`${H.height.value}px`:"env(safe-area-inset-top, 0px)",D=U.value?`${J.height.value}px`:Xs((Te=(Y=a.meta.ui)==null?void 0:Y.containerSettings)==null?void 0:Te.ignoreSafeAreaBottom)?"0px":"env(safe-area-inset-bottom, 0px)";return k.value?`calc(100vh - ${F} - ${D})`:`calc(100dvh - ${F} - ${D})`}),ue=ne(()=>{var F;return((F=a.meta.auth)==null?void 0:F.requiresAuth)&&!K.value||S.value});Ge(M,(F,D)=>{D===!1&&F===!0&&o.refetchQueries()}),Ge(K,F=>{F?B.value=f.connect():(B.value=void 0,f.disconnect())},{immediate:!0}),Ge(N,F=>{K.value?M.value=F:M.value=!0}),Ge(se,F=>{const{isLoading:D}=cf(0,{parent:"body"});D.value=F},{immediate:!0}),Ge([q,L],()=>{Zs(()=>{var D,Y;if(/^var\([^)]+\)$/.test(q.value)){const Te=window.getComputedStyle(document.body),He=q.value.split("var(")[1].split(")")[0],ht=Te.getPropertyValue(He);(D=document.querySelector('meta[name="theme-color"]'))==null||D.setAttribute("content",ht)}else(Y=document.querySelector('meta[name="theme-color"]'))==null||Y.setAttribute("content",q.value)})},{immediate:!0}),Ge(a,F=>{var D,Y;Xs((Y=(D=F.meta.ui)==null?void 0:D.containerSettings)==null?void 0:Y.disableScroll)?(document.body.classList.add("disable-overflow-scroll"),document.documentElement.classList.add("disable-overflow-scroll")):(document.body.classList.remove("disable-overflow-scroll"),document.documentElement.classList.remove("disable-overflow-scroll"))},{immediate:!0,deep:!0});const Se=()=>{const F=document.querySelector('meta[name="electron-server"]'),D=F!==null&&F.getAttribute("content")==="true";W.value=window.electron!==void 0,I.value=D,setTimeout(()=>{W.value=window.electron!==void 0,I.value=D},100)};return Sn(async()=>{await l.isReady(),S.value=!1,Se()}),(F,D)=>{var wt,zt,nt,Yt,Be,Ue,V,X,_e,ye,fe;const Y=ek,Te=j0,He=q0,ht=D0,Mt=ZC,Qe=tw,ze=Db,ge=Fb,pt=Ei("RouterView"),Jt=e1;return c(ue)||!c(M)?(m(),A("div",{key:0,class:"flex w-full h-full justify-center items-center absolute z-50",style:ot({minHeight:c(k)?"100vh !important":"100dvh !important"})},[y(Y,{reload:"",icon:!c(M)&&c(K)?c(nk):void 0},null,8,["icon"])],4)):(m(),A("div",mk,[y(Te,{position:"bottom-right"}),y(He),y(ht),y(Mt),c(i)?(m(),j(Qe,{key:0,ref_key:"topbarRef",ref:O,style:ot({left:c(b)?"0px":`${c(w).width.value}px`}),class:"z-2 top-0"},null,8,["style"])):ce("",!0),c(n)?(m(),j(ze,{key:1,ref_key:"bottombarRef",ref:U,class:"z-2"},null,512)):ce("",!0),c(r)?(m(),j(ge,{key:2,ref_key:"navbarRef",ref:E,class:"z-3 top-0 left-0"},null,512)):ce("",!0),g("main",{id:"container",class:"relative w-dvw z-1",style:ot({paddingTop:c(O)?`${c(H).height.value}px`:"env(safe-area-inset-top, 0px)",paddingLeft:c(E)&&!c(b)?`${c(w).width.value}px`:"env(safe-area-inset-left, 0px)",paddingRight:"env(safe-area-inset-right, 0px)",paddingBottom:c(U)?`${c(J).height.value}px`:("toValue"in F?F.toValue:c(Xs))((zt=(wt=F.$route.meta.ui)==null?void 0:wt.containerSettings)==null?void 0:zt.ignoreSafeAreaBottom)?"0px":"env(safe-area-inset-bottom, 0px)"})},[g("div",{class:at(["w-full max-w-full h-full grid",{"p-4":("toValue"in F?F.toValue:c(Xs))((Yt=(nt=F.$route.meta.ui)==null?void 0:nt.containerSettings)==null?void 0:Yt.padding)}]),style:ot({minHeight:c(oe),maxHeight:("toValue"in F?F.toValue:c(Xs))((Ue=(Be=F.$route.meta.ui)==null?void 0:Be.containerSettings)==null?void 0:Ue.disableScroll)?c(oe):void 0,height:("toValue"in F?F.toValue:c(Xs))((X=(V=F.$route.meta.ui)==null?void 0:V.containerSettings)==null?void 0:X.disableScroll)?c(oe):void 0,overflow:("toValue"in F?F.toValue:c(Xs))((ye=(_e=F.$route.meta.ui)==null?void 0:_e.containerSettings)==null?void 0:ye.disableScroll)?"hidden":void 0})},[y(pt,{class:"w-full h-full relative overflow-x-hidden"})],6)],4),c(W)?(m(),j(Jt,{key:3})):ce("",!0),c(e)==="opened"||c(t)==="opened"&&c(b)?(m(),j(Qh,{key:4,to:c(e)==="opened"?"#app":"#container",defer:""},[c(b)?(m(),A("div",{key:0,class:at(["fixed top-0 left-0 right-0 bottom-0 w-full h-full bg-black/50 z-1",{"z-2":c(e)==="opened"}])},null,2)):ce("",!0)],8,["to"])):ce("",!0),g("div",{class:"fixed-bg",style:ot({background:("toValue"in F?F.toValue:c(Xs))((fe=F.$route.meta.ui)==null?void 0:fe.background)})},null,4)]))}}}),fk=qs(pk,[["__scopeId","data-v-6277ff0b"]]),gk=hf(),vk=Tf(Rf,{primitive:{borderRadius:{none:"0",xs:"2px",sm:"4px",md:"6px",lg:"8px",xl:"12px"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"}},semantic:{transitionDuration:"0.2s",focusRing:{width:"1px",style:"solid",color:"{primary.color}",offset:"2px",shadow:"none"},disabledOpacity:"0.6",iconSize:"1rem",anchorGutter:"2px",primary:{50:"#fdf4f6",100:"#f7ccd4",200:"#f1a3b2",300:"#eb7b90",400:"#e5526e",500:"#df2a4c",600:"#be2441",700:"#9c1d35",800:"#7b172a",900:"#59111e",950:"#380b13"},formField:{paddingX:"0.75rem",paddingY:"0.5rem",sm:{fontSize:"0.875rem",paddingX:"0.625rem",paddingY:"0.375rem"},lg:{fontSize:"1.125rem",paddingX:"0.875rem",paddingY:"0.625rem"},borderRadius:"{border.radius.md}",focusRing:{width:"0",style:"none",color:"transparent",offset:"0",shadow:"none"},transitionDuration:"{transition.duration}"},list:{padding:"0.25rem 0.25rem",gap:"2px",header:{padding:"0.5rem 1rem 0.25rem 1rem"},option:{padding:"0.5rem 0.75rem",borderRadius:"{border.radius.sm}"},optionGroup:{padding:"0.5rem 0.75rem",fontWeight:"600"}},content:{borderRadius:"{border.radius.md}"},mask:{transitionDuration:"0.15s"},navigation:{list:{padding:"0.25rem 0.25rem",gap:"2px"},item:{padding:"0.5rem 0.75rem",borderRadius:"{border.radius.sm}",gap:"0.5rem"},submenuLabel:{padding:"0.5rem 0.75rem",fontWeight:"600"},submenuIcon:{size:"0.875rem"}},overlay:{select:{borderRadius:"{border.radius.md}",shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"},popover:{borderRadius:"{border.radius.md}",padding:"0.75rem",shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"},modal:{borderRadius:"{border.radius.xl}",padding:"1.25rem",shadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1)"},navigation:{shadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)"}},colorScheme:{light:{surface:{0:"#ffffff",50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",850:"#0f172a",900:"#0f172a",925:"#0c1421",950:"#020617",1e3:"#000000"},primary:{color:"{primary.500}",contrastColor:"#ffffff",hoverColor:"{primary.600}",activeColor:"{primary.700}"},highlight:{background:"{primary.50}",focusBackground:"{primary.100}",color:"{primary.700}",focusColor:"{primary.800}"},mask:{background:"rgba(0,0,0,0.4)",color:"{surface.200}"},formField:{background:"{surface.50}",disabledBackground:"{surface.200}",filledBackground:"{surface.50}",filledHoverBackground:"{surface.50}",filledFocusBackground:"{surface.50}",borderColor:"{surface.300}",hoverBorderColor:"{surface.400}",focusBorderColor:"{primary.color}",invalidBorderColor:"{red.400}",color:"{surface.700}",disabledColor:"{surface.500}",placeholderColor:"{surface.500}",invalidPlaceholderColor:"{red.600}",floatLabelColor:"{surface.500}",floatLabelFocusColor:"{primary.600}",floatLabelActiveColor:"{surface.500}",floatLabelInvalidColor:"{form.field.invalid.placeholder.color}",iconColor:"{surface.400}",shadow:"0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"},text:{color:"{surface.700}",hoverColor:"{surface.800}",mutedColor:"{surface.500}",hoverMutedColor:"{surface.600}"},content:{background:"{surface.0}",hoverBackground:"{surface.100}",borderColor:"{surface.200}",color:"{text.color}",hoverColor:"{text.hover.color}"},overlay:{select:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"},popover:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"},modal:{background:"{surface.0}",borderColor:"{surface.200}",color:"{text.color}"}},list:{option:{focusBackground:"{surface.100}",selectedBackground:"{highlight.background}",selectedFocusBackground:"{highlight.focus.background}",color:"{text.color}",focusColor:"{text.hover.color}",selectedColor:"{highlight.color}",selectedFocusColor:"{highlight.focus.color}",icon:{color:"{surface.400}",focusColor:"{surface.500}"}},optionGroup:{background:"transparent",color:"{text.muted.color}"}},navigation:{item:{focusBackground:"{surface.100}",activeBackground:"{surface.100}",color:"{text.color}",focusColor:"{text.hover.color}",activeColor:"{text.hover.color}",icon:{color:"{surface.400}",focusColor:"{surface.500}",activeColor:"{surface.500}"}},submenuLabel:{background:"transparent",color:"{text.muted.color}"},submenuIcon:{color:"{surface.400}",focusColor:"{surface.500}",activeColor:"{surface.500}"}}},dark:{surface:{0:"#ffffff",50:"#f5f5f5",100:"#d1d1d1",200:"#adadad",300:"#898989",400:"#646464",500:"#404040",600:"#363636",700:"#2d2d2d",800:"#232323",850:"#1d1d1d",900:"#1a1a1a",925:"#161616",950:"#101010",1e3:"#0d0d0d"},primary:{color:"{primary.500}",contrastColor:"{surface.900}",hoverColor:"{primary.600}",activeColor:"{primary.700}"},highlight:{background:"color-mix(in srgb, {primary.400}, transparent 84%)",focusBackground:"color-mix(in srgb, {primary.400}, transparent 76%)",color:"rgba(255,255,255,.87)",focusColor:"rgba(255,255,255,.87)"},mask:{background:"rgba(0,0,0,0.6)",color:"{surface.200}"},formField:{background:"{surface.925}",disabledBackground:"{surface.700}",filledBackground:"{surface.800}",filledHoverBackground:"{surface.800}",filledFocusBackground:"{surface.800}",borderColor:"{surface.800}",hoverBorderColor:"{surface.500}",focusBorderColor:"{primary.color}",invalidBorderColor:"{red.300}",color:"{surface.0}",disabledColor:"{surface.400}",placeholderColor:"{surface.400}",invalidPlaceholderColor:"{red.400}",floatLabelColor:"{surface.400}",floatLabelFocusColor:"{primary.color}",floatLabelActiveColor:"{surface.400}",floatLabelInvalidColor:"{form.field.invalid.placeholder.color}",iconColor:"{surface.400}",shadow:"0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(18, 18, 23, 0.05)"},text:{color:"{surface.0}",hoverColor:"{surface.0}",mutedColor:"{surface.400}",hoverMutedColor:"{surface.300}"},content:{background:"{surface.900}",hoverBackground:"{surface.800}",borderColor:"{surface.700}",color:"{text.color}",hoverColor:"{text.hover.color}"},overlay:{select:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"},popover:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"},modal:{background:"{surface.900}",borderColor:"{surface.700}",color:"{text.color}"}},list:{option:{focusBackground:"{surface.800}",selectedBackground:"{highlight.background}",selectedFocusBackground:"{highlight.focus.background}",color:"{text.color}",focusColor:"{text.hover.color}",selectedColor:"{highlight.color}",selectedFocusColor:"{highlight.focus.color}",icon:{color:"{surface.500}",focusColor:"{surface.400}"}},optionGroup:{background:"transparent",color:"{text.muted.color}"}},navigation:{item:{focusBackground:"{surface.800}",activeBackground:"{surface.800}",color:"{text.color}",focusColor:"{text.hover.color}",activeColor:"{text.hover.color}",icon:{color:"{surface.500}",focusColor:"{surface.400}",activeColor:"{surface.400}"}},submenuLabel:{background:"transparent",color:"{text.muted.color}"},submenuIcon:{color:"{surface.500}",focusColor:"{surface.400}",activeColor:"{surface.400}"}}}}}}),_k=()=>{const s=Z0(fk);return s.directive("tooltip",jr),s.use(La).use(gk).use(uk).use(B0).use(z0).use(U0).use(Pf,{theme:{preset:vk,options:{cssLayer:{name:"primevue",order:"theme, base, primevue"},darkModeSelector:".dark-mode"}}}).use($0),s},yk=_k();yk.mount("#app");export{Bi as $,S4 as A,Lb as B,Jn as C,fp as D,f9 as E,pp as F,t8 as G,r8 as H,G8 as I,U8 as J,Q8 as K,rx as L,g8 as M,tx as N,gx as O,mx as P,ux as Q,ax as R,Sa as S,Y5 as T,R_ as U,U4 as V,$4 as W,E4 as X,b4 as Y,l9 as Z,Fa as _,Il as a,u9 as a0,Nl as a1,vs as a2,Ie as a3,bp as a4,v2 as a5,S6 as a6,hh as a7,uh as a8,ch as a9,mh as aa,dh as ab,fh as ac,xp as ad,Ep as ae,Km as af,$3 as ag,h9 as ah,hd as ai,Uc as aj,T2 as ak,a9 as al,Rl as am,uo as an,p9 as ao,Zm as ap,c9 as aq,hk as ar,g9 as as,m9 as at,d9 as au,Si as b,Cn as c,xi as d,Ol as e,Pl as f,Fr as g,Vr as h,_o as i,zc as j,y9 as k,_9 as l,d3 as m,wp as n,v9 as o,kp as p,Tl as q,O_ as r,I_ as s,ja as t,Fs as u,kh as v,Fl as w,kl as x,Ap as y,qs as z};
|