@camera.ui/server 0.0.13-alpha.7 → 0.0.13-alpha.9

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.
Files changed (76) hide show
  1. package/dist/interface/assets/{@intlify-Ck2ZoCVz.js → @intlify-YW_pt133.js} +4 -4
  2. package/dist/interface/assets/{@mdi-DdmeckA1.js → @mdi-jq8isxax.js} +1 -1
  3. package/dist/interface/assets/@vueuse-DbPVvJxZ.js +1 -0
  4. package/dist/interface/assets/{Account-DmYo08Qh.js → Account-BfQIYSY9.js} +1 -1
  5. package/dist/interface/assets/{Adminpanel-BJMS2lPd.js → Adminpanel-D-IRPo9j.js} +1 -1
  6. package/dist/interface/assets/{Appearance-DKeJKTST.js → Appearance-B6KmagNC.js} +1 -1
  7. package/dist/interface/assets/{Backup-Cxzbjmat.js → Backup-DAQ5i5CX.js} +1 -1
  8. package/dist/interface/assets/{Camera-CdiCoPuE.js → Camera-Bi6_ARja.js} +1 -1
  9. package/dist/interface/assets/{Cameras-CAdTRgyD.js → Cameras-Bnyqxi_V.js} +1 -1
  10. package/dist/interface/assets/{Camview-DQh45zxY.js → Camview-ChqbnO3e.js} +1 -1
  11. package/dist/interface/assets/{Config-BNDa6thC.js → Config-BjrMRwfT.js} +1 -1
  12. package/dist/interface/assets/Console-DWrfRWs9.css +1 -0
  13. package/dist/interface/assets/{Console-DaeLrWgn.js → Console-DvDVSn1k.js} +2 -2
  14. package/dist/interface/assets/{FirstSteps-a9MQcU4I.js → FirstSteps-Dxd9rz8L.js} +1 -1
  15. package/dist/interface/assets/{NewCamera-CQcflfB9.js → NewCamera-Cok5A6i_.js} +18 -18
  16. package/dist/interface/assets/NewCamera-DJ3tUBT_.css +1 -0
  17. package/dist/interface/assets/{Plugin-CuzMGJle.js → Plugin-BDQynqPw.js} +1 -1
  18. package/dist/interface/assets/{Plugins-Vbigmnnl.js → Plugins-BmMHP2A8.js} +1 -1
  19. package/dist/interface/assets/{Recordings-Cj7DTXms.js → Recordings-DXXeJXrx.js} +1 -1
  20. package/dist/interface/assets/{Recordings-OwkmcBiG.js → Recordings-ZTql-w8N.js} +1 -1
  21. package/dist/interface/assets/{Settings-DtuxhxkK.js → Settings-B9yGAOhD.js} +1 -1
  22. package/dist/interface/assets/System-1z5qZSaJ.js +4 -0
  23. package/dist/interface/assets/{User-DtIcGUsp.js → User-8xO4LUlf.js} +1 -1
  24. package/dist/interface/assets/{VConfigEditor.vue_vue_type_script_setup_true_lang-NvLEB-vb.js → VConfigEditor.vue_vue_type_script_setup_true_lang-DDxLGgGL.js} +1 -1
  25. package/dist/interface/assets/{VConsole-CZymGHU4.js → VConsole-D85lNxwk.js} +1 -1
  26. package/dist/interface/assets/VPlayer-B53-f3Ad.js +1 -0
  27. package/dist/interface/assets/{VPlayer-4vWU8KqJ.css → VPlayer-H4sGdlHU.css} +1 -1
  28. package/dist/interface/assets/VPluginCard--4QV9IM6.css +1 -0
  29. package/dist/interface/assets/VPluginCard-Cl6Zw1Dg.js +4 -0
  30. package/dist/interface/assets/main-C2N2tbw_.js +9 -0
  31. package/dist/interface/assets/main-CKofdZVi.css +1 -0
  32. package/dist/interface/assets/{plugins-X26db0mJ.js → plugins-Cs7BJHj-.js} +1 -1
  33. package/dist/interface/assets/rxjs-DmqiRszP.js +3 -0
  34. package/dist/interface/assets/{system-CjiOVZ9H.js → system-C1OmXhti.js} +1 -1
  35. package/dist/interface/assets/{ui-DNIEL7pW.js → ui-CdiPlYMM.js} +1 -1
  36. package/dist/interface/assets/{vue-i18n-Cyk5bTcs.js → vue-i18n-CHUfunSC.js} +3 -3
  37. package/dist/interface/index.html +7 -7
  38. package/dist/interface/sw.js +1 -1
  39. package/dist/server/package.json +4 -4
  40. package/dist/server/src/api/controllers/plugins.controller.d.ts +1 -0
  41. package/dist/server/src/api/controllers/plugins.controller.js +6 -0
  42. package/dist/server/src/api/controllers/plugins.controller.js.map +1 -1
  43. package/dist/server/src/api/schemas/cameras.schema.d.ts +5 -4
  44. package/dist/server/src/api/schemas/cameras.schema.js +44 -2
  45. package/dist/server/src/api/schemas/cameras.schema.js.map +1 -1
  46. package/dist/server/src/api/websocket/index.js +5 -5
  47. package/dist/server/src/api/websocket/index.js.map +1 -1
  48. package/dist/server/src/api/websocket/nsp/main.d.ts +7 -0
  49. package/dist/server/src/api/websocket/nsp/main.js +8 -0
  50. package/dist/server/src/api/websocket/nsp/main.js.map +1 -0
  51. package/dist/server/src/api/websocket/nsp/notifications.d.ts +5 -4
  52. package/dist/server/src/api/websocket/nsp/notifications.js +7 -12
  53. package/dist/server/src/api/websocket/nsp/notifications.js.map +1 -1
  54. package/dist/server/src/api/websocket/nsp/server.d.ts +14 -2
  55. package/dist/server/src/api/websocket/nsp/server.js +100 -6
  56. package/dist/server/src/api/websocket/nsp/server.js.map +1 -1
  57. package/dist/server/src/api/websocket/types.d.ts +1 -1
  58. package/dist/server/src/camera/streaming/peer-connection.js +1 -0
  59. package/dist/server/src/camera/streaming/peer-connection.js.map +1 -1
  60. package/dist/server/src/services/logger/index.d.ts +2 -3
  61. package/dist/server/src/services/logger/index.js +23 -73
  62. package/dist/server/src/services/logger/index.js.map +1 -1
  63. package/package.json +4 -4
  64. package/dist/interface/assets/@vueuse-GPEsefjJ.js +0 -1
  65. package/dist/interface/assets/Console-DJq4Hm5A.css +0 -1
  66. package/dist/interface/assets/NewCamera-C7naTyF1.css +0 -1
  67. package/dist/interface/assets/System-DA2Qigu6.js +0 -4
  68. package/dist/interface/assets/VPlayer-D_SuxyEf.js +0 -1
  69. package/dist/interface/assets/VPluginCard-B7FNMmgt.css +0 -1
  70. package/dist/interface/assets/VPluginCard-BVeId9fp.js +0 -4
  71. package/dist/interface/assets/main-BvNHUtMy.css +0 -1
  72. package/dist/interface/assets/main-f-Qd4R5M.js +0 -9
  73. package/dist/interface/assets/rxjs-CQrF441D.js +0 -3
  74. package/dist/server/src/api/websocket/nsp/frameWorker.d.ts +0 -13
  75. package/dist/server/src/api/websocket/nsp/frameWorker.js +0 -29
  76. package/dist/server/src/api/websocket/nsp/frameWorker.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{C as we,c as ve,_ as _e}from"./VPlayer-D_SuxyEf.js";import{f as ye,w as xe,d as ke}from"./main-f-Qd4R5M.js";import{F as Se,r as w,D as Te,c as Pe,w as Re,e as h,f as k,M as a,R as n,u as t,i as O,n as W,j as l,T as m,V as d,m as G,N as D,Q as B,O as A,q as _,l as Ie,X as Ae}from"./@vue-CIFymae3.js";import{H as P,t as Ce,y as He,j as Ve,p as je}from"./highlight.js-fBaokXp-.js";import{e as z,s as Ee,E as Oe,F as Ge,X as Me,Y as Ue,Z as Fe}from"./@mdi-DdmeckA1.js";import{j as $e}from"./@vueuse-GPEsefjJ.js";import{M as Le}from"./markdown-it-DI8MEbma.js";import{F as C,a as We}from"./vee-validate-DHjm38DY.js";import{s as De}from"./utils-BvINh1mj.js";import{a as Be}from"./vue-router-C55prZ5l.js";import{b as S,e as y,K as N,L as Y,M as K,N as q,c as J,y as X,m as ze,O as Ne,V as Q}from"./vuetify-B_vGZaGi.js";import"./qrcode-SHonoxyK.js";import"./dijkstrajs-D_NXgYpA.js";import"./zod-BaF2dDCd.js";import"./pinia-B_gX_pHL.js";import"./@vee-validate-CmTVjJBY.js";import"./vue3-toastify-Cy6dUyKO.js";import"./plugins-X26db0mJ.js";import"./@tanstack-DPd4-F0t.js";import"./draggabilly-YEGzHR3_.js";import"./@xterm-LO7TPXYg.js";import"./get-size-D1dS-IaP.js";import"./unidragger-91TYirAP.js";import"./ev-emitter-t78oQA8k.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue-i18n-Cyk5bTcs.js";import"./@intlify-Ck2ZoCVz.js";import"./axios-BI2i94Vb.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-CQrF441D.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./mdurl-k9Sl0PQj.js";import"./uc.micro-kMc2yuuw.js";import"./entities-C20TfXL6.js";import"./linkify-it-DmNjr4Kv.js";import"./punycode.js-Dj65hjkv.js";const Ye=["bubble://","dvrip://","echo:","exec:","expr:","ffmpeg:","gopro://","hass:","homekit://","http://","https://","httpx://","isapi://","ivideon:","kasa://","nest:","onvif://","roborock://","rtmp://","rtsp://","rtspx://","tapo://","tcp://","webrtc:","webtorrent:"],Ke=["#backchannel=0","#header=","#media=audio","#media=video","#timeout=10","#timeout=20","#timeout=30","#transport="],Z=["#audio=aac","#audio=aac/16000","#audio=mp3","#audio=opus","#audio=pcm","#audio=pcm/8000","#audio=pcm/16000","#audio=pcm/48000","#audio=pcma","#audio=pcma/8000","#audio=pcma/16000","#audio=pcma/48000","#audio=pcml","#audio=pcml/8000","#audio=pcml/44100","#audio=pcmu","#audio=pcmu/8000","#audio=pcmu/16000","#audio=pcmu/48000","#drawtext","#hardware","#hardware=cuda","#hardware=dxva2","#hardware=rkmpp","#hardware=v4l2m2m","#hardware=vaapi","#hardware=videotoolbox","#height=","#raw=","#rotate=-90","#rotate=90","#rotate=180","#rotate=270","#video=copy","#video=h264","#video=h265","#video=mjpeg","#width="],qe=["client_id=","client_private=","device_id=","device_public="],Je=["#header="],Xe=["client_id=","client_secret=","refresh_token=","project_id=","device_id="],Qe=["#client_id=","#format=openipc","#format=wyze","#format=kinesis","#ice_servers="],Ze="#### Source: Bubble\n\nOther names: [ESeeCloud](http://www.eseecloud.com/), [dvr163](http://help.dvr163.com/).\n\n- you can skip `username`, `password`, `port`, `ch` and `stream` if they are default\n- setup separate streams for different channels and streams\n\n```yaml\nstreams:\n camera1: bubble://username:password@192.168.1.123:34567/bubble/live?ch=0&stream=0\n```\n\n_Source: [Go2Rtc Bubble](https://github.com/AlexxIT/go2rtc#source-bubble)_\n",et="#### Source: DVRIP\n\nOther names: DVR-IP, NetSurveillance, Sofia protocol (NETsurveillance ActiveX plugin XMeye SDK).\n\n- you can skip `username`, `password`, `port`, `channel` and `subtype` if they are default\n- setup separate streams for different channels\n- use `subtype=0` for Main stream, and `subtype=1` for Extra1 stream\n- only the TCP protocol is supported\n\n```yaml\nstreams:\n only_stream: dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0\n only_tts: dvrip://username:password@192.168.1.123:34567?backchannel=1\n two_way_audio:\n - dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0\n - dvrip://username:password@192.168.1.123:34567?backchannel=1\n```\n\n_Source: [Go2Rtc DVRIP](https://github.com/AlexxIT/go2rtc#source-dvrip)_\n",tt=`#### Source: Echo
1
+ import{C as xe,c as ke,_ as Se}from"./VPlayer-B53-f3Ad.js";import{f as Te,w as Pe,d as Re}from"./main-C2N2tbw_.js";import{F as Ae,r as v,D as Ie,c as Ce,w as Ve,e as d,f as k,M as n,R as a,u as e,i as G,n as Y,j as u,T as l,V as h,m as V,N as K,Q as q,O as P,q as _,l as M,X as He}from"./@vue-CIFymae3.js";import{H as A,t as je,y as Ee,j as Oe,p as Ge}from"./highlight.js-fBaokXp-.js";import{e as J,s as Me,E as Ue,F as $e,X,Y as Le,Z as We}from"./@mdi-jq8isxax.js";import{j as De}from"./@vueuse-DbPVvJxZ.js";import{M as Be}from"./markdown-it-DI8MEbma.js";import{F as I,a as Fe}from"./vee-validate-DHjm38DY.js";import{s as ze}from"./utils-BvINh1mj.js";import{a as Ne}from"./vue-router-C55prZ5l.js";import{b as S,e as x,K as Q,L as Z,M as ee,N as te,c as oe,y as L,m as Ye,O as Ke,V as ae}from"./vuetify-B_vGZaGi.js";import"./qrcode-SHonoxyK.js";import"./dijkstrajs-D_NXgYpA.js";import"./zod-BaF2dDCd.js";import"./pinia-B_gX_pHL.js";import"./@vee-validate-CmTVjJBY.js";import"./vue3-toastify-Cy6dUyKO.js";import"./plugins-Cs7BJHj-.js";import"./@tanstack-DPd4-F0t.js";import"./draggabilly-YEGzHR3_.js";import"./@xterm-LO7TPXYg.js";import"./get-size-D1dS-IaP.js";import"./unidragger-91TYirAP.js";import"./ev-emitter-t78oQA8k.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./mdurl-k9Sl0PQj.js";import"./uc.micro-kMc2yuuw.js";import"./entities-C20TfXL6.js";import"./linkify-it-DmNjr4Kv.js";import"./punycode.js-Dj65hjkv.js";const ne=["bubble://","dvrip://","echo:","exec:","expr:","ffmpeg:","gopro://","hass:","homekit://","http://","https://","httpx://","isapi://","ivideon:","kasa://","nest:","onvif://","roborock://","rtmp://","rtsp://","rtspx://","tapo://","tcp://","webrtc:","webtorrent:"],qe=["#backchannel=0","#header=","#media=audio","#media=video","#timeout=10","#timeout=20","#timeout=30","#transport="],se=["#audio=aac","#audio=aac/16000","#audio=mp3","#audio=opus","#audio=pcm","#audio=pcm/8000","#audio=pcm/16000","#audio=pcm/48000","#audio=pcma","#audio=pcma/8000","#audio=pcma/16000","#audio=pcma/48000","#audio=pcml","#audio=pcml/8000","#audio=pcml/44100","#audio=pcmu","#audio=pcmu/8000","#audio=pcmu/16000","#audio=pcmu/48000","#drawtext","#hardware","#hardware=cuda","#hardware=dxva2","#hardware=rkmpp","#hardware=v4l2m2m","#hardware=vaapi","#hardware=videotoolbox","#height=","#raw=","#rotate=-90","#rotate=90","#rotate=180","#rotate=270","#video=copy","#video=h264","#video=h265","#video=mjpeg","#width="],Je=["client_id=","client_private=","device_id=","device_public="],Xe=["#header="],Qe=["client_id=","client_secret=","refresh_token=","project_id=","device_id="],Ze=["#client_id=","#format=openipc","#format=wyze","#format=kinesis","#ice_servers="],et="#### Source: Bubble\n\nOther names: [ESeeCloud](http://www.eseecloud.com/), [dvr163](http://help.dvr163.com/).\n\n- you can skip `username`, `password`, `port`, `ch` and `stream` if they are default\n- setup separate streams for different channels and streams\n\n```yaml\nstreams:\n camera1: bubble://username:password@192.168.1.123:34567/bubble/live?ch=0&stream=0\n```\n\n_Source: [Go2Rtc Bubble](https://github.com/AlexxIT/go2rtc#source-bubble)_\n",tt="#### Source: DVRIP\n\nOther names: DVR-IP, NetSurveillance, Sofia protocol (NETsurveillance ActiveX plugin XMeye SDK).\n\n- you can skip `username`, `password`, `port`, `channel` and `subtype` if they are default\n- setup separate streams for different channels\n- use `subtype=0` for Main stream, and `subtype=1` for Extra1 stream\n- only the TCP protocol is supported\n\n```yaml\nstreams:\n only_stream: dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0\n only_tts: dvrip://username:password@192.168.1.123:34567?backchannel=1\n two_way_audio:\n - dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0\n - dvrip://username:password@192.168.1.123:34567?backchannel=1\n```\n\n_Source: [Go2Rtc DVRIP](https://github.com/AlexxIT/go2rtc#source-dvrip)_\n",ot=`#### Source: Echo
2
2
 
