@futdevpro/ccap 1.1.2771 → 1.1.2863
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/client-dist/{agent-instances.module-I4BSGDNA.js → agent-instances.module-SRVXVWB4.js} +2 -2
- package/client-dist/{ca.module-4FWP2XY4.js → ca.module-ZAYCRAK6.js} +2 -2
- package/client-dist/cc-usage-dashboard.component-TNMEIWMI.js +2 -0
- package/client-dist/cc-usage-dashboard.component-TNMEIWMI.js.map +7 -0
- package/client-dist/{cc.module-G2GSNVFJ.js → cc.module-BF2AOAIM.js} +2 -2
- package/client-dist/{chunk-WBMES66O.js → chunk-23GMPVB5.js} +2 -2
- package/client-dist/{chunk-DVGKMXHM.js → chunk-2DJBCAHJ.js} +2 -2
- package/client-dist/{chunk-LUIH5IH4.js → chunk-2LOFMRCO.js} +2 -2
- package/client-dist/{chunk-6VSHLGVD.js → chunk-2X5MWPDN.js} +2 -2
- package/client-dist/{chunk-HDPOKOM5.js → chunk-2Y7GYEOT.js} +2 -2
- package/client-dist/{chunk-WYRNU54S.js → chunk-34XFCTVF.js} +2 -2
- package/client-dist/{chunk-E6RJBEUN.js → chunk-4RT7LOTQ.js} +2 -2
- package/client-dist/{chunk-NWNWKLLW.js → chunk-4TEHGQ5C.js} +2 -2
- package/client-dist/{chunk-7DKTD4P6.js → chunk-4XEPGDZH.js} +2 -2
- package/client-dist/{chunk-7NPTBX4Y.js → chunk-52JG2IIG.js} +2 -2
- package/client-dist/{chunk-JVO3EHGB.js → chunk-77HGZO43.js} +2 -2
- package/client-dist/{chunk-YURXOU4U.js → chunk-7JFONJTJ.js} +2 -2
- package/client-dist/{chunk-7AQGRHMA.js → chunk-7JW45JC5.js} +2 -2
- package/client-dist/{chunk-7V3LRQAZ.js → chunk-7MSQD5HV.js} +2 -2
- package/client-dist/{chunk-64BJ5ZPJ.js → chunk-AFF37OKI.js} +2 -2
- package/client-dist/{chunk-XT2TWSB3.js → chunk-B7WQ5TK3.js} +2 -2
- package/client-dist/{chunk-ZVNHBXJU.js → chunk-CBIUSRE5.js} +2 -2
- package/client-dist/{chunk-YJEHCUWB.js → chunk-CUUDVYOC.js} +2 -2
- package/client-dist/{chunk-ZQ4GFPEN.js → chunk-DHIVAX2C.js} +2 -2
- package/client-dist/{chunk-ASQEQSVO.js → chunk-DU3IYPGM.js} +2 -2
- package/client-dist/{chunk-IPOJA4NQ.js → chunk-DUN7ICUI.js} +2 -2
- package/client-dist/{chunk-DI7UBKC5.js → chunk-DZ74YN25.js} +2 -2
- package/client-dist/{chunk-23UH5S6I.js → chunk-EDQWK2Q5.js} +2 -2
- package/client-dist/{chunk-P7FDJL6S.js → chunk-EIT3LSQO.js} +2 -2
- package/client-dist/{chunk-CDKFHI2N.js → chunk-ELFCSLIP.js} +2 -2
- package/client-dist/{chunk-CDKFHI2N.js.map → chunk-ELFCSLIP.js.map} +1 -1
- package/client-dist/{chunk-WE3IF6CE.js → chunk-EMVGFT6L.js} +2 -2
- package/client-dist/{chunk-AVBSYCMH.js → chunk-EUY2HZZV.js} +2 -2
- package/client-dist/{chunk-MZ3LRP25.js → chunk-EZNIJZBL.js} +2 -2
- package/client-dist/{chunk-KCEYLL24.js → chunk-FYXUOXRP.js} +2 -2
- package/client-dist/{chunk-X2KATA6U.js → chunk-GODWUWRO.js} +2 -2
- package/client-dist/{chunk-WWZOAP46.js → chunk-HSAGX22H.js} +2 -2
- package/client-dist/{chunk-WHRKP7CF.js → chunk-I6OBHW45.js} +8 -8
- package/client-dist/{chunk-WHRKP7CF.js.map → chunk-I6OBHW45.js.map} +1 -1
- package/client-dist/{chunk-6VFHL63I.js → chunk-L7PQ72ZG.js} +2 -2
- package/client-dist/{chunk-LYCDXEA4.js → chunk-NI4AZWY2.js} +2 -2
- package/client-dist/{chunk-FTVB36SW.js → chunk-O7U4KV25.js} +2 -2
- package/client-dist/{chunk-M7S54EWW.js → chunk-OIBDRASW.js} +2 -2
- package/client-dist/{chunk-737N2QOC.js → chunk-PZMEVMSF.js} +2 -2
- package/client-dist/{chunk-EXE26RV4.js → chunk-Q7GDEJL2.js} +2 -2
- package/client-dist/{chunk-T4N37SRP.js → chunk-QHLRSGQG.js} +2 -2
- package/client-dist/{chunk-CNZUTJXV.js → chunk-QTRIOR6Z.js} +2 -2
- package/client-dist/{chunk-4CUQDHAH.js → chunk-QUEQSNIS.js} +2 -2
- package/client-dist/{chunk-PQIHFZG3.js → chunk-SO3QL2U5.js} +2 -2
- package/client-dist/{chunk-C43VIJCY.js → chunk-SX22WHCZ.js} +2 -2
- package/client-dist/{chunk-2HJ74DSG.js → chunk-TUKCFE3B.js} +2 -2
- package/client-dist/{chunk-3FRNDMIC.js → chunk-UI6N7Y2P.js} +2 -2
- package/client-dist/{chunk-V42OZMBH.js → chunk-VLMQV3OI.js} +2 -2
- package/client-dist/{chunk-AKOD5HPA.js → chunk-VXJF6N32.js} +2 -2
- package/client-dist/{chunk-3FRRZGAB.js → chunk-WQIBGXGU.js} +2 -2
- package/client-dist/{chunk-7MOSEOQF.js → chunk-WYTT3YHQ.js} +2 -2
- package/client-dist/{chunk-5QT5PZ2B.js → chunk-X2FIFUXZ.js} +2 -2
- package/client-dist/{chunk-D2TMY72D.js → chunk-XSP7NLZB.js} +2 -2
- package/client-dist/{chunk-4HEHXXDL.js → chunk-XXO2YNDP.js} +2 -2
- package/client-dist/{chunk-SXP4YJY5.js → chunk-YGTNCGIU.js} +2 -2
- package/client-dist/{chunk-KYI7S4JV.js → chunk-YU32GIMP.js} +2 -2
- package/client-dist/{chunk-TKE33F7W.js → chunk-ZGWUDLYU.js} +2 -2
- package/client-dist/{chunk-BV54ST5B.js → chunk-ZMZ462V7.js} +2 -2
- package/client-dist/{consultant.module-ACB352FM.js → consultant.module-3PAIPMAH.js} +2 -2
- package/client-dist/{crd.module-XN253YIG.js → crd.module-PJO2UJEG.js} +2 -2
- package/client-dist/{dashboard.module-F43GCOJ6.js → dashboard.module-TJMYHTHX.js} +2 -2
- package/client-dist/{do.module-OHJBGMDT.js → do.module-SBE6P3B7.js} +2 -2
- package/client-dist/{document-library.module-WDOKDFTM.js → document-library.module-YH7IF4EP.js} +2 -2
- package/client-dist/{embedding-eval.module-ECD7QXRH.js → embedding-eval.module-STWWCUD7.js} +2 -2
- package/client-dist/{embedding-registry.module-764ZU57G.js → embedding-registry.module-XX6725DX.js} +2 -2
- package/client-dist/{err.module-R2ATIMSQ.js → err.module-SL2IYMTF.js} +2 -2
- package/client-dist/{feedback.module-ALGNJKOG.js → feedback.module-RMRL65YC.js} +2 -2
- package/client-dist/{host-runtime-mcp.module-Z3D57LRD.js → host-runtime-mcp.module-OJORUP2R.js} +2 -2
- package/client-dist/index.html +1 -1
- package/client-dist/{live-dev-pipeline.module-EHZPO24W.js → live-dev-pipeline.module-AMBMFVIH.js} +2 -2
- package/client-dist/{logs.module-QNMNIVLO.js → logs.module-3CQ6KLLB.js} +2 -2
- package/client-dist/{main-IYPXSS3O.js → main-RCFMPV3V.js} +5 -5
- package/client-dist/main-RCFMPV3V.js.map +7 -0
- package/client-dist/{master-control-remote-poc.module-BVKFRRZN.js → master-control-remote-poc.module-FD3E5JB7.js} +2 -2
- package/client-dist/{mobile-app.module-WUZGYVG6.js → mobile-app.module-LHVADRFV.js} +2 -2
- package/client-dist/{model-registry.module-WDC3LG3H.js → model-registry.module-ZTKOWGAN.js} +2 -2
- package/client-dist/{oc.module-K5COGX5N.js → oc.module-GLPSVTAT.js} +2 -2
- package/client-dist/{orc.module-EA5J6IGA.js → orc.module-BKMJC5YX.js} +2 -2
- package/client-dist/{project-management.module-UI36OFRI.js → project-management.module-QEIXJONY.js} +2 -2
- package/client-dist/project-source-routed.module-LSFQT5DK.js +2 -0
- package/client-dist/{scheduler.module-AOWDLFVH.js → scheduler.module-TD4G2WNF.js} +2 -2
- package/client-dist/{session.module-2FLZRRCE.js → session.module-YCITR6BG.js} +2 -2
- package/client-dist/{set.module-B7XMMVTO.js → set.module-JIWXIF2C.js} +2 -2
- package/client-dist/{setup.module-O26UCVEY.js → setup.module-ZWL33O7N.js} +2 -2
- package/client-dist/{terminals.module-LTV6MFUG.js → terminals.module-MKXQLASR.js} +2 -2
- package/client-dist/{voice-notes-poc.module-VXD3G3TV.js → voice-notes-poc.module-7LUIU7P5.js} +2 -2
- package/client-dist/{wfs.module-B2UGRMKL.js → wfs.module-2BMXPFAL.js} +2 -2
- package/package.json +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/account/cc-account-discovery.util.d.ts +25 -3
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/account/cc-account-discovery.util.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/account/cc-account-discovery.util.js +23 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/account/cc-account-discovery.util.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/account/cc-account-discovery.util.spec.js +56 -3
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/account/cc-account-discovery.util.spec.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.d.ts +20 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.js +98 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.d.ts +51 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.d.ts.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.js +72 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.js.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.spec.d.ts +2 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.spec.d.ts.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.spec.js +67 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_models/data-models/cc-account-usage-state.data-model.spec.js.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.d.ts +33 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.js +56 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.spec.js +38 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.spec.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account.controller.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account.controller.js +29 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account.controller.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.d.ts +6 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.js +48 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.spec.js +55 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.spec.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.d.ts +53 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.d.ts.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.js +168 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.js.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.spec.d.ts +2 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.spec.d.ts.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.spec.js +156 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-usage-state.data-service.spec.js.map +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-manager.control-service.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-manager.control-service.js +9 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-manager.control-service.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/claude-code.data-service.d.ts +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/claude-code.data-service.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/claude-code.data-service.js +1 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/claude-code.data-service.js.map +1 -1
- package/server/build/src/_modules/messaging/_collections/consts/msg.const.d.ts +17 -0
- package/server/build/src/_modules/messaging/_collections/consts/msg.const.d.ts.map +1 -1
- package/server/build/src/_modules/messaging/_collections/consts/msg.const.js +19 -1
- package/server/build/src/_modules/messaging/_collections/consts/msg.const.js.map +1 -1
- package/server/build/src/app.server.d.ts +2 -8
- package/server/build/src/app.server.d.ts.map +1 -1
- package/server/build/src/app.server.js +6 -14
- package/server/build/src/app.server.js.map +1 -1
- package/client-dist/main-IYPXSS3O.js.map +0 -7
- package/client-dist/project-source-routed.module-ADAJCFPE.js +0 -2
- /package/client-dist/{agent-instances.module-I4BSGDNA.js.map → agent-instances.module-SRVXVWB4.js.map} +0 -0
- /package/client-dist/{ca.module-4FWP2XY4.js.map → ca.module-ZAYCRAK6.js.map} +0 -0
- /package/client-dist/{cc.module-G2GSNVFJ.js.map → cc.module-BF2AOAIM.js.map} +0 -0
- /package/client-dist/{chunk-WBMES66O.js.map → chunk-23GMPVB5.js.map} +0 -0
- /package/client-dist/{chunk-DVGKMXHM.js.map → chunk-2DJBCAHJ.js.map} +0 -0
- /package/client-dist/{chunk-LUIH5IH4.js.map → chunk-2LOFMRCO.js.map} +0 -0
- /package/client-dist/{chunk-6VSHLGVD.js.map → chunk-2X5MWPDN.js.map} +0 -0
- /package/client-dist/{chunk-HDPOKOM5.js.map → chunk-2Y7GYEOT.js.map} +0 -0
- /package/client-dist/{chunk-WYRNU54S.js.map → chunk-34XFCTVF.js.map} +0 -0
- /package/client-dist/{chunk-E6RJBEUN.js.map → chunk-4RT7LOTQ.js.map} +0 -0
- /package/client-dist/{chunk-NWNWKLLW.js.map → chunk-4TEHGQ5C.js.map} +0 -0
- /package/client-dist/{chunk-7DKTD4P6.js.map → chunk-4XEPGDZH.js.map} +0 -0
- /package/client-dist/{chunk-7NPTBX4Y.js.map → chunk-52JG2IIG.js.map} +0 -0
- /package/client-dist/{chunk-JVO3EHGB.js.map → chunk-77HGZO43.js.map} +0 -0
- /package/client-dist/{chunk-YURXOU4U.js.map → chunk-7JFONJTJ.js.map} +0 -0
- /package/client-dist/{chunk-7AQGRHMA.js.map → chunk-7JW45JC5.js.map} +0 -0
- /package/client-dist/{chunk-7V3LRQAZ.js.map → chunk-7MSQD5HV.js.map} +0 -0
- /package/client-dist/{chunk-64BJ5ZPJ.js.map → chunk-AFF37OKI.js.map} +0 -0
- /package/client-dist/{chunk-XT2TWSB3.js.map → chunk-B7WQ5TK3.js.map} +0 -0
- /package/client-dist/{chunk-ZVNHBXJU.js.map → chunk-CBIUSRE5.js.map} +0 -0
- /package/client-dist/{chunk-YJEHCUWB.js.map → chunk-CUUDVYOC.js.map} +0 -0
- /package/client-dist/{chunk-ZQ4GFPEN.js.map → chunk-DHIVAX2C.js.map} +0 -0
- /package/client-dist/{chunk-ASQEQSVO.js.map → chunk-DU3IYPGM.js.map} +0 -0
- /package/client-dist/{chunk-IPOJA4NQ.js.map → chunk-DUN7ICUI.js.map} +0 -0
- /package/client-dist/{chunk-DI7UBKC5.js.map → chunk-DZ74YN25.js.map} +0 -0
- /package/client-dist/{chunk-23UH5S6I.js.map → chunk-EDQWK2Q5.js.map} +0 -0
- /package/client-dist/{chunk-P7FDJL6S.js.map → chunk-EIT3LSQO.js.map} +0 -0
- /package/client-dist/{chunk-WE3IF6CE.js.map → chunk-EMVGFT6L.js.map} +0 -0
- /package/client-dist/{chunk-AVBSYCMH.js.map → chunk-EUY2HZZV.js.map} +0 -0
- /package/client-dist/{chunk-MZ3LRP25.js.map → chunk-EZNIJZBL.js.map} +0 -0
- /package/client-dist/{chunk-KCEYLL24.js.map → chunk-FYXUOXRP.js.map} +0 -0
- /package/client-dist/{chunk-X2KATA6U.js.map → chunk-GODWUWRO.js.map} +0 -0
- /package/client-dist/{chunk-WWZOAP46.js.map → chunk-HSAGX22H.js.map} +0 -0
- /package/client-dist/{chunk-6VFHL63I.js.map → chunk-L7PQ72ZG.js.map} +0 -0
- /package/client-dist/{chunk-LYCDXEA4.js.map → chunk-NI4AZWY2.js.map} +0 -0
- /package/client-dist/{chunk-FTVB36SW.js.map → chunk-O7U4KV25.js.map} +0 -0
- /package/client-dist/{chunk-M7S54EWW.js.map → chunk-OIBDRASW.js.map} +0 -0
- /package/client-dist/{chunk-737N2QOC.js.map → chunk-PZMEVMSF.js.map} +0 -0
- /package/client-dist/{chunk-EXE26RV4.js.map → chunk-Q7GDEJL2.js.map} +0 -0
- /package/client-dist/{chunk-T4N37SRP.js.map → chunk-QHLRSGQG.js.map} +0 -0
- /package/client-dist/{chunk-CNZUTJXV.js.map → chunk-QTRIOR6Z.js.map} +0 -0
- /package/client-dist/{chunk-4CUQDHAH.js.map → chunk-QUEQSNIS.js.map} +0 -0
- /package/client-dist/{chunk-PQIHFZG3.js.map → chunk-SO3QL2U5.js.map} +0 -0
- /package/client-dist/{chunk-C43VIJCY.js.map → chunk-SX22WHCZ.js.map} +0 -0
- /package/client-dist/{chunk-2HJ74DSG.js.map → chunk-TUKCFE3B.js.map} +0 -0
- /package/client-dist/{chunk-3FRNDMIC.js.map → chunk-UI6N7Y2P.js.map} +0 -0
- /package/client-dist/{chunk-V42OZMBH.js.map → chunk-VLMQV3OI.js.map} +0 -0
- /package/client-dist/{chunk-AKOD5HPA.js.map → chunk-VXJF6N32.js.map} +0 -0
- /package/client-dist/{chunk-3FRRZGAB.js.map → chunk-WQIBGXGU.js.map} +0 -0
- /package/client-dist/{chunk-7MOSEOQF.js.map → chunk-WYTT3YHQ.js.map} +0 -0
- /package/client-dist/{chunk-5QT5PZ2B.js.map → chunk-X2FIFUXZ.js.map} +0 -0
- /package/client-dist/{chunk-D2TMY72D.js.map → chunk-XSP7NLZB.js.map} +0 -0
- /package/client-dist/{chunk-4HEHXXDL.js.map → chunk-XXO2YNDP.js.map} +0 -0
- /package/client-dist/{chunk-SXP4YJY5.js.map → chunk-YGTNCGIU.js.map} +0 -0
- /package/client-dist/{chunk-KYI7S4JV.js.map → chunk-YU32GIMP.js.map} +0 -0
- /package/client-dist/{chunk-TKE33F7W.js.map → chunk-ZGWUDLYU.js.map} +0 -0
- /package/client-dist/{chunk-BV54ST5B.js.map → chunk-ZMZ462V7.js.map} +0 -0
- /package/client-dist/{consultant.module-ACB352FM.js.map → consultant.module-3PAIPMAH.js.map} +0 -0
- /package/client-dist/{crd.module-XN253YIG.js.map → crd.module-PJO2UJEG.js.map} +0 -0
- /package/client-dist/{dashboard.module-F43GCOJ6.js.map → dashboard.module-TJMYHTHX.js.map} +0 -0
- /package/client-dist/{do.module-OHJBGMDT.js.map → do.module-SBE6P3B7.js.map} +0 -0
- /package/client-dist/{document-library.module-WDOKDFTM.js.map → document-library.module-YH7IF4EP.js.map} +0 -0
- /package/client-dist/{embedding-eval.module-ECD7QXRH.js.map → embedding-eval.module-STWWCUD7.js.map} +0 -0
- /package/client-dist/{embedding-registry.module-764ZU57G.js.map → embedding-registry.module-XX6725DX.js.map} +0 -0
- /package/client-dist/{err.module-R2ATIMSQ.js.map → err.module-SL2IYMTF.js.map} +0 -0
- /package/client-dist/{feedback.module-ALGNJKOG.js.map → feedback.module-RMRL65YC.js.map} +0 -0
- /package/client-dist/{host-runtime-mcp.module-Z3D57LRD.js.map → host-runtime-mcp.module-OJORUP2R.js.map} +0 -0
- /package/client-dist/{live-dev-pipeline.module-EHZPO24W.js.map → live-dev-pipeline.module-AMBMFVIH.js.map} +0 -0
- /package/client-dist/{logs.module-QNMNIVLO.js.map → logs.module-3CQ6KLLB.js.map} +0 -0
- /package/client-dist/{master-control-remote-poc.module-BVKFRRZN.js.map → master-control-remote-poc.module-FD3E5JB7.js.map} +0 -0
- /package/client-dist/{mobile-app.module-WUZGYVG6.js.map → mobile-app.module-LHVADRFV.js.map} +0 -0
- /package/client-dist/{model-registry.module-WDC3LG3H.js.map → model-registry.module-ZTKOWGAN.js.map} +0 -0
- /package/client-dist/{oc.module-K5COGX5N.js.map → oc.module-GLPSVTAT.js.map} +0 -0
- /package/client-dist/{orc.module-EA5J6IGA.js.map → orc.module-BKMJC5YX.js.map} +0 -0
- /package/client-dist/{project-management.module-UI36OFRI.js.map → project-management.module-QEIXJONY.js.map} +0 -0
- /package/client-dist/{project-source-routed.module-ADAJCFPE.js.map → project-source-routed.module-LSFQT5DK.js.map} +0 -0
- /package/client-dist/{scheduler.module-AOWDLFVH.js.map → scheduler.module-TD4G2WNF.js.map} +0 -0
- /package/client-dist/{session.module-2FLZRRCE.js.map → session.module-YCITR6BG.js.map} +0 -0
- /package/client-dist/{set.module-B7XMMVTO.js.map → set.module-JIWXIF2C.js.map} +0 -0
- /package/client-dist/{setup.module-O26UCVEY.js.map → setup.module-ZWL33O7N.js.map} +0 -0
- /package/client-dist/{terminals.module-LTV6MFUG.js.map → terminals.module-MKXQLASR.js.map} +0 -0
- /package/client-dist/{voice-notes-poc.module-VXD3G3TV.js.map → voice-notes-poc.module-7LUIU7P5.js.map} +0 -0
- /package/client-dist/{wfs.module-B2UGRMKL.js.map → wfs.module-2BMXPFAL.js.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as ks}from"./chunk-
|
|
2
|
-
This means that the reconnection will use the socket.io reconnection logic, `,"not the Dynamo implementations."),this.reconnect=!1)}};xe.DyFM_SocketClient_Params=bt});var kt=f(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.DyFM_SocketEvent=void 0;var Ie=
|
|
1
|
+
import{j as ks}from"./chunk-2LOFMRCO.js";import{I as $,N as Es,a as _s,b as ys,c as gs,d as ur,e as gt,f as ms,g as lr,i as hr,l as bs,n as dr,p as fr}from"./chunk-ELFCSLIP.js";import{C as oe,H as _t,O as fs,P as De,a as as,aa as z,e as cr,f,g as ar,h as us,hb as ps,i as K,ib as yt,jb as Fe,k as u,l as ls,m as hs,w as pt,y as ds}from"./chunk-TBMJSIBB.js";var qe=f(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.DyFM_SocketEvent_Key=void 0;var vs=function(s){return s.incomingNewConnection="connection",s.outgoingNewConnection="connect",s.subscribe="subscribe",s.subscriptionSuccessful="subscriptionSuccessful",s.unsubscribe="unsubscribe",s.unsubscribeSuccessful="unsubscribeSuccessful",s.disconnect="disconnect",s.ping="ping",s.event="event",s.error="error",s}(vs||(Me.DyFM_SocketEvent_Key=vs={}))});var Ss=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.DyFM_SocketClient_Params=void 0;var yr=ur(),gr=gt(),bt=class{name;service;address;port;reconnectDelay=yr.second*30;reconnect=!0;socketOptions;constructor(e){Object.assign(this,e),this.reconnect=!!this.reconnectDelay,(this.socketOptions?.autoConnect||this.socketOptions?.reconnection||this.socketOptions?.reconnectionDelay)&&(gr.DyFM_Log.warn("autoConnect or reconnection is set to true in socketOptions, so reconnect is set to false",`
|
|
2
|
+
This means that the reconnection will use the socket.io reconnection logic, `,"not the Dynamo implementations."),this.reconnect=!1)}};xe.DyFM_SocketClient_Params=bt});var kt=f(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.DyFM_SocketEvent=void 0;var Ie=gs(),ws=ms(),Ee=gt(),mr=hr(),br=bs(),ke=qe(),Et=class{name;eventKey;serviceName;preProcesses;tasks;logEvent;logEventContent;stackLocation;constructor(e){try{this.name=e.name??e.eventKey,this.eventKey=e.eventKey,this.serviceName=e.serviceName??"UnknownSocketService",this.preProcesses=e.preProcesses??[],this.tasks=e.tasks??[],this.stackLocation=(0,mr.DyFM_getConstructionStackLocation)(),e.logEvent!==void 0?this.logEvent=e.logEvent:this.eventKey===ke.DyFM_SocketEvent_Key.subscribe?this.logEvent=!1:[ke.DyFM_SocketEvent_Key.incomingNewConnection,ke.DyFM_SocketEvent_Key.outgoingNewConnection,ke.DyFM_SocketEvent_Key.disconnect].includes(this.eventKey)?this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents||Ie.DyFM_global_settings.log_settings.socket_mainEvents:this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents,this.logEventContent=e.logEventContent??Ie.DyFM_global_settings.log_settings.socket_eventContent}catch(t){throw Ee.DyFM_Log.error(`
|
|
3
3
|
Socket Event params setup failed (${this.serviceName}): ${e.eventKey}`,t),t}}getPreLog(e){return u(this,null,function*(){try{this.logEventContent&&this.eventKey!==ke.DyFM_SocketEvent_Key.incomingNewConnection?Ee.DyFM_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey};
|
|
4
4
|
|
|
5
|
-
content:`,e):Ee.DyFM_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey}...`)}catch(t){Ee.DyFM_Log.error(`PreLog failed... (socket: ${this.serviceName})`,t)}})}executeEventTasks(e,t){return u(this,null,function*(){try{(this.logEvent||this.logEventContent)&&(yield this.getPreLog(e)),yield ws.DyFM_Array.asyncForEach(this.preProcesses,n=>u(this,null,function*(){e=yield n(e)})),yield ws.DyFM_Array.asyncForEach(this.tasks,n=>u(this,null,function*(){yield n(e,t)}))}catch(n){n instanceof yr.DyFM_Error?n.logShort("Socket Event tasks failed to execute"):Ee.DyFM_Log.error(`Socket Event tasks failed to execute on ${this.serviceName}.... (${this.eventKey})`,n,"content:",e)}})}};je.DyFM_SocketEvent=Et});var Le=f(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.ERROR_PACKET=V.PACKET_TYPES_REVERSE=V.PACKET_TYPES=void 0;var q=Object.create(null);V.PACKET_TYPES=q;q.open="0";q.close="1";q.ping="2";q.pong="3";q.message="4";q.upgrade="5";q.noop="6";var Cs=Object.create(null);V.PACKET_TYPES_REVERSE=Cs;Object.keys(q).forEach(s=>{Cs[q[s]]=s});var mr={type:"error",data:"parser error"};V.ERROR_PACKET=mr});var Ds=f(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.encodePacket=void 0;ve.encodePacketToBinary=Er;var br=Le(),Rs=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ps=typeof ArrayBuffer=="function",As=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Ns=({type:s,data:e},t,n)=>Rs&&e instanceof Blob?t?n(e):Ts(e,n):Ps&&(e instanceof ArrayBuffer||As(e))?t?n(e):Ts(new Blob([e]),n):n(br.PACKET_TYPES[s]+(e||""));ve.encodePacket=Ns;var Ts=(s,e)=>{let t=new FileReader;return t.onload=function(){let n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(s)};function Os(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var vt;function Er(s,e){if(Rs&&s.data instanceof Blob)return s.data.arrayBuffer().then(Os).then(e);if(Ps&&(s.data instanceof ArrayBuffer||As(s.data)))return e(Os(s.data));Ns(s,!1,t=>{vt||(vt=new TextEncoder),e(vt.encode(t))})}});var Fs=f(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.decode=ae.encode=void 0;var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<ce.length;s++)Se[ce.charCodeAt(s)]=s;var kr=s=>{let e=new Uint8Array(s),t,n=e.length,r="";for(t=0;t<n;t+=3)r+=ce[e[t]>>2],r+=ce[(e[t]&3)<<4|e[t+1]>>4],r+=ce[(e[t+1]&15)<<2|e[t+2]>>6],r+=ce[e[t+2]&63];return n%3===2?r=r.substring(0,r.length-1)+"=":n%3===1&&(r=r.substring(0,r.length-2)+"=="),r};ae.encode=kr;var vr=s=>{let e=s.length*.75,t=s.length,n,r=0,i,o,c,h;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);let _=new ArrayBuffer(e),a=new Uint8Array(_);for(n=0;n<t;n+=4)i=Se[s.charCodeAt(n)],o=Se[s.charCodeAt(n+1)],c=Se[s.charCodeAt(n+2)],h=Se[s.charCodeAt(n+3)],a[r++]=i<<2|o>>4,a[r++]=(o&15)<<4|c>>2,a[r++]=(c&3)<<6|h&63;return _};ae.decode=vr});var qs=f(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.decodePacket=void 0;var Be=Le(),Sr=Fs(),wr=typeof ArrayBuffer=="function",Cr=(s,e)=>{if(typeof s!="string")return{type:"message",data:Ms(s,e)};let t=s.charAt(0);return t==="b"?{type:"message",data:Tr(s.substring(1),e)}:Be.PACKET_TYPES_REVERSE[t]?s.length>1?{type:Be.PACKET_TYPES_REVERSE[t],data:s.substring(1)}:{type:Be.PACKET_TYPES_REVERSE[t]}:Be.ERROR_PACKET};Ue.decodePacket=Cr;var Tr=(s,e)=>{if(wr){let t=(0,Sr.decode)(s);return Ms(t,e)}else return{base64:!0,data:s}},Ms=(s,e)=>{switch(e){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}}});var ue=f(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.decodePayload=O.decodePacket=O.encodePayload=O.encodePacket=O.protocol=void 0;O.createPacketEncoderStream=Pr;O.createPacketDecoderStream=Ar;var wt=Ds();Object.defineProperty(O,"encodePacket",{enumerable:!0,get:function(){return wt.encodePacket}});var Ct=qs();Object.defineProperty(O,"decodePacket",{enumerable:!0,get:function(){return Ct.decodePacket}});var xs=Le(),Is="",Or=(s,e)=>{let t=s.length,n=new Array(t),r=0;s.forEach((i,o)=>{(0,wt.encodePacket)(i,!1,c=>{n[o]=c,++r===t&&e(n.join(Is))})})};O.encodePayload=Or;var Rr=(s,e)=>{let t=s.split(Is),n=[];for(let r=0;r<t.length;r++){let i=(0,Ct.decodePacket)(t[r],e);if(n.push(i),i.type==="error")break}return n};O.decodePayload=Rr;function Pr(){return new TransformStream({transform(s,e){(0,wt.encodePacketToBinary)(s,t=>{let n=t.length,r;if(n<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,n);else if(n<65536){r=new Uint8Array(3);let i=new DataView(r.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{r=new Uint8Array(9);let i=new DataView(r.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}s.data&&typeof s.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}var St;function Ke(s){return s.reduce((e,t)=>e+t.length,0)}function $e(s,e){if(s[0].length===e)return s.shift();let t=new Uint8Array(e),n=0;for(let r=0;r<e;r++)t[r]=s[0][n++],n===s[0].length&&(s.shift(),n=0);return s.length&&n<s[0].length&&(s[0]=s[0].slice(n)),t}function Ar(s,e){St||(St=new TextDecoder);let t=[],n=0,r=-1,i=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(n===0){if(Ke(t)<1)break;let h=$e(t,1);i=(h[0]&128)===128,r=h[0]&127,r<126?n=3:r===126?n=1:n=2}else if(n===1){if(Ke(t)<2)break;let h=$e(t,2);r=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),n=3}else if(n===2){if(Ke(t)<8)break;let h=$e(t,8),_=new DataView(h.buffer,h.byteOffset,h.length),a=_.getUint32(0);if(a>Math.pow(2,21)-1){c.enqueue(xs.ERROR_PACKET);break}r=a*Math.pow(2,32)+_.getUint32(4),n=3}else{if(Ke(t)<r)break;let h=$e(t,r);c.enqueue((0,Ct.decodePacket)(i?h:St.decode(h),e)),n=0}if(r===0||r>s){c.enqueue(xs.ERROR_PACKET);break}}}})}O.protocol=4});var G={};or(G,{Emitter:()=>w});function w(s){if(s)return Nr(s)}function Nr(s){for(var e in w.prototype)s[e]=w.prototype[e];return s}var Q=ir(()=>{"use strict";w.prototype.on=w.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};w.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var n,r=0;r<t.length;r++)if(n=t[r],n===e||n.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+s],this};w.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,r=t.length;n<r;++n)t[n].apply(this,e)}return this};w.prototype.emitReserved=w.prototype.emit;w.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};w.prototype.hasListeners=function(s){return!!this.listeners(s).length}});var Z=f(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.defaultBinaryType=L.globalThisShim=L.nextTick=void 0;L.createCookieJar=Dr;L.nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0);L.globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();L.defaultBinaryType="arraybuffer";function Dr(){}});var ee=f(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.pick=Fr;le.installTimerFunctions=xr;le.byteLength=jr;le.randomString=Br;var W=Z();function Fr(s,...e){return e.reduce((t,n)=>(s.hasOwnProperty(n)&&(t[n]=s[n]),t),{})}var Mr=W.globalThisShim.setTimeout,qr=W.globalThisShim.clearTimeout;function xr(s,e){e.useNativeTimers?(s.setTimeoutFn=Mr.bind(W.globalThisShim),s.clearTimeoutFn=qr.bind(W.globalThisShim)):(s.setTimeoutFn=W.globalThisShim.setTimeout.bind(W.globalThisShim),s.clearTimeoutFn=W.globalThisShim.clearTimeout.bind(W.globalThisShim))}var Ir=1.33;function jr(s){return typeof s=="string"?Lr(s):Math.ceil((s.byteLength||s.size)*Ir)}function Lr(s){let e=0,t=0;for(let n=0,r=s.length;n<r;n++)e=s.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function Br(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}});var Tt=f(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.encode=Ur;Ve.decode=Kr;function Ur(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function Kr(s){let e={},t=s.split("&");for(let n=0,r=t.length;n<r;n++){let i=t[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}});var Ls=f((uc,js)=>{"use strict";var he=1e3,de=he*60,fe=de*60,te=fe*24,$r=te*7,Vr=te*365.25;js.exports=function(s,e){e=e||{};var t=typeof s;if(t==="string"&&s.length>0)return Wr(s);if(t==="number"&&isFinite(s))return e.long?Yr(s):Hr(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};function Wr(s){if(s=String(s),!(s.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*Vr;case"weeks":case"week":case"w":return t*$r;case"days":case"day":case"d":return t*te;case"hours":case"hour":case"hrs":case"hr":case"h":return t*fe;case"minutes":case"minute":case"mins":case"min":case"m":return t*de;case"seconds":case"second":case"secs":case"sec":case"s":return t*he;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Hr(s){var e=Math.abs(s);return e>=te?Math.round(s/te)+"d":e>=fe?Math.round(s/fe)+"h":e>=de?Math.round(s/de)+"m":e>=he?Math.round(s/he)+"s":s+"ms"}function Yr(s){var e=Math.abs(s);return e>=te?We(s,e,te,"day"):e>=fe?We(s,e,fe,"hour"):e>=de?We(s,e,de,"minute"):e>=he?We(s,e,he,"second"):s+" ms"}function We(s,e,t,n){var r=e>=t*1.5;return Math.round(s/t)+" "+n+(r?"s":"")}});var Us=f((lc,Bs)=>{"use strict";function Xr(s){t.debug=t,t.default=t,t.coerce=h,t.disable=o,t.enable=r,t.enabled=c,t.humanize=Ls(),t.destroy=_,Object.keys(s).forEach(a=>{t[a]=s[a]}),t.names=[],t.skips=[],t.formatters={};function e(a){let l=0;for(let g=0;g<a.length;g++)l=(l<<5)-l+a.charCodeAt(g),l|=0;return t.colors[Math.abs(l)%t.colors.length]}t.selectColor=e;function t(a){let l,g=null,S,ie;function T(...P){if(!T.enabled)return;let J=T,Ae=Number(new Date),sr=Ae-(l||Ae);J.diff=sr,J.prev=l,J.curr=Ae,l=Ae,P[0]=t.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let Ne=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(ft,nr)=>{if(ft==="%%")return"%";Ne++;let cs=t.formatters[nr];if(typeof cs=="function"){let rr=P[Ne];ft=cs.call(J,rr),P.splice(Ne,1),Ne--}return ft}),t.formatArgs.call(J,P),(J.log||t.log).apply(J,P)}return T.namespace=a,T.useColors=t.useColors(),T.color=t.selectColor(a),T.extend=n,T.destroy=t.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(S!==t.namespaces&&(S=t.namespaces,ie=t.enabled(a)),ie),set:P=>{g=P}}),typeof t.init=="function"&&t.init(T),T}function n(a,l){let g=t(this.namespace+(typeof l>"u"?":":l)+a);return g.log=this.log,g}function r(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let l=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of l)g[0]==="-"?t.skips.push(g.slice(1)):t.names.push(g)}function i(a,l){let g=0,S=0,ie=-1,T=0;for(;g<a.length;)if(S<l.length&&(l[S]===a[g]||l[S]==="*"))l[S]==="*"?(ie=S,T=g,S++):(g++,S++);else if(ie!==-1)S=ie+1,T++,g=T;else return!1;for(;S<l.length&&l[S]==="*";)S++;return S===l.length}function o(){let a=[...t.names,...t.skips.map(l=>"-"+l)].join(",");return t.enable(""),a}function c(a){for(let l of t.skips)if(i(a,l))return!1;for(let l of t.names)if(i(a,l))return!0;return!1}function h(a){return a instanceof Error?a.stack||a.message:a}function _(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Bs.exports=Xr});var A=f((R,He)=>{"use strict";R.formatArgs=zr;R.save=Gr;R.load=Qr;R.useColors=Jr;R.storage=Zr();R.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();R.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Jr(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let s;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(s=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(s[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function zr(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+He.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;s.splice(1,0,e,"color: inherit");let t=0,n=0;s[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(t++,r==="%c"&&(n=t))}),s.splice(n,0,e)}R.log=console.debug||console.log||(()=>{});function Gr(s){try{s?R.storage.setItem("debug",s):R.storage.removeItem("debug")}catch{}}function Qr(){let s;try{s=R.storage.getItem("debug")||R.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=process.env.DEBUG),s}function Zr(){try{return localStorage}catch{}}He.exports=Us()(R);var{formatters:ei}=He.exports;ei.j=function(s){try{return JSON.stringify(s)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var we=f(H=>{"use strict";var ti=H&&H.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(H,"__esModule",{value:!0});H.Transport=H.TransportError=void 0;var si=ue(),ni=(Q(),K(G)),ri=ee(),ii=Tt(),oi=ti(A()),ci=(0,oi.default)("engine.io-client:transport"),Ye=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}};H.TransportError=Ye;var Ot=class extends ni.Emitter{constructor(e){super(),this.writable=!1,(0,ri.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new Ye(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"?this.write(e):ci("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=(0,si.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=(0,ii.encode)(e);return t.length?"?"+t:""}};H.Transport=Ot});var Pt=f(pe=>{"use strict";var ai=pe&&pe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(pe,"__esModule",{value:!0});pe.Polling=void 0;var ui=we(),li=ee(),Ks=ue(),hi=ai(A()),D=(0,hi.default)("engine.io-client:polling"),Rt=class extends ui.Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{D("paused"),this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(D("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){D("pre-pause polling complete"),--n||t()})),this.writable||(D("we are currently writing - waiting to pause"),n++,this.once("drain",function(){D("pre-pause writing complete"),--n||t()}))}else t()}_poll(){D("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){D("polling got data %s",e);let t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};(0,Ks.decodePayload)(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this._poll():D('ignoring poll - transport state "%s"',this.readyState))}doClose(){let e=()=>{D("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(D("transport open - closing"),e()):(D("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,Ks.encodePayload)(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=(0,li.randomString)()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};pe.Polling=Rt});var Vs=f(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.hasCORS=void 0;var $s=!1;try{$s=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Xe.hasCORS=$s});var ze=f(x=>{"use strict";var di=x&&x.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(x,"__esModule",{value:!0});x.XHR=x.Request=x.BaseXHR=void 0;var fi=Pt(),pi=(Q(),K(G)),Ws=ee(),Ys=Z(),_i=Vs(),gi=di(A()),At=(0,gi.default)("engine.io-client:polling");function yi(){}var Je=class extends fi.Polling{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(r,i)=>{this.onError("xhr post error",r,i)})}doPoll(){At("xhr poll");let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}};x.BaseXHR=Je;var B=class s extends pi.Emitter{constructor(e,t,n){super(),this.createRequest=e,(0,Ws.installTimerFunctions)(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;let t=(0,Ws.pick)(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;let n=this._xhr=this.createRequest(t);try{At("xhr open %s: %s",this._method,this._uri),n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var r;n.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},At("xhr data %s",this._data),n.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=yi,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};x.Request=B;B.requestsCount=0;B.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Hs);else if(typeof addEventListener=="function"){let s="onpagehide"in Ys.globalThisShim?"pagehide":"unload";addEventListener(s,Hs,!1)}}function Hs(){for(let s in B.requests)B.requests.hasOwnProperty(s)&&B.requests[s].abort()}var mi=function(){let s=Xs({xdomain:!1});return s&&s.responseType!==null}(),Nt=class extends Je{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=mi&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new B(Xs,this.uri(),e)}};x.XHR=Nt;function Xs(s){let e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||_i.hasCORS))return new XMLHttpRequest}catch{}if(!e)try{return new Ys.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}});var Qe=f(Y=>{"use strict";var bi=Y&&Y.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Y,"__esModule",{value:!0});Y.WS=Y.BaseWS=void 0;var Ei=we(),Js=ee(),ki=ue(),Ft=Z(),vi=bi(A()),Si=(0,vi.default)("engine.io-client:websocket"),zs=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Ge=class extends Ei.Transport{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,n=zs?{}:(0,Js.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;(0,ki.encodePacket)(n,this.supportsBinary,i=>{try{this.doWrite(n,i)}catch{Si("websocket closed before onclose event")}r&&(0,Ft.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,Js.randomString)()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}};Y.BaseWS=Ge;var Dt=Ft.globalThisShim.WebSocket||Ft.globalThisShim.MozWebSocket,Mt=class extends Ge{createSocket(e,t,n){return zs?new Dt(e,t,n):t?new Dt(e,t):new Dt(e)}doWrite(e,t){this.ws.send(t)}};Y.WS=Mt});var xt=f(_e=>{"use strict";var wi=_e&&_e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(_e,"__esModule",{value:!0});_e.WT=void 0;var Ci=we(),Ti=Z(),Gs=ue(),Oi=wi(A()),Ce=(0,Oi.default)("engine.io-client:webtransport"),qt=class extends Ci.Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{Ce("transport closed gracefully"),this.onClose()}).catch(e=>{Ce("transport closed due to %s",e),this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=(0,Gs.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=(0,Gs.createPacketEncoderStream)();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:c,value:h})=>{if(c){Ce("session is closed");return}Ce("received chunk: %o",h),this.onPacket(h),i()}).catch(c=>{Ce("an error occurred while reading: %s",c)})};i();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&(0,Ti.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};_e.WT=qt});var It=f(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.transports=void 0;var Ri=ze(),Pi=Qe(),Ai=xt();Ze.transports={websocket:Pi.WS,webtransport:Ai.WT,polling:Ri.XHR}});var Lt=f(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.parse=Fi;var Ni=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Di=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Fi(s){if(s.length>8e3)throw"URI too long";let e=s,t=s.indexOf("["),n=s.indexOf("]");t!=-1&&n!=-1&&(s=s.substring(0,t)+s.substring(t,n).replace(/:/g,";")+s.substring(n,s.length));let r=Ni.exec(s||""),i={},o=14;for(;o--;)i[Di[o]]=r[o]||"";return t!=-1&&n!=-1&&(i.source=e,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=Mi(i,i.path),i.queryKey=qi(i,i.query),i}function Mi(s,e){let t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function qi(s,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,r,i){r&&(t[r]=i)}),t}});var $t=f(I=>{"use strict";var xi=I&&I.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(I,"__esModule",{value:!0});I.Socket=I.SocketWithUpgrade=I.SocketWithoutUpgrade=void 0;var Ii=It(),Qs=ee(),ji=Tt(),Zs=Lt(),Li=(Q(),K(G)),en=ue(),Bt=Z(),Bi=xi(A()),m=(0,Bi.default)("engine.io-client:socket"),Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",Te=[];Ut&&addEventListener("offline",()=>{m("closing %d connection(s) because the network was lost",Te.length),Te.forEach(s=>s())},!1);var se=class s extends Li.Emitter{constructor(e,t){if(super(),this.binaryType=Bt.defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){let n=(0,Zs.parse)(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=(0,Zs.parse)(t.host).host);(0,Qs.installTimerFunctions)(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{let r=n.prototype.name;this.transports.push(r),this._transportsByName[r]=n}),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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,ji.decode)(this.opts.query)),Ut&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(m("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Te.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=(0,Bt.createCookieJar)()),this._open()}createTransport(e){m('creating transport "%s"',e);let t=Object.assign({},this.opts.query);t.EIO=en.protocol,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return m("options: %j",n),new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let e=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){m("setting transport %s",e.name),this.transport&&(m("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){m("socket open"),this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(m('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}else m('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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){let e=this._getWritablePackets();m("flushing %d packets in socket",e.length),this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){let r=this.writeBuffer[n].data;if(r&&(t+=(0,Qs.byteLength)(r)),n>0&&t>this._maxPayload)return m("only send %d out of %d packets",n,this.writeBuffer.length),this.writeBuffer.slice(0,n);t+=2}return m("payload size is %d (max: %d)",t,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(m("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,(0,Bt.nextTick)(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if(typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;let i={type:e,data:t,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){let e=()=>{this._onClose("forced close"),m("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(m("socket error %j",e),s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return m("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(m('socket close with reason: "%s"',e),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let n=Te.indexOf(this._offlineEventListener);n!==-1&&(m("removing listener for the 'offline' event"),Te.splice(n,1))}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}};I.SocketWithoutUpgrade=se;se.protocol=en.protocol;var et=class extends se{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade){m("starting upgrade probes");for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}}_probe(e){m('probing transport "%s"',e);let t=this.createTransport(e),n=!1;se.priorWebsocketSuccess=!1;let r=()=>{n||(m('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",l=>{if(!n)if(l.type==="pong"&&l.data==="probe"){if(m('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;se.priorWebsocketSuccess=t.name==="websocket",m('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{n||this.readyState!=="closed"&&(m("changing transport and sending upgrade packet"),a(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{m('probe transport "%s" failed',e);let g=new Error("probe error");g.transport=t.name,this.emitReserved("upgradeError",g)}}))};function i(){n||(n=!0,a(),t.close(),t=null)}let o=l=>{let g=new Error("probe error: "+l);g.transport=t.name,i(),m('probe transport "%s" failed because of error: %s',e,l),this.emitReserved("upgradeError",g)};function c(){o("transport closed")}function h(){o("socket closed")}function _(l){t&&l.name!==t.name&&(m('"%s" works - aborting "%s"',l.name,t.name),i())}let a=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",_)};t.once("open",r),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}};I.SocketWithUpgrade=et;var Kt=class extends et{constructor(e,t={}){let n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(r=>Ii.transports[r]).filter(r=>!!r)),super(e,n)}};I.Socket=Kt});var tn=f(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.Fetch=void 0;var Ui=Pt(),Vt=class extends Ui.Polling{doPoll(){this._fetch().then(e=>{if(!e.ok)return this.onError("fetch read error",e.status,e);e.text().then(t=>this.onData(t))}).catch(e=>{this.onError("fetch read error",e)})}doWrite(e,t){this._fetch(e).then(n=>{if(!n.ok)return this.onError("fetch write error",n.status,n);t()}).catch(n=>{this.onError("fetch write error",n)})}_fetch(e){var t;let n=e!==void 0,r=new Headers(this.opts.extraHeaders);return n&&r.set("content-type","text/plain;charset=UTF-8"),(t=this.socket._cookieJar)===null||t===void 0||t.appendCookies(r),fetch(this.uri(),{method:n?"POST":"GET",body:n?e:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(i=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(i.headers.getSetCookie()),i})}};tt.Fetch=Vt});var st=f(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.WebTransport=p.WebSocket=p.NodeWebSocket=p.XHR=p.NodeXHR=p.Fetch=p.nextTick=p.parse=p.installTimerFunctions=p.transports=p.TransportError=p.Transport=p.protocol=p.SocketWithUpgrade=p.SocketWithoutUpgrade=p.Socket=void 0;var sn=$t();Object.defineProperty(p,"Socket",{enumerable:!0,get:function(){return sn.Socket}});var nn=$t();Object.defineProperty(p,"SocketWithoutUpgrade",{enumerable:!0,get:function(){return nn.SocketWithoutUpgrade}});Object.defineProperty(p,"SocketWithUpgrade",{enumerable:!0,get:function(){return nn.SocketWithUpgrade}});p.protocol=sn.Socket.protocol;var rn=we();Object.defineProperty(p,"Transport",{enumerable:!0,get:function(){return rn.Transport}});Object.defineProperty(p,"TransportError",{enumerable:!0,get:function(){return rn.TransportError}});var Ki=It();Object.defineProperty(p,"transports",{enumerable:!0,get:function(){return Ki.transports}});var $i=ee();Object.defineProperty(p,"installTimerFunctions",{enumerable:!0,get:function(){return $i.installTimerFunctions}});var Vi=Lt();Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return Vi.parse}});var Wi=Z();Object.defineProperty(p,"nextTick",{enumerable:!0,get:function(){return Wi.nextTick}});var Hi=tn();Object.defineProperty(p,"Fetch",{enumerable:!0,get:function(){return Hi.Fetch}});var Yi=ze();Object.defineProperty(p,"NodeXHR",{enumerable:!0,get:function(){return Yi.XHR}});var Xi=ze();Object.defineProperty(p,"XHR",{enumerable:!0,get:function(){return Xi.XHR}});var Ji=Qe();Object.defineProperty(p,"NodeWebSocket",{enumerable:!0,get:function(){return Ji.WS}});var zi=Qe();Object.defineProperty(p,"WebSocket",{enumerable:!0,get:function(){return zi.WS}});var Gi=xt();Object.defineProperty(p,"WebTransport",{enumerable:!0,get:function(){return Gi.WT}})});var cn=f(Oe=>{"use strict";var Qi=Oe&&Oe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.url=to;var Zi=st(),eo=Qi(A()),on=(0,eo.default)("socket.io-client:url");function to(s,e="",t){let n=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(on("protocol-less url %s",s),typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),on("parse %s",s),n=(0,Zi.parse)(s)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let i=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port+e,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n}});var Wt=f(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.isBinary=un;rt.hasBinary=nt;var so=typeof ArrayBuffer=="function",no=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,an=Object.prototype.toString,ro=typeof Blob=="function"||typeof Blob<"u"&&an.call(Blob)==="[object BlobConstructor]",io=typeof File=="function"||typeof File<"u"&&an.call(File)==="[object FileConstructor]";function un(s){return so&&(s instanceof ArrayBuffer||no(s))||ro&&s instanceof Blob||io&&s instanceof File}function nt(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,n=s.length;t<n;t++)if(nt(s[t]))return!0;return!1}if(un(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return nt(s.toJSON(),!0);for(let t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&nt(s[t]))return!0;return!1}});var ln=f(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.deconstructPacket=co;it.reconstructPacket=ao;var oo=Wt();function co(s){let e=[],t=s.data,n=s;return n.data=Ht(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Ht(s,e){if(!s)return s;if((0,oo.isBinary)(s)){let t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){let t=new Array(s.length);for(let n=0;n<s.length;n++)t[n]=Ht(s[n],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){let t={};for(let n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=Ht(s[n],e));return t}return s}function ao(s,e){return s.data=Yt(s.data,e),delete s.attachments,s}function Yt(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=Yt(s[t],e);else if(typeof s=="object")for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=Yt(s[t],e));return s}});var ct=f(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.Decoder=F.Encoder=F.PacketType=F.protocol=void 0;F.isPacketValid=go;var uo=(Q(),K(G)),hn=ln(),dn=Wt(),lo=A(),Xt=(0,lo.default)("socket.io-parser"),fn=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];F.protocol=5;var y=function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s}(y||(F.PacketType=y={})),Jt=class{constructor(e){this.replacer=e}encode(e){return Xt("encoding packet %j",e),(e.type===y.EVENT||e.type===y.ACK)&&(0,dn.hasBinary)(e)?this.encodeAsBinary({type:e.type===y.EVENT?y.BINARY_EVENT:y.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===y.BINARY_EVENT||e.type===y.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),Xt("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,hn.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};F.Encoder=Jt;var zt=class s extends uo.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===y.BINARY_EVENT;n||t.type===y.BINARY_ACK?(t.type=n?y.EVENT:y.ACK,this.reconstructor=new Gt(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,dn.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(y[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===y.BINARY_EVENT||n.type===y.BINARY_ACK){let i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){let i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(i,t)}else n.nsp="/";let r=e.charAt(t+1);if(r!==""&&Number(r)==r){let i=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){let i=this.tryParse(e.substr(t));if(s.isPayloadValid(n.type,i))n.data=i;else throw new Error("invalid payload")}return Xt("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case y.CONNECT:return ot(t);case y.DISCONNECT:return t===void 0;case y.CONNECT_ERROR:return typeof t=="string"||ot(t);case y.EVENT:case y.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&fn.indexOf(t[0])===-1);case y.ACK:case y.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};F.Decoder=zt;var Gt=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,hn.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function ho(s){return typeof s=="string"}var fo=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function po(s){return s===void 0||fo(s)}function ot(s){return Object.prototype.toString.call(s)==="[object Object]"}function _o(s,e){switch(s){case y.CONNECT:return e===void 0||ot(e);case y.DISCONNECT:return e===void 0;case y.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&fn.indexOf(e[0])===-1);case y.ACK:return Array.isArray(e);case y.CONNECT_ERROR:return typeof e=="string"||ot(e);default:return!1}}function go(s){return ho(s.nsp)&&po(s.id)&&_o(s.type,s.data)}});var Zt=f(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.on=yo;function yo(s,e,t){return s.on(e,t),function(){s.off(e,t)}}});var ts=f(ge=>{"use strict";var mo=ge&&ge.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ge,"__esModule",{value:!0});ge.Socket=void 0;var M=ct(),at=Zt(),bo=(Q(),K(G)),Eo=mo(A()),E=(0,Eo.default)("socket.io-client:socket"),ko=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),es=class extends bo.Emitter{constructor(e,t,n){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=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[(0,at.on)(e,"open",this.onopen.bind(this)),(0,at.on)(e,"packet",this.onpacket.bind(this)),(0,at.on)(e,"error",this.onerror.bind(this)),(0,at.on)(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,i;if(ko.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:M.PacketType.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let a=this.ids++;E("emitting packet with ack id %d",a);let l=t.pop();this._registerAckCallback(a,l),o.id=a}let c=(r=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||r===void 0?void 0:r.writable,h=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!c?E("discard packet as the transport is not currently writable"):h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o),this.flags={},this}_registerAckCallback(e,t){var n;let r=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(r===void 0){this.acks[e]=t;return}let i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&(E("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(c,1));E("event with ack id %d has timed out after %d ms",e,r),t.call(this,new Error("operation has timed out"))},r),o=(...c)=>{this.io.clearTimeoutFn(i),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(o,c)=>o?r(o):n(c);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...i)=>n!==this._queue[0]?E("packet [%d] already acknowledged",n.id):(r!==null?n.tryCount>this._opts.retries&&(E("packet [%d] is discarded after %d tries",n.id,n.tryCount),this._queue.shift(),t&&t(r)):(E("packet [%d] was successfully sent",n.id),this._queue.shift(),t&&t(null,...i)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(E("draining queue"),!this.connected||this._queue.length===0)return;let t=this._queue[0];if(t.pending&&!e){E("packet [%d] has already been sent and is waiting for an ack",t.id);return}t.pending=!0,t.tryCount++,E("sending packet [%d] (try n\xB0%d)",t.id,t.tryCount),this.flags=t.flags,this.emit.apply(this,t.args)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){E("transport is open - connecting"),typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:M.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){E("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){let n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case M.PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 M.PacketType.EVENT:case M.PacketType.BINARY_EVENT:this.onevent(e);break;case M.PacketType.ACK:case M.PacketType.BINARY_ACK:this.onack(e);break;case M.PacketType.DISCONNECT:this.ondisconnect();break;case M.PacketType.CONNECT_ERROR:this.destroy();let n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){let t=e.data||[];E("emitting event %j",t),e.id!=null&&(E("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,E("sending ack %j",r),t.packet({type:M.PacketType.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];if(typeof t!="function"){E("bad ack %s",e.id);return}delete this.acks[e.id],E("calling ack %s with %j",e.id,e.data),t.withError&&e.data.unshift(null),t.apply(this,e.data)}onconnect(e,t){E("socket connected with id %s",e),this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){E("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(E("performing disconnect (%s)",this.nsp),this.packet({type:M.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};ge.Socket=es});var pn=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.Backoff=ye;function ye(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}ye.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=Math.floor(e*10)&1?s+t:s-t}return Math.min(s,this.max)|0};ye.prototype.reset=function(){this.attempts=0};ye.prototype.setMin=function(s){this.ms=s};ye.prototype.setMax=function(s){this.max=s};ye.prototype.setJitter=function(s){this.jitter=s}});var _n=f(N=>{"use strict";var vo=N&&N.__createBinding||(Object.create?function(s,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,r)}:function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]}),So=N&&N.__setModuleDefault||(Object.create?function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}:function(s,e){s.default=e}),wo=N&&N.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&vo(e,s,t);return So(e,s),e},Co=N&&N.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(N,"__esModule",{value:!0});N.Manager=void 0;var ns=st(),To=ts(),Oo=wo(ct()),ne=Zt(),Ro=pn(),Po=(Q(),K(G)),Ao=Co(A()),v=(0,Ao.default)("socket.io-client:manager"),rs=class extends Po.Emitter{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,(0,ns.installTimerFunctions)(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Ro.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let r=t.parser||Oo;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(v("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;v("opening %s",this.uri),this.engine=new ns.Socket(this.uri,this.opts);let t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;let r=(0,ne.on)(t,"open",function(){n.onopen(),e&&e()}),i=c=>{v("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=(0,ne.on)(t,"error",i);if(this._timeout!==!1){let c=this._timeout;v("connect attempt will timeout after %d",c);let h=this.setTimeoutFn(()=>{v("connect attempt timed out after %d",c),r(),i(new Error("timeout")),t.close()},c);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){v("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push((0,ne.on)(e,"ping",this.onping.bind(this)),(0,ne.on)(e,"data",this.ondata.bind(this)),(0,ne.on)(e,"error",this.onerror.bind(this)),(0,ne.on)(e,"close",this.onclose.bind(this)),(0,ne.on)(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){(0,ns.nextTick)(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){v("error",e),this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new To.Socket(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let n of t)if(this.nsps[n].active){v("socket %s is still active, skipping close",n);return}this._close()}_packet(e){v("writing packet %j",e);let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){v("cleanup"),this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){v("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;v("closed due to %s",e),this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)v("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();v("will wait %dms before reconnect attempt",t),this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(v("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(v("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):(v("reconnect success"),e.onreconnect())}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};N.Manager=rs});var bn=f((b,mn)=>{"use strict";var No=b&&b.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(b,"__esModule",{value:!0});b.WebTransport=b.WebSocket=b.NodeWebSocket=b.XHR=b.NodeXHR=b.Fetch=b.Socket=b.Manager=b.protocol=void 0;b.io=re;b.connect=re;b.default=re;var Do=cn(),ut=_n();Object.defineProperty(b,"Manager",{enumerable:!0,get:function(){return ut.Manager}});var yn=ts();Object.defineProperty(b,"Socket",{enumerable:!0,get:function(){return yn.Socket}});var Fo=No(A()),gn=(0,Fo.default)("socket.io-client"),Re={};function re(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};let t=(0,Do.url)(s,e.path||"/socket.io"),n=t.source,r=t.id,i=t.path,o=Re[r]&&i in Re[r].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,h;return c?(gn("ignoring socket cache for %s",n),h=new ut.Manager(n,e)):(Re[r]||(gn("new io instance for %s",n),Re[r]=new ut.Manager(n,e)),h=Re[r]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(re,{Manager:ut.Manager,Socket:yn.Socket,io:re,connect:re});var Mo=ct();Object.defineProperty(b,"protocol",{enumerable:!0,get:function(){return Mo.protocol}});var me=st();Object.defineProperty(b,"Fetch",{enumerable:!0,get:function(){return me.Fetch}});Object.defineProperty(b,"NodeXHR",{enumerable:!0,get:function(){return me.NodeXHR}});Object.defineProperty(b,"XHR",{enumerable:!0,get:function(){return me.XHR}});Object.defineProperty(b,"NodeWebSocket",{enumerable:!0,get:function(){return me.NodeWebSocket}});Object.defineProperty(b,"WebSocket",{enumerable:!0,get:function(){return me.WebSocket}});Object.defineProperty(b,"WebTransport",{enumerable:!0,get:function(){return me.WebTransport}});mn.exports=re});var Sn=f(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.DyFM_SocketClient_ServiceBase=void 0;var qo=(gs(),K(_s)),xo=qo.__importStar(bn()),En=lr(),kn=ys(),Io=ms(),k=yt(),vn=ar(),is=bs(),X=qe(),Pe=kt(),os=class{_params;get params(){return this._params}get name(){return this.params.name}socket;incomingEvents;_connected_BS=new En.BehaviorSubject(!1);get connected(){return this._connected_BS.value}connected$=this._connected_BS.asObservable();_subscribed_BS=new En.BehaviorSubject(!1);get subscribed(){return this._subscribed_BS.value}subscribed$=this._subscribed_BS.asObservable();debugLog=kn.DyFM_global_settings.log_settings.setup;logFn=kn.DyFM_global_settings.log_settings.functions;defaultEvents=[new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.outgoingNewConnection,tasks:[()=>u(this,null,function*(){this._connected_BS.next(!0),this.subscribed&&this._subscribed_BS.next(!1),k.DyFM_Log.success(`< > socket-client(${this.params.name}) connected!`)})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.disconnect,tasks:[()=>u(this,null,function*(){this._connected_BS.next(!1),this.subscribed&&this._subscribed_BS.next(!1),k.DyFM_Log.warn(`<x > socket-client(${this.params.name}) disconnected!`),this._params.reconnect&&(yield vn.DyFM_Async.delay(this._params.reconnectDelay),this.connectSocket())})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.subscriptionSuccessful,tasks:[()=>u(this,null,function*(){k.DyFM_Log.success(`<=--> socket-client(${this.params.name}) subscription successful!`),this._subscribed_BS.next(!0)})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.unsubscribeSuccessful,tasks:[()=>u(this,null,function*(){k.DyFM_Log.success(`<x--> socket-client(${this.params.name}) unsubscribe successful!`),this._subscribed_BS.next(!1)})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.error,tasks:[e=>u(this,null,function*(){is.DyFM_Error.logSimple(`=--> socket-client(${this.params.name}) ERROR`,e)})]})];constructor(){this.asyncConstructor().catch(e=>{is.DyFM_Error.logSimple(`socket-client "${this.params?.name}" Service setup failed! (DyFM_SocketClientService constructor catch)
|
|
6
|
-
ERROR:`,e)})}subscriptionInProgress=!1;subscribe(){return u(this,null,function*(){try{if(this.subscribed){k.DyFM_Log.warn(`socket-client(${this.params.name}) already subscribed!`);return}if(this.subscriptionInProgress){k.DyFM_Log.warn(`socket-client(${this.params.name}) subscription in progress!`);return}this.subscriptionInProgress=!0;let e=yield this.getSubscriptionContent();yield this.emitEvent(X.DyFM_SocketEvent_Key.subscribe,e),this.subscriptionInProgress=!1}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Subscribe failed!`,e),this.subscriptionInProgress=!1,e}})}unsubscribe(){return u(this,null,function*(){try{yield this.emitEvent(X.DyFM_SocketEvent_Key.unsubscribe,null)}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Unsubscribe failed!`,e),e}})}emitEvent(e,t){return u(this,null,function*(){try{k.DyFM_Log.log(`<=-- outgoing socket-client(${this.params.name}) event: ${e}`),this.socket.emit(e,t)}catch(n){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Emit Event failed: ${this.params?.name} (${this.params?.port})`,n),n}})}asyncConstructor(){return u(this,null,function*(){try{this._params=this.getParams(),this.incomingEvents=this.getIncomingEvents()??[];let e=this.params.port?`${this.params.address}:${this.params.port}`:this.params.address;this.socket=
|
|
5
|
+
content:`,e):Ee.DyFM_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey}...`)}catch(t){Ee.DyFM_Log.error(`PreLog failed... (socket: ${this.serviceName})`,t)}})}executeEventTasks(e,t){return u(this,null,function*(){try{(this.logEvent||this.logEventContent)&&(yield this.getPreLog(e)),yield ws.DyFM_Array.asyncForEach(this.preProcesses,n=>u(this,null,function*(){e=yield n(e)})),yield ws.DyFM_Array.asyncForEach(this.tasks,n=>u(this,null,function*(){yield n(e,t)}))}catch(n){n instanceof br.DyFM_Error?n.logShort("Socket Event tasks failed to execute"):Ee.DyFM_Log.error(`Socket Event tasks failed to execute on ${this.serviceName}.... (${this.eventKey})`,n,"content:",e)}})}};je.DyFM_SocketEvent=Et});var Le=f(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.ERROR_PACKET=V.PACKET_TYPES_REVERSE=V.PACKET_TYPES=void 0;var q=Object.create(null);V.PACKET_TYPES=q;q.open="0";q.close="1";q.ping="2";q.pong="3";q.message="4";q.upgrade="5";q.noop="6";var Cs=Object.create(null);V.PACKET_TYPES_REVERSE=Cs;Object.keys(q).forEach(s=>{Cs[q[s]]=s});var Er={type:"error",data:"parser error"};V.ERROR_PACKET=Er});var Ds=f(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.encodePacket=void 0;ve.encodePacketToBinary=vr;var kr=Le(),Rs=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ps=typeof ArrayBuffer=="function",As=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Ns=({type:s,data:e},t,n)=>Rs&&e instanceof Blob?t?n(e):Ts(e,n):Ps&&(e instanceof ArrayBuffer||As(e))?t?n(e):Ts(new Blob([e]),n):n(kr.PACKET_TYPES[s]+(e||""));ve.encodePacket=Ns;var Ts=(s,e)=>{let t=new FileReader;return t.onload=function(){let n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(s)};function Os(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var vt;function vr(s,e){if(Rs&&s.data instanceof Blob)return s.data.arrayBuffer().then(Os).then(e);if(Ps&&(s.data instanceof ArrayBuffer||As(s.data)))return e(Os(s.data));Ns(s,!1,t=>{vt||(vt=new TextEncoder),e(vt.encode(t))})}});var Fs=f(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.decode=ae.encode=void 0;var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<ce.length;s++)Se[ce.charCodeAt(s)]=s;var Sr=s=>{let e=new Uint8Array(s),t,n=e.length,r="";for(t=0;t<n;t+=3)r+=ce[e[t]>>2],r+=ce[(e[t]&3)<<4|e[t+1]>>4],r+=ce[(e[t+1]&15)<<2|e[t+2]>>6],r+=ce[e[t+2]&63];return n%3===2?r=r.substring(0,r.length-1)+"=":n%3===1&&(r=r.substring(0,r.length-2)+"=="),r};ae.encode=Sr;var wr=s=>{let e=s.length*.75,t=s.length,n,r=0,i,o,c,h;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);let _=new ArrayBuffer(e),a=new Uint8Array(_);for(n=0;n<t;n+=4)i=Se[s.charCodeAt(n)],o=Se[s.charCodeAt(n+1)],c=Se[s.charCodeAt(n+2)],h=Se[s.charCodeAt(n+3)],a[r++]=i<<2|o>>4,a[r++]=(o&15)<<4|c>>2,a[r++]=(c&3)<<6|h&63;return _};ae.decode=wr});var qs=f(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.decodePacket=void 0;var Be=Le(),Cr=Fs(),Tr=typeof ArrayBuffer=="function",Or=(s,e)=>{if(typeof s!="string")return{type:"message",data:Ms(s,e)};let t=s.charAt(0);return t==="b"?{type:"message",data:Rr(s.substring(1),e)}:Be.PACKET_TYPES_REVERSE[t]?s.length>1?{type:Be.PACKET_TYPES_REVERSE[t],data:s.substring(1)}:{type:Be.PACKET_TYPES_REVERSE[t]}:Be.ERROR_PACKET};Ue.decodePacket=Or;var Rr=(s,e)=>{if(Tr){let t=(0,Cr.decode)(s);return Ms(t,e)}else return{base64:!0,data:s}},Ms=(s,e)=>{switch(e){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}}});var ue=f(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.decodePayload=O.decodePacket=O.encodePayload=O.encodePacket=O.protocol=void 0;O.createPacketEncoderStream=Nr;O.createPacketDecoderStream=Dr;var wt=Ds();Object.defineProperty(O,"encodePacket",{enumerable:!0,get:function(){return wt.encodePacket}});var Ct=qs();Object.defineProperty(O,"decodePacket",{enumerable:!0,get:function(){return Ct.decodePacket}});var xs=Le(),Is="",Pr=(s,e)=>{let t=s.length,n=new Array(t),r=0;s.forEach((i,o)=>{(0,wt.encodePacket)(i,!1,c=>{n[o]=c,++r===t&&e(n.join(Is))})})};O.encodePayload=Pr;var Ar=(s,e)=>{let t=s.split(Is),n=[];for(let r=0;r<t.length;r++){let i=(0,Ct.decodePacket)(t[r],e);if(n.push(i),i.type==="error")break}return n};O.decodePayload=Ar;function Nr(){return new TransformStream({transform(s,e){(0,wt.encodePacketToBinary)(s,t=>{let n=t.length,r;if(n<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,n);else if(n<65536){r=new Uint8Array(3);let i=new DataView(r.buffer);i.setUint8(0,126),i.setUint16(1,n)}else{r=new Uint8Array(9);let i=new DataView(r.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(n))}s.data&&typeof s.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}var St;function Ke(s){return s.reduce((e,t)=>e+t.length,0)}function $e(s,e){if(s[0].length===e)return s.shift();let t=new Uint8Array(e),n=0;for(let r=0;r<e;r++)t[r]=s[0][n++],n===s[0].length&&(s.shift(),n=0);return s.length&&n<s[0].length&&(s[0]=s[0].slice(n)),t}function Dr(s,e){St||(St=new TextDecoder);let t=[],n=0,r=-1,i=!1;return new TransformStream({transform(o,c){for(t.push(o);;){if(n===0){if(Ke(t)<1)break;let h=$e(t,1);i=(h[0]&128)===128,r=h[0]&127,r<126?n=3:r===126?n=1:n=2}else if(n===1){if(Ke(t)<2)break;let h=$e(t,2);r=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),n=3}else if(n===2){if(Ke(t)<8)break;let h=$e(t,8),_=new DataView(h.buffer,h.byteOffset,h.length),a=_.getUint32(0);if(a>Math.pow(2,21)-1){c.enqueue(xs.ERROR_PACKET);break}r=a*Math.pow(2,32)+_.getUint32(4),n=3}else{if(Ke(t)<r)break;let h=$e(t,r);c.enqueue((0,Ct.decodePacket)(i?h:St.decode(h),e)),n=0}if(r===0||r>s){c.enqueue(xs.ERROR_PACKET);break}}}})}O.protocol=4});var G={};ar(G,{Emitter:()=>w});function w(s){if(s)return Fr(s)}function Fr(s){for(var e in w.prototype)s[e]=w.prototype[e];return s}var Q=cr(()=>{"use strict";w.prototype.on=w.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};w.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};w.prototype.off=w.prototype.removeListener=w.prototype.removeAllListeners=w.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var n,r=0;r<t.length;r++)if(n=t[r],n===e||n.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+s],this};w.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,r=t.length;n<r;++n)t[n].apply(this,e)}return this};w.prototype.emitReserved=w.prototype.emit;w.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};w.prototype.hasListeners=function(s){return!!this.listeners(s).length}});var Z=f(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.defaultBinaryType=L.globalThisShim=L.nextTick=void 0;L.createCookieJar=Mr;L.nextTick=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0);L.globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")();L.defaultBinaryType="arraybuffer";function Mr(){}});var ee=f(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.pick=qr;le.installTimerFunctions=jr;le.byteLength=Br;le.randomString=Kr;var W=Z();function qr(s,...e){return e.reduce((t,n)=>(s.hasOwnProperty(n)&&(t[n]=s[n]),t),{})}var xr=W.globalThisShim.setTimeout,Ir=W.globalThisShim.clearTimeout;function jr(s,e){e.useNativeTimers?(s.setTimeoutFn=xr.bind(W.globalThisShim),s.clearTimeoutFn=Ir.bind(W.globalThisShim)):(s.setTimeoutFn=W.globalThisShim.setTimeout.bind(W.globalThisShim),s.clearTimeoutFn=W.globalThisShim.clearTimeout.bind(W.globalThisShim))}var Lr=1.33;function Br(s){return typeof s=="string"?Ur(s):Math.ceil((s.byteLength||s.size)*Lr)}function Ur(s){let e=0,t=0;for(let n=0,r=s.length;n<r;n++)e=s.charCodeAt(n),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(n++,t+=4);return t}function Kr(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}});var Tt=f(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.encode=$r;Ve.decode=Vr;function $r(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function Vr(s){let e={},t=s.split("&");for(let n=0,r=t.length;n<r;n++){let i=t[n].split("=");e[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return e}});var Ls=f((hc,js)=>{"use strict";var he=1e3,de=he*60,fe=de*60,te=fe*24,Wr=te*7,Hr=te*365.25;js.exports=function(s,e){e=e||{};var t=typeof s;if(t==="string"&&s.length>0)return Yr(s);if(t==="number"&&isFinite(s))return e.long?Jr(s):Xr(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))};function Yr(s){if(s=String(s),!(s.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(s);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*Hr;case"weeks":case"week":case"w":return t*Wr;case"days":case"day":case"d":return t*te;case"hours":case"hour":case"hrs":case"hr":case"h":return t*fe;case"minutes":case"minute":case"mins":case"min":case"m":return t*de;case"seconds":case"second":case"secs":case"sec":case"s":return t*he;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Xr(s){var e=Math.abs(s);return e>=te?Math.round(s/te)+"d":e>=fe?Math.round(s/fe)+"h":e>=de?Math.round(s/de)+"m":e>=he?Math.round(s/he)+"s":s+"ms"}function Jr(s){var e=Math.abs(s);return e>=te?We(s,e,te,"day"):e>=fe?We(s,e,fe,"hour"):e>=de?We(s,e,de,"minute"):e>=he?We(s,e,he,"second"):s+" ms"}function We(s,e,t,n){var r=e>=t*1.5;return Math.round(s/t)+" "+n+(r?"s":"")}});var Us=f((dc,Bs)=>{"use strict";function zr(s){t.debug=t,t.default=t,t.coerce=h,t.disable=o,t.enable=r,t.enabled=c,t.humanize=Ls(),t.destroy=_,Object.keys(s).forEach(a=>{t[a]=s[a]}),t.names=[],t.skips=[],t.formatters={};function e(a){let l=0;for(let y=0;y<a.length;y++)l=(l<<5)-l+a.charCodeAt(y),l|=0;return t.colors[Math.abs(l)%t.colors.length]}t.selectColor=e;function t(a){let l,y=null,S,ie;function T(...P){if(!T.enabled)return;let J=T,Ae=Number(new Date),rr=Ae-(l||Ae);J.diff=rr,J.prev=l,J.curr=Ae,l=Ae,P[0]=t.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let Ne=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(ft,ir)=>{if(ft==="%%")return"%";Ne++;let cs=t.formatters[ir];if(typeof cs=="function"){let or=P[Ne];ft=cs.call(J,or),P.splice(Ne,1),Ne--}return ft}),t.formatArgs.call(J,P),(J.log||t.log).apply(J,P)}return T.namespace=a,T.useColors=t.useColors(),T.color=t.selectColor(a),T.extend=n,T.destroy=t.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(S!==t.namespaces&&(S=t.namespaces,ie=t.enabled(a)),ie),set:P=>{y=P}}),typeof t.init=="function"&&t.init(T),T}function n(a,l){let y=t(this.namespace+(typeof l>"u"?":":l)+a);return y.log=this.log,y}function r(a){t.save(a),t.namespaces=a,t.names=[],t.skips=[];let l=(typeof a=="string"?a:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of l)y[0]==="-"?t.skips.push(y.slice(1)):t.names.push(y)}function i(a,l){let y=0,S=0,ie=-1,T=0;for(;y<a.length;)if(S<l.length&&(l[S]===a[y]||l[S]==="*"))l[S]==="*"?(ie=S,T=y,S++):(y++,S++);else if(ie!==-1)S=ie+1,T++,y=T;else return!1;for(;S<l.length&&l[S]==="*";)S++;return S===l.length}function o(){let a=[...t.names,...t.skips.map(l=>"-"+l)].join(",");return t.enable(""),a}function c(a){for(let l of t.skips)if(i(a,l))return!1;for(let l of t.names)if(i(a,l))return!0;return!1}function h(a){return a instanceof Error?a.stack||a.message:a}function _(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Bs.exports=zr});var A=f((R,He)=>{"use strict";R.formatArgs=Qr;R.save=Zr;R.load=ei;R.useColors=Gr;R.storage=ti();R.destroy=(()=>{let s=!1;return()=>{s||(s=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();R.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Gr(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let s;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(s=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(s[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Qr(s){if(s[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+s[0]+(this.useColors?"%c ":" ")+"+"+He.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;s.splice(1,0,e,"color: inherit");let t=0,n=0;s[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(t++,r==="%c"&&(n=t))}),s.splice(n,0,e)}R.log=console.debug||console.log||(()=>{});function Zr(s){try{s?R.storage.setItem("debug",s):R.storage.removeItem("debug")}catch{}}function ei(){let s;try{s=R.storage.getItem("debug")||R.storage.getItem("DEBUG")}catch{}return!s&&typeof process<"u"&&"env"in process&&(s=process.env.DEBUG),s}function ti(){try{return localStorage}catch{}}He.exports=Us()(R);var{formatters:si}=He.exports;si.j=function(s){try{return JSON.stringify(s)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var we=f(H=>{"use strict";var ni=H&&H.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(H,"__esModule",{value:!0});H.Transport=H.TransportError=void 0;var ri=ue(),ii=(Q(),K(G)),oi=ee(),ci=Tt(),ai=ni(A()),ui=(0,ai.default)("engine.io-client:transport"),Ye=class extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}};H.TransportError=Ye;var Ot=class extends ii.Emitter{constructor(e){super(),this.writable=!1,(0,oi.installTimerFunctions)(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,n){return super.emitReserved("error",new Ye(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"?this.write(e):ui("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=(0,ri.decodePacket)(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=(0,ci.encode)(e);return t.length?"?"+t:""}};H.Transport=Ot});var Pt=f(pe=>{"use strict";var li=pe&&pe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(pe,"__esModule",{value:!0});pe.Polling=void 0;var hi=we(),di=ee(),Ks=ue(),fi=li(A()),D=(0,fi.default)("engine.io-client:polling"),Rt=class extends hi.Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{D("paused"),this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(D("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){D("pre-pause polling complete"),--n||t()})),this.writable||(D("we are currently writing - waiting to pause"),n++,this.once("drain",function(){D("pre-pause writing complete"),--n||t()}))}else t()}_poll(){D("polling"),this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){D("polling got data %s",e);let t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};(0,Ks.decodePayload)(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this._poll():D('ignoring poll - transport state "%s"',this.readyState))}doClose(){let e=()=>{D("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(D("transport open - closing"),e()):(D("transport not open - deferring close"),this.once("open",e))}write(e){this.writable=!1,(0,Ks.encodePayload)(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=(0,di.randomString)()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};pe.Polling=Rt});var Vs=f(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.hasCORS=void 0;var $s=!1;try{$s=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Xe.hasCORS=$s});var ze=f(x=>{"use strict";var pi=x&&x.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(x,"__esModule",{value:!0});x.XHR=x.Request=x.BaseXHR=void 0;var _i=Pt(),yi=(Q(),K(G)),Ws=ee(),Ys=Z(),gi=Vs(),mi=pi(A()),At=(0,mi.default)("engine.io-client:polling");function bi(){}var Je=class extends _i.Polling{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){let n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(r,i)=>{this.onError("xhr post error",r,i)})}doPoll(){At("xhr poll");let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}};x.BaseXHR=Je;var B=class s extends yi.Emitter{constructor(e,t,n){super(),this.createRequest=e,(0,Ws.installTimerFunctions)(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;let t=(0,Ws.pick)(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;let n=this._xhr=this.createRequest(t);try{At("xhr open %s: %s",this._method,this._uri),n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this._opts.extraHeaders[r])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var r;n.readyState===3&&((r=this._opts.cookieJar)===null||r===void 0||r.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},At("xhr data %s",this._data),n.send(this._data)}catch(r){this.setTimeoutFn(()=>{this._onError(r)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=bi,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};x.Request=B;B.requestsCount=0;B.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Hs);else if(typeof addEventListener=="function"){let s="onpagehide"in Ys.globalThisShim?"pagehide":"unload";addEventListener(s,Hs,!1)}}function Hs(){for(let s in B.requests)B.requests.hasOwnProperty(s)&&B.requests[s].abort()}var Ei=function(){let s=Xs({xdomain:!1});return s&&s.responseType!==null}(),Nt=class extends Je{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ei&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new B(Xs,this.uri(),e)}};x.XHR=Nt;function Xs(s){let e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||gi.hasCORS))return new XMLHttpRequest}catch{}if(!e)try{return new Ys.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}});var Qe=f(Y=>{"use strict";var ki=Y&&Y.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Y,"__esModule",{value:!0});Y.WS=Y.BaseWS=void 0;var vi=we(),Js=ee(),Si=ue(),Ft=Z(),wi=ki(A()),Ci=(0,wi.default)("engine.io-client:websocket"),zs=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Ge=class extends vi.Transport{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,n=zs?{}:(0,Js.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;(0,Si.encodePacket)(n,this.supportsBinary,i=>{try{this.doWrite(n,i)}catch{Ci("websocket closed before onclose event")}r&&(0,Ft.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=(0,Js.randomString)()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}};Y.BaseWS=Ge;var Dt=Ft.globalThisShim.WebSocket||Ft.globalThisShim.MozWebSocket,Mt=class extends Ge{createSocket(e,t,n){return zs?new Dt(e,t,n):t?new Dt(e,t):new Dt(e)}doWrite(e,t){this.ws.send(t)}};Y.WS=Mt});var xt=f(_e=>{"use strict";var Ti=_e&&_e.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(_e,"__esModule",{value:!0});_e.WT=void 0;var Oi=we(),Ri=Z(),Gs=ue(),Pi=Ti(A()),Ce=(0,Pi.default)("engine.io-client:webtransport"),qt=class extends Oi.Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{Ce("transport closed gracefully"),this.onClose()}).catch(e=>{Ce("transport closed due to %s",e),this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=(0,Gs.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=(0,Gs.createPacketEncoderStream)();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let i=()=>{n.read().then(({done:c,value:h})=>{if(c){Ce("session is closed");return}Ce("received chunk: %o",h),this.onPacket(h),i()}).catch(c=>{Ce("an error occurred while reading: %s",c)})};i();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],r=t===e.length-1;this._writer.write(n).then(()=>{r&&(0,Ri.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};_e.WT=qt});var It=f(Ze=>{"use strict";Object.defineProperty(Ze,"__esModule",{value:!0});Ze.transports=void 0;var Ai=ze(),Ni=Qe(),Di=xt();Ze.transports={websocket:Ni.WS,webtransport:Di.WT,polling:Ai.XHR}});var Lt=f(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.parse=qi;var Fi=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Mi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function qi(s){if(s.length>8e3)throw"URI too long";let e=s,t=s.indexOf("["),n=s.indexOf("]");t!=-1&&n!=-1&&(s=s.substring(0,t)+s.substring(t,n).replace(/:/g,";")+s.substring(n,s.length));let r=Fi.exec(s||""),i={},o=14;for(;o--;)i[Mi[o]]=r[o]||"";return t!=-1&&n!=-1&&(i.source=e,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=xi(i,i.path),i.queryKey=Ii(i,i.query),i}function xi(s,e){let t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function Ii(s,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,r,i){r&&(t[r]=i)}),t}});var $t=f(I=>{"use strict";var ji=I&&I.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(I,"__esModule",{value:!0});I.Socket=I.SocketWithUpgrade=I.SocketWithoutUpgrade=void 0;var Li=It(),Qs=ee(),Bi=Tt(),Zs=Lt(),Ui=(Q(),K(G)),en=ue(),Bt=Z(),Ki=ji(A()),m=(0,Ki.default)("engine.io-client:socket"),Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",Te=[];Ut&&addEventListener("offline",()=>{m("closing %d connection(s) because the network was lost",Te.length),Te.forEach(s=>s())},!1);var se=class s extends Ui.Emitter{constructor(e,t){if(super(),this.binaryType=Bt.defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){let n=(0,Zs.parse)(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=(0,Zs.parse)(t.host).host);(0,Qs.installTimerFunctions)(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{let r=n.prototype.name;this.transports.push(r),this._transportsByName[r]=n}),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},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,Bi.decode)(this.opts.query)),Ut&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(m("adding listener for the 'offline' event"),this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Te.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=(0,Bt.createCookieJar)()),this._open()}createTransport(e){m('creating transport "%s"',e);let t=Object.assign({},this.opts.query);t.EIO=en.protocol,t.transport=e,this.id&&(t.sid=this.id);let n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return m("options: %j",n),new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let e=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){m("setting transport %s",e.name),this.transport&&(m("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){m("socket open"),this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(m('socket receive: type "%s", data "%s"',e.type,e.data),this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}else m('packet received with socket readyState "%s"',this.readyState)}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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){let e=this._getWritablePackets();m("flushing %d packets in socket",e.length),this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n<this.writeBuffer.length;n++){let r=this.writeBuffer[n].data;if(r&&(t+=(0,Qs.byteLength)(r)),n>0&&t>this._maxPayload)return m("only send %d out of %d packets",n,this.writeBuffer.length),this.writeBuffer.slice(0,n);t+=2}return m("payload size is %d (max: %d)",t,this._maxPayload),this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let e=Date.now()>this._pingTimeoutTime;return e&&(m("throttled timer detected, scheduling connection close"),this._pingTimeoutTime=0,(0,Bt.nextTick)(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,r){if(typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;let i={type:e,data:t,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){let e=()=>{this._onClose("forced close"),m("socket closing - telling transport to close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(m("socket error %j",e),s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return m("trying next transport"),this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(m('socket close with reason: "%s"',e),this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let n=Te.indexOf(this._offlineEventListener);n!==-1&&(m("removing listener for the 'offline' event"),Te.splice(n,1))}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}};I.SocketWithoutUpgrade=se;se.protocol=en.protocol;var et=class extends se{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade){m("starting upgrade probes");for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}}_probe(e){m('probing transport "%s"',e);let t=this.createTransport(e),n=!1;se.priorWebsocketSuccess=!1;let r=()=>{n||(m('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",l=>{if(!n)if(l.type==="pong"&&l.data==="probe"){if(m('probe transport "%s" pong',e),this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;se.priorWebsocketSuccess=t.name==="websocket",m('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{n||this.readyState!=="closed"&&(m("changing transport and sending upgrade packet"),a(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{m('probe transport "%s" failed',e);let y=new Error("probe error");y.transport=t.name,this.emitReserved("upgradeError",y)}}))};function i(){n||(n=!0,a(),t.close(),t=null)}let o=l=>{let y=new Error("probe error: "+l);y.transport=t.name,i(),m('probe transport "%s" failed because of error: %s',e,l),this.emitReserved("upgradeError",y)};function c(){o("transport closed")}function h(){o("socket closed")}function _(l){t&&l.name!==t.name&&(m('"%s" works - aborting "%s"',l.name,t.name),i())}let a=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",c),this.off("close",h),this.off("upgrading",_)};t.once("open",r),t.once("error",o),t.once("close",c),this.once("close",h),this.once("upgrading",_),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let n=0;n<e.length;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}};I.SocketWithUpgrade=et;var Kt=class extends et{constructor(e,t={}){let n=typeof e=="object"?e:t;(!n.transports||n.transports&&typeof n.transports[0]=="string")&&(n.transports=(n.transports||["polling","websocket","webtransport"]).map(r=>Li.transports[r]).filter(r=>!!r)),super(e,n)}};I.Socket=Kt});var tn=f(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.Fetch=void 0;var $i=Pt(),Vt=class extends $i.Polling{doPoll(){this._fetch().then(e=>{if(!e.ok)return this.onError("fetch read error",e.status,e);e.text().then(t=>this.onData(t))}).catch(e=>{this.onError("fetch read error",e)})}doWrite(e,t){this._fetch(e).then(n=>{if(!n.ok)return this.onError("fetch write error",n.status,n);t()}).catch(n=>{this.onError("fetch write error",n)})}_fetch(e){var t;let n=e!==void 0,r=new Headers(this.opts.extraHeaders);return n&&r.set("content-type","text/plain;charset=UTF-8"),(t=this.socket._cookieJar)===null||t===void 0||t.appendCookies(r),fetch(this.uri(),{method:n?"POST":"GET",body:n?e:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(i=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(i.headers.getSetCookie()),i})}};tt.Fetch=Vt});var st=f(p=>{"use strict";Object.defineProperty(p,"__esModule",{value:!0});p.WebTransport=p.WebSocket=p.NodeWebSocket=p.XHR=p.NodeXHR=p.Fetch=p.nextTick=p.parse=p.installTimerFunctions=p.transports=p.TransportError=p.Transport=p.protocol=p.SocketWithUpgrade=p.SocketWithoutUpgrade=p.Socket=void 0;var sn=$t();Object.defineProperty(p,"Socket",{enumerable:!0,get:function(){return sn.Socket}});var nn=$t();Object.defineProperty(p,"SocketWithoutUpgrade",{enumerable:!0,get:function(){return nn.SocketWithoutUpgrade}});Object.defineProperty(p,"SocketWithUpgrade",{enumerable:!0,get:function(){return nn.SocketWithUpgrade}});p.protocol=sn.Socket.protocol;var rn=we();Object.defineProperty(p,"Transport",{enumerable:!0,get:function(){return rn.Transport}});Object.defineProperty(p,"TransportError",{enumerable:!0,get:function(){return rn.TransportError}});var Vi=It();Object.defineProperty(p,"transports",{enumerable:!0,get:function(){return Vi.transports}});var Wi=ee();Object.defineProperty(p,"installTimerFunctions",{enumerable:!0,get:function(){return Wi.installTimerFunctions}});var Hi=Lt();Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return Hi.parse}});var Yi=Z();Object.defineProperty(p,"nextTick",{enumerable:!0,get:function(){return Yi.nextTick}});var Xi=tn();Object.defineProperty(p,"Fetch",{enumerable:!0,get:function(){return Xi.Fetch}});var Ji=ze();Object.defineProperty(p,"NodeXHR",{enumerable:!0,get:function(){return Ji.XHR}});var zi=ze();Object.defineProperty(p,"XHR",{enumerable:!0,get:function(){return zi.XHR}});var Gi=Qe();Object.defineProperty(p,"NodeWebSocket",{enumerable:!0,get:function(){return Gi.WS}});var Qi=Qe();Object.defineProperty(p,"WebSocket",{enumerable:!0,get:function(){return Qi.WS}});var Zi=xt();Object.defineProperty(p,"WebTransport",{enumerable:!0,get:function(){return Zi.WT}})});var cn=f(Oe=>{"use strict";var eo=Oe&&Oe.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.url=no;var to=st(),so=eo(A()),on=(0,so.default)("socket.io-client:url");function no(s,e="",t){let n=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(on("protocol-less url %s",s),typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),on("parse %s",s),n=(0,to.parse)(s)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";let i=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+i+":"+n.port+e,n.href=n.protocol+"://"+i+(t&&t.port===n.port?"":":"+n.port),n}});var Wt=f(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.isBinary=un;rt.hasBinary=nt;var ro=typeof ArrayBuffer=="function",io=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,an=Object.prototype.toString,oo=typeof Blob=="function"||typeof Blob<"u"&&an.call(Blob)==="[object BlobConstructor]",co=typeof File=="function"||typeof File<"u"&&an.call(File)==="[object FileConstructor]";function un(s){return ro&&(s instanceof ArrayBuffer||io(s))||oo&&s instanceof Blob||co&&s instanceof File}function nt(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,n=s.length;t<n;t++)if(nt(s[t]))return!0;return!1}if(un(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return nt(s.toJSON(),!0);for(let t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&nt(s[t]))return!0;return!1}});var ln=f(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.deconstructPacket=uo;it.reconstructPacket=lo;var ao=Wt();function uo(s){let e=[],t=s.data,n=s;return n.data=Ht(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Ht(s,e){if(!s)return s;if((0,ao.isBinary)(s)){let t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){let t=new Array(s.length);for(let n=0;n<s.length;n++)t[n]=Ht(s[n],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){let t={};for(let n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=Ht(s[n],e));return t}return s}function lo(s,e){return s.data=Yt(s.data,e),delete s.attachments,s}function Yt(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=Yt(s[t],e);else if(typeof s=="object")for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=Yt(s[t],e));return s}});var ct=f(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.Decoder=F.Encoder=F.PacketType=F.protocol=void 0;F.isPacketValid=mo;var ho=(Q(),K(G)),hn=ln(),dn=Wt(),fo=A(),Xt=(0,fo.default)("socket.io-parser"),fn=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];F.protocol=5;var g=function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s}(g||(F.PacketType=g={})),Jt=class{constructor(e){this.replacer=e}encode(e){return Xt("encoding packet %j",e),(e.type===g.EVENT||e.type===g.ACK)&&(0,dn.hasBinary)(e)?this.encodeAsBinary({type:e.type===g.EVENT?g.BINARY_EVENT:g.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===g.BINARY_EVENT||e.type===g.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),Xt("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,hn.deconstructPacket)(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}};F.Encoder=Jt;var zt=class s extends ho.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===g.BINARY_EVENT;n||t.type===g.BINARY_ACK?(t.type=n?g.EVENT:g.ACK,this.reconstructor=new Gt(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,dn.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(g[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===g.BINARY_EVENT||n.type===g.BINARY_ACK){let i=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(i,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");n.attachments=Number(o)}if(e.charAt(t+1)==="/"){let i=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(i,t)}else n.nsp="/";let r=e.charAt(t+1);if(r!==""&&Number(r)==r){let i=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(i,t+1))}if(e.charAt(++t)){let i=this.tryParse(e.substr(t));if(s.isPayloadValid(n.type,i))n.data=i;else throw new Error("invalid payload")}return Xt("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case g.CONNECT:return ot(t);case g.DISCONNECT:return t===void 0;case g.CONNECT_ERROR:return typeof t=="string"||ot(t);case g.EVENT:case g.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&fn.indexOf(t[0])===-1);case g.ACK:case g.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};F.Decoder=zt;var Gt=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,hn.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function po(s){return typeof s=="string"}var _o=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s};function yo(s){return s===void 0||_o(s)}function ot(s){return Object.prototype.toString.call(s)==="[object Object]"}function go(s,e){switch(s){case g.CONNECT:return e===void 0||ot(e);case g.DISCONNECT:return e===void 0;case g.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&fn.indexOf(e[0])===-1);case g.ACK:return Array.isArray(e);case g.CONNECT_ERROR:return typeof e=="string"||ot(e);default:return!1}}function mo(s){return po(s.nsp)&&yo(s.id)&&go(s.type,s.data)}});var Zt=f(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.on=bo;function bo(s,e,t){return s.on(e,t),function(){s.off(e,t)}}});var ts=f(ye=>{"use strict";var Eo=ye&&ye.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ye,"__esModule",{value:!0});ye.Socket=void 0;var M=ct(),at=Zt(),ko=(Q(),K(G)),vo=Eo(A()),E=(0,vo.default)("socket.io-client:socket"),So=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),es=class extends ko.Emitter{constructor(e,t,n){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=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[(0,at.on)(e,"open",this.onopen.bind(this)),(0,at.on)(e,"packet",this.onpacket.bind(this)),(0,at.on)(e,"error",this.onerror.bind(this)),(0,at.on)(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var n,r,i;if(So.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:M.PacketType.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let a=this.ids++;E("emitting packet with ack id %d",a);let l=t.pop();this._registerAckCallback(a,l),o.id=a}let c=(r=(n=this.io.engine)===null||n===void 0?void 0:n.transport)===null||r===void 0?void 0:r.writable,h=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!c?E("discard packet as the transport is not currently writable"):h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o),this.flags={},this}_registerAckCallback(e,t){var n;let r=(n=this.flags.timeout)!==null&&n!==void 0?n:this._opts.ackTimeout;if(r===void 0){this.acks[e]=t;return}let i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let c=0;c<this.sendBuffer.length;c++)this.sendBuffer[c].id===e&&(E("removing packet with ack id %d from the buffer",e),this.sendBuffer.splice(c,1));E("event with ack id %d has timed out after %d ms",e,r),t.call(this,new Error("operation has timed out"))},r),o=(...c)=>{this.io.clearTimeoutFn(i),t.apply(this,c)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((n,r)=>{let i=(o,c)=>o?r(o):n(c);i.withError=!0,t.push(i),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...i)=>n!==this._queue[0]?E("packet [%d] already acknowledged",n.id):(r!==null?n.tryCount>this._opts.retries&&(E("packet [%d] is discarded after %d tries",n.id,n.tryCount),this._queue.shift(),t&&t(r)):(E("packet [%d] was successfully sent",n.id),this._queue.shift(),t&&t(null,...i)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(E("draining queue"),!this.connected||this._queue.length===0)return;let t=this._queue[0];if(t.pending&&!e){E("packet [%d] has already been sent and is waiting for an ack",t.id);return}t.pending=!0,t.tryCount++,E("sending packet [%d] (try n\xB0%d)",t.id,t.tryCount),this.flags=t.flags,this.emit.apply(this,t.args)}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){E("transport is open - connecting"),typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:M.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){E("close (%s)",e),this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){let n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case M.PacketType.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 M.PacketType.EVENT:case M.PacketType.BINARY_EVENT:this.onevent(e);break;case M.PacketType.ACK:case M.PacketType.BINARY_ACK:this.onack(e);break;case M.PacketType.DISCONNECT:this.ondisconnect();break;case M.PacketType.CONNECT_ERROR:this.destroy();let n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){let t=e.data||[];E("emitting event %j",t),e.id!=null&&(E("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,n=!1;return function(...r){n||(n=!0,E("sending ack %j",r),t.packet({type:M.PacketType.ACK,id:e,data:r}))}}onack(e){let t=this.acks[e.id];if(typeof t!="function"){E("bad ack %s",e.id);return}delete this.acks[e.id],E("calling ack %s with %j",e.id,e.data),t.withError&&e.data.unshift(null),t.apply(this,e.data)}onconnect(e,t){E("socket connected with id %s",e),this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){E("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(E("performing disconnect (%s)",this.nsp),this.packet({type:M.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}};ye.Socket=es});var pn=f(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.Backoff=ge;function ge(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}ge.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=Math.floor(e*10)&1?s+t:s-t}return Math.min(s,this.max)|0};ge.prototype.reset=function(){this.attempts=0};ge.prototype.setMin=function(s){this.ms=s};ge.prototype.setMax=function(s){this.max=s};ge.prototype.setJitter=function(s){this.jitter=s}});var _n=f(N=>{"use strict";var wo=N&&N.__createBinding||(Object.create?function(s,e,t,n){n===void 0&&(n=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(s,n,r)}:function(s,e,t,n){n===void 0&&(n=t),s[n]=e[t]}),Co=N&&N.__setModuleDefault||(Object.create?function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}:function(s,e){s.default=e}),To=N&&N.__importStar||function(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&wo(e,s,t);return Co(e,s),e},Oo=N&&N.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(N,"__esModule",{value:!0});N.Manager=void 0;var ns=st(),Ro=ts(),Po=To(ct()),ne=Zt(),Ao=pn(),No=(Q(),K(G)),Do=Oo(A()),v=(0,Do.default)("socket.io-client:manager"),rs=class extends No.Emitter{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,(0,ns.installTimerFunctions)(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Ao.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let r=t.parser||Po;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(v("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;v("opening %s",this.uri),this.engine=new ns.Socket(this.uri,this.opts);let t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;let r=(0,ne.on)(t,"open",function(){n.onopen(),e&&e()}),i=c=>{v("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",c),e?e(c):this.maybeReconnectOnOpen()},o=(0,ne.on)(t,"error",i);if(this._timeout!==!1){let c=this._timeout;v("connect attempt will timeout after %d",c);let h=this.setTimeoutFn(()=>{v("connect attempt timed out after %d",c),r(),i(new Error("timeout")),t.close()},c);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(r),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){v("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push((0,ne.on)(e,"ping",this.onping.bind(this)),(0,ne.on)(e,"data",this.ondata.bind(this)),(0,ne.on)(e,"error",this.onerror.bind(this)),(0,ne.on)(e,"close",this.onclose.bind(this)),(0,ne.on)(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){(0,ns.nextTick)(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){v("error",e),this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ro.Socket(this,e,t),this.nsps[e]=n),n}_destroy(e){let t=Object.keys(this.nsps);for(let n of t)if(this.nsps[n].active){v("socket %s is still active, skipping close",n);return}this._close()}_packet(e){v("writing packet %j",e);let t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){v("cleanup"),this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){v("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;v("closed due to %s",e),this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)v("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();v("will wait %dms before reconnect attempt",t),this._reconnecting=!0;let n=this.setTimeoutFn(()=>{e.skipReconnect||(v("attempting reconnect"),this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(v("reconnect attempt error"),e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):(v("reconnect success"),e.onreconnect())}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};N.Manager=rs});var bn=f((b,mn)=>{"use strict";var Fo=b&&b.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(b,"__esModule",{value:!0});b.WebTransport=b.WebSocket=b.NodeWebSocket=b.XHR=b.NodeXHR=b.Fetch=b.Socket=b.Manager=b.protocol=void 0;b.io=re;b.connect=re;b.default=re;var Mo=cn(),ut=_n();Object.defineProperty(b,"Manager",{enumerable:!0,get:function(){return ut.Manager}});var gn=ts();Object.defineProperty(b,"Socket",{enumerable:!0,get:function(){return gn.Socket}});var qo=Fo(A()),yn=(0,qo.default)("socket.io-client"),Re={};function re(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};let t=(0,Mo.url)(s,e.path||"/socket.io"),n=t.source,r=t.id,i=t.path,o=Re[r]&&i in Re[r].nsps,c=e.forceNew||e["force new connection"]||e.multiplex===!1||o,h;return c?(yn("ignoring socket cache for %s",n),h=new ut.Manager(n,e)):(Re[r]||(yn("new io instance for %s",n),Re[r]=new ut.Manager(n,e)),h=Re[r]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(re,{Manager:ut.Manager,Socket:gn.Socket,io:re,connect:re});var xo=ct();Object.defineProperty(b,"protocol",{enumerable:!0,get:function(){return xo.protocol}});var me=st();Object.defineProperty(b,"Fetch",{enumerable:!0,get:function(){return me.Fetch}});Object.defineProperty(b,"NodeXHR",{enumerable:!0,get:function(){return me.NodeXHR}});Object.defineProperty(b,"XHR",{enumerable:!0,get:function(){return me.XHR}});Object.defineProperty(b,"NodeWebSocket",{enumerable:!0,get:function(){return me.NodeWebSocket}});Object.defineProperty(b,"WebSocket",{enumerable:!0,get:function(){return me.WebSocket}});Object.defineProperty(b,"WebTransport",{enumerable:!0,get:function(){return me.WebTransport}});mn.exports=re});var Sn=f(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.DyFM_SocketClient_ServiceBase=void 0;var Io=(ys(),K(_s)),jo=Io.__importStar(bn()),En=dr(),kn=gs(),Lo=ms(),k=gt(),vn=lr(),is=bs(),X=qe(),Pe=kt(),os=class{_params;get params(){return this._params}get name(){return this.params.name}socket;incomingEvents;_connected_BS=new En.BehaviorSubject(!1);get connected(){return this._connected_BS.value}connected$=this._connected_BS.asObservable();_subscribed_BS=new En.BehaviorSubject(!1);get subscribed(){return this._subscribed_BS.value}subscribed$=this._subscribed_BS.asObservable();debugLog=kn.DyFM_global_settings.log_settings.setup;logFn=kn.DyFM_global_settings.log_settings.functions;defaultEvents=[new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.outgoingNewConnection,tasks:[()=>u(this,null,function*(){this._connected_BS.next(!0),this.subscribed&&this._subscribed_BS.next(!1),k.DyFM_Log.success(`< > socket-client(${this.params.name}) connected!`)})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.disconnect,tasks:[()=>u(this,null,function*(){this._connected_BS.next(!1),this.subscribed&&this._subscribed_BS.next(!1),k.DyFM_Log.warn(`<x > socket-client(${this.params.name}) disconnected!`),this._params.reconnect&&(yield vn.DyFM_Async.delay(this._params.reconnectDelay),this.connectSocket())})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.subscriptionSuccessful,tasks:[()=>u(this,null,function*(){k.DyFM_Log.success(`<=--> socket-client(${this.params.name}) subscription successful!`),this._subscribed_BS.next(!0)})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.unsubscribeSuccessful,tasks:[()=>u(this,null,function*(){k.DyFM_Log.success(`<x--> socket-client(${this.params.name}) unsubscribe successful!`),this._subscribed_BS.next(!1)})]}),new Pe.DyFM_SocketEvent({eventKey:X.DyFM_SocketEvent_Key.error,tasks:[e=>u(this,null,function*(){is.DyFM_Error.logSimple(`=--> socket-client(${this.params.name}) ERROR`,e)})]})];constructor(){this.asyncConstructor().catch(e=>{is.DyFM_Error.logSimple(`socket-client "${this.params?.name}" Service setup failed! (DyFM_SocketClientService constructor catch)
|
|
6
|
+
ERROR:`,e)})}subscriptionInProgress=!1;subscribe(){return u(this,null,function*(){try{if(this.subscribed){k.DyFM_Log.warn(`socket-client(${this.params.name}) already subscribed!`);return}if(this.subscriptionInProgress){k.DyFM_Log.warn(`socket-client(${this.params.name}) subscription in progress!`);return}this.subscriptionInProgress=!0;let e=yield this.getSubscriptionContent();yield this.emitEvent(X.DyFM_SocketEvent_Key.subscribe,e),this.subscriptionInProgress=!1}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Subscribe failed!`,e),this.subscriptionInProgress=!1,e}})}unsubscribe(){return u(this,null,function*(){try{yield this.emitEvent(X.DyFM_SocketEvent_Key.unsubscribe,null)}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Unsubscribe failed!`,e),e}})}emitEvent(e,t){return u(this,null,function*(){try{k.DyFM_Log.log(`<=-- outgoing socket-client(${this.params.name}) event: ${e}`),this.socket.emit(e,t)}catch(n){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Emit Event failed: ${this.params?.name} (${this.params?.port})`,n),n}})}asyncConstructor(){return u(this,null,function*(){try{this._params=this.getParams(),this.incomingEvents=this.getIncomingEvents()??[];let e=this.params.port?`${this.params.address}:${this.params.port}`:this.params.address;this.socket=jo.io(e,as({},this.params.socketOptions)),yield this.setupDefaultEvents(),yield this.setupSocketEvents(),k.DyFM_Log.success(`
|
|
7
7
|
socket-client(${this.params?.name}) Service setup finished`),yield this.connectSocket()}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params?.name}) Service setup failed!`,e),new is.DyFM_Error({errorCode:"FM-SCS-001",error:e})}})}setupDefaultEvents(){return u(this,null,function*(){try{this.logFn&&console.log(`
|
|
8
|
-
Fn:. setupDefaultEvents`),this.defaultEvents.forEach(e=>{e.serviceName=this.params.name;let t=this.incomingEvents.find(n=>n.eventKey===e.eventKey);t?t.tasks.unshift(...e.tasks):this.incomingEvents.push(e)})}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Default Events failed, ERROR:`,e),e}})}setupSocketEvents(){return u(this,null,function*(){try{this.debugLog&&console.log(`Setup socket-client(${this.params.name}) Events...`),yield
|
|
9
|
-
Fn:. tryReconnectIfNeeded`),yield vn.DyFM_Async.delay(this._params.reconnectDelay),this.connected||(this.tryingToReconnect=!1,yield this.connectSocket())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Try Reconnect failed, ERROR:`,e),this.tryingToReconnect=!1,e}})}reconnect(){this.tryingToReconnect=!1,this.socket&&this.socket.disconnect(),this.connectSocket()}};lt.DyFM_SocketClient_ServiceBase=os});var wn=f(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});var ht=(gs(),K(_s));ht.__exportStar(qe(),be);ht.__exportStar(Ss(),be);ht.__exportStar(kt(),be);ht.__exportStar(Sn(),be)});function dr(s,e){!e?.injector&&_t(dr);let t=e?.injector??oe(fs),n=new hs(1),r=Fe(()=>{let i;try{i=s()}catch(o){gt(()=>n.error(o));return}gt(()=>n.next(i))},{injector:t,manualCleanup:!0});return t.get(De).onDestroy(()=>{r.destroy(),n.complete()}),n.asObservable()}function mt(s,e){let t=!e?.manualCleanup;t&&!e?.injector&&_t(mt);let n=t?e?.injector?.get(De)??oe(De):null,r=fr(e?.equal),i;e?.requireSync?i=z({kind:0},{equal:r}):i=z({kind:1,value:e?.initialValue},{equal:r});let o=s.subscribe({next:c=>i.set({kind:1,value:c}),error:c=>{if(e?.rejectErrors)throw c;i.set({kind:2,error:c})}});if(e?.requireSync&&i().kind===0)throw new pt(601,!1);return n?.onDestroy(o.unsubscribe.bind(o)),ps(()=>{let c=i();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new pt(601,!1)}},{equal:e?.equal})}function fr(s=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&s(e.value,t.value)}var j=function(s){return s.connecting="connecting",s.connected="connected",s.error="error",s}(j||{});var C=us(hr()),d=us(wn());function dt(){if($.socketUrl!==void 0&&$.socketUrl.trim()!=="")return $.socketUrl.trim();if(typeof window<"u"){let s=new URL(window.location.href).origin;return C.DyFM_Log.warn("CCAP_Socket | socketUrl not set, using same-origin fallback:",s),s}return""}function U(s){return s!=null&&typeof s=="object"&&!(s instanceof Error)}function Cn(){return typeof globalThis>"u"?!1:globalThis.jasmine!==void 0}var Tn="answer",On="notify-user",Rn="agent-events",Pn="context:updated",An="monitoring:event",Nn="user-notification",Dn="cc-session:status",Fn="cc-session:output",Mn="cc-session:event",qn="cc-session:list-update",xn="cc-session:session-update",In="ca-session:status",jn="ca-session:output",Ln="ca-session:event",Bn="ca-session:list-update",Un="ext-session-msg:message",Kn="ext-session-msg:update",$n="user-interaction:request",Vn="instance-data:session-status-updated",Wn="instance:presence-update",Hn="openclaw-instance-data:status-updated",Yn="cci-instance-data:status-updated",Xn="cai-instance-data:status-updated",Jn="terminal:list:result",zn="terminal:start:result",Gn="terminal:command-result",Qn="terminal:command-output",Zn="cc:rate-limit-update",er="session-queue:updated",tr="session-queue:lock-changed",Lo="system-error",Bo="terminal-error",Uo="server:start-id",Ko="connect_error",$o=8*C.second,Wc=(()=>{class s extends d.DyFM_SocketClient_ServiceBase{status_$=z(j.connecting);lastError_$=z(null);connectAttemptCount_$=z(0);hasEverConnected=!1;connectionTimeoutId=null;knownServerStartId=null;eventSubject_S=new ls;event$=this.eventSubject_S.asObservable();connected_$=mt(this.connected$,{initialValue:!1});get socketAddress(){return dt()||(this.params?.address??"")}globalError_CS=oe(ks);settingsGeneral_DS=oe(Es);constructor(){super(),Cn()||this.startConnectionTimeout(),Fe(()=>{this.connected&&!this.subscribed&&this.subscribe()})}startConnectionTimeout(){this.clearConnectionTimeout(),this.connectionTimeoutId=setTimeout(()=>{if(this.connectionTimeoutId=null,this.status_$()===j.connecting){let t=new Error("Socket connection timeout \u2013 server unreachable or setup failed. Click to reconnect.");this.status_$.set(j.error),this.lastError_$.set(t),C.DyFM_Log.warn("CCAP_Socket | Connection timeout")}},$o)}clearConnectionTimeout(){this.connectionTimeoutId!==null&&(clearTimeout(this.connectionTimeoutId),this.connectionTimeoutId=null)}getParams(){let t=dt(),n=Cn(),r={path:"/socket",transports:["polling","websocket"],reconnectionDelay:1e3};return n&&(r.reconnection=!1),new d.DyFM_SocketClient_Params({name:"CCAP Client",address:t,reconnect:!n,reconnectDelay:C.minute,socketOptions:r})}getIncomingEvents(){let t=this,n=(r,i)=>{try{let o=U(i)?i:{};if(!t.eventSubject_S){let c=`Socket event dropped: eventSubject not initialized | event: ${r} | This means the socket event system is not functional \u2014 no live updates will arrive.`;C.DyFM_Log.error(`[CCAP_Socket] ${c}`),t.globalError_CS.showError(new Error(c),"client-socket-event-subject");return}t.eventSubject_S.next({event:r,payload:o})}catch(o){let c=o instanceof Error?o.message:String(o);C.DyFM_Log.error(`[CCAP_Socket] pushEnvelope failed | event: ${r} | ${c}`),t.globalError_CS.showError(o instanceof Error?o:new Error(`Socket event processing failed: ${r} \u2014 ${c}`),"client-socket-push-envelope")}};return[new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.outgoingNewConnection,tasks:[()=>u(this,null,function*(){t.clearConnectionTimeout(),t.hasEverConnected=!0,t.status_$.set(j.connected),t.lastError_$.set(null),t.connectAttemptCount_$.set(0),C.DyFM_Log.info("CCAP_Socket | Connected")})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.disconnect,tasks:[()=>u(this,null,function*(){t.hasEverConnected&&t.status_$.set(j.error),C.DyFM_Log.info("CCAP_Socket | Disconnected")})]}),new d.DyFM_SocketEvent({eventKey:Ko,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.connectAttemptCount_$.update(a=>a+1);let i=r instanceof Error?r:new Error(String(r)),o=U(r)?r.description:void 0,c=U(r)?r.type:void 0;C.DyFM_Log.info("CCAP_Socket | connect_error",`attempt #${t.connectAttemptCount_$()}`,i?.message??String(r),o!==void 0?String(o):"",c!==void 0?String(c):""),t.status_$.set(j.error);let h=t.params?.address??"",_=t.buildSocketErrorDisplay({err:i,socketUrl:h,eventType:"connect_error",raw:r});t.lastError_$.set(_),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(_.fullMessage??_.message??i.message),stack:typeof _.stack=="string"?_.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.error,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.status_$.set(j.error);let i=r instanceof Error?r:new Error(String(r)),o=t.params?.address??"",c=t.buildSocketErrorDisplay({err:i,socketUrl:o,eventType:"error",raw:r});t.lastError_$.set(c),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(c.fullMessage??c.message??i.message),stack:typeof c.stack=="string"?c.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:Tn,tasks:[r=>u(this,null,function*(){n(Tn,r)})]}),new d.DyFM_SocketEvent({eventKey:On,tasks:[r=>u(this,null,function*(){n(On,r)})]}),new d.DyFM_SocketEvent({eventKey:Rn,tasks:[r=>u(this,null,function*(){n(Rn,r)})]}),new d.DyFM_SocketEvent({eventKey:Pn,tasks:[r=>u(this,null,function*(){n(Pn,r)})]}),new d.DyFM_SocketEvent({eventKey:An,tasks:[r=>u(this,null,function*(){n(An,r)})]}),new d.DyFM_SocketEvent({eventKey:Nn,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{};if(n(Nn,r),i.type===Lo){let o=t.buildServerErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}else if(i.type===Bo){let o=t.buildTerminalErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}})]}),new d.DyFM_SocketEvent({eventKey:Uo,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{},o=typeof i.serverStartId=="number"?i.serverStartId:void 0;o!==void 0&&(t.knownServerStartId===null?(t.knownServerStartId=o,C.DyFM_Log.info("CCAP_Socket | Server start ID stored:",o)):t.knownServerStartId!==o&&(C.DyFM_Log.warn("CCAP_Socket | Server restarted (start ID changed), reloading page"),window.location.reload()))})]}),new d.DyFM_SocketEvent({eventKey:Dn,tasks:[r=>u(this,null,function*(){n(Dn,r)})]}),new d.DyFM_SocketEvent({eventKey:Fn,tasks:[r=>u(this,null,function*(){n(Fn,r)})]}),new d.DyFM_SocketEvent({eventKey:Mn,tasks:[r=>u(this,null,function*(){n(Mn,r)})]}),new d.DyFM_SocketEvent({eventKey:qn,tasks:[r=>u(this,null,function*(){n(qn,r)})]}),new d.DyFM_SocketEvent({eventKey:xn,tasks:[r=>u(this,null,function*(){n(xn,r)})]}),new d.DyFM_SocketEvent({eventKey:In,tasks:[r=>u(this,null,function*(){n(In,r)})]}),new d.DyFM_SocketEvent({eventKey:jn,tasks:[r=>u(this,null,function*(){n(jn,r)})]}),new d.DyFM_SocketEvent({eventKey:Ln,tasks:[r=>u(this,null,function*(){n(Ln,r)})]}),new d.DyFM_SocketEvent({eventKey:Bn,tasks:[r=>u(this,null,function*(){n(Bn,r)})]}),new d.DyFM_SocketEvent({eventKey:Un,tasks:[r=>u(this,null,function*(){n(Un,r)})]}),new d.DyFM_SocketEvent({eventKey:Kn,tasks:[r=>u(this,null,function*(){n(Kn,r)})]}),new d.DyFM_SocketEvent({eventKey:$n,tasks:[r=>u(this,null,function*(){n($n,r)})]}),new d.DyFM_SocketEvent({eventKey:Vn,tasks:[r=>u(this,null,function*(){n(Vn,r)})]}),new d.DyFM_SocketEvent({eventKey:Wn,tasks:[r=>u(this,null,function*(){n(Wn,r)})]}),new d.DyFM_SocketEvent({eventKey:Hn,tasks:[r=>u(this,null,function*(){n(Hn,r)})]}),new d.DyFM_SocketEvent({eventKey:Yn,tasks:[r=>u(this,null,function*(){n(Yn,r)})]}),new d.DyFM_SocketEvent({eventKey:Xn,tasks:[r=>u(this,null,function*(){n(Xn,r)})]}),new d.DyFM_SocketEvent({eventKey:Jn,tasks:[r=>u(this,null,function*(){n(Jn,r)})]}),new d.DyFM_SocketEvent({eventKey:zn,tasks:[r=>u(this,null,function*(){n(zn,r)})]}),new d.DyFM_SocketEvent({eventKey:Gn,tasks:[r=>u(this,null,function*(){n(Gn,r)})]}),new d.DyFM_SocketEvent({eventKey:Qn,tasks:[r=>u(this,null,function*(){n(Qn,r)})]}),new d.DyFM_SocketEvent({eventKey:er,tasks:[r=>u(this,null,function*(){n(er,r)})]}),new d.DyFM_SocketEvent({eventKey:tr,tasks:[r=>u(this,null,function*(){n(tr,r)})]}),new d.DyFM_SocketEvent({eventKey:Zn,tasks:[r=>u(this,null,function*(){n(Zn,r)})]})]}getSubscriptionContent(){return u(this,null,function*(){let t=this.socket?.id;return Promise.resolve({clientId:t})})}shouldReportSocketConnectionErrorsToErrorList(){return this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0}buildSocketErrorDisplay(t){let n=t.err.message?.trim()?t.err.message:"WebSocket connection failed",r=t.socketUrl.trim()?`WebSocket: ${n} \u2014 ${t.socketUrl}`:`WebSocket: ${n}`,i={message:r,fullMessage:r,name:t.err.name,stack:t.err.stack??null,socketUrl:t.socketUrl,transport:"websocket",eventType:t.eventType,attemptedAt:new Date().toISOString(),connectAttempt:this.connectAttemptCount_$()},o=$.socketUrl!==void 0&&$.socketUrl.trim()!=="";i.socketUrlSource=o?"environment.socketUrl":"same-origin fallback";let c=this.params?.socketOptions?.transports??[];if(c.length>0&&(i.configuredTransports=c.join(", ")),typeof window<"u"&&(i.pageOrigin=window.location.origin),U(t.raw)){let _=t.raw,a=_.description;if(typeof a=="string"&&a.trim())i.description=a.trim();else if(a instanceof Error)i.description=a.message,a.stack&&(i.descriptionStack=a.stack);else if(a instanceof Event)i.description=this.extractDomEventInfo(a);else if(U(a)){let l=a,g=[];typeof l.message=="string"&&l.message.trim()&&g.push(l.message.trim()),typeof l.status=="number"&&(i.httpStatus=l.status,g.push(`HTTP ${l.status}`)),typeof l.statusText=="string"&&l.statusText.trim()&&(i.httpStatusText=l.statusText.trim(),g.push(l.statusText.trim())),typeof l.responseURL=="string"&&l.responseURL.trim()&&(i.responseUrl=l.responseURL.trim()),g.length>0&&(i.description=g.join(" \u2013 "))}typeof _.type=="string"&&_.type.trim()&&(i.type=_.type.trim()),U(_.context)&&(i.errorContext=_.context)}t.raw instanceof Event&&!i.description&&(i.description=this.extractDomEventInfo(t.raw));let h=[r];if(typeof i.description=="string"&&h.push(`Cause: ${i.description}`),typeof i.httpStatus=="number"){let _=typeof i.httpStatusText=="string"?` ${i.httpStatusText}`:"";h.push(`HTTP: ${i.httpStatus}${_}`)}return typeof i.responseUrl=="string"&&h.push(`Response URL: ${i.responseUrl}`),h.push(`Attempt: #${i.connectAttempt}`),h.push(`Source: ${i.socketUrlSource}`),i.fullMessage=h.join(" | "),i}extractDomEventInfo(t){let n=[];n.push(`type=${t.type}`);let r=t.target;return U(r)&&(typeof r.readyState=="number"&&n.push(`readyState=${r.readyState}`),typeof r.url=="string"&&r.url&&n.push(`url=${r.url}`),typeof r.responseURL=="string"&&r.responseURL&&n.push(`responseURL=${r.responseURL}`),typeof r.status=="number"&&n.push(`status=${r.status}`)),n.push("(DOM Event - tipikusan SSL cert reject, CORS, vagy network unreachable)"),n.join(", ")}buildTerminalErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=typeof t.code=="string"?t.code:String(t.code??""),i=[n];r&&i.push(`K\xF3d: ${r}`),typeof t.terminalId=="string"&&t.terminalId.trim()&&i.push(`Termin\xE1l ID: ${t.terminalId.trim()}`),typeof t.path=="string"&&t.path.trim()&&i.push(`Path: ${t.path.trim()}`);let o=i.join(`
|
|
10
|
-
`),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:null,detailsText:o,timestamp:c}}buildServerErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=t.stack,i=typeof r=="string"?r:r!=null?String(r):null,o=typeof t.detailsText=="string"?t.detailsText:JSON.stringify(t,null,2),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:i,detailsText:o,timestamp:c}}reconnect(){if(this.socket){this.clearConnectionTimeout(),this.status_$.set(j.connecting),this.lastError_$.set(null),this.connectAttemptCount_$.set(0),this.startConnectionTimeout();let t=this.params?.address??dt();C.DyFM_Log.info("CCAP_Socket | Reconnecting to",t),this.socket.disconnect(),this.socket.connect()}}emit(t,n){this.socket?.connected&&this.socket.emit(t,n)}diagnoseConnection(){return u(this,null,function*(){let t=this.params?.address??dt(),n={timestamp:new Date().toISOString(),socketUrl:t,socketUrlSource:$.socketUrl!==void 0&&$.socketUrl.trim()!==""?"environment.socketUrl":"same-origin fallback",pageOrigin:typeof window<"u"?window.location.origin:"",socketConnected:this.socket?.connected??!1,socketId:this.socket?.id??null,connectAttemptCount:this.connectAttemptCount_$(),currentStatus:this.status_$()},r=yield s.probeEndpoint("/api/server/status","serverStatusApi");if(n.serverStatusApi=r,r.ok===!0&&r.body!==void 0){let _=r.body;if(_!==null&&typeof _=="object"){let a=_;n.serverReportedHttpPort=a.httpPort??null,n.serverReportedSocketPort=a.socketPort??null}}let i=this.params?.socketOptions?.path??"/socket",o=`${t}${i}/?EIO=4&transport=polling&t=${Date.now()}`,c=yield s.probeEndpoint(o,"socketIoPolling");n.socketIoPolling=c;let h=n.serverReportedSocketPort;if(typeof h=="number"&&h>0){let _=`http://localhost:${h}${i}/?EIO=4&transport=polling&t=${Date.now()}`,a=yield s.probeEndpoint(_,"socketIoDirectPort");n.socketIoDirectPort=a}return n})}static probeEndpoint(t,n){return u(this,null,function*(){let r={url:t,label:n},i=performance.now();try{let o=yield fetch(t,{method:"GET",cache:"no-store"}),c=Math.round(performance.now()-i);r.ok=o.ok,r.httpStatus=o.status,r.httpStatusText=o.statusText,r.elapsedMs=c;try{let h=yield o.text();try{r.body=JSON.parse(h)}catch{r.bodyPreview=h.substring(0,300)}}catch{r.bodyReadError="Failed to read response body"}}catch(o){let c=Math.round(performance.now()-i);r.elapsedMs=c,r.ok=!1,r.fetchError=o instanceof Error?o.message:String(o),o instanceof TypeError&&(r.fetchErrorType="TypeError (network/CORS/SSL)")}return r})}ngOnDestroy(){this.clearConnectionTimeout(),this.socket&&this.socket.disconnect()}static \u0275fac=function(n){return new(n||s)};static \u0275prov=ds({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
Fn:. setupDefaultEvents`),this.defaultEvents.forEach(e=>{e.serviceName=this.params.name;let t=this.incomingEvents.find(n=>n.eventKey===e.eventKey);t?t.tasks.unshift(...e.tasks):this.incomingEvents.push(e)})}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Default Events failed, ERROR:`,e),e}})}setupSocketEvents(){return u(this,null,function*(){try{this.debugLog&&console.log(`Setup socket-client(${this.params.name}) Events...`),yield Lo.DyFM_Array.asyncForEach(this.incomingEvents,e=>u(this,null,function*(){e.serviceName=this.params.name,this.socket.on(e.eventKey,t=>u(this,null,function*(){try{yield e.executeEventTasks(t,this.params.service)}catch(n){k.DyFM_Log.error(`socket-client(${this.params.name}) Event failed, ERROR:`,n),yield this.emitEvent(X.DyFM_SocketEvent_Key.error,n)}}))}))}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Socket Events failed, ERROR:`,e),e}})}connectSocket(){return u(this,null,function*(){try{k.DyFM_Log.info(`< .. > socket-client(${this.params.name}) connecting to ${this.params.address}:${this.params.port} ...`),this.socket.connect(),this.params.reconnect&&(yield this.tryReconnectIfNeeded())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Connect Socket failed, ERROR:`,e),e}})}tryingToReconnect=!1;tryReconnectIfNeeded(){return u(this,null,function*(){try{if(console.log("tryReconnectIfNeeded",this._params.reconnectDelay),this.tryingToReconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) already trying to reconnect!`);return}if(!this.params.reconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) Dynamo reconnection is disabled!`);return}this.tryingToReconnect=!0,this.logFn&&console.log(`
|
|
9
|
+
Fn:. tryReconnectIfNeeded`),yield vn.DyFM_Async.delay(this._params.reconnectDelay),this.connected||(this.tryingToReconnect=!1,yield this.connectSocket())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Try Reconnect failed, ERROR:`,e),this.tryingToReconnect=!1,e}})}reconnect(){this.tryingToReconnect=!1,this.socket&&this.socket.disconnect(),this.connectSocket()}};lt.DyFM_SocketClient_ServiceBase=os});var wn=f(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});var ht=(ys(),K(_s));ht.__exportStar(qe(),be);ht.__exportStar(Ss(),be);ht.__exportStar(kt(),be);ht.__exportStar(Sn(),be)});function pr(s,e){!e?.injector&&_t(pr);let t=e?.injector??oe(fs),n=new hs(1),r=Fe(()=>{let i;try{i=s()}catch(o){yt(()=>n.error(o));return}yt(()=>n.next(i))},{injector:t,manualCleanup:!0});return t.get(De).onDestroy(()=>{r.destroy(),n.complete()}),n.asObservable()}function mt(s,e){let t=!e?.manualCleanup;t&&!e?.injector&&_t(mt);let n=t?e?.injector?.get(De)??oe(De):null,r=_r(e?.equal),i;e?.requireSync?i=z({kind:0},{equal:r}):i=z({kind:1,value:e?.initialValue},{equal:r});let o=s.subscribe({next:c=>i.set({kind:1,value:c}),error:c=>{if(e?.rejectErrors)throw c;i.set({kind:2,error:c})}});if(e?.requireSync&&i().kind===0)throw new pt(601,!1);return n?.onDestroy(o.unsubscribe.bind(o)),ps(()=>{let c=i();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new pt(601,!1)}},{equal:e?.equal})}function _r(s=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&s(e.value,t.value)}var C=us(fr()),d=us(wn());var j=function(s){return s.connecting="connecting",s.connected="connected",s.error="error",s}(j||{});function dt(){if($.socketUrl!==void 0&&$.socketUrl.trim()!=="")return $.socketUrl.trim();if(typeof window<"u"){let s=new URL(window.location.href).origin;return C.DyFM_Log.warn("CCAP_Socket | socketUrl not set, using same-origin fallback:",s),s}return""}function U(s){return s!=null&&typeof s=="object"&&!(s instanceof Error)}function Cn(){return typeof globalThis>"u"?!1:globalThis.jasmine!==void 0}var Tn="answer",On="notify-user",Rn="agent-events",Pn="context:updated",An="monitoring:event",Nn="user-notification",Dn="cc-session:status",Fn="cc-session:output",Mn="cc-session:event",qn="cc-session:list-update",xn="cc-session:session-update",In="ca-session:status",jn="ca-session:output",Ln="ca-session:event",Bn="ca-session:list-update",Un="ext-session-msg:message",Kn="ext-session-msg:update",$n="user-interaction:request",Vn="instance-data:session-status-updated",Wn="instance:presence-update",Hn="openclaw-instance-data:status-updated",Yn="cci-instance-data:status-updated",Xn="cai-instance-data:status-updated",Jn="terminal:list:result",zn="terminal:start:result",Gn="terminal:command-result",Qn="terminal:command-output",Zn="cc:rate-limit-update",er="cc:account-usage-update",tr="cc:account-list-update",sr="session-queue:updated",nr="session-queue:lock-changed",Uo="system-error",Ko="terminal-error",$o="server:start-id",Vo="connect_error",Wo=8*C.second,Yc=(()=>{class s extends d.DyFM_SocketClient_ServiceBase{status_$=z(j.connecting);lastError_$=z(null);connectAttemptCount_$=z(0);hasEverConnected=!1;connectionTimeoutId=null;knownServerStartId=null;eventSubject_S=new ls;event$=this.eventSubject_S.asObservable();connected_$=mt(this.connected$,{initialValue:!1});get socketAddress(){return dt()||(this.params?.address??"")}globalError_CS=oe(ks);settingsGeneral_DS=oe(Es);constructor(){super(),Cn()||this.startConnectionTimeout(),Fe(()=>{this.connected&&!this.subscribed&&this.subscribe()})}startConnectionTimeout(){this.clearConnectionTimeout(),this.connectionTimeoutId=setTimeout(()=>{if(this.connectionTimeoutId=null,this.status_$()===j.connecting){let t=new Error("Socket connection timeout \u2013 server unreachable or setup failed. Click to reconnect.");this.status_$.set(j.error),this.lastError_$.set(t),C.DyFM_Log.warn("CCAP_Socket | Connection timeout")}},Wo)}clearConnectionTimeout(){this.connectionTimeoutId!==null&&(clearTimeout(this.connectionTimeoutId),this.connectionTimeoutId=null)}getParams(){let t=dt(),n=Cn(),r={path:"/socket",transports:["polling","websocket"],reconnectionDelay:1e3};return n&&(r.reconnection=!1),new d.DyFM_SocketClient_Params({name:"CCAP Client",address:t,reconnect:!n,reconnectDelay:C.minute,socketOptions:r})}getIncomingEvents(){let t=this,n=(r,i)=>{try{let o=U(i)?i:{};if(!t.eventSubject_S){let c=`Socket event dropped: eventSubject not initialized | event: ${r} | This means the socket event system is not functional \u2014 no live updates will arrive.`;C.DyFM_Log.error(`[CCAP_Socket] ${c}`),t.globalError_CS.showError(new Error(c),"client-socket-event-subject");return}t.eventSubject_S.next({event:r,payload:o})}catch(o){let c=o instanceof Error?o.message:String(o);C.DyFM_Log.error(`[CCAP_Socket] pushEnvelope failed | event: ${r} | ${c}`),t.globalError_CS.showError(o instanceof Error?o:new Error(`Socket event processing failed: ${r} \u2014 ${c}`),"client-socket-push-envelope")}};return[new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.outgoingNewConnection,tasks:[()=>u(this,null,function*(){t.clearConnectionTimeout(),t.hasEverConnected=!0,t.status_$.set(j.connected),t.lastError_$.set(null),t.connectAttemptCount_$.set(0),C.DyFM_Log.info("CCAP_Socket | Connected")})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.disconnect,tasks:[()=>u(this,null,function*(){t.hasEverConnected&&t.status_$.set(j.error),C.DyFM_Log.info("CCAP_Socket | Disconnected")})]}),new d.DyFM_SocketEvent({eventKey:Vo,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.connectAttemptCount_$.update(a=>a+1);let i=r instanceof Error?r:new Error(String(r)),o=U(r)?r.description:void 0,c=U(r)?r.type:void 0;C.DyFM_Log.info("CCAP_Socket | connect_error",`attempt #${t.connectAttemptCount_$()}`,i?.message??String(r),o!==void 0?String(o):"",c!==void 0?String(c):""),t.status_$.set(j.error);let h=t.params?.address??"",_=t.buildSocketErrorDisplay({err:i,socketUrl:h,eventType:"connect_error",raw:r});t.lastError_$.set(_),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(_.fullMessage??_.message??i.message),stack:typeof _.stack=="string"?_.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.error,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.status_$.set(j.error);let i=r instanceof Error?r:new Error(String(r)),o=t.params?.address??"",c=t.buildSocketErrorDisplay({err:i,socketUrl:o,eventType:"error",raw:r});t.lastError_$.set(c),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(c.fullMessage??c.message??i.message),stack:typeof c.stack=="string"?c.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:Tn,tasks:[r=>u(this,null,function*(){n(Tn,r)})]}),new d.DyFM_SocketEvent({eventKey:On,tasks:[r=>u(this,null,function*(){n(On,r)})]}),new d.DyFM_SocketEvent({eventKey:Rn,tasks:[r=>u(this,null,function*(){n(Rn,r)})]}),new d.DyFM_SocketEvent({eventKey:Pn,tasks:[r=>u(this,null,function*(){n(Pn,r)})]}),new d.DyFM_SocketEvent({eventKey:An,tasks:[r=>u(this,null,function*(){n(An,r)})]}),new d.DyFM_SocketEvent({eventKey:Nn,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{};if(n(Nn,r),i.type===Uo){let o=t.buildServerErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}else if(i.type===Ko){let o=t.buildTerminalErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}})]}),new d.DyFM_SocketEvent({eventKey:$o,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{},o=typeof i.serverStartId=="number"?i.serverStartId:void 0;o!==void 0&&(t.knownServerStartId===null?(t.knownServerStartId=o,C.DyFM_Log.info("CCAP_Socket | Server start ID stored:",o)):t.knownServerStartId!==o&&(C.DyFM_Log.warn("CCAP_Socket | Server restarted (start ID changed), reloading page"),window.location.reload()))})]}),new d.DyFM_SocketEvent({eventKey:Dn,tasks:[r=>u(this,null,function*(){n(Dn,r)})]}),new d.DyFM_SocketEvent({eventKey:Fn,tasks:[r=>u(this,null,function*(){n(Fn,r)})]}),new d.DyFM_SocketEvent({eventKey:Mn,tasks:[r=>u(this,null,function*(){n(Mn,r)})]}),new d.DyFM_SocketEvent({eventKey:qn,tasks:[r=>u(this,null,function*(){n(qn,r)})]}),new d.DyFM_SocketEvent({eventKey:xn,tasks:[r=>u(this,null,function*(){n(xn,r)})]}),new d.DyFM_SocketEvent({eventKey:In,tasks:[r=>u(this,null,function*(){n(In,r)})]}),new d.DyFM_SocketEvent({eventKey:jn,tasks:[r=>u(this,null,function*(){n(jn,r)})]}),new d.DyFM_SocketEvent({eventKey:Ln,tasks:[r=>u(this,null,function*(){n(Ln,r)})]}),new d.DyFM_SocketEvent({eventKey:Bn,tasks:[r=>u(this,null,function*(){n(Bn,r)})]}),new d.DyFM_SocketEvent({eventKey:Un,tasks:[r=>u(this,null,function*(){n(Un,r)})]}),new d.DyFM_SocketEvent({eventKey:Kn,tasks:[r=>u(this,null,function*(){n(Kn,r)})]}),new d.DyFM_SocketEvent({eventKey:$n,tasks:[r=>u(this,null,function*(){n($n,r)})]}),new d.DyFM_SocketEvent({eventKey:Vn,tasks:[r=>u(this,null,function*(){n(Vn,r)})]}),new d.DyFM_SocketEvent({eventKey:Wn,tasks:[r=>u(this,null,function*(){n(Wn,r)})]}),new d.DyFM_SocketEvent({eventKey:Hn,tasks:[r=>u(this,null,function*(){n(Hn,r)})]}),new d.DyFM_SocketEvent({eventKey:Yn,tasks:[r=>u(this,null,function*(){n(Yn,r)})]}),new d.DyFM_SocketEvent({eventKey:Xn,tasks:[r=>u(this,null,function*(){n(Xn,r)})]}),new d.DyFM_SocketEvent({eventKey:Jn,tasks:[r=>u(this,null,function*(){n(Jn,r)})]}),new d.DyFM_SocketEvent({eventKey:zn,tasks:[r=>u(this,null,function*(){n(zn,r)})]}),new d.DyFM_SocketEvent({eventKey:Gn,tasks:[r=>u(this,null,function*(){n(Gn,r)})]}),new d.DyFM_SocketEvent({eventKey:Qn,tasks:[r=>u(this,null,function*(){n(Qn,r)})]}),new d.DyFM_SocketEvent({eventKey:sr,tasks:[r=>u(this,null,function*(){n(sr,r)})]}),new d.DyFM_SocketEvent({eventKey:nr,tasks:[r=>u(this,null,function*(){n(nr,r)})]}),new d.DyFM_SocketEvent({eventKey:Zn,tasks:[r=>u(this,null,function*(){n(Zn,r)})]}),new d.DyFM_SocketEvent({eventKey:er,tasks:[r=>u(this,null,function*(){n(er,r)})]}),new d.DyFM_SocketEvent({eventKey:tr,tasks:[r=>u(this,null,function*(){n(tr,r)})]})]}getSubscriptionContent(){return u(this,null,function*(){let t=this.socket?.id;return Promise.resolve({clientId:t})})}shouldReportSocketConnectionErrorsToErrorList(){return this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0}buildSocketErrorDisplay(t){let n=t.err.message?.trim()?t.err.message:"WebSocket connection failed",r=t.socketUrl.trim()?`WebSocket: ${n} \u2014 ${t.socketUrl}`:`WebSocket: ${n}`,i={message:r,fullMessage:r,name:t.err.name,stack:t.err.stack??null,socketUrl:t.socketUrl,transport:"websocket",eventType:t.eventType,attemptedAt:new Date().toISOString(),connectAttempt:this.connectAttemptCount_$()},o=$.socketUrl!==void 0&&$.socketUrl.trim()!=="";i.socketUrlSource=o?"environment.socketUrl":"same-origin fallback";let c=this.params?.socketOptions?.transports??[];if(c.length>0&&(i.configuredTransports=c.join(", ")),typeof window<"u"&&(i.pageOrigin=window.location.origin),U(t.raw)){let _=t.raw,a=_.description;if(typeof a=="string"&&a.trim())i.description=a.trim();else if(a instanceof Error)i.description=a.message,a.stack&&(i.descriptionStack=a.stack);else if(a instanceof Event)i.description=this.extractDomEventInfo(a);else if(U(a)){let l=a,y=[];typeof l.message=="string"&&l.message.trim()&&y.push(l.message.trim()),typeof l.status=="number"&&(i.httpStatus=l.status,y.push(`HTTP ${l.status}`)),typeof l.statusText=="string"&&l.statusText.trim()&&(i.httpStatusText=l.statusText.trim(),y.push(l.statusText.trim())),typeof l.responseURL=="string"&&l.responseURL.trim()&&(i.responseUrl=l.responseURL.trim()),y.length>0&&(i.description=y.join(" \u2013 "))}typeof _.type=="string"&&_.type.trim()&&(i.type=_.type.trim()),U(_.context)&&(i.errorContext=_.context)}t.raw instanceof Event&&!i.description&&(i.description=this.extractDomEventInfo(t.raw));let h=[r];if(typeof i.description=="string"&&h.push(`Cause: ${i.description}`),typeof i.httpStatus=="number"){let _=typeof i.httpStatusText=="string"?` ${i.httpStatusText}`:"";h.push(`HTTP: ${i.httpStatus}${_}`)}return typeof i.responseUrl=="string"&&h.push(`Response URL: ${i.responseUrl}`),h.push(`Attempt: #${i.connectAttempt}`),h.push(`Source: ${i.socketUrlSource}`),i.fullMessage=h.join(" | "),i}extractDomEventInfo(t){let n=[];n.push(`type=${t.type}`);let r=t.target;return U(r)&&(typeof r.readyState=="number"&&n.push(`readyState=${r.readyState}`),typeof r.url=="string"&&r.url&&n.push(`url=${r.url}`),typeof r.responseURL=="string"&&r.responseURL&&n.push(`responseURL=${r.responseURL}`),typeof r.status=="number"&&n.push(`status=${r.status}`)),n.push("(DOM Event - tipikusan SSL cert reject, CORS, vagy network unreachable)"),n.join(", ")}buildTerminalErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=typeof t.code=="string"?t.code:String(t.code??""),i=[n];r&&i.push(`K\xF3d: ${r}`),typeof t.terminalId=="string"&&t.terminalId.trim()&&i.push(`Termin\xE1l ID: ${t.terminalId.trim()}`),typeof t.path=="string"&&t.path.trim()&&i.push(`Path: ${t.path.trim()}`);let o=i.join(`
|
|
10
|
+
`),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:null,detailsText:o,timestamp:c}}buildServerErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=t.stack,i=typeof r=="string"?r:r!=null?String(r):null,o=typeof t.detailsText=="string"?t.detailsText:JSON.stringify(t,null,2),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:i,detailsText:o,timestamp:c}}reconnect(){if(this.socket){this.clearConnectionTimeout(),this.status_$.set(j.connecting),this.lastError_$.set(null),this.connectAttemptCount_$.set(0),this.startConnectionTimeout();let t=this.params?.address??dt();C.DyFM_Log.info("CCAP_Socket | Reconnecting to",t),this.socket.disconnect(),this.socket.connect()}}emit(t,n){this.socket?.connected&&this.socket.emit(t,n)}diagnoseConnection(){return u(this,null,function*(){let t=this.params?.address??dt(),n={timestamp:new Date().toISOString(),socketUrl:t,socketUrlSource:$.socketUrl!==void 0&&$.socketUrl.trim()!==""?"environment.socketUrl":"same-origin fallback",pageOrigin:typeof window<"u"?window.location.origin:"",socketConnected:this.socket?.connected??!1,socketId:this.socket?.id??null,connectAttemptCount:this.connectAttemptCount_$(),currentStatus:this.status_$()},r=yield s.probeEndpoint("/api/server/status","serverStatusApi");if(n.serverStatusApi=r,r.ok===!0&&r.body!==void 0){let _=r.body;if(_!==null&&typeof _=="object"){let a=_;n.serverReportedHttpPort=a.httpPort??null,n.serverReportedSocketPort=a.socketPort??null}}let i=this.params?.socketOptions?.path??"/socket",o=`${t}${i}/?EIO=4&transport=polling&t=${Date.now()}`,c=yield s.probeEndpoint(o,"socketIoPolling");n.socketIoPolling=c;let h=n.serverReportedSocketPort;if(typeof h=="number"&&h>0){let _=`http://localhost:${h}${i}/?EIO=4&transport=polling&t=${Date.now()}`,a=yield s.probeEndpoint(_,"socketIoDirectPort");n.socketIoDirectPort=a}return n})}static probeEndpoint(t,n){return u(this,null,function*(){let r={url:t,label:n},i=performance.now();try{let o=yield fetch(t,{method:"GET",cache:"no-store"}),c=Math.round(performance.now()-i);r.ok=o.ok,r.httpStatus=o.status,r.httpStatusText=o.statusText,r.elapsedMs=c;try{let h=yield o.text();try{r.body=JSON.parse(h)}catch{r.bodyPreview=h.substring(0,300)}}catch{r.bodyReadError="Failed to read response body"}}catch(o){let c=Math.round(performance.now()-i);r.elapsedMs=c,r.ok=!1,r.fetchError=o instanceof Error?o.message:String(o),o instanceof TypeError&&(r.fetchErrorType="TypeError (network/CORS/SSL)")}return r})}ngOnDestroy(){this.clearConnectionTimeout(),this.socket&&this.socket.disconnect()}static \u0275fac=function(n){return new(n||s)};static \u0275prov=ds({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{pr as a,mt as b,wn as c,j as d,Yc as e};
|
|
11
|
+
//# sourceMappingURL=chunk-I6OBHW45.js.map
|