@camera.ui/server 0.0.58-internal.2 → 0.0.59
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/cupdate.config.txt +1 -0
- package/dist/interface/assets/{main.CTd_HbrU.0.0.58-internal.2.css → main.CuA7U3df.0.0.59.css} +1 -1
- package/dist/interface/index.html +44 -44
- package/dist/interface/js/{@primevue.CCOhlpr_.0.0.58-internal.2.js → @primevue.B74XGlz4.0.0.59.js} +1 -1
- package/dist/interface/js/@tanstack.CmhkBmOY.0.0.59.js +1 -0
- package/dist/interface/js/{@vee-validate.DXQYyKnw.0.0.58-internal.2.js → @vee-validate.Pql1j7iK.0.0.59.js} +1 -1
- package/dist/interface/js/@vueuse.MbjtYQmZ.0.0.59.js +1 -0
- package/dist/interface/js/Adminpanel.DgxPa7cC.0.0.59.js +1 -0
- package/dist/interface/js/Camera.B402UNR2.0.0.59.js +1 -0
- package/dist/interface/js/{Cameras.CH9Jp0y1.0.0.58-internal.2.js → Cameras.Dyir9gg1.0.0.59.js} +1 -1
- package/dist/interface/js/Cammesh.CeRcBXPZ.0.0.59.js +1 -0
- package/dist/interface/js/Camview.3JR8srqY.0.0.59.js +1 -0
- package/dist/interface/js/Config.XkULRDWR.0.0.59.js +2 -0
- package/dist/interface/js/Console.W83jr373.0.0.59.js +4 -0
- package/dist/interface/js/CuiConsole.CND1i8s8.0.0.59.js +1 -0
- package/dist/interface/js/CuiPluginCard.CJOUye4J.0.0.59.js +4 -0
- package/dist/interface/js/CuiTimeline.B3BXMmEx.0.0.59.js +1 -0
- package/dist/interface/js/FirstSteps.5K7O1GAZ.0.0.59.js +1 -0
- package/dist/interface/js/Plugin.C5n1wOvc.0.0.59.js +1 -0
- package/dist/interface/js/Plugins.BrRVAbdG.0.0.59.js +1 -0
- package/dist/interface/js/Recordings.CENwhYx8.0.0.59.js +1 -0
- package/dist/interface/js/Settings.Y_HQYita.0.0.59.js +1 -0
- package/dist/interface/js/SettingsAccount.CI8zj-Zp.0.0.59.js +1 -0
- package/dist/interface/js/SettingsAppearance.qKyWDUrO.0.0.59.js +1 -0
- package/dist/interface/js/SettingsAppearance.vue_vue_type_script_setup_true_lang.T86Wmd9I.0.0.59.js +1 -0
- package/dist/interface/js/SettingsBackup.YnQZKJSH.0.0.59.js +1 -0
- package/dist/interface/js/SettingsRecordings.DgWGltTw.0.0.59.js +1 -0
- package/dist/interface/js/SettingsRemote.Cd9txrZR.0.0.59.js +1 -0
- package/dist/interface/js/SettingsSystem.-M-CWxQc.0.0.59.js +1 -0
- package/dist/interface/js/SettingsUsers.CttAtlXd.0.0.59.js +1 -0
- package/dist/interface/js/VersionsHandler.vue_vue_type_script_setup_true_lang.DH0uiBR8.0.0.59.js +4 -0
- package/dist/interface/js/{ace-builds.BTc_8r0F.0.0.58-internal.2.js → ace-builds.ioqWNkDH.0.0.59.js} +2 -2
- package/dist/interface/js/ace.config.c_YyPkWD.0.0.59.js +1 -0
- package/dist/interface/js/backup.D5BdFpxO.0.0.59.js +1 -0
- package/dist/interface/js/{chart.js.DulBE9Ha.0.0.58-internal.2.js → chart.js.DaX6hBgw.0.0.59.js} +1 -1
- package/dist/interface/js/close-circle._MYhhzAG.0.0.59.js +1 -0
- package/dist/interface/js/dnd-core.DMsKrAl-.0.0.59.js +1 -0
- package/dist/interface/js/{draggabilly.4YiiUwjf.0.0.58-internal.2.js → draggabilly.B9oSznOL.0.0.59.js} +1 -1
- package/dist/interface/js/engine.io-client.BlXqqnuj.0.0.59.js +1 -0
- package/dist/interface/js/fast-deep-equal.FBO3y2GY.0.0.59.js +1 -0
- package/dist/interface/js/{highlight.js.DufLphmF.0.0.58-internal.2.js → highlight.js.cQ_7Ex6r.0.0.59.js} +1 -1
- package/dist/interface/js/linkify-it.BqQkZkf1.0.0.59.js +1 -0
- package/dist/interface/js/{main.B815hqR0.0.0.58-internal.2.js → main.DHd_dMb6.0.0.59.js} +3 -3
- package/dist/interface/js/{markdown-it.DWzo15GL.0.0.58-internal.2.js → markdown-it.B8xTmVBR.0.0.59.js} +1 -1
- package/dist/interface/js/{nprogress.Ch0iTg9A.0.0.58-internal.2.js → nprogress.C28vLvLy.0.0.59.js} +1 -1
- package/dist/interface/js/{pinia.eSJCqrRk.0.0.58-internal.2.js → pinia.DwJk4SJ-.0.0.59.js} +1 -1
- package/dist/interface/js/{primevue.DDULn9kM.0.0.58-internal.2.js → primevue.DbIzNwuR.0.0.59.js} +1 -1
- package/dist/interface/js/{qrcode.2uy4AF_1.0.0.58-internal.2.js → qrcode.DixdAggJ.0.0.59.js} +1 -1
- package/dist/interface/js/react-dnd-touch-backend.vzY2aEPv.0.0.59.js +1 -0
- package/dist/interface/js/refresh-rounded.DLGFWUn0.0.0.59.js +1 -0
- package/dist/interface/js/{rxjs.B2ccbYNa.0.0.58-internal.2.js → rxjs.DFrQz5Mr.0.0.59.js} +1 -1
- package/dist/interface/js/socket.io-client.M9yU1uIE.0.0.59.js +1 -0
- package/dist/interface/js/socket.io-parser.w7I_ynfs.0.0.59.js +1 -0
- package/dist/interface/js/system.DxdNf12K.0.0.59.js +1 -0
- package/dist/interface/js/trash-fill.DpvFEJ-X.0.0.59.js +1 -0
- package/dist/interface/js/{unidragger.D9rEVfuC.0.0.58-internal.2.js → unidragger.CTTiht5n.0.0.59.js} +1 -1
- package/dist/interface/js/{vee-validate.DxWC7Uc5.0.0.58-internal.2.js → vee-validate.Td-CaRMY.0.0.59.js} +1 -1
- package/dist/interface/js/vue-chartjs.Bc2RfUSm.0.0.59.js +1 -0
- package/dist/interface/js/{vue-i18n.D-f3YMiP.0.0.58-internal.2.js → vue-i18n.DEKQrOB4.0.0.59.js} +1 -1
- package/dist/interface/js/vue-inline-svg.Bw3375gC.0.0.59.js +1 -0
- package/dist/interface/js/{vue-router.DYUr4L8h.0.0.58-internal.2.js → vue-router.BaktRwHe.0.0.59.js} +1 -1
- package/dist/interface/js/vue-zoomable.DPOsbt78.0.0.59.js +1 -0
- package/dist/interface/js/vue3-dnd.12c13v_q.0.0.59.js +1 -0
- package/dist/interface/js/zoom-out.CapG5H39.0.0.59.js +1 -0
- package/dist/interface/sw.js +1 -1
- package/dist/server/package.json +3 -3
- package/dist/server/requirements.txt +3 -3
- package/package.json +3 -3
- package/dist/interface/js/@tanstack.DVVgae2-.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/@vueuse.CVrMoaIT.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Adminpanel.BURyS2fd.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Camera.ClowKxTJ.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Cammesh.ByVNJV12.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Camview.BPBs14YX.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Config.DxpaumCj.0.0.58-internal.2.js +0 -2
- package/dist/interface/js/Console.JIgbV0MF.0.0.58-internal.2.js +0 -4
- package/dist/interface/js/CuiConsole.DMGeAcTq.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/CuiPluginCard.Bg03ZO3b.0.0.58-internal.2.js +0 -4
- package/dist/interface/js/CuiTimeline.DQiak7sU.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/FirstSteps.DpIIjDgR.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Plugin.Br-EzIcR.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Plugins.QtoKsSO7.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Recordings.CFL4OJm9.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/Settings.IxJy7omz.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsAccount.75RYOuGO.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsAppearance.Bv4CuFga.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsAppearance.vue_vue_type_script_setup_true_lang.i29sMBTa.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsBackup.BOppgt5m.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsRecordings.Dt_qMSqs.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsRemote.CCQRT8cB.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsSystem.Bp5gBnxf.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/SettingsUsers.Cqhyznjv.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/VersionsHandler.vue_vue_type_script_setup_true_lang.DZNgfE3d.0.0.58-internal.2.js +0 -4
- package/dist/interface/js/ace.config.DUC5fdrd.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/backup.D4HEKsOi.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/close-circle.UrlBqVF6.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/dnd-core.DAMWQCvv.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/engine.io-client.DiKRcrKS.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/fast-deep-equal.Bh5FLukT.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/linkify-it.BOOCiNk4.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/react-dnd-touch-backend.BT0IbXxH.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/refresh-rounded.BOHZ0TxX.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/socket.io-client.DGrbrDom.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/socket.io-parser.DMj4FMpp.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/system.By06dkPp.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/trash-fill.Cb52hWSy.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/vue-chartjs.DUlsxriZ.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/vue-inline-svg.DASdcuI6.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/vue-zoomable.BNmlNdT9.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/vue3-dnd.DAET8WGU.0.0.58-internal.2.js +0 -1
- package/dist/interface/js/zoom-out.DyAZXu3O.0.0.58-internal.2.js +0 -1
- /package/dist/interface/assets/{@xterm.DYP7pi_n.0.0.58-internal.2.css → @xterm.DYP7pi_n.0.0.59.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.BKek2EMH.0.0.58-internal.2.css → Adminpanel.BKek2EMH.0.0.59.css} +0 -0
- /package/dist/interface/assets/{Cameras.BDWZJqPN.0.0.58-internal.2.css → Cameras.BDWZJqPN.0.0.59.css} +0 -0
- /package/dist/interface/assets/{Camview.Cvhuou6V.0.0.58-internal.2.css → Camview.Cvhuou6V.0.0.59.css} +0 -0
- /package/dist/interface/assets/{CuiConsole.DCYyxdVg.0.0.58-internal.2.css → CuiConsole.DCYyxdVg.0.0.59.css} +0 -0
- /package/dist/interface/assets/{CuiPluginCard.yF8V0SZY.0.0.58-internal.2.css → CuiPluginCard.yF8V0SZY.0.0.59.css} +0 -0
- /package/dist/interface/assets/{CuiTimeline.BkIwlYtw.0.0.58-internal.2.css → CuiTimeline.BkIwlYtw.0.0.59.css} +0 -0
- /package/dist/interface/assets/{Plugin.DJElsAn5.0.0.58-internal.2.css → Plugin.DJElsAn5.0.0.59.css} +0 -0
- /package/dist/interface/assets/{Plugins.BwPlcRrV.0.0.58-internal.2.css → Plugins.BwPlcRrV.0.0.59.css} +0 -0
- /package/dist/interface/assets/{Settings.CkgfRkQr.0.0.58-internal.2.css → Settings.CkgfRkQr.0.0.59.css} +0 -0
- /package/dist/interface/assets/{SettingsAccount.CDZT7gN-.0.0.58-internal.2.css → SettingsAccount.CDZT7gN-.0.0.59.css} +0 -0
- /package/dist/interface/assets/{SettingsBackup.CX0rT0QJ.0.0.58-internal.2.css → SettingsBackup.CX0rT0QJ.0.0.59.css} +0 -0
- /package/dist/interface/assets/{highlight.Ch2EwETz.0.0.58-internal.2.css → highlight.Ch2EwETz.0.0.59.css} +0 -0
- /package/dist/interface/assets/{logo-256.BCQk9H1-.0.0.58-internal.2.png → logo-256.BCQk9H1-.0.0.59.png} +0 -0
- /package/dist/interface/assets/{logo-512.DLKVOU2S.0.0.58-internal.2.png → logo-512.DLKVOU2S.0.0.59.png} +0 -0
- /package/dist/interface/assets/{logo.DmEiRk0z.0.0.58-internal.2.png → logo.DmEiRk0z.0.0.59.png} +0 -0
- /package/dist/interface/assets/{mode-json.Br7xisR1.0.0.58-internal.2.js → mode-json.Br7xisR1.0.0.59.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.CIYL8U3d.0.0.58-internal.2.js → mode-yaml.CIYL8U3d.0.0.59.js} +0 -0
- /package/dist/interface/assets/{worker-base.jEXLGV2h.0.0.58-internal.2.js → worker-base.jEXLGV2h.0.0.59.js} +0 -0
- /package/dist/interface/assets/{worker-json.DgwNIOck.0.0.58-internal.2.js → worker-json.DgwNIOck.0.0.59.js} +0 -0
- /package/dist/interface/assets/{worker-yaml.B3uUYINB.0.0.58-internal.2.js → worker-yaml.B3uUYINB.0.0.59.js} +0 -0
- /package/dist/interface/js/{@babel.l0sNRNKZ.0.0.58-internal.2.js → @babel.l0sNRNKZ.0.0.59.js} +0 -0
- /package/dist/interface/js/{@intlify.BkGPX90O.0.0.58-internal.2.js → @intlify.BkGPX90O.0.0.59.js} +0 -0
- /package/dist/interface/js/{@kurkle.D8fDXNIl.0.0.58-internal.2.js → @kurkle.D8fDXNIl.0.0.59.js} +0 -0
- /package/dist/interface/js/{@primeuix.BkBDkSvZ.0.0.58-internal.2.js → @primeuix.BkBDkSvZ.0.0.59.js} +0 -0
- /package/dist/interface/js/{@react-dnd.CcwRs9xb.0.0.58-internal.2.js → @react-dnd.CcwRs9xb.0.0.59.js} +0 -0
- /package/dist/interface/js/{@socket.io.Dkula2eQ.0.0.58-internal.2.js → @socket.io.Dkula2eQ.0.0.59.js} +0 -0
- /package/dist/interface/js/{@vue.Dh6viqaK.0.0.58-internal.2.js → @vue.Dh6viqaK.0.0.59.js} +0 -0
- /package/dist/interface/js/{@xterm.DvWsUiP3.0.0.58-internal.2.js → @xterm.IuPb7RlQ.0.0.59.js} +0 -0
- /package/dist/interface/js/{axios.DHr9lByg.0.0.58-internal.2.js → axios.DHr9lByg.0.0.59.js} +0 -0
- /package/dist/interface/js/{birpc.l0sNRNKZ.0.0.58-internal.2.js → birpc.l0sNRNKZ.0.0.59.js} +0 -0
- /package/dist/interface/js/{compare-versions.DqEOhma6.0.0.58-internal.2.js → compare-versions.DqEOhma6.0.0.59.js} +0 -0
- /package/dist/interface/js/{dijkstrajs.C00ieaqj.0.0.58-internal.2.js → dijkstrajs.C00ieaqj.0.0.59.js} +0 -0
- /package/dist/interface/js/{engine.io-parser.BiEtp6m2.0.0.58-internal.2.js → engine.io-parser.BiEtp6m2.0.0.59.js} +0 -0
- /package/dist/interface/js/{entities.C20TfXL6.0.0.58-internal.2.js → entities.C20TfXL6.0.0.59.js} +0 -0
- /package/dist/interface/js/{ev-emitter.X5f1qa-c.0.0.58-internal.2.js → ev-emitter.X5f1qa-c.0.0.59.js} +0 -0
- /package/dist/interface/js/{get-size.D1dS-IaP.0.0.58-internal.2.js → get-size.D1dS-IaP.0.0.59.js} +0 -0
- /package/dist/interface/js/{hookable.l0sNRNKZ.0.0.58-internal.2.js → hookable.l0sNRNKZ.0.0.59.js} +0 -0
- /package/dist/interface/js/{mdurl.k9Sl0PQj.0.0.58-internal.2.js → mdurl.k9Sl0PQj.0.0.59.js} +0 -0
- /package/dist/interface/js/{perfect-debounce.l0sNRNKZ.0.0.58-internal.2.js → perfect-debounce.l0sNRNKZ.0.0.59.js} +0 -0
- /package/dist/interface/js/{primelocale.Bga3dOQu.0.0.58-internal.2.js → primelocale.Bga3dOQu.0.0.59.js} +0 -0
- /package/dist/interface/js/{punycode.js.Dj65hjkv.0.0.58-internal.2.js → punycode.js.Dj65hjkv.0.0.59.js} +0 -0
- /package/dist/interface/js/{react-dnd-html5-backend.1HQjlkwI.0.0.58-internal.2.js → react-dnd-html5-backend.1HQjlkwI.0.0.59.js} +0 -0
- /package/dist/interface/js/{redux.BFxtlG_c.0.0.58-internal.2.js → redux.BFxtlG_c.0.0.59.js} +0 -0
- /package/dist/interface/js/{tslib.9k7AwCpt.0.0.58-internal.2.js → tslib.9k7AwCpt.0.0.59.js} +0 -0
- /package/dist/interface/js/{uc.micro.kMc2yuuw.0.0.58-internal.2.js → uc.micro.kMc2yuuw.0.0.59.js} +0 -0
- /package/dist/interface/js/{uuid.C6aID195.0.0.58-internal.2.js → uuid.C6aID195.0.0.59.js} +0 -0
- /package/dist/interface/js/{vue.l0sNRNKZ.0.0.58-internal.2.js → vue.l0sNRNKZ.0.0.59.js} +0 -0
- /package/dist/interface/js/{zod.sy4ilHCy.0.0.58-internal.2.js → zod.sy4ilHCy.0.0.59.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 yu=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)||yu("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)?yu("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),bt=(s,e,t)=>(Da(s,e,"access private method"),t);import{u as Ci,a as Vt,b as dt,V as $0}from"./@tanstack.DVVgae2-.0.0.58-internal.2.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 Lh,g as R0,h as jh,D as bu,i as Qc,j as fo,k as I0,l as go,m as Aa,n as Kc,o as qh,p as Zc,q as Dh,r as Bh,t as Gc,u as Wc,v as Jc,w as Yc,x as zh,y as Uh,z as Vh,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.DDULn9kM.0.0.58-internal.2.js";import{F as me,c as M,d as m,e as g,B as Tt,r as oe,o as Sn,a4 as Ma,L as It,h as c,R as y,P as at,M as L,O as ae,W as ot,y as Ls,k as se,w as Ze,t as Jt,N as $,Y as Pr,J as Ei,m as tt,V as Pt,I as he,ac as Qt,f as ps,ab as Hh,b as Tr,A as Xs,a7 as vo,H as Gt,X as Ct,Z as zt,i as mi,a5 as Xc,a0 as V0,Q as Ai,ad as el,n as Zs,G as ei,D as wu,_ as Qh,S as H0,ae as Kn,af as Rr,$ as lr,ag as Q0,a1 as K0,T as Kh,ah as Z0}from"./@vue.Dh6viqaK.0.0.58-internal.2.js";import{v as Zh,u as tl,a as G0,c as sl,b as W0,d as J0,e as Gh,o as nl,f as Wh,g as Y0,h as X0,i as ef,r as xu,j as lc,k as tf,l as ri,m as rl,n as sf,p as fn,q as nf,s as Su,t as rf,w as of,x as Eo,y as af,z as cf}from"./@vueuse.CVrMoaIT.0.0.58-internal.2.js";import{a as lf,A as uf}from"./axios.DHr9lByg.0.0.58-internal.2.js";import{u as js,c as df}from"./vue-i18n.D-f3YMiP.0.0.58-internal.2.js";import{d as Mi,s as Vs,c as hf}from"./pinia.eSJCqrRk.0.0.58-internal.2.js";import{u as qr,a as $i,c as mf,b as pf}from"./vue-router.DYUr4L8h.0.0.58-internal.2.js";import{R as $a}from"./vue-inline-svg.DASdcuI6.0.0.58-internal.2.js";import{F as il,a as Dt,E as Bt}from"./vee-validate.DxWC7Uc5.0.0.58-internal.2.js";import{t as Wn}from"./@vee-validate.DXQYyKnw.0.0.58-internal.2.js";import{o as kt,c as Ss,u as Os,l as be,t as ff,n as xn,s as Ke,d as ur,r as ol,e as Hn,f as gf,g as Cu,h as vf,i as al,j as Jh,k as ku}from"./zod.sy4ilHCy.0.0.58-internal.2.js";import{v as hn}from"./uuid.C6aID195.0.0.58-internal.2.js";import{M as _f}from"./socket.io-client.DGrbrDom.0.0.58-internal.2.js";import{O as yf}from"./rxjs.B2ccbYNa.0.0.58-internal.2.js";import{H as Gr,t as bf,y as wf,j as xf,p as Sf}from"./highlight.js.DufLphmF.0.0.58-internal.2.js";import{M as Cf}from"./markdown-it.DWzo15GL.0.0.58-internal.2.js";import{q as kf}from"./qrcode.2uy4AF_1.0.0.58-internal.2.js";import{D as Yh}from"./draggabilly.4YiiUwjf.0.0.58-internal.2.js";import{m as Ef}from"./vue-zoomable.BNmlNdT9.0.0.58-internal.2.js";import{e as Af,d as Mf}from"./primelocale.Bga3dOQu.0.0.58-internal.2.js";import{Y as $f,Z as Pf}from"./@primevue.CCOhlpr_.0.0.58-internal.2.js";import{a$ as Tf,b0 as Rf}from"./@primeuix.BkBDkSvZ.0.0.58-internal.2.js";import"./nprogress.Ch0iTg9A.0.0.58-internal.2.js";import"./@xterm.DvWsUiP3.0.0.58-internal.2.js";import"./@intlify.BkGPX90O.0.0.58-internal.2.js";import"./engine.io-client.DiKRcrKS.0.0.58-internal.2.js";import"./engine.io-parser.BiEtp6m2.0.0.58-internal.2.js";import"./@socket.io.Dkula2eQ.0.0.58-internal.2.js";import"./socket.io-parser.DMj4FMpp.0.0.58-internal.2.js";import"./tslib.9k7AwCpt.0.0.58-internal.2.js";import"./mdurl.k9Sl0PQj.0.0.58-internal.2.js";import"./uc.micro.kMc2yuuw.0.0.58-internal.2.js";import"./entities.C20TfXL6.0.0.58-internal.2.js";import"./linkify-it.BOOCiNk4.0.0.58-internal.2.js";import"./punycode.js.Dj65hjkv.0.0.58-internal.2.js";import"./dijkstrajs.C00ieaqj.0.0.58-internal.2.js";import"./get-size.D1dS-IaP.0.0.58-internal.2.js";import"./unidragger.D9rEVfuC.0.0.58-internal.2.js";import"./ev-emitter.X5f1qa-c.0.0.58-internal.2.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(),M("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=me({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(),M("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=me({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(),M("svg",Kf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13H5v-2h14z"},null,-1)]))}const Gf=me({name:"mdi-minus",render:Zf}),Wf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jf(s,e){return m(),M("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=me({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=Tt({__name:"CuiWindowButtons",setup(s){const e=oe(!1),t=oe(!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 It((m(),M("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)?ae("",!0):(m(),L(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(),L(v,{key:1,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"])):(m(),L(h,{key:0,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"]))],4)])),[[c(Zh),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(),M("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 Xh=me({name:"tabler-power",render:s1}),n1="/assets/logo-512.DLKVOU2S.0.0.58-internal.2.png",r1=Object.freeze(Object.defineProperty({__proto__:null,default:n1},Symbol.toStringTag,{value:"Module"})),i1="/assets/logo-256.BCQk9H1-.0.0.58-internal.2.png",o1=Object.freeze(Object.defineProperty({__proto__:null,default:i1},Symbol.toStringTag,{value:"Module"})),a1="/assets/logo-512.DLKVOU2S.0.0.58-internal.2.png",c1=Object.freeze(Object.defineProperty({__proto__:null,default:a1},Symbol.toStringTag,{value:"Module"})),l1="/assets/logo.DmEiRk0z.0.0.58-internal.2.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 Eu={};/*! 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 O=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(te,W)=>{if(te==="%%")return"%";O++;const I=r.formatters[W];if(typeof I=="function"){const E=f[O];te=I.call(b,E),f.splice(O,1),O--}return te}),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=Eu.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=Eu.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 O=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(te,W)=>{if(te==="%%")return"%";O++;const I=r.formatters[W];if(typeof I=="function"){const E=f[O];te=I.call(b,E),f.splice(O,1),O--}return te}),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,O={create:b?function(){return us(Object.create(null))}:k?function(){return us({__proto__:null})}:function(){return us({})},has:z?function(V,ne){return d.call(V,ne)}:function(V,ne){return ne in V},get:z?function(V,ne){return d.call(V,ne)?V[ne]:void 0}:function(V,ne){return V[ne]}},te=Object.getPrototypeOf(Function),W=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Cs(),I=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:hs(),E=typeof WeakMap=="function"?WeakMap:Be(),N=h?Symbol.for("@reflect-metadata:registry"):void 0,D=ts(),C=bs(D);function A(V,ne,ve,Ce){if(de(ve)){if(!U(V))throw new TypeError;if(!fe(ne))throw new TypeError;return Se(V,ne)}if(!U(V))throw new TypeError;if(!vt(ne))throw new TypeError;if(!vt(Ce)&&!de(Ce)&&!xt(Ce))throw new TypeError;return xt(Ce)&&(Ce=void 0),F(V,ne,ve=ht(ve),Ce)}function B(V,ne){function ve(Ce,nt){if(!vt(Ce))throw new TypeError;if(!de(nt)&&!ye(nt))throw new TypeError;pt(V,ne,Ce,nt)}return ve}function H(V,ne,ve,Ce){if(!vt(ve))throw new TypeError;return de(Ce)||(Ce=ht(Ce)),pt(V,ne,ve,Ce)}function R(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),q(V,ne,ve)}function w(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),Y(V,ne,ve)}function Q(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),Te(V,ne,ve)}function J(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),He(V,ne,ve)}function j(V,ne){if(!vt(V))throw new TypeError;return de(ne)||(ne=ht(ne)),ft(V,ne)}function ie(V,ne){if(!vt(V))throw new TypeError;return de(ne)||(ne=ht(ne)),Ge(V,ne)}function ue(V,ne,ve){if(!vt(ne))throw new TypeError;if(de(ve)||(ve=ht(ve)),!vt(ne))throw new TypeError;de(ve)||(ve=ht(ve));var Ce=os(ne,ve,!1);return!de(Ce)&&Ce.OrdinaryDeleteMetadata(V,ne,ve)}function Se(V,ne){for(var ve=V.length-1;ve>=0;--ve){var Ce=(0,V[ve])(ne);if(!de(Ce)&&!xt(Ce)){if(!fe(Ce))throw new TypeError;ne=Ce}}return ne}function F(V,ne,ve,Ce){for(var nt=V.length-1;nt>=0;--nt){var Ft=(0,V[nt])(ne,ve,Ce);if(!de(Ft)&&!xt(Ft)){if(!vt(Ft))throw new TypeError;Ce=Ft}}return Ce}function q(V,ne,ve){if(Y(V,ne,ve))return!0;var Ce=rt(ne);return!xt(Ce)&&q(V,Ce,ve)}function Y(V,ne,ve){var Ce=os(ne,ve,!1);return!de(Ce)&>(Ce.OrdinaryHasOwnMetadata(V,ne,ve))}function Te(V,ne,ve){if(Y(V,ne,ve))return He(V,ne,ve);var Ce=rt(ne);return xt(Ce)?void 0:Te(V,Ce,ve)}function He(V,ne,ve){var Ce=os(ne,ve,!1);if(!de(Ce))return Ce.OrdinaryGetOwnMetadata(V,ne,ve)}function pt(V,ne,ve,Ce){os(ve,Ce,!0).OrdinaryDefineOwnMetadata(V,ne,ve,Ce)}function ft(V,ne){var ve=Ge(V,ne),Ce=rt(V);if(Ce===null)return ve;var nt=ft(Ce,ne);if(nt.length<=0)return ve;if(ve.length<=0)return nt;for(var Ft=new I,Zt=[],Xe=0,xe=ve;Xe<xe.length;Xe++){var Ne=xe[Xe];Ft.has(Ne)||(Ft.add(Ne),Zt.push(Ne))}for(var Fe=0,_e=nt;Fe<_e.length;Fe++)Ne=_e[Fe],Ft.has(Ne)||(Ft.add(Ne),Zt.push(Ne));return Zt}function Ge(V,ne){var ve=os(V,ne,!1);return ve?ve.OrdinaryOwnMetadataKeys(V,ne):[]}function Je(V){if(V===null)return 1;switch(typeof V){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return V===null?1:6;default:return 6}}function de(V){return V===void 0}function xt(V){return V===null}function Kt(V){return typeof V=="symbol"}function vt(V){return typeof V=="object"?V!==null:typeof V=="function"}function jt(V,ne){switch(Je(V)){case 0:case 1:case 2:case 3:case 4:case 5:return V}var ve="string",Ce=le(V,v);if(Ce!==void 0){var nt=Ce.call(V,ve);if(vt(nt))throw new TypeError;return nt}return ct(V)}function ct(V,ne){var ve,Ce;{var nt=V.toString;if(X(nt)&&!vt(Ce=nt.call(V))||X(ve=V.valueOf)&&!vt(Ce=ve.call(V)))return Ce}throw new TypeError}function gt(V){return!!V}function De(V){return""+V}function ht(V){var ne=jt(V);return Kt(ne)?ne:De(ne)}function U(V){return Array.isArray?Array.isArray(V):V instanceof Object?V instanceof Array:Object.prototype.toString.call(V)==="[object Array]"}function X(V){return typeof V=="function"}function fe(V){return typeof V=="function"}function ye(V){switch(Je(V)){case 3:case 4:return!0;default:return!1}}function pe(V,ne){return V===ne||V!=V&&ne!=ne}function le(V,ne){var ve=V[ne];if(ve!=null){if(!X(ve))throw new TypeError;return ve}}function ge(V){var ne=le(V,f);if(!X(ne))throw new TypeError;var ve=ne.call(V);if(!vt(ve))throw new TypeError;return ve}function Ie(V){return V.value}function Ee(V){var ne=V.next();return!ne.done&&ne}function Ue(V){var ne=V.return;ne&&ne.call(V)}function rt(V){var ne=Object.getPrototypeOf(V);if(typeof V!="function"||V===te||ne!==te)return ne;var ve=V.prototype,Ce=ve&&Object.getPrototypeOf(ve);if(Ce==null||Ce===Object.prototype)return ne;var nt=Ce.constructor;return typeof nt!="function"||nt===V?ne:nt}function St(){var V,ne,ve,Ce;de(N)||u.Reflect===void 0||N in u.Reflect||typeof u.Reflect.defineMetadata!="function"||(V=ls(u.Reflect));var nt=new E,Ft={registerProvider:Zt,getProvider:xe,setProvider:Fe};return Ft;function Zt(_e){if(!Object.isExtensible(Ft))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case V===_e:break;case de(ne):ne=_e;break;case ne===_e:break;case de(ve):ve=_e;break;case ve===_e:break;default:Ce===void 0&&(Ce=new I),Ce.add(_e)}}function Xe(_e,it){if(!de(ne)){if(ne.isProviderFor(_e,it))return ne;if(!de(ve)){if(ve.isProviderFor(_e,it))return ne;if(!de(Ce))for(var _=ge(Ce);;){var x=Ee(_);if(!x)return;var S=Ie(x);if(S.isProviderFor(_e,it))return Ue(_),S}}}if(!de(V)&&V.isProviderFor(_e,it))return V}function xe(_e,it){var _,x=nt.get(_e);return de(x)||(_=x.get(it)),de(_)&&(de(_=Xe(_e,it))||(de(x)&&(x=new W,nt.set(_e,x)),x.set(it,_))),_}function Ne(_e){if(de(_e))throw new TypeError;return ne===_e||ve===_e||!de(Ce)&&Ce.has(_e)}function Fe(_e,it,_){if(!Ne(_))throw new Error("Metadata provider not registered.");var x=xe(_e,it);if(x!==_){if(!de(x))return!1;var S=nt.get(_e);de(S)&&(S=new W,nt.set(_e,S)),S.set(it,_)}return!0}}function ts(){var V;return!de(N)&&vt(u.Reflect)&&Object.isExtensible(u.Reflect)&&(V=u.Reflect[N]),de(V)&&(V=St()),!de(N)&&vt(u.Reflect)&&Object.isExtensible(u.Reflect)&&Object.defineProperty(u.Reflect,N,{enumerable:!1,configurable:!1,writable:!1,value:V}),V}function bs(V){var ne=new E,ve={isProviderFor:function(Ne,Fe){var _e=ne.get(Ne);return!de(_e)&&_e.has(Fe)},OrdinaryDefineOwnMetadata:Zt,OrdinaryHasOwnMetadata:nt,OrdinaryGetOwnMetadata:Ft,OrdinaryOwnMetadataKeys:Xe,OrdinaryDeleteMetadata:xe};return D.registerProvider(ve),ve;function Ce(Ne,Fe,_e){var it=ne.get(Ne),_=!1;if(de(it)){if(!_e)return;it=new W,ne.set(Ne,it),_=!0}var x=it.get(Fe);if(de(x)){if(!_e)return;if(x=new W,it.set(Fe,x),!V.setProvider(Ne,Fe,ve))throw it.delete(Fe),_&&ne.delete(Ne),new Error("Wrong provider for target.")}return x}function nt(Ne,Fe,_e){var it=Ce(Fe,_e,!1);return!de(it)&>(it.has(Ne))}function Ft(Ne,Fe,_e){var it=Ce(Fe,_e,!1);if(!de(it))return it.get(Ne)}function Zt(Ne,Fe,_e,it){Ce(_e,it,!0).set(Ne,Fe)}function Xe(Ne,Fe){var _e=[],it=Ce(Ne,Fe,!1);if(de(it))return _e;for(var _=ge(it.keys()),x=0;;){var S=Ee(_);if(!S)return _e.length=x,_e;var P=Ie(S);try{_e[x]=P}catch(T){try{Ue(_)}finally{throw T}}x++}}function xe(Ne,Fe,_e){var it=Ce(Fe,_e,!1);if(de(it)||!it.delete(Ne))return!1;if(it.size===0){var _=ne.get(Fe);de(_)||(_.delete(_e),_.size===0&&ne.delete(_))}return!0}}function ls(V){var ne=V.defineMetadata,ve=V.hasOwnMetadata,Ce=V.getOwnMetadata,nt=V.getOwnMetadataKeys,Ft=V.deleteMetadata,Zt=new E,Xe={isProviderFor:function(xe,Ne){var Fe=Zt.get(xe);return!(de(Fe)||!Fe.has(Ne))||!!nt(xe,Ne).length&&(de(Fe)&&(Fe=new I,Zt.set(xe,Fe)),Fe.add(Ne),!0)},OrdinaryDefineOwnMetadata:ne,OrdinaryHasOwnMetadata:ve,OrdinaryGetOwnMetadata:Ce,OrdinaryOwnMetadataKeys:nt,OrdinaryDeleteMetadata:Ft};return Xe}function os(V,ne,ve){var Ce=D.getProvider(V,ne);if(!de(Ce))return Ce;if(ve){if(D.setProvider(V,ne,C))return C;throw new Error("Illegal state.")}}function Cs(){var V={},ne=[],ve=function(){function Xe(xe,Ne,Fe){this._index=0,this._keys=xe,this._values=Ne,this._selector=Fe}return Xe.prototype["@@iterator"]=function(){return this},Xe.prototype[f]=function(){return this},Xe.prototype.next=function(){var xe=this._index;if(xe>=0&&xe<this._keys.length){var Ne=this._selector(this._keys[xe],this._values[xe]);return xe+1>=this._keys.length?(this._index=-1,this._keys=ne,this._values=ne):this._index++,{value:Ne,done:!1}}return{value:void 0,done:!0}},Xe.prototype.throw=function(xe){throw this._index>=0&&(this._index=-1,this._keys=ne,this._values=ne),xe},Xe.prototype.return=function(xe){return this._index>=0&&(this._index=-1,this._keys=ne,this._values=ne),{value:xe,done:!0}},Xe}(),Ce=function(){function Xe(){this._keys=[],this._values=[],this._cacheKey=V,this._cacheIndex=-2}return Object.defineProperty(Xe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Xe.prototype.has=function(xe){return this._find(xe,!1)>=0},Xe.prototype.get=function(xe){var Ne=this._find(xe,!1);return Ne>=0?this._values[Ne]:void 0},Xe.prototype.set=function(xe,Ne){var Fe=this._find(xe,!0);return this._values[Fe]=Ne,this},Xe.prototype.delete=function(xe){var Ne=this._find(xe,!1);if(Ne>=0){for(var Fe=this._keys.length,_e=Ne+1;_e<Fe;_e++)this._keys[_e-1]=this._keys[_e],this._values[_e-1]=this._values[_e];return this._keys.length--,this._values.length--,pe(xe,this._cacheKey)&&(this._cacheKey=V,this._cacheIndex=-2),!0}return!1},Xe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=V,this._cacheIndex=-2},Xe.prototype.keys=function(){return new ve(this._keys,this._values,nt)},Xe.prototype.values=function(){return new ve(this._keys,this._values,Ft)},Xe.prototype.entries=function(){return new ve(this._keys,this._values,Zt)},Xe.prototype["@@iterator"]=function(){return this.entries()},Xe.prototype[f]=function(){return this.entries()},Xe.prototype._find=function(xe,Ne){if(!pe(this._cacheKey,xe)){this._cacheIndex=-1;for(var Fe=0;Fe<this._keys.length;Fe++)if(pe(this._keys[Fe],xe)){this._cacheIndex=Fe;break}}return this._cacheIndex<0&&Ne&&(this._cacheIndex=this._keys.length,this._keys.push(xe),this._values.push(void 0)),this._cacheIndex},Xe}();return Ce;function nt(Xe,xe){return Xe}function Ft(Xe,xe){return xe}function Zt(Xe,xe){return[Xe,xe]}}function hs(){return function(){function V(){this._map=new W}return Object.defineProperty(V.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),V.prototype.has=function(ne){return this._map.has(ne)},V.prototype.add=function(ne){return this._map.set(ne,ne),this},V.prototype.delete=function(ne){return this._map.delete(ne)},V.prototype.clear=function(){this._map.clear()},V.prototype.keys=function(){return this._map.keys()},V.prototype.values=function(){return this._map.keys()},V.prototype.entries=function(){return this._map.entries()},V.prototype["@@iterator"]=function(){return this.keys()},V.prototype[f]=function(){return this.keys()},V}()}function Be(){var V=16,ne=O.create(),ve=Ce();return function(){function xe(){this._key=Ce()}return xe.prototype.has=function(Ne){var Fe=nt(Ne,!1);return Fe!==void 0&&O.has(Fe,this._key)},xe.prototype.get=function(Ne){var Fe=nt(Ne,!1);return Fe!==void 0?O.get(Fe,this._key):void 0},xe.prototype.set=function(Ne,Fe){return nt(Ne,!0)[this._key]=Fe,this},xe.prototype.delete=function(Ne){var Fe=nt(Ne,!1);return Fe!==void 0&&delete Fe[this._key]},xe.prototype.clear=function(){this._key=Ce()},xe}();function Ce(){var xe;do xe="@@WeakMap@@"+Xe();while(O.has(ne,xe));return ne[xe]=!0,xe}function nt(xe,Ne){if(!d.call(xe,ve)){if(!Ne)return;Object.defineProperty(xe,ve,{value:O.create()})}return xe[ve]}function Ft(xe,Ne){for(var Fe=0;Fe<Ne;++Fe)xe[Fe]=255*Math.random()|0;return xe}function Zt(xe){if(typeof Uint8Array=="function"){var Ne=new Uint8Array(xe);return typeof crypto<"u"?crypto.getRandomValues(Ne):typeof msCrypto<"u"?msCrypto.getRandomValues(Ne):Ft(Ne,xe),Ne}return Ft(new Array(xe),xe)}function Xe(){var xe=Zt(V);xe[6]=79&xe[6]|64,xe[8]=191&xe[8]|128;for(var Ne="",Fe=0;Fe<V;++Fe){var _e=xe[Fe];Fe!==4&&Fe!==6&&Fe!==8||(Ne+="-"),_e<16&&(Ne+="0"),Ne+=_e.toString(16).toLowerCase()}return Ne}}function us(V){return V.__=void 0,delete V.__,V}l("decorate",A),l("metadata",B),l("defineMetadata",H),l("hasMetadata",R),l("hasOwnMetadata",w),l("getMetadata",Q),l("getOwnMetadata",J),l("getMetadataKeys",j),l("getOwnMetadataKeys",ie),l("deleteMetadata",ue)}(o,i),i.Reflect===void 0&&(i.Reflect=r)})()})(n||(n={}))}},Au={};function tn(s){var e=Au[s];if(e!==void 0)return e.exports;var t=Au[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 As={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"},em={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 xs 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 xs?{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 xs(t.message,t.code,t.details,t.cause?xs.fromJSON(t.cause):void 0)}}class y1 extends xs{constructor(e,t,n){super(e,As.INTERNAL_ERROR,t,n)}}class b1 extends xs{constructor(e,t,n){super(e,Ir.INTERNAL_ERROR,t,n)}}class w1 extends xs{constructor(e,t,n){super(e,en.INTERNAL_ERROR,t,n)}}class x1 extends xs{constructor(e,t,n){super(e,$n.INTERNAL_ERROR,t,n)}}class S1 extends xs{constructor(e,t,n){super(e,zn.INTERNAL_ERROR,t,n)}}class C1 extends xs{constructor(e,t,n){super(e,rr.INTERNAL_ERROR,t,n)}}class k1 extends xs{constructor(e,t,n){super(e,em.INTERNAL_ERROR,t,n)}}class E1 extends xs{constructor(e,t,n){super(e,sr.INTERNAL_ERROR,t,n)}}const ut=class ut{static create(e,t,n,r){if(t instanceof xs)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 ut.create(t,i,n,r)}}};p(ut,"connection",{connectionFailed:(e,t)=>ut.create("connection",e,"Connection failed",{description:"Failed to establish connection",code:As.FAILED,...t}),subscribeFailed:(e,t)=>ut.create("connection",e,"Subscription failed",{description:"Failed to subscribe to subject",code:As.INTERNAL_ERROR,...t}),requestFailed:(e,t)=>ut.create("connection",e,"Request failed",{description:"Failed to send request",code:As.INTERNAL_ERROR,...t}),timeout:(e,t)=>ut.create("connection",e,"Connection timeout",{description:"Connection attempt timed out",code:As.TIMEOUT,...t}),notConnected:(e,t)=>ut.create("connection",e,"Not connected",{description:"Connection is not established",code:As.INTERNAL_ERROR,...t}),invalidState:(e,t)=>ut.create("connection",e,"Invalid connection state",{description:"Connection is in invalid state",code:As.INVALID_STATE,...t}),internalError:(e,t)=>ut.create("connection",e,"Internal connection error",{description:"Internal connection error",code:As.INTERNAL_ERROR,...t})}),p(ut,"config",{missing:(e,t)=>ut.create("config",e,"Missing configuration",{description:"Required configuration is missing",code:Ir.MISSING,...t}),invalid:(e,t)=>ut.create("config",e,"Invalid configuration",{description:"Invalid configuration provided",code:Ir.INVALID,...t}),internalError:(e,t)=>ut.create("config",e,"Internal configuration error",{description:"Internal configuration error",code:Ir.INTERNAL_ERROR,...t})}),p(ut,"auth",{unauthorized:(e,t)=>ut.create("auth",e,"Unauthorized",{description:"Authentication failed",code:en.UNAUTHORIZED,...t}),forbidden:(e,t)=>ut.create("auth",e,"Forbidden",{description:"Insufficient permissions",code:en.FORBIDDEN,...t}),internalError:(e,t)=>ut.create("auth",e,"Internal auth error",{description:"Internal auth error",code:en.INTERNAL_ERROR,...t})}),p(ut,"client",{registrationFailed:(e,t)=>ut.create("client",e,"Registration failed",{description:"Failed to register client",code:$n.REGISTRATION_FAILED,...t}),notFound:(e,t)=>ut.create("client",e,"Client not found",{description:"Requested client could not be found",code:$n.NOT_FOUND,...t}),invalidState:(e,t)=>ut.create("client",e,"Invalid client state",{description:"Client is in invalid state",code:$n.INVALID_STATE,...t}),internalError:(e,t)=>ut.create("client",e,"Internal client error",{description:"Internal client error",code:$n.INTERNAL_ERROR,...t})}),p(ut,"message",{invalidFormat:(e,t)=>ut.create("message",e,"Invalid message format",{description:"Failed to parse message",code:zn.INVALID_FORMAT,...t}),deliveryFailed:(e,t)=>ut.create("message",e,"Message delivery failed",{description:"Failed to deliver message",code:zn.DELIVERY_FAILED,...t}),timeout:(e,t)=>ut.create("message",e,"Message timeout",{description:"Message processing timed out",code:zn.TIMEOUT,...t}),executionFailed:(e,t)=>ut.create("message",e,"Message execution failed",{description:"Failed to execute message",code:zn.EXECUTION_FAILED,...t}),internalError:(e,t)=>ut.create("message",e,"Internal message error",{description:"Internal message error",code:zn.INTERNAL_ERROR,...t})}),p(ut,"cluster",{joinFailed:(e,t)=>ut.create("cluster",e,"Failed to join cluster",{description:"Failed to join cluster",code:sr.JOIN_FAILED,...t}),syncFailed:(e,t)=>ut.create("cluster",e,"Failed to sync cluster",{description:"Failed to sync cluster",code:sr.SYNC_FAILED,...t}),nodeNotFound:(e,t)=>ut.create("cluster",e,"Node not found",{description:"Requested node could not be found",code:sr.NODE_NOT_FOUND,...t}),instanceNotFound:(e,t)=>ut.create("cluster",e,"Instance not found",{description:"Requested instance could not be found",code:sr.INSTANCE_NOT_FOUND,...t}),communicationFailed:(e,t)=>ut.create("cluster",e,"Communication failed",{description:"Cluster communication failed",code:sr.COMMUNICATION_FAILED,...t}),invalidState:(e,t)=>ut.create("cluster",e,"Invalid cluster state",{description:"Cluster is in invalid state",code:sr.INVALID_STATE,...t}),internalError:(e,t)=>ut.create("cluster",e,"Internal cluster error",{description:"Internal cluster error",code:sr.INTERNAL_ERROR,...t})}),p(ut,"registry",{internalError:(e,t)=>ut.create("registry",e,"Internal registry error",{description:"Internal registry error",code:em.INTERNAL_ERROR,...t})}),p(ut,"rpc",{methodNotFound:(e,t,n)=>ut.create("rpc",t,`Method not found: ${e}`,{description:"Requested method could not be found",code:rr.METHOD_NOT_FOUND,...n}),invalidRequest:(e,t)=>ut.create("rpc",e,"Invalid request",{description:"Invalid RPC request",code:rr.INVALID_REQUEST,...t}),requestFailed:(e,t)=>ut.create("rpc",e,"RPC request failed",{description:"Failed to send RPC request",code:rr.INTERNAL_ERROR,...t}),executionFailed:(e,t)=>ut.create("rpc",e,"RPC execution failed",{description:"Failed to execute RPC request",code:rr.INTERNAL_ERROR,...t}),connectionFailed:(e,t)=>ut.create("rpc",e,"Failed to get RPC connection",{description:"Failed to get RPC connection",code:rr.CONNECTION_FAILED,...t}),internalError:(e,t)=>ut.create("rpc",e,"Internal RPC error",{description:"Internal RPC error",code:rr.INTERNAL_ERROR,...t})});let $t=ut;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 $t.config.invalid(void 0,{description:"Invalid ID in metadata",code:Ir.INVALID,metadata:{metadata:e}});if(!e.name)throw $t.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 $t.config.invalid(void 0,{description:"No NATS endpoints provided",code:Ir.INVALID,metadata:{endpoints:e.endpoints}});if(!e.auth)throw $t.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 $t.config.invalid(void 0,{description:"Missing server authentication configuration",code:en.INVALID_CREDENTIALS});if(!n||typeof n!="object")throw $t.config.invalid(void 0,{description:"Missing cluster authentication configuration",code:en.INVALID_CREDENTIALS});if(typeof t.user!="string"||t.user.length===0)throw $t.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 $t.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 $t.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 $t.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 $t.config.invalid(void 0,{description:"Invalid username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:t}}});if(typeof n!="string"||n.length===0)throw $t.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 Mu(s){return s&&s.length!==0?sn.decode(s):""}const $u="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]=$u.charCodeAt(t)}}fillSeq(){let s=this.seq;for(let e=21;e>=12;e--)this.buf[e]=$u.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 tm{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 tm;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=tm.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 sm(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 Pu(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.5K7O1GAZ.0.0.59.js","js/primevue.DbIzNwuR.0.0.59.js","js/@primeuix.BkBDkSvZ.0.0.59.js","js/@vue.Dh6viqaK.0.0.59.js","js/@primevue.B74XGlz4.0.0.59.js","js/vue-inline-svg.Bw3375gC.0.0.59.js","js/backup.D5BdFpxO.0.0.59.js","js/system.DxdNf12K.0.0.59.js","js/@tanstack.CmhkBmOY.0.0.59.js","js/vue-i18n.DEKQrOB4.0.0.59.js","js/@intlify.BkGPX90O.0.0.59.js","js/SettingsAccount.CI8zj-Zp.0.0.59.js","js/vee-validate.Td-CaRMY.0.0.59.js","js/pinia.DwJk4SJ-.0.0.59.js","js/@vueuse.MbjtYQmZ.0.0.59.js","js/nprogress.C28vLvLy.0.0.59.js","js/@xterm.IuPb7RlQ.0.0.59.js","assets/@xterm.DYP7pi_n.0.0.59.css","js/axios.DHr9lByg.0.0.59.js","js/vue-router.BaktRwHe.0.0.59.js","js/@vee-validate.Pql1j7iK.0.0.59.js","js/zod.sy4ilHCy.0.0.59.js","js/uuid.C6aID195.0.0.59.js","js/socket.io-client.M9yU1uIE.0.0.59.js","js/engine.io-client.BlXqqnuj.0.0.59.js","js/engine.io-parser.BiEtp6m2.0.0.59.js","js/@socket.io.Dkula2eQ.0.0.59.js","js/socket.io-parser.w7I_ynfs.0.0.59.js","js/rxjs.DFrQz5Mr.0.0.59.js","js/tslib.9k7AwCpt.0.0.59.js","js/highlight.js.cQ_7Ex6r.0.0.59.js","assets/highlight.Ch2EwETz.0.0.59.css","js/markdown-it.B8xTmVBR.0.0.59.js","js/mdurl.k9Sl0PQj.0.0.59.js","js/uc.micro.kMc2yuuw.0.0.59.js","js/entities.C20TfXL6.0.0.59.js","js/linkify-it.BqQkZkf1.0.0.59.js","js/punycode.js.Dj65hjkv.0.0.59.js","js/qrcode.DixdAggJ.0.0.59.js","js/dijkstrajs.C00ieaqj.0.0.59.js","js/draggabilly.B9oSznOL.0.0.59.js","js/get-size.D1dS-IaP.0.0.59.js","js/unidragger.CTTiht5n.0.0.59.js","js/ev-emitter.X5f1qa-c.0.0.59.js","js/vue-zoomable.DPOsbt78.0.0.59.js","js/primelocale.Bga3dOQu.0.0.59.js","assets/SettingsAccount.CDZT7gN-.0.0.59.css","js/SettingsAppearance.vue_vue_type_script_setup_true_lang.T86Wmd9I.0.0.59.js","js/Cameras.Dyir9gg1.0.0.59.js","js/refresh-rounded.DLGFWUn0.0.0.59.js","js/CuiConsole.CND1i8s8.0.0.59.js","assets/CuiConsole.DCYyxdVg.0.0.59.css","assets/Cameras.BDWZJqPN.0.0.59.css","js/Camera.B402UNR2.0.0.59.js","js/CuiTimeline.B3BXMmEx.0.0.59.js","assets/CuiTimeline.BkIwlYtw.0.0.59.css","js/Camview.3JR8srqY.0.0.59.js","js/vue3-dnd.12c13v_q.0.0.59.js","js/dnd-core.DMsKrAl-.0.0.59.js","js/redux.BFxtlG_c.0.0.59.js","js/@react-dnd.CcwRs9xb.0.0.59.js","js/fast-deep-equal.FBO3y2GY.0.0.59.js","js/react-dnd-html5-backend.1HQjlkwI.0.0.59.js","js/react-dnd-touch-backend.vzY2aEPv.0.0.59.js","assets/Camview.Cvhuou6V.0.0.59.css","js/Recordings.CENwhYx8.0.0.59.js","js/Config.XkULRDWR.0.0.59.js","js/zoom-out.CapG5H39.0.0.59.js","js/Console.W83jr373.0.0.59.js","js/Plugins.BrRVAbdG.0.0.59.js","js/CuiPluginCard.CJOUye4J.0.0.59.js","js/trash-fill.DpvFEJ-X.0.0.59.js","js/VersionsHandler.vue_vue_type_script_setup_true_lang.DH0uiBR8.0.0.59.js","assets/CuiPluginCard.yF8V0SZY.0.0.59.css","assets/Plugins.BwPlcRrV.0.0.59.css","js/Plugin.C5n1wOvc.0.0.59.js","js/close-circle._MYhhzAG.0.0.59.js","assets/Plugin.DJElsAn5.0.0.59.css","js/Adminpanel.DgxPa7cC.0.0.59.js","js/chart.js.DaX6hBgw.0.0.59.js","js/@kurkle.D8fDXNIl.0.0.59.js","js/vue-chartjs.Bc2RfUSm.0.0.59.js","assets/Adminpanel.BKek2EMH.0.0.59.css","js/Cammesh.CeRcBXPZ.0.0.59.js","js/Settings.Y_HQYita.0.0.59.js","assets/Settings.CkgfRkQr.0.0.59.css","js/SettingsAppearance.qKyWDUrO.0.0.59.js","js/SettingsUsers.CttAtlXd.0.0.59.js","js/SettingsRecordings.DgWGltTw.0.0.59.js","js/SettingsBackup.YnQZKJSH.0.0.59.js","assets/SettingsBackup.CX0rT0QJ.0.0.59.css","js/SettingsRemote.Cd9txrZR.0.0.59.js","js/SettingsSystem.-M-CWxQc.0.0.59.js","js/compare-versions.DqEOhma6.0.0.59.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var A0=Object.defineProperty;var yu=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)||yu("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)?yu("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),bt=(s,e,t)=>(Da(s,e,"access private method"),t);import{u as Ci,a as Vt,b as dt,V as $0}from"./@tanstack.CmhkBmOY.0.0.59.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 Lh,g as R0,h as jh,D as bu,i as Qc,j as fo,k as I0,l as go,m as Aa,n as Kc,o as qh,p as Zc,q as Dh,r as Bh,t as Gc,u as Wc,v as Jc,w as Yc,x as zh,y as Uh,z as Vh,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.DbIzNwuR.0.0.59.js";import{F as me,c as M,d as m,e as g,B as Tt,r as oe,o as Sn,a4 as Ma,L as It,h as c,R as y,P as at,M as L,O as ae,W as ot,y as Ls,k as se,w as Ze,t as Jt,N as $,Y as Pr,J as Ei,m as tt,V as Pt,I as he,ac as Qt,f as ps,ab as Hh,b as Tr,A as Xs,a7 as vo,H as Gt,X as Ct,Z as zt,i as mi,a5 as Xc,a0 as V0,Q as Ai,ad as el,n as Zs,G as ei,D as wu,_ as Qh,S as H0,ae as Kn,af as Rr,$ as lr,ag as Q0,a1 as K0,T as Kh,ah as Z0}from"./@vue.Dh6viqaK.0.0.59.js";import{v as Zh,u as tl,a as G0,c as sl,b as W0,d as J0,e as Gh,o as nl,f as Wh,g as Y0,h as X0,i as ef,r as xu,j as lc,k as tf,l as ri,m as rl,n as sf,p as fn,q as nf,s as Su,t as rf,w as of,x as Eo,y as af,z as cf}from"./@vueuse.MbjtYQmZ.0.0.59.js";import{a as lf,A as uf}from"./axios.DHr9lByg.0.0.59.js";import{u as js,c as df}from"./vue-i18n.DEKQrOB4.0.0.59.js";import{d as Mi,s as Vs,c as hf}from"./pinia.DwJk4SJ-.0.0.59.js";import{u as qr,a as $i,c as mf,b as pf}from"./vue-router.BaktRwHe.0.0.59.js";import{R as $a}from"./vue-inline-svg.Bw3375gC.0.0.59.js";import{F as il,a as Dt,E as Bt}from"./vee-validate.Td-CaRMY.0.0.59.js";import{t as Wn}from"./@vee-validate.Pql1j7iK.0.0.59.js";import{o as kt,c as Ss,u as Os,l as be,t as ff,n as xn,s as Ke,d as ur,r as ol,e as Hn,f as gf,g as Cu,h as vf,i as al,j as Jh,k as ku}from"./zod.sy4ilHCy.0.0.59.js";import{v as hn}from"./uuid.C6aID195.0.0.59.js";import{M as _f}from"./socket.io-client.M9yU1uIE.0.0.59.js";import{O as yf}from"./rxjs.DFrQz5Mr.0.0.59.js";import{H as Gr,t as bf,y as wf,j as xf,p as Sf}from"./highlight.js.cQ_7Ex6r.0.0.59.js";import{M as Cf}from"./markdown-it.B8xTmVBR.0.0.59.js";import{q as kf}from"./qrcode.DixdAggJ.0.0.59.js";import{D as Yh}from"./draggabilly.B9oSznOL.0.0.59.js";import{m as Ef}from"./vue-zoomable.DPOsbt78.0.0.59.js";import{e as Af,d as Mf}from"./primelocale.Bga3dOQu.0.0.59.js";import{Y as $f,Z as Pf}from"./@primevue.B74XGlz4.0.0.59.js";import{a$ as Tf,b0 as Rf}from"./@primeuix.BkBDkSvZ.0.0.59.js";import"./nprogress.C28vLvLy.0.0.59.js";import"./@xterm.IuPb7RlQ.0.0.59.js";import"./@intlify.BkGPX90O.0.0.59.js";import"./engine.io-client.BlXqqnuj.0.0.59.js";import"./engine.io-parser.BiEtp6m2.0.0.59.js";import"./@socket.io.Dkula2eQ.0.0.59.js";import"./socket.io-parser.w7I_ynfs.0.0.59.js";import"./tslib.9k7AwCpt.0.0.59.js";import"./mdurl.k9Sl0PQj.0.0.59.js";import"./uc.micro.kMc2yuuw.0.0.59.js";import"./entities.C20TfXL6.0.0.59.js";import"./linkify-it.BqQkZkf1.0.0.59.js";import"./punycode.js.Dj65hjkv.0.0.59.js";import"./dijkstrajs.C00ieaqj.0.0.59.js";import"./get-size.D1dS-IaP.0.0.59.js";import"./unidragger.CTTiht5n.0.0.59.js";import"./ev-emitter.X5f1qa-c.0.0.59.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(),M("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=me({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(),M("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=me({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(),M("svg",Kf,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13H5v-2h14z"},null,-1)]))}const Gf=me({name:"mdi-minus",render:Zf}),Wf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jf(s,e){return m(),M("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=me({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=Tt({__name:"CuiWindowButtons",setup(s){const e=oe(!1),t=oe(!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 It((m(),M("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)?ae("",!0):(m(),L(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(),L(v,{key:1,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"])):(m(),L(h,{key:0,color:"#0d650d",width:"100%",height:"100%",class:at(["transition-opacity opacity-0",{"opacity-100":c(e)}])},null,8,["class"]))],4)])),[[c(Zh),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(),M("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 Xh=me({name:"tabler-power",render:s1}),n1="/assets/logo-512.DLKVOU2S.0.0.59.png",r1=Object.freeze(Object.defineProperty({__proto__:null,default:n1},Symbol.toStringTag,{value:"Module"})),i1="/assets/logo-256.BCQk9H1-.0.0.59.png",o1=Object.freeze(Object.defineProperty({__proto__:null,default:i1},Symbol.toStringTag,{value:"Module"})),a1="/assets/logo-512.DLKVOU2S.0.0.59.png",c1=Object.freeze(Object.defineProperty({__proto__:null,default:a1},Symbol.toStringTag,{value:"Module"})),l1="/assets/logo.DmEiRk0z.0.0.59.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 Eu={};/*! 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 O=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(te,W)=>{if(te==="%%")return"%";O++;const I=r.formatters[W];if(typeof I=="function"){const E=f[O];te=I.call(b,E),f.splice(O,1),O--}return te}),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=Eu.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=Eu.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 O=0;f[0]=f[0].replace(/%([a-zA-Z%])/g,(te,W)=>{if(te==="%%")return"%";O++;const I=r.formatters[W];if(typeof I=="function"){const E=f[O];te=I.call(b,E),f.splice(O,1),O--}return te}),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,O={create:b?function(){return us(Object.create(null))}:k?function(){return us({__proto__:null})}:function(){return us({})},has:z?function(V,ne){return d.call(V,ne)}:function(V,ne){return ne in V},get:z?function(V,ne){return d.call(V,ne)?V[ne]:void 0}:function(V,ne){return V[ne]}},te=Object.getPrototypeOf(Function),W=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Cs(),I=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:hs(),E=typeof WeakMap=="function"?WeakMap:Be(),N=h?Symbol.for("@reflect-metadata:registry"):void 0,D=ts(),C=bs(D);function A(V,ne,ve,Ce){if(de(ve)){if(!U(V))throw new TypeError;if(!fe(ne))throw new TypeError;return Se(V,ne)}if(!U(V))throw new TypeError;if(!vt(ne))throw new TypeError;if(!vt(Ce)&&!de(Ce)&&!xt(Ce))throw new TypeError;return xt(Ce)&&(Ce=void 0),F(V,ne,ve=ht(ve),Ce)}function B(V,ne){function ve(Ce,nt){if(!vt(Ce))throw new TypeError;if(!de(nt)&&!ye(nt))throw new TypeError;pt(V,ne,Ce,nt)}return ve}function H(V,ne,ve,Ce){if(!vt(ve))throw new TypeError;return de(Ce)||(Ce=ht(Ce)),pt(V,ne,ve,Ce)}function R(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),q(V,ne,ve)}function w(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),Y(V,ne,ve)}function Q(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),Te(V,ne,ve)}function J(V,ne,ve){if(!vt(ne))throw new TypeError;return de(ve)||(ve=ht(ve)),He(V,ne,ve)}function j(V,ne){if(!vt(V))throw new TypeError;return de(ne)||(ne=ht(ne)),ft(V,ne)}function ie(V,ne){if(!vt(V))throw new TypeError;return de(ne)||(ne=ht(ne)),Ge(V,ne)}function ue(V,ne,ve){if(!vt(ne))throw new TypeError;if(de(ve)||(ve=ht(ve)),!vt(ne))throw new TypeError;de(ve)||(ve=ht(ve));var Ce=os(ne,ve,!1);return!de(Ce)&&Ce.OrdinaryDeleteMetadata(V,ne,ve)}function Se(V,ne){for(var ve=V.length-1;ve>=0;--ve){var Ce=(0,V[ve])(ne);if(!de(Ce)&&!xt(Ce)){if(!fe(Ce))throw new TypeError;ne=Ce}}return ne}function F(V,ne,ve,Ce){for(var nt=V.length-1;nt>=0;--nt){var Ft=(0,V[nt])(ne,ve,Ce);if(!de(Ft)&&!xt(Ft)){if(!vt(Ft))throw new TypeError;Ce=Ft}}return Ce}function q(V,ne,ve){if(Y(V,ne,ve))return!0;var Ce=rt(ne);return!xt(Ce)&&q(V,Ce,ve)}function Y(V,ne,ve){var Ce=os(ne,ve,!1);return!de(Ce)&>(Ce.OrdinaryHasOwnMetadata(V,ne,ve))}function Te(V,ne,ve){if(Y(V,ne,ve))return He(V,ne,ve);var Ce=rt(ne);return xt(Ce)?void 0:Te(V,Ce,ve)}function He(V,ne,ve){var Ce=os(ne,ve,!1);if(!de(Ce))return Ce.OrdinaryGetOwnMetadata(V,ne,ve)}function pt(V,ne,ve,Ce){os(ve,Ce,!0).OrdinaryDefineOwnMetadata(V,ne,ve,Ce)}function ft(V,ne){var ve=Ge(V,ne),Ce=rt(V);if(Ce===null)return ve;var nt=ft(Ce,ne);if(nt.length<=0)return ve;if(ve.length<=0)return nt;for(var Ft=new I,Zt=[],Xe=0,xe=ve;Xe<xe.length;Xe++){var Ne=xe[Xe];Ft.has(Ne)||(Ft.add(Ne),Zt.push(Ne))}for(var Fe=0,_e=nt;Fe<_e.length;Fe++)Ne=_e[Fe],Ft.has(Ne)||(Ft.add(Ne),Zt.push(Ne));return Zt}function Ge(V,ne){var ve=os(V,ne,!1);return ve?ve.OrdinaryOwnMetadataKeys(V,ne):[]}function Je(V){if(V===null)return 1;switch(typeof V){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return V===null?1:6;default:return 6}}function de(V){return V===void 0}function xt(V){return V===null}function Kt(V){return typeof V=="symbol"}function vt(V){return typeof V=="object"?V!==null:typeof V=="function"}function jt(V,ne){switch(Je(V)){case 0:case 1:case 2:case 3:case 4:case 5:return V}var ve="string",Ce=le(V,v);if(Ce!==void 0){var nt=Ce.call(V,ve);if(vt(nt))throw new TypeError;return nt}return ct(V)}function ct(V,ne){var ve,Ce;{var nt=V.toString;if(X(nt)&&!vt(Ce=nt.call(V))||X(ve=V.valueOf)&&!vt(Ce=ve.call(V)))return Ce}throw new TypeError}function gt(V){return!!V}function De(V){return""+V}function ht(V){var ne=jt(V);return Kt(ne)?ne:De(ne)}function U(V){return Array.isArray?Array.isArray(V):V instanceof Object?V instanceof Array:Object.prototype.toString.call(V)==="[object Array]"}function X(V){return typeof V=="function"}function fe(V){return typeof V=="function"}function ye(V){switch(Je(V)){case 3:case 4:return!0;default:return!1}}function pe(V,ne){return V===ne||V!=V&&ne!=ne}function le(V,ne){var ve=V[ne];if(ve!=null){if(!X(ve))throw new TypeError;return ve}}function ge(V){var ne=le(V,f);if(!X(ne))throw new TypeError;var ve=ne.call(V);if(!vt(ve))throw new TypeError;return ve}function Ie(V){return V.value}function Ee(V){var ne=V.next();return!ne.done&&ne}function Ue(V){var ne=V.return;ne&&ne.call(V)}function rt(V){var ne=Object.getPrototypeOf(V);if(typeof V!="function"||V===te||ne!==te)return ne;var ve=V.prototype,Ce=ve&&Object.getPrototypeOf(ve);if(Ce==null||Ce===Object.prototype)return ne;var nt=Ce.constructor;return typeof nt!="function"||nt===V?ne:nt}function St(){var V,ne,ve,Ce;de(N)||u.Reflect===void 0||N in u.Reflect||typeof u.Reflect.defineMetadata!="function"||(V=ls(u.Reflect));var nt=new E,Ft={registerProvider:Zt,getProvider:xe,setProvider:Fe};return Ft;function Zt(_e){if(!Object.isExtensible(Ft))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case V===_e:break;case de(ne):ne=_e;break;case ne===_e:break;case de(ve):ve=_e;break;case ve===_e:break;default:Ce===void 0&&(Ce=new I),Ce.add(_e)}}function Xe(_e,it){if(!de(ne)){if(ne.isProviderFor(_e,it))return ne;if(!de(ve)){if(ve.isProviderFor(_e,it))return ne;if(!de(Ce))for(var _=ge(Ce);;){var x=Ee(_);if(!x)return;var S=Ie(x);if(S.isProviderFor(_e,it))return Ue(_),S}}}if(!de(V)&&V.isProviderFor(_e,it))return V}function xe(_e,it){var _,x=nt.get(_e);return de(x)||(_=x.get(it)),de(_)&&(de(_=Xe(_e,it))||(de(x)&&(x=new W,nt.set(_e,x)),x.set(it,_))),_}function Ne(_e){if(de(_e))throw new TypeError;return ne===_e||ve===_e||!de(Ce)&&Ce.has(_e)}function Fe(_e,it,_){if(!Ne(_))throw new Error("Metadata provider not registered.");var x=xe(_e,it);if(x!==_){if(!de(x))return!1;var S=nt.get(_e);de(S)&&(S=new W,nt.set(_e,S)),S.set(it,_)}return!0}}function ts(){var V;return!de(N)&&vt(u.Reflect)&&Object.isExtensible(u.Reflect)&&(V=u.Reflect[N]),de(V)&&(V=St()),!de(N)&&vt(u.Reflect)&&Object.isExtensible(u.Reflect)&&Object.defineProperty(u.Reflect,N,{enumerable:!1,configurable:!1,writable:!1,value:V}),V}function bs(V){var ne=new E,ve={isProviderFor:function(Ne,Fe){var _e=ne.get(Ne);return!de(_e)&&_e.has(Fe)},OrdinaryDefineOwnMetadata:Zt,OrdinaryHasOwnMetadata:nt,OrdinaryGetOwnMetadata:Ft,OrdinaryOwnMetadataKeys:Xe,OrdinaryDeleteMetadata:xe};return D.registerProvider(ve),ve;function Ce(Ne,Fe,_e){var it=ne.get(Ne),_=!1;if(de(it)){if(!_e)return;it=new W,ne.set(Ne,it),_=!0}var x=it.get(Fe);if(de(x)){if(!_e)return;if(x=new W,it.set(Fe,x),!V.setProvider(Ne,Fe,ve))throw it.delete(Fe),_&&ne.delete(Ne),new Error("Wrong provider for target.")}return x}function nt(Ne,Fe,_e){var it=Ce(Fe,_e,!1);return!de(it)&>(it.has(Ne))}function Ft(Ne,Fe,_e){var it=Ce(Fe,_e,!1);if(!de(it))return it.get(Ne)}function Zt(Ne,Fe,_e,it){Ce(_e,it,!0).set(Ne,Fe)}function Xe(Ne,Fe){var _e=[],it=Ce(Ne,Fe,!1);if(de(it))return _e;for(var _=ge(it.keys()),x=0;;){var S=Ee(_);if(!S)return _e.length=x,_e;var P=Ie(S);try{_e[x]=P}catch(T){try{Ue(_)}finally{throw T}}x++}}function xe(Ne,Fe,_e){var it=Ce(Fe,_e,!1);if(de(it)||!it.delete(Ne))return!1;if(it.size===0){var _=ne.get(Fe);de(_)||(_.delete(_e),_.size===0&&ne.delete(_))}return!0}}function ls(V){var ne=V.defineMetadata,ve=V.hasOwnMetadata,Ce=V.getOwnMetadata,nt=V.getOwnMetadataKeys,Ft=V.deleteMetadata,Zt=new E,Xe={isProviderFor:function(xe,Ne){var Fe=Zt.get(xe);return!(de(Fe)||!Fe.has(Ne))||!!nt(xe,Ne).length&&(de(Fe)&&(Fe=new I,Zt.set(xe,Fe)),Fe.add(Ne),!0)},OrdinaryDefineOwnMetadata:ne,OrdinaryHasOwnMetadata:ve,OrdinaryGetOwnMetadata:Ce,OrdinaryOwnMetadataKeys:nt,OrdinaryDeleteMetadata:Ft};return Xe}function os(V,ne,ve){var Ce=D.getProvider(V,ne);if(!de(Ce))return Ce;if(ve){if(D.setProvider(V,ne,C))return C;throw new Error("Illegal state.")}}function Cs(){var V={},ne=[],ve=function(){function Xe(xe,Ne,Fe){this._index=0,this._keys=xe,this._values=Ne,this._selector=Fe}return Xe.prototype["@@iterator"]=function(){return this},Xe.prototype[f]=function(){return this},Xe.prototype.next=function(){var xe=this._index;if(xe>=0&&xe<this._keys.length){var Ne=this._selector(this._keys[xe],this._values[xe]);return xe+1>=this._keys.length?(this._index=-1,this._keys=ne,this._values=ne):this._index++,{value:Ne,done:!1}}return{value:void 0,done:!0}},Xe.prototype.throw=function(xe){throw this._index>=0&&(this._index=-1,this._keys=ne,this._values=ne),xe},Xe.prototype.return=function(xe){return this._index>=0&&(this._index=-1,this._keys=ne,this._values=ne),{value:xe,done:!0}},Xe}(),Ce=function(){function Xe(){this._keys=[],this._values=[],this._cacheKey=V,this._cacheIndex=-2}return Object.defineProperty(Xe.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Xe.prototype.has=function(xe){return this._find(xe,!1)>=0},Xe.prototype.get=function(xe){var Ne=this._find(xe,!1);return Ne>=0?this._values[Ne]:void 0},Xe.prototype.set=function(xe,Ne){var Fe=this._find(xe,!0);return this._values[Fe]=Ne,this},Xe.prototype.delete=function(xe){var Ne=this._find(xe,!1);if(Ne>=0){for(var Fe=this._keys.length,_e=Ne+1;_e<Fe;_e++)this._keys[_e-1]=this._keys[_e],this._values[_e-1]=this._values[_e];return this._keys.length--,this._values.length--,pe(xe,this._cacheKey)&&(this._cacheKey=V,this._cacheIndex=-2),!0}return!1},Xe.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=V,this._cacheIndex=-2},Xe.prototype.keys=function(){return new ve(this._keys,this._values,nt)},Xe.prototype.values=function(){return new ve(this._keys,this._values,Ft)},Xe.prototype.entries=function(){return new ve(this._keys,this._values,Zt)},Xe.prototype["@@iterator"]=function(){return this.entries()},Xe.prototype[f]=function(){return this.entries()},Xe.prototype._find=function(xe,Ne){if(!pe(this._cacheKey,xe)){this._cacheIndex=-1;for(var Fe=0;Fe<this._keys.length;Fe++)if(pe(this._keys[Fe],xe)){this._cacheIndex=Fe;break}}return this._cacheIndex<0&&Ne&&(this._cacheIndex=this._keys.length,this._keys.push(xe),this._values.push(void 0)),this._cacheIndex},Xe}();return Ce;function nt(Xe,xe){return Xe}function Ft(Xe,xe){return xe}function Zt(Xe,xe){return[Xe,xe]}}function hs(){return function(){function V(){this._map=new W}return Object.defineProperty(V.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),V.prototype.has=function(ne){return this._map.has(ne)},V.prototype.add=function(ne){return this._map.set(ne,ne),this},V.prototype.delete=function(ne){return this._map.delete(ne)},V.prototype.clear=function(){this._map.clear()},V.prototype.keys=function(){return this._map.keys()},V.prototype.values=function(){return this._map.keys()},V.prototype.entries=function(){return this._map.entries()},V.prototype["@@iterator"]=function(){return this.keys()},V.prototype[f]=function(){return this.keys()},V}()}function Be(){var V=16,ne=O.create(),ve=Ce();return function(){function xe(){this._key=Ce()}return xe.prototype.has=function(Ne){var Fe=nt(Ne,!1);return Fe!==void 0&&O.has(Fe,this._key)},xe.prototype.get=function(Ne){var Fe=nt(Ne,!1);return Fe!==void 0?O.get(Fe,this._key):void 0},xe.prototype.set=function(Ne,Fe){return nt(Ne,!0)[this._key]=Fe,this},xe.prototype.delete=function(Ne){var Fe=nt(Ne,!1);return Fe!==void 0&&delete Fe[this._key]},xe.prototype.clear=function(){this._key=Ce()},xe}();function Ce(){var xe;do xe="@@WeakMap@@"+Xe();while(O.has(ne,xe));return ne[xe]=!0,xe}function nt(xe,Ne){if(!d.call(xe,ve)){if(!Ne)return;Object.defineProperty(xe,ve,{value:O.create()})}return xe[ve]}function Ft(xe,Ne){for(var Fe=0;Fe<Ne;++Fe)xe[Fe]=255*Math.random()|0;return xe}function Zt(xe){if(typeof Uint8Array=="function"){var Ne=new Uint8Array(xe);return typeof crypto<"u"?crypto.getRandomValues(Ne):typeof msCrypto<"u"?msCrypto.getRandomValues(Ne):Ft(Ne,xe),Ne}return Ft(new Array(xe),xe)}function Xe(){var xe=Zt(V);xe[6]=79&xe[6]|64,xe[8]=191&xe[8]|128;for(var Ne="",Fe=0;Fe<V;++Fe){var _e=xe[Fe];Fe!==4&&Fe!==6&&Fe!==8||(Ne+="-"),_e<16&&(Ne+="0"),Ne+=_e.toString(16).toLowerCase()}return Ne}}function us(V){return V.__=void 0,delete V.__,V}l("decorate",A),l("metadata",B),l("defineMetadata",H),l("hasMetadata",R),l("hasOwnMetadata",w),l("getMetadata",Q),l("getOwnMetadata",J),l("getMetadataKeys",j),l("getOwnMetadataKeys",ie),l("deleteMetadata",ue)}(o,i),i.Reflect===void 0&&(i.Reflect=r)})()})(n||(n={}))}},Au={};function tn(s){var e=Au[s];if(e!==void 0)return e.exports;var t=Au[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 As={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"},em={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 xs 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 xs?{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 xs(t.message,t.code,t.details,t.cause?xs.fromJSON(t.cause):void 0)}}class y1 extends xs{constructor(e,t,n){super(e,As.INTERNAL_ERROR,t,n)}}class b1 extends xs{constructor(e,t,n){super(e,Ir.INTERNAL_ERROR,t,n)}}class w1 extends xs{constructor(e,t,n){super(e,en.INTERNAL_ERROR,t,n)}}class x1 extends xs{constructor(e,t,n){super(e,$n.INTERNAL_ERROR,t,n)}}class S1 extends xs{constructor(e,t,n){super(e,zn.INTERNAL_ERROR,t,n)}}class C1 extends xs{constructor(e,t,n){super(e,rr.INTERNAL_ERROR,t,n)}}class k1 extends xs{constructor(e,t,n){super(e,em.INTERNAL_ERROR,t,n)}}class E1 extends xs{constructor(e,t,n){super(e,sr.INTERNAL_ERROR,t,n)}}const ut=class ut{static create(e,t,n,r){if(t instanceof xs)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 ut.create(t,i,n,r)}}};p(ut,"connection",{connectionFailed:(e,t)=>ut.create("connection",e,"Connection failed",{description:"Failed to establish connection",code:As.FAILED,...t}),subscribeFailed:(e,t)=>ut.create("connection",e,"Subscription failed",{description:"Failed to subscribe to subject",code:As.INTERNAL_ERROR,...t}),requestFailed:(e,t)=>ut.create("connection",e,"Request failed",{description:"Failed to send request",code:As.INTERNAL_ERROR,...t}),timeout:(e,t)=>ut.create("connection",e,"Connection timeout",{description:"Connection attempt timed out",code:As.TIMEOUT,...t}),notConnected:(e,t)=>ut.create("connection",e,"Not connected",{description:"Connection is not established",code:As.INTERNAL_ERROR,...t}),invalidState:(e,t)=>ut.create("connection",e,"Invalid connection state",{description:"Connection is in invalid state",code:As.INVALID_STATE,...t}),internalError:(e,t)=>ut.create("connection",e,"Internal connection error",{description:"Internal connection error",code:As.INTERNAL_ERROR,...t})}),p(ut,"config",{missing:(e,t)=>ut.create("config",e,"Missing configuration",{description:"Required configuration is missing",code:Ir.MISSING,...t}),invalid:(e,t)=>ut.create("config",e,"Invalid configuration",{description:"Invalid configuration provided",code:Ir.INVALID,...t}),internalError:(e,t)=>ut.create("config",e,"Internal configuration error",{description:"Internal configuration error",code:Ir.INTERNAL_ERROR,...t})}),p(ut,"auth",{unauthorized:(e,t)=>ut.create("auth",e,"Unauthorized",{description:"Authentication failed",code:en.UNAUTHORIZED,...t}),forbidden:(e,t)=>ut.create("auth",e,"Forbidden",{description:"Insufficient permissions",code:en.FORBIDDEN,...t}),internalError:(e,t)=>ut.create("auth",e,"Internal auth error",{description:"Internal auth error",code:en.INTERNAL_ERROR,...t})}),p(ut,"client",{registrationFailed:(e,t)=>ut.create("client",e,"Registration failed",{description:"Failed to register client",code:$n.REGISTRATION_FAILED,...t}),notFound:(e,t)=>ut.create("client",e,"Client not found",{description:"Requested client could not be found",code:$n.NOT_FOUND,...t}),invalidState:(e,t)=>ut.create("client",e,"Invalid client state",{description:"Client is in invalid state",code:$n.INVALID_STATE,...t}),internalError:(e,t)=>ut.create("client",e,"Internal client error",{description:"Internal client error",code:$n.INTERNAL_ERROR,...t})}),p(ut,"message",{invalidFormat:(e,t)=>ut.create("message",e,"Invalid message format",{description:"Failed to parse message",code:zn.INVALID_FORMAT,...t}),deliveryFailed:(e,t)=>ut.create("message",e,"Message delivery failed",{description:"Failed to deliver message",code:zn.DELIVERY_FAILED,...t}),timeout:(e,t)=>ut.create("message",e,"Message timeout",{description:"Message processing timed out",code:zn.TIMEOUT,...t}),executionFailed:(e,t)=>ut.create("message",e,"Message execution failed",{description:"Failed to execute message",code:zn.EXECUTION_FAILED,...t}),internalError:(e,t)=>ut.create("message",e,"Internal message error",{description:"Internal message error",code:zn.INTERNAL_ERROR,...t})}),p(ut,"cluster",{joinFailed:(e,t)=>ut.create("cluster",e,"Failed to join cluster",{description:"Failed to join cluster",code:sr.JOIN_FAILED,...t}),syncFailed:(e,t)=>ut.create("cluster",e,"Failed to sync cluster",{description:"Failed to sync cluster",code:sr.SYNC_FAILED,...t}),nodeNotFound:(e,t)=>ut.create("cluster",e,"Node not found",{description:"Requested node could not be found",code:sr.NODE_NOT_FOUND,...t}),instanceNotFound:(e,t)=>ut.create("cluster",e,"Instance not found",{description:"Requested instance could not be found",code:sr.INSTANCE_NOT_FOUND,...t}),communicationFailed:(e,t)=>ut.create("cluster",e,"Communication failed",{description:"Cluster communication failed",code:sr.COMMUNICATION_FAILED,...t}),invalidState:(e,t)=>ut.create("cluster",e,"Invalid cluster state",{description:"Cluster is in invalid state",code:sr.INVALID_STATE,...t}),internalError:(e,t)=>ut.create("cluster",e,"Internal cluster error",{description:"Internal cluster error",code:sr.INTERNAL_ERROR,...t})}),p(ut,"registry",{internalError:(e,t)=>ut.create("registry",e,"Internal registry error",{description:"Internal registry error",code:em.INTERNAL_ERROR,...t})}),p(ut,"rpc",{methodNotFound:(e,t,n)=>ut.create("rpc",t,`Method not found: ${e}`,{description:"Requested method could not be found",code:rr.METHOD_NOT_FOUND,...n}),invalidRequest:(e,t)=>ut.create("rpc",e,"Invalid request",{description:"Invalid RPC request",code:rr.INVALID_REQUEST,...t}),requestFailed:(e,t)=>ut.create("rpc",e,"RPC request failed",{description:"Failed to send RPC request",code:rr.INTERNAL_ERROR,...t}),executionFailed:(e,t)=>ut.create("rpc",e,"RPC execution failed",{description:"Failed to execute RPC request",code:rr.INTERNAL_ERROR,...t}),connectionFailed:(e,t)=>ut.create("rpc",e,"Failed to get RPC connection",{description:"Failed to get RPC connection",code:rr.CONNECTION_FAILED,...t}),internalError:(e,t)=>ut.create("rpc",e,"Internal RPC error",{description:"Internal RPC error",code:rr.INTERNAL_ERROR,...t})});let $t=ut;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 $t.config.invalid(void 0,{description:"Invalid ID in metadata",code:Ir.INVALID,metadata:{metadata:e}});if(!e.name)throw $t.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 $t.config.invalid(void 0,{description:"No NATS endpoints provided",code:Ir.INVALID,metadata:{endpoints:e.endpoints}});if(!e.auth)throw $t.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 $t.config.invalid(void 0,{description:"Missing server authentication configuration",code:en.INVALID_CREDENTIALS});if(!n||typeof n!="object")throw $t.config.invalid(void 0,{description:"Missing cluster authentication configuration",code:en.INVALID_CREDENTIALS});if(typeof t.user!="string"||t.user.length===0)throw $t.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 $t.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 $t.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 $t.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 $t.config.invalid(void 0,{description:"Invalid username provided",code:en.INVALID_CREDENTIALS,metadata:{provided:{user:t}}});if(typeof n!="string"||n.length===0)throw $t.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 Mu(s){return s&&s.length!==0?sn.decode(s):""}const $u="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]=$u.charCodeAt(t)}}fillSeq(){let s=this.seq;for(let e=21;e>=12;e--)this.buf[e]=$u.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 tm{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 tm;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=tm.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 sm(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 Pu(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=nm(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 om(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 Ms;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 mm 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=ms.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),O=new ul({hdr:1,sid:0,size:0},rn,{});return O._headers=z,O._subject=k,O}(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 mm{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(Lt.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 Zu(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 om(r.muxSubscriptions,this.msg.reply,{timeout:e.timeout},i);r.request(o);try{r.publish(this.msg.reply,Qu,{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(Qu)}nak(e){let t=ag;e&&(t=Tu().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=Tu().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},Gu={MAX_RECONNECT_ATTEMPTS:-1,DELAY:2e3},Ag={TTL:3e4},Wu={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",{...Wu})}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={...Wu}}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,Le,dn;try{Cc=new TextDecoder}catch{}var K=0,Nt,cr,Ts,Un,Rt,es={},ln=0,In=0,Gs=[],Ju={useRecords:!1,mapsAsObjects:!0};class pm{}const fm=new pm;fm.name="MessagePack 0xC1";var Yu,pr=!1,gm=2;try{new Function("")}catch{gm=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(Le)return xm(()=>(Ec(),this?this.unpack(e,t):gi.prototype.unpack.call(Ju,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,K=t.start||0):(K=0,dn=t>-1?t:e.length),In=0,cr=null,Ts=null,Le=e;try{Rt=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw Le=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(es=this,this.structures)return Nt=this.structures,To(t);(!Nt||Nt.length>0)&&(Nt=[])}else es=Ju,(!Nt||Nt.length>0)&&(Nt=[]);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];K<i;)r=K,n.push(To());return n}if(t(o,r,K)===!1)return;for(;K<i;)if(r=K,t(To(),r,K)===!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(!es.trusted&&!pr){let t=Nt.sharedLength||0;t<Nt.length&&(Nt.length=t)}let e;if(es.randomAccessStructure&&Le[K]<64&&Le[K]>=32&&Yu?(e=Yu(Le,K,dn,es),Le=null,s&&s.lazy||!e||(e=e.toJSON()),K=dn):e=fs(),Ts&&(K=Ts.postBundlePosition,Ts=null),pr&&(Nt.restoreStructures=null),K==dn)Nt&&Nt.restoreStructures&&Xu(),Nt=null,Le=null,Un&&(Un=null);else{if(K>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 Nt&&Nt.restoreStructures&&Xu(),Ec(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||K>dn)&&(e.incomplete=!0),e}}function Xu(){for(let s in Nt.restoreStructures)Nt[s]=Nt.restoreStructures[s];Nt.restoreStructures=null}function fs(){let s=Le[K++];if(s<160){if(s<128){if(s<64)return s;{let e=Nt[63&s]||es.getStructures&&vm()[63&s];return e?(e.read||(e.read=vl(e,63&s)),e.read()):s}}if(s<144){if(s-=128,es.mapsAsObjects){let e={};for(let t=0;t<s;t++){let n=ym();n==="__proto__"&&(n="__proto_"),e[n]=fs()}return e}{let e=new Map;for(let t=0;t<s;t++)e.set(fs(),fs());return e}}{s-=144;let e=new Array(s);for(let t=0;t<s;t++)e[t]=fs();return es.freezeData?Object.freeze(e):e}}if(s<192){let e=s-160;if(In>=K)return cr.slice(K-ln,(K+=e)-ln);if(In==0&&dn<140){let t=e<16?_l(e):_m(e);if(t!=null)return t}return kc(e)}{let e;switch(s){case 192:return null;case 193:return Ts?(e=fs(),e>0?Ts[1].slice(Ts.position1,Ts.position1+=e):Ts[0].slice(Ts.position0,Ts.position0-=e)):fm;case 194:return!1;case 195:return!0;case 196:if(e=Le[K++],e===void 0)throw new Error("Unexpected end of buffer");return Wa(e);case 197:return e=Rt.getUint16(K),K+=2,Wa(e);case 198:return e=Rt.getUint32(K),K+=4,Wa(e);case 199:return xr(Le[K++]);case 200:return e=Rt.getUint16(K),K+=2,xr(e);case 201:return e=Rt.getUint32(K),K+=4,xr(e);case 202:if(e=Rt.getFloat32(K),es.useFloat32>2){let t=yl[(127&Le[K])<<1|Le[K+1]>>7];return K+=4,(t*e+(e>0?.5:-.5)|0)/t}return K+=4,e;case 203:return e=Rt.getFloat64(K),K+=8,e;case 204:return Le[K++];case 205:return e=Rt.getUint16(K),K+=2,e;case 206:return e=Rt.getUint32(K),K+=4,e;case 207:return es.int64AsType==="number"?(e=4294967296*Rt.getUint32(K),e+=Rt.getUint32(K+4)):es.int64AsType==="string"?e=Rt.getBigUint64(K).toString():es.int64AsType==="auto"?(e=Rt.getBigUint64(K),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=Rt.getBigUint64(K),K+=8,e;case 208:return Rt.getInt8(K++);case 209:return e=Rt.getInt16(K),K+=2,e;case 210:return e=Rt.getInt32(K),K+=4,e;case 211:return es.int64AsType==="number"?(e=4294967296*Rt.getInt32(K),e+=Rt.getUint32(K+4)):es.int64AsType==="string"?e=Rt.getBigInt64(K).toString():es.int64AsType==="auto"?(e=Rt.getBigInt64(K),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=Rt.getBigInt64(K),K+=8,e;case 212:if(e=Le[K++],e==114)return id(63&Le[K++]);{let t=Gs[e];if(t)return t.read?(K++,t.read(fs())):t.noBuffer?(K++,t()):t(Le.subarray(K,++K));throw new Error("Unknown extension "+e)}case 213:return e=Le[K],e==114?(K++,id(63&Le[K++],Le[K++])):xr(2);case 214:return xr(4);case 215:return xr(8);case 216:return xr(16);case 217:return e=Le[K++],In>=K?cr.slice(K-ln,(K+=e)-ln):Pg(e);case 218:return e=Rt.getUint16(K),In>=(K+=2)?cr.slice(K-ln,(K+=e)-ln):Tg(e);case 219:return e=Rt.getUint32(K),In>=(K+=4)?cr.slice(K-ln,(K+=e)-ln):Rg(e);case 220:return e=Rt.getUint16(K),K+=2,td(e);case 221:return e=Rt.getUint32(K),K+=4,td(e);case 222:return e=Rt.getUint16(K),K+=2,sd(e);case 223:return e=Rt.getUint32(K),K+=4,sd(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++>gm){let r=s.read=new Function("r","return function(){return "+(es.freezeData?"Object.freeze":"")+"({"+s.map(i=>i==="__proto__"?"__proto_:r()":$g.test(i)?i+":r()":"["+JSON.stringify(i)+"]:r()").join(",")+"})}")(fs);return s.highByte===0&&(s.read=ed(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]=fs()}return es.freezeData?Object.freeze(n):n}return t.count=0,s.highByte===0?ed(e,t):t}const ed=(s,e)=>function(){let t=Le[K++];if(t===0)return e();let n=s<32?-(s+(t<<5)):s+(t<<5),r=Nt[n]||vm()[n];if(!r)throw new Error("Record id is not defined for "+n);return r.read||(r.read=vl(r,s)),r.read()};function vm(){let s=xm(()=>(Le=null,es.getStructures()));return Nt=es._mergeStructures(s,Nt)}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(Le.subarray(K,K+=s));const t=K+s,n=[];for(e="";K<t;){const r=Le[K++];if(128&r)if((224&r)==192){const i=63&Le[K++];n.push((31&r)<<6|i)}else if((240&r)==224){const i=63&Le[K++],o=63&Le[K++];n.push((31&r)<<12|i<<6|o)}else if((248&r)==240){let i=(7&r)<<18|(63&Le[K++])<<12|(63&Le[K++])<<6|63&Le[K++];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+=ks.apply(String,n),n.length=0)}return n.length>0&&(e+=ks.apply(String,n)),e}function td(s){let e=new Array(s);for(let t=0;t<s;t++)e[t]=fs();return es.freezeData?Object.freeze(e):e}function sd(s){if(es.mapsAsObjects){let e={};for(let t=0;t<s;t++){let n=ym();n==="__proto__"&&(n="__proto_"),e[n]=fs()}return e}{let e=new Map;for(let t=0;t<s;t++)e.set(fs(),fs());return e}}var ks=String.fromCharCode;function _m(s){let e=K,t=new Array(s);for(let n=0;n<s;n++){const r=Le[K++];if((128&r)>0)return void(K=e);t[n]=r}return ks.apply(String,t)}function _l(s){if(s<4){if(s<2){if(s===0)return"";{let e=Le[K++];return(128&e)>1?void(K-=1):ks(e)}}{let e=Le[K++],t=Le[K++];if((128&e)>0||(128&t)>0)return void(K-=2);if(s<3)return ks(e,t);let n=Le[K++];return(128&n)>0?void(K-=3):ks(e,t,n)}}{let e=Le[K++],t=Le[K++],n=Le[K++],r=Le[K++];if((128&e)>0||(128&t)>0||(128&n)>0||(128&r)>0)return void(K-=4);if(s<6){if(s===4)return ks(e,t,n,r);{let i=Le[K++];return(128&i)>0?void(K-=5):ks(e,t,n,r,i)}}if(s<8){let i=Le[K++],o=Le[K++];if((128&i)>0||(128&o)>0)return void(K-=6);if(s<7)return ks(e,t,n,r,i,o);let a=Le[K++];return(128&a)>0?void(K-=7):ks(e,t,n,r,i,o,a)}{let i=Le[K++],o=Le[K++],a=Le[K++],l=Le[K++];if((128&i)>0||(128&o)>0||(128&a)>0||(128&l)>0)return void(K-=8);if(s<10){if(s===8)return ks(e,t,n,r,i,o,a,l);{let u=Le[K++];return(128&u)>0?void(K-=9):ks(e,t,n,r,i,o,a,l,u)}}if(s<12){let u=Le[K++],d=Le[K++];if((128&u)>0||(128&d)>0)return void(K-=10);if(s<11)return ks(e,t,n,r,i,o,a,l,u,d);let h=Le[K++];return(128&h)>0?void(K-=11):ks(e,t,n,r,i,o,a,l,u,d,h)}{let u=Le[K++],d=Le[K++],h=Le[K++],v=Le[K++];if((128&u)>0||(128&d)>0||(128&h)>0||(128&v)>0)return void(K-=12);if(s<14){if(s===12)return ks(e,t,n,r,i,o,a,l,u,d,h,v);{let f=Le[K++];return(128&f)>0?void(K-=13):ks(e,t,n,r,i,o,a,l,u,d,h,v,f)}}{let f=Le[K++],b=Le[K++];if((128&f)>0||(128&b)>0)return void(K-=14);if(s<15)return ks(e,t,n,r,i,o,a,l,u,d,h,v,f,b);let k=Le[K++];return(128&k)>0?void(K-=15):ks(e,t,n,r,i,o,a,l,u,d,h,v,f,b,k)}}}}}function nd(){let s,e=Le[K++];if(e<192)s=e-160;else switch(e){case 217:s=Le[K++];break;case 218:s=Rt.getUint16(K),K+=2;break;case 219:s=Rt.getUint32(K),K+=4;break;default:throw new Error("Expected string")}return xo(s)}function Wa(s){return es.copyBuffers?Uint8Array.prototype.slice.call(Le,K,K+=s):Le.subarray(K,K+=s)}function xr(s){let e=Le[K++];if(Gs[e]){let t;return Gs[e](Le.subarray(K,t=K+=s),n=>{K=n;try{return fs()}finally{K=t}})}throw new Error("Unknown extension type "+e)}var rd=new Array(4096);function ym(){let s=Le[K++];if(!(s>=160&&s<192))return K--,bm(fs());if(s-=160,In>=K)return cr.slice(K-ln,(K+=s)-ln);if(!(In==0&&dn<180))return kc(s);let e,t=4095&(s<<5^(s>1?Rt.getUint16(K):s>0?Le[K]:0)),n=rd[t],r=K,i=K+s-3,o=0;if(n&&n.bytes==s){for(;r<i;){if(e=Rt.getUint32(r),e!=n[o++]){r=1879048192;break}r+=4}for(i+=3;r<i;)if(e=Le[r++],e!=n[o++]){r=1879048192;break}if(r===i)return K=r,n.string;i-=3,r=K}for(n=[],rd[t]=n,n.bytes=s;r<i;)e=Rt.getUint32(r),n.push(e),r+=4;for(i+=3;r<i;)e=Le[r++],n.push(e);let a=s<16?_l(s):_m(s);return n.string=a??kc(s)}function bm(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 id=(s,e)=>{let t=fs().map(bm),n=s;e!==void 0&&(s=s<32?-((e<<5)+s):(e<<5)+s,t.highByte=e);let r=Nt[s];return r&&(r.isShared||pr)&&((Nt.restoreStructures||(Nt.restoreStructures=[]))[s]=r),Nt[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=fs();return(Ig[s[0]]||Error)(s[1],{cause:s[2]})},Gs[105]=s=>{if(es.structuredClone===!1)throw new Error("Structured clone extension is disabled");let e=Rt.getUint32(K-4);Un||(Un=new Map);let t,n=Le[K];t=n>=144&&n<160||n==220||n==221?[]:{};let r={target:t};Un.set(e,r);let i=fs();return r.used?Object.assign(t,i):(r.target=i,i)},Gs[112]=s=>{if(es.structuredClone===!1)throw new Error("Structured clone extension is disabled");let e=Rt.getUint32(K-4),t=Un.get(e);return t.used=!0,t.target},Gs[115]=()=>new Set(fs());const wm=["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=wm[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=fs();return new RegExp(s[0],s[1])};const Ng=[];function xm(s){let e=dn,t=K,n=ln,r=In,i=cr,o=Un,a=Ts,l=new Uint8Array(Le.slice(0,dn)),u=Nt,d=Nt.slice(0,Nt.length),h=es,v=pr,f=s();return dn=e,K=t,ln=n,In=r,cr=i,Un=o,Ts=a,Le=l,pr=v,(Nt=u).splice(0,Nt.length,...d),es=h,Rt=new DataView(Le.buffer,Le.byteOffset,Le.byteLength),f}function Ec(){Le=null,Un=null,Nt=null}Gs[98]=s=>{let e=(s[0]<<24)+(s[1]<<16)+(s[2]<<8)+s[3],t=K;return K+=e-s.length,Ts=Ng,(Ts=[nd(),nd()]).position0=0,Ts.position1=0,Ts.postBundlePosition=K,K=t,fs()},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,Sm,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,Cm=Ia?Buffer:Uint8Array,od=Ia?4294967296:2144337920;let re,qi,Xt,Ds,Lg,G=0,cs=null;const jg=/[\u0080-\uFFFF]/,Jr=Symbol("record-id");class km extends gi{constructor(e){let t,n,r,i;super(e),this.offset=0;let o=Cm.prototype.utf8Write?function(w,Q){return re.utf8Write(w,Q,re.byteLength-Q)}:!(!Ho||!Ho.encodeInto)&&function(w,Q){return Ho.encodeInto(w,re.subarray(Q)).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,O=0;this.pack=this.encode=function(w,Q){if(re||(re=new Ro(8192),Xt=re.dataView||(re.dataView=new DataView(re.buffer,0,8192)),G=0),Ds=re.length-10,Ds-G<2048?(re=new Ro(re.length),Xt=re.dataView||(re.dataView=new DataView(re.buffer,0,re.length)),Ds=re.length-10,G=0):G=G+7&2147483640,t=G,Q&Ug&&(G+=255&Q),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 j=r.sharedLength||0;if(j>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 ie=0;ie<j;ie++){let ue=r[ie];if(!ue)continue;let Se,F=r.transitions;for(let q=0,Y=ue.length;q<Y;q++){let Te=ue[q];Se=F[Te],Se||(Se=F[Te]=Object.create(null)),F=Se}F[Jr]=ie+64}this.lastNamedStructuresLength=j}l||(r.nextId=j+64)}let J;n&&(n=!1);try{a.randomAccessStructure&&w&&w.constructor&&w.constructor===Object?R(w):I(w);let j=cs;if(cs&&ld(t,I,0),i&&i.idsToInsert){let ie=i.idsToInsert.sort((q,Y)=>q.offset>Y.offset?1:-1),ue=ie.length,Se=-1;for(;j&&ue>0;){let q=ie[--ue].offset+t;q<j.stringsPosition+t&&Se===-1&&(Se=0),q>j.position+t?Se>=0&&(Se+=6):(Se>=0&&(Xt.setUint32(j.position+t,Xt.getUint32(j.position+t)+Se),Se=-1),j=j.previous,ue++)}Se>=0&&j&&Xt.setUint32(j.position+t,Xt.getUint32(j.position+t)+Se),G+=6*ie.length,G>Ds&&A(G),a.offset=G;let F=function(q,Y){let Te,He=6*Y.length,pt=q.length-He;for(;Te=Y.pop();){let ft=Te.offset,Ge=Te.id;q.copyWithin(ft+He,ft,pt),He-=6;let Je=ft+He;q[Je++]=214,q[Je++]=105,q[Je++]=Ge>>24,q[Je++]=Ge>>16&255,q[Je++]=Ge>>8&255,q[Je++]=255&Ge,pt=ft}return q}(re.subarray(t,G),ie);return i=null,F}return a.offset=G,Q&Bg?(re.start=t,re.end=G,re):re.subarray(t,G)}catch(j){throw J=j,j}finally{if(r&&(te(),n&&a.saveStructures)){let j=r.sharedLength||0,ie=re.subarray(t,G),ue=Dg(r,a);if(!J)return a.saveStructures(ue,ue.isCompatible)===!1?a.pack(w,Q):(a.lastNamedStructuresLength=j,re.length>1073741824&&(re=null),ie)}re.length>1073741824&&(re=null),Q&zg&&(G=t)}};const te=()=>{O<10&&O++;let w=r.sharedLength||0;if(r.length>w&&!l&&(r.length=w),z>1e4)r.transitions=null,O=0,z=0,k.length>0&&(k=[]);else if(k.length>0&&!l){for(let Q=0,J=k.length;Q<J;Q++)k[Q][Jr]=0;k=[]}},W=w=>{var Q=w.length;Q<16?re[G++]=144|Q:Q<65536?(re[G++]=220,re[G++]=Q>>8,re[G++]=255&Q):(re[G++]=221,Xt.setUint32(G,Q),G+=4);for(let J=0;J<Q;J++)I(w[J])},I=w=>{G>Ds&&(re=A(G));var Q,J=typeof w;if(J==="string"){let j,ie=w.length;if(cs&&ie>=4&&ie<4096){if((cs.size+=ie)>21760){let F,q,Y=(cs[0]?3*cs[0].length+cs[1].length:0)+10;G+Y>Ds&&(re=A(G+Y)),cs.position?(q=cs,re[G]=200,G+=3,re[G++]=98,F=G-t,G+=4,ld(t,I,0),Xt.setUint16(F+t-3,G-t-F)):(re[G++]=214,re[G++]=98,F=G-t,G+=4),cs=["",""],cs.previous=q,cs.size=0,cs.position=F}let Se=jg.test(w);return cs[Se?0:1]+=w,re[G++]=193,void I(Se?-ie:ie)}j=ie<32?1:ie<256?2:ie<65536?3:5;let ue=3*ie;if(G+ue>Ds&&(re=A(G+ue)),ie<64||!o){let Se,F,q,Y=G+j;for(Se=0;Se<ie;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&(q=w.charCodeAt(Se+1)))==56320?(F=65536+((1023&F)<<10)+(1023&q),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);Q=Y-G-j}else Q=o(w,G+j);Q<32?re[G++]=160|Q:Q<256?(j<2&&re.copyWithin(G+2,G+1,G+1+Q),re[G++]=217,re[G++]=Q):Q<65536?(j<3&&re.copyWithin(G+3,G+2,G+2+Q),re[G++]=218,re[G++]=Q>>8,re[G++]=255&Q):(j<5&&re.copyWithin(G+5,G+3,G+3+Q),re[G++]=219,Xt.setUint32(G,Q),G+=4),G+=Q}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,Xt.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,Xt.setInt16(G,w),G+=2):(re[G++]=210,Xt.setInt32(G,w),G+=4);else{let j;if((j=this.useFloat32)>0&&w<4294967296&&w>=-2147483648){let ie;if(re[G++]=202,Xt.setFloat32(G,w),j<4||((ie=w*yl[(127&re[G])<<1|re[G+1]>>7])|0)===ie)return void(G+=4);G--}re[G++]=203,Xt.setFloat64(G,w),G+=8}else if(J==="object"||J==="function")if(w){if(i){let ie=i.get(w);if(ie){if(!ie.id){let ue=i.idsToInsert||(i.idsToInsert=[]);ie.id=ue.push(ie)}return re[G++]=214,re[G++]=112,Xt.setUint32(G,ie.id),void(G+=4)}i.set(w,{offset:G-t})}let j=w.constructor;if(j===Object)C(w);else if(j===Array)W(w);else if(j===Map)if(this.mapAsEmptyObject)re[G++]=128;else{(Q=w.size)<16?re[G++]=128|Q:Q<65536?(re[G++]=222,re[G++]=Q>>8,re[G++]=255&Q):(re[G++]=223,Xt.setUint32(G,Q),G+=4);for(let[ie,ue]of w)I(ie),I(ue)}else{for(let ie=0,ue=Ac.length;ie<ue;ie++)if(w instanceof Sm[ie]){let Se=Ac[ie];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)?W(w):C(w):I(He))}let F,q=re,Y=Xt,Te=G;re=null;try{F=Se.pack.call(this,w,He=>(re=q,q=null,G+=He,G>Ds&&A(G),{target:re,targetView:Xt,position:G-He}),I)}finally{q&&(re=q,Xt=Y,G=Te,Ds=re.length-10)}return void(F&&(F.length+G>Ds&&A(F.length+G),G=qg(F,re,G,Se.type)))}if(Array.isArray(w))W(w);else{if(w.toJSON){const ie=w.toJSON();if(ie!==w)return I(ie)}if(J==="function")return I(this.writeFunction&&this.writeFunction(w));C(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,Xt.setBigInt64(G,w);else if(w<BigInt(1)<<BigInt(64)&&w>0)re[G++]=207,Xt.setBigUint64(G,w);else{if(!this.largeBigIntToFloat){if(this.largeBigIntToString)return I(w.toString());if(this.useBigIntExtension&&w<BigInt(2)**BigInt(1023)&&w>-(BigInt(2)**BigInt(1023))){re[G++]=199,G++,re[G++]=66;let j,ie=[];do{let ue=w&BigInt(255);j=(ue&BigInt(128))===(w<BigInt(0)?BigInt(128):BigInt(0)),ie.push(ue),w>>=BigInt(8)}while(w!==BigInt(0)&&w!==BigInt(-1)||!j);re[G-2]=ie.length;for(let ue=ie.length;ue>0;)re[G++]=Number(ie[--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,Xt.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 Q;if(this.skipValues){Q=[];for(let ie in w)typeof w.hasOwnProperty=="function"&&!w.hasOwnProperty(ie)||this.skipValues.includes(w[ie])||Q.push(ie)}else Q=Object.keys(w);let J,j=Q.length;if(j<16?re[G++]=128|j:j<65536?(re[G++]=222,re[G++]=j>>8,re[G++]=255&j):(re[G++]=223,Xt.setUint32(G,j),G+=4),this.coercibleKeyAsNumber)for(let ie=0;ie<j;ie++){J=Q[ie];let ue=Number(J);I(isNaN(ue)?J:ue),I(w[J])}else for(let ie=0;ie<j;ie++)I(J=Q[ie]),I(w[J])}:w=>{re[G++]=222;let Q=G-t;G+=2;let J=0;for(let j in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(j))&&(I(j),I(w[j]),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[Q+++t]=J>>8,re[Q+t]=255&J},N=this.useRecords===!1?E:e.progressiveRecords&&!v?w=>{let Q,J,j=r.transitions||(r.transitions=Object.create(null)),ie=G++-t;for(let ue in w)if(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(ue)){if(Q=j[ue],Q)j=Q;else{let Se=Object.keys(w),F=j;j=r.transitions;let q=0;for(let Y=0,Te=Se.length;Y<Te;Y++){let He=Se[Y];Q=j[He],Q||(Q=j[He]=Object.create(null),q++),j=Q}ie+t+1==G?(G--,B(j,Se,q)):H(j,Se,ie,q),J=!0,j=F[ue]}I(w[ue])}if(!J){let ue=j[Jr];ue?re[ie+t]=ue:H(j,Object.keys(w),ie,0)}}:w=>{let Q,J=r.transitions||(r.transitions=Object.create(null)),j=0;for(let ue in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(ue))&&(Q=J[ue],Q||(Q=J[ue]=Object.create(null),j++),J=Q);let ie=J[Jr];ie?ie>=96&&v?(re[G++]=96+(31&(ie-=96)),re[G++]=ie>>5):re[G++]=ie:B(J,J.__keys__||Object.keys(w),j);for(let ue in w)(typeof w.hasOwnProperty!="function"||w.hasOwnProperty(ue))&&I(w[ue])},D=typeof this.useRecords=="function"&&this.useRecords,C=D?w=>{D(w)?N(w):E(w)}:N,A=w=>{let Q;if(w>16777216){if(w-t>od)throw new Error("Packed buffer would be larger than maximum buffer size");Q=Math.min(od,4096*Math.round(Math.max((w-t)*(w>67108864?1.25:2),4194304)/4096))}else Q=1+(Math.max(w-t<<2,re.length-1)>>12)<<12;let J=new Ro(Q);return Xt=J.dataView||(J.dataView=new DataView(J.buffer,0,Q)),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,Q,J)=>{let j=r.nextId;j||(j=64),j<f&&this.shouldShareStructure&&!this.shouldShareStructure(Q)?(j=r.nextOwnId,j<b||(j=f),r.nextOwnId=j+1):(j>=b&&(j=f),r.nextId=j+1);let ie=Q.highByte=j>=96&&v?j-96>>5:-1;w[Jr]=j,w.__keys__=Q,r[j-64]=Q,j<f?(Q.isShared=!0,r.sharedLength=j-63,n=!0,ie>=0?(re[G++]=96+(31&j),re[G++]=ie):re[G++]=j):(ie>=0?(re[G++]=213,re[G++]=114,re[G++]=96+(31&j),re[G++]=ie):(re[G++]=212,re[G++]=114,re[G++]=j),J&&(z+=O*J),k.length>=h&&(k.shift()[Jr]=0),k.push(w),I(Q))},H=(w,Q,J,j)=>{let ie=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,Q,j),qi=re;let q=G;if(re=ie,G=ue,Ds=Se,t=F,q>1){let Y=G+q-1;Y>Ds&&A(Y);let Te=J+t;re.copyWithin(Te+q,Te+1,G),re.set(qi.slice(0,q),Te),G=Y}else re[J+t]=qi[0]},R=w=>{let Q=Lg(w,re,t,G,r,A,(J,j,ie)=>{if(ie)return n=!0;G=j;let ue=re;return I(J),te(),ue!==re?{position:G,targetView:Xt,target:re}:G},this);if(Q===0)return C(w);G=Q}}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 ad(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 cd(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 ld(s,e,t){if(cs.length>0){Xt.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}Sm=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,pm],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?ad(s,16,e):cd(Ia?Buffer.from(s):new Uint8Array(s),e)}},{pack(s,e){let t=s.constructor;t!==Cm&&this.moreTypes?ad(s,wm.indexOf(t.name),e):cd(s,e)}},{pack(s,e){let{target:t,position:n}=e(1);t[n]=193}}];let ud=new km({useRecords:!1});ud.pack,ud.pack;const Bg=512,zg=1024,Ug=2048,Vg=new km({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 Em=[];let Io;for(;Ar--;)Em[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+=Em[256*Math.random()|0];return Io.substring(Ar,Ar+++t)}const Ht=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:(Ht(`[${this.options.metadata.id}] Establishing connection...`),this.connectionPromise=this.establishConnection(),await this.connectionPromise,Ht(`[${this.options.metadata.id}] Connection established successfully.`)))}async disconnect(){this.isDisconnected=!0,Ht(`[${this.options.metadata.id}] Disconnecting...`),await this.drainConnection(),this.connection=null,Ht(`[${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 $t.connection.invalidState(void 0,{description:"Connection is not established",code:As.INVALID_STATE});return this.connection}publish(e,t,n,r){if(this.isClosed())throw Ht(`[${this.options.metadata.id}] Publish skipped: Connection closed or draining`),$t.connection.notConnected(void 0,{description:"Failed to publish message: Connection closed or draining",code:As.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(),Ht("Published message to",e,i.id)}catch(o){throw this.metricsTracker.trackMessageError(),$t.message.deliveryFailed(o,{description:"Failed to publish message",code:zn.DELIVERY_FAILED,subject:e})}}async request(e,t,n,r){if(this.isClosed())throw Ht(`[${this.options.metadata.id}] Request skipped: Connection closed or draining. Subject: ${e}`),$t.connection.notConnected(void 0,{description:"Failed to send request: Connection closed or draining",code:As.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 xs.fromJSON(l.error);return l}catch(a){throw this.metricsTracker.trackRequestEnd(i,!0),a instanceof xs?a:$t.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 Ht(`[${this.options.metadata.id}] RPC Request skipped: Connection closed or draining. Subject: ${e}`),$t.connection.notConnected(void 0,{description:"Failed to send RPC request: Connection closed or draining",code:As.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 xs.fromJSON(o.error);return o}catch(i){throw this.metricsTracker.trackRPCEnd(!0),i instanceof xs?i:$t.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 Ht(`[${this.options.metadata.id}] Subscribe skipped: Connection closed or draining. Subject: ${e}`),$t.connection.notConnected(void 0,{description:"Failed to subscribe: Connection closed or draining",code:As.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 $t.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),Ht(`[${this.options.metadata.id}] Created subscription group for %s`,e)}return i.handlers.has(n)&&Ht(`[${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),Ht(`[${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{Ht(`[${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 Ht(`[${this.options.metadata.id}] NATS connect() successful.`),(async()=>{for await(const l of a.status())l.type===Pn.Reconnect&&Ht(`[${this.options.metadata.id}] Connection reconnected.`)})().catch(l=>{Ht(`[${this.options.metadata.id}] Error in status monitoring:`,l)}),a.closed().then(l=>{Ht(`[${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 Ht(`[${this.options.metadata.id}] Connection attempt ${o} failed:`,a),$t.connection.connectionFailed(a,{description:"Failed to connect to NATS server",code:As.FAILED,metadata:{attempts:o}});Ht(`[${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){Ht("Error draining connection:",e)}}async handleSubscription(e,t,n){Ht(`[${this.options.metadata.id}] Starting message loop for subscription ${t}`);for await(const r of e){if(!this.subscriptionGroups.has(t)){Ht(`[${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(),Ht(`[${this.options.metadata.id}] Error processing message for ${t}:`,o)}}Ht(`[${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=$t.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=$t.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(),Ht("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(),Ht("Error in sync handler:",a)}await Promise.allSettled(i)}respondTo(e,t,n,r){try{if(this.isClosed())throw Ht(`[${this.options.metadata.id}] Respond skipped: Connection closed or draining. Subject: ${e.subject}`),$t.connection.notConnected(void 0,{description:"Failed to respond: Connection closed or draining",code:As.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(),Ht("Error sending request response:",i)}}respondToRPC(e,t,n,r,i,o){try{if(this.isClosed())throw Ht(`[${this.options.metadata.id}] RPC Respond skipped: Connection closed or draining. Subject: ${e.subject}`),$t.connection.notConnected(void 0,{description:"Failed to respond: Connection closed or draining",code:As.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(),Ht("Error sending RPC response:",a)}}packMessage(e){try{return t=e,Vg.pack(t)}catch(n){throw this.metricsTracker.trackMessageError(),$t.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 $t.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:Gu.MAX_RECONNECT_ATTEMPTS,delay:Gu.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 qt=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}`;qt(`[C:${n}] Starting generator stream for ${e}`);let a=null,l=null;try{qt(`[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(),qt(`[C:${n}] Dedicated consumer connection established.`);const d=a.subscribe(i,h=>this.handleStreamMessage(n,h),yn(),"generator");for(qt(`[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),qt(`[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)}}qt(`[C:${n}] Consumption loop finished.`)}finally{qt(`[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),qt(`[C:${n}] Consumer cleanup finished.`)}}async handleGenerator(e,t){var i;const n=`${this.namespace}.${e}.generator`;qt(`[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){qt(`[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 qt(`[P:unknown] Received generator request for ${e} without streamId. Discarding.`);const i=`${this.namespace}.${e}.generator`,o=`${i}.stream.${r}`,a=`${i}.control.${r}`;qt(`[P:${r}] Received generator request for ${e}`);let l=null,u=null,d=null;try{qt(`[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(),qt(`[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");qt(`[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),qt(`[P:${r}] Generator handler invoked. Processing frames...`);let f=await d.next();for(;;){if(this.producerGeneratorStates.get(r)!==u){qt(`[P:${r}] Producer state removed. Aborting loop.`);break}if(f.done){l.publish(o,{requestId:n.id,streamId:r,done:!0}),qt(`[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(O=>{var te;return(te=this.pendingReadySignals.get(r))==null?void 0:te.add(O)});let k;const z=new Promise(O=>{k=setTimeout(()=>{qt(`[P:${r}] Ready signal timeout.`),O()},1e4)});if(await Promise.race([b.finally(()=>clearTimeout(k)),z]),clearTimeout(k),this.producerGeneratorStates.get(r)!==u){qt(`[P:${r}] Producer state changed during wait. Aborting loop.`);break}f=await d.next()}}catch(v){if(qt(`[P:${r}] Error during generator execution:`,v),l&&this.producerGeneratorStates.has(r)){const f=$t.rpc.internalError(v,{description:"Error processing generator request"});try{l.publish(o,{requestId:n.id,streamId:r,done:!0,error:f.toJSON()})}catch(b){qt(`[P:${r}] Error sending error message:`,b)}}}finally{qt(`[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),qt(`[P:${r}] Producer side cleanup finished.`)}}async dispose(){qt("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(),qt("RPCGeneratorManager disposed.")}handleStreamMessage(e,t){const n=this.consumerGeneratorStates.get(e);if(n)return t.error?(n.error=xs.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),qt(`[C:${e}] Cleaning up consumer generator...`),t.streamSubscription.unsubscribe(),await this.cleanupConsumerConnection(e,t.dedicatedConnection,t.controlSubject))}async cleanupConsumerConnection(e,t,n){if(qt(`[C:${e}] Cleaning up consumer connection...`),n&&!t.isClosed())try{t.publish(n,{type:"return"})}catch{}t.isClosed()||await t.disconnect().catch(r=>qt(`[C:${e}] Error disconnecting consumer connection:`,r))}async cleanupProducerGenerator(e,t){this.producerGeneratorStates.has(e)&&(this.producerGeneratorStates.delete(e),this.pendingReadySignals.delete(e),qt(`[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";qt(`[P:${n}] Cleaning up producer connection...`),t==null||t.unsubscribe(),e&&!e.isClosed()&&await e.disconnect().catch(o=>qt(`[P:${n}] Error disconnecting producer connection:`,o))}}const Bs=Pi("camera:ui:rpc");class dd{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 dd(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 dd(t,i,this.options,n),await r.connect(),this.remoteRpcManagers.set(t,r)}return r}catch(r){throw $t.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 $t.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 $t.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 $t.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 xs.fromJSON(r.error);if(!r.data.success)throw $t.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,$t.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 $t.connection.connectionFailed(t,{description:"Failed to start client",code:As.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 $t.connection.connectionFailed(n,{description:"Failed to stop client",code:As.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 Wt,hd,md;(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"})(Wt||(Wt={})),function(s){s.Opened="Opened",s.Closed="Closed",s.Jammed="Jammed",s.Unknown="Unknown"}(hd||(hd={})),function(s){s.MotionDetector="MotionDetector",s.ObjectDetector="ObjectDetector",s.AudioDetector="AudioDetector"}(md||(md={}));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 Am(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 Mm(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=Mm(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{pd(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)pd(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}(),$m=Oa.EMPTY;function Pm(s){return s instanceof Oa||s&&"closed"in s&&Is(s.remove)&&Is(s.add)&&Is(s.unsubscribe)}function pd(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 Tm(s){ov.setTimeout(function(){throw s})}function fd(){}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,Pm(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){Tm(s)}var cv={closed:!0,next:fd,error:function(s){throw s},complete:fd},Pc=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Rm(s){return s}function lv(s){return s.length===0?Rm: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)&&Pm(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=gd(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=gd(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 gd(s){var e;return(e=s??iv.Promise)!==null&&e!==void 0?e:Promise}var uv=Mm(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 vd(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?$m:(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 vd(t,n)},e}(or),vd=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:$m},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),Im={now:function(){return(Im.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=Im);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,Tm)});if(function(o){return Symbol.asyncIterator&&Is(o==null?void 0:o[Symbol.asyncIterator])}(s))return _d(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 _d(function(o){return nv(this,arguments,function(){var a,l,u;return Am(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 _d(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 Am(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},O=function(){z(),d=v=void 0,b=k=!1},te=function(){var W=d;O(),W==null||W.unsubscribe()};return Ri(function(W,I){f++,k||b||z();var E=v=v??t();I.add(function(){--f!==0||k||b||(h=tc(te,l))}),E.subscribe(I),!d&&f>0&&(d=new io({next:function(N){return E.next(N)},error:function(N){k=!0,z(),h=tc(O,r,N),E.error(N)},complete:function(){b=!0,z(),h=tc(O,o),E.complete()}}),pa(W).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 Om(s,e,t){return t===void 0&&(t=1/0),Is(e)?Om(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,O=function(){!z||f.length||b||o.complete()},te=function(I){return b<l?W(I):f.push(I)},W=function(I){d&&o.next(I),b++;var E=!1;pa(a(I,k++)).subscribe(vi(o,function(N){u==null||u(N),d?te(N):o.next(N)},function(){E=!0},void 0,function(){if(E)try{b--;for(var N=function(){var D=f.shift();h?function(C,A,B,H,R){H===void 0&&(H=0),R===void 0&&(R=!1);var w=A.schedule(function(){B(),R?C.add(this.schedule(null,H)):this.unsubscribe()},H);C.add(w)}(o,h,function(){return W(D)}):W(D)};f.length&&b<l;)N();O()}catch(D){o.error(D)}}))};return i.subscribe(vi(o,te,function(){z=!0,O()})),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 yd(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 bd(s){return s[0]<s[2]&&s[1]<s[3]}function wd(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]))))]);bd(b)&&(u.boundingBox=b,u.confidence=d)}bd(u.boundingBox)&&i.push(u),r.add(u.id)}var a;return i}function xd(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!Nm(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 Nm(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 Sd=(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}},Cd=(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=Sd(l,i);if(xd(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=Sd(l,i),d=Nm(i.boundingBox,u.points),h=xd(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 st,Ko,Zo,Go,Wo,Jo,Yo,Xo,Rc,nr,Mn;class yv extends Xg{constructor(t,n){super();Yn(this,st);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(bt(this,st,Jo).call(this,{state:!1},!0)));p(this,"motionState",new gn(bt(this,st,Zo).call(this,{detections:[],state:!1},!0)));p(this,"audioState",new gn(bt(this,st,Ko).call(this,{state:!1,db:0},!0)));p(this,"objectState",new gn(bt(this,st,Go).call(this,{detections:[]},!0)));p(this,"doorbellState",new gn(bt(this,st,Wo).call(this,{state:!1},!0)));p(this,"sirenState",new gn(bt(this,st,Yo).call(this,{state:!1,level:0},!0)));p(this,"batteryState",new gn(bt(this,st,Xo).call(this,{level:100,charging:!1,lowBattery:!1},!0)));p(this,"capabilities",new gn([]));p(this,"onConnected",bt(this,st,Mn).call(this,this.cameraState));p(this,"onFrameWorkerConnected",bt(this,st,Mn).call(this,this.frameWorkerState));p(this,"onLightSwitched",bt(this,st,Mn).call(this,this.lightState));p(this,"onMotionDetected",bt(this,st,Mn).call(this,this.motionState));p(this,"onAudioDetected",bt(this,st,Mn).call(this,this.audioState));p(this,"onObjectDetected",bt(this,st,Mn).call(this,this.objectState));p(this,"onDoorbellPressed",bt(this,st,Mn).call(this,this.doorbellState));p(this,"onSirenDetected",bt(this,st,Mn).call(this,this.sirenState));p(this,"onBatteryChanged",bt(this,st,Mn).call(this,this.batteryState));this.logger=n,this.cameraSubject=new gn(t),this.snapshotCache=new(tv())({max:100,ttl:1e3*this.snapshotTTL}),t.pluginId==="native"&&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 pluginId(){return this.cameraSubject.getValue().pluginId}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(Wt.Light)}get hasSiren(){return this.hasCapability(Wt.Siren)}get hasDoorbell(){return this.hasCapability(Wt.Doorbell)}get hasBattery(){return this.hasCapability(Wt.Battery)}get hasAudioDetector(){return this.hasCapability(Wt.AudioSensor)}get hasMotionDetector(){return this.hasCapability(Wt.MotionSensor)||this.hasCapability(Wt.MotionDetector)}get hasObjectDetector(){return this.hasCapability(Wt.ObjectSensor)||this.hasCapability(Wt.ObjectDetector)}get hasPtz(){return this.hasCapability(Wt.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(),Om(([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(bt(this,st,Jo).call(this,o));break;case"motion":this.motionState.next(bt(this,st,Zo).call(this,o));break;case"audio":this.audioState.next(bt(this,st,Ko).call(this,o));break;case"object":this.objectState.next(bt(this,st,Go).call(this,o));break;case"doorbell":this.doorbellState.next(bt(this,st,Wo).call(this,o));break;case"siren":this.sirenState.next(bt(this,st,Yo).call(this,o));break;case"battery":this.batteryState.next(bt(this,st,Xo).call(this,o))}}checkStateInternal(t,n,r){let i,o=!1;switch(t){case"audio":const a=n;i=bt(this,st,Ko).call(this,a),o=this.stateChanged(this.getValue("audio"),i,"audio");break;case"light":const l=n;i=bt(this,st,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=yd(u.detections),u.detections=wd(u.detections),u.detections=Cd(u.detections,this.detectionZones,this.detectionSettings),b&&u.detections.length===0&&(u.state=!1)}i=bt(this,st,Zo).call(this,u),o=this.stateChanged(this.getValue("motion"),i,"motion");break;case"object":const d=n;r||(d.detections=yd(d.detections),d.detections=wd(d.detections),d.detections=Cd(d.detections,this.detectionZones,this.detectionSettings)),i=bt(this,st,Go).call(this,d),o=this.stateChanged(this.getValue("object"),i,"object");break;case"doorbell":const h=n;i=bt(this,st,Wo).call(this,h),o=this.stateChanged(this.getValue("doorbell"),i,"doorbell");break;case"siren":const v=n;i=bt(this,st,Yo).call(this,v),o=this.stateChanged(this.getValue("siren"),i,"siren");break;case"battery":const f=n;i=bt(this,st,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(bt(this,st,Rc).call(this,t),bt(this,st,Rc).call(this,n),!0)}}st=new WeakSet,Ko=function(t,n=!1){let r,i;if(n||(r=this.getValue("audio"),r&&r.lastEvent&&delete r.lastEvent),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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=Rm),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===Wt.StreamUrl));if(!t)throw new Error("No capability found for streamUrl");return this.interfaces&&"streamUrl"in this.interfaces?this.interfaces.streamUrl(e):(await bt(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===Wt.Snapshot));if(!n)throw new Error("No capability found for snapshot");return this.interfaces&&"snapshot"in this.interfaces?this.interfaces.snapshot(e,t):(await bt(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===Wt.PTZ));if(!t)throw new Error("No capability found for PTZ");return this.interfaces&&"ptzCommand"in this.interfaces?this.interfaces.ptzCommand(e):(await bt(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){if(e===An(this,po))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(r=>r.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 kd={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(kd.randomUUID&&!s)return kd.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 Ut,Ed;(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})(Ut||(Ut={})),function(s){s.mergeShapes=(e,t)=>({...e,...t})}(Ed||(Ed={}));const Qe=Ut.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 Qe.undefined;case"string":return Qe.string;case"number":return isNaN(s)?Qe.nan:Qe.number;case"boolean":return Qe.boolean;case"function":return Qe.function;case"bigint":return Qe.bigint;case"symbol":return Qe.symbol;case"object":return Array.isArray(s)?Qe.array:s===null?Qe.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?Qe.promise:typeof Map<"u"&&s instanceof Map?Qe.map:typeof Set<"u"&&s instanceof Set?Qe.set:typeof Date<"u"&&s instanceof Date?Qe.date:Qe.object;default:return Qe.unknown}},$e=Ut.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,Ut.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===Qe.undefined?"Required":`Expected ${s.expected}, received ${s.received}`;break;case $e.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,Ut.jsonStringifyReplacer)}`;break;case $e.unrecognized_keys:t=`Unrecognized key(s) in object: ${Ut.joinValues(s.keys,", ")}`;break;case $e.invalid_union:t="Invalid input";break;case $e.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Ut.joinValues(s.options)}`;break;case $e.invalid_enum_value:t=`Invalid enum value. Expected ${Ut.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}"`:Ut.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,Ut.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 ze(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 wt;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 wt;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 wt=Object.freeze({status:"aborted"}),Oc=s=>({status:"dirty",value:s}),pn=s=>({status:"valid",value:s}),Ad=s=>s.status==="aborted",Md=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 Fm(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 Ye,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}(Ye||(Ye={}));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 $d=(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 Mt(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 Ot{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 $d(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 $d(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:mt.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({...Mt(this._def),schema:this,typeName:mt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new jc({...Mt(this._def),innerType:this,defaultValue:t,typeName:mt.ZodDefault})}brand(){return new Vv({typeName:mt.ZodBranded,type:this,...Mt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new qc({...Mt(this._def),innerType:this,catchValue:t,typeName:mt.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}(=)?))?$/,Lm="((\\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(`^${Lm}$`);function jm(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=`${Lm}T${jm(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 Ot{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Qe.string){const o=this._getOrReturnCtx(e);return ze(o,{code:$e.invalid_type,expected:Qe.string,received:o.parsedType}),wt}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),ze(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),ze(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?ze(n,{code:$e.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(n,{code:$e.invalid_string,validation:"datetime",message:o.message}),t.dirty()):o.kind==="date"?qv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{code:$e.invalid_string,validation:"date",message:o.message}),t.dirty()):o.kind==="time"?new RegExp(`^${jm(o)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{code:$e.invalid_string,validation:"time",message:o.message}),t.dirty()):o.kind==="duration"?Tv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(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),ze(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),ze(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),ze(n,{validation:"cidr",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64"?Lv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{validation:"base64",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64url"?jv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{validation:"base64url",code:$e.invalid_string,message:o.message}),t.dirty()):Ut.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,...Ye.errToObj(n)})}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ye.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ye.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ye.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ye.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ye.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ye.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ye.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ye.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ye.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,...Ye.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,...Ye.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ye.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ye.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Ye.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ye.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ye.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ye.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ye.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ye.errToObj(t)})}nonempty(e){return this.min(1,Ye.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:mt.ZodString,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Mt(s)})};class yi extends Ot{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)!==Qe.number){const r=this._getOrReturnCtx(e);return ze(r,{code:$e.invalid_type,expected:Qe.number,received:r.parsedType}),wt}let t;const n=new Qs;for(const r of this._def.checks)r.kind==="int"?Ut.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ze(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),ze(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),ze(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),ze(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),ze(t,{code:$e.not_finite,message:r.message}),n.dirty()):Ut.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ye.toString(t))}setLimit(e,t,n,r){return new yi({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ye.toString(r)}]})}_addCheck(e){return new yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ye.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ye.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ye.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ye.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"&&Ut.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:mt.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...Mt(s)});class ao extends Ot{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)!==Qe.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),ze(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),ze(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),ze(t,{code:$e.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Ut.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.bigint,received:t.parsedType}),wt}gte(e,t){return this.setLimit("min",e,!0,Ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ye.toString(t))}setLimit(e,t,n,r){return new ao({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ye.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:Ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ye.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:mt.ZodBigInt,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Mt(s)})};class Nc extends Ot{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Qe.boolean){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.boolean,received:t.parsedType}),wt}return pn(e.data)}}Nc.create=s=>new Nc({typeName:mt.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...Mt(s)});class va extends Ot{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Qe.date){const r=this._getOrReturnCtx(e);return ze(r,{code:$e.invalid_type,expected:Qe.date,received:r.parsedType}),wt}if(isNaN(e.data.getTime()))return ze(this._getOrReturnCtx(e),{code:$e.invalid_date}),wt;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),ze(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),ze(n,{code:$e.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Ut.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:Ye.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ye.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:mt.ZodDate,...Mt(s)});class Pd extends Ot{_parse(e){if(this._getType(e)!==Qe.symbol){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.symbol,received:t.parsedType}),wt}return pn(e.data)}}Pd.create=s=>new Pd({typeName:mt.ZodSymbol,...Mt(s)});class Td extends Ot{_parse(e){if(this._getType(e)!==Qe.undefined){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.undefined,received:t.parsedType}),wt}return pn(e.data)}}Td.create=s=>new Td({typeName:mt.ZodUndefined,...Mt(s)});class Rd extends Ot{_parse(e){if(this._getType(e)!==Qe.null){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.null,received:t.parsedType}),wt}return pn(e.data)}}Rd.create=s=>new Rd({typeName:mt.ZodNull,...Mt(s)});class co extends Ot{constructor(){super(...arguments),this._any=!0}_parse(e){return pn(e.data)}}co.create=s=>new co({typeName:mt.ZodAny,...Mt(s)});class Id extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pn(e.data)}}Id.create=s=>new Id({typeName:mt.ZodUnknown,...Mt(s)});class fr extends Ot{_parse(e){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.never,received:t.parsedType}),wt}}fr.create=s=>new fr({typeName:mt.ZodNever,...Mt(s)});class Od extends Ot{_parse(e){if(this._getType(e)!==Qe.undefined){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.void,received:t.parsedType}),wt}return pn(e.data)}}Od.create=s=>new Od({typeName:mt.ZodVoid,...Mt(s)});class On extends Ot{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Qe.array)return ze(t,{code:$e.invalid_type,expected:Qe.array,received:t.parsedType}),wt;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(o||a)&&(ze(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&&(ze(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&&(ze(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:Ye.toString(t)}})}max(e,t){return new On({...this._def,maxLength:{value:e,message:Ye.toString(t)}})}length(e,t){return new On({...this._def,exactLength:{value:e,message:Ye.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:mt.ZodArray,...Mt(e)});class _s extends Ot{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=Ut.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Qe.object){const l=this._getOrReturnCtx(e);return ze(l,{code:$e.invalid_type,expected:Qe.object,received:l.parsedType}),wt}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&&(ze(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 Ye.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=Ye.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:mt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _s({...this._def,catchall:e})}pick(e){const t={};return Ut.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 Ut.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 Ut.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 Ut.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 qm(Ut.objectKeys(this.shape))}}_s.create=(s,e)=>new _s({shape:()=>s,unknownKeys:"strip",catchall:fr.create(),typeName:mt.ZodObject,...Mt(e)}),_s.strictCreate=(s,e)=>new _s({shape:()=>s,unknownKeys:"strict",catchall:fr.create(),typeName:mt.ZodObject,...Mt(e)}),_s.lazycreate=(s,e)=>new _s({shape:s,unknownKeys:"strip",catchall:fr.create(),typeName:mt.ZodObject,...Mt(e)});class _a extends Ot{_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 ze(t,{code:$e.invalid_union,unionErrors:i}),wt});{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 ze(t,{code:$e.invalid_union,unionErrors:o}),wt}}get options(){return this._def.options}}_a.create=(s,e)=>new _a({options:s,typeName:mt.ZodUnion,...Mt(e)});function Fc(s,e){const t=ir(s),n=ir(e);if(s===e)return{valid:!0,data:s};if(t===Qe.object&&n===Qe.object){const r=Ut.objectKeys(e),i=Ut.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===Qe.array&&n===Qe.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===Qe.date&&n===Qe.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class ya extends Ot{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(i,o)=>{if(Ad(i)||Ad(o))return wt;const a=Fc(i.value,o.value);return a.valid?((Md(i)||Md(o))&&t.dirty(),{status:t.value,value:a.data}):(ze(n,{code:$e.invalid_intersection_types}),wt)};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:mt.ZodIntersection,...Mt(t)});class Nr extends Ot{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Qe.array)return ze(n,{code:$e.invalid_type,expected:Qe.array,received:n.parsedType}),wt;if(n.data.length<this._def.items.length)return ze(n,{code:$e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),wt;!this._def.rest&&n.data.length>this._def.items.length&&(ze(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:mt.ZodTuple,rest:null,...Mt(e)})};class xl extends Ot{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!==Qe.object)return ze(n,{code:$e.invalid_type,expected:Qe.object,received:n.parsedType}),wt;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 Ot?{keyType:e,valueType:t,typeName:mt.ZodRecord,...Mt(n)}:{keyType:Vn.create(),valueType:e,typeName:mt.ZodRecord,...Mt(t)})}}class Nd extends Ot{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!==Qe.map)return ze(n,{code:$e.invalid_type,expected:Qe.map,received:n.parsedType}),wt;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 wt;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 wt;u.status!=="dirty"&&d.status!=="dirty"||t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}}}}Nd.create=(s,e,t)=>new Nd({valueType:e,keyType:s,typeName:mt.ZodMap,...Mt(t)});class lo extends Ot{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Qe.set)return ze(n,{code:$e.invalid_type,expected:Qe.set,received:n.parsedType}),wt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(ze(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&&(ze(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 wt;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:Ye.toString(t)}})}max(e,t){return new lo({...this._def,maxSize:{value:e,message:Ye.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:mt.ZodSet,...Mt(e)});class Fd extends Ot{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})}}Fd.create=(s,e)=>new Fd({getter:s,typeName:mt.ZodLazy,...Mt(e)});class Lc extends Ot{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ze(t,{received:t.data,code:$e.invalid_literal,expected:this._def.value}),wt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function qm(s,e){return new bi({values:s,typeName:mt.ZodEnum,...Mt(e)})}Lc.create=(s,e)=>new Lc({value:s,typeName:mt.ZodLiteral,...Mt(e)});class bi extends Ot{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 ze(t,{expected:Ut.joinValues(n),received:t.parsedType,code:$e.invalid_type}),wt}if(ga(this,Ki)||Fm(this,Ki,new Set(this._def.values)),!ga(this,Ki).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ze(t,{received:t.data,code:$e.invalid_enum_value,options:n}),wt}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=qm;class Ld extends Ot{constructor(){super(...arguments),Zi.set(this,void 0)}_parse(e){const t=Ut.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Qe.string&&n.parsedType!==Qe.number){const r=Ut.objectValues(t);return ze(n,{expected:Ut.joinValues(r),received:n.parsedType,code:$e.invalid_type}),wt}if(ga(this,Zi)||Fm(this,Zi,new Set(Ut.getValidEnumValues(this._def.values))),!ga(this,Zi).has(e.data)){const r=Ut.objectValues(t);return ze(n,{received:n.data,code:$e.invalid_enum_value,options:r}),wt}return pn(e.data)}get enum(){return this._def.values}}Zi=new WeakMap,Ld.create=(s,e)=>new Ld({values:s,typeName:mt.ZodNativeEnum,...Mt(e)});class ba extends Ot{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Qe.promise&&t.common.async===!1)return ze(t,{code:$e.invalid_type,expected:Qe.promise,received:t.parsedType}),wt;const n=t.parsedType===Qe.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:mt.ZodPromise,...Mt(e)});class si extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mt.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=>{ze(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 wt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?wt:l.status==="dirty"||t.value==="dirty"?Oc(l.value):l});{if(t.value==="aborted")return wt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?wt: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"?wt:(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"?wt:(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)}Ut.assertNever(r)}}si.create=(s,e,t)=>new si({schema:s,typeName:mt.ZodEffects,effect:e,...Mt(t)}),si.createWithPreprocess=(s,e,t)=>new si({schema:e,effect:{type:"preprocess",transform:s},typeName:mt.ZodEffects,...Mt(t)});class gr extends Ot{_parse(e){return this._getType(e)===Qe.undefined?pn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}gr.create=(s,e)=>new gr({innerType:s,typeName:mt.ZodOptional,...Mt(e)});class wi extends Ot{_parse(e){return this._getType(e)===Qe.null?pn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wi.create=(s,e)=>new wi({innerType:s,typeName:mt.ZodNullable,...Mt(e)});class jc extends Ot{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Qe.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:mt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Mt(e)});class qc extends Ot{_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:mt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Mt(e)});class jd extends Ot{_parse(e){if(this._getType(e)!==Qe.nan){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.nan,received:t.parsedType}),wt}return{status:"valid",value:e.data}}}jd.create=s=>new jd({typeName:mt.ZodNaN,...Mt(s)});class Vv extends Ot{_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 Ot{_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"?wt: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"?wt: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:mt.ZodPipeline})}}class Dc extends Ot{_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 qd(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=qd(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=qd(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:mt.ZodReadonly,...Mt(e)});var mt;(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"})(mt||(mt={}));const We=Vn.create,Fn=yi.create,Rs=Nc.create,Di=co.create,At=(fr.create,On.create,_s.create),Ns=_a.create,Hv=(ya.create,Nr.create),Bc=xl.create,we=Lc.create,Qv=(bi.create,ba.create,gr.create);wi.create;function Dd(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Bd=At({enabled:Rs().default(!1)}).strict(),Kv=Ns([we("animal"),we("person"),we("vehicle"),we("other"),we("motion")]),Cl=Hv([Fn(),Fn()]),zd=At({name:We().trim().min(1,"Zone Name is required"),points:Cl.array().min(3,"At least 3 points are required"),type:Ns([we("intersect"),we("contain")]),filter:Ns([we("include"),we("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(),Ud=At({motion:At({timeout:Fn().min(10,"Minimum 10 seconds")}),object:At({confidence:Fn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),Dm=Ns([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("snapshot")]),Zv=Ns([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("auto")]),Gv=Ns([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("webrtc:"),we("webtorrent:")]).options.map(s=>s.value),Wv=new RegExp(`^(${Gv.join("|")})`),Bm=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=At({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Dm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Bm.array().min(1,"At least one valid URL is required")}).strict(),Yv=At({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Dm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Bm.array().min(1,"At least one valid URL is required")}).strict(),Sr=At({id:We(),name:We().trim()}),Vd=At({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([we("auto"),we("mse"),we("webrtc"),we("webrtc/tcp")]),e_=Ns([we("16:9"),we("8:3"),we("4:3"),we("auto")]),Hd=At({decoder:Ns([we("pillow"),we("wasm"),we("rust"),we("gpu")]),fps:Fn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Ns([we("640x480"),we("640x360"),we("320x240"),we("320x180")])}),Qd=Ns([we("camera"),we("doorbell")]),Kd=At({streamingMode:Xv,streamingSource:Zv,aspectRatio:e_}),Zd=At({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_=(At({name:We().trim().min(1,"Camera name is required"),url:We().trim().url().min(1,"Camera URL is required"),type:Ns([we("Google"),we("Ring"),we("HomeKit"),we("Onvif"),we("Hass"),we("GoPro"),we("Roborock"),we("FFmpeg"),we("DVRip"),we("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"]}),At({_id:We().default(mn()).transform(()=>mn()),nativeId:We().trim().optional(),pluginId:We().trim().default("native"),disabled:Rs().default(!1),name:We().trim().min(1,"Camera name is required"),type:Qd.default("camera"),isCloud:Rs().default(!1),snapshotTTL:Fn().min(30,"Minimum cache time must be 30").default(600),info:Zd.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:Vd.default({hub:[],plugins:[]}),recording:Bd.default({enabled:!1}),interface:Kd.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:zd.default([]),detectionSettings:Ud.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:Hd.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||Dd(e)?{...s,isCloud:!0}:s}),At({disabled:Rs().optional(),type:Qd.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:Zd.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:Vd.partial().optional(),interface:Kd.partial().optional(),recording:Bd.partial().optional(),detectionZones:zd.optional(),detectionSettings:Ud.partial().optional(),frameWorkerSettings:Hd.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||Dd(e))return{...s,isCloud:!0}}return s}),At({url:We().trim()}).strict(),/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/);var Gd,Wd;(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"})(Gd||(Gd={})),function(s){s.START="start",s.STOP="stop"}(Wd||(Wd={}));const Jd=["image/jpeg","image/png"],Yd=2097152,Xd=["video/mp4","video/quicktime"],eh=10485760,th=["audio/mpeg","audio/wav","audio/ogg"],sh=2097152,s_=(At({pluginname:We().trim().refine(s=>t_.test(s),"Not a valid plugin name"),pluginversion:We().trim().optional().default("latest")}).strict(),At({actionId:We(),payload:Di()}).strict(),Bc(Di(),Di()),At({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=Yd:s.size<=Yd,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Jd.includes(s.mimetype):Jd.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))}),At({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=sh:s.size<=sh,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?th.includes(s.mimetype):th.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))}),At({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=eh:s.size<=eh,"Max file size is 5 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Xd.includes(s.mimetype):Xd.includes(s.type),".mp4 files are accepted"),config:qn().transform(s=>JSON.parse(s.value))}),Bc(We(),Di()),At({key:We()}).strict(),At({key:We(),payload:Di()}).strict(),At({version:We().trim().optional().default("latest")}).strict(),At({mode:Ns([we("disabled"),we("port-forward"),we("router-forward"),we("cloudflare"),we("custom-domain")]).default("disabled"),cloudflare:At({tunnelToken:We().trim(),customDomain:We().trim(),tunnelUrl:We().trim(),tunnelCredentials:At({username:We().trim(),password:We().trim()}).partial()}).partial().strict(),customDomain:At({url:We().trim().optional()}).partial().strict()}).strict()),nh=(At({serverAddresses:We().trim().ip().array().default([]),remoteAccess:s_}).strict(),["image/jpeg","image/jpg","image/png"]),rh=5242880,zm=At({index:Fn(),cameraId:We()}),Um=Ns([we(1),we(4),we(6),we(7),we(9),we(10),we(12),we(13),we(15),we(16),we(20),we(26)]),n_=Ns([we("dnd"),we("view")]),r_=At({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Layout name is required"),viewSize:Um,cameras:zm.array(),type:n_}),i_=(At({name:We().trim().min(1,"Layout name is required"),viewSize:Um,cameras:zm.array()}).partial().optional(),At({views:r_.array()})),o_=At({_id:We().default(mn()).transform(()=>mn()),cameraId:We(),points:Cl}),a_=(At({cameraId:We(),points:Cl}).partial().optional(),At({shortcuts:o_.array()})),ih=At({camview:i_,cameras:Bc(We().trim(),a_)});At({_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([we("admin"),we("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:ih.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),At({username:We().trim().min(1,"Username is required"),password:We().trim().min(1,"Password is required"),rememberMe:Rs().default(!1)}).strict(),At({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([we("admin"),we("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)<=rh:s.size<=rh,"Max file size is 5MB.").refine(s=>(e=>e.mimetype!==void 0)(s)?nh.includes(s.mimetype):nh.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:Rs().optional(),singleSession:Rs().optional(),firstLogin:Rs().optional(),preferences:ih.partial().optional()}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"});var oh;(function(s){s.READY="ready",s.RESTARTING="restarting",s.STARTING="starting",s.STARTED="started",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown"})(oh||(oh={}));class c_ 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 l_ 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 c_(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 u_{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 d_{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 l_(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 h_{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 u_(this.proxy),t=new d_(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 Oe=lf.create({baseURL:`${location.origin}/api`});Oe.interceptors.request.use(s=>{const{accessToken:e}=Fs();return e&&(s.headers.Authorization=`Bearer ${e}`),s},s=>Promise.reject(s));Oe.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(),Oe(e)}catch(u){return Promise.reject(u)}}return Promise.reject(s)});const Cn=()=>({add:e=>{P0.emit("add",e)}}),Vm=async s=>(await Oe.get("/auth/check",{signal:s})).data,m_=async({parameter:s,signal:e})=>(await Oe.get("/auth/tokens",{params:s,signal:e})).data,Hm=async({loginInformation:s})=>(await Oe.post("/auth/login",s)).data,Qm=async()=>(await Oe.post("/auth/logout")).data,p_=async({id:s,access_token:e})=>(await Oe.post(`/auth/logout/${s}`,null,{params:{token:e}})).data,Km=async({refresh_token:s})=>(await Oe.post("/auth/refresh",{refresh_token:s})).data;class i9{constructor(){p(this,"_queryClient",Ci());p(this,"authStore",Fs());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{name:"checkQuery",enabled:!0},{name:"listQuery",enabled:!0}]))}get queryClient(){return this._queryClient}checkQuery(){var e;return Vt({queryKey:["auth",(e=this.authStore.user)==null?void 0:e.username],queryFn:({signal:t})=>Vm(t),enabled:()=>this.queryActivator.value.some(t=>t.name==="checkQuery"&&t.enabled)})}listQuery(e){return Vt({queryKey:["tokensList",e],queryFn:({signal:t})=>m_({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="listQuery"&&t.enabled)})}loginQuery(){return dt({mutationFn:Hm})}logoutQuery(){return dt({mutationFn:Qm})}logoutTokenQuery(){return dt({mutationFn:p_,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 dt({mutationFn:Km})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const f_=async({userData:s})=>(await Oe.post("/users",s)).data,g_=async({username:s,signal:e})=>(await Oe.get(`/users/${s}`,{signal:e})).data,v_=async({parameter:s,signal:e})=>(await Oe.get("/users",{params:s,signal:e})).data,wa=async({username:s,userData:e})=>(await Oe.patch(`/users/${s}`,e)).data,__=async({username:s})=>(await Oe.delete(`/users/${s}`)).data,y_=async()=>(await Oe.delete("/users")).data,b_=async({username:s,cameraname:e,shortcutData:t})=>(await Oe.post(`/users/${s}/preferences/cameras/${e}/shortcuts`,t)).data,w_=async({username:s,cameraname:e,shortcutid:t,signal:n})=>(await Oe.get(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,{signal:n})).data,x_=async({username:s,cameraname:e,signal:t})=>(await Oe.get(`/users/${s}/preferences/cameras/${e}/shortcuts`,{signal:t})).data,S_=async({username:s,cameraname:e,shortcutid:t,shortcutData:n})=>(await Oe.patch(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,n)).data,C_=async({username:s,cameraname:e,shortcutid:t})=>(await Oe.delete(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`)).data,k_=async({username:s,cameraname:e})=>(await Oe.delete(`/users/${s}/preferences/cameras/${e}/shortcuts`)).data,E_=async({username:s,viewData:e})=>(await Oe.post(`/users/${s}/preferences/camview/views`,e)).data,A_=async({username:s,viewid:e,signal:t})=>(await Oe.get(`/users/${s}/preferences/camview/views/${e}`,{signal:t})).data,M_=async({username:s,parameter:e,signal:t})=>(await Oe.get(`/users/${s}/preferences/camview/views`,{params:e,signal:t})).data,ah=async({username:s,viewid:e,viewData:t})=>(await Oe.patch(`/users/${s}/preferences/camview/views/${e}`,t)).data,$_=async({username:s,viewid:e})=>(await Oe.delete(`/users/${s}/preferences/camview/views/${e}`)).data,P_=async({username:s})=>(await Oe.delete(`/users/${s}/preferences/camview/views`)).data;class T_{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{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 dt({mutationFn:f_,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 Vt({queryKey:["users",e],queryFn:({signal:t})=>g_({username:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getUserQuery"&&t.enabled)})}getUsersQuery(e){return Vt({queryKey:["usersList",e],queryFn:({signal:t})=>v_({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getUsersQuery"&&t.enabled)})}patchUserQuery(){return dt({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 dt({mutationFn:__,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 dt({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.users_removed"),life:3e3})}})}createShortcutQuery(){return dt({mutationFn:b_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})}})}getShortcutQuery(e,t,n){return Vt({queryKey:["shortcutsList",e,t,n],queryFn:({signal:r})=>w_({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 Vt({queryKey:["shortcutsList",e,t],queryFn:({signal:n})=>x_({username:c(e),cameraname:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getShortcutsQuery"&&n.enabled)})}patchShortcutQuery(){return dt({mutationFn:S_,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 dt({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})}})}removeShortcutsQuery(){return dt({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})}})}createViewQuery(){return dt({mutationFn:E_,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 Vt({queryKey:["viewsList",e],queryFn:({signal:n})=>A_({username:c(e),viewid:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getUserQuery"&&n.enabled)})}getViewsQuery(e,t){return Vt({queryKey:["viewsList",e,t],queryFn:({signal:n})=>M_({username:c(e),parameter:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getViewsQuery"&&n.enabled)})}patchViewQuery(){return dt({mutationFn:ah,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 dt({mutationFn:ah,onSuccess:async(e,t)=>{await this._queryClient.invalidateQueries({queryKey:["viewsList",t.username]})}})}removeViewQuery(){return dt({mutationFn:$_,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 dt({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.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 R_(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:W=>W?JSON.parse(W):null,write:W=>JSON.stringify(W)}}),n=Ls(null),r=Ls(null),i=Ls(null),o=oe(!1),a=oe(!1),l=oe(!1),u=se(()=>t.value!==null),d=se(()=>r.value!==null&&!i.value&&!o.value),h=se(()=>{var W;return((W=t.value)==null?void 0:W.access_token)??null});Ze(s,()=>{a.value=!1},{deep:!0}),Ze(t,W=>{!a.value&&!sa(W,t.value)&&k()},{deep:!0});const v=async W=>{if(r.value)return r.value;o.value=!0,i.value=null;try{n.value||(n.value=new h_({endpoint:window.origin,token:W,skipCheck:!0,logger:{...console,attention:console.warn,success:console.log}}));const I=await n.value.connect();return r.value=I,I}catch(I){const E=I instanceof Error?I:new Error(String(I));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 W=>{if(!u.value){l.value=!1,a.value=!0;try{const I=await Hm({loginInformation:W});t.value=I,await v(I.access_token),e.push("/cameras")}finally{a.value=!1}}},k=async()=>{!u.value||l.value||(l.value=!0,a.value=!0,await f(),O(),await Qm(),t.value=null,e.push("/"),window.location.reload(),a.value=!1)},z=async()=>{if(!t.value)return;const W=await Km({refresh_token:t.value.refresh_token});n.value&&await n.value.updateCredentials({endpoint:window.origin,token:W.access_token}),t.value.access_token=W.access_token},O=async()=>{try{if("serviceWorker"in navigator){const I=await(await navigator.serviceWorker.ready).pushManager.getSubscription();I&&await I.unsubscribe()}}catch{}},te=async(W,I)=>{t.value&&(W&&await wa({username:t.value.username,userData:W}),I&&await wa({username:t.value.username,userData:I}))};return u.value&&h.value&&v(h.value).catch(W=>{console.error("Error initializing API:",W)}),{isLoggedIn:u,isApiReady:d,loginLoading:a,api:r,apiError:i,accessToken:h,user:t,login:b,logout:k,refreshToken:z,updateUser:te,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:""},o9=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)}}),I_=(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 Zm=s=>{switch(s){case"error":return"error";case"info":return"info";case"success":return"success";case"warning":return"warn";default:return"info"}},a9=s=>{s||(s=new Date);const e=new Date(s);return e.setMilliseconds(0),e},c9=s=>{s||(s=new Date);const e=new Date(s);return e.setSeconds(0,0),e.setMilliseconds(0),e},O_=["src","alt"],N_=["src","alt","width","height"],F_=Tt({__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}=Jt(e),u=oe(!1),d=oe(!1),h=se(()=>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 O=Lr,te=T0;return m(),L(te,{alt:k.alt,class:"w-full h-full flex items-center justify-center"},{image:$(()=>[!c(u)&&!c(d)?(m(),L(O,{key:0,"stroke-width":"6",class:"w-[50%] h-[50%] max-w-[30px] max-h-[30px]"})):ae("",!0),It(g("div",{class:at(c(a)),style:ot(c(l))},[c(d)?ae("",!0):It((m(),M("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,O_)),[[Pr,c(u)]]),c(d)?(m(),M("img",{key:1,src:c(h),alt:k.alt,width:c(n),height:c(r),class:"contain",style:ot({aspectRatio:c(i)})},null,12,N_)):ae("",!0)],6),[[Pr,c(u)||c(d)]])]),_:1},8,["alt"])}}}),Fa=qs(F_,[["__scopeId","data-v-6696d637"]]),L_=Tt({__name:"CuiAvatar",props:{src:{},showBorder:{type:Boolean,default:!0},size:{default:22}},setup(s){const e=s,{showBorder:t,size:n,src:r}=Jt(e);return(i,o)=>{const a=Fa;return m(),M("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)}}}),Gm=qs(L_,[["__scopeId","data-v-82af9e29"]]),j_={class:"flex items-center justify-center absolute left-3 h-full"},q_={key:0,class:"flex items-center shrink-0"},D_={key:1,class:"shrink-0"},B_={key:2,class:"shrink-0"},z_={key:0,class:"overflow-hidden flex-1 ml-10"},U_={class:"flex flex-row items-center justify-between"},V_={class:"text-start flex-1"},H_={key:0,class:"text-xs text-muted"},Q_=Tt({__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:O,showTooltip:te,fallbackActivePath:W}=Jt(n),I=se(()=>t.path===b.value||b.value!=="/"&&(t.path.startsWith(b.value+"/")||t.path.startsWith((W.value??b.value)+"/"))),E=()=>{e.logout()};return(N,D)=>{const C=Gm,A=Xh,B=ys,H=Ei("RouterLink"),R=jr;return m(),L(H,{to:c(b)},{default:$(({isActive:w})=>[It((m(),L(B,tt({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(I))&&!c(u),"hover:!text-color active:!text-color focus:!text-color":!w&&!c(I)}],fluid:""},c(O)),{default:$(()=>[g("div",j_,[c(u)?(m(),M("div",q_,[y(C,{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(I)||!c(a)?(m(),M("div",D_,[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(I))?(m(),M("div",B_,[y(c(a),{style:ot({width:`${c(i)}px`,height:`${c(i)}px`})},null,8,["style"])])):ae("",!0)]),y(Pt,{name:"fade"},{default:$(()=>[c(f)?(m(),M("div",z_,[g("div",U_,[g("div",V_,[g("div",{class:at(["text-sm max-w-100 truncate font-semibold",[c(d),{"text-color font-bold":c(u)}]])},he(c(h)),3),c(v)?(m(),M("div",H_,he(c(v)),1)):ae("",!0)]),c(k)?(m(),L(B,{key:0,text:"",rounded:"",class:"dark-mode cui-icon-md",onClick:E},{icon:$(()=>[y(A,{width:"100%",height:"100%"})]),_:1})):ae("",!0)])])):ae("",!0)]),_:1})]),_:2},1040,["class"])),[[R,{value:c(te)&&!c(f)?c(h):"",pt:{root:{class:"dark-mode"}}}]])]),_:1},8,["to"])}}}),Wm=qs(Q_,[["__scopeId","data-v-13c365f7"]]),K_="modulepreload",Z_=function(s){return"/"+s},ch={},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=Z_(u),u in ch)return;ch[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":K_,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)})},G_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W_(s,e){return m(),M("svg",G_,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 J_=me({name:"lets-icons-back",render:W_}),Y_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X_(s,e){return m(),M("svg",Y_,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8z"},null,-1)]))}const e2=me({name:"mdi-home",render:X_}),t2={class:"relative flex items-center justify-center draggable-region"},s2={class:"container mx-auto px-6 relative z-10"},n2={class:"text-center"},r2={class:"text-8xl font-bold mb-4 relative flex items-center justify-center"},i2={class:"relative w-24 h-24 mx-2 group"},o2={class:"relative z-1 scale-150 non-draggable-region"},a2={class:"text-muted max-w-md mx-auto mb-8"},c2={class:"flex items-center justify-center gap-4"},l2={class:"text-white"},u2=Tt({__name:"404",setup(s){return(e,t)=>{const n=e2,r=ys,i=Ei("RouterLink"),o=J_;return m(),M("div",t2,[g("div",s2,[g("div",n2,[g("h1",r2,[t[1]||(t[1]=g("span",null,"4",-1)),g("div",i2,[g("div",o2,[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",a2,he(e.$t("views.404.error_message")),1),g("div",c2,[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",l2,he(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,he(e.$t("components.form.button.back")),1)]),_:1})])])])])}}}),d2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h2(s,e){return m(),M("svg",d2,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 m2=me({name:"ic-baseline-discord",render:h2}),p2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f2(s,e){return m(),M("svg",p2,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 g2=me({name:"mdi-github",render:f2});function Jm(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Ym=kt({enabled:Ss().default(!1)}).strict(),v2=Os([be("animal"),be("person"),be("vehicle"),be("other"),be("motion")]),El=ff([xn(),xn()]),Al=kt({name:Ke().trim().min(1,"Zone Name is required"),points:El.array().min(3,"At least 3 points are required"),type:Os([be("intersect"),be("contain")]),filter:Os([be("include"),be("exclude")]),classes:v2.array(),isPrivacyMask:Ss(),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(),Xm=kt({motion:kt({timeout:xn().min(10,"Minimum 10 seconds")}),object:kt({confidence:xn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),Ml=Os([be("high-resolution"),be("mid-resolution"),be("low-resolution"),be("snapshot")]),_2=Os([be("high-resolution"),be("mid-resolution"),be("low-resolution"),be("auto")]),ep=Os([be("bubble://"),be("cui://"),be("doorbird://"),be("dvrip://"),be("echo:"),be("eseecloud://"),be("exec:"),be("expr:"),be("ffmpeg:"),be("flussonic://"),be("gopro://"),be("hass:"),be("homekit://"),be("http://"),be("https://"),be("httpx://"),be("isapi://"),be("ivideon:"),be("kasa://"),be("nest:"),be("onvif://"),be("ring:"),be("roborock://"),be("rtmp://"),be("rtsp://"),be("rtspx://"),be("tapo://"),be("tcp://"),be("webrtc:"),be("webtorrent:")]),y2=ep.options.map(s=>s.value),b2=new RegExp(`^(${y2.join("|")})`),tp=Ke().refine(s=>{if(!b2.test(s))return!1;try{return new URL(s),!0}catch{return!1}},{message:"Invalid URL format or unsupported protocol"}),w2=kt({_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:Ss().default(!1),hotMode:Ss().default(!1),urls:tp.array().min(1,"At least one valid URL is required")}).strict(),x2=kt({_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:Ss().default(!1),hotMode:Ss().default(!1),urls:tp.array().min(1,"At least one valid URL is required")}).strict(),Cr=kt({id:Ke(),name:Ke().trim()}),sp=kt({hub:Cr.array().optional(),cameraController:Cr.optional(),motionDetection:Cr.optional(),audioDetection:Cr.optional(),objectDetection:Cr.optional(),ptz:Cr.optional(),plugins:Cr.array()}).strict(),S2=Os([be("auto"),be("mse"),be("webrtc"),be("webrtc/tcp")]),C2=Os([be("16:9"),be("8:3"),be("4:3"),be("auto")]),np=kt({decoder:Os([be("pillow"),be("wasm"),be("rust"),be("gpu")]),fps:xn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Os([be("640x480"),be("640x360"),be("320x240"),be("320x180")])}),rp=Os([be("camera"),be("doorbell")]),ip=kt({streamingMode:S2,streamingSource:_2,aspectRatio:C2}),op=kt({model:Ke().trim().optional(),manufacturer:Ke().trim().optional(),hardware:Ke().trim().optional(),serialNumber:Ke().trim().optional(),firmwareVersion:Ke().trim().optional(),supportUrl:Ke().trim().optional()}),k2=kt({name:Ke().trim().min(1,"Camera name is required"),url:Ke().trim().url().min(1,"Camera URL is required"),type:Os([be("Google"),be("Ring"),be("HomeKit"),be("Onvif"),be("Hass"),be("GoPro"),be("Roborock"),be("FFmpeg"),be("DVRip"),be("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"]}),E2=kt({_id:Ke().default(hn()).transform(()=>hn()),nativeId:Ke().trim().optional(),pluginId:Ke().trim().default("native"),disabled:Ss().default(!1),name:Ke().trim().min(1,"Camera name is required"),type:rp.default("camera"),isCloud:Ss().default(!1),snapshotTTL:xn().min(30,"Minimum cache time must be 30").default(600),info:op.default({model:"IP Camera",manufacturer:"camera.ui",hardware:"Camera",serialNumber:"Unknown",firmwareVersion:"Unknown",supportUrl:"Unknown"}),sources:w2.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:sp.default({hub:[],plugins:[]}),recording:Ym.default({enabled:!1}),interface:ip.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:Al.default([]),detectionSettings:Xm.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:np.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||Jm(e)?{...s,isCloud:!0}:s}),A2=kt({disabled:Ss().optional(),type:rp.optional(),name:Ke().trim().min(1,"Camera name is required").optional(),isCloud:Ss().optional(),snapshotTTL:xn().min(30,"Minimum cache time must be 30").optional(),info:op.partial().optional(),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"}).optional(),extensions:sp.partial().optional(),interface:ip.partial().optional(),recording:Ym.partial().optional(),detectionZones:Al.optional(),detectionSettings:Xm.partial().optional(),frameWorkerSettings:np.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||Jm(e))return{...s,isCloud:!0}}return s});kt({url:Ke().trim()}).strict();const M2=/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/;var $2=(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))($2||{});const lh=["image/jpeg","image/png"],uh=1024*1024*2,dh=["video/mp4","video/quicktime"],hh=1024*1024*10,mh=["audio/mpeg","audio/wav","audio/ogg"],ph=1024*1024*2;kt({pluginname:Ke().trim().refine(s=>M2.test(s),"Not a valid plugin name"),pluginversion:Ke().trim().optional().default("latest")}).strict();kt({actionId:Ke(),payload:ur()}).strict();ol(ur(),ur());kt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=uh:s.size<=uh,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?lh.includes(s.mimetype):lh.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))});kt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=ph:s.size<=ph,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?mh.includes(s.mimetype):mh.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))});kt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=hh:s.size<=hh,"Max file size is 5 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?dh.includes(s.mimetype):dh.includes(s.type),".mp4 files are accepted"),config:Hn().transform(s=>JSON.parse(s.value))});ol(Ke(),ur());kt({key:Ke()}).strict();kt({key:Ke(),payload:ur()}).strict();kt({version:Ke().trim().optional().default("latest")}).strict();const P2=kt({mode:Os([be("disabled"),be("port-forward"),be("router-forward"),be("cloudflare"),be("custom-domain")]).default("disabled"),cloudflare:kt({tunnelToken:Ke().trim(),customDomain:Ke().trim(),tunnelUrl:Ke().trim(),tunnelCredentials:kt({username:Ke().trim(),password:Ke().trim()}).partial()}).partial().strict(),customDomain:kt({url:Ke().trim().optional()}).partial().strict()}).strict(),l9=kt({serverAddresses:Ke().trim().ip().array().default([]),remoteAccess:P2}).strict(),fh=["image/jpeg","image/jpg","image/png"],gh=1024*1024*5,ap=kt({index:xn(),cameraId:Ke()}),cp=Os([be(1),be(4),be(6),be(7),be(9),be(10),be(12),be(13),be(15),be(16),be(20),be(26)]),T2=Os([be("dnd"),be("view")]),lp=kt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Layout name is required"),viewSize:cp,cameras:ap.array(),type:T2});kt({name:Ke().trim().min(1,"Layout name is required"),viewSize:cp,cameras:ap.array()}).partial().optional();const R2=kt({views:lp.array()}),I2=kt({_id:Ke().default(hn()).transform(()=>hn()),cameraId:Ke(),points:El});kt({cameraId:Ke(),points:El}).partial().optional();const O2=kt({shortcuts:I2.array()}),up=kt({camview:R2,cameras:ol(Ke().trim(),O2)}),N2=kt({_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([be("admin"),be("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:Ss().default(!1),singleSession:Ss().default(!1),firstLogin:Ss().default(!0),preferences:up.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),F2=kt({username:Ke().trim().min(1,"Username is required"),password:Ke().trim().min(1,"Password is required"),rememberMe:Ss().default(!1)}).strict(),L2=kt({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([be("admin"),be("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)<=gh:s.size<=gh,"Max file size is 5MB.").refine(s=>(t=>t.mimetype!==void 0)(s)?fh.includes(s.mimetype):fh.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:Ss().optional(),singleSession:Ss().optional(),firstLogin:Ss().optional(),preferences:up.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),vh=s=>s.type==="number",_h=s=>s.type==="boolean",xa=s=>s.type==="string"&&"enum"in s,yh=s=>s.type==="array",zr=s=>s.type==="button",Ur=s=>s.type==="submit",j2=s=>ar(s)&&(!s.format||s.format!=="qrCode"&&s.format!=="image"),q2=(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}},D2=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},u9=(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},dp=(s,e)=>e?s.filter(t=>"group"in t&&t.group===e):s,B2=(s,e)=>{const t=dp(s,e);return t.length>0&&t.every(n=>"readonly"in n&&n.readonly)},z2=(s,e)=>{const t=dp(s,e);return t.length>0&&t.some(n=>"store"in n&&n.store)},U2=(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},hp=s=>{if(zr(s)||Ur(s))return ur();switch(s.type){case"string":if(xa(s))if(s.multiple){let i=Cu(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()===""||U2(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?Ss():Ss().optional();case"array":const n=hp(s.items),r=Cu(n);return s.required?r:r.optional();default:return s.required?ur():ur().optional()}},V2=s=>{const e={};return s.forEach(t=>{!zr(t)&&!Ur(t)&&(e[t.key]=hp(t))}),kt(e)},H2=Wn(F2),d9=Wn(N2),h9=Wn(L2),m9=Wn(lp),Q2={class:"flex justify-center items-center draggable-region"},K2={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"},Z2={class:"flex flex-col h-full p-10 non-draggable-region"},G2={class:"flex flex-col items-center justify-center mb-10"},W2={class:"flex flex-col gap-10 md:gap-6 w-full mt-10 md:mt-0"},J2={for:"username",class:"cui-label"},Y2={for:"password",class:"cui-label"},X2={class:"flex flex-col gap-6 mt-10"},ey={class:"flex items-center field-checkbox-gap"},ty={for:"rememberMe",class:"cui-label-checkbox"},sy={class:"flex justify-end items-center gap-1"},ny=Tt({__name:"Login",setup(s){const e=Cn(),t=Fs(),{t:n}=js(),{loginLoading:r}=Vs(t),i=Qt("formRef"),o=oe(""),a=oe(""),l=oe(!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=Lh,b=R0,k=ys,z=Ea,O=g2,te=m2;return m(),M("div",Q2,[g("div",K2,[g("div",Z2,[g("div",G2,[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(H2),class:"flex flex-col h-full",onSubmit:u},{default:$(()=>[g("div",W2,[y(c(Dt),{modelValue:c(o),"onUpdate:modelValue":h[0]||(h[0]=W=>ps(o)?o.value=W:null),modelModifiers:{trim:!0},name:"username",as:"div",class:"flex flex-col field-gap"},{default:$(({field:W,errors:I})=>[g("label",J2,he(d.$t("components.form.label.username")),1),y(v,tt({invalid:I.length>0,type:"text",size:"large",loading:c(r),fluid:""},W),null,16,["invalid","loading"]),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"username",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:c(a),"onUpdate:modelValue":h[1]||(h[1]=W=>ps(a)?a.value=W:null),name:"password",as:"div",class:"flex flex-col field-gap"},{default:$(({field:W,errors:I})=>[g("label",Y2,he(d.$t("components.form.label.password")),1),y(f,tt({invalid:I.length>0,size:"large",loading:c(r),feedback:!1,"toggle-mask":"",fluid:""},W),null,16,["invalid","loading"]),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"password",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])]),g("div",X2,[y(c(Dt),{"model-value":c(l),name:"rememberMe",type:"checkbox","checked-value":!0,"unchecked-value":!1,as:"div",class:"flex flex-col field-gap"},{default:$(({field:W,errors:I})=>[g("div",ey,[y(b,tt({"model-value":c(l)},W,{invalid:I.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",ty,he(d.$t("components.form.label.remember_me")),1)]),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{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",sy,[y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(O,{class:"text-muted",width:"100%",height:"100%"})]),_:1}),y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(te,{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))])])}}}),mp=Mi("loading",()=>({routerLoading:oe(!1)})),ry={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iy(s,e){return m(),M("svg",ry,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 bh=me({name:"mingcute-grid-fill",render:iy}),oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ay(s,e){return m(),M("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 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 wh=me({name:"mingcute-grid-line",render:ay}),cy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ly(s,e){return m(),M("svg",cy,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 xh=me({name:"bx-cctv",render:ly}),uy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dy(s,e){return m(),M("svg",uy,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=me({name:"bxs-cctv",render:dy}),hy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function my(s,e){return m(),M("svg",hy,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 Sh=me({name:"mdi-note-edit",render:my}),py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fy(s,e){return m(),M("svg",py,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 Ch=me({name:"mdi-note-edit-outline",render:fy}),gy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vy(s,e){return m(),M("svg",gy,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 kh=me({name:"tabler-puzzle",render:vy}),_y={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yy(s,e){return m(),M("svg",_y,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=me({name:"tabler-puzzle-filled",render:yy}),by={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function wy(s,e){return m(),M("svg",by,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 Eh=me({name:"icon-park-outline-terminal",render:wy}),xy={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},Sy=["id"],Cy=["mask"];function ky(s,e){return m(),M("svg",xy,[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,Sy)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSTerminal0+")"},null,8,Cy)])}const Ah=me({name:"icon-park-solid-terminal",render:ky,setup(){return{idMap:{ipSTerminal0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Ey={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ay(s,e){return m(),M("svg",Ey,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=me({name:"mingcute-photo-album-fill",render:Ay}),My={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $y(s,e){return m(),M("svg",My,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=me({name:"mingcute-photo-album-line",render:$y}),Py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ty(s,e){return m(),M("svg",Py,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 Mh=me({name:"solar-graph-bold",render:Ty}),Ry={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Iy(s,e){return m(),M("svg",Ry,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 $h=me({name:"solar-graph-outline",render:Iy}),Oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ny(s,e){return m(),M("svg",Oy,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 Ph=me({name:"bx-network-chart",render:Ny}),Fy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ly(s,e){return m(),M("svg",Fy,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 Th=me({name:"bxs-network-chart",render:Ly}),jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qy(s,e){return m(),M("svg",jy,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=me({name:"mdi-cog",render:qy}),Dy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function By(s,e){return m(),M("svg",Dy,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=me({name:"mdi-cog-outline",render:By}),zy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Uy(s,e){return m(),M("svg",zy,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 Vy=me({name:"mdi-account-circle",render:Uy}),Hy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qy(s,e){return m(),M("svg",Hy,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 Ky=me({name:"mdi-account-circle-outline",render:Qy}),Zy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Gy(s,e){return m(),M("svg",Zy,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 Wy=me({name:"ic-outline-design-services",render:Gy}),Jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yy(s,e){return m(),M("svg",Jy,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 Xy=me({name:"ic-round-design-services",render:Yy}),eb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tb(s,e){return m(),M("svg",eb,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 sb=me({name:"mdi-users",render:tb}),nb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rb(s,e){return m(),M("svg",nb,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 ib=me({name:"mdi-users-outline",render:rb}),ob={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function ab(s,e){return m(),M("svg",ob,e[0]||(e[0]=[Hh('<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 cb=me({name:"clarity-backup-restore-line",render:ab}),lb={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function ub(s,e){return m(),M("svg",lb,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 db=me({name:"clarity-backup-restore-solid",render:ub}),hb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mb(s,e){return m(),M("svg",hb,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 pb=me({name:"material-symbols-cloud",render:mb}),fb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gb(s,e){return m(),M("svg",fb,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 vb=me({name:"material-symbols-cloud-outline",render:gb}),_b={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yb(s,e){return m(),M("svg",_b,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 bb=me({name:"mingcute-settings-2-fill",render:yb}),wb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xb(s,e){return m(),M("svg",wb,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 Sb=me({name:"mingcute-settings-2-line",render:xb}),Cb=sl(J0),kb=sl(W0);function Vr(){const{angle:s}=Cb(),e=kb({listenOrientation:!0}),t=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=360}),n=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=450}),r=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<640}),i=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<768}),o=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>768&&d<1024}),a=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1024}),l=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1280}),u=se(()=>{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:u2,meta:{name:"notfound",auth:{requiresAuth:!1,role:"none"}}},{name:"Login",path:"/login",alias:"/",component:ny,meta:{name:"login",auth:{requiresAuth:!1,role:"none"},ui:{background:se(()=>$s.value?"var(--card-background)":void 0)}}},{name:"FirstSteps",path:"/first-steps",component:()=>vs(()=>import("./FirstSteps.DpIIjDgR.0.0.58-internal.2.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.CH9Jp0y1.0.0.58-internal.2.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:se(()=>!cc.value),fullwidth:se(()=>cc.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:xh,active:zc}},bottombar:{icon:{default:xh,active:zc}}}},{name:"Camera",path:"/cameras/:cameraname",component:()=>vs(()=>import("./Camera.ClowKxTJ.0.0.58-internal.2.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:se(()=>$s.value),ignoreSafeAreaBottom:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:se(()=>!$s.value)}}},{name:"Camview",path:"/camview",component:()=>vs(()=>import("./Camview.BPBs14YX.0.0.58-internal.2.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:se(()=>!cc.value)},background:"#000000",showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:wh,active:bh}},bottombar:{icon:{default:wh,active:bh}}}},{name:"Recordings",path:"/recordings",component:()=>vs(()=>import("./Recordings.CFL4OJm9.0.0.58-internal.2.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:se(()=>$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.DxpaumCj.0.0.58-internal.2.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:Ch,active:Sh}},profileMenu:{icon:{default:Ch,active:Sh}}}},{name:"Console",path:"/console",component:()=>vs(()=>import("./Console.JIgbV0MF.0.0.58-internal.2.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:Eh,active:Ah}},profileMenu:{icon:{default:Eh,active:Ah}}}},{name:"Plugins",path:"/plugins",component:()=>vs(()=>import("./Plugins.QtoKsSO7.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:kh,active:Uc}},profileMenu:{icon:{default:kh,active:Uc}}}},{name:"ScopedPlugin",path:"/plugins/:scope/:pluginname",component:()=>vs(()=>import("./Plugin.Br-EzIcR.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Plugin",path:"/plugins/:pluginname",component:()=>vs(()=>import("./Plugin.Br-EzIcR.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Adminpanel",path:"/admin",component:()=>vs(()=>import("./Adminpanel.BURyS2fd.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:$h,active:Mh}},profileMenu:{icon:{default:$h,active:Mh}}}},{name:"Cammesh",path:"/cammesh",component:()=>vs(()=>import("./Cammesh.ByVNJV12.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:Ph,active:Th}},profileMenu:{icon:{default:Ph,active:Th}}}},{name:"Settings",path:"/settings",component:()=>vs(()=>import("./Settings.IxJy7omz.0.0.58-internal.2.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.75RYOuGO.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Ky,active:Vy}}}},{name:"SettingsAppearance",path:"appearance",component:()=>vs(()=>import("./SettingsAppearance.Bv4CuFga.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Wy,active:Xy}}}},{name:"SettingsUsers",path:"user",component:()=>vs(()=>import("./SettingsUsers.Cqhyznjv.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ib,active:sb}}}},{name:"SettingsRecordings",path:"recordings",component:()=>vs(()=>import("./SettingsRecordings.Dt_qMSqs.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ac,active:oc}}}},{name:"SettingsBackup",path:"backup",component:()=>vs(()=>import("./SettingsBackup.BOppgt5m.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:cb,active:db}}}},{name:"SettingsRemote",path:"remote",component:()=>vs(()=>import("./SettingsRemote.CCQRT8cB.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:vb,active:pb}}}},{name:"SettingsSystem",path:"system",component:()=>vs(()=>import("./SettingsSystem.Bp5gBnxf.0.0.58-internal.2.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Sb,active:bb}}}}]}],La=mf({history:pf("/"),routes:uo,scrollBehavior:async()=>(await R_(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=mp(),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 Vm()}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=oe(new Map),e=oe(!1),t=oe(!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,O)=>new yf(te=>{b.emit(z,O,W=>{typeof W=="object"&&W.error?te.error(W):te.next(W),te.complete()})})}},l=se(()=>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}}),p9=["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},Eb=Symbol("cui-app-bus"),zi=Tr({navbarState:void 0,subbarState:void 0}),Rl=()=>{const s=Gh(Eb);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=se(()=>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=se(()=>e.path.includes("/settings")?i.value?"opened":t.subbarState?t.subbarState:"closed":void 0),u=se(()=>{var v;return!!Xs((v=e.meta.ui)==null?void 0:v.showNavbar)}),d=se(()=>{var v;return!!(Xs((v=e.meta.ui)==null?void 0:v.showBottombar)&&o.value.interface.showBottomBarOnMobile&&r.value)}),h=se(()=>{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},Ab={class:"pl-safe pt-safe h-full flex flex-col"},Mb={class:"overflow-hidden w-full pr-4"},$b={key:0,class:"ml-2 w-full flex flex-row items-center"},Pb={class:"flex flex-col flex-1 my-4 px-[0.9rem]"},Tb={class:"flex flex-col space-y-1"},Rb={class:"flex flex-col space-y-1 pb-safe"},Ib={key:0,class:"dark-mode text-muted pl-3 uppercase text-xs font-bold"},Ob=Tt({__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=Qt("navbarRef"),f=oe("closed"),b=Ls(),k=oe(!1),z=oe(!1),O=oe(!1),te=oe(!1);nl(v,R=>{const w=R.target,Q=w.closest("#menu-icon"),J=w.closest("#submenu-icon"),j=w.closest("#navbar-icon");!Q&&!J&&!j&&C()});const W=se(()=>d.value.interface.selectedSettingsView),I=se(()=>uo.filter(R=>{var w,Q;return((Q=(w=R.meta)==null?void 0:w.navbar)==null?void 0:Q.position)==="top"&&R.meta&&Si(R)})),E=se(()=>uo.filter(R=>{var w,Q;return((Q=(w=R.meta)==null?void 0:w.navbar)==null?void 0:Q.position)==="bottom"&&Si(R)})),N=se(()=>d.value.interface.navbarStayCollapsed&&f.value!=="opened"?"closed":l.value?"opened":f.value),D=se(()=>N.value==="closed"?a.value?vn.CLOSED:vn.MINIFIED:vn.EXPANDED);Ze(u,R=>{R&&R!==f.value&&(f.value=R==="minified"||R==="closed"?"closed":"opened")}),Ze(t.currentRoute,(R,w)=>{R.path!==w.path&&C()}),Ze(h,()=>{var R,w,Q,J;((R=h.value)==null?void 0:R.role)==="admin"||((w=h.value)==null?void 0:w.role)==="master"?(b.value=i.connectToNamespace("/server"),b.value.socket.on("plugin-updates",j=>{z.value=j.length>0||!1}),b.value.socket.on("server-updates",j=>{k.value=j.updateAvailable||j.betaUpdateAvailable||!1}),b.value.request("get-updates").subscribe(j=>{z.value=j.plugins.length>0||!1,k.value=j.server.updateAvailable||j.server.betaUpdateAvailable||!1})):(J=(Q=b.value)==null?void 0:Q.disconnect)==null||J.call(Q)},{deep:!0,immediate:!0}),Ze(O,R=>{R&&B()});const C=()=>{o.emit({navbarState:"closed"})},A=(R,w)=>{O.value&&w.channel==="update-check"&&w.status==="available"&&(k.value=!0)},B=async()=>{if(O.value){window.electron.removeListener("app-status",A),window.electron.on("app-status",A),window.electron.send("check-for-updates");try{const R=await window.electron.invoke("get-update-available");k.value=R.isUpdateAvailable}catch{}}},H=()=>{const R=document.querySelector('meta[name="electron-server"]'),w=R!==null&&R.getAttribute("content")==="true";O.value=window.electron!==void 0,te.value=w,setTimeout(()=>{O.value=window.electron!==void 0,te.value=w},100)};return Sn(()=>{H()}),vo(()=>{var R;(R=window.electron)==null||R.removeListener("app-status",A)}),e({navbarState:N}),(R,w)=>{var Se,F;const Q=Ei("RouterLink"),J=_o,j=ys,ie=jh,ue=Wm;return m(),M("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(D)===c(vn).EXPANDED}]),style:ot({left:c(D)===0?"-1px":"0px",width:`calc(${c(D)}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",Ab,[g("div",{class:at(["w-full flex items-center shrink-0 h-[60px]",{"mt-[25px]":c(O)}])},[y(Q,{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",Mb,[y(Pt,{name:"fade"},{default:$(()=>[c(D)===c(vn).EXPANDED?(m(),M("div",$b,[y(Q,{to:"/cameras",class:"text-white font-bold text-lg text-shadow"},{default:$(()=>w[0]||(w[0]=[Gt("camera.ui")])),_:1}),c(N)==="opened"&&c(a)?(m(),L(j,{key:0,id:"navbar-icon",class:"dark-mode ml-auto cui-icon-md text-white",text:"",rounded:"",onClick:C},{icon:$(()=>[y(J,{width:"100%",height:"100%"})]),_:1})):ae("",!0)])):ae("",!0)]),_:1})])],2),g("div",Pb,[g("div",Tb,[(m(!0),M(Ct,null,zt(c(I),q=>(m(),M("div",{key:q.name,class:"w-full h-[50px] relative"},[c(z)&&q.name==="Plugins"?(m(),L(ie,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ae("",!0),y(ue,{icon:q.meta.navbar.icon.default,"active-icon":q.meta.navbar.icon.active,to:q.path,label:R.$t(`navigation.${q.name.toLowerCase()}`),expanded:c(D)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(D)===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",Rb,[y(Pt,{name:"fade"},{default:$(()=>[c(N)==="opened"?(m(),M("span",Ib,he(R.$t("navigation.extras")),1)):ae("",!0)]),_:1}),(m(!0),M(Ct,null,zt(c(E),q=>(m(),M("div",{key:q.name,class:"w-full h-[50px] relative"},[c(k)&&q.name==="Settings"?(m(),L(ie,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ae("",!0),y(ue,{icon:q.meta.navbar.icon.default,"active-icon":q.meta.navbar.icon.active,to:q.path==="/settings"?`/settings/${c(W)}`:q.path,"fallback-active-path":q.path,label:R.$t(`navigation.${q.name.toLowerCase()}`),expanded:c(D)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(D)===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(D)===c(vn).EXPANDED,"show-logout":"",to:"/settings/account","dark-mode":"","avatar-size":22,class:at(["w-[50px] h-[50px]",{"w-full":c(D)===c(vn).EXPANDED}])},null,8,["label","description","expanded","class"])])])])],6)}}}),Nb={HEIGHT:60},Fb={class:"px-2 h-full pb-safe-offset-1 flex items-center justify-around"},Lb=Tt({__name:"CuiBottombar",setup(s,{expose:e}){const t=Qt("bottombarRef"),n=se(()=>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=Wm;return m(),M("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(Nb).HEIGHT}px + env(safe-area-inset-bottom, 0px))`})},[g("div",Fb,[(m(!0),M(Ct,null,zt(c(n),a=>(m(),L(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)}}}),jb=qs(Lb,[["__scopeId","data-v-78d01fd3"]]),qb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Db(s,e){return m(),M("svg",qb,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 Bb=me({name:"lucide-trash2",render:Db}),zb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ub(s,e){return m(),M("svg",zb,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 Vb=me({name:"solar-bell-bold",render:Ub}),Hb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qb(s,e){return m(),M("svg",Hb,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 Kb=me({name:"material-symbols-close-rounded",render:Qb}),Zb={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function Gb(s,e){return m(),M("svg",Zb,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 Wb=me({name:"octicon-chevron-left16",render:Gb}),pp=Symbol("DialogStepper");function Jb(s){const e=oe(s),t=oe(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=se(()=>!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(pp,v),v}function f9(){const s=mi(pp);if(!s)throw new Error("useCuiDialogStepperContext must be used within a dialog that uses useCuiDialogStepper");return s}const Yb={class:"p-dialog-header justify-start gap-1"},Xb={key:0,class:"p-dialog-header-actions"},e5={class:"p-dialog-title"},t5={class:"p-dialog-header-actions ml-auto"},s5={key:0},n5=["innerHTML"],r5={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)"}},i5=Tt({__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=Jt(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:O,src:te,title:W,fullscreen:I,tabs:E,markdown:N}=r;Xc("dialogRefProps",r);const D=oe(!1),C=oe(null),A=oe(!1),B=oe(W.value);let H;const R=n.value.options.templates,w=se(()=>{var Y;return!!(D.value||a!=null&&a.value||Xs((Y=C.value)==null?void 0:Y.isLoading))}),Q=se(()=>E.value!==void 0&&E.value.length>0),J=se(()=>k!=null&&k.value?k.value:t("components.form.button.close")),j=se(()=>z!=null&&z.value?z.value:t("components.form.button.save")),ie=se(()=>({...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=se(()=>({...d==null?void 0:d.value,label:j.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}));Q.value&&(H=Jb(E.value??[]),Ze(H.isMainTab,Y=>{A.value=!Y},{immediate:!0}),H.on("updateTabTitle",({tabId:Y,title:Te})=>{(H==null?void 0:H.currentTab.value)===Y&&(W!=null&&W.value)&&(B.value=Te)}),H.on("tabChange",Y=>{B.value=(Y==null?void 0:Y.title)??W.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{D.value=!0;const He=await((Te=(Y=C.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{D.value=!1}},q=async()=>{var Y,Te,He,pt;try{D.value=!0;const ft=await((Te=(Y=C.value)==null?void 0:Y.onConfirm)==null?void 0:Te.call(Y));if(ft===null)return;O!=null&&O.value?(pt=(He=n.value.options).onConfirm)==null||pt.call(He,ft):n.value.close({status:"confirm",data:ft})}catch(ft){console.error(ft),e.add({severity:"error",summary:t("components.toast.title_error"),detail:ft.message,life:3e3})}finally{D.value=!1}};return(Y,Te)=>{var Je;const He=Wb,pt=ys,ft=Kb,Ge=Fa;return m(),M(Ct,null,[g("div",Yb,[y(Pt,{name:"slide-left"},{default:$(()=>{var de;return[c(A)?(m(),M("div",Xb,[y(pt,{severity:"secondary",text:"",rounded:"",class:"p-dialog-back-button",onClick:(de=c(H))==null?void 0:de.goToMainTab},{icon:$(()=>[y(He,{width:"100%",height:"100%"})]),_:1},8,["onClick"])])):ae("",!0)]}),_:1}),g("span",e5,he(c(B)),1),g("div",t5,[y(pt,{severity:"secondary",text:"",rounded:"",class:"p-dialog-close-button",onClick:c(n).close},{icon:$(()=>[y(ft,{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(I)},c(f)]),style:ot(c(b))},[c(i)&&!c(N)?(m(),M("span",s5,he(c(i)),1)):c(i)&&c(N)?(m(),M("div",{key:1,class:"w-full markdown-body",innerHTML:c(Se).render(c(i))},null,8,n5)):c(te)?(m(),L(Ge,{key:2,src:c(te),"image-container-class":"w-full h-full"},null,8,["src"])):(m(),L(Ai((Je=c(R))==null?void 0:Je.content),tt({key:3,ref_key:"componentRef",ref:C,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",r5,[c(h)?ae("",!0):(m(),L(pt,tt({key:0},c(ie),{class:"cui-button-medium",onClick:F}),null,16)),Te[0]||(Te[0]=g("div",{class:"ml-auto"},null,-1)),c(v)?ae("",!0):(m(),L(pt,tt({key:1},c(ue),{loading:c(w),disabled:c(l),class:"cui-button-medium",onClick:q}),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 o5(){return{open:(e,t)=>{const n={content:e&&me(e),options:t||{},data:t&&t.data,close:r=>{bu.emit("close",{instance:n,params:r})}};return bu.emit("open",{instance:n}),n}}}function Il(){const s=o5(),{mdBreakpoint:e}=Vr(),t=(u,d)=>{const h=Tr({...u});kl(h.options.props,d)},n=(u,d)=>(Ze(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:O,...te}=d,W={content:v?me(v):void 0},I=s.open(i5,{data:Jt(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:W,...te,events:O,onConfirm:b,onCancel:k,onClose:E=>{var N,D;if(((N=E==null?void 0:E.data)==null?void 0:N.status)==="confirm"){const{status:C,...A}=E.data;b==null||b((A==null?void 0:A.data)??A)}else k==null||k();z==null||z(((D=E==null?void 0:E.data)==null?void 0:D.data)??(E==null?void 0:E.data))}});return f.fullscreen?I:n(I,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 a5=sl(Wh);function Ol(){const s=se(()=>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=se(()=>typeof window>"u"?!1:[/Android/i].some(k=>navigator.userAgent.match(k))),t=se(()=>typeof window>"u"?!1:n.value||r.value),n=se(()=>typeof window>"u"?!1:[/iPhone/i].some(k=>navigator.userAgent.match(k))),r=se(()=>typeof window>"u"?!1:[/Macintosh/i].some(k=>navigator.userAgent.match(k)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1)),i=se(()=>{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=se(()=>typeof window>"u"?!1:[/Safari/i].some(k=>navigator.userAgent.match(k))),a=se(()=>{if(typeof window>"u")return null;const b=/Version\/(\d+).+Safari/;return navigator.userAgent.match(b)}),l=se(()=>typeof window>"u"?!1:[/Firefox/i].some(k=>navigator.userAgent.match(k))),u=se(()=>typeof window>"u"?!1:[/Chrome/i].some(k=>navigator.userAgent.match(k))),d=se(()=>{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=se(()=>a5("(display-mode: standalone)").value||window.navigator.standalone||document.referrer.includes("android-app://")),v=se(()=>{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,O=k&&k>=17&&z&&z>=2;return!!(b||!n.value||n.value&&O)}),f=se(()=>{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 c5={class:"flex justify-between items-center mb-4 h-9"},l5={class:"flex items-center gap-2"},u5={class:"text-base font-semibold"},d5={class:"overflow-y-auto",style:{maxHeight:"234px"}},h5={class:"flex gap-3"},m5={class:"flex-1 min-w-0"},p5={class:"flex justify-between items-center"},f5={class:"font-semibold text-sm text-color truncate max-w-[200px]"},g5={class:"text-xs text-muted shrink-0"},v5={class:"text-xs text-muted mt-1 text-left line-clamp-2 overflow-hidden"},_5={key:0,class:"text-center py-8 text-muted text-sm"},y5=Tt({__name:"CuiNotificationMenu",setup(s){const{t:e}=js(),t=qr(),n=Pl(),r=Il(),{isTouch:i}=Ol(),o=Ls(),a=Qt("notificationsMenuRef"),l=oe([]),u=oe({}),d=oe(!1),h=oe(!1);Ze(d,C=>{C&&N()});const v=(C,[A])=>{var ie,ue;if(!A.isIntersecting){(ie=u.value[C])==null||ie.resetFn(),(ue=u.value[C])==null||ue.stopFn(),delete u.value[C];return}if(u.value[C])return;const B=A.target;if(!B.parentElement)return;const R=nl(B,()=>{u.value[C]&&u.value[C].resetFn()});let w;const Q=i.value?X0:ef,{direction:J,stop:j}=Q(B,{threshold:10,disableTextSelect:!0,onSwipe(){var Se,F;for(const q in u.value)q!==C&&((Se=u.value[q])==null||Se.resetFn());J.value==="left"?u.value[C]={left:"-75px",opacity:1,deleteOpacity:1,isSwiping:!0,resetFn(){this.left="0",this.opacity=1,this.deleteOpacity=0},stopFn:()=>{delete u.value[C],j(),R(),clearTimeout(w)}}:(F=u.value[C])==null||F.resetFn()},onSwipeEnd(){clearTimeout(w),w=setTimeout(()=>{u.value[C]&&(u.value[C].isSwiping=!1)},10)}})},f=C=>{var A;(A=a.value)==null||A.toggle(C)},b=C=>{const A=Date.now()-C,B=Math.floor(A/(1e3*60)),H=Math.floor(A/(1e3*60*60)),R=Math.floor(A/(1e3*60*60*24));return B<60?`${B}${e("components.notification_menu.short_minutes")}`:H<24?`${H}${e("components.notification_menu.short_hours")}`:R<7?`${R}${e("components.notification_menu.short_days")}`:R<30?`${Math.floor(R/7)}${e("components.notification_menu.short_weeks")}`:R<365?`${Math.floor(R/30)}${e("components.notification_menu.short_months")}`:`${Math.floor(R/365)}${e("components.notification_menu.short_years")}`},k=C=>{var B;const A=C.link;(B=a.value)==null||B.hide(),z(C),A&&t.push({path:A})},z=C=>{var A;if(C){const B=u.value[C._id];B==null||B.stopFn();const H=l.value.findIndex(R=>R._id===C._id);H!==-1&&(l.value.splice(H,1),(A=o.value)==null||A.socket.emit("remove-notification",C._id))}},O=()=>{var C,A;for(const B in u.value)(C=u.value[B])==null||C.stopFn();l.value.splice(0,l.value.length),(A=o.value)==null||A.socket.emit("clear-notifications")},te=C=>{switch(C){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)"}},W=C=>{const A=u.value[C._id];A!=null&&A.isSwiping||r.openTextDialog({data:{title:C.title,contentText:C.text,confirmText:C!=null&&C.link?e("components.form.button.go_to_message"):e("components.form.button.mark_as_read")},onConfirm:()=>k(C),onCancel:()=>z(C)})},I=()=>{var C,A;for(const B in u.value)(C=u.value[B])==null||C.resetFn(),(A=u.value[B])==null||A.stopFn()},E=(C,A)=>{if(d.value&&A.channel==="update-check"&&A.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(H=>H._id===B._id))return;l.value.push(B)}},N=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 A={_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===A._id))return;l.value.push(A)}}catch{}}};el(()=>{o.value=n.connectToNamespace("/notifications"),o.value.request("get-notifications").subscribe(C=>{l.value=C}),o.value.socket.on("notifications",C=>{l.value=C}),o.value.socket.on("remove-notification",C=>{const A=l.value.findIndex(B=>B._id===C||B.title===C);A!==-1&&l.value.splice(A,1)}),o.value.socket.on("clear-notifications",()=>{l.value=[]})});const D=()=>{const C=document.querySelector('meta[name="electron-server"]'),A=C!==null&&C.getAttribute("content")==="true";d.value=window.electron!==void 0,h.value=A,setTimeout(()=>{d.value=window.electron!==void 0,h.value=A},100)};return Sn(()=>{D()}),vo(()=>{var C,A,B;(A=(C=o.value)==null?void 0:C.end)==null||A.call(C),(B=window.electron)==null||B.removeListener("app-status",E)}),(C,A)=>{const B=Vb,H=jh,R=ys,w=Bb,Q=Ea,J=Qc;return m(),M(Ct,null,[y(R,{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(),L(H,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] right-[10px] top-[7px]"})):ae("",!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:I},{default:$(()=>[g("div",c5,[g("div",l5,[g("h3",u5,he(C.$t("components.notification_menu.notifications")),1),y(H,{class:"rounded-full text-xs p-1"},{default:$(()=>[Gt(he(c(l).length>99?"99+":c(l).length),1)]),_:1})]),c(l).length?(m(),L(R,{key:0,severity:"danger",text:"",rounded:"",class:"p-2 cui-icon-md",onClick:O},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:1})):ae("",!0)]),g("div",d5,[(m(!0),M(Ct,null,zt(c(l),j=>{var ie,ue,Se;return m(),M("div",{key:j._id,class:"relative overflow-hidden"},[It((m(),M("div",{class:"relative transition-all duration-200",style:ot({left:((ie=c(u)[j._id])==null?void 0:ie.left)||"0",opacity:((ue=c(u)[j._id])==null?void 0:ue.opacity)||1})},[y(R,{severity:"secondary",text:"",class:"cui-button p-2 block w-full",onClick:F=>W(j)},{default:$(()=>[g("div",h5,[g("div",{class:"w-2 h-2 rounded-full mt-2",style:ot({backgroundColor:te(j.type)})},null,4),g("div",m5,[g("div",p5,[g("h4",f5,he(j.title),1),g("span",g5,he(b(j.timestamp)),1)]),g("p",v5,he(j.text),1)])])]),_:2},1032,["onClick"])],4)),[[c(Y0),F=>v(j._id,F)]]),g("div",{class:"absolute right-0 top-0 h-full flex items-center pr-4",style:ot({opacity:((Se=c(u)[j._id])==null?void 0:Se.deleteOpacity)||0})},[y(R,{severity:"danger",class:"cui-icon-sm",text:"",rounded:"",onClick:F=>z(j)},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:2},1032,["onClick"])],4),c(l).indexOf(j)!==c(l).length-1?(m(),L(Q,{key:0,class:"my-0 py-1"})):ae("",!0)])}),128))]),c(l).length===0?(m(),M("div",_5,he(C.$t("components.notification_menu.no_notifications")),1)):ae("",!0)]),_:1},512)],64)}}}),b5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w5(s,e){return m(),M("svg",b5,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 x5=me({name:"material-symbols-light-mode-rounded",render:w5}),S5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C5(s,e){return m(),M("svg",S5,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 k5=me({name:"material-symbols-dark-mode",render:C5}),E5={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},A5=["id"],M5=["mask"];function $5(s,e){return m(),M("svg",E5,[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,A5)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSDarkMode0+")"},null,8,M5)])}const P5=me({name:"icon-park-solid-dark-mode",render:$5,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=xu(e.theme,{onBeforeChange(){if(!r.value)return!1},onChanged(h){e.theme=h,localStorage.setItem("theme",JSON.stringify(e))}}),n=xu(e.autoMode,{onBeforeChange(h){if(h&&!r.value)return!1},onChanged(h){e.autoMode=h,localStorage.setItem("theme",JSON.stringify(e))}}),r=oe(!0),i=Tr(["light","dark"]);Ze(n,h=>{h&&(t.value=o())}),Ze(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=Wh("(prefers-color-scheme: dark)");return Ze(d,h=>{n.value&&(t.value=h?"dark":"light")}),l(a()),{colors:i,theme:t,autoMode:n,setAppTheme:l,getSystemMode:o,toggleTheme:u}}),T5=Tt({__name:"CuiThemeSwitch",setup(s){const e=Nl(),{theme:t,autoMode:n}=Vs(e),r=()=>{e.toggleTheme()};return(i,o)=>{const a=P5,l=k5,u=x5,d=ys;return m(),L(d,{severity:"secondary",text:"",class:"cui-button p-2 text-color",onClick:r},{default:$(()=>[c(n)?(m(),L(a,{key:0,class:"w-6 h-6"})):c(t)==="dark"?(m(),L(l,{key:1,class:"w-6 h-6"})):c(t)==="light"?(m(),L(u,{key:2,class:"w-6 h-6"})):ae("",!0)]),_:1})}}}),R5={class:"relative flex overflow-hidden items-center justify-center w-5 h-5"},I5={class:"flex flex-col justify-between w-4 h-3 transform transition-all duration-100 origin-center overflow-hidden"},O5=Tt({__name:"CuiNavbarToggle",setup(s){const e=Tl(),{bus:t}=Rl(),{navbarState:n}=ja(),{xlBreakpoint:r}=Vr(),{uiSettings:i}=Vs(e),o=oe("closed"),a=se(()=>o.value==="opened");Ze(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(),L(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",R5,[g("div",I5,[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})):ae("",!0)}}}),N5={class:"group relative flex items-center"},F5={key:0,class:"flex items-center mr-3 pointer-events-auto"},L5={class:"flex-1 min-w-0 text-left"},j5={class:"text-sm font-medium truncate"},q5=["is-exact-active"],D5=["is-exact-active"],B5=Tt({__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}=Jt(n),[d,h]=lc(),[v,f]=lc(),b=k=>{r.value||t("click",k)};return(k,z)=>{const O=ys,te=Ei("RouterLink"),W=jr;return m(),M("div",N5,[y(c(v),null,{default:$(({isExactActive:I})=>[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(),M("div",F5,[ei(k.$slots,"prepend",{isExactActive:I??!1},void 0,!0)])):ae("",!0),g("div",L5,[g("div",j5,[ei(k.$slots,"default",{isExactActive:I??!1},void 0,!0)]),k.$slots.subtitle?(m(),M("div",{key:0,"is-exact-active":I??!1,class:"text-sm text-muted mt-0.5"},[ei(k.$slots,"subtitle",{},void 0,!0)],8,q5)):ae("",!0)]),k.$slots.append?(m(),M("div",{key:1,"is-exact-active":I??!1,class:"flex items-center ml-3 pointer-events-auto"},[ei(k.$slots,"append",{},void 0,!0)],8,D5)):ae("",!0)],2)]),_:3}),y(c(d),null,{default:$(({isExactActive:I})=>[It(y(O,tt({text:"",fluid:"",disabled:c(r),severity:"contrast",class:["cui-button absolute inset-0",[{active:c(i)||I,"cursor-not-allowed disabled":c(r)},c(i)||I?c(a):void 0]]},c(l),{onClick:b}),null,16,["disabled","class"]),[[W,{value:c(u)}]]),y(c(f),{"is-exact-active":I},null,8,["is-exact-active"])]),_:1}),c(o)?(m(),L(te,{key:0,to:c(o),class:"block transition-all duration-300"},{default:$(({isExactActive:I})=>[y(c(h),{"is-exact-active":I},null,8,["is-exact-active"])]),_:1},8,["to"])):(m(),L(c(h),{key:1}))])}}}),fp=qs(B5,[["__scopeId","data-v-115e51ef"]]),z5={key:0,class:"flex flex-col gap-1"},U5={key:2,class:"flex flex-col gap-1"},V5={key:4,class:"flex flex-col gap-1"},gp=Tt({__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}=Jt(r),u=Qt("menuRef"),d=oe(!1),h=oe(),[v,f]=lc(),b=se(()=>{const C=i.value.filter(A=>!A.hide);return l.value?C.sort((A,B)=>A.key&&B.key?A.key.localeCompare(B.key):A.label&&B.label?A.label.localeCompare(B.label):0):C}),k=se(()=>b.value.filter(C=>C.position==="header")),z=se(()=>b.value.filter(C=>C.position==="footer")),O=se(()=>b.value.filter(C=>!C.position)),te=C=>{var A;o.value&&N(),(A=C.onClick)==null||A.call(C,wu(h.value)),n("click:menu-item",C)},W=()=>{d.value=!0,n("show")},I=()=>{h.value=void 0,d.value=!1,n("hide")},E=(C,A,B)=>{var H;h.value=B,(H=u.value)==null||H.toggle(C,A)},N=()=>{var C;(C=u.value)==null||C.hide()},D=(C,A)=>{var B;(B=u.value)==null||B.show(C,A)};return e({menu:u,isOpen:d,data:wu(h),toggleMenu:E,hide:N,show:D}),(C,A)=>{const B=Gm,H=fo,R=fp,w=Ea,Q=Qc;return m(),L(Q,tt({ref_key:"menuRef",ref:u,class:"shadow-lg cui-rounded-corner"},c(a),{onShow:W,onHide:I}),{default:$(()=>[y(c(v),null,{default:$(({item:J})=>[(m(),L(R,{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:j=>te(J)},Qh({default:$(({isExactActive:j})=>[g("span",tt(J.labelProps,{class:{"text-primary":j||J.active,"!font-bold":J.avatarProps,"opacity-70":!J.disabled}}),he(J.label),17)]),_:2},[J.avatarProps||J.icon?{name:"prepend",fn:$(({isExactActive:j})=>[J.avatarProps?(m(),L(B,H0(tt({key:0},J.avatarProps)),null,16)):ae("",!0),J.icon?(m(),L(Ai(J.icon),tt({key:1},J.iconProps,{class:{"text-primary":j||J.active,"opacity-70":!J.disabled}}),null,16,["class"])):ae("",!0)]),key:"0"}:void 0,J.description?{name:"subtitle",fn:$(()=>[g("span",tt(J.descriptionProps,{class:{"opacity-70":!J.disabled}}),he(J.description),17)]),key:"1"}:void 0,J.toggle?{name:"append",fn:$(()=>[y(H,{"model-value":J.toggleState,disabled:J.disabled,"onUpdate:modelValue":j=>te(J)},null,8,["model-value","disabled","onUpdate:modelValue"])]),key:"2"}:void 0]),1032,["to","disabled","button-props","tooltip","onClick"]))]),_:1}),c(k).length?(m(),M("div",z5,[(m(!0),M(Ct,null,zt(c(k),(J,j)=>(m(),L(c(f),{key:j,item:J},null,8,["item"]))),128))])):ae("",!0),c(k).length&&c(O).length?(m(),L(w,{key:1,class:"m-0 py-3"})):ae("",!0),c(O).length?(m(),M("div",U5,[(m(!0),M(Ct,null,zt(c(O),(J,j)=>(m(),L(c(f),{key:j,item:J},null,8,["item"]))),128))])):ae("",!0),c(O).length&&c(z).length?(m(),L(w,{key:3,class:"m-0 py-3"})):ae("",!0),c(z).length?(m(),M("div",V5,[(m(!0),M(Ct,null,zt(c(z),(J,j)=>(m(),L(c(f),{key:j,item:J},null,8,["item"]))),128))])):ae("",!0)]),_:1},16)}}}),H5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q5(s,e){return m(),M("svg",H5,e[0]||(e[0]=[Hh('<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 K5=me({name:"iconoir-reload-window",render:Q5}),Z5={class:"relative w-6 h-6"},G5=Tt({__name:"CuiProfileMenu",setup(s){const{t:e}=js(),t=Fs(),{user:n}=Vs(t),r=Qt("menuRef"),i=se(()=>uo.filter(l=>{var u;return((u=l.meta)==null?void 0:u.profileMenu)&&l.meta.auth&&Si(l)})),o=se(()=>{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:K5,onClick:a}],d={label:e("components.user_menu.logout"),icon:Xh,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=gp;return m(),M(Ct,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",Z5,[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)}}}),W5={HEIGHT:60},J5={class:"flex flex-row items-center flex-1 p-2"},Y5=Tt({__name:"CuiTopbar",setup(s){const{showBottombar:e}=ja();return(t,n)=>{const r=G5,i=O5,o=T5,a=y5;return m(),M("header",{class:"cui-topbar fixed flex flex-row items-center right-0 pt-safe pr-safe draggable-region",style:ot({height:`calc(${c(W5).HEIGHT}px + env(safe-area-inset-top, 0px))`})},[g("div",J5,[c(e)?(m(),L(r,{key:0,class:"non-draggable-region"})):(m(),L(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(),L(a,{key:2})):ae("",!0)])],4)}}}),X5=qs(Y5,[["__scopeId","data-v-162b131f"]]),ew={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tw(s,e){return m(),M("svg",ew,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 sw=me({name:"majesticons-open",render:tw}),vp=Tt({__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}=Jt(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(),M("div",{class:at(["flex flex-wrap gap-2",{"opacity-60 pointer-events-none":c(r)}])},[ei(l.$slots,"default")],2))}}),nw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rw(s,e){return m(),M("svg",nw,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 _p=me({name:"mdi-check",render:rw}),iw={key:0,class:"absolute left-1 top-1/2 transform -translate-y-1/2 flex items-center justify-center cui-icon-sm"},ow=Tt({__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}=Jt(e),a=mi("chipGroup"),l=se(()=>r.value||(a==null?void 0:a.disabled.value)),u=se(()=>{if(!a)return!1;const v=a.modelValue.value;return Array.isArray(v)?v.includes(t.value):v===t.value}),d=se(()=>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=_p,k=I0;return m(),L(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(Pt,{name:"fade"},{default:$(()=>[c(o)&&c(u)?(m(),M("div",iw,[y(b,{width:"100%",height:"100%"})])):ae("",!0)]),_:1}),ei(v.$slots,"default",{},void 0,!0)]),_:3},8,["removable","disabled","class"])}}}),yp=qs(ow,[["__scopeId","data-v-3b79f904"]]),aw=async({cameraData:s})=>(await Oe.post("/cameras",s)).data,cw=async({cameraData:s})=>(await Oe.post("/cameras/pair",s)).data,lw=async({cameraData:s})=>(await Oe.post("/cameras/preview",s)).data,bp=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}`,{signal:e})).data,uw=async({cameraname:s})=>(await Oe.delete(`/cameras/${s}/log`)).data,dw=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}/log/download`,{signal:e})).data,hw=async({cameraname:s,sourcename:e,probeConfig:t,signal:n})=>(await Oe.get(`/cameras/${s}/probe/${e}`,{params:{...t},signal:n})).data,mw=async({cameraname:s,forceNew:e,signal:t})=>(await Oe.get(`/cameras/${s}/snapshot`,{signal:t,params:{forceNew:e}})).data,pw=async({parameter:s,signal:e})=>(await Oe.get("/cameras",{params:s,signal:e})).data,fw=async({type:s,src:e,signal:t})=>(await Oe.get("/cameras/discover",{params:{type:s,src:e},signal:t})).data,gw=async({cameraname:s,cameraData:e})=>(await Oe.patch(`/cameras/${s}`,e)).data,vw=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}/extensions`,{signal:e})).data,_w=async({cameraname:s,pluginname:e,signal:t})=>(await Oe.get(`/cameras/${s}/${e}/config`,{signal:t})).data,yw=async({cameraname:s,pluginname:e,configData:t})=>(await Oe.patch(`/cameras/${s}/${e}/config`,t)).data,bw=async({cameraname:s,pluginname:e,configData:t})=>(await Oe.put(`/cameras/${s}/${e}/config`,t)).data,ww=async({cameraname:s,pluginname:e,configData:t})=>(await Oe.post(`/cameras/${s}/${e}/config`,t)).data,xw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.put(`/cameras/${s}/${e}/enable`,null,{params:{type:t}})).data,Sw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.put(`/cameras/${s}/${e}/disable`,null,{params:{type:t}})).data,Cw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.post(`/cameras/${s}/${e}`,null,{params:{type:t}})).data,kw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.delete(`/cameras/${s}/${e}`,{params:{type:t}})).data,Ew=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}/zones`,{signal:e})).data,Aw=async({cameraname:s,zoneData:e})=>(await Oe.patch(`/cameras/${s}/zones`,e)).data,Mw=async({cameraname:s})=>(await Oe.delete(`/cameras/${s}`)).data,$w=async()=>(await Oe.delete("/cameras")).data;class Jn{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{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 dt({mutationFn:aw,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 dt({mutationFn:cw,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 dt({mutationFn:lw})}getCameraQuery(e){return Vt({queryKey:["cameras",e],queryFn:({signal:t})=>bp({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraQuery"&&t.enabled)})}getCameraExtensionsQuery(e){return Vt({queryKey:["camerasExtensions",e],queryFn:({signal:t})=>vw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraExtensionsQuery"&&t.enabled)})}probeCameraSourceQuery(e,t,n){return Vt({queryKey:["cameras",e,"probe",t],queryFn:({signal:r})=>hw({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 Vt({queryKey:["camerasSnapshot",e],queryFn:({signal:n})=>mw({cameraname:c(e),forceNew:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getCameraSnapshotQuery"&&n.enabled),retry:!1})}getCamerasQuery(e){return Vt({queryKey:["camerasList",e],queryFn:({signal:t})=>pw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getCamerasQuery"&&t.enabled)})}discoverCamerasQuery(e){return Vt({queryKey:["cameras","discover",e],queryFn:({signal:t})=>fw({...c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="discoverCamerasQuery"&&t.enabled)})}patchCameraQuery(){return dt({mutationFn:gw,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 Vt({queryKey:["cameras","extensions",e,t],queryFn:({signal:r})=>_w({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 dt({mutationFn:yw,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 dt({mutationFn:bw,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 dt({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]})}})}enableCameraExtensionQuery(){return dt({mutationFn:xw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}disableCameraExtensionQuery(){return dt({mutationFn:Sw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}addCameraExtensionQuery(){return dt({mutationFn:Cw,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 Vt({queryKey:["cameras",e,"zones"],queryFn:({signal:t})=>Ew({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getZonesQuery"&&t.enabled)})}patchZonesQuery(){return dt({mutationFn:Aw,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 dt({mutationFn:kw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}removeCameraQuery(){return dt({mutationFn:Mw,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 dt({mutationFn:$w,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 Vt({queryKey:["logs",e],queryFn:({signal:t})=>dw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return dt({mutationFn:uw,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 Pw=async({pluginData:s})=>(await Oe.post("/plugins",s)).data,Tw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}`,{signal:e})).data,Rw=async({pluginname:s,signal:e})=>(await Oe.get(`/plugins/${s}/versions`,{signal:e})).data,Iw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/update`,{signal:e})).data,Ow=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/logo`,{signal:e})).data,Nw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/config`,{signal:e})).data,Fw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/contract`,{signal:e})).data,Lw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/readme`,{signal:e})).data,jw=async({pluginName:s,query:e,signal:t})=>(await Oe.get(`/plugins/${s}/changelog`,{params:e,signal:t})).data,qw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/interface`,{signal:e})).data,Dw=async({parameter:s,signal:e})=>(await Oe.get("/plugins",{params:s,signal:e})).data,Bw=async({parameter:s,signal:e})=>(await Oe.get("/plugins/extensions",{params:s,signal:e})).data,zw=async({pluginName:s})=>(await Oe.delete(`/plugins/${s}/log`)).data,Uw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/log/download`,{signal:e})).data,Vw=async({parameter:s,signal:e})=>(await Oe.get("/plugins/progress",{params:s,signal:e})).data,Hw=async({query:s,parameter:e,signal:t})=>(await Oe.get("/plugins/search",{params:{...s,...e},signal:t})).data,Qw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/enable`)).data,Kw=async({pluginName:s,configData:e})=>(await Oe.patch(`/plugins/${s}/config`,e)).data,Zw=async({pluginname:s,configData:e})=>(await Oe.put(`/plugins/${s}/config`,e)).data,Gw=async({pluginname:s,configData:e})=>(await Oe.post(`/plugins/${s}/config`,e)).data,Ww=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/disable`)).data,Jw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/start`)).data,Yw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/stop`)).data,Xw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/restart`)).data,e3=async({pluginName:s,formData:e})=>(await Oe.post(`/plugins/${s}/detect/motion`,e,{responseType:"arraybuffer"})).data,t3=async({pluginName:s,formData:e})=>(await Oe.post(`/plugins/${s}/detect/objects`,e)).data,s3=async({pluginName:s,formData:e})=>(await Oe.post(`/plugins/${s}/detect/audio`,e)).data,n3=async({pluginName:s,removeStorage:e})=>(await Oe.delete(`/plugins/${s}`,{params:{removeStorage:e}})).data,r3=async()=>(await Oe.delete("/plugins")).data;class Fl{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{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 dt({mutationFn:Pw,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 Vt({queryKey:["plugins",e],queryFn:({signal:t})=>Tw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginQuery"&&t.enabled)})}getPluginsQuery(e){return Vt({queryKey:["pluginsList",e],queryFn:({signal:t})=>Dw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsQuery"&&t.enabled)})}getPluginsExtensionsQuery(e){return Vt({queryKey:["extensionsList",e],queryFn:({signal:t})=>Bw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsExtensionsQuery"&&t.enabled)})}getPluginsProgressQuery(e){return Vt({queryKey:["pluginsProgress",e],queryFn:({signal:t})=>Vw({parameter:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsProgressQuery"&&t.enabled)})}searchPluginsQuery(e,t){return Vt({queryKey:["pluginsSearch",e,t],queryFn:({signal:n})=>Hw({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 Vt({queryKey:["plugins",e,"versions"],queryFn:({signal:t})=>Rw({pluginname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginVersionsQuery"&&t.enabled)})}getPluginUpdateQuery(e){return Vt({queryKey:["plugins",e,"update"],queryFn:({signal:t})=>Iw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginUpdateQuery"&&t.enabled)})}getPluginLogoQuery(e){return Vt({queryKey:["plugins",e,"logo"],queryFn:({signal:t})=>Ow({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginLogoQuery"&&t.enabled)})}getPluginConfigQuery(e){return Vt({queryKey:["plugins",e,"config"],queryFn:({signal:t})=>Nw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginConfigQuery"&&t.enabled)})}getPluginContractQuery(e){return Vt({queryKey:["plugins",e,"contract"],queryFn:({signal:t})=>Fw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginContractQuery"&&t.enabled)})}getPluginReadmeQuery(e){return Vt({queryKey:["plugins",e,"readme"],queryFn:({signal:t})=>Lw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginReadmeQuery"&&t.enabled)})}getPluginInterfaceQuery(e){return Vt({queryKey:["plugins",e,"interface"],queryFn:({signal:t})=>qw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginInterfaceQuery"&&t.enabled)})}getPluginChangelogQuery(e,t){return Vt({queryKey:["plugins",e,"changelog"],queryFn:({signal:n})=>jw({pluginName:c(e),query:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getPluginChangelogQuery"&&n.enabled)})}patchPluginConfigQuery(){return dt({mutationFn:Kw,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 dt({mutationFn:Jw,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 dt({mutationFn:Yw,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 dt({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_restarted"),life:3e3})}})}detectMotionQuery(){return dt({mutationFn:e3})}detectObjectsQuery(){return dt({mutationFn:t3})}detectAudioQuery(){return dt({mutationFn:s3})}setPluginConfigQuery(){return dt({mutationFn:Zw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}submitPluginConfigQuery(){return dt({mutationFn:Gw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}enablePluginQuery(){return dt({mutationFn:Qw,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 dt({mutationFn:Ww,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 dt({mutationFn:n3,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 dt({mutationFn:r3,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 Vt({queryKey:["logs",e],queryFn:({signal:t})=>Uw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return dt({mutationFn:zw,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 i3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o3(s,e){return m(),M("svg",i3,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=me({name:"mdi-plus-circle",render:o3}),a3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c3(s,e){return m(),M("svg",a3,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 l3=me({name:"mdi-information",render:c3}),u3={key:0,class:"flex flex-col field-gap"},d3=["for"],h3={key:1,class:"flex flex-col field-gap"},m3=["for"],p3=["for"],f3=["for"],g3={class:"flex items-center gap-4"},v3={class:"flex flex-col field-switch-gap"},_3=["for"],y3=["for"],b3={class:"flex gap-2 items-center w-full"},w3={class:"text-color"},x3={class:"w-full h-full flex flex-col gap-6"},S3={class:"flex flex-row w-full items-center justify-center mt-3"},C3=Tt({__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}=Jt(i),h=oe(0),v=oe(0),f=oe(a.value.opened?[l.value]:[]);Ze(r,()=>{h.value++},{deep:!0});const b=tf(async()=>{if(ar(a.value)&&a.value.format==="qrCode"){let I;return o.value==="dark"?I={dark:"#FFFFFFFF",light:"#FF000000"}:I={dark:"#404040FF",light:"#FFFFFFFF"},await kf.toDataURL(W.value||"",{margin:.5,type:"image/png",color:I,scale:10})}},void 0,{lazy:!0}),k=se(()=>{if(ar(a.value)&&a.value.format==="image")return W.value}),z=(I,E)=>{const N=ni(I,E);return Array.isArray(N)?N:[]},O=I=>{const E=ni(r.value,I),N=Array.isArray(E)?[...E]:[];yh(a.value)&&a.value.items&&(N.push($l(a.value.items)),ic(r.value,I,N),v.value++)},te=(I,E)=>{const N=ni(r.value,I);if(Array.isArray(N)){const D=[...N];D.splice(E,1),ic(r.value,I,D),v.value++,n("onTrigger")}},W=se({get:()=>(h.value,ni(r.value,l.value)),set:I=>{const E=a.value;let N=I;xa(E)?E.multiple?N=Array.isArray(I)?I:[I]:N=I&&I.toString():ar(E)?N=I!=null?I.toString():"":vh(E)?N=typeof I=="number"?I:parseFloat(I)||0:_h(E)&&(N=I==="true"||I===!0),ic(r.value,l.value,N),h.value++}});return(I,E)=>{const N=Fa,D=ki,C=Lh,A=_o,B=ys,H=Aa,R=go,w=Kc,Q=qh,J=fo,j=Zc,ie=Dh,ue=l3,Se=Jc,F=Ei("CuiSchemaField",!0),q=wp,Y=Yc,Te=Wc,He=Gc,pt=Bh,ft=jr;return m(),M("div",null,[c(ar)(c(a))&&c(a).format==="qrCode"?(m(),M("div",u3,[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,d3),y(N,{src:c(b),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):ae("",!0),c(ar)(c(a))&&c(a).format==="image"?(m(),M("div",h3,[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,m3),y(N,{src:c(k),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):c(j2)(c(a))?(m(),L(c(Dt),{key:2,modelValue:c(W),"onUpdate:modelValue":E[1]||(E[1]=Ge=>ps(W)?W.value=Ge:null),modelModifiers:{trim:!0},name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,p3),y(R,null,{default:$(()=>[c(a).format!=="password"?(m(),L(D,tt({key:0},Ge,{invalid:Je.length>0,readonly:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),type:"text"}),null,16,["invalid","readonly","placeholder","loading"])):(m(),L(C,tt({key:1,"model-value":c(W),invalid:Je.length>0,readonly:c(a).readonly},Ge,{feedback:!1,"toggle-mask":""}),null,16,["model-value","invalid","readonly"])),c(u)?(m(),L(H,{key:2},{default:$(()=>[y(B,{text:"",severity:"secondary",loading:c(d),onClick:E[0]||(E[0]=de=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A)]),_:1},8,["loading"])]),_:1})):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!Je.length&&c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)]),_:1},8,["modelValue","name"])):c(vh)(c(a))?(m(),L(c(Dt),{key:3,"model-value":c(W),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,f3),y(R,null,{default:$(()=>[y(Q,tt(Ge,{modelValue:c(W),"onUpdate:modelValue":E[2]||(E[2]=de=>ps(W)?W.value=de:null),invalid:Je.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]=de=>W.value=de),onInput:E[4]||(E[4]=de=>W.value=de.value)}),null,16,["modelValue","invalid","readonly","step","min","max","loading"]),c(u)?(m(),L(H,{key:0},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[5]||(E[5]=de=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A)]),_:1},8,["loading"])]),_:1})):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!Je.length&&c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)]),_:1},8,["model-value","name"])):c(_h)(c(a))?(m(),L(c(Dt),{key:4,"model-value":c(W),value:!0,"unchecked-value":!1,type:"checkbox",name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("div",g3,[g("div",v3,[g("label",{for:c(l),class:"cui-label-switch"},he(c(a).title),9,_3),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-switch-error"},null,8,["name"])]),_:1})]),y(J,tt({"model-value":c(W)},Ge,{invalid:Je.length>0,loading:c(d),class:"ml-auto shrink-0",onValueChange:E[6]||(E[6]=de=>W.value=de)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value","name"])):c(xa)(c(a))?(m(),L(c(Dt),{key:5,"model-value":c(W),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,y3),y(R,null,{default:$(()=>[c(a).multiple?(m(),L(ie,tt({key:1},Ge,{"model-value":c(W),options:c(a).enum,invalid:Je.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]=de=>W.value=de)}),null,16,["model-value","options","invalid","disabled","placeholder","show-clear","loading"])):(m(),L(j,tt({key:0},Ge,{"model-value":c(W),options:c(a).enum,invalid:Je.length>0,disabled:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),onValueChange:E[7]||(E[7]=de=>W.value=de)}),null,16,["model-value","options","invalid","disabled","placeholder","loading"])),c(u)?(m(),L(H,{key:2},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[9]||(E[9]=de=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A)]),_:1},8,["loading"])]),_:1})):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!Je.length&&c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)]),_:1},8,["model-value","name"])):c(zr)(c(a))?(m(),M(Ct,{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(Ge=>n("onAction",{key:c(l)}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)],64)):c(Ur)(c(a))?(m(),M(Ct,{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(Ge=>n("onSubmit",{key:c(a).key}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)],64)):c(yh)(c(a))&&c(a).items?(m(),L(pt,{key:8,class:"cui-card border-color-inner",pt:{body:{class:"p-1"}}},{content:$(()=>[(m(),L(He,{key:c(v),value:c(f),"onUpdate:value":E[18]||(E[18]=Ge=>ps(f)?f.value=Ge:null),multiple:""},{default:$(()=>[y(Te,{value:c(l)??"0",class:"border-none"},{default:$(()=>[y(Se,null,{default:$(()=>[g("div",b3,[c(a).description?It((m(),L(ue,{key:0,class:"text-muted"},null,512)),[[ft,{value:c(a).description}]]):ae("",!0),g("span",w3,he(c(a).title||c(l)),1),c(u)?(m(),L(B,{key:1,text:"",rounded:"",severity:"danger",class:"cui-icon-md ml-auto mr-2",loading:c(d),onClick:E[12]||(E[12]=Ge=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A,{width:"100%",height:"100%"})]),_:1},8,["loading"])):ae("",!0)])]),_:1}),y(Y,null,{default:$(()=>[g("div",x3,[(m(!0),M(Ct,null,zt(z(r.value,c(l)),(Ge,Je)=>(m(),L(F,{key:`item-${Je}`,modelValue:r.value,"onUpdate:modelValue":E[13]||(E[13]=de=>r.value=de),"schema-field":c(a).items,"config-key":`${c(l)}[${Je}]`,"array-item":{key:c(l),index:Je},loading:c(d),onOnAction:E[14]||(E[14]=de=>n("onAction",de)),onOnSubmit:E[15]||(E[15]=de=>n("onSubmit",de)),onOnTrigger:E[16]||(E[16]=()=>v.value++)},null,8,["modelValue","schema-field","config-key","array-item","loading"]))),128)),g("div",S3,[y(B,{text:"",rounded:"",class:"cui-icon-md",loading:c(d),onClick:E[17]||(E[17]=lr(Ge=>O(c(l)),["prevent"]))},{icon:$(()=>[y(q,{width:"100%",height:"100%"})]),_:1},8,["loading"])])])]),_:1})]),_:1},8,["value"])]),_:1},8,["value"]))]),_:1})):ae("",!0)])}}}),k3={key:0,class:"flex flex-col gap-6"},E3={key:1,class:"flex flex-col gap-6"},xp=Tt({__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}=Jt(r),v=Qt("formRef"),f=oe(""),b=oe(!1),k=oe({});Ze([i,v],([])=>{v.value&&(!q2(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=D2(i.value.schema)},{immediate:!0,deep:!0});const z=se(()=>{const R=V2(i.value.schema);return Wn(R)}),O=se(()=>{const R=[];return i.value.schema.forEach(w=>{w.group&&!w.hidden&&!R.includes(w.group)&&R.push(w.group)}),R.length&&!f.value&&(f.value=R[0]),R}),te=se(()=>B2(i.value.schema,f.value)),W=se(()=>z2(i.value.schema,f.value));Ze(f,R=>{R&&n("changeGroup",R)});const I=R=>i.value.schema.filter(w=>(w.group===R||!w.group&&R===O.value[0])&&!w.hidden),E=R=>{const w=ar(R)&&R.format==="qrCode",Q=ar(R)&&R.format==="image",J=zr(R)||Ur(R);return!w&&!Q&&!J},N=R=>!R.hidden||R.hidden&&E(R),D=async()=>{var R;return await((R=v.value)==null?void 0:R.validate())},C=R=>{n("onAction",R)},A=async R=>{const w=await D();w!=null&&w.valid&&(w!=null&&w.values)?(b.value=!1,n("onSubmit",{key:R.key,payload:w.values})):(b.value=!0,console.error("result",w))},B=async()=>{const R=await D();R!=null&&R.valid&&(R!=null&&R.values)?(b.value=!1,n("onFormSubmit",R.values)):(b.value=!0,console.error("Form validation failed:",R))};return e({reset:()=>{var R;(R=v.value)==null||R.resetForm()}}),(R,w)=>{const Q=yp,J=vp,j=C3,ie=Vh,ue=Uh,Se=zh,F=ys;return m(),M("div",null,[y(c(il),{ref_key:"formRef",ref:v,"validation-schema":c(z),onSubmit:B},{default:$(()=>[c(O).length?(m(),M("div",k3,[y(J,{modelValue:c(f),"onUpdate:modelValue":w[0]||(w[0]=q=>ps(f)?f.value=q:null),mandatory:""},{default:$(()=>[(m(!0),M(Ct,null,zt(c(O),q=>(m(),L(Q,{key:q,size:"small",value:q},{default:$(()=>[Gt(he(q),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),y(Se,{value:c(f),"onUpdate:value":w[2]||(w[2]=q=>ps(f)?f.value=q:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(ue,{class:"p-0"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(O),(q,Y)=>(m(),L(ie,{key:Y,value:q,"as-child":""},{default:$(Te=>[It(g("div",tt({class:Te.class,ref_for:!0},Te.a11yAttrs,{class:"flex flex-col gap-6"}),[(m(!0),M(Ct,null,zt(I(q),He=>(m(),M(Ct,{key:He.key},[N(He)&&(He.group===q||!He.group&&Y===0)?It((m(),L(j,{key:0,modelValue:c(k),"onUpdate:modelValue":w[1]||(w[1]=pt=>ps(k)?k.value=pt:null),"schema-field":He,"config-key":He.key,loading:c(o),onOnAction:C,onOnSubmit:A},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!He.hidden]]):ae("",!0)],64))),128))],16),[[Pr,Te.active]])]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])])):(m(),M("div",E3,[(m(!0),M(Ct,null,zt(c(i).schema,q=>(m(),M(Ct,{key:q.key},[N(q)?It((m(),L(j,{key:0,modelValue:c(k),"onUpdate:modelValue":w[3]||(w[3]=Y=>ps(k)?k.value=Y:null),"schema-field":q,"config-key":q.key,loading:c(o),onOnAction:C,onOnSubmit:A},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!q.hidden]]):ae("",!0)],64))),128))])),!c(te)&&c(W)&&c(a)||c(u)?(m(),L(F,{key:2,fluid:"",class:"mt-7 cui-button-medium",severity:c(h),type:"submit",loading:c(o),disabled:c(d),label:c(l)||R.$t("components.form.button.save")},null,8,["severity","loading","disabled","label"])):ae("",!0)]),_:1},8,["validation-schema"])])}}}),A3=Tt({__name:"PluginSchema",props:{schemaConfig:{},pluginName:{},cameraName:{},buttonKey:{}},setup(s,{expose:e}){const t=new Fl,n=new Jn,r=Cn(),{t:i}=js(),o=mi("dialogRef"),a=mi("dialogRefProps"),l=s,{schemaConfig:u,pluginName:d,cameraName:h,buttonKey:v}=Jt(l),f=oe({schema:[],config:{}}),{mutate:b,isPending:k}=t.submitPluginConfigQuery(),{mutateAsync:z,isPending:O}=t.setPluginConfigQuery(),{mutate:te,isPending:W}=n.submitCameraExtensionConfigQuery(),{mutateAsync:I,isPending:E}=n.setCameraExtensionConfigQuery(),N=se(()=>{var A;return!!((A=a.loading)!=null&&A.value||k.value||O.value||W.value||E.value)});Ze(u,A=>{f.value=A},{deep:!0,immediate:!0});const D=async A=>{h.value?await I({cameraname:h.value,pluginname:d.value,configData:{key:A.key}}):await z({pluginname:d.value,configData:{key:A.key}})},C=async A=>{console.log("onFormSubmit",A);const B={...u.value.config,...A};console.log("onFormSubmit payload",B);const H=R=>{if(R!=null&&R.toast){const w=Zm(R.toast.type);r.add({severity:w,summary:i(`components.toast.title_${w}`),detail:R.toast.message,life:3e3})}R!=null&&R.schema&&Object.keys(R.schema).length&&f.value?f.value.schema=R.schema:o.value.close()};h.value?te({cameraname:h.value,pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:H}):b({pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:H})};return e({isLoading:N}),(A,B)=>{const H=xp;return m(),L(H,{"schema-form":c(f),loading:c(N),"show-button":"",onOnAction:D,onOnFormSubmit:C},null,8,["schema-form","loading"])}}}),M3={class:"p-4 flex flex-col gap-2"},$3={class:"cui-label"},P3={key:0,class:"flex flex-col gap-2"},T3={class:"cui-label"},R3={key:5,class:"text-sm text-muted text-center min-h-[30px]"},I3={class:"cui-label"},O3={key:6,class:"w-full flex items-center justify-center my-5"},N3={key:1,class:"text-sm text-muted text-center"},F3={key:1,class:"flex flex-col gap-2"},L3={class:"cui-label"},j3={key:0,class:"w-full flex items-center justify-center"},q3={key:1,class:"text-sm text-muted text-center"},D3={key:1,class:"w-full h-full"},B3={class:"cui-list-item"},z3=Tt({__name:"Plugins",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Jn,n=new Fl,r=Cn(),i=Il(),{t:o}=js(),a=s,{camera:l,loading:u}=Jt(a),d=Qt("schemaRef"),h=oe("hub"),v=oe(["hub","motionDetection","objectDetection","audioDetection","ptz","more"]),f=oe(""),b=oe(),k=oe(),z=oe(),O=oe(),te=oe(),W=oe(!0);t.toggleQueryActivator("getCameraExtensionConfigQuery",!1);const{data:I}=n.getPluginsQuery({page:1,pageSize:-1}),{data:E,isFetching:N,suspense:D}=t.getCameraExtensionsQuery(l.value.name),{data:C,isFetching:A}=t.getCameraExtensionConfigQuery(l.value.name,f,W),{data:B,isFetching:H}=n.getPluginsExtensionsQuery({page:1,pageSize:-1}),{mutate:R,isPending:w}=t.submitCameraExtensionConfigQuery(),{mutateAsync:Q,isPending:J}=t.patchCameraExtensionConfigQuery(),{mutateAsync:j,isPending:ie}=t.setCameraExtensionConfigQuery(),{mutateAsync:ue,isPending:Se}=t.addCameraExtensionQuery(),{mutateAsync:F,isPending:q}=t.removeCameraExtensionQuery(),{mutateAsync:Y,isPending:Te}=t.enableCameraExtensionQuery(),{mutateAsync:He,isPending:pt}=t.disableCameraExtensionQuery(),ft=se(()=>N.value||H.value||Se.value||q.value||Te.value||pt.value),Ge=se(()=>ft.value||u.value||w.value||J.value||ie.value),Je=se(()=>{const le=h.value==="hub"&&de.value.length,ge=h.value==="motionDetection"&&xt.value.length,Ie=h.value==="audioDetection"&&Kt.value.length,Ee=h.value==="objectDetection"&&vt.value.length,Ue=h.value==="ptz"&&jt.value.length;return!le&&!ge&&!Ie&&!Ee&&!Ue}),de=se(()=>{var ge;const le=((ge=E.value)==null?void 0:ge.filter(Ie=>Ie.type.includes("hub")))||[];return le.length&&I.value&&I.value.result.some(Ie=>Ie.pluginName===le[0].pluginName&>(Ie.pluginName))?(b.value=le[0].pluginName,f.value=le[0].pluginName):b.value=void 0,De(le)}),xt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("motionDetection")))||[];return le.length&>(l.value.extensions.motionDetection)?k.value=(Ie=l.value.extensions.motionDetection)==null?void 0:Ie.name:k.value=void 0,De(le)}),Kt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("audioDetection")))||[];return le.length&>(l.value.extensions.audioDetection)?z.value=(Ie=l.value.extensions.audioDetection)==null?void 0:Ie.name:z.value=void 0,De(le)}),vt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("objectDetection")))||[];return le.length&>(l.value.extensions.objectDetection)?O.value=(Ie=l.value.extensions.objectDetection)==null?void 0:Ie.name:O.value=void 0,De(le)}),jt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("ptz")))||[];return le.length&>(l.value.extensions.ptz)?te.value=(Ie=l.value.extensions.ptz)==null?void 0:Ie.name:te.value=void 0,De(le)}),ct=se(()=>{var Ie,Ee;const le=((Ie=I.value)==null?void 0:Ie.result)||[];return(((Ee=B.value)==null?void 0:Ee.result)||[]).filter(Ue=>{const rt=le.find(ts=>ts.pluginName===Ue.pluginName);return((rt==null?void 0:rt["camera.ui"].extensions)??[]).filter(ts=>ts!=="cameraController").length>0})});Ze(b,(le,ge)=>{le&&le!==ge&&ht(le)}),Ze(k,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"motionDetection"):le&&X(le,!0,"motionDetection"))}),Ze(O,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"objectDetection"):le&&X(le,!0,"objectDetection"))}),Ze(te,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"ptz"):le&&X(le,!0,"ptz"))}),Ze(z,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"audioDetection"):le&&X(le,!0,"audioDetection"))});const gt=le=>{const ge=typeof le=="string"?le:le==null?void 0:le.name;if(ge&&I.value&&I.value.result.some(Ie=>Ie.pluginName===ge&&!Ie.disabled))return ge},De=le=>le.sort((ge,Ie)=>!gt(ge.pluginName)&>(Ie.pluginName)?1:gt(ge.pluginName)&&!gt(Ie.pluginName)?-1:ge.displayName.localeCompare(Ie.displayName)),ht=le=>{var ge;if(t.toggleQueryActivator("getCameraExtensionConfigQuery",!1),le!==void 0)f.value=le;else switch(h.value){case"hub":f.value=gt((ge=de.value[0])==null?void 0:ge.pluginName)||"";break;case"motionDetection":f.value=gt(l.value.extensions.motionDetection)||"";break;case"audioDetection":f.value=gt(l.value.extensions.audioDetection)||"";break;case"objectDetection":f.value=gt(l.value.extensions.objectDetection)||"";break;case"ptz":f.value=gt(l.value.extensions.ptz)||"";break;default:f.value="";break}f.value&&f.value!==""&&t.toggleQueryActivator("getCameraExtensionConfigQuery",!0)},U=async le=>{var ge;if(E.value)if(E.value.some(Ie=>Ie.pluginName===le.pluginName)){for(const Ie of le.type)await F({cameraname:l.value.name,pluginname:le.pluginName,type:Ie});(ge=d.value)==null||ge.reset()}else for(const Ie of le.type)await ue({cameraname:l.value.name,pluginname:le.pluginName,type:Ie})},X=async(le,ge,Ie)=>{var Ue;const Ee=Ie in l.value.extensions?l.value.extensions[Ie]:void 0;l.value&&(ge?(Ee==null?void 0:Ee.name)!==le&&(await Y({cameraname:l.value.name,pluginname:le,type:Ie}),Zs(()=>ht(le))):(Ee==null?void 0:Ee.name)===le&&(await He({cameraname:l.value.name,pluginname:le,type:Ie}),(Ue=d.value)==null||Ue.reset(),Zs(()=>ht())))},fe=async(le,ge)=>{await j({cameraname:l.value.name,pluginname:ge,configData:{key:le.key}})},ye=(le,ge)=>{R({cameraname:l.value.name,pluginname:ge,configData:{key:le.key,payload:le.payload}},{onSuccess:Ie=>{if(Ie!=null&&Ie.toast){const Ee=Zm(Ie.toast.type);r.add({severity:Ee,summary:o(`components.toast.title_${Ee}`),detail:Ie.toast.message,life:3e3})}Ie!=null&&Ie.schema&&Object.keys(Ie.schema).length&&i.openComponentDialog(A3,{data:{title:o("components.dialog.title.config"),hideConfirmButton:!0,contentProps:{schemaConfig:{schema:Ie.schema,config:le.payload},pluginName:ge,cameraName:l.value.name,buttonKey:le.key}}})}})},pe=async(le,ge)=>{await Q({cameraname:l.value.name,pluginname:le,configData:ge})};return el(async()=>{await D(),ht()}),(le,ge)=>{var Cs,hs;const Ie=yp,Ee=vp,Ue=Ea,rt=Lr,St=fo,ts=fp,bs=sw,ls=ys,os=jr;return m(),M("div",M3,[g("span",$3,he(le.$t("components.camera_options.categories")),1),y(Ee,{modelValue:c(h),"onUpdate:modelValue":[ge[0]||(ge[0]=Be=>ps(h)?h.value=Be:null),ge[1]||(ge[1]=Be=>ht())],disabled:c(ft),mandatory:""},{default:$(()=>[(m(!0),M(Ct,null,zt(c(v),Be=>(m(),L(Ie,{key:Be,size:"small",disabled:c(Ge),value:Be},{default:$(()=>[Gt(he(le.$t(`components.camera_options.chip_${Be}`)),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"]),y(Ue,{class:"m-0 py-3"}),c(h)!=="more"?(m(),M("div",P3,[g("span",T3,he(le.$t("components.camera_options.chip_plugins")),1),c(h)==="hub"&&c(de).length?(m(),L(Ee,{key:0,modelValue:c(b),"onUpdate:modelValue":ge[2]||(ge[2]=Be=>ps(b)?b.value=Be:null),disabled:c(ft),mandatory:"",class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(de),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="motionDetection"&&c(xt).length?(m(),L(Ee,{key:1,modelValue:c(k),"onUpdate:modelValue":ge[3]||(ge[3]=Be=>ps(k)?k.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(xt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="objectDetection"&&c(vt).length?(m(),L(Ee,{key:2,modelValue:c(O),"onUpdate:modelValue":ge[4]||(ge[4]=Be=>ps(O)?O.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(vt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="audioDetection"&&c(Kt).length?(m(),L(Ee,{key:3,modelValue:c(z),"onUpdate:modelValue":ge[5]||(ge[5]=Be=>ps(z)?z.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(Kt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="ptz"&&c(jt).length?(m(),L(Ee,{key:4,modelValue:c(te),"onUpdate:modelValue":ge[6]||(ge[6]=Be=>ps(te)?te.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(jt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):c(Je)?(m(),M("span",R3,he(le.$t("components.camera_options.no_plugins_enabled")),1)):ae("",!0),y(Ue,{class:"m-0 py-3"}),g("span",I3,he(le.$t("components.camera_options.plugin_settings")),1),c(A)||!c(f)||!c(C)||!((Cs=c(C))!=null&&Cs.schema)||((hs=c(C))==null?void 0:hs.schema.length)===0?(m(),M("div",O3,[c(A)?(m(),L(rt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),M("span",N3,he(le.$t("components.camera_options.no_config")),1))])):(m(),L(xp,{ref_key:"schemaRef",ref:d,key:c(f),"schema-form":{schema:c(C).schema,config:c(C).config},loading:c(Ge),onOnFormSubmit:ge[7]||(ge[7]=Be=>pe(c(f),Be)),onOnSubmit:ge[8]||(ge[8]=Be=>ye(Be,c(f))),onOnAction:ge[9]||(ge[9]=Be=>fe(Be,c(f)))},null,8,["schema-form","loading"]))])):(m(),M("div",F3,[g("span",L3,he(le.$t("components.camera_options.manage_plugins")),1),c(H)||!c(ct).length?(m(),M("div",j3,[c(H)?(m(),L(rt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),M("span",q3,he(le.$t("components.camera_options.no_plugins_found")),1))])):(m(),M("div",D3,[(m(!0),M(Ct,null,zt(c(ct),Be=>It((m(),M("div",{key:Be.pluginName,class:"cui-list-item"},[y(ts,{disabled:c(ft)||!gt(Be.pluginName),class:"h-14",onClick:us=>le.$router.push(`/plugins/${Be.pluginName}`)},{append:$(()=>{var us;return[y(St,{"model-value":(us=c(E))==null?void 0:us.some(V=>V.pluginName===Be.pluginName),disabled:c(ft)||!gt(Be.pluginName),"onUpdate:modelValue":V=>U(Be)},null,8,["model-value","disabled","onUpdate:modelValue"])]}),default:$(()=>[g("span",null,he(Be.displayName),1)]),_:2},1032,["disabled","onClick"])])),[[os,{value:gt(Be.pluginName)===void 0?le.$t("components.form.tooltip.disabled"):""},void 0,{top:!0}]])),128))])),g("div",B3,[y(ts,{class:"h-14",onClick:ge[10]||(ge[10]=Be=>le.$router.push("/plugins"))},{append:$(()=>[y(ls,{text:"",rounded:"",severity:"secondary",class:"cui-icon-md"},{icon:$(()=>[y(bs,{width:"100%",height:"100%"})]),_:1})]),default:$(()=>[g("span",null,he(le.$t("components.camera_options.more_plugins")),1)]),_:1})])]))])}}}),U3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V3(s,e){return m(),M("svg",U3,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 H3=me({name:"mdi-checkbox-intermediate",render:V3}),Q3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K3(s,e){return m(),M("svg",Q3,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 Z3=me({name:"mdi-vector-intersection",render:K3}),G3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W3(s,e){return m(),M("svg",G3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6zm14 11H6V8h12z"},null,-1)]))}const J3=me({name:"mdi-rectangle-outline",render:W3}),Y3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X3(s,e){return m(),M("svg",Y3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6z"},null,-1)]))}const e4=me({name:"mdi-rectangle",render:X3}),t4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s4(s,e){return m(),M("svg",t4,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 n4=me({name:"mdi-cctv",render:s4}),r4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function i4(s,e){return m(),M("svg",r4,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 o4=me({name:"mdi-cctv-off",render:i4}),a4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c4(s,e){return m(),M("svg",a4,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 l4=me({name:"mdi-cancel",render:c4}),u4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function d4(s,e){return m(),M("svg",u4,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 h4=me({name:"mdi-undo",render:d4}),m4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function p4(s,e){return m(),M("svg",m4,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 f4=me({name:"mdi-trash-can",render:p4}),g4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v4(s,e){return m(),M("svg",g4,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 _4=me({name:"mdi-pencil",render:v4}),y4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b4(s,e){return m(),M("svg",y4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"},null,-1)]))}const w4=me({name:"mdi-plus",render:b4}),x4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S4(s,e){return m(),M("svg",x4,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 C4=me({name:"mingcute-timeline-fill",render:S4}),k4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E4(s,e){return m(),M("svg",k4,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 A4=me({name:"mingcute-timeline-line",render:E4}),M4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $4(s,e){return m(),M("svg",M4,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 P4=me({name:"mdi-map-marker-add",render:$4}),T4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function R4(s,e){return m(),M("svg",T4,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 I4=me({name:"mdi-map-marker-add-outline",render:R4}),O4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N4(s,e){return m(),M("svg",O4,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=me({name:"mingcute-computer-camera-fill",render:N4}),F4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L4(s,e){return m(),M("svg",F4,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 j4=me({name:"mingcute-computer-camera-line",render:L4}),q4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D4(s,e){return m(),M("svg",q4,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 B4=me({name:"material-symbols-detection-and-zone-rounded",render:D4}),z4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function U4(s,e){return m(),M("svg",z4,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 V4=me({name:"fa6-solid-object-ungroup",render:U4}),H4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function Q4(s,e){return m(),M("svg",H4,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 K4=me({name:"fa6-regular-object-ungroup",render:Q4}),Z4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G4(s,e){return m(),M("svg",Z4,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 W4=me({name:"solar-camera-square-linear",render:G4}),J4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y4(s,e){return m(),M("svg",J4,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 X4=me({name:"solar-share-circle-outline",render:Y4}),Ll=Tt({__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}=Jt(n),b=oe(!1);o.value&&t.toggleQueryActivator("getCameraSnapshotQuery",!1);const{data:k,isFetching:z,refetch:O,isRefetching:te}=t.getCameraSnapshotQuery(r,b),W=se(()=>(i.value||z.value||te.value)&&f.value),I=se(()=>{if(o.value)return o.value;if(k.value)return`data:image/jpeg;base64,${k.value}`});return e({download:()=>{if(I.value){const D=`${r.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,C=document.createElement("a");C.setAttribute("download",D),C.href=I.value,document.body.appendChild(C),C.click(),C.remove()}},refresh:()=>{b.value=!0,O(),b.value=!1},isLoading:W,snapshotSrc:I}),(D,C)=>{const A=Lr,B=Fa;return m(),M("div",{class:"w-full h-full flex items-center justify-center bg-black aspect-video",style:ot({width:`${c(a)}`,height:`${c(l)}`})},[c(W)?(m(),L(A,{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(),L(B,{key:1,src:c(I),"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)}}}),e6=["d"],t6=Tt({__name:"CuiPolygon",props:{cameraZones:{}},setup(s){const e=s,{cameraZones:t}=Jt(e),n=Qt("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(),M("svg",{ref_key:"zoneRef",ref:n,width:"100%",height:"100%",class:"zones-container polygon-container"},[(m(!0),M(Ct,null,zt(c(t),(l,u)=>(m(),M("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,e6))),128))],512))}}),s6=qs(t6,[["__scopeId","data-v-bcfe05d5"]]),n6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function r6(s,e){return m(),M("svg",n6,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 i6=me({name:"bi-person-fill",render:r6}),o6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function a6(s,e){return m(),M("svg",o6,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 c6=me({name:"fluent-animal-paw-print-24-filled",render:a6}),l6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function u6(s,e){return m(),M("svg",l6,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 d6=me({name:"fluent-vehicle-car-16-filled",render:u6}),h6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m6(s,e){return m(),M("svg",h6,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 p6=me({name:"healthicons-running-24px",render:m6}),f6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g6(s,e){return m(),M("svg",f6,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 v6=me({name:"lucide-boxes",render:g6}),_6={class:"w-full h-full"},y6={key:1,class:"label-text"},b6=Tt({__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}=Jt(t),l=Qt("containerRef"),u=Ls([]),{width:d,height:h}=rl(l),v={motion:{color:"#A855F7",icon:p6},animal:{color:"#22C55E",icon:c6},person:{color:"#3B82F6",icon:i6},vehicle:{color:"#EF4444",icon:d6},other:{color:"#CAC443",icon:v6}},f=se(()=>Math.min(d.value||800,h.value||600)),b=se(()=>f.value<200?.8:1),k=se(()=>C=>{if(!u.value.length||!d.value)return 0;const{inputWidth:A}=u.value[0];return Math.round(C*d.value/A)}),z=se(()=>C=>{if(!u.value.length||!h.value)return 0;const{inputHeight:A}=u.value[0];return Math.round(C*h.value/A)}),O=se(()=>(C,A)=>k.value(A)-k.value(C)),te=se(()=>(C,A)=>z.value(A)-z.value(C)),W=se(()=>C=>{const A=O.value(C.boundingBox[0],C.boundingBox[2]),B=te.value(C.boundingBox[1],C.boundingBox[3]),H=A<200?.3:A<400?.25:.2;return Math.min(A,B)*H}),I=se(()=>C=>{const A=z.value(C.boundingBox[1]),B=30*b.value;return A<B}),E=se(()=>C=>k.value(C.boundingBox[0])>d.value*.7),N=C=>{u.value=C.filter(A=>r.value.includes(A.label))},D=()=>{u.value=[]};return Ze(n,C=>{C.length&&N(C)},{immediate:!0}),e({draw:N,clear:D}),(C,A)=>(m(),M("div",{ref_key:"containerRef",ref:l,class:"bbox-container"},[(m(!0),M(Ct,null,zt(c(u),B=>{var H,R;return m(),M("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(O)(B.boundingBox[0],B.boundingBox[2])}px`,height:`${c(te)(B.boundingBox[1],B.boundingBox[3])}px`})},[g("div",_6,[(m(),M(Ct,null,zt(["tl","tr","bl","br"],w=>{var Q;return g("div",{key:w,class:at(["corner-lines",w]),style:ot({"--corner-color":((Q=v[B.label])==null?void 0:Q.color)||v.other.color,"--corner-size":`${c(W)(B)}px`})},A[0]||(A[0]=[g("div",{class:"line horizontal"},null,-1),g("div",{class:"line vertical"},null,-1)]),6)}),64))]),c(a)||c(i)||c(o)?(m(),M("div",{key:0,class:at(["label z-1",{"label-bottom":c(I)(B),"label-right":c(E)(B)}]),style:ot({backgroundColor:((H=v[B.label])==null?void 0:H.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(),L(Ai(((R=v[B.label])==null?void 0:R.icon)||v.other.icon),{key:0})):ae("",!0),c(a)&&c(f)>250?(m(),M("span",y6,he(B.label),1)):ae("",!0),c(i)&&c(f)>250?(m(),M("span",{key:2,class:"confidence",style:ot({fontSize:`${11*c(b)}px`})},he((B.confidence*100).toFixed(1))+"% ",5)):ae("",!0)],6)):ae("",!0)],4)}),128))],512))}}),w6=qs(b6,[["__scopeId","data-v-870e7d93"]]),x6={class:"snapshot-hover-container flex items-center justify-center aspect-video"},S6={class:"shortcut-menu"},C6=Tt({__name:"CuiCameraShortcuts",props:{cameraName:{},addingShortcuts:{type:Boolean}},setup(s){var ht;const e=new Jn,t=new T_,n=Fs(),r=qr(),i=s,{cameraName:o,addingShortcuts:a}=Jt(i),{user:l}=Vs(n),u=Qt("placeholderRef"),d=Qt("shortcutContainerRef"),h=Qt("camerasMenuRef"),v=Ls({}),f=Ls({}),b=Ls({}),k=oe({}),z=oe(!1),O=oe(),te=oe(!1),W=oe(!1),I=oe([]),E=oe({}),N=oe(!1),D=rl(d);e.toggleQueryActivator("getCamerasQuery",!1);const{data:C,isFetching:A}=e.getCameraQuery(o),{data:B,isFetching:H}=e.getCamerasQuery({page:1,pageSize:-1}),{data:R,isFetching:w}=t.getShortcutsQuery(((ht=l.value)==null?void 0:ht.username)||"",o),{mutate:Q,isPending:J}=t.patchShortcutQuery(),{mutate:j,isPending:ie}=t.createShortcutQuery(),{mutate:ue,isPending:Se}=t.removeShortcutQuery(),F=se(()=>A.value||w.value||J.value||H.value||ie.value||Se.value),q=se(()=>{var U;return(U=B.value)!=null&&U.result?B.value.result.filter(X=>X.name!==o.value):[]}),Y=se(()=>{var U;return((U=l.value)==null?void 0:U.username)??""});Ze([R,C],()=>{R.value&&C.value&&(I.value=xi(R.value))},{immediate:!0,deep:!0}),Ze([D.width,D.height],()=>{W.value=!0,Zs(()=>{de()})}),Ze(I,()=>{Zs(()=>{xt()})},{deep:!0,immediate:!0}),Ze(W,U=>{U&&(O.value=void 0)});const Te=U=>{te.value||(O.value=void 0),N.value=U,e.toggleQueryActivator("getCamerasQuery",U)};Ze([u,O],([U,X])=>{U&&X&&setTimeout(()=>{var fe;(fe=h.value)==null||fe.show({currentTarget:U})},50)},{deep:!0}),Ze(E,()=>{Object.entries(E.value).forEach(([U,X])=>{var fe,ye;if(X&&f.value[U]){const pe=v.value[U];pe&&((fe=f.value[U])==null||fe.show({currentTarget:pe}))}else(ye=f.value[U])==null||ye.hide()})},{deep:!0});const He=(U,X)=>{z.value||(e.toggleQueryActivator("getCamerasQuery",X),E.value[U]=z.value?!1:X,Object.entries(E.value).forEach(([fe,ye])=>{fe!==U&&ye&&(E.value[fe]=!1)}))},pt=U=>{z.value||jt(U)},ft=(U,X)=>{U||(E.value[X._id]?(He(X._id,!1),De(X.cameraId)):He(X._id,!0))},Ge=()=>{Object.entries(b.value).forEach(([U,X])=>{const fe=d.value;if(!fe)return;const ye=fe.getBoundingClientRect(),pe=X.element.getBoundingClientRect(),le=(pe.left-ye.left)/ye.width*100,ge=(pe.top-ye.top)/ye.height*100;k.value[U]={x:Math.max(0,Math.min(le,100)),y:Math.max(0,Math.min(ge,100))}})},Je=()=>{Object.entries(b.value).forEach(([U,X])=>{const fe=k.value[U];if(!fe)return;const ye=d.value;if(!ye)return;const pe=ye.getBoundingClientRect(),le=X.element.getBoundingClientRect(),ge=pe.width-le.width,Ie=pe.height-le.height,Ee=Math.max(0,Math.min(fe.x/100*pe.width,ge)),Ue=Math.max(0,Math.min(fe.y/100*pe.height,Ie));X.setPosition(Ee,Ue)}),W.value=!1},de=()=>{Object.entries(k.value).forEach(([U,X])=>{k.value[U]={x:Math.max(0,Math.min(X.x,100)),y:Math.max(0,Math.min(X.y,100))}}),Je()},xt=()=>{for(const[U,X]of Object.entries(b.value))I.value.find(fe=>fe._id===U)||(X.destroy(),delete b.value[U],delete k.value[U]);for(const[U]of Object.entries(k.value))I.value.find(X=>X._id===U)||delete k.value[U];for(const[U,X]of Object.entries(v.value)){const fe=I.value.find(ye=>ye._id===U);if(X&&fe&&d.value){b.value[fe._id]&&b.value[fe._id].destroy();const ye=new Yh(X,{containment:d.value});b.value[fe._id]=ye;const[pe,le]=fe.points,ge=d.value.getBoundingClientRect(),Ie=pe/100*ge.width,Ee=le/100*ge.height;ye.setPosition(Ie,Ee),k.value[fe._id]={x:pe,y:le},ye.on("dragMove",()=>{z.value=!0;const Ue=f.value[U];Ue==null||Ue.alignOverlay()}),ye.on("dragEnd",()=>{setTimeout(()=>{z.value=!1},50),Ge();const Ue=k.value[fe._id];Q({username:Y.value,cameraname:o.value,shortcutid:fe._id,shortcutData:{points:[Ue.x,Ue.y]}})})}}Je()},Kt=U=>{if(!a.value||!d.value)return;te.value=!0;const X=d.value.getBoundingClientRect(),fe=35,ye=35;O.value={x:Math.max(0,Math.min(U.clientX-X.left-fe/2,X.width-fe)),y:Math.max(0,Math.min(U.clientY-X.top-ye/2,X.height-ye))}},vt=async U=>{if(!u.value||!d.value)return;const X=d.value,fe=u.value,ye=X.getBoundingClientRect(),pe=fe.getBoundingClientRect(),le=pe.left-ye.left,ge=pe.top-ye.top,Ie=le/ye.width*100,Ee=ge/ye.height*100;j({username:Y.value,cameraname:o.value,shortcutData:{_id:"",points:[Ie,Ee],cameraId:U._id}},{onSettled:()=>{var Ue;te.value=!1,O.value=void 0,(Ue=h.value)==null||Ue.hide()}})},jt=U=>{const X=b.value[U._id];X==null||X.destroy(),ue({username:Y.value,cameraname:o.value,shortcutid:U._id})},ct=(U,X)=>{v.value[X]=U},gt=(U,X)=>{f.value[X]=U},De=async U=>{if(z.value)return;const X=new AbortController,ye=(await bp({cameraname:U,signal:X.signal})).name;ye&&r.push(`/cameras/${ye}`)};return Q0(()=>{v.value={}}),Sn(()=>{Zs(()=>{xt()})}),vo(()=>{Object.values(b.value).forEach(U=>U.destroy())}),(U,X)=>{const fe=Sp,ye=ys,pe=Lr,le=Ap,ge=Qc,Ie=Ll;return m(),M("div",{ref_key:"shortcutContainerRef",ref:d,class:at(["shortcut-container",{"!pointer-events-auto":c(a)}]),style:ot({cursor:c(a)?"pointer":"default"}),onClick:lr(Kt,["self"])},[(m(!0),M(Ct,null,zt(c(I),Ee=>It((m(),M("div",{ref_for:!0,ref:Ue=>ct(Ue,Ee._id),key:Ee._id,class:"draggable absolute pointer-events-auto",style:ot({background:c(E)[Ee._id]?"#545454":void 0})},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(fe,{width:"100%",height:"100%"})]),_:1}),y(ge,{ref_for:!0,ref:Ue=>gt(Ue,Ee._id),class:"shadow-lg cui-rounded-corner overflow-hidden",pt:{content:{class:"p-0"}}},{default:$(()=>{var Ue;return[g("div",x6,[(Ue=c(B))!=null&&Ue.result.find(rt=>rt._id===Ee.cameraId)?(m(),L(le,{key:1,"source-role":"low-resolution","camera-info":c(B).result.find(rt=>rt._id===Ee.cameraId),toolbar:!1,control:!1,subcontrol:!1,"live-indicator-overlay":""},null,8,["camera-info"])):(m(),L(pe,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])]}),_:2},1536)],4)),[[c(Zh),[Ue=>He(Ee._id,Ue),{delayEnter:0,delayLeave:1e3}]],[c(sf),[()=>pt(Ee),{distanceThreshold:24,delay:500,onMouseUp:(Ue,rt,St)=>ft(St,Ee)}]]])),128)),c(O)?(m(),M("div",{key:0,ref_key:"placeholderRef",ref:u,class:"draggable absolute pointer-events-auto",style:ot(`left: ${c(O).x}px; top: ${c(O).y}px;`)},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(fe,{width:"100%",height:"100%"})]),_:1})],4)):ae("",!0),c(a)&&!c(z)&&!c(W)?(m(),L(ge,{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]=Ee=>N.value=!0),onHide:X[1]||(X[1]=Ee=>Te(!1))},{default:$(()=>[g("div",S6,[(m(!0),M(Ct,null,zt(c(q),Ee=>(m(),L(Ie,{key:Ee._id,class:"shortcut-menu-item","camera-name":Ee.name,width:"100%",loading:c(F),onClick:lr(Ue=>vt(Ee),["prevent"])},null,8,["camera-name","loading","onClick"]))),128))])]),_:1},512)):ae("",!0)],6)}}}),k6=qs(C6,[["__scopeId","data-v-98006b6f"]]),E6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function A6(s,e){return m(),M("svg",E6,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 M6=me({name:"ion-chevron-forward-outline",render:A6}),$6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function P6(s,e){return m(),M("svg",$6,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 T6=me({name:"ion-chevron-back-outline",render:P6}),R6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function I6(s,e){return m(),M("svg",R6,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 O6=me({name:"ion-chevron-down-outline",render:I6}),N6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function F6(s,e){return m(),M("svg",N6,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 L6=me({name:"ion-chevron-up-outline",render:F6}),j6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q6(s,e){return m(),M("svg",j6,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 D6=me({name:"ic-round-minus",render:q6}),B6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z6(s,e){return m(),M("svg",B6,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 U6=me({name:"ic-round-plus",render:z6});function jl(s){const e=oe(),t=oe(!1),n=oe(!1),r=oe(),i=oe(),o=oe(),a=oe(),l=oe(),u=oe(),d=oe(),h=oe([]),v=se(()=>t.value),f=se(()=>n.value),b=se(()=>h.value.includes(Wt.Light)),k=se(()=>h.value.includes(Wt.Siren)),z=se(()=>h.value.includes(Wt.Doorbell)),O=se(()=>h.value.includes(Wt.Battery)),te=se(()=>h.value.includes(Wt.AudioSensor)),W=se(()=>h.value.includes(Wt.MotionSensor)||h.value.includes(Wt.MotionDetector)),I=se(()=>h.value.includes(Wt.ObjectSensor)||h.value.includes(Wt.ObjectDetector)),E=se(()=>h.value.includes(Wt.PTZ));return Ze(s,N=>{if(!N)return;e.value=N.cameraSubject.value,t.value=N.connected,n.value=N.frameWorkerConnected,h.value=N.getCapabilities(),r.value=N.getValue("light"),i.value=N.getValue("motion"),o.value=N.getValue("audio"),a.value=N.getValue("object"),l.value=N.getValue("doorbell"),u.value=N.getValue("siren"),d.value=N.getValue("battery");const D=fn(N.cameraSubject);Ze(D,ue=>{ue&&(e.value=ue)});const C=fn(N.onConnected);Ze(C,ue=>{t.value=!!ue});const A=fn(N.onFrameWorkerConnected);Ze(A,ue=>{n.value=!!ue});const B=fn(N.capabilities);Ze(B,ue=>{ue&&(h.value=ue.map(Se=>Se.capabilities).flat())});const H=fn(N.onLightSwitched);Ze(H,ue=>{r.value=ue});const R=fn(N.onMotionDetected);Ze(R,ue=>{i.value=ue});const w=fn(N.onAudioDetected);Ze(w,ue=>{o.value=ue});const Q=fn(N.onObjectDetected);Ze(Q,ue=>{a.value=ue});const J=fn(N.onDoorbellPressed);Ze(J,ue=>{l.value=ue});const j=fn(N.onSirenDetected);Ze(j,ue=>{u.value=ue});const ie=fn(N.onBatteryChanged);Ze(ie,ue=>{d.value=ue})},{immediate:!0}),{cameraObject:e,connected:v,frameWorkerConnected:f,hasLight:b,hasSiren:k,hasDoorbell:z,hasBattery:O,hasAudioDetector:te,hasMotionDetector:W,hasObjectDetector:I,hasPtz:E,capabilities:h,lightState:r,motionState:i,audioState:o,objectState:a,doorbellState:l,sirenState:u,batteryState:d}}const V6={class:"relative w-full h-full"},H6={class:"absolute top-1 text-muted"},Q6={class:"absolute bottom-1 text-muted"},K6={class:"absolute left-1 text-muted"},Z6={class:"absolute right-1 text-muted"},Rh=100,kr=2e3,as=.05,Ih=.05,G6=.03,W6=Tt({__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}=Jt(r),{capabilities:a}=jl(i),l=Qt("panTiltRef"),u=Qt("zoomRef"),d=Tr({x:0,y:0}),h=Tr({x:0,y:0}),v=Tr({x:0,y:0}),f=oe(!1),b=oe(!1),k=oe(0),z=oe(0),O=oe(0),te=oe(!1),W=oe(0),I=oe(0),E=oe(0),N=oe(0),D=oe(0),C=oe(0),A=oe(0),B=oe("none"),H=oe(0),R=oe(0),w=oe(0),Q=oe(null),J=oe(Date.now()),j=se(()=>f.value||b.value),ie=se(()=>o.value==="small"?45:60),ue=se(()=>o.value==="small"?10:15),Se=se(()=>te.value),F=De=>Math.round(De*100)/100,q=De=>F(Math.max(0,Math.min(1,De))),Y=async De=>{const ht=Date.now();if(!(te.value&&ht-W.value<Rh)){"pan"in De&&De.pan!==void 0&&(De.pan=F(De.pan)),"tilt"in De&&De.tilt!==void 0&&(De.tilt=F(De.tilt)),"zoom"in De&&De.zoom!==void 0&&(De.zoom=q(De.zoom)),te.value=!0,W.value=ht;try{await i.value.interfaces.ptzCommand(De)}catch(U){console.error("PTZ command failed:",U)}finally{te.value=!1}}},Te=()=>{const De=Date.now(),ht=(De-J.value)/1e3;J.value=De;let U=!1;if(f.value&&(Math.abs(D.value)>=as||Math.abs(C.value)>=as)){const X=D.value*Ih*ht*5,fe=C.value*Ih*ht*5;H.value=Math.max(-1,Math.min(1,H.value+X)),R.value=Math.max(-1,Math.min(1,R.value+fe));const ye=F(H.value),pe=F(R.value);(h.x!==ye||h.y!==pe)&&(h.x=ye,h.y=pe,n("panTiltChange",{x:h.x,y:h.y}),U=!0)}if(b.value&&Math.abs(A.value)>=as){const X=A.value*G6*ht*10;w.value=Math.max(0,Math.min(1,w.value+X));const fe=F(w.value);z.value!==fe&&(z.value=fe,n("zoomChange",fe),U=!0)}if(U&&j.value&&Date.now()-W.value>=Rh*2){if(f.value&&(Math.abs(D.value)>=as||Math.abs(C.value)>=as)){const fe=F(D.value),ye=F(C.value);B.value==="pan"?Y({type:"continuous",pan:fe,tilt:0,timeout:kr}):B.value==="tilt"?Y({type:"continuous",pan:0,tilt:ye,timeout:kr}):Y({type:"continuous",pan:fe,tilt:ye,timeout:kr})}else if(b.value&&Math.abs(A.value)>=as){const fe=q(Math.abs(A.value)),ye=A.value>0;Y({type:"continuous",zoom:ye?fe:-fe,timeout:kr})}}j.value&&(Q.value=requestAnimationFrame(Te))},He=()=>{Q.value!==null&&cancelAnimationFrame(Q.value),J.value=Date.now(),Q.value=requestAnimationFrame(Te)},pt=()=>{Q.value!==null&&(cancelAnimationFrame(Q.value),Q.value=null)},ft=async()=>{await new Promise(De=>setTimeout(De,50)),!j.value&&(Math.abs(I.value)>=as||Math.abs(E.value)>=as||Math.abs(N.value)>=as)&&(D.value=0,C.value=0,A.value=0,B.value="none",I.value=0,E.value=0,N.value=0,await Y({type:"stop"}),pt())},Ge=De=>{b.value=!0,J.value=Date.now(),w.value=z.value,He(),De instanceof MouseEvent?Je(De.clientY):Je(De.touches[0].clientY)},Je=async De=>{if(!u.value||!b.value)return;const ht=u.value.getBoundingClientRect(),U=ht.top+ht.height/2,X=ie.value;let fe=De-U;fe=Math.max(-X,Math.min(X,fe)),k.value=fe;const ye=-fe/X;A.value=ye;const pe=F(ye);if(Math.abs(pe)>=as&&Math.abs(pe-N.value)>=as){N.value=pe;const le=pe>0,ge=q(Math.abs(pe));await Y({type:"continuous",zoom:le?ge:-ge,timeout:kr})}else b.value&&Math.abs(pe)<as&&Math.abs(N.value)>=as&&(A.value=0,N.value=0,await Y({type:"stop"}))},de=De=>{f.value=!0,J.value=Date.now(),He(),De instanceof MouseEvent?xt(De.clientX,De.clientY):xt(De.touches[0].clientX,De.touches[0].clientY)},xt=async(De,ht)=>{if(!l.value||!f.value)return;const U=l.value.getBoundingClientRect(),X=U.width/2,fe=U.height/2;let ye=De-U.left-X,pe=ht-U.top-fe;const le=Math.min(X,fe)-ue.value,ge=Math.sqrt(ye*ye+pe*pe);ge>le&&(ye=ye/ge*le,pe=pe/ge*le),d.x=ye,d.y=pe;const Ie=ye/le,Ee=-pe/le,Ue=Math.abs(Ie),rt=Math.abs(Ee);Ue>=as||rt>=as?Ue>rt?(B.value="pan",D.value=Ie,C.value=0):(B.value="tilt",D.value=0,C.value=Ee):(B.value="none",D.value=0,C.value=0),(Ue>as||rt>as)&&(v.x=D.value,v.y=C.value);const St=Math.abs(D.value-I.value),ts=Math.abs(C.value-E.value),bs=St>=as||ts>=as,ls=Math.abs(D.value)>=as||Math.abs(C.value)>=as;if(ls&&bs){I.value=D.value,E.value=C.value;const os=F(D.value),Cs=F(C.value);B.value==="pan"?await Y({type:"continuous",pan:os,tilt:0,timeout:kr}):B.value==="tilt"&&await Y({type:"continuous",pan:0,tilt:Cs,timeout:kr})}else f.value&&!ls&&(Math.abs(I.value)>=as||Math.abs(E.value)>=as)&&(D.value=0,C.value=0,B.value="none",I.value=0,E.value=0,await Y({type:"stop"}))},Kt=De=>{f.value&&xt(De.clientX,De.clientY),b.value&&Je(De.clientY)},vt=De=>{De.preventDefault(),f.value&&xt(De.touches[0].clientX,De.touches[0].clientY),b.value&&Je(De.touches[0].clientY)},jt=()=>{f.value&&(f.value=!1,d.x=0,d.y=0),b.value&&(O.value=z.value,b.value=!1,k.value=0),ft()},ct=async(De,ht)=>{await Y({type:"preset",preset:De,speed:ht})},gt=async De=>{await Y({type:"home",speed:De})};return Sn(()=>{window.addEventListener("mousemove",Kt),window.addEventListener("mouseup",jt),window.addEventListener("touchmove",vt,{passive:!1}),window.addEventListener("touchend",jt)}),vo(()=>{window.removeEventListener("mousemove",Kt),window.removeEventListener("mouseup",jt),window.removeEventListener("touchmove",vt),window.removeEventListener("touchend",jt),pt(),Y({type:"stop"})}),e({goToPreset:ct,goToHome:gt,isLoading:Se}),(De,ht)=>{const U=U6,X=D6,fe=L6,ye=O6,pe=T6,le=M6;return m(),M("div",V6,[c(a).includes(c(Wt).PTZZoom)?(m(),M("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:Ge,onTouchstart:lr(Ge,["prevent"])},[g("div",{class:at(["absolute top-4 text-muted",c(o)==="small"?"text-base":"text-lg"])},[y(U)],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)):ae("",!0),c(a).includes(c(Wt).PTZ)?(m(),M("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:de,onTouchstart:lr(de,["prevent"])},[g("div",H6,[y(fe)]),g("div",Q6,[y(ye)]),g("div",K6,[y(pe)]),g("div",Z6,[y(le)]),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)):ae("",!0)])}}}),J6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y6(s,e){return m(),M("svg",J6,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 X6=me({name:"mingcute-fullscreen-exit-fill",render:Y6}),e8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t8(s,e){return m(),M("svg",e8,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 s8=me({name:"mingcute-fullscreen-fill",render:t8}),n8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function r8(s,e){return m(),M("svg",n8,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 i8=me({name:"fluent-picture-in-picture16-filled",render:r8}),o8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function a8(s,e){return m(),M("svg",o8,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 c8=me({name:"fluent-picture-in-picture16-regular",render:a8}),l8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u8(s,e){return m(),M("svg",l8,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 d8=me({name:"mage-microphone-mute-fill",render:u8}),h8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m8(s,e){return m(),M("svg",h8,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 p8=me({name:"mage-microphone-fill",render:m8}),f8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function g8(s,e){return m(),M("svg",f8,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 v8=me({name:"heroicons-speaker-x-mark16-solid",render:g8}),_8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function y8(s,e){return m(),M("svg",_8,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 b8=me({name:"heroicons-speaker-wave16-solid",render:y8}),w8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x8(s,e){return m(),M("svg",w8,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 S8=me({name:"mdi-fast-forward10",render:x8}),C8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k8(s,e){return m(),M("svg",C8,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 E8=me({name:"basil-pause-solid",render:k8}),A8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function M8(s,e){return m(),M("svg",A8,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 $8=me({name:"basil-play-solid",render:M8}),P8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T8(s,e){return m(),M("svg",P8,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 R8=me({name:"mdi-rewind10",render:T8}),I8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O8(s,e){return m(),M("svg",I8,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 N8=me({name:"grommet-icons-pan",render:O8}),F8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L8(s,e){return m(),M("svg",F8,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 j8=me({name:"material-symbols-home-rounded",render:L8}),q8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D8(s,e){return m(),M("svg",q8,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 B8=me({name:"simple-icons-webrtc",render:D8}),z8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U8(s,e){return m(),M("svg",z8,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 V8=me({name:"cbi-iosfacetime",render:U8}),H8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q8(s,e){return m(),M("svg",H8,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 K8=me({name:"material-symbols-motion-photos-auto-outline-rounded",render:Q8}),Z8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G8(s,e){return m(),M("svg",Z8,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 W8=me({name:"fluent-pulse24-filled",render:G8}),J8={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function Y8(s,e){return m(),M("svg",J8,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 X8=me({name:"icon-park-solid-sleep",render:Y8}),ex={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tx(s,e){return m(),M("svg",ex,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 sx=me({name:"mdi-webcam",render:tx}),nx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rx(s,e){return m(),M("svg",nx,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 ix=me({name:"mynaui-letter-h-square-solid",render:rx}),ox={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ax(s,e){return m(),M("svg",ox,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 cx=me({name:"mynaui-letter-m-square-solid",render:ax}),lx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ux(s,e){return m(),M("svg",lx,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 dx=me({name:"mynaui-letter-l-square-solid",render:ux}),hx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mx(s,e){return m(),M("svg",hx,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 px=me({name:"mynaui-letter-a-square-solid",render:mx}),fx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gx(s,e){return m(),M("svg",fx,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 vx=me({name:"solar-moon-sleep-bold",render:gx}),_x=Symbol("cui-camera-drawer"),Do=Gh(_x),Cp={position:"right",showCloseIcon:!1,modal:!0,dismissable:!0,baseZIndex:1e3,blockScroll:!0,pt:{root:{class:"w-full sm:w-[400px]"}}},kp=()=>{const s=oe(!1),e=se(()=>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=Ze(t,o=>{o&&e.value&&(i(),n(e.value))});setTimeout(()=>{i(),r(new Error("Timeout waiting for API"))},15e3)})}const yx={key:"sleep",class:"absolute left-0 right-0 top-0 bottom-0 bg-black/80 flex items-center justify-center z-7"},bx={class:"flex flex-col items-center justify-center text-center"},wx={key:0,class:"text-white/80 text-sm max-w-xs mt-3"},xx={key:"loading",class:"absolute w-full h-full flex flex-col items-center justify-center z-6 pointer-events-none"},Sx={key:0,class:"mt-3 text-white text-sm text-shadow"},Cx={key:"overlay",class:"absolute w-full p-4 flex items-center justify-between gap-2 z-6 pointer-events-none"},kx={key:1,class:"text-sm font-semibold p-2 bg-black/60 rounded-xl text-white"},Ex={id:"timeline-container",key:"timeline",class:"absolute w-full h-full z-5 pointer-events-none"},Ax={key:5,class:"absolute top-0 left-0 w-full h-full z-5 pointer-events-none"},Mx=["data-player-id","muted"],$x={class:"flex items-center gap-2"},Px={key:1,class:"w-[10px] h-[10px] rounded-full bg-red-500"},Tx={class:"text-base font-semibold"},Oh=6,Rx=5e3,Nh=5e3,Ix=1e4,Ox=1e3,Nx=Tt({__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:O,cardProps:te,cameraNameOverlay:W,liveIndicatorOverlay:I,control:E,controlFastForwardButton:N,controlFsButton:D,controlMicrophoneButton:C,controlPipButton:A,controlPlayPauseButton:B,controlRewindButton:H,controlSpeakerButton:R,subcontrol:w,subcontrolActivityModeButton:Q,subcontrolPtzButton:J,subcontrolQualityButton:j,subcontrolStreamingModeButton:ie,toolbar:ue,toolbarClass:Se,toolbarDetectionButton:F,toolbarSettingsButton:q,toolbarShareButton:Y,toolbarShortcutsButton:Te,toolbarSnapshotButton:He,toolbarStyle:pt,toolbarTimelineButton:ft,toolbarZoneButton:Ge}=Jt(b),Je=Qt("snapshotRef"),de=Qt("menuRef"),xt=Qt("motionDetectionCanvasRef"),Kt=Qt("objectDetectionCanvasRef"),vt=Qt("ptzRef"),jt=Qt("playerContainerRef"),ct=Qt("videoPlayerRef"),gt=Ls(),{cameraObject:De,motionState:ht,objectState:U,hasPtz:X,hasMotionDetector:fe,hasObjectDetector:ye}=jl(gt),pe=Ls(null),le=Ls(),ge=oe(!1),Ie=oe(!1),Ee=oe(!1),Ue=oe("loading"),rt=oe(!1),St=oe(!1),ts=oe(!1),bs=oe(!1),ls=oe(!1),os=oe({x:0,y:0}),Cs=oe(1),hs=oe(!1),Be=oe(!1),us=oe(!1),V=oe(!1),ne=oe(!1),ve=oe(!0),Ce=oe(!1),nt=oe(!0),Ft=oe(!1),Zt=oe(!1),Xe=oe(!1),xe=oe(["animal","motion","other","person","vehicle"]),Ne=I_();let Fe,_e,it;n.toggleQueryActivator("getCameraQuery",!1);const{data:_,isFetching:x,suspense:S}=n.getCameraQuery(typeof k.value=="string"?k.value:""),P=nf(),T=Su(jt,{delayLeave:1e3}),Z=Su(jt,{delayLeave:0}),Me=ri(jt),{isFullscreen:Pe,toggle:ce}=rf(a.value?ct:jt),{idle:ke,reset:yt}=of(Rx,{initialState:!1});Eo(ct,"enterpictureinpicture",()=>Zt.value=!0),Eo(ct,"leavepictureinpicture",()=>Zt.value=!1),Eo(ct,"pause",()=>{Ce.value=!1,ls.value||Co()}),Eo(ct,"play",()=>{ls.value=!1,Ce.value=!0});const et=se(()=>(T.value||ve.value)&&E.value&&!hs.value),_t=se(()=>typeof k.value=="string"&&x.value||!Ee.value||rt.value),ds=se(()=>Ie.value&&Ue.value!=="error"),ws=se(()=>!!navigator.mediaDevices&&ge.value&&(Ue.value==="webrtc"||Ue.value==="webrtc/tcp")),Ii=se(()=>Xe.value||!Ee.value),kn=se(()=>{var ee;return f.value??((ee=So.value)==null?void 0:ee.interface.streamingMode)??"webrtc"}),on=se(()=>{var ee;return v.value??((ee=So.value)==null?void 0:ee.interface.streamingSource)??"high-resolution"}),ql=se(()=>W.value&&et.value&&!i.value&&Me.width.value>=350),$p=se(()=>E.value&&et.value&&!St.value&&Me.width.value>=150),Pp=se(()=>w.value&&et.value&&!St.value&&Me.width.value>=150),Oi=se(()=>us.value&&Me.width.value>=350&&X.value),Dl=se(()=>{var Ae;let ee=(Ae=So.value)==null?void 0:Ae.interface.aspectRatio;return ee=!ee||ee==="auto"?"16:9":ee,ee.replace(":","/")}),So=se(()=>typeof k.value=="string"?_.value:k.value),En=se(()=>typeof k.value=="string"?k.value:k.value.name),Tp=se(()=>[{key:"animal",label:"Animal",toggle:!0,toggleState:xe.value.includes("animal"),disabled:!Ni.value.includes("animal"),onClick:()=>Qr("animal")},{key:"motion",label:"Motion",toggle:!0,toggleState:xe.value.includes("motion"),disabled:!Ni.value.includes("motion"),onClick:()=>Qr("motion")},{key:"other",label:"Other",toggle:!0,toggleState:xe.value.includes("other"),disabled:!Ni.value.includes("other"),onClick:()=>Qr("other")},{key:"person",label:"Person",toggle:!0,toggleState:xe.value.includes("person"),disabled:!Ni.value.includes("person"),onClick:()=>Qr("person")},{key:"vehicle",label:"Vehicle",toggle:!0,toggleState:xe.value.includes("vehicle"),disabled:!Ni.value.includes("vehicle"),onClick:()=>Qr("vehicle")}]),Rp=se(()=>{var Ae;const ee={body:{class:"w-full h-full p-0 overflow-hidden justify-center"},root:{class:{}}};return O.value&&(ee.root.class={...ee.root.class,"!rounded-none !border-0":!0}),kl(ee,(Ae=te.value)==null?void 0:Ae.pt)}),Bl=se(()=>{const ee=Me.width.value;return ee?ee<=150?.4:ee<250?.5:ee<350?.7:ee<450?.85:1:1}),Ip=se(()=>{const ee=Me.height.value,Ae=Bl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),Op=se(()=>{const ee=Me.height.value,Ae=Bl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),lt=se(()=>{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=se(()=>{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=se(()=>`${an.value}px`),Ni=se(()=>{var Ae;const ee=new Set(((Ae=So.value)==null?void 0:Ae.detectionZones.map(Et=>Et.classes).flat())??[]);return fe.value||ee.delete("motion"),ye.value||(ee.delete("animal"),ee.delete("person"),ee.delete("vehicle"),ee.delete("other")),Array.from(ee)});Ze(P,ee=>{var Ae,Et;ee==="hidden"?(clearTimeout(_e),_e=setTimeout(()=>{Hr()},Ix)):(clearTimeout(_e),(Ae=pe.value)!=null&&Ae.finishLoading?Co():(yr(),(Et=pe.value)==null||Et.start()))}),Ze(rt,async ee=>{ee&&await qa(!1,!1)}),Ze(Ee,ee=>{ee||qp(),d("streamFinishedLoading",ee)}),Ze(Ue,ee=>{clearInterval(it),ee==="mse"&&(it=setInterval(Dp,Ox))}),Ze(h,()=>{Jl()}),Ze(ke,ee=>{h.value==="standby"&&ee&&(St.value=!0,Hr())}),Ze(ht,()=>{var ee,Ae,Et;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Yl(((Ae=ht.value)==null?void 0:Ae.detections)??[]),eu("motion",((Et=ht.value)==null?void 0:Et.detections)??[]))},{deep:!0}),Ze(U,()=>{var ee,Ae,Et;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Yl(((Ae=U.value)==null?void 0:Ae.detections)??[]),eu("object",((Et=U.value)==null?void 0:Et.detections)??[]))},{deep:!0});const Np=async()=>{if(!ct.value)throw new Error("Video player not found!");typeof k.value=="string"&&await S();const ee=await Ep();if(gt.value=await ee.deviceManager.getCamera(En.value),!gt.value)throw new Error("Camera not found!");pe.value=gt.value.createWebRTCSession({role:on.value,mode:kn.value,videoElement:ct.value,webrtcConnectTimeout:2e3}),pe.value.addEventListener("error",Vl),pe.value.addEventListener("reconnect",yr),pe.value.addEventListener("onModeChange",Hl),pe.value.addEventListener("onSourceChange",Ql),pe.value.addEventListener("onStreamProbe",Kl),pe.value.addEventListener("onFinishLoading",Zl),pe.value.addEventListener("onFirstFrame",Gl),pe.value.addEventListener("onLoadedData",Wl),Jl(!0)},Fp=()=>{var ee;if(kn.value==="auto"){const Ae=(ee=pe.value)!=null&&ee.currentMode?u(`components.player.streaming_mode_${pe.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=pe.value)!=null&&ee.currentResolution?u(`components.player.source_role_${pe.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")},zl=ee=>{if(!ct.value||!jt.value||!T.value){os.value={x:0,y:0},Cs.value=1;return}const Ae=jt.value.getBoundingClientRect(),Et=ct.value.getBoundingClientRect(),gs=Math.max(0,(Et.width-Ae.width)/2),ss=Math.max(0,(Et.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,Yt=Oh-1;ee.zoom>Yt?ee.type==="dblClick"?Zs(()=>{Cs.value=Kr}):Zs(()=>{Cs.value=Yt}):ee.zoom===1&&setTimeout(()=>{os.value={x:0,y:0}},10)},Ul=()=>{z.value&&!St.value&&d("expand")},Vl=ee=>{console.error(En.value,ee),Ue.value="error",Ee.value=!1,rt.value=!1},yr=()=>{Ue.value="reconnecting",Ee.value=!1,rt.value=!0},Hl=()=>{Ue.value=pe.value.currentMode,rt.value=!1,Ee.value=!1},Ql=()=>{Ue.value="adapting",ts.value=!0},Kl=()=>{Ue.value=pe.value.currentMode,ge.value=pe.value.hasBackchannel,Ie.value=pe.value.hasAudio},Zl=()=>{Ue.value=pe.value.currentMode,rt.value=!1},Gl=()=>{Ue.value=pe.value.currentMode,Ee.value=!0,ts.value=!1},Wl=()=>{Ue.value=pe.value.currentMode,Ee.value=!0,ts.value=!1},Jl=ee=>{var Ae,Et,gs,ss;clearTimeout(Fe),h.value==="always-on"?(St.value=!1,(Ae=pe.value)!=null&&Ae.finishLoading||(ee||yr(),(Et=pe.value)==null||Et.start())):h.value==="standby"?St.value||(yt(),(gs=pe.value)!=null&&gs.finishLoading||(yr(),(ss=pe.value)==null||ss.start())):h.value==="activity"&&(bs.value||(St.value=!0,Hr()))},Yl=ee=>{var Ae,Et;h.value==="activity"&&(!!(ee!=null&&ee.length&&ee.some(ss=>xe.value.includes(ss.label)))?(bs.value=!0,clearTimeout(Fe),(St.value||!((Ae=pe.value)!=null&&Ae.finishLoading))&&(St.value=!1,yr(),(Et=pe.value)==null||Et.start())):(clearTimeout(Fe),Fe=setTimeout(()=>{bs.value||(St.value=!0,Hr())},Nh),bs.value=!1))},jp=()=>{var ee;St.value&&(St.value=!1,yr(),(ee=pe.value)==null||ee.start(),h.value==="standby"?yt():h.value==="activity"&&(clearTimeout(Fe),bs.value||(Fe=setTimeout(()=>{St.value=!0,Hr()},Nh))))},Hr=()=>{var ee;(ee=pe.value)==null||ee.close(),Ee.value=!1},Xl=()=>{var ee;if(ct.value){const Ae=document.createElement("canvas");Ae.width=ct.value.videoWidth,Ae.height=ct.value.videoHeight,(ee=Ae.getContext("2d"))==null||ee.drawImage(ct.value,0,0,Ae.width,Ae.height);const Et=Ae.toDataURL("image/png"),gs=`${En.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,ss=document.createElement("a");ss.setAttribute("download",gs),ss.href=Et,document.body.appendChild(ss),ss.click(),ss.remove()}},qp=()=>{var ee,Ae;(ee=xt.value)==null||ee.clear(),(Ae=Kt.value)==null||Ae.clear()},eu=(ee,Ae)=>{var Et,gs;Ee.value&&(ee==="motion"?(Et=xt.value)==null||Et.draw(Ae):ee==="object"&&((gs=Kt.value)==null||gs.draw(Ae)))},Co=async()=>{if(ct.value)try{await ct.value.play()}catch(ee){if(ct.value&&!ct.value.muted)return ct.value.muted=!0,Co();console.warn(En.value,ee)}},Dp=()=>{if(ct.value&&Ue.value==="mse"&&!rt.value&&Ee.value&&ct.value.buffered.length>0){const ee=ct.value.buffered.end(ct.value.buffered.length-1);ee-ct.value.currentTime>1&&(ct.value.currentTime=ee)}},Qr=ee=>{const Ae=xe.value.indexOf(ee);Ae>-1?xe.value.splice(Ae,1):xe.value.push(ee)},tu=ee=>{ee=ee??!ne.value,ne.value=ee},su=ee=>{nt.value=ee!==void 0?ee:!nt.value},qa=async(ee,Ae=!1)=>{var Et,gs;if((Et=pe.value)!=null&&Et.currentMode.includes("webrtc"))if(Ft.value=ee!==void 0?ee:!Ft.value,Ft.value)try{le.value=await navigator.mediaDevices.getUserMedia({audio:!0});const ss=le.value.getAudioTracks()[0];nt.value=!Ae,await pe.value.toggleMicrophone(ss)}catch(ss){console.warn(En.value,ss)}else(gs=le.value)==null||gs.getTracks().forEach(ss=>ss.stop()),le.value=void 0,await pe.value.toggleMicrophone(null)},nu=ee=>{h.value=ee||(h.value==="always-on"?"standby":h.value==="standby"?"activity":"always-on")},ru=async ee=>{var Et;let Ae=on.value;Ae=ee||(Ae==="auto"?"low-resolution":Ae==="low-resolution"?"mid-resolution":Ae==="mid-resolution"?"high-resolution":"auto"),await((Et=pe.value)==null?void 0:Et.toggleRole(Ae)),v.value=Ae},iu=async ee=>{var Et;let Ae=kn.value;Ae=ee||(Ae==="auto"?"webrtc":Ae==="webrtc"?"mse":"auto"),await((Et=pe.value)==null?void 0:Et.toggleMode(Ae)),f.value=Ae},ou=()=>{var ee;document.pictureInPictureElement?document.exitPictureInPicture():document.pictureInPictureEnabled&&((ee=ct.value)==null||ee.requestPictureInPicture())},au=()=>{ct.value&&(Ce.value?(ls.value=!0,ct.value.pause()):Co())},cu=()=>{o.value?ce():Pe.value=!Pe.value},lu=()=>{Be.value=!Be.value},uu=()=>{us.value=!us.value},du=()=>{hs.value=!hs.value},hu=()=>{V.value=!V.value},mu=()=>{},pu=()=>{},Bp=ee=>{Xe.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,Et,gs,ss,br,wr,Kr,Yt;clearTimeout(Fe),(ee=pe.value)==null||ee.removeEventListener("error",Vl),(Ae=pe.value)==null||Ae.removeEventListener("reconnect",yr),(Et=pe.value)==null||Et.removeEventListener("onModeChange",Hl),(gs=pe.value)==null||gs.removeEventListener("onSourceChange",Ql),(ss=pe.value)==null||ss.removeEventListener("onStreamProbe",Kl),(br=pe.value)==null||br.removeEventListener("onFinishLoading",Zl),(wr=pe.value)==null||wr.removeEventListener("onFirstFrame",Gl),(Kr=pe.value)==null||Kr.removeEventListener("onLoadedData",Wl),Hr(),(Yt=gt.value)==null||Yt.close()}),e({togglePlay:au,toggleSourceRole:ru,togglePictureInPicture:ou,toggleActivityMode:nu,toggleAddingShortcuts:du,toggleStreamingMode:iu,toggleFs:cu,toggleMute:su,toggleMicrophone:qa,toggleShortcuts:lu,togglePtz:uu,toggleFastForward:pu,toggleRewind:mu,toggleZones:tu,toggleDetectionClass:Qr,toggleTimeline:hu,timelineScroll:Bp,captureScreenshot:Xl}),(ee,Ae)=>{const Et=vx,gs=Lr,ss=px,br=dx,wr=cx,Kr=ix,Yt=ys,zp=sx,Up=X8,Vp=W8,Hp=K8,Qp=V8,Kp=B8,Zp=j8,Gp=N8,Wp=R8,Jp=$8,Yp=E8,Xp=S8,e0=b8,t0=v8,s0=p8,n0=d8,r0=c8,i0=i8,o0=s8,a0=X6,c0=W6,l0=k6,fu=w6,u0=s6,d0=Ll,h0=X4,m0=W4,p0=K4,f0=V4,g0=B4,v0=j4,_0=Sp,y0=I4,b0=P4,w0=A4,x0=C4,S0=Vc,C0=Sa,k0=Bh,E0=gp,Js=jr;return m(),M("div",null,[y(k0,{class:"cui-card",pt:c(Rp)},{content:$(()=>{var gu;return[g("div",{id:"video-container",ref_key:"playerContainerRef",ref:jt,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(Dl)})},{default:$(()=>{var ko,vu;return[c(St)?(m(),M("div",yx,[g("div",bx,[y(Et,{class:"text-white w-[50px] h-[50px]"}),c(Me).width.value>=350?(m(),M("p",wx,he(ee.$t("components.player.stream_paused")),1)):ae("",!0)])])):ae("",!0),c(_t)&&!c(St)?(m(),M("div",xx,[y(gs,{class:"w-[30px] h-[30px] m-0","stroke-width":"5"}),c(rt)?(m(),M("span",Sx,he(ee.$t("components.player.reconnecting"))+"...",1)):ae("",!0)])):ae("",!0),!c(St)&&(c(ql)||c(I))?(m(),M("div",Cx,[c(I)?(m(),M("div",{key:0,class:at(["w-[10px] h-[10px] rounded-full shadow-md",{"bg-red-500":c(Ee),"bg-gray-500":!c(Ee)}])},null,2)):ae("",!0),c(ql)?(m(),M("span",kx,he(c(En)),1)):ae("",!0)])):ae("",!0),c(Pp)?(m(),M("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(j)&&!c(us)?It((m(),L(Yt,{key:0,disabled:c(_t),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=>ru())},{icon:$(()=>[c(on)==="auto"?(m(),L(ss,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):c(on)==="low-resolution"?(m(),L(br,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):c(on)==="mid-resolution"?(m(),L(wr,{key:2,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Kr,{key:3,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Lp()},void 0,{top:!0}]]):ae("",!0),c(Q)&&!c(us)?It((m(),L(Yt,{key:1,disabled:c(_t),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=>nu())},{icon:$(()=>[h.value==="always-on"?(m(),L(zp,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):h.value==="standby"?(m(),L(Up,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Vp,{key:2,width:`${c(lt)}px`,height:`${c(lt)}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}]]):ae("",!0),c(ie)&&!c(us)?It((m(),L(Yt,{key:2,disabled:c(_t),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=>iu())},{icon:$(()=>[c(kn)==="auto"?(m(),L(Hp,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):c(kn)==="mse"?(m(),L(Qp,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Kp,{key:2,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Fp()},void 0,{top:!0}]]):ae("",!0),c(us)&&c(X)&&c(Me).width.value>=350?It((m(),L(Yt,{key:3,disabled:c(_t)||((ko=c(vt))==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 _u;return(_u=c(vt))==null?void 0:_u.goToHome()})},{icon:$(()=>[y(Zp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz_go_to_home")},void 0,{top:!0}]]):ae("",!0),c(J)&&c(Me).width.value>=350&&c(X)?It((m(),L(Yt,{key:4,disabled:c(_t)||c(V),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:uu},{icon:$(()=>[y(Gp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz")},void 0,{top:!0}]]):ae("",!0)],4)):ae("",!0),c($p)&&!c(V)&&!c(Oi)?(m(),M("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(H)?(m(),L(Yt,{key:0,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",onClick:mu},{icon:$(()=>[y(Wp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1})):ae("",!0),c(B)?(m(),L(Yt,{key:1,disabled:c(_t),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:au},{icon:$(()=>[c(Ce)?(m(),L(Yp,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Jp,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(N)?(m(),L(Yt,{key:2,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:pu},{icon:$(()=>[y(Xp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1},8,["style"])):ae("",!0),c(R)?(m(),L(Yt,{key:3,disabled:!c(ds)||c(_t),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=>su())},{icon:$(()=>[c(nt)?(m(),L(t0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(e0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(C)?(m(),L(Yt,{key:4,disabled:!c(ws)||c(_t),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(Ft)?(m(),L(s0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(n0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(A)?(m(),L(Yt,{key:5,disabled:!c(l)||c(_t),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:ou},{icon:$(()=>[c(Zt)?(m(),L(i0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(r0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(D)?(m(),L(Yt,{key:6,disabled:!c(o)||c(_t),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:cu},{icon:$(()=>[c(Pe)?(m(),L(a0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(o0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0)],4)):ae("",!0),It(g("div",Ex,null,512),[[Pr,c(V)&&!c(Oi)&&!c(St)]]),c(Oi)&&!c(V)&&!c(St)&&c(gt)?(m(),M("div",Ax,[y(c0,{ref_key:"ptzRef",ref:vt,"camera-device":c(gt)},null,8,["camera-device"])])):ae("",!0),(c(Be)||c(hs))&&!c(St)?(m(),L(l0,{key:6,"camera-name":c(En),"adding-shortcuts":c(hs),class:"z-4 pointer-events-none"},null,8,["camera-name","adding-shortcuts"])):ae("",!0),c(fe)&&!c(St)?(m(),L(fu,{key:7,ref_key:"motionDetectionCanvasRef",ref:xt,classes:c(xe),class:"z-3 pointer-events-none"},null,8,["classes"])):ae("",!0),c(ye)&&!c(St)?(m(),L(fu,{key:8,ref_key:"objectDetectionCanvasRef",ref:Kt,classes:c(xe),class:"z-3 pointer-events-none"},null,8,["classes"])):ae("",!0),c(ne)&&!c(St)?(m(),L(u0,{key:9,"camera-zones":((vu=c(De))==null?void 0:vu.detectionZones)??[],class:"z-2 pointer-events-none"},null,8,["camera-zones"])):ae("",!0),It(y(d0,{key:"snapshot",ref_key:"snapshotRef",ref:Je,"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:Ul},null,8,["camera-name","class"]),[[Pr,(!c(Ee)||c(St)||c(ts))&&!c(Zt)]]),y(c(Ef),{key:"zoomable",pan:c(os),"onUpdate:pan":Ae[6]||(Ae[6]=Ln=>ps(os)?os.value=Ln:null),zoom:c(Cs),"onUpdate:zoom":Ae[7]||(Ae[7]=Ln=>ps(Cs)?Cs.value=Ln:null),disabled:!c(Z)||c(V)||c(Oi)||c(St),"enable-control-button":!1,"dbl-click-enabled":!1,"min-zoom":1,"max-zoom":Oh,selector:c(Z)?`[data-player-id='${c(Ne)}']`:"disabled","zoom-origin":"pointer",class:"h-full w-full items-center justfiy-center",onPanned:zl,onZoom:zl},{default:$(()=>[g("video",{ref_key:"videoPlayerRef",ref:ct,"data-player-id":c(Ne),playsinline:"",autoplay:"",preload:"auto",muted:c(nt),class:at(["w-full cursor-[inherit] object-fill",{"cursor-pointer":c(z),"object-contain":c(Pe)}]),style:ot({aspectRatio:c(Dl)}),onClick:Ul},null,14,Mx)]),_:1},8,["pan","zoom","disabled","selector"])]}),_:1},8,["style"])],512),c(ue)?(m(),M("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(pt)])},[g("div",$x,[c(Ii)?(m(),L(gs,{key:0,"stroke-width":"5",class:"w-[10px] h-[10px]"})):(m(),M("div",Px)),g("span",Tx,he(c(En)),1)]),Ae[10]||(Ae[10]=g("div",{class:"ml-auto"},null,-1)),c(Y)?It((m(),L(Yt,{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}]]):ae("",!0),c(He)?It((m(),L(Yt,{key:1,fluid:"",text:"",severity:"contrast",class:"cui-icon-lg not-hover:text-surface-400",onClick:Xl},{icon:$(()=>[y(m0,{width:"100%",height:"100%"})]),_:1})),[[Js,{value:ee.$t("components.player.capture_snapshot")},void 0,{top:!0}]]):ae("",!0),c(Ge)?It((m(),L(Yt,{key:2,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(ne)}]),onClick:Ae[8]||(Ae[8]=ko=>tu())},{icon:$(()=>[c(ne)?(m(),L(f0,{key:1,width:"100%",height:"100%"})):(m(),L(p0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(ne)?ee.$t("components.player.hide_zones"):ee.$t("components.player.show_zones")},void 0,{top:!0}]]):ae("",!0),c(F)&&(c(fe)||c(ye))?It((m(),L(Yt,{key:3,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(xe).length}]),onClick:(gu=c(de))==null?void 0:gu.toggleMenu},{icon:$(()=>[y(g0,{width:"100%",height:"100%"})]),_:1},8,["class","onClick"])),[[Js,{value:ee.$t("components.player.detections")},void 0,{top:!0}]]):ae("",!0),c(Te)?It((m(),L(Yt,{key:4,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(Be)||c(hs)}]),onClick:lu},{icon:$(()=>[!c(Be)&&!c(hs)?(m(),L(v0,{key:0,width:"100%",height:"100%"})):(m(),L(_0,{key:1,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(Be)?ee.$t("components.player.hide_shortcuts"):ee.$t("components.player.show_shortcuts")},void 0,{top:!0}]]):ae("",!0),c(Te)?It((m(),L(Yt,{key:5,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(hs)}]),onClick:du},{icon:$(()=>[c(hs)?(m(),L(b0,{key:1,width:"100%",height:"100%"})):(m(),L(y0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(hs)?ee.$t("components.player.save_shortcuts"):ee.$t("components.player.add_shortcuts")},void 0,{top:!0}]]):ae("",!0),c(ft)?It((m(),L(Yt,{key:6,disabled:c(Oi),fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(V)}]),onClick:hu},{icon:$(()=>[c(V)?(m(),L(x0,{key:1,width:"100%",height:"100%"})):(m(),L(w0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["disabled","class"])),[[Js,{value:c(V)?ee.$t("components.player.hide_timeline"):ee.$t("components.player.show_timeline")},void 0,{top:!0}]]):ae("",!0),c(q)&&("useCuiPermission"in ee?ee.useCuiPermission:c(Si))(void 0,"admin")?It((m(),L(Yt,{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(),L(C0,{key:1,width:"100%",height:"100%"})):(m(),L(S0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:ee.$t("components.player.settings")},void 0,{top:!0}]]):ae("",!0)],6)):ae("",!0)]}),_:1},8,["pt"]),y(E0,{ref_key:"menuRef",ref:de,items:c(Tp),"sort-list":"","auto-hide":!1},null,8,["items"])])}}}),Ap=qs(Nx,[["__scopeId","data-v-d1d904d2"]]),Fx=al({protocol:ep,url:Jh().trim().min(1,"Camera Source is required").array().nonempty("Camera Source is required")}).strict(),Lx=al({name:Jh().trim().min(1,"Camera Source Name is required"),urls:Fx.array(),role:Ml,useForSnapshot:ku().default(!1),hotMode:ku().default(!1)}).strict(),jx=al({...E2.innerType().shape,sources:Lx.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(),g9=Wn(jx),v9=Wn(k2),qx=Wn(A2),Dx=Wn(Al),Bx={class:"w-full h-full relative"},zx={class:"flex flex-col justify-center items-center"},Ux={class:"relative w-full"},Vx={class:"w-full flex flex-col items-center justify-center gap-6"},Hx={class:"relative w-full flex flex-col items-center justify-center"},Qx={class:"absolute top-0 left-0 right-0 bottom-0"},Kx={class:"playground-container flex w-full h-full"},Zx={class:"sandbox w-full h-full"},Gx={class:"handles"},Wx=["data-id","data-point","data-point-index","data-zone-index","onDblclick"],Jx={class:"clipboard"},Yx={width:"100%",height:"100%",class:"polygon-container"},Xx=["d","onClick","onDblclick","onMousedown","onTouchstart"],eS={class:"flex flex-col gap-6 zone-buttons justify-center items-center"},tS=["for"],sS=["for"],nS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},rS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},iS=Tt({__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}=Jt(i),u=Qt("draggablesRef"),d=Qt("outsideRef"),h=Qt("playerRef"),v=Ls([]),f=oe([]),b=oe(!1),k=oe([]),z=oe(void 0),O=oe(-1),te=oe(-1),W=oe(["animal","vehicle","person","other","motion"]);let I=!1;const E={x:0,y:0},N=rl(h);nl(d,U=>{const X=U.target,fe=X.closest(".polygon"),ye=X.closest(".edit-button"),pe=X.closest(".remove-button"),le=X.closest(".handle"),ge=X.closest(".zone-buttons"),Ie=X.closest(".p-multiselect-list"),Ee=X.closest(".p-colorpicker-panel");!fe&&!ye&&!pe&&!le&&!b.value&&!ge&&!Ie&&!Ee&&(O.value=-1)});const{mutateAsync:D,isPending:C}=t.patchZonesQuery(),A=se(()=>{var U;return!!((U=o.loading)!=null&&U.value||C.value)}),B=se(()=>{var X;const U=[];return b.value&&U.push("customizing"),(X=f.value)!=null&&X.length||U.push("start"),U.join(" ")});Ze(te,()=>{te.value=-1}),Ze(O,(U,X)=>{var fe,ye;if(U===-1&&((fe=f.value)!=null&&fe.length)&&f.value[X]){O.value=X;return}U===-1&&((ye=f.value)!=null&&ye.length)&&(te.value=0)}),Ze(l,()=>{f.value=xi(l.value),H()},{deep:!0,immediate:!0});function H(){if(f.value){if(f.value.length===0){k.value=[];return}k.value=f.value.flatMap((U,X)=>U.points.map((fe,ye)=>({_id:`${U.name}-${ye}`,zoneIndex:X,pointIndex:ye,point:[fe[0],fe[1]]})))}}Ze([N.width,N.height],()=>{Kt()});const R=U=>{if("touches"in U){const X=U.touches[0];return{x:X.clientX,y:X.clientY}}return{x:U.clientX,y:U.clientY}},w=(U,X)=>{if(U.stopPropagation(),!h.value)return;Te(b.value),I=!0,O.value=X;const fe=h.value.getBoundingClientRect(),{x:ye,y:pe}=R(U);E.x=(ye-fe.left)/fe.width*100,E.y=(pe-fe.top)/fe.height*100},Q=U=>{if(!I||!h.value||O.value===-1||!f.value.length)return;const X=h.value.getBoundingClientRect(),{x:fe,y:ye}=R(U),pe=(fe-X.left)/X.width*100,le=(ye-X.top)/X.height*100,ge=pe-E.x,Ie=le-E.y,Ee=f.value[O.value].points;let Ue=!1;for(let rt=0;rt<Ee.length;rt++){const St=Ee[rt][0]+ge,ts=Ee[rt][1]+Ie;if(St<0||St>100||ts<0||ts>100){Ue=!0;break}}if(!Ue)for(let rt=0;rt<Ee.length;rt++){Ee[rt][0]+=ge,Ee[rt][1]+=Ie,Ee[rt][0]=Math.max(0,Math.min(100,Ee[rt][0])),Ee[rt][1]=Math.max(0,Math.min(100,Ee[rt][1]));const St=Ee[rt][0]/100*X.width,ts=Ee[rt][1]/100*X.height,bs=v.value.find(ls=>ls.id===`${f.value[O.value].name}-${rt}`);bs==null||bs.setPosition(St,ts)}E.x=pe,E.y=le},J=()=>{setTimeout(()=>{I=!1},100)},j=()=>{!f.value.length||O.value===-1||(f.value[O.value].isPrivacyMask=!f.value[O.value].isPrivacyMask)},ie=()=>{f.value[O.value]&&(f.value[O.value].filter=f.value[O.value].filter==="include"?"exclude":"include")},ue=()=>{f.value[O.value]&&(f.value[O.value].type=f.value[O.value].type==="intersect"?"contain":"intersect")},Se=U=>{if(!b.value||I)return;const X=z.value!==void 0?z.value:f.value.length,fe=Math.min(Math.max(Math.round((U.offsetX-10)/N.width.value*100),0),100),ye=Math.min(Math.max(Math.round((U.offsetY-10)/N.height.value*100),0),100);if(z.value===void 0){const pe=`zone-${Date.now()}`;f.value.push({name:pe,points:[],filter:"include",type:"contain",classes:["animal","motion","person","vehicle"],isPrivacyMask:!1,color:Je()}),z.value=f.value.length-1}f.value[X].points.push([fe,ye]),H(),Zs(()=>{const pe=f.value[X].points.length-1;F({_id:`${f.value[X].name}-${pe}`,zoneIndex:X,pointIndex:pe,point:[fe,ye]})})},F=U=>{var fe;if(U.zoneIndex===void 0||U.pointIndex===void 0)return;const X=(fe=u.value)==null?void 0:fe.filter(ye=>ye.dataset.pointIndex===U.pointIndex.toString()&&ye.dataset.zoneIndex===U.zoneIndex.toString());!X||X.length===0||ct(X[0],U.point)},q=U=>{if(!f.value.length)return;const X=Math.round(U.point[0]/N.width.value*100),fe=Math.round(U.point[1]/N.height.value*100);f.value[U.zoneIndex].points[U.pointIndex]=[X,fe]},Y=()=>{b.value=!0,z.value=void 0},Te=U=>{var fe;if(z.value===void 0){b.value=!1;return}b.value=U||!1;const X=z.value;!f.value[X]||!f.value[X].points||(f.value[X].points.length<3?(f.value.splice(X,1),H()):((fe=u.value)==null||fe.forEach(ye=>De(ye)),O.value=X),z.value=void 0)},He=()=>{b.value=!0,z.value=O.value},pt=()=>{O.value===-1||!f.value.length||(f.value.splice(O.value,1),O.value=Math.max(-1,O.value-1),H(),Zs(()=>{Kt()}))},ft=()=>{var U;if((U=f.value)!=null&&U.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),H());return}f.value.length>0&&(f.value.pop(),H(),Zs(()=>{Kt()}))}},Ge=()=>{I=!1,b.value=!1,z.value=void 0,f.value&&(f.value.length=0,k.value=[],Zs(()=>{vt()}))},Je=()=>{const U=Math.floor(Math.random()*256),X=Math.floor(Math.random()*256),fe=Math.floor(Math.random()*256);return"#"+[U,X,fe].map(ye=>ye.toString(16).padStart(2,"0")).join("")},de=U=>{if(!U||!U.length)return"";const X=U.map(ye=>{const pe=Math.round(ye[0]/100*N.width.value),le=Math.round(ye[1]/100*N.height.value);return`${pe+10},${le+10}`});if(X.length===0)return"";let fe=`M ${X[0]}`;for(let ye=1;ye<X.length;ye++)fe+=` L ${X[ye]}`;return fe+=" Z",fe},xt=U=>{b.value||(O.value=U)},Kt=()=>{var U;vt(),(U=u.value)==null||U.forEach(X=>{if(!X.dataset.zoneIndex||!X.dataset.pointIndex)return;const fe=parseInt(X.dataset.zoneIndex),ye=parseInt(X.dataset.pointIndex);if(!f.value[fe]||!f.value[fe].points[ye])return;const pe=f.value[fe].points[ye];pe&&(ct(X,pe),De(X))})},vt=()=>{v.value.forEach(U=>U.destroy()),v.value=[]},jt=U=>{!f.value.length||!f.value[U.zoneIndex]||f.value[U.zoneIndex].points.length<4||(f.value[U.zoneIndex].points.splice(U.pointIndex,1),H(),Zs(()=>{Kt()}))},ct=(U,X)=>{Object.assign(U.style,gt(X))},gt=U=>({left:Math.round(U[0]/100*N.width.value)+"px",top:Math.round(U[1]/100*N.height.value)+"px"}),De=U=>{U.classList.add("draggable");const X=new Yh(U,{containment:!0,grid:[0,0]}).on("pointerDown",()=>{var fe;(fe=document.querySelectorAll(`[data-point="${U.dataset.zoneIndex}-${U.dataset.pointIndex}"]`)[0])==null||fe.classList.add("changing")}).on("dragMove",()=>{if(!U.dataset.zoneIndex||!U.dataset.pointIndex||!U.dataset.id)return;const fe=X.position.x,ye=X.position.y;q({_id:U.dataset.id,point:[fe,ye],pointIndex:parseInt(U.dataset.pointIndex),zoneIndex:parseInt(U.dataset.zoneIndex)})}).on("pointerUp",()=>{document.querySelectorAll(".point").forEach(fe=>fe.classList.remove("changing"))});X.id=U.dataset.id,v.value.push(X)},ht=async()=>{if(f.value.length)try{const U=await Dx.parse(f.value);if(!U.value)return n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",U.errors),null;await D({cameraname:a.value,zoneData:f.value})}catch(U){return console.error("Error saving zones:",U),n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.save_failed"),life:3e3}),null}};return Sn(async()=>{var U;setTimeout(()=>{Kt()}),(U=f.value)!=null&&U.length&&(O.value=0)}),e({isLoading:A,onConfirm:ht}),(U,X)=>{var ve,Ce,nt,Ft,Zt,Xe,xe,Ne,Fe;const fe=Ap,ye=Dh,pe=go,le=ki,ge=O0,Ie=Aa,Ee=w4,Ue=ys,rt=_p,St=_4,ts=f4,bs=h4,ls=l4,os=o4,Cs=n4,hs=e4,Be=J3,us=Z3,V=H3,ne=jr;return m(),M("div",Bx,[g("div",zx,[g("div",Ux,[g("div",{ref_key:"outsideRef",ref:d},null,512),g("div",Vx,[g("div",Hx,[g("div",Qx,[g("div",Kx,[g("section",{class:at(["playground w-full h-full",c(B)]),onClick:Se},[g("div",Zx,[g("div",Gx,[(m(!0),M(Ct,null,zt(c(k),_e=>(m(),M("div",{key:_e._id,ref_for:!0,ref_key:"draggablesRef",ref:u,class:"handle","data-id":_e._id,"data-point":`${_e.zoneIndex}-${_e.pointIndex}`,"data-point-index":_e.pointIndex,"data-zone-index":_e.zoneIndex,onDblclick:lr(it=>jt(_e),["prevent"])},X[3]||(X[3]=[g("div",{class:"delete-point"},null,-1)]),40,Wx))),128)),g("div",Jx,[(m(),M("svg",Yx,[(m(!0),M(Ct,null,zt(c(f),(_e,it)=>(m(),M("path",{key:_e.name,d:de(_e.points),class:at(["cursor-pointer",{dash:_e.type==="intersect"&&!_e.isPrivacyMask,selected:c(O)===it}]),style:ot({fill:_e.isPrivacyMask?"rgba(16, 16, 16, 0.9)":_e.filter==="exclude"?"transparent":`${_e.color}4D`,stroke:_e.isPrivacyMask?"#333333":_e.color,"stroke-width":"2"}),onClick:_=>xt(it),onDblclick:()=>_e.isPrivacyMask=!_e.isPrivacyMask,onMousedown:_=>w(_,it),onMousemove:Q,onMouseup:J,onTouchstart:_=>w(_,it),onTouchmove:Q,onTouchend:J},null,46,Xx))),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(fe,{"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",eS,[y(c(Dt),{"model-value":(ve=c(f)[c(O)])==null?void 0:ve.classes,name:`zone[${c(O)}].classes`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:_e,errors:it})=>[g("label",{for:`zone[${c(O)}].classes`,class:"cui-label"},he(U.$t("components.form.label.classes")),9,tS),y(pe,null,{default:$(()=>{var _,x;return[y(ye,tt(_e,{"model-value":(_=c(f)[c(O)])==null?void 0:_.classes,options:c(W),disabled:(x=c(f)[c(O)])==null?void 0:x.isPrivacyMask,invalid:it.length>0,loading:c(A),"max-selected-labels":2,"show-toggle-all":!1,"show-clear":"",type:"text",onValueChange:X[0]||(X[0]=S=>c(f)[c(O)].classes=S)}),null,16,["model-value","options","disabled","invalid","loading"])]}),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`zone[${c(O)}].classes`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),y(c(Dt),{"model-value":(Ce=c(f)[c(O)])==null?void 0:Ce.color,name:`zone[${c(O)}].color`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:_e,errors:it})=>[g("label",{for:`zone[${c(O)}].color`,class:"cui-label"},he(U.$t("components.form.label.color")),9,sS),y(pe,null,{default:$(()=>{var _;return[y(le,tt(_e,{disabled:(_=c(f)[c(O)])==null?void 0:_.isPrivacyMask,invalid:it.length>0,loading:c(A),readonly:"",type:"text"}),null,16,["disabled","invalid","loading"]),y(Ie,null,{default:$(()=>{var x,S;return[(m(),L(ge,{key:c(O),"model-value":(x=c(f)[c(O)])==null?void 0:x.color,format:"hex",disabled:(S=c(f)[c(O)])==null?void 0:S.isPrivacyMask,onValueChange:X[1]||(X[1]=P=>P?c(f)[c(O)].color=`#${P}`:null)},null,8,["model-value","disabled"]))]}),_:1})]}),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`zone[${c(O)}].color`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),g("div",nS,[c(b)?It((m(),L(Ue,{key:1,disabled:c(z)!==void 0&&((Ft=(nt=c(f)[c(z)])==null?void 0:nt.points)==null?void 0:Ft.length)<3,loading:c(A),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:X[2]||(X[2]=_e=>Te(!1))},{icon:$(()=>[y(rt,{width:"20px",height:"20px"})]),_:1},8,["disabled","loading"])),[[ne,{value:U.$t("components.form.tooltip.finish")},void 0,{top:!0}]]):It((m(),L(Ue,{key:0,loading:c(A),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Y},{icon:$(()=>[y(Ee,{width:"20px",height:"20px"})]),_:1},8,["loading"])),[[ne,{value:U.$t("components.form.tooltip.new")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length||c(O)<0||c(b),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:He},{icon:$(()=>[y(St,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.edit")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length||c(O)<0,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:pt},{icon:$(()=>[y(ts,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.delete")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ft},{icon:$(()=>[y(bs,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.undo")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Ge},{icon:$(()=>[y(ls,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.clear")},void 0,{top:!0}]])]),g("div",rS,[It((m(),L(Ue,{loading:c(A),disabled:!(c(f).length&&c(O)>=0&&c(f)[c(O)]),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:j},{icon:$(()=>{var _e;return[(_e=c(f)[c(O)])!=null&&_e.isPrivacyMask?(m(),L(os,{key:0,width:"20px",height:"20px"})):(m(),L(Cs,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[ne,{value:(Zt=c(f)[c(O)])!=null&&Zt.isPrivacyMask?U.$t("components.form.tooltip.privacy_mask"):U.$t("components.form.tooltip.public_mask")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:(Xe=c(f)[c(O)])==null?void 0:Xe.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ie},{icon:$(()=>{var _e;return[((_e=c(f)[c(O)])==null?void 0:_e.filter)==="include"?(m(),L(hs,{key:0,width:"20px",height:"20px"})):(m(),L(Be,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[ne,{value:((xe=c(f)[c(O)])==null?void 0:xe.filter)==="include"?U.$t("components.form.tooltip.include"):U.$t("components.form.tooltip.exclude")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:(Ne=c(f)[c(O)])==null?void 0:Ne.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ue},{icon:$(()=>{var _e;return[((_e=c(f)[c(O)])==null?void 0:_e.type)==="intersect"?(m(),L(us,{key:0,width:"20px",height:"20px"})):(m(),L(V,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[ne,{value:((Fe=c(f)[c(O)])==null?void 0:Fe.type)==="intersect"?U.$t("components.form.tooltip.intersect"):U.$t("components.form.tooltip.contain")},void 0,{top:!0}]])])])])])])])}}}),oS=qs(iS,[["__scopeId","data-v-51a8517c"]]),aS={class:"text-color font-normal"},cS={class:"flex flex-col gap-6"},lS={for:"name",class:"cui-label"},uS={for:"type",class:"cui-label"},dS={class:"flex items-center gap-4"},hS={class:"flex flex-col field-switch-gap"},mS={for:"disabled",class:"cui-label-switch"},pS={class:"text-color font-normal"},fS={class:"flex flex-col gap-6"},gS={for:"info.manufacturer",class:"cui-label"},vS={for:"info.model",class:"cui-label"},_S={for:"info.hardware",class:"cui-label"},yS={for:"info.serialNumber",class:"cui-label"},bS={for:"info.firmwareVersion",class:"cui-label"},wS={for:"info.supportUrl",class:"cui-label"},xS={class:"text-color font-normal"},SS={class:"flex flex-col gap-6"},CS={for:"interface.streamingMode",class:"cui-label"},kS={for:"interface.streamingSource",class:"cui-label"},ES={for:"interface.aspectRatio",class:"cui-label"},AS={class:"text-color font-normal"},MS={class:"flex flex-col gap-6"},$S={for:"detectionSettings.motion.timeout",class:"cui-label"},PS={for:"detectionSettings.object.confidence",class:"cui-label"},TS={class:"text-color font-normal"},RS={class:"flex flex-col gap-6 w-full items-center justify-center"},IS={class:"text-color font-normal"},OS={class:"flex flex-col gap-6"},NS={for:"snapshotTTL",class:"cui-label"},FS={class:"text-color font-normal"},LS={class:"flex flex-col gap-6"},jS={for:"frameWorkerSettings.decoder",class:"cui-label"},qS={for:"frameWorkerSettings.resolution",class:"cui-label"},DS={for:"frameWorkerSettings.fps",class:"cui-label"},BS=Tt({__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}=Jt(u),v=oe(["camera","doorbell"]),f=oe(["auto","mse","webrtc","webrtc/tcp"]),b=oe(["auto","high-resolution","mid-resolution","low-resolution"]),k=oe(["16:9","8:3","4:3","auto"]),z=oe(["pillow","wasm","rust","gpu"]),O=oe(["640x480","640x360","320x240","320x180"]),{mutateAsync:te,isPending:W}=t.removeCameraQuery(),I=se(()=>h.value||W.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 te({cameraname:d.value.name}),n.path.includes(d.value.name)&&r.push({path:"/cameras"}),l("close")}catch{}}})},N=(D=[])=>{i.openComponentDialog(oS,{data:{title:o("components.zone_editor.edit_zones"),loading:I,contentProps:{cameraName:d.value.name,zones:D}}})};return(D,C)=>{const A=Jc,B=ki,H=go,R=Zc,w=Kc,Q=fo,J=ys,j=Yc,ie=Wc,ue=qh,Se=Gc;return m(),L(Se,{multiple:"",class:"p-4"},{default:$(()=>[y(ie,{value:"general"},{default:$(()=>[y(A,{class:"px-0 pt-0"},{default:$(()=>[g("span",aS,he(D.$t("components.camera_options.general")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",cS,[y(c(Dt),{modelValue:a.value.name,"onUpdate:modelValue":C[0]||(C[0]=F=>a.value.name=F),modelModifiers:{trim:!0},name:"name",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",lS,he(D.$t("components.form.label.name")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"name",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{"model-value":a.value.type,name:"type",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",uS,he(D.$t("components.form.label.type")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.type,options:c(v),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[1]||(C[1]=Y=>a.value.type=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"type",class:"cui-input-error"})]),_:1})]),_:1},8,["model-value"]),y(c(Dt),{"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:q})=>[g("div",dS,[g("div",hS,[g("label",mS,he(D.$t("components.form.label.disabled")),1),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.disable_camera")),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"disabled",class:"cui-input-switch-error"})]),_:1})]),y(Q,tt({"model-value":a.value.disabled},F,{invalid:q.length>0,loading:c(I),class:"ml-auto shrink-0",onValueChange:C[2]||(C[2]=Y=>a.value.disabled=Y)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value"]),y(J,{fluid:"",severity:"danger",loading:c(I),class:"cui-button-medium",label:D.$t("components.form.button.remove"),onClick:C[3]||(C[3]=F=>E())},null,8,["loading","label"])])]),_:1})]),_:1}),y(ie,{value:"branding"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",pS,he(D.$t("components.camera_options.branding")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",fS,[y(c(Dt),{modelValue:a.value.info.manufacturer,"onUpdate:modelValue":C[4]||(C[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:q})=>[g("label",gS,he(D.$t("components.form.label.manufacturer")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.manufacturer",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.model,"onUpdate:modelValue":C[5]||(C[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:q})=>[g("label",vS,he(D.$t("components.form.label.model")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.model",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.hardware,"onUpdate:modelValue":C[6]||(C[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:q})=>[g("label",_S,he(D.$t("components.form.label.hardware_version")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.hardware",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.serialNumber,"onUpdate:modelValue":C[7]||(C[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:q})=>[g("label",yS,he(D.$t("components.form.label.serial_number")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.serialNumber",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.firmwareVersion,"onUpdate:modelValue":C[8]||(C[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:q})=>[g("label",bS,he(D.$t("components.form.label.firmware_version")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.firmwareVersion",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.supportUrl,"onUpdate:modelValue":C[9]||(C[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:q})=>[g("label",wS,he(D.$t("components.form.label.support_url")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.supportUrl",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])])]),_:1})]),_:1}),y(ie,{value:"interface"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",xS,he(D.$t("components.camera_options.interface")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",SS,[y(c(Dt),{"model-value":a.value.interface.streamingMode,name:"interface.streamingMode",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",CS,he(D.$t("components.form.label.streaming_mode")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.interface.streamingMode,options:c(f),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[10]||(C[10]=Y=>a.value.interface.streamingMode=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"interface.streamingMode",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.streaming_mode")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.interface.streamingSource,name:"interface.streamingSource",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",kS,he(D.$t("components.form.label.streaming_source")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.interface.streamingSource,options:c(b),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[11]||(C[11]=Y=>a.value.interface.streamingSource=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"interface.streamingSource",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.streaming_source")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.interface.aspectRatio,name:"interface.aspectRatio",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",ES,he(D.$t("components.form.label.aspect_ratio")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.interface.aspectRatio,options:c(k),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[12]||(C[12]=Y=>a.value.interface.aspectRatio=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"interface.aspectRatio",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.aspect_ratio")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(ie,{value:"detection"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",AS,he(D.$t("components.camera_options.detection")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",MS,[y(c(Dt),{"model-value":a.value.detectionSettings.motion.timeout,name:"detectionSettings.motion.timeout",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",$S,he(D.$t("components.form.label.motion_duration")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.detectionSettings.motion.timeout},F,{invalid:q.length>0,loading:c(I),"show-buttons":"","use-grouping":!1,onValueChange:C[13]||(C[13]=Y=>a.value.detectionSettings.motion.timeout=Y),onInput:C[14]||(C[14]=Y=>a.value.detectionSettings.motion.timeout=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"detectionSettings.motion.timeout",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.motion_duration")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.detectionSettings.object.confidence,name:"detectionSettings.object.confidence",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",PS,he(D.$t("components.form.label.confidence")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.detectionSettings.object.confidence},F,{invalid:q.length>0,loading:c(I),"show-buttons":"",step:.01,max:1,mode:"decimal","use-grouping":!1,onValueChange:C[15]||(C[15]=Y=>a.value.detectionSettings.object.confidence=Y),onInput:C[16]||(C[16]=Y=>a.value.detectionSettings.object.confidence=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"detectionSettings.object.confidence",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.confidence")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(ie,{value:"zones"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",TS,he(D.$t("components.camera_options.zones")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",RS,[y(J,{fluid:"",class:"cui-button-medium",loading:c(I),label:D.$t("components.form.button.edit_zones"),onClick:C[17]||(C[17]=F=>N(c(d).detectionZones))},null,8,["loading","label"])])]),_:1})]),_:1}),y(ie,{value:"snapshot"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",IS,he(D.$t("components.camera_options.snapshot")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",OS,[y(c(Dt),{"model-value":a.value.snapshotTTL,name:"snapshotTTL",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",NS,he(D.$t("components.form.label.cache_time")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.snapshotTTL},F,{invalid:q.length>0,loading:c(I),"show-buttons":"","use-grouping":!1,onValueChange:C[18]||(C[18]=Y=>a.value.snapshotTTL=Y),onInput:C[19]||(C[19]=Y=>a.value.snapshotTTL=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"snapshotTTL",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.cache_time")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(ie,{value:"frameworker"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",FS,he(D.$t("components.camera_options.frame_worker")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",LS,[y(c(Dt),{"model-value":a.value.frameWorkerSettings.decoder,name:"frameWorkerSettings.decoder",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",jS,he(D.$t("components.form.label.decoder")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.frameWorkerSettings.decoder,options:c(z),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[20]||(C[20]=Y=>a.value.frameWorkerSettings.decoder=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"frameWorkerSettings.decoder",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.frameworker_decoder")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.frameWorkerSettings.resolution,name:"frameWorkerSettings.resolution",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",qS,he(D.$t("components.form.label.resolution")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.frameWorkerSettings.resolution,options:c(O),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[21]||(C[21]=Y=>a.value.frameWorkerSettings.resolution=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"frameWorkerSettings.resolution",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.frameworker_resolution")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.frameWorkerSettings.fps,name:"frameWorkerSettings.fps",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",DS,he(D.$t("components.form.label.fps")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.frameWorkerSettings.fps},F,{invalid:q.length>0,loading:c(I),min:0,"show-buttons":"","use-grouping":!1,onValueChange:C[22]||(C[22]=Y=>a.value.frameWorkerSettings.fps=Y),onInput:C[23]||(C[23]=Y=>a.value.frameWorkerSettings.fps=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"frameWorkerSettings.fps",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.frameworker_fps")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})}}}),zS={class:"relative"},US=Tt({__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}=Jt(t),d=Qt("buttonRef"),h=oe(!1),v=ri(d);let f;const b=se(()=>({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,O)=>{const te=ys;return m(),M("div",{ref_key:"buttonRef",ref:d,class:"relative"},[y(te,tt(c(o),{label:c(r),onClick:k}),Qh({_:2},[c(i)?{name:"icon",fn:$(()=>[g("div",zS,[(m(),L(Ai(c(i))))])]),key:"0"}:void 0]),1040,["label"]),(m(),L(Kh,{to:"body"},[y(Pt,{name:"fade"},{default:$(()=>[c(h)?(m(),L(te,tt({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"])):ae("",!0)]),_:1})]))],512)}}}),VS={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function HS(s,e){return m(),M("svg",VS,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 Fh=me({name:"fluent-copy-16-filled",render:HS}),QS={class:"flex flex-col field-gap"},KS={class:"cui-label"},ZS={class:"cui-label"},GS={class:"cui-label"},WS={key:0,class:"flex flex-col field-gap"},JS={class:"cui-label"},YS={key:1,class:"flex flex-col field-gap"},XS={class:"cui-label"},e7=Tt({__name:"CameraSource",props:{cameraName:{},source:{},loading:{type:Boolean}},setup(s){const e=new Jn,t=s,{cameraName:n,source:r,loading:i}=Jt(t),{data:o,isFetching:a}=e.probeCameraSourceQuery(n.value,r.value.name,{video:!0,audio:!0,microphone:!0}),{copy:l}=af({legacy:!0}),u=se(()=>!!(i.value||a.value)),d=se(()=>{var f;return((f=o.value)==null?void 0:f.probe.consumers.filter(b=>b.format_name!=="probe").length)||0}),h=se(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(O=>O.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(O=>O.codec.codec_type==="video");return(b==null?void 0:b.map(O=>O.codec.codec_name))||[]}),v=se(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(O=>O.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(O=>O.codec.codec_type==="audio");return(b==null?void 0:b.map(O=>O.codec.codec_name))||[]});return(f,b)=>{const k=ki,z=go,O=US,te=Aa;return m(),M(Ct,null,[g("div",QS,[g("label",KS,he(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),M(Ct,null,zt(c(h),(W,I)=>(m(),M("div",{key:I,class:"flex flex-col field-gap"},[g("label",ZS,he(f.$t("components.form.label.video_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":W,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),(m(!0),M(Ct,null,zt(c(v),(W,I)=>(m(),M("div",{key:I,class:"flex flex-col field-gap"},[g("label",GS,he(f.$t("components.form.label.audio_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":W,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),c(r).role!=="snapshot"?(m(),M("div",WS,[g("label",JS,he(f.$t("components.form.label.rtsp_url")),1),y(z,null,{default:$(()=>{var W;return[y(k,{"model-value":(W=c(o))==null?void 0:W.rtspUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(te,null,{default:$(()=>{var I;return[y(O,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Fh),"button-props":{severity:"secondary",disabled:!((I=c(o))!=null&&I.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})])):ae("",!0),c(r).role!=="snapshot"?(m(),M("div",YS,[g("label",XS,he(f.$t("components.form.label.onvif_url")),1),y(z,null,{default:$(()=>{var W;return[y(k,{"model-value":(W=c(o))==null?void 0:W.onvifUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(te,null,{default:$(()=>{var I;return[y(O,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Fh),"button-props":{severity:"secondary",disabled:!((I=c(o))!=null&&I.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})])):ae("",!0)],64)}}}),t7={class:"flex gap-2 items-center w-full"},s7={class:"text-color font-normal"},n7={class:"flex flex-col gap-6"},r7=["for"],i7=["for"],o7={class:"flex items-center gap-4"},a7={class:"flex flex-col field-switch-gap"},c7=["for"],l7={class:"flex items-center gap-4"},u7={class:"flex flex-col field-switch-gap"},d7=["for"],h7={class:"flex flex-col gap-6"},m7=["for"],p7={class:"w-full flex items-center justify-center my-3"},f7=Tt({__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}=Jt(n),o=oe(["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,O=go,te=e7,W=Zc,I=Kc,E=fo,N=Aa,D=Yc,C=Wc,A=Gc,B=wp;return m(),M(Ct,null,[y(A,{multiple:"",class:"p-4"},{default:$(()=>[(m(!0),M(Ct,null,zt(t.value.sources,(H,R)=>(m(),L(C,{key:R,value:R},{default:$(()=>[y(k,{class:at({"px-0 pt-0":R===0,"px-0":R!==0})},{default:$(()=>[g("div",t7,[g("span",s7,he(h.$t("components.camera_options.source")+": "+H.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(R)},{icon:$(()=>[y(f,{width:"100%",height:"100%"})]),_:2},1032,["loading","disabled","onClick"])])]),_:2},1032,["class"]),y(D,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",n7,[y(c(Dt),{modelValue:H.name,"onUpdate:modelValue":w=>H.name=w,modelModifiers:{trim:!0},name:`sources[${R}].name`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("label",{for:`sources[${R}].name`,class:"cui-label"},he(h.$t("components.form.label.source_name")),9,r7),y(O,null,{default:$(()=>[y(z,tt({ref_for:!0},w,{invalid:Q.length>0,loading:c(i),readonly:c(r).sources.some(J=>J.name===H.name),type:"text"}),null,16,["invalid","loading","readonly"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].name`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),H._id?(m(),L(te,{key:0,"camera-name":c(r).name,source:H,loading:c(i)},null,8,["camera-name","source","loading"])):ae("",!0),y(c(Dt),{"model-value":H.role,name:`sources[${R}].role`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("label",{for:`sources[${R}].role`,class:"cui-label"},he(h.$t("components.form.label.source_role")),9,i7),y(O,null,{default:$(()=>[y(W,tt({"model-value":H.role,ref_for:!0},w,{options:c(o).filter(J=>!t.value.sources.some(j=>j.role===J&&j._id!==H._id)),invalid:Q.length>0,loading:c(i),onValueChange:J=>H.role=J}),null,16,["model-value","options","invalid","loading","onValueChange"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].role`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["model-value","name"]),H.role!=="snapshot"&&t.value.sources.length>1&&!t.value.sources.some(w=>(w.useForSnapshot||w.role==="snapshot")&&w._id!==H._id)?(m(),L(c(Dt),{key:1,"model-value":H.useForSnapshot,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${R}].useForSnapshot`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("div",o7,[g("div",a7,[g("label",{for:`sources[${R}].useForSnapshot`,class:"cui-label-switch"},he(h.$t("components.form.label.use_for_snapshot")),9,c7),y(I,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(h.$t("components.form.hint.use_for_snapshot")),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].useForSnapshot`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,tt({"model-value":H.useForSnapshot,ref_for:!0},w,{invalid:Q.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>H.useForSnapshot=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ae("",!0),H.role!=="snapshot"?(m(),L(c(Dt),{key:2,"model-value":H.hotMode,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${R}].hotMode`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("div",l7,[g("div",u7,[g("label",{for:`sources[${R}].hotMode`,class:"cui-label-switch"},he(h.$t("components.form.label.hot_mode")),9,d7),y(I,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(h.$t("components.form.hint.hot_mode")),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].hotMode`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,tt({"model-value":H.hotMode,ref_for:!0},w,{invalid:Q.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>H.hotMode=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ae("",!0),g("div",h7,[g("label",{for:`sources[${R}].urls[]`,class:"cui-label"},he(h.$t("components.form.label.sources")),9,m7),(m(!0),M(Ct,null,zt(H.urls,(w,Q)=>(m(),L(c(Dt),{key:Q,modelValue:H.urls[Q],"onUpdate:modelValue":J=>H.urls[Q]=J,modelModifiers:{trim:!0},name:`sources[${R}].urls[${Q}]`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:J,errors:j})=>[y(O,null,{default:$(()=>[y(z,tt({ref_for:!0},J,{invalid:j.length>0,loading:c(i),type:"text"}),null,16,["invalid","loading"]),H.urls.length>1?(m(),L(N,{key:0},{default:$(()=>[y(b,{text:"",severity:"secondary",loading:c(i),onClick:ie=>u(R,Q)},{icon:$(()=>[y(f)]),_:2},1032,["loading","onClick"])]),_:2},1024)):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].urls[${Q}]`,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(R)},null,8,["loading","label","onClick"])])])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1}),g("div",p7,[y(b,{text:"",rounded:"",loading:c(i),class:"cui-icon-xl",onClick:d},{icon:$(()=>[y(B,{width:"100%",height:"100%"})]),_:1},8,["loading"])])],64)}}}),g7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v7(s,e){return m(),M("svg",g7,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 _7=me({name:"mdi-lightbulb-off",render:v7}),y7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b7(s,e){return m(),M("svg",y7,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 w7=me({name:"mdi-lightbulb-on",render:b7}),x7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function S7(s,e){return m(),M("svg",x7,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 C7=me({name:"flat-color-icons-empty-battery",render:S7}),k7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function E7(s,e){return m(),M("svg",k7,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 A7=me({name:"flat-color-icons-low-battery",render:E7}),M7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function $7(s,e){return m(),M("svg",M7,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 P7=me({name:"flat-color-icons-middle-battery",render:$7}),T7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function R7(s,e){return m(),M("svg",T7,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 I7=me({name:"flat-color-icons-high-battery",render:R7}),O7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function N7(s,e){return m(),M("svg",O7,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 F7=me({name:"flat-color-icons-full-battery",render:N7}),L7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function j7(s,e){return m(),M("svg",L7,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 q7=me({name:"flat-color-icons-charge-battery",render:j7}),D7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B7(s,e){return m(),M("svg",D7,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 z7=me({name:"mdi-cloud",render:B7}),U7={key:0,class:"flex items-center justify-center h-full"},V7={key:1},H7={class:"flex flex-col p-4"},Q7={class:"camera-info flex justify-between items-center text-sm"},K7={class:"font-bold"},Z7={class:"flex items-center gap-2"},G7={class:"camera-info flex justify-between items-center text-sm"},W7={class:"font-bold"},J7={class:"flex items-center"},Y7={key:0,class:"camera-info flex justify-between items-center text-sm"},X7={class:"font-bold"},eC={class:"flex items-center gap-2"},tC={key:0},sC={key:1,class:"camera-info flex justify-between items-center text-sm"},nC={class:"font-bold"},rC={class:"flex items-center"},iC={key:2,class:"camera-info flex justify-between items-center text-sm"},oC={class:"font-bold"},aC={class:"flex items-center"},cC={key:1},lC={key:2},uC={key:3,class:"camera-info flex justify-between items-center text-sm"},dC={class:"font-bold"},hC={class:"flex items-center"},mC={key:1},pC={key:2},fC={key:4,class:"camera-info flex justify-between items-center text-sm"},gC={class:"font-bold"},vC={class:"flex items-center"},_C={key:1},yC={key:2},bC={key:5,class:"camera-info flex justify-between items-center text-sm"},wC={class:"font-bold"},xC={class:"flex items-center"},SC={key:1},CC={key:2},kC={key:6,class:"camera-info flex justify-between items-center text-sm"},EC={class:"font-bold"},AC={class:"flex items-center"},MC={key:1},$C={key:2},PC=Tt({__name:"Overview",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Fl,n=s,{cameraDevice:r,loading:i,latestSnapshotSrc:o}=Jt(n),{cameraObject:a,hasBattery:l,hasLight:u,hasAudioDetector:d,hasDoorbell:h,hasMotionDetector:v,hasObjectDetector:f,hasSiren:b,lightState:k,batteryState:z,motionState:O,objectState:te,audioState:W,doorbellState:I,sirenState:E}=jl(r),{data:N,isFetching:D}=t.getPluginsQuery({page:1,pageSize:-1}),C=se(()=>D.value||i.value);return(A,B)=>{var Y,Te,He,pt,ft,Ge,Je,de,xt,Kt,vt;const H=Lr,R=Ll,w=z7,Q=q7,J=F7,j=I7,ie=P7,ue=A7,Se=C7,F=w7,q=_7;return c(a)?(m(),M("div",V7,[y(R,{"camera-name":c(a).name,src:c(o),class:"w-full aspect-video bg-black","image-container-class":"w-full h-full"},null,8,["camera-name","src"]),g("div",H7,[g("div",Q7,[g("span",K7,he(A.$t("components.camera_options.name")),1),g("div",Z7,[g("span",null,he(c(a).name),1),c(a).isCloud?(m(),L(w,{key:0,class:"w-5 h-5"})):ae("",!0)])]),g("div",G7,[g("span",W7,he(A.$t("components.camera_options.plugin")),1),g("div",J7,[c(C)?(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"})):ae("",!0),g("span",null,he(c(a).pluginId!=="native"?((Te=(Y=c(N))==null?void 0:Y.result.find(jt=>jt.id===c(a).pluginId))==null?void 0:Te.pluginName)||A.$t("components.camera_options.unknown"):A.$t("components.camera_options.native")),1)])]),c(l)?(m(),M("div",Y7,[g("span",X7,he(A.$t("components.camera_options.battery_state")),1),g("div",eC,[c(z)!==void 0?(m(),M("span",tC,he(c(z).level)+"%",1)):ae("",!0),c(z)?c(z).charging?(m(),L(Q,{key:2,class:"w-5 h-5"})):c(z).level===100?(m(),L(J,{key:3,class:"w-5 h-5"})):c(z).level>=75?(m(),L(j,{key:4,class:"w-5 h-5"})):c(z).level>=50?(m(),L(ie,{key:5,class:"w-5 h-5"})):c(z).level>=25?(m(),L(ue,{key:6,class:"w-5 h-5"})):(m(),L(Se,{key:7,class:"w-5 h-5"})):(m(),L(H,{key:1,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(u)?(m(),M("div",sC,[g("span",nC,he(A.$t("components.camera_options.light_state")),1),g("div",rC,[c(k)?c(k).state?(m(),L(F,{key:1,class:"text-yellow-400 w-5 h-5"})):(m(),L(q,{key:2,class:"text-muted w-5 h-5"})):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(d)?(m(),M("div",iC,[g("span",oC,he(A.$t("components.camera_options.audio_state")),1),g("div",aC,[c(W)?c(W).state||(He=c(W).lastEvent)!=null&&He.state?(m(),M("span",cC,he(c(Bi)(c(W).state?c(W).timestamp:c(W).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",lC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(h)?(m(),M("div",uC,[g("span",dC,he(A.$t("components.camera_options.doorbell_state")),1),g("div",hC,[c(I)?c(I).state||(pt=c(I).lastEvent)!=null&&pt.state?(m(),M("span",mC,he(c(Bi)(c(I).state?c(I).timestamp:c(I).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",pC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(v)?(m(),M("div",fC,[g("span",gC,he(A.$t("components.camera_options.motion_state")),1),g("div",vC,[c(O)?c(O).state||(ft=c(O).detections)!=null&&ft.length||(Ge=c(O).lastEvent)!=null&&Ge.state||(de=(Je=c(O).lastEvent)==null?void 0:Je.detections)!=null&&de.length?(m(),M("span",_C,he(c(Bi)(c(O).state||(xt=c(O).detections)!=null&&xt.length?c(O).timestamp:c(O).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",yC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(f)?(m(),M("div",bC,[g("span",wC,he(A.$t("components.camera_options.object_state")),1),g("div",xC,[c(te)?c(te).detections.length||(Kt=c(te).lastEvent)!=null&&Kt.detections.length?(m(),M("span",SC,he(c(Bi)(c(te).detections.length?c(te).timestamp:c(te).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",CC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(b)?(m(),M("div",kC,[g("span",EC,he(A.$t("components.camera_options.siren_state")),1),g("div",AC,[c(E)?c(E).state||(vt=c(E).lastEvent)!=null&&vt.state?(m(),M("span",MC,he(c(Bi)(c(E).state?c(E).timestamp:c(E).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",$C,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0)])])):(m(),M("div",U7,[y(H,{"stroke-width":"5",class:"w-[30px] h-[30px]"})]))}}}),TC=qs(PC,[["__scopeId","data-v-50f1b706"]]),RC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IC(s,e){return m(),M("svg",RC,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 OC=me({name:"humbleicons-url",render:IC}),NC={class:"flex items-center w-full h-[45px] border-b-[1px] border-color px-3"},FC={class:"font-semibold text-lg truncate"},LC=["onClick"],jC={class:"text-xs truncate"},qC={class:"w-full h-full max-h-full overflow-y-scroll"},DC={key:0,class:"flex w-full h-full items-center justify-center mt-5"},BC={key:1,class:"w-full h-full"},zC={key:0,class:"w-full flex items-center justify-center p-4 h-[70px]"},UC=Tt({__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}=Jt(o),u=Qt("formRef"),d=Ls(),h=oe(),v=oe("overview"),f=oe([{name:"overview",icon:zc},{name:"sources",icon:OC},{name:"settings",icon:Sa},{name:"plugins",icon:Uc}]),{data:b,isFetching:k,suspense:z}=t.getCameraQuery(a),{mutate:O,isPending:te}=t.patchCameraQuery(),W=se(()=>k.value||te.value),I=se(()=>v.value==="sources"||v.value==="settings");Ze(b,N=>{N&&(h.value=xi(N))},{deep:!0,immediate:!0});const E=async()=>{var D;const N=await((D=u.value)==null?void 0:D.validate());N!=null&&N.valid&&N.values?O({cameraname:a.value,cameraData:N.values}):(n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",N))};return Sn(async()=>{if(await z(),!b.value)return;const N=await Ep();d.value=await N.deviceManager.getCamera(b.value.name)}),Ma(()=>{var N;(N=d.value)==null||N.close()}),(N,D)=>{const C=_o,A=ys,B=F0,H=N0,R=Lr,w=TC,Q=f7,J=BS,j=z3,ie=Vh,ue=Uh,Se=zh;return m(),M(Ct,null,[g("div",NC,[g("span",FC,he(c(a)),1),y(A,{text:"",rounded:"",severity:"secondary",class:"ml-auto cui-icon-md shrink-0",onClick:D[0]||(D[0]=F=>i("close"))},{icon:$(()=>[y(C,{width:"100%",height:"100%"})]),_:1})]),y(c(il),{ref_key:"formRef",ref:u,class:"w-full",style:ot({height:`calc(100% - 45px - ${c(I)?"70px":"0px"})`}),"validation-schema":c(qx)},{default:$(()=>[y(Se,{value:c(v),"onUpdate:value":D[7]||(D[7]=F=>ps(v)?v.value=F:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(H,{class:"justify-between",pt:{tablist:{class:"h-[65px]"},activeBar:{class:"!w-auto"}}},{default:$(()=>[(m(!0),M(Ct,null,zt(c(f),(F,q)=>(m(),L(B,{key:q,value:F.name,"as-child":""},{default:$(Y=>[g("div",tt({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(),L(Ai(F.icon),{class:"w-5 h-5"})),g("span",jC,he(N.$t(`components.options_sidebar.segment_tab_${F.name}`)),1)],16,LC)]),_:2},1032,["value"]))),128))]),_:1}),y(ue,{class:"p-0 h-[calc(100%-65px)]"},{default:$(()=>[g("div",qC,[(m(!0),M(Ct,null,zt(c(f),(F,q)=>(m(),L(ie,{key:q,value:F.name,"as-child":""},{default:$(Y=>[Y.active?(m(),M("div",tt({key:0,class:Y.class,ref_for:!0},Y.a11yAttrs),[!c(h)||!c(b)||!c(d)?(m(),M("div",DC,[y(R,{"stroke-width":"5",class:"w-[30px] h-[30px]"})])):(m(),M("div",BC,[c(v)==="overview"?(m(),L(w,{key:0,camera:c(b),"camera-device":c(d),loading:c(W),"latest-snapshot-src":c(l),onClose:D[1]||(D[1]=Te=>i("close"))},null,8,["camera","camera-device","loading","latest-snapshot-src"])):ae("",!0),c(v)==="sources"?(m(),L(Q,{key:1,modelValue:c(h),"onUpdate:modelValue":D[2]||(D[2]=Te=>ps(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(W),onClose:D[3]||(D[3]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ae("",!0),c(v)==="settings"?(m(),L(J,{key:2,modelValue:c(h),"onUpdate:modelValue":D[4]||(D[4]=Te=>ps(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(W),onClose:D[5]||(D[5]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ae("",!0),c(v)==="plugins"?(m(),L(j,{key:3,camera:c(b),"camera-device":c(d),loading:c(W),onClose:D[6]||(D[6]=Te=>i("close"))},null,8,["camera","camera-device","loading"])):ae("",!0)]))],16)):ae("",!0)]),_:2},1032,["value"]))),128))])]),_:1})]),_:1},8,["value"]),c(I)?(m(),M("div",zC,[y(A,{fluid:"",severity:"success",class:"cui-button-medium",label:N.$t("components.form.button.save"),onClick:E},null,8,["label"])])):ae("",!0)]),_:1},8,["style","validation-schema"])],64)}}}),VC={class:"w-full h-full p-safe !pb-0 md:!pl-0"},HC={class:"w-full h-full border-0 md:border-r-[1px] border-color overflow-y-auto pb-safe"},QC=Tt({__name:"CuiCameraDrawer",setup(s){const e=qr(),t=kp(),n=t.getEventBus(),r=oe(!1),i=oe(),o=oe(),a=se(()=>Cp.pt);Ze(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=UC,v=L0;return m(),L(v,tt({visible:c(r),"onUpdate:visible":d[0]||(d[0]=f=>ps(r)?r.value=f:null)},c(o),{class:"border-0 md:border-l-[1px]",pt:c(a),onHide:l}),{container:$(({closeCallback:f})=>[g("div",VC,[g("div",HC,[c(i)?(m(),L(h,tt({key:0},c(i),{onClose:f}),null,16,["onClose"])):ae("",!0)])])]),_:1},16,["visible","pt"])}}}),KC={class:"loader flex flex-col justify-center items-center"},ZC={key:0,class:"absolute flex flex-col items-center justify-center pb-safe bottom-10"},GC={key:0,class:"offline"},WC={key:1,class:"text-center text-white text-sm font-bold mt-2"},JC=Tt({__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}=Jt(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(),M("div",KC,[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(),M("div",ZC,[c(o)?(m(),M("div",GC,[(m(),L(Ai(c(o)),{class:"w-8 h-8 text-primary"}))])):ae("",!0),c(i)?(m(),M("div",WC,he(c(i)),1)):ae("",!0)])):ae("",!0)]))}}),YC=qs(JC,[["__scopeId","data-v-d2a6a09b"]]),XC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ek(s,e){return m(),M("svg",XC,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 3h8l-4 6h4L6 21l4-9H6z"},null,-1)]))}const tk=me({name:"gridicons-offline",render:ek}),sk={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_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"}}},nk={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_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"}}},rk={de:sk,en:nk},ik=["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"],ok=s=>{var t;const e=n=>ak(ik.find(r=>r===(n==null?void 0:n.toLowerCase())));return(t=window.navigator)!=null&&t.language?e(window.navigator.language):e("en")},ak=s=>{if(!s)return Ca;switch(s){case Mp.find(e=>e===s):return s;default:return Ca}},ck=df({locale:ok(),fallbackLocale:Ca,legacy:!1,globalInjection:!0,messages:rk}),lk={de:Mf,en:Af},uk=Mi("locale",()=>{const s=tl("locale",Ca),e=oe(Mp),t=$f(),n=js();Ze(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=lk[o];a&&(t.config.locale=a)};return r(s.value),i(s.value),{languages:e,locale:s,setI18Nlocale:r,setPrimeVueLocale:i}}),dk={key:1},hk=Tt({__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=mp(),v=Fs(),f=Pl(),{mdBreakpoint:b}=Vr(),{isPWA:k}=Ol(),{t:z}=js();uk();const{theme:O}=Vs(d),{routerLoading:te}=Vs(h),{isLoggedIn:W}=Vs(v),{isConnected:I}=Vs(f),E=Qt("navbarRef"),N=Qt("topbarRef"),D=Qt("bottombarRef"),C=oe(!0),A=oe(!0),B=Ls(),H=oe(!1),R=oe(!1),w=ri(E),Q=ri(N),J=ri(D);o.setDefaultOptions({queries:{refetchOnWindowFocus:!1,gcTime:5*60*1e3,staleTime:1e4,networkMode:"always",retry:(F,q)=>{var Y,Te,He;if(q instanceof uf&&((Y=q.response)==null?void 0:Y.status)===401)return Fs().logout(),!1;if(F===0){const pt=((He=(Te=q.response)==null?void 0:Te.data)==null?void 0:He.message)??q.message??q;u.add({severity:"error",summary:z("components.toast.title_error"),detail:pt,life:3e3}),console.error(pt)}return F<2}},mutations:{retry:0,networkMode:"always",onError:F=>{var Y,Te,He,pt;const q=((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:q,life:3e3}),console.error(((pt=(He=F.response)==null?void 0:He.data)==null?void 0:pt.message)??F.message??F)}}});const j=se(()=>{var Y,Te;let F="var(--ground-background)";const q=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)":q&&(F=q),F}),ie=se(()=>{var Y,Te;const F=N.value?`${Q.height.value}px`:"env(safe-area-inset-top, 0px)",q=D.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} - ${q})`:`calc(100dvh - ${F} - ${q})`}),ue=se(()=>{var F;return((F=a.meta.auth)==null?void 0:F.requiresAuth)&&!W.value||C.value});Ze(A,(F,q)=>{q===!1&&F===!0&&o.refetchQueries()}),Ze(W,F=>{F?B.value=f.connect():(B.value=void 0,f.disconnect())},{immediate:!0}),Ze(I,F=>{W.value?A.value=F:A.value=!0}),Ze(te,F=>{const{isLoading:q}=cf(0,{parent:"body"});q.value=F},{immediate:!0}),Ze([j,O],()=>{Zs(()=>{var q,Y;if(/^var\([^)]+\)$/.test(j.value)){const Te=window.getComputedStyle(document.body),He=j.value.split("var(")[1].split(")")[0],pt=Te.getPropertyValue(He);(q=document.querySelector('meta[name="theme-color"]'))==null||q.setAttribute("content",pt)}else(Y=document.querySelector('meta[name="theme-color"]'))==null||Y.setAttribute("content",j.value)})},{immediate:!0}),Ze(a,F=>{var q,Y;Xs((Y=(q=F.meta.ui)==null?void 0:q.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"]'),q=F!==null&&F.getAttribute("content")==="true";H.value=window.electron!==void 0,R.value=q,setTimeout(()=>{H.value=window.electron!==void 0,R.value=q},100)};return Sn(async()=>{await l.isReady(),C.value=!1,Se()}),(F,q)=>{var vt,jt,ct,gt,De,ht,U,X,fe,ye,pe;const Y=YC,Te=j0,He=q0,pt=D0,ft=QC,Ge=X5,Je=jb,de=Ob,xt=Ei("RouterView"),Kt=e1;return c(ue)||!c(A)?(m(),M("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(A)&&c(W)?c(tk):void 0},null,8,["icon"])],4)):(m(),M("div",dk,[y(Te,{position:"bottom-right"}),y(He),y(pt),y(ft),c(i)?(m(),L(Ge,{key:0,ref_key:"topbarRef",ref:N,style:ot({left:c(b)?"0px":`${c(w).width.value}px`}),class:"z-2 top-0"},null,8,["style"])):ae("",!0),c(n)?(m(),L(Je,{key:1,ref_key:"bottombarRef",ref:D,class:"z-2"},null,512)):ae("",!0),c(r)?(m(),L(de,{key:2,ref_key:"navbarRef",ref:E,class:"z-3 top-0 left-0"},null,512)):ae("",!0),g("main",{id:"container",class:"relative w-dvw z-1",style:ot({paddingTop:c(N)?`${c(Q).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(D)?`${c(J).height.value}px`:("toValue"in F?F.toValue:c(Xs))((jt=(vt=F.$route.meta.ui)==null?void 0:vt.containerSettings)==null?void 0:jt.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))((gt=(ct=F.$route.meta.ui)==null?void 0:ct.containerSettings)==null?void 0:gt.padding)}]),style:ot({minHeight:c(ie),maxHeight:("toValue"in F?F.toValue:c(Xs))((ht=(De=F.$route.meta.ui)==null?void 0:De.containerSettings)==null?void 0:ht.disableScroll)?c(ie):void 0,height:("toValue"in F?F.toValue:c(Xs))((X=(U=F.$route.meta.ui)==null?void 0:U.containerSettings)==null?void 0:X.disableScroll)?c(ie):void 0,overflow:("toValue"in F?F.toValue:c(Xs))((ye=(fe=F.$route.meta.ui)==null?void 0:fe.containerSettings)==null?void 0:ye.disableScroll)?"hidden":void 0})},[y(xt,{class:"w-full h-full relative overflow-x-hidden"})],6)],4),c(H)?(m(),L(Kt,{key:3})):ae("",!0),c(e)==="opened"||c(t)==="opened"&&c(b)?(m(),L(Kh,{key:4,to:c(e)==="opened"?"#app":"#container",defer:""},[c(b)?(m(),M("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)):ae("",!0)],8,["to"])):ae("",!0),g("div",{class:"fixed-bg",style:ot({background:("toValue"in F?F.toValue:c(Xs))((pe=F.$route.meta.ui)==null?void 0:pe.background)})},null,4)]))}}}),mk=qs(hk,[["__scopeId","data-v-6277ff0b"]]),pk=hf(),fk=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}"}}}}}}),gk=()=>{const s=Z0(mk);return s.directive("tooltip",jr),s.use(La).use(pk).use(ck).use(B0).use(z0).use(U0).use(Pf,{theme:{preset:fk,options:{cssLayer:{name:"primevue",order:"theme, base, primevue"},darkModeSelector:".dark-mode"}}}).use($0),s},vk=gk();vk.mount("#app");export{Bi as $,w4 as A,Nb as B,Jn as C,gp as D,m9 as E,fp as F,X6 as G,s8 as H,K8 as I,B8 as J,V8 as K,sx as L,p8 as M,X8 as N,px as O,dx as P,cx as Q,ix as R,Sa as S,W5 as T,T_ as U,B4 as V,A4 as W,C4 as X,_4 as Y,a9 as Z,Fa as _,Il as a,c9 as a0,Nl as a1,vs as a2,Oe as a3,Fl as a4,g2 as a5,w6 as a6,mh as a7,dh as a8,lh as a9,ph as aa,hh as ab,gh as ac,xp as ad,Ep as ae,Zm as af,A3 as ag,u9 as ah,md as ai,Uc as aj,$2 as ak,i9 as al,Rl as am,uo as an,h9 as ao,Gm as ap,o9 as aq,uk as ar,p9 as as,d9 as at,l9 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,v9 as k,g9 as l,l3 as m,wp as n,f9 as o,kp as p,Tl as q,I_ as r,R_ as s,ja as t,Fs as u,Eh as v,Ll 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{pd(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)pd(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}(),$m=Oa.EMPTY;function Pm(s){return s instanceof Oa||s&&"closed"in s&&Is(s.remove)&&Is(s.add)&&Is(s.unsubscribe)}function pd(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 Tm(s){ov.setTimeout(function(){throw s})}function fd(){}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,Pm(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){Tm(s)}var cv={closed:!0,next:fd,error:function(s){throw s},complete:fd},Pc=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Rm(s){return s}function lv(s){return s.length===0?Rm: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)&&Pm(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=gd(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=gd(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 gd(s){var e;return(e=s??iv.Promise)!==null&&e!==void 0?e:Promise}var uv=Mm(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 vd(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?$m:(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 vd(t,n)},e}(or),vd=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:$m},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),Im={now:function(){return(Im.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=Im);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,Tm)});if(function(o){return Symbol.asyncIterator&&Is(o==null?void 0:o[Symbol.asyncIterator])}(s))return _d(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 _d(function(o){return nv(this,arguments,function(){var a,l,u;return Am(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 _d(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 Am(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},O=function(){z(),d=v=void 0,b=k=!1},te=function(){var W=d;O(),W==null||W.unsubscribe()};return Ri(function(W,I){f++,k||b||z();var E=v=v??t();I.add(function(){--f!==0||k||b||(h=tc(te,l))}),E.subscribe(I),!d&&f>0&&(d=new io({next:function(N){return E.next(N)},error:function(N){k=!0,z(),h=tc(O,r,N),E.error(N)},complete:function(){b=!0,z(),h=tc(O,o),E.complete()}}),pa(W).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 Om(s,e,t){return t===void 0&&(t=1/0),Is(e)?Om(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,O=function(){!z||f.length||b||o.complete()},te=function(I){return b<l?W(I):f.push(I)},W=function(I){d&&o.next(I),b++;var E=!1;pa(a(I,k++)).subscribe(vi(o,function(N){u==null||u(N),d?te(N):o.next(N)},function(){E=!0},void 0,function(){if(E)try{b--;for(var N=function(){var D=f.shift();h?function(C,A,B,H,R){H===void 0&&(H=0),R===void 0&&(R=!1);var w=A.schedule(function(){B(),R?C.add(this.schedule(null,H)):this.unsubscribe()},H);C.add(w)}(o,h,function(){return W(D)}):W(D)};f.length&&b<l;)N();O()}catch(D){o.error(D)}}))};return i.subscribe(vi(o,te,function(){z=!0,O()})),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 yd(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 bd(s){return s[0]<s[2]&&s[1]<s[3]}function wd(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]))))]);bd(b)&&(u.boundingBox=b,u.confidence=d)}bd(u.boundingBox)&&i.push(u),r.add(u.id)}var a;return i}function xd(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!Nm(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 Nm(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 Sd=(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}},Cd=(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=Sd(l,i);if(xd(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=Sd(l,i),d=Nm(i.boundingBox,u.points),h=xd(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 st,Ko,Zo,Go,Wo,Jo,Yo,Xo,Rc,nr,Mn;class yv extends Xg{constructor(t,n){super();Yn(this,st);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(bt(this,st,Jo).call(this,{state:!1},!0)));p(this,"motionState",new gn(bt(this,st,Zo).call(this,{detections:[],state:!1},!0)));p(this,"audioState",new gn(bt(this,st,Ko).call(this,{state:!1,db:0},!0)));p(this,"objectState",new gn(bt(this,st,Go).call(this,{detections:[]},!0)));p(this,"doorbellState",new gn(bt(this,st,Wo).call(this,{state:!1},!0)));p(this,"sirenState",new gn(bt(this,st,Yo).call(this,{state:!1,level:0},!0)));p(this,"batteryState",new gn(bt(this,st,Xo).call(this,{level:100,charging:!1,lowBattery:!1},!0)));p(this,"capabilities",new gn([]));p(this,"onConnected",bt(this,st,Mn).call(this,this.cameraState));p(this,"onFrameWorkerConnected",bt(this,st,Mn).call(this,this.frameWorkerState));p(this,"onLightSwitched",bt(this,st,Mn).call(this,this.lightState));p(this,"onMotionDetected",bt(this,st,Mn).call(this,this.motionState));p(this,"onAudioDetected",bt(this,st,Mn).call(this,this.audioState));p(this,"onObjectDetected",bt(this,st,Mn).call(this,this.objectState));p(this,"onDoorbellPressed",bt(this,st,Mn).call(this,this.doorbellState));p(this,"onSirenDetected",bt(this,st,Mn).call(this,this.sirenState));p(this,"onBatteryChanged",bt(this,st,Mn).call(this,this.batteryState));this.logger=n,this.cameraSubject=new gn(t),this.snapshotCache=new(tv())({max:100,ttl:1e3*this.snapshotTTL}),t.pluginId==="native"&&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 pluginId(){return this.cameraSubject.getValue().pluginId}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(Wt.Light)}get hasSiren(){return this.hasCapability(Wt.Siren)}get hasDoorbell(){return this.hasCapability(Wt.Doorbell)}get hasBattery(){return this.hasCapability(Wt.Battery)}get hasAudioDetector(){return this.hasCapability(Wt.AudioSensor)}get hasMotionDetector(){return this.hasCapability(Wt.MotionSensor)||this.hasCapability(Wt.MotionDetector)}get hasObjectDetector(){return this.hasCapability(Wt.ObjectSensor)||this.hasCapability(Wt.ObjectDetector)}get hasPtz(){return this.hasCapability(Wt.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(),Om(([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(bt(this,st,Jo).call(this,o));break;case"motion":this.motionState.next(bt(this,st,Zo).call(this,o));break;case"audio":this.audioState.next(bt(this,st,Ko).call(this,o));break;case"object":this.objectState.next(bt(this,st,Go).call(this,o));break;case"doorbell":this.doorbellState.next(bt(this,st,Wo).call(this,o));break;case"siren":this.sirenState.next(bt(this,st,Yo).call(this,o));break;case"battery":this.batteryState.next(bt(this,st,Xo).call(this,o))}}checkStateInternal(t,n,r){let i,o=!1;switch(t){case"audio":const a=n;i=bt(this,st,Ko).call(this,a),o=this.stateChanged(this.getValue("audio"),i,"audio");break;case"light":const l=n;i=bt(this,st,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=yd(u.detections),u.detections=wd(u.detections),u.detections=Cd(u.detections,this.detectionZones,this.detectionSettings),b&&u.detections.length===0&&(u.state=!1)}i=bt(this,st,Zo).call(this,u),o=this.stateChanged(this.getValue("motion"),i,"motion");break;case"object":const d=n;r||(d.detections=yd(d.detections),d.detections=wd(d.detections),d.detections=Cd(d.detections,this.detectionZones,this.detectionSettings)),i=bt(this,st,Go).call(this,d),o=this.stateChanged(this.getValue("object"),i,"object");break;case"doorbell":const h=n;i=bt(this,st,Wo).call(this,h),o=this.stateChanged(this.getValue("doorbell"),i,"doorbell");break;case"siren":const v=n;i=bt(this,st,Yo).call(this,v),o=this.stateChanged(this.getValue("siren"),i,"siren");break;case"battery":const f=n;i=bt(this,st,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(bt(this,st,Rc).call(this,t),bt(this,st,Rc).call(this,n),!0)}}st=new WeakSet,Ko=function(t,n=!1){let r,i;if(n||(r=this.getValue("audio"),r&&r.lastEvent&&delete r.lastEvent),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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),bt(this,st,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=Rm),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===Wt.StreamUrl));if(!t)throw new Error("No capability found for streamUrl");return this.interfaces&&"streamUrl"in this.interfaces?this.interfaces.streamUrl(e):(await bt(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===Wt.Snapshot));if(!n)throw new Error("No capability found for snapshot");return this.interfaces&&"snapshot"in this.interfaces?this.interfaces.snapshot(e,t):(await bt(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===Wt.PTZ));if(!t)throw new Error("No capability found for PTZ");return this.interfaces&&"ptzCommand"in this.interfaces?this.interfaces.ptzCommand(e):(await bt(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){if(e===An(this,po))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(r=>r.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 kd={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(kd.randomUUID&&!s)return kd.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 Ut,Ed;(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})(Ut||(Ut={})),function(s){s.mergeShapes=(e,t)=>({...e,...t})}(Ed||(Ed={}));const Qe=Ut.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 Qe.undefined;case"string":return Qe.string;case"number":return isNaN(s)?Qe.nan:Qe.number;case"boolean":return Qe.boolean;case"function":return Qe.function;case"bigint":return Qe.bigint;case"symbol":return Qe.symbol;case"object":return Array.isArray(s)?Qe.array:s===null?Qe.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?Qe.promise:typeof Map<"u"&&s instanceof Map?Qe.map:typeof Set<"u"&&s instanceof Set?Qe.set:typeof Date<"u"&&s instanceof Date?Qe.date:Qe.object;default:return Qe.unknown}},$e=Ut.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,Ut.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===Qe.undefined?"Required":`Expected ${s.expected}, received ${s.received}`;break;case $e.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,Ut.jsonStringifyReplacer)}`;break;case $e.unrecognized_keys:t=`Unrecognized key(s) in object: ${Ut.joinValues(s.keys,", ")}`;break;case $e.invalid_union:t="Invalid input";break;case $e.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Ut.joinValues(s.options)}`;break;case $e.invalid_enum_value:t=`Invalid enum value. Expected ${Ut.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}"`:Ut.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,Ut.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 ze(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 wt;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 wt;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 wt=Object.freeze({status:"aborted"}),Oc=s=>({status:"dirty",value:s}),pn=s=>({status:"valid",value:s}),Ad=s=>s.status==="aborted",Md=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 Fm(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 Ye,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}(Ye||(Ye={}));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 $d=(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 Mt(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 Ot{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 $d(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 $d(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:mt.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({...Mt(this._def),schema:this,typeName:mt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new jc({...Mt(this._def),innerType:this,defaultValue:t,typeName:mt.ZodDefault})}brand(){return new Vv({typeName:mt.ZodBranded,type:this,...Mt(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new qc({...Mt(this._def),innerType:this,catchValue:t,typeName:mt.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}(=)?))?$/,Lm="((\\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(`^${Lm}$`);function jm(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=`${Lm}T${jm(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 Ot{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Qe.string){const o=this._getOrReturnCtx(e);return ze(o,{code:$e.invalid_type,expected:Qe.string,received:o.parsedType}),wt}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),ze(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),ze(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?ze(n,{code:$e.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(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),ze(n,{code:$e.invalid_string,validation:"datetime",message:o.message}),t.dirty()):o.kind==="date"?qv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{code:$e.invalid_string,validation:"date",message:o.message}),t.dirty()):o.kind==="time"?new RegExp(`^${jm(o)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{code:$e.invalid_string,validation:"time",message:o.message}),t.dirty()):o.kind==="duration"?Tv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(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),ze(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),ze(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),ze(n,{validation:"cidr",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64"?Lv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{validation:"base64",code:$e.invalid_string,message:o.message}),t.dirty()):o.kind==="base64url"?jv.test(e.data)||(n=this._getOrReturnCtx(e,n),ze(n,{validation:"base64url",code:$e.invalid_string,message:o.message}),t.dirty()):Ut.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,...Ye.errToObj(n)})}_addCheck(e){return new Vn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ye.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ye.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ye.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ye.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ye.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ye.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ye.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ye.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ye.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,...Ye.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,...Ye.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ye.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ye.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...Ye.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ye.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ye.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ye.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ye.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ye.errToObj(t)})}nonempty(e){return this.min(1,Ye.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:mt.ZodString,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Mt(s)})};class yi extends Ot{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)!==Qe.number){const r=this._getOrReturnCtx(e);return ze(r,{code:$e.invalid_type,expected:Qe.number,received:r.parsedType}),wt}let t;const n=new Qs;for(const r of this._def.checks)r.kind==="int"?Ut.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),ze(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),ze(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),ze(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),ze(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),ze(t,{code:$e.not_finite,message:r.message}),n.dirty()):Ut.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ye.toString(t))}setLimit(e,t,n,r){return new yi({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ye.toString(r)}]})}_addCheck(e){return new yi({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ye.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ye.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ye.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ye.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"&&Ut.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:mt.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...Mt(s)});class ao extends Ot{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)!==Qe.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),ze(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),ze(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),ze(t,{code:$e.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Ut.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.bigint,received:t.parsedType}),wt}gte(e,t){return this.setLimit("min",e,!0,Ye.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ye.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ye.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ye.toString(t))}setLimit(e,t,n,r){return new ao({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ye.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:Ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ye.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ye.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:mt.ZodBigInt,coerce:(e=s==null?void 0:s.coerce)!==null&&e!==void 0&&e,...Mt(s)})};class Nc extends Ot{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Qe.boolean){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.boolean,received:t.parsedType}),wt}return pn(e.data)}}Nc.create=s=>new Nc({typeName:mt.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...Mt(s)});class va extends Ot{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Qe.date){const r=this._getOrReturnCtx(e);return ze(r,{code:$e.invalid_type,expected:Qe.date,received:r.parsedType}),wt}if(isNaN(e.data.getTime()))return ze(this._getOrReturnCtx(e),{code:$e.invalid_date}),wt;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),ze(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),ze(n,{code:$e.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Ut.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:Ye.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ye.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:mt.ZodDate,...Mt(s)});class Pd extends Ot{_parse(e){if(this._getType(e)!==Qe.symbol){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.symbol,received:t.parsedType}),wt}return pn(e.data)}}Pd.create=s=>new Pd({typeName:mt.ZodSymbol,...Mt(s)});class Td extends Ot{_parse(e){if(this._getType(e)!==Qe.undefined){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.undefined,received:t.parsedType}),wt}return pn(e.data)}}Td.create=s=>new Td({typeName:mt.ZodUndefined,...Mt(s)});class Rd extends Ot{_parse(e){if(this._getType(e)!==Qe.null){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.null,received:t.parsedType}),wt}return pn(e.data)}}Rd.create=s=>new Rd({typeName:mt.ZodNull,...Mt(s)});class co extends Ot{constructor(){super(...arguments),this._any=!0}_parse(e){return pn(e.data)}}co.create=s=>new co({typeName:mt.ZodAny,...Mt(s)});class Id extends Ot{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pn(e.data)}}Id.create=s=>new Id({typeName:mt.ZodUnknown,...Mt(s)});class fr extends Ot{_parse(e){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.never,received:t.parsedType}),wt}}fr.create=s=>new fr({typeName:mt.ZodNever,...Mt(s)});class Od extends Ot{_parse(e){if(this._getType(e)!==Qe.undefined){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.void,received:t.parsedType}),wt}return pn(e.data)}}Od.create=s=>new Od({typeName:mt.ZodVoid,...Mt(s)});class On extends Ot{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==Qe.array)return ze(t,{code:$e.invalid_type,expected:Qe.array,received:t.parsedType}),wt;if(r.exactLength!==null){const o=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(o||a)&&(ze(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&&(ze(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&&(ze(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:Ye.toString(t)}})}max(e,t){return new On({...this._def,maxLength:{value:e,message:Ye.toString(t)}})}length(e,t){return new On({...this._def,exactLength:{value:e,message:Ye.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:mt.ZodArray,...Mt(e)});class _s extends Ot{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=Ut.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==Qe.object){const l=this._getOrReturnCtx(e);return ze(l,{code:$e.invalid_type,expected:Qe.object,received:l.parsedType}),wt}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&&(ze(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 Ye.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=Ye.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:mt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new _s({...this._def,catchall:e})}pick(e){const t={};return Ut.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 Ut.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 Ut.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 Ut.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 qm(Ut.objectKeys(this.shape))}}_s.create=(s,e)=>new _s({shape:()=>s,unknownKeys:"strip",catchall:fr.create(),typeName:mt.ZodObject,...Mt(e)}),_s.strictCreate=(s,e)=>new _s({shape:()=>s,unknownKeys:"strict",catchall:fr.create(),typeName:mt.ZodObject,...Mt(e)}),_s.lazycreate=(s,e)=>new _s({shape:s,unknownKeys:"strip",catchall:fr.create(),typeName:mt.ZodObject,...Mt(e)});class _a extends Ot{_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 ze(t,{code:$e.invalid_union,unionErrors:i}),wt});{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 ze(t,{code:$e.invalid_union,unionErrors:o}),wt}}get options(){return this._def.options}}_a.create=(s,e)=>new _a({options:s,typeName:mt.ZodUnion,...Mt(e)});function Fc(s,e){const t=ir(s),n=ir(e);if(s===e)return{valid:!0,data:s};if(t===Qe.object&&n===Qe.object){const r=Ut.objectKeys(e),i=Ut.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===Qe.array&&n===Qe.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===Qe.date&&n===Qe.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class ya extends Ot{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(i,o)=>{if(Ad(i)||Ad(o))return wt;const a=Fc(i.value,o.value);return a.valid?((Md(i)||Md(o))&&t.dirty(),{status:t.value,value:a.data}):(ze(n,{code:$e.invalid_intersection_types}),wt)};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:mt.ZodIntersection,...Mt(t)});class Nr extends Ot{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Qe.array)return ze(n,{code:$e.invalid_type,expected:Qe.array,received:n.parsedType}),wt;if(n.data.length<this._def.items.length)return ze(n,{code:$e.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),wt;!this._def.rest&&n.data.length>this._def.items.length&&(ze(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:mt.ZodTuple,rest:null,...Mt(e)})};class xl extends Ot{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!==Qe.object)return ze(n,{code:$e.invalid_type,expected:Qe.object,received:n.parsedType}),wt;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 Ot?{keyType:e,valueType:t,typeName:mt.ZodRecord,...Mt(n)}:{keyType:Vn.create(),valueType:e,typeName:mt.ZodRecord,...Mt(t)})}}class Nd extends Ot{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!==Qe.map)return ze(n,{code:$e.invalid_type,expected:Qe.map,received:n.parsedType}),wt;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 wt;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 wt;u.status!=="dirty"&&d.status!=="dirty"||t.dirty(),a.set(u.value,d.value)}return{status:t.value,value:a}}}}Nd.create=(s,e,t)=>new Nd({valueType:e,keyType:s,typeName:mt.ZodMap,...Mt(t)});class lo extends Ot{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==Qe.set)return ze(n,{code:$e.invalid_type,expected:Qe.set,received:n.parsedType}),wt;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(ze(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&&(ze(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 wt;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:Ye.toString(t)}})}max(e,t){return new lo({...this._def,maxSize:{value:e,message:Ye.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:mt.ZodSet,...Mt(e)});class Fd extends Ot{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})}}Fd.create=(s,e)=>new Fd({getter:s,typeName:mt.ZodLazy,...Mt(e)});class Lc extends Ot{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return ze(t,{received:t.data,code:$e.invalid_literal,expected:this._def.value}),wt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function qm(s,e){return new bi({values:s,typeName:mt.ZodEnum,...Mt(e)})}Lc.create=(s,e)=>new Lc({value:s,typeName:mt.ZodLiteral,...Mt(e)});class bi extends Ot{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 ze(t,{expected:Ut.joinValues(n),received:t.parsedType,code:$e.invalid_type}),wt}if(ga(this,Ki)||Fm(this,Ki,new Set(this._def.values)),!ga(this,Ki).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return ze(t,{received:t.data,code:$e.invalid_enum_value,options:n}),wt}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=qm;class Ld extends Ot{constructor(){super(...arguments),Zi.set(this,void 0)}_parse(e){const t=Ut.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==Qe.string&&n.parsedType!==Qe.number){const r=Ut.objectValues(t);return ze(n,{expected:Ut.joinValues(r),received:n.parsedType,code:$e.invalid_type}),wt}if(ga(this,Zi)||Fm(this,Zi,new Set(Ut.getValidEnumValues(this._def.values))),!ga(this,Zi).has(e.data)){const r=Ut.objectValues(t);return ze(n,{received:n.data,code:$e.invalid_enum_value,options:r}),wt}return pn(e.data)}get enum(){return this._def.values}}Zi=new WeakMap,Ld.create=(s,e)=>new Ld({values:s,typeName:mt.ZodNativeEnum,...Mt(e)});class ba extends Ot{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==Qe.promise&&t.common.async===!1)return ze(t,{code:$e.invalid_type,expected:Qe.promise,received:t.parsedType}),wt;const n=t.parsedType===Qe.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:mt.ZodPromise,...Mt(e)});class si extends Ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===mt.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=>{ze(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 wt;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?wt:l.status==="dirty"||t.value==="dirty"?Oc(l.value):l});{if(t.value==="aborted")return wt;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?wt: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"?wt:(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"?wt:(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)}Ut.assertNever(r)}}si.create=(s,e,t)=>new si({schema:s,typeName:mt.ZodEffects,effect:e,...Mt(t)}),si.createWithPreprocess=(s,e,t)=>new si({schema:e,effect:{type:"preprocess",transform:s},typeName:mt.ZodEffects,...Mt(t)});class gr extends Ot{_parse(e){return this._getType(e)===Qe.undefined?pn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}gr.create=(s,e)=>new gr({innerType:s,typeName:mt.ZodOptional,...Mt(e)});class wi extends Ot{_parse(e){return this._getType(e)===Qe.null?pn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}wi.create=(s,e)=>new wi({innerType:s,typeName:mt.ZodNullable,...Mt(e)});class jc extends Ot{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===Qe.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:mt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Mt(e)});class qc extends Ot{_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:mt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Mt(e)});class jd extends Ot{_parse(e){if(this._getType(e)!==Qe.nan){const t=this._getOrReturnCtx(e);return ze(t,{code:$e.invalid_type,expected:Qe.nan,received:t.parsedType}),wt}return{status:"valid",value:e.data}}}jd.create=s=>new jd({typeName:mt.ZodNaN,...Mt(s)});class Vv extends Ot{_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 Ot{_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"?wt: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"?wt: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:mt.ZodPipeline})}}class Dc extends Ot{_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 qd(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=qd(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=qd(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:mt.ZodReadonly,...Mt(e)});var mt;(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"})(mt||(mt={}));const We=Vn.create,Fn=yi.create,Rs=Nc.create,Di=co.create,At=(fr.create,On.create,_s.create),Ns=_a.create,Hv=(ya.create,Nr.create),Bc=xl.create,we=Lc.create,Qv=(bi.create,ba.create,gr.create);wi.create;function Dd(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Bd=At({enabled:Rs().default(!1)}).strict(),Kv=Ns([we("animal"),we("person"),we("vehicle"),we("other"),we("motion")]),Cl=Hv([Fn(),Fn()]),zd=At({name:We().trim().min(1,"Zone Name is required"),points:Cl.array().min(3,"At least 3 points are required"),type:Ns([we("intersect"),we("contain")]),filter:Ns([we("include"),we("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(),Ud=At({motion:At({timeout:Fn().min(10,"Minimum 10 seconds")}),object:At({confidence:Fn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),Dm=Ns([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("snapshot")]),Zv=Ns([we("high-resolution"),we("mid-resolution"),we("low-resolution"),we("auto")]),Gv=Ns([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("webrtc:"),we("webtorrent:")]).options.map(s=>s.value),Wv=new RegExp(`^(${Gv.join("|")})`),Bm=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=At({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Dm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Bm.array().min(1,"At least one valid URL is required")}).strict(),Yv=At({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Camera Source Name is required").transform(s=>s.replace(/ /g,"_").toLowerCase()),role:Dm,useForSnapshot:Rs().default(!1),hotMode:Rs().default(!1),urls:Bm.array().min(1,"At least one valid URL is required")}).strict(),Sr=At({id:We(),name:We().trim()}),Vd=At({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([we("auto"),we("mse"),we("webrtc"),we("webrtc/tcp")]),e_=Ns([we("16:9"),we("8:3"),we("4:3"),we("auto")]),Hd=At({decoder:Ns([we("pillow"),we("wasm"),we("rust"),we("gpu")]),fps:Fn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Ns([we("640x480"),we("640x360"),we("320x240"),we("320x180")])}),Qd=Ns([we("camera"),we("doorbell")]),Kd=At({streamingMode:Xv,streamingSource:Zv,aspectRatio:e_}),Zd=At({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_=(At({name:We().trim().min(1,"Camera name is required"),url:We().trim().url().min(1,"Camera URL is required"),type:Ns([we("Google"),we("Ring"),we("HomeKit"),we("Onvif"),we("Hass"),we("GoPro"),we("Roborock"),we("FFmpeg"),we("DVRip"),we("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"]}),At({_id:We().default(mn()).transform(()=>mn()),nativeId:We().trim().optional(),pluginId:We().trim().default("native"),disabled:Rs().default(!1),name:We().trim().min(1,"Camera name is required"),type:Qd.default("camera"),isCloud:Rs().default(!1),snapshotTTL:Fn().min(30,"Minimum cache time must be 30").default(600),info:Zd.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:Vd.default({hub:[],plugins:[]}),recording:Bd.default({enabled:!1}),interface:Kd.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:zd.default([]),detectionSettings:Ud.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:Hd.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||Dd(e)?{...s,isCloud:!0}:s}),At({disabled:Rs().optional(),type:Qd.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:Zd.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:Vd.partial().optional(),interface:Kd.partial().optional(),recording:Bd.partial().optional(),detectionZones:zd.optional(),detectionSettings:Ud.partial().optional(),frameWorkerSettings:Hd.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||Dd(e))return{...s,isCloud:!0}}return s}),At({url:We().trim()}).strict(),/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/);var Gd,Wd;(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"})(Gd||(Gd={})),function(s){s.START="start",s.STOP="stop"}(Wd||(Wd={}));const Jd=["image/jpeg","image/png"],Yd=2097152,Xd=["video/mp4","video/quicktime"],eh=10485760,th=["audio/mpeg","audio/wav","audio/ogg"],sh=2097152,s_=(At({pluginname:We().trim().refine(s=>t_.test(s),"Not a valid plugin name"),pluginversion:We().trim().optional().default("latest")}).strict(),At({actionId:We(),payload:Di()}).strict(),Bc(Di(),Di()),At({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=Yd:s.size<=Yd,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Jd.includes(s.mimetype):Jd.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))}),At({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=sh:s.size<=sh,"Max file size is 2 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?th.includes(s.mimetype):th.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))}),At({upload:qn().refine(s=>(e=>e.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=eh:s.size<=eh,"Max file size is 5 MB").refine(s=>(e=>e.mimetype!==void 0)(s)?Xd.includes(s.mimetype):Xd.includes(s.type),".mp4 files are accepted"),config:qn().transform(s=>JSON.parse(s.value))}),Bc(We(),Di()),At({key:We()}).strict(),At({key:We(),payload:Di()}).strict(),At({version:We().trim().optional().default("latest")}).strict(),At({mode:Ns([we("disabled"),we("port-forward"),we("router-forward"),we("cloudflare"),we("custom-domain")]).default("disabled"),cloudflare:At({tunnelToken:We().trim(),customDomain:We().trim(),tunnelUrl:We().trim(),tunnelCredentials:At({username:We().trim(),password:We().trim()}).partial()}).partial().strict(),customDomain:At({url:We().trim().optional()}).partial().strict()}).strict()),nh=(At({serverAddresses:We().trim().ip().array().default([]),remoteAccess:s_}).strict(),["image/jpeg","image/jpg","image/png"]),rh=5242880,zm=At({index:Fn(),cameraId:We()}),Um=Ns([we(1),we(4),we(6),we(7),we(9),we(10),we(12),we(13),we(15),we(16),we(20),we(26)]),n_=Ns([we("dnd"),we("view")]),r_=At({_id:We().default(mn()).transform(()=>mn()),name:We().trim().min(1,"Layout name is required"),viewSize:Um,cameras:zm.array(),type:n_}),i_=(At({name:We().trim().min(1,"Layout name is required"),viewSize:Um,cameras:zm.array()}).partial().optional(),At({views:r_.array()})),o_=At({_id:We().default(mn()).transform(()=>mn()),cameraId:We(),points:Cl}),a_=(At({cameraId:We(),points:Cl}).partial().optional(),At({shortcuts:o_.array()})),ih=At({camview:i_,cameras:Bc(We().trim(),a_)});At({_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([we("admin"),we("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:ih.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),At({username:We().trim().min(1,"Username is required"),password:We().trim().min(1,"Password is required"),rememberMe:Rs().default(!1)}).strict(),At({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([we("admin"),we("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)<=rh:s.size<=rh,"Max file size is 5MB.").refine(s=>(e=>e.mimetype!==void 0)(s)?nh.includes(s.mimetype):nh.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:Rs().optional(),singleSession:Rs().optional(),firstLogin:Rs().optional(),preferences:ih.partial().optional()}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"});var oh;(function(s){s.READY="ready",s.RESTARTING="restarting",s.STARTING="starting",s.STARTED="started",s.STOPPED="stopped",s.ERROR="error",s.UNKNOWN="unknown"})(oh||(oh={}));class c_ 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 l_ 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 c_(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 u_{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 d_{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 l_(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 h_{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 u_(this.proxy),t=new d_(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 Oe=lf.create({baseURL:`${location.origin}/api`});Oe.interceptors.request.use(s=>{const{accessToken:e}=Fs();return e&&(s.headers.Authorization=`Bearer ${e}`),s},s=>Promise.reject(s));Oe.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(),Oe(e)}catch(u){return Promise.reject(u)}}return Promise.reject(s)});const Cn=()=>({add:e=>{P0.emit("add",e)}}),Vm=async s=>(await Oe.get("/auth/check",{signal:s})).data,m_=async({parameter:s,signal:e})=>(await Oe.get("/auth/tokens",{params:s,signal:e})).data,Hm=async({loginInformation:s})=>(await Oe.post("/auth/login",s)).data,Qm=async()=>(await Oe.post("/auth/logout")).data,p_=async({id:s,access_token:e})=>(await Oe.post(`/auth/logout/${s}`,null,{params:{token:e}})).data,Km=async({refresh_token:s})=>(await Oe.post("/auth/refresh",{refresh_token:s})).data;class i9{constructor(){p(this,"_queryClient",Ci());p(this,"authStore",Fs());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{name:"checkQuery",enabled:!0},{name:"listQuery",enabled:!0}]))}get queryClient(){return this._queryClient}checkQuery(){var e;return Vt({queryKey:["auth",(e=this.authStore.user)==null?void 0:e.username],queryFn:({signal:t})=>Vm(t),enabled:()=>this.queryActivator.value.some(t=>t.name==="checkQuery"&&t.enabled)})}listQuery(e){return Vt({queryKey:["tokensList",e],queryFn:({signal:t})=>m_({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="listQuery"&&t.enabled)})}loginQuery(){return dt({mutationFn:Hm})}logoutQuery(){return dt({mutationFn:Qm})}logoutTokenQuery(){return dt({mutationFn:p_,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 dt({mutationFn:Km})}toggleQueryActivator(e,t){const n=this.queryActivator.value.find(r=>r.name===e);n&&(n.enabled=t)}}const f_=async({userData:s})=>(await Oe.post("/users",s)).data,g_=async({username:s,signal:e})=>(await Oe.get(`/users/${s}`,{signal:e})).data,v_=async({parameter:s,signal:e})=>(await Oe.get("/users",{params:s,signal:e})).data,wa=async({username:s,userData:e})=>(await Oe.patch(`/users/${s}`,e)).data,__=async({username:s})=>(await Oe.delete(`/users/${s}`)).data,y_=async()=>(await Oe.delete("/users")).data,b_=async({username:s,cameraname:e,shortcutData:t})=>(await Oe.post(`/users/${s}/preferences/cameras/${e}/shortcuts`,t)).data,w_=async({username:s,cameraname:e,shortcutid:t,signal:n})=>(await Oe.get(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,{signal:n})).data,x_=async({username:s,cameraname:e,signal:t})=>(await Oe.get(`/users/${s}/preferences/cameras/${e}/shortcuts`,{signal:t})).data,S_=async({username:s,cameraname:e,shortcutid:t,shortcutData:n})=>(await Oe.patch(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`,n)).data,C_=async({username:s,cameraname:e,shortcutid:t})=>(await Oe.delete(`/users/${s}/preferences/cameras/${e}/shortcuts/${t}`)).data,k_=async({username:s,cameraname:e})=>(await Oe.delete(`/users/${s}/preferences/cameras/${e}/shortcuts`)).data,E_=async({username:s,viewData:e})=>(await Oe.post(`/users/${s}/preferences/camview/views`,e)).data,A_=async({username:s,viewid:e,signal:t})=>(await Oe.get(`/users/${s}/preferences/camview/views/${e}`,{signal:t})).data,M_=async({username:s,parameter:e,signal:t})=>(await Oe.get(`/users/${s}/preferences/camview/views`,{params:e,signal:t})).data,ah=async({username:s,viewid:e,viewData:t})=>(await Oe.patch(`/users/${s}/preferences/camview/views/${e}`,t)).data,$_=async({username:s,viewid:e})=>(await Oe.delete(`/users/${s}/preferences/camview/views/${e}`)).data,P_=async({username:s})=>(await Oe.delete(`/users/${s}/preferences/camview/views`)).data;class T_{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{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 dt({mutationFn:f_,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 Vt({queryKey:["users",e],queryFn:({signal:t})=>g_({username:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getUserQuery"&&t.enabled)})}getUsersQuery(e){return Vt({queryKey:["usersList",e],queryFn:({signal:t})=>v_({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getUsersQuery"&&t.enabled)})}patchUserQuery(){return dt({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 dt({mutationFn:__,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 dt({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.users_removed"),life:3e3})}})}createShortcutQuery(){return dt({mutationFn:b_,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["shortcutsList",t.username]})}})}getShortcutQuery(e,t,n){return Vt({queryKey:["shortcutsList",e,t,n],queryFn:({signal:r})=>w_({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 Vt({queryKey:["shortcutsList",e,t],queryFn:({signal:n})=>x_({username:c(e),cameraname:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getShortcutsQuery"&&n.enabled)})}patchShortcutQuery(){return dt({mutationFn:S_,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 dt({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})}})}removeShortcutsQuery(){return dt({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})}})}createViewQuery(){return dt({mutationFn:E_,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 Vt({queryKey:["viewsList",e],queryFn:({signal:n})=>A_({username:c(e),viewid:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getUserQuery"&&n.enabled)})}getViewsQuery(e,t){return Vt({queryKey:["viewsList",e,t],queryFn:({signal:n})=>M_({username:c(e),parameter:c(t),signal:n}),placeholderData:n=>n,enabled:()=>this.queryActivator.value.some(n=>n.name==="getViewsQuery"&&n.enabled)})}patchViewQuery(){return dt({mutationFn:ah,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 dt({mutationFn:ah,onSuccess:async(e,t)=>{await this._queryClient.invalidateQueries({queryKey:["viewsList",t.username]})}})}removeViewQuery(){return dt({mutationFn:$_,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 dt({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.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 R_(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:W=>W?JSON.parse(W):null,write:W=>JSON.stringify(W)}}),n=Ls(null),r=Ls(null),i=Ls(null),o=oe(!1),a=oe(!1),l=oe(!1),u=se(()=>t.value!==null),d=se(()=>r.value!==null&&!i.value&&!o.value),h=se(()=>{var W;return((W=t.value)==null?void 0:W.access_token)??null});Ze(s,()=>{a.value=!1},{deep:!0}),Ze(t,W=>{!a.value&&!sa(W,t.value)&&k()},{deep:!0});const v=async W=>{if(r.value)return r.value;o.value=!0,i.value=null;try{n.value||(n.value=new h_({endpoint:window.origin,token:W,skipCheck:!0,logger:{...console,attention:console.warn,success:console.log}}));const I=await n.value.connect();return r.value=I,I}catch(I){const E=I instanceof Error?I:new Error(String(I));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 W=>{if(!u.value){l.value=!1,a.value=!0;try{const I=await Hm({loginInformation:W});t.value=I,await v(I.access_token),e.push("/cameras")}finally{a.value=!1}}},k=async()=>{!u.value||l.value||(l.value=!0,a.value=!0,await f(),O(),await Qm(),t.value=null,e.push("/"),window.location.reload(),a.value=!1)},z=async()=>{if(!t.value)return;const W=await Km({refresh_token:t.value.refresh_token});n.value&&await n.value.updateCredentials({endpoint:window.origin,token:W.access_token}),t.value.access_token=W.access_token},O=async()=>{try{if("serviceWorker"in navigator){const I=await(await navigator.serviceWorker.ready).pushManager.getSubscription();I&&await I.unsubscribe()}}catch{}},te=async(W,I)=>{t.value&&(W&&await wa({username:t.value.username,userData:W}),I&&await wa({username:t.value.username,userData:I}))};return u.value&&h.value&&v(h.value).catch(W=>{console.error("Error initializing API:",W)}),{isLoggedIn:u,isApiReady:d,loginLoading:a,api:r,apiError:i,accessToken:h,user:t,login:b,logout:k,refreshToken:z,updateUser:te,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:""},o9=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)}}),I_=(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 Zm=s=>{switch(s){case"error":return"error";case"info":return"info";case"success":return"success";case"warning":return"warn";default:return"info"}},a9=s=>{s||(s=new Date);const e=new Date(s);return e.setMilliseconds(0),e},c9=s=>{s||(s=new Date);const e=new Date(s);return e.setSeconds(0,0),e.setMilliseconds(0),e},O_=["src","alt"],N_=["src","alt","width","height"],F_=Tt({__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}=Jt(e),u=oe(!1),d=oe(!1),h=se(()=>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 O=Lr,te=T0;return m(),L(te,{alt:k.alt,class:"w-full h-full flex items-center justify-center"},{image:$(()=>[!c(u)&&!c(d)?(m(),L(O,{key:0,"stroke-width":"6",class:"w-[50%] h-[50%] max-w-[30px] max-h-[30px]"})):ae("",!0),It(g("div",{class:at(c(a)),style:ot(c(l))},[c(d)?ae("",!0):It((m(),M("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,O_)),[[Pr,c(u)]]),c(d)?(m(),M("img",{key:1,src:c(h),alt:k.alt,width:c(n),height:c(r),class:"contain",style:ot({aspectRatio:c(i)})},null,12,N_)):ae("",!0)],6),[[Pr,c(u)||c(d)]])]),_:1},8,["alt"])}}}),Fa=qs(F_,[["__scopeId","data-v-6696d637"]]),L_=Tt({__name:"CuiAvatar",props:{src:{},showBorder:{type:Boolean,default:!0},size:{default:22}},setup(s){const e=s,{showBorder:t,size:n,src:r}=Jt(e);return(i,o)=>{const a=Fa;return m(),M("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)}}}),Gm=qs(L_,[["__scopeId","data-v-82af9e29"]]),j_={class:"flex items-center justify-center absolute left-3 h-full"},q_={key:0,class:"flex items-center shrink-0"},D_={key:1,class:"shrink-0"},B_={key:2,class:"shrink-0"},z_={key:0,class:"overflow-hidden flex-1 ml-10"},U_={class:"flex flex-row items-center justify-between"},V_={class:"text-start flex-1"},H_={key:0,class:"text-xs text-muted"},Q_=Tt({__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:O,showTooltip:te,fallbackActivePath:W}=Jt(n),I=se(()=>t.path===b.value||b.value!=="/"&&(t.path.startsWith(b.value+"/")||t.path.startsWith((W.value??b.value)+"/"))),E=()=>{e.logout()};return(N,D)=>{const C=Gm,A=Xh,B=ys,H=Ei("RouterLink"),R=jr;return m(),L(H,{to:c(b)},{default:$(({isActive:w})=>[It((m(),L(B,tt({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(I))&&!c(u),"hover:!text-color active:!text-color focus:!text-color":!w&&!c(I)}],fluid:""},c(O)),{default:$(()=>[g("div",j_,[c(u)?(m(),M("div",q_,[y(C,{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(I)||!c(a)?(m(),M("div",D_,[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(I))?(m(),M("div",B_,[y(c(a),{style:ot({width:`${c(i)}px`,height:`${c(i)}px`})},null,8,["style"])])):ae("",!0)]),y(Pt,{name:"fade"},{default:$(()=>[c(f)?(m(),M("div",z_,[g("div",U_,[g("div",V_,[g("div",{class:at(["text-sm max-w-100 truncate font-semibold",[c(d),{"text-color font-bold":c(u)}]])},he(c(h)),3),c(v)?(m(),M("div",H_,he(c(v)),1)):ae("",!0)]),c(k)?(m(),L(B,{key:0,text:"",rounded:"",class:"dark-mode cui-icon-md",onClick:E},{icon:$(()=>[y(A,{width:"100%",height:"100%"})]),_:1})):ae("",!0)])])):ae("",!0)]),_:1})]),_:2},1040,["class"])),[[R,{value:c(te)&&!c(f)?c(h):"",pt:{root:{class:"dark-mode"}}}]])]),_:1},8,["to"])}}}),Wm=qs(Q_,[["__scopeId","data-v-13c365f7"]]),K_="modulepreload",Z_=function(s){return"/"+s},ch={},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=Z_(u),u in ch)return;ch[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":K_,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)})},G_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W_(s,e){return m(),M("svg",G_,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 J_=me({name:"lets-icons-back",render:W_}),Y_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X_(s,e){return m(),M("svg",Y_,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 20v-6h4v6h5v-8h3L12 3L2 12h3v8z"},null,-1)]))}const e2=me({name:"mdi-home",render:X_}),t2={class:"relative flex items-center justify-center draggable-region"},s2={class:"container mx-auto px-6 relative z-10"},n2={class:"text-center"},r2={class:"text-8xl font-bold mb-4 relative flex items-center justify-center"},i2={class:"relative w-24 h-24 mx-2 group"},o2={class:"relative z-1 scale-150 non-draggable-region"},a2={class:"text-muted max-w-md mx-auto mb-8"},c2={class:"flex items-center justify-center gap-4"},l2={class:"text-white"},u2=Tt({__name:"404",setup(s){return(e,t)=>{const n=e2,r=ys,i=Ei("RouterLink"),o=J_;return m(),M("div",t2,[g("div",s2,[g("div",n2,[g("h1",r2,[t[1]||(t[1]=g("span",null,"4",-1)),g("div",i2,[g("div",o2,[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",a2,he(e.$t("views.404.error_message")),1),g("div",c2,[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",l2,he(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,he(e.$t("components.form.button.back")),1)]),_:1})])])])])}}}),d2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function h2(s,e){return m(),M("svg",d2,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 m2=me({name:"ic-baseline-discord",render:h2}),p2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function f2(s,e){return m(),M("svg",p2,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 g2=me({name:"mdi-github",render:f2});function Jm(s){const e=["kasa://","nest:","ring:","tapo://"];return s.some(t=>e.some(n=>t.startsWith(n)))}const Ym=kt({enabled:Ss().default(!1)}).strict(),v2=Os([be("animal"),be("person"),be("vehicle"),be("other"),be("motion")]),El=ff([xn(),xn()]),Al=kt({name:Ke().trim().min(1,"Zone Name is required"),points:El.array().min(3,"At least 3 points are required"),type:Os([be("intersect"),be("contain")]),filter:Os([be("include"),be("exclude")]),classes:v2.array(),isPrivacyMask:Ss(),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(),Xm=kt({motion:kt({timeout:xn().min(10,"Minimum 10 seconds")}),object:kt({confidence:xn().min(.3,"Minimum 0.3").max(1,"Maximum 1")})}),Ml=Os([be("high-resolution"),be("mid-resolution"),be("low-resolution"),be("snapshot")]),_2=Os([be("high-resolution"),be("mid-resolution"),be("low-resolution"),be("auto")]),ep=Os([be("bubble://"),be("cui://"),be("doorbird://"),be("dvrip://"),be("echo:"),be("eseecloud://"),be("exec:"),be("expr:"),be("ffmpeg:"),be("flussonic://"),be("gopro://"),be("hass:"),be("homekit://"),be("http://"),be("https://"),be("httpx://"),be("isapi://"),be("ivideon:"),be("kasa://"),be("nest:"),be("onvif://"),be("ring:"),be("roborock://"),be("rtmp://"),be("rtsp://"),be("rtspx://"),be("tapo://"),be("tcp://"),be("webrtc:"),be("webtorrent:")]),y2=ep.options.map(s=>s.value),b2=new RegExp(`^(${y2.join("|")})`),tp=Ke().refine(s=>{if(!b2.test(s))return!1;try{return new URL(s),!0}catch{return!1}},{message:"Invalid URL format or unsupported protocol"}),w2=kt({_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:Ss().default(!1),hotMode:Ss().default(!1),urls:tp.array().min(1,"At least one valid URL is required")}).strict(),x2=kt({_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:Ss().default(!1),hotMode:Ss().default(!1),urls:tp.array().min(1,"At least one valid URL is required")}).strict(),Cr=kt({id:Ke(),name:Ke().trim()}),sp=kt({hub:Cr.array().optional(),cameraController:Cr.optional(),motionDetection:Cr.optional(),audioDetection:Cr.optional(),objectDetection:Cr.optional(),ptz:Cr.optional(),plugins:Cr.array()}).strict(),S2=Os([be("auto"),be("mse"),be("webrtc"),be("webrtc/tcp")]),C2=Os([be("16:9"),be("8:3"),be("4:3"),be("auto")]),np=kt({decoder:Os([be("pillow"),be("wasm"),be("rust"),be("gpu")]),fps:xn().min(0,"Minimum 0 fps").max(30,"Maximum 30 fps"),resolution:Os([be("640x480"),be("640x360"),be("320x240"),be("320x180")])}),rp=Os([be("camera"),be("doorbell")]),ip=kt({streamingMode:S2,streamingSource:_2,aspectRatio:C2}),op=kt({model:Ke().trim().optional(),manufacturer:Ke().trim().optional(),hardware:Ke().trim().optional(),serialNumber:Ke().trim().optional(),firmwareVersion:Ke().trim().optional(),supportUrl:Ke().trim().optional()}),k2=kt({name:Ke().trim().min(1,"Camera name is required"),url:Ke().trim().url().min(1,"Camera URL is required"),type:Os([be("Google"),be("Ring"),be("HomeKit"),be("Onvif"),be("Hass"),be("GoPro"),be("Roborock"),be("FFmpeg"),be("DVRip"),be("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"]}),E2=kt({_id:Ke().default(hn()).transform(()=>hn()),nativeId:Ke().trim().optional(),pluginId:Ke().trim().default("native"),disabled:Ss().default(!1),name:Ke().trim().min(1,"Camera name is required"),type:rp.default("camera"),isCloud:Ss().default(!1),snapshotTTL:xn().min(30,"Minimum cache time must be 30").default(600),info:op.default({model:"IP Camera",manufacturer:"camera.ui",hardware:"Camera",serialNumber:"Unknown",firmwareVersion:"Unknown",supportUrl:"Unknown"}),sources:w2.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:sp.default({hub:[],plugins:[]}),recording:Ym.default({enabled:!1}),interface:ip.default({streamingMode:"auto",streamingSource:"auto",aspectRatio:"16:9"}),detectionZones:Al.default([]),detectionSettings:Xm.default({motion:{timeout:60},object:{confidence:.7}}),frameWorkerSettings:np.default({decoder:"rust",fps:10,resolution:"320x180"})}).strict().transform(s=>{const e=s.sources.flatMap(t=>t.urls);return s.isCloud||Jm(e)?{...s,isCloud:!0}:s}),A2=kt({disabled:Ss().optional(),type:rp.optional(),name:Ke().trim().min(1,"Camera name is required").optional(),isCloud:Ss().optional(),snapshotTTL:xn().min(30,"Minimum cache time must be 30").optional(),info:op.partial().optional(),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"}).optional(),extensions:sp.partial().optional(),interface:ip.partial().optional(),recording:Ym.partial().optional(),detectionZones:Al.optional(),detectionSettings:Xm.partial().optional(),frameWorkerSettings:np.partial().optional()}).strict().transform(s=>{if(s.sources){const e=s.sources.flatMap(t=>t.urls);if(s.isCloud===!0||Jm(e))return{...s,isCloud:!0}}return s});kt({url:Ke().trim()}).strict();const M2=/^((@[\w-.]*)\/)?(camera-ui-[\w-]*)$/;var $2=(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))($2||{});const lh=["image/jpeg","image/png"],uh=1024*1024*2,dh=["video/mp4","video/quicktime"],hh=1024*1024*10,mh=["audio/mpeg","audio/wav","audio/ogg"],ph=1024*1024*2;kt({pluginname:Ke().trim().refine(s=>M2.test(s),"Not a valid plugin name"),pluginversion:Ke().trim().optional().default("latest")}).strict();kt({actionId:Ke(),payload:ur()}).strict();ol(ur(),ur());kt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=uh:s.size<=uh,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?lh.includes(s.mimetype):lh.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))});kt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=ph:s.size<=ph,"Max file size is 2 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?mh.includes(s.mimetype):mh.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))});kt({upload:Hn().refine(s=>(t=>t.mimetype!==void 0)(s)?Buffer.byteLength(s._buf)<=hh:s.size<=hh,"Max file size is 5 MB").refine(s=>(t=>t.mimetype!==void 0)(s)?dh.includes(s.mimetype):dh.includes(s.type),".mp4 files are accepted"),config:Hn().transform(s=>JSON.parse(s.value))});ol(Ke(),ur());kt({key:Ke()}).strict();kt({key:Ke(),payload:ur()}).strict();kt({version:Ke().trim().optional().default("latest")}).strict();const P2=kt({mode:Os([be("disabled"),be("port-forward"),be("router-forward"),be("cloudflare"),be("custom-domain")]).default("disabled"),cloudflare:kt({tunnelToken:Ke().trim(),customDomain:Ke().trim(),tunnelUrl:Ke().trim(),tunnelCredentials:kt({username:Ke().trim(),password:Ke().trim()}).partial()}).partial().strict(),customDomain:kt({url:Ke().trim().optional()}).partial().strict()}).strict(),l9=kt({serverAddresses:Ke().trim().ip().array().default([]),remoteAccess:P2}).strict(),fh=["image/jpeg","image/jpg","image/png"],gh=1024*1024*5,ap=kt({index:xn(),cameraId:Ke()}),cp=Os([be(1),be(4),be(6),be(7),be(9),be(10),be(12),be(13),be(15),be(16),be(20),be(26)]),T2=Os([be("dnd"),be("view")]),lp=kt({_id:Ke().default(hn()).transform(()=>hn()),name:Ke().trim().min(1,"Layout name is required"),viewSize:cp,cameras:ap.array(),type:T2});kt({name:Ke().trim().min(1,"Layout name is required"),viewSize:cp,cameras:ap.array()}).partial().optional();const R2=kt({views:lp.array()}),I2=kt({_id:Ke().default(hn()).transform(()=>hn()),cameraId:Ke(),points:El});kt({cameraId:Ke(),points:El}).partial().optional();const O2=kt({shortcuts:I2.array()}),up=kt({camview:R2,cameras:ol(Ke().trim(),O2)}),N2=kt({_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([be("admin"),be("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:Ss().default(!1),singleSession:Ss().default(!1),firstLogin:Ss().default(!0),preferences:up.default({camview:{views:[]},cameras:{}})}).strict().refine(s=>s.password===s.passwordConfirm,{path:["passwordConfirm"],message:"Passwords do not match"}),F2=kt({username:Ke().trim().min(1,"Username is required"),password:Ke().trim().min(1,"Password is required"),rememberMe:Ss().default(!1)}).strict(),L2=kt({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([be("admin"),be("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)<=gh:s.size<=gh,"Max file size is 5MB.").refine(s=>(t=>t.mimetype!==void 0)(s)?fh.includes(s.mimetype):fh.includes(s.type),".jpg, .jpeg, .png files are accepted.")),rememberMe:Ss().optional(),singleSession:Ss().optional(),firstLogin:Ss().optional(),preferences:up.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),vh=s=>s.type==="number",_h=s=>s.type==="boolean",xa=s=>s.type==="string"&&"enum"in s,yh=s=>s.type==="array",zr=s=>s.type==="button",Ur=s=>s.type==="submit",j2=s=>ar(s)&&(!s.format||s.format!=="qrCode"&&s.format!=="image"),q2=(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}},D2=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},u9=(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},dp=(s,e)=>e?s.filter(t=>"group"in t&&t.group===e):s,B2=(s,e)=>{const t=dp(s,e);return t.length>0&&t.every(n=>"readonly"in n&&n.readonly)},z2=(s,e)=>{const t=dp(s,e);return t.length>0&&t.some(n=>"store"in n&&n.store)},U2=(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},hp=s=>{if(zr(s)||Ur(s))return ur();switch(s.type){case"string":if(xa(s))if(s.multiple){let i=Cu(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()===""||U2(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?Ss():Ss().optional();case"array":const n=hp(s.items),r=Cu(n);return s.required?r:r.optional();default:return s.required?ur():ur().optional()}},V2=s=>{const e={};return s.forEach(t=>{!zr(t)&&!Ur(t)&&(e[t.key]=hp(t))}),kt(e)},H2=Wn(F2),d9=Wn(N2),h9=Wn(L2),m9=Wn(lp),Q2={class:"flex justify-center items-center draggable-region"},K2={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"},Z2={class:"flex flex-col h-full p-10 non-draggable-region"},G2={class:"flex flex-col items-center justify-center mb-10"},W2={class:"flex flex-col gap-10 md:gap-6 w-full mt-10 md:mt-0"},J2={for:"username",class:"cui-label"},Y2={for:"password",class:"cui-label"},X2={class:"flex flex-col gap-6 mt-10"},ey={class:"flex items-center field-checkbox-gap"},ty={for:"rememberMe",class:"cui-label-checkbox"},sy={class:"flex justify-end items-center gap-1"},ny=Tt({__name:"Login",setup(s){const e=Cn(),t=Fs(),{t:n}=js(),{loginLoading:r}=Vs(t),i=Qt("formRef"),o=oe(""),a=oe(""),l=oe(!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=Lh,b=R0,k=ys,z=Ea,O=g2,te=m2;return m(),M("div",Q2,[g("div",K2,[g("div",Z2,[g("div",G2,[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(H2),class:"flex flex-col h-full",onSubmit:u},{default:$(()=>[g("div",W2,[y(c(Dt),{modelValue:c(o),"onUpdate:modelValue":h[0]||(h[0]=W=>ps(o)?o.value=W:null),modelModifiers:{trim:!0},name:"username",as:"div",class:"flex flex-col field-gap"},{default:$(({field:W,errors:I})=>[g("label",J2,he(d.$t("components.form.label.username")),1),y(v,tt({invalid:I.length>0,type:"text",size:"large",loading:c(r),fluid:""},W),null,16,["invalid","loading"]),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"username",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:c(a),"onUpdate:modelValue":h[1]||(h[1]=W=>ps(a)?a.value=W:null),name:"password",as:"div",class:"flex flex-col field-gap"},{default:$(({field:W,errors:I})=>[g("label",Y2,he(d.$t("components.form.label.password")),1),y(f,tt({invalid:I.length>0,size:"large",loading:c(r),feedback:!1,"toggle-mask":"",fluid:""},W),null,16,["invalid","loading"]),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"password",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])]),g("div",X2,[y(c(Dt),{"model-value":c(l),name:"rememberMe",type:"checkbox","checked-value":!0,"unchecked-value":!1,as:"div",class:"flex flex-col field-gap"},{default:$(({field:W,errors:I})=>[g("div",ey,[y(b,tt({"model-value":c(l)},W,{invalid:I.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",ty,he(d.$t("components.form.label.remember_me")),1)]),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{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",sy,[y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(O,{class:"text-muted",width:"100%",height:"100%"})]),_:1}),y(k,{severity:"secondary",class:"cui-icon-md",text:"",rounded:""},{icon:$(()=>[y(te,{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))])])}}}),mp=Mi("loading",()=>({routerLoading:oe(!1)})),ry={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iy(s,e){return m(),M("svg",ry,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 bh=me({name:"mingcute-grid-fill",render:iy}),oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ay(s,e){return m(),M("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 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 wh=me({name:"mingcute-grid-line",render:ay}),cy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ly(s,e){return m(),M("svg",cy,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 xh=me({name:"bx-cctv",render:ly}),uy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dy(s,e){return m(),M("svg",uy,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=me({name:"bxs-cctv",render:dy}),hy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function my(s,e){return m(),M("svg",hy,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 Sh=me({name:"mdi-note-edit",render:my}),py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fy(s,e){return m(),M("svg",py,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 Ch=me({name:"mdi-note-edit-outline",render:fy}),gy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function vy(s,e){return m(),M("svg",gy,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 kh=me({name:"tabler-puzzle",render:vy}),_y={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yy(s,e){return m(),M("svg",_y,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=me({name:"tabler-puzzle-filled",render:yy}),by={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function wy(s,e){return m(),M("svg",by,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 Eh=me({name:"icon-park-outline-terminal",render:wy}),xy={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},Sy=["id"],Cy=["mask"];function ky(s,e){return m(),M("svg",xy,[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,Sy)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSTerminal0+")"},null,8,Cy)])}const Ah=me({name:"icon-park-solid-terminal",render:ky,setup(){return{idMap:{ipSTerminal0:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),Ey={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ay(s,e){return m(),M("svg",Ey,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=me({name:"mingcute-photo-album-fill",render:Ay}),My={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $y(s,e){return m(),M("svg",My,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=me({name:"mingcute-photo-album-line",render:$y}),Py={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ty(s,e){return m(),M("svg",Py,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 Mh=me({name:"solar-graph-bold",render:Ty}),Ry={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Iy(s,e){return m(),M("svg",Ry,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 $h=me({name:"solar-graph-outline",render:Iy}),Oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ny(s,e){return m(),M("svg",Oy,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 Ph=me({name:"bx-network-chart",render:Ny}),Fy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ly(s,e){return m(),M("svg",Fy,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 Th=me({name:"bxs-network-chart",render:Ly}),jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qy(s,e){return m(),M("svg",jy,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=me({name:"mdi-cog",render:qy}),Dy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function By(s,e){return m(),M("svg",Dy,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=me({name:"mdi-cog-outline",render:By}),zy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Uy(s,e){return m(),M("svg",zy,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 Vy=me({name:"mdi-account-circle",render:Uy}),Hy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qy(s,e){return m(),M("svg",Hy,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 Ky=me({name:"mdi-account-circle-outline",render:Qy}),Zy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Gy(s,e){return m(),M("svg",Zy,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 Wy=me({name:"ic-outline-design-services",render:Gy}),Jy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yy(s,e){return m(),M("svg",Jy,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 Xy=me({name:"ic-round-design-services",render:Yy}),eb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tb(s,e){return m(),M("svg",eb,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 sb=me({name:"mdi-users",render:tb}),nb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rb(s,e){return m(),M("svg",nb,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 ib=me({name:"mdi-users-outline",render:rb}),ob={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function ab(s,e){return m(),M("svg",ob,e[0]||(e[0]=[Hh('<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 cb=me({name:"clarity-backup-restore-line",render:ab}),lb={viewBox:"0 0 36 36",width:"1.2em",height:"1.2em"};function ub(s,e){return m(),M("svg",lb,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 db=me({name:"clarity-backup-restore-solid",render:ub}),hb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mb(s,e){return m(),M("svg",hb,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 pb=me({name:"material-symbols-cloud",render:mb}),fb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gb(s,e){return m(),M("svg",fb,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 vb=me({name:"material-symbols-cloud-outline",render:gb}),_b={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yb(s,e){return m(),M("svg",_b,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 bb=me({name:"mingcute-settings-2-fill",render:yb}),wb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xb(s,e){return m(),M("svg",wb,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 Sb=me({name:"mingcute-settings-2-line",render:xb}),Cb=sl(J0),kb=sl(W0);function Vr(){const{angle:s}=Cb(),e=kb({listenOrientation:!0}),t=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=360}),n=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<=450}),r=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<640}),i=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d<768}),o=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>768&&d<1024}),a=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1024}),l=se(()=>{let d=e.width.value;return s.value>0&&(screen.height>screen.width?d=screen.height:d=screen.width),d>=1280}),u=se(()=>{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:u2,meta:{name:"notfound",auth:{requiresAuth:!1,role:"none"}}},{name:"Login",path:"/login",alias:"/",component:ny,meta:{name:"login",auth:{requiresAuth:!1,role:"none"},ui:{background:se(()=>$s.value?"var(--card-background)":void 0)}}},{name:"FirstSteps",path:"/first-steps",component:()=>vs(()=>import("./FirstSteps.5K7O1GAZ.0.0.59.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.Dyir9gg1.0.0.59.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:se(()=>!cc.value),fullwidth:se(()=>cc.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:xh,active:zc}},bottombar:{icon:{default:xh,active:zc}}}},{name:"Camera",path:"/cameras/:cameraname",component:()=>vs(()=>import("./Camera.B402UNR2.0.0.59.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:se(()=>$s.value),ignoreSafeAreaBottom:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:se(()=>!$s.value)}}},{name:"Camview",path:"/camview",component:()=>vs(()=>import("./Camview.3JR8srqY.0.0.59.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:se(()=>!cc.value)},background:"#000000",showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:wh,active:bh}},bottombar:{icon:{default:wh,active:bh}}}},{name:"Recordings",path:"/recordings",component:()=>vs(()=>import("./Recordings.CENwhYx8.0.0.59.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:se(()=>$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.XkULRDWR.0.0.59.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:Ch,active:Sh}},profileMenu:{icon:{default:Ch,active:Sh}}}},{name:"Console",path:"/console",component:()=>vs(()=>import("./Console.W83jr373.0.0.59.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:Eh,active:Ah}},profileMenu:{icon:{default:Eh,active:Ah}}}},{name:"Plugins",path:"/plugins",component:()=>vs(()=>import("./Plugins.BrRVAbdG.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"top",icon:{default:kh,active:Uc}},profileMenu:{icon:{default:kh,active:Uc}}}},{name:"ScopedPlugin",path:"/plugins/:scope/:pluginname",component:()=>vs(()=>import("./Plugin.C5n1wOvc.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Plugin",path:"/plugins/:pluginname",component:()=>vs(()=>import("./Plugin.C5n1wOvc.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0}}},{name:"Adminpanel",path:"/admin",component:()=>vs(()=>import("./Adminpanel.DgxPa7cC.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:$h,active:Mh}},profileMenu:{icon:{default:$h,active:Mh}}}},{name:"Cammesh",path:"/cammesh",component:()=>vs(()=>import("./Cammesh.CeRcBXPZ.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},navbar:{position:"bottom",icon:{default:Ph,active:Th}},profileMenu:{icon:{default:Ph,active:Th}}}},{name:"Settings",path:"/settings",component:()=>vs(()=>import("./Settings.Y_HQYita.0.0.59.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.CI8zj-Zp.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Ky,active:Vy}}}},{name:"SettingsAppearance",path:"appearance",component:()=>vs(()=>import("./SettingsAppearance.qKyWDUrO.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Wy,active:Xy}}}},{name:"SettingsUsers",path:"user",component:()=>vs(()=>import("./SettingsUsers.CttAtlXd.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ib,active:sb}}}},{name:"SettingsRecordings",path:"recordings",component:()=>vs(()=>import("./SettingsRecordings.DgWGltTw.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:ac,active:oc}}}},{name:"SettingsBackup",path:"backup",component:()=>vs(()=>import("./SettingsBackup.YnQZKJSH.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:cb,active:db}}}},{name:"SettingsRemote",path:"remote",component:()=>vs(()=>import("./SettingsRemote.Cd9txrZR.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:vb,active:pb}}}},{name:"SettingsSystem",path:"system",component:()=>vs(()=>import("./SettingsSystem.-M-CWxQc.0.0.59.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:se(()=>$s.value)},showNavbar:!0,showTopbar:!0,showBottombar:!0},settingsBar:{icon:{default:Sb,active:bb}}}}]}],La=mf({history:pf("/"),routes:uo,scrollBehavior:async()=>(await R_(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=mp(),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 Vm()}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=oe(new Map),e=oe(!1),t=oe(!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,O)=>new yf(te=>{b.emit(z,O,W=>{typeof W=="object"&&W.error?te.error(W):te.next(W),te.complete()})})}},l=se(()=>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}}),p9=["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},Eb=Symbol("cui-app-bus"),zi=Tr({navbarState:void 0,subbarState:void 0}),Rl=()=>{const s=Gh(Eb);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=se(()=>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=se(()=>e.path.includes("/settings")?i.value?"opened":t.subbarState?t.subbarState:"closed":void 0),u=se(()=>{var v;return!!Xs((v=e.meta.ui)==null?void 0:v.showNavbar)}),d=se(()=>{var v;return!!(Xs((v=e.meta.ui)==null?void 0:v.showBottombar)&&o.value.interface.showBottomBarOnMobile&&r.value)}),h=se(()=>{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},Ab={class:"pl-safe pt-safe h-full flex flex-col"},Mb={class:"overflow-hidden w-full pr-4"},$b={key:0,class:"ml-2 w-full flex flex-row items-center"},Pb={class:"flex flex-col flex-1 my-4 px-[0.9rem]"},Tb={class:"flex flex-col space-y-1"},Rb={class:"flex flex-col space-y-1 pb-safe"},Ib={key:0,class:"dark-mode text-muted pl-3 uppercase text-xs font-bold"},Ob=Tt({__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=Qt("navbarRef"),f=oe("closed"),b=Ls(),k=oe(!1),z=oe(!1),O=oe(!1),te=oe(!1);nl(v,R=>{const w=R.target,Q=w.closest("#menu-icon"),J=w.closest("#submenu-icon"),j=w.closest("#navbar-icon");!Q&&!J&&!j&&C()});const W=se(()=>d.value.interface.selectedSettingsView),I=se(()=>uo.filter(R=>{var w,Q;return((Q=(w=R.meta)==null?void 0:w.navbar)==null?void 0:Q.position)==="top"&&R.meta&&Si(R)})),E=se(()=>uo.filter(R=>{var w,Q;return((Q=(w=R.meta)==null?void 0:w.navbar)==null?void 0:Q.position)==="bottom"&&Si(R)})),N=se(()=>d.value.interface.navbarStayCollapsed&&f.value!=="opened"?"closed":l.value?"opened":f.value),D=se(()=>N.value==="closed"?a.value?vn.CLOSED:vn.MINIFIED:vn.EXPANDED);Ze(u,R=>{R&&R!==f.value&&(f.value=R==="minified"||R==="closed"?"closed":"opened")}),Ze(t.currentRoute,(R,w)=>{R.path!==w.path&&C()}),Ze(h,()=>{var R,w,Q,J;((R=h.value)==null?void 0:R.role)==="admin"||((w=h.value)==null?void 0:w.role)==="master"?(b.value=i.connectToNamespace("/server"),b.value.socket.on("plugin-updates",j=>{z.value=j.length>0||!1}),b.value.socket.on("server-updates",j=>{k.value=j.updateAvailable||j.betaUpdateAvailable||!1}),b.value.request("get-updates").subscribe(j=>{z.value=j.plugins.length>0||!1,k.value=j.server.updateAvailable||j.server.betaUpdateAvailable||!1})):(J=(Q=b.value)==null?void 0:Q.disconnect)==null||J.call(Q)},{deep:!0,immediate:!0}),Ze(O,R=>{R&&B()});const C=()=>{o.emit({navbarState:"closed"})},A=(R,w)=>{O.value&&w.channel==="update-check"&&w.status==="available"&&(k.value=!0)},B=async()=>{if(O.value){window.electron.removeListener("app-status",A),window.electron.on("app-status",A),window.electron.send("check-for-updates");try{const R=await window.electron.invoke("get-update-available");k.value=R.isUpdateAvailable}catch{}}},H=()=>{const R=document.querySelector('meta[name="electron-server"]'),w=R!==null&&R.getAttribute("content")==="true";O.value=window.electron!==void 0,te.value=w,setTimeout(()=>{O.value=window.electron!==void 0,te.value=w},100)};return Sn(()=>{H()}),vo(()=>{var R;(R=window.electron)==null||R.removeListener("app-status",A)}),e({navbarState:N}),(R,w)=>{var Se,F;const Q=Ei("RouterLink"),J=_o,j=ys,ie=jh,ue=Wm;return m(),M("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(D)===c(vn).EXPANDED}]),style:ot({left:c(D)===0?"-1px":"0px",width:`calc(${c(D)}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",Ab,[g("div",{class:at(["w-full flex items-center shrink-0 h-[60px]",{"mt-[25px]":c(O)}])},[y(Q,{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",Mb,[y(Pt,{name:"fade"},{default:$(()=>[c(D)===c(vn).EXPANDED?(m(),M("div",$b,[y(Q,{to:"/cameras",class:"text-white font-bold text-lg text-shadow"},{default:$(()=>w[0]||(w[0]=[Gt("camera.ui")])),_:1}),c(N)==="opened"&&c(a)?(m(),L(j,{key:0,id:"navbar-icon",class:"dark-mode ml-auto cui-icon-md text-white",text:"",rounded:"",onClick:C},{icon:$(()=>[y(J,{width:"100%",height:"100%"})]),_:1})):ae("",!0)])):ae("",!0)]),_:1})])],2),g("div",Pb,[g("div",Tb,[(m(!0),M(Ct,null,zt(c(I),q=>(m(),M("div",{key:q.name,class:"w-full h-[50px] relative"},[c(z)&&q.name==="Plugins"?(m(),L(ie,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ae("",!0),y(ue,{icon:q.meta.navbar.icon.default,"active-icon":q.meta.navbar.icon.active,to:q.path,label:R.$t(`navigation.${q.name.toLowerCase()}`),expanded:c(D)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(D)===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",Rb,[y(Pt,{name:"fade"},{default:$(()=>[c(N)==="opened"?(m(),M("span",Ib,he(R.$t("navigation.extras")),1)):ae("",!0)]),_:1}),(m(!0),M(Ct,null,zt(c(E),q=>(m(),M("div",{key:q.name,class:"w-full h-[50px] relative"},[c(k)&&q.name==="Settings"?(m(),L(ie,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] left-[31px] top-[10px] z-1"})):ae("",!0),y(ue,{icon:q.meta.navbar.icon.default,"active-icon":q.meta.navbar.icon.active,to:q.path==="/settings"?`/settings/${c(W)}`:q.path,"fallback-active-path":q.path,label:R.$t(`navigation.${q.name.toLowerCase()}`),expanded:c(D)===c(vn).EXPANDED,"dark-mode":"","show-tooltip":"","icon-size":22,"button-props":{style:{color:"#a4a4a4"}},class:at(["w-[50px] h-[50px]",{"w-full":c(D)===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(D)===c(vn).EXPANDED,"show-logout":"",to:"/settings/account","dark-mode":"","avatar-size":22,class:at(["w-[50px] h-[50px]",{"w-full":c(D)===c(vn).EXPANDED}])},null,8,["label","description","expanded","class"])])])])],6)}}}),Nb={HEIGHT:60},Fb={class:"px-2 h-full pb-safe-offset-1 flex items-center justify-around"},Lb=Tt({__name:"CuiBottombar",setup(s,{expose:e}){const t=Qt("bottombarRef"),n=se(()=>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=Wm;return m(),M("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(Nb).HEIGHT}px + env(safe-area-inset-bottom, 0px))`})},[g("div",Fb,[(m(!0),M(Ct,null,zt(c(n),a=>(m(),L(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)}}}),jb=qs(Lb,[["__scopeId","data-v-78d01fd3"]]),qb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Db(s,e){return m(),M("svg",qb,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 Bb=me({name:"lucide-trash2",render:Db}),zb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ub(s,e){return m(),M("svg",zb,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 Vb=me({name:"solar-bell-bold",render:Ub}),Hb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qb(s,e){return m(),M("svg",Hb,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 Kb=me({name:"material-symbols-close-rounded",render:Qb}),Zb={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function Gb(s,e){return m(),M("svg",Zb,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 Wb=me({name:"octicon-chevron-left16",render:Gb}),pp=Symbol("DialogStepper");function Jb(s){const e=oe(s),t=oe(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=se(()=>!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(pp,v),v}function f9(){const s=mi(pp);if(!s)throw new Error("useCuiDialogStepperContext must be used within a dialog that uses useCuiDialogStepper");return s}const Yb={class:"p-dialog-header justify-start gap-1"},Xb={key:0,class:"p-dialog-header-actions"},e5={class:"p-dialog-title"},t5={class:"p-dialog-header-actions ml-auto"},s5={key:0},n5=["innerHTML"],r5={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)"}},i5=Tt({__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=Jt(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:O,src:te,title:W,fullscreen:I,tabs:E,markdown:N}=r;Xc("dialogRefProps",r);const D=oe(!1),C=oe(null),A=oe(!1),B=oe(W.value);let H;const R=n.value.options.templates,w=se(()=>{var Y;return!!(D.value||a!=null&&a.value||Xs((Y=C.value)==null?void 0:Y.isLoading))}),Q=se(()=>E.value!==void 0&&E.value.length>0),J=se(()=>k!=null&&k.value?k.value:t("components.form.button.close")),j=se(()=>z!=null&&z.value?z.value:t("components.form.button.save")),ie=se(()=>({...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=se(()=>({...d==null?void 0:d.value,label:j.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}));Q.value&&(H=Jb(E.value??[]),Ze(H.isMainTab,Y=>{A.value=!Y},{immediate:!0}),H.on("updateTabTitle",({tabId:Y,title:Te})=>{(H==null?void 0:H.currentTab.value)===Y&&(W!=null&&W.value)&&(B.value=Te)}),H.on("tabChange",Y=>{B.value=(Y==null?void 0:Y.title)??W.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{D.value=!0;const He=await((Te=(Y=C.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{D.value=!1}},q=async()=>{var Y,Te,He,pt;try{D.value=!0;const ft=await((Te=(Y=C.value)==null?void 0:Y.onConfirm)==null?void 0:Te.call(Y));if(ft===null)return;O!=null&&O.value?(pt=(He=n.value.options).onConfirm)==null||pt.call(He,ft):n.value.close({status:"confirm",data:ft})}catch(ft){console.error(ft),e.add({severity:"error",summary:t("components.toast.title_error"),detail:ft.message,life:3e3})}finally{D.value=!1}};return(Y,Te)=>{var Je;const He=Wb,pt=ys,ft=Kb,Ge=Fa;return m(),M(Ct,null,[g("div",Yb,[y(Pt,{name:"slide-left"},{default:$(()=>{var de;return[c(A)?(m(),M("div",Xb,[y(pt,{severity:"secondary",text:"",rounded:"",class:"p-dialog-back-button",onClick:(de=c(H))==null?void 0:de.goToMainTab},{icon:$(()=>[y(He,{width:"100%",height:"100%"})]),_:1},8,["onClick"])])):ae("",!0)]}),_:1}),g("span",e5,he(c(B)),1),g("div",t5,[y(pt,{severity:"secondary",text:"",rounded:"",class:"p-dialog-close-button",onClick:c(n).close},{icon:$(()=>[y(ft,{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(I)},c(f)]),style:ot(c(b))},[c(i)&&!c(N)?(m(),M("span",s5,he(c(i)),1)):c(i)&&c(N)?(m(),M("div",{key:1,class:"w-full markdown-body",innerHTML:c(Se).render(c(i))},null,8,n5)):c(te)?(m(),L(Ge,{key:2,src:c(te),"image-container-class":"w-full h-full"},null,8,["src"])):(m(),L(Ai((Je=c(R))==null?void 0:Je.content),tt({key:3,ref_key:"componentRef",ref:C,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",r5,[c(h)?ae("",!0):(m(),L(pt,tt({key:0},c(ie),{class:"cui-button-medium",onClick:F}),null,16)),Te[0]||(Te[0]=g("div",{class:"ml-auto"},null,-1)),c(v)?ae("",!0):(m(),L(pt,tt({key:1},c(ue),{loading:c(w),disabled:c(l),class:"cui-button-medium",onClick:q}),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 o5(){return{open:(e,t)=>{const n={content:e&&me(e),options:t||{},data:t&&t.data,close:r=>{bu.emit("close",{instance:n,params:r})}};return bu.emit("open",{instance:n}),n}}}function Il(){const s=o5(),{mdBreakpoint:e}=Vr(),t=(u,d)=>{const h=Tr({...u});kl(h.options.props,d)},n=(u,d)=>(Ze(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:O,...te}=d,W={content:v?me(v):void 0},I=s.open(i5,{data:Jt(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:W,...te,events:O,onConfirm:b,onCancel:k,onClose:E=>{var N,D;if(((N=E==null?void 0:E.data)==null?void 0:N.status)==="confirm"){const{status:C,...A}=E.data;b==null||b((A==null?void 0:A.data)??A)}else k==null||k();z==null||z(((D=E==null?void 0:E.data)==null?void 0:D.data)??(E==null?void 0:E.data))}});return f.fullscreen?I:n(I,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 a5=sl(Wh);function Ol(){const s=se(()=>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=se(()=>typeof window>"u"?!1:[/Android/i].some(k=>navigator.userAgent.match(k))),t=se(()=>typeof window>"u"?!1:n.value||r.value),n=se(()=>typeof window>"u"?!1:[/iPhone/i].some(k=>navigator.userAgent.match(k))),r=se(()=>typeof window>"u"?!1:[/Macintosh/i].some(k=>navigator.userAgent.match(k)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>1)),i=se(()=>{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=se(()=>typeof window>"u"?!1:[/Safari/i].some(k=>navigator.userAgent.match(k))),a=se(()=>{if(typeof window>"u")return null;const b=/Version\/(\d+).+Safari/;return navigator.userAgent.match(b)}),l=se(()=>typeof window>"u"?!1:[/Firefox/i].some(k=>navigator.userAgent.match(k))),u=se(()=>typeof window>"u"?!1:[/Chrome/i].some(k=>navigator.userAgent.match(k))),d=se(()=>{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=se(()=>a5("(display-mode: standalone)").value||window.navigator.standalone||document.referrer.includes("android-app://")),v=se(()=>{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,O=k&&k>=17&&z&&z>=2;return!!(b||!n.value||n.value&&O)}),f=se(()=>{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 c5={class:"flex justify-between items-center mb-4 h-9"},l5={class:"flex items-center gap-2"},u5={class:"text-base font-semibold"},d5={class:"overflow-y-auto",style:{maxHeight:"234px"}},h5={class:"flex gap-3"},m5={class:"flex-1 min-w-0"},p5={class:"flex justify-between items-center"},f5={class:"font-semibold text-sm text-color truncate max-w-[200px]"},g5={class:"text-xs text-muted shrink-0"},v5={class:"text-xs text-muted mt-1 text-left line-clamp-2 overflow-hidden"},_5={key:0,class:"text-center py-8 text-muted text-sm"},y5=Tt({__name:"CuiNotificationMenu",setup(s){const{t:e}=js(),t=qr(),n=Pl(),r=Il(),{isTouch:i}=Ol(),o=Ls(),a=Qt("notificationsMenuRef"),l=oe([]),u=oe({}),d=oe(!1),h=oe(!1);Ze(d,C=>{C&&N()});const v=(C,[A])=>{var ie,ue;if(!A.isIntersecting){(ie=u.value[C])==null||ie.resetFn(),(ue=u.value[C])==null||ue.stopFn(),delete u.value[C];return}if(u.value[C])return;const B=A.target;if(!B.parentElement)return;const R=nl(B,()=>{u.value[C]&&u.value[C].resetFn()});let w;const Q=i.value?X0:ef,{direction:J,stop:j}=Q(B,{threshold:10,disableTextSelect:!0,onSwipe(){var Se,F;for(const q in u.value)q!==C&&((Se=u.value[q])==null||Se.resetFn());J.value==="left"?u.value[C]={left:"-75px",opacity:1,deleteOpacity:1,isSwiping:!0,resetFn(){this.left="0",this.opacity=1,this.deleteOpacity=0},stopFn:()=>{delete u.value[C],j(),R(),clearTimeout(w)}}:(F=u.value[C])==null||F.resetFn()},onSwipeEnd(){clearTimeout(w),w=setTimeout(()=>{u.value[C]&&(u.value[C].isSwiping=!1)},10)}})},f=C=>{var A;(A=a.value)==null||A.toggle(C)},b=C=>{const A=Date.now()-C,B=Math.floor(A/(1e3*60)),H=Math.floor(A/(1e3*60*60)),R=Math.floor(A/(1e3*60*60*24));return B<60?`${B}${e("components.notification_menu.short_minutes")}`:H<24?`${H}${e("components.notification_menu.short_hours")}`:R<7?`${R}${e("components.notification_menu.short_days")}`:R<30?`${Math.floor(R/7)}${e("components.notification_menu.short_weeks")}`:R<365?`${Math.floor(R/30)}${e("components.notification_menu.short_months")}`:`${Math.floor(R/365)}${e("components.notification_menu.short_years")}`},k=C=>{var B;const A=C.link;(B=a.value)==null||B.hide(),z(C),A&&t.push({path:A})},z=C=>{var A;if(C){const B=u.value[C._id];B==null||B.stopFn();const H=l.value.findIndex(R=>R._id===C._id);H!==-1&&(l.value.splice(H,1),(A=o.value)==null||A.socket.emit("remove-notification",C._id))}},O=()=>{var C,A;for(const B in u.value)(C=u.value[B])==null||C.stopFn();l.value.splice(0,l.value.length),(A=o.value)==null||A.socket.emit("clear-notifications")},te=C=>{switch(C){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)"}},W=C=>{const A=u.value[C._id];A!=null&&A.isSwiping||r.openTextDialog({data:{title:C.title,contentText:C.text,confirmText:C!=null&&C.link?e("components.form.button.go_to_message"):e("components.form.button.mark_as_read")},onConfirm:()=>k(C),onCancel:()=>z(C)})},I=()=>{var C,A;for(const B in u.value)(C=u.value[B])==null||C.resetFn(),(A=u.value[B])==null||A.stopFn()},E=(C,A)=>{if(d.value&&A.channel==="update-check"&&A.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(H=>H._id===B._id))return;l.value.push(B)}},N=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 A={_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===A._id))return;l.value.push(A)}}catch{}}};el(()=>{o.value=n.connectToNamespace("/notifications"),o.value.request("get-notifications").subscribe(C=>{l.value=C}),o.value.socket.on("notifications",C=>{l.value=C}),o.value.socket.on("remove-notification",C=>{const A=l.value.findIndex(B=>B._id===C||B.title===C);A!==-1&&l.value.splice(A,1)}),o.value.socket.on("clear-notifications",()=>{l.value=[]})});const D=()=>{const C=document.querySelector('meta[name="electron-server"]'),A=C!==null&&C.getAttribute("content")==="true";d.value=window.electron!==void 0,h.value=A,setTimeout(()=>{d.value=window.electron!==void 0,h.value=A},100)};return Sn(()=>{D()}),vo(()=>{var C,A,B;(A=(C=o.value)==null?void 0:C.end)==null||A.call(C),(B=window.electron)==null||B.removeListener("app-status",E)}),(C,A)=>{const B=Vb,H=jh,R=ys,w=Bb,Q=Ea,J=Qc;return m(),M(Ct,null,[y(R,{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(),L(H,{key:0,class:"absolute min-w-[8px] w-[8px] h-[8px] right-[10px] top-[7px]"})):ae("",!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:I},{default:$(()=>[g("div",c5,[g("div",l5,[g("h3",u5,he(C.$t("components.notification_menu.notifications")),1),y(H,{class:"rounded-full text-xs p-1"},{default:$(()=>[Gt(he(c(l).length>99?"99+":c(l).length),1)]),_:1})]),c(l).length?(m(),L(R,{key:0,severity:"danger",text:"",rounded:"",class:"p-2 cui-icon-md",onClick:O},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:1})):ae("",!0)]),g("div",d5,[(m(!0),M(Ct,null,zt(c(l),j=>{var ie,ue,Se;return m(),M("div",{key:j._id,class:"relative overflow-hidden"},[It((m(),M("div",{class:"relative transition-all duration-200",style:ot({left:((ie=c(u)[j._id])==null?void 0:ie.left)||"0",opacity:((ue=c(u)[j._id])==null?void 0:ue.opacity)||1})},[y(R,{severity:"secondary",text:"",class:"cui-button p-2 block w-full",onClick:F=>W(j)},{default:$(()=>[g("div",h5,[g("div",{class:"w-2 h-2 rounded-full mt-2",style:ot({backgroundColor:te(j.type)})},null,4),g("div",m5,[g("div",p5,[g("h4",f5,he(j.title),1),g("span",g5,he(b(j.timestamp)),1)]),g("p",v5,he(j.text),1)])])]),_:2},1032,["onClick"])],4)),[[c(Y0),F=>v(j._id,F)]]),g("div",{class:"absolute right-0 top-0 h-full flex items-center pr-4",style:ot({opacity:((Se=c(u)[j._id])==null?void 0:Se.deleteOpacity)||0})},[y(R,{severity:"danger",class:"cui-icon-sm",text:"",rounded:"",onClick:F=>z(j)},{icon:$(()=>[y(w,{width:"100%",height:"100%"})]),_:2},1032,["onClick"])],4),c(l).indexOf(j)!==c(l).length-1?(m(),L(Q,{key:0,class:"my-0 py-1"})):ae("",!0)])}),128))]),c(l).length===0?(m(),M("div",_5,he(C.$t("components.notification_menu.no_notifications")),1)):ae("",!0)]),_:1},512)],64)}}}),b5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w5(s,e){return m(),M("svg",b5,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 x5=me({name:"material-symbols-light-mode-rounded",render:w5}),S5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C5(s,e){return m(),M("svg",S5,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 k5=me({name:"material-symbols-dark-mode",render:C5}),E5={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"},A5=["id"],M5=["mask"];function $5(s,e){return m(),M("svg",E5,[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,A5)]),g("path",{fill:"currentColor",d:"M0 0h48v48H0z",mask:"url(#"+s.idMap.ipSDarkMode0+")"},null,8,M5)])}const P5=me({name:"icon-park-solid-dark-mode",render:$5,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=xu(e.theme,{onBeforeChange(){if(!r.value)return!1},onChanged(h){e.theme=h,localStorage.setItem("theme",JSON.stringify(e))}}),n=xu(e.autoMode,{onBeforeChange(h){if(h&&!r.value)return!1},onChanged(h){e.autoMode=h,localStorage.setItem("theme",JSON.stringify(e))}}),r=oe(!0),i=Tr(["light","dark"]);Ze(n,h=>{h&&(t.value=o())}),Ze(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=Wh("(prefers-color-scheme: dark)");return Ze(d,h=>{n.value&&(t.value=h?"dark":"light")}),l(a()),{colors:i,theme:t,autoMode:n,setAppTheme:l,getSystemMode:o,toggleTheme:u}}),T5=Tt({__name:"CuiThemeSwitch",setup(s){const e=Nl(),{theme:t,autoMode:n}=Vs(e),r=()=>{e.toggleTheme()};return(i,o)=>{const a=P5,l=k5,u=x5,d=ys;return m(),L(d,{severity:"secondary",text:"",class:"cui-button p-2 text-color",onClick:r},{default:$(()=>[c(n)?(m(),L(a,{key:0,class:"w-6 h-6"})):c(t)==="dark"?(m(),L(l,{key:1,class:"w-6 h-6"})):c(t)==="light"?(m(),L(u,{key:2,class:"w-6 h-6"})):ae("",!0)]),_:1})}}}),R5={class:"relative flex overflow-hidden items-center justify-center w-5 h-5"},I5={class:"flex flex-col justify-between w-4 h-3 transform transition-all duration-100 origin-center overflow-hidden"},O5=Tt({__name:"CuiNavbarToggle",setup(s){const e=Tl(),{bus:t}=Rl(),{navbarState:n}=ja(),{xlBreakpoint:r}=Vr(),{uiSettings:i}=Vs(e),o=oe("closed"),a=se(()=>o.value==="opened");Ze(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(),L(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",R5,[g("div",I5,[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})):ae("",!0)}}}),N5={class:"group relative flex items-center"},F5={key:0,class:"flex items-center mr-3 pointer-events-auto"},L5={class:"flex-1 min-w-0 text-left"},j5={class:"text-sm font-medium truncate"},q5=["is-exact-active"],D5=["is-exact-active"],B5=Tt({__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}=Jt(n),[d,h]=lc(),[v,f]=lc(),b=k=>{r.value||t("click",k)};return(k,z)=>{const O=ys,te=Ei("RouterLink"),W=jr;return m(),M("div",N5,[y(c(v),null,{default:$(({isExactActive:I})=>[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(),M("div",F5,[ei(k.$slots,"prepend",{isExactActive:I??!1},void 0,!0)])):ae("",!0),g("div",L5,[g("div",j5,[ei(k.$slots,"default",{isExactActive:I??!1},void 0,!0)]),k.$slots.subtitle?(m(),M("div",{key:0,"is-exact-active":I??!1,class:"text-sm text-muted mt-0.5"},[ei(k.$slots,"subtitle",{},void 0,!0)],8,q5)):ae("",!0)]),k.$slots.append?(m(),M("div",{key:1,"is-exact-active":I??!1,class:"flex items-center ml-3 pointer-events-auto"},[ei(k.$slots,"append",{},void 0,!0)],8,D5)):ae("",!0)],2)]),_:3}),y(c(d),null,{default:$(({isExactActive:I})=>[It(y(O,tt({text:"",fluid:"",disabled:c(r),severity:"contrast",class:["cui-button absolute inset-0",[{active:c(i)||I,"cursor-not-allowed disabled":c(r)},c(i)||I?c(a):void 0]]},c(l),{onClick:b}),null,16,["disabled","class"]),[[W,{value:c(u)}]]),y(c(f),{"is-exact-active":I},null,8,["is-exact-active"])]),_:1}),c(o)?(m(),L(te,{key:0,to:c(o),class:"block transition-all duration-300"},{default:$(({isExactActive:I})=>[y(c(h),{"is-exact-active":I},null,8,["is-exact-active"])]),_:1},8,["to"])):(m(),L(c(h),{key:1}))])}}}),fp=qs(B5,[["__scopeId","data-v-115e51ef"]]),z5={key:0,class:"flex flex-col gap-1"},U5={key:2,class:"flex flex-col gap-1"},V5={key:4,class:"flex flex-col gap-1"},gp=Tt({__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}=Jt(r),u=Qt("menuRef"),d=oe(!1),h=oe(),[v,f]=lc(),b=se(()=>{const C=i.value.filter(A=>!A.hide);return l.value?C.sort((A,B)=>A.key&&B.key?A.key.localeCompare(B.key):A.label&&B.label?A.label.localeCompare(B.label):0):C}),k=se(()=>b.value.filter(C=>C.position==="header")),z=se(()=>b.value.filter(C=>C.position==="footer")),O=se(()=>b.value.filter(C=>!C.position)),te=C=>{var A;o.value&&N(),(A=C.onClick)==null||A.call(C,wu(h.value)),n("click:menu-item",C)},W=()=>{d.value=!0,n("show")},I=()=>{h.value=void 0,d.value=!1,n("hide")},E=(C,A,B)=>{var H;h.value=B,(H=u.value)==null||H.toggle(C,A)},N=()=>{var C;(C=u.value)==null||C.hide()},D=(C,A)=>{var B;(B=u.value)==null||B.show(C,A)};return e({menu:u,isOpen:d,data:wu(h),toggleMenu:E,hide:N,show:D}),(C,A)=>{const B=Gm,H=fo,R=fp,w=Ea,Q=Qc;return m(),L(Q,tt({ref_key:"menuRef",ref:u,class:"shadow-lg cui-rounded-corner"},c(a),{onShow:W,onHide:I}),{default:$(()=>[y(c(v),null,{default:$(({item:J})=>[(m(),L(R,{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:j=>te(J)},Qh({default:$(({isExactActive:j})=>[g("span",tt(J.labelProps,{class:{"text-primary":j||J.active,"!font-bold":J.avatarProps,"opacity-70":!J.disabled}}),he(J.label),17)]),_:2},[J.avatarProps||J.icon?{name:"prepend",fn:$(({isExactActive:j})=>[J.avatarProps?(m(),L(B,H0(tt({key:0},J.avatarProps)),null,16)):ae("",!0),J.icon?(m(),L(Ai(J.icon),tt({key:1},J.iconProps,{class:{"text-primary":j||J.active,"opacity-70":!J.disabled}}),null,16,["class"])):ae("",!0)]),key:"0"}:void 0,J.description?{name:"subtitle",fn:$(()=>[g("span",tt(J.descriptionProps,{class:{"opacity-70":!J.disabled}}),he(J.description),17)]),key:"1"}:void 0,J.toggle?{name:"append",fn:$(()=>[y(H,{"model-value":J.toggleState,disabled:J.disabled,"onUpdate:modelValue":j=>te(J)},null,8,["model-value","disabled","onUpdate:modelValue"])]),key:"2"}:void 0]),1032,["to","disabled","button-props","tooltip","onClick"]))]),_:1}),c(k).length?(m(),M("div",z5,[(m(!0),M(Ct,null,zt(c(k),(J,j)=>(m(),L(c(f),{key:j,item:J},null,8,["item"]))),128))])):ae("",!0),c(k).length&&c(O).length?(m(),L(w,{key:1,class:"m-0 py-3"})):ae("",!0),c(O).length?(m(),M("div",U5,[(m(!0),M(Ct,null,zt(c(O),(J,j)=>(m(),L(c(f),{key:j,item:J},null,8,["item"]))),128))])):ae("",!0),c(O).length&&c(z).length?(m(),L(w,{key:3,class:"m-0 py-3"})):ae("",!0),c(z).length?(m(),M("div",V5,[(m(!0),M(Ct,null,zt(c(z),(J,j)=>(m(),L(c(f),{key:j,item:J},null,8,["item"]))),128))])):ae("",!0)]),_:1},16)}}}),H5={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q5(s,e){return m(),M("svg",H5,e[0]||(e[0]=[Hh('<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 K5=me({name:"iconoir-reload-window",render:Q5}),Z5={class:"relative w-6 h-6"},G5=Tt({__name:"CuiProfileMenu",setup(s){const{t:e}=js(),t=Fs(),{user:n}=Vs(t),r=Qt("menuRef"),i=se(()=>uo.filter(l=>{var u;return((u=l.meta)==null?void 0:u.profileMenu)&&l.meta.auth&&Si(l)})),o=se(()=>{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:K5,onClick:a}],d={label:e("components.user_menu.logout"),icon:Xh,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=gp;return m(),M(Ct,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",Z5,[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)}}}),W5={HEIGHT:60},J5={class:"flex flex-row items-center flex-1 p-2"},Y5=Tt({__name:"CuiTopbar",setup(s){const{showBottombar:e}=ja();return(t,n)=>{const r=G5,i=O5,o=T5,a=y5;return m(),M("header",{class:"cui-topbar fixed flex flex-row items-center right-0 pt-safe pr-safe draggable-region",style:ot({height:`calc(${c(W5).HEIGHT}px + env(safe-area-inset-top, 0px))`})},[g("div",J5,[c(e)?(m(),L(r,{key:0,class:"non-draggable-region"})):(m(),L(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(),L(a,{key:2})):ae("",!0)])],4)}}}),X5=qs(Y5,[["__scopeId","data-v-162b131f"]]),ew={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tw(s,e){return m(),M("svg",ew,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 sw=me({name:"majesticons-open",render:tw}),vp=Tt({__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}=Jt(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(),M("div",{class:at(["flex flex-wrap gap-2",{"opacity-60 pointer-events-none":c(r)}])},[ei(l.$slots,"default")],2))}}),nw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rw(s,e){return m(),M("svg",nw,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 _p=me({name:"mdi-check",render:rw}),iw={key:0,class:"absolute left-1 top-1/2 transform -translate-y-1/2 flex items-center justify-center cui-icon-sm"},ow=Tt({__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}=Jt(e),a=mi("chipGroup"),l=se(()=>r.value||(a==null?void 0:a.disabled.value)),u=se(()=>{if(!a)return!1;const v=a.modelValue.value;return Array.isArray(v)?v.includes(t.value):v===t.value}),d=se(()=>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=_p,k=I0;return m(),L(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(Pt,{name:"fade"},{default:$(()=>[c(o)&&c(u)?(m(),M("div",iw,[y(b,{width:"100%",height:"100%"})])):ae("",!0)]),_:1}),ei(v.$slots,"default",{},void 0,!0)]),_:3},8,["removable","disabled","class"])}}}),yp=qs(ow,[["__scopeId","data-v-3b79f904"]]),aw=async({cameraData:s})=>(await Oe.post("/cameras",s)).data,cw=async({cameraData:s})=>(await Oe.post("/cameras/pair",s)).data,lw=async({cameraData:s})=>(await Oe.post("/cameras/preview",s)).data,bp=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}`,{signal:e})).data,uw=async({cameraname:s})=>(await Oe.delete(`/cameras/${s}/log`)).data,dw=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}/log/download`,{signal:e})).data,hw=async({cameraname:s,sourcename:e,probeConfig:t,signal:n})=>(await Oe.get(`/cameras/${s}/probe/${e}`,{params:{...t},signal:n})).data,mw=async({cameraname:s,forceNew:e,signal:t})=>(await Oe.get(`/cameras/${s}/snapshot`,{signal:t,params:{forceNew:e}})).data,pw=async({parameter:s,signal:e})=>(await Oe.get("/cameras",{params:s,signal:e})).data,fw=async({type:s,src:e,signal:t})=>(await Oe.get("/cameras/discover",{params:{type:s,src:e},signal:t})).data,gw=async({cameraname:s,cameraData:e})=>(await Oe.patch(`/cameras/${s}`,e)).data,vw=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}/extensions`,{signal:e})).data,_w=async({cameraname:s,pluginname:e,signal:t})=>(await Oe.get(`/cameras/${s}/${e}/config`,{signal:t})).data,yw=async({cameraname:s,pluginname:e,configData:t})=>(await Oe.patch(`/cameras/${s}/${e}/config`,t)).data,bw=async({cameraname:s,pluginname:e,configData:t})=>(await Oe.put(`/cameras/${s}/${e}/config`,t)).data,ww=async({cameraname:s,pluginname:e,configData:t})=>(await Oe.post(`/cameras/${s}/${e}/config`,t)).data,xw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.put(`/cameras/${s}/${e}/enable`,null,{params:{type:t}})).data,Sw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.put(`/cameras/${s}/${e}/disable`,null,{params:{type:t}})).data,Cw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.post(`/cameras/${s}/${e}`,null,{params:{type:t}})).data,kw=async({cameraname:s,pluginname:e,type:t})=>(await Oe.delete(`/cameras/${s}/${e}`,{params:{type:t}})).data,Ew=async({cameraname:s,signal:e})=>(await Oe.get(`/cameras/${s}/zones`,{signal:e})).data,Aw=async({cameraname:s,zoneData:e})=>(await Oe.patch(`/cameras/${s}/zones`,e)).data,Mw=async({cameraname:s})=>(await Oe.delete(`/cameras/${s}`)).data,$w=async()=>(await Oe.delete("/cameras")).data;class Jn{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{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 dt({mutationFn:aw,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 dt({mutationFn:cw,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 dt({mutationFn:lw})}getCameraQuery(e){return Vt({queryKey:["cameras",e],queryFn:({signal:t})=>bp({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraQuery"&&t.enabled)})}getCameraExtensionsQuery(e){return Vt({queryKey:["camerasExtensions",e],queryFn:({signal:t})=>vw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getCameraExtensionsQuery"&&t.enabled)})}probeCameraSourceQuery(e,t,n){return Vt({queryKey:["cameras",e,"probe",t],queryFn:({signal:r})=>hw({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 Vt({queryKey:["camerasSnapshot",e],queryFn:({signal:n})=>mw({cameraname:c(e),forceNew:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getCameraSnapshotQuery"&&n.enabled),retry:!1})}getCamerasQuery(e){return Vt({queryKey:["camerasList",e],queryFn:({signal:t})=>pw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getCamerasQuery"&&t.enabled)})}discoverCamerasQuery(e){return Vt({queryKey:["cameras","discover",e],queryFn:({signal:t})=>fw({...c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="discoverCamerasQuery"&&t.enabled)})}patchCameraQuery(){return dt({mutationFn:gw,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 Vt({queryKey:["cameras","extensions",e,t],queryFn:({signal:r})=>_w({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 dt({mutationFn:yw,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 dt({mutationFn:bw,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 dt({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]})}})}enableCameraExtensionQuery(){return dt({mutationFn:xw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}disableCameraExtensionQuery(){return dt({mutationFn:Sw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}addCameraExtensionQuery(){return dt({mutationFn:Cw,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 Vt({queryKey:["cameras",e,"zones"],queryFn:({signal:t})=>Ew({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getZonesQuery"&&t.enabled)})}patchZonesQuery(){return dt({mutationFn:Aw,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 dt({mutationFn:kw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["cameras",t.cameraname],exact:!0}),await this._queryClient.refetchQueries({queryKey:["camerasExtensions",t.cameraname]})}})}removeCameraQuery(){return dt({mutationFn:Mw,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 dt({mutationFn:$w,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 Vt({queryKey:["logs",e],queryFn:({signal:t})=>dw({cameraname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return dt({mutationFn:uw,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 Pw=async({pluginData:s})=>(await Oe.post("/plugins",s)).data,Tw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}`,{signal:e})).data,Rw=async({pluginname:s,signal:e})=>(await Oe.get(`/plugins/${s}/versions`,{signal:e})).data,Iw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/update`,{signal:e})).data,Ow=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/logo`,{signal:e})).data,Nw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/config`,{signal:e})).data,Fw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/contract`,{signal:e})).data,Lw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/readme`,{signal:e})).data,jw=async({pluginName:s,query:e,signal:t})=>(await Oe.get(`/plugins/${s}/changelog`,{params:e,signal:t})).data,qw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/interface`,{signal:e})).data,Dw=async({parameter:s,signal:e})=>(await Oe.get("/plugins",{params:s,signal:e})).data,Bw=async({parameter:s,signal:e})=>(await Oe.get("/plugins/extensions",{params:s,signal:e})).data,zw=async({pluginName:s})=>(await Oe.delete(`/plugins/${s}/log`)).data,Uw=async({pluginName:s,signal:e})=>(await Oe.get(`/plugins/${s}/log/download`,{signal:e})).data,Vw=async({parameter:s,signal:e})=>(await Oe.get("/plugins/progress",{params:s,signal:e})).data,Hw=async({query:s,parameter:e,signal:t})=>(await Oe.get("/plugins/search",{params:{...s,...e},signal:t})).data,Qw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/enable`)).data,Kw=async({pluginName:s,configData:e})=>(await Oe.patch(`/plugins/${s}/config`,e)).data,Zw=async({pluginname:s,configData:e})=>(await Oe.put(`/plugins/${s}/config`,e)).data,Gw=async({pluginname:s,configData:e})=>(await Oe.post(`/plugins/${s}/config`,e)).data,Ww=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/disable`)).data,Jw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/start`)).data,Yw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/stop`)).data,Xw=async({pluginName:s})=>(await Oe.put(`/plugins/${s}/restart`)).data,e3=async({pluginName:s,formData:e})=>(await Oe.post(`/plugins/${s}/detect/motion`,e,{responseType:"arraybuffer"})).data,t3=async({pluginName:s,formData:e})=>(await Oe.post(`/plugins/${s}/detect/objects`,e)).data,s3=async({pluginName:s,formData:e})=>(await Oe.post(`/plugins/${s}/detect/audio`,e)).data,n3=async({pluginName:s,removeStorage:e})=>(await Oe.delete(`/plugins/${s}`,{params:{removeStorage:e}})).data,r3=async()=>(await Oe.delete("/plugins")).data;class Fl{constructor(){p(this,"_queryClient",Ci());p(this,"t",js().t);p(this,"toast",Cn());p(this,"queryActivator",oe([{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 dt({mutationFn:Pw,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 Vt({queryKey:["plugins",e],queryFn:({signal:t})=>Tw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginQuery"&&t.enabled)})}getPluginsQuery(e){return Vt({queryKey:["pluginsList",e],queryFn:({signal:t})=>Dw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsQuery"&&t.enabled)})}getPluginsExtensionsQuery(e){return Vt({queryKey:["extensionsList",e],queryFn:({signal:t})=>Bw({parameter:c(e),signal:t}),placeholderData:t=>t,enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsExtensionsQuery"&&t.enabled)})}getPluginsProgressQuery(e){return Vt({queryKey:["pluginsProgress",e],queryFn:({signal:t})=>Vw({parameter:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginsProgressQuery"&&t.enabled)})}searchPluginsQuery(e,t){return Vt({queryKey:["pluginsSearch",e,t],queryFn:({signal:n})=>Hw({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 Vt({queryKey:["plugins",e,"versions"],queryFn:({signal:t})=>Rw({pluginname:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginVersionsQuery"&&t.enabled)})}getPluginUpdateQuery(e){return Vt({queryKey:["plugins",e,"update"],queryFn:({signal:t})=>Iw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginUpdateQuery"&&t.enabled)})}getPluginLogoQuery(e){return Vt({queryKey:["plugins",e,"logo"],queryFn:({signal:t})=>Ow({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginLogoQuery"&&t.enabled)})}getPluginConfigQuery(e){return Vt({queryKey:["plugins",e,"config"],queryFn:({signal:t})=>Nw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginConfigQuery"&&t.enabled)})}getPluginContractQuery(e){return Vt({queryKey:["plugins",e,"contract"],queryFn:({signal:t})=>Fw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginContractQuery"&&t.enabled)})}getPluginReadmeQuery(e){return Vt({queryKey:["plugins",e,"readme"],queryFn:({signal:t})=>Lw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginReadmeQuery"&&t.enabled)})}getPluginInterfaceQuery(e){return Vt({queryKey:["plugins",e,"interface"],queryFn:({signal:t})=>qw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="getPluginInterfaceQuery"&&t.enabled)})}getPluginChangelogQuery(e,t){return Vt({queryKey:["plugins",e,"changelog"],queryFn:({signal:n})=>jw({pluginName:c(e),query:c(t),signal:n}),enabled:()=>this.queryActivator.value.some(n=>n.name==="getPluginChangelogQuery"&&n.enabled)})}patchPluginConfigQuery(){return dt({mutationFn:Kw,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 dt({mutationFn:Jw,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 dt({mutationFn:Yw,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 dt({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_restarted"),life:3e3})}})}detectMotionQuery(){return dt({mutationFn:e3})}detectObjectsQuery(){return dt({mutationFn:t3})}detectAudioQuery(){return dt({mutationFn:s3})}setPluginConfigQuery(){return dt({mutationFn:Zw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}submitPluginConfigQuery(){return dt({mutationFn:Gw,onSuccess:async(e,t)=>{await this._queryClient.refetchQueries({queryKey:["plugins",t.pluginname,t.configData]})}})}enablePluginQuery(){return dt({mutationFn:Qw,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 dt({mutationFn:Ww,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 dt({mutationFn:n3,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 dt({mutationFn:r3,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 Vt({queryKey:["logs",e],queryFn:({signal:t})=>Uw({pluginName:c(e),signal:t}),enabled:()=>this.queryActivator.value.some(t=>t.name==="downloadLogQuery"&&t.enabled)})}clearLogQuery(){return dt({mutationFn:zw,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 i3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function o3(s,e){return m(),M("svg",i3,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=me({name:"mdi-plus-circle",render:o3}),a3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c3(s,e){return m(),M("svg",a3,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 l3=me({name:"mdi-information",render:c3}),u3={key:0,class:"flex flex-col field-gap"},d3=["for"],h3={key:1,class:"flex flex-col field-gap"},m3=["for"],p3=["for"],f3=["for"],g3={class:"flex items-center gap-4"},v3={class:"flex flex-col field-switch-gap"},_3=["for"],y3=["for"],b3={class:"flex gap-2 items-center w-full"},w3={class:"text-color"},x3={class:"w-full h-full flex flex-col gap-6"},S3={class:"flex flex-row w-full items-center justify-center mt-3"},C3=Tt({__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}=Jt(i),h=oe(0),v=oe(0),f=oe(a.value.opened?[l.value]:[]);Ze(r,()=>{h.value++},{deep:!0});const b=tf(async()=>{if(ar(a.value)&&a.value.format==="qrCode"){let I;return o.value==="dark"?I={dark:"#FFFFFFFF",light:"#FF000000"}:I={dark:"#404040FF",light:"#FFFFFFFF"},await kf.toDataURL(W.value||"",{margin:.5,type:"image/png",color:I,scale:10})}},void 0,{lazy:!0}),k=se(()=>{if(ar(a.value)&&a.value.format==="image")return W.value}),z=(I,E)=>{const N=ni(I,E);return Array.isArray(N)?N:[]},O=I=>{const E=ni(r.value,I),N=Array.isArray(E)?[...E]:[];yh(a.value)&&a.value.items&&(N.push($l(a.value.items)),ic(r.value,I,N),v.value++)},te=(I,E)=>{const N=ni(r.value,I);if(Array.isArray(N)){const D=[...N];D.splice(E,1),ic(r.value,I,D),v.value++,n("onTrigger")}},W=se({get:()=>(h.value,ni(r.value,l.value)),set:I=>{const E=a.value;let N=I;xa(E)?E.multiple?N=Array.isArray(I)?I:[I]:N=I&&I.toString():ar(E)?N=I!=null?I.toString():"":vh(E)?N=typeof I=="number"?I:parseFloat(I)||0:_h(E)&&(N=I==="true"||I===!0),ic(r.value,l.value,N),h.value++}});return(I,E)=>{const N=Fa,D=ki,C=Lh,A=_o,B=ys,H=Aa,R=go,w=Kc,Q=qh,J=fo,j=Zc,ie=Dh,ue=l3,Se=Jc,F=Ei("CuiSchemaField",!0),q=wp,Y=Yc,Te=Wc,He=Gc,pt=Bh,ft=jr;return m(),M("div",null,[c(ar)(c(a))&&c(a).format==="qrCode"?(m(),M("div",u3,[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,d3),y(N,{src:c(b),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):ae("",!0),c(ar)(c(a))&&c(a).format==="image"?(m(),M("div",h3,[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,m3),y(N,{src:c(k),class:"mb-3","image-container-class":"w-full h-full"},null,8,["src"])])):c(j2)(c(a))?(m(),L(c(Dt),{key:2,modelValue:c(W),"onUpdate:modelValue":E[1]||(E[1]=Ge=>ps(W)?W.value=Ge:null),modelModifiers:{trim:!0},name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,p3),y(R,null,{default:$(()=>[c(a).format!=="password"?(m(),L(D,tt({key:0},Ge,{invalid:Je.length>0,readonly:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),type:"text"}),null,16,["invalid","readonly","placeholder","loading"])):(m(),L(C,tt({key:1,"model-value":c(W),invalid:Je.length>0,readonly:c(a).readonly},Ge,{feedback:!1,"toggle-mask":""}),null,16,["model-value","invalid","readonly"])),c(u)?(m(),L(H,{key:2},{default:$(()=>[y(B,{text:"",severity:"secondary",loading:c(d),onClick:E[0]||(E[0]=de=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A)]),_:1},8,["loading"])]),_:1})):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!Je.length&&c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)]),_:1},8,["modelValue","name"])):c(vh)(c(a))?(m(),L(c(Dt),{key:3,"model-value":c(W),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,f3),y(R,null,{default:$(()=>[y(Q,tt(Ge,{modelValue:c(W),"onUpdate:modelValue":E[2]||(E[2]=de=>ps(W)?W.value=de:null),invalid:Je.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]=de=>W.value=de),onInput:E[4]||(E[4]=de=>W.value=de.value)}),null,16,["modelValue","invalid","readonly","step","min","max","loading"]),c(u)?(m(),L(H,{key:0},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[5]||(E[5]=de=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A)]),_:1},8,["loading"])]),_:1})):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!Je.length&&c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)]),_:1},8,["model-value","name"])):c(_h)(c(a))?(m(),L(c(Dt),{key:4,"model-value":c(W),value:!0,"unchecked-value":!1,type:"checkbox",name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("div",g3,[g("div",v3,[g("label",{for:c(l),class:"cui-label-switch"},he(c(a).title),9,_3),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-switch-error"},null,8,["name"])]),_:1})]),y(J,tt({"model-value":c(W)},Ge,{invalid:Je.length>0,loading:c(d),class:"ml-auto shrink-0",onValueChange:E[6]||(E[6]=de=>W.value=de)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value","name"])):c(xa)(c(a))?(m(),L(c(Dt),{key:5,"model-value":c(W),name:c(l),as:"div",class:"flex flex-col field-gap"},{default:$(({field:Ge,errors:Je})=>[g("label",{for:c(l),class:"cui-label"},he(c(a).title),9,y3),y(R,null,{default:$(()=>[c(a).multiple?(m(),L(ie,tt({key:1},Ge,{"model-value":c(W),options:c(a).enum,invalid:Je.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]=de=>W.value=de)}),null,16,["model-value","options","invalid","disabled","placeholder","show-clear","loading"])):(m(),L(j,tt({key:0},Ge,{"model-value":c(W),options:c(a).enum,invalid:Je.length>0,disabled:c(a).readonly,placeholder:c(a).placeholder,loading:c(d),onValueChange:E[7]||(E[7]=de=>W.value=de)}),null,16,["model-value","options","invalid","disabled","placeholder","loading"])),c(u)?(m(),L(H,{key:2},{default:$(()=>[y(B,{text:"",rounded:"",severity:"danger",loading:c(d),onClick:E[9]||(E[9]=de=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A)]),_:1},8,["loading"])]),_:1})):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:c(l),class:"cui-input-error"},null,8,["name"])]),_:1}),!Je.length&&c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)]),_:1},8,["model-value","name"])):c(zr)(c(a))?(m(),M(Ct,{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(Ge=>n("onAction",{key:c(l)}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)],64)):c(Ur)(c(a))?(m(),M(Ct,{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(Ge=>n("onSubmit",{key:c(a).key}),["prevent"]))},null,8,["severity","loading","label"]),c(a).description?(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(c(a).description),1)]),_:1})):ae("",!0)],64)):c(yh)(c(a))&&c(a).items?(m(),L(pt,{key:8,class:"cui-card border-color-inner",pt:{body:{class:"p-1"}}},{content:$(()=>[(m(),L(He,{key:c(v),value:c(f),"onUpdate:value":E[18]||(E[18]=Ge=>ps(f)?f.value=Ge:null),multiple:""},{default:$(()=>[y(Te,{value:c(l)??"0",class:"border-none"},{default:$(()=>[y(Se,null,{default:$(()=>[g("div",b3,[c(a).description?It((m(),L(ue,{key:0,class:"text-muted"},null,512)),[[ft,{value:c(a).description}]]):ae("",!0),g("span",w3,he(c(a).title||c(l)),1),c(u)?(m(),L(B,{key:1,text:"",rounded:"",severity:"danger",class:"cui-icon-md ml-auto mr-2",loading:c(d),onClick:E[12]||(E[12]=Ge=>te(c(u).key,c(u).index))},{icon:$(()=>[y(A,{width:"100%",height:"100%"})]),_:1},8,["loading"])):ae("",!0)])]),_:1}),y(Y,null,{default:$(()=>[g("div",x3,[(m(!0),M(Ct,null,zt(z(r.value,c(l)),(Ge,Je)=>(m(),L(F,{key:`item-${Je}`,modelValue:r.value,"onUpdate:modelValue":E[13]||(E[13]=de=>r.value=de),"schema-field":c(a).items,"config-key":`${c(l)}[${Je}]`,"array-item":{key:c(l),index:Je},loading:c(d),onOnAction:E[14]||(E[14]=de=>n("onAction",de)),onOnSubmit:E[15]||(E[15]=de=>n("onSubmit",de)),onOnTrigger:E[16]||(E[16]=()=>v.value++)},null,8,["modelValue","schema-field","config-key","array-item","loading"]))),128)),g("div",S3,[y(B,{text:"",rounded:"",class:"cui-icon-md",loading:c(d),onClick:E[17]||(E[17]=lr(Ge=>O(c(l)),["prevent"]))},{icon:$(()=>[y(q,{width:"100%",height:"100%"})]),_:1},8,["loading"])])])]),_:1})]),_:1},8,["value"])]),_:1},8,["value"]))]),_:1})):ae("",!0)])}}}),k3={key:0,class:"flex flex-col gap-6"},E3={key:1,class:"flex flex-col gap-6"},xp=Tt({__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}=Jt(r),v=Qt("formRef"),f=oe(""),b=oe(!1),k=oe({});Ze([i,v],([])=>{v.value&&(!q2(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=D2(i.value.schema)},{immediate:!0,deep:!0});const z=se(()=>{const R=V2(i.value.schema);return Wn(R)}),O=se(()=>{const R=[];return i.value.schema.forEach(w=>{w.group&&!w.hidden&&!R.includes(w.group)&&R.push(w.group)}),R.length&&!f.value&&(f.value=R[0]),R}),te=se(()=>B2(i.value.schema,f.value)),W=se(()=>z2(i.value.schema,f.value));Ze(f,R=>{R&&n("changeGroup",R)});const I=R=>i.value.schema.filter(w=>(w.group===R||!w.group&&R===O.value[0])&&!w.hidden),E=R=>{const w=ar(R)&&R.format==="qrCode",Q=ar(R)&&R.format==="image",J=zr(R)||Ur(R);return!w&&!Q&&!J},N=R=>!R.hidden||R.hidden&&E(R),D=async()=>{var R;return await((R=v.value)==null?void 0:R.validate())},C=R=>{n("onAction",R)},A=async R=>{const w=await D();w!=null&&w.valid&&(w!=null&&w.values)?(b.value=!1,n("onSubmit",{key:R.key,payload:w.values})):(b.value=!0,console.error("result",w))},B=async()=>{const R=await D();R!=null&&R.valid&&(R!=null&&R.values)?(b.value=!1,n("onFormSubmit",R.values)):(b.value=!0,console.error("Form validation failed:",R))};return e({reset:()=>{var R;(R=v.value)==null||R.resetForm()}}),(R,w)=>{const Q=yp,J=vp,j=C3,ie=Vh,ue=Uh,Se=zh,F=ys;return m(),M("div",null,[y(c(il),{ref_key:"formRef",ref:v,"validation-schema":c(z),onSubmit:B},{default:$(()=>[c(O).length?(m(),M("div",k3,[y(J,{modelValue:c(f),"onUpdate:modelValue":w[0]||(w[0]=q=>ps(f)?f.value=q:null),mandatory:""},{default:$(()=>[(m(!0),M(Ct,null,zt(c(O),q=>(m(),L(Q,{key:q,size:"small",value:q},{default:$(()=>[Gt(he(q),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),y(Se,{value:c(f),"onUpdate:value":w[2]||(w[2]=q=>ps(f)?f.value=q:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(ue,{class:"p-0"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(O),(q,Y)=>(m(),L(ie,{key:Y,value:q,"as-child":""},{default:$(Te=>[It(g("div",tt({class:Te.class,ref_for:!0},Te.a11yAttrs,{class:"flex flex-col gap-6"}),[(m(!0),M(Ct,null,zt(I(q),He=>(m(),M(Ct,{key:He.key},[N(He)&&(He.group===q||!He.group&&Y===0)?It((m(),L(j,{key:0,modelValue:c(k),"onUpdate:modelValue":w[1]||(w[1]=pt=>ps(k)?k.value=pt:null),"schema-field":He,"config-key":He.key,loading:c(o),onOnAction:C,onOnSubmit:A},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!He.hidden]]):ae("",!0)],64))),128))],16),[[Pr,Te.active]])]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["value"])])):(m(),M("div",E3,[(m(!0),M(Ct,null,zt(c(i).schema,q=>(m(),M(Ct,{key:q.key},[N(q)?It((m(),L(j,{key:0,modelValue:c(k),"onUpdate:modelValue":w[3]||(w[3]=Y=>ps(k)?k.value=Y:null),"schema-field":q,"config-key":q.key,loading:c(o),onOnAction:C,onOnSubmit:A},null,8,["modelValue","schema-field","config-key","loading"])),[[Pr,!q.hidden]]):ae("",!0)],64))),128))])),!c(te)&&c(W)&&c(a)||c(u)?(m(),L(F,{key:2,fluid:"",class:"mt-7 cui-button-medium",severity:c(h),type:"submit",loading:c(o),disabled:c(d),label:c(l)||R.$t("components.form.button.save")},null,8,["severity","loading","disabled","label"])):ae("",!0)]),_:1},8,["validation-schema"])])}}}),A3=Tt({__name:"PluginSchema",props:{schemaConfig:{},pluginName:{},cameraName:{},buttonKey:{}},setup(s,{expose:e}){const t=new Fl,n=new Jn,r=Cn(),{t:i}=js(),o=mi("dialogRef"),a=mi("dialogRefProps"),l=s,{schemaConfig:u,pluginName:d,cameraName:h,buttonKey:v}=Jt(l),f=oe({schema:[],config:{}}),{mutate:b,isPending:k}=t.submitPluginConfigQuery(),{mutateAsync:z,isPending:O}=t.setPluginConfigQuery(),{mutate:te,isPending:W}=n.submitCameraExtensionConfigQuery(),{mutateAsync:I,isPending:E}=n.setCameraExtensionConfigQuery(),N=se(()=>{var A;return!!((A=a.loading)!=null&&A.value||k.value||O.value||W.value||E.value)});Ze(u,A=>{f.value=A},{deep:!0,immediate:!0});const D=async A=>{h.value?await I({cameraname:h.value,pluginname:d.value,configData:{key:A.key}}):await z({pluginname:d.value,configData:{key:A.key}})},C=async A=>{console.log("onFormSubmit",A);const B={...u.value.config,...A};console.log("onFormSubmit payload",B);const H=R=>{if(R!=null&&R.toast){const w=Zm(R.toast.type);r.add({severity:w,summary:i(`components.toast.title_${w}`),detail:R.toast.message,life:3e3})}R!=null&&R.schema&&Object.keys(R.schema).length&&f.value?f.value.schema=R.schema:o.value.close()};h.value?te({cameraname:h.value,pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:H}):b({pluginname:d.value,configData:{key:v.value,payload:B}},{onSuccess:H})};return e({isLoading:N}),(A,B)=>{const H=xp;return m(),L(H,{"schema-form":c(f),loading:c(N),"show-button":"",onOnAction:D,onOnFormSubmit:C},null,8,["schema-form","loading"])}}}),M3={class:"p-4 flex flex-col gap-2"},$3={class:"cui-label"},P3={key:0,class:"flex flex-col gap-2"},T3={class:"cui-label"},R3={key:5,class:"text-sm text-muted text-center min-h-[30px]"},I3={class:"cui-label"},O3={key:6,class:"w-full flex items-center justify-center my-5"},N3={key:1,class:"text-sm text-muted text-center"},F3={key:1,class:"flex flex-col gap-2"},L3={class:"cui-label"},j3={key:0,class:"w-full flex items-center justify-center"},q3={key:1,class:"text-sm text-muted text-center"},D3={key:1,class:"w-full h-full"},B3={class:"cui-list-item"},z3=Tt({__name:"Plugins",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Jn,n=new Fl,r=Cn(),i=Il(),{t:o}=js(),a=s,{camera:l,loading:u}=Jt(a),d=Qt("schemaRef"),h=oe("hub"),v=oe(["hub","motionDetection","objectDetection","audioDetection","ptz","more"]),f=oe(""),b=oe(),k=oe(),z=oe(),O=oe(),te=oe(),W=oe(!0);t.toggleQueryActivator("getCameraExtensionConfigQuery",!1);const{data:I}=n.getPluginsQuery({page:1,pageSize:-1}),{data:E,isFetching:N,suspense:D}=t.getCameraExtensionsQuery(l.value.name),{data:C,isFetching:A}=t.getCameraExtensionConfigQuery(l.value.name,f,W),{data:B,isFetching:H}=n.getPluginsExtensionsQuery({page:1,pageSize:-1}),{mutate:R,isPending:w}=t.submitCameraExtensionConfigQuery(),{mutateAsync:Q,isPending:J}=t.patchCameraExtensionConfigQuery(),{mutateAsync:j,isPending:ie}=t.setCameraExtensionConfigQuery(),{mutateAsync:ue,isPending:Se}=t.addCameraExtensionQuery(),{mutateAsync:F,isPending:q}=t.removeCameraExtensionQuery(),{mutateAsync:Y,isPending:Te}=t.enableCameraExtensionQuery(),{mutateAsync:He,isPending:pt}=t.disableCameraExtensionQuery(),ft=se(()=>N.value||H.value||Se.value||q.value||Te.value||pt.value),Ge=se(()=>ft.value||u.value||w.value||J.value||ie.value),Je=se(()=>{const le=h.value==="hub"&&de.value.length,ge=h.value==="motionDetection"&&xt.value.length,Ie=h.value==="audioDetection"&&Kt.value.length,Ee=h.value==="objectDetection"&&vt.value.length,Ue=h.value==="ptz"&&jt.value.length;return!le&&!ge&&!Ie&&!Ee&&!Ue}),de=se(()=>{var ge;const le=((ge=E.value)==null?void 0:ge.filter(Ie=>Ie.type.includes("hub")))||[];return le.length&&I.value&&I.value.result.some(Ie=>Ie.pluginName===le[0].pluginName&>(Ie.pluginName))?(b.value=le[0].pluginName,f.value=le[0].pluginName):b.value=void 0,De(le)}),xt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("motionDetection")))||[];return le.length&>(l.value.extensions.motionDetection)?k.value=(Ie=l.value.extensions.motionDetection)==null?void 0:Ie.name:k.value=void 0,De(le)}),Kt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("audioDetection")))||[];return le.length&>(l.value.extensions.audioDetection)?z.value=(Ie=l.value.extensions.audioDetection)==null?void 0:Ie.name:z.value=void 0,De(le)}),vt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("objectDetection")))||[];return le.length&>(l.value.extensions.objectDetection)?O.value=(Ie=l.value.extensions.objectDetection)==null?void 0:Ie.name:O.value=void 0,De(le)}),jt=se(()=>{var ge,Ie;const le=((ge=E.value)==null?void 0:ge.filter(Ee=>Ee.type.includes("ptz")))||[];return le.length&>(l.value.extensions.ptz)?te.value=(Ie=l.value.extensions.ptz)==null?void 0:Ie.name:te.value=void 0,De(le)}),ct=se(()=>{var Ie,Ee;const le=((Ie=I.value)==null?void 0:Ie.result)||[];return(((Ee=B.value)==null?void 0:Ee.result)||[]).filter(Ue=>{const rt=le.find(ts=>ts.pluginName===Ue.pluginName);return((rt==null?void 0:rt["camera.ui"].extensions)??[]).filter(ts=>ts!=="cameraController").length>0})});Ze(b,(le,ge)=>{le&&le!==ge&&ht(le)}),Ze(k,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"motionDetection"):le&&X(le,!0,"motionDetection"))}),Ze(O,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"objectDetection"):le&&X(le,!0,"objectDetection"))}),Ze(te,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"ptz"):le&&X(le,!0,"ptz"))}),Ze(z,(le,ge)=>{le!==ge&&(!le&&ge?X(ge,!1,"audioDetection"):le&&X(le,!0,"audioDetection"))});const gt=le=>{const ge=typeof le=="string"?le:le==null?void 0:le.name;if(ge&&I.value&&I.value.result.some(Ie=>Ie.pluginName===ge&&!Ie.disabled))return ge},De=le=>le.sort((ge,Ie)=>!gt(ge.pluginName)&>(Ie.pluginName)?1:gt(ge.pluginName)&&!gt(Ie.pluginName)?-1:ge.displayName.localeCompare(Ie.displayName)),ht=le=>{var ge;if(t.toggleQueryActivator("getCameraExtensionConfigQuery",!1),le!==void 0)f.value=le;else switch(h.value){case"hub":f.value=gt((ge=de.value[0])==null?void 0:ge.pluginName)||"";break;case"motionDetection":f.value=gt(l.value.extensions.motionDetection)||"";break;case"audioDetection":f.value=gt(l.value.extensions.audioDetection)||"";break;case"objectDetection":f.value=gt(l.value.extensions.objectDetection)||"";break;case"ptz":f.value=gt(l.value.extensions.ptz)||"";break;default:f.value="";break}f.value&&f.value!==""&&t.toggleQueryActivator("getCameraExtensionConfigQuery",!0)},U=async le=>{var ge;if(E.value)if(E.value.some(Ie=>Ie.pluginName===le.pluginName)){for(const Ie of le.type)await F({cameraname:l.value.name,pluginname:le.pluginName,type:Ie});(ge=d.value)==null||ge.reset()}else for(const Ie of le.type)await ue({cameraname:l.value.name,pluginname:le.pluginName,type:Ie})},X=async(le,ge,Ie)=>{var Ue;const Ee=Ie in l.value.extensions?l.value.extensions[Ie]:void 0;l.value&&(ge?(Ee==null?void 0:Ee.name)!==le&&(await Y({cameraname:l.value.name,pluginname:le,type:Ie}),Zs(()=>ht(le))):(Ee==null?void 0:Ee.name)===le&&(await He({cameraname:l.value.name,pluginname:le,type:Ie}),(Ue=d.value)==null||Ue.reset(),Zs(()=>ht())))},fe=async(le,ge)=>{await j({cameraname:l.value.name,pluginname:ge,configData:{key:le.key}})},ye=(le,ge)=>{R({cameraname:l.value.name,pluginname:ge,configData:{key:le.key,payload:le.payload}},{onSuccess:Ie=>{if(Ie!=null&&Ie.toast){const Ee=Zm(Ie.toast.type);r.add({severity:Ee,summary:o(`components.toast.title_${Ee}`),detail:Ie.toast.message,life:3e3})}Ie!=null&&Ie.schema&&Object.keys(Ie.schema).length&&i.openComponentDialog(A3,{data:{title:o("components.dialog.title.config"),hideConfirmButton:!0,contentProps:{schemaConfig:{schema:Ie.schema,config:le.payload},pluginName:ge,cameraName:l.value.name,buttonKey:le.key}}})}})},pe=async(le,ge)=>{await Q({cameraname:l.value.name,pluginname:le,configData:ge})};return el(async()=>{await D(),ht()}),(le,ge)=>{var Cs,hs;const Ie=yp,Ee=vp,Ue=Ea,rt=Lr,St=fo,ts=fp,bs=sw,ls=ys,os=jr;return m(),M("div",M3,[g("span",$3,he(le.$t("components.camera_options.categories")),1),y(Ee,{modelValue:c(h),"onUpdate:modelValue":[ge[0]||(ge[0]=Be=>ps(h)?h.value=Be:null),ge[1]||(ge[1]=Be=>ht())],disabled:c(ft),mandatory:""},{default:$(()=>[(m(!0),M(Ct,null,zt(c(v),Be=>(m(),L(Ie,{key:Be,size:"small",disabled:c(Ge),value:Be},{default:$(()=>[Gt(he(le.$t(`components.camera_options.chip_${Be}`)),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"]),y(Ue,{class:"m-0 py-3"}),c(h)!=="more"?(m(),M("div",P3,[g("span",T3,he(le.$t("components.camera_options.chip_plugins")),1),c(h)==="hub"&&c(de).length?(m(),L(Ee,{key:0,modelValue:c(b),"onUpdate:modelValue":ge[2]||(ge[2]=Be=>ps(b)?b.value=Be:null),disabled:c(ft),mandatory:"",class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(de),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="motionDetection"&&c(xt).length?(m(),L(Ee,{key:1,modelValue:c(k),"onUpdate:modelValue":ge[3]||(ge[3]=Be=>ps(k)?k.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(xt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="objectDetection"&&c(vt).length?(m(),L(Ee,{key:2,modelValue:c(O),"onUpdate:modelValue":ge[4]||(ge[4]=Be=>ps(O)?O.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(vt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="audioDetection"&&c(Kt).length?(m(),L(Ee,{key:3,modelValue:c(z),"onUpdate:modelValue":ge[5]||(ge[5]=Be=>ps(z)?z.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(Kt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):ae("",!0),c(h)==="ptz"&&c(jt).length?(m(),L(Ee,{key:4,modelValue:c(te),"onUpdate:modelValue":ge[6]||(ge[6]=Be=>ps(te)?te.value=Be:null),disabled:c(ft),class:"min-h-[30px]"},{default:$(()=>[(m(!0),M(Ct,null,zt(c(jt),Be=>(m(),L(Ie,{key:Be.pluginName,size:"small",filter:"",disabled:!gt(Be.pluginName)||c(Ge),value:Be.pluginName},{default:$(()=>[Gt(he(Be.displayName),1)]),_:2},1032,["disabled","value"]))),128))]),_:1},8,["modelValue","disabled"])):c(Je)?(m(),M("span",R3,he(le.$t("components.camera_options.no_plugins_enabled")),1)):ae("",!0),y(Ue,{class:"m-0 py-3"}),g("span",I3,he(le.$t("components.camera_options.plugin_settings")),1),c(A)||!c(f)||!c(C)||!((Cs=c(C))!=null&&Cs.schema)||((hs=c(C))==null?void 0:hs.schema.length)===0?(m(),M("div",O3,[c(A)?(m(),L(rt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),M("span",N3,he(le.$t("components.camera_options.no_config")),1))])):(m(),L(xp,{ref_key:"schemaRef",ref:d,key:c(f),"schema-form":{schema:c(C).schema,config:c(C).config},loading:c(Ge),onOnFormSubmit:ge[7]||(ge[7]=Be=>pe(c(f),Be)),onOnSubmit:ge[8]||(ge[8]=Be=>ye(Be,c(f))),onOnAction:ge[9]||(ge[9]=Be=>fe(Be,c(f)))},null,8,["schema-form","loading"]))])):(m(),M("div",F3,[g("span",L3,he(le.$t("components.camera_options.manage_plugins")),1),c(H)||!c(ct).length?(m(),M("div",j3,[c(H)?(m(),L(rt,{key:0,class:"w-[30px] h-[30px]","stroke-width":"5"})):(m(),M("span",q3,he(le.$t("components.camera_options.no_plugins_found")),1))])):(m(),M("div",D3,[(m(!0),M(Ct,null,zt(c(ct),Be=>It((m(),M("div",{key:Be.pluginName,class:"cui-list-item"},[y(ts,{disabled:c(ft)||!gt(Be.pluginName),class:"h-14",onClick:us=>le.$router.push(`/plugins/${Be.pluginName}`)},{append:$(()=>{var us;return[y(St,{"model-value":(us=c(E))==null?void 0:us.some(V=>V.pluginName===Be.pluginName),disabled:c(ft)||!gt(Be.pluginName),"onUpdate:modelValue":V=>U(Be)},null,8,["model-value","disabled","onUpdate:modelValue"])]}),default:$(()=>[g("span",null,he(Be.displayName),1)]),_:2},1032,["disabled","onClick"])])),[[os,{value:gt(Be.pluginName)===void 0?le.$t("components.form.tooltip.disabled"):""},void 0,{top:!0}]])),128))])),g("div",B3,[y(ts,{class:"h-14",onClick:ge[10]||(ge[10]=Be=>le.$router.push("/plugins"))},{append:$(()=>[y(ls,{text:"",rounded:"",severity:"secondary",class:"cui-icon-md"},{icon:$(()=>[y(bs,{width:"100%",height:"100%"})]),_:1})]),default:$(()=>[g("span",null,he(le.$t("components.camera_options.more_plugins")),1)]),_:1})])]))])}}}),U3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function V3(s,e){return m(),M("svg",U3,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 H3=me({name:"mdi-checkbox-intermediate",render:V3}),Q3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function K3(s,e){return m(),M("svg",Q3,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 Z3=me({name:"mdi-vector-intersection",render:K3}),G3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W3(s,e){return m(),M("svg",G3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6zm14 11H6V8h12z"},null,-1)]))}const J3=me({name:"mdi-rectangle-outline",render:W3}),Y3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function X3(s,e){return m(),M("svg",Y3,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M4 6v13h16V6z"},null,-1)]))}const e4=me({name:"mdi-rectangle",render:X3}),t4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function s4(s,e){return m(),M("svg",t4,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 n4=me({name:"mdi-cctv",render:s4}),r4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function i4(s,e){return m(),M("svg",r4,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 o4=me({name:"mdi-cctv-off",render:i4}),a4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function c4(s,e){return m(),M("svg",a4,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 l4=me({name:"mdi-cancel",render:c4}),u4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function d4(s,e){return m(),M("svg",u4,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 h4=me({name:"mdi-undo",render:d4}),m4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function p4(s,e){return m(),M("svg",m4,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 f4=me({name:"mdi-trash-can",render:p4}),g4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v4(s,e){return m(),M("svg",g4,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 _4=me({name:"mdi-pencil",render:v4}),y4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b4(s,e){return m(),M("svg",y4,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"},null,-1)]))}const w4=me({name:"mdi-plus",render:b4}),x4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function S4(s,e){return m(),M("svg",x4,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 C4=me({name:"mingcute-timeline-fill",render:S4}),k4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function E4(s,e){return m(),M("svg",k4,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 A4=me({name:"mingcute-timeline-line",render:E4}),M4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $4(s,e){return m(),M("svg",M4,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 P4=me({name:"mdi-map-marker-add",render:$4}),T4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function R4(s,e){return m(),M("svg",T4,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 I4=me({name:"mdi-map-marker-add-outline",render:R4}),O4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N4(s,e){return m(),M("svg",O4,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=me({name:"mingcute-computer-camera-fill",render:N4}),F4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L4(s,e){return m(),M("svg",F4,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 j4=me({name:"mingcute-computer-camera-line",render:L4}),q4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D4(s,e){return m(),M("svg",q4,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 B4=me({name:"material-symbols-detection-and-zone-rounded",render:D4}),z4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function U4(s,e){return m(),M("svg",z4,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 V4=me({name:"fa6-solid-object-ungroup",render:U4}),H4={viewBox:"0 0 640 512",width:"1.5em",height:"1.2em"};function Q4(s,e){return m(),M("svg",H4,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 K4=me({name:"fa6-regular-object-ungroup",render:Q4}),Z4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G4(s,e){return m(),M("svg",Z4,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 W4=me({name:"solar-camera-square-linear",render:G4}),J4={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y4(s,e){return m(),M("svg",J4,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 X4=me({name:"solar-share-circle-outline",render:Y4}),Ll=Tt({__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}=Jt(n),b=oe(!1);o.value&&t.toggleQueryActivator("getCameraSnapshotQuery",!1);const{data:k,isFetching:z,refetch:O,isRefetching:te}=t.getCameraSnapshotQuery(r,b),W=se(()=>(i.value||z.value||te.value)&&f.value),I=se(()=>{if(o.value)return o.value;if(k.value)return`data:image/jpeg;base64,${k.value}`});return e({download:()=>{if(I.value){const D=`${r.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,C=document.createElement("a");C.setAttribute("download",D),C.href=I.value,document.body.appendChild(C),C.click(),C.remove()}},refresh:()=>{b.value=!0,O(),b.value=!1},isLoading:W,snapshotSrc:I}),(D,C)=>{const A=Lr,B=Fa;return m(),M("div",{class:"w-full h-full flex items-center justify-center bg-black aspect-video",style:ot({width:`${c(a)}`,height:`${c(l)}`})},[c(W)?(m(),L(A,{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(),L(B,{key:1,src:c(I),"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)}}}),e6=["d"],t6=Tt({__name:"CuiPolygon",props:{cameraZones:{}},setup(s){const e=s,{cameraZones:t}=Jt(e),n=Qt("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(),M("svg",{ref_key:"zoneRef",ref:n,width:"100%",height:"100%",class:"zones-container polygon-container"},[(m(!0),M(Ct,null,zt(c(t),(l,u)=>(m(),M("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,e6))),128))],512))}}),s6=qs(t6,[["__scopeId","data-v-bcfe05d5"]]),n6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function r6(s,e){return m(),M("svg",n6,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 i6=me({name:"bi-person-fill",render:r6}),o6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function a6(s,e){return m(),M("svg",o6,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 c6=me({name:"fluent-animal-paw-print-24-filled",render:a6}),l6={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function u6(s,e){return m(),M("svg",l6,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 d6=me({name:"fluent-vehicle-car-16-filled",render:u6}),h6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m6(s,e){return m(),M("svg",h6,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 p6=me({name:"healthicons-running-24px",render:m6}),f6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function g6(s,e){return m(),M("svg",f6,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 v6=me({name:"lucide-boxes",render:g6}),_6={class:"w-full h-full"},y6={key:1,class:"label-text"},b6=Tt({__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}=Jt(t),l=Qt("containerRef"),u=Ls([]),{width:d,height:h}=rl(l),v={motion:{color:"#A855F7",icon:p6},animal:{color:"#22C55E",icon:c6},person:{color:"#3B82F6",icon:i6},vehicle:{color:"#EF4444",icon:d6},other:{color:"#CAC443",icon:v6}},f=se(()=>Math.min(d.value||800,h.value||600)),b=se(()=>f.value<200?.8:1),k=se(()=>C=>{if(!u.value.length||!d.value)return 0;const{inputWidth:A}=u.value[0];return Math.round(C*d.value/A)}),z=se(()=>C=>{if(!u.value.length||!h.value)return 0;const{inputHeight:A}=u.value[0];return Math.round(C*h.value/A)}),O=se(()=>(C,A)=>k.value(A)-k.value(C)),te=se(()=>(C,A)=>z.value(A)-z.value(C)),W=se(()=>C=>{const A=O.value(C.boundingBox[0],C.boundingBox[2]),B=te.value(C.boundingBox[1],C.boundingBox[3]),H=A<200?.3:A<400?.25:.2;return Math.min(A,B)*H}),I=se(()=>C=>{const A=z.value(C.boundingBox[1]),B=30*b.value;return A<B}),E=se(()=>C=>k.value(C.boundingBox[0])>d.value*.7),N=C=>{u.value=C.filter(A=>r.value.includes(A.label))},D=()=>{u.value=[]};return Ze(n,C=>{C.length&&N(C)},{immediate:!0}),e({draw:N,clear:D}),(C,A)=>(m(),M("div",{ref_key:"containerRef",ref:l,class:"bbox-container"},[(m(!0),M(Ct,null,zt(c(u),B=>{var H,R;return m(),M("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(O)(B.boundingBox[0],B.boundingBox[2])}px`,height:`${c(te)(B.boundingBox[1],B.boundingBox[3])}px`})},[g("div",_6,[(m(),M(Ct,null,zt(["tl","tr","bl","br"],w=>{var Q;return g("div",{key:w,class:at(["corner-lines",w]),style:ot({"--corner-color":((Q=v[B.label])==null?void 0:Q.color)||v.other.color,"--corner-size":`${c(W)(B)}px`})},A[0]||(A[0]=[g("div",{class:"line horizontal"},null,-1),g("div",{class:"line vertical"},null,-1)]),6)}),64))]),c(a)||c(i)||c(o)?(m(),M("div",{key:0,class:at(["label z-1",{"label-bottom":c(I)(B),"label-right":c(E)(B)}]),style:ot({backgroundColor:((H=v[B.label])==null?void 0:H.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(),L(Ai(((R=v[B.label])==null?void 0:R.icon)||v.other.icon),{key:0})):ae("",!0),c(a)&&c(f)>250?(m(),M("span",y6,he(B.label),1)):ae("",!0),c(i)&&c(f)>250?(m(),M("span",{key:2,class:"confidence",style:ot({fontSize:`${11*c(b)}px`})},he((B.confidence*100).toFixed(1))+"% ",5)):ae("",!0)],6)):ae("",!0)],4)}),128))],512))}}),w6=qs(b6,[["__scopeId","data-v-870e7d93"]]),x6={class:"snapshot-hover-container flex items-center justify-center aspect-video"},S6={class:"shortcut-menu"},C6=Tt({__name:"CuiCameraShortcuts",props:{cameraName:{},addingShortcuts:{type:Boolean}},setup(s){var ht;const e=new Jn,t=new T_,n=Fs(),r=qr(),i=s,{cameraName:o,addingShortcuts:a}=Jt(i),{user:l}=Vs(n),u=Qt("placeholderRef"),d=Qt("shortcutContainerRef"),h=Qt("camerasMenuRef"),v=Ls({}),f=Ls({}),b=Ls({}),k=oe({}),z=oe(!1),O=oe(),te=oe(!1),W=oe(!1),I=oe([]),E=oe({}),N=oe(!1),D=rl(d);e.toggleQueryActivator("getCamerasQuery",!1);const{data:C,isFetching:A}=e.getCameraQuery(o),{data:B,isFetching:H}=e.getCamerasQuery({page:1,pageSize:-1}),{data:R,isFetching:w}=t.getShortcutsQuery(((ht=l.value)==null?void 0:ht.username)||"",o),{mutate:Q,isPending:J}=t.patchShortcutQuery(),{mutate:j,isPending:ie}=t.createShortcutQuery(),{mutate:ue,isPending:Se}=t.removeShortcutQuery(),F=se(()=>A.value||w.value||J.value||H.value||ie.value||Se.value),q=se(()=>{var U;return(U=B.value)!=null&&U.result?B.value.result.filter(X=>X.name!==o.value):[]}),Y=se(()=>{var U;return((U=l.value)==null?void 0:U.username)??""});Ze([R,C],()=>{R.value&&C.value&&(I.value=xi(R.value))},{immediate:!0,deep:!0}),Ze([D.width,D.height],()=>{W.value=!0,Zs(()=>{de()})}),Ze(I,()=>{Zs(()=>{xt()})},{deep:!0,immediate:!0}),Ze(W,U=>{U&&(O.value=void 0)});const Te=U=>{te.value||(O.value=void 0),N.value=U,e.toggleQueryActivator("getCamerasQuery",U)};Ze([u,O],([U,X])=>{U&&X&&setTimeout(()=>{var fe;(fe=h.value)==null||fe.show({currentTarget:U})},50)},{deep:!0}),Ze(E,()=>{Object.entries(E.value).forEach(([U,X])=>{var fe,ye;if(X&&f.value[U]){const pe=v.value[U];pe&&((fe=f.value[U])==null||fe.show({currentTarget:pe}))}else(ye=f.value[U])==null||ye.hide()})},{deep:!0});const He=(U,X)=>{z.value||(e.toggleQueryActivator("getCamerasQuery",X),E.value[U]=z.value?!1:X,Object.entries(E.value).forEach(([fe,ye])=>{fe!==U&&ye&&(E.value[fe]=!1)}))},pt=U=>{z.value||jt(U)},ft=(U,X)=>{U||(E.value[X._id]?(He(X._id,!1),De(X.cameraId)):He(X._id,!0))},Ge=()=>{Object.entries(b.value).forEach(([U,X])=>{const fe=d.value;if(!fe)return;const ye=fe.getBoundingClientRect(),pe=X.element.getBoundingClientRect(),le=(pe.left-ye.left)/ye.width*100,ge=(pe.top-ye.top)/ye.height*100;k.value[U]={x:Math.max(0,Math.min(le,100)),y:Math.max(0,Math.min(ge,100))}})},Je=()=>{Object.entries(b.value).forEach(([U,X])=>{const fe=k.value[U];if(!fe)return;const ye=d.value;if(!ye)return;const pe=ye.getBoundingClientRect(),le=X.element.getBoundingClientRect(),ge=pe.width-le.width,Ie=pe.height-le.height,Ee=Math.max(0,Math.min(fe.x/100*pe.width,ge)),Ue=Math.max(0,Math.min(fe.y/100*pe.height,Ie));X.setPosition(Ee,Ue)}),W.value=!1},de=()=>{Object.entries(k.value).forEach(([U,X])=>{k.value[U]={x:Math.max(0,Math.min(X.x,100)),y:Math.max(0,Math.min(X.y,100))}}),Je()},xt=()=>{for(const[U,X]of Object.entries(b.value))I.value.find(fe=>fe._id===U)||(X.destroy(),delete b.value[U],delete k.value[U]);for(const[U]of Object.entries(k.value))I.value.find(X=>X._id===U)||delete k.value[U];for(const[U,X]of Object.entries(v.value)){const fe=I.value.find(ye=>ye._id===U);if(X&&fe&&d.value){b.value[fe._id]&&b.value[fe._id].destroy();const ye=new Yh(X,{containment:d.value});b.value[fe._id]=ye;const[pe,le]=fe.points,ge=d.value.getBoundingClientRect(),Ie=pe/100*ge.width,Ee=le/100*ge.height;ye.setPosition(Ie,Ee),k.value[fe._id]={x:pe,y:le},ye.on("dragMove",()=>{z.value=!0;const Ue=f.value[U];Ue==null||Ue.alignOverlay()}),ye.on("dragEnd",()=>{setTimeout(()=>{z.value=!1},50),Ge();const Ue=k.value[fe._id];Q({username:Y.value,cameraname:o.value,shortcutid:fe._id,shortcutData:{points:[Ue.x,Ue.y]}})})}}Je()},Kt=U=>{if(!a.value||!d.value)return;te.value=!0;const X=d.value.getBoundingClientRect(),fe=35,ye=35;O.value={x:Math.max(0,Math.min(U.clientX-X.left-fe/2,X.width-fe)),y:Math.max(0,Math.min(U.clientY-X.top-ye/2,X.height-ye))}},vt=async U=>{if(!u.value||!d.value)return;const X=d.value,fe=u.value,ye=X.getBoundingClientRect(),pe=fe.getBoundingClientRect(),le=pe.left-ye.left,ge=pe.top-ye.top,Ie=le/ye.width*100,Ee=ge/ye.height*100;j({username:Y.value,cameraname:o.value,shortcutData:{_id:"",points:[Ie,Ee],cameraId:U._id}},{onSettled:()=>{var Ue;te.value=!1,O.value=void 0,(Ue=h.value)==null||Ue.hide()}})},jt=U=>{const X=b.value[U._id];X==null||X.destroy(),ue({username:Y.value,cameraname:o.value,shortcutid:U._id})},ct=(U,X)=>{v.value[X]=U},gt=(U,X)=>{f.value[X]=U},De=async U=>{if(z.value)return;const X=new AbortController,ye=(await bp({cameraname:U,signal:X.signal})).name;ye&&r.push(`/cameras/${ye}`)};return Q0(()=>{v.value={}}),Sn(()=>{Zs(()=>{xt()})}),vo(()=>{Object.values(b.value).forEach(U=>U.destroy())}),(U,X)=>{const fe=Sp,ye=ys,pe=Lr,le=Ap,ge=Qc,Ie=Ll;return m(),M("div",{ref_key:"shortcutContainerRef",ref:d,class:at(["shortcut-container",{"!pointer-events-auto":c(a)}]),style:ot({cursor:c(a)?"pointer":"default"}),onClick:lr(Kt,["self"])},[(m(!0),M(Ct,null,zt(c(I),Ee=>It((m(),M("div",{ref_for:!0,ref:Ue=>ct(Ue,Ee._id),key:Ee._id,class:"draggable absolute pointer-events-auto",style:ot({background:c(E)[Ee._id]?"#545454":void 0})},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(fe,{width:"100%",height:"100%"})]),_:1}),y(ge,{ref_for:!0,ref:Ue=>gt(Ue,Ee._id),class:"shadow-lg cui-rounded-corner overflow-hidden",pt:{content:{class:"p-0"}}},{default:$(()=>{var Ue;return[g("div",x6,[(Ue=c(B))!=null&&Ue.result.find(rt=>rt._id===Ee.cameraId)?(m(),L(le,{key:1,"source-role":"low-resolution","camera-info":c(B).result.find(rt=>rt._id===Ee.cameraId),toolbar:!1,control:!1,subcontrol:!1,"live-indicator-overlay":""},null,8,["camera-info"])):(m(),L(pe,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])]}),_:2},1536)],4)),[[c(Zh),[Ue=>He(Ee._id,Ue),{delayEnter:0,delayLeave:1e3}]],[c(sf),[()=>pt(Ee),{distanceThreshold:24,delay:500,onMouseUp:(Ue,rt,St)=>ft(St,Ee)}]]])),128)),c(O)?(m(),M("div",{key:0,ref_key:"placeholderRef",ref:u,class:"draggable absolute pointer-events-auto",style:ot(`left: ${c(O).x}px; top: ${c(O).y}px;`)},[y(ye,{severity:"secondary",rounded:"",class:"cui-icon-lg shadow-sm pointer-events-auto"},{icon:$(()=>[y(fe,{width:"100%",height:"100%"})]),_:1})],4)):ae("",!0),c(a)&&!c(z)&&!c(W)?(m(),L(ge,{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]=Ee=>N.value=!0),onHide:X[1]||(X[1]=Ee=>Te(!1))},{default:$(()=>[g("div",S6,[(m(!0),M(Ct,null,zt(c(q),Ee=>(m(),L(Ie,{key:Ee._id,class:"shortcut-menu-item","camera-name":Ee.name,width:"100%",loading:c(F),onClick:lr(Ue=>vt(Ee),["prevent"])},null,8,["camera-name","loading","onClick"]))),128))])]),_:1},512)):ae("",!0)],6)}}}),k6=qs(C6,[["__scopeId","data-v-98006b6f"]]),E6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function A6(s,e){return m(),M("svg",E6,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 M6=me({name:"ion-chevron-forward-outline",render:A6}),$6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function P6(s,e){return m(),M("svg",$6,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 T6=me({name:"ion-chevron-back-outline",render:P6}),R6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function I6(s,e){return m(),M("svg",R6,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 O6=me({name:"ion-chevron-down-outline",render:I6}),N6={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function F6(s,e){return m(),M("svg",N6,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 L6=me({name:"ion-chevron-up-outline",render:F6}),j6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function q6(s,e){return m(),M("svg",j6,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 D6=me({name:"ic-round-minus",render:q6}),B6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function z6(s,e){return m(),M("svg",B6,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 U6=me({name:"ic-round-plus",render:z6});function jl(s){const e=oe(),t=oe(!1),n=oe(!1),r=oe(),i=oe(),o=oe(),a=oe(),l=oe(),u=oe(),d=oe(),h=oe([]),v=se(()=>t.value),f=se(()=>n.value),b=se(()=>h.value.includes(Wt.Light)),k=se(()=>h.value.includes(Wt.Siren)),z=se(()=>h.value.includes(Wt.Doorbell)),O=se(()=>h.value.includes(Wt.Battery)),te=se(()=>h.value.includes(Wt.AudioSensor)),W=se(()=>h.value.includes(Wt.MotionSensor)||h.value.includes(Wt.MotionDetector)),I=se(()=>h.value.includes(Wt.ObjectSensor)||h.value.includes(Wt.ObjectDetector)),E=se(()=>h.value.includes(Wt.PTZ));return Ze(s,N=>{if(!N)return;e.value=N.cameraSubject.value,t.value=N.connected,n.value=N.frameWorkerConnected,h.value=N.getCapabilities(),r.value=N.getValue("light"),i.value=N.getValue("motion"),o.value=N.getValue("audio"),a.value=N.getValue("object"),l.value=N.getValue("doorbell"),u.value=N.getValue("siren"),d.value=N.getValue("battery");const D=fn(N.cameraSubject);Ze(D,ue=>{ue&&(e.value=ue)});const C=fn(N.onConnected);Ze(C,ue=>{t.value=!!ue});const A=fn(N.onFrameWorkerConnected);Ze(A,ue=>{n.value=!!ue});const B=fn(N.capabilities);Ze(B,ue=>{ue&&(h.value=ue.map(Se=>Se.capabilities).flat())});const H=fn(N.onLightSwitched);Ze(H,ue=>{r.value=ue});const R=fn(N.onMotionDetected);Ze(R,ue=>{i.value=ue});const w=fn(N.onAudioDetected);Ze(w,ue=>{o.value=ue});const Q=fn(N.onObjectDetected);Ze(Q,ue=>{a.value=ue});const J=fn(N.onDoorbellPressed);Ze(J,ue=>{l.value=ue});const j=fn(N.onSirenDetected);Ze(j,ue=>{u.value=ue});const ie=fn(N.onBatteryChanged);Ze(ie,ue=>{d.value=ue})},{immediate:!0}),{cameraObject:e,connected:v,frameWorkerConnected:f,hasLight:b,hasSiren:k,hasDoorbell:z,hasBattery:O,hasAudioDetector:te,hasMotionDetector:W,hasObjectDetector:I,hasPtz:E,capabilities:h,lightState:r,motionState:i,audioState:o,objectState:a,doorbellState:l,sirenState:u,batteryState:d}}const V6={class:"relative w-full h-full"},H6={class:"absolute top-1 text-muted"},Q6={class:"absolute bottom-1 text-muted"},K6={class:"absolute left-1 text-muted"},Z6={class:"absolute right-1 text-muted"},Rh=100,kr=2e3,as=.05,Ih=.05,G6=.03,W6=Tt({__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}=Jt(r),{capabilities:a}=jl(i),l=Qt("panTiltRef"),u=Qt("zoomRef"),d=Tr({x:0,y:0}),h=Tr({x:0,y:0}),v=Tr({x:0,y:0}),f=oe(!1),b=oe(!1),k=oe(0),z=oe(0),O=oe(0),te=oe(!1),W=oe(0),I=oe(0),E=oe(0),N=oe(0),D=oe(0),C=oe(0),A=oe(0),B=oe("none"),H=oe(0),R=oe(0),w=oe(0),Q=oe(null),J=oe(Date.now()),j=se(()=>f.value||b.value),ie=se(()=>o.value==="small"?45:60),ue=se(()=>o.value==="small"?10:15),Se=se(()=>te.value),F=De=>Math.round(De*100)/100,q=De=>F(Math.max(0,Math.min(1,De))),Y=async De=>{const ht=Date.now();if(!(te.value&&ht-W.value<Rh)){"pan"in De&&De.pan!==void 0&&(De.pan=F(De.pan)),"tilt"in De&&De.tilt!==void 0&&(De.tilt=F(De.tilt)),"zoom"in De&&De.zoom!==void 0&&(De.zoom=q(De.zoom)),te.value=!0,W.value=ht;try{await i.value.interfaces.ptzCommand(De)}catch(U){console.error("PTZ command failed:",U)}finally{te.value=!1}}},Te=()=>{const De=Date.now(),ht=(De-J.value)/1e3;J.value=De;let U=!1;if(f.value&&(Math.abs(D.value)>=as||Math.abs(C.value)>=as)){const X=D.value*Ih*ht*5,fe=C.value*Ih*ht*5;H.value=Math.max(-1,Math.min(1,H.value+X)),R.value=Math.max(-1,Math.min(1,R.value+fe));const ye=F(H.value),pe=F(R.value);(h.x!==ye||h.y!==pe)&&(h.x=ye,h.y=pe,n("panTiltChange",{x:h.x,y:h.y}),U=!0)}if(b.value&&Math.abs(A.value)>=as){const X=A.value*G6*ht*10;w.value=Math.max(0,Math.min(1,w.value+X));const fe=F(w.value);z.value!==fe&&(z.value=fe,n("zoomChange",fe),U=!0)}if(U&&j.value&&Date.now()-W.value>=Rh*2){if(f.value&&(Math.abs(D.value)>=as||Math.abs(C.value)>=as)){const fe=F(D.value),ye=F(C.value);B.value==="pan"?Y({type:"continuous",pan:fe,tilt:0,timeout:kr}):B.value==="tilt"?Y({type:"continuous",pan:0,tilt:ye,timeout:kr}):Y({type:"continuous",pan:fe,tilt:ye,timeout:kr})}else if(b.value&&Math.abs(A.value)>=as){const fe=q(Math.abs(A.value)),ye=A.value>0;Y({type:"continuous",zoom:ye?fe:-fe,timeout:kr})}}j.value&&(Q.value=requestAnimationFrame(Te))},He=()=>{Q.value!==null&&cancelAnimationFrame(Q.value),J.value=Date.now(),Q.value=requestAnimationFrame(Te)},pt=()=>{Q.value!==null&&(cancelAnimationFrame(Q.value),Q.value=null)},ft=async()=>{await new Promise(De=>setTimeout(De,50)),!j.value&&(Math.abs(I.value)>=as||Math.abs(E.value)>=as||Math.abs(N.value)>=as)&&(D.value=0,C.value=0,A.value=0,B.value="none",I.value=0,E.value=0,N.value=0,await Y({type:"stop"}),pt())},Ge=De=>{b.value=!0,J.value=Date.now(),w.value=z.value,He(),De instanceof MouseEvent?Je(De.clientY):Je(De.touches[0].clientY)},Je=async De=>{if(!u.value||!b.value)return;const ht=u.value.getBoundingClientRect(),U=ht.top+ht.height/2,X=ie.value;let fe=De-U;fe=Math.max(-X,Math.min(X,fe)),k.value=fe;const ye=-fe/X;A.value=ye;const pe=F(ye);if(Math.abs(pe)>=as&&Math.abs(pe-N.value)>=as){N.value=pe;const le=pe>0,ge=q(Math.abs(pe));await Y({type:"continuous",zoom:le?ge:-ge,timeout:kr})}else b.value&&Math.abs(pe)<as&&Math.abs(N.value)>=as&&(A.value=0,N.value=0,await Y({type:"stop"}))},de=De=>{f.value=!0,J.value=Date.now(),He(),De instanceof MouseEvent?xt(De.clientX,De.clientY):xt(De.touches[0].clientX,De.touches[0].clientY)},xt=async(De,ht)=>{if(!l.value||!f.value)return;const U=l.value.getBoundingClientRect(),X=U.width/2,fe=U.height/2;let ye=De-U.left-X,pe=ht-U.top-fe;const le=Math.min(X,fe)-ue.value,ge=Math.sqrt(ye*ye+pe*pe);ge>le&&(ye=ye/ge*le,pe=pe/ge*le),d.x=ye,d.y=pe;const Ie=ye/le,Ee=-pe/le,Ue=Math.abs(Ie),rt=Math.abs(Ee);Ue>=as||rt>=as?Ue>rt?(B.value="pan",D.value=Ie,C.value=0):(B.value="tilt",D.value=0,C.value=Ee):(B.value="none",D.value=0,C.value=0),(Ue>as||rt>as)&&(v.x=D.value,v.y=C.value);const St=Math.abs(D.value-I.value),ts=Math.abs(C.value-E.value),bs=St>=as||ts>=as,ls=Math.abs(D.value)>=as||Math.abs(C.value)>=as;if(ls&&bs){I.value=D.value,E.value=C.value;const os=F(D.value),Cs=F(C.value);B.value==="pan"?await Y({type:"continuous",pan:os,tilt:0,timeout:kr}):B.value==="tilt"&&await Y({type:"continuous",pan:0,tilt:Cs,timeout:kr})}else f.value&&!ls&&(Math.abs(I.value)>=as||Math.abs(E.value)>=as)&&(D.value=0,C.value=0,B.value="none",I.value=0,E.value=0,await Y({type:"stop"}))},Kt=De=>{f.value&&xt(De.clientX,De.clientY),b.value&&Je(De.clientY)},vt=De=>{De.preventDefault(),f.value&&xt(De.touches[0].clientX,De.touches[0].clientY),b.value&&Je(De.touches[0].clientY)},jt=()=>{f.value&&(f.value=!1,d.x=0,d.y=0),b.value&&(O.value=z.value,b.value=!1,k.value=0),ft()},ct=async(De,ht)=>{await Y({type:"preset",preset:De,speed:ht})},gt=async De=>{await Y({type:"home",speed:De})};return Sn(()=>{window.addEventListener("mousemove",Kt),window.addEventListener("mouseup",jt),window.addEventListener("touchmove",vt,{passive:!1}),window.addEventListener("touchend",jt)}),vo(()=>{window.removeEventListener("mousemove",Kt),window.removeEventListener("mouseup",jt),window.removeEventListener("touchmove",vt),window.removeEventListener("touchend",jt),pt(),Y({type:"stop"})}),e({goToPreset:ct,goToHome:gt,isLoading:Se}),(De,ht)=>{const U=U6,X=D6,fe=L6,ye=O6,pe=T6,le=M6;return m(),M("div",V6,[c(a).includes(c(Wt).PTZZoom)?(m(),M("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:Ge,onTouchstart:lr(Ge,["prevent"])},[g("div",{class:at(["absolute top-4 text-muted",c(o)==="small"?"text-base":"text-lg"])},[y(U)],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)):ae("",!0),c(a).includes(c(Wt).PTZ)?(m(),M("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:de,onTouchstart:lr(de,["prevent"])},[g("div",H6,[y(fe)]),g("div",Q6,[y(ye)]),g("div",K6,[y(pe)]),g("div",Z6,[y(le)]),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)):ae("",!0)])}}}),J6={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y6(s,e){return m(),M("svg",J6,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 X6=me({name:"mingcute-fullscreen-exit-fill",render:Y6}),e8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function t8(s,e){return m(),M("svg",e8,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 s8=me({name:"mingcute-fullscreen-fill",render:t8}),n8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function r8(s,e){return m(),M("svg",n8,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 i8=me({name:"fluent-picture-in-picture16-filled",render:r8}),o8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function a8(s,e){return m(),M("svg",o8,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 c8=me({name:"fluent-picture-in-picture16-regular",render:a8}),l8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function u8(s,e){return m(),M("svg",l8,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 d8=me({name:"mage-microphone-mute-fill",render:u8}),h8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function m8(s,e){return m(),M("svg",h8,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 p8=me({name:"mage-microphone-fill",render:m8}),f8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function g8(s,e){return m(),M("svg",f8,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 v8=me({name:"heroicons-speaker-x-mark16-solid",render:g8}),_8={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function y8(s,e){return m(),M("svg",_8,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 b8=me({name:"heroicons-speaker-wave16-solid",render:y8}),w8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function x8(s,e){return m(),M("svg",w8,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 S8=me({name:"mdi-fast-forward10",render:x8}),C8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function k8(s,e){return m(),M("svg",C8,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 E8=me({name:"basil-pause-solid",render:k8}),A8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function M8(s,e){return m(),M("svg",A8,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 $8=me({name:"basil-play-solid",render:M8}),P8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function T8(s,e){return m(),M("svg",P8,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 R8=me({name:"mdi-rewind10",render:T8}),I8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function O8(s,e){return m(),M("svg",I8,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 N8=me({name:"grommet-icons-pan",render:O8}),F8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function L8(s,e){return m(),M("svg",F8,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 j8=me({name:"material-symbols-home-rounded",render:L8}),q8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function D8(s,e){return m(),M("svg",q8,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 B8=me({name:"simple-icons-webrtc",render:D8}),z8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U8(s,e){return m(),M("svg",z8,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 V8=me({name:"cbi-iosfacetime",render:U8}),H8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Q8(s,e){return m(),M("svg",H8,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 K8=me({name:"material-symbols-motion-photos-auto-outline-rounded",render:Q8}),Z8={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G8(s,e){return m(),M("svg",Z8,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 W8=me({name:"fluent-pulse24-filled",render:G8}),J8={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function Y8(s,e){return m(),M("svg",J8,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 X8=me({name:"icon-park-solid-sleep",render:Y8}),ex={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tx(s,e){return m(),M("svg",ex,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 sx=me({name:"mdi-webcam",render:tx}),nx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rx(s,e){return m(),M("svg",nx,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 ix=me({name:"mynaui-letter-h-square-solid",render:rx}),ox={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ax(s,e){return m(),M("svg",ox,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 cx=me({name:"mynaui-letter-m-square-solid",render:ax}),lx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ux(s,e){return m(),M("svg",lx,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 dx=me({name:"mynaui-letter-l-square-solid",render:ux}),hx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mx(s,e){return m(),M("svg",hx,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 px=me({name:"mynaui-letter-a-square-solid",render:mx}),fx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gx(s,e){return m(),M("svg",fx,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 vx=me({name:"solar-moon-sleep-bold",render:gx}),_x=Symbol("cui-camera-drawer"),Do=Gh(_x),Cp={position:"right",showCloseIcon:!1,modal:!0,dismissable:!0,baseZIndex:1e3,blockScroll:!0,pt:{root:{class:"w-full sm:w-[400px]"}}},kp=()=>{const s=oe(!1),e=se(()=>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=Ze(t,o=>{o&&e.value&&(i(),n(e.value))});setTimeout(()=>{i(),r(new Error("Timeout waiting for API"))},15e3)})}const yx={key:"sleep",class:"absolute left-0 right-0 top-0 bottom-0 bg-black/80 flex items-center justify-center z-7"},bx={class:"flex flex-col items-center justify-center text-center"},wx={key:0,class:"text-white/80 text-sm max-w-xs mt-3"},xx={key:"loading",class:"absolute w-full h-full flex flex-col items-center justify-center z-6 pointer-events-none"},Sx={key:0,class:"mt-3 text-white text-sm text-shadow"},Cx={key:"overlay",class:"absolute w-full p-4 flex items-center justify-between gap-2 z-6 pointer-events-none"},kx={key:1,class:"text-sm font-semibold p-2 bg-black/60 rounded-xl text-white"},Ex={id:"timeline-container",key:"timeline",class:"absolute w-full h-full z-5 pointer-events-none"},Ax={key:5,class:"absolute top-0 left-0 w-full h-full z-5 pointer-events-none"},Mx=["data-player-id","muted"],$x={class:"flex items-center gap-2"},Px={key:1,class:"w-[10px] h-[10px] rounded-full bg-red-500"},Tx={class:"text-base font-semibold"},Oh=6,Rx=5e3,Nh=5e3,Ix=1e4,Ox=1e3,Nx=Tt({__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:O,cardProps:te,cameraNameOverlay:W,liveIndicatorOverlay:I,control:E,controlFastForwardButton:N,controlFsButton:D,controlMicrophoneButton:C,controlPipButton:A,controlPlayPauseButton:B,controlRewindButton:H,controlSpeakerButton:R,subcontrol:w,subcontrolActivityModeButton:Q,subcontrolPtzButton:J,subcontrolQualityButton:j,subcontrolStreamingModeButton:ie,toolbar:ue,toolbarClass:Se,toolbarDetectionButton:F,toolbarSettingsButton:q,toolbarShareButton:Y,toolbarShortcutsButton:Te,toolbarSnapshotButton:He,toolbarStyle:pt,toolbarTimelineButton:ft,toolbarZoneButton:Ge}=Jt(b),Je=Qt("snapshotRef"),de=Qt("menuRef"),xt=Qt("motionDetectionCanvasRef"),Kt=Qt("objectDetectionCanvasRef"),vt=Qt("ptzRef"),jt=Qt("playerContainerRef"),ct=Qt("videoPlayerRef"),gt=Ls(),{cameraObject:De,motionState:ht,objectState:U,hasPtz:X,hasMotionDetector:fe,hasObjectDetector:ye}=jl(gt),pe=Ls(null),le=Ls(),ge=oe(!1),Ie=oe(!1),Ee=oe(!1),Ue=oe("loading"),rt=oe(!1),St=oe(!1),ts=oe(!1),bs=oe(!1),ls=oe(!1),os=oe({x:0,y:0}),Cs=oe(1),hs=oe(!1),Be=oe(!1),us=oe(!1),V=oe(!1),ne=oe(!1),ve=oe(!0),Ce=oe(!1),nt=oe(!0),Ft=oe(!1),Zt=oe(!1),Xe=oe(!1),xe=oe(["animal","motion","other","person","vehicle"]),Ne=I_();let Fe,_e,it;n.toggleQueryActivator("getCameraQuery",!1);const{data:_,isFetching:x,suspense:S}=n.getCameraQuery(typeof k.value=="string"?k.value:""),P=nf(),T=Su(jt,{delayLeave:1e3}),Z=Su(jt,{delayLeave:0}),Me=ri(jt),{isFullscreen:Pe,toggle:ce}=rf(a.value?ct:jt),{idle:ke,reset:yt}=of(Rx,{initialState:!1});Eo(ct,"enterpictureinpicture",()=>Zt.value=!0),Eo(ct,"leavepictureinpicture",()=>Zt.value=!1),Eo(ct,"pause",()=>{Ce.value=!1,ls.value||Co()}),Eo(ct,"play",()=>{ls.value=!1,Ce.value=!0});const et=se(()=>(T.value||ve.value)&&E.value&&!hs.value),_t=se(()=>typeof k.value=="string"&&x.value||!Ee.value||rt.value),ds=se(()=>Ie.value&&Ue.value!=="error"),ws=se(()=>!!navigator.mediaDevices&&ge.value&&(Ue.value==="webrtc"||Ue.value==="webrtc/tcp")),Ii=se(()=>Xe.value||!Ee.value),kn=se(()=>{var ee;return f.value??((ee=So.value)==null?void 0:ee.interface.streamingMode)??"webrtc"}),on=se(()=>{var ee;return v.value??((ee=So.value)==null?void 0:ee.interface.streamingSource)??"high-resolution"}),ql=se(()=>W.value&&et.value&&!i.value&&Me.width.value>=350),$p=se(()=>E.value&&et.value&&!St.value&&Me.width.value>=150),Pp=se(()=>w.value&&et.value&&!St.value&&Me.width.value>=150),Oi=se(()=>us.value&&Me.width.value>=350&&X.value),Dl=se(()=>{var Ae;let ee=(Ae=So.value)==null?void 0:Ae.interface.aspectRatio;return ee=!ee||ee==="auto"?"16:9":ee,ee.replace(":","/")}),So=se(()=>typeof k.value=="string"?_.value:k.value),En=se(()=>typeof k.value=="string"?k.value:k.value.name),Tp=se(()=>[{key:"animal",label:"Animal",toggle:!0,toggleState:xe.value.includes("animal"),disabled:!Ni.value.includes("animal"),onClick:()=>Qr("animal")},{key:"motion",label:"Motion",toggle:!0,toggleState:xe.value.includes("motion"),disabled:!Ni.value.includes("motion"),onClick:()=>Qr("motion")},{key:"other",label:"Other",toggle:!0,toggleState:xe.value.includes("other"),disabled:!Ni.value.includes("other"),onClick:()=>Qr("other")},{key:"person",label:"Person",toggle:!0,toggleState:xe.value.includes("person"),disabled:!Ni.value.includes("person"),onClick:()=>Qr("person")},{key:"vehicle",label:"Vehicle",toggle:!0,toggleState:xe.value.includes("vehicle"),disabled:!Ni.value.includes("vehicle"),onClick:()=>Qr("vehicle")}]),Rp=se(()=>{var Ae;const ee={body:{class:"w-full h-full p-0 overflow-hidden justify-center"},root:{class:{}}};return O.value&&(ee.root.class={...ee.root.class,"!rounded-none !border-0":!0}),kl(ee,(Ae=te.value)==null?void 0:Ae.pt)}),Bl=se(()=>{const ee=Me.width.value;return ee?ee<=150?.4:ee<250?.5:ee<350?.7:ee<450?.85:1:1}),Ip=se(()=>{const ee=Me.height.value,Ae=Bl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),Op=se(()=>{const ee=Me.height.value,Ae=Bl.value;return ee?`${Math.min(Math.max(ee*.05,15),30)*Ae}px`:"20px"}),lt=se(()=>{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=se(()=>{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=se(()=>`${an.value}px`),Ni=se(()=>{var Ae;const ee=new Set(((Ae=So.value)==null?void 0:Ae.detectionZones.map(Et=>Et.classes).flat())??[]);return fe.value||ee.delete("motion"),ye.value||(ee.delete("animal"),ee.delete("person"),ee.delete("vehicle"),ee.delete("other")),Array.from(ee)});Ze(P,ee=>{var Ae,Et;ee==="hidden"?(clearTimeout(_e),_e=setTimeout(()=>{Hr()},Ix)):(clearTimeout(_e),(Ae=pe.value)!=null&&Ae.finishLoading?Co():(yr(),(Et=pe.value)==null||Et.start()))}),Ze(rt,async ee=>{ee&&await qa(!1,!1)}),Ze(Ee,ee=>{ee||qp(),d("streamFinishedLoading",ee)}),Ze(Ue,ee=>{clearInterval(it),ee==="mse"&&(it=setInterval(Dp,Ox))}),Ze(h,()=>{Jl()}),Ze(ke,ee=>{h.value==="standby"&&ee&&(St.value=!0,Hr())}),Ze(ht,()=>{var ee,Ae,Et;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Yl(((Ae=ht.value)==null?void 0:Ae.detections)??[]),eu("motion",((Et=ht.value)==null?void 0:Et.detections)??[]))},{deep:!0}),Ze(U,()=>{var ee,Ae,Et;((ee=_.value)==null?void 0:ee.detectionZones.length)!==0&&(Yl(((Ae=U.value)==null?void 0:Ae.detections)??[]),eu("object",((Et=U.value)==null?void 0:Et.detections)??[]))},{deep:!0});const Np=async()=>{if(!ct.value)throw new Error("Video player not found!");typeof k.value=="string"&&await S();const ee=await Ep();if(gt.value=await ee.deviceManager.getCamera(En.value),!gt.value)throw new Error("Camera not found!");pe.value=gt.value.createWebRTCSession({role:on.value,mode:kn.value,videoElement:ct.value,webrtcConnectTimeout:2e3}),pe.value.addEventListener("error",Vl),pe.value.addEventListener("reconnect",yr),pe.value.addEventListener("onModeChange",Hl),pe.value.addEventListener("onSourceChange",Ql),pe.value.addEventListener("onStreamProbe",Kl),pe.value.addEventListener("onFinishLoading",Zl),pe.value.addEventListener("onFirstFrame",Gl),pe.value.addEventListener("onLoadedData",Wl),Jl(!0)},Fp=()=>{var ee;if(kn.value==="auto"){const Ae=(ee=pe.value)!=null&&ee.currentMode?u(`components.player.streaming_mode_${pe.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=pe.value)!=null&&ee.currentResolution?u(`components.player.source_role_${pe.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")},zl=ee=>{if(!ct.value||!jt.value||!T.value){os.value={x:0,y:0},Cs.value=1;return}const Ae=jt.value.getBoundingClientRect(),Et=ct.value.getBoundingClientRect(),gs=Math.max(0,(Et.width-Ae.width)/2),ss=Math.max(0,(Et.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,Yt=Oh-1;ee.zoom>Yt?ee.type==="dblClick"?Zs(()=>{Cs.value=Kr}):Zs(()=>{Cs.value=Yt}):ee.zoom===1&&setTimeout(()=>{os.value={x:0,y:0}},10)},Ul=()=>{z.value&&!St.value&&d("expand")},Vl=ee=>{console.error(En.value,ee),Ue.value="error",Ee.value=!1,rt.value=!1},yr=()=>{Ue.value="reconnecting",Ee.value=!1,rt.value=!0},Hl=()=>{Ue.value=pe.value.currentMode,rt.value=!1,Ee.value=!1},Ql=()=>{Ue.value="adapting",ts.value=!0},Kl=()=>{Ue.value=pe.value.currentMode,ge.value=pe.value.hasBackchannel,Ie.value=pe.value.hasAudio},Zl=()=>{Ue.value=pe.value.currentMode,rt.value=!1},Gl=()=>{Ue.value=pe.value.currentMode,Ee.value=!0,ts.value=!1},Wl=()=>{Ue.value=pe.value.currentMode,Ee.value=!0,ts.value=!1},Jl=ee=>{var Ae,Et,gs,ss;clearTimeout(Fe),h.value==="always-on"?(St.value=!1,(Ae=pe.value)!=null&&Ae.finishLoading||(ee||yr(),(Et=pe.value)==null||Et.start())):h.value==="standby"?St.value||(yt(),(gs=pe.value)!=null&&gs.finishLoading||(yr(),(ss=pe.value)==null||ss.start())):h.value==="activity"&&(bs.value||(St.value=!0,Hr()))},Yl=ee=>{var Ae,Et;h.value==="activity"&&(!!(ee!=null&&ee.length&&ee.some(ss=>xe.value.includes(ss.label)))?(bs.value=!0,clearTimeout(Fe),(St.value||!((Ae=pe.value)!=null&&Ae.finishLoading))&&(St.value=!1,yr(),(Et=pe.value)==null||Et.start())):(clearTimeout(Fe),Fe=setTimeout(()=>{bs.value||(St.value=!0,Hr())},Nh),bs.value=!1))},jp=()=>{var ee;St.value&&(St.value=!1,yr(),(ee=pe.value)==null||ee.start(),h.value==="standby"?yt():h.value==="activity"&&(clearTimeout(Fe),bs.value||(Fe=setTimeout(()=>{St.value=!0,Hr()},Nh))))},Hr=()=>{var ee;(ee=pe.value)==null||ee.close(),Ee.value=!1},Xl=()=>{var ee;if(ct.value){const Ae=document.createElement("canvas");Ae.width=ct.value.videoWidth,Ae.height=ct.value.videoHeight,(ee=Ae.getContext("2d"))==null||ee.drawImage(ct.value,0,0,Ae.width,Ae.height);const Et=Ae.toDataURL("image/png"),gs=`${En.value.replace(/ /g,"_").toLowerCase()}_${new Date().toISOString()}.png`,ss=document.createElement("a");ss.setAttribute("download",gs),ss.href=Et,document.body.appendChild(ss),ss.click(),ss.remove()}},qp=()=>{var ee,Ae;(ee=xt.value)==null||ee.clear(),(Ae=Kt.value)==null||Ae.clear()},eu=(ee,Ae)=>{var Et,gs;Ee.value&&(ee==="motion"?(Et=xt.value)==null||Et.draw(Ae):ee==="object"&&((gs=Kt.value)==null||gs.draw(Ae)))},Co=async()=>{if(ct.value)try{await ct.value.play()}catch(ee){if(ct.value&&!ct.value.muted)return ct.value.muted=!0,Co();console.warn(En.value,ee)}},Dp=()=>{if(ct.value&&Ue.value==="mse"&&!rt.value&&Ee.value&&ct.value.buffered.length>0){const ee=ct.value.buffered.end(ct.value.buffered.length-1);ee-ct.value.currentTime>1&&(ct.value.currentTime=ee)}},Qr=ee=>{const Ae=xe.value.indexOf(ee);Ae>-1?xe.value.splice(Ae,1):xe.value.push(ee)},tu=ee=>{ee=ee??!ne.value,ne.value=ee},su=ee=>{nt.value=ee!==void 0?ee:!nt.value},qa=async(ee,Ae=!1)=>{var Et,gs;if((Et=pe.value)!=null&&Et.currentMode.includes("webrtc"))if(Ft.value=ee!==void 0?ee:!Ft.value,Ft.value)try{le.value=await navigator.mediaDevices.getUserMedia({audio:!0});const ss=le.value.getAudioTracks()[0];nt.value=!Ae,await pe.value.toggleMicrophone(ss)}catch(ss){console.warn(En.value,ss)}else(gs=le.value)==null||gs.getTracks().forEach(ss=>ss.stop()),le.value=void 0,await pe.value.toggleMicrophone(null)},nu=ee=>{h.value=ee||(h.value==="always-on"?"standby":h.value==="standby"?"activity":"always-on")},ru=async ee=>{var Et;let Ae=on.value;Ae=ee||(Ae==="auto"?"low-resolution":Ae==="low-resolution"?"mid-resolution":Ae==="mid-resolution"?"high-resolution":"auto"),await((Et=pe.value)==null?void 0:Et.toggleRole(Ae)),v.value=Ae},iu=async ee=>{var Et;let Ae=kn.value;Ae=ee||(Ae==="auto"?"webrtc":Ae==="webrtc"?"mse":"auto"),await((Et=pe.value)==null?void 0:Et.toggleMode(Ae)),f.value=Ae},ou=()=>{var ee;document.pictureInPictureElement?document.exitPictureInPicture():document.pictureInPictureEnabled&&((ee=ct.value)==null||ee.requestPictureInPicture())},au=()=>{ct.value&&(Ce.value?(ls.value=!0,ct.value.pause()):Co())},cu=()=>{o.value?ce():Pe.value=!Pe.value},lu=()=>{Be.value=!Be.value},uu=()=>{us.value=!us.value},du=()=>{hs.value=!hs.value},hu=()=>{V.value=!V.value},mu=()=>{},pu=()=>{},Bp=ee=>{Xe.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,Et,gs,ss,br,wr,Kr,Yt;clearTimeout(Fe),(ee=pe.value)==null||ee.removeEventListener("error",Vl),(Ae=pe.value)==null||Ae.removeEventListener("reconnect",yr),(Et=pe.value)==null||Et.removeEventListener("onModeChange",Hl),(gs=pe.value)==null||gs.removeEventListener("onSourceChange",Ql),(ss=pe.value)==null||ss.removeEventListener("onStreamProbe",Kl),(br=pe.value)==null||br.removeEventListener("onFinishLoading",Zl),(wr=pe.value)==null||wr.removeEventListener("onFirstFrame",Gl),(Kr=pe.value)==null||Kr.removeEventListener("onLoadedData",Wl),Hr(),(Yt=gt.value)==null||Yt.close()}),e({togglePlay:au,toggleSourceRole:ru,togglePictureInPicture:ou,toggleActivityMode:nu,toggleAddingShortcuts:du,toggleStreamingMode:iu,toggleFs:cu,toggleMute:su,toggleMicrophone:qa,toggleShortcuts:lu,togglePtz:uu,toggleFastForward:pu,toggleRewind:mu,toggleZones:tu,toggleDetectionClass:Qr,toggleTimeline:hu,timelineScroll:Bp,captureScreenshot:Xl}),(ee,Ae)=>{const Et=vx,gs=Lr,ss=px,br=dx,wr=cx,Kr=ix,Yt=ys,zp=sx,Up=X8,Vp=W8,Hp=K8,Qp=V8,Kp=B8,Zp=j8,Gp=N8,Wp=R8,Jp=$8,Yp=E8,Xp=S8,e0=b8,t0=v8,s0=p8,n0=d8,r0=c8,i0=i8,o0=s8,a0=X6,c0=W6,l0=k6,fu=w6,u0=s6,d0=Ll,h0=X4,m0=W4,p0=K4,f0=V4,g0=B4,v0=j4,_0=Sp,y0=I4,b0=P4,w0=A4,x0=C4,S0=Vc,C0=Sa,k0=Bh,E0=gp,Js=jr;return m(),M("div",null,[y(k0,{class:"cui-card",pt:c(Rp)},{content:$(()=>{var gu;return[g("div",{id:"video-container",ref_key:"playerContainerRef",ref:jt,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(Dl)})},{default:$(()=>{var ko,vu;return[c(St)?(m(),M("div",yx,[g("div",bx,[y(Et,{class:"text-white w-[50px] h-[50px]"}),c(Me).width.value>=350?(m(),M("p",wx,he(ee.$t("components.player.stream_paused")),1)):ae("",!0)])])):ae("",!0),c(_t)&&!c(St)?(m(),M("div",xx,[y(gs,{class:"w-[30px] h-[30px] m-0","stroke-width":"5"}),c(rt)?(m(),M("span",Sx,he(ee.$t("components.player.reconnecting"))+"...",1)):ae("",!0)])):ae("",!0),!c(St)&&(c(ql)||c(I))?(m(),M("div",Cx,[c(I)?(m(),M("div",{key:0,class:at(["w-[10px] h-[10px] rounded-full shadow-md",{"bg-red-500":c(Ee),"bg-gray-500":!c(Ee)}])},null,2)):ae("",!0),c(ql)?(m(),M("span",kx,he(c(En)),1)):ae("",!0)])):ae("",!0),c(Pp)?(m(),M("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(j)&&!c(us)?It((m(),L(Yt,{key:0,disabled:c(_t),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=>ru())},{icon:$(()=>[c(on)==="auto"?(m(),L(ss,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):c(on)==="low-resolution"?(m(),L(br,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):c(on)==="mid-resolution"?(m(),L(wr,{key:2,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Kr,{key:3,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Lp()},void 0,{top:!0}]]):ae("",!0),c(Q)&&!c(us)?It((m(),L(Yt,{key:1,disabled:c(_t),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=>nu())},{icon:$(()=>[h.value==="always-on"?(m(),L(zp,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):h.value==="standby"?(m(),L(Up,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Vp,{key:2,width:`${c(lt)}px`,height:`${c(lt)}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}]]):ae("",!0),c(ie)&&!c(us)?It((m(),L(Yt,{key:2,disabled:c(_t),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=>iu())},{icon:$(()=>[c(kn)==="auto"?(m(),L(Hp,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):c(kn)==="mse"?(m(),L(Qp,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Kp,{key:2,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])),[[Js,{value:Fp()},void 0,{top:!0}]]):ae("",!0),c(us)&&c(X)&&c(Me).width.value>=350?It((m(),L(Yt,{key:3,disabled:c(_t)||((ko=c(vt))==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 _u;return(_u=c(vt))==null?void 0:_u.goToHome()})},{icon:$(()=>[y(Zp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz_go_to_home")},void 0,{top:!0}]]):ae("",!0),c(J)&&c(Me).width.value>=350&&c(X)?It((m(),L(Yt,{key:4,disabled:c(_t)||c(V),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:uu},{icon:$(()=>[y(Gp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1},8,["disabled","style"])),[[Js,{value:ee.$t("components.player.ptz")},void 0,{top:!0}]]):ae("",!0)],4)):ae("",!0),c($p)&&!c(V)&&!c(Oi)?(m(),M("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(H)?(m(),L(Yt,{key:0,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",onClick:mu},{icon:$(()=>[y(Wp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1})):ae("",!0),c(B)?(m(),L(Yt,{key:1,disabled:c(_t),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:au},{icon:$(()=>[c(Ce)?(m(),L(Yp,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(Jp,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(N)?(m(),L(Yt,{key:2,disabled:"",fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:pu},{icon:$(()=>[y(Xp,{width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])]),_:1},8,["style"])):ae("",!0),c(R)?(m(),L(Yt,{key:3,disabled:!c(ds)||c(_t),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=>su())},{icon:$(()=>[c(nt)?(m(),L(t0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(e0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(C)?(m(),L(Yt,{key:4,disabled:!c(ws)||c(_t),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(Ft)?(m(),L(s0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(n0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(A)?(m(),L(Yt,{key:5,disabled:!c(l)||c(_t),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:ou},{icon:$(()=>[c(Zt)?(m(),L(i0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(r0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0),c(D)?(m(),L(Yt,{key:6,disabled:!c(o)||c(_t),fluid:"",text:"",severity:"contrast",class:"!rounded-none !h-full",style:ot({width:`${c(an)}px`,height:`${c(Ws)}px`}),onClick:cu},{icon:$(()=>[c(Pe)?(m(),L(a0,{key:1,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"])):(m(),L(o0,{key:0,width:`${c(lt)}px`,height:`${c(lt)}px`},null,8,["width","height"]))]),_:1},8,["disabled","style"])):ae("",!0)],4)):ae("",!0),It(g("div",Ex,null,512),[[Pr,c(V)&&!c(Oi)&&!c(St)]]),c(Oi)&&!c(V)&&!c(St)&&c(gt)?(m(),M("div",Ax,[y(c0,{ref_key:"ptzRef",ref:vt,"camera-device":c(gt)},null,8,["camera-device"])])):ae("",!0),(c(Be)||c(hs))&&!c(St)?(m(),L(l0,{key:6,"camera-name":c(En),"adding-shortcuts":c(hs),class:"z-4 pointer-events-none"},null,8,["camera-name","adding-shortcuts"])):ae("",!0),c(fe)&&!c(St)?(m(),L(fu,{key:7,ref_key:"motionDetectionCanvasRef",ref:xt,classes:c(xe),class:"z-3 pointer-events-none"},null,8,["classes"])):ae("",!0),c(ye)&&!c(St)?(m(),L(fu,{key:8,ref_key:"objectDetectionCanvasRef",ref:Kt,classes:c(xe),class:"z-3 pointer-events-none"},null,8,["classes"])):ae("",!0),c(ne)&&!c(St)?(m(),L(u0,{key:9,"camera-zones":((vu=c(De))==null?void 0:vu.detectionZones)??[],class:"z-2 pointer-events-none"},null,8,["camera-zones"])):ae("",!0),It(y(d0,{key:"snapshot",ref_key:"snapshotRef",ref:Je,"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:Ul},null,8,["camera-name","class"]),[[Pr,(!c(Ee)||c(St)||c(ts))&&!c(Zt)]]),y(c(Ef),{key:"zoomable",pan:c(os),"onUpdate:pan":Ae[6]||(Ae[6]=Ln=>ps(os)?os.value=Ln:null),zoom:c(Cs),"onUpdate:zoom":Ae[7]||(Ae[7]=Ln=>ps(Cs)?Cs.value=Ln:null),disabled:!c(Z)||c(V)||c(Oi)||c(St),"enable-control-button":!1,"dbl-click-enabled":!1,"min-zoom":1,"max-zoom":Oh,selector:c(Z)?`[data-player-id='${c(Ne)}']`:"disabled","zoom-origin":"pointer",class:"h-full w-full items-center justfiy-center",onPanned:zl,onZoom:zl},{default:$(()=>[g("video",{ref_key:"videoPlayerRef",ref:ct,"data-player-id":c(Ne),playsinline:"",autoplay:"",preload:"auto",muted:c(nt),class:at(["w-full cursor-[inherit] object-fill",{"cursor-pointer":c(z),"object-contain":c(Pe)}]),style:ot({aspectRatio:c(Dl)}),onClick:Ul},null,14,Mx)]),_:1},8,["pan","zoom","disabled","selector"])]}),_:1},8,["style"])],512),c(ue)?(m(),M("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(pt)])},[g("div",$x,[c(Ii)?(m(),L(gs,{key:0,"stroke-width":"5",class:"w-[10px] h-[10px]"})):(m(),M("div",Px)),g("span",Tx,he(c(En)),1)]),Ae[10]||(Ae[10]=g("div",{class:"ml-auto"},null,-1)),c(Y)?It((m(),L(Yt,{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}]]):ae("",!0),c(He)?It((m(),L(Yt,{key:1,fluid:"",text:"",severity:"contrast",class:"cui-icon-lg not-hover:text-surface-400",onClick:Xl},{icon:$(()=>[y(m0,{width:"100%",height:"100%"})]),_:1})),[[Js,{value:ee.$t("components.player.capture_snapshot")},void 0,{top:!0}]]):ae("",!0),c(Ge)?It((m(),L(Yt,{key:2,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(ne)}]),onClick:Ae[8]||(Ae[8]=ko=>tu())},{icon:$(()=>[c(ne)?(m(),L(f0,{key:1,width:"100%",height:"100%"})):(m(),L(p0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(ne)?ee.$t("components.player.hide_zones"):ee.$t("components.player.show_zones")},void 0,{top:!0}]]):ae("",!0),c(F)&&(c(fe)||c(ye))?It((m(),L(Yt,{key:3,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(xe).length}]),onClick:(gu=c(de))==null?void 0:gu.toggleMenu},{icon:$(()=>[y(g0,{width:"100%",height:"100%"})]),_:1},8,["class","onClick"])),[[Js,{value:ee.$t("components.player.detections")},void 0,{top:!0}]]):ae("",!0),c(Te)?It((m(),L(Yt,{key:4,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(Be)||c(hs)}]),onClick:lu},{icon:$(()=>[!c(Be)&&!c(hs)?(m(),L(v0,{key:0,width:"100%",height:"100%"})):(m(),L(_0,{key:1,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(Be)?ee.$t("components.player.hide_shortcuts"):ee.$t("components.player.show_shortcuts")},void 0,{top:!0}]]):ae("",!0),c(Te)?It((m(),L(Yt,{key:5,fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(hs)}]),onClick:du},{icon:$(()=>[c(hs)?(m(),L(b0,{key:1,width:"100%",height:"100%"})):(m(),L(y0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:c(hs)?ee.$t("components.player.save_shortcuts"):ee.$t("components.player.add_shortcuts")},void 0,{top:!0}]]):ae("",!0),c(ft)?It((m(),L(Yt,{key:6,disabled:c(Oi),fluid:"",text:"",severity:"contrast",class:at(["cui-icon-lg not-hover:text-surface-400",{active:c(V)}]),onClick:hu},{icon:$(()=>[c(V)?(m(),L(x0,{key:1,width:"100%",height:"100%"})):(m(),L(w0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["disabled","class"])),[[Js,{value:c(V)?ee.$t("components.player.hide_timeline"):ee.$t("components.player.show_timeline")},void 0,{top:!0}]]):ae("",!0),c(q)&&("useCuiPermission"in ee?ee.useCuiPermission:c(Si))(void 0,"admin")?It((m(),L(Yt,{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(),L(C0,{key:1,width:"100%",height:"100%"})):(m(),L(S0,{key:0,width:"100%",height:"100%"}))]),_:1},8,["class"])),[[Js,{value:ee.$t("components.player.settings")},void 0,{top:!0}]]):ae("",!0)],6)):ae("",!0)]}),_:1},8,["pt"]),y(E0,{ref_key:"menuRef",ref:de,items:c(Tp),"sort-list":"","auto-hide":!1},null,8,["items"])])}}}),Ap=qs(Nx,[["__scopeId","data-v-d1d904d2"]]),Fx=al({protocol:ep,url:Jh().trim().min(1,"Camera Source is required").array().nonempty("Camera Source is required")}).strict(),Lx=al({name:Jh().trim().min(1,"Camera Source Name is required"),urls:Fx.array(),role:Ml,useForSnapshot:ku().default(!1),hotMode:ku().default(!1)}).strict(),jx=al({...E2.innerType().shape,sources:Lx.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(),g9=Wn(jx),v9=Wn(k2),qx=Wn(A2),Dx=Wn(Al),Bx={class:"w-full h-full relative"},zx={class:"flex flex-col justify-center items-center"},Ux={class:"relative w-full"},Vx={class:"w-full flex flex-col items-center justify-center gap-6"},Hx={class:"relative w-full flex flex-col items-center justify-center"},Qx={class:"absolute top-0 left-0 right-0 bottom-0"},Kx={class:"playground-container flex w-full h-full"},Zx={class:"sandbox w-full h-full"},Gx={class:"handles"},Wx=["data-id","data-point","data-point-index","data-zone-index","onDblclick"],Jx={class:"clipboard"},Yx={width:"100%",height:"100%",class:"polygon-container"},Xx=["d","onClick","onDblclick","onMousedown","onTouchstart"],eS={class:"flex flex-col gap-6 zone-buttons justify-center items-center"},tS=["for"],sS=["for"],nS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},rS={class:"flex flex-row h-[50px] rounded-full overflow-hidden justify-self-center max-w-max border-[1px] border-color-inner"},iS=Tt({__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}=Jt(i),u=Qt("draggablesRef"),d=Qt("outsideRef"),h=Qt("playerRef"),v=Ls([]),f=oe([]),b=oe(!1),k=oe([]),z=oe(void 0),O=oe(-1),te=oe(-1),W=oe(["animal","vehicle","person","other","motion"]);let I=!1;const E={x:0,y:0},N=rl(h);nl(d,U=>{const X=U.target,fe=X.closest(".polygon"),ye=X.closest(".edit-button"),pe=X.closest(".remove-button"),le=X.closest(".handle"),ge=X.closest(".zone-buttons"),Ie=X.closest(".p-multiselect-list"),Ee=X.closest(".p-colorpicker-panel");!fe&&!ye&&!pe&&!le&&!b.value&&!ge&&!Ie&&!Ee&&(O.value=-1)});const{mutateAsync:D,isPending:C}=t.patchZonesQuery(),A=se(()=>{var U;return!!((U=o.loading)!=null&&U.value||C.value)}),B=se(()=>{var X;const U=[];return b.value&&U.push("customizing"),(X=f.value)!=null&&X.length||U.push("start"),U.join(" ")});Ze(te,()=>{te.value=-1}),Ze(O,(U,X)=>{var fe,ye;if(U===-1&&((fe=f.value)!=null&&fe.length)&&f.value[X]){O.value=X;return}U===-1&&((ye=f.value)!=null&&ye.length)&&(te.value=0)}),Ze(l,()=>{f.value=xi(l.value),H()},{deep:!0,immediate:!0});function H(){if(f.value){if(f.value.length===0){k.value=[];return}k.value=f.value.flatMap((U,X)=>U.points.map((fe,ye)=>({_id:`${U.name}-${ye}`,zoneIndex:X,pointIndex:ye,point:[fe[0],fe[1]]})))}}Ze([N.width,N.height],()=>{Kt()});const R=U=>{if("touches"in U){const X=U.touches[0];return{x:X.clientX,y:X.clientY}}return{x:U.clientX,y:U.clientY}},w=(U,X)=>{if(U.stopPropagation(),!h.value)return;Te(b.value),I=!0,O.value=X;const fe=h.value.getBoundingClientRect(),{x:ye,y:pe}=R(U);E.x=(ye-fe.left)/fe.width*100,E.y=(pe-fe.top)/fe.height*100},Q=U=>{if(!I||!h.value||O.value===-1||!f.value.length)return;const X=h.value.getBoundingClientRect(),{x:fe,y:ye}=R(U),pe=(fe-X.left)/X.width*100,le=(ye-X.top)/X.height*100,ge=pe-E.x,Ie=le-E.y,Ee=f.value[O.value].points;let Ue=!1;for(let rt=0;rt<Ee.length;rt++){const St=Ee[rt][0]+ge,ts=Ee[rt][1]+Ie;if(St<0||St>100||ts<0||ts>100){Ue=!0;break}}if(!Ue)for(let rt=0;rt<Ee.length;rt++){Ee[rt][0]+=ge,Ee[rt][1]+=Ie,Ee[rt][0]=Math.max(0,Math.min(100,Ee[rt][0])),Ee[rt][1]=Math.max(0,Math.min(100,Ee[rt][1]));const St=Ee[rt][0]/100*X.width,ts=Ee[rt][1]/100*X.height,bs=v.value.find(ls=>ls.id===`${f.value[O.value].name}-${rt}`);bs==null||bs.setPosition(St,ts)}E.x=pe,E.y=le},J=()=>{setTimeout(()=>{I=!1},100)},j=()=>{!f.value.length||O.value===-1||(f.value[O.value].isPrivacyMask=!f.value[O.value].isPrivacyMask)},ie=()=>{f.value[O.value]&&(f.value[O.value].filter=f.value[O.value].filter==="include"?"exclude":"include")},ue=()=>{f.value[O.value]&&(f.value[O.value].type=f.value[O.value].type==="intersect"?"contain":"intersect")},Se=U=>{if(!b.value||I)return;const X=z.value!==void 0?z.value:f.value.length,fe=Math.min(Math.max(Math.round((U.offsetX-10)/N.width.value*100),0),100),ye=Math.min(Math.max(Math.round((U.offsetY-10)/N.height.value*100),0),100);if(z.value===void 0){const pe=`zone-${Date.now()}`;f.value.push({name:pe,points:[],filter:"include",type:"contain",classes:["animal","motion","person","vehicle"],isPrivacyMask:!1,color:Je()}),z.value=f.value.length-1}f.value[X].points.push([fe,ye]),H(),Zs(()=>{const pe=f.value[X].points.length-1;F({_id:`${f.value[X].name}-${pe}`,zoneIndex:X,pointIndex:pe,point:[fe,ye]})})},F=U=>{var fe;if(U.zoneIndex===void 0||U.pointIndex===void 0)return;const X=(fe=u.value)==null?void 0:fe.filter(ye=>ye.dataset.pointIndex===U.pointIndex.toString()&&ye.dataset.zoneIndex===U.zoneIndex.toString());!X||X.length===0||ct(X[0],U.point)},q=U=>{if(!f.value.length)return;const X=Math.round(U.point[0]/N.width.value*100),fe=Math.round(U.point[1]/N.height.value*100);f.value[U.zoneIndex].points[U.pointIndex]=[X,fe]},Y=()=>{b.value=!0,z.value=void 0},Te=U=>{var fe;if(z.value===void 0){b.value=!1;return}b.value=U||!1;const X=z.value;!f.value[X]||!f.value[X].points||(f.value[X].points.length<3?(f.value.splice(X,1),H()):((fe=u.value)==null||fe.forEach(ye=>De(ye)),O.value=X),z.value=void 0)},He=()=>{b.value=!0,z.value=O.value},pt=()=>{O.value===-1||!f.value.length||(f.value.splice(O.value,1),O.value=Math.max(-1,O.value-1),H(),Zs(()=>{Kt()}))},ft=()=>{var U;if((U=f.value)!=null&&U.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),H());return}f.value.length>0&&(f.value.pop(),H(),Zs(()=>{Kt()}))}},Ge=()=>{I=!1,b.value=!1,z.value=void 0,f.value&&(f.value.length=0,k.value=[],Zs(()=>{vt()}))},Je=()=>{const U=Math.floor(Math.random()*256),X=Math.floor(Math.random()*256),fe=Math.floor(Math.random()*256);return"#"+[U,X,fe].map(ye=>ye.toString(16).padStart(2,"0")).join("")},de=U=>{if(!U||!U.length)return"";const X=U.map(ye=>{const pe=Math.round(ye[0]/100*N.width.value),le=Math.round(ye[1]/100*N.height.value);return`${pe+10},${le+10}`});if(X.length===0)return"";let fe=`M ${X[0]}`;for(let ye=1;ye<X.length;ye++)fe+=` L ${X[ye]}`;return fe+=" Z",fe},xt=U=>{b.value||(O.value=U)},Kt=()=>{var U;vt(),(U=u.value)==null||U.forEach(X=>{if(!X.dataset.zoneIndex||!X.dataset.pointIndex)return;const fe=parseInt(X.dataset.zoneIndex),ye=parseInt(X.dataset.pointIndex);if(!f.value[fe]||!f.value[fe].points[ye])return;const pe=f.value[fe].points[ye];pe&&(ct(X,pe),De(X))})},vt=()=>{v.value.forEach(U=>U.destroy()),v.value=[]},jt=U=>{!f.value.length||!f.value[U.zoneIndex]||f.value[U.zoneIndex].points.length<4||(f.value[U.zoneIndex].points.splice(U.pointIndex,1),H(),Zs(()=>{Kt()}))},ct=(U,X)=>{Object.assign(U.style,gt(X))},gt=U=>({left:Math.round(U[0]/100*N.width.value)+"px",top:Math.round(U[1]/100*N.height.value)+"px"}),De=U=>{U.classList.add("draggable");const X=new Yh(U,{containment:!0,grid:[0,0]}).on("pointerDown",()=>{var fe;(fe=document.querySelectorAll(`[data-point="${U.dataset.zoneIndex}-${U.dataset.pointIndex}"]`)[0])==null||fe.classList.add("changing")}).on("dragMove",()=>{if(!U.dataset.zoneIndex||!U.dataset.pointIndex||!U.dataset.id)return;const fe=X.position.x,ye=X.position.y;q({_id:U.dataset.id,point:[fe,ye],pointIndex:parseInt(U.dataset.pointIndex),zoneIndex:parseInt(U.dataset.zoneIndex)})}).on("pointerUp",()=>{document.querySelectorAll(".point").forEach(fe=>fe.classList.remove("changing"))});X.id=U.dataset.id,v.value.push(X)},ht=async()=>{if(f.value.length)try{const U=await Dx.parse(f.value);if(!U.value)return n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",U.errors),null;await D({cameraname:a.value,zoneData:f.value})}catch(U){return console.error("Error saving zones:",U),n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.save_failed"),life:3e3}),null}};return Sn(async()=>{var U;setTimeout(()=>{Kt()}),(U=f.value)!=null&&U.length&&(O.value=0)}),e({isLoading:A,onConfirm:ht}),(U,X)=>{var ve,Ce,nt,Ft,Zt,Xe,xe,Ne,Fe;const fe=Ap,ye=Dh,pe=go,le=ki,ge=O0,Ie=Aa,Ee=w4,Ue=ys,rt=_p,St=_4,ts=f4,bs=h4,ls=l4,os=o4,Cs=n4,hs=e4,Be=J3,us=Z3,V=H3,ne=jr;return m(),M("div",Bx,[g("div",zx,[g("div",Ux,[g("div",{ref_key:"outsideRef",ref:d},null,512),g("div",Vx,[g("div",Hx,[g("div",Qx,[g("div",Kx,[g("section",{class:at(["playground w-full h-full",c(B)]),onClick:Se},[g("div",Zx,[g("div",Gx,[(m(!0),M(Ct,null,zt(c(k),_e=>(m(),M("div",{key:_e._id,ref_for:!0,ref_key:"draggablesRef",ref:u,class:"handle","data-id":_e._id,"data-point":`${_e.zoneIndex}-${_e.pointIndex}`,"data-point-index":_e.pointIndex,"data-zone-index":_e.zoneIndex,onDblclick:lr(it=>jt(_e),["prevent"])},X[3]||(X[3]=[g("div",{class:"delete-point"},null,-1)]),40,Wx))),128)),g("div",Jx,[(m(),M("svg",Yx,[(m(!0),M(Ct,null,zt(c(f),(_e,it)=>(m(),M("path",{key:_e.name,d:de(_e.points),class:at(["cursor-pointer",{dash:_e.type==="intersect"&&!_e.isPrivacyMask,selected:c(O)===it}]),style:ot({fill:_e.isPrivacyMask?"rgba(16, 16, 16, 0.9)":_e.filter==="exclude"?"transparent":`${_e.color}4D`,stroke:_e.isPrivacyMask?"#333333":_e.color,"stroke-width":"2"}),onClick:_=>xt(it),onDblclick:()=>_e.isPrivacyMask=!_e.isPrivacyMask,onMousedown:_=>w(_,it),onMousemove:Q,onMouseup:J,onTouchstart:_=>w(_,it),onTouchmove:Q,onTouchend:J},null,46,Xx))),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(fe,{"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",eS,[y(c(Dt),{"model-value":(ve=c(f)[c(O)])==null?void 0:ve.classes,name:`zone[${c(O)}].classes`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:_e,errors:it})=>[g("label",{for:`zone[${c(O)}].classes`,class:"cui-label"},he(U.$t("components.form.label.classes")),9,tS),y(pe,null,{default:$(()=>{var _,x;return[y(ye,tt(_e,{"model-value":(_=c(f)[c(O)])==null?void 0:_.classes,options:c(W),disabled:(x=c(f)[c(O)])==null?void 0:x.isPrivacyMask,invalid:it.length>0,loading:c(A),"max-selected-labels":2,"show-toggle-all":!1,"show-clear":"",type:"text",onValueChange:X[0]||(X[0]=S=>c(f)[c(O)].classes=S)}),null,16,["model-value","options","disabled","invalid","loading"])]}),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`zone[${c(O)}].classes`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),y(c(Dt),{"model-value":(Ce=c(f)[c(O)])==null?void 0:Ce.color,name:`zone[${c(O)}].color`,as:"div",class:"flex flex-col field-gap w-full"},{default:$(({field:_e,errors:it})=>[g("label",{for:`zone[${c(O)}].color`,class:"cui-label"},he(U.$t("components.form.label.color")),9,sS),y(pe,null,{default:$(()=>{var _;return[y(le,tt(_e,{disabled:(_=c(f)[c(O)])==null?void 0:_.isPrivacyMask,invalid:it.length>0,loading:c(A),readonly:"",type:"text"}),null,16,["disabled","invalid","loading"]),y(Ie,null,{default:$(()=>{var x,S;return[(m(),L(ge,{key:c(O),"model-value":(x=c(f)[c(O)])==null?void 0:x.color,format:"hex",disabled:(S=c(f)[c(O)])==null?void 0:S.isPrivacyMask,onValueChange:X[1]||(X[1]=P=>P?c(f)[c(O)].color=`#${P}`:null)},null,8,["model-value","disabled"]))]}),_:1})]}),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`zone[${c(O)}].color`,class:"cui-input-error"},null,8,["name"])]),_:1})]),_:1},8,["model-value","name"]),g("div",nS,[c(b)?It((m(),L(Ue,{key:1,disabled:c(z)!==void 0&&((Ft=(nt=c(f)[c(z)])==null?void 0:nt.points)==null?void 0:Ft.length)<3,loading:c(A),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:X[2]||(X[2]=_e=>Te(!1))},{icon:$(()=>[y(rt,{width:"20px",height:"20px"})]),_:1},8,["disabled","loading"])),[[ne,{value:U.$t("components.form.tooltip.finish")},void 0,{top:!0}]]):It((m(),L(Ue,{key:0,loading:c(A),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Y},{icon:$(()=>[y(Ee,{width:"20px",height:"20px"})]),_:1},8,["loading"])),[[ne,{value:U.$t("components.form.tooltip.new")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length||c(O)<0||c(b),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:He},{icon:$(()=>[y(St,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.edit")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length||c(O)<0,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:pt},{icon:$(()=>[y(ts,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.delete")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ft},{icon:$(()=>[y(bs,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.undo")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:!c(f).length,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:Ge},{icon:$(()=>[y(ls,{width:"20px",height:"20px"})]),_:1},8,["loading","disabled"])),[[ne,{value:U.$t("components.form.tooltip.clear")},void 0,{top:!0}]])]),g("div",rS,[It((m(),L(Ue,{loading:c(A),disabled:!(c(f).length&&c(O)>=0&&c(f)[c(O)]),severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:j},{icon:$(()=>{var _e;return[(_e=c(f)[c(O)])!=null&&_e.isPrivacyMask?(m(),L(os,{key:0,width:"20px",height:"20px"})):(m(),L(Cs,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[ne,{value:(Zt=c(f)[c(O)])!=null&&Zt.isPrivacyMask?U.$t("components.form.tooltip.privacy_mask"):U.$t("components.form.tooltip.public_mask")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:(Xe=c(f)[c(O)])==null?void 0:Xe.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ie},{icon:$(()=>{var _e;return[((_e=c(f)[c(O)])==null?void 0:_e.filter)==="include"?(m(),L(hs,{key:0,width:"20px",height:"20px"})):(m(),L(Be,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[ne,{value:((xe=c(f)[c(O)])==null?void 0:xe.filter)==="include"?U.$t("components.form.tooltip.include"):U.$t("components.form.tooltip.exclude")},void 0,{top:!0}]]),It((m(),L(Ue,{loading:c(A),disabled:(Ne=c(f)[c(O)])==null?void 0:Ne.isPrivacyMask,severity:"secondary",class:"!rounded-none !h-full w-[60px]",onClick:ue},{icon:$(()=>{var _e;return[((_e=c(f)[c(O)])==null?void 0:_e.type)==="intersect"?(m(),L(us,{key:0,width:"20px",height:"20px"})):(m(),L(V,{key:1,width:"20px",height:"20px"}))]}),_:1},8,["loading","disabled"])),[[ne,{value:((Fe=c(f)[c(O)])==null?void 0:Fe.type)==="intersect"?U.$t("components.form.tooltip.intersect"):U.$t("components.form.tooltip.contain")},void 0,{top:!0}]])])])])])])])}}}),oS=qs(iS,[["__scopeId","data-v-51a8517c"]]),aS={class:"text-color font-normal"},cS={class:"flex flex-col gap-6"},lS={for:"name",class:"cui-label"},uS={for:"type",class:"cui-label"},dS={class:"flex items-center gap-4"},hS={class:"flex flex-col field-switch-gap"},mS={for:"disabled",class:"cui-label-switch"},pS={class:"text-color font-normal"},fS={class:"flex flex-col gap-6"},gS={for:"info.manufacturer",class:"cui-label"},vS={for:"info.model",class:"cui-label"},_S={for:"info.hardware",class:"cui-label"},yS={for:"info.serialNumber",class:"cui-label"},bS={for:"info.firmwareVersion",class:"cui-label"},wS={for:"info.supportUrl",class:"cui-label"},xS={class:"text-color font-normal"},SS={class:"flex flex-col gap-6"},CS={for:"interface.streamingMode",class:"cui-label"},kS={for:"interface.streamingSource",class:"cui-label"},ES={for:"interface.aspectRatio",class:"cui-label"},AS={class:"text-color font-normal"},MS={class:"flex flex-col gap-6"},$S={for:"detectionSettings.motion.timeout",class:"cui-label"},PS={for:"detectionSettings.object.confidence",class:"cui-label"},TS={class:"text-color font-normal"},RS={class:"flex flex-col gap-6 w-full items-center justify-center"},IS={class:"text-color font-normal"},OS={class:"flex flex-col gap-6"},NS={for:"snapshotTTL",class:"cui-label"},FS={class:"text-color font-normal"},LS={class:"flex flex-col gap-6"},jS={for:"frameWorkerSettings.decoder",class:"cui-label"},qS={for:"frameWorkerSettings.resolution",class:"cui-label"},DS={for:"frameWorkerSettings.fps",class:"cui-label"},BS=Tt({__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}=Jt(u),v=oe(["camera","doorbell"]),f=oe(["auto","mse","webrtc","webrtc/tcp"]),b=oe(["auto","high-resolution","mid-resolution","low-resolution"]),k=oe(["16:9","8:3","4:3","auto"]),z=oe(["pillow","wasm","rust","gpu"]),O=oe(["640x480","640x360","320x240","320x180"]),{mutateAsync:te,isPending:W}=t.removeCameraQuery(),I=se(()=>h.value||W.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 te({cameraname:d.value.name}),n.path.includes(d.value.name)&&r.push({path:"/cameras"}),l("close")}catch{}}})},N=(D=[])=>{i.openComponentDialog(oS,{data:{title:o("components.zone_editor.edit_zones"),loading:I,contentProps:{cameraName:d.value.name,zones:D}}})};return(D,C)=>{const A=Jc,B=ki,H=go,R=Zc,w=Kc,Q=fo,J=ys,j=Yc,ie=Wc,ue=qh,Se=Gc;return m(),L(Se,{multiple:"",class:"p-4"},{default:$(()=>[y(ie,{value:"general"},{default:$(()=>[y(A,{class:"px-0 pt-0"},{default:$(()=>[g("span",aS,he(D.$t("components.camera_options.general")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",cS,[y(c(Dt),{modelValue:a.value.name,"onUpdate:modelValue":C[0]||(C[0]=F=>a.value.name=F),modelModifiers:{trim:!0},name:"name",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",lS,he(D.$t("components.form.label.name")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"name",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{"model-value":a.value.type,name:"type",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",uS,he(D.$t("components.form.label.type")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.type,options:c(v),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[1]||(C[1]=Y=>a.value.type=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"type",class:"cui-input-error"})]),_:1})]),_:1},8,["model-value"]),y(c(Dt),{"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:q})=>[g("div",dS,[g("div",hS,[g("label",mS,he(D.$t("components.form.label.disabled")),1),y(w,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.disable_camera")),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"disabled",class:"cui-input-switch-error"})]),_:1})]),y(Q,tt({"model-value":a.value.disabled},F,{invalid:q.length>0,loading:c(I),class:"ml-auto shrink-0",onValueChange:C[2]||(C[2]=Y=>a.value.disabled=Y)}),null,16,["model-value","invalid","loading"])])]),_:1},8,["model-value"]),y(J,{fluid:"",severity:"danger",loading:c(I),class:"cui-button-medium",label:D.$t("components.form.button.remove"),onClick:C[3]||(C[3]=F=>E())},null,8,["loading","label"])])]),_:1})]),_:1}),y(ie,{value:"branding"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",pS,he(D.$t("components.camera_options.branding")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",fS,[y(c(Dt),{modelValue:a.value.info.manufacturer,"onUpdate:modelValue":C[4]||(C[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:q})=>[g("label",gS,he(D.$t("components.form.label.manufacturer")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.manufacturer",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.model,"onUpdate:modelValue":C[5]||(C[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:q})=>[g("label",vS,he(D.$t("components.form.label.model")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.model",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.hardware,"onUpdate:modelValue":C[6]||(C[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:q})=>[g("label",_S,he(D.$t("components.form.label.hardware_version")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.hardware",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.serialNumber,"onUpdate:modelValue":C[7]||(C[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:q})=>[g("label",yS,he(D.$t("components.form.label.serial_number")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.serialNumber",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.firmwareVersion,"onUpdate:modelValue":C[8]||(C[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:q})=>[g("label",bS,he(D.$t("components.form.label.firmware_version")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.firmwareVersion",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"]),y(c(Dt),{modelValue:a.value.info.supportUrl,"onUpdate:modelValue":C[9]||(C[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:q})=>[g("label",wS,he(D.$t("components.form.label.support_url")),1),y(H,null,{default:$(()=>[y(B,tt(F,{invalid:q.length>0,loading:c(I),type:"text"}),null,16,["invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"info.supportUrl",class:"cui-input-error"})]),_:1})]),_:1},8,["modelValue"])])]),_:1})]),_:1}),y(ie,{value:"interface"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",xS,he(D.$t("components.camera_options.interface")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",SS,[y(c(Dt),{"model-value":a.value.interface.streamingMode,name:"interface.streamingMode",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",CS,he(D.$t("components.form.label.streaming_mode")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.interface.streamingMode,options:c(f),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[10]||(C[10]=Y=>a.value.interface.streamingMode=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"interface.streamingMode",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.streaming_mode")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.interface.streamingSource,name:"interface.streamingSource",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",kS,he(D.$t("components.form.label.streaming_source")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.interface.streamingSource,options:c(b),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[11]||(C[11]=Y=>a.value.interface.streamingSource=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"interface.streamingSource",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.streaming_source")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.interface.aspectRatio,name:"interface.aspectRatio",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",ES,he(D.$t("components.form.label.aspect_ratio")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.interface.aspectRatio,options:c(k),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[12]||(C[12]=Y=>a.value.interface.aspectRatio=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"interface.aspectRatio",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.aspect_ratio")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(ie,{value:"detection"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",AS,he(D.$t("components.camera_options.detection")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",MS,[y(c(Dt),{"model-value":a.value.detectionSettings.motion.timeout,name:"detectionSettings.motion.timeout",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",$S,he(D.$t("components.form.label.motion_duration")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.detectionSettings.motion.timeout},F,{invalid:q.length>0,loading:c(I),"show-buttons":"","use-grouping":!1,onValueChange:C[13]||(C[13]=Y=>a.value.detectionSettings.motion.timeout=Y),onInput:C[14]||(C[14]=Y=>a.value.detectionSettings.motion.timeout=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"detectionSettings.motion.timeout",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.motion_duration")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.detectionSettings.object.confidence,name:"detectionSettings.object.confidence",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",PS,he(D.$t("components.form.label.confidence")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.detectionSettings.object.confidence},F,{invalid:q.length>0,loading:c(I),"show-buttons":"",step:.01,max:1,mode:"decimal","use-grouping":!1,onValueChange:C[15]||(C[15]=Y=>a.value.detectionSettings.object.confidence=Y),onInput:C[16]||(C[16]=Y=>a.value.detectionSettings.object.confidence=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"detectionSettings.object.confidence",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.confidence")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(ie,{value:"zones"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",TS,he(D.$t("components.camera_options.zones")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",RS,[y(J,{fluid:"",class:"cui-button-medium",loading:c(I),label:D.$t("components.form.button.edit_zones"),onClick:C[17]||(C[17]=F=>N(c(d).detectionZones))},null,8,["loading","label"])])]),_:1})]),_:1}),y(ie,{value:"snapshot"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",IS,he(D.$t("components.camera_options.snapshot")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",OS,[y(c(Dt),{"model-value":a.value.snapshotTTL,name:"snapshotTTL",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",NS,he(D.$t("components.form.label.cache_time")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.snapshotTTL},F,{invalid:q.length>0,loading:c(I),"show-buttons":"","use-grouping":!1,onValueChange:C[18]||(C[18]=Y=>a.value.snapshotTTL=Y),onInput:C[19]||(C[19]=Y=>a.value.snapshotTTL=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"snapshotTTL",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.cache_time")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1}),y(ie,{value:"frameworker"},{default:$(()=>[y(A,{class:"px-0"},{default:$(()=>[g("span",FS,he(D.$t("components.camera_options.frame_worker")),1)]),_:1}),y(j,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",LS,[y(c(Dt),{"model-value":a.value.frameWorkerSettings.decoder,name:"frameWorkerSettings.decoder",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",jS,he(D.$t("components.form.label.decoder")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.frameWorkerSettings.decoder,options:c(z),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[20]||(C[20]=Y=>a.value.frameWorkerSettings.decoder=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"frameWorkerSettings.decoder",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.frameworker_decoder")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.frameWorkerSettings.resolution,name:"frameWorkerSettings.resolution",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",qS,he(D.$t("components.form.label.resolution")),1),y(H,null,{default:$(()=>[y(R,tt(F,{"model-value":a.value.frameWorkerSettings.resolution,options:c(O),invalid:q.length>0,loading:c(I),type:"text",onValueChange:C[21]||(C[21]=Y=>a.value.frameWorkerSettings.resolution=Y)}),null,16,["model-value","options","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"frameWorkerSettings.resolution",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.frameworker_resolution")),1)]),_:1}))]),_:1},8,["model-value"]),y(c(Dt),{"model-value":a.value.frameWorkerSettings.fps,name:"frameWorkerSettings.fps",as:"div",class:"flex flex-col field-gap"},{default:$(({field:F,errors:q})=>[g("label",DS,he(D.$t("components.form.label.fps")),1),y(H,null,{default:$(()=>[y(ue,tt({"model-value":a.value.frameWorkerSettings.fps},F,{invalid:q.length>0,loading:c(I),min:0,"show-buttons":"","use-grouping":!1,onValueChange:C[22]||(C[22]=Y=>a.value.frameWorkerSettings.fps=Y),onInput:C[23]||(C[23]=Y=>a.value.frameWorkerSettings.fps=Y.value)}),null,16,["model-value","invalid","loading"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:"frameWorkerSettings.fps",class:"cui-input-error"})]),_:1}),q.length?ae("",!0):(m(),L(w,{key:0,severity:"secondary",variant:"simple",size:"small",class:"cui-input-hint"},{default:$(()=>[Gt(he(D.$t("components.form.hint.frameworker_fps")),1)]),_:1}))]),_:1},8,["model-value"])])]),_:1})]),_:1})]),_:1})}}}),zS={class:"relative"},US=Tt({__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}=Jt(t),d=Qt("buttonRef"),h=oe(!1),v=ri(d);let f;const b=se(()=>({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,O)=>{const te=ys;return m(),M("div",{ref_key:"buttonRef",ref:d,class:"relative"},[y(te,tt(c(o),{label:c(r),onClick:k}),Qh({_:2},[c(i)?{name:"icon",fn:$(()=>[g("div",zS,[(m(),L(Ai(c(i))))])]),key:"0"}:void 0]),1040,["label"]),(m(),L(Kh,{to:"body"},[y(Pt,{name:"fade"},{default:$(()=>[c(h)?(m(),L(te,tt({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"])):ae("",!0)]),_:1})]))],512)}}}),VS={viewBox:"0 0 16 16",width:"1.2em",height:"1.2em"};function HS(s,e){return m(),M("svg",VS,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 Fh=me({name:"fluent-copy-16-filled",render:HS}),QS={class:"flex flex-col field-gap"},KS={class:"cui-label"},ZS={class:"cui-label"},GS={class:"cui-label"},WS={key:0,class:"flex flex-col field-gap"},JS={class:"cui-label"},YS={key:1,class:"flex flex-col field-gap"},XS={class:"cui-label"},e7=Tt({__name:"CameraSource",props:{cameraName:{},source:{},loading:{type:Boolean}},setup(s){const e=new Jn,t=s,{cameraName:n,source:r,loading:i}=Jt(t),{data:o,isFetching:a}=e.probeCameraSourceQuery(n.value,r.value.name,{video:!0,audio:!0,microphone:!0}),{copy:l}=af({legacy:!0}),u=se(()=>!!(i.value||a.value)),d=se(()=>{var f;return((f=o.value)==null?void 0:f.probe.consumers.filter(b=>b.format_name!=="probe").length)||0}),h=se(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(O=>O.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(O=>O.codec.codec_type==="video");return(b==null?void 0:b.map(O=>O.codec.codec_name))||[]}),v=se(()=>{var k,z;const f=(k=o.value)==null?void 0:k.probe.consumers.find(O=>O.format_name==="probe"),b=(z=f==null?void 0:f.senders)==null?void 0:z.filter(O=>O.codec.codec_type==="audio");return(b==null?void 0:b.map(O=>O.codec.codec_name))||[]});return(f,b)=>{const k=ki,z=go,O=US,te=Aa;return m(),M(Ct,null,[g("div",QS,[g("label",KS,he(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),M(Ct,null,zt(c(h),(W,I)=>(m(),M("div",{key:I,class:"flex flex-col field-gap"},[g("label",ZS,he(f.$t("components.form.label.video_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":W,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),(m(!0),M(Ct,null,zt(c(v),(W,I)=>(m(),M("div",{key:I,class:"flex flex-col field-gap"},[g("label",GS,he(f.$t("components.form.label.audio_codec")),1),y(z,null,{default:$(()=>[y(k,{"model-value":W,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"])]),_:2},1024)]))),128)),c(r).role!=="snapshot"?(m(),M("div",WS,[g("label",JS,he(f.$t("components.form.label.rtsp_url")),1),y(z,null,{default:$(()=>{var W;return[y(k,{"model-value":(W=c(o))==null?void 0:W.rtspUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(te,null,{default:$(()=>{var I;return[y(O,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Fh),"button-props":{severity:"secondary",disabled:!((I=c(o))!=null&&I.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})])):ae("",!0),c(r).role!=="snapshot"?(m(),M("div",YS,[g("label",XS,he(f.$t("components.form.label.onvif_url")),1),y(z,null,{default:$(()=>{var W;return[y(k,{"model-value":(W=c(o))==null?void 0:W.onvifUrl,loading:c(u),readonly:"",type:"text"},null,8,["model-value","loading"]),y(te,null,{default:$(()=>{var I;return[y(O,{"action-text":f.$t("components.form.tooltip.copied"),icon:c(Fh),"button-props":{severity:"secondary",disabled:!((I=c(o))!=null&&I.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})])):ae("",!0)],64)}}}),t7={class:"flex gap-2 items-center w-full"},s7={class:"text-color font-normal"},n7={class:"flex flex-col gap-6"},r7=["for"],i7=["for"],o7={class:"flex items-center gap-4"},a7={class:"flex flex-col field-switch-gap"},c7=["for"],l7={class:"flex items-center gap-4"},u7={class:"flex flex-col field-switch-gap"},d7=["for"],h7={class:"flex flex-col gap-6"},m7=["for"],p7={class:"w-full flex items-center justify-center my-3"},f7=Tt({__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}=Jt(n),o=oe(["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,O=go,te=e7,W=Zc,I=Kc,E=fo,N=Aa,D=Yc,C=Wc,A=Gc,B=wp;return m(),M(Ct,null,[y(A,{multiple:"",class:"p-4"},{default:$(()=>[(m(!0),M(Ct,null,zt(t.value.sources,(H,R)=>(m(),L(C,{key:R,value:R},{default:$(()=>[y(k,{class:at({"px-0 pt-0":R===0,"px-0":R!==0})},{default:$(()=>[g("div",t7,[g("span",s7,he(h.$t("components.camera_options.source")+": "+H.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(R)},{icon:$(()=>[y(f,{width:"100%",height:"100%"})]),_:2},1032,["loading","disabled","onClick"])])]),_:2},1032,["class"]),y(D,{pt:{content:{class:"px-0"}}},{default:$(()=>[g("div",n7,[y(c(Dt),{modelValue:H.name,"onUpdate:modelValue":w=>H.name=w,modelModifiers:{trim:!0},name:`sources[${R}].name`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("label",{for:`sources[${R}].name`,class:"cui-label"},he(h.$t("components.form.label.source_name")),9,r7),y(O,null,{default:$(()=>[y(z,tt({ref_for:!0},w,{invalid:Q.length>0,loading:c(i),readonly:c(r).sources.some(J=>J.name===H.name),type:"text"}),null,16,["invalid","loading","readonly"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].name`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),H._id?(m(),L(te,{key:0,"camera-name":c(r).name,source:H,loading:c(i)},null,8,["camera-name","source","loading"])):ae("",!0),y(c(Dt),{"model-value":H.role,name:`sources[${R}].role`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("label",{for:`sources[${R}].role`,class:"cui-label"},he(h.$t("components.form.label.source_role")),9,i7),y(O,null,{default:$(()=>[y(W,tt({"model-value":H.role,ref_for:!0},w,{options:c(o).filter(J=>!t.value.sources.some(j=>j.role===J&&j._id!==H._id)),invalid:Q.length>0,loading:c(i),onValueChange:J=>H.role=J}),null,16,["model-value","options","invalid","loading","onValueChange"])]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].role`,class:"cui-input-error"},null,8,["name"])]),_:2},1024)]),_:2},1032,["model-value","name"]),H.role!=="snapshot"&&t.value.sources.length>1&&!t.value.sources.some(w=>(w.useForSnapshot||w.role==="snapshot")&&w._id!==H._id)?(m(),L(c(Dt),{key:1,"model-value":H.useForSnapshot,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${R}].useForSnapshot`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("div",o7,[g("div",a7,[g("label",{for:`sources[${R}].useForSnapshot`,class:"cui-label-switch"},he(h.$t("components.form.label.use_for_snapshot")),9,c7),y(I,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(h.$t("components.form.hint.use_for_snapshot")),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].useForSnapshot`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,tt({"model-value":H.useForSnapshot,ref_for:!0},w,{invalid:Q.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>H.useForSnapshot=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ae("",!0),H.role!=="snapshot"?(m(),L(c(Dt),{key:2,"model-value":H.hotMode,value:!0,"unchecked-value":!1,type:"checkbox",name:`sources[${R}].hotMode`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:w,errors:Q})=>[g("div",l7,[g("div",u7,[g("label",{for:`sources[${R}].hotMode`,class:"cui-label-switch"},he(h.$t("components.form.label.hot_mode")),9,d7),y(I,{severity:"secondary",variant:"simple",size:"small",class:"cui-input-switch-hint"},{default:$(()=>[Gt(he(h.$t("components.form.hint.hot_mode")),1)]),_:1}),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].hotMode`,class:"cui-input-switch-error"},null,8,["name"])]),_:2},1024)]),y(E,tt({"model-value":H.hotMode,ref_for:!0},w,{invalid:Q.length>0,loading:c(i),class:"ml-auto shrink-0",onValueChange:J=>H.hotMode=J}),null,16,["model-value","invalid","loading","onValueChange"])])]),_:2},1032,["model-value","name"])):ae("",!0),g("div",h7,[g("label",{for:`sources[${R}].urls[]`,class:"cui-label"},he(h.$t("components.form.label.sources")),9,m7),(m(!0),M(Ct,null,zt(H.urls,(w,Q)=>(m(),L(c(Dt),{key:Q,modelValue:H.urls[Q],"onUpdate:modelValue":J=>H.urls[Q]=J,modelModifiers:{trim:!0},name:`sources[${R}].urls[${Q}]`,as:"div",class:"flex flex-col field-gap"},{default:$(({field:J,errors:j})=>[y(O,null,{default:$(()=>[y(z,tt({ref_for:!0},J,{invalid:j.length>0,loading:c(i),type:"text"}),null,16,["invalid","loading"]),H.urls.length>1?(m(),L(N,{key:0},{default:$(()=>[y(b,{text:"",severity:"secondary",loading:c(i),onClick:ie=>u(R,Q)},{icon:$(()=>[y(f)]),_:2},1032,["loading","onClick"])]),_:2},1024)):ae("",!0)]),_:2},1024),y(Pt,{name:"fade"},{default:$(()=>[y(c(Bt),{name:`sources[${R}].urls[${Q}]`,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(R)},null,8,["loading","label","onClick"])])])]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1}),g("div",p7,[y(b,{text:"",rounded:"",loading:c(i),class:"cui-icon-xl",onClick:d},{icon:$(()=>[y(B,{width:"100%",height:"100%"})]),_:1},8,["loading"])])],64)}}}),g7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v7(s,e){return m(),M("svg",g7,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 _7=me({name:"mdi-lightbulb-off",render:v7}),y7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b7(s,e){return m(),M("svg",y7,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 w7=me({name:"mdi-lightbulb-on",render:b7}),x7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function S7(s,e){return m(),M("svg",x7,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 C7=me({name:"flat-color-icons-empty-battery",render:S7}),k7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function E7(s,e){return m(),M("svg",k7,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 A7=me({name:"flat-color-icons-low-battery",render:E7}),M7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function $7(s,e){return m(),M("svg",M7,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 P7=me({name:"flat-color-icons-middle-battery",render:$7}),T7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function R7(s,e){return m(),M("svg",T7,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 I7=me({name:"flat-color-icons-high-battery",render:R7}),O7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function N7(s,e){return m(),M("svg",O7,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 F7=me({name:"flat-color-icons-full-battery",render:N7}),L7={viewBox:"0 0 48 48",width:"1.2em",height:"1.2em"};function j7(s,e){return m(),M("svg",L7,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 q7=me({name:"flat-color-icons-charge-battery",render:j7}),D7={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B7(s,e){return m(),M("svg",D7,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 z7=me({name:"mdi-cloud",render:B7}),U7={key:0,class:"flex items-center justify-center h-full"},V7={key:1},H7={class:"flex flex-col p-4"},Q7={class:"camera-info flex justify-between items-center text-sm"},K7={class:"font-bold"},Z7={class:"flex items-center gap-2"},G7={class:"camera-info flex justify-between items-center text-sm"},W7={class:"font-bold"},J7={class:"flex items-center"},Y7={key:0,class:"camera-info flex justify-between items-center text-sm"},X7={class:"font-bold"},eC={class:"flex items-center gap-2"},tC={key:0},sC={key:1,class:"camera-info flex justify-between items-center text-sm"},nC={class:"font-bold"},rC={class:"flex items-center"},iC={key:2,class:"camera-info flex justify-between items-center text-sm"},oC={class:"font-bold"},aC={class:"flex items-center"},cC={key:1},lC={key:2},uC={key:3,class:"camera-info flex justify-between items-center text-sm"},dC={class:"font-bold"},hC={class:"flex items-center"},mC={key:1},pC={key:2},fC={key:4,class:"camera-info flex justify-between items-center text-sm"},gC={class:"font-bold"},vC={class:"flex items-center"},_C={key:1},yC={key:2},bC={key:5,class:"camera-info flex justify-between items-center text-sm"},wC={class:"font-bold"},xC={class:"flex items-center"},SC={key:1},CC={key:2},kC={key:6,class:"camera-info flex justify-between items-center text-sm"},EC={class:"font-bold"},AC={class:"flex items-center"},MC={key:1},$C={key:2},PC=Tt({__name:"Overview",props:{camera:{},cameraDevice:{},loading:{type:Boolean},latestSnapshotSrc:{}},emits:["close"],setup(s,{emit:e}){const t=new Fl,n=s,{cameraDevice:r,loading:i,latestSnapshotSrc:o}=Jt(n),{cameraObject:a,hasBattery:l,hasLight:u,hasAudioDetector:d,hasDoorbell:h,hasMotionDetector:v,hasObjectDetector:f,hasSiren:b,lightState:k,batteryState:z,motionState:O,objectState:te,audioState:W,doorbellState:I,sirenState:E}=jl(r),{data:N,isFetching:D}=t.getPluginsQuery({page:1,pageSize:-1}),C=se(()=>D.value||i.value);return(A,B)=>{var Y,Te,He,pt,ft,Ge,Je,de,xt,Kt,vt;const H=Lr,R=Ll,w=z7,Q=q7,J=F7,j=I7,ie=P7,ue=A7,Se=C7,F=w7,q=_7;return c(a)?(m(),M("div",V7,[y(R,{"camera-name":c(a).name,src:c(o),class:"w-full aspect-video bg-black","image-container-class":"w-full h-full"},null,8,["camera-name","src"]),g("div",H7,[g("div",Q7,[g("span",K7,he(A.$t("components.camera_options.name")),1),g("div",Z7,[g("span",null,he(c(a).name),1),c(a).isCloud?(m(),L(w,{key:0,class:"w-5 h-5"})):ae("",!0)])]),g("div",G7,[g("span",W7,he(A.$t("components.camera_options.plugin")),1),g("div",J7,[c(C)?(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"})):ae("",!0),g("span",null,he(c(a).pluginId!=="native"?((Te=(Y=c(N))==null?void 0:Y.result.find(jt=>jt.id===c(a).pluginId))==null?void 0:Te.pluginName)||A.$t("components.camera_options.unknown"):A.$t("components.camera_options.native")),1)])]),c(l)?(m(),M("div",Y7,[g("span",X7,he(A.$t("components.camera_options.battery_state")),1),g("div",eC,[c(z)!==void 0?(m(),M("span",tC,he(c(z).level)+"%",1)):ae("",!0),c(z)?c(z).charging?(m(),L(Q,{key:2,class:"w-5 h-5"})):c(z).level===100?(m(),L(J,{key:3,class:"w-5 h-5"})):c(z).level>=75?(m(),L(j,{key:4,class:"w-5 h-5"})):c(z).level>=50?(m(),L(ie,{key:5,class:"w-5 h-5"})):c(z).level>=25?(m(),L(ue,{key:6,class:"w-5 h-5"})):(m(),L(Se,{key:7,class:"w-5 h-5"})):(m(),L(H,{key:1,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(u)?(m(),M("div",sC,[g("span",nC,he(A.$t("components.camera_options.light_state")),1),g("div",rC,[c(k)?c(k).state?(m(),L(F,{key:1,class:"text-yellow-400 w-5 h-5"})):(m(),L(q,{key:2,class:"text-muted w-5 h-5"})):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(d)?(m(),M("div",iC,[g("span",oC,he(A.$t("components.camera_options.audio_state")),1),g("div",aC,[c(W)?c(W).state||(He=c(W).lastEvent)!=null&&He.state?(m(),M("span",cC,he(c(Bi)(c(W).state?c(W).timestamp:c(W).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",lC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(h)?(m(),M("div",uC,[g("span",dC,he(A.$t("components.camera_options.doorbell_state")),1),g("div",hC,[c(I)?c(I).state||(pt=c(I).lastEvent)!=null&&pt.state?(m(),M("span",mC,he(c(Bi)(c(I).state?c(I).timestamp:c(I).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",pC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(v)?(m(),M("div",fC,[g("span",gC,he(A.$t("components.camera_options.motion_state")),1),g("div",vC,[c(O)?c(O).state||(ft=c(O).detections)!=null&&ft.length||(Ge=c(O).lastEvent)!=null&&Ge.state||(de=(Je=c(O).lastEvent)==null?void 0:Je.detections)!=null&&de.length?(m(),M("span",_C,he(c(Bi)(c(O).state||(xt=c(O).detections)!=null&&xt.length?c(O).timestamp:c(O).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",yC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(f)?(m(),M("div",bC,[g("span",wC,he(A.$t("components.camera_options.object_state")),1),g("div",xC,[c(te)?c(te).detections.length||(Kt=c(te).lastEvent)!=null&&Kt.detections.length?(m(),M("span",SC,he(c(Bi)(c(te).detections.length?c(te).timestamp:c(te).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",CC,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0),c(b)?(m(),M("div",kC,[g("span",EC,he(A.$t("components.camera_options.siren_state")),1),g("div",AC,[c(E)?c(E).state||(vt=c(E).lastEvent)!=null&&vt.state?(m(),M("span",MC,he(c(Bi)(c(E).state?c(E).timestamp:c(E).lastEvent.timestamp,"DD.MM.YYYY, HH:mm:ss")),1)):(m(),M("span",$C,"-")):(m(),L(H,{key:0,"stroke-width":"5",class:"w-[30px] h-[30px]"}))])])):ae("",!0)])])):(m(),M("div",U7,[y(H,{"stroke-width":"5",class:"w-[30px] h-[30px]"})]))}}}),TC=qs(PC,[["__scopeId","data-v-50f1b706"]]),RC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IC(s,e){return m(),M("svg",RC,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 OC=me({name:"humbleicons-url",render:IC}),NC={class:"flex items-center w-full h-[45px] border-b-[1px] border-color px-3"},FC={class:"font-semibold text-lg truncate"},LC=["onClick"],jC={class:"text-xs truncate"},qC={class:"w-full h-full max-h-full overflow-y-scroll"},DC={key:0,class:"flex w-full h-full items-center justify-center mt-5"},BC={key:1,class:"w-full h-full"},zC={key:0,class:"w-full flex items-center justify-center p-4 h-[70px]"},UC=Tt({__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}=Jt(o),u=Qt("formRef"),d=Ls(),h=oe(),v=oe("overview"),f=oe([{name:"overview",icon:zc},{name:"sources",icon:OC},{name:"settings",icon:Sa},{name:"plugins",icon:Uc}]),{data:b,isFetching:k,suspense:z}=t.getCameraQuery(a),{mutate:O,isPending:te}=t.patchCameraQuery(),W=se(()=>k.value||te.value),I=se(()=>v.value==="sources"||v.value==="settings");Ze(b,N=>{N&&(h.value=xi(N))},{deep:!0,immediate:!0});const E=async()=>{var D;const N=await((D=u.value)==null?void 0:D.validate());N!=null&&N.valid&&N.values?O({cameraname:a.value,cameraData:N.values}):(n.add({severity:"error",summary:r("components.toast.title_error"),detail:r("components.toast.validation_failed"),life:3e3}),console.log("Validation failed",N))};return Sn(async()=>{if(await z(),!b.value)return;const N=await Ep();d.value=await N.deviceManager.getCamera(b.value.name)}),Ma(()=>{var N;(N=d.value)==null||N.close()}),(N,D)=>{const C=_o,A=ys,B=F0,H=N0,R=Lr,w=TC,Q=f7,J=BS,j=z3,ie=Vh,ue=Uh,Se=zh;return m(),M(Ct,null,[g("div",NC,[g("span",FC,he(c(a)),1),y(A,{text:"",rounded:"",severity:"secondary",class:"ml-auto cui-icon-md shrink-0",onClick:D[0]||(D[0]=F=>i("close"))},{icon:$(()=>[y(C,{width:"100%",height:"100%"})]),_:1})]),y(c(il),{ref_key:"formRef",ref:u,class:"w-full",style:ot({height:`calc(100% - 45px - ${c(I)?"70px":"0px"})`}),"validation-schema":c(qx)},{default:$(()=>[y(Se,{value:c(v),"onUpdate:value":D[7]||(D[7]=F=>ps(v)?v.value=F:null),scrollable:"",class:"w-full h-full"},{default:$(()=>[y(H,{class:"justify-between",pt:{tablist:{class:"h-[65px]"},activeBar:{class:"!w-auto"}}},{default:$(()=>[(m(!0),M(Ct,null,zt(c(f),(F,q)=>(m(),L(B,{key:q,value:F.name,"as-child":""},{default:$(Y=>[g("div",tt({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(),L(Ai(F.icon),{class:"w-5 h-5"})),g("span",jC,he(N.$t(`components.options_sidebar.segment_tab_${F.name}`)),1)],16,LC)]),_:2},1032,["value"]))),128))]),_:1}),y(ue,{class:"p-0 h-[calc(100%-65px)]"},{default:$(()=>[g("div",qC,[(m(!0),M(Ct,null,zt(c(f),(F,q)=>(m(),L(ie,{key:q,value:F.name,"as-child":""},{default:$(Y=>[Y.active?(m(),M("div",tt({key:0,class:Y.class,ref_for:!0},Y.a11yAttrs),[!c(h)||!c(b)||!c(d)?(m(),M("div",DC,[y(R,{"stroke-width":"5",class:"w-[30px] h-[30px]"})])):(m(),M("div",BC,[c(v)==="overview"?(m(),L(w,{key:0,camera:c(b),"camera-device":c(d),loading:c(W),"latest-snapshot-src":c(l),onClose:D[1]||(D[1]=Te=>i("close"))},null,8,["camera","camera-device","loading","latest-snapshot-src"])):ae("",!0),c(v)==="sources"?(m(),L(Q,{key:1,modelValue:c(h),"onUpdate:modelValue":D[2]||(D[2]=Te=>ps(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(W),onClose:D[3]||(D[3]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ae("",!0),c(v)==="settings"?(m(),L(J,{key:2,modelValue:c(h),"onUpdate:modelValue":D[4]||(D[4]=Te=>ps(h)?h.value=Te:null),camera:c(b),"camera-device":c(d),loading:c(W),onClose:D[5]||(D[5]=Te=>i("close"))},null,8,["modelValue","camera","camera-device","loading"])):ae("",!0),c(v)==="plugins"?(m(),L(j,{key:3,camera:c(b),"camera-device":c(d),loading:c(W),onClose:D[6]||(D[6]=Te=>i("close"))},null,8,["camera","camera-device","loading"])):ae("",!0)]))],16)):ae("",!0)]),_:2},1032,["value"]))),128))])]),_:1})]),_:1},8,["value"]),c(I)?(m(),M("div",zC,[y(A,{fluid:"",severity:"success",class:"cui-button-medium",label:N.$t("components.form.button.save"),onClick:E},null,8,["label"])])):ae("",!0)]),_:1},8,["style","validation-schema"])],64)}}}),VC={class:"w-full h-full p-safe !pb-0 md:!pl-0"},HC={class:"w-full h-full border-0 md:border-r-[1px] border-color overflow-y-auto pb-safe"},QC=Tt({__name:"CuiCameraDrawer",setup(s){const e=qr(),t=kp(),n=t.getEventBus(),r=oe(!1),i=oe(),o=oe(),a=se(()=>Cp.pt);Ze(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=UC,v=L0;return m(),L(v,tt({visible:c(r),"onUpdate:visible":d[0]||(d[0]=f=>ps(r)?r.value=f:null)},c(o),{class:"border-0 md:border-l-[1px]",pt:c(a),onHide:l}),{container:$(({closeCallback:f})=>[g("div",VC,[g("div",HC,[c(i)?(m(),L(h,tt({key:0},c(i),{onClose:f}),null,16,["onClose"])):ae("",!0)])])]),_:1},16,["visible","pt"])}}}),KC={class:"loader flex flex-col justify-center items-center"},ZC={key:0,class:"absolute flex flex-col items-center justify-center pb-safe bottom-10"},GC={key:0,class:"offline"},WC={key:1,class:"text-center text-white text-sm font-bold mt-2"},JC=Tt({__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}=Jt(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(),M("div",KC,[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(),M("div",ZC,[c(o)?(m(),M("div",GC,[(m(),L(Ai(c(o)),{class:"w-8 h-8 text-primary"}))])):ae("",!0),c(i)?(m(),M("div",WC,he(c(i)),1)):ae("",!0)])):ae("",!0)]))}}),YC=qs(JC,[["__scopeId","data-v-d2a6a09b"]]),XC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ek(s,e){return m(),M("svg",XC,e[0]||(e[0]=[g("path",{fill:"currentColor",d:"M10 3h8l-4 6h4L6 21l4-9H6z"},null,-1)]))}const tk=me({name:"gridicons-offline",render:ek}),sk={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_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"}}},nk={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_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"}}},rk={de:sk,en:nk},ik=["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"],ok=s=>{var t;const e=n=>ak(ik.find(r=>r===(n==null?void 0:n.toLowerCase())));return(t=window.navigator)!=null&&t.language?e(window.navigator.language):e("en")},ak=s=>{if(!s)return Ca;switch(s){case Mp.find(e=>e===s):return s;default:return Ca}},ck=df({locale:ok(),fallbackLocale:Ca,legacy:!1,globalInjection:!0,messages:rk}),lk={de:Mf,en:Af},uk=Mi("locale",()=>{const s=tl("locale",Ca),e=oe(Mp),t=$f(),n=js();Ze(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=lk[o];a&&(t.config.locale=a)};return r(s.value),i(s.value),{languages:e,locale:s,setI18Nlocale:r,setPrimeVueLocale:i}}),dk={key:1},hk=Tt({__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=mp(),v=Fs(),f=Pl(),{mdBreakpoint:b}=Vr(),{isPWA:k}=Ol(),{t:z}=js();uk();const{theme:O}=Vs(d),{routerLoading:te}=Vs(h),{isLoggedIn:W}=Vs(v),{isConnected:I}=Vs(f),E=Qt("navbarRef"),N=Qt("topbarRef"),D=Qt("bottombarRef"),C=oe(!0),A=oe(!0),B=Ls(),H=oe(!1),R=oe(!1),w=ri(E),Q=ri(N),J=ri(D);o.setDefaultOptions({queries:{refetchOnWindowFocus:!1,gcTime:5*60*1e3,staleTime:1e4,networkMode:"always",retry:(F,q)=>{var Y,Te,He;if(q instanceof uf&&((Y=q.response)==null?void 0:Y.status)===401)return Fs().logout(),!1;if(F===0){const pt=((He=(Te=q.response)==null?void 0:Te.data)==null?void 0:He.message)??q.message??q;u.add({severity:"error",summary:z("components.toast.title_error"),detail:pt,life:3e3}),console.error(pt)}return F<2}},mutations:{retry:0,networkMode:"always",onError:F=>{var Y,Te,He,pt;const q=((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:q,life:3e3}),console.error(((pt=(He=F.response)==null?void 0:He.data)==null?void 0:pt.message)??F.message??F)}}});const j=se(()=>{var Y,Te;let F="var(--ground-background)";const q=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)":q&&(F=q),F}),ie=se(()=>{var Y,Te;const F=N.value?`${Q.height.value}px`:"env(safe-area-inset-top, 0px)",q=D.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} - ${q})`:`calc(100dvh - ${F} - ${q})`}),ue=se(()=>{var F;return((F=a.meta.auth)==null?void 0:F.requiresAuth)&&!W.value||C.value});Ze(A,(F,q)=>{q===!1&&F===!0&&o.refetchQueries()}),Ze(W,F=>{F?B.value=f.connect():(B.value=void 0,f.disconnect())},{immediate:!0}),Ze(I,F=>{W.value?A.value=F:A.value=!0}),Ze(te,F=>{const{isLoading:q}=cf(0,{parent:"body"});q.value=F},{immediate:!0}),Ze([j,O],()=>{Zs(()=>{var q,Y;if(/^var\([^)]+\)$/.test(j.value)){const Te=window.getComputedStyle(document.body),He=j.value.split("var(")[1].split(")")[0],pt=Te.getPropertyValue(He);(q=document.querySelector('meta[name="theme-color"]'))==null||q.setAttribute("content",pt)}else(Y=document.querySelector('meta[name="theme-color"]'))==null||Y.setAttribute("content",j.value)})},{immediate:!0}),Ze(a,F=>{var q,Y;Xs((Y=(q=F.meta.ui)==null?void 0:q.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"]'),q=F!==null&&F.getAttribute("content")==="true";H.value=window.electron!==void 0,R.value=q,setTimeout(()=>{H.value=window.electron!==void 0,R.value=q},100)};return Sn(async()=>{await l.isReady(),C.value=!1,Se()}),(F,q)=>{var vt,jt,ct,gt,De,ht,U,X,fe,ye,pe;const Y=YC,Te=j0,He=q0,pt=D0,ft=QC,Ge=X5,Je=jb,de=Ob,xt=Ei("RouterView"),Kt=e1;return c(ue)||!c(A)?(m(),M("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(A)&&c(W)?c(tk):void 0},null,8,["icon"])],4)):(m(),M("div",dk,[y(Te,{position:"bottom-right"}),y(He),y(pt),y(ft),c(i)?(m(),L(Ge,{key:0,ref_key:"topbarRef",ref:N,style:ot({left:c(b)?"0px":`${c(w).width.value}px`}),class:"z-2 top-0"},null,8,["style"])):ae("",!0),c(n)?(m(),L(Je,{key:1,ref_key:"bottombarRef",ref:D,class:"z-2"},null,512)):ae("",!0),c(r)?(m(),L(de,{key:2,ref_key:"navbarRef",ref:E,class:"z-3 top-0 left-0"},null,512)):ae("",!0),g("main",{id:"container",class:"relative w-dvw z-1",style:ot({paddingTop:c(N)?`${c(Q).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(D)?`${c(J).height.value}px`:("toValue"in F?F.toValue:c(Xs))((jt=(vt=F.$route.meta.ui)==null?void 0:vt.containerSettings)==null?void 0:jt.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))((gt=(ct=F.$route.meta.ui)==null?void 0:ct.containerSettings)==null?void 0:gt.padding)}]),style:ot({minHeight:c(ie),maxHeight:("toValue"in F?F.toValue:c(Xs))((ht=(De=F.$route.meta.ui)==null?void 0:De.containerSettings)==null?void 0:ht.disableScroll)?c(ie):void 0,height:("toValue"in F?F.toValue:c(Xs))((X=(U=F.$route.meta.ui)==null?void 0:U.containerSettings)==null?void 0:X.disableScroll)?c(ie):void 0,overflow:("toValue"in F?F.toValue:c(Xs))((ye=(fe=F.$route.meta.ui)==null?void 0:fe.containerSettings)==null?void 0:ye.disableScroll)?"hidden":void 0})},[y(xt,{class:"w-full h-full relative overflow-x-hidden"})],6)],4),c(H)?(m(),L(Kt,{key:3})):ae("",!0),c(e)==="opened"||c(t)==="opened"&&c(b)?(m(),L(Kh,{key:4,to:c(e)==="opened"?"#app":"#container",defer:""},[c(b)?(m(),M("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)):ae("",!0)],8,["to"])):ae("",!0),g("div",{class:"fixed-bg",style:ot({background:("toValue"in F?F.toValue:c(Xs))((pe=F.$route.meta.ui)==null?void 0:pe.background)})},null,4)]))}}}),mk=qs(hk,[["__scopeId","data-v-6277ff0b"]]),pk=hf(),fk=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}"}}}}}}),gk=()=>{const s=Z0(mk);return s.directive("tooltip",jr),s.use(La).use(pk).use(ck).use(B0).use(z0).use(U0).use(Pf,{theme:{preset:fk,options:{cssLayer:{name:"primevue",order:"theme, base, primevue"},darkModeSelector:".dark-mode"}}}).use($0),s},vk=gk();vk.mount("#app");export{Bi as $,w4 as A,Nb as B,Jn as C,gp as D,m9 as E,fp as F,X6 as G,s8 as H,K8 as I,B8 as J,V8 as K,sx as L,p8 as M,X8 as N,px as O,dx as P,cx as Q,ix as R,Sa as S,W5 as T,T_ as U,B4 as V,A4 as W,C4 as X,_4 as Y,a9 as Z,Fa as _,Il as a,c9 as a0,Nl as a1,vs as a2,Oe as a3,Fl as a4,g2 as a5,w6 as a6,mh as a7,dh as a8,lh as a9,ph as aa,hh as ab,gh as ac,xp as ad,Ep as ae,Zm as af,A3 as ag,u9 as ah,md as ai,Uc as aj,$2 as ak,i9 as al,Rl as am,uo as an,h9 as ao,Gm as ap,o9 as aq,uk as ar,p9 as as,d9 as at,l9 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,v9 as k,g9 as l,l3 as m,wp as n,f9 as o,kp as p,Tl as q,I_ as r,R_ as s,ja as t,Fs as u,Eh as v,Ll as w,kl as x,Ap as y,qs as z};
|