openc3-cosmos-tool-cmdtlmserver 6.3.0 → 6.4.0

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 (110) hide show
  1. checksums.yaml +4 -4
  2. data/tools/cmdtlmserver/{ArrayWidget-BbsN1dzF-ee2cfc7dad123cfaccf5.js → ArrayWidget-DAZApfkV-f88e557be03eaff0196a.js} +2 -2
  3. data/tools/cmdtlmserver/{ArrayplotWidget-CCKEyYIx-a00019e86008704efc46.js → ArrayplotWidget-BfsxDplv-ba452c09191ab9d2c9eb.js} +1 -1
  4. data/tools/cmdtlmserver/{BarColumn-C6p07yWK-a95a551de7a97b26a986.js → BarColumn-q0nAsvrd-979fd197d5ebe0b26180.js} +1 -1
  5. data/tools/cmdtlmserver/BlockWidget-SDCUWcMQ-bf304a4da8db5487fae4.js +2 -0
  6. data/tools/cmdtlmserver/{ButtonWidget-CtfJzCBR-9a325bb9d73eea161bde.js → ButtonWidget-BVMjwC19-ede0b497a027ec794404.js} +2 -2
  7. data/tools/cmdtlmserver/CanvasWidget-bVkufjRQ-9dcac9d39e370aa10c52.js +1 -0
  8. data/tools/cmdtlmserver/CanvasdotWidget-DpniFfca-f90aa75b137ff18b3798.js +1 -0
  9. data/tools/cmdtlmserver/{CanvasimageWidget-BPlj5QYK-148404626d26f39ae7a4.js → CanvasimageWidget-DHOSz-dJ-5a5ba6522191031db873.js} +1 -1
  10. data/tools/cmdtlmserver/{CanvasimagevalueWidget-DVFGLt8f-228223ab8bc7ab0b61c6.js → CanvasimagevalueWidget-zrURWWUL-74842a2e8e5704161b0c.js} +1 -1
  11. data/tools/cmdtlmserver/CanvaslabelWidget-D-XAMifp-ef701aeff5463ee972a8.js +1 -0
  12. data/tools/cmdtlmserver/{CanvaslabelvalueWidget-B7yIDmsn-725d0c4e2daf6bda08ec.js → CanvaslabelvalueWidget-BsIdBtEb-fb59e3539c9504cab09e.js} +1 -1
  13. data/tools/cmdtlmserver/{CanvaslineWidget-BICdxX0Q-7c180d081ca1a967d997.js → CanvaslineWidget-CA2aPGRg-49781b78cfbb16c58a8c.js} +1 -1
  14. data/tools/cmdtlmserver/{CanvaslinevalueWidget-Cq-Ddh0P-bdf272b782303e2bc8bb.js → CanvaslinevalueWidget-J7epKRlo-edd46a4b0deeef5ae0ed.js} +1 -1
  15. data/tools/cmdtlmserver/CheckbuttonWidget-ByH-PDRG-3155a1e301a42f78cfd7.js +1 -0
  16. data/tools/cmdtlmserver/{CmdPacketsTab-8938018b2c20935a31ff.js → CmdPacketsTab-a7526cd69bdab193ee5c.js} +1 -1
  17. data/tools/cmdtlmserver/{CmdTlmServer-3100bab0f78a7952a5f1.js → CmdTlmServer-309d57f324c500380120.js} +2 -2
  18. data/tools/cmdtlmserver/{ComboboxWidget-CtyKbEWb-7925168021879bcae865.js → ComboboxWidget-Bdm_fMzW-35d26cf71d2c4968d59f.js} +1 -1
  19. data/tools/cmdtlmserver/DateWidget-BaQqthC7-cdd37a33ebab941131bd.js +1 -0
  20. data/tools/cmdtlmserver/{DetailsDialog-DmEC5BTs-ae29c74b5a12a811ab58.js → DetailsDialog-C5jf8o0K-6c95c0f291529e1685c1.js} +1 -1
  21. data/tools/cmdtlmserver/{DynamicWidget-CfMtj7H8-dda9e71246a61119ef51.js → DynamicWidget-CfMtj7H8-2cf72b6eea3dd0c269ee.js} +1 -1
  22. data/tools/cmdtlmserver/FormatvalueWidget--H5B9i_Y-ea7b65d27cda96da7981.js +1 -0
  23. data/tools/cmdtlmserver/Graph-M382Zo8o-85a1f138f1c956abdd93.js +1 -0
  24. data/tools/cmdtlmserver/{GraphWidget-DurWDmpg-1d3f53de02fa1378a1c8.js → GraphWidget-_YOGDD1U-ab62f3ec1ddfc73d8261.js} +1 -1
  25. data/tools/cmdtlmserver/{HorizontalWidget-Cd_wl1b3-b4a1220511cbad208895.js → HorizontalWidget-D_gzrOWs-fdee514a9c5af4e3291e.js} +1 -1
  26. data/tools/cmdtlmserver/HorizontalboxWidget-GDcjO-UB-7c5f8b33fb5940c687c5.js +1 -0
  27. data/tools/cmdtlmserver/HorizontallineWidget-DZvOYFxf-66653528e98b7e7a6854.js +1 -0
  28. data/tools/cmdtlmserver/{IframeWidget-BPerHCCa-89189a6be7985eb8e47b.js → IframeWidget-CuUav9b3-f0fb66709947f9c31faa.js} +1 -1
  29. data/tools/cmdtlmserver/{ImageLoader-4N-7Gj61-e6e724f54c4470cc6855.js → ImageLoader-3KLKJ5mV-6d450caf10714a1c2108.js} +1 -1
  30. data/tools/cmdtlmserver/{ImageviewerWidget-Cw_H_HmZ-79d50f4df25f701d60c0.js → ImageviewerWidget-BMZ6REN4-af83de8358d437aabaaa.js} +1 -1
  31. data/tools/cmdtlmserver/{InterfacesTab-2d486c0457a95cc3e028.js → InterfacesTab-99bb37f3330ba2d25c87.js} +1 -1
  32. data/tools/cmdtlmserver/{LabelWidget-xrmcVeq8-870ee165781b2cf65c51.js → LabelWidget-oh6FIG6s-9270f681e463343ddbc3.js} +1 -1
  33. data/tools/cmdtlmserver/LabelledWidget-Bic36les-ef154fc814c821ffb0f2.js +1 -0
  34. data/tools/cmdtlmserver/LabelprogressbarWidget-CqIiGoDb-84eeed45dde02cb11ba1.js +1 -0
  35. data/tools/cmdtlmserver/LabelsparklineWidget-DLhmqO02-36d951bb7e324fe2527f.js +1 -0
  36. data/tools/cmdtlmserver/{LabelvalueWidget-CQ06wWDK-1796e7cae5e984c98aaf.js → LabelvalueWidget-BefwSSVq-4e84fe0e93bb57974749.js} +1 -1
  37. data/tools/cmdtlmserver/{LabelvaluedescWidget-Bo8zT01X-80efb25b4bedad034d9d.js → LabelvaluedescWidget-NxrCzznm-498585155de94a9d642a.js} +1 -1
  38. data/tools/cmdtlmserver/{LabelvaluelimitsbarWidget-BucTw8Yk-3294f1f5165c95dd609e.js → LabelvaluelimitsbarWidget-pq7qoolL-7fbe95c93b160ed39797.js} +1 -1
  39. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-edkpogsl-4d1dd09c79a5c7f9f634.js +1 -0
  40. data/tools/cmdtlmserver/{LabelvaluerangebarWidget-D8cbfXFM-ed365f14f0ddd33fc1ee.js → LabelvaluerangebarWidget-DpJNv9dh-e87dc2ccc07c6045b227.js} +1 -1
  41. data/tools/cmdtlmserver/{Layout-Tf--nruw-77595e15c57a061b0dba.js → Layout-B0hvhBQO-6d8d3e486762393ef9be.js} +1 -1
  42. data/tools/cmdtlmserver/{LedWidget-qH_FthkK-1cfbae497162dcc3aefa.js → LedWidget--4eSxBnn-849d3f80225bb6ea4279.js} +1 -1
  43. data/tools/cmdtlmserver/LimitsbarWidget-BQaumgRt-b86ec2d9b3c30d9a79e0.js +1 -0
  44. data/tools/cmdtlmserver/{LimitscolorWidget-c6Qa6su7-87921f3fb3e7afc5de79.js → LimitscolorWidget-BBF9sRtF-f1dab8dc05417d5099ae.js} +1 -1
  45. data/tools/cmdtlmserver/{LimitscolumnWidget-CcLs_443-604b2033bbe5db32cec6.js → LimitscolumnWidget-DZZtSoXw-b96074327af0a4eb8f1a.js} +1 -1
  46. data/tools/cmdtlmserver/LinegraphWidget-DTLZmyWs-76dc3e7fb815d8df3c63.js +1 -0
  47. data/tools/cmdtlmserver/MatrixbycolumnsWidget-dpgZz4wR-899f52fcc1cf07680726.js +1 -0
  48. data/tools/cmdtlmserver/{ProgressbarWidget-iYGw8-Dc-ebd0bd2f7dd1a5a808fc.js → ProgressbarWidget-7cYr8136-8a806c19acd9b2256deb.js} +1 -1
  49. data/tools/cmdtlmserver/RadiobuttonWidget-DTfn-7F2-44820ea50a2cf744199c.js +1 -0
  50. data/tools/cmdtlmserver/RadiogroupWidget-DWvTpw94-686f3de581689bdf40ea.js +1 -0
  51. data/tools/cmdtlmserver/{RangebarWidget-D_zGTtCa-8bfd7bef4ad63b9af243.js → RangebarWidget-CG2Y7eYp-c1a4a0e1ba7dc72e4ffc.js} +1 -1
  52. data/tools/cmdtlmserver/RawDialog-9d943e44f3112342601e.js +11 -0
  53. data/tools/cmdtlmserver/{RollupWidget-Dolsixyt-64fd8c2e5990b362afb3.js → RollupWidget-C6HKTfCR-e7ff42b2d6df403e4189.js} +1 -1
  54. data/tools/cmdtlmserver/{RoutersTab-12cdceede3476c777ebf.js → RoutersTab-c8c4095e051bd4eac1a6.js} +1 -1
  55. data/tools/cmdtlmserver/{ScrollwindowWidget-DV2nZuNi-622615ed3b3c3be199a7.js → ScrollwindowWidget-DvhBCYd2-2eda888b5878a3c9c43e.js} +1 -1
  56. data/tools/cmdtlmserver/SignalWidget-BZIoGjam-3f5bffb65296b2b4c9d3.js +1 -0
  57. data/tools/cmdtlmserver/{SpacerWidget-BH0p2OLi-d2bd2a8e1f0b4014a44f.js → SpacerWidget-YBS8RZIE-ea53c28322ecfeaf856a.js} +1 -1
  58. data/tools/cmdtlmserver/{SparklineWidget-coxi9r2g-93d3a65c88c064975334.js → SparklineWidget-BMhY9vYe-da8fa0c3c84c83859f98.js} +1 -1
  59. data/tools/cmdtlmserver/{StatusTab-84eda227fff2c85ad6b1.js → StatusTab-1c14fdf42c5eec6f89a0.js} +1 -1
  60. data/tools/cmdtlmserver/TabbookWidget-RfET19pq-2e5216e9a0e0355fdf93.js +1 -0
  61. data/tools/cmdtlmserver/TargetsTab-4550f57bc831c1f7a7eb.js +1 -0
  62. data/tools/cmdtlmserver/TextboxWidget-M8vFBSxS-ab8e94f59a6caf7ef59e.js +1 -0
  63. data/tools/cmdtlmserver/{TextfieldWidget-C08N4JE8-1068f0ee1d4002e54079.js → TextfieldWidget-Dev7lCsT-57eee147afa6de319acc.js} +1 -1
  64. data/tools/cmdtlmserver/{TimeWidget-DtwdEcFg-5a3bc19e8ab2a1804ae7.js → TimeWidget-CQzn13rQ-33c3d901e2ecc494bc4e.js} +1 -1
  65. data/tools/cmdtlmserver/TitleWidget-C4zbSian-94081f4edd1e63057002.js +1 -0
  66. data/tools/cmdtlmserver/{TlmPacketsTab-e5b98e3e4c15475a7a17.js → TlmPacketsTab-13c5610fdcc6520cc036.js} +1 -1
  67. data/tools/cmdtlmserver/{Updater-30365f17f9b4eb94ca1e.js → Updater-6429d216c3370ebd6673.js} +1 -1
  68. data/tools/cmdtlmserver/{VWidget-DQqb7NVW-4602918435743a49de41.js → VWidget-iASFPjdx-dec42be1780c3b23701d.js} +1 -1
  69. data/tools/cmdtlmserver/ValueWidget-BVI6uUVX-af1a23f95e0403600802.js +1 -0
  70. data/tools/cmdtlmserver/ValuelimitsbarWidget-BiIcery0-6faa39be217cfac99fe0.js +1 -0
  71. data/tools/cmdtlmserver/{ValuelimitscolumnWidget-QvhI6EcE-b0440ffbb0b94727592e.js → ValuelimitscolumnWidget-BiRI8GbI-ac216d8db3d2ba20fde8.js} +1 -1
  72. data/tools/cmdtlmserver/{ValuerangebarWidget-Dt3K9BnC-5a6ec326052278b4ed3d.js → ValuerangebarWidget-CtMFQu9--e26b11738302a6d54bdb.js} +1 -1
  73. data/tools/cmdtlmserver/{VerticalWidget-BIIViZgI-3d41ce14c58d12499a92.js → VerticalWidget-CRmcpQBn-9df168a6eea1affbbf4b.js} +1 -1
  74. data/tools/cmdtlmserver/VerticalboxWidget-C-qChjug-183c16ebf187f5b009d8.js +1 -0
  75. data/tools/cmdtlmserver/Widget-CFEnOKms-581f43b2be218bd79d7d.js +1 -0
  76. data/tools/cmdtlmserver/main-798cf58cd430cfe7259b.js +1503 -0
  77. data/tools/cmdtlmserver/main.js +1 -1
  78. data/tools/cmdtlmserver/services-389a1aae83969a37ebbc.js +7 -0
  79. metadata +78 -78
  80. data/tools/cmdtlmserver/BlockWidget-DlCHbqZX-c390667024b5d4780d6b.js +0 -2
  81. data/tools/cmdtlmserver/CanvasWidget-CqRlXc4r-fecb24efdf6f68a33ad2.js +0 -1
  82. data/tools/cmdtlmserver/CanvasdotWidget--Xr_KsZs-840bf70c26d7888f4d66.js +0 -1
  83. data/tools/cmdtlmserver/CanvaslabelWidget-CYNqmyP0-c9c9beb56e22552527cb.js +0 -1
  84. data/tools/cmdtlmserver/CheckbuttonWidget-B74AWeaW-de22da2f691ae5858bbf.js +0 -1
  85. data/tools/cmdtlmserver/DateWidget-BEVSczU8-95d14f0b9ce5fc0b69a3.js +0 -1
  86. data/tools/cmdtlmserver/FormatvalueWidget-DN12xymS-312eedcf339bb3a361e8.js +0 -1
  87. data/tools/cmdtlmserver/Graph-Bgo0cjl3-34cca1d79d056287c70c.js +0 -1
  88. data/tools/cmdtlmserver/HorizontalboxWidget-BcMTFBU--ebe35d30ef1038d848e8.js +0 -1
  89. data/tools/cmdtlmserver/HorizontallineWidget-CXFqHclf-fa0e898fc84d1495ab9f.js +0 -1
  90. data/tools/cmdtlmserver/LabelledWidget-D48QoyMk-8ef3423e6396375a66e4.js +0 -1
  91. data/tools/cmdtlmserver/LabelprogressbarWidget-C_950t6g-2936a8a5b4b14474e12e.js +0 -1
  92. data/tools/cmdtlmserver/LabelsparklineWidget-0KXQyPoU-da36e09f571b80924e16.js +0 -1
  93. data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-Dflb1hNd-a115105dee00eafa5323.js +0 -1
  94. data/tools/cmdtlmserver/LimitsbarWidget-B9lAB2RD-ba9cf8359583cfe6eeb1.js +0 -1
  95. data/tools/cmdtlmserver/LinegraphWidget-BSVYLFo1-e8a98958fba9fb2e2fb9.js +0 -1
  96. data/tools/cmdtlmserver/MatrixbycolumnsWidget-DXFpZTre-67f734ae3f31f19eb2a0.js +0 -1
  97. data/tools/cmdtlmserver/RadiobuttonWidget-ytmoVZ3u-3a28b6b2ee47bb71a55d.js +0 -1
  98. data/tools/cmdtlmserver/RadiogroupWidget-CusMBhKH-2ab564c7e2c5bd9ce708.js +0 -1
  99. data/tools/cmdtlmserver/RawDialog-9d64be002d16366306d0.js +0 -11
  100. data/tools/cmdtlmserver/SignalWidget-d9-6h85k-6fb4be9567110de7f7f2.js +0 -1
  101. data/tools/cmdtlmserver/TabbookWidget-B1XKplGH-e22ec8d6a5c838c7c5fd.js +0 -1
  102. data/tools/cmdtlmserver/TargetsTab-e4763d63ea20379aa310.js +0 -1
  103. data/tools/cmdtlmserver/TextboxWidget-C-_M2M4l-e87fb9cd37972bf5d25b.js +0 -1
  104. data/tools/cmdtlmserver/TitleWidget-CT-aLcNb-f05601921aa733b9911e.js +0 -1
  105. data/tools/cmdtlmserver/ValueWidget-C6RanBj3-1821aa6088bd82d581f4.js +0 -1
  106. data/tools/cmdtlmserver/ValuelimitsbarWidget-B3bvjfxc-4f2349bfcb30c31119c1.js +0 -1
  107. data/tools/cmdtlmserver/VerticalboxWidget-DY72fLHW-f459428e4aed8df3e9d9.js +0 -1
  108. data/tools/cmdtlmserver/Widget-oyqWpFXJ-18d727bbb6fbb5d9c2da.js +0 -1
  109. data/tools/cmdtlmserver/main-3edbee545cea57a5f76d.js +0 -1499
  110. data/tools/cmdtlmserver/services-61aec8b87d81fdbc4b64.js +0 -7
