openc3-cosmos-tool-cmdtlmserver 6.9.1 → 6.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/tools/cmdtlmserver/ArrayWidget-C59wpWWk-5c23b659d87f2c68f1f8.js +2 -0
  3. data/tools/cmdtlmserver/{ArrayplotWidget-CoRsUxHG-cf7fff88417fb2243c3d.js → ArrayplotWidget-tKqIV461-69b93fbe6c96b6fc74c8.js} +1 -1
  4. data/tools/cmdtlmserver/{BarColumn-DHP-zQ4R-8f7de54e6fbaa25e4ec4.js → BarColumn-CUO9ur6W-a3cf13ae72d2bcaca048.js} +1 -1
  5. data/tools/cmdtlmserver/BlockWidget-BdlMR_1A-72f9faa443712ec20192.js +2 -0
  6. data/tools/cmdtlmserver/{ButtonWidget-C3ZWRjZZ-d4f10adaa4d980be147b.js → ButtonWidget-C2JVmh3p-8182fd293966fb57b545.js} +2 -2
  7. data/tools/cmdtlmserver/{CanvasWidget-CL-XzPF4-5cb52c70d0a7623af62d.js → CanvasWidget-BRbdw1fu-e883370954a0f3c628b6.js} +1 -1
  8. data/tools/cmdtlmserver/{CanvasdotWidget-D8Y9DgVE-d4ce1b672cfd13141a61.js → CanvasdotWidget-C8T_w03p-9abf39f00eddceb492b2.js} +1 -1
  9. data/tools/cmdtlmserver/{CanvasimageWidget-DHSGK_tD-b0b463aa2a7854867228.js → CanvasimageWidget-C1w2vSsG-90c81cd3ab87a8825002.js} +1 -1
  10. data/tools/cmdtlmserver/{CanvasimagevalueWidget-Btt_fQfC-9bad1ce95b773296304d.js → CanvasimagevalueWidget-BMv2SmEq-d6d92e343a2a6105fd90.js} +1 -1
  11. data/tools/cmdtlmserver/{CanvaslabelWidget-BF_8RTjv-cc491567aedeb0a05962.js → CanvaslabelWidget-LEBZQ3DR-fb14e176d00f00150d8e.js} +1 -1
  12. data/tools/cmdtlmserver/{CanvaslabelvalueWidget-scbwaujI-921ddd08e78e6a07a01e.js → CanvaslabelvalueWidget-Q6UdEanF-17272a719eefb062c283.js} +1 -1
  13. data/tools/cmdtlmserver/CanvaslineWidget-BhvBCDoS-d693034562792622b829.js +1 -0
  14. data/tools/cmdtlmserver/{CanvaslinevalueWidget-CljziRek-55c5928bcdef9cd5c3e1.js → CanvaslinevalueWidget-EaASC9TU-cbb21d5a502c664894f1.js} +1 -1
  15. data/tools/cmdtlmserver/CheckbuttonWidget-C3bjQwrp-3bf99905f8136eb37d45.js +1 -0
  16. data/tools/cmdtlmserver/{CmdPacketsTab-2fc1a07bfa4480ac1f08.js → CmdPacketsTab-90b7eafbae0c1ed28430.js} +1 -1
  17. data/tools/cmdtlmserver/{CmdTlmServer-8583a13b294ed4f3cb46.js → CmdTlmServer-5fa13cb7651202a03c8c.js} +2 -2
  18. data/tools/cmdtlmserver/{ComboboxWidget-BLXNYFiY-13a3fa2f54e442f31472.js → ComboboxWidget-CmruSbJy-e223f5d0af5d55988d3f.js} +1 -1
  19. data/tools/cmdtlmserver/{DataFlowsTab-d5417860ccc3925137e9.js → DataFlowsTab-b2e31ee49fd89c2b01c4.js} +1 -1
  20. data/tools/cmdtlmserver/{DateWidget-BTqLCtLS-8daf3620df3f82d93460.js → DateWidget-CcUxRlJ2-988ead4672c9bff3fd3c.js} +1 -1
  21. data/tools/cmdtlmserver/{DetailsDialog-BNCS3QAe-321aef533102379472dd.js → DetailsDialog-DxYZre4A-3db5b5e7905643a0fb80.js} +1 -1
  22. data/tools/cmdtlmserver/{DynamicWidget-CfMtj7H8-c6963e567e7e1f83eb47.js → DynamicWidget-DHL7pbgW-4c1d29fa83848dc6e5d8.js} +1 -1
  23. data/tools/cmdtlmserver/{FormatvalueWidget-CLYx8qbg-a8b84f8338259639bf3e.js → FormatvalueWidget-Lk5K0wTL-6b725aa76f27d5db94ab.js} +1 -1
  24. data/tools/cmdtlmserver/Graph-CjEE2WxX-bb7f5ba3af37177d131e.js +1 -0
  25. data/tools/cmdtlmserver/{GraphWidget-Cb6Ozf54-9a6662f6a20837d0632e.js → GraphWidget-BaO2FpKo-4d4707ab4567aad52098.js} +1 -1
  26. data/tools/cmdtlmserver/{HorizontalWidget-AY2M01qP-2edc328bb61ab1d8c352.js → HorizontalWidget-D3Q5IUQg-17d375b2b69c785818b6.js} +1 -1
  27. data/tools/cmdtlmserver/{HorizontalboxWidget-2MEKvq_C-5f3d5a6c63938edc7e25.js → HorizontalboxWidget-D7bUUqfG-95eb191777368357ab5a.js} +1 -1
  28. data/tools/cmdtlmserver/HorizontallineWidget-DZcIetQh-1b698bc4b69a6cc5b460.js +1 -0
  29. data/tools/cmdtlmserver/{IframeWidget-UKKUl7k5-d952d6f2121f46bd5cd1.js → IframeWidget-Df7vTYZj-9aeaf295370b58030c56.js} +1 -1
  30. data/tools/cmdtlmserver/{ImageLoader-C-CIL4YD-5c9f041325968056ecee.js → ImageLoader-DpKY46fX-d37df4bf688051c6e62b.js} +1 -1
  31. data/tools/cmdtlmserver/{ImageviewerWidget-DhuQH5Io-3ffa4eba2d5ec7fab561.js → ImageviewerWidget-wHbhv08x-c35a4a41bc8347fa46be.js} +1 -1
  32. data/tools/cmdtlmserver/InterfaceFlowChart-9c58deee6e517473f8c4.js +27 -0
  33. data/tools/cmdtlmserver/{InterfacesTab-c4826fb489e9ede4a629.js → InterfacesTab-985faadca6eef712e593.js} +1 -1
  34. data/tools/cmdtlmserver/{LabelWidget-SO9zqcNN-ad11c9cf1f60a49a2e18.js → LabelWidget-BehwzOCR-47adc21706d0e6825f5b.js} +1 -1
  35. data/tools/cmdtlmserver/LabelledWidget-DJKR8ikj-ac6dcacfa7568ee8041f.js +1 -0
  36. data/tools/cmdtlmserver/LabelprogressbarWidget-D4Qzq894-ccf7a29fdf6d3a96a8f2.js +1 -0
  37. data/tools/cmdtlmserver/LabelsparklineWidget-CwCOklZG-8c7ccc992e75f0f32be6.js +1 -0
  38. data/tools/cmdtlmserver/{LabelvalueWidget-B6BbNFnk-841a2d1e10f7ed6c758b.js → LabelvalueWidget-DW8Q7BTX-24a2c366e17b2a0d986a.js} +1 -1
  39. data/tools/cmdtlmserver/{LabelvaluedescWidget-CxfL-H9C-8070d7b77c88031486ce.js → LabelvaluedescWidget-DgNX7tK2-32ed7f56c071646d6021.js} +1 -1
  40. data/tools/cmdtlmserver/{LabelvaluelimitsbarWidget-BT5k9mHv-5ae949fa461b8d83a90b.js → LabelvaluelimitsbarWidget-DAEBW0hU-4a2f141d335fc2396b7e.js} +1 -1
  41. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-Dok-of6n-fb3408cc4e10ea11a8ba.js +1 -0
  42. data/tools/cmdtlmserver/{LabelvaluerangebarWidget-DexAc2UB-93c700592d4adb69c24f.js → LabelvaluerangebarWidget-CQ0xCUFU-ba4525c34b19d1673724.js} +1 -1
  43. data/tools/cmdtlmserver/{Layout-Dd6dRf3R-5d9525589ebd67d04af3.js → Layout-CrCMUbtG-8ba11f2f51ce35865950.js} +1 -1
  44. data/tools/cmdtlmserver/{LedWidget-D1RwHb_V-e70a453d62de53fc4cc4.js → LedWidget-DzQNEDF7-1a86f7864c026403ffce.js} +1 -1
  45. data/tools/cmdtlmserver/{LimitsbarWidget-ClOmoV50-32e4687296483925ef45.js → LimitsbarWidget-zkoAz9SQ-4b557968f197282b5c2e.js} +1 -1
  46. data/tools/cmdtlmserver/{LimitscolorWidget-CBUoEYKp-2eda2f669a46488e8a70.js → LimitscolorWidget-dez316Rk-622833252ce09add096f.js} +1 -1
  47. data/tools/cmdtlmserver/{LimitscolumnWidget-hsHkmY-_-dfe985da8cb1e4fb8f44.js → LimitscolumnWidget-D-IPNDVg-d4c4ba78f86930d43613.js} +1 -1
  48. data/tools/cmdtlmserver/LinegraphWidget-CicnZgjt-950c059e71af09179822.js +1 -0
  49. data/tools/cmdtlmserver/{MatrixbycolumnsWidget-CsogVU9c-10fd32777925d9442a96.js → MatrixbycolumnsWidget-D3qN6GTr-9b3e1323688e8d2250c7.js} +1 -1
  50. data/tools/cmdtlmserver/{ProgressbarWidget-CO6CEkxP-c039479ecf62eded7ca5.js → ProgressbarWidget-CLilcPBe-94014008fbae23a95f6d.js} +1 -1
  51. data/tools/cmdtlmserver/{RadiobuttonWidget-DrxUclws-bf048676c97fbc5f15f9.js → RadiobuttonWidget-Dsy01RJ--82e43666d0c6f0045450.js} +1 -1
  52. data/tools/cmdtlmserver/RadiogroupWidget-BNcVGNj1-fab29deaa5fa4eaa585d.js +1 -0
  53. data/tools/cmdtlmserver/{RangebarWidget-5uQTfLMP-fbf20be901d74457c1e3.js → RangebarWidget-DhcoIdNf-3f0956ef2273c2185b69.js} +1 -1
  54. data/tools/cmdtlmserver/{RawBuffer-297eb45db5fd466515cf.js → RawBuffer-ac6de873d5cea7850d06.js} +1 -1
  55. data/tools/cmdtlmserver/{RawDialog-4bd995f9b817bead62bc.js → RawDialog-86087d6f8e22b8945b6d.js} +1 -1
  56. data/tools/cmdtlmserver/{RollupWidget-B0DCULnu-c1c8709da1baf6ebd6ee.js → RollupWidget-BypuPvE7-52117c9be621dbc973e9.js} +1 -1
  57. data/tools/cmdtlmserver/{RoutersTab-5b98f50d4e2f63f9dd35.js → RoutersTab-3486e9bb3f7831f1e280.js} +1 -1
  58. data/tools/cmdtlmserver/{ScrollwindowWidget-BOkZQgtf-e6cc33bc849eb8d7bd65.js → ScrollwindowWidget-DNQgHoNO-618d56cd3f6bc6014130.js} +1 -1
  59. data/tools/cmdtlmserver/{SignalWidget-Cis0Xkea-d93e29d8a24c7fa83262.js → SignalWidget-BHwyScCG-aeaa41671901e05a8989.js} +1 -1
  60. data/tools/cmdtlmserver/{SpacerWidget-CLcqC2Qk-5a2784ed86deeb186b04.js → SpacerWidget-CFxXXTm7-20089e05c6aacecc0f18.js} +1 -1
  61. data/tools/cmdtlmserver/{SparklineWidget-CTp83eZ--d8923fe24ad5454672ea.js → SparklineWidget-C0lRpRrp-43729970d1edf3af29bf.js} +1 -1
  62. data/tools/cmdtlmserver/{StatusTab-f0d97741c9b81165be4d.js → StatusTab-ae9620bb09c9b607daa7.js} +1 -1
  63. data/tools/cmdtlmserver/{TabbookWidget-uucd-zsX-9ca00b138ad0410a395d.js → TabbookWidget-CeeBOYOt-2c790812db8c1ef31168.js} +1 -1
  64. data/tools/cmdtlmserver/{TargetsTab-e73932f8e410c019a7fb.js → TargetsTab-3d3aae0beab7206bd1de.js} +1 -1
  65. data/tools/cmdtlmserver/TextboxWidget-DoA2b3YU-f1b61ed60a5afc248ebc.js +1 -0
  66. data/tools/cmdtlmserver/TextfieldWidget-Dj4DV74o-48e1ba9820260a3e2e47.js +1 -0
  67. data/tools/cmdtlmserver/{TimeWidget-CPNVZaUM-5c584984fa282cb34f7d.js → TimeWidget-DAQDQ0UM-7bdfef740de9e2ada41f.js} +1 -1
  68. data/tools/cmdtlmserver/TitleWidget-Ct0JlY9s-c24fc13063982ef30e20.js +1 -0
  69. data/tools/cmdtlmserver/{TlmPacketsTab-e3cc489a1a75be3ad163.js → TlmPacketsTab-809c372993d7ba2d68ba.js} +1 -1
  70. data/tools/cmdtlmserver/{Updater-837ca86e536f4a3bdfa3.js → Updater-553d513753f29e3810f3.js} +1 -1
  71. data/tools/cmdtlmserver/{VWidget-DQGJRgAk-5116c4895c75eb64bc95.js → VWidget-A802LGvR-ac28cc03daf8d86d0a13.js} +1 -1
  72. data/tools/cmdtlmserver/{ValueWidget-Bk1RFjks-bafe9d75ed0ad230977c.js → ValueWidget-QaBYsiZz-882368d57808716f6de0.js} +1 -1
  73. data/tools/cmdtlmserver/ValuelimitsbarWidget-CFToRM7w-3fa1f5ff41c95e3035ef.js +1 -0
  74. data/tools/cmdtlmserver/ValuelimitscolumnWidget-BG7naMYx-ae729c50c05933a5e4a8.js +1 -0
  75. data/tools/cmdtlmserver/{ValuerangebarWidget-CcQw_XK9-cf89ccb88ad449e8cbae.js → ValuerangebarWidget-CChK2Lmm-8b6741981136504f3321.js} +1 -1
  76. data/tools/cmdtlmserver/{VerticalWidget-CNtFQv3R-f4938160b8ca4f6f8e29.js → VerticalWidget-C8iN5DJK-2202053d30d577ff94f6.js} +1 -1
  77. data/tools/cmdtlmserver/{VerticalboxWidget-Yxmz1SnU-e3f9ebb22e5e4d61a3ad.js → VerticalboxWidget-CXwUSWrP-f2515b5fd1433388cb09.js} +1 -1
  78. data/tools/cmdtlmserver/{Widget-LsyjS7ZS-cdba91229220d626542a.js → Widget-Cx1jBJHK-752645b358a0eb44dbb9.js} +1 -1
  79. data/tools/cmdtlmserver/main-851cb6e931fb7e4e1ea8.js +1505 -0
  80. data/tools/cmdtlmserver/main.js +1 -1
  81. data/tools/cmdtlmserver/services-fb7b2ae749c6cb1388eb.js +7 -0
  82. metadata +80 -80
  83. data/tools/cmdtlmserver/ArrayWidget-DLfNWDzN-668cf74ee813dc5f8b4e.js +0 -2
  84. data/tools/cmdtlmserver/BlockWidget-BmHSFvOq-7972fe8dc7ee035e8bc5.js +0 -2
  85. data/tools/cmdtlmserver/CanvaslineWidget-gRvm_-TT-3f553128be52acccf4b4.js +0 -1
  86. data/tools/cmdtlmserver/CheckbuttonWidget-BOabI_jE-7719358d066394c0e656.js +0 -1
  87. data/tools/cmdtlmserver/Graph-BliBYJxD-4840ff23f489551cb5c6.js +0 -1
  88. data/tools/cmdtlmserver/HorizontallineWidget-DgpOPA7q-4d2f373e68599c0b3c9a.js +0 -1
  89. data/tools/cmdtlmserver/InterfaceFlowChart-cf8e7ac29846b6274daf.js +0 -27
  90. data/tools/cmdtlmserver/LabelledWidget-DWoM5AJ5-5be5b0fc4b1d554cd2c9.js +0 -1
  91. data/tools/cmdtlmserver/LabelprogressbarWidget-D3vnkvQZ-ecdff8119d3acede9267.js +0 -1
  92. data/tools/cmdtlmserver/LabelsparklineWidget-DO0T-Jot-1037dec1f749b07920ed.js +0 -1
  93. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-DUbmxh4p-83f93e14d0e7f5d6567d.js +0 -1
  94. data/tools/cmdtlmserver/LinegraphWidget-CXrKtxOo-b32b5ac365e8b55b70b1.js +0 -1
  95. data/tools/cmdtlmserver/RadiogroupWidget-DN9C38cg-d3e6f1038a6500acab63.js +0 -1
  96. data/tools/cmdtlmserver/TextboxWidget-C2n38ti5-c9817307d1c09190a5a7.js +0 -1
  97. data/tools/cmdtlmserver/TextfieldWidget--HTv9ddk-68f02460d9d011823773.js +0 -1
  98. data/tools/cmdtlmserver/TitleWidget-Cp0cb6V8-f81d2e0d0b8018f28841.js +0 -1
  99. data/tools/cmdtlmserver/ValuelimitsbarWidget-C0HIBYh2-f90d82733623ccfbbb25.js +0 -1
  100. data/tools/cmdtlmserver/ValuelimitscolumnWidget-BTT90uyX-9f2d92c01237bf9eac93.js +0 -1
  101. data/tools/cmdtlmserver/main-65cfe3c3762daf491069.js +0 -1505
  102. data/tools/cmdtlmserver/services-eb1403f6c88517815ca2.js +0 -7