3
3
  Some sources may have a dynamic link. And you will need to get it using a bash or python script. Your script should echo a link to the source. RTSP, FFmpeg or any of the [supported sources](https://github.com/AlexxIT/go2rtc#module-streams).
4
4
 
@@ -11,7 +11,7 @@ streams:
11
11
  \`\`\`
12
12
 
13
13
  _Source: [Go2Rtc Echo](https://github.com/AlexxIT/go2rtc#source-echo)_
14
- `,ot=`#### Source: Exec
14
+ `,at=`#### Source: Exec
15
15
 
16
16
  Exec source can run any external application and expect data from it. Two transports are supported - **pipe** and **RTSP**.
17
17
 
@@ -34,7 +34,7 @@ streams:
34
34
  \`\`\`
35
35
 
36
36
  _Source: [Go2Rtc Exec](https://github.com/AlexxIT/go2rtc#source-exec)_
37
- `,at=`#### Source: Expr
37
+ `,nt=`#### Source: Expr
38
38
 
39
39
  [Expr](https://github.com/antonmedv/expr) - expression language and expression evaluation for Go.
40
40
 
@@ -125,7 +125,7 @@ streams:
125
125
  | r.json() | r.json() | await r.json() |
126
126
  | r.headers | r.headers | r.headers |
127
127
  | let m = match(text, "abc") | m = re.search("abc", text) | let m = text.match(/abc/) |
128
- `,nt="#### Source: FFmpeg\n\nYou can get any stream or file or device via FFmpeg and push it to go2rtc. The app will automatically start FFmpeg with the proper arguments when someone starts watching the stream.\n\n- FFmpeg preistalled for **Docker** and **Hass Add-on** users\n- **Hass Add-on** users can target files from [/media](https://www.home-assistant.io/more-info/local-media/setup-media/) folder\n\nFormat: `ffmpeg:{input}#{param1}#{param2}#{param3}`. Examples:\n\n```yaml\nstreams:\n # [FILE] all tracks will be copied without transcoding codecs\n file1: ffmpeg:/media/BigBuckBunny.mp4\n\n # [FILE] video will be transcoded to H264, audio will be skipped\n file2: ffmpeg:/media/BigBuckBunny.mp4#video=h264\n\n # [FILE] video will be copied, audio will be transcoded to pcmu\n file3: ffmpeg:/media/BigBuckBunny.mp4#video=copy#audio=pcmu\n\n # [HLS] video will be copied, audio will be skipped\n hls: ffmpeg:https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/gear5/prog_index.m3u8#video=copy\n\n # [MJPEG] video will be transcoded to H264\n mjpeg: ffmpeg:http://185.97.122.128/cgi-bin/faststream.jpg#video=h264\n\n # [RTSP] video with rotation, should be transcoded, so select H264\n rotate: ffmpeg:rtsp://rtsp:12345678@192.168.1.123/av_stream/ch0#video=h264#rotate=90\n```\n\nAll trascoding formats has [built-in templates](https://github.com/AlexxIT/go2rtc/blob/master/internal/ffmpeg/ffmpeg.go): `h264`, `h265`, `opus`, `pcmu`, `pcmu/16000`, `pcmu/48000`, `pcma`, `pcma/16000`, `pcma/48000`, `aac`, `aac/16000`.\n\nBut you can override them via YAML config. You can also add your own formats to config and use them with source params.\n\n```yaml\nffmpeg:\n bin: ffmpeg # path to ffmpeg binary\n h264: '-codec:v libx264 -g:v 30 -preset:v superfast -tune:v zerolatency -profile:v main -level:v 4.1'\n mycodec: '-any args that supported by ffmpeg...'\n myinput: '-fflags nobuffer -flags low_delay -timeout 5000000 -i {input}'\n myraw: '-ss 00:00:20'\n```\n\n- You can use go2rtc stream name as ffmpeg input (ex. `ffmpeg:camera1#video=h264`)\n- You can use `video` and `audio` params multiple times (ex. `#video=copy#audio=copy#audio=pcmu`)\n- You can use `rotate` param with `90`, `180`, `270` or `-90` values, important with transcoding (ex. `#video=h264#rotate=90`)\n- You can use `width` and/or `height` params, important with transcoding (ex. `#video=h264#width=1280`)\n- You can use `drawtext` to add a timestamp (ex. `drawtext=x=2:y=2:fontsize=12:fontcolor=white:box=1:boxcolor=black`)\n - This will greatly increase the CPU of the server, even with hardware acceleration\n- You can use `raw` param for any additional FFmpeg arguments (ex. `#raw=-vf transpose=1`)\n- You can use `input` param to override default input template (ex. `#input=rtsp/udp` will change RTSP transport from TCP to UDP+TCP)\n - You can use raw input value (ex. `#input=-timeout 5000000 -i {input}`)\n - You can add your own input templates\n\nRead more about [hardware acceleration](https://github.com/AlexxIT/go2rtc/wiki/Hardware-acceleration).\n\n**PS.** It is recommended to check the available hardware in the WebUI add page.\n\n<hr>\n\n#### Source: FFmpeg Device\n\nYou can get video from any USB-camera or Webcam as RTSP or WebRTC stream. This is part of FFmpeg integration.\n\n- check available devices in Web interface\n- `video_size` and `framerate` must be supported by your camera!\n- for Linux supported only video for now\n- for macOS you can stream Facetime camera or whole Desktop!\n- for macOS important to set right framerate\n\nFormat: `ffmpeg:device?{input-params}#{param1}#{param2}#{param3}`\n\n```yaml\nstreams:\n linux_usbcam: ffmpeg:device?video=0&video_size=1280x720#video=h264\n windows_webcam: ffmpeg:device?video=0#video=h264\n macos_facetime: ffmpeg:device?video=0&audio=1&video_size=1280x720&framerate=30#video=h264#audio=pcma\n```\n\n**PS.** It is recommended to check the available devices in the WebUI add page.\n\n_Source: [Go2Rtc FFmpeg](https://github.com/AlexxIT/go2rtc#source-ffmpeg) & [Go2Rtc FFmpeg Device](https://github.com/AlexxIT/go2rtc#source-ffmpeg-device)_\n",st=`#### Source: GoPro
128
+ `,st="#### Source: FFmpeg\n\nYou can get any stream or file or device via FFmpeg and push it to go2rtc. The app will automatically start FFmpeg with the proper arguments when someone starts watching the stream.\n\n- FFmpeg preistalled for **Docker** and **Hass Add-on** users\n- **Hass Add-on** users can target files from [/media](https://www.home-assistant.io/more-info/local-media/setup-media/) folder\n\nFormat: `ffmpeg:{input}#{param1}#{param2}#{param3}`. Examples:\n\n```yaml\nstreams:\n # [FILE] all tracks will be copied without transcoding codecs\n file1: ffmpeg:/media/BigBuckBunny.mp4\n\n # [FILE] video will be transcoded to H264, audio will be skipped\n file2: ffmpeg:/media/BigBuckBunny.mp4#video=h264\n\n # [FILE] video will be copied, audio will be transcoded to pcmu\n file3: ffmpeg:/media/BigBuckBunny.mp4#video=copy#audio=pcmu\n\n # [HLS] video will be copied, audio will be skipped\n hls: ffmpeg:https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_16x9/gear5/prog_index.m3u8#video=copy\n\n # [MJPEG] video will be transcoded to H264\n mjpeg: ffmpeg:http://185.97.122.128/cgi-bin/faststream.jpg#video=h264\n\n # [RTSP] video with rotation, should be transcoded, so select H264\n rotate: ffmpeg:rtsp://rtsp:12345678@192.168.1.123/av_stream/ch0#video=h264#rotate=90\n```\n\nAll trascoding formats has [built-in templates](https://github.com/AlexxIT/go2rtc/blob/master/internal/ffmpeg/ffmpeg.go): `h264`, `h265`, `opus`, `pcmu`, `pcmu/16000`, `pcmu/48000`, `pcma`, `pcma/16000`, `pcma/48000`, `aac`, `aac/16000`.\n\nBut you can override them via YAML config. You can also add your own formats to config and use them with source params.\n\n```yaml\nffmpeg:\n bin: ffmpeg # path to ffmpeg binary\n h264: '-codec:v libx264 -g:v 30 -preset:v superfast -tune:v zerolatency -profile:v main -level:v 4.1'\n mycodec: '-any args that supported by ffmpeg...'\n myinput: '-fflags nobuffer -flags low_delay -timeout 5000000 -i {input}'\n myraw: '-ss 00:00:20'\n```\n\n- You can use go2rtc stream name as ffmpeg input (ex. `ffmpeg:camera1#video=h264`)\n- You can use `video` and `audio` params multiple times (ex. `#video=copy#audio=copy#audio=pcmu`)\n- You can use `rotate` param with `90`, `180`, `270` or `-90` values, important with transcoding (ex. `#video=h264#rotate=90`)\n- You can use `width` and/or `height` params, important with transcoding (ex. `#video=h264#width=1280`)\n- You can use `drawtext` to add a timestamp (ex. `drawtext=x=2:y=2:fontsize=12:fontcolor=white:box=1:boxcolor=black`)\n - This will greatly increase the CPU of the server, even with hardware acceleration\n- You can use `raw` param for any additional FFmpeg arguments (ex. `#raw=-vf transpose=1`)\n- You can use `input` param to override default input template (ex. `#input=rtsp/udp` will change RTSP transport from TCP to UDP+TCP)\n - You can use raw input value (ex. `#input=-timeout 5000000 -i {input}`)\n - You can add your own input templates\n\nRead more about [hardware acceleration](https://github.com/AlexxIT/go2rtc/wiki/Hardware-acceleration).\n\n**PS.** It is recommended to check the available hardware in the WebUI add page.\n\n<hr>\n\n#### Source: FFmpeg Device\n\nYou can get video from any USB-camera or Webcam as RTSP or WebRTC stream. This is part of FFmpeg integration.\n\n- check available devices in Web interface\n- `video_size` and `framerate` must be supported by your camera!\n- for Linux supported only video for now\n- for macOS you can stream Facetime camera or whole Desktop!\n- for macOS important to set right framerate\n\nFormat: `ffmpeg:device?{input-params}#{param1}#{param2}#{param3}`\n\n```yaml\nstreams:\n linux_usbcam: ffmpeg:device?video=0&video_size=1280x720#video=h264\n windows_webcam: ffmpeg:device?video=0#video=h264\n macos_facetime: ffmpeg:device?video=0&audio=1&video_size=1280x720&framerate=30#video=h264#audio=pcma\n```\n\n**PS.** It is recommended to check the available devices in the WebUI add page.\n\n_Source: [Go2Rtc FFmpeg](https://github.com/AlexxIT/go2rtc#source-ffmpeg) & [Go2Rtc FFmpeg Device](https://github.com/AlexxIT/go2rtc#source-ffmpeg-device)_\n",rt=`#### Source: GoPro
129
129
 
130
130
  Supported models: HERO9, HERO10, HERO11, HERO12.
131
131
  Supported OS: Linux, Mac, Windows, [HassOS](https://www.home-assistant.io/installation/)
@@ -152,7 +152,7 @@ streams:
152
152
  - https://gopro.github.io/OpenGoPro/
153
153
 
154
154
  _Source: [Go2Rtc Hass](https://github.com/AlexxIT/go2rtc#source-hass)_
155
- `,rt=`#### Source: Hass
155
+ `,it=`#### Source: Hass
156
156
 
157
157
  Support import camera links from [Home Assistant](https://www.home-assistant.io/) config files:
158
158
 
@@ -189,7 +189,7 @@ streams:
189
189
  By default, the Home Assistant API does not allow you to get dynamic RTSP link to a camera stream. So more cameras, like [Tuya](https://www.home-assistant.io/integrations/tuya/), and possibly others can also be imported by using [this method](https://github.com/felipecrs/hass-expose-camera-stream-source#importing-home-assistant-cameras-to-go2rtc-andor-frigate).
190
190
 
191
191
  _Source: [Go2Rtc Hass](https://github.com/AlexxIT/go2rtc#source-hass)_
192
- `,it=`#### Source: HomeKit
192
+ `,ct=`#### Source: HomeKit
193
193
 
194
194
  **Important:**
195
195
 
@@ -223,7 +223,7 @@ RTSP link with "normal" audio for any player: \`rtsp://192.168.1.123:8554/aqara_
223
223
  **This source is in active development!** Tested only with [Aqara Camera Hub G3](https://www.aqara.com/eu/product/camera-hub-g3) (both EU and CN versions).
224
224
 
225
225
  _Source: [Go2Rtc HomeKit](https://github.com/AlexxIT/go2rtc#source-homekit)_
226
- `,ct=`#### Source: HTTP
226
+ `,lt=`#### Source: HTTP
227
227
 
228
228
  Support Content-Type:
229
229
 
@@ -267,7 +267,7 @@ streams:
267
267
  \`\`\`
268
268
 
269
269
  _Source: [Go2Rtc Isapi](https://github.com/AlexxIT/go2rtc#source-isapi)_
270
- `,lt=`#### Source: Ivideon
270
+ `,ut=`#### Source: Ivideon
271
271
 
272
272
  Support public cameras from service [Ivideon](https://tv.ivideon.com/).
273
273
 
@@ -277,7 +277,7 @@ streams:
277
277
  \`\`\`
278
278
 
279
279
  _Source: [Go2Rtc Ivideon](https://github.com/AlexxIT/go2rtc#source-ivideon)_
280
- `,ut=`#### Source: Kasa
280
+ `,pt=`#### Source: Kasa
281
281
 
282
282
  [TP-Link Kasa](https://www.kasasmart.com/) non-standard protocol [more info](https://medium.com/@hu3vjeen/reverse-engineering-tp-link-kc100-bac4641bf1cd).
283
283
 
@@ -287,7 +287,7 @@ streams:
287
287
  \`\`\`
288
288
 
289
289
  _Source: [Go2Rtc Kasa](https://github.com/AlexxIT/go2rtc#source-kasa)_
290
- `,pt=`#### Source: Nest
290
+ `,dt=`#### Source: Nest
291
291
 
292
292
  Currently only WebRTC cameras are supported. Stream reconnects every 5 minutes.
293
293
 
@@ -299,7 +299,7 @@ streams:
299
299
  \`\`\`
300
300
 
301
301
  _Source: [Go2Rtc Nest](https://github.com/AlexxIT/go2rtc#source-nest)_
302
- `,dt=`#### Source: ONVIF
302
+ `,ht=`#### Source: ONVIF
303
303
 
304
304
  The source is not very useful if you already know RTSP and snapshot links for your camera. But it can be useful if you don't.
305
305
 
@@ -313,7 +313,7 @@ streams:
313
313
  \`\`\`
314
314
 
315
315
  _Source: [Go2Rtc Onvif](https://github.com/AlexxIT/go2rtc#source-onvif)_
316
- `,ht=`#### Source: Roborock
316
+ `,gt=`#### Source: Roborock
317
317
 
318
318
  This source type support Roborock vacuums with cameras. Known working models:
319
319
 
@@ -325,7 +325,7 @@ Source support load Roborock credentials from Home Assistant [custom integration
325
325
  If you have graphic pin for your vacuum - add it as numeric pin (lines: 123, 456, 678) to the end of the roborock-link.
326
326
 
327
327
  _Source: [Go2Rtc Roborock](https://github.com/AlexxIT/go2rtc#source-roborock)_
328
- `,gt=`#### Source: RTMP
328
+ `,ft=`#### Source: RTMP
329
329
 
330
330
  You can get stream from RTMP server, for example [Frigate](https://docs.frigate.video/configuration/rtmp).
331
331
 
@@ -335,7 +335,7 @@ streams:
335
335
  \`\`\`
336
336
 
337
337
  _Source: [Go2Rtc RTMP](https://github.com/AlexxIT/go2rtc#source-rtmp)_
338
- `,ft=`#### Source: RTSP
338
+ `,bt=`#### Source: RTSP
339
339
 
340
340
  \`\`\`yaml
341
341
  streams:
@@ -382,7 +382,7 @@ streams:
382
382
  \`\`\`
383
383
 
384
384
  _Source: [Go2Rtc RTSP](https://github.com/AlexxIT/go2rtc#source-rtsp)_
385
- `,bt=`#### Source: Tapo
385
+ `,wt=`#### Source: Tapo
386
386
 
387
387
  [TP-Link Tapo](https://www.tapo.com/) proprietary camera protocol with **two way audio** support.
388
388
 
@@ -399,7 +399,7 @@ streams:
399
399
  \`\`\`
400
400
 
401
401
  _Source: [Go2Rtc Tapo](https://github.com/AlexxIT/go2rtc#source-tapo)_
402
- `,wt=`#### Source: WebRTC
402
+ `,vt=`#### Source: WebRTC
403
403
 
404
404
  This source type support four connection formats.
405
405
 
@@ -435,7 +435,7 @@ streams:
435
435
  **PS.** For \`kinesis\` sources you can use [echo](https://github.com/AlexxIT/go2rtc#source-echo) to get connection params using \`bash\`/\`python\` or any other script language.
436
436
 
437
437
  _Source: [Go2Rtc WebRTC](https://github.com/AlexxIT/go2rtc#source-webrtc)_
438
- `,vt=`#### Source: WebTorrent
438
+ `,_t=`#### Source: WebTorrent
439
439
 
440
440
  This source can get a stream from another go2rtc via [WebTorrent](https://github.com/AlexxIT/go2rtc#module-webtorrent) protocol.
441
441
 
@@ -445,4 +445,4 @@ streams:
445
445
  \`\`\`
446
446
 
447
447
  _Source: [Go2Rtc Webtorrent](https://github.com/AlexxIT/go2rtc#source-webtorrent)_
448
- `,_t={class:"page-title"},yt={class:"window"},xt={class:"subview-title text-color"},kt={class:"relative"},St={for:"name",class:"v-label"},Tt={class:"mt-5"},Pt={class:"subview-title text-color"},Rt={class:"flex flex-row items-center justify-center ml-auto"},It={class:"relative w-full flex flex-col"},At=["for"],Ct=["for"],Ht=["for"],Vt={class:"w-full flex flex-row justify-center my-1"},jt={class:"ml-2 flex items-center justify-center",style:{"max-height":"44px"}},Et={class:"flex items-center ml-auto"},Ot={class:"flex flex-row w-full items-center justify-center mt-3"},Gt={key:0,class:"w-full h-full flex items-center justify-center"},Mt=["innerHTML"],Ut={key:1,class:"w-full h-full flex items-center justify-center"},Ft={key:0,class:"w-full h-full flex items-center justify-center"},$t=Se({__name:"NewCamera",setup(Lt){P.registerLanguage("typescript",Ce),P.registerLanguage("yaml",He),P.registerLanguage("json",Ve),P.registerLanguage("python",je);const{smallMobileActive:H}=ye(),ee=Be(),U=new we,te=w(new Set),oe=w(),ae=w(!1),M=w(0),V=w([0]),T=w(),ne=w(["high-resolution","mid-resolution","low-resolution","snapshot"]),j=Te(),R=w(!1),E=w(!1),g=w({disabled:!1,name:"",info:{manufacturer:"",model:"",hardware:"",serialNumber:"",firmwareVersion:"",supportUrl:""},sources:[{name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}],recording:{enabled:!1},interface:{streamingMode:"webrtc"},extensions:{hub:[],plugins:[]}}),{mutate:se,isPending:re}=U.createCameraQuery(),{mutateAsync:ie,isPending:ce}=U.previewCameraQuery(),u=Pe(()=>re.value||ae.value),F=Le("commonmark",{highlight(o,e){if(e&&P.getLanguage(e))try{return'<pre><code class="hljs">'+P.highlight(o,{language:e,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+F.utils.escapeHtml(o)+"</code></pre>"}});Re(R,o=>{o||setTimeout(()=>{j.value={presets:[],md:void 0}},300)});const me=o=>{g.value.sources[o].urls.push({protocol:"rtsp://",url:[]})},le=(o,e)=>{g.value.sources[o].urls.splice(e,1)},ue=()=>{g.value.sources.push({name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}),V.value=[g.value.sources.length]},pe=o=>{g.value.sources.splice(o,1)},$=o=>{let e,s,b;switch(o){case"bubble://":e=[],s=Object.assign({"../markdowns/bubble.md":Ze});break;case"dvrip://":e=[],s=Object.assign({"../markdowns/dvrip.md":et});break;case"echo:":e=[],s=Object.assign({"../markdowns/echo.md":tt});break;case"exec:":e=[],s=Object.assign({"../markdowns/exec.md":ot});break;case"expr:":e=[],s=Object.assign({"../markdowns/expr.md":at});break;case"ffmpeg:":e=Z,s=Object.assign({"../markdowns/ffmpeg.md":nt});break;case"gopro://":e=Z,s=Object.assign({"../markdowns/gopro.md":st});break;case"hass:":e=[],s=Object.assign({"../markdowns/hass.md":rt});break;case"homekit://":e=qe,s=Object.assign({"../markdowns/homekit.md":it});break;case"http://":case"https://":case"httpx://":case"tcp://":e=Je,s=Object.assign({"../markdowns/http.md":ct});break;case"isapi://":e=[],s=Object.assign({"../markdowns/isapi.md":mt});break;case"ivideon:":e=[],s=Object.assign({"../markdowns/ivideon.md":lt});break;case"kasa://":e=[],s=Object.assign({"../markdowns/kasa.md":ut});break;case"nest:":e=Xe,s=Object.assign({"../markdowns/nest.md":pt});break;case"onvif://":e=[],s=Object.assign({"../markdowns/onvif.md":dt});break;case"roborock://":e=[],s=Object.assign({"../markdowns/roborock.md":ht});break;case"rtmp://":e=[],s=Object.assign({"../markdowns/rtmp.md":gt});break;case"rtsp://":case"rtspx://":e=Ke,s=Object.assign({"../markdowns/rtsp.md":ft});break;case"tapo://":e=[],s=Object.assign({"../markdowns/tapo.md":bt});break;case"webrtc:":e=Qe,s=Object.assign({"../markdowns/webrtc.md":wt});break;case"webtorrent:":e=[],s=Object.assign({"../markdowns/webtorrent.md":vt});break;default:e=[],s=void 0;break}return s&&(b=Object.values(s)[0]),j.value={presets:e,md:b},{presets:e,md:b}},de=o=>{$(o),R.value=!0},he=async o=>{T.value=void 0,E.value=!0;const e=o.url.join(""),b={url:e.includes(o.protocol)?e:`${o.protocol}${e}`},r=await ie({cameraData:b});T.value=r?`data:image/jpeg;base64,${r}`:"ERROR",T.value!=="ERROR"&&te.value.add(b.url)},ge=o=>({...o,pluginId:"native",type:"camera",isCloud:!1,hasLight:!1,hasSiren:!1,hasBinarySensor:!1,hasBattery:!1,activityZones:[],activitySettings:{motion:{timeout:20},object:{confidence:.7}},frameWorkerSettings:{decoder:"wasm",fps:10,resolution:640},sources:o.sources.map(s=>{let b=s.urls.map(r=>{if(r.url){const c=r.url.join("");return c.includes(r.protocol)?c:`${r.protocol}${c}`}}).filter(Boolean);return{_id:"",...s,urls:b}})}),fe=o=>{const{isLoading:e}=$e(0,{parent:".topbar"});e.value=!0;let s=ge(o);se({cameraData:s},{onSuccess:async()=>{e.value=!1,await De(500),ee.push({path:"/cameras"})}})},be=(o,e)=>{e.protocol=o};return(o,e)=>{const s=xe,b=_e;return h(),k("main",{class:W(["w-full h-full",{"px-0":t(H)}])},[a(t(We),{ref_key:"cameraVeeForm",ref:oe,class:"firststeps-form flex flex-col h-full w-full","validation-schema":t(ve),"initial-values":t(g),onSubmit:e[3]||(e[3]=r=>fe(r))},{default:n(()=>[l("div",{class:W(["mb-3 flex items-center",{"mx-2":t(H)}]),style:{height:"30px"}},[l("h1",_t,m(o.$t("views.new_camera.title")),1),a(S,{loading:t(u),variant:"text",color:"green",type:"submit",class:"ml-auto"},{default:n(()=>[a(y,{size:"15",class:"mr-1"},{default:n(()=>[d(m(t(z)),1)]),_:1}),d(" "+m(o.$t("components.form.button.add")),1)]),_:1},8,["loading"])],2),l("div",yt,[l("div",null,[l("span",xt,m(o.$t("components.form.label.camera")),1),a(N,{modelValue:t(M),"onUpdate:modelValue":e[1]||(e[1]=r=>O(M)?M.value=r:null),class:"inner-component mt-2"},{default:n(()=>[a(Y,{elevation:"0",value:1},{default:n(()=>[a(K,{style:{height:"48px"},class:"truncate"},{default:n(()=>[d(m(o.$t("views.new_camera.camera")),1)]),_:1}),a(q,{eager:""},{default:n(()=>[l("div",kt,[a(t(C),{modelValue:t(g).name,"onUpdate:modelValue":e[0]||(e[0]=r=>t(g).name=r),name:"name"},{default:n(({field:r,errorMessage:c,errors:i})=>[l("label",St,m(o.$t("components.form.label.camera_name")),1),a(J,G({loading:t(u),variant:"outlined",name:"name",type:"text",density:"compact"},r,{error:i.length>0,"error-messages":c}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),l("div",Tt,[l("span",Pt,m(o.$t("components.form.label.camera_sources")),1),a(N,{modelValue:t(V),"onUpdate:modelValue":e[2]||(e[2]=r=>O(V)?V.value=r:null),class:"inner-component mt-2",multiple:"",variant:"accordion"},{default:n(()=>[(h(!0),k(D,null,B(t(g).sources,(r,c)=>(h(),A(Y,{key:c,value:c+1,elevation:"0",style:Ae(t(H)?"border-radius: 0px !important":"")},{default:n(()=>[a(K,{style:{height:"48px"},class:"truncate"},{actions:n(({expanded:i})=>[l("div",Rt,[a(S,{disabled:t(g).sources.length<2||t(u),size:"22.5",rounded:"",color:"red",variant:"text",class:"mx-2",onClick:_(f=>pe(c),["stop"])},{default:n(()=>[a(y,null,{default:n(()=>[d(m(t(Ee)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),i?(h(),A(y,{key:0,size:"22.5"},{default:n(()=>[d(m(t(Oe)),1)]),_:1})):(h(),A(y,{key:1,size:"22.5"},{default:n(()=>[d(m(t(Ge)),1)]),_:1}))])]),default:n(()=>[d(m(o.$t("views.new_camera.source")+": "+c)+" ",1)]),_:2},1024),a(q,{eager:""},{default:n(()=>[l("div",It,[a(t(C),{modelValue:r.name,"onUpdate:modelValue":i=>r.name=i,name:`sources[${c}].name`},{default:n(({field:i,errorMessage:f,errors:p})=>[l("label",{for:`sources[${c}].name`,class:"v-label"},m(o.$t("components.form.label.source_name")),9,At),a(J,G({loading:t(u),variant:"outlined",name:`sources[${c}].name`,type:"text",density:"compact",ref_for:!0},i,{error:p.length>0,"error-messages":f}),null,16,["loading","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),a(t(C),{modelValue:r.roles,"onUpdate:modelValue":i=>r.roles=i,name:`sources[${c}].roles`},{default:n(({field:i,errorMessage:f,errors:p})=>[l("label",{for:`sources[${c}].roles`,class:"v-label"},m(o.$t("components.form.label.source_role")),9,Ct),a(X,G({loading:t(u),items:t(ne).filter(x=>!t(g).sources.some((I,v)=>{var L;return((L=I.roles)==null?void 0:L.includes(x))&&v!==c})),variant:"outlined",name:`sources[${c}].roles`,type:"text",density:"compact",chips:"",multiple:"",clearable:"",ref_for:!0},i,{error:p.length>0,"error-messages":f,"model-value":i.value,onKeydown:_(()=>null,["prevent"])}),{chip:n(({item:x})=>[a(ze,{color:"#df2a4c"},{default:n(()=>[d(m(x.title),1)]),_:2},1024)]),_:2},1040,["loading","items","name","error","error-messages","model-value"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),l("label",{for:`sources[${c}].urls[].url`,class:"v-label"},m(o.$t("components.form.label.camera_sources")),9,Ht),(h(!0),k(D,null,B(r.urls,(i,f)=>(h(),k("div",{key:f},[l("div",Vt,[a(t(C),{modelValue:i.protocol,"onUpdate:modelValue":p=>i.protocol=p,name:`sources[${c}].urls[${f}].protocol`},{default:n(({field:p,errors:x,errorMessage:I})=>[a(X,G({loading:t(u),items:t(Ye),"hide-no-data":"","hide-details":"",variant:"outlined",name:`sources[${c}].urls[${f}].protocol`,type:"text",density:"compact",style:{"min-width":"125px","max-width":"125px","min-height":"40px","max-height":"40px"},class:"camera-protocol",ref_for:!0},p,{error:x.length>0,"error-messages":I,"model-value":p.value,onKeydown:_(()=>null,["prevent"]),"onUpdate:modelValue":v=>be(v,i)}),null,16,["loading","items","name","error","error-messages","model-value","onUpdate:modelValue"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),a(t(C),{modelValue:i.url,"onUpdate:modelValue":p=>i.url=p,name:`sources[${c}].urls[${f}].url`},{default:n(({field:p,errorMessage:x,errors:I})=>[a(Ne,{modelValue:i.url,"onUpdate:modelValue":[v=>i.url=v,v=>p.value=v],loading:t(u),clearable:"",chips:"",multiple:"",items:$(i.protocol).presets,variant:"outlined",name:`sources[${c}].urls[${f}].url`,type:"text",density:"compact",class:"camera-source",error:I.length>0,"error-messages":x},{"append-inner":n(()=>[r.urls.length>1?(h(),A(S,{key:0,size:"28",variant:"text",rounded:"",density:"compact",color:"red",disabled:r.urls.length<2||t(u),onClick:_(v=>le(c,f),["prevent"])},{default:n(()=>[a(y,{size:"20"},{default:n(()=>[d(m(t(Me)),1)]),_:1})]),_:2},1032,["disabled","onClick"])):Ie("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","loading","items","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),l("div",jt,[a(S,{disabled:!i.protocol||!i.url.length||t(u),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(p=>he(i),["prevent"])},{default:n(()=>[a(y,{size:"20"},{default:n(()=>[d(m(t(Ue)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),a(S,{disabled:t(u),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(p=>de(i.protocol),["prevent"])},{default:n(()=>[a(y,{size:"20"},{default:n(()=>[d(m(t(Fe)),1)]),_:1})]),_:2},1032,["disabled","onClick"])])])]))),128)),l("div",Et,[a(S,{disabled:t(u),color:"#df2a4c",variant:"flat",onClick:_(i=>me(c),["prevent"])},{default:n(()=>[d(m(o.$t("components.form.button.add_source")),1)]),_:2},1032,["disabled","onClick"])])])]),_:2},1024)]),_:2},1032,["value","style"]))),128))]),_:1},8,["modelValue"]),l("div",Ot,[a(S,{disabled:t(u),variant:"text",color:"#df2a4c",icon:"",onClick:_(ue,["prevent"])},{default:n(()=>[a(y,{size:"30"},{default:n(()=>[d(m(t(z)),1)]),_:1})]),_:1},8,["disabled"])])])])]),_:1},8,["validation-schema","initial-values"]),a(s,{modelValue:t(R),"onUpdate:modelValue":e[4]||(e[4]=r=>O(R)?R.value=r:null),title:o.$t("components.dialog.title.information"),loading:t(u),"hide-confirm-button":""},{content:n(()=>{var r;return[(r=t(j))!=null&&r.md?(h(),k("div",Gt,[l("div",{class:"w-full markdown-body",innerHTML:t(F).render(t(j).md)},null,8,Mt)])):(h(),k("div",Ut,[a(Q,{color:"#df2a4c",indeterminate:""})]))]}),_:1},8,["modelValue","title","loading"]),a(s,{modelValue:t(E),"onUpdate:modelValue":e[5]||(e[5]=r=>O(E)?E.value=r:null),title:o.$t("components.dialog.title.preview"),loading:t(u),"hide-confirm-button":""},{content:n(()=>[!t(T)||t(ce)?(h(),k("div",Ft,[a(Q,{color:"#df2a4c",indeterminate:""})])):(h(),A(b,{key:1,class:"mt-5 inner-component","show-camera-name":"","current-camera":t(T),"border-radius":t(H)?0:3,border:!1,target:"preview","preview-src":t(T),"button-elevation":"1"},null,8,["current-camera","border-radius","preview-src"]))]),_:1},8,["modelValue","title","loading"])],2)}}}),jo=ke($t,[["__scopeId","data-v-d2dfec8d"]]);export{jo as default};
448
+ `,yt={class:"page-title"},xt={class:"window"},kt={class:"subview-title text-color"},St={class:"relative"},Tt={for:"name",class:"v-label"},Pt={class:"mt-5"},Rt={class:"subview-title text-color"},At={class:"flex flex-row items-center justify-center ml-auto"},It={class:"relative w-full flex flex-col"},Ct=["for"],Vt=["for"],Ht=["for"],jt={key:0,class:"w-full flex flex-row justify-center my-1"},Et={class:"ml-2 flex items-center justify-center",style:{"max-height":"44px"}},Ot={class:"w-full flex flex-row justify-center my-1"},Gt={class:"ml-2 flex items-center justify-center",style:{"max-height":"44px"}},Mt={class:"flex items-center ml-auto"},Ut={class:"flex flex-row w-full items-center justify-center mt-3"},$t={key:0,class:"w-full h-full"},Lt=["innerHTML"],Wt={key:1,class:"w-full h-full flex items-center justify-center"},Dt={key:0,class:"w-full h-full flex items-center justify-center"},Bt=Ae({__name:"NewCamera",setup(Ft){A.registerLanguage("typescript",je),A.registerLanguage("yaml",Ee),A.registerLanguage("json",Oe),A.registerLanguage("python",Ge);const{smallMobileActive:H,extraSmallMobileActive:U}=Te(),re=Ne(),W=new xe,ie=v(new Set),ce=v(),le=v(!1),$=v(0),j=v([0]),R=v(),me=v(["high-resolution","mid-resolution","low-resolution","snapshot"]),E=Ie(),C=v(!1),O=v(!1),f=v({disabled:!1,name:"",info:{manufacturer:"",model:"",hardware:"",serialNumber:"",firmwareVersion:"",supportUrl:""},sources:[{name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}],recording:{enabled:!1},interface:{streamingMode:"webrtc"},extensions:{hub:[],plugins:[]}}),{mutate:ue,isPending:pe}=W.createCameraQuery(),{mutateAsync:de,isPending:he}=W.previewCameraQuery(),p=Ce(()=>pe.value||le.value),D=Be("commonmark",{highlight(o,t){if(t&&A.getLanguage(t))try{return'<pre><code class="hljs">'+A.highlight(o,{language:t,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+D.utils.escapeHtml(o)+"</code></pre>"}});Ve(C,o=>{o||setTimeout(()=>{E.value={presets:[],md:void 0}},300)});const ge=o=>{f.value.sources[o].urls.push({protocol:"rtsp://",url:[]})},fe=(o,t)=>{f.value.sources[o].urls.splice(t,1)},be=()=>{f.value.sources.push({name:"",roles:[],urls:[{protocol:"rtsp://",url:[]}]}),j.value=[f.value.sources.length]},we=o=>{f.value.sources.splice(o,1)},B=o=>{let t,s,b;switch(o){case"bubble://":t=[],s=Object.assign({"../markdowns/bubble.md":et});break;case"dvrip://":t=[],s=Object.assign({"../markdowns/dvrip.md":tt});break;case"echo:":t=[],s=Object.assign({"../markdowns/echo.md":ot});break;case"exec:":t=[],s=Object.assign({"../markdowns/exec.md":at});break;case"expr:":t=[],s=Object.assign({"../markdowns/expr.md":nt});break;case"ffmpeg:":t=se,s=Object.assign({"../markdowns/ffmpeg.md":st});break;case"gopro://":t=se,s=Object.assign({"../markdowns/gopro.md":rt});break;case"hass:":t=[],s=Object.assign({"../markdowns/hass.md":it});break;case"homekit://":t=Je,s=Object.assign({"../markdowns/homekit.md":ct});break;case"http://":case"https://":case"httpx://":case"tcp://":t=Xe,s=Object.assign({"../markdowns/http.md":lt});break;case"isapi://":t=[],s=Object.assign({"../markdowns/isapi.md":mt});break;case"ivideon:":t=[],s=Object.assign({"../markdowns/ivideon.md":ut});break;case"kasa://":t=[],s=Object.assign({"../markdowns/kasa.md":pt});break;case"nest:":t=Qe,s=Object.assign({"../markdowns/nest.md":dt});break;case"onvif://":t=[],s=Object.assign({"../markdowns/onvif.md":ht});break;case"roborock://":t=[],s=Object.assign({"../markdowns/roborock.md":gt});break;case"rtmp://":t=[],s=Object.assign({"../markdowns/rtmp.md":ft});break;case"rtsp://":case"rtspx://":t=qe,s=Object.assign({"../markdowns/rtsp.md":bt});break;case"tapo://":t=[],s=Object.assign({"../markdowns/tapo.md":wt});break;case"webrtc:":t=Ze,s=Object.assign({"../markdowns/webrtc.md":vt});break;case"webtorrent:":t=[],s=Object.assign({"../markdowns/webtorrent.md":_t});break;default:t=[],s=void 0;break}return s&&(b=Object.values(s)[0]),E.value={presets:t,md:b},{presets:t,md:b}},F=o=>{B(o),C.value=!0},ve=async o=>{R.value=void 0,O.value=!0;const t=o.url.join(""),b={url:t.includes(o.protocol)?t:`${o.protocol}${t}`},r=await de({cameraData:b});R.value=r?`data:image/jpeg;base64,${r}`:"ERROR",R.value!=="ERROR"&&ie.value.add(b.url)},_e=o=>({...o,pluginId:"native",type:"camera",isCloud:!1,hasLight:!1,hasSiren:!1,hasBinarySensor:!1,hasBattery:!1,activityZones:[],activitySettings:{motion:{timeout:20},object:{confidence:.7}},frameWorkerSettings:{decoder:"wasm",fps:10,resolution:640},sources:o.sources.map(s=>{let b=s.urls.map(r=>{if(r.url){const c=r.url.join("");return c.includes(r.protocol)?c:`${r.protocol}${c}`}}).filter(Boolean);return{_id:"",...s,urls:b}})}),ye=o=>{const{isLoading:t}=De(0,{parent:".topbar"});t.value=!0;let s=_e(o);ue({cameraData:s},{onSuccess:async()=>{t.value=!1,await ze(500),re.push({path:"/cameras"})}})},z=(o,t)=>{t.protocol=o};return(o,t)=>{const s=Pe,b=Se;return d(),k("main",{class:Y(["w-full h-full",{"px-0":e(H)}])},[n(e(Fe),{ref_key:"cameraVeeForm",ref:ce,class:"firststeps-form flex flex-col h-full w-full","validation-schema":e(ke),"initial-values":e(f),onSubmit:t[3]||(t[3]=r=>ye(r))},{default:a(()=>[u("div",{class:Y(["mb-3 flex items-center",{"mx-2":e(H)}]),style:{height:"30px"}},[u("h1",yt,l(o.$t("views.new_camera.title")),1),n(S,{loading:e(p),variant:"text",color:"green",type:"submit",class:"ml-auto"},{default:a(()=>[n(x,{size:"15",class:"mr-1"},{default:a(()=>[h(l(e(J)),1)]),_:1}),h(" "+l(o.$t("components.form.button.add")),1)]),_:1},8,["loading"])],2),u("div",xt,[u("div",null,[u("span",kt,l(o.$t("components.form.label.camera")),1),n(Q,{modelValue:e($),"onUpdate:modelValue":t[1]||(t[1]=r=>G($)?$.value=r:null),class:"inner-component mt-2"},{default:a(()=>[n(Z,{elevation:"0",value:1},{default:a(()=>[n(ee,{style:{height:"48px"},class:"truncate"},{default:a(()=>[h(l(o.$t("views.new_camera.camera")),1)]),_:1}),n(te,{eager:""},{default:a(()=>[u("div",St,[n(e(I),{modelValue:e(f).name,"onUpdate:modelValue":t[0]||(t[0]=r=>e(f).name=r),name:"name"},{default:a(({field:r,errorMessage:c,errors:i})=>[u("label",Tt,l(o.$t("components.form.label.camera_name")),1),n(oe,V({loading:e(p),variant:"outlined",name:"name",type:"text",density:"compact"},r,{error:i.length>0,"error-messages":c}),null,16,["loading","error","error-messages"])]),_:1},8,["modelValue"])])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),u("div",Pt,[u("span",Rt,l(o.$t("components.form.label.camera_sources")),1),n(Q,{modelValue:e(j),"onUpdate:modelValue":t[2]||(t[2]=r=>G(j)?j.value=r:null),class:"inner-component mt-2",multiple:"",variant:"accordion"},{default:a(()=>[(d(!0),k(K,null,q(e(f).sources,(r,c)=>(d(),P(Z,{key:c,value:c+1,elevation:"0",style:He(e(H)?"border-radius: 0px !important":"")},{default:a(()=>[n(ee,{style:{height:"48px"},class:"truncate"},{actions:a(({expanded:i})=>[u("div",At,[n(S,{disabled:e(f).sources.length<2||e(p),size:"22.5",rounded:"",color:"red",variant:"text",class:"mx-2",onClick:_(g=>we(c),["stop"])},{default:a(()=>[n(x,null,{default:a(()=>[h(l(e(Me)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),i?(d(),P(x,{key:0,size:"22.5"},{default:a(()=>[h(l(e(Ue)),1)]),_:1})):(d(),P(x,{key:1,size:"22.5"},{default:a(()=>[h(l(e($e)),1)]),_:1}))])]),default:a(()=>[h(l(o.$t("views.new_camera.source")+": "+c)+" ",1)]),_:2},1024),n(te,{eager:""},{default:a(()=>[u("div",It,[n(e(I),{modelValue:r.name,"onUpdate:modelValue":i=>r.name=i,name:`sources[${c}].name`},{default:a(({field:i,errorMessage:g,errors:m})=>[u("label",{for:`sources[${c}].name`,class:"v-label"},l(o.$t("components.form.label.source_name")),9,Ct),n(oe,V({loading:e(p),variant:"outlined",name:`sources[${c}].name`,type:"text",density:"compact",ref_for:!0},i,{error:m.length>0,"error-messages":g}),null,16,["loading","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),n(e(I),{modelValue:r.roles,"onUpdate:modelValue":i=>r.roles=i,name:`sources[${c}].roles`},{default:a(({field:i,errorMessage:g,errors:m})=>[u("label",{for:`sources[${c}].roles`,class:"v-label"},l(o.$t("components.form.label.source_role")),9,Vt),n(L,V({loading:e(p),items:e(me).filter(y=>!e(f).sources.some((T,w)=>{var N;return((N=T.roles)==null?void 0:N.includes(y))&&w!==c})),variant:"outlined",name:`sources[${c}].roles`,type:"text",density:"compact",chips:"",multiple:"",clearable:"",ref_for:!0},i,{error:m.length>0,"error-messages":g,"model-value":i.value,onKeydown:_(()=>null,["prevent"])}),{chip:a(({item:y})=>[n(Ye,{color:"#df2a4c"},{default:a(()=>[h(l(y.title),1)]),_:2},1024)]),_:2},1040,["loading","items","name","error","error-messages","model-value"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),u("label",{for:`sources[${c}].urls[].url`,class:"v-label"},l(o.$t("components.form.label.camera_sources")),9,Ht),(d(!0),k(K,null,q(r.urls,(i,g)=>(d(),k("div",{key:g},[e(U)?(d(),k("div",jt,[n(e(I),{modelValue:i.protocol,"onUpdate:modelValue":m=>i.protocol=m,name:`sources[${c}].urls[${g}].protocol`},{default:a(({field:m,errors:y,errorMessage:T})=>[n(L,V({loading:e(p),items:e(ne),"hide-no-data":"","hide-details":"",variant:"outlined",name:`sources[${c}].urls[${g}].protocol`,type:"text",density:"compact",class:"camera-protocol",ref_for:!0},m,{error:y.length>0,"error-messages":T,"model-value":m.value,onKeydown:_(()=>null,["prevent"]),"onUpdate:modelValue":w=>z(w,i)}),null,16,["loading","items","name","error","error-messages","model-value","onUpdate:modelValue"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),u("div",Et,[n(S,{disabled:e(p),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(m=>F(i.protocol),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(X)),1)]),_:1})]),_:2},1032,["disabled","onClick"])])])):M("",!0),u("div",Ot,[e(U)?M("",!0):(d(),P(e(I),{key:0,modelValue:i.protocol,"onUpdate:modelValue":m=>i.protocol=m,name:`sources[${c}].urls[${g}].protocol`},{default:a(({field:m,errors:y,errorMessage:T})=>[n(L,V({loading:e(p),items:e(ne),"hide-no-data":"","hide-details":"",variant:"outlined",name:`sources[${c}].urls[${g}].protocol`,type:"text",density:"compact",style:{"min-width":"125px","max-width":"125px","min-height":"40px","max-height":"40px"},class:"camera-protocol",ref_for:!0},m,{error:y.length>0,"error-messages":T,"model-value":m.value,onKeydown:_(()=>null,["prevent"]),"onUpdate:modelValue":w=>z(w,i)}),null,16,["loading","items","name","error","error-messages","model-value","onUpdate:modelValue"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"])),n(e(I),{modelValue:i.url,"onUpdate:modelValue":m=>i.url=m,name:`sources[${c}].urls[${g}].url`},{default:a(({field:m,errorMessage:y,errors:T})=>[n(Ke,{modelValue:i.url,"onUpdate:modelValue":[w=>i.url=w,w=>m.value=w],loading:e(p),clearable:"",chips:"",multiple:"",items:B(i.protocol).presets,variant:"outlined",name:`sources[${c}].urls[${g}].url`,type:"text",density:"compact",class:"camera-source",error:T.length>0,"error-messages":y},{"append-inner":a(()=>[r.urls.length>1?(d(),P(S,{key:0,size:"28",variant:"text",rounded:"",density:"compact",color:"red",disabled:r.urls.length<2||e(p),onClick:_(w=>fe(c,g),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(Le)),1)]),_:1})]),_:2},1032,["disabled","onClick"])):M("",!0)]),_:2},1032,["modelValue","onUpdate:modelValue","loading","items","name","error","error-messages"])]),_:2},1032,["modelValue","onUpdate:modelValue","name"]),u("div",Gt,[n(S,{disabled:!i.protocol||!i.url.length||e(p),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(m=>ve(i),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(We)),1)]),_:1})]),_:2},1032,["disabled","onClick"]),e(U)?M("",!0):(d(),P(S,{key:0,disabled:e(p),color:"#5e5e5e",density:"compact",icon:"",variant:"text",onClick:_(m=>F(i.protocol),["prevent"])},{default:a(()=>[n(x,{size:"20"},{default:a(()=>[h(l(e(X)),1)]),_:1})]),_:2},1032,["disabled","onClick"]))])])]))),128)),u("div",Mt,[n(S,{disabled:e(p),color:"#df2a4c",variant:"flat",onClick:_(i=>ge(c),["prevent"])},{default:a(()=>[h(l(o.$t("components.form.button.add_source")),1)]),_:2},1032,["disabled","onClick"])])])]),_:2},1024)]),_:2},1032,["value","style"]))),128))]),_:1},8,["modelValue"]),u("div",Ut,[n(S,{disabled:e(p),variant:"text",color:"#df2a4c",icon:"",onClick:_(be,["prevent"])},{default:a(()=>[n(x,{size:"30"},{default:a(()=>[h(l(e(J)),1)]),_:1})]),_:1},8,["disabled"])])])])]),_:1},8,["validation-schema","initial-values"]),n(s,{modelValue:e(C),"onUpdate:modelValue":t[4]||(t[4]=r=>G(C)?C.value=r:null),title:o.$t("components.dialog.title.information"),loading:e(p),"hide-confirm-button":""},{content:a(()=>{var r;return[(r=e(E))!=null&&r.md?(d(),k("div",$t,[u("div",{class:"w-full markdown-body",innerHTML:e(D).render(e(E).md)},null,8,Lt)])):(d(),k("div",Wt,[n(ae,{color:"#df2a4c",indeterminate:""})]))]}),_:1},8,["modelValue","title","loading"]),n(s,{modelValue:e(O),"onUpdate:modelValue":t[5]||(t[5]=r=>G(O)?O.value=r:null),title:o.$t("components.dialog.title.preview"),loading:e(p),"hide-confirm-button":""},{content:a(()=>[!e(R)||e(he)?(d(),k("div",Dt,[n(ae,{color:"#df2a4c",indeterminate:""})])):(d(),P(b,{key:1,class:"mt-5 inner-component","show-camera-name":"","current-camera":e(R),"border-radius":e(H)?0:3,border:!1,target:"preview","preview-src":e(R),"button-elevation":"1"},null,8,["current-camera","border-radius","preview-src"]))]),_:1},8,["modelValue","title","loading"])],2)}}}),Go=Re(Bt,[["__scopeId","data-v-65da19aa"]]);export{Go as default};
@@ -0,0 +1 @@
1
+ div[data-v-65da19aa] .v-expansion-panel-title__overlay,div[data-v-65da19aa] .v-expansion-panel__shadow{background:var(--background-inner-component);border-radius:4px;border:1px solid var(--border-card);box-shadow:none!important}@media screen and (max-width: 639px){div[data-v-65da19aa] .v-expansion-panel-title__overlay,div[data-v-65da19aa] .v-expansion-panel__shadow{border-radius:0}}.new-source-container[data-v-65da19aa]{padding:1rem;background:rgba(var(--color-rgb),.04);border-radius:10px}.camera-protocol[data-v-65da19aa] .v-input__prepend,.camera-source[data-v-65da19aa] .v-input__prepend{margin:0!important}.camera-protocol[data-v-65da19aa] .v-field{border-radius:4px 0 0 4px/4px 0px 0px 4px!important}.camera-source[data-v-65da19aa] .v-field{border-top-left-radius:0;border-bottom-left-radius:0}.camera-source[data-v-65da19aa] .v-input__append{margin-left:5px}.window[data-v-65da19aa]{min-height:calc(100% - 36px)}
@@ -1 +1 @@
1
- import{a as we,b as lt,C as at,d as it,e as rt,g as ut}from"./VPlayer-D_SuxyEf.js";import{_ as ct}from"./VPluginCard-BVeId9fp.js";import{F as $e,t as Ee,r as l,c as H,w as Y,e as a,f as u,j as s,u as e,T as d,l as y,n as X,V as J,M as f,R as g,q as P,y as te,i as fe,a3 as dt,U as ft,X as Qe,O as B,N as Pe,Q as De}from"./@vue-CIFymae3.js";import{X as Fe,k as ce,i as oe,c as Be}from"./@mdi-DdmeckA1.js";import{i as ze}from"./vue3-toastify-Cy6dUyKO.js";import{P as Ie}from"./plugins-X26db0mJ.js";import{A as Me,M as Ve,i as Ue,d as ke,C as Je,D as je,w as Ye,E as Re,F as Le,z as mt,f as pt,G as vt}from"./main-f-Qd4R5M.js";import{e as le,b as me,V as de,U as gt,W as _t,C as ht,w as yt,G as qe,f as He,I as bt,J as xt,n as wt,x as $t}from"./vuetify-B_vGZaGi.js";import{H as se,t as It,y as kt,j as Ct,p as St}from"./highlight.js-fBaokXp-.js";import{M as Pt}from"./markdown-it-DI8MEbma.js";import{u as Dt}from"./vue-router-C55prZ5l.js";import{x as Vt}from"./@vueuse-GPEsefjJ.js";import"./qrcode-SHonoxyK.js";import"./dijkstrajs-D_NXgYpA.js";import"./vee-validate-DHjm38DY.js";import"./zod-BaF2dDCd.js";import"./pinia-B_gX_pHL.js";import"./@vee-validate-CmTVjJBY.js";import"./draggabilly-YEGzHR3_.js";import"./@xterm-LO7TPXYg.js";import"./get-size-D1dS-IaP.js";import"./unidragger-91TYirAP.js";import"./ev-emitter-t78oQA8k.js";import"./@tanstack-DPd4-F0t.js";import"./VConfigEditor.vue_vue_type_script_setup_true_lang-NvLEB-vb.js";import"./ace-builds-Jtyk_kwI.js";import"./@vueform-B8BH3_sM.js";import"./system-CjiOVZ9H.js";import"./VConsole-CZymGHU4.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue-i18n-Cyk5bTcs.js";import"./@intlify-Ck2ZoCVz.js";import"./axios-BI2i94Vb.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-CQrF441D.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./mdurl-k9Sl0PQj.js";import"./uc.micro-kMc2yuuw.js";import"./entities-C20TfXL6.js";import"./linkify-it-DmNjr4Kv.js";import"./punycode.js-Dj65hjkv.js";const jt={class:"w-full"},Lt={key:0,class:"w-full"},zt={class:"flex flex-col justify-center items-center mb-5"},Et={for:"restoreInput",class:"cursor-pointer text-center text-sm"},Ft=["accept"],Ot={key:0,class:"text-red text-sm"},Tt={key:1,class:"w-full flex flex-col items-center justify-center"},At={class:"relative mb-4 w-full"},Nt=["src","type"],Qt={class:"flex items-center justify-center"},Bt={class:"mx-2"},Mt={class:"disabled-text"},Ut={class:"mt-10"},Jt={class:"box-title w-full mb-3"},Rt={key:0,class:"flex items-center justify-center text-sm text-passive mt-5"},qt=$e({__name:"VAudioDetectionInterface",props:{pluginName:{}},setup(ne){const O=new Ie,C=ne,{pluginName:T}=Ee(C),i=l([]),x=l(!1),p=l(!1),D=l(!1),b=l(!1),$=l(null),I=l(null),z=l(Me.join(",")),F=l(""),S=l({}),h=l(!1),V=l(),_=l(!0),{mutateAsync:E,isPending:A}=O.detectAudioQuery(),{data:M,isLoading:G}=O.getPluginInterfaceQuery(T.value,{type:"audioDetection"}),R=H(()=>A.value||G.value||h.value),w=n=>{const t=i.value.findIndex(o=>o.name===n);t>-1&&(i.value.splice(t,1),W(),F.value="",V.value=void 0)},j=n=>{if(x.value=!1,p.value=!1,b.value=!1,i.value=[],n.dataTransfer)if(n.dataTransfer.files.length>1)p.value=!0;else{const t=n.dataTransfer.files[0];Me.includes(t.type)&&t.size<=Ve?(i.value.push(t),te(()=>{k(t)})):t.size>Ve?b.value=!0:p.value=!0}},K=n=>{var o;p.value=!1,b.value=!1,i.value=[];const t=n.target;if(t&&t.files){if(((o=t.files)==null?void 0:o.length)>1)p.value=!0;else if(t.files.length===1){const m=t.files[0];m.size<=Ve?(i.value.push(m),te(()=>{k(m)})):b.value=!0}}},W=()=>{$.value&&($.value.value="")},Z=n=>n<1024?n+" bytes":n<1048576?(n/1024).toFixed(1)+" KB":(n/1048576).toFixed(1)+" MB",k=n=>{h.value=!0;const t=new Audio;t.src=URL.createObjectURL(n),t.onloadedmetadata=()=>{V.value={mimeType:n.type},h.value=!1}},q=async n=>{if(!i.value.length){D.value=!0;return}h.value=!0;const t=new FormData;t.append("upload",i.value[0]),t.append("config",JSON.stringify(n)),t.append("metadata",JSON.stringify(V.value));try{await E({pluginName:T.value,formData:t})?ze.info(Ue.global.t("components.detection_interface.audio_detected")):ze.info(Ue.global.t("components.detection_interface.audio_not_detected"))}catch(o){console.error("Error detecting audio",o)}finally{h.value=!1}};return Y(i,n=>{n.length>0?(D.value=!1,_.value=!1):(F.value="",V.value=void 0,_.value=!0)},{immediate:!0,deep:!0}),(n,t)=>{const o=we;return a(),u("div",jt,[s("div",{class:"file-upload-box p-4",onDrop:t[1]||(t[1]=P(m=>j(m),["prevent"])),onDragover:t[2]||(t[2]=P(m=>x.value=!0,["prevent"])),onDragenter:t[3]||(t[3]=P(m=>x.value=!0,["prevent"])),onDragleave:t[4]||(t[4]=P(m=>x.value=!1,["prevent"]))},[e(i).length?(a(),u("div",Tt,[s("div",At,[s("audio",{ref_key:"audioPlayer",ref:I,controls:"",class:"w-full"},[s("source",{src:e(F),type:e(i)[0].type},null,8,Nt),J(" Your browser does not support the audio element. ")],512)]),s("div",Qt,[f(me,{size:"28",variant:"text",color:"red",rounded:"",onClick:t[0]||(t[0]=P(m=>w(e(i)[0].name),["stop"]))},{default:g(()=>[f(le,{size:"20"},{default:g(()=>[J(d(e(Fe)),1)]),_:1})]),_:1}),s("b",Bt,d(e(i)[0].name),1),s("span",Mt,"("+d(Z(e(i)[0].size))+")",1)])])):(a(),u("div",Lt,[s("div",zt,[s("label",Et,d(n.$t("components.detection_interface.drop_or_select_audio_to_detect")),1),s("input",{id:"restoreInput",ref_key:"fileInput",ref:$,type:"file",class:"d-none",accept:e(z),onChange:K},null,40,Ft),e(p)?(a(),u("p",Ot,d(n.$t("components.detection_interface.only_one_audio_allowed")),1)):y("",!0),e(D)?(a(),u("p",{key:1,class:X(["text-red text-sm",{"mt-2":e(p)}])},d(n.$t("components.detection_interface.audio_required")),3)):y("",!0),e(b)?(a(),u("p",{key:2,class:X(["text-red text-sm",{"mt-2":e(p)||e(D)}])},d(n.$t("components.detection_interface.file_size_error")),3)):y("",!0)])]))],32),s("div",Ut,[s("div",Jt,d(n.$t("components.detection_interface.interface_config")),1),e(S)&&Object.keys(e(S)).length?y("",!0):(a(),u("div",Rt,d(n.$t("components.detection_interface.no_interface_config")),1)),f(o,{config:e(S),"ui-schema":e(M),loading:e(R),"save-button-label":n.$t("components.detection_interface.detect_audio"),"disable-button":e(_),"save-button-color":"#df2a4c","show-button":"",onOnFormSubmit:q},null,8,["config","ui-schema","loading","save-button-label","disable-button"])])])}}}),Ht=ke(qt,[["__scopeId","data-v-c1c7820f"]]),Yt={class:"w-full"},Xt={key:0,class:"w-full"},Gt={class:"flex flex-col justify-center items-center mb-5"},Kt={for:"restoreInput",class:"cursor-pointer text-center text-sm"},Wt=["accept"],Zt={key:0,class:"text-red text-sm"},en={key:1,class:"w-full flex flex-col items-center justify-center"},tn={class:"relative mb-4"},nn=["src"],on={class:"flex items-center justify-center"},sn={class:"mx-2"},ln={class:"disabled-text"},an={class:"mt-10"},rn={class:"box-title w-full mb-3"},un={key:0,class:"flex items-center justify-center text-sm text-passive mt-5"},cn={class:"relative"},dn=["src"],fn=$e({__name:"VObjectDetectionInterface",props:{pluginName:{}},setup(ne){const O=new Ie,C=ne,{pluginName:T}=Ee(C),i=l([]),x=l(!1),p=l(!1),D=l(!1),b=l(!1),$=l(null),I=l(Je.join(",")),z=l(""),F=l({}),S=l(!1),h=l(),V=l([]),_=l(!1),E=l(!0),{mutateAsync:A,isPending:M}=O.detectObjectsQuery(),{data:G,isLoading:R}=O.getPluginInterfaceQuery(T.value,{type:"objectDetection"}),w=H(()=>M.value||R.value||S.value),j=t=>{const o=i.value.findIndex(m=>m.name===t);o>-1&&(i.value.splice(o,1),Z(),z.value="",h.value=void 0)},K=t=>{if(x.value=!1,p.value=!1,b.value=!1,i.value=[],t.dataTransfer)if(t.dataTransfer.files.length>1)p.value=!0;else{const o=t.dataTransfer.files[0];Je.includes(o.type)&&o.size<=je?(i.value.push(o),te(()=>{k(o)})):o.size>je?b.value=!0:p.value=!0}},W=t=>{var m;p.value=!1,b.value=!1,i.value=[];const o=t.target;if(o&&o.files){if(((m=o.files)==null?void 0:m.length)>1)p.value=!0;else if(o.files.length===1){const L=o.files[0];L.size<=je?(i.value.push(L),te(()=>{k(L)})):b.value=!0}}},Z=()=>{$.value&&($.value.value="")},k=t=>{S.value=!0;const o=new Image;o.src=URL.createObjectURL(t),o.onload=()=>{z.value=o.src,h.value={width:o.width,height:o.height},S.value=!1}},q=t=>t<1024?t+" bytes":t<1048576?(t/1024).toFixed(1)+" KB":(t/1048576).toFixed(1)+" MB",n=async t=>{if(!i.value.length){D.value=!0;return}S.value=!0;const o=new FormData;o.append("upload",i.value[0]),o.append("config",JSON.stringify(t)),o.append("metadata",JSON.stringify(h.value));try{const m=await A({pluginName:T.value,formData:o});_.value=!0,setTimeout(()=>{V.value=m},300)}catch(m){console.error("Error detecting objects",m)}finally{S.value=!1}};return Y(i,t=>{t.length>0?(D.value=!1,E.value=!1):(z.value="",h.value=void 0,E.value=!0)},{immediate:!0,deep:!0}),(t,o)=>{const m=we,L=lt,Ce=Ye;return a(),u("div",Yt,[s("div",{class:"file-upload-box p-4",onDrop:o[1]||(o[1]=P(U=>K(U),["prevent"])),onDragover:o[2]||(o[2]=P(U=>x.value=!0,["prevent"])),onDragenter:o[3]||(o[3]=P(U=>x.value=!0,["prevent"])),onDragleave:o[4]||(o[4]=P(U=>x.value=!1,["prevent"]))},[e(i).length?(a(),u("div",en,[s("div",tn,[s("img",{src:e(z),alt:"Preview",class:"w-full"},null,8,nn)]),s("div",on,[f(me,{size:"28",variant:"text",color:"red",rounded:"",onClick:o[0]||(o[0]=P(U=>j(e(i)[0].name),["stop"]))},{default:g(()=>[f(le,{size:"20"},{default:g(()=>[J(d(e(Fe)),1)]),_:1})]),_:1}),s("b",sn,d(e(i)[0].name),1),s("span",ln,"("+d(q(e(i)[0].size))+")",1)])])):(a(),u("div",Xt,[s("div",Gt,[s("label",Kt,d(t.$t("components.detection_interface.drop_or_select_image_to_detect_objects")),1),s("input",{id:"restoreInput",ref_key:"fileInput",ref:$,type:"file",class:"d-none",accept:e(I),onChange:W},null,40,Wt),e(p)?(a(),u("p",Zt,d(t.$t("components.detection_interface.only_one_image_allowed")),1)):y("",!0),e(D)?(a(),u("p",{key:1,class:X(["text-red text-sm",{"mt-2":e(p)}])},d(t.$t("components.detection_interface.image_required")),3)):y("",!0),e(b)?(a(),u("p",{key:2,class:X(["text-red text-sm",{"mt-2":e(p)||e(D)}])},d(t.$t("components.detection_interface.file_size_error")),3)):y("",!0)])]))],32),s("div",an,[s("div",rn,d(t.$t("components.detection_interface.interface_config")),1),e(F)&&Object.keys(e(F)).length?y("",!0):(a(),u("div",un,d(t.$t("components.detection_interface.no_interface_config")),1)),f(m,{config:e(F),"ui-schema":e(G),loading:e(w),"save-button-label":t.$t("components.detection_interface.detect_objects"),"disable-button":e(E),"save-button-color":"#df2a4c","show-button":"",onOnFormSubmit:n},null,8,["config","ui-schema","loading","save-button-label","disable-button"])]),f(Ce,{modelValue:e(_),"onUpdate:modelValue":o[5]||(o[5]=U=>fe(_)?_.value=U:null),title:t.$t("components.dialog.title.result"),"hide-confirm-button":"",width:"auto"},{content:g(()=>[s("div",cn,[f(L,{detections:e(V)},null,8,["detections"]),s("img",{src:e(z),alt:"Preview",class:"w-full"},null,8,dn)])]),_:1},8,["modelValue","title"])])}}}),mn=ke(fn,[["__scopeId","data-v-453d8b3d"]]),pn={class:"w-full"},vn={key:0,class:"w-full"},gn={class:"flex flex-col justify-center items-center mb-5"},_n={for:"restoreInput",class:"cursor-pointer text-center text-sm"},hn=["accept"],yn={key:0,class:"text-red text-sm"},bn={key:1,class:"w-full flex flex-col items-center justify-center"},xn={class:"relative mb-4 w-full"},wn={class:"flex items-center justify-center"},$n={class:"mx-2"},In={class:"disabled-text"},kn={class:"mt-10"},Cn={class:"box-title w-full mb-3"},Sn={key:0,class:"flex items-center justify-center text-sm text-passive mt-5"},Pn={class:"relative"},Dn=$e({__name:"VMotionDetectionInterface",props:{pluginName:{}},setup(ne){const O=new Ie,C=ne,{pluginName:T}=Ee(C),i=l([]),x=l(!1),p=l(!1),D=l(!1),b=l(!1),$=l(null),I=l(null),z=l(null),F=l(Re.join(",")),S=l({}),h=l(!1),V=l(!1),_=l(!0),{mutateAsync:E,isPending:A}=O.detectMotionQuery(),{data:M,isLoading:G}=O.getPluginInterfaceQuery(T.value,{type:"motionDetection"}),R=H(()=>A.value||G.value||h.value),w=n=>{const t=i.value.findIndex(o=>o.name===n);t>-1&&(i.value.splice(t,1),W(),I.value.src="")},j=n=>{if(x.value=!1,p.value=!1,b.value=!1,i.value=[],n.dataTransfer)if(n.dataTransfer.files.length>1)p.value=!0;else{const t=n.dataTransfer.files[0];Re.includes(t.type)&&t.size<=Le?(i.value.push(t),te(()=>{k(t)})):t.size>Le?b.value=!0:p.value=!0}},K=n=>{var o;p.value=!1,b.value=!1,i.value=[];const t=n.target;if(t&&t.files){if(((o=t.files)==null?void 0:o.length)>1)p.value=!0;else if(t.files.length===1){const m=t.files[0];m.size<=Le?(i.value.push(m),te(()=>{k(m)})):b.value=!0}}},W=()=>{$.value&&($.value.value="")},Z=n=>n<1024?n+" bytes":n<1048576?(n/1024).toFixed(1)+" KB":(n/1048576).toFixed(1)+" MB",k=n=>{h.value=!0,I.value.src=URL.createObjectURL(n),I.value.load(),I.value.onloadeddata=()=>{h.value=!1}},q=async n=>{if(!i.value.length){D.value=!0;return}h.value=!0;const t=new FormData;t.append("upload",i.value[0]),t.append("config",JSON.stringify(n));try{const o=await E({pluginName:T.value,formData:t}),m=new Blob([o],{type:"video/mp4"});V.value=!0,setTimeout(()=>{z.value&&(z.value.src=URL.createObjectURL(m),z.value.load())},300)}catch(o){console.error("Error detecting motion",o)}finally{h.value=!1}};return Y(i,n=>{n.length>0?(D.value=!1,_.value=!1):_.value=!0},{immediate:!0,deep:!0}),(n,t)=>{const o=we,m=Ye;return a(),u("div",pn,[s("div",{class:"file-upload-box p-4",onDrop:t[1]||(t[1]=P(L=>j(L),["prevent"])),onDragover:t[2]||(t[2]=P(L=>x.value=!0,["prevent"])),onDragenter:t[3]||(t[3]=P(L=>x.value=!0,["prevent"])),onDragleave:t[4]||(t[4]=P(L=>x.value=!1,["prevent"]))},[e(i).length?(a(),u("div",bn,[s("div",xn,[s("video",{ref_key:"videoPlayer",ref:I,controls:"",class:"w-full"},"Your browser does not support the video tag.",512)]),s("div",wn,[f(me,{size:"28",variant:"text",color:"red",rounded:"",onClick:t[0]||(t[0]=P(L=>w(e(i)[0].name),["stop"]))},{default:g(()=>[f(le,{size:"20"},{default:g(()=>[J(d(e(Fe)),1)]),_:1})]),_:1}),s("b",$n,d(e(i)[0].name),1),s("span",In,"("+d(Z(e(i)[0].size))+")",1)])])):(a(),u("div",vn,[s("div",gn,[s("label",_n,d(n.$t("components.detection_interface.drop_or_select_video_to_detect_motion")),1),s("input",{id:"restoreInput",ref_key:"fileInput",ref:$,type:"file",class:"d-none",accept:e(F),onChange:K},null,40,hn),e(p)?(a(),u("p",yn,d(n.$t("components.detection_interface.only_one_video_allowed")),1)):y("",!0),e(D)?(a(),u("p",{key:1,class:X(["text-red text-sm",{"mt-2":e(p)}])},d(n.$t("components.detection_interface.video_required")),3)):y("",!0),e(b)?(a(),u("p",{key:2,class:X(["text-red text-sm",{"mt-2":e(p)||e(D)}])},d(n.$t("components.detection_interface.file_size_error")),3)):y("",!0)])]))],32),s("div",kn,[s("div",Cn,d(n.$t("components.detection_interface.interface_config")),1),e(S)&&Object.keys(e(S)).length?y("",!0):(a(),u("div",Sn,d(n.$t("components.detection_interface.no_interface_config")),1)),f(o,{config:e(S),"ui-schema":e(M),loading:e(R),"save-button-label":n.$t("components.detection_interface.detect_motion"),"disable-button":e(_),"save-button-color":"#df2a4c","show-button":"",onOnFormSubmit:q},null,8,["config","ui-schema","loading","save-button-label","disable-button"])]),f(m,{modelValue:e(V),"onUpdate:modelValue":t[5]||(t[5]=L=>fe(V)?V.value=L:null),title:n.$t("components.dialog.title.result"),"hide-confirm-button":"",width:"auto"},{content:g(()=>[s("div",Pn,[s("video",{ref_key:"videoPlayerResult",ref:z,controls:"",class:"w-full"},"Your browser does not support the video tag.",512)])]),_:1},8,["modelValue","title"])])}}}),Vn=ke(Dn,[["__scopeId","data-v-b825f442"]]),jn={key:0,class:"flex items-center justify-center w-full h-full"},Ln={key:1,class:"h-full w-full"},zn={class:"page-title"},En={class:"flex flex-col flex-1 inner-component mt-0 p-4"},Fn={class:"box-title w-full mb-3"},On={key:0,class:"w-full h-full flex items-center justify-center"},Tn={key:1},An={class:"options-segments flex items-center justify-between"},Nn={class:"flex flex-col items-center justify-center"},Qn={class:"options-segments-text mt-2"},Bn={key:1},Mn={key:2},Un={key:3},Jn={key:4},Rn={class:"w-full full-inner-height"},qn={class:"flex flex-col md:flex-row gap-2 h-full"},Hn={class:"flex flex-col flex-1",style:{height:"200px","max-height":"200px"}},Yn={key:0,class:"w-full h-full flex items-center justify-center inner-component mt-0"},Xn={class:"flex flex-col flex-1 inner-component mt-0 p-4"},Gn={class:"box-title w-full mb-3"},Kn={key:0,class:"w-full h-full flex items-center justify-center"},Wn=["innerHTML"],Zn={class:"flex flex-col flex-1 inner-component mt-0 p-4"},eo={class:"box-title w-full mb-3"},to={key:0,class:"w-full h-full flex items-center justify-center"},no=["innerHTML"],oo=["data-ignore-id"],so=$e({__name:"Plugin",setup(ne){se.registerLanguage("typescript",It),se.registerLanguage("yaml",kt),se.registerLanguage("json",Ct),se.registerLanguage("python",St);const O=new at,C=new Ie,T=mt(),i=Dt(),{mobileActive:x,smallMobileActive:p}=pt(),D=l(vt()),b=l(),$=l(!1),I=l([]),z=l(!1),F=l(i.params.scope),S=l(i.params.pluginname),h=l(),V=l([]),_=l({name:"settings",icon:ce,isInterface:!1}),E=l(!1),A=l(),M=l(),[G,R]=Vt(),w=H(()=>F.value?`${F.value}/${S.value}`:S.value);C.toggleQueryActivator("getPluginContractQuery",!1);const{data:j,isLoading:K}=C.getPluginQuery(w),{data:W,isLoading:Z}=C.getPluginConfigJsonQuery(w),{data:k,isLoading:q}=C.getPluginSchemaQuery(w),{data:n}=C.getPluginContractQuery(w),{data:t,isLoading:o}=C.getPluginReadmeQuery(w),{data:m,isLoading:L}=C.getPluginChangelogQuery(w),{mutateAsync:Ce,isPending:U}=C.actionButtonQuery(),{mutate:Xe,isPending:Ge}=C.patchPluginConfigQuery(),{mutate:Ke,isPending:We}=O.addCameraExtensionQuery(),{mutate:Ze,isPending:et}=O.removeCameraExtensionQuery(),Oe=H(()=>!!(K.value||Z.value||q.value||o.value||L.value)),pe=H(()=>!!(We.value||et.value)),ae=H(()=>!!($.value||U.value||Ge.value)),ve=H(()=>{var r,c,N;return!!(k.value||(r=n.value)!=null&&r.cameras.length||(c=n.value)!=null&&c.contract.extension||(N=n.value)!=null&&N.contract.supportAdditionalCameras)}),Se=Pt("commonmark",{highlight(r,c){if(c&&se.getLanguage(c))try{return'<pre><code class="hljs">'+se.highlight(r,{language:c,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+Se.utils.escapeHtml(r)+"</code></pre>"}});Y(()=>i.params.pluginname,()=>{S.value=i.params.pluginname},{deep:!0,immediate:!0}),Y(h,r=>{te(()=>z.value=!!r)}),Y(k,()=>{q.value?C.toggleQueryActivator("getPluginContractQuery",!1):C.toggleQueryActivator("getPluginContractQuery",!0)},{deep:!0,immediate:!0}),Y(n,()=>{var ge,_e,he,ye,be,xe,ie,re,ue,v;const r=[];let c=!1,N=!1;((ge=n.value)==null?void 0:ge.contract.extension)==="motionDetection"&&(N=!0,r.push({name:"motion_detection",icon:oe,isInterface:!0}),_.value={name:"motion_detection",icon:oe,isInterface:!0}),((_e=n.value)==null?void 0:_e.contract.extension)==="objectDetection"&&(N=!0,r.push({name:"object_detection",icon:oe,isInterface:!0}),_.value={name:"object_detection",icon:oe,isInterface:!0}),((he=n.value)==null?void 0:he.contract.extension)==="audioDetection"&&(N=!0,r.push({name:"audio_detection",icon:oe,isInterface:!0}),_.value={name:"audio_detection",icon:oe,isInterface:!0}),k.value&&k.value.schema&&Object.keys(k.value.schema).length&&(r.push({name:"settings",icon:ce,isInterface:!1}),c=!0,N||(_.value={name:"settings",icon:ce,isInterface:!1})),((ye=n.value)!=null&&ye.cameras.length||(be=n.value)!=null&&be.contract.extension||(xe=n.value)!=null&&xe.contract.supportAdditionalCameras)&&(r.push({name:"cameras",icon:Be,isInterface:!1}),!c&&!N&&(_.value={name:"cameras",icon:Be,isInterface:!1})),V.value=r,((ie=n.value)!=null&&ie.contract.extension||(re=n.value)!=null&&re.contract.supportAdditionalCameras)&&((ue=n.value)!=null&&ue.cameras.length)&&(I.value=(v=n.value)==null?void 0:v.cameras.filter(ee=>ee.extensions.plugins.includes(w.value)).map(ee=>ee.name))},{deep:!0,immediate:!0}),Y(E,r=>{r||(A.value=void 0,M.value=void 0)});const tt=async r=>{if(!k.value)return;$.value=!0;const c=ut(k.value.schema,r);Xe({pluginName:w.value,configData:c},{onSettled:()=>{$.value=!1}})},nt=async r=>{$.value=!0,await Ce({pluginName:w.value,actionId:r.actionId,payload:r.payload},{onSuccess:c=>{c!=null&&c.toast&&ze[c.toast.type](c.toast.message),c!=null&&c.schema&&Object.keys(c.schema).length&&(M.value=r.payload,A.value=c,E.value=!0)},onSettled:()=>{$.value=!1}})},ot=async r=>{j.value&&(I.value.includes(r.name)?Ze({cameraname:r.name,pluginname:j.value.pluginName},{onSuccess:()=>{I.value=I.value.filter(c=>c!==r.name)}}):Ke({cameraname:r.name,pluginname:j.value.pluginName},{onSuccess:()=>{I.value=[...I.value,r.name]}}))};return dt(()=>{b.value=T.connectToNamespace("/plugins")}),ft(()=>{var r,c;(c=(r=b.value)==null?void 0:r.end)==null||c.call(r)}),(r,c)=>{var ie,re,ue;const N=we,ge=Vn,_e=mn,he=Ht,ye=ct,be=it,xe=rt;return a(),u("main",{class:X(["w-full h-full",{"px-0":e(p)}])},[e(Oe)?(a(),u("div",jn,[f(de,{color:"#df2a4c",indeterminate:""})])):(a(),u("div",Ln,[s("div",{class:X(["mb-3 flex w-full items-center",{"px-2":e(p)}]),style:{height:"30px"}},[s("h1",zn,d((ie=e(j))==null?void 0:ie.displayName),1)],2),f(e(G),null,{default:g(()=>[s("div",{class:"plugin-settings-box flex flex-col gap-2 h-full",style:Qe({width:e(ve)&&!e(x)?"40%":"100%"})},[s("div",En,[s("div",Fn,d(r.$t("views.plugin.plugin_settings")),1),e(j)?(a(),u("div",Tn,[s("div",An,[f(gt,{modelValue:e(_),"onUpdate:modelValue":c[0]||(c[0]=v=>fe(_)?_.value=v:null),height:"100%",grow:"","slider-color":"#df2a4c","hide-slider":e(pe)||e(ae)},{default:g(()=>[(a(!0),u(Pe,null,De(e(V),(v,ee)=>(a(),B(_t,{key:ee,value:v,disabled:e(Oe)||v.isInterface&&e(j).disabled,"min-width":"auto"},{default:g(()=>[s("div",Nn,[f(le,{size:"20"},{default:g(()=>[J(d(v.icon),1)]),_:2},1024),s("span",Qn,d(v.isInterface?r.$t("views.plugin.segment_tab_interface"):r.$t(`views.plugin.segment_tab_${v.name.toLowerCase()}`)),1)])]),_:2},1032,["value","disabled"]))),128))]),_:1},8,["modelValue","hide-slider"])]),e(pe)||e(ae)?(a(),B(ht,{key:0,height:"2",color:"#df2a4c",indeterminate:"",style:{"margin-top":"-2px"}})):y("",!0),f(yt,{modelValue:e(_),"onUpdate:modelValue":c[1]||(c[1]=v=>fe(_)?_.value=v:null),class:"box-content w-full flex-1 mt-3",continuous:""},{default:g(()=>[(a(!0),u(Pe,null,De(e(V),(v,ee)=>(a(),B($t,{key:ee,value:{name:v.name,icon:v.icon,isInterface:v.isInterface},disabled:v.isInterface&&e(j).disabled},{default:g(()=>{var Te;return[v.name==="settings"&&e(k)?(a(),B(N,{key:0,config:e(W)||{},"ui-schema":e(k),loading:e(ae),onOnFormSubmit:tt,onOnSubmit:nt},null,8,["config","ui-schema","loading"])):y("",!0),v.name==="cameras"?(a(),u("div",Bn,[(a(!0),u(Pe,null,De((Te=e(n))==null?void 0:Te.cameras,Q=>{var Ae,Ne;return a(),u("div",{key:Q.name},[!((Ae=e(n))!=null&&Ae.contract.extension)&&!((Ne=e(n))!=null&&Ne.contract.supportAdditionalCameras)?(a(),B(qe,{key:0,"select-strategy":"classic",class:"py-0",disabled:e(pe)||e(ae),"onClick:select":()=>r.$router.push(`/cameras/${Q.name}`)},{default:g(()=>[f(He,{value:Q.name,class:"px-2"},{append:g(()=>[f(me,{class:"ml-auto",size:"28",rounded:"",density:"compact",variant:"text",onClick:P(st=>h.value=Q.name,["stop"])},{default:g(()=>[f(le,{size:"18"},{default:g(()=>[J(d(e(ce)),1)]),_:1})]),_:2},1032,["onClick"])]),default:g(()=>[J(d(Q.name)+" ",1)]),_:2},1032,["value"])]),_:2},1032,["disabled","onClick:select"])):(a(),B(qe,{key:1,"select-strategy":"classic",class:"py-0",disabled:e(pe)||e(ae),"onUpdate:selected":()=>ot(Q)},{default:g(()=>[f(He,{class:"px-2",value:e(j).pluginName,active:e(I).includes(Q.name)},{prepend:g(()=>[f(bt,{start:""},{default:g(()=>[f(xt,{"model-value":e(I).includes(Q.name),color:"#df2a4c"},null,8,["model-value"])]),_:2},1024)]),append:g(()=>[f(me,{class:"ml-auto",size:"28",rounded:"",density:"compact",variant:"text",onClick:P(st=>h.value=Q.name,["stop"])},{default:g(()=>[f(le,{size:"18"},{default:g(()=>[J(d(e(ce)),1)]),_:1})]),_:2},1032,["onClick"])]),default:g(()=>[J(d(Q.name)+" ",1)]),_:2},1032,["value","active"])]),_:2},1032,["disabled","onUpdate:selected"])),f(wt,{style:{"border-color":"rgba(var(--color-rgb), 0.1)",opacity:"1"},class:"my-1"})])}),128))])):y("",!0),v.name==="motion_detection"?(a(),u("div",Mn,[f(ge,{"plugin-name":e(w)},null,8,["plugin-name"])])):y("",!0),v.name==="object_detection"?(a(),u("div",Un,[f(_e,{"plugin-name":e(w)},null,8,["plugin-name"])])):y("",!0),v.name==="audio_detection"?(a(),u("div",Jn,[f(he,{"plugin-name":e(w)},null,8,["plugin-name"])])):y("",!0)]}),_:2},1032,["value","disabled"]))),128))]),_:1},8,["modelValue"])])):(a(),u("div",On,[f(de,{color:"#df2a4c",indeterminate:""})]))])],4)]),_:1}),s("div",Rn,[s("div",qn,[s("div",{class:"w-full flex flex-col gap-2 h-full",style:Qe({width:e(ve)&&!e(x)?"60%":"100%"})},[s("div",Hn,[e(j)?(a(),B(ye,{key:1,ref:"pluginRef",plugin:e(j),"min-height":"175px",height:"100%",width:"100%","border-radius":"4px","show-toggle":"","show-settings":"","show-logo":"","show-plugin-status":"","show-logs":"","show-configs":"",truncate:!1,onIsLoading:c[2]||(c[2]=v=>$.value=v)},null,8,["plugin"])):(a(),u("div",Yn,[f(de,{color:"#df2a4c",indeterminate:""})]))]),e(ve)&&e(x)?(a(),B(e(R),{key:0})):y("",!0),s("div",Xn,[s("div",Gn,d(r.$t("views.plugin.readme")),1),e(o)?(a(),u("div",Kn,[f(de,{color:"#df2a4c",indeterminate:""})])):(a(),u("div",{key:1,class:"box-content w-full h-full flex-1 markdown-body pt-1",innerHTML:e(Se).render(e(t)||r.$t("views.plugin.no_readme"))},null,8,Wn))]),s("div",Zn,[s("div",eo,d(r.$t("views.plugin.changelog")),1),e(L)?(a(),u("div",to,[f(de,{color:"#df2a4c",indeterminate:""})])):(a(),u("div",{key:1,class:"box-content w-full h-full flex-1 markdown-body pt-1",innerHTML:e(Se).render(e(m)||r.$t("views.plugin.no_changelog"))},null,8,no))])],4),e(ve)&&!e(x)?(a(),B(e(R),{key:0})):y("",!0)])])])),e(h)?(a(),u("div",{key:2,"data-ignore-id":e(D)},[f(be,{"camera-name":e(h),show:e(z),onClose:c[3]||(c[3]=v=>h.value=void 0)},null,8,["camera-name","show"])],8,oo)):y("",!0),(ue=(re=e(A))==null?void 0:re.schema)!=null&&ue.config?(a(),B(xe,{key:3,modelValue:e(E),"onUpdate:modelValue":c[4]||(c[4]=v=>fe(E)?E.value=v:null),"ui-schema":{schema:e(A).schema},"plugin-config":e(M)||{},"plugin-name":e(w)},null,8,["modelValue","ui-schema","plugin-config","plugin-name"])):y("",!0)],2)}}}),ts=ke(so,[["__scopeId","data-v-5201d26c"]]);export{ts as default};
1
+ import{a as we,b as lt,C as at,d as it,e as rt,g as ut}from"./VPlayer-B53-f3Ad.js";import{_ as ct}from"./VPluginCard-Cl6Zw1Dg.js";import{F as $e,t as Ee,r as l,c as H,w as Y,e as a,f as u,j as s,u as e,T as d,l as y,n as G,V as J,M as f,R as g,q as P,y as te,i as fe,a3 as dt,U as ft,X as Qe,O as B,N as Pe,Q as De}from"./@vue-CIFymae3.js";import{Y as Fe,k as ce,i as oe,c as Be}from"./@mdi-jq8isxax.js";import{i as ze}from"./vue3-toastify-Cy6dUyKO.js";import{P as Ie}from"./plugins-Cs7BJHj-.js";import{A as Me,M as Ve,i as Ue,d as ke,C as Je,D as je,w as Ye,E as Re,F as Le,z as mt,f as pt,G as vt}from"./main-C2N2tbw_.js";import{e as le,b as me,V as de,U as gt,W as _t,C as ht,w as yt,G as qe,f as He,I as bt,J as xt,n as wt,x as $t}from"./vuetify-B_vGZaGi.js";import{H as se,t as It,y as kt,j as Ct,p as St}from"./highlight.js-fBaokXp-.js";import{M as Pt}from"./markdown-it-DI8MEbma.js";import{u as Dt}from"./vue-router-C55prZ5l.js";import{x as Vt}from"./@vueuse-DbPVvJxZ.js";import"./qrcode-SHonoxyK.js";import"./dijkstrajs-D_NXgYpA.js";import"./vee-validate-DHjm38DY.js";import"./zod-BaF2dDCd.js";import"./pinia-B_gX_pHL.js";import"./@vee-validate-CmTVjJBY.js";import"./draggabilly-YEGzHR3_.js";import"./@xterm-LO7TPXYg.js";import"./get-size-D1dS-IaP.js";import"./unidragger-91TYirAP.js";import"./ev-emitter-t78oQA8k.js";import"./@tanstack-DPd4-F0t.js";import"./VConfigEditor.vue_vue_type_script_setup_true_lang-DDxLGgGL.js";import"./ace-builds-Jtyk_kwI.js";import"./@vueform-B8BH3_sM.js";import"./system-C1OmXhti.js";import"./VConsole-D85lNxwk.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./mdurl-k9Sl0PQj.js";import"./uc.micro-kMc2yuuw.js";import"./entities-C20TfXL6.js";import"./linkify-it-DmNjr4Kv.js";import"./punycode.js-Dj65hjkv.js";const jt={class:"w-full"},Lt={key:0,class:"w-full"},zt={class:"flex flex-col justify-center items-center mb-5"},Et={for:"restoreInput",class:"cursor-pointer text-center text-sm"},Ft=["accept"],Ot={key:0,class:"text-red text-sm"},Tt={key:1,class:"w-full flex flex-col items-center justify-center"},At={class:"relative mb-4 w-full"},Nt=["src","type"],Qt={class:"flex items-center justify-center"},Bt={class:"mx-2"},Mt={class:"disabled-text"},Ut={class:"mt-10"},Jt={class:"box-title w-full mb-3"},Rt={key:0,class:"flex items-center justify-center text-sm text-passive mt-5"},qt=$e({__name:"VAudioDetectionInterface",props:{pluginName:{}},setup(ne){const O=new Ie,C=ne,{pluginName:T}=Ee(C),i=l([]),x=l(!1),p=l(!1),D=l(!1),b=l(!1),$=l(null),I=l(null),z=l(Me.join(",")),F=l(""),S=l({}),h=l(!1),V=l(),_=l(!0),{mutateAsync:E,isPending:A}=O.detectAudioQuery(),{data:M,isLoading:X}=O.getPluginInterfaceQuery(T.value,{type:"audioDetection"}),R=H(()=>A.value||X.value||h.value),w=n=>{const t=i.value.findIndex(o=>o.name===n);t>-1&&(i.value.splice(t,1),W(),F.value="",V.value=void 0)},j=n=>{if(x.value=!1,p.value=!1,b.value=!1,i.value=[],n.dataTransfer)if(n.dataTransfer.files.length>1)p.value=!0;else{const t=n.dataTransfer.files[0];Me.includes(t.type)&&t.size<=Ve?(i.value.push(t),te(()=>{k(t)})):t.size>Ve?b.value=!0:p.value=!0}},K=n=>{var o;p.value=!1,b.value=!1,i.value=[];const t=n.target;if(t&&t.files){if(((o=t.files)==null?void 0:o.length)>1)p.value=!0;else if(t.files.length===1){const m=t.files[0];m.size<=Ve?(i.value.push(m),te(()=>{k(m)})):b.value=!0}}},W=()=>{$.value&&($.value.value="")},Z=n=>n<1024?n+" bytes":n<1048576?(n/1024).toFixed(1)+" KB":(n/1048576).toFixed(1)+" MB",k=n=>{h.value=!0;const t=new Audio;t.src=URL.createObjectURL(n),t.onloadedmetadata=()=>{V.value={mimeType:n.type},h.value=!1}},q=async n=>{if(!i.value.length){D.value=!0;return}h.value=!0;const t=new FormData;t.append("upload",i.value[0]),t.append("config",JSON.stringify(n)),t.append("metadata",JSON.stringify(V.value));try{await E({pluginName:T.value,formData:t})?ze.info(Ue.global.t("components.detection_interface.audio_detected")):ze.info(Ue.global.t("components.detection_interface.audio_not_detected"))}catch(o){console.error("Error detecting audio",o)}finally{h.value=!1}};return Y(i,n=>{n.length>0?(D.value=!1,_.value=!1):(F.value="",V.value=void 0,_.value=!0)},{immediate:!0,deep:!0}),(n,t)=>{const o=we;return a(),u("div",jt,[s("div",{class:"file-upload-box p-4",onDrop:t[1]||(t[1]=P(m=>j(m),["prevent"])),onDragover:t[2]||(t[2]=P(m=>x.value=!0,["prevent"])),onDragenter:t[3]||(t[3]=P(m=>x.value=!0,["prevent"])),onDragleave:t[4]||(t[4]=P(m=>x.value=!1,["prevent"]))},[e(i).length?(a(),u("div",Tt,[s("div",At,[s("audio",{ref_key:"audioPlayer",ref:I,controls:"",class:"w-full"},[s("source",{src:e(F),type:e(i)[0].type},null,8,Nt),J(" Your browser does not support the audio element. ")],512)]),s("div",Qt,[f(me,{size:"28",variant:"text",color:"red",rounded:"",onClick:t[0]||(t[0]=P(m=>w(e(i)[0].name),["stop"]))},{default:g(()=>[f(le,{size:"20"},{default:g(()=>[J(d(e(Fe)),1)]),_:1})]),_:1}),s("b",Bt,d(e(i)[0].name),1),s("span",Mt,"("+d(Z(e(i)[0].size))+")",1)])])):(a(),u("div",Lt,[s("div",zt,[s("label",Et,d(n.$t("components.detection_interface.drop_or_select_audio_to_detect")),1),s("input",{id:"restoreInput",ref_key:"fileInput",ref:$,type:"file",class:"d-none",accept:e(z),onChange:K},null,40,Ft),e(p)?(a(),u("p",Ot,d(n.$t("components.detection_interface.only_one_audio_allowed")),1)):y("",!0),e(D)?(a(),u("p",{key:1,class:G(["text-red text-sm",{"mt-2":e(p)}])},d(n.$t("components.detection_interface.audio_required")),3)):y("",!0),e(b)?(a(),u("p",{key:2,class:G(["text-red text-sm",{"mt-2":e(p)||e(D)}])},d(n.$t("components.detection_interface.file_size_error")),3)):y("",!0)])]))],32),s("div",Ut,[s("div",Jt,d(n.$t("components.detection_interface.interface_config")),1),e(S)&&Object.keys(e(S)).length?y("",!0):(a(),u("div",Rt,d(n.$t("components.detection_interface.no_interface_config")),1)),f(o,{config:e(S),"ui-schema":e(M),loading:e(R),"save-button-label":n.$t("components.detection_interface.detect_audio"),"disable-button":e(_),"save-button-color":"#df2a4c","show-button":"",onOnFormSubmit:q},null,8,["config","ui-schema","loading","save-button-label","disable-button"])])])}}}),Ht=ke(qt,[["__scopeId","data-v-c1c7820f"]]),Yt={class:"w-full"},Gt={key:0,class:"w-full"},Xt={class:"flex flex-col justify-center items-center mb-5"},Kt={for:"restoreInput",class:"cursor-pointer text-center text-sm"},Wt=["accept"],Zt={key:0,class:"text-red text-sm"},en={key:1,class:"w-full flex flex-col items-center justify-center"},tn={class:"relative mb-4"},nn=["src"],on={class:"flex items-center justify-center"},sn={class:"mx-2"},ln={class:"disabled-text"},an={class:"mt-10"},rn={class:"box-title w-full mb-3"},un={key:0,class:"flex items-center justify-center text-sm text-passive mt-5"},cn={class:"relative"},dn=["src"],fn=$e({__name:"VObjectDetectionInterface",props:{pluginName:{}},setup(ne){const O=new Ie,C=ne,{pluginName:T}=Ee(C),i=l([]),x=l(!1),p=l(!1),D=l(!1),b=l(!1),$=l(null),I=l(Je.join(",")),z=l(""),F=l({}),S=l(!1),h=l(),V=l([]),_=l(!1),E=l(!0),{mutateAsync:A,isPending:M}=O.detectObjectsQuery(),{data:X,isLoading:R}=O.getPluginInterfaceQuery(T.value,{type:"objectDetection"}),w=H(()=>M.value||R.value||S.value),j=t=>{const o=i.value.findIndex(m=>m.name===t);o>-1&&(i.value.splice(o,1),Z(),z.value="",h.value=void 0)},K=t=>{if(x.value=!1,p.value=!1,b.value=!1,i.value=[],t.dataTransfer)if(t.dataTransfer.files.length>1)p.value=!0;else{const o=t.dataTransfer.files[0];Je.includes(o.type)&&o.size<=je?(i.value.push(o),te(()=>{k(o)})):o.size>je?b.value=!0:p.value=!0}},W=t=>{var m;p.value=!1,b.value=!1,i.value=[];const o=t.target;if(o&&o.files){if(((m=o.files)==null?void 0:m.length)>1)p.value=!0;else if(o.files.length===1){const L=o.files[0];L.size<=je?(i.value.push(L),te(()=>{k(L)})):b.value=!0}}},Z=()=>{$.value&&($.value.value="")},k=t=>{S.value=!0;const o=new Image;o.src=URL.createObjectURL(t),o.onload=()=>{z.value=o.src,h.value={width:o.width,height:o.height},S.value=!1}},q=t=>t<1024?t+" bytes":t<1048576?(t/1024).toFixed(1)+" KB":(t/1048576).toFixed(1)+" MB",n=async t=>{if(!i.value.length){D.value=!0;return}S.value=!0;const o=new FormData;o.append("upload",i.value[0]),o.append("config",JSON.stringify(t)),o.append("metadata",JSON.stringify(h.value));try{const m=await A({pluginName:T.value,formData:o});_.value=!0,setTimeout(()=>{V.value=m},300)}catch(m){console.error("Error detecting objects",m)}finally{S.value=!1}};return Y(i,t=>{t.length>0?(D.value=!1,E.value=!1):(z.value="",h.value=void 0,E.value=!0)},{immediate:!0,deep:!0}),(t,o)=>{const m=we,L=lt,Ce=Ye;return a(),u("div",Yt,[s("div",{class:"file-upload-box p-4",onDrop:o[1]||(o[1]=P(U=>K(U),["prevent"])),onDragover:o[2]||(o[2]=P(U=>x.value=!0,["prevent"])),onDragenter:o[3]||(o[3]=P(U=>x.value=!0,["prevent"])),onDragleave:o[4]||(o[4]=P(U=>x.value=!1,["prevent"]))},[e(i).length?(a(),u("div",en,[s("div",tn,[s("img",{src:e(z),alt:"Preview",class:"w-full"},null,8,nn)]),s("div",on,[f(me,{size:"28",variant:"text",color:"red",rounded:"",onClick:o[0]||(o[0]=P(U=>j(e(i)[0].name),["stop"]))},{default:g(()=>[f(le,{size:"20"},{default:g(()=>[J(d(e(Fe)),1)]),_:1})]),_:1}),s("b",sn,d(e(i)[0].name),1),s("span",ln,"("+d(q(e(i)[0].size))+")",1)])])):(a(),u("div",Gt,[s("div",Xt,[s("label",Kt,d(t.$t("components.detection_interface.drop_or_select_image_to_detect_objects")),1),s("input",{id:"restoreInput",ref_key:"fileInput",ref:$,type:"file",class:"d-none",accept:e(I),onChange:W},null,40,Wt),e(p)?(a(),u("p",Zt,d(t.$t("components.detection_interface.only_one_image_allowed")),1)):y("",!0),e(D)?(a(),u("p",{key:1,class:G(["text-red text-sm",{"mt-2":e(p)}])},d(t.$t("components.detection_interface.image_required")),3)):y("",!0),e(b)?(a(),u("p",{key:2,class:G(["text-red text-sm",{"mt-2":e(p)||e(D)}])},d(t.$t("components.detection_interface.file_size_error")),3)):y("",!0)])]))],32),s("div",an,[s("div",rn,d(t.$t("components.detection_interface.interface_config")),1),e(F)&&Object.keys(e(F)).length?y("",!0):(a(),u("div",un,d(t.$t("components.detection_interface.no_interface_config")),1)),f(m,{config:e(F),"ui-schema":e(X),loading:e(w),"save-button-label":t.$t("components.detection_interface.detect_objects"),"disable-button":e(E),"save-button-color":"#df2a4c","show-button":"",onOnFormSubmit:n},null,8,["config","ui-schema","loading","save-button-label","disable-button"])]),f(Ce,{modelValue:e(_),"onUpdate:modelValue":o[5]||(o[5]=U=>fe(_)?_.value=U:null),title:t.$t("components.dialog.title.result"),"hide-confirm-button":"",width:"auto"},{content:g(()=>[s("div",cn,[f(L,{detections:e(V)},null,8,["detections"]),s("img",{src:e(z),alt:"Preview",class:"w-full"},null,8,dn)])]),_:1},8,["modelValue","title"])])}}}),mn=ke(fn,[["__scopeId","data-v-453d8b3d"]]),pn={class:"w-full"},vn={key:0,class:"w-full"},gn={class:"flex flex-col justify-center items-center mb-5"},_n={for:"restoreInput",class:"cursor-pointer text-center text-sm"},hn=["accept"],yn={key:0,class:"text-red text-sm"},bn={key:1,class:"w-full flex flex-col items-center justify-center"},xn={class:"relative mb-4 w-full"},wn={class:"flex items-center justify-center"},$n={class:"mx-2"},In={class:"disabled-text"},kn={class:"mt-10"},Cn={class:"box-title w-full mb-3"},Sn={key:0,class:"flex items-center justify-center text-sm text-passive mt-5"},Pn={class:"relative"},Dn=$e({__name:"VMotionDetectionInterface",props:{pluginName:{}},setup(ne){const O=new Ie,C=ne,{pluginName:T}=Ee(C),i=l([]),x=l(!1),p=l(!1),D=l(!1),b=l(!1),$=l(null),I=l(null),z=l(null),F=l(Re.join(",")),S=l({}),h=l(!1),V=l(!1),_=l(!0),{mutateAsync:E,isPending:A}=O.detectMotionQuery(),{data:M,isLoading:X}=O.getPluginInterfaceQuery(T.value,{type:"motionDetection"}),R=H(()=>A.value||X.value||h.value),w=n=>{const t=i.value.findIndex(o=>o.name===n);t>-1&&(i.value.splice(t,1),W(),I.value.src="")},j=n=>{if(x.value=!1,p.value=!1,b.value=!1,i.value=[],n.dataTransfer)if(n.dataTransfer.files.length>1)p.value=!0;else{const t=n.dataTransfer.files[0];Re.includes(t.type)&&t.size<=Le?(i.value.push(t),te(()=>{k(t)})):t.size>Le?b.value=!0:p.value=!0}},K=n=>{var o;p.value=!1,b.value=!1,i.value=[];const t=n.target;if(t&&t.files){if(((o=t.files)==null?void 0:o.length)>1)p.value=!0;else if(t.files.length===1){const m=t.files[0];m.size<=Le?(i.value.push(m),te(()=>{k(m)})):b.value=!0}}},W=()=>{$.value&&($.value.value="")},Z=n=>n<1024?n+" bytes":n<1048576?(n/1024).toFixed(1)+" KB":(n/1048576).toFixed(1)+" MB",k=n=>{h.value=!0,I.value.src=URL.createObjectURL(n),I.value.load(),I.value.onloadeddata=()=>{h.value=!1}},q=async n=>{if(!i.value.length){D.value=!0;return}h.value=!0;const t=new FormData;t.append("upload",i.value[0]),t.append("config",JSON.stringify(n));try{const o=await E({pluginName:T.value,formData:t}),m=new Blob([o],{type:"video/mp4"});V.value=!0,setTimeout(()=>{z.value&&(z.value.src=URL.createObjectURL(m),z.value.load())},300)}catch(o){console.error("Error detecting motion",o)}finally{h.value=!1}};return Y(i,n=>{n.length>0?(D.value=!1,_.value=!1):_.value=!0},{immediate:!0,deep:!0}),(n,t)=>{const o=we,m=Ye;return a(),u("div",pn,[s("div",{class:"file-upload-box p-4",onDrop:t[1]||(t[1]=P(L=>j(L),["prevent"])),onDragover:t[2]||(t[2]=P(L=>x.value=!0,["prevent"])),onDragenter:t[3]||(t[3]=P(L=>x.value=!0,["prevent"])),onDragleave:t[4]||(t[4]=P(L=>x.value=!1,["prevent"]))},[e(i).length?(a(),u("div",bn,[s("div",xn,[s("video",{ref_key:"videoPlayer",ref:I,controls:"",class:"w-full"},"Your browser does not support the video tag.",512)]),s("div",wn,[f(me,{size:"28",variant:"text",color:"red",rounded:"",onClick:t[0]||(t[0]=P(L=>w(e(i)[0].name),["stop"]))},{default:g(()=>[f(le,{size:"20"},{default:g(()=>[J(d(e(Fe)),1)]),_:1})]),_:1}),s("b",$n,d(e(i)[0].name),1),s("span",In,"("+d(Z(e(i)[0].size))+")",1)])])):(a(),u("div",vn,[s("div",gn,[s("label",_n,d(n.$t("components.detection_interface.drop_or_select_video_to_detect_motion")),1),s("input",{id:"restoreInput",ref_key:"fileInput",ref:$,type:"file",class:"d-none",accept:e(F),onChange:K},null,40,hn),e(p)?(a(),u("p",yn,d(n.$t("components.detection_interface.only_one_video_allowed")),1)):y("",!0),e(D)?(a(),u("p",{key:1,class:G(["text-red text-sm",{"mt-2":e(p)}])},d(n.$t("components.detection_interface.video_required")),3)):y("",!0),e(b)?(a(),u("p",{key:2,class:G(["text-red text-sm",{"mt-2":e(p)||e(D)}])},d(n.$t("components.detection_interface.file_size_error")),3)):y("",!0)])]))],32),s("div",kn,[s("div",Cn,d(n.$t("components.detection_interface.interface_config")),1),e(S)&&Object.keys(e(S)).length?y("",!0):(a(),u("div",Sn,d(n.$t("components.detection_interface.no_interface_config")),1)),f(o,{config:e(S),"ui-schema":e(M),loading:e(R),"save-button-label":n.$t("components.detection_interface.detect_motion"),"disable-button":e(_),"save-button-color":"#df2a4c","show-button":"",onOnFormSubmit:q},null,8,["config","ui-schema","loading","save-button-label","disable-button"])]),f(m,{modelValue:e(V),"onUpdate:modelValue":t[5]||(t[5]=L=>fe(V)?V.value=L:null),title:n.$t("components.dialog.title.result"),"hide-confirm-button":"",width:"auto"},{content:g(()=>[s("div",Pn,[s("video",{ref_key:"videoPlayerResult",ref:z,controls:"",class:"w-full"},"Your browser does not support the video tag.",512)])]),_:1},8,["modelValue","title"])])}}}),Vn=ke(Dn,[["__scopeId","data-v-b825f442"]]),jn={key:0,class:"flex items-center justify-center w-full h-full"},Ln={key:1,class:"h-full w-full"},zn={class:"page-title"},En={class:"flex flex-col flex-1 inner-component mt-0 p-4"},Fn={class:"box-title w-full mb-3"},On={key:0,class:"w-full h-full flex items-center justify-center"},Tn={key:1},An={class:"options-segments flex items-center justify-between"},Nn={class:"flex flex-col items-center justify-center"},Qn={class:"options-segments-text mt-2"},Bn={key:1},Mn={key:2},Un={key:3},Jn={key:4},Rn={class:"w-full full-inner-height"},qn={class:"flex flex-col md:flex-row gap-2 h-full"},Hn={class:"flex flex-col flex-1",style:{height:"200px","max-height":"200px"}},Yn={key:0,class:"w-full h-full flex items-center justify-center inner-component mt-0"},Gn={class:"flex flex-col flex-1 inner-component mt-0 p-4"},Xn={class:"box-title w-full mb-3"},Kn={key:0,class:"w-full h-full flex items-center justify-center"},Wn=["innerHTML"],Zn={class:"flex flex-col flex-1 inner-component mt-0 p-4"},eo={class:"box-title w-full mb-3"},to={key:0,class:"w-full h-full flex items-center justify-center"},no=["innerHTML"],oo=["data-ignore-id"],so=$e({__name:"Plugin",setup(ne){se.registerLanguage("typescript",It),se.registerLanguage("yaml",kt),se.registerLanguage("json",Ct),se.registerLanguage("python",St);const O=new at,C=new Ie,T=mt(),i=Dt(),{mobileActive:x,smallMobileActive:p}=pt(),D=l(vt()),b=l(),$=l(!1),I=l([]),z=l(!1),F=l(i.params.scope),S=l(i.params.pluginname),h=l(),V=l([]),_=l({name:"settings",icon:ce,isInterface:!1}),E=l(!1),A=l(),M=l(),[X,R]=Vt(),w=H(()=>F.value?`${F.value}/${S.value}`:S.value);C.toggleQueryActivator("getPluginContractQuery",!1);const{data:j,isLoading:K}=C.getPluginQuery(w),{data:W,isLoading:Z}=C.getPluginConfigJsonQuery(w),{data:k,isLoading:q}=C.getPluginSchemaQuery(w),{data:n}=C.getPluginContractQuery(w),{data:t,isLoading:o}=C.getPluginReadmeQuery(w),{data:m,isLoading:L}=C.getPluginChangelogQuery(w),{mutateAsync:Ce,isPending:U}=C.actionButtonQuery(),{mutate:Ge,isPending:Xe}=C.patchPluginConfigQuery(),{mutate:Ke,isPending:We}=O.addCameraExtensionQuery(),{mutate:Ze,isPending:et}=O.removeCameraExtensionQuery(),Oe=H(()=>!!(K.value||Z.value||q.value||o.value||L.value)),pe=H(()=>!!(We.value||et.value)),ae=H(()=>!!($.value||U.value||Xe.value)),ve=H(()=>{var r,c,N;return!!(k.value||(r=n.value)!=null&&r.cameras.length||(c=n.value)!=null&&c.contract.extension||(N=n.value)!=null&&N.contract.supportAdditionalCameras)}),Se=Pt("commonmark",{highlight(r,c){if(c&&se.getLanguage(c))try{return'<pre><code class="hljs">'+se.highlight(r,{language:c,ignoreIllegals:!0}).value+"</code></pre>"}catch{}return'<pre><code class="hljs">'+Se.utils.escapeHtml(r)+"</code></pre>"}});Y(()=>i.params.pluginname,()=>{S.value=i.params.pluginname},{deep:!0,immediate:!0}),Y(h,r=>{te(()=>z.value=!!r)}),Y(k,()=>{q.value?C.toggleQueryActivator("getPluginContractQuery",!1):C.toggleQueryActivator("getPluginContractQuery",!0)},{deep:!0,immediate:!0}),Y(n,()=>{var ge,_e,he,ye,be,xe,ie,re,ue,v;const r=[];let c=!1,N=!1;((ge=n.value)==null?void 0:ge.contract.extension)==="motionDetection"&&(N=!0,r.push({name:"motion_detection",icon:oe,isInterface:!0}),_.value={name:"motion_detection",icon:oe,isInterface:!0}),((_e=n.value)==null?void 0:_e.contract.extension)==="objectDetection"&&(N=!0,r.push({name:"object_detection",icon:oe,isInterface:!0}),_.value={name:"object_detection",icon:oe,isInterface:!0}),((he=n.value)==null?void 0:he.contract.extension)==="audioDetection"&&(N=!0,r.push({name:"audio_detection",icon:oe,isInterface:!0}),_.value={name:"audio_detection",icon:oe,isInterface:!0}),k.value&&k.value.schema&&Object.keys(k.value.schema).length&&(r.push({name:"settings",icon:ce,isInterface:!1}),c=!0,N||(_.value={name:"settings",icon:ce,isInterface:!1})),((ye=n.value)!=null&&ye.cameras.length||(be=n.value)!=null&&be.contract.extension||(xe=n.value)!=null&&xe.contract.supportAdditionalCameras)&&(r.push({name:"cameras",icon:Be,isInterface:!1}),!c&&!N&&(_.value={name:"cameras",icon:Be,isInterface:!1})),V.value=r,((ie=n.value)!=null&&ie.contract.extension||(re=n.value)!=null&&re.contract.supportAdditionalCameras)&&((ue=n.value)!=null&&ue.cameras.length)&&(I.value=(v=n.value)==null?void 0:v.cameras.filter(ee=>ee.extensions.plugins.includes(w.value)).map(ee=>ee.name))},{deep:!0,immediate:!0}),Y(E,r=>{r||(A.value=void 0,M.value=void 0)});const tt=async r=>{if(!k.value)return;$.value=!0;const c=ut(k.value.schema,r);Ge({pluginName:w.value,configData:c},{onSettled:()=>{$.value=!1}})},nt=async r=>{$.value=!0,await Ce({pluginName:w.value,actionId:r.actionId,payload:r.payload},{onSuccess:c=>{c!=null&&c.toast&&ze[c.toast.type](c.toast.message),c!=null&&c.schema&&Object.keys(c.schema).length&&(M.value=r.payload,A.value=c,E.value=!0)},onSettled:()=>{$.value=!1}})},ot=async r=>{j.value&&(I.value.includes(r.name)?Ze({cameraname:r.name,pluginname:j.value.pluginName},{onSuccess:()=>{I.value=I.value.filter(c=>c!==r.name)}}):Ke({cameraname:r.name,pluginname:j.value.pluginName},{onSuccess:()=>{I.value=[...I.value,r.name]}}))};return dt(()=>{b.value=T.connectToNamespace("/plugins")}),ft(()=>{var r,c;(c=(r=b.value)==null?void 0:r.end)==null||c.call(r)}),(r,c)=>{var ie,re,ue;const N=we,ge=Vn,_e=mn,he=Ht,ye=ct,be=it,xe=rt;return a(),u("main",{class:G(["w-full h-full",{"px-0":e(p)}])},[e(Oe)?(a(),u("div",jn,[f(de,{color:"#df2a4c",indeterminate:""})])):(a(),u("div",Ln,[s("div",{class:G(["mb-3 flex w-full items-center",{"px-2":e(p)}]),style:{height:"30px"}},[s("h1",zn,d((ie=e(j))==null?void 0:ie.displayName),1)],2),f(e(X),null,{default:g(()=>[s("div",{class:"plugin-settings-box flex flex-col gap-2 h-full",style:Qe({width:e(ve)&&!e(x)?"40%":"100%"})},[s("div",En,[s("div",Fn,d(r.$t("views.plugin.plugin_settings")),1),e(j)?(a(),u("div",Tn,[s("div",An,[f(gt,{modelValue:e(_),"onUpdate:modelValue":c[0]||(c[0]=v=>fe(_)?_.value=v:null),height:"100%",grow:"","slider-color":"#df2a4c","hide-slider":e(pe)||e(ae)},{default:g(()=>[(a(!0),u(Pe,null,De(e(V),(v,ee)=>(a(),B(_t,{key:ee,value:v,disabled:e(Oe)||v.isInterface&&e(j).disabled,"min-width":"auto"},{default:g(()=>[s("div",Nn,[f(le,{size:"20"},{default:g(()=>[J(d(v.icon),1)]),_:2},1024),s("span",Qn,d(v.isInterface?r.$t("views.plugin.segment_tab_interface"):r.$t(`views.plugin.segment_tab_${v.name.toLowerCase()}`)),1)])]),_:2},1032,["value","disabled"]))),128))]),_:1},8,["modelValue","hide-slider"])]),e(pe)||e(ae)?(a(),B(ht,{key:0,height:"2",color:"#df2a4c",indeterminate:"",style:{"margin-top":"-2px"}})):y("",!0),f(yt,{modelValue:e(_),"onUpdate:modelValue":c[1]||(c[1]=v=>fe(_)?_.value=v:null),class:"box-content w-full flex-1 mt-3",continuous:""},{default:g(()=>[(a(!0),u(Pe,null,De(e(V),(v,ee)=>(a(),B($t,{key:ee,value:{name:v.name,icon:v.icon,isInterface:v.isInterface},disabled:v.isInterface&&e(j).disabled},{default:g(()=>{var Te;return[v.name==="settings"&&e(k)?(a(),B(N,{key:0,config:e(W)||{},"ui-schema":e(k),loading:e(ae),onOnFormSubmit:tt,onOnSubmit:nt},null,8,["config","ui-schema","loading"])):y("",!0),v.name==="cameras"?(a(),u("div",Bn,[(a(!0),u(Pe,null,De((Te=e(n))==null?void 0:Te.cameras,Q=>{var Ae,Ne;return a(),u("div",{key:Q.name},[!((Ae=e(n))!=null&&Ae.contract.extension)&&!((Ne=e(n))!=null&&Ne.contract.supportAdditionalCameras)?(a(),B(qe,{key:0,"select-strategy":"classic",class:"py-0",disabled:e(pe)||e(ae),"onClick:select":()=>r.$router.push(`/cameras/${Q.name}`)},{default:g(()=>[f(He,{value:Q.name,class:"px-2"},{append:g(()=>[f(me,{class:"ml-auto",size:"28",rounded:"",density:"compact",variant:"text",onClick:P(st=>h.value=Q.name,["stop"])},{default:g(()=>[f(le,{size:"18"},{default:g(()=>[J(d(e(ce)),1)]),_:1})]),_:2},1032,["onClick"])]),default:g(()=>[J(d(Q.name)+" ",1)]),_:2},1032,["value"])]),_:2},1032,["disabled","onClick:select"])):(a(),B(qe,{key:1,"select-strategy":"classic",class:"py-0",disabled:e(pe)||e(ae),"onUpdate:selected":()=>ot(Q)},{default:g(()=>[f(He,{class:"px-2",value:e(j).pluginName,active:e(I).includes(Q.name)},{prepend:g(()=>[f(bt,{start:""},{default:g(()=>[f(xt,{"model-value":e(I).includes(Q.name),color:"#df2a4c"},null,8,["model-value"])]),_:2},1024)]),append:g(()=>[f(me,{class:"ml-auto",size:"28",rounded:"",density:"compact",variant:"text",onClick:P(st=>h.value=Q.name,["stop"])},{default:g(()=>[f(le,{size:"18"},{default:g(()=>[J(d(e(ce)),1)]),_:1})]),_:2},1032,["onClick"])]),default:g(()=>[J(d(Q.name)+" ",1)]),_:2},1032,["value","active"])]),_:2},1032,["disabled","onUpdate:selected"])),f(wt,{style:{"border-color":"rgba(var(--color-rgb), 0.1)",opacity:"1"},class:"my-1"})])}),128))])):y("",!0),v.name==="motion_detection"?(a(),u("div",Mn,[f(ge,{"plugin-name":e(w)},null,8,["plugin-name"])])):y("",!0),v.name==="object_detection"?(a(),u("div",Un,[f(_e,{"plugin-name":e(w)},null,8,["plugin-name"])])):y("",!0),v.name==="audio_detection"?(a(),u("div",Jn,[f(he,{"plugin-name":e(w)},null,8,["plugin-name"])])):y("",!0)]}),_:2},1032,["value","disabled"]))),128))]),_:1},8,["modelValue"])])):(a(),u("div",On,[f(de,{color:"#df2a4c",indeterminate:""})]))])],4)]),_:1}),s("div",Rn,[s("div",qn,[s("div",{class:"w-full flex flex-col gap-2 h-full",style:Qe({width:e(ve)&&!e(x)?"60%":"100%"})},[s("div",Hn,[e(j)?(a(),B(ye,{key:1,ref:"pluginRef",plugin:e(j),"min-height":"175px",height:"100%",width:"100%","border-radius":"4px","show-toggle":"","show-settings":"","show-logo":"","show-plugin-status":"","show-logs":"","show-configs":"",truncate:!1,onIsLoading:c[2]||(c[2]=v=>$.value=v)},null,8,["plugin"])):(a(),u("div",Yn,[f(de,{color:"#df2a4c",indeterminate:""})]))]),e(ve)&&e(x)?(a(),B(e(R),{key:0})):y("",!0),s("div",Gn,[s("div",Xn,d(r.$t("views.plugin.readme")),1),e(o)?(a(),u("div",Kn,[f(de,{color:"#df2a4c",indeterminate:""})])):(a(),u("div",{key:1,class:"box-content w-full h-full flex-1 markdown-body pt-1",innerHTML:e(Se).render(e(t)||r.$t("views.plugin.no_readme"))},null,8,Wn))]),s("div",Zn,[s("div",eo,d(r.$t("views.plugin.changelog")),1),e(L)?(a(),u("div",to,[f(de,{color:"#df2a4c",indeterminate:""})])):(a(),u("div",{key:1,class:"box-content w-full h-full flex-1 markdown-body pt-1",innerHTML:e(Se).render(e(m)||r.$t("views.plugin.no_changelog"))},null,8,no))])],4),e(ve)&&!e(x)?(a(),B(e(R),{key:0})):y("",!0)])])])),e(h)?(a(),u("div",{key:2,"data-ignore-id":e(D)},[f(be,{"camera-name":e(h),show:e(z),onClose:c[3]||(c[3]=v=>h.value=void 0)},null,8,["camera-name","show"])],8,oo)):y("",!0),(ue=(re=e(A))==null?void 0:re.schema)!=null&&ue.config?(a(),B(xe,{key:3,modelValue:e(E),"onUpdate:modelValue":c[4]||(c[4]=v=>fe(E)?E.value=v:null),"ui-schema":{schema:e(A).schema},"plugin-config":e(M)||{},"plugin-name":e(w)},null,8,["modelValue","ui-schema","plugin-config","plugin-name"])):y("",!0)],2)}}}),ts=ke(so,[["__scopeId","data-v-5201d26c"]]);export{ts as default};
@@ -1 +1 @@
1
- import{f as S,d as C,z as j,w as D}from"./main-f-Qd4R5M.js";import{_ as z}from"./VPluginCard-BVeId9fp.js";import{P as B}from"./plugins-X26db0mJ.js";import{c as F,S as I,m as R,n as U,C as A,b as q,A as E,e as G}from"./vuetify-B_vGZaGi.js";import{F as L,r,w as X,e as s,f as i,M as l,R as f,j as n,T as p,u as e,i as M,V as N,X as k,N as P,Q as $,l as H,a3 as J,U as K,n as b,aa as O,q as W}from"./@vue-CIFymae3.js";import{e as Y}from"./@mdi-DdmeckA1.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-Cyk5bTcs.js";import"./@intlify-Ck2ZoCVz.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-GPEsefjJ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-CQrF441D.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./VConfigEditor.vue_vue_type_script_setup_true_lang-NvLEB-vb.js";import"./ace-builds-Jtyk_kwI.js";import"./@vueform-B8BH3_sM.js";import"./system-CjiOVZ9H.js";import"./VConsole-CZymGHU4.js";const Z={class:"v-label"},ee={class:"flex flex-row items-center justify-center w-full mt-8"},te={class:"flex flex-col items-center justify-center w-full mt-3"},le={key:0,class:"my-3"},oe={key:1,class:"search-container w-full overflow-scroll hide-scrollbar"},se=L({__name:"VPluginSearch",setup(Q){const a=new B,{smallMobileActive:v}=S(),x=r({page:1,pageSize:-1}),w=r({}),u=r(""),d=r([]),{data:g,isLoading:m}=a.searchPluginsQuery(w,x);X(g,t=>{t!=null&&t.result&&(d.value=t.result.filter(o=>!o.installPath))},{immediate:!0,deep:!0});const h=t=>{t.preventDefault(),w.value.pluginname=u.value??""};return(t,o)=>{const y=z;return s(),i("div",null,[l(I,{class:"ml-auto",onSubmit:h},{default:f(()=>[n("label",Z,p(t.$t("components.form.label.name")),1),l(F,{modelValue:e(u),"onUpdate:modelValue":o[0]||(o[0]=_=>M(u)?u.value=_:null),placeholder:"camera-ui-","hide-details":"",clearable:"",solo:"",variant:"outlined",density:"comfortable","onClick:clear":h},null,8,["modelValue"])]),_:1}),n("div",ee,[n("h3",null,p(t.$t("components.plugin_search.plugins")),1),l(R,{size:"small",class:"ml-auto",color:"#df2a4c"},{default:f(()=>[N(p(e(d).length),1)]),_:1})]),l(U,{style:{"border-color":"rgba(var(--color-rgb), 0.1)",opacity:"1"},class:"mt-3"}),l(A,{active:e(m),indeterminate:e(m),color:"#df2a4c",height:"2px"},null,8,["active","indeterminate"]),n("div",te,[!e(m)&&!e(d).length?(s(),i("div",le,p(t.$t("views.plugins.no_plugins")),1)):e(m)?H("",!0):(s(),i("div",oe,[n("div",{class:"grid gap-2",style:k(`grid-template-columns: repeat(auto-fill, minmax(${e(v)?"100%":"450px"}, 1fr))`)},[(s(!0),i(P,null,$(e(d),(_,c)=>(s(),i("div",{key:c,class:"relative"},[l(y,{plugin:_,height:"175px","max-height":"175px",width:"100%",background:"var(--background-inner-component-card)","min-width":e(v)?"100%":"450px","show-install-button":""},null,8,["plugin","min-width"])]))),128))],4)]))])])}}}),ie=C(se,[["__scopeId","data-v-6cf55538"]]),ae={class:"page-title"},ne={class:"w-full flex justify-center items-center mt-3"},re=L({__name:"Plugins",setup(Q){const{smallMobileActive:a}=S(),v=j(),x=new B,w=r(null),u=r(),d=r({page:1,pageSize:-1}),g=r(!1),{data:m,isLoading:h}=x.getPluginsQuery(d);return J(()=>{u.value=v.connectToNamespace("/plugins")}),K(()=>{var t,o;(o=(t=u.value)==null?void 0:t.end)==null||o.call(t)}),(t,o)=>{const y=ie,_=D;return s(),i("main",{class:b(["w-full h-full",{"px-0":e(a)}])},[n("div",{class:b(["mb-3 flex w-full items-center",{"px-2":e(a)}]),style:{height:"30px"}},[n("h1",ae,p(t.$t(`views.${String(t.$route.name).toLowerCase()}.title`)),1)],2),l(O,{name:"fade",tag:"div"},{default:f(()=>{var c;return[e(h)?(s(),i("div",{key:0,class:"grid gap-2",style:k(`grid-template-columns: repeat(auto-fill, minmax(${e(a)?"100%":"450px"}, 1fr))`)},[(s(),i(P,null,$(15,V=>l(E,{key:V,elevation:1,type:"image",class:"relative",style:{"border-radius":"8px",overflow:"hidden"},height:175})),64))],4)):(c=e(m))!=null&&c.result.length?(s(),i("div",{key:2,class:"grid gap-2",style:k(`grid-template-columns: repeat(auto-fill, minmax(${e(a)?"100%":"450px"}, 1fr))`)},[(s(!0),i(P,null,$(e(m).result,(V,T)=>(s(),i("div",{key:T,class:"relative"},[l(z,{ref_for:!0,ref_key:"pluginRef",ref:w,plugin:V,height:"175px","max-height":"175px",width:"100%","min-width":e(a)?"100%":"450px","border-radius":e(a)?"0px":"8px","show-toggle":"","show-settings":"","show-logo":"","show-plugin-status":"","show-logs":"","show-configs":""},null,8,["plugin","min-width","border-radius"])]))),128))],4)):(s(),i("div",{key:1,class:b(["disabled-text",{"px-2":e(a)}])},p(t.$t("views.plugins.no_plugins")),3))]}),_:1}),n("div",ne,[l(q,{variant:"text",color:"#df2a4c",icon:"",onClick:o[0]||(o[0]=W(c=>g.value=!0,["prevent"]))},{default:f(()=>[l(G,{size:"30"},{default:f(()=>[N(p(e(Y)),1)]),_:1})]),_:1})]),l(_,{modelValue:e(g),"onUpdate:modelValue":o[1]||(o[1]=c=>M(g)?g.value=c:null),title:t.$t("components.dialog.title.search_plugin"),"hide-confirm-button":"",loading:e(h),fullscreen:""},{content:f(()=>[l(y)]),_:1},8,["modelValue","title","loading"])],2)}}}),Ee=C(re,[["__scopeId","data-v-67f88e8e"]]);export{Ee as default};
1
+ import{f as S,d as C,z as j,w as D}from"./main-C2N2tbw_.js";import{_ as z}from"./VPluginCard-Cl6Zw1Dg.js";import{P as B}from"./plugins-Cs7BJHj-.js";import{c as F,S as I,m as R,n as U,C as A,b as q,A as E,e as G}from"./vuetify-B_vGZaGi.js";import{F as L,r,w as X,e as s,f as i,M as l,R as f,j as n,T as p,u as e,i as M,V as N,X as k,N as P,Q as $,l as H,a3 as J,U as K,n as b,aa as O,q as W}from"./@vue-CIFymae3.js";import{e as Y}from"./@mdi-jq8isxax.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-DbPVvJxZ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./VConfigEditor.vue_vue_type_script_setup_true_lang-DDxLGgGL.js";import"./ace-builds-Jtyk_kwI.js";import"./@vueform-B8BH3_sM.js";import"./system-C1OmXhti.js";import"./VConsole-D85lNxwk.js";const Z={class:"v-label"},ee={class:"flex flex-row items-center justify-center w-full mt-8"},te={class:"flex flex-col items-center justify-center w-full mt-3"},le={key:0,class:"my-3"},oe={key:1,class:"search-container w-full overflow-scroll hide-scrollbar"},se=L({__name:"VPluginSearch",setup(Q){const a=new B,{smallMobileActive:v}=S(),x=r({page:1,pageSize:-1}),w=r({}),u=r(""),d=r([]),{data:g,isLoading:m}=a.searchPluginsQuery(w,x);X(g,t=>{t!=null&&t.result&&(d.value=t.result.filter(o=>!o.installPath))},{immediate:!0,deep:!0});const h=t=>{t.preventDefault(),w.value.pluginname=u.value??""};return(t,o)=>{const y=z;return s(),i("div",null,[l(I,{class:"ml-auto",onSubmit:h},{default:f(()=>[n("label",Z,p(t.$t("components.form.label.name")),1),l(F,{modelValue:e(u),"onUpdate:modelValue":o[0]||(o[0]=_=>M(u)?u.value=_:null),placeholder:"camera-ui-","hide-details":"",clearable:"",solo:"",variant:"outlined",density:"comfortable","onClick:clear":h},null,8,["modelValue"])]),_:1}),n("div",ee,[n("h3",null,p(t.$t("components.plugin_search.plugins")),1),l(R,{size:"small",class:"ml-auto",color:"#df2a4c"},{default:f(()=>[N(p(e(d).length),1)]),_:1})]),l(U,{style:{"border-color":"rgba(var(--color-rgb), 0.1)",opacity:"1"},class:"mt-3"}),l(A,{active:e(m),indeterminate:e(m),color:"#df2a4c",height:"2px"},null,8,["active","indeterminate"]),n("div",te,[!e(m)&&!e(d).length?(s(),i("div",le,p(t.$t("views.plugins.no_plugins")),1)):e(m)?H("",!0):(s(),i("div",oe,[n("div",{class:"grid gap-2",style:k(`grid-template-columns: repeat(auto-fill, minmax(${e(v)?"100%":"450px"}, 1fr))`)},[(s(!0),i(P,null,$(e(d),(_,c)=>(s(),i("div",{key:c,class:"relative"},[l(y,{plugin:_,height:"175px","max-height":"175px",width:"100%",background:"var(--background-inner-component-card)","min-width":e(v)?"100%":"450px","show-install-button":""},null,8,["plugin","min-width"])]))),128))],4)]))])])}}}),ie=C(se,[["__scopeId","data-v-6cf55538"]]),ae={class:"page-title"},ne={class:"w-full flex justify-center items-center mt-3"},re=L({__name:"Plugins",setup(Q){const{smallMobileActive:a}=S(),v=j(),x=new B,w=r(null),u=r(),d=r({page:1,pageSize:-1}),g=r(!1),{data:m,isLoading:h}=x.getPluginsQuery(d);return J(()=>{u.value=v.connectToNamespace("/plugins")}),K(()=>{var t,o;(o=(t=u.value)==null?void 0:t.end)==null||o.call(t)}),(t,o)=>{const y=ie,_=D;return s(),i("main",{class:b(["w-full h-full",{"px-0":e(a)}])},[n("div",{class:b(["mb-3 flex w-full items-center",{"px-2":e(a)}]),style:{height:"30px"}},[n("h1",ae,p(t.$t(`views.${String(t.$route.name).toLowerCase()}.title`)),1)],2),l(O,{name:"fade",tag:"div"},{default:f(()=>{var c;return[e(h)?(s(),i("div",{key:0,class:"grid gap-2",style:k(`grid-template-columns: repeat(auto-fill, minmax(${e(a)?"100%":"450px"}, 1fr))`)},[(s(),i(P,null,$(15,V=>l(E,{key:V,elevation:1,type:"image",class:"relative",style:{"border-radius":"8px",overflow:"hidden"},height:175})),64))],4)):(c=e(m))!=null&&c.result.length?(s(),i("div",{key:2,class:"grid gap-2",style:k(`grid-template-columns: repeat(auto-fill, minmax(${e(a)?"100%":"450px"}, 1fr))`)},[(s(!0),i(P,null,$(e(m).result,(V,T)=>(s(),i("div",{key:T,class:"relative"},[l(z,{ref_for:!0,ref_key:"pluginRef",ref:w,plugin:V,height:"175px","max-height":"175px",width:"100%","min-width":e(a)?"100%":"450px","border-radius":e(a)?"0px":"8px","show-toggle":"","show-settings":"","show-logo":"","show-plugin-status":"","show-logs":"","show-configs":""},null,8,["plugin","min-width","border-radius"])]))),128))],4)):(s(),i("div",{key:1,class:b(["disabled-text",{"px-2":e(a)}])},p(t.$t("views.plugins.no_plugins")),3))]}),_:1}),n("div",ne,[l(q,{variant:"text",color:"#df2a4c",icon:"",onClick:o[0]||(o[0]=W(c=>g.value=!0,["prevent"]))},{default:f(()=>[l(G,{size:"30"},{default:f(()=>[N(p(e(Y)),1)]),_:1})]),_:1})]),l(_,{modelValue:e(g),"onUpdate:modelValue":o[1]||(o[1]=c=>M(g)?g.value=c:null),title:t.$t("components.dialog.title.search_plugin"),"hide-confirm-button":"",loading:e(h),fullscreen:""},{content:f(()=>[l(y)]),_:1},8,["modelValue","title","loading"])],2)}}}),Ee=C(re,[["__scopeId","data-v-67f88e8e"]]);export{Ee as default};
@@ -1 +1 @@
1
- import{f as p}from"./main-f-Qd4R5M.js";import{F as m,e as s,f as a,j as r,T as l,n as i,u as e}from"./@vue-CIFymae3.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-Cyk5bTcs.js";import"./@intlify-Ck2ZoCVz.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-GPEsefjJ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vuetify-B_vGZaGi.js";import"./@mdi-DdmeckA1.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-CQrF441D.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";const n={class:"page-title"},G=m({__name:"Recordings",setup(c){const{smallMobileActive:t}=p();return(o,f)=>(s(),a("main",{class:i(["w-full h-full",{"px-0":e(t)}])},[r("div",{class:i(["flex w-full items-center",{"px-2":e(t)}]),style:{height:"30px"}},[r("h1",n,l(o.$t(`views.${String(o.$route.name).toLowerCase()}.title`)),1)],2)],2))}});export{G as default};
1
+ import{f as p}from"./main-C2N2tbw_.js";import{F as m,e as s,f as a,j as r,T as l,n as i,u as e}from"./@vue-CIFymae3.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-DbPVvJxZ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vuetify-B_vGZaGi.js";import"./@mdi-jq8isxax.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";const n={class:"page-title"},G=m({__name:"Recordings",setup(c){const{smallMobileActive:t}=p();return(o,f)=>(s(),a("main",{class:i(["w-full h-full",{"px-0":e(t)}])},[r("div",{class:i(["flex w-full items-center",{"px-2":e(t)}]),style:{height:"30px"}},[r("h1",n,l(o.$t(`views.${String(o.$route.name).toLowerCase()}.title`)),1)],2)],2))}});export{G as default};
@@ -1 +1 @@
1
- import{d as r}from"./main-f-Qd4R5M.js";import{f as o,e as t}from"./@vue-CIFymae3.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-Cyk5bTcs.js";import"./@intlify-Ck2ZoCVz.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-GPEsefjJ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vuetify-B_vGZaGi.js";import"./@mdi-DdmeckA1.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-CQrF441D.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";const i={};function m(p,e){return t(),o("div",null,"Test")}const G=r(i,[["render",m]]);export{G as default};
1
+ import{d as r}from"./main-C2N2tbw_.js";import{f as o,e as t}from"./@vue-CIFymae3.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-DbPVvJxZ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vuetify-B_vGZaGi.js";import"./@mdi-jq8isxax.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";const i={};function m(p,e){return t(),o("div",null,"Test")}const G=r(i,[["render",m]]);export{G as default};
@@ -1 +1 @@
1
- import{F as q,t as Z,r as u,c as B,w as _,a3 as Y,x as U,J as G,e as d,f as h,j as s,N as L,Q as ee,O as V,R as g,M as x,V as te,T as C,u as o,l as N,X as A,W as J,b as oe,n as z,q as ae,S as se}from"./@vue-CIFymae3.js";import{f as K,S as O,T as ne,R as ie,d as P,V as F,h as j}from"./main-f-Qd4R5M.js";import{u as Q,a as re}from"./vue-router-C55prZ5l.js";import{o as le,f as ce,g as ue}from"./@vueuse-GPEsefjJ.js";import{e as de,b as pe}from"./vuetify-B_vGZaGi.js";import{B as fe,G as me}from"./@mdi-DdmeckA1.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-Cyk5bTcs.js";import"./@intlify-Ck2ZoCVz.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-CQrF441D.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";var M=(m=>(m[m.MAXWIDTH=280]="MAXWIDTH",m))(M||{});const ve={class:"flex flex-col w-full pb-safe"},_e={class:"flex flex-row navigation-text"},be={class:"ml-5"},he={class:"navigation-title"},ge={key:0},xe={key:0,class:"overlay"},Se=q({__name:"VSubNavigation",props:{routes:{},description:{type:Boolean,default:!1},state:{type:Boolean,default:!1}},emits:["inner-sidebar-state"],setup(m,{emit:S}){const{desktopActive:r,mobileActive:y}=K(),k=Q(),l=ce(ie),R=S,w=m,{routes:n,state:I,description:b}=Z(w),$=u(null),a=u(),c=u(),T=B(()=>{let e=`calc(${t.value}px + env(safe-area-inset-left, 0px))`;return c.value==="closed"&&a.value==="closed"&&(e=`calc(${t.value}px - env(safe-area-inset-left, 0px))`),e}),t=B(()=>{let e=0;switch(c.value){case"opened":e=O.MAXWIDTH;break;case"minified":e=O.MINWIDTH;break;case"closed":e=0;break}return!r.value&&!I.value&&(e-=M.MAXWIDTH),e});return le($,e=>{if(r.value||a.value==="closed")return;e.target.closest(".no-outside")||(a.value="closed")}),l.on(e=>{e.sidebarState&&(c.value=e.sidebarState)}),_(r,e=>{a.value=e?"opened":"closed"}),_(I,e=>{a.value=e?r.value?"opened":"overlay":"closed"}),_(a,e=>{e&&(l.emit({subNavigationState:e}),R("inner-sidebar-state",e))}),Y(()=>{var e;y.value||(e=k.meta)!=null&&e.ui.noMinifiedSidebar?c.value="closed":c.value="minified"}),U(()=>{var p;a.value=r.value?"opened":"closed";const e=(p=k.name)==null?void 0:p.toString().toLowerCase(),v=document.getElementById(e);v&&setTimeout(()=>{v.scrollIntoView({behavior:"smooth"})},100)}),(e,v)=>{const p=G("router-link");return d(),h(L,null,[s("div",{ref_key:"innerSidebar",ref:$,class:"inner-sidebar-settings pb-safe",style:A({left:o(T),maxWidth:`${o(M).MAXWIDTH}px`,height:`calc(100dvh - ${o(ne).MINHEIGHT}px)`})},[s("div",ve,[(d(!0),h(L,null,ee(o(n),(i,f)=>{var D;return d(),V(p,{id:(D=i.name)==null?void 0:D.toString().toLowerCase(),key:f,class:"navigation-inner",to:i.path,style:A({"border-bottom":f!==o(n).length-1?"1px solid var(--border)":void 0})},{default:g(()=>{var H,W,X;return[s("div",_e,[x(de,{size:((H=i.meta)==null?void 0:H.navigation.iconSize)||"20",class:"navigation-icon"},{default:g(()=>{var E;return[te(C((E=i.meta)==null?void 0:E.navigation.icon),1)]}),_:2},1032,["size"]),s("div",be,[s("b",he,C(e.$t(`navigation.${(W=i.meta)==null?void 0:W.name}`)),1),o(b)?(d(),h("p",ge,C(e.$t(`navigation_description.${(X=i.meta)==null?void 0:X.description}`)),1)):N("",!0)])])]}),_:2},1032,["id","to","style"])}),128))])],4),x(J,{name:"overlay-fade",mode:"in-out"},{default:g(()=>[o(a)==="overlay"?(d(),h("div",xe)):N("",!0)]),_:1})],64)}}}),ye=P(Se,[["__scopeId","data-v-7a51011d"]]),ke={class:"w-full h-full flex flex-row"},we={class:"flex flex-row items-center"},Ie=q({__name:"Settings",setup(m){const S=Q(),r=re(),{desktopActive:y,smallMobileActive:k}=K(),l=u(),R=u(null),w=u(null),n=u(!1),I=u(0),b=oe(F.find(t=>t.name==="Settings").children.filter(t=>j(t))),$=B(()=>F.find(t=>t.name==="Settings").children.filter(t=>j(t))),{isSwiping:a,direction:c}=ue(w),T=B(()=>{let t="0px";switch(l.value){case"closed":case"overlay":t="0px";break;case"opened":t=`${M.MAXWIDTH}px`;break}return`padding-left: ${t}`});return _([a,c],()=>{if(a.value){const t=b.findIndex(e=>e.path===S.path.split("/settings/")[1]);switch(c.value){case"right":{const e=b[t-1];e&&r.push({path:e.path})}break;case"left":{const e=b[t+1];e&&r.push({path:e.path})}break}}}),_(l,()=>{n.value=l.value!=="closed"}),_(S,()=>{y.value||(n.value=!1)},{deep:!0}),(t,e)=>{var i;const v=ye,p=G("router-view");return d(),h("main",ke,[x(v,{description:"",state:o(n),routes:o($),onInnerSidebarState:e[0]||(e[0]=f=>l.value=f)},null,8,["state","routes"]),s("div",{class:"router-container",style:A(`transition: 0.2s all ease-in-out;${o(T)};`)},[s("div",{ref_key:"routerContainer",ref:R,class:"router-container-inner h-full w-full flex flex-col"},[s("div",we,[o(y)?N("",!0):(d(),V(pe,{key:0,ref:"innerSidebarButton",density:"compact",icon:o(n)?o(fe):o(me),class:z(["no-outside",{"ml-2":o(k)}]),elevation:"0",style:{border:"1px solid rgba(var(--border-rgb), 0.75)"},onClick:e[1]||(e[1]=ae(f=>n.value=!o(n),["prevent"]))},null,8,["icon","class"])),s("h1",{class:z(["page-title text-color",{"mx-3":o(l)!=="opened"}])},C(t.$t(`views.settings.title_${(i=t.$route.meta)==null?void 0:i.name}`)),3)]),s("div",{ref_key:"subviewContainer",ref:w,class:"h-full"},[x(p,{class:"mt-10 pb-5",style:{height:"calc(100% - 40px)"}},{default:g(({Component:f})=>[x(J,{name:"fade",mode:"out-in"},{default:g(()=>[(d(),V(se(f),{key:o(I)}))]),_:2},1024)]),_:1})],512)],512)],4)])}}}),et=P(Ie,[["__scopeId","data-v-838a0f39"]]);export{et as default};
1
+ import{F as q,t as Z,r as u,c as B,w as _,a3 as Y,x as U,J as G,e as d,f as h,j as s,N as L,Q as ee,O as V,R as g,M as x,V as te,T as C,u as o,l as N,X as A,W as J,b as oe,n as z,q as ae,S as se}from"./@vue-CIFymae3.js";import{f as K,S as O,T as ne,V as ie,d as P,W as F,h as j}from"./main-C2N2tbw_.js";import{u as Q,a as re}from"./vue-router-C55prZ5l.js";import{o as le,f as ce,g as ue}from"./@vueuse-DbPVvJxZ.js";import{e as de,b as pe}from"./vuetify-B_vGZaGi.js";import{B as fe,G as me}from"./@mdi-jq8isxax.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";var M=(m=>(m[m.MAXWIDTH=280]="MAXWIDTH",m))(M||{});const ve={class:"flex flex-col w-full pb-safe"},_e={class:"flex flex-row navigation-text"},be={class:"ml-5"},he={class:"navigation-title"},ge={key:0},xe={key:0,class:"overlay"},Se=q({__name:"VSubNavigation",props:{routes:{},description:{type:Boolean,default:!1},state:{type:Boolean,default:!1}},emits:["inner-sidebar-state"],setup(m,{emit:S}){const{desktopActive:r,mobileActive:y}=K(),k=Q(),l=ce(ie),R=S,w=m,{routes:n,state:I,description:b}=Z(w),$=u(null),a=u(),c=u(),T=B(()=>{let e=`calc(${t.value}px + env(safe-area-inset-left, 0px))`;return c.value==="closed"&&a.value==="closed"&&(e=`calc(${t.value}px - env(safe-area-inset-left, 0px))`),e}),t=B(()=>{let e=0;switch(c.value){case"opened":e=O.MAXWIDTH;break;case"minified":e=O.MINWIDTH;break;case"closed":e=0;break}return!r.value&&!I.value&&(e-=M.MAXWIDTH),e});return le($,e=>{if(r.value||a.value==="closed")return;e.target.closest(".no-outside")||(a.value="closed")}),l.on(e=>{e.sidebarState&&(c.value=e.sidebarState)}),_(r,e=>{a.value=e?"opened":"closed"}),_(I,e=>{a.value=e?r.value?"opened":"overlay":"closed"}),_(a,e=>{e&&(l.emit({subNavigationState:e}),R("inner-sidebar-state",e))}),Y(()=>{var e;y.value||(e=k.meta)!=null&&e.ui.noMinifiedSidebar?c.value="closed":c.value="minified"}),U(()=>{var p;a.value=r.value?"opened":"closed";const e=(p=k.name)==null?void 0:p.toString().toLowerCase(),v=document.getElementById(e);v&&setTimeout(()=>{v.scrollIntoView({behavior:"smooth"})},100)}),(e,v)=>{const p=G("router-link");return d(),h(L,null,[s("div",{ref_key:"innerSidebar",ref:$,class:"inner-sidebar-settings pb-safe",style:A({left:o(T),maxWidth:`${o(M).MAXWIDTH}px`,height:`calc(100dvh - ${o(ne).MINHEIGHT}px)`})},[s("div",ve,[(d(!0),h(L,null,ee(o(n),(i,f)=>{var D;return d(),V(p,{id:(D=i.name)==null?void 0:D.toString().toLowerCase(),key:f,class:"navigation-inner",to:i.path,style:A({"border-bottom":f!==o(n).length-1?"1px solid var(--border)":void 0})},{default:g(()=>{var W,H,X;return[s("div",_e,[x(de,{size:((W=i.meta)==null?void 0:W.navigation.iconSize)||"20",class:"navigation-icon"},{default:g(()=>{var E;return[te(C((E=i.meta)==null?void 0:E.navigation.icon),1)]}),_:2},1032,["size"]),s("div",be,[s("b",he,C(e.$t(`navigation.${(H=i.meta)==null?void 0:H.name}`)),1),o(b)?(d(),h("p",ge,C(e.$t(`navigation_description.${(X=i.meta)==null?void 0:X.description}`)),1)):N("",!0)])])]}),_:2},1032,["id","to","style"])}),128))])],4),x(J,{name:"overlay-fade",mode:"in-out"},{default:g(()=>[o(a)==="overlay"?(d(),h("div",xe)):N("",!0)]),_:1})],64)}}}),ye=P(Se,[["__scopeId","data-v-7a51011d"]]),ke={class:"w-full h-full flex flex-row"},we={class:"flex flex-row items-center"},Ie=q({__name:"Settings",setup(m){const S=Q(),r=re(),{desktopActive:y,smallMobileActive:k}=K(),l=u(),R=u(null),w=u(null),n=u(!1),I=u(0),b=oe(F.find(t=>t.name==="Settings").children.filter(t=>j(t))),$=B(()=>F.find(t=>t.name==="Settings").children.filter(t=>j(t))),{isSwiping:a,direction:c}=ue(w),T=B(()=>{let t="0px";switch(l.value){case"closed":case"overlay":t="0px";break;case"opened":t=`${M.MAXWIDTH}px`;break}return`padding-left: ${t}`});return _([a,c],()=>{if(a.value){const t=b.findIndex(e=>e.path===S.path.split("/settings/")[1]);switch(c.value){case"right":{const e=b[t-1];e&&r.push({path:e.path})}break;case"left":{const e=b[t+1];e&&r.push({path:e.path})}break}}}),_(l,()=>{n.value=l.value!=="closed"}),_(S,()=>{y.value||(n.value=!1)},{deep:!0}),(t,e)=>{var i;const v=ye,p=G("router-view");return d(),h("main",ke,[x(v,{description:"",state:o(n),routes:o($),onInnerSidebarState:e[0]||(e[0]=f=>l.value=f)},null,8,["state","routes"]),s("div",{class:"router-container",style:A(`transition: 0.2s all ease-in-out;${o(T)};`)},[s("div",{ref_key:"routerContainer",ref:R,class:"router-container-inner h-full w-full flex flex-col"},[s("div",we,[o(y)?N("",!0):(d(),V(pe,{key:0,ref:"innerSidebarButton",density:"compact",icon:o(n)?o(fe):o(me),class:z(["no-outside",{"ml-2":o(k)}]),elevation:"0",style:{border:"1px solid rgba(var(--border-rgb), 0.75)"},onClick:e[1]||(e[1]=ae(f=>n.value=!o(n),["prevent"]))},null,8,["icon","class"])),s("h1",{class:z(["page-title text-color",{"mx-3":o(l)!=="opened"}])},C(t.$t(`views.settings.title_${(i=t.$route.meta)==null?void 0:i.name}`)),3)]),s("div",{ref_key:"subviewContainer",ref:w,class:"h-full"},[x(p,{class:"mt-10 pb-5",style:{height:"calc(100% - 40px)"}},{default:g(({Component:f})=>[x(J,{name:"fade",mode:"out-in"},{default:g(()=>[(d(),V(se(f),{key:o(I)}))]),_:2},1024)]),_:1})],512)],512)],4)])}}}),et=P(Ie,[["__scopeId","data-v-838a0f39"]]);export{et as default};
@@ -0,0 +1,4 @@
1
+ import{z as se,f as ne,s as ae,Y as le,y as ie,w as re}from"./main-C2N2tbw_.js";import{F as ue,r as a,c as L,w as R,U as de,e as u,f,O as Q,u as o,M as l,l as me,ae as ce,j as n,T as i,g as pe,R as v,q as F,i as $,V as P}from"./@vue-CIFymae3.js";import{S as ve,r as fe}from"./system-C1OmXhti.js";import{V as ge}from"./VConsole-D85lNxwk.js";import{s as O}from"./utils-BvINh1mj.js";import{av as _e}from"./@mdi-jq8isxax.js";import{c as ye}from"./compare-versions-DqEOhma6.js";import{T as Ve,b as W,V as q,e as we,y as be}from"./vuetify-B_vGZaGi.js";import"./vue-inline-svg-DDdr3aAz.js";import"./vue3-toastify-Cy6dUyKO.js";import"./vue-i18n-CHUfunSC.js";import"./@intlify-YW_pt133.js";import"./axios-BI2i94Vb.js";import"./@tanstack-DPd4-F0t.js";import"./pinia-B_gX_pHL.js";import"./vue-router-C55prZ5l.js";import"./@vueuse-DbPVvJxZ.js";import"./nprogress-QK5AFhFr.js";import"./@xterm-LO7TPXYg.js";import"./vee-validate-DHjm38DY.js";import"./@vee-validate-CmTVjJBY.js";import"./zod-BaF2dDCd.js";import"./uuid-DvF23Exx.js";import"./socket.io-client-Bq_SHkin.js";import"./engine.io-client-DBBxzneW.js";import"./engine.io-parser-BiEtp6m2.js";import"./@socket.io-Dkula2eQ.js";import"./socket.io-parser-BBkuslX-.js";import"./rxjs-DmqiRszP.js";import"./tslib-9k7AwCpt.js";import"./v-calendar-CbEkwI4D.js";import"./@popperjs-BQBsAJpH.js";const ke={key:0,class:"flex w-full h-full justify-center items-center fixed top-0 left-0",style:{"z-index":"9000"}},he={class:"subview-title text-color"},$e={class:"inner-component p-4"},xe={class:"flex"},Ce={class:"text-sm"},Se={class:"text-sm ml-auto text-right"},Te={key:1},Ue=n("div",{class:"my-8"},null,-1),Le={class:"flex items-center justify-center"},Re={key:0,class:"flex flex-row items-center"},Ie={class:"text-disabled"},Me={key:1,class:"flex flex-col items-center justify-center"},Ne={class:"text-disabled mb-3"},Qe={key:2,class:"text-disabled"},Be=n("div",{class:"p-5"},[n("span",null,"WIP: Release Notes")],-1),je={class:"p-5 flex w-full items-center justify-center"},ze={class:"v-label"},yt=ue({__name:"System",setup(Ae){const E=new le,B=new ve,Y=se(),{smallMobileActive:j}=ne(),{isTouch:G}=ae(),m=a(!1),g=a(!1),_=a(!1),x=a(""),I=a(!1),y=a(null),c=a(),V=a(!1),d=a(""),w=a(!1),b=a(""),H=L(()=>S.value||I.value),J=L(()=>({fontSize:j.value?12:14})),z=L(()=>k.value&&d.value?ye(d.value,k.value.version)===1:!1),K=L(()=>{var e;return((e=M.value)==null?void 0:e.versions.toReversed())||[]}),{data:k,isLoading:X}=E.apiInfoQuery(),{data:M,isLoading:C}=B.checkVersionQuery(),{mutateAsync:A,isPending:S}=B.updateSystemQuery();R(k,()=>{var e,t;x.value=((e=k.value)==null?void 0:e.version)||"",b.value=((t=k.value)==null?void 0:t.version)||""},{deep:!0,immediate:!0}),R(M,()=>{var e;d.value=((e=M.value)==null?void 0:e["dist-tags"].alpha)||""},{deep:!0,immediate:!0}),R(m,e=>{N(e),!e&&!V.value&&setTimeout(()=>{_.value=!0},300)}),R(j,()=>{Z()});const N=e=>{var t,T,p,s,U,D;e?(c.value=Y.connectToNamespace("/logs"),(t=c.value)==null||t.socket.on("stdout/@camera.ui/server",r=>{var h;(h=y.value)==null||h.writeTerminal(r)}),(T=c.value)==null||T.socket.on("stdout",r=>{var h;(h=y.value)==null||h.writeTerminal(r)}),(p=c.value)==null||p.socket.on("disconnect",()=>{var r;(r=y.value)==null||r.writeTerminal(`
2
+ \rWebsocket failed to connect! Is the server running?
3
+ \r
4
+ \r`)}),(s=c.value)==null||s.socket.on("clear-log",()=>{var r;(r=y.value)==null||r.clearTerminal()})):(D=(U=c.value)==null?void 0:U.end)==null||D.call(U)},Z=()=>{m.value&&(N(!1),N(!0))},ee=async()=>{if(g.value=!1,V.value=!1,!(!z.value||!d.value)){await O(300),m.value=!0;try{await A({pluginData:{pluginname:"@camera.ui/server",pluginversion:d.value}}),x.value=d.value}catch{V.value=!0}}},te=async e=>{w.value=!1,V.value=!1,await O(300),m.value=!0;try{await A({pluginData:{pluginname:"@camera.ui/server",pluginversion:e}}),x.value=e}catch{V.value=!0}},oe=async()=>{_.value=!1,I.value=!0,await fe()};return de(()=>{var e,t;(t=(e=c.value)==null?void 0:e.end)==null||t.call(e)}),(e,t)=>{const T=ie,p=re;return u(),f("div",null,[(u(),Q(ce,{to:".app"},[o(I)?(u(),f("div",ke,[l(T,{reload:""})])):me("",!0)])),n("div",null,[n("span",he,i(e.$t("views.settings.current_version")),1),n("div",$e,[n("div",xe,[n("span",Ce,i(e.$t("views.settings.current_version_info")),1),n("span",Se,[o(X)?(u(),Q(q,{key:0,color:"#df2a4c",indeterminate:""})):(u(),f("span",Te,[n("b",null,i(o(x)),1)])),pe((u(),Q(W,{density:"compact",loading:o(S),icon:"",variant:"text",class:"ml-2",onClick:t[0]||(t[0]=F(s=>w.value=!0,["prevent"]))},{default:v(()=>[l(we,{size:"20",class:"text-passive"},{default:v(()=>[P(i(o(_e)),1)]),_:1})]),_:1},8,["loading"])),[[Ve,{disabled:o(G),text:e.$t("components.form.tooltip.restart")}]])])])]),Ue,n("div",Le,[o(C)?(u(),f("div",Re,[l(q,{color:"#df2a4c",indeterminate:"",class:"mr-3",size:"15",width:"2"}),n("span",Ie,i(e.$t("views.settings.searching_updates")),1)])):o(z)?(u(),f("div",Me,[n("span",Ne,i(e.$t("views.settings.available_updates_info")),1),l(W,{loading:o(S),color:"#df2a4c",onClick:t[1]||(t[1]=F(s=>g.value=!0,["prevent"]))},{default:v(()=>[P("v"+i(o(d)),1)]),_:1},8,["loading"])])):(u(),f("span",Qe,i(e.$t("views.settings.not_available_updates_info")),1))])]),l(p,{modelValue:o(g),"onUpdate:modelValue":t[2]||(t[2]=s=>$(g)?g.value=s:null),title:`${e.$t("components.dialog.title.update")}: ${o(d)}`,"fullscreen-content":"",loading:o(S),"confirm-text":"components.form.button.update",onConfirm:ee},{content:v(()=>[Be]),_:1},8,["modelValue","title","loading"]),l(p,{modelValue:o(m),"onUpdate:modelValue":t[3]||(t[3]=s=>$(m)?m.value=s:null),title:e.$t("components.dialog.title.log"),"fullscreen-content":"","hide-confirm-button":""},{content:v(()=>[l(ge,{ref_key:"consoleRef",ref:y,class:"text-editor",options:o(J)},null,8,["options"])]),_:1},8,["modelValue","title"]),l(p,{modelValue:o(_),"onUpdate:modelValue":t[4]||(t[4]=s=>$(_)?_.value=s:null),title:e.$t("components.dialog.title.restart"),"confirm-text":"components.form.button.restart",loading:o(H),onConfirm:t[5]||(t[5]=s=>oe())},{content:v(()=>[n("div",je,[n("span",null,i(e.$t("components.dialog.message.restart_server_info")),1)])]),_:1},8,["modelValue","title","loading"]),l(p,{modelValue:o(w),"onUpdate:modelValue":t[7]||(t[7]=s=>$(w)?w.value=s:null),title:e.$t("components.dialog.title.install_version"),"confirm-text":"components.form.button.install",loading:o(C),onConfirm:t[8]||(t[8]=s=>te(o(b)))},{content:v(()=>[n("label",ze,i(e.$t("components.form.label.server_version")),1),l(be,{modelValue:o(b),"onUpdate:modelValue":t[6]||(t[6]=s=>$(b)?b.value=s:null),"hide-details":"",solo:"",variant:"outlined",density:"compact",items:o(K),disabled:o(C),loading:o(C)},null,8,["modelValue","items","disabled","loading"])]),_:1},8,["modelValue","title","loading"])])}}});export{yt as default};