camera.ui3 0.0.31-alpha.7 → 0.0.31-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.
- package/dist/interface/@camera.ui.5tgIM73-.0.0.31-alpha.9.js +3 -0
- package/dist/interface/{@tanstack.C5ZmdPMX.0.0.31-alpha.7.js → @tanstack.DiO-YfND.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{@vee-validate.C1sFKgmu.0.0.31-alpha.7.js → @vee-validate.BcQFNWZE.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{@vueform.BzGYev9O.0.0.31-alpha.7.js → @vueform.CY_hGye7.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{@vueuse.PD04ZxXf.0.0.31-alpha.7.js → @vueuse.9BxRKi-L.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{Account.BTeKYTDS.0.0.31-alpha.7.js → Account.ClNqrEzq.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{Adminpanel.BaWQ_scK.0.0.31-alpha.7.js → Adminpanel.EgJtOipv.0.0.31-alpha.9.js} +2 -2
- package/dist/interface/{Appearance.DEVYktQT.0.0.31-alpha.7.js → Appearance.Bd_De-AN.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{Backup.DZGSZkOZ.0.0.31-alpha.7.js → Backup.DJHIFHH5.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{Camera.Btiz7Ggb.0.0.31-alpha.7.js → Camera.DtJ7F2vx.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/Cameras.C6Jw9DBM.0.0.31-alpha.9.js +1 -0
- package/dist/interface/Camview.D-kKkkwH.0.0.31-alpha.9.js +1 -0
- package/dist/interface/Config.tNTb0Q1P.0.0.31-alpha.9.js +1 -0
- package/dist/interface/Console.5zJr03Pu.0.0.31-alpha.9.js +4 -0
- package/dist/interface/{FirstSteps.tI-KBrzZ.0.0.31-alpha.7.js → FirstSteps.Dv-f7Q30.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{NewCamera.CrbKjsxQ.0.0.31-alpha.7.js → NewCamera.9oVueNXm.0.0.31-alpha.9.js} +2 -2
- package/dist/interface/{Plugin.CGEg24tL.0.0.31-alpha.7.js → Plugin.MmkX88gY.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{Plugins.C01s0gRb.0.0.31-alpha.7.js → Plugins.C4zCniN8.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/Recordings.CNdtF6ac.0.0.31-alpha.9.js +1 -0
- package/dist/interface/Recordings.D8wI1lYM.0.0.31-alpha.9.js +1 -0
- package/dist/interface/{Settings.Kqq6XWH2.0.0.31-alpha.7.js → Settings.DQNCNI65.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{System.CMQt6nxU.0.0.31-alpha.7.js → System.BH3d2wgd.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{User.l4xfX0QW.0.0.31-alpha.7.js → User.KszaeyZA.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{VConfigEditor.vue_vue_type_script_setup_true_lang.C7EiFGNp.0.0.31-alpha.7.js → VConfigEditor.vue_vue_type_script_setup_true_lang.BAYmotSN.0.0.31-alpha.9.js} +2 -2
- package/dist/interface/{VConsole.Dd9XT5Uc.0.0.31-alpha.7.js → VConsole.BpaR5IBq.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/VPlayer.BARBY2Yl.0.0.31-alpha.9.js +1 -0
- package/dist/interface/{VPluginCard.CzqB_sNN.0.0.31-alpha.7.js → VPluginCard.C3zVPPxc.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{ace-builds.DXF0kNYD.0.0.31-alpha.7.js → ace-builds.SJlMp9cD.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{apexcharts.rWLnyoo2.0.0.31-alpha.7.js → apexcharts.COeUheTz.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/assets/Cameras.0.0.31-alpha.9.b9mQaG3Q.css +1 -0
- package/dist/interface/assets/Camview.0.0.31-alpha.9.DxCmx1if.css +1 -0
- package/dist/interface/assets/Config.0.0.31-alpha.9.BtdZEuQO.css +1 -0
- package/dist/interface/assets/Console.0.0.31-alpha.9.Cc8Jy8yw.css +1 -0
- package/dist/interface/assets/NewCamera.0.0.31-alpha.9.m4FTNlSI.css +1 -0
- package/dist/interface/assets/{VPlayer.0.0.31-alpha.7.CX8iJzZQ.css → VPlayer.0.0.31-alpha.9.DL-vUJg6.css} +1 -1
- package/dist/interface/assets/{main.0.0.31-alpha.7.DsLnYJiq.css → main.0.0.31-alpha.9.DVYbSD6m.css} +1 -1
- package/dist/interface/{dnd-core.YMrXUGND.0.0.31-alpha.7.js → dnd-core.C-BrWt9e.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{draggabilly.GpB8TOyE.0.0.31-alpha.7.js → draggabilly.BVQCUu31.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{engine.io-client.0rDBaiC-.0.0.31-alpha.7.js → engine.io-client.AS8grqwl.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{ev-emitter.BJv01w63.0.0.31-alpha.7.js → ev-emitter.DdqYF_mT.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{fast-deep-equal.D3Ii1Cl_.0.0.31-alpha.7.js → fast-deep-equal.CAY2EWVV.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{highlight.js.bw9qPOx5.0.0.31-alpha.7.js → highlight.js.DyqKEn5l.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/index.html +34 -34
- package/dist/interface/{linkify-it.Dv7rKtNA.0.0.31-alpha.7.js → linkify-it.D_VrFIEs.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/main.qn-1EUvn.0.0.31-alpha.9.js +2 -0
- package/dist/interface/{markdown-it.BHO6EvHC.0.0.31-alpha.7.js → markdown-it.CKLQdOwp.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{nprogress.Vi6jioDG.0.0.31-alpha.7.js → nprogress.B9kF5yPN.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{pinia.BmNMGws-.0.0.31-alpha.7.js → pinia.CtdBjRVP.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{plugins.8xllclI2.0.0.31-alpha.7.js → plugins.Bkal5GEl.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{qrcode.C6itkoyR.0.0.31-alpha.7.js → qrcode.nk05XZUk.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{react-dnd-touch-backend.BA_82Cq0.0.0.31-alpha.7.js → react-dnd-touch-backend.9gsCxBRV.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{rxjs.yBzqm3cW.0.0.31-alpha.7.js → rxjs.O8rqJXmX.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{socket.io-client.CREiw90L.0.0.31-alpha.7.js → socket.io-client.BgnB__Bp.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{socket.io-parser.CXwV0PeT.0.0.31-alpha.7.js → socket.io-parser.CDdrp6JV.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/sw.js +1 -1
- package/dist/interface/{system.CfsZJsD4.0.0.31-alpha.7.js → system.DW1v9qpo.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{unidragger.DGZQtVYj.0.0.31-alpha.7.js → unidragger.Du7VJMKS.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{v-calendar.DbgRs2B9.0.0.31-alpha.7.js → v-calendar.CpGjgKe5.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vee-validate.CgBFBn_c.0.0.31-alpha.7.js → vee-validate.BMToAU75.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vue-i18n.47lrsSx-.0.0.31-alpha.7.js → vue-i18n.bhUkliEa.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vue-inline-svg.B_v_uRHL.0.0.31-alpha.7.js → vue-inline-svg.pmg4fXNu.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vue-router.6SfjZo7d.0.0.31-alpha.7.js → vue-router.D52Gr9tg.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vue3-apexcharts.DihGA-Qc.0.0.31-alpha.7.js → vue3-apexcharts.BmV4BSAH.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vue3-dnd.BwRW_ask.0.0.31-alpha.7.js → vue3-dnd.CZCIjzeJ.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vue3-toastify.183kFIIP.0.0.31-alpha.7.js → vue3-toastify.61dIcR4V.0.0.31-alpha.9.js} +1 -1
- package/dist/interface/{vuetify.eyVDgSy7.0.0.31-alpha.7.js → vuetify.Bil1YTHi.0.0.31-alpha.9.js} +1 -1
- package/dist/server/package.json +3 -3
- package/dist/server/requirements.txt +1 -1
- package/dist/server/src/api/index.js +8 -10
- package/dist/server/src/api/index.js.map +1 -1
- package/dist/server/src/api/utils/cert.d.ts +7 -7
- package/dist/server/src/api/utils/cert.js +178 -385
- package/dist/server/src/api/utils/cert.js.map +1 -1
- package/dist/server/src/api/utils/constants.d.ts +0 -2
- package/dist/server/src/api/utils/constants.js +4 -7
- package/dist/server/src/api/utils/constants.js.map +1 -1
- package/dist/server/src/api/websocket/nsp/notifications.js +1 -1
- package/dist/server/src/api/websocket/nsp/notifications.js.map +1 -1
- package/dist/server/src/api/websocket/nsp/server.d.ts +1 -1
- package/dist/server/src/api/websocket/nsp/server.js +11 -3
- package/dist/server/src/api/websocket/nsp/server.js.map +1 -1
- package/dist/server/src/decoder/worker.js +1 -1
- package/dist/server/src/decoder/worker.js.map +1 -1
- package/dist/server/src/services/logger/index.d.ts +6 -1
- package/dist/server/src/services/logger/index.js +43 -11
- package/dist/server/src/services/logger/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/interface/@camera.ui.ilP0Pgi-.0.0.31-alpha.7.js +0 -3
- package/dist/interface/Cameras.BNYZVEyF.0.0.31-alpha.7.js +0 -1
- package/dist/interface/Camview.CF0kGHsU.0.0.31-alpha.7.js +0 -1
- package/dist/interface/Config.D0PvJtyZ.0.0.31-alpha.7.js +0 -1
- package/dist/interface/Console.B03AS0NK.0.0.31-alpha.7.js +0 -4
- package/dist/interface/Recordings.BYc7rTt5.0.0.31-alpha.7.js +0 -1
- package/dist/interface/Recordings.l_zt5BJF.0.0.31-alpha.7.js +0 -1
- package/dist/interface/VPlayer.CpMa1SNk.0.0.31-alpha.7.js +0 -1
- package/dist/interface/assets/Cameras.0.0.31-alpha.7.BwLwzGQW.css +0 -1
- package/dist/interface/assets/Camview.0.0.31-alpha.7.Ce_V-Nxj.css +0 -1
- package/dist/interface/assets/Config.0.0.31-alpha.7.xOTKGJ5Y.css +0 -1
- package/dist/interface/assets/Console.0.0.31-alpha.7.DWrfRWs9.css +0 -1
- package/dist/interface/assets/NewCamera.0.0.31-alpha.7.DG58gb_Z.css +0 -1
- package/dist/interface/main.3GWz905i.0.0.31-alpha.7.js +0 -2
- /package/dist/interface/{@babel.l0sNRNKZ.0.0.31-alpha.7.js → @babel.l0sNRNKZ.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{@intlify.Jdj6PDCT.0.0.31-alpha.7.js → @intlify.Jdj6PDCT.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{@mdi.DVdKciOk.0.0.31-alpha.7.js → @mdi.DVdKciOk.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{@popperjs.BQBsAJpH.0.0.31-alpha.7.js → @popperjs.BQBsAJpH.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{@react-dnd.CcwRs9xb.0.0.31-alpha.7.js → @react-dnd.CcwRs9xb.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{@socket.io.Dkula2eQ.0.0.31-alpha.7.js → @socket.io.Dkula2eQ.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{@vue.FH56CEei.0.0.31-alpha.7.js → @vue.FH56CEei.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{@xterm.5BydZhPp.0.0.31-alpha.7.js → @xterm.CSJozHT0.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/assets/{@vueform.0.0.31-alpha.7.h7tNX9p6.css → @vueform.0.0.31-alpha.9.h7tNX9p6.css} +0 -0
- /package/dist/interface/assets/{@xterm.0.0.31-alpha.7.CGrrDQr5.css → @xterm.0.0.31-alpha.9.CGrrDQr5.css} +0 -0
- /package/dist/interface/assets/{Account.0.0.31-alpha.7.Ce3OmKrC.css → Account.0.0.31-alpha.9.Ce3OmKrC.css} +0 -0
- /package/dist/interface/assets/{Adminpanel.0.0.31-alpha.7.BCpVV7QL.css → Adminpanel.0.0.31-alpha.9.BCpVV7QL.css} +0 -0
- /package/dist/interface/assets/{Backup.0.0.31-alpha.7.BIwaSlv3.css → Backup.0.0.31-alpha.9.BIwaSlv3.css} +0 -0
- /package/dist/interface/assets/{Camera.0.0.31-alpha.7.BDtUJ-lA.css → Camera.0.0.31-alpha.9.BDtUJ-lA.css} +0 -0
- /package/dist/interface/assets/{FirstSteps.0.0.31-alpha.7.CCo2y-sU.css → FirstSteps.0.0.31-alpha.9.CCo2y-sU.css} +0 -0
- /package/dist/interface/assets/{Plugin.0.0.31-alpha.7.BtRA6zDt.css → Plugin.0.0.31-alpha.9.BtRA6zDt.css} +0 -0
- /package/dist/interface/assets/{Plugins.0.0.31-alpha.7.Cwu0aGUO.css → Plugins.0.0.31-alpha.9.Cwu0aGUO.css} +0 -0
- /package/dist/interface/assets/{Settings.0.0.31-alpha.7.DTRm1psP.css → Settings.0.0.31-alpha.9.DTRm1psP.css} +0 -0
- /package/dist/interface/assets/{User.0.0.31-alpha.7.DPDcJbx8.css → User.0.0.31-alpha.9.DPDcJbx8.css} +0 -0
- /package/dist/interface/assets/{VConsole.0.0.31-alpha.7.BZT1WyS-.css → VConsole.0.0.31-alpha.9.BZT1WyS-.css} +0 -0
- /package/dist/interface/assets/{VPluginCard.0.0.31-alpha.7.CyNvwFGk.css → VPluginCard.0.0.31-alpha.9.CyNvwFGk.css} +0 -0
- /package/dist/interface/assets/{highlight.0.0.31-alpha.7.DgoK_Xib.css → highlight.0.0.31-alpha.9.DgoK_Xib.css} +0 -0
- /package/dist/interface/assets/{logo-256.0.0.31-alpha.7.BCQk9H1-.png → logo-256.0.0.31-alpha.9.BCQk9H1-.png} +0 -0
- /package/dist/interface/assets/{logo-512.0.0.31-alpha.7.DLKVOU2S.png → logo-512.0.0.31-alpha.9.DLKVOU2S.png} +0 -0
- /package/dist/interface/assets/{logo.0.0.31-alpha.7.DmEiRk0z.png → logo.0.0.31-alpha.9.DmEiRk0z.png} +0 -0
- /package/dist/interface/assets/{mode-json.0.0.31-alpha.7.Br7xisR1.js → mode-json.0.0.31-alpha.9.Br7xisR1.js} +0 -0
- /package/dist/interface/assets/{mode-yaml.0.0.31-alpha.7.CIYL8U3d.js → mode-yaml.0.0.31-alpha.9.CIYL8U3d.js} +0 -0
- /package/dist/interface/assets/{v-calendar.0.0.31-alpha.7.CtSuDYZU.css → v-calendar.0.0.31-alpha.9.CtSuDYZU.css} +0 -0
- /package/dist/interface/assets/{vue3-toastify.0.0.31-alpha.7.DTY1DMRs.css → vue3-toastify.0.0.31-alpha.9.DTY1DMRs.css} +0 -0
- /package/dist/interface/assets/{vuetify.0.0.31-alpha.7.Cip-kMKR.css → vuetify.0.0.31-alpha.9.Cip-kMKR.css} +0 -0
- /package/dist/interface/{axios.C-n2IhIP.0.0.31-alpha.7.js → axios.C-n2IhIP.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{compare-versions.DqEOhma6.0.0.31-alpha.7.js → compare-versions.DqEOhma6.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{dijkstrajs.D_NXgYpA.0.0.31-alpha.7.js → dijkstrajs.D_NXgYpA.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{engine.io-parser.BiEtp6m2.0.0.31-alpha.7.js → engine.io-parser.BiEtp6m2.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{entities.C20TfXL6.0.0.31-alpha.7.js → entities.C20TfXL6.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{get-size.D1dS-IaP.0.0.31-alpha.7.js → get-size.D1dS-IaP.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{mdurl.k9Sl0PQj.0.0.31-alpha.7.js → mdurl.k9Sl0PQj.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{punycode.js.Dj65hjkv.0.0.31-alpha.7.js → punycode.js.Dj65hjkv.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{react-dnd-html5-backend.1HQjlkwI.0.0.31-alpha.7.js → react-dnd-html5-backend.1HQjlkwI.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{redux.CuxFRhX_.0.0.31-alpha.7.js → redux.CuxFRhX_.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{tslib.9k7AwCpt.0.0.31-alpha.7.js → tslib.9k7AwCpt.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{types.Cz9TaZAP.0.0.31-alpha.7.js → types.Cz9TaZAP.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{uc.micro.kMc2yuuw.0.0.31-alpha.7.js → uc.micro.kMc2yuuw.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{utils.mAKpSMLY.0.0.31-alpha.7.js → utils.mAKpSMLY.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{uuid.DvF23Exx.0.0.31-alpha.7.js → uuid.DvF23Exx.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{vue.l0sNRNKZ.0.0.31-alpha.7.js → vue.l0sNRNKZ.0.0.31-alpha.9.js} +0 -0
- /package/dist/interface/{zod.DnW1_kUe.0.0.31-alpha.7.js → zod.DnW1_kUe.0.0.31-alpha.9.js} +0 -0
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
// export const CSR_CERT_FILENAME = 'camera.ui.csr.cert.pem';
|
|
2
1
|
export const HOST_CERT_FILENAME = 'camera.ui.cert.pem';
|
|
3
2
|
export const HOST_KEY_FILENAME = 'camera.ui.key.pem';
|
|
4
3
|
export const ROOT_CERT_FILENAME = 'camera.ui.root.cert.pem';
|
|
5
4
|
export const ROOT_KEY_FILENAME = 'camera.ui.root.key.pem';
|
|
6
|
-
export const P12_FILENAME = 'camera.ui.p12';
|
|
7
|
-
export const P12_PASSWORD = 'camera.ui';
|
|
8
5
|
export const DEFAULTS = {
|
|
9
6
|
C: 'DE',
|
|
10
7
|
ST: 'Berlin',
|
|
11
8
|
L: 'Berlin',
|
|
12
|
-
O: '
|
|
13
|
-
OU: '
|
|
14
|
-
CN: '
|
|
15
|
-
ROOT_CN: '
|
|
9
|
+
O: 'Camera UI',
|
|
10
|
+
OU: 'Camera UI Dev',
|
|
11
|
+
CN: 'localhost',
|
|
12
|
+
ROOT_CN: 'Camera UI Root CA',
|
|
16
13
|
};
|
|
17
14
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/api/utils/constants.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/api/utils/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC;AAC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAE1D,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,CAAC,EAAE,IAAI;IACP,EAAE,EAAE,QAAQ;IACZ,CAAC,EAAE,QAAQ;IACX,CAAC,EAAE,WAAW;IACd,EAAE,EAAE,eAAe;IACnB,EAAE,EAAE,WAAW;IACf,OAAO,EAAE,mBAAmB;CAC7B,CAAC"}
|
|
@@ -7,9 +7,9 @@ export class NotificationsNamespace {
|
|
|
7
7
|
this.logger = container.resolve('logger');
|
|
8
8
|
this.nsp = io.of(this.nspName);
|
|
9
9
|
this.nsp.on('connection', (socket) => {
|
|
10
|
-
socket.on('clear-notifications', this.clearNotifications.bind(this));
|
|
11
10
|
socket.on('get-notifications', this.getNotifications.bind(this));
|
|
12
11
|
socket.on('remove-notification', (id) => this.removeNotification(id));
|
|
12
|
+
socket.on('clear-notifications', this.clearNotifications.bind(this));
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
clearNotifications() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../../../../src/api/websocket/nsp/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC,MAAM,OAAO,sBAAsB;IAC1B,GAAG,CAAY;IACf,OAAO,GAAc,gBAAgB,CAAC;IAErC,MAAM,CAAgB;IAE9B,YAAY,EAAU;QACpB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,OAAO,CAAgB,QAAQ,CAAC,CAAC;QAEzD,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,MAAc,EAAE,EAAE;YAC3C,MAAM,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../../../../src/api/websocket/nsp/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC,MAAM,OAAO,sBAAsB;IAC1B,GAAG,CAAY;IACf,OAAO,GAAc,gBAAgB,CAAC;IAErC,MAAM,CAAgB;IAE9B,YAAY,EAAU;QACpB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,OAAO,CAAgB,QAAQ,CAAC,CAAC;QAEzD,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,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;
|
|
11
11
|
constructor(io: Server);
|
|
12
|
-
getUpdates(payload
|
|
12
|
+
getUpdates(payload?: any, callback?: Function): {
|
|
13
13
|
server?: INpmPluginState;
|
|
14
14
|
plugins: INpmPluginState[];
|
|
15
15
|
};
|
|
@@ -37,7 +37,7 @@ export class ServerNamespace {
|
|
|
37
37
|
}
|
|
38
38
|
async checkUpdate() {
|
|
39
39
|
await Promise.allSettled([this.checkServerUpdate(), this.checkPluginUpdates()]);
|
|
40
|
-
this.nsp.emit('updates', this.getUpdates(
|
|
40
|
+
this.nsp.emit('updates', this.getUpdates());
|
|
41
41
|
}
|
|
42
42
|
async checkServerUpdate() {
|
|
43
43
|
try {
|
|
@@ -60,7 +60,11 @@ export class ServerNamespace {
|
|
|
60
60
|
latestVersion: updateAvailable,
|
|
61
61
|
};
|
|
62
62
|
if (updateAvailable) {
|
|
63
|
-
this.logger.
|
|
63
|
+
const notification = this.logger.createNotification('system-update', 'Update', 'New camera.ui udate available', 'info', '/plugins');
|
|
64
|
+
this.logger.notify(notification);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
this.logger.removeNotification('system-update', true);
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
catch {
|
|
@@ -79,7 +83,11 @@ export class ServerNamespace {
|
|
|
79
83
|
}
|
|
80
84
|
this.pluginUpdates = pluginStates;
|
|
81
85
|
if (pluginStates.length > 0) {
|
|
82
|
-
this.logger.
|
|
86
|
+
const notification = this.logger.createNotification('plugin-update', 'Plugin Update', 'New plugin updates available', 'info', '/plugins');
|
|
87
|
+
this.logger.notify(notification);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.logger.removeNotification('plugin-update', true);
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../src/api/websocket/nsp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,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(PLUGIN_STATUS.STARTED);
|
|
194
|
-
this.logger.debug(this.getLogPrefix(),
|
|
194
|
+
this.logger.debug(this.getLogPrefix(), 'Frame Worker ready');
|
|
195
195
|
_resolve();
|
|
196
196
|
break;
|
|
197
197
|
case 'getFFmpegArgs':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../../src/decoder/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAYrG,MAAM,OAAO,WAAY,SAAQ,UAAU;IACzB,aAAa,CAAS;IAE/B,IAAI,CAAS;IAEH,OAAO,GAAG,IAAI,GAAG,EAA6B,CAAC;IACxD,OAAO,CAAS;IAChB,UAAU,CAAS;IAEnB,SAAS,CAAmB;IAC5B,UAAU,CAAqB;IAE/B,WAAW,CAAmB;IAE9B,MAAM,CAAS;IACf,aAAa,CAAgB;IAC7B,aAAa,CAAgB;IAC7B,YAAY,CAAmB;IAE/B,WAAW,CAAgB;IAC3B,WAAW,GAAG,KAAK,CAAC;IACpB,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,GAAG,KAAK,CAAC;IACnB,IAAI,CAAa;IACjB,cAAc,CAAW;IACzB,UAAU,GAAe,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,E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AAY,CAAC,IAAI,CAAC,CAAC;oBACxH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,+EAA+E,CAAC,CAAC;oBACvH,MAAM,GAAG,YAAY,CAAC;gBACxB,CAAC;gBAED,cAAc,CAAC,QAAQ,GAAG;oBACxB,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO;oBACtC,UAAU,EAAE,IAAI,CAAC,UAAU;iBAC5B,CAAC;gBACF,MAAM;YACR,KAAK,cAAc;gBACjB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAyB,CAAC,CAAC;gBAC3E,MAAM;YACR,KAAK,cAAc;gBACjB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAC3C,MAAM;QACV,CAAC;QAED,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IACpC,CAAC;IAEO,SAAS,CAAC,MAAqB;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,MAAM,WAAW,GAAkB;YACjC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,MAAM,EAAE,MAAM;aACf;SACF,CAAC;QAEF,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,4BAA4B,EAAE,WAAW,CAAC,CAAC;IACtF,CAAC;IAEO,YAAY;QAClB,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC;IACtC,CAAC;CACF"}
|
|
@@ -6,6 +6,11 @@ import type { LoggingLevel } from '../config/types.js';
|
|
|
6
6
|
export declare class LoggerService extends Logger {
|
|
7
7
|
notifications: UiNotification[];
|
|
8
8
|
constructor(options?: LoggerOptions);
|
|
9
|
-
notify(title: string, text: string, type: LoggingLevel, link: string):
|
|
9
|
+
notify(title: string, text: string, type: LoggingLevel, link: string): UiNotification | undefined;
|
|
10
|
+
notify(notification: UiNotification): UiNotification | undefined;
|
|
11
|
+
removeNotification(id: string, notify: boolean): void;
|
|
12
|
+
removeNotification(notification: UiNotification, notify: boolean): void;
|
|
13
|
+
clearNotifications(notifiy: boolean): void;
|
|
14
|
+
createNotification(id: string | undefined, title: string, text: string, type: LoggingLevel, link: string): UiNotification;
|
|
10
15
|
private checkIfNotificationExists;
|
|
11
16
|
}
|
|
@@ -8,28 +8,60 @@ export class LoggerService extends Logger {
|
|
|
8
8
|
super({ ...options, prefix: 'camera.ui' });
|
|
9
9
|
container.registerInstance('logger', this);
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
notify(notificationOrTitle, text, type, link) {
|
|
12
|
+
let notification;
|
|
13
|
+
if (typeof notificationOrTitle === 'string') {
|
|
14
|
+
notification = this.createNotification(undefined, notificationOrTitle, text, type, link);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
notification = notificationOrTitle;
|
|
18
|
+
}
|
|
19
|
+
if (this.checkIfNotificationExists(notification)) {
|
|
13
20
|
return;
|
|
14
21
|
}
|
|
22
|
+
if (this.notifications.length > 100) {
|
|
23
|
+
this.notifications.pop();
|
|
24
|
+
}
|
|
25
|
+
this.notifications.unshift(notification);
|
|
26
|
+
this.trace('New notification', JSON.stringify(notification));
|
|
15
27
|
const socketService = container.resolve('socketService');
|
|
28
|
+
socketService.io.of('/notifications').emit('notifications', this.notifications);
|
|
29
|
+
return notification;
|
|
30
|
+
}
|
|
31
|
+
removeNotification(notificationOrId, notify) {
|
|
32
|
+
let notification;
|
|
33
|
+
if (typeof notificationOrId === 'string') {
|
|
34
|
+
notification = this.notifications.find((n) => n._id === notificationOrId);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
notification = notificationOrId;
|
|
38
|
+
}
|
|
39
|
+
this.notifications = this.notifications.filter((n) => n._id !== notification._id);
|
|
40
|
+
if (notify && notification) {
|
|
41
|
+
const socketService = container.resolve('socketService');
|
|
42
|
+
socketService.io.of('/notifications').emit('notifications', this.notifications);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
clearNotifications(notifiy) {
|
|
46
|
+
this.notifications = [];
|
|
47
|
+
if (notifiy) {
|
|
48
|
+
const socketService = container.resolve('socketService');
|
|
49
|
+
socketService.io.of('/notifications').emit('clear-notifications');
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
createNotification(id = uuidv4(), title, text, type, link) {
|
|
16
53
|
const notification = {
|
|
17
|
-
_id:
|
|
54
|
+
_id: id,
|
|
18
55
|
title,
|
|
19
56
|
text,
|
|
20
57
|
type,
|
|
21
58
|
timestamp: Date.now(),
|
|
22
59
|
link,
|
|
23
60
|
};
|
|
24
|
-
|
|
25
|
-
this.notifications.pop();
|
|
26
|
-
}
|
|
27
|
-
this.notifications.unshift(notification);
|
|
28
|
-
this.debug('New notification', JSON.stringify(notification));
|
|
29
|
-
socketService.io.of('/notifications').emit('notifications', this.notifications);
|
|
61
|
+
return notification;
|
|
30
62
|
}
|
|
31
|
-
checkIfNotificationExists(
|
|
32
|
-
return this.notifications.some((
|
|
63
|
+
checkIfNotificationExists(notification) {
|
|
64
|
+
return this.notifications.some((n) => n._id === notification._id || (n.title === notification.title && n.text === notification.text && n.type === notification.type && n.link === notification.link));
|
|
33
65
|
}
|
|
34
66
|
}
|
|
35
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/services/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,EAAE,IAAI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,aAAa,GAAG,EAAE,CAAC;QAExB,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,aAAa,GAAG,SAAS,CAAC,OAAO,CAAgB,eAAe,CAAC,CAAC;YACxE,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IAEM,kBAAkB,CAAC,EAAE,GAAG,MAAM,EAAE,EAAE,KAAa,EAAE,IAAY,EAAE,IAAkB,EAAE,IAAY;QACpG,MAAM,YAAY,GAAmB;YACnC,GAAG,EAAE,EAAE;YACP,KAAK;YACL,IAAI;YACJ,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,IAAI;SACL,CAAC;QAEF,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,yBAAyB,CAAC,YAA4B;QAC5D,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAC5B,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,GAAG,KAAK,YAAY,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,KAAK,YAAY,CAAC,KAAK,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,CACjK,CAAC;IACJ,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "camera.ui3",
|
|
3
|
-
"version": "0.0.31-alpha.
|
|
3
|
+
"version": "0.0.31-alpha.9",
|
|
4
4
|
"description": "camera.ui",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@camera.ui/common": "^0.0.17",
|
|
30
30
|
"@camera.ui/go2rtc": "^0.0.23",
|
|
31
31
|
"@camera.ui/nats": "^0.0.12",
|
|
32
|
-
"@camera.ui/plugineer": "^0.0.
|
|
32
|
+
"@camera.ui/plugineer": "^0.0.17",
|
|
33
33
|
"@camera.ui/types": "^0.0.72",
|
|
34
34
|
"@fastify/cors": "^9.0.1",
|
|
35
35
|
"@fastify/formbody": "^7.4.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"eslint": "8.57.0",
|
|
97
97
|
"eslint-config-prettier": "^9.1.0",
|
|
98
98
|
"eslint-plugin-prettier": "^5.2.1",
|
|
99
|
-
"nodemon": "^3.1.
|
|
99
|
+
"nodemon": "^3.1.5",
|
|
100
100
|
"prettier": "^3.3.3",
|
|
101
101
|
"rimraf": "^6.0.1",
|
|
102
102
|
"tsx": "^4.19.1",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
var Tt=Object.defineProperty;var Ot=(r,t,e)=>t in r?Tt(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var p=(r,t,e)=>Ot(r,typeof t!="symbol"?t+"":t,e);var Ct={855:r=>{const t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,e=()=>t.now(),s=i=>i===1/0||(o=>o&&o===Math.floor(o)&&o>0&&isFinite(o))(i);class n{constructor({max:o=1/0,ttl:a,updateAgeOnGet:c=!1,checkAgeOnGet:u=!1,noUpdateTTL:h=!1,dispose:l,noDisposeOnSet:g=!1}={}){if(this.expirations=Object.create(null),this.data=new Map,this.expirationMap=new Map,a!==void 0&&!s(a))throw new TypeError("ttl must be positive integer or Infinity if set");if(!s(o))throw new TypeError("max must be positive integer or Infinity");if(this.ttl=a,this.max=o,this.updateAgeOnGet=!!c,this.checkAgeOnGet=!!u,this.noUpdateTTL=!!h,this.noDisposeOnSet=!!g,l!==void 0){if(typeof l!="function")throw new TypeError("dispose must be function if set");this.dispose=l}this.timer=void 0,this.timerExpiration=void 0}setTimer(o,a){if(this.timerExpiration<o)return;this.timer&&clearTimeout(this.timer);const c=setTimeout(()=>{this.timer=void 0,this.timerExpiration=void 0,this.purgeStale();for(const u in this.expirations){this.setTimer(u,u-e());break}},a);c.unref&&c.unref(),this.timerExpiration=o,this.timer=c}cancelTimer(){this.timer&&(clearTimeout(this.timer),this.timerExpiration=void 0,this.timer=void 0)}cancelTimers(){return process.emitWarning('TTLCache.cancelTimers has been renamed to TTLCache.cancelTimer (no "s"), and will be removed in the next major version update'),this.cancelTimer()}clear(){const o=this.dispose!==n.prototype.dispose?[...this]:[];this.data.clear(),this.expirationMap.clear(),this.cancelTimer(),this.expirations=Object.create(null);for(const[a,c]of o)this.dispose(c,a,"delete")}setTTL(o,a=this.ttl){const c=this.expirationMap.get(o);if(c!==void 0){const u=this.expirations[c];!u||u.length<=1?delete this.expirations[c]:this.expirations[c]=u.filter(h=>h!==o)}if(a!==1/0){const u=Math.floor(e()+a);this.expirationMap.set(o,u),this.expirations[u]||(this.expirations[u]=[],this.setTimer(u,a)),this.expirations[u].push(o)}else this.expirationMap.set(o,1/0)}set(o,a,{ttl:c=this.ttl,noUpdateTTL:u=this.noUpdateTTL,noDisposeOnSet:h=this.noDisposeOnSet}={}){if(!s(c))throw new TypeError("ttl must be positive integer or Infinity");if(this.expirationMap.has(o)){u||this.setTTL(o,c);const l=this.data.get(o);l!==a&&(this.data.set(o,a),h||this.dispose(l,o,"set"))}else this.setTTL(o,c),this.data.set(o,a);for(;this.size>this.max;)this.purgeToCapacity();return this}has(o){return this.data.has(o)}getRemainingTTL(o){const a=this.expirationMap.get(o);return a===1/0?a:a!==void 0?Math.max(0,Math.ceil(a-e())):0}get(o,{updateAgeOnGet:a=this.updateAgeOnGet,ttl:c=this.ttl,checkAgeOnGet:u=this.checkAgeOnGet}={}){const h=this.data.get(o);if(!u||this.getRemainingTTL(o)!==0)return a&&this.setTTL(o,c),h;this.delete(o)}dispose(o,a){}delete(o){const a=this.expirationMap.get(o);if(a!==void 0){const c=this.data.get(o);this.data.delete(o),this.expirationMap.delete(o);const u=this.expirations[a];return u&&(u.length<=1?delete this.expirations[a]:this.expirations[a]=u.filter(h=>h!==o)),this.dispose(c,o,"delete"),this.size===0&&this.cancelTimer(),!0}return!1}purgeToCapacity(){for(const o in this.expirations){const a=this.expirations[o];if(!(this.size-a.length>=this.max)){const c=this.size-this.max,u=[];for(const h of a.splice(0,c))u.push([h,this.data.get(h)]),this.data.delete(h),this.expirationMap.delete(h);for(const[h,l]of u)this.dispose(l,h,"evict");return}{delete this.expirations[o];const c=[];for(const u of a)c.push([u,this.data.get(u)]),this.data.delete(u),this.expirationMap.delete(u);for(const[u,h]of c)this.dispose(h,u,"evict")}}}get size(){return this.data.size}purgeStale(){const o=Math.ceil(e());for(const a in this.expirations){if(a==="Infinity"||a>o)return;const c=[...this.expirations[a]||[]],u=[];delete this.expirations[a];for(const h of c)u.push([h,this.data.get(h)]),this.data.delete(h),this.expirationMap.delete(h);for(const[h,l]of u)this.dispose(l,h,"stale")}this.size===0&&this.cancelTimer()}*entries(){for(const o in this.expirations)for(const a of this.expirations[o])yield[a,this.data.get(a)]}*keys(){for(const o in this.expirations)for(const a of this.expirations[o])yield a}*values(){for(const o in this.expirations)for(const a of this.expirations[o])yield this.data.get(a)}[Symbol.iterator](){return this.entries()}}r.exports=n}},Pe={};function O(r){var t=Pe[r];if(t!==void 0)return t.exports;var e=Pe[r]={exports:{}};return Ct[r](e,e.exports,O),e.exports}O.n=r=>{var t=r&&r.__esModule?()=>r.default:()=>r;return O.d(t,{a:t}),t},O.d=(r,t)=>{for(var e in t)O.o(t,e)&&!O.o(r,e)&&Object.defineProperty(r,e,{enumerable:!0,get:t[e]})},O.o=(r,t)=>Object.prototype.hasOwnProperty.call(r,t),O.r=r=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var st={};O.d(st,{j:()=>_s});var we={};O.r(we),O.d(we,{Decoder:()=>Le,Encoder:()=>ws,PacketType:()=>b,protocol:()=>vs});class At{constructor(t){p(this,"baseURL");p(this,"abortControllers",new Set);this.baseURL=`${t}/api`}async request(t,e,s,n={}){const i=new AbortController;this.abortControllers.add(i);const o=setTimeout(()=>{i.abort(),this.abortControllers.delete(i)},15e3);try{const a=await fetch(`${this.baseURL}${e}`,{method:t,headers:{"Content-Type":"application/json",...n.headers},body:s?JSON.stringify(s):void 0,signal:i.signal,...n});if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a}finally{clearTimeout(o),this.abortControllers.delete(i)}}get(t,e){return this.request("GET",t,void 0,e)}post(t,e,s){return this.request("POST",t,e,s)}}class Rt{constructor(){p(this,"subscriptions",[]);p(this,"additionalSubscriptions",[])}addSubscriptions(...t){this.subscriptions.push(...t)}addAdditionalSubscriptions(...t){this.additionalSubscriptions.push(...t)}unsubscribe(){this.subscriptions.forEach(t=>t.unsubscribe())}unsubscribeAdditional(){this.additionalSubscriptions.forEach(t=>t.unsubscribe())}}function U(r,t,e=!1){if(r===t)return!0;if((r===void 0||t===void 0||r===null||t===null)&&(r||t))return!1;const s=r==null?void 0:r.constructor.name,n=t==null?void 0:t.constructor.name;if(s!==n)return!1;if(s==="Array"&&n==="Array"){if(r.length!==t.length)return!1;if(e){const i=[...t];return r.every(o=>{const a=i.findIndex(c=>U(o,c,e));return a!==-1&&(i.splice(a,1),!0)})}{let i=!0;for(let o=0;o<r.length;o++)if(!U(r[o],t[o],e)){i=!1;break}return i}}if(s==="Object"&&n==="Object"){let i=!0;const o=Object.keys(r),a=Object.keys(t);if(o.length!==a.length)return!1;for(let c=0;c<o.length;c++)if(r[o[c]]&&t[o[c]]){if(r[o[c]]===t[o[c]])continue;if(!r[o[c]]||r[o[c]].constructor.name!=="Array"&&r[o[c]].constructor.name!=="Object"){if(r[o[c]]!==t[o[c]]){i=!1;break}}else if(i=U(r[o[c]],t[o[c]],e),!i)break}else if(r[o[c]]&&!t[o[c]]||!r[o[c]]&&t[o[c]]){i=!1;break}return i}return r===t}function C(r){return JSON.parse(JSON.stringify(r))}var Bt=O(855),jt=O.n(Bt),Se=function(r,t){return Se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])},Se(r,t)};function q(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=r}Se(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function rt(r,t){var e,s,n,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(u){return function(h){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,h[0]&&(i=0)),i;)try{if(e=1,s&&(n=2&h[0]?s.return:h[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,h[1])).done)return n;switch(s=0,n&&(h=[2&h[0],n.value]),h[0]){case 0:case 1:n=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,s=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(!((n=(n=i.trys).length>0&&n[n.length-1])||h[0]!==6&&h[0]!==2)){i=0;continue}if(h[0]===3&&(!n||h[1]>n[0]&&h[1]<n[3])){i.label=h[1];break}if(h[0]===6&&i.label<n[1]){i.label=n[1],n=h;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(h);break}n[2]&&i.ops.pop(),i.trys.pop();continue}h=t.call(r,i)}catch(l){h=[6,l],s=0}finally{e=n=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([c,u])}}}function z(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],s=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&s>=r.length&&(r=void 0),{value:r&&r[s++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var s,n,i=e.call(r),o=[];try{for(;(t===void 0||t-- >0)&&!(s=i.next()).done;)o.push(s.value)}catch(a){n={error:a}}finally{try{s&&!s.done&&(e=i.return)&&e.call(i)}finally{if(n)throw n.error}}return o}function re(r,t,e){if(arguments.length===2)for(var s,n=0,i=t.length;n<i;n++)!s&&n in t||(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return r.concat(s||Array.prototype.slice.call(t))}function N(r){return this instanceof N?(this.v=r,this):new N(r)}function E(r){return typeof r=="function"}function nt(r){var t=r(function(e){Error.call(e),e.stack=new Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ue=nt(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
2
|
-
`+t.map(function(e,s){return s+1+") "+e.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function ke(r,t){if(r){var e=r.indexOf(t);0<=e&&r.splice(e,1)}}var oe=function(){function r(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var t,e,s,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=z(o),c=a.next();!c.done;c=a.next())c.value.remove(this)}catch(d){t={error:d}}finally{try{c&&!c.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(E(u))try{u()}catch(d){i=d instanceof ue?d.errors:[d]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=z(h),g=l.next();!g.done;g=l.next()){var y=g.value;try{Me(y)}catch(d){i=i??[],d instanceof ue?i=re(re([],se(i)),se(d.errors)):i.push(d)}}}catch(d){s={error:d}}finally{try{g&&!g.done&&(n=l.return)&&n.call(l)}finally{if(s)throw s.error}}}if(i)throw new ue(i)}},r.prototype.add=function(t){var e;if(t&&t!==this)if(this.closed)Me(t);else{if(t instanceof r){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(e=this._finalizers)!==null&&e!==void 0?e:[]).push(t)}},r.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},r.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},r.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&ke(e,t)},r.prototype.remove=function(t){var e=this._finalizers;e&&ke(e,t),t instanceof r&&t._removeParent(this)},r.EMPTY=function(){var t=new r;return t.closed=!0,t}(),r}(),it=oe.EMPTY;function ot(r){return r instanceof oe||r&&"closed"in r&&E(r.remove)&&E(r.add)&&E(r.unsubscribe)}function Me(r){E(r)?r():r.unsubscribe()}var at={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Lt={setTimeout:function(r,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];return setTimeout.apply(void 0,re([r,t],se(e)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function ct(r){Lt.setTimeout(function(){throw r})}function De(){}function Z(r){r()}var Be=function(r){function t(e){var s=r.call(this)||this;return s.isStopped=!1,e?(s.destination=e,ot(e)&&e.add(s)):s.destination=Dt,s}return q(t,r),t.create=function(e,s,n){return new H(e,s,n)},t.prototype.next=function(e){this.isStopped?void 0:this._next(e)},t.prototype.error=function(e){this.isStopped?void 0:(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?void 0:(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(oe),Pt=Function.prototype.bind;function le(r,t){return Pt.call(r,t)}var Mt=function(){function r(t){this.partialObserver=t}return r.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(s){Y(s)}},r.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(s){Y(s)}else Y(t)},r.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(e){Y(e)}},r}(),H=function(r){function t(e,s,n){var i,o,a=r.call(this)||this;return E(e)||!e?i={next:e??void 0,error:s??void 0,complete:n??void 0}:a&&at.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return a.unsubscribe()},i={next:e.next&&le(e.next,o),error:e.error&&le(e.error,o),complete:e.complete&&le(e.complete,o)}):i=e,a.destination=new Mt(i),a}return q(t,r),t}(Be);function Y(r){ct(r)}var Dt={closed:!0,next:De,error:function(r){throw r},complete:De},xe=typeof Symbol=="function"&&Symbol.observable||"@@observable";function qt(r){return r}var M=function(){function r(t){t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,s){var n=this,i=function(o){return o&&o instanceof Be||function(a){return a&&E(a.next)&&E(a.error)&&E(a.complete)}(o)&&ot(o)}(t)?t:new H(t,e,s);return Z(function(){var o=n,a=o.operator,c=o.source;i.add(a?a.call(i,c):c?n._subscribe(i):n._trySubscribe(i))}),i},r.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},r.prototype.forEach=function(t,e){var s=this;return new(e=qe(e))(function(n,i){var o=new H({next:function(a){try{t(a)}catch(c){i(c),o.unsubscribe()}},error:i,complete:n});s.subscribe(o)})},r.prototype._subscribe=function(t){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(t)},r.prototype[xe]=function(){return this},r.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return((s=t).length===0?qt:s.length===1?s[0]:function(n){return s.reduce(function(i,o){return o(i)},n)})(this);var s},r.prototype.toPromise=function(t){var e=this;return new(t=qe(t))(function(s,n){var i;e.subscribe(function(o){return i=o},function(o){return n(o)},function(){return s(i)})})},r.create=function(t){return new r(t)},r}();function qe(r){var t;return(t=r??at.Promise)!==null&&t!==void 0?t:Promise}var It=nt(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ae=function(r){function t(){var e=r.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return q(t,r),t.prototype.lift=function(e){var s=new Ie(this,this);return s.operator=e,s},t.prototype._throwIfClosed=function(){if(this.closed)throw new It},t.prototype.next=function(e){var s=this;Z(function(){var n,i;if(s._throwIfClosed(),!s.isStopped){s.currentObservers||(s.currentObservers=Array.from(s.observers));try{for(var o=z(s.currentObservers),a=o.next();!a.done;a=o.next())a.value.next(e)}catch(c){n={error:c}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var s=this;Z(function(){if(s._throwIfClosed(),!s.isStopped){s.hasError=s.isStopped=!0,s.thrownError=e;for(var n=s.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Z(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var s=e.observers;s.length;)s.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return((e=this.observers)===null||e===void 0?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(e){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,e)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var s=this,n=this,i=n.hasError,o=n.isStopped,a=n.observers;return i||o?it:(this.currentObservers=null,a.push(e),new oe(function(){s.currentObservers=null,ke(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var s=this,n=s.hasError,i=s.thrownError,o=s.isStopped;n?e.error(i):o&&e.complete()},t.prototype.asObservable=function(){var e=new M;return e.source=this,e},t.create=function(e,s){return new Ie(e,s)},t}(M),Ie=function(r){function t(e,s){var n=r.call(this)||this;return n.destination=e,n.source=s,n}return q(t,r),t.prototype.next=function(e){var s,n;(n=(s=this.destination)===null||s===void 0?void 0:s.next)===null||n===void 0||n.call(s,e)},t.prototype.error=function(e){var s,n;(n=(s=this.destination)===null||s===void 0?void 0:s.error)===null||n===void 0||n.call(s,e)},t.prototype.complete=function(){var e,s;(s=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||s===void 0||s.call(e)},t.prototype._subscribe=function(e){var s,n;return(n=(s=this.source)===null||s===void 0?void 0:s.subscribe(e))!==null&&n!==void 0?n:it},t}(ae),L=function(r){function t(e){var s=r.call(this)||this;return s._value=e,s}return q(t,r),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(e){var s=r.prototype._subscribe.call(this,e);return!s.closed&&e.next(this._value),s},t.prototype.getValue=function(){var e=this,s=e.hasError,n=e.thrownError,i=e._value;if(s)throw n;return this._throwIfClosed(),i},t.prototype.next=function(e){r.prototype.next.call(this,this._value=e)},t}(ae),ht={now:function(){return(ht.delegate||Date).now()},delegate:void 0},pe=function(r){function t(e,s,n){e===void 0&&(e=1/0),s===void 0&&(s=1/0),n===void 0&&(n=ht);var i=r.call(this)||this;return i._bufferSize=e,i._windowTime=s,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=s===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,s),i}return q(t,r),t.prototype.next=function(e){var s=this,n=s.isStopped,i=s._buffer,o=s._infiniteTimeWindow,a=s._timestampProvider,c=s._windowTime;n||(i.push(e),!o&&i.push(a.now()+c)),this._trimBuffer(),r.prototype.next.call(this,e)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var s=this._innerSubscribe(e),n=this._infiniteTimeWindow,i=this._buffer.slice(),o=0;o<i.length&&!e.closed;o+=n?1:2)e.next(i[o]);return this._checkFinalizedStatuses(e),s},t.prototype._trimBuffer=function(){var e=this,s=e._bufferSize,n=e._timestampProvider,i=e._buffer,o=e._infiniteTimeWindow,a=(o?1:2)*s;if(s<1/0&&a<i.length&&i.splice(0,i.length-a),!o){for(var c=n.now(),u=0,h=1;h<i.length&&i[h]<=c;h+=2)u=h;u&&i.splice(0,u+1)}},t}(ae);function J(r){return function(t){if(function(e){return E(e==null?void 0:e.lift)}(t))return t.lift(function(e){try{return r(e,this)}catch(s){this.error(s)}});throw new TypeError("Unable to lift unknown Observable type")}}function $(r,t,e,s,n){return new Nt(r,t,e,s,n)}var Nt=function(r){function t(e,s,n,i,o,a){var c=r.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=s?function(u){try{s(u)}catch(h){e.error(h)}}:r.prototype._next,c._error=i?function(u){try{i(u)}catch(h){e.error(h)}finally{this.unsubscribe()}}:r.prototype._error,c._complete=n?function(){try{n()}catch(u){e.error(u)}finally{this.unsubscribe()}}:r.prototype._complete,c}return q(t,r),t.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var s=this.closed;r.prototype.unsubscribe.call(this),!s&&((e=this.onFinalize)===null||e===void 0||e.call(this))}},t}(Be);function Ne(){return J(function(r,t){var e,s=!1;r.subscribe($(t,function(n){var i=e;e=n,s&&t.next([i,n]),s=!0}))})}function Ue(r,t){return J(function(e,s){var n=0;e.subscribe($(s,function(i){return r.call(t,i,n++)&&s.next(i)}))})}function ut(r,t){return J(function(e,s){var n=0;e.subscribe($(s,function(i){s.next(r.call(t,i,n++))}))})}var Ut=function(r){return r&&typeof r.length=="number"&&typeof r!="function"},Vt=typeof Symbol=="function"&&Symbol.iterator?Symbol.iterator:"@@iterator";function ne(r){if(r instanceof M)return r;if(r!=null){if(function(i){return E(i[xe])}(r))return n=r,new M(function(i){var o=n[xe]();if(E(o.subscribe))return o.subscribe(i);throw new TypeError("Provided object does not correctly implement Symbol.observable")});if(Ut(r))return s=r,new M(function(i){for(var o=0;o<s.length&&!i.closed;o++)i.next(s[o]);i.complete()});if(function(i){return E(i==null?void 0:i.then)}(r))return e=r,new M(function(i){e.then(function(o){i.closed||(i.next(o),i.complete())},function(o){return i.error(o)}).then(null,ct)});if(function(i){return Symbol.asyncIterator&&E(i==null?void 0:i[Symbol.asyncIterator])}(r))return Ve(r);if(function(i){return E(i==null?void 0:i[Vt])}(r))return t=r,new M(function(i){var o,a;try{for(var c=z(t),u=c.next();!u.done;u=c.next()){var h=u.value;if(i.next(h),i.closed)return}}catch(l){o={error:l}}finally{try{u&&!u.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}i.complete()});if(function(i){return E(i==null?void 0:i.getReader)}(r))return Ve(function(i){return function(o,a,c){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u,h=c.apply(o,a||[]),l=[];return u=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),g("next"),g("throw"),g("return",function(f){return function(m){return Promise.resolve(m).then(f,v)}}),u[Symbol.asyncIterator]=function(){return this},u;function g(f,m){h[f]&&(u[f]=function(w){return new Promise(function(_,T){l.push([f,w,_,T])>1||y(f,w)})},m&&(u[f]=m(u[f])))}function y(f,m){try{(w=h[f](m)).value instanceof N?Promise.resolve(w.value.v).then(d,v):S(l[0][2],w)}catch(_){S(l[0][3],_)}var w}function d(f){y("next",f)}function v(f){y("throw",f)}function S(f,m){f(m),l.shift(),l.length&&y(l[0][0],l[0][1])}}(this,arguments,function(){var o,a,c;return rt(this,function(u){switch(u.label){case 0:o=i.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,N(o.read())];case 3:return a=u.sent(),c=a.value,a.done?[4,N(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,N(c)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return o.releaseLock(),[7];case 10:return[2]}})})}(r))}var t,e,s,n;throw function(i){return new TypeError("You provided "+(i!==null&&typeof i=="object"?"an invalid object":"'"+i+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(r)}function Ve(r){return new M(function(t){(function(e,s){var n,i,o,a,c,u,h,l;return c=this,u=void 0,l=function(){var g,y;return rt(this,function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),n=function(v){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var S,f=v[Symbol.asyncIterator];return f?f.call(v):(v=z(v),S={},m("next"),m("throw"),m("return"),S[Symbol.asyncIterator]=function(){return this},S);function m(w){S[w]=v[w]&&function(_){return new Promise(function(T,k){(function(P,kt,xt,_t){Promise.resolve(_t).then(function(Et){P({value:Et,done:xt})},kt)})(T,k,(_=v[w](_)).done,_.value)})}}}(e),d.label=1;case 1:return[4,n.next()];case 2:if((i=d.sent()).done)return[3,4];if(g=i.value,s.next(g),s.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return y=d.sent(),o={error:y},[3,11];case 6:return d.trys.push([6,,9,10]),i&&!i.done&&(a=n.return)?[4,a.call(n)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return s.complete(),[2]}})},new((h=void 0)||(h=Promise))(function(g,y){function d(f){try{S(l.next(f))}catch(m){y(m)}}function v(f){try{S(l.throw(f))}catch(m){y(m)}}function S(f){f.done?g(f.value):function(m){return m instanceof h?m:new h(function(w){w(m)})}(f.value).then(d,v)}S((l=l.apply(c,u||[])).next())})})(r,t).catch(function(e){return t.error(e)})})}function de(r){r===void 0&&(r={});var t=r.connector,e=t===void 0?function(){return new ae}:t,s=r.resetOnError,n=s===void 0||s,i=r.resetOnComplete,o=i===void 0||i,a=r.resetOnRefCountZero,c=a===void 0||a;return function(u){var h,l,g,y=0,d=!1,v=!1,S=function(){l==null||l.unsubscribe(),l=void 0},f=function(){S(),h=g=void 0,d=v=!1},m=function(){var w=h;f(),w==null||w.unsubscribe()};return J(function(w,_){y++,v||d||S();var T=g=g??e();_.add(function(){--y!=0||v||d||(l=fe(m,c))}),T.subscribe(_),!h&&y>0&&(h=new H({next:function(k){return T.next(k)},error:function(k){v=!0,S(),l=fe(f,n,k),T.error(k)},complete:function(){d=!0,S(),l=fe(f,o),T.complete()}}),ne(w).subscribe(h))})(u)}}function fe(r,t){for(var e=[],s=2;s<arguments.length;s++)e[s-2]=arguments[s];if(t!==!0){if(t!==!1){var n=new H({next:function(){n.unsubscribe(),r()}});return ne(t.apply(void 0,re([],se(e)))).subscribe(n)}}else r()}function lt(r,t,e){return e===void 0&&(e=1/0),E(t)?lt(function(s,n){return ut(function(i,o){return t(s,i,n,o)})(ne(r(s,n)))},e):(typeof t=="number"&&(e=t),J(function(s,n){return function(i,o,a,c,u,h,l,g){var y=[],d=0,v=0,S=!1,f=function(){!S||y.length||d||o.complete()},m=function(_){return d<c?w(_):y.push(_)},w=function(_){d++;var T=!1;ne(a(_,v++)).subscribe($(o,function(k){o.next(k)},function(){T=!0},void 0,function(){if(T)try{d--;for(var k=function(){var P=y.shift();w(P)};y.length&&d<c;)k();f()}catch(P){o.error(P)}}))};return i.subscribe($(o,m,function(){S=!0,f()})),function(){}}(s,n,r,e)}))}const Ft=(r,t)=>{const[e,s,n,i]=r,[o,a,c,u]=t,h=Math.max(e,o),l=Math.max(s,a),g=Math.min(n,c),y=Math.min(i,u),d=Math.max(0,g-h)*Math.max(0,y-l);return d/((n-e)*(i-s)+(c-o)*(u-a)-d)},Wt=(r,t)=>{const{origWidth:e,origHeight:s}=t,n=r.points.map(([i,o])=>[i*e/100,o*s/100]);return{...r,points:n}},Fe=r=>{const{origWidth:t,origHeight:e,inputWidth:s,inputHeight:n}=r,[i,o,a,c]=r.boundingBox,u=i*t/s,h=o*e/n,l=a*t/s,g=c*e/n;return{...r,boundingBox:[u,h,l,g]}},We=(r,t,e)=>{if(r.confidence<e.object.confidence)return!1;if(t.length===0)return!0;const[s,n,i,o]=r.boundingBox,a={xmin:s,ymin:n,xmax:i,ymax:o};let c=!1;for(const u of t){const h=Wt(u,r);if(h.isPrivacyMask){if(V(a,h.points)){c=!1;break}}else h.filter==="include"?h.type==="contain"?V(a,h.points)&&(c=!0):h.type==="intersect"&&(ze(a,h.points)||V(a,h.points))&&(c=!0):h.filter==="exclude"&&(h.type==="contain"?V(a,h.points)||(c=!0):h.type==="intersect"&&(ze(a,h.points)||V(a,h.points)||(c=!0)))}return c},ze=(r,t)=>{const e=zt(r);for(const s of e)for(let n=0;n<t.length;n++){const i=[t[n],t[(n+1)%t.length]];if(Ht(s,i))return!0}return!1},V=(r,t)=>[[r.xmin,r.ymin],[r.xmax,r.ymin],[r.xmax,r.ymax],[r.xmin,r.ymax]].every(e=>$t(e,t)),zt=r=>{const{xmin:t,ymin:e,xmax:s,ymax:n}=r;return[[[t,e],[s,e]],[[s,e],[s,n]],[[s,n],[t,n]],[[t,n],[t,e]]]},Ht=(r,t)=>{const e=(a,c,u)=>(u[1]-a[1])*(c[0]-a[0])>(c[1]-a[1])*(u[0]-a[0]);return s=r[0],n=r[1],e(s,i=t[0],o=t[1])!==e(n,i,o)&&e(s,n,i)!==e(s,n,o);var s,n,i,o},$t=(r,t)=>{const[e,s]=r;let n=!1,[i,o]=t[t.length-1];for(const[a,c]of t)c>s!=o>s&&e<(i-a)*(s-c)/(o-c)+a&&(n=!n),[i,o]=[a,c];return n};class Jt extends Rt{constructor(e,s){super();p(this,"logger");p(this,"snapshotCache");p(this,"cameraSubject");p(this,"cameraState",new L(!1));p(this,"lightState",new L(this.getLightState({state:!1},!0)));p(this,"motionState",new L(this.getMotionState({detections:[],state:!1},!0)));p(this,"audioState",new L(this.getAudioState({state:!1,db:0},!0)));p(this,"objectState",new L(this.getObjectState({detections:[]},!0)));p(this,"doorbellState",new L(this.getDoorbellState({state:!1},!0)));p(this,"sirenState",new L(this.getSirenState({state:!1,level:0},!0)));p(this,"batteryState",new L(this.getBatteryState({level:100,charging:!1,lowBattery:!1},!0)));p(this,"onConnected",this.createStateObservable(this.cameraState));p(this,"onLightSwitched",this.createStateObservable(this.lightState));p(this,"onMotionDetected",this.createStateObservable(this.motionState));p(this,"onAudioDetected",this.createStateObservable(this.audioState));p(this,"onObjectDetected",this.createStateObservable(this.objectState));p(this,"onDoorbellPressed",this.createStateObservable(this.doorbellState));p(this,"onSirenDetected",this.createStateObservable(this.sirenState));p(this,"onBatteryChanged",this.createStateObservable(this.batteryState));this.logger=s,this.cameraSubject=new L(e),this.updateCamera(e),this.snapshotCache=new(jt())({max:100,ttl:1e3*this.snapshotTTL}),e.pluginId==="native"&&this.cameraState.next(!0)}get cameraObject(){return C(this.cameraSubject.getValue())}get id(){return this.cameraSubject.getValue()._id}get nativeId(){return this.cameraSubject.getValue().nativeId}get pluginId(){return this.cameraSubject.getValue().pluginId}get connected(){return this.cameraState.getValue()}get disabled(){return this.cameraSubject.getValue().disabled}get name(){return this.cameraSubject.getValue().name}get type(){return this.cameraSubject.getValue().type}get info(){return C(this.cameraSubject.getValue().info)}get isCloud(){return this.cameraSubject.getValue().isCloud}get hasLight(){return this.cameraSubject.getValue().hasLight}get hasSiren(){return this.cameraSubject.getValue().hasSiren}get hasBinarySensor(){return this.cameraSubject.getValue().hasBinarySensor}get hasBattery(){return this.cameraSubject.getValue().hasBattery}get hasMotionDetector(){return this.cameraSubject.getValue().hasMotionDetector}get hasAudioDetector(){return this.cameraSubject.getValue().hasAudioDetector}get hasObjectDetector(){return this.cameraSubject.getValue().hasObjectDetector}get hasPtz(){return this.cameraSubject.getValue().hasPtz}get hasPrebuffer(){return this.cameraSubject.getValue().hasPrebuffer}get snapshotTTL(){return this.cameraSubject.getValue().snapshotTTL}get activityZones(){return C(this.cameraSubject.getValue().activityZones)}get activitySettings(){return C(this.cameraSubject.getValue().activitySettings)}get frameWorkerSettings(){return C(this.cameraSubject.getValue().frameWorkerSettings)}get streamSource(){return this.highResolutionSource||this.midResolutionSource||this.lowResolutionSource}get snapshotSource(){return this.sources.find(e=>e.roles.includes("snapshot")&&!e.internal)}get highResolutionSource(){return this.sources.find(e=>e.roles.includes("high-resolution")&&!e.internal)}get midResolutionSource(){return this.sources.find(e=>e.roles.includes("mid-resolution")&&!e.internal)}get lowResolutionSource(){return this.sources.find(e=>e.roles.includes("low-resolution")&&!e.internal)}get ptz(){return this.ptzDelegate}getValue(e){switch(e){case"light":return C(this.lightState.getValue());case"motion":return C(this.motionState.getValue());case"audio":return C(this.audioState.getValue());case"object":return C(this.objectState.getValue());case"doorbell":return C(this.doorbellState.getValue());case"siren":return C(this.sirenState.getValue());case"battery":return C(this.batteryState.getValue());default:throw new Error(`Unknown state: ${e}`)}}async snapshot(e){this.snapshotCache.purgeStale();const s=this.snapshotSource||this.streamSource,n=s.urls.www.jpegSnapshot,i=this.snapshotCache.get(s._id);if(!e&&i)return this.logger.trace(this.name,"Snapshot requested (cached)"),i;this.logger.trace(this.name,"Snapshot requested (fetching)");try{if(this.cameraObject.pluginId!=="native"){const h=await this.cameraDelegate.snapshot();if(h&&h.byteLength>0)return this.snapshotCache.set(s._id,h),h}const o=new AbortController,a=setTimeout(()=>o.abort(),5e3),c=await fetch(n,{signal:o.signal});if(clearTimeout(a),!c.ok)throw new Error("Status Code: "+c.status);const u=await c.arrayBuffer();return u.byteLength>0&&this.snapshotCache.set(s._id,u),u}catch{return}}onStateChange(e){return this[`${e}State`].pipe(Ne(),Ue(([s,n])=>typeof s=="boolean"||typeof n=="boolean"?s!==n:this.stateChanged(s,n,e)),ut(([s,n])=>({oldState:s,newState:n})),de({connector:()=>new pe(1)}))}onPropertyChange(e){return this.cameraSubject.pipe(Ne(),lt(([s,n])=>(Array.isArray(e)?e:[e]).map(i=>({property:i,oldData:s[i],newData:n[i]}))),Ue(({oldData:s,newData:n})=>!U(s,n,!0)),de({connector:()=>new pe(1)}))}removeAllListeners(){this.lightState.complete(),this.motionState.complete(),this.audioState.complete(),this.objectState.complete(),this.doorbellState.complete(),this.sirenState.complete(),this.batteryState.complete(),this.cameraSubject.complete(),this.cameraState.complete()}updateCamera(e){this.cameraSubject.next(e)}updateCameraState(e){this.cameraState.next(e)}updateStateInternal(e,s,n){let i,o=!1;if(n)o=!0,i=s;else{const a=this.checkStateInternal(e,s);o=a.changed,i=a.event}if(o)switch(e){case"light":this.lightState.next(this.getLightState(i));break;case"motion":this.motionState.next(this.getMotionState(i));break;case"audio":this.audioState.next(this.getAudioState(i));break;case"object":this.objectState.next(this.getObjectState(i));break;case"doorbell":this.doorbellState.next(this.getDoorbellState(i));break;case"siren":this.sirenState.next(this.getSirenState(i));break;case"battery":this.batteryState.next(this.getBatteryState(i));break;default:throw new Error(`Unknown state: ${e}`)}}checkStateInternal(e,s){let n,i=!1;switch(e){case"audio":const o=s;n=this.getAudioState(o),i=this.stateChanged(this.getValue("audio"),n,"audio");break;case"light":const a=s;n=this.getLightState(a),i=this.stateChanged(this.getValue("light"),n,"light");break;case"motion":const c=s;c.state!==void 0&&(c.detections=[]),c.detections=((y,d=.2)=>{if(y.length===0)return[];const v=[...y].sort((f,m)=>{const w=(f.boundingBox[2]-f.boundingBox[0])*(f.boundingBox[3]-f.boundingBox[1]);return(m.boundingBox[2]-m.boundingBox[0])*(m.boundingBox[3]-m.boundingBox[1])-w}),S=[];for(;v.length>0;){let f={...v[0]};v.shift();const m=[];for(let w=0;w<v.length;w++)Ft(f.boundingBox,v[w].boundingBox)>d&&m.push(w);if(m.length>0){const w=[f,...m.map(k=>v[k])],_=[Math.min(...w.map(k=>k.boundingBox[0])),Math.min(...w.map(k=>k.boundingBox[1])),Math.max(...w.map(k=>k.boundingBox[2])),Math.max(...w.map(k=>k.boundingBox[3]))],T=w.reduce((k,P)=>k.confidence>P.confidence?k:P);f={...T,boundingBox:_,id:T.id||f.id};for(let k=m.length-1;k>=0;k--)v.splice(m[k],1)}S.push(f)}return S})(c.detections),c.detections=((y,d,v)=>{const S=[];for(const f of y)We(Fe(f),d,v)&&d.some(m=>!m.classes.length||m.classes.includes(f.label))&&S.push(f);return S})(c.detections,this.activityZones,this.activitySettings),n=this.getMotionState(c),i=this.stateChanged(this.getValue("motion"),n,"motion");break;case"object":const u=s;u.detections=((y,d,v)=>{const S=[];for(const f of y)We(Fe(f),d,v)&&d.some(m=>!m.classes.length||m.classes.includes(f.label))&&S.push(f);return S})(u.detections,this.activityZones,this.activitySettings),n=this.getObjectState(u),i=this.stateChanged(this.getValue("object"),n,"object");break;case"doorbell":const h=s;n=this.getDoorbellState(h),i=this.stateChanged(this.getValue("doorbell"),n,"doorbell");break;case"siren":const l=s;n=this.getSirenState(l),i=this.stateChanged(this.getValue("siren"),n,"siren");break;case"battery":const g=s;n=this.getBatteryState(g),i=this.stateChanged(this.getValue("battery"),n,"battery");break;default:throw new Error(`Unknown state: ${e}`)}return{changed:i,event:n}}stateChanged(e,s,n){if(!e||!s||!n)return!1;if(n=="audio"){if(!this.hasAudioDetector)return!1;const i=e,o=s;return i.state!==o.state||i.db!==o.db}if(n=="motion"){if(!this.hasMotionDetector)return!1;const i=e,o=s;return o.state!==void 0?i.state!==o.state:!U(i.detections,o.detections,!0)}if(n=="object"){if(!this.hasObjectDetector)return!1;const i=s;return!U(e.detections,i.detections,!0)}if(n=="siren"){if(!this.hasSiren)return!1;const i=e,o=s;return i.state!==o.state||i.level!==o.level}if(n=="battery"){if(!this.hasBattery)return!1;const i=e,o=s;return i.level!==o.level||i.lowBattery!==o.lowBattery||i.charging!==o.charging}if(n=="doorbell"){if(!this.hasBinarySensor)return!1;const i=s;return e.state!==i.state}if(n=="light"){if(!this.hasLight)return!1;const i=s;return e.state!==i.state}return!1}getAudioState(e,s=!1){var o;let n,i;if(!s){const a=this.getValue("audio");a.state?n=a:(o=a.lastEvent)!=null&&o.state&&(n=a.lastEvent),n&&delete n.lastEvent}if(this.isStateEvent(e))i=e;else{const a={...e,timestamp:Date.now()};i={...a,db:a.db||(n==null?void 0:n.db)||0,lastEvent:n||(a.state?a:void 0)}}return i}getMotionState(e,s=!1){var o;let n,i;if(!s){const a=this.getValue("motion");a.detections.length?n=a:(o=a.lastEvent)!=null&&o.detections.length&&(n=a.lastEvent),n&&delete n.lastEvent}if(this.isStateEvent(e))i=e;else{const a={...e,timestamp:Date.now()};i={...a,lastEvent:n||(a.detections.length?a:void 0)}}return i}getObjectState(e,s=!1){var o;let n,i;if(!s){const a=this.getValue("object");a.detections.length?n=a:(o=a.lastEvent)!=null&&o.detections.length&&(n=a.lastEvent),n&&delete n.lastEvent}if(this.isStateEvent(e))i=e;else{const a={...e,timestamp:Date.now()};i={...a,lastEvent:n||(a.detections.length?a:void 0)}}return i}getDoorbellState(e,s=!1){var o;let n,i;if(!s){const a=this.getValue("doorbell");a.state?n=a:(o=a.lastEvent)!=null&&o.state&&(n=a.lastEvent),n&&delete n.lastEvent}if(this.isStateEvent(e))i=e;else{const a={...e,timestamp:Date.now()};i={...a,lastEvent:n||(a.state?a:void 0)}}return i}getLightState(e,s=!1){var o;let n,i;if(!s){const a=this.getValue("light");a.state?n=a:(o=a.lastEvent)!=null&&o.state&&(n=a.lastEvent),n&&delete n.lastEvent}if(this.isStateEvent(e))i=e;else{const a={...e,timestamp:Date.now()};i={...a,lastEvent:n||(a.state?a:void 0)}}return i}getSirenState(e,s=!1){var o;let n,i;if(!s){const a=this.getValue("siren");a.state?n=a:(o=a.lastEvent)!=null&&o.state&&(n=a.lastEvent),n&&delete n.lastEvent}if(this.isStateEvent(e))i=e;else{const a={...e,timestamp:Date.now()};i={...a,level:a.level||(n==null?void 0:n.level)||0,lastEvent:n||(a.state?a:void 0)}}return i}getBatteryState(e,s=!1){let n,i;if(!s){const o=this.getValue("battery");this.stateChanged(o,e,"battery")?n=o:o.lastEvent&&this.stateChanged(o.lastEvent,e,"battery")&&(n=o.lastEvent),n&&delete n.lastEvent}if(this.isStateEvent(e))i=e;else{const o={...e,timestamp:Date.now()};i={...o,charging:e.charging||(n==null?void 0:n.charging)||!1,lowBattery:e.lowBattery||(n==null?void 0:n.lowBattery)||!1,lastEvent:n||o}}return i}isStateEvent(e){return"timestamp"in e}createStateObservable(e){return e.pipe(de({connector:()=>new pe(1)}))}}class Yt{constructor(t){p(this,"delegate");p(this,"onRequest");this.onRequest=t}async snapshot(){return this.delegate?this.delegate.snapshot():this._onRequest("snapshot",[],5e3)}_onRequest(t,e,s){return this.onRequest("cameraDelegate",t,e,s)}}class Kt{constructor(t){p(this,"delegate");p(this,"onRequest");this.onRequest=t}async getPrebufferingState(t,e){return this.delegate?this.delegate.getPrebufferingState(t,e):this._onRequest("prebufferDelegate","getPrebufferingState",[t,e])}_onRequest(t,e,s,n){return this.onRequest(t,e,s,n)}}class Gt{constructor(t){p(this,"delegate");p(this,"onRequest");this.onRequest=t}async moveAbsolute(t,e,s){return this.delegate?this.delegate.moveAbsolute(t,e,s):this._onRequest("moveAbsolute",[t,e,s])}async moveRelative(t,e,s){return this.delegate?this.delegate.moveRelative(t,e,s):this._onRequest("moveRelative",[t,e,s])}async moveContinuous(t,e,s){return this.delegate?this.delegate.moveContinuous(t,e,s):this._onRequest("moveContinuous",[t,e,s])}async stop(){return this.delegate?this.delegate.stop():this._onRequest("stop",[])}_onRequest(t,e,s){return this.onRequest("ptzDelegate",t,e,s)}}const ce=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){const t=16*Math.random()|0;return(r==="x"?t:3&t|8).toString(16)});class Xt extends EventTarget{constructor(e,s,n,i){super();p(this,"cameraDevice");p(this,"socketService");p(this,"logger");p(this,"options");p(this,"videoPlayer");p(this,"socket");p(this,"streamId");p(this,"hasBackchannel",!1);p(this,"closed",!1);p(this,"micTransceiver",null);p(this,"pc",null);p(this,"buf",new Uint8Array(2097152));p(this,"mediaSource",null);p(this,"sourceBuffer",null);p(this,"bufLen",0);p(this,"mseCodecs","");p(this,"videoPlayerMp4");p(this,"media",["video","audio","microphone"]);p(this,"codecList",[]);p(this,"reconnectTimeout");p(this,"_finishLoading",!1);p(this,"webrtcReconnectTimeout");this.options=i,this.videoPlayer=i.videoElement,this.cameraDevice=e,this.socketService=s,this.logger=n;const{socket:o}=this.socketService.getSocket(`${e.id}-go2rtcSession`,!0);this.socket=o,this.socket.connect(),this.streamId=ce(),this.createCodecsList()}get mode(){return this.options.mode}connect(e){e&&(this.options.mode=e),console.log(this.cameraDevice.name,`Connecting... (${this.options.mode})`),this.socket.on("ws-open",this.onWsOpen.bind(this)),this.socket.on("ws-close",this.onWsClose.bind(this)),this.socket.on("ws-message",this.onWsMessage.bind(this)),this.socket.emit("ws-open",{id:this.streamId,cameraSource:this.options.sourceName,mode:this.options.mode})}disconnect(){console.log(this.cameraDevice.name,"Disconnecting..."),this.socket.removeListener("ws-open",this.onWsOpen.bind(this)),this.socket.removeListener("ws-close",this.onWsClose.bind(this)),this.socket.removeListener("ws-message",this.onWsMessage.bind(this)),this.socket.emit("ws-close",{id:this.streamId})}async reconnect(e){console.log(this.cameraDevice.name,"Reconnecting..."),this.dispatchEvent(new Event("reconnect")),this.close(),await new Promise(s=>setTimeout(s,100)),this.connect(e)}reset(){var e,s,n;this._finishLoading=!1,(e=this.pc)==null||e.getTransceivers().forEach(i=>{var o,a;return(a=(o=i.sender)==null?void 0:o.track)==null?void 0:a.stop()}),(s=this.pc)==null||s.close(),this.pc=null,(n=this.videoPlayerMp4)==null||n.remove(),this.videoPlayerMp4=void 0,this.videoPlayer.srcObject=null,this.videoPlayer.src="",this.videoPlayer.poster=""}close(){console.log(this.cameraDevice.name,"Closing..."),this.closed=!0,this.reset(),this.disconnect(),this.socket.emit("end"),this.socket.removeAllListeners()}onWsOpen({id:e}){if(e===this.streamId)switch(console.log(this.cameraDevice.name,"Connected"),this.options.mode){case"webrtc":case"webrtc/tcp":console.log(this.cameraDevice.name,"Requesting WebRTC session..."),this.requestWebrtc();break;case"mse":console.log(this.cameraDevice.name,"Requesting MSE session..."),this.requestMse();break;case"hls":console.log(this.cameraDevice.name,"Requesting HLS session..."),this.requestHls();break;case"mp4":console.log(this.cameraDevice.name,"Requesting MP4 session..."),this.requestMp4();break;case"mjpeg":console.log(this.cameraDevice.name,"Requesting MJPEG session..."),this.requestMjpeg();break;default:console.log(this.cameraDevice.name,"Unknown mode:",this.options.mode),this.dispatchEvent(new ErrorEvent("error",{message:"Unknown mode: "+this.options.mode}))}}onWsClose({id:e}){e===this.streamId&&(this.closed||this.options.reconnectInterval===void 0||(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=setTimeout(()=>{this.reconnect()},this.options.reconnectInterval)))}onWsMessage({id:e,data:s}){if(e===this.streamId&&s.type)switch(s.type){case"mse":this.onMseData(s);break;case"hls":this.onHlsData(s);break;case"webrtc/candidate":case"webrtc/answer":this.onWebrtcData(s);break;case"mse-binary":this.onMseBuffer(s);break;case"mjpeg-binary":this.onMjpegBuffer(s);break;case"mp4-binary":this.onMp4Buffer(s);break;case"stream-info":this.onStreamInfo(s);break;case"error":this.dispatchEvent(new ErrorEvent("error",{error:s,message:s.value}))}}async requestWebrtc(){this.reset(),this.pc=new RTCPeerConnection({bundlePolicy:"max-bundle",iceServers:[{urls:"stun:stun.l.google.com:19302"}],sdpSemantics:"unified-plan"}),this.pc.addEventListener("icecandidate",s=>{var i,o;if(this.options.mode==="webrtc/tcp"&&((i=s.candidate)==null?void 0:i.protocol)==="udp")return;const n=((o=s.candidate)==null?void 0:o.toJSON().candidate)||"";this.socket.emit("stream-payload",{id:this.streamId,data:{type:"webrtc/candidate",value:n}})}),this.pc.addEventListener("connectionstatechange",()=>{var s,n,i,o,a;if(console.log(this.cameraDevice.name,"Connection state:",(s=this.pc)==null?void 0:s.connectionState),((n=this.pc)==null?void 0:n.connectionState)==="connected"){const c=(i=this.pc)==null?void 0:i.getTransceivers().filter(u=>u.currentDirection==="recvonly").map(u=>u.receiver.track);this.videoPlayer.srcObject=new MediaStream(c),this.finishLoading(),this.play(),this.disconnect()}else((o=this.pc)==null?void 0:o.connectionState)!=="failed"&&((a=this.pc)==null?void 0:a.connectionState)!=="disconnected"||(clearTimeout(this.webrtcReconnectTimeout),this.webrtcReconnectTimeout=setTimeout(()=>{var c,u;((c=this.pc)==null?void 0:c.connectionState)!=="failed"&&((u=this.pc)==null?void 0:u.connectionState)!=="disconnected"||this.reconnect()},1e3))}),this.pc.addTransceiver("video",{direction:"recvonly"}),this.pc.addTransceiver("audio",{direction:"recvonly"}),this.micTransceiver=this.pc.addTransceiver("audio",{direction:"sendonly"});const e=await this.pc.createOffer();await this.pc.setLocalDescription(e),console.log(this.cameraDevice.name,"Offer:",e.sdp),this.socket.emit("stream-payload",{id:this.streamId,data:{type:"webrtc/offer",value:e.sdp}})}async onWebrtcData(e){var s,n,i;try{switch(e.type){case"webrtc/candidate":if(this.options.mode==="webrtc/tcp"&&e.value.indexOf(" udp ")>0)return;await((s=this.pc)==null?void 0:s.addIceCandidate({candidate:e.value,sdpMid:"0"}));break;case"webrtc/answer":console.log(this.cameraDevice.name,"Answer:",e.value),await((n=this.pc)==null?void 0:n.setRemoteDescription({type:"answer",sdp:e.value}));break;case"error":if(console.log(this.cameraDevice.name,"WebRTC Error:",e.value),e.value.indexOf("webrtc/offer")<0)return;(i=this.pc)==null||i.close()}}catch(o){this.dispatchEvent(new ErrorEvent("error",{error:o,message:o.message}))}}requestMse(){if(this.reset(),"ManagedMediaSource"in window){console.log(this.cameraDevice.name,"Using ManagedMediaSource");const e=window.ManagedMediaSource;this.mediaSource=new e,this.mediaSource.addEventListener("sourceopen",()=>{this.socket.emit("stream-payload",{id:this.streamId,data:{type:"mse",value:this.parseCodecs(e.isTypeSupported)}})},{once:!0}),this.videoPlayer.disableRemotePlayback=!0,this.videoPlayer.srcObject=this.mediaSource}else console.log(this.cameraDevice.name,"Using MediaSource"),this.mediaSource=new MediaSource,this.mediaSource.addEventListener("sourceopen",()=>{URL.revokeObjectURL(this.videoPlayer.src),this.socket.emit("stream-payload",{id:this.streamId,data:{type:"mse",value:this.parseCodecs(MediaSource.isTypeSupported)}})},{once:!0}),this.videoPlayer.src=URL.createObjectURL(this.mediaSource),this.videoPlayer.srcObject=null;this.play(),this.mseCodecs=""}onMseData(e){this.mediaSource&&(this.mseCodecs=e.value,this.bufLen=0,this.buf=new Uint8Array(2097152),this.sourceBuffer=this.mediaSource.addSourceBuffer(e.value),this.sourceBuffer.mode="segments",this.sourceBuffer.addEventListener("updateend",()=>{var s,n,i,o,a;if(!((s=this.sourceBuffer)!=null&&s.updating))try{if(this.bufLen>0){const c=this.buf.slice(0,this.bufLen);this.bufLen=0,(n=this.sourceBuffer)==null||n.appendBuffer(c)}else if((o=(i=this.sourceBuffer)==null?void 0:i.buffered)!=null&&o.length){const c=this.sourceBuffer.buffered.end(this.sourceBuffer.buffered.length-1)-15,u=this.sourceBuffer.buffered.start(0);c>u&&(this.sourceBuffer.remove(u,c),(a=this.mediaSource)==null||a.setLiveSeekableRange(c,c+15))}}catch{}}))}async onMseBuffer(e){var s,n,i;if(((s=this.mediaSource)==null?void 0:s.readyState)!=="closed")if(this.finishLoading(),((n=this.sourceBuffer)==null?void 0:n.updating)||this.bufLen>0){const o=new Uint8Array(e.value);this.buf.set(o,this.bufLen),this.bufLen+=o.byteLength}else try{(i=this.sourceBuffer)==null||i.appendBuffer(e.value)}catch{}else this.closed||(this.closed=!0,this.dispatchEvent(new ErrorEvent("error",{message:"MediaSource closed"})),this.options.mode="webrtc",this.requestWebrtc())}requestMjpeg(){this.reset(),this.socket.emit("stream-payload",{id:this.streamId,data:{type:"mjpeg"}})}onMjpegBuffer(e){this.videoPlayer.controls=!1,this.videoPlayer.poster="data:image/jpeg;base64,"+this.btoaBinary(e.value),this.finishLoading()}requestMp4(){this.reset();const e=document.createElement("canvas");let s=null;this.videoPlayerMp4=document.createElement("video"),this.videoPlayerMp4.autoplay=!0,this.videoPlayerMp4.playsInline=!0,this.videoPlayerMp4.muted=!0,this.videoPlayerMp4.addEventListener("loadeddata",()=>{this.videoPlayerMp4&&(s||(e.width=this.videoPlayerMp4.videoWidth,e.height=this.videoPlayerMp4.videoHeight,s=e.getContext("2d")),s==null||s.drawImage(this.videoPlayerMp4,0,0,e.width,e.height),this.videoPlayer.controls=!1,this.videoPlayer.poster=e.toDataURL("image/jpeg"))});const n=this.codecList.filter(i=>this.media.includes(i.indexOf("vc1")>0?"video":"audio")).filter(i=>this.videoPlayer.canPlayType(`video/mp4; codecs="${i}"`)).join();console.log(this.cameraDevice.name,"Playable codecs (MP4):",n),this.socket.emit("stream-payload",{id:this.streamId,data:{type:"mp4",value:n}})}onMp4Buffer(e){this.finishLoading(),this.videoPlayerMp4&&(this.videoPlayerMp4.src="data:video/mp4;base64,"+this.btoaBinary(e.value))}requestHls(){this.reset();const e=this.parseCodecs(s=>this.videoPlayer.canPlayType(s));console.log(this.cameraDevice.name,"Playable codecs (HLS):",e),this.socket.emit("stream-payload",{id:this.streamId,data:{type:"hls",value:e}})}onHlsData(e){const s="http"+e.wsURL.substring(2,e.wsURL.indexOf("/ws"))+"/hls/",n=e.value.replace("hls/",s),i="data:application/vnd.apple.mpegurl;base64,"+btoa(n.toString());this.videoPlayer.src=i,this.finishLoading(),this.play()}onStreamInfo(e){var n;const s=e.value;(n=s==null?void 0:s.producers)!=null&&n.length&&(this.hasBackchannel=s.producers.some(i=>{var o;return(o=i.senders)==null?void 0:o.length}))}async play(){try{await this.videoPlayer.play()}catch(e){if(!this.videoPlayer.muted)return this.videoPlayer.muted=!0,this.play();this.logger.warn(this.cameraDevice.name,e)}}finishLoading(){this._finishLoading||(this._finishLoading=!0,this.dispatchEvent(new Event("finishLoading")))}createCodecsList(){const e=["avc1.640029","avc1.64002A","avc1.640033","hvc1.1.6.L153.B0","mp4a.40.2","mp4a.40.5","flac","opus"],s=typeof window>"u"?null:navigator.userAgent.match(/Version\/(\d+).+Safari/);if(s!=null&&s[1]){const n=s[1]<"13"?"mp4a.40.2":s[1]<"14"?"flac":"opus";e.splice(e.indexOf(n))}this.codecList=e}parseCodecs(e){return this.codecList.filter(s=>this.media.includes(s.indexOf("vc1")>0?"video":"audio")).filter(s=>e(`video/mp4; codecs="${s}"`)).join()}btoaBinary(e){const s=new Uint8Array(e),n=s.byteLength;let i="";for(let o=0;o<n;o++)i+=String.fromCharCode(s[o]);return window.btoa(i)}}class He extends Jt{constructor(e,s,n){super(e,n);p(this,"socketService");p(this,"socket");p(this,"pluginName","@camera.ui/client");p(this,"subject");p(this,"_started",!1);p(this,"cameraDelegate",new Yt(this.onRequest.bind(this)));p(this,"ptzDelegate",new Gt(this.onRequest.bind(this)));p(this,"prebufferDelegate",new Kt(this.onRequest.bind(this)));this.socketService=s;const{socket:i}=this.socketService.getSocket(this.id,!0);this.socket=i,this.socket.connect(),this.subject=`${this.pluginName}.camera.${this.id}`,this.listenToMessages()}get started(){return this._started}get sources(){return this._sources.filter(e=>!e.internal)}get internalSources(){return this._sources.map(e=>({...e,type:e.name.endsWith(" AAC")?"aac":e.name.endsWith(" OPUS")?"opus":"pcma"})).filter(e=>e.internal)}get _sources(){return JSON.parse(JSON.stringify(this.cameraSubject.getValue().sources)).map(e=>({...e,getPrebufferingState:s=>this.prebufferDelegate.getPrebufferingState(e.name,s),probeStream:()=>this.onRequest("cameraFn","probeStream",[e._id])}))}async start(){this._started||(this._started=!0,await this.refreshStates(),this.socket.emit("joinRoomStates",this.id))}stop(){this._started=!1,this.socket.emit("leaveRoomStates",this.id)}close(){this.cleanup()}connect(){return this.onRequest("cameraFn","connect")}disconnect(){return this.onRequest("cameraFn","disconnect")}createSession(e){return new Xt(this,this.socketService,this.logger,e)}async refreshStates(){const e=await this.onRequest("cameraFn","refreshStates");super.updateCamera(e.camera),super.updateCameraState(e.cameraState);for(const[s,n]of Object.entries(e.states))super.updateStateInternal(s,n,!0)}async cleanup(){this.stop(),this.removeAllListeners(),this.unsubscribe(),this.socket.removeAllListeners()}listenToMessages(){this.socket.emit("joinRoomDevice",this.id),this.socket.on("updateState",e=>{e.cameraId===this.id&&super.updateStateInternal(e.stateName,e.data.newEvent,!0)}),this.socket.on("updateDevice",e=>{if(e.cameraId===this.id)switch(e.type){case"removed":this.cleanup();break;case"updated":super.updateCamera(e.data);break;case"cameraState":super.updateCameraState(e.data)}})}onRequest(e,s,n=[]){const i={requestId:ce(),targetId:this.subject,targetName:this.name,pluginId:this.pluginName,cameraId:this.id,type:"request",proxy:"camera",client:e,fn:s,args:n,timestamp:Date.now(),timeout:5e3};return new Promise((o,a)=>{this.socket.emit("request",i,c=>{c.error?a(c.error):o(c.response)})})}}class Qt{constructor(t,e){p(this,"socketService");p(this,"socket");p(this,"logger");p(this,"pluginName","@camera.ui/client");p(this,"subject");this.socketService=t,this.socket=t.socket,this.logger=e,this.subject=`${this.pluginName}.coreManager`}async getFFmpegPath(){return this.onRequest("getFFmpegPath")}async getHwaccelInfo(){return this.onRequest("getHwaccelInfo")}async getServerAddresses(){return this.onRequest("getServerAddresses")}async getIceServers(){return this.onRequest("getIceServers")}onRequest(t,e){const s={requestId:ce(),targetId:this.subject,targetName:this.pluginName,pluginId:this.pluginName,type:"request",proxy:"core",client:"coreFn",fn:t,args:e||[],timestamp:Date.now(),timeout:5e3};return new Promise((n,i)=>{this.socket.emit("request",s,o=>{o.error?i(o.error):n(o.response)})})}}class Zt{constructor(t,e){p(this,"socketService");p(this,"socket");p(this,"logger");p(this,"pluginName","@camera.ui/client");p(this,"subject");this.socketService=t,this.socket=t.socket,this.logger=e,this.subject=`${this.pluginName}.deviceManager`}async getCameraById(t){const e=await this.onRequest("getCameraById",[t]);if(e){const s=new He(e,this.socketService,this.logger);return await s.refreshStates(),s}}async getCameraByName(t){const e=await this.onRequest("getCameraByName",[t]);if(e){const s=new He(e,this.socketService,this.logger);return await s.refreshStates(),s}}onRequest(t,e){const s={requestId:ce(),targetId:this.subject,targetName:this.pluginName,pluginId:this.pluginName,type:"request",proxy:"device",client:"deviceFn",fn:t,args:e||[],timestamp:Date.now(),timeout:5e3};return new Promise((n,i)=>{this.socket.emit("request",s,o=>{o.error?i(o.error):n(o.response)})})}}const B=Object.create(null);B.open="0",B.close="1",B.ping="2",B.pong="3",B.message="4",B.upgrade="5",B.noop="6";const ee=Object.create(null);Object.keys(B).forEach(r=>{ee[B[r]]=r});const _e={type:"error",data:"parser error"},pt=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",dt=typeof ArrayBuffer=="function",ft=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,ge=({type:r,data:t},e,s)=>pt&&t instanceof Blob?e?s(t):$e(t,s):dt&&(t instanceof ArrayBuffer||ft(t))?e?s(t):$e(new Blob([t]),s):s(B[r]+(t||"")),$e=(r,t)=>{const e=new FileReader;return e.onload=function(){const s=e.result.split(",")[1];t("b"+(s||""))},e.readAsDataURL(r)};function Je(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let me;const W=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<64;r++)W["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(r)]=r;const es=typeof ArrayBuffer=="function",Ee=(r,t)=>{if(typeof r!="string")return{type:"message",data:gt(r,t)};const e=r.charAt(0);return e==="b"?{type:"message",data:ts(r.substring(1),t)}:ee[e]?r.length>1?{type:ee[e],data:r.substring(1)}:{type:ee[e]}:_e},ts=(r,t)=>{if(es){const e=(s=>{let n,i,o,a,c,u=.75*s.length,h=s.length,l=0;s[s.length-1]==="="&&(u--,s[s.length-2]==="="&&u--);const g=new ArrayBuffer(u),y=new Uint8Array(g);for(n=0;n<h;n+=4)i=W[s.charCodeAt(n)],o=W[s.charCodeAt(n+1)],a=W[s.charCodeAt(n+2)],c=W[s.charCodeAt(n+3)],y[l++]=i<<2|o>>4,y[l++]=(15&o)<<4|a>>2,y[l++]=(3&a)<<6|63&c;return g})(r);return gt(e,t)}return{base64:!0,data:r}},gt=(r,t)=>t==="blob"?r instanceof Blob?r:new Blob([r]):r instanceof ArrayBuffer?r:r.buffer,Ye="";let ye;function K(r){return r.reduce((t,e)=>t+e.length,0)}function G(r,t){if(r[0].length===t)return r.shift();const e=new Uint8Array(t);let s=0;for(let n=0;n<t;n++)e[n]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),e}function x(r){if(r)return function(t){for(var e in x.prototype)t[e]=x.prototype[e];return t}(r)}x.prototype.on=x.prototype.addEventListener=function(r,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(t),this},x.prototype.once=function(r,t){function e(){this.off(r,e),t.apply(this,arguments)}return e.fn=t,this.on(r,e),this},x.prototype.off=x.prototype.removeListener=x.prototype.removeAllListeners=x.prototype.removeEventListener=function(r,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var e,s=this._callbacks["$"+r];if(!s)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n=0;n<s.length;n++)if((e=s[n])===t||e.fn===t){s.splice(n,1);break}return s.length===0&&delete this._callbacks["$"+r],this},x.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),e=this._callbacks["$"+r],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(e){s=0;for(var n=(e=e.slice(0)).length;s<n;++s)e[s].apply(this,t)}return this},x.prototype.emitReserved=x.prototype.emit,x.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]},x.prototype.hasListeners=function(r){return!!this.listeners(r).length};const A=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();function mt(r,...t){return t.reduce((e,s)=>(r.hasOwnProperty(s)&&(e[s]=r[s]),e),{})}const ss=A.setTimeout,rs=A.clearTimeout;function he(r,t){t.useNativeTimers?(r.setTimeoutFn=ss.bind(A),r.clearTimeoutFn=rs.bind(A)):(r.setTimeoutFn=A.setTimeout.bind(A),r.clearTimeoutFn=A.clearTimeout.bind(A))}class ns extends Error{constructor(t,e,s){super(t),this.description=e,this.context=s,this.type="TransportError"}}class be extends x{constructor(t){super(),this.writable=!1,he(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,s){return super.emitReserved("error",new ns(t,e,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return this.readyState!=="opening"&&this.readyState!=="open"||(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=Ee(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,e={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(e)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const e=function(s){let n="";for(let i in s)s.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return n}(t);return e.length?"?"+e:""}}const yt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Te=64,is={};let Ke,Ge=0,X=0;function Xe(r){let t="";do t=yt[r%Te]+t,r=Math.floor(r/Te);while(r>0);return t}function Qe(){const r=Xe(+new Date);return r!==Ke?(Ge=0,Ke=r):r+"."+Xe(Ge++)}for(;X<Te;X++)is[yt[X]]=X;let bt=!1;try{bt=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const os=bt;function vt(r){const t=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||os))return new XMLHttpRequest}catch{}if(!t)try{return new A[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function as(){}const cs=new vt({xdomain:!1}).responseType!=null;class j extends x{constructor(t,e){super(),he(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.data=e.data!==void 0?e.data:null,this.create()}create(){var t;const e=mt(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd;const s=this.xhr=new vt(e);try{s.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let n in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(n)&&s.setRequestHeader(n,this.opts.extraHeaders[n])}}catch{}if(this.method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(s.timeout=this.opts.requestTimeout),s.onreadystatechange=()=>{var n;s.readyState===3&&((n=this.opts.cookieJar)===null||n===void 0||n.parseCookies(s)),s.readyState===4&&(s.status===200||s.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof s.status=="number"?s.status:0)},0))},s.send(this.data)}catch(n){return void this.setTimeoutFn(()=>{this.onError(n)},0)}typeof document<"u"&&(this.index=j.requestsCount++,j.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(this.xhr!==void 0&&this.xhr!==null){if(this.xhr.onreadystatechange=as,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete j.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}function Ze(){for(let r in j.requests)j.requests.hasOwnProperty(r)&&j.requests[r].abort()}j.requestsCount=0,j.requests={},typeof document<"u"&&(typeof attachEvent=="function"?attachEvent("onunload",Ze):typeof addEventListener=="function"&&addEventListener("onpagehide"in A?"pagehide":"unload",Ze,!1));const Oe=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,t)=>t(r,0),Q=A.WebSocket||A.MozWebSocket,et=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",hs={websocket:class extends be{constructor(r){super(r),this.supportsBinary=!r.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const r=this.uri(),t=this.opts.protocols,e=et?{}:mt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=et?new Q(r,t,e):t?new Q(r,t):new Q(r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let t=0;t<r.length;t++){const e=r[t],s=t===r.length-1;ge(e,this.supportsBinary,n=>{try{this.ws.send(n)}catch{}s&&Oe(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){this.ws!==void 0&&(this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Qe()),this.supportsBinary||(t.b64=1),this.createUri(r,t)}check(){return!!Q}},webtransport:class extends be{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(r=>{const t=function(o,a){ye||(ye=new TextDecoder);const c=[];let u=0,h=-1,l=!1;return new TransformStream({transform(g,y){for(c.push(g);;){if(u===0){if(K(c)<1)break;const d=G(c,1);l=!(128&~d[0]),h=127&d[0],u=h<126?3:h===126?1:2}else if(u===1){if(K(c)<2)break;const d=G(c,2);h=new DataView(d.buffer,d.byteOffset,d.length).getUint16(0),u=3}else if(u===2){if(K(c)<8)break;const d=G(c,8),v=new DataView(d.buffer,d.byteOffset,d.length),S=v.getUint32(0);if(S>Math.pow(2,21)-1){y.enqueue(_e);break}h=S*Math.pow(2,32)+v.getUint32(4),u=3}else{if(K(c)<h)break;const d=G(c,h);y.enqueue(Ee(l?d:ye.decode(d),a)),u=0}if(h===0||h>o){y.enqueue(_e);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=r.readable.pipeThrough(t).getReader(),s=new TransformStream({transform(o,a){(function(c,u){pt&&c.data instanceof Blob?c.data.arrayBuffer().then(Je).then(u):dt&&(c.data instanceof ArrayBuffer||ft(c.data))?u(Je(c.data)):ge(c,!1,h=>{me||(me=new TextEncoder),u(me.encode(h))})})(o,c=>{const u=c.length;let h;if(u<126)h=new Uint8Array(1),new DataView(h.buffer).setUint8(0,u);else if(u<65536){h=new Uint8Array(3);const l=new DataView(h.buffer);l.setUint8(0,126),l.setUint16(1,u)}else{h=new Uint8Array(9);const l=new DataView(h.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(u))}o.data&&typeof o.data!="string"&&(h[0]|=128),a.enqueue(h),a.enqueue(c)})}});s.readable.pipeTo(r.writable),this.writer=s.writable.getWriter();const n=()=>{e.read().then(({done:o,value:a})=>{o||(this.onPacket(a),n())}).catch(o=>{})};n();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this.writer.write(i).then(()=>this.onOpen())})}))}write(r){this.writable=!1;for(let t=0;t<r.length;t++){const e=r[t],s=t===r.length-1;this.writer.write(e).then(()=>{s&&Oe(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this.transport)===null||r===void 0||r.close()}},polling:class extends be{constructor(r){if(super(r),this.polling=!1,typeof location<"u"){const e=location.protocol==="https:";let s=location.port;s||(s=e?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}const t=r&&r.forceBase64;this.supportsBinary=cs&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(r){this.readyState="pausing";const t=()=>{this.readyState="paused",r()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",function(){--e||t()})),this.writable||(e++,this.once("drain",function(){--e||t()}))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){((t,e)=>{const s=t.split(Ye),n=[];for(let i=0;i<s.length;i++){const o=Ee(s[i],e);if(n.push(o),o.type==="error")break}return n})(r,this.socket.binaryType).forEach(t=>{if(this.readyState==="opening"&&t.type==="open"&&this.onOpen(),t.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)}),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,((t,e)=>{const s=t.length,n=new Array(s);let i=0;t.forEach((o,a)=>{ge(o,!1,c=>{n[a]=c,++i===s&&e(n.join(Ye))})})})(r,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Qe()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(r,t)}request(r={}){return Object.assign(r,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new j(this.uri(),r)}doWrite(r,t){const e=this.request({method:"POST",data:r});e.on("success",t),e.on("error",(s,n)=>{this.onError("xhr post error",s,n)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(t,e)=>{this.onError("xhr poll error",t,e)}),this.pollXhr=r}}},us=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,ls=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Ce(r){if(r.length>2e3)throw"URI too long";const t=r,e=r.indexOf("["),s=r.indexOf("]");e!=-1&&s!=-1&&(r=r.substring(0,e)+r.substring(e,s).replace(/:/g,";")+r.substring(s,r.length));let n=us.exec(r||""),i={},o=14;for(;o--;)i[ls[o]]=n[o]||"";return e!=-1&&s!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(a,c){const u=c.replace(/\/{2,9}/g,"/").split("/");return c.slice(0,1)!="/"&&c.length!==0||u.splice(0,1),c.slice(-1)=="/"&&u.splice(u.length-1,1),u}(0,i.path),i.queryKey=function(a,c){const u={};return c.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(h,l,g){l&&(u[l]=g)}),u}(0,i.query),i}class D extends x{constructor(t,e={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],t&&typeof t=="object"&&(e=t,t=null),t?(t=Ce(t),e.hostname=t.host,e.secure=t.protocol==="https"||t.protocol==="wss",e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=Ce(e.host).host),he(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=function(s){let n={},i=s.split("&");for(let o=0,a=i.length;o<a;o++){let c=i[o].split("=");n[decodeURIComponent(c[0])]=decodeURIComponent(c[1])}return n}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const e=Object.assign({},this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);const s=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new hs[t](s)}open(){let t;if(this.opts.rememberUpgrade&&D.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else{if(this.transports.length===0)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch{return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",e=>this.onClose("transport close",e))}probe(t){let e=this.createTransport(t),s=!1;D.priorWebsocketSuccess=!1;const n=()=>{s||(e.send([{type:"ping",data:"probe"}]),e.once("packet",l=>{if(!s)if(l.type==="pong"&&l.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",e),!e)return;D.priorWebsocketSuccess=e.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(h(),this.setTransport(e),e.send([{type:"upgrade"}]),this.emitReserved("upgrade",e),e=null,this.upgrading=!1,this.flush())})}else{const g=new Error("probe error");g.transport=e.name,this.emitReserved("upgradeError",g)}}))};function i(){s||(s=!0,h(),e.close(),e=null)}const o=l=>{const g=new Error("probe error: "+l);g.transport=e.name,i(),this.emitReserved("upgradeError",g)};function a(){o("transport closed")}function c(){o("socket closed")}function u(l){e&&l.name!==e.name&&i()}const h=()=>{e.removeListener("open",n),e.removeListener("error",o),e.removeListener("close",a),this.off("close",c),this.off("upgrading",u)};e.once("open",n),e.once("error",o),e.once("close",a),this.once("close",c),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||e.open()},200):e.open()}onOpen(){if(this.readyState="open",D.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const e=this.upgrades.length;for(;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s<this.writeBuffer.length;s++){const n=this.writeBuffer[s].data;if(n&&(t+=typeof(e=n)=="string"?function(i){let o=0,a=0;for(let c=0,u=i.length;c<u;c++)o=i.charCodeAt(c),o<128?a+=1:o<2048?a+=2:o<55296||o>=57344?a+=3:(c++,a+=4);return a}(e):Math.ceil(1.33*(e.byteLength||e.size))),s>0&&t>this.maxPayload)return this.writeBuffer.slice(0,s);t+=2}var e;return this.writeBuffer}write(t,e,s){return this.sendPacket("message",t,e,s),this}send(t,e,s){return this.sendPacket("message",t,e,s),this}sendPacket(t,e,s,n){if(typeof e=="function"&&(n=e,e=void 0),typeof s=="function"&&(n=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;(s=s||{}).compress=s.compress!==!1;const i={type:t,data:e,options:s};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),n&&this.once("flush",n),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},s=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return this.readyState!=="opening"&&this.readyState!=="open"||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}onError(t){D.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,e){this.readyState!=="opening"&&this.readyState!=="open"&&this.readyState!=="closing"||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let s=0;const n=t.length;for(;s<n;s++)~this.transports.indexOf(t[s])&&e.push(t[s]);return e}}D.protocol=4;const ps=typeof ArrayBuffer=="function",ds=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,wt=Object.prototype.toString,fs=typeof Blob=="function"||typeof Blob<"u"&&wt.call(Blob)==="[object BlobConstructor]",gs=typeof File=="function"||typeof File<"u"&&wt.call(File)==="[object FileConstructor]";function je(r){return ps&&(r instanceof ArrayBuffer||ds(r))||fs&&r instanceof Blob||gs&&r instanceof File}function te(r,t){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let e=0,s=r.length;e<s;e++)if(te(r[e]))return!0;return!1}if(je(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return te(r.toJSON(),!0);for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)&&te(r[e]))return!0;return!1}function ms(r){const t=[],e=r.data,s=r;return s.data=Ae(e,t),s.attachments=t.length,{packet:s,buffers:t}}function Ae(r,t){if(!r)return r;if(je(r)){const e={_placeholder:!0,num:t.length};return t.push(r),e}if(Array.isArray(r)){const e=new Array(r.length);for(let s=0;s<r.length;s++)e[s]=Ae(r[s],t);return e}if(typeof r=="object"&&!(r instanceof Date)){const e={};for(const s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=Ae(r[s],t));return e}return r}function ys(r,t){return r.data=Re(r.data,t),delete r.attachments,r}function Re(r,t){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<t.length)return t[r.num];throw new Error("illegal attachments")}if(Array.isArray(r))for(let e=0;e<r.length;e++)r[e]=Re(r[e],t);else if(typeof r=="object")for(const e in r)Object.prototype.hasOwnProperty.call(r,e)&&(r[e]=Re(r[e],t));return r}const bs=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],vs=5;var b;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(b||(b={}));class ws{constructor(t){this.replacer=t}encode(t){return t.type!==b.EVENT&&t.type!==b.ACK||!te(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===b.EVENT?b.BINARY_EVENT:b.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==b.BINARY_EVENT&&t.type!==b.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(e+=t.nsp+","),t.id!=null&&(e+=t.id),t.data!=null&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){const e=ms(t),s=this.encodeAsString(e.packet),n=e.buffers;return n.unshift(s),n}}function tt(r){return Object.prototype.toString.call(r)==="[object Object]"}class Le extends x{constructor(t){super(),this.reviver=t}add(t){let e;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");e=this.decodeString(t);const s=e.type===b.BINARY_EVENT;s||e.type===b.BINARY_ACK?(e.type=s?b.EVENT:b.ACK,this.reconstructor=new Ss(e),e.attachments===0&&super.emitReserved("decoded",e)):super.emitReserved("decoded",e)}else{if(!je(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");e=this.reconstructor.takeBinaryData(t),e&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;const s={type:Number(t.charAt(0))};if(b[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===b.BINARY_EVENT||s.type===b.BINARY_ACK){const i=e+1;for(;t.charAt(++e)!=="-"&&e!=t.length;);const o=t.substring(i,e);if(o!=Number(o)||t.charAt(e)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(t.charAt(e+1)==="/"){const i=e+1;for(;++e&&t.charAt(e)!==","&&e!==t.length;);s.nsp=t.substring(i,e)}else s.nsp="/";const n=t.charAt(e+1);if(n!==""&&Number(n)==n){const i=e+1;for(;++e;){const o=t.charAt(e);if(o==null||Number(o)!=o){--e;break}if(e===t.length)break}s.id=Number(t.substring(i,e+1))}if(t.charAt(++e)){const i=this.tryParse(t.substr(e));if(!Le.isPayloadValid(s.type,i))throw new Error("invalid payload");s.data=i}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,e){switch(t){case b.CONNECT:return tt(e);case b.DISCONNECT:return e===void 0;case b.CONNECT_ERROR:return typeof e=="string"||tt(e);case b.EVENT:case b.BINARY_EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&bs.indexOf(e[0])===-1);case b.ACK:case b.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Ss{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const e=ys(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}function R(r,t,e){return r.on(t,e),function(){r.off(t,e)}}const ks=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class St extends x{constructor(t,e,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[R(t,"open",this.onopen.bind(this)),R(t,"packet",this.onpacket.bind(this)),R(t,"error",this.onerror.bind(this)),R(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(ks.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(e.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(e),this;const s={type:b.EVENT,data:e,options:{}};if(s.options.compress=this.flags.compress!==!1,typeof e[e.length-1]=="function"){const i=this.ids++,o=e.pop();this._registerAckCallback(i,o),s.id=i}const n=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!n||!this.connected)||(this.connected?(this.notifyOutgoingListeners(s),this.packet(s)):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,e){var s;const n=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(n===void 0)return void(this.acks[t]=e);const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);e.call(this,new Error("operation has timed out"))},n),o=(...a)=>{this.io.clearTimeoutFn(i),e.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...e){return new Promise((s,n)=>{const i=(o,a)=>o?n(o):s(a);i.withError=!0,e.push(i),this.emit(t,...e)})}_addToQueue(t){let e;typeof t[t.length-1]=="function"&&(e=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((n,...i)=>{if(s===this._queue[0])return n!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),e&&e(n)):(this._queue.shift(),e&&e(null,...i)),s.pending=!1,this._drainQueue()}),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const e=this._queue[0];e.pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:b.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){const e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case b.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case b.EVENT:case b.BINARY_EVENT:this.onevent(t);break;case b.ACK:case b.BINARY_ACK:this.onack(t);break;case b.DISCONNECT:this.ondisconnect();break;case b.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];t.id!=null&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const s of e)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let s=!1;return function(...n){s||(s=!0,e.packet({type:b.ACK,id:t,data:n}))}}onack(t){const e=this.acks[t.id];typeof e=="function"&&(delete this.acks[t.id],e.withError&&t.data.unshift(null),e.apply(this,t.data))}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:b.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const e=this._anyOutgoingListeners;for(let s=0;s<e.length;s++)if(t===e[s])return e.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const e=this._anyOutgoingListeners.slice();for(const s of e)s.apply(this,t.data)}}}function I(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}I.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),e=Math.floor(t*this.jitter*r);r=1&Math.floor(10*t)?r+e:r-e}return 0|Math.min(r,this.max)},I.prototype.reset=function(){this.attempts=0},I.prototype.setMin=function(r){this.ms=r},I.prototype.setMax=function(r){this.max=r},I.prototype.setJitter=function(r){this.jitter=r};class ie extends x{constructor(t,e){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,he(this,e),this.reconnection(e.reconnection!==!1),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor((s=e.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new I({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(e.timeout==null?2e4:e.timeout),this._readyState="closed",this.uri=t;const n=e.parser||we;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this._autoConnect=e.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(e=this.backoff)===null||e===void 0||e.setMin(t),this)}randomizationFactor(t){var e;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(e=this.backoff)===null||e===void 0||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(e=this.backoff)===null||e===void 0||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new D(this.uri,this.opts);const e=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const n=R(e,"open",function(){s.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=R(e,"error",i);if(this._timeout!==!1){const a=this._timeout,c=this.setTimeoutFn(()=>{n(),i(new Error("timeout")),e.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(n),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(R(t,"ping",this.onping.bind(this)),R(t,"data",this.ondata.bind(this)),R(t,"error",this.onerror.bind(this)),R(t,"close",this.onclose.bind(this)),R(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(e){this.onclose("parse error",e)}}ondecoded(t){Oe(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new St(this,t,e),this.nsps[t]=s),s}_destroy(t){const e=Object.keys(this.nsps);for(const s of e)if(this.nsps[s].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let s=0;s<e.length;s++)this.engine.write(e[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(n=>{n?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",n)):t.onreconnect()}))},e);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const F={};function ve(r,t){typeof r=="object"&&(t=r,r=void 0);const e=function(c,u="",h){let l=c;h=h||typeof location<"u"&&location,c==null&&(c=h.protocol+"//"+h.host),typeof c=="string"&&(c.charAt(0)==="/"&&(c=c.charAt(1)==="/"?h.protocol+c:h.host+c),/^(https?|wss?):\/\//.test(c)||(c=h!==void 0?h.protocol+"//"+c:"https://"+c),l=Ce(c)),l.port||(/^(http|ws)$/.test(l.protocol)?l.port="80":/^(http|ws)s$/.test(l.protocol)&&(l.port="443")),l.path=l.path||"/";const g=l.host.indexOf(":")!==-1?"["+l.host+"]":l.host;return l.id=l.protocol+"://"+g+":"+l.port+u,l.href=l.protocol+"://"+g+(h&&h.port===l.port?"":":"+l.port),l}(r,(t=t||{}).path||"/socket.io"),s=e.source,n=e.id,i=e.path,o=F[n]&&i in F[n].nsps;let a;return t.forceNew||t["force new connection"]||t.multiplex===!1||o?a=new ie(s,t):(F[n]||(F[n]=new ie(s,t)),a=F[n]),e.query&&!t.query&&(t.query=e.queryKey),a.socket(e.path,t)}Object.assign(ve,{Manager:ie,Socket:St,io:ve,connect:ve});class xs{constructor(t,e){p(this,"socket");p(this,"token");p(this,"endpoint");p(this,"socketList",new Map);this.endpoint=t.replace("https://","wss://").replace("http://","ws://"),this.token=e,this.socket=this.getSocket("default").socket,this.socket.connect()}close(){this.socket.emit("end"),this.socket.removeAllListeners(),this.socket.disconnect()}getSocket(t,e){return this.createManager(e)}createManager(t){const e=new ie(this.endpoint,{reconnection:!0,reconnectionDelay:500,rejectUnauthorized:!1,transports:["websocket"],forceNew:t}),s=e.socket("/proxy",{auth:{token:`Bearer ${this.token}`}});return{manager:e,socket:s}}}class _s{constructor(t){p(this,"api");p(this,"socketService");p(this,"config");p(this,"logger");p(this,"token");p(this,"deviceManager");p(this,"coreManager");this.config=t,this.logger=t.logger||{...console,attention:console.warn},this.api=new At(t.endpoint)}async connect(){return this.deviceManager&&this.coreManager||(this.cleanUpClient(),await this.login(),this.token=this.token||this.config.token,this.socketService=new xs(this.config.endpoint,this.token),this.coreManager=new Qt(this.socketService,this.logger),this.deviceManager=new Zt(this.socketService,this.logger),this.checkSession()),{coreManager:this.coreManager,deviceManager:this.deviceManager}}async disconnect(){var t;(t=this.socketService)==null||t.close(),this.cleanUpClient(),this.config.username&&this.config.password&&await this.api.post("/auth/logout",void 0,{headers:{Authorization:`Bearer ${this.token}`}})}async updateCredentials(t){this.config={...this.config,...t},this.socketService&&await this.disconnect(),await this.connect()}async login(){var t;if(this.config.username&&this.config.password)try{const e=await this.api.post("/auth/login",{username:this.config.username,password:this.config.password}),s=await e.json();this.token=s.access_token}catch(e){throw((t=e.response)==null?void 0:t.status)===401?new Error("Invalid credentials"):new Error(`Failed to get token: ${e.message}`)}else if(this.config.token&&!this.config.skipCheck)try{await this.api.get("/auth/check",{headers:{Authorization:`Bearer ${this.config.token}`}})}catch(e){throw new Error(`Invalid token: ${e.message}`)}this.token=this.token||this.config.token}getDeviceManager(){return this.deviceManager}checkSession(){var t,e;(t=this.socketService)==null||t.socket.removeListener("invalidToken"),(e=this.socketService)==null||e.socket.on("invalidToken",async s=>{s===this.token&&await this.disconnect()})}cleanUpClient(){this.deviceManager=void 0}}var Ts=st.j;export{Ts as X};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as j,_ as I}from"./VPlayer.CpMa1SNk.0.0.31-alpha.7.js";import{e as L,d as R,f as M,h as T,j as D}from"./main.3GWz905i.0.0.31-alpha.7.js";import{s as P}from"./utils.mAKpSMLY.0.0.31-alpha.7.js";import{j as Q}from"./@vueuse.PD04ZxXf.0.0.31-alpha.7.js";import{A as E,R as G,e as U,b as F}from"./vuetify.eyVDgSy7.0.0.31-alpha.7.js";import{G as A,t as K,r as S,c as C,x as O,b as t,d as s,u as e,O as h,R as g,N as n,f as c,U as d,e as W,k as _,g as u,S as $,aa as Y,Y as z,P as q,W as H}from"./@vue.FH56CEei.0.0.31-alpha.7.js";import{e as J}from"./@mdi.DVdKciOk.0.0.31-alpha.7.js";import{s as X}from"./pinia.BmNMGws-.0.0.31-alpha.7.js";import"./qrcode.C6itkoyR.0.0.31-alpha.7.js";import"./dijkstrajs.D_NXgYpA.0.0.31-alpha.7.js";import"./vee-validate.CgBFBn_c.0.0.31-alpha.7.js";import"./zod.DnW1_kUe.0.0.31-alpha.7.js";import"./@vee-validate.C1sFKgmu.0.0.31-alpha.7.js";import"./vue3-toastify.183kFIIP.0.0.31-alpha.7.js";import"./plugins.8xllclI2.0.0.31-alpha.7.js";import"./@tanstack.C5ZmdPMX.0.0.31-alpha.7.js";import"./draggabilly.GpB8TOyE.0.0.31-alpha.7.js";import"./@xterm.5BydZhPp.0.0.31-alpha.7.js";import"./get-size.D1dS-IaP.0.0.31-alpha.7.js";import"./unidragger.DGZQtVYj.0.0.31-alpha.7.js";import"./ev-emitter.BJv01w63.0.0.31-alpha.7.js";import"./vue-router.6SfjZo7d.0.0.31-alpha.7.js";import"./vue-i18n.47lrsSx-.0.0.31-alpha.7.js";import"./@intlify.Jdj6PDCT.0.0.31-alpha.7.js";import"./axios.C-n2IhIP.0.0.31-alpha.7.js";import"./@camera.ui.ilP0Pgi-.0.0.31-alpha.7.js";import"./uuid.DvF23Exx.0.0.31-alpha.7.js";import"./socket.io-client.CREiw90L.0.0.31-alpha.7.js";import"./engine.io-client.0rDBaiC-.0.0.31-alpha.7.js";import"./engine.io-parser.BiEtp6m2.0.0.31-alpha.7.js";import"./@socket.io.Dkula2eQ.0.0.31-alpha.7.js";import"./socket.io-parser.CXwV0PeT.0.0.31-alpha.7.js";import"./rxjs.yBzqm3cW.0.0.31-alpha.7.js";import"./tslib.9k7AwCpt.0.0.31-alpha.7.js";import"./vue-inline-svg.B_v_uRHL.0.0.31-alpha.7.js";import"./v-calendar.DbgRs2B9.0.0.31-alpha.7.js";import"./@popperjs.BQBsAJpH.0.0.31-alpha.7.js";import"./nprogress.Vi6jioDG.0.0.31-alpha.7.js";const Z={key:0,class:"camera-events hide-scrollbar flex flex-auto flex-row"},ee={key:1,class:"disabled-text"},te={key:2,class:"camera-events hide-scrollbar flex flex-auto flex-row"},se=["onClick"],ae=A({__name:"VCameraEvents",props:{showAll:{type:Boolean,default:!1},camera:{}},setup(V){const y=V,{camera:a,showAll:f}=K(y),m=S(!0),p=S(null),x=Q(p),i=C(()=>{const r=[];for(let o=0;o<50;o++)r.push({camera:"Kamera 1",title:"Event 1",type:"motion",timestamp:Date.now(),image:void 0});return r}),k=C(()=>f.value||i.value.some(r=>r.camera===(a==null?void 0:a.value))),l=C(()=>Math.ceil(x.width.value/150)),B=r=>{console.log(r)},w=r=>!!(f.value||a!=null&&a.value&&r===a.value);return O(async()=>{await P(1500),m.value=!1}),(r,o)=>{const N=L;return t(),s("div",{ref_key:"main",ref:p,class:"camera-events-container"},[e(m)?(t(),s("div",Z,[(t(!0),s(h,null,g(e(l),(v,b)=>(t(),s("div",{key:b,class:"mx-1 flex flex-col justify-center items-center"},[n(E,{elevation:1,height:"140px",type:"image",class:"camera-event-card"}),n(E,{elevation:0,type:"text",style:{background:"none"}})]))),128))])):!e(m)&&(!e(k)||!e(i).length)?(t(),s("div",ee,[c("span",null,d(r.$t("components.camera_events.no_events")),1)])):(t(),s("div",te,[(t(!0),s(h,null,g(e(i),(v,b)=>(t(),s("div",{key:b,class:"mx-1 text-center"},[w(v.camera)?W((t(),s("div",{key:0,class:"camera-event-card cursor-pointer",onClick:ce=>B(v)},[n(N,{style:{background:"var(--background-img)","border-radius":"5px"},src:v.image,width:"100%",height:"100%","aspect-ratio":"1/1","spinner-size":"15","spinner-width":"2","error-style":"","placeholder-style":"",cover:""},null,8,["src"])],8,se)),[[G]]):_("",!0),o[0]||(o[0]=c("span",{class:"text-sm text-passive"},"12:01:45",-1))]))),128))]))],512)}}}),re=R(ae,[["__scopeId","data-v-ebd7b0ef"]]),oe={class:"page-title"},ie={class:"page-title"},ne={key:"new-camera",class:"w-full flex justify-center items-center mt-3"},le=A({__name:"Cameras",setup(V){const y=new j,{smallMobileActive:a,extraSmallMobileActive:f}=M(),m=T(),{uiSettings:p}=X(m),x=S({page:1,pageSize:-1}),{data:i,isLoading:k}=y.getCamerasQuery(x);return(l,B)=>{const w=re,r=I;return t(),s("main",{class:u(["w-full h-full",{"px-0":e(a)}])},[e(p).cameras.showEvents?(t(),s("div",{key:0,class:u(["mb-3 flex items-center",{"px-2":e(a)}]),style:{height:"30px"}},[c("h1",oe,d(l.$t("views.cameras.events")),1)],2)):_("",!0),e(p).cameras.showEvents?(t(),s("div",{key:1,class:u(["w-full mb-3",{"px-2":e(a)}])},[n(w,{"show-all":""})],2)):_("",!0),c("div",{class:u(["mb-3 flex items-center",{"px-2":e(a)}]),style:{height:"30px"}},[c("h1",ie,d(l.$t(`views.${String(l.$route.name).toLowerCase()}.title`)),1)],2),n(Y,{name:"fade",tag:"div"},{default:$(()=>[e(k)||!e(i)?(t(),s("div",{key:0,class:"grid",style:z(`grid-template-columns: repeat(auto-fit, minmax(${e(a)?"100%":"300px"}, 1fr))`)},[(t(),s(h,null,g(8,o=>n(E,{key:o,elevation:1,type:"image",class:"w-full h-full aspect-video"})),64))],4)):e(i).result.length?(t(),s("div",{key:2,class:"grid",style:z(`grid-template-columns: repeat(auto-fit, minmax(${e(a)?"100%":"300px"}, 1fr)) ${e(i).result.length===1?"50%":""}`)},[(t(!0),s(h,null,g(e(i).result,o=>(t(),s("div",{key:o.name,class:"relative item"},[n(r,{"absolute-title":"","show-title":"","show-tooltips":!1,"clickable-title":"","clickable-container":"",settings:"","current-camera":o.name,"border-radius":e(a)?0:3,border:!1,target:"snapshot","button-elevation":"1"},null,8,["current-camera","border-radius"])]))),128))],4)):(t(),s("div",{key:1,class:u({"disabled-text":!0,"px-2":e(a)})},d(l.$t("views.cameras.no_cameras")),3)),c("div",ne,[e(D)(void 0,"admin")&&!e(f)?(t(),q(F,{key:0,to:"/new-camera",variant:"text",color:"#df2a4c",icon:""},{default:$(()=>[n(U,{size:"30"},{default:$(()=>[H(d(e(J)),1)]),_:1})]),_:1})):_("",!0)])]),_:1})],2)}}}),Ye=R(le,[["__scopeId","data-v-fdfbad07"]]);export{Ye as default};
|