@@ -1,7 +0,0 @@
1
- System.register([],function(we,zs){"use strict";return{execute:function(){var Kt=Object.defineProperty,Xt=(t,e,n)=>e in t?Kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,re=(t,e,n)=>Xt(t,typeof e!="symbol"?e+"":e,n);function He(t,e){return function(){return t.apply(e,arguments)}}const{toString:Gt}=Object.prototype,{getPrototypeOf:ve}=Object,se=(t=>e=>{const n=Gt.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),k=t=>(t=t.toLowerCase(),e=>se(e)===t),ie=t=>e=>typeof e===t,{isArray:W}=Array,X=ie("undefined");function Qt(t){return t!==null&&!X(t)&&t.constructor!==null&&!X(t.constructor)&&C(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ve=k("ArrayBuffer");function Yt(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ve(t.buffer),e}const Zt=ie("string"),C=ie("function"),Ke=ie("number"),oe=t=>t!==null&&typeof t=="object",en=t=>t===!0||t===!1,ce=t=>{if(se(t)!=="object")return!1;const e=ve(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},tn=k("Date"),nn=k("File"),rn=k("Blob"),sn=k("FileList"),on=t=>oe(t)&&C(t.pipe),cn=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||C(t.append)&&((e=se(t))==="formdata"||e==="object"&&C(t.toString)&&t.toString()==="[object FormData]"))},an=k("URLSearchParams"),[ln,un,hn,dn]=["ReadableStream","Request","Response","Headers"].map(k),fn=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function G(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),W(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{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 Xe(t,e){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 $=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ge=t=>!X(t)&&t!==$;function Se(){const{caseless:t}=Ge(this)&&this||{},e={},n=(r,s)=>{const i=t&&Xe(e,s)||s;ce(e[i])&&ce(r)?e[i]=Se(e[i],r):ce(r)?e[i]=Se({},r):W(r)?e[i]=r.slice():e[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&G(arguments[r],n);return e}const pn=(t,e,n,{allOwnKeys:r}={})=>(G(e,(s,i)=>{n&&C(s)?t[i]=He(s,n):t[i]=s},{allOwnKeys:r}),t),gn=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),mn=(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)},bn=(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&&ve(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},yn=(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},_n=t=>{if(!t)return null;if(W(t))return t;let e=t.length;if(!Ke(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},wn=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ve(Uint8Array)),vn=(t,e)=>{const n=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=n.next())&&!r.done;){const s=r.value;e.call(t,s[0],s[1])}},Sn=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},En=k("HTMLFormElement"),xn=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,n,r){return n.toUpperCase()+r}),Qe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),On=k("RegExp"),Ye=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};G(n,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(r[i]=o||s)}),Object.defineProperties(t,r)},Rn=t=>{Ye(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+"'")})}})},An=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return W(t)?r(t):r(String(t).split(e)),n},Cn=()=>{},Tn=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function kn(t){return!!(t&&C(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Pn=t=>{const e=new Array(10),n=(r,s)=>{if(oe(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const i=W(r)?[]:{};return G(r,(o,c)=>{const l=n(o,s+1);!X(l)&&(i[c]=l)}),e[s]=void 0,i}}return r};return n(t,0)},jn=k("AsyncFunction"),Nn=t=>t&&(oe(t)||C(t))&&C(t.then)&&C(t.catch),Ze=((t,e)=>t?setImmediate:e?((n,r)=>($.addEventListener("message",({source:s,data:i})=>{s===$&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),$.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",C($.postMessage)),In=typeof queueMicrotask<"u"?queueMicrotask.bind($):typeof process<"u"&&process.nextTick||Ze,a={isArray:W,isArrayBuffer:Ve,isBuffer:Qt,isFormData:cn,isArrayBufferView:Yt,isString:Zt,isNumber:Ke,isBoolean:en,isObject:oe,isPlainObject:ce,isReadableStream:ln,isRequest:un,isResponse:hn,isHeaders:dn,isUndefined:X,isDate:tn,isFile:nn,isBlob:rn,isRegExp:On,isFunction:C,isStream:on,isURLSearchParams:an,isTypedArray:wn,isFileList:sn,forEach:G,merge:Se,extend:pn,trim:fn,stripBOM:gn,inherits:mn,toFlatObject:bn,kindOf:se,kindOfTest:k,endsWith:yn,toArray:_n,forEachEntry:vn,matchAll:Sn,isHTMLForm:En,hasOwnProperty:Qe,hasOwnProp:Qe,reduceDescriptors:Ye,freezeMethods:Rn,toObjectSet:An,toCamelCase:xn,noop:Cn,toFiniteNumber:Tn,findKey:Xe,global:$,isContextDefined:Ge,isSpecCompliantForm:kn,toJSONObject:Pn,isAsyncFn:jn,isThenable:Nn,setImmediate:Ze,asap:In};function m(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(m,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 et=m.prototype,tt={};["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=>{tt[t]={value:t}}),Object.defineProperties(m,tt),Object.defineProperty(et,"isAxiosError",{value:!0}),m.from=(t,e,n,r,s,i)=>{const o=Object.create(et);return a.toFlatObject(t,o,function(c){return c!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,t.message,e,n,r,s),o.cause=t,o.name=t.name,i&&Object.assign(o,i),o};const Ln=null;function Ee(t){return a.isPlainObject(t)||a.isArray(t)}function nt(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function rt(t,e,n){return t?t.concat(e).map(function(r,s){return r=nt(r),!n&&s?"["+r+"]":r}).join(n?".":""):e}function Un(t){return a.isArray(t)&&!t.some(Ee)}const Fn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ae(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(d,y){return!a.isUndefined(y[d])});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(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(!c&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?c&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,y,f){let S=d;if(d&&!f&&typeof d=="object"){if(a.endsWith(y,"{}"))y=r?y:y.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&Un(d)||(a.isFileList(d)||a.endsWith(y,"[]"))&&(S=a.toArray(d)))return y=nt(y),S.forEach(function(w,_){!(a.isUndefined(w)||w===null)&&e.append(o===!0?rt([y],_,i):o===null?y:y+"[]",l(w))}),!1}return Ee(d)?!0:(e.append(rt(f,y,i),l(d)),!1)}const h=[],p=Object.assign(Fn,{defaultVisitor:u,convertValue:l,isVisitable:Ee});function g(d,y){if(!a.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(d),a.forEach(d,function(f,S){(!(a.isUndefined(f)||f===null)&&s.call(e,f,a.isString(S)?S.trim():S,y,p))===!0&&g(f,y?y.concat(S):[S])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return g(t),e}function st(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function xe(t,e){this._pairs=[],t&&ae(t,this,e)}const it=xe.prototype;it.append=function(t,e){this._pairs.push([t,e])},it.toString=function(t){const e=t?function(n){return t.call(this,n,st)}:st;return this._pairs.map(function(n){return e(n[0])+"="+e(n[1])},"").join("&")};function $n(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ot(t,e,n){if(!e)return t;const r=n&&n.encode||$n;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 xe(e,n).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class ct{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 at={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},qn=typeof URLSearchParams<"u"?URLSearchParams:xe,Dn=typeof FormData<"u"?FormData:null,Bn=typeof Blob<"u"?Blob:null,Mn={isBrowser:!0,classes:{URLSearchParams:qn,FormData:Dn,Blob:Bn},protocols:["http","https","file","blob","url","data"]},Oe=typeof window<"u"&&typeof document<"u",Re=typeof navigator=="object"&&navigator||void 0,zn=Oe&&(!Re||["ReactNative","NativeScript","NS"].indexOf(Re.product)<0),Jn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Wn=Oe&&window.location.href||"http://localhost",Hn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Oe,hasStandardBrowserEnv:zn,hasStandardBrowserWebWorkerEnv:Jn,navigator:Re,origin:Wn},Symbol.toStringTag,{value:"Module"})),x={...Hn,...Mn};function Vn(t,e){return ae(t,new x.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return x.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function Kn(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Xn(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 lt(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]=Xn(s[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const n={};return a.forEachEntry(t,(r,s)=>{e(Kn(r),s,n,0)}),n}return null}function Gn(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 Q={transitional:at,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(lt(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 Vn(t,this.formSerializer).toString();if((i=a.isFileList(t))||n.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return ae(i?{"files[]":t}:t,o&&new o,this.formSerializer)}}return s||r?(e.setContentType("application/json",!1),Gn(t)):t}],transformResponse:[function(t){const e=this.transitional||Q.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)}catch(i){if(s)throw i.name==="SyntaxError"?m.from(i,m.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:x.classes.FormData,Blob:x.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=>{Q.headers[t]={}});const Qn=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"]),Yn=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]&&Qn[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},ut=Symbol("internals");function Y(t){return t&&String(t).trim().toLowerCase()}function le(t){return t===!1||t==null?t:a.isArray(t)?t.map(le):String(t)}function Zn(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 er=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Ae(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 tr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function nr(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 R=class{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function s(o,c,l){const u=Y(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]=le(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())&&!er(t))i(Yn(t),e);else if(a.isHeaders(t))for(const[o,c]of t.entries())s(c,o,n);else t!=null&&s(e,t,n);return this}get(t,e){if(t=Y(t),t){const n=a.findKey(this,t);if(n){const r=this[n];if(!e)return r;if(e===!0)return Zn(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=Y(t),t){const n=a.findKey(this,t);return!!(n&&this[n]!==void 0&&(!e||Ae(this,this[n],n,e)))}return!1}delete(t,e){const n=this;let r=!1;function s(i){if(i=Y(i),i){const o=a.findKey(n,i);o&&(!e||Ae(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||Ae(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]=le(r),delete e[s];return}const o=t?tr(s):String(s).trim();o!==s&&delete e[s],e[o]=le(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
- `)}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[ut]=this[ut]={accessors:{}}).accessors,n=this.prototype;function r(s){const i=Y(s);e[i]||(nr(n,s),e[i]=!0)}return a.isArray(t)?t.forEach(r):r(t),this}};R.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(R.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),a.freezeMethods(R);function Ce(t,e){const n=this||Q,r=e||n,s=R.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 ht(t){return!!(t&&t.__CANCEL__)}function H(t,e,n){m.call(this,t??"canceled",m.ERR_CANCELED,e,n),this.name="CanceledError"}a.inherits(H,m,{__CANCEL__:!0});function dt(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function rr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function sr(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,p=0;for(;h!==s;)p+=n[h++],h=h%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),l-o<e)return;const g=u&&l-u;return g?Math.round(p*1e3/g):void 0}}function ir(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.apply(null,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 ue=(t,e,n=3)=>{let r=0;const s=sr(50,250);return ir(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,l=o-r,u=s(l),h=o<=c;r=o;const p={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(p)},n)},ft=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},pt=t=>(...e)=>a.asap(()=>t(...e)),or=x.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,x.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(x.origin),x.navigator&&/(msie|trident)/i.test(x.navigator.userAgent)):()=>!0,cr=x.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 ar(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function lr(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gt(t,e,n){let r=!ar(e);return t&&(r||n==!1)?lr(t,e):e}const mt=t=>t instanceof R?{...t}:t;function q(t,e){e=e||{};const n={};function r(u,h,p,g){return a.isPlainObject(u)&&a.isPlainObject(h)?a.merge.call({caseless:g},u,h):a.isPlainObject(h)?a.merge({},h):a.isArray(h)?h.slice():h}function s(u,h,p,g){if(a.isUndefined(h)){if(!a.isUndefined(u))return r(void 0,u,p,g)}else return r(u,h,p,g)}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,p){if(p in e)return r(u,h);if(p 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,p)=>s(mt(u),mt(h),p,!0)};return a.forEach(Object.keys(Object.assign({},t,e)),function(u){const h=l[u]||s,p=h(t[u],e[u],u);a.isUndefined(p)&&h!==c||(n[u]=p)}),n}const bt=t=>{const e=q({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=e;e.headers=o=R.from(o),e.url=ot(gt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let l;if(a.isFormData(n)){if(x.hasStandardBrowserEnv||x.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...h]=l?l.split(";").map(p=>p.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...h].join("; "))}}if(x.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&or(e.url))){const u=s&&i&&cr.read(i);u&&o.set(s,u)}return e},ur=typeof XMLHttpRequest<"u",hr=ur&&function(t){return new Promise(function(e,n){const r=bt(t);let s=r.data;const i=R.from(r.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:l}=r,u,h,p,g,d;function y(){g&&g(),d&&d(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let f=new XMLHttpRequest;f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout;function S(){if(!f)return;const _=R.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),T={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:_,config:t,request:f};dt(function(L){e(L),y()},function(L){n(L),y()},T),f=null}"onloadend"in f?f.onloadend=S:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(S)},f.onabort=function(){f&&(n(new m("Request aborted",m.ECONNABORTED,t,f)),f=null)},f.onerror=function(){n(new m("Network Error",m.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let _=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const T=r.transitional||at;r.timeoutErrorMessage&&(_=r.timeoutErrorMessage),n(new m(_,T.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,f)),f=null},s===void 0&&i.setContentType(null),"setRequestHeader"in f&&a.forEach(i.toJSON(),function(_,T){f.setRequestHeader(T,_)}),a.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),o&&o!=="json"&&(f.responseType=r.responseType),l&&([p,d]=ue(l,!0),f.addEventListener("progress",p)),c&&f.upload&&([h,g]=ue(c),f.upload.addEventListener("progress",h),f.upload.addEventListener("loadend",g)),(r.cancelToken||r.signal)&&(u=_=>{f&&(n(!_||_.type?new H(null,t,f):_),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const w=rr(r.url);if(w&&x.protocols.indexOf(w)===-1){n(new m("Unsupported protocol "+w+":",m.ERR_BAD_REQUEST,t));return}f.send(s||null)})},dr=(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 m?h:new H(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,i(new m(`timeout ${e} of ms exceeded`,m.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}},fr=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},pr=async function*(t,e){for await(const n of gr(t))yield*fr(n,e)},gr=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()}},yt=(t,e,n,r)=>{const s=pr(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 p=h.byteLength;if(n){let g=i+=p;n(g)}l.enqueue(new Uint8Array(h))}catch(u){throw c(u),u}},cancel(l){return c(l),s.return()}},{highWaterMark:2})},he=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",_t=he&&typeof ReadableStream=="function",mr=he&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),wt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},br=_t&&wt(()=>{let t=!1;const e=new Request(x.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),vt=64*1024,Te=_t&&wt(()=>a.isReadableStream(new Response("").body)),de={stream:Te&&(t=>t.body)};he&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!de[e]&&(de[e]=a.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new m(`Response type '${e}' is not supported`,m.ERR_NOT_SUPPORT,r)})})})(new Response);const yr=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(x.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(a.isArrayBufferView(t)||a.isArrayBuffer(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await mr(t)).byteLength},_r=async(t,e)=>a.toFiniteNumber(t.getContentLength())??yr(e),wr=he&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:i,timeout:o,onDownloadProgress:c,onUploadProgress:l,responseType:u,headers:h,withCredentials:p="same-origin",fetchOptions:g}=bt(t);u=u?(u+"").toLowerCase():"text";let d=dr([s,i&&i.toAbortSignal()],o),y;const f=d&&d.unsubscribe&&(()=>{d.unsubscribe()});let S;try{if(l&&br&&n!=="get"&&n!=="head"&&(S=await _r(h,r))!==0){let O=new Request(e,{method:"POST",body:r,duplex:"half"}),I;if(a.isFormData(r)&&(I=O.headers.get("content-type"))&&h.setContentType(I),O.body){const[z,F]=ft(S,ue(pt(l)));r=yt(O.body,vt,z,F)}}a.isString(p)||(p=p?"include":"omit");const w="credentials"in Request.prototype;y=new Request(e,{...g,signal:d,method:n.toUpperCase(),headers:h.normalize().toJSON(),body:r,duplex:"half",credentials:w?p:void 0});let _=await fetch(y);const T=Te&&(u==="stream"||u==="response");if(Te&&(c||T&&f)){const O={};["status","statusText","headers"].forEach(U=>{O[U]=_[U]});const I=a.toFiniteNumber(_.headers.get("content-length")),[z,F]=c&&ft(I,ue(pt(c),!0))||[];_=new Response(yt(_.body,vt,z,()=>{F&&F(),f&&f()}),O)}u=u||"text";let L=await de[a.findKey(de,u)||"text"](_,t);return!T&&f&&f(),await new Promise((O,I)=>{dt(O,I,{data:L,headers:R.from(_.headers),status:_.status,statusText:_.statusText,config:t,request:y})})}catch(w){throw f&&f(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,t,y),{cause:w.cause||w}):m.from(w,w&&w.code,t,y)}}),ke={http:Ln,xhr:hr,fetch:wr};a.forEach(ke,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const St=t=>`- ${t}`,vr=t=>a.isFunction(t)||t===null||t===!1,Et={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let i=0;i<e;i++){n=t[i];let o;if(r=n,!vr(n)&&(r=ke[(o=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?i.length>1?`since :
4
- `+i.map(St).join(`
5
- `):" "+St(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:ke};function Pe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new H(null,t)}function xt(t){return Pe(t),t.headers=R.from(t.headers),t.data=Ce.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Et.getAdapter(t.adapter||Q.adapter)(t).then(function(e){return Pe(t),e.data=Ce.call(t,t.transformResponse,e),e.headers=R.from(e.headers),e},function(e){return ht(e)||(Pe(t),e&&e.response&&(e.response.data=Ce.call(t,t.transformResponse,e.response),e.response.headers=R.from(e.response.headers))),Promise.reject(e)})}const Ot="1.8.4",fe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{fe[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Rt={};fe.transitional=function(t,e,n){function r(s,i){return"[Axios v"+Ot+"] Transitional option '"+s+"'"+i+(n?". "+n:"")}return(s,i,o)=>{if(t===!1)throw new m(r(i," has been removed"+(e?" in "+e:"")),m.ERR_DEPRECATED);return e&&!Rt[i]&&(Rt[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}},fe.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Sr(t,e,n){if(typeof t!="object")throw new m("options must be an object",m.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 m("option "+i+" must be "+l,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const pe={assertOptions:Sr,validators:fe},N=pe.validators;let D=class{constructor(t){this.defaults=t,this.interceptors={request:new ct,response:new ct}}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=q(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:s}=e;n!==void 0&&pe.assertOptions(n,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),r!=null&&(a.isFunction(r)?e.paramsSerializer={serialize:r}:pe.assertOptions(r,{encode:N.function,serialize:N.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),pe.assertOptions(e,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.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"],d=>{delete s[d]}),e.headers=R.concat(i,s);const o=[];let c=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(e)===!1||(c=c&&d.synchronous,o.unshift(d.fulfilled,d.rejected))});const l=[];this.interceptors.response.forEach(function(d){l.push(d.fulfilled,d.rejected)});let u,h=0,p;if(!c){const d=[xt.bind(this),void 0];for(d.unshift.apply(d,o),d.push.apply(d,l),p=d.length,u=Promise.resolve(e);h<p;)u=u.then(d[h++],d[h++]);return u}p=o.length;let g=e;for(h=0;h<p;){const d=o[h++],y=o[h++];try{g=d(g)}catch(f){y.call(this,f);break}}try{u=xt.call(this,g)}catch(d){return Promise.reject(d)}for(h=0,p=l.length;h<p;)u=u.then(l[h++],l[h++]);return u}getUri(t){t=q(this.defaults,t);const e=gt(t.baseURL,t.url,t.allowAbsoluteUrls);return ot(e,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){D.prototype[t]=function(e,n){return this.request(q(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(q(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}D.prototype[t]=e(),D.prototype[t+"Form"]=e(!0)});let Er=class Vt{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 H(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 Vt(function(n){e=n}),cancel:e}}};function xr(t){return function(e){return t.apply(null,e)}}function Or(t){return a.isObject(t)&&t.isAxiosError===!0}const je={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(je).forEach(([t,e])=>{je[e]=t});function At(t){const e=new D(t),n=He(D.prototype.request,e);return a.extend(n,D.prototype,e,{allOwnKeys:!0}),a.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return At(q(t,r))},n}const v=At(Q);v.Axios=D,v.CanceledError=H,v.CancelToken=Er,v.isCancel=ht,v.VERSION=Ot,v.toFormData=ae,v.AxiosError=m,v.Cancel=v.CanceledError,v.all=function(t){return Promise.all(t)},v.spread=xr,v.isAxiosError=Or,v.mergeConfig=q,v.AxiosHeaders=R,v.formToJSON=t=>lt(a.isHTMLForm(t)?new FormData(t):t),v.getAdapter=Et.getAdapter,v.HttpStatusCode=je,v.default=v;const{Axios:Js,AxiosError:Ws,CanceledError:Hs,isCancel:Vs,CancelToken:Ks,VERSION:Xs,all:Gs,Cancel:Qs,isAxiosError:Ys,spread:Zs,toFormData:ei,AxiosHeaders:ti,HttpStatusCode:ni,formToJSON:ri,getAdapter:si,mergeConfig:ii}=v,Ne=v.create({baseURL:location.origin,timeout:6e4,params:{}});Ne.interceptors.response.use(t=>t,t=>{var e,n,r,s,i,o,c,l,u,h,p;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(y){y&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let g=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(g+=`${t.response.statusText} `),(r=(n=t.response)==null?void 0:n.config)!=null&&r.data&&(g+=`${t.response.config.data} `),(i=(s=t.response)==null?void 0:s.data)!=null&&i.message?g+=`${t.response.data.message}`:(c=(o=t.response)==null?void 0:o.data)!=null&&c.exception?g+=`${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&&(g+=`${t.response.data.error.class} `),g+=`${t.response.data.error.message}`):g+=`${(p=t.response)==null?void 0:p.data}`;const{$cosmosNotify:d}=window;throw d&&d.serious({title:"Network error",body:g}),t}else throw t});const ge=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),Ne({method:t,url:e,data:n,params:r,headers:s,onUploadProgress:c})},Ie={Accept:"application/json"},Ct={...Ie,"Content-Type":"application/json"},oi=we("o",{get:function(t,{params:e,headers:n=Ie,noScope:r,noAuth:s,onUploadProgress:i}={}){return ge("get",t,{params:e,headers:n,noScope:r,noAuth:s,onUploadProgress:i})},put:function(t,{data:e,params:n,headers:r=Ct,noScope:s,noAuth:i,onUploadProgress:o}={}){return ge("put",t,{data:e,params:n,headers:r,noScope:s,noAuth:i,onUploadProgress:o})},post:function(t,{data:e,params:n,headers:r=Ct,noScope:s,noAuth:i,onUploadProgress:o}={}){return ge("post",t,{data:e,params:n,headers:r,noScope:s,noAuth:i,onUploadProgress:o})},delete:function(t,{params:e,headers:n=Ie,noScope:r,noAuth:s,onUploadProgress:i}={}){return ge("delete",t,{params:e,headers:n,noScope:r,noAuth:s,onUploadProgress:i})}});let me=()=>({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 Z extends Error{constructor(e,n){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=n,this.name="ReasonError"}}class Le extends Z{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class Rr extends Z{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class P extends Z{constructor(e,n){n?super(e,n):super("Disconnected",e),this.name="DisconnectedError"}}class Ar extends P{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function Tt(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 Cr{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 B=Symbol("state");class kt{constructor(e={}){this.emitter=me(),this.params=Object.freeze(e),this.presence=new Cr(this),this.initialConnect=!0,this[B]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=Tt({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[B]}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[B]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[B]="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[B]="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[B]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[B]="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 Z("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class Tr{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 kr{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 Pr{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new kr),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 Tr(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 jr{constructor(e={}){this.subscriptions=new Pr(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 Pt={debug:0,info:1,warn:2,error:3};class jt{constructor(e){this.level=e||"warn"}log(e,n,r){Pt[e]<Pt[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 ee extends jt{writeLogEntry(){}}class Nr{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let Ir=0;class Nt{constructor(e={}){let{logger:n}=e;this.logger=n||new ee,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=Tt(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=++Ir;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 Rr(`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 P(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 Le)):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 It=()=>Date.now()/1e3|0;class Lr extends Nt{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.restoreSince===void 0&&(this.restoreSince=It()),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"||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=It()),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.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 Ur extends Z{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class Ue extends kt{constructor(e,n){super(n),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}re(Ue,"identifier","__ghost__");const Fr="$pubsub";class Fe extends kt{async perform(e,n){if(e.startsWith("$"))return super.perform(e,n);throw Error("not implemented")}}re(Fe,"identifier",Fr);const M=Symbol("state");let $r=class{constructor({transport:t,protocol:e,encoder:n,logger:r,lazy:s,hubOptions:i,performFailures:o,transportConfigurator:c}){this.emitter=me(),this.transport=t,this.encoder=n,this.logger=r||new ee,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new jr(i||{}),this[M]="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[M]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[M]="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[M]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new P("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[M]="connected",this.hub.subscriptions.all().forEach(r=>{t&&r.remoteId&&t.includes(r.remoteId)?r.notify("restored"):(r.notify("disconnected",new P("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 P(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[M]="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 P?t:new P(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[M]="closed";let n=e||new P("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 Fe({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new Fe({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let n,r;return typeof t=="string"&&(r=t,t=Ue),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 Le&&this.logger.warn("rejected",i),o instanceof P){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 P?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 Ur;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 qr={maxMissingPings:2,maxReconnectAttempts:1/0},V=()=>Date.now(),Lt=(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 Ut=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},qr,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 ee,this.state="pending_connect",this.attempts=0,this.disconnectedAt=V()}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=V(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=V(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=V(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=V()})),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=V()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new Ar))}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 Dr{constructor(e,n={}){this.transports=e,this.transport=null,this.emitter=me(),this.unbind=[],this.logger=n.logger||new ee}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 Br{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=me();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 Ft={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Mr(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({},Ft,e);let{protocol:n,websocketImplementation:r,websocketFormat:s,websocketOptions:i,websocketAuthStrategy:o,fallbacks:c,logLevel:l,logger:u,transport:h,encoder:p,lazy:g,monitor:d,pingInterval:y,reconnectStrategy:f,maxMissingPings:S,maxReconnectAttempts:w,subprotocol:_,tokenRefresher:T,historyTimestamp:L,protocolOptions:O,concurrentSubscribes:I,performFailures:z,transportConfigurator:F,auth:U}=e;if(u=u||new ee(l),typeof n=="string"){_=_||n;let K=n.substring(0,n.lastIndexOf("-")),A=n.substring(n.lastIndexOf("-")+1);if(O=O||{},K==="actioncable-v1")n=new Nt({logger:u,...O});else if(K==="actioncable-v1-ext")n=new Lr({logger:u,historyTimestamp:L,...O});else throw Error(`Protocol is not supported yet: ${n}`);if(A==="json")p=p||new Nr,s=s||"text";else if(A==="msgpack"){if(s="binary",!p)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(A==="protobuf"){if(s=s||"binary",!p)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 Br(t,{websocketImplementation:r,websocketOptions:i,subprotocol:_,authStrategy:o,format:s}),c&&(h=new Dr([h,...c],{logger:u})),U&&U.token&&h.setToken(U.token,U.param||"jid"),f=f||Lt(y),d!==!1&&(d=d||new Ut({pingInterval:y,reconnectStrategy:f,maxMissingPings:S,maxReconnectAttempts:w,logger:u}));let Je={concurrentSubscribes:I},j=new $r({protocol:n,transport:h,encoder:p,logger:u,lazy:g,hubOptions:Je,performFailures:z,transportConfigurator:F});return d&&(d.watch(j),j.monitor=d),T&&zr(j,async()=>{try{await T(h)}catch(K){return u.error("Failed to refresh authentication token: "+K),!1}return j.connect().catch(()=>{}),!0}),j}function zr(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 Jr{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 Wr extends Ue{constructor(e,n,r){super(e,n),this.subscription=new Jr(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 Le?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Hr{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 Wr(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 Vr{constructor(e){this.cable=e,this.subscriptions=new Hr(e)}}class Kr extends jt{writeLogEntry(e,n,r){r?console[e](n,r):console[e](n)}}class Xr extends Ut{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 P("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 Gr=["cable","action-cable"],Qr="/cable",be=(t,e)=>{for(let n of Gr){let r=t.head.querySelector(`meta[name='${n}-${e}']`);if(r)return r.getAttribute("content")}},$t=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Yr=()=>{if(typeof document<"u"&&document.head){let t=be(document,"url");if(t)return $t(t)}return $t(Qr)},Zr=()=>{if(typeof document<"u"&&document.head){let t=be(document,"history-timestamp");if(t)return t|0}},es=()=>{if(typeof document<"u"&&document.head)return be(document,"token")},ts=()=>{if(typeof document<"u"&&document.head)return be(document,"token-param")};function ns(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Yr(),e=e||{},e.historyTimestamp||(e.historyTimestamp=Zr());let n=es();if(n){let u=ts();e.auth=Object.assign({token:n,param:u},e.auth||{})}e=Object.assign({},Ft,e);let{logLevel:r,logger:s,pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:l}=e;return s=e.logger=e.logger||new Kr(r),o=e.reconnectStrategy=e.reconnectStrategy||Lt(i),e.monitor!==!1&&(e.monitor=e.monitor||new Xr({pingInterval:i,reconnectStrategy:o,maxMissingPings:c,maxReconnectAttempts:l,logger:s})),Mr(t,e)}function rs(t,e){let n=ns(t,e);return new Vr(n)}class ss{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(window.openc3Scope)+"&authorization="+encodeURIComponent(localStorage.openc3Token);o=new URL(o,document.baseURI).href,this._cable=rs(o)}return this._cable.subscriptions.create({channel:e,...s},r)})}recordPing(){}}we("l",ss);function $e(t){return is.test(t)}const is=/^-?[0-9]+$/;function qt(t){return os.test(t)}const os=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Dt(t,e){const n=Number.parseFloat(t),r=String(n),s=Bt(t),i=Bt(r);return!!(s===i||(e==null?void 0:e.approx)===!0&&!$e(t)&&i.length>=14&&s.startsWith(i.substring(0,14)))}let te=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function cs(t){if(Dt(t,{approx:!1}))return;if($e(t))return te.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?te.underflow:te.truncate_float:te.overflow}function Bt(t){return t.replace(as,"").replace(us,"").replace(hs,"").replace(ls,"")}const as=/[eE][+-]?\d+$/,ls=/^-?(0*)?/,us=/\./,hs=/0+$/;class ds{constructor(e){if(re(this,"isLosslessNumber",!0),!qt(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=cs(this.value);if(e===void 0||e===te.truncate_float)return Number.parseFloat(this.value);if($e(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 fs(t){return t&&typeof t=="object"&&t.isLosslessNumber===!0||!1}function ps(t){return new ds(t)}function gs(t,e){return qe({"":t},"",t,e)}function qe(t,e,n,r){return Array.isArray(n)?r.call(t,e,bs(n,r)):n&&typeof n=="object"&&!fs(n)?r.call(t,e,ms(n,r)):r.call(t,e,n)}function ms(t,e){for(const n of Object.keys(t)){const r=qe(t,n,t[n],e);r!==void 0?t[n]=r:delete t[n]}return t}function bs(t,e){for(let n=0;n<t.length;n++)t[n]=qe(t,String(n),t[n],e);return t}function ys(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ps,r=0;const s=c();return y(s),S(),e?gs(s,e):s;function i(){if(t.charCodeAt(r)===xs){r++,u();const b={};let E=!0;for(;r<t.length&&t.charCodeAt(r)!==zt;){E?E=!1:(g(),u());const J=r,ne=h();if(ne===void 0){T();return}u(),d();const We=c();if(We===void 0){U();return}Object.prototype.hasOwnProperty.call(b,ne)&&!De(We,b[ne])&&L(ne,J+1),b[ne]=We}return t.charCodeAt(r)!==zt&&O(),r++,b}}function o(){if(t.charCodeAt(r)===Os){r++,u();const b=[];let E=!0;for(;r<t.length&&t.charCodeAt(r)!==Jt;){E?E=!1:g();const J=c();f(J),b.push(J)}return t.charCodeAt(r)!==Jt&&I(),r++,b}}function c(){u();const b=h()??p()??i()??o()??l("true",!0)??l("false",!1)??l("null",null);return u(),b}function l(b,E){if(t.slice(r,r+b.length)===b)return r+=b.length,E}function u(){for(;_s(t.charCodeAt(r));)r++}function h(){if(t.charCodeAt(r)===Be){r++;let b="";for(;r<t.length&&t.charCodeAt(r)!==Be;){if(t.charCodeAt(r)===Es){const E=t[r+1],J=Ss[E];J!==void 0?(b+=J,r++):E==="u"?ye(t.charCodeAt(r+2))&&ye(t.charCodeAt(r+3))&&ye(t.charCodeAt(r+4))&&ye(t.charCodeAt(r+5))?(b+=String.fromCharCode(Number.parseInt(t.slice(r+2,r+6),16)),r+=5):Je(r):F(r)}else vs(t.charCodeAt(r))?b+=t[r]:z(t[r]);r++}return _(),r++,b}}function p(){const b=r;if(t.charCodeAt(r)===Wt&&(r++,w(b)),t.charCodeAt(r)===Me)r++;else if(ws(t.charCodeAt(r)))for(r++;_e(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===Ns)for(r++,w(b);_e(t.charCodeAt(r));)r++;if(t.charCodeAt(r)===$s||t.charCodeAt(r)===Fs)for(r++,(t.charCodeAt(r)===Wt||t.charCodeAt(r)===ks)&&r++,w(b);_e(t.charCodeAt(r));)r++;if(r>b)return n(t.slice(b,r))}function g(){if(t.charCodeAt(r)!==js)throw new SyntaxError(`Comma ',' expected after value ${A()}`);r++}function d(){if(t.charCodeAt(r)!==Is)throw new SyntaxError(`Colon ':' expected after property name ${A()}`);r++}function y(b){if(b===void 0)throw new SyntaxError(`JSON value expected ${A()}`)}function f(b){if(b===void 0)throw new SyntaxError(`Array item expected ${A()}`)}function S(){if(r<t.length)throw new SyntaxError(`Expected end of input ${A()}`)}function w(b){if(!_e(t.charCodeAt(r))){const E=t.slice(b,r);throw new SyntaxError(`Invalid number '${E}', expecting a digit ${A()}`)}}function _(){if(t.charCodeAt(r)!==Be)throw new SyntaxError(`End of string '"' expected ${A()}`)}function T(){throw new SyntaxError(`Quoted object key expected ${A()}`)}function L(b,E){throw new SyntaxError(`Duplicate key '${b}' encountered at position ${E}`)}function O(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${A()}`)}function I(){throw new SyntaxError(`Array item or end of array ']' expected ${A()}`)}function z(b){throw new SyntaxError(`Invalid character '${b}' ${j()}`)}function F(b){const E=t.slice(b,b+2);throw new SyntaxError(`Invalid escape character '${E}' ${j()}`)}function U(){throw new SyntaxError(`Object value expected after ':' ${j()}`)}function Je(b){const E=t.slice(b,b+6);throw new SyntaxError(`Invalid unicode character '${E}' ${j()}`)}function j(){return`at position ${r}`}function K(){return r<t.length?`but got '${t[r]}'`:"but reached end of input"}function A(){return`${K()} ${j()}`}}function _s(t){return t===Rs||t===As||t===Cs||t===Ts}function ye(t){return t>=Me&&t<=ze||t>=Ls&&t<=qs||t>=Us&&t<=Ds}function _e(t){return t>=Me&&t<=ze}function ws(t){return t>=Ps&&t<=ze}function vs(t){return t>=32&&t<=1114111}function De(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>De(n,e[r])):Mt(t)&&Mt(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(n=>De(t[n],e[n])):!1}function Mt(t){return typeof t=="object"&&t!==null}const Ss={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
7
- `,r:"\r",t:" "},Es=92,xs=123,zt=125,Os=91,Jt=93,Rs=32,As=10,Cs=9,Ts=13,Be=34,ks=43,Wt=45,Me=48,Ps=49,ze=57,js=44,Ns=46,Is=58,Ls=65,Us=97,Fs=69,$s=101,qs=70,Ds=102;function Ht(t,e,n,r){return s(t);function s(l,u){if(Array.isArray(r)){const h=r.find(p=>p.test(l));if(h){const p=h.stringify(l);if(typeof p!="string"||!qt(p))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${p})`);return p}}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 p=0;p<l.length;p++){const g=l[p];typeof g<"u"&&typeof g!="function"?h+=s(g):h+="null",p<l.length-1&&(h+=",")}return h+="]",h}function o(l,u){if(typeof l.toJSON=="function")return Ht(l.toJSON(),e,n,void 0);const h=Array.isArray(e)?e.map(String):Object.keys(l);if(h.length===0)return"{}";let p=!0,g="{";for(const d of h){const y=l[d];if(c(d,y)){p?p=!1:g+=",";const f=JSON.stringify(d);g+=`${f}:`,g+=s(y)}}return g+="}",g}function c(l,u){return typeof u<"u"&&typeof u!="function"&&typeof u!="symbol"}}function Bs(t){return Dt(t)?parseFloat(t):BigInt(t)}class Ms{constructor(){re(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 Ne.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)=>Ht(o)],transformResponse:[o=>ys(o,void 0,Bs)]})).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.name="Unknown error",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){return this.exec("map_target_to_interface",[e,n])}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])}get_all_router_info(){return this.exec("get_all_router_info",[])}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[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])}async get_tlm_values(e,n=30,r=null){let s={stale_time:n};r!==null&&(s.cache_timeout=r);const i=await this.exec("get_tlm_values",[e],s,{},1e4);let o=i[0].length,c=null;for(let l=0;l<o;l++)c=this.decode_openc3_type(i[0][l]),c!==null&&(i[0][l]=c);return i}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){let o=null;for(let c in s)Object.prototype.hasOwnProperty.call(s,c)&&(o=this.encode_openc3_type(s[c]),o!==null&&(s[c]=o));return this.exec(e,[n,r,s],{},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={}){return n===void 0?this.exec("cmd",e,{},s):this._cmd("cmd",e,n,r,s)}cmd_no_range_check(e,n,r,s={}){return n===void 0?this.exec("cmd_no_range_check",e,{},s):this._cmd("cmd_no_range_check",e,n,r,s)}cmd_raw(e,n,r,s={}){return n===void 0?this.exec("cmd_raw",e,{},s):this._cmd("cmd_raw",e,n,r,s)}cmd_raw_no_range_check(e,n,r,s={}){return n===void 0?this.exec("cmd_raw_no_range_check",e,{},s):this._cmd("cmd_raw_no_range_check",e,n,r,s)}cmd_no_hazardous_check(e,n,r,s={}){return n===void 0?this.exec("cmd_no_hazardous_check",e,{},s):this._cmd("cmd_no_hazardous_check",e,n,r,s)}cmd_no_checks(e,n,r,s={}){return n===void 0?this.exec("cmd_no_checks",e,{},s):this._cmd("cmd_no_checks",e,n,r,s)}cmd_raw_no_hazardous_check(e,n,r,s={}){return n===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},s):this._cmd("cmd_raw_no_hazardous_check",e,n,r,s)}cmd_raw_no_checks(e,n,r,s={}){return n===void 0?this.exec("cmd_raw_no_checks",e,{},s):this._cmd("cmd_raw_no_checks",e,n,r,s)}build_cmd(e,n,r){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,r)}build_command(e,n,r){return n===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,n,r)}get_interface_names(){return this.exec("get_interface_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){return this.exec("get_setting",[e])}get_settings(e){return this.exec("get_settings",e)}set_setting(e,n){return this.exec("set_setting",[e,n])}update_news(){return this.exec("update_news",[])}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("")}}}we("h",Ms)}}});