@@ -1,7 +0,0 @@
1
- System.register([],function(Ae,Ks){"use strict";return{execute:function(){var rn=Object.defineProperty,sn=(t,e,n)=>e in t?rn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ue=(t,e,n)=>sn(t,typeof e!="symbol"?e+"":e,n);function Ge(t,e){return function(){return t.apply(e,arguments)}}const{toString:on}=Object.prototype,{getPrototypeOf:Ce}=Object,{iterator:he,toStringTag:Qe}=Symbol,de=(t=>e=>{const n=on.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),N=t=>(t=t.toLowerCase(),e=>de(e)===t),fe=t=>e=>typeof e===t,{isArray:V}=Array,K=fe("undefined");function te(t){return t!==null&&!K(t)&&t.constructor!==null&&!K(t.constructor)&&C(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ye=N("ArrayBuffer");function cn(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ye(t.buffer),e}const an=fe("string"),C=fe("function"),Ze=fe("number"),ne=t=>t!==null&&typeof t=="object",ln=t=>t===!0||t===!1,pe=t=>{if(de(t)!=="object")return!1;const e=Ce(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Qe in t)&&!(he in t)},un=t=>{if(!ne(t)||te(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},hn=N("Date"),dn=N("File"),fn=N("Blob"),pn=N("FileList"),gn=t=>ne(t)&&C(t.pipe),mn=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||C(t.append)&&((e=de(t))==="formdata"||e==="object"&&C(t.toString)&&t.toString()==="[object FormData]"))},bn=N("URLSearchParams"),[_n,yn,wn,vn]=["ReadableStream","Request","Response","Headers"].map(N),Sn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function re(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),V(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(te(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let c;for(r=0;r<o;r++)c=i[r],e.call(null,t[c],c,t)}}function et(t,e){if(te(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const B=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,tt=t=>!K(t)&&t!==B;function Te(){const{caseless:t,skipUndefined:e}=tt(this)&&this||{},n={},r=(s,i)=>{const o=t&&et(n,i)||i;pe(n[o])&&pe(s)?n[o]=Te(n[o],s):pe(s)?n[o]=Te({},s):V(s)?n[o]=s.slice():(!e||!K(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&re(arguments[s],r);return n}const En=(t,e,n,{allOwnKeys:r}={})=>(re(e,(s,i)=>{n&&C(s)?t[i]=Ge(s,n):t[i]=s},{allOwnKeys:r}),t),xn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),On=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Rn=(t,e,n,r)=>{let s,i,o;const c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!r||r(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=n!==!1&&Ce(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},An=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Cn=t=>{if(!t)return null;if(V(t))return t;let e=t.length;if(!Ze(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Tn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ce(Uint8Array)),kn=(t,e)=>{const n=(t&&t[he]).call(t);let r;for(;(r=n.next())&&!r.done;){const s=r.value;e.call(t,s[0],s[1])}},jn=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Pn=N("HTMLFormElement"),In=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,r){return n.toUpperCase()+r}),nt=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Nn=N("RegExp"),rt=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};re(n,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(r[i]=o||s)}),Object.defineProperties(t,r)},Ln=t=>{rt(t,(e,n)=>{if(C(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(C(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Un=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return V(t)?r(t):r(String(t).split(e)),n},Fn=()=>{},$n=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function qn(t){return!!(t&&C(t.append)&&t[Qe]==="FormData"&&t[he])}const Dn=t=>{const e=new Array(10),n=(r,s)=>{if(ne(r)){if(e.indexOf(r)>=0)return;if(te(r))return r;if(!("toJSON"in r)){e[s]=r;const i=V(r)?[]:{};return re(r,(o,c)=>{const l=n(o,s+1);!K(l)&&(i[c]=l)}),e[s]=void 0,i}}return r};return n(t,0)},Bn=N("AsyncFunction"),Mn=t=>t&&(ne(t)||C(t))&&C(t.then)&&C(t.catch),st=((t,e)=>t?setImmediate:e?((n,r)=>(B.addEventListener("message",({source:s,data:i})=>{s===B&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),B.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",C(B.postMessage)),zn=typeof queueMicrotask<"u"?queueMicrotask.bind(B):typeof process<"u"&&process.nextTick||st,Hn=t=>t!=null&&C(t[he]),a={isArray:V,isArrayBuffer:Ye,isBuffer:te,isFormData:mn,isArrayBufferView:cn,isString:an,isNumber:Ze,isBoolean:ln,isObject:ne,isPlainObject:pe,isEmptyObject:un,isReadableStream:_n,isRequest:yn,isResponse:wn,isHeaders:vn,isUndefined:K,isDate:hn,isFile:dn,isBlob:fn,isRegExp:Nn,isFunction:C,isStream:gn,isURLSearchParams:bn,isTypedArray:Tn,isFileList:pn,forEach:re,merge:Te,extend:En,trim:Sn,stripBOM:xn,inherits:On,toFlatObject:Rn,kindOf:de,kindOfTest:N,endsWith:An,toArray:Cn,forEachEntry:kn,matchAll:jn,isHTMLForm:Pn,hasOwnProperty:nt,hasOwnProp:nt,reduceDescriptors:rt,freezeMethods:Ln,toObjectSet:Un,toCamelCase:In,noop:Fn,toFiniteNumber:$n,findKey:et,global:B,isContextDefined:tt,isSpecCompliantForm:qn,toJSONObject:Dn,isAsyncFn:Bn,isThenable:Mn,setImmediate:st,asap:zn,isIterable:Hn};function _(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(_,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const it=_.prototype,ot={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{ot[t]={value:t}}),Object.defineProperties(_,ot),Object.defineProperty(it,"isAxiosError",{value:!0}),_.from=(t,e,n,r,s,i)=>{const o=Object.create(it);a.toFlatObject(t,o,function(u){return u!==Error.prototype},u=>u!=="isAxiosError");const c=t&&t.message?t.message:"Error",l=e==null&&t?t.code:e;return _.call(o,c,l,n,r,s),t&&o.cause==null&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",i&&Object.assign(o,i),o};const Wn=null;function ke(t){return a.isPlainObject(t)||a.isArray(t)}function ct(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function at(t,e,n){return t?t.concat(e).map(function(r,s){return r=ct(r),!n&&s?"["+r+"]":r}).join(n?".":""):e}function Jn(t){return a.isArray(t)&&!t.some(ke)}const Vn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ge(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,p){return!a.isUndefined(p[f])});const r=n.metaTokens,s=n.visitor||u,i=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(a.isBoolean(f))return f.toString();if(!c&&a.isBlob(f))throw new _("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?c&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function u(f,p,d){let v=f;if(f&&!d&&typeof f=="object"){if(a.endsWith(p,"{}"))p=r?p:p.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&Jn(f)||(a.isFileList(f)||a.endsWith(p,"[]"))&&(v=a.toArray(f)))return p=ct(p),v.forEach(function(S,w){!(a.isUndefined(S)||S===null)&&e.append(o===!0?at([p],w,i):o===null?p:p+"[]",l(S))}),!1}return ke(f)?!0:(e.append(at(d,p,i),l(f)),!1)}const h=[],g=Object.assign(Vn,{defaultVisitor:u,convertValue:l,isVisitable:ke});function m(f,p){if(!a.isUndefined(f)){if(h.indexOf(f)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(f),a.forEach(f,function(d,v){(!(a.isUndefined(d)||d===null)&&s.call(e,d,a.isString(v)?v.trim():v,p,g))===!0&&m(d,p?p.concat(v):[v])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return m(t),e}function lt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function je(t,e){this._pairs=[],t&&ge(t,this,e)}const ut=je.prototype;ut.append=function(t,e){this._pairs.push([t,e])},ut.toString=function(t){const e=t?function(n){return t.call(this,n,lt)}:lt;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function Kn(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ht(t,e,n){if(!e)return t;const r=n&&n.encode||Kn;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=a.isURLSearchParams(e)?e.toString():new je(e,n).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class dt{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(n){n!==null&&e(n)})}}const ft={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Xn=typeof URLSearchParams<"u"?URLSearchParams:je,Gn=typeof FormData<"u"?FormData:null,Qn=typeof Blob<"u"?Blob:null,Yn={isBrowser:!0,classes:{URLSearchParams:Xn,FormData:Gn,Blob:Qn},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",Ie=typeof navigator=="object"&&navigator||void 0,Zn=Pe&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),er=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",tr=Pe&&window.location.href||"http://localhost",nr=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:Zn,hasStandardBrowserWebWorkerEnv:er,navigator:Ie,origin:tr},Symbol.toStringTag,{value:"Module"})),O={...nr,...Yn};function rr(t,e){return ge(t,new O.classes.URLSearchParams,{visitor:function(n,r,s,i){return O.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function sr(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ir(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],e[i]=t[i];return e}function pt(t){function e(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),l=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,l?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),e(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=ir(s[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const n={};return a.forEachEntry(t,(r,s)=>{e(sr(r),s,n,0)}),n}return null}function or(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const se={transitional:ft,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,s=a.isObject(t);if(s&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return r?JSON.stringify(pt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return rr(t,this.formSerializer).toString();if((i=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return ge(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return s||r?(e.setContentType("application/json",!1),or(t)):t}],transformResponse:[function(t){const e=this.transitional||se.transitional,n=e&&e.forcedJSONParsing,r=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(n&&!this.responseType||r)){const s=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(i){if(s)throw i.name==="SyntaxError"?_.from(i,_.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:O.classes.FormData,Blob:O.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{se.headers[t]={}});const cr=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ar=t=>{const e={};let n,r,s;return t&&t.split(`
2
- `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||e[n]&&cr[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},gt=Symbol("internals");function ie(t){return t&&String(t).trim().toLowerCase()}function me(t){return t===!1||t==null?t:a.isArray(t)?t.map(me):String(t)}function lr(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const ur=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ne(t,e,n,r,s){if(a.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function hr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function dr(t,e){const n=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,o){return this[r].call(this,e,s,i,o)},configurable:!0})})}let T=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function s(o,c,l){const u=ie(c);if(!u)throw new Error("header name must be a non-empty string");const h=a.findKey(r,u);(!h||r[h]===void 0||l===!0||l===void 0&&r[h]!==!1)&&(r[h||c]=me(o))}const i=(o,c)=>a.forEach(o,(l,u)=>s(l,u,c));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(a.isString(t)&&(t=t.trim())&&!ur(t))i(ar(t),e);else if(a.isObject(t)&&a.isIterable(t)){let o={},c,l;for(const u of t){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");o[l=u[0]]=(c=o[l])?a.isArray(c)?[...c,u[1]]:[c,u[1]]:u[1]}i(o,e)}else t!=null&&s(e,t,n);return this}get(t,e){if(t=ie(t),t){const n=a.findKey(this,t);if(n){const r=this[n];if(!e)return r;if(e===!0)return lr(r);if(a.isFunction(e))return e.call(this,r,n);if(a.isRegExp(e))return e.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ie(t),t){const n=a.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||Ne(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let r=!1;function s(i){if(i=ie(i),i){const o=a.findKey(n,i);o&&(!e||Ne(n,n[o],o,e))&&(delete n[o],r=!0)}}return a.isArray(t)?t.forEach(s):s(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const s=e[n];(!t||Ne(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){const e=this,n={};return a.forEach(this,(r,s)=>{const i=a.findKey(n,s);if(i){e[i]=me(r),delete e[s];return}const o=t?hr(s):String(s).trim();o!==s&&delete e[s],e[o]=me(r),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return a.forEach(this,(n,r)=>{n!=null&&n!==!1&&(e[r]=t&&a.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(r=>n.set(r)),n}static accessor(t){const e=(this[gt]=this[gt]={accessors:{}}).accessors,n=this.prototype;function r(s){const i=ie(s);e[i]||(dr(n,s),e[i]=!0)}return a.isArray(t)?t.forEach(r):r(t),this}};T.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(T.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),a.freezeMethods(T);function Le(t,e){const n=this||se,r=e||n,s=T.from(r.headers);let i=r.data;return a.forEach(t,function(o){i=o.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function mt(t){return!!(t&&t.__CANCEL__)}function X(t,e,n){_.call(this,t??"canceled",_.ERR_CANCELED,e,n),this.name="CanceledError"}a.inherits(X,_,{__CANCEL__:!0});function bt(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new _("Request failed with status code "+n.status,[_.ERR_BAD_REQUEST,_.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function fr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function pr(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),u=r[i];o||(o=l),n[s]=c,r[s]=l;let h=i,g=0;for(;h!==s;)g+=n[h++],h=h%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),l-o<e)return;const m=u&&l-u;return m?Math.round(g*1e3/m):void 0}}function gr(t,e){let n=0,r=1e3/e,s,i;const o=(c,l=Date.now())=>{n=l,s=null,i&&(clearTimeout(i),i=null),t(...c)};return[(...c)=>{const l=Date.now(),u=l-n;u>=r?o(c,l):(s=c,i||(i=setTimeout(()=>{i=null,o(s)},r-u)))},()=>s&&o(s)]}const be=(t,e,n=3)=>{let r=0;const s=pr(50,250);return gr(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,l=o-r,u=s(l),h=o<=c;r=o;const g={loaded:o,total:c,progress:c?o/c:void 0,bytes:l,rate:u||void 0,estimated:u&&c&&h?(c-o)/u:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(g)},n)},_t=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},yt=t=>(...e)=>a.asap(()=>t(...e)),mr=O.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,O.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(O.origin),O.navigator&&/(msie|trident)/i.test(O.navigator.userAgent)):()=>!0,br=O.hasStandardBrowserEnv?{write(t,e,n,r,s,i){const o=[t+"="+encodeURIComponent(e)];a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(r)&&o.push("path="+r),a.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function _r(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function yr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function wt(t,e,n){let r=!_r(e);return t&&(r||n==!1)?yr(t,e):e}const vt=t=>t instanceof T?{...t}:t;function M(t,e){e=e||{};const n={};function r(u,h,g,m){return a.isPlainObject(u)&&a.isPlainObject(h)?a.merge.call({caseless:m},u,h):a.isPlainObject(h)?a.merge({},h):a.isArray(h)?h.slice():h}function s(u,h,g,m){if(a.isUndefined(h)){if(!a.isUndefined(u))return r(void 0,u,g,m)}else return r(u,h,g,m)}function i(u,h){if(!a.isUndefined(h))return r(void 0,h)}function o(u,h){if(a.isUndefined(h)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,h)}function c(u,h,g){if(g in e)return r(u,h);if(g in t)return r(void 0,u)}const l={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(u,h,g)=>s(vt(u),vt(h),g,!0)};return a.forEach(Object.keys({...t,...e}),function(u){const h=l[u]||s,g=h(t[u],e[u],u);a.isUndefined(g)&&h!==c||(n[u]=g)}),n}const St=t=>{const e=M({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=e;if(e.headers=o=T.from(o),e.url=ht(wt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(O.hasStandardBrowserEnv||O.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([h,g])=>{u.includes(h.toLowerCase())&&o.set(h,g)})}}if(O.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&mr(e.url))){const l=s&&i&&br.read(i);l&&o.set(s,l)}return e},wr=typeof XMLHttpRequest<"u",vr=wr&&function(t){return new Promise(function(e,n){const r=St(t);let s=r.data;const i=T.from(r.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:l}=r,u,h,g,m,f;function p(){m&&m(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let d=new XMLHttpRequest;d.open(r.method.toUpperCase(),r.url,!0),d.timeout=r.timeout;function v(){if(!d)return;const w=T.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),A={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:w,config:t,request:d};bt(function(j){e(j),p()},function(j){n(j),p()},A),d=null}"onloadend"in d?d.onloadend=v:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(v)},d.onabort=function(){d&&(n(new _("Request aborted",_.ECONNABORTED,t,d)),d=null)},d.onerror=function(w){const A=w&&w.message?w.message:"Network Error",j=new _(A,_.ERR_NETWORK,t,d);j.event=w||null,n(j),d=null},d.ontimeout=function(){let w=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const A=r.transitional||ft;r.timeoutErrorMessage&&(w=r.timeoutErrorMessage),n(new _(w,A.clarifyTimeoutError?_.ETIMEDOUT:_.ECONNABORTED,t,d)),d=null},s===void 0&&i.setContentType(null),"setRequestHeader"in d&&a.forEach(i.toJSON(),function(w,A){d.setRequestHeader(A,w)}),a.isUndefined(r.withCredentials)||(d.withCredentials=!!r.withCredentials),o&&o!=="json"&&(d.responseType=r.responseType),l&&([g,f]=be(l,!0),d.addEventListener("progress",g)),c&&d.upload&&([h,m]=be(c),d.upload.addEventListener("progress",h),d.upload.addEventListener("loadend",m)),(r.cancelToken||r.signal)&&(u=w=>{d&&(n(!w||w.type?new X(null,t,d):w),d.abort(),d=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const S=fr(r.url);if(S&&O.protocols.indexOf(S)===-1){n(new _("Unsupported protocol "+S+":",_.ERR_BAD_REQUEST,t));return}d.send(s||null)})},Sr=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(u){if(!s){s=!0,c();const h=u instanceof Error?u:this.reason;r.abort(h instanceof _?h:new X(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,i(new _(`timeout ${e} of ms exceeded`,_.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),t=null)};t.forEach(u=>u.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>a.asap(c),l}},Er=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},xr=async function*(t,e){for await(const n of Or(t))yield*Er(n,e)},Or=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},Et=(t,e,n,r)=>{const s=xr(t,e);let i=0,o,c=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:h}=await s.next();if(u){c(),l.close();return}let g=h.byteLength;if(n){let m=i+=g;n(m)}l.enqueue(new Uint8Array(h))}catch(u){throw c(u),u}},cancel(l){return c(l),s.return()}},{highWaterMark:2})},xt=64*1024,{isFunction:_e}=a,Ot=(({fetch:t,Request:e,Response:n})=>({fetch:t,Request:e,Response:n}))(a.global),{ReadableStream:Rt,TextEncoder:At}=a.global,Ct=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Rr=t=>{const{fetch:e,Request:n,Response:r}=Object.assign({},Ot,t),s=_e(e),i=_e(n),o=_e(r);if(!s)return!1;const c=s&&_e(Rt),l=s&&(typeof At=="function"?(p=>d=>p.encode(d))(new At):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=i&&c&&Ct(()=>{let p=!1;const d=new n(O.origin,{body:new Rt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!d}),h=o&&c&&Ct(()=>a.isReadableStream(new r("").body)),g={stream:h&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!g[p]&&(g[p]=(d,v)=>{let S=d&&d[p];if(S)return S.call(d);throw new _(`Response type '${p}' is not supported`,_.ERR_NOT_SUPPORT,v)})});const m=async p=>{if(p==null)return 0;if(a.isBlob(p))return p.size;if(a.isSpecCompliantForm(p))return(await new n(O.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(a.isArrayBufferView(p)||a.isArrayBuffer(p))return p.byteLength;if(a.isURLSearchParams(p)&&(p=p+""),a.isString(p))return(await l(p)).byteLength},f=async(p,d)=>a.toFiniteNumber(p.getContentLength())??m(d);return async p=>{let{url:d,method:v,data:S,signal:w,cancelToken:A,timeout:j,onDownloadProgress:$,onUploadProgress:Q,responseType:P,headers:J,withCredentials:U="same-origin",fetchOptions:Y}=St(p);P=P?(P+"").toLowerCase():"text";let R=Sr([w,A&&A.toAbortSignal()],j),I=null;const E=R&&R.unsubscribe&&(()=>{R.unsubscribe()});let b;try{if(Q&&u&&v!=="get"&&v!=="head"&&(b=await f(J,S))!==0){let D=new n(d,{method:"POST",body:S,duplex:"half"}),ee;if(a.isFormData(S)&&(ee=D.headers.get("content-type"))&&J.setContentType(ee),D.body){const[Xe,Re]=_t(b,be(yt(Q)));S=Et(D.body,xt,Xe,Re)}}a.isString(U)||(U=U?"include":"omit");const y=i&&"credentials"in n.prototype,q={...Y,signal:R,method:v.toUpperCase(),headers:J.normalize().toJSON(),body:S,duplex:"half",credentials:y?U:void 0};I=i&&new n(d,q);let k=await(i?e(I,Y):e(d,q));const Z=h&&(P==="stream"||P==="response");if(h&&($||Z&&E)){const D={};["status","statusText","headers"].forEach(tn=>{D[tn]=k[tn]});const ee=a.toFiniteNumber(k.headers.get("content-length")),[Xe,Re]=$&&_t(ee,be(yt($),!0))||[];k=new r(Et(k.body,xt,Xe,()=>{Re&&Re(),E&&E()}),D)}P=P||"text";let Vs=await g[a.findKey(g,P)||"text"](k,p);return!Z&&E&&E(),await new Promise((D,ee)=>{bt(D,ee,{data:Vs,headers:T.from(k.headers),status:k.status,statusText:k.statusText,config:p,request:I})})}catch(y){throw E&&E(),y&&y.name==="TypeError"&&/Load failed|fetch/i.test(y.message)?Object.assign(new _("Network Error",_.ERR_NETWORK,p,I),{cause:y.cause||y}):_.from(y,y&&y.code,p,I)}}},Ar=new Map,Tt=t=>{let e=a.merge.call({skipUndefined:!0},Ot,t?t.env:null);const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let o=i.length,c=o,l,u,h=Ar;for(;c--;)l=i[c],u=h.get(l),u===void 0&&h.set(l,u=c?new Map:Rr(e)),h=u;return u};Tt();const Ue={http:Wn,xhr:vr,fetch:{get:Tt}};a.forEach(Ue,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const kt=t=>`- ${t}`,Cr=t=>a.isFunction(t)||t===null||t===!1,jt={getAdapter:(t,e)=>{t=a.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let o=0;o<n;o++){r=t[o];let c;if(s=r,!Cr(r)&&(s=Ue[(c=String(r)).toLowerCase()],s===void 0))throw new _(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(e))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let c=n?o.length>1?`since :
4
- `+o.map(kt).join(`
5
- `):" "+kt(o[0]):"as no adapter specified";throw new _("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s},adapters:Ue};function Fe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new X(null,t)}function Pt(t){return Fe(t),t.headers=T.from(t.headers),t.data=Le.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),jt.getAdapter(t.adapter||se.adapter,t)(t).then(function(e){return Fe(t),e.data=Le.call(t,t.transformResponse,e),e.headers=T.from(e.headers),e},function(e){return mt(e)||(Fe(t),e&&e.response&&(e.response.data=Le.call(t,t.transformResponse,e.response),e.response.headers=T.from(e.response.headers))),Promise.reject(e)})}const It="1.12.0",ye={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ye[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Nt={};ye.transitional=function(t,e,n){function r(s,i){return"[Axios v"+It+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,o)=>{if(t===!1)throw new _(r(i," has been removed"+(e?" in "+e:"")),_.ERR_DEPRECATED);return e&&!Nt[i]&&(Nt[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,i,o):!0}},ye.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Tr(t,e,n){if(typeof t!="object")throw new _("options must be an object",_.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],o=e[i];if(o){const c=t[i],l=c===void 0||o(c,i,t);if(l!==!0)throw new _("option "+i+" must be "+l,_.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new _("Unknown option "+i,_.ERR_BAD_OPTION)}}const we={assertOptions:Tr,validators:ye},F=we.validators;let z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new dt,response:new dt}}async request(t,e){try{return await this._request(t,e)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
- `+s):n.stack=s}catch{}}throw n}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=M(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:s}=e;n!==void 0&&we.assertOptions(n,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),r!=null&&(a.isFunction(r)?e.paramsSerializer={serialize:r}:we.assertOptions(r,{encode:F.function,serialize:F.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),we.assertOptions(e,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=s&&a.merge(s.common,s[e.method]);s&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete s[f]}),e.headers=T.concat(i,s);const o=[];let c=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(e)===!1||(c=c&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,h=0,g;if(!c){const f=[Pt.bind(this),void 0];for(f.unshift(...o),f.push(...l),g=f.length,u=Promise.resolve(e);h<g;)u=u.then(f[h++],f[h++]);return u}g=o.length;let m=e;for(h=0;h<g;){const f=o[h++],p=o[h++];try{m=f(m)}catch(d){p.call(this,d);break}}try{u=Pt.call(this,m)}catch(f){return Promise.reject(f)}for(h=0,g=l.length;h<g;)u=u.then(l[h++],l[h++]);return u}getUri(t){t=M(this.defaults,t);const e=wt(t.baseURL,t.url,t.allowAbsoluteUrls);return ht(e,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){z.prototype[t]=function(e,n){return this.request(M(n||{},{method:t,url:e,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function e(n){return function(r,s,i){return this.request(M(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}z.prototype[t]=e(),z.prototype[t+"Form"]=e(!0)});let kr=class nn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(s,i,o){r.reason||(r.reason=new X(s,i,o),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new nn(function(n){e=n}),cancel:e}}};function jr(t){return function(e){return t.apply(null,e)}}function Pr(t){return a.isObject(t)&&t.isAxiosError===!0}const $e={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries($e).forEach(([t,e])=>{$e[e]=t});function Lt(t){const e=new z(t),n=Ge(z.prototype.request,e);return a.extend(n,z.prototype,e,{allOwnKeys:!0}),a.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return Lt(M(t,r))},n}const x=Lt(se);x.Axios=z,x.CanceledError=X,x.CancelToken=kr,x.isCancel=mt,x.VERSION=It,x.toFormData=ge,x.AxiosError=_,x.Cancel=x.CanceledError,x.all=function(t){return Promise.all(t)},x.spread=jr,x.isAxiosError=Pr,x.mergeConfig=M,x.AxiosHeaders=T,x.formToJSON=t=>pt(a.isHTMLForm(t)?new FormData(t):t),x.getAdapter=jt.getAdapter,x.HttpStatusCode=$e,x.default=x;const{Axios:Xs,AxiosError:Gs,CanceledError:Qs,isCancel:Ys,CancelToken:Zs,VERSION:ei,all:ti,Cancel:ni,isAxiosError:ri,spread:si,toFormData:ii,AxiosHeaders:oi,HttpStatusCode:ci,formToJSON:ai,getAdapter:li,mergeConfig:ui}=x,qe=x.create({baseURL:location.origin,timeout:6e4,params:{}});qe.interceptors.response.use(t=>t,t=>{var e,n,r,s,i,o,c,l,u,h,g;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(p){p&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let m=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(m+=`${t.response.statusText} `),(r=(n=t.response)==null?void 0:n.config)!=null&&r.data&&(m+=`${t.response.config.data} `),(i=(s=t.response)==null?void 0:s.data)!=null&&i.message?m+=`${t.response.data.message}`:(c=(o=t.response)==null?void 0:o.data)!=null&&c.exception?m+=`${t.response.data.exception}`:(h=(u=(l=t.response)==null?void 0:l.data)==null?void 0:u.error)!=null&&h.message?(t.response.data.error.class&&(m+=`${t.response.data.error.class} `),m+=`${t.response.data.error.message}`):m+=`${(g=t.response)==null?void 0:g.data}`;const{$cosmosNotify:f}=window;throw f&&f.serious({title:"Network error",body:m}),t}else throw t});const ve=async function(t,e,{data:n,params:r={},headers:s,noAuth:i=!1,noScope:o=!1,onUploadProgress:c=!1}={}){if(!i){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}s.Authorization=localStorage.openc3Token}return s.manual=!0,!o&&!r.scope&&(r.scope=window.openc3Scope),qe({method:t,url:e,data:n,params:r,headers:s,onUploadProgress:c})},De={Accept:"application/json"},Ut={...De,"Content-Type":"application/json"},hi=Ae("h",{get:function(t,{params:e,headers:n=De,noScope:r,noAuth:s,onUploadProgress:i}={}){return ve("get",t,{params:e,headers:n,noScope:r,noAuth:s,onUploadProgress:i})},put:function(t,{data:e,params:n,headers:r=Ut,noScope:s,noAuth:i,onUploadProgress:o}={}){return ve("put",t,{data:e,params:n,headers:r,noScope:s,noAuth:i,onUploadProgress:o})},post:function(t,{data:e,params:n,headers:r=Ut,noScope:s,noAuth:i,onUploadProgress:o}={}){return ve("post",t,{data:e,params:n,headers:r,noScope:s,noAuth:i,onUploadProgress:o})},delete:function(t,{params:e,headers:n=De,noScope:r,noAuth:s,onUploadProgress:i}={}){return ve("delete",t,{params:e,headers:n,noScope:r,noAuth:s,onUploadProgress:i})}});let Se=()=>({emit(t,...e){for(let n=this.events[t]||[],r=0,s=n.length;r<s;r++)n[r](...e)},events:{},on(t,e){var n;return((n=this.events)[t]||(n[t]=[])).push(e),()=>{var r;this.events[t]=(r=this.events[t])==null?void 0:r.filter(s=>e!==s)}}});class oe extends Error{constructor(e,n){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=n,this.name="ReasonError"}}class Be extends oe{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class Ir extends oe{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class L extends oe{constructor(e,n){n?super(e,n):super("Disconnected",e),this.name="DisconnectedError"}}class Nr extends L{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Ft(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let n=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${n}`}).join(",")}}`:""}class Lr{constructor(e){this.channel=e,this.listeners=[]}watch(){this.listeners.push(this.channel.on("presence",e=>{if(e.type==="info"){this._state||(this._state=this.stateFromInfo(e));return}this._state&&(e.type==="join"?this._state[e.id]=e.info:e.type==="leave"&&delete this._state[e.id])}))}reset(){delete this._state}dispose(){delete this._info,delete this._state,this.listeners.forEach(e=>e()),this.listeners.length=0}async join(e,n){if(!this._info)return this._info={id:e,info:n},this.channel.perform("$presence:join",this._info)}async leave(){if(!this._info)return;let e=await this.channel.perform("$presence:leave");return delete this._info,e}async info(){return this._state?this._state:(this._promise||(this._promise=this._sync()),await this._promise,this._state)}async _sync(){this.watch();try{let e=await this.channel.perform("$presence:info",{});return this._state=this.stateFromInfo(e),this._state}finally{delete this._promise}}stateFromInfo(e){return e.records.reduce((n,{id:r,info:s})=>(n[r]=s,n),{})}}const H=Symbol("state");class $t{constructor(e={}){this.emitter=Se(),this.params=Object.freeze(e),this.presence=new Lr(this),this.initialConnect=!0,this[H]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Ft({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[H]}attached(e){if(this.receiver){if(this.receiver!==e)throw Error("Already connected to a different receiver");return!1}return this.receiver=e,!0}connecting(){this[H]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[H]="connected";let e=!1;this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:e})):this.emit("connect",{reconnect:!0,restored:e})}restored(){if(this.state==="connected")throw Error("Already connected");this[H]="connected";let e=!0,n=!0;this.initialConnect=!1,this.emit("connect",{reconnect:n,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[H]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[H]="closed",delete this.receiver,this.initialConnect=!0,this.presence.dispose(),this.emit("close",e))}disconnect(){this.state==="idle"||this.state==="closed"||this.receiver.unsubscribe(this)}async perform(e,n){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,n)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(n){let r=this.receiver?this.receiver.logger:null;r&&r.warn("whisper failed: ",n)}}receive(e,n){this.emit("message",e,n)}on(e,n){return this.emitter.on(e,n)}once(e,n){let r=this.emitter.on(e,(...s)=>{r(),n(...s)});return r}emit(e,...n){return this.emitter.emit(e,...n)}ensureSubscribed(){return this.state==="connected"?Promise.resolve():this.state==="closed"?Promise.reject(Error("Channel is unsubscribed")):this.pendingSubscribe()}pendingSubscribe(){return this._pendingSubscribe?this._pendingSubscribe:(this._pendingSubscribe=new Promise((e,n)=>{let r=[()=>delete this._pendingSubscribe];r.push(this.on("connect",()=>{r.forEach(s=>s()),e()})),r.push(this.on("close",s=>{r.forEach(i=>i()),n(s||new oe("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class Ur{constructor(e){this.id=e,this.intent="unsubscribed",this.state="idle",this.channels=[],this.disposed=!1,this._pendings=[]}add(e){this.channels.includes(e)||this.channels.push(e)}remove(e){let n=this.channels.indexOf(e);n>-1&&this.channels.splice(n,1)}notify(e,...n){this.state=e==="restored"?"connected":e,n.length===1?this.channels.forEach(r=>r[e](n[0])):this.channels.forEach(r=>r[e]())}pending(e){this._checkIntent(e);let n=this._pendings[0];return!n||n.intent!==e?Promise.resolve():n.promise}ensureResubscribed(){this.disposed||(this.intent=void 0,this.ensureSubscribed())}ensureSubscribed(){if(this.intent!=="subscribed"){if(this.disposed)throw Error("Subscription is disposed");this.intent="subscribed",!this._mergeWithPending("unsubscribed")&&this.subscriber(this)}}maybeUnsubscribe(){this.disposed||this.intent==="unsubscribed"||this.channels.length>0||(this.intent="unsubscribed",this._mergeWithPending("subscribed"))||this.unsubscriber(this)}async acquire(e){this._checkIntent(e);let n,r={promise:new Promise(i=>{n=i}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(r),1),n(r)},canceled:!1,acquired:!1},s=this._pendingTop;return this._pendings.push(r),s&&await s.promise,this.gvl&&await this.gvl.acquire(r,e),r.acquired=!0,r}close(e){this.disposed=!0,this.intent=void 0,this.notify("closed",e)}_checkIntent(e){if(!(e==="unsubscribed"||e==="subscribed"))throw Error(`Unknown subscription intent: ${e}`)}get _pendingTop(){return this._pendings.length?this._pendings[this._pendings.length-1]:void 0}_mergeWithPending(e){let n=this._pendingTop;return!n||n.acquired||n.intent!==e?!1:(this._pendings.pop(),n.canceled=!0,!0)}}class Fr{constructor(){this.queue=[]}async acquire(e,n){n==="subscribed"&&(this.queue.push(e.promise.then(()=>{this.queue.splice(this.queue.indexOf(e),1)})),this.queue.length>1&&await this.queue[this.queue.length-2])}}class $r{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new Fr),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:n,unsubscribe:r}){let s=this._subscriptions[e]=new Ur(e);return s.remoteId=this._localToRemote[e],s.subscriber=n,s.unsubscriber=r,s.gvl=this.glv,s}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,n){this._localToRemote[e]=n;let r=this.get(e);r&&(r.remoteId=n)}}class qr{constructor(e={}){this.subscriptions=new $r(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,n){this._remoteToLocal[n]=e,this.subscriptions.storeRemoteId(e,n),this.flush(n)}unsubscribe(e){let n=this.subscriptions.get(e);if(!n)return;let r=n.remoteId;r&&delete this._remoteToLocal[r],this.subscriptions.remove(e)}transmit(e,n,r){let s=this._remoteToLocal[e];if(!s){this._pendingMessages.push([e,n,r]);return}let i=this.subscriptions.get(s);i&&i.channels.forEach(o=>{o.receive(n,r)})}notify(e,n,r){let s=this._remoteToLocal[e];if(!s)return;let i=this.subscriptions.get(s);i&&i.channels.forEach(o=>o.emit(n,r))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let n=[];for(let r of this._pendingMessages)r[0]===e?this.transmit(r[0],r[1],r[2]):n.push(r);this._pendingMessages=n}}const qt={debug:0,info:1,warn:2,error:3};class Dt{constructor(e){this.level=e||"warn"}log(e,n,r){qt[e]<qt[this.level]||this.writeLogEntry(e,n,r)}writeLogEntry(){throw Error("Not implemented")}debug(e,n){this.log("debug",e,n)}info(e,n){this.log("info",e,n)}warn(e,n){this.log("warn",e,n)}error(e,n){this.log("error",e,n)}}class ce extends Dt{writeLogEntry(){}}class Dr{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let Br=0;class Bt{constructor(e={}){let{logger:n}=e;this.logger=n||new ce,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,n){let r={channel:e};n&&Object.assign(r,n);let s=Ft(r);if(this.pendingUnsubscriptions[s]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,s),new Promise(c=>{setTimeout(()=>{c(this.subscribe(e,n))},o)})}if(this.pendingSubscriptions[s])return this.logger.warn("subscription is already pending, skipping",s),Promise.reject(Error("Already subscribing"));let i=this.subscribeRetryInterval;return new Promise((o,c)=>{let l=++Br;this.pendingSubscriptions[s]={resolve:o,reject:c,id:l},this.cable.send(this.buildSubscribeRequest(s)),this.maybeRetrySubscribe(l,s,i)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,n,r){setTimeout(()=>{let s=this.pendingSubscriptions[n];s&&s.id===e&&(this.logger.warn(`no subscription ack received in ${r}ms, retrying subscribe`,n),this.cable.send(this.buildSubscribeRequest(n)),this.maybeExpireSubscribe(e,n,r))},r)}maybeExpireSubscribe(e,n,r){setTimeout(()=>{let s=this.pendingSubscriptions[n];s&&s.id===e&&(delete this.pendingSubscriptions[n],s.reject(new Ir(`Haven't received subscription ack in ${r*2}ms for ${n}`)))},r)}unsubscribe(e){return this.cable.send({command:"unsubscribe",identifier:e}),this.pendingUnsubscriptions[e]=!0,setTimeout(()=>{delete this.pendingUnsubscriptions[e]},this.subscribeCooldownInterval),Promise.resolve()}perform(e,n,r){return n==="$whisper"?this.whisper(e,r):(r||(r={}),r.action=n,this.cable.send({command:"message",identifier:e,data:JSON.stringify(r)}),Promise.resolve())}whisper(e,n){return this.cable.send({command:"whisper",identifier:e,data:n}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:n,identifier:r,message:s,reason:i,reconnect:o}=e;if(n==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),n==="welcome"){let c=e.sid;return c&&this.cable.setSessionId(c),this.cable.connected()}if(n==="disconnect"){let c=new L(i);this.reset(c),o===!1?this.cable.closed(c):this.cable.disconnected(c);return}if(n==="confirm_subscription"){let c=this.pendingSubscriptions[r];if(!c){this.logger.error("subscription not found, unsubscribing",{type:n,identifier:r}),this.unsubscribe(r);return}return delete this.pendingSubscriptions[r],c.resolve(r)}if(n==="reject_subscription"){let c=this.pendingSubscriptions[r];return c?(delete this.pendingSubscriptions[r],c.reject(new Be)):this.logger.error("subscription not found",{type:n,identifier:r})}if(s)return{identifier:r,message:s};this.logger.warn(`unknown message type: ${n}`,{message:e})}reset(e){for(let n in this.pendingSubscriptions)this.pendingSubscriptions[n].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const Mt=()=>Date.now()/1e3|0;class Mr extends Bt{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=Mt()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let n in this.pendingPresence)this.pendingPresence[n].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:n,identifier:r,message:s}=e;if(n==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(n==="reject_subscription")return super.receive(e);if(n==="confirm_subscription")return this.subscriptionStreams[r]||(this.subscriptionStreams[r]=new Set),super.receive(e);if(n==="ping")return this.restoreSince&&(this.restoreSince=Mt()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),n==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",r);return}if(n==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",r);return}if(n==="welcome"){if(this.disableSessionRecovery||(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId)),e.restored){let i=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of i)this.cable.send({identifier:o,command:"history",history:this.historyRequestFor(o)}),this.presenceInfo[o]&&this.cable.send({identifier:o,command:"join",presence:this.presenceInfo[o]});return this.cable.restored(i)}return this.cable.connected(this.sessionId)}if(n==="presence"){let i=s.type;if(i==="info"){let o=this.pendingPresence[r];o&&(delete this.pendingPresence[r],o.resolve(s))}else if(i==="error"){let o=this.pendingPresence[r];o&&(delete this.pendingPresence[r],o.reject(new Error("failed to retrieve presence")))}return{type:n,identifier:r,message:s}}if(s){let i=this.trackStreamPosition(r,e.stream_id,e.epoch,e.offset);return{identifier:r,message:s,meta:i}}this.logger.warn(`unknown message type: ${n}`,{message:e})}perform(e,n,r){switch(n){case"$presence:join":return this.join(e,r);case"$presence:leave":return this.leave(e,r);case"$presence:info":return this.presence(e,r)}return super.perform(e,n,r)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let n=super.buildSubscribeRequest(e),r=this.historyRequestFor(e);r&&(n.history=r,this.pendingHistory[e]=!0);let s=this.presenceInfo[e];return s&&(n.presence=s),n}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let n={},r=!1;if(this.subscriptionStreams[e])for(let s of this.subscriptionStreams[e]){let i=this.streamsPositions[s];i&&(r=!0,n[s]=i)}if(!(!r&&!this.restoreSince))return{since:this.restoreSince,streams:n}}trackStreamPosition(e,n,r,s){if(!(!n||!r))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(n),this.streamsPositions[n]={epoch:r,offset:s},{stream:n,epoch:r,offset:s}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,n){return this.presenceInfo[e]=n,this.cable.send({command:"join",identifier:e,presence:n}),Promise.resolve()}async leave(e,n){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:n}),Promise.resolve()}presence(e,n){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((r,s)=>{this.pendingPresence[e]={resolve:r,reject:s},this.cable.send({command:"presence",identifier:e,data:n})})}}class zr extends oe{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class Me extends $t{constructor(e,n){super(n),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}ue(Me,"identifier","__ghost__");const Hr="$pubsub";class ze extends $t{async perform(e,n){if(e.startsWith("$"))return super.perform(e,n);throw Error("not implemented")}}ue(ze,"identifier",Hr);const W=Symbol("state");let Wr=class{constructor({transport:t,protocol:e,encoder:n,logger:r,lazy:s,hubOptions:i,performFailures:o,transportConfigurator:c}){this.emitter=Se(),this.transport=t,this.encoder=n,this.logger=r||new ce,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new qr(i||{}),this[W]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=c,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,s===!1&&this.connect().catch(()=>{})}get state(){return this[W]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[W]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(n){this.handleClose(n)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[W]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new L("recovery_failed"))),this.hub.subscriptions.all().forEach(e=>this._resubscribe(e));let t=!1;this.recovering=!1,this.initialConnect?(this.initialConnect=!1,this.emit("connect",{reconnect:!1,restored:t})):this.emit("connect",{reconnect:!0,restored:t})}restored(t){this.logger.info("connection recovered",{remoteIds:t}),this[W]="connected",this.hub.subscriptions.all().forEach(r=>{t&&r.remoteId&&t.includes(r.remoteId)?r.notify("restored"):(r.notify("disconnected",new L("recovery_failed")),this._resubscribe(r))});let e=!this.initialConnect,n=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:n})}notify(t,e,n){e&&typeof e!="string"&&(n=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:n}):this.emit("info",{type:t,data:n})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new L(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[W]="disconnected",this.recovering=this.protocol.recoverableClosure(t),this.recovering?this.hub.subscriptions.all().forEach(e=>e.notify("connecting")):this.hub.subscriptions.all().forEach(e=>{e.notify("disconnected",t)}),this.protocol.reset(t),this.hub.close(),this.transport.close(),this.emit("disconnect",t))}closed(t){if(this.state==="closed"||this.state==="idle")return;let e;t&&(e=t instanceof L?t:new L(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[W]="closed";let n=e||new L("cable_closed");this.hub.subscriptions.all().forEach(r=>r.notify("disconnected",n)),this.hub.close(),this.protocol.reset(),this.transport.close(),this.initialConnect=!0,this.emit("close",e)}disconnect(){this.closed()}handleIncoming(t){if(this.state==="closed"||this.state==="idle")return;let e=this.encoder.decode(t);if(e===void 0){this.logger.error("failed to decode message",{message:t});return}this.logger.debug("incoming data",e);let n=this.protocol.receive(e);if(n){this.logger.debug("processed incoming message",n);let{type:r,identifier:s,message:i,meta:o}=n;r?this.hub.notify(s,r,i):this.hub.transmit(s,i,o)}}send(t){if(this.state==="closed")throw Error("Cable is closed");let e=this.encoder.encode(t);if(e===void 0){this.logger.error("failed to encode message",{message:t});return}this.logger.debug("outgoing message",t),this.transport.send(e)}keepalive(t){this.emit("keepalive",t)}streamFrom(t){let e=new ze({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new ze({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let n,r;return typeof t=="string"&&(r=t,t=Me),n=r?new t(r,e):new t(e),this.subscribe(n)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let n=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:r=>this._subscribe(r,t.channelId,t.params),unsubscribe:r=>this._unsubscribe(r)});return n.add(t),n.intent==="subscribed"&&n.state==="connected"&&t.connected(),n.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,n){let r=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:r});return}this.logger.debug("acquiring subscribe lock",{identifier:r});let s=await t.acquire("subscribed");if(s.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:r}),s.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:r}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),s.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:r}),s.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:r}),t.notify("connected"),s.release();return}let i={identifier:e,params:n};this.logger.debug("subscribing",i);try{let o=await this.protocol.subscribe(e,n);this.hub.subscribe(r,o),this.logger.debug("subscribed",{...i,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof Be&&this.logger.warn("rejected",i),o instanceof L){this.logger.debug("disconnected during subscription; will retry on connect",i),s.release();return}this.logger.error("failed to subscribe",{error:o,...i})}t.close(o),this.hub.unsubscribe(r)}s.release()}unsubscribe(t){let e=t.identifier,n=this.hub.subscriptions.get(e);if(!n)throw Error(`Subscription not found: ${e}`);n.remove(t),t.closed(),n.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let n=await t.acquire("unsubscribed");if(n.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),n.release();return}if(this.logger.debug("unsubscribe lock has been acquired",{identifier:e}),t.intent!=="unsubscribed"){this.logger.debug("cancel unsubscribe, no longer needed",{identifier:e,intent:t.intent}),n.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),n.release();return}let r=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:r}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),n.release();return}try{await this.protocol.unsubscribe(r),this.logger.debug("unsubscribed remotely",{id:e})}catch(s){s&&(s instanceof L?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:s}):this.logger.error("unsubscribe failed",{id:e,error:s}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",n.release()}async perform(t,e,n){if(this.performFailures==="throw")return this._perform(t,e,n);try{return await this._perform(t,e,n)}catch(r){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:r});return}}async _perform(t,e,n){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new zr;let r=this.hub.subscriptions.get(t);if(!r)throw Error(`Subscription not found: ${t}`);if(await r.pending("subscribed"),r.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let s=r.remoteId,i={id:s,action:e,payload:n};this.logger.debug("perform",i);try{let o=await this.protocol.perform(s,e,n);return o&&this.logger.debug("perform result",{message:o,request:i}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:i}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let n=this.emitter.on(t,(...r)=>{n(),e(...r)});return n}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let n=[()=>delete this._pendingConnect];n.push(this.on("connect",()=>{n.forEach(r=>r()),t()})),n.push(this.on("close",r=>{n.forEach(s=>s()),e(r)})),n.push(this.on("disconnect",r=>{n.forEach(s=>s()),e(r)}))}),this._pendingConnect)}};const Jr={maxMissingPings:2,maxReconnectAttempts:1/0},G=()=>Date.now(),zt=(t,e)=>{e=e||{};let{backoffRate:n,jitterRatio:r,maxInterval:s}=e;return n=n||2,r===void 0&&(r=.5),i=>{let o=t*n**i,c=o*n,l=o+(c-o)*Math.random(),u=2*(Math.random()-.5)*r;return l=l*(1+u),s&&s<l&&(l=s),l}};let Ht=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},Jr,e),this.strategy=e.reconnectStrategy,!this.strategy)throw Error("Reconnect strategy must be provided");this.maxMissingPings=e.maxMissingPings,this.maxReconnectAttempts=e.maxReconnectAttempts,this.logger=e.logger||new ce,this.state="pending_connect",this.attempts=0,this.disconnectedAt=G()}watch(t){this.target=t,this.initListeners()}reconnectNow(){return this.state==="connected"||this.state==="pending_connect"||this.state==="closed"?!1:(this.cancelReconnect(),this.state="pending_connect",this.target.connect().catch(t=>{this.logger.info("Failed at reconnecting: "+t)}),!0)}initListeners(){this.unbind=[],this.unbind.push(this.target.on("connect",()=>{this.attempts=0,this.pingedAt=G(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=G(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=G(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=G()})),this.unbind.push(()=>{this.cancelReconnect(),this.stopPolling()})}dispose(){delete this.target,this.unbind&&this.unbind.forEach(t=>t()),delete this.unbind}startPolling(){this.pollId&&clearTimeout(this.pollId);let t=this.pingInterval+(Math.random()-.5)*this.pingInterval*.5;this.pollId=setTimeout(()=>{this.checkStale(),this.state==="connected"&&this.startPolling()},t)}stopPolling(){this.pollId&&clearTimeout(this.pollId)}checkStale(){let t=G()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new Nr))}scheduleReconnect(){if(this.attempts>=this.maxReconnectAttempts){this.target.close();return}let t=this.strategy(this.attempts);this.attempts++,this.logger.info(`Reconnecting in ${t}ms (${this.attempts} attempt)`),this.state="pending_reconnect",this.reconnnectId=setTimeout(()=>this.reconnectNow(),t)}cancelReconnect(){this.reconnnectId&&(clearTimeout(this.reconnnectId),delete this.reconnnectId)}};class Vr{constructor(e,n={}){this.transports=e,this.transport=null,this.emitter=Se(),this.unbind=[],this.logger=n.logger||new ce}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let n=this.transports[e];try{this.transport=n,this.resetListeners(),this.logger.debug(`Trying to connect via ${n.displayName()}`),await n.open(),this.logger.debug(`Connected via ${n.displayName()}`);return}catch(r){this.logger.debug(`Failed to connect via ${n.displayName()}: ${r.message}`)}}throw this.transport=null,this.resetListeners(),new Error("Couldn't connect via any available transport")}send(e){if(!this.transport)throw new Error("No transport is open");this.transport.send(e)}async close(){if(!this.transport)throw new Error("No transport is open");await this.transport.close(),this.transport=null}setURL(){throw new Error("Not implemented. Set URL for each transport separately")}setParam(e,n){this.transports.forEach(r=>{r.setParam(e,n)})}setToken(e,n){this.transports.forEach(r=>{r.setToken(e,n)})}on(e,n){return this.emitter.on(e,n)}once(e,n){let r=this.emitter.on(e,(...s)=>{r(),n(...s)});return r}get url(){return this.transport?this.transport.url:""}resetListeners(){this.unbind.forEach(e=>e()),this.unbind.length=0,this.transport&&this.unbind.push(this.transport.on("open",()=>{this.emitter.emit("open")}),this.transport.on("data",e=>{this.emitter.emit("data",e)}),this.transport.on("close",e=>{this.emitter.emit("close",e)}),this.transport.on("error",e=>{this.emitter.emit("error",e)}))}}class Kr{constructor(e,n={}){this.url=e;let r=n.websocketImplementation;if(r)this.Impl=r;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Se();let{format:s,subprotocol:i,authStrategy:o}=n;this.format=s||"text",this.connectionOptions=n.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=i}displayName(){return"WebSocket("+this.url+")"}open(){let e=this.subprotocol;return this.authStrategy==="sub-protocol"&&(e=[this.subprotocol,this.authProtocol]),this.connectionOptions?this.ws=new this.Impl(this.url,e,this.connectionOptions):this.ws=new this.Impl(this.url,e),this.ws.binaryType="arraybuffer",this.initListeners(),new Promise((n,r)=>{let s=[];s.push(this.once("open",()=>{s.forEach(i=>i()),n()})),s.push(this.once("close",()=>{s.forEach(i=>i()),r(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,n){let r=new URL(this.url);r.searchParams.set(e,n);let s=`${r.protocol}//${r.host}${r.pathname}?${r.searchParams}`;this.setURL(s)}setToken(e,n="jid"){if(this.authStrategy==="param")this.setParam(n,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let r=`x-${n}`.toLowerCase();r=Object.keys(this.connectionOptions.headers).find(s=>s.toLowerCase()===r)||r,this.connectionOptions.headers[r]=e}else if(this.authStrategy==="sub-protocol")this.authProtocol=`anycable-token.${e}`;else throw new Error("Unknown auth strategy: "+this.authStrategy)}send(e){if(!this.ws||!this.connected)throw Error("WebSocket is not connected");this.ws.send(e)}close(){this.ws?this.onclose():this.connected=!1}on(e,n){return this.emitter.on(e,n)}once(e,n){let r=this.emitter.on(e,(...s)=>{r(),n(...s)});return r}initListeners(){this.ws.onerror=e=>{this.connected&&this.emitter.emit("error",e.error||new Error("WS Error"))},this.ws.onclose=()=>{this.onclose()},this.ws.onmessage=e=>{let n=e.data;this.format==="binary"&&(n=new Uint8Array(n)),this.emitter.emit("data",n)},this.ws.onopen=()=>{this.connected=!0,this.emitter.emit("open")}}onclose(){this.ws.onclose=void 0,this.ws.onmessage=void 0,this.ws.onopen=void 0,this.ws.close(),delete this.ws,this.connected=!1,this.emitter.emit("close")}}const Wt={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Xr(t,e){if(typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),e=e||{},!t&&!e.transport)throw Error("URL or transport must be specified");e=Object.assign({},Wt,e);let{protocol:n,websocketImplementation:r,websocketFormat:s,websocketOptions:i,websocketAuthStrategy:o,fallbacks:c,logLevel:l,logger:u,transport:h,encoder:g,lazy:m,monitor:f,pingInterval:p,reconnectStrategy:d,maxMissingPings:v,maxReconnectAttempts:S,subprotocol:w,tokenRefresher:A,historyTimestamp:j,protocolOptions:$,concurrentSubscribes:Q,performFailures:P,transportConfigurator:J,auth:U}=e;if(u=u||new ce(l),typeof n=="string"){w=w||n;let I=n.substring(0,n.lastIndexOf("-")),E=n.substring(n.lastIndexOf("-")+1);if($=$||{},I==="actioncable-v1")n=new Bt({logger:u,...$});else if(I==="actioncable-v1-ext")n=new Mr({logger:u,historyTimestamp:j,...$});else throw Error(`Protocol is not supported yet: ${n}`);if(E==="json")g=g||new Dr,s=s||"text";else if(E==="msgpack"){if(s="binary",!g)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(E==="protobuf"){if(s=s||"binary",!g)throw Error("Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own")}else throw Error(`Protocol is not supported yet: ${n}`)}if(!n)throw Error("Protocol must be specified");h=h||new Kr(t,{websocketImplementation:r,websocketOptions:i,subprotocol:w,authStrategy:o,format:s}),c&&(h=new Vr([h,...c],{logger:u})),U&&U.token&&h.setToken(U.token,U.param||"jid"),d=d||zt(p),f!==!1&&(f=f||new Ht({pingInterval:p,reconnectStrategy:d,maxMissingPings:v,maxReconnectAttempts:S,logger:u}));let Y={concurrentSubscribes:Q},R=new Wr({protocol:n,transport:h,encoder:g,logger:u,lazy:m,hubOptions:Y,performFailures:P,transportConfigurator:J});return f&&(f.watch(R),R.monitor=f),A&&Gr(R,async()=>{try{await A(h)}catch(I){return u.error("Failed to refresh authentication token: "+I),!1}return R.connect().catch(()=>{}),!0}),R}function Gr(t,e){let n=!1;t.on("connect",()=>n=!1),t.on("close",async r=>{if(r){if(n){t.logger.warn("Token auto-refresh is disabled",r);return}r.reason==="token_expired"&&(n=!0,await e())}})}class Qr{constructor(e){this.channel=e}notify(e,...n){typeof this[e]=="function"&&this[e](...n)}perform(e,n={}){this.channel.perform(e,n)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class Yr extends Me{constructor(e,n,r){super(e,n),this.subscription=new Qr(this),Object.assign(this.subscription,r),this.on("connect",({reconnect:s})=>this.subscription.notify("connected",{reconnected:s})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",s=>this.subscription.notify("received",s)),this.on("close",s=>{s&&s instanceof Be?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Zr{constructor(e){this.cable=e}create(e,n){let r,s;typeof e=="object"?(r=e.channel,delete e.channel,s=e):(r=e,s={});let i=new Yr(r,s,n);return i.subscription.notify("initialized"),this.cable.subscribe(i),i.subscription}findAll(e){return this.cable.hub.channels.filter(n=>n.identifier===e).map(n=>n.subscription)}}class es{constructor(e){this.cable=e,this.subscriptions=new Zr(e)}}class ts extends Dt{writeLogEntry(e,n,r){r?console[e](n,r):console[e](n)}}class ns extends Ht{watch(e){super.watch(e),this.initActivityListeners()}initActivityListeners(){if(typeof document<"u"&&typeof window<"u"&&document.addEventListener&&window.addEventListener){let e=()=>{document.hidden||this.reconnectNow()&&this.logger.debug("Trigger reconnect due to visibility change")},n=s=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:s})},r=()=>this.disconnect(new L("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",n,!1),window.addEventListener("online",n,!1),window.addEventListener("resume",n,!1),window.addEventListener("freeze",r,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",n,!1),window.removeEventListener("online",n,!1),window.removeEventListener("resume",n,!1),window.removeEventListener("freeze",r,!1)})}}disconnect(e){this.state==="disconnected"||this.state==="closed"||(this.logger.info("Disconnecting",{reason:e.message}),this.cancelReconnect(),this.stopPolling(),this.state="pending_disconnect",this.target.disconnected(e))}}const rs=["cable","action-cable"],ss="/cable",Ee=(t,e)=>{for(let n of rs){let r=t.head.querySelector(`meta[name='${n}-${e}']`);if(r)return r.getAttribute("content")}},Jt=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,is=()=>{if(typeof document<"u"&&document.head){let t=Ee(document,"url");if(t)return Jt(t)}return Jt(ss)},os=()=>{if(typeof document<"u"&&document.head){let t=Ee(document,"history-timestamp");if(t)return t|0}},cs=()=>{if(typeof document<"u"&&document.head)return Ee(document,"token")},as=()=>{if(typeof document<"u"&&document.head)return Ee(document,"token-param")};function ls(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||is(),e=e||{},e.historyTimestamp||(e.historyTimestamp=os());let n=cs();if(n){let u=as();e.auth=Object.assign({token:n,param:u},e.auth||{})}e=Object.assign({},Wt,e);let{logLevel:r,logger:s,pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:l}=e;return s=e.logger=e.logger||new ts(r),o=e.reconnectStrategy=e.reconnectStrategy||zt(i),e.monitor!==!1&&(e.monitor=e.monitor||new ns({pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:l,logger:s})),Xr(t,e)}function us(t,e){let n=ls(t,e);return new es(n)}class hs{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,n,r={},s={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(i=>{if(i&&OpenC3Auth.setTokens(),this._cable==null){let o=this._url+"?scope="+encodeURIComponent(n)+"&authorization="+encodeURIComponent(localStorage.openc3Token);o=new URL(o,document.baseURI).href,this._cable=us(o)}return this._cable.subscriptions.create({channel:e,...s},r)})}recordPing(){}}Ae("p",hs);function ae(t){return ds.test(t)}const ds=/^-?[0-9]+$/;function Vt(t){return fs.test(t)}const fs=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Kt(t,e){if(ae(t))return Number.isSafeInteger(Number.parseInt(t,10));const n=Number.parseFloat(t),r=String(n);if(t===r)return!0;const s=Xt(t),i=Xt(r);return!!(s===i||(e==null?void 0:e.approx)===!0&&!ae(t)&&i.length>=14&&s.startsWith(i.substring(0,14)))}let le=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function ps(t){if(Kt(t,{approx:!1}))return;if(ae(t))return le.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?le.underflow:le.truncate_float:le.overflow}function Xt(t){const{start:e,end:n}=gs(t),r=t.substring(e,n),s=r.indexOf(".");return s===-1?r:r.substring(0,s)+r.substring(s+1)}function gs(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let n=t.lastIndexOf("e");for(n===-1&&(n=t.lastIndexOf("E")),n===-1&&(n=t.length);(t[n-1]==="0"||t[n-1]===".")&&n>e;)n--;return{start:e,end:n}}class ms{constructor(e){if(ue(this,"isLosslessNumber",!0),!Vt(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=ps(this.value);if(e===void 0||e===le.truncate_float)return Number.parseFloat(this.value);if(ae(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${Number.parseFloat(this.value)}`)}toString(){return this.value}}function bs(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function _s(t){return new ms(t)}function ys(t,e){return He({"":t},"",t,e)}function He(t,e,n,r){return Array.isArray(n)?r.call(t,e,vs(n,r)):n&&typeof n=="object"&&!bs(n)?r.call(t,e,ws(n,r)):r.call(t,e,n)}function ws(t,e){for(const n of Object.keys(t)){const r=He(t,n,t[n],e);r!==void 0?t[n]=r:delete t[n]}return t}function vs(t,e){for(let n=0;n<t.length;n++)t[n]=He(t,String(n),t[n],e);return t}function Ss(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_s,r=0;const s=c();return p(s),v(),e?ys(s,e):s;function i(){if(t.charCodeAt(r)===Cs){r++,u();const b={};let y=!0;for(;r<t.length&&t.charCodeAt(r)!==Qt;){y?y=!1:(m(),u());const q=r,k=h();if(k===void 0){A();return}u(),f();const Z=c();if(Z===void 0){U();return}Object.prototype.hasOwnProperty.call(b,k)&&!We(Z,b[k])&&j(k,q+1),b[k]=Z}return t.charCodeAt(r)!==Qt&&$(),r++,b}}function o(){if(t.charCodeAt(r)===Ts){r++,u();const b=[];let y=!0;for(;r<t.length&&t.charCodeAt(r)!==Yt;){y?y=!1:m();const q=c();d(q),b.push(q)}return t.charCodeAt(r)!==Yt&&Q(),r++,b}}function c(){u();const b=h()??g()??i()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),b}function l(b,y){if(t.slice(r,r+b.length)===b)return r+=b.length,y}function u(){for(;Es(t.charCodeAt(r));)r++}function h(){if(t.charCodeAt(r)===Je){r++;let b="";for(;r<t.length&&t.charCodeAt(r)!==Je;){if(t.charCodeAt(r)===As){const y=t[r+1],q=Rs[y];q!==void 0?(b+=q,r++):y==="u"?xe(t.charCodeAt(r+2))&&xe(t.charCodeAt(r+3))&&xe(t.charCodeAt(r+4))&&xe(t.charCodeAt(r+5))?(b+=String.fromCharCode(Number.parseInt(t.slice(r+2,r+6),16)),r+=5):Y(r):J(r)}else Os(t.charCodeAt(r))?b+=t[r]:P(t[r]);r++}return w(),r++,b}}function g(){const b=r;if(t.charCodeAt(r)===Zt&&(r++,S(b)),t.charCodeAt(r)===Ve)r++;else if(xs(t.charCodeAt(r)))for(r++;Oe(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===Fs)for(r++,S(b);Oe(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===Ms||t.charCodeAt(r)===Bs)for(r++,(t.charCodeAt(r)===Zt||t.charCodeAt(r)===Ns)&&r++,S(b);Oe(t.charCodeAt(r));)r++;if(r>b)return n(t.slice(b,r))}function m(){if(t.charCodeAt(r)!==Us)throw new SyntaxError(`Comma ',' expected after value ${E()}`);r++}function f(){if(t.charCodeAt(r)!==$s)throw new SyntaxError(`Colon ':' expected after property name ${E()}`);r++}function p(b){if(b===void 0)throw new SyntaxError(`JSON value expected ${E()}`)}function d(b){if(b===void 0)throw new SyntaxError(`Array item expected ${E()}`)}function v(){if(r<t.length)throw new SyntaxError(`Expected end of input ${E()}`)}function S(b){if(!Oe(t.charCodeAt(r))){const y=t.slice(b,r);throw new SyntaxError(`Invalid number '${y}', expecting a digit ${E()}`)}}function w(){if(t.charCodeAt(r)!==Je)throw new SyntaxError(`End of string '"' expected ${E()}`)}function A(){throw new SyntaxError(`Quoted object key expected ${E()}`)}function j(b,y){throw new SyntaxError(`Duplicate key '${b}' encountered at position ${y}`)}function $(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${E()}`)}function Q(){throw new SyntaxError(`Array item or end of array ']' expected ${E()}`)}function P(b){throw new SyntaxError(`Invalid character '${b}' ${R()}`)}function J(b){const y=t.slice(b,b+2);throw new SyntaxError(`Invalid escape character '${y}' ${R()}`)}function U(){throw new SyntaxError(`Object value expected after ':' ${R()}`)}function Y(b){const y=t.slice(b,b+6);throw new SyntaxError(`Invalid unicode character '${y}' ${R()}`)}function R(){return`at position ${r}`}function I(){return r<t.length?`but got '${t[r]}'`:"but reached end of input"}function E(){return`${I()} ${R()}`}}function Es(t){return t===ks||t===js||t===Ps||t===Is}function xe(t){return t>=Ve&&t<=Ke||t>=qs&&t<=zs||t>=Ds&&t<=Hs}function Oe(t){return t>=Ve&&t<=Ke}function xs(t){return t>=Ls&&t<=Ke}function Os(t){return t>=32&&t<=1114111}function We(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>We(n,e[r])):Gt(t)&&Gt(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(n=>We(t[n],e[n])):!1}function Gt(t){return typeof t=="object"&&t!==null}const Rs={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
7
- `,r:"\r",t:" "},As=92,Cs=123,Qt=125,Ts=91,Yt=93,ks=32,js=10,Ps=9,Is=13,Je=34,Ns=43,Zt=45,Ve=48,Ls=49,Ke=57,Us=44,Fs=46,$s=58,qs=65,Ds=97,Bs=69,Ms=101,zs=70,Hs=102;function en(t,e,n,r){return s(t);function s(l,u){if(Array.isArray(r)){const h=r.find(g=>g.test(l));if(h){const g=h.stringify(l);if(typeof g!="string"||!Vt(g))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${g})`);return g}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l!=null&&l.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return i(l);if(l&&typeof l=="object")return o(l)}function i(l,u){if(l.length===0)return"[]";let h="[";for(let g=0;g<l.length;g++){const m=l[g];typeof m<"u"&&typeof m!="function"?h+=s(m):h+="null",g<l.length-1&&(h+=",")}return h+="]",h}function o(l,u){if(typeof l.toJSON=="function")return en(l.toJSON(),e,n,void 0);const h=Array.isArray(e)?e.map(String):Object.keys(l);if(h.length===0)return"{}";let g=!0,m="{";for(const f of h){const p=l[f];if(c(f,p)){g?g=!1:m+=",";const d=JSON.stringify(f);m+=`${d}:`,m+=s(p)}}return m+="}",m}function c(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function Ws(t){return ae(t)&&!Kt(t)?BigInt(t):parseFloat(t)}class Js{constructor(){ue(this,"id",1)}async exec(e,n,r={},s={},i=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return r.scope=window.openc3Scope,s.manual=!0,(await qe.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:n,id:this.id,keyword_params:r},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...s},timeout:i,transformRequest:[(o,c)=>en(o)],transformResponse:[o=>Ss(o,void 0,Ws)]})).data.result}catch(o){let c=new Error;throw o.response?(c.name=o.response.data.error.data.class,c.message=o.response.data.error.data.message,c.object=o.response.data.error):o.request?(c.name="Request error",c.message="Request error, no response received"):c=o,c}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,n,r,s,i){return this.exec("map_target_to_interface",[e,n],{cmd_only:r,tlm_only:s,unmap_old:i})}unmap_target_from_interface(e,n,r,s){return this.exec("unmap_target_from_interface",[e,n],{cmd_only:r,tlm_only:s})}connect_interface(e,...n){return n.length>0?this.exec("connect_interface",[e,...n]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,n,...r){return this.exec("interface_cmd",[e,n,...r])}interface_target_enable(e,n,r=!1,s=!1){return this.exec("interface_target_enable",[e,n],{cmd_only:r,tlm_only:s})}interface_target_disable(e,n,r=!1,s=!1){return this.exec("interface_target_disable",[e,n],{cmd_only:r,tlm_only:s})}interface_details(e){return this.exec("interface_details",[e])}get_all_router_info(){return this.exec("get_all_router_info",[])}map_target_to_router(e,n,r,s,i){return this.exec("map_target_to_router",[e,n],{cmd_only:r,tlm_only:s,unmap_old:i})}unmap_target_from_router(e,n,r,s){return this.exec("unmap_target_from_router",[e,n],{cmd_only:r,tlm_only:s})}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}router_target_enable(e,n,r=!1,s=!1){return this.exec("router_target_enable",[e,n],{cmd_only:r,tlm_only:s})}router_target_disable(e,n,r=!1,s=!1){return this.exec("router_target_disable",[e,n],{cmd_only:r,tlm_only:s})}router_details(e){return this.exec("router_details",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,n,r){return this.exec("get_item",[e,n,r])}get_param(e,n,r){return this.exec("get_param",[e,n,r])}get_parameter(e,n,r){return this.exec("get_param",[e,n,r])}get_limits_sets(){return this.exec("get_limits_sets",[])}get_limits_set(){return this.exec("get_limits_set",[])}set_limits_set(e){return this.exec("set_limits_set",[e])}get_target(e){return this.exec("get_target",[e])}get_target_names(){return this.exec("get_target_names",[])}get_target_list(){return this.exec("get_target_names",[])}get_tlm(e,n){return this.exec("get_tlm",[e,n])}get_telemetry(e,n){return this.exec("get_tlm",[e,n])}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.exec("get_all_tlm",[e])}get_all_tlm_names(e,n=!1){return this.exec("get_all_tlm_names",[e],{hidden:n})}get_all_telemetry_names(e){return this.exec("get_all_tlm_names",[e])}get_all_tlm_item_names(e){return this.exec("get_all_tlm_item_names",[e])}async get_tlm_packet(e,n,r,s=30){const i=await this.exec("get_tlm_packet",[e,n],{type:r,stale_time:s});if(i!=null){let o=i.length,c=null;for(let l=0;l<o;l++)c=this.decode_openc3_type(i[l][1]),c!==null&&(i[l][1]=c)}return i}get_packet_derived_items(e,n){return this.exec("get_packet_derived_items",[e,n])}get_tlm_buffer(e,n){return this.exec("get_tlm_buffer",[e,n])}get_tlm_available(e){return this.exec("get_tlm_available",[e])}async get_tlm_values(e,n=30,r=null,s=null,i=null){let o={stale_time:n};r!==null&&(o.cache_timeout=r),s!==null&&(o.start_time=s.toISOString()),i!==null&&(o.end_time=i.toISOString());const c=await this.exec("get_tlm_values",[e],o,{},1e4);if(c&&c.length>0){let l=c[0].length,u=null;for(let h=0;h<l;h++)u=this.decode_openc3_type(c[0][h]),u!==null&&(c[0][h]=u)}return c}get_limits(e,n,r){return this.exec("get_limits",[e,n,r])}async tlm(e,n,r,s="CONVERTED"){let i=null;if(n===void 0)i=await this.exec("tlm",[e]);else if(r===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(n))i=await this.exec("tlm",[e],{type:n});else{let c=new Error;throw c.name="TypeError",c.message=`Invalid data type ${n}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,c}else i=await this.exec("tlm",[e,n,r],{type:s});let o=this.decode_openc3_type(i);return o!==null&&(i=o),i}async inject_tlm(e,n,r=null,s="CONVERTED"){await this.exec("inject_tlm",[e,n,r],{type:s})}set_tlm(e,n,r,s){return this.exec("set_tlm",[e,n,r],{type:s})}override_tlm(e,n,r,s){return this.exec("override_tlm",[e,n,r],{type:s})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,n,r,s){return this.exec("normalize_tlm",[e,n,r],{type:s})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.exec("get_all_cmds",[e])}get_all_cmd_names(e,n=!1){return this.exec("get_all_cmd_names",[e],{hidden:n})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,n){return this.exec("get_cmd",[e,n])}get_command(e,n){return this.exec("get_cmd",[e,n])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,n,r,s="CONVERTED"){return this.exec("get_cmd_value",[e,n,r,s])}get_cmd_buffer(e,n){return this.exec("get_cmd_buffer",[e,n])}_cmd(e,n,r,s,i,o={}){let c=null;for(let l in s)Object.prototype.hasOwnProperty.call(s,l)&&(c=this.encode_openc3_type(s[l]),c!==null&&(s[l]=c));return this.exec(e,[n,r,s],o,i)}get_cmd_hazardous(e,n,r,s={}){return n===void 0?this.exec("get_cmd_hazardous",e,{},s):this._cmd("get_cmd_hazardous",e,n,r,s)}cmd(e,n,r,s={},i={}){return n===void 0?this.exec("cmd",e,{},s):this._cmd("cmd",e,n,r,s,i)}cmd_no_range_check(e,n,r,s={},i={}){return n===void 0?this.exec("cmd_no_range_check",e,{},s,i):this._cmd("cmd_no_range_check",e,n,r,s,i)}cmd_raw(e,n,r,s={},i={}){return n===void 0?this.exec("cmd_raw",e,{},s,i):this._cmd("cmd_raw",e,n,r,s,i)}cmd_raw_no_range_check(e,n,r,s={},i={}){return n===void 0?this.exec("cmd_raw_no_range_check",e,{},s,i):this._cmd("cmd_raw_no_range_check",e,n,r,s,i)}cmd_no_hazardous_check(e,n,r,s={},i={}){return n===void 0?this.exec("cmd_no_hazardous_check",e,{},s,i):this._cmd("cmd_no_hazardous_check",e,n,r,s,i)}cmd_no_checks(e,n,r,s={},i={}){return n===void 0?this.exec("cmd_no_checks",e,{},s,i):this._cmd("cmd_no_checks",e,n,r,s,i)}cmd_raw_no_hazardous_check(e,n,r,s={},i={}){return n===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},s,i):this._cmd("cmd_raw_no_hazardous_check",e,n,r,s,i)}cmd_raw_no_checks(e,n,r,s={},i={}){return n===void 0?this.exec("cmd_raw_no_checks",e,{},s,i):this._cmd("cmd_raw_no_checks",e,n,r,s,i)}build_cmd(e,n,r,s={},i={}){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,r,s,i)}build_command(e,n,r,s={},i={}){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,r,s,i)}get_interface_names(){return this.exec("get_interface_names",[])}get_router_names(){return this.exec("get_router_names",[])}send_raw(e,n){return this.exec("send_raw",[e,n])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,n){return this.exec("load_config",[e,n])}save_config(e,n,r){return this.exec("save_config",[e,n,r])}delete_config(e,n){return this.exec("delete_config",[e,n])}enable_limits(e,n,r){return this.exec("enable_limits",[e,n,r])}disable_limits(e,n,r){return this.exec("disable_limits",[e,n,r])}get_out_of_limits(){return this.exec("get_out_of_limits",[])}get_overall_limits_state(e){return this.exec("get_overall_limits_state",[e])}list_settings(){return this.exec("list_settings",[])}get_all_settings(){return this.exec("get_all_settings",[])}get_setting(e,n){return this.exec("get_setting",[e],n)}get_settings(e,n){return this.exec("get_settings",e,n)}set_setting(e,n){return this.exec("set_setting",[e,n])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}save_setting(e,n){return this.exec("set_setting",[e,n])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>i.toString(16).padStart(2,"0")).join("")}}}Ae("g",Js)}}});