openc3-cosmos-tool-dataextractor 6.4.0 → 6.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/tools/dataextractor/{ArrayWidget-DAZApfkV-b8b28de0dacc098b06e3.js → ArrayWidget-D0fKsdTb-67885dbde6f79c12af64.js} +2 -2
  3. data/tools/dataextractor/{ArrayplotWidget-BfsxDplv-e86c0932fe82ecc01e2b.js → ArrayplotWidget-BmRSuGhA-ae936ee3b3e6126f04e1.js} +1 -1
  4. data/tools/dataextractor/{BarColumn-q0nAsvrd-6e658bf0ec2e10fb37f3.js → BarColumn-DtYw6Gmq-74aea521c3897e3467ed.js} +1 -1
  5. data/tools/dataextractor/{BlockWidget-SDCUWcMQ-40fc0f226abfbb2a4a0b.js → BlockWidget-Dpxbw455-7e30a8392a8e32b65911.js} +2 -2
  6. data/tools/dataextractor/{ButtonWidget-BVMjwC19-e1996dd324c6efe486ad.js → ButtonWidget-8iOpXmpp-97483e86c3a3888020d1.js} +1 -1
  7. data/tools/dataextractor/CanvasWidget-B0iU38rA-5a0972cd3499f296e1de.js +1 -0
  8. data/tools/dataextractor/CanvasdotWidget-C9viSVBs-cc2033797d0173bee753.js +1 -0
  9. data/tools/dataextractor/{CanvasimageWidget-DHOSz-dJ-9ef693b49868fc107935.js → CanvasimageWidget-CFiCpITu-b1a1953750ef5ba587d1.js} +1 -1
  10. data/tools/dataextractor/{CanvasimagevalueWidget-zrURWWUL-31bf3f8524ae3f9403c8.js → CanvasimagevalueWidget-fu6vbAY0-8f499fdb462799dabe79.js} +1 -1
  11. data/tools/dataextractor/CanvaslabelWidget-BVqHq3Vp-3575819857ae38001639.js +1 -0
  12. data/tools/dataextractor/{CanvaslabelvalueWidget-BsIdBtEb-1fe48ad3872524eaea65.js → CanvaslabelvalueWidget-BOFa8-NU-afcaba1fdf72ed77b1d0.js} +1 -1
  13. data/tools/dataextractor/{CanvaslineWidget-CA2aPGRg-ab16c554730125c69d54.js → CanvaslineWidget-l3ko0QXk-ad8c4936b4a84c80e5ec.js} +1 -1
  14. data/tools/dataextractor/{CanvaslinevalueWidget-J7epKRlo-84dd23372ce64577cc08.js → CanvaslinevalueWidget-BCZoO-Z6-af5d8dd26510559ab0e1.js} +1 -1
  15. data/tools/dataextractor/CheckbuttonWidget-BN7e1d5b-490f307db8d051e10c87.js +1 -0
  16. data/tools/dataextractor/ComboboxWidget-Bb5RGXDB-24dbce1ebb3df79f9bb4.js +1 -0
  17. data/tools/dataextractor/{DataExtractor-65a135dbff91b818f99a.js → DataExtractor-1fe4e50c471248554d59.js} +9 -9
  18. data/tools/dataextractor/{DateWidget-BaQqthC7-3347cef05fc42ebc7ffd.js → DateWidget-Dggqab-F-8605742fa9c047f32e0a.js} +1 -1
  19. data/tools/dataextractor/{DetailsDialog-C5jf8o0K-b8dc8f38563b9998760f.js → DetailsDialog-BhSAQDSK-ad063a616582f7561b4f.js} +1 -1
  20. data/tools/dataextractor/{DynamicWidget-CfMtj7H8-2cdf5b9cf94b4cdaeea4.js → DynamicWidget-CfMtj7H8-cee30f2a9515c1edc8cd.js} +1 -1
  21. data/tools/dataextractor/{FormatvalueWidget--H5B9i_Y-95a828279f419a55d952.js → FormatvalueWidget-B9_PbzY2-9202a69b40052d81d8f4.js} +1 -1
  22. data/tools/dataextractor/{Graph-M382Zo8o-1bdf81fad8b0dd15b84b.js → Graph-B29y4d5A-8517c7f168f448df9743.js} +1 -1
  23. data/tools/dataextractor/{GraphWidget-_YOGDD1U-a04db4489e01f2a75a65.js → GraphWidget-oBxPa3EB-77101d795b3ed942caca.js} +1 -1
  24. data/tools/dataextractor/{HorizontalWidget-D_gzrOWs-44afae16430ac2c0d393.js → HorizontalWidget-BWgZL_Oz-6d5cec99279c29f4b506.js} +1 -1
  25. data/tools/dataextractor/{HorizontalboxWidget-GDcjO-UB-b9945b7f7f5ac88cfaf4.js → HorizontalboxWidget-yMYUnNB8-96c1c819d9c6b615d41c.js} +1 -1
  26. data/tools/dataextractor/HorizontallineWidget-C4zMx7z2-3861a508db1a03b0ee37.js +1 -0
  27. data/tools/dataextractor/{IframeWidget-CuUav9b3-efa6b3a0b14ca90cab92.js → IframeWidget-DA4P_mJT-a975542f2fccd85ef0ba.js} +1 -1
  28. data/tools/dataextractor/{ImageLoader-3KLKJ5mV-efb1814fe07e9be2837e.js → ImageLoader-rvd9t-mk-a481e728e6c8e4194a37.js} +1 -1
  29. data/tools/dataextractor/{ImageviewerWidget-BMZ6REN4-397f13d7d67f66df9724.js → ImageviewerWidget-B1wK0hK4-95ca5429ceec4da5eda8.js} +1 -1
  30. data/tools/dataextractor/{LabelWidget-oh6FIG6s-944eaf7b318ff2f64e7d.js → LabelWidget-CY0saBoK-64c832cdf33940ce08b0.js} +1 -1
  31. data/tools/dataextractor/LabelledWidget-B3ZOYaGy-484a15dbfd20981105ee.js +1 -0
  32. data/tools/dataextractor/{LabelprogressbarWidget-CqIiGoDb-b228c9c246250d420ef6.js → LabelprogressbarWidget-CmXcESTg-3de8ca51b2bc56ae1a76.js} +1 -1
  33. data/tools/dataextractor/LabelsparklineWidget-D_yrQrn6-70734962e11d46568db1.js +1 -0
  34. data/tools/dataextractor/{LabelvalueWidget-BefwSSVq-ac5081560eab26a5c527.js → LabelvalueWidget-dNaNfsBE-75e740863a3ee94432c6.js} +1 -1
  35. data/tools/dataextractor/{LabelvaluedescWidget-NxrCzznm-487c06272832e0e1dd19.js → LabelvaluedescWidget-3vNoH6Mc-f345c01c578c57e3af47.js} +1 -1
  36. data/tools/dataextractor/LabelvaluelimitsbarWidget-7VppYVIN-bb285dd20a471227a92f.js +1 -0
  37. data/tools/dataextractor/LabelvaluelimitscolumnWidget-BZ6nwifg-55d785adfe48206f9f2a.js +1 -0
  38. data/tools/dataextractor/LabelvaluerangebarWidget-IyuXLNsw-354c174451b69f17aa02.js +1 -0
  39. data/tools/dataextractor/Layout-BqMhhhws-8e298f101cdf9456f4cf.js +1 -0
  40. data/tools/dataextractor/{LedWidget--4eSxBnn-48837da673e3e793c4a0.js → LedWidget-DSxpmIOK-9f78145c6ac4d097bd83.js} +1 -1
  41. data/tools/dataextractor/{LimitsbarWidget-BQaumgRt-78b15e1e849bdbf05d55.js → LimitsbarWidget-BoPTdVV5-70fd970c21cfc6ff7a1d.js} +1 -1
  42. data/tools/dataextractor/{LimitscolorWidget-BBF9sRtF-911518229b04b7aa0f9b.js → LimitscolorWidget-Bt3qOvrv-4ccd2ef594f2d8469964.js} +1 -1
  43. data/tools/dataextractor/{LimitscolumnWidget-DZZtSoXw-38a2e8309d5d65280d96.js → LimitscolumnWidget-Ce6YnUBz-44de7af4869e1fe595b9.js} +1 -1
  44. data/tools/dataextractor/LinegraphWidget-XAbg0jj2-e45a870ba09bb001f3fe.js +1 -0
  45. data/tools/dataextractor/{MatrixbycolumnsWidget-dpgZz4wR-ac0f96aaf20f71a21afc.js → MatrixbycolumnsWidget-5MgJFZtz-7ffa8618947051d6e4c0.js} +1 -1
  46. data/tools/dataextractor/{ProgressbarWidget-7cYr8136-eb8d60a51944fd084049.js → ProgressbarWidget-CDwDOFIy-9f6dccc68ecd8649d9d0.js} +1 -1
  47. data/tools/dataextractor/{RadiobuttonWidget-DTfn-7F2-6fc7c9220ba00ab45392.js → RadiobuttonWidget-cQ8V8LaD-521d491b93f5a527c4ca.js} +1 -1
  48. data/tools/dataextractor/RadiogroupWidget-BvRnuGA2-3d7e9fcf1d7e1d15d89a.js +1 -0
  49. data/tools/dataextractor/{RangebarWidget-CG2Y7eYp-e4aa2caf0a80b8c0b254.js → RangebarWidget-aHmgV0qs-954c7d6cc848b31cfdb8.js} +1 -1
  50. data/tools/dataextractor/{RollupWidget-C6HKTfCR-6c11d8c6c12d47586fb1.js → RollupWidget-D1jUPrUQ-bdab148f2f5b1c03a5e7.js} +1 -1
  51. data/tools/dataextractor/{ScrollwindowWidget-DvhBCYd2-335a14af2240b22e7631.js → ScrollwindowWidget-Cn0o3b4E-affecd2638b0875e1479.js} +1 -1
  52. data/tools/dataextractor/{SignalWidget-BZIoGjam-76a4e1f6a2144d3d9129.js → SignalWidget-BQBzqdU--b7384af438be2696981b.js} +1 -1
  53. data/tools/dataextractor/{SpacerWidget-YBS8RZIE-f268ac30585fbe38fe4c.js → SpacerWidget-C0RmQY3t-50815e57ada95e919300.js} +1 -1
  54. data/tools/dataextractor/SparklineWidget-BTH9rvcX-b76c40d909a3e781f9cb.js +1 -0
  55. data/tools/dataextractor/TabbookWidget-C-aDdEoD-66881344447b2efbdbd6.js +1 -0
  56. data/tools/dataextractor/TextboxWidget-Dd2ccpUQ-b262848ec69ce4b84995.js +1 -0
  57. data/tools/dataextractor/TextfieldWidget-DY3aFTnP-c1cd587ad2e8900006e2.js +1 -0
  58. data/tools/dataextractor/{TimeWidget-CQzn13rQ-21fa2721481446e47ea6.js → TimeWidget-C_site21-4c37369e1096e889e13f.js} +1 -1
  59. data/tools/dataextractor/TitleWidget-Bx81VfQD-a5c0cd8e5426763c1002.js +1 -0
  60. data/tools/dataextractor/{VWidget-iASFPjdx-637dccdabcc1ac0239db.js → VWidget-DuUens7G-81e4b65cdffc5763d668.js} +1 -1
  61. data/tools/dataextractor/{ValueWidget-BVI6uUVX-c20dc286912ae142e9e6.js → ValueWidget-cbjxVV3B-8d1c88d887f415407878.js} +1 -1
  62. data/tools/dataextractor/{ValuelimitsbarWidget-BiIcery0-aea103ba681e5584ef11.js → ValuelimitsbarWidget-cQb2o_xH-6b6569e4e6e9f7dd0a1e.js} +1 -1
  63. data/tools/dataextractor/{ValuelimitscolumnWidget-BiRI8GbI-aad224d8f12a13cdb7c7.js → ValuelimitscolumnWidget-BBTuSCK9-3250f13d4e6a0c7ee788.js} +1 -1
  64. data/tools/dataextractor/{ValuerangebarWidget-CtMFQu9--e714c74c9ddf8800bb62.js → ValuerangebarWidget-Ct7iGtu0-44dac374a5d14bb7b995.js} +1 -1
  65. data/tools/dataextractor/{VerticalWidget-CRmcpQBn-fc1d3fb87ec10c9c5004.js → VerticalWidget-DJn02myf-5f374eac345f35bb8b82.js} +1 -1
  66. data/tools/dataextractor/VerticalboxWidget-DHQMxtF3-bb9fdd62eece5fc0557c.js +1 -0
  67. data/tools/dataextractor/{Widget-CFEnOKms-5633544d52088087c039.js → Widget-CP2CtyUr-a48e1b94a2273540bcd5.js} +1 -1
  68. data/tools/dataextractor/{main-2641727deb9dc0901688.js → main-5dc41c7d1aed03caf8c4.js} +88 -88
  69. data/tools/dataextractor/main.js +1 -1
  70. metadata +69 -69
  71. data/tools/dataextractor/CanvasWidget-bVkufjRQ-6d1c8aafad9aa46eb979.js +0 -1
  72. data/tools/dataextractor/CanvasdotWidget-DpniFfca-3f595ffe55f335597ded.js +0 -1
  73. data/tools/dataextractor/CanvaslabelWidget-D-XAMifp-ff22b34d0be45da8f76d.js +0 -1
  74. data/tools/dataextractor/CheckbuttonWidget-ByH-PDRG-1a26caf663b9a6f0f189.js +0 -1
  75. data/tools/dataextractor/ComboboxWidget-Bdm_fMzW-c0027dbade87123745d0.js +0 -1
  76. data/tools/dataextractor/HorizontallineWidget-DZvOYFxf-667e8836e96e13d89ba3.js +0 -1
  77. data/tools/dataextractor/LabelledWidget-Bic36les-a0092a4e817d9ce8f822.js +0 -1
  78. data/tools/dataextractor/LabelsparklineWidget-DLhmqO02-bcc4b8ee90512812c866.js +0 -1
  79. data/tools/dataextractor/LabelvaluelimitsbarWidget-pq7qoolL-9db54e53474531f547f4.js +0 -1
  80. data/tools/dataextractor/LabelvaluelimitscolumnWidget-edkpogsl-f07b3b590d98e88e5abd.js +0 -1
  81. data/tools/dataextractor/LabelvaluerangebarWidget-DpJNv9dh-25487195a2ff07791f78.js +0 -1
  82. data/tools/dataextractor/Layout-B0hvhBQO-c526a2e9c7a0d5740c0e.js +0 -1
  83. data/tools/dataextractor/LinegraphWidget-DTLZmyWs-abc6afff48d364dd7e06.js +0 -1
  84. data/tools/dataextractor/RadiogroupWidget-DWvTpw94-187e5c27e3ccfa514da7.js +0 -1
  85. data/tools/dataextractor/SparklineWidget-BMhY9vYe-a10d02c29434be49dd2d.js +0 -1
  86. data/tools/dataextractor/TabbookWidget-RfET19pq-c08113217b7155860abc.js +0 -1
  87. data/tools/dataextractor/TextboxWidget-M8vFBSxS-f90d94863b40dff3dd8b.js +0 -1
  88. data/tools/dataextractor/TextfieldWidget-Dev7lCsT-c6d17590ef67c677f7bc.js +0 -1
  89. data/tools/dataextractor/TitleWidget-C4zbSian-7bdd043479a0fb4c6ae3.js +0 -1
  90. data/tools/dataextractor/VerticalboxWidget-C-qChjug-3101ff694a2ab2b2837f.js +0 -1
@@ -1,11 +1,11 @@
1
- System.register(["./main-2641727deb9dc0901688.js","vue","vue-router","single-spa","vuex","vuetify"],function(_s,Er){"use strict";var at,ct,lt,ut,dt,ht,ft,C,L,A,pt,f,m,ge,J,K,te,oe,F,je,Ue,se,Le,mt,Fe;return{setters:[R=>{at=R.d,ct=R._,lt=R.N,ut=R.R,dt=R.w,ht=R.a,ft=R.v},R=>{C=R.resolveComponent,L=R.createBlock,A=R.openBlock,pt=R.Teleport,f=R.createVNode,m=R.withCtx,ge=R.createElementVNode,J=R.toDisplayString,K=R.createElementBlock,te=R.Fragment,oe=R.renderList,F=R.createTextVNode,je=R.mergeProps,Ue=R.createSlots,se=R.createCommentVNode,Le=R.normalizeStyle,mt=R.withModifiers,Fe=R.withKeys},null,null,null,null],execute:function(){var R=document.createElement("style");R.textContent=`.title-font[data-v-f98b189b]{font-size:1.125rem}.v-progress-linear__determinate[data-v-f98b189b]{transition:none!important}
2
- /*$vite$:1*/`,document.head.appendChild(R);const ws={props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(t){return t.replaceAll(" ","-").toLowerCase()},subMenuClick(t){t.command(t),this.$refs.topmenu[0].isActive=!1}},mounted(){document.title=this.title}},vs={class:"app-title mr-2"};function Es(t,e,s,i,n,r){const o=C("v-col"),a=C("v-row"),c=C("v-icon"),l=C("v-btn"),d=C("v-divider"),g=C("v-list-item-title"),b=C("v-list-item"),h=C("v-list"),w=C("v-menu"),p=C("v-radio"),E=C("v-list-item-action"),T=C("v-radio-group"),x=C("v-checkbox");return A(),L(pt,{to:"#openc3-menu"},[f(a,{"no-gutters":""},{default:m(()=>[f(o,{"align-self":"end"},{default:m(()=>[ge("span",vs,J(s.title),1)]),_:1})]),_:1}),f(a,{dense:"",class:"flex-nowrap"},{default:m(()=>[(A(!0),K(te,null,oe(s.menus,(O,j)=>(A(),L(w,{ref_for:!0,ref:"topmenu",key:j},{activator:m(({props:_})=>[f(l,je({ref_for:!0},_,{variant:"outlined",class:"mx-1 menu-button",text:O.label,"data-test":r.formatDT(`${s.title} ${O.label}`)}),{append:m(()=>[f(c,{class:"menu-button-icon"},{default:m(()=>e[0]||(e[0]=[F(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:m(()=>[f(h,null,{default:m(()=>[(A(!0),K(te,null,oe(O.items,(_,k)=>(A(),K(te,null,[_.divider?(A(),L(d,{key:k+"-divider"})):_.subMenu&&_.subMenu.length>0?(A(),K("div",{key:k+"-submenu"},[(A(),L(w,{"open-on-hover":"",location:"right",key:k},{activator:m(({props:D})=>[(A(),L(b,je({ref_for:!0},D,{disabled:_.disabled,key:k}),Ue({append:m(()=>[f(c,null,{default:m(()=>e[1]||(e[1]=[F(" mdi-chevron-right ")])),_:1})]),default:m(()=>[!_.radio&&!_.checkbox?(A(),L(g,{key:0,style:Le("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[F(J(_.label),1)]),_:2},1032,["style"])):se("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[f(c,{disabled:_.disabled},{default:m(()=>[F(J(_.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:m(()=>[f(h,null,{default:m(()=>[(A(!0),K(te,null,oe(_.subMenu,(D,q)=>(A(),L(b,{key:q,"prepend-icon":D.icon,onClick:$=>r.subMenuClick(D)},{default:m(()=>[f(g,null,{default:m(()=>[F(J(D.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):_.radioGroup?(A(),L(T,{"model-value":_.value,"onUpdate:modelValue":_.command,key:k+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:m(()=>[(A(!0),K(te,null,oe(_.choices,(D,q)=>(A(),L(b,{key:q+"-choice"},{default:m(()=>[f(E,{class:"list-action"},{default:m(()=>[f(p,{color:"secondary",label:D.label,value:D.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(A(),L(b,{onClick:D=>_.command(_),disabled:_.disabled,"data-test":r.formatDT(`${s.title} ${O.label} ${_.label}`),key:k+"-list"},Ue({default:m(()=>[_.checkbox?(A(),L(E,{key:0,class:"list-action"},{default:m(()=>[f(x,{modelValue:_.checked,"onUpdate:modelValue":D=>_.checked=D,label:_.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):se("",!0),!_.radio&&!_.checkbox?(A(),L(g,{key:1,style:Le("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[F(J(_.label),1)]),_:2},1032,["style"])):se("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[f(c,{icon:_.icon,disabled:_.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Ts=at(ws,[["render",Es],["__scopeId","data-v-4d454b93"]]);var Ss=Object.defineProperty,xs=(t,e,s)=>e in t?Ss(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,be=(t,e,s)=>xs(t,typeof e!="symbol"?e+"":e,s);function gt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Cs}=Object.prototype,{getPrototypeOf:Me}=Object,{iterator:ye,toStringTag:bt}=Symbol,_e=(t=>e=>{const s=Cs.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),H=t=>(t=t.toLowerCase(),e=>_e(e)===t),we=t=>e=>typeof e===t,{isArray:ie}=Array,ae=we("undefined");function Os(t){return t!==null&&!ae(t)&&t.constructor!==null&&!ae(t.constructor)&&M(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const yt=H("ArrayBuffer");function Rs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&yt(t.buffer),e}const ks=we("string"),M=we("function"),_t=we("number"),ve=t=>t!==null&&typeof t=="object",As=t=>t===!0||t===!1,Ee=t=>{if(_e(t)!=="object")return!1;const e=Me(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(bt in t)&&!(ye in t)},Ds=H("Date"),Is=H("File"),Ps=H("Blob"),Ns=H("FileList"),js=t=>ve(t)&&M(t.pipe),Us=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||M(t.append)&&((e=_e(t))==="formdata"||e==="object"&&M(t.toString)&&t.toString()==="[object FormData]"))},Ls=H("URLSearchParams"),[Fs,Ms,Vs,qs]=["ReadableStream","Request","Response","Headers"].map(H),Bs=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ce(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let i,n;if(typeof t!="object"&&(t=[t]),ie(t))for(i=0,n=t.length;i<n;i++)e.call(null,t[i],i,t);else{const r=s?Object.getOwnPropertyNames(t):Object.keys(t),o=r.length;let a;for(i=0;i<o;i++)a=r[i],e.call(null,t[a],a,t)}}function wt(t,e){e=e.toLowerCase();const s=Object.keys(t);let i=s.length,n;for(;i-- >0;)if(n=s[i],e===n.toLowerCase())return n;return null}const Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vt=t=>!ae(t)&&t!==Z;function Ve(){const{caseless:t}=vt(this)&&this||{},e={},s=(i,n)=>{const r=t&&wt(e,n)||n;Ee(e[r])&&Ee(i)?e[r]=Ve(e[r],i):Ee(i)?e[r]=Ve({},i):ie(i)?e[r]=i.slice():e[r]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&ce(arguments[i],s);return e}const $s=(t,e,s,{allOwnKeys:i}={})=>(ce(e,(n,r)=>{s&&M(n)?t[r]=gt(n,s):t[r]=n},{allOwnKeys:i}),t),Hs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),zs=(t,e,s,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},Js=(t,e,s,i)=>{let n,r,o;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),r=n.length;r-- >0;)o=n[r],(!i||i(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=s!==!1&&Me(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Ws=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const i=t.indexOf(e,s);return i!==-1&&i===s},Ks=t=>{if(!t)return null;if(ie(t))return t;let e=t.length;if(!_t(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},Zs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Me(Uint8Array)),Gs=(t,e)=>{const s=(t&&t[ye]).call(t);let i;for(;(i=s.next())&&!i.done;){const n=i.value;e.call(t,n[0],n[1])}},Xs=(t,e)=>{let s;const i=[];for(;(s=t.exec(e))!==null;)i.push(s);return i},Qs=H("HTMLFormElement"),Ys=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),Et=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),ei=H("RegExp"),Tt=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),i={};ce(s,(n,r)=>{let o;(o=e(n,r,t))!==!1&&(i[r]=o||n)}),Object.defineProperties(t,i)},ti=t=>{Tt(t,(e,s)=>{if(M(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const i=t[s];if(M(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},si=(t,e)=>{const s={},i=n=>{n.forEach(r=>{s[r]=!0})};return ie(t)?i(t):i(String(t).split(e)),s},ii=()=>{},ni=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ri(t){return!!(t&&M(t.append)&&t[bt]==="FormData"&&t[ye])}const oi=t=>{const e=new Array(10),s=(i,n)=>{if(ve(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[n]=i;const r=ie(i)?[]:{};return ce(i,(o,a)=>{const c=s(o,n+1);!ae(c)&&(r[a]=c)}),e[n]=void 0,r}}return i};return s(t,0)},ai=H("AsyncFunction"),ci=t=>t&&(ve(t)||M(t))&&M(t.then)&&M(t.catch),St=((t,e)=>t?setImmediate:e?((s,i)=>(Z.addEventListener("message",({source:n,data:r})=>{n===Z&&r===s&&i.length&&i.shift()()},!1),n=>{i.push(n),Z.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",M(Z.postMessage)),li=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||St,ui=t=>t!=null&&M(t[ye]),u={isArray:ie,isArrayBuffer:yt,isBuffer:Os,isFormData:Us,isArrayBufferView:Rs,isString:ks,isNumber:_t,isBoolean:As,isObject:ve,isPlainObject:Ee,isReadableStream:Fs,isRequest:Ms,isResponse:Vs,isHeaders:qs,isUndefined:ae,isDate:Ds,isFile:Is,isBlob:Ps,isRegExp:ei,isFunction:M,isStream:js,isURLSearchParams:Ls,isTypedArray:Zs,isFileList:Ns,forEach:ce,merge:Ve,extend:$s,trim:Bs,stripBOM:Hs,inherits:zs,toFlatObject:Js,kindOf:_e,kindOfTest:H,endsWith:Ws,toArray:Ks,forEachEntry:Gs,matchAll:Xs,isHTMLForm:Qs,hasOwnProperty:Et,hasOwnProp:Et,reduceDescriptors:Tt,freezeMethods:ti,toObjectSet:si,toCamelCase:Ys,noop:ii,toFiniteNumber:ni,findKey:wt,global:Z,isContextDefined:vt,isSpecCompliantForm:ri,toJSONObject:oi,isAsyncFn:ai,isThenable:ci,setImmediate:St,asap:li,isIterable:ui};function v(t,e,s,i,n){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),s&&(this.config=s),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}u.inherits(v,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:u.toJSONObject(this.config),code:this.code,status:this.status}}});const xt=v.prototype,Ct={};["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=>{Ct[t]={value:t}}),Object.defineProperties(v,Ct),Object.defineProperty(xt,"isAxiosError",{value:!0}),v.from=(t,e,s,i,n,r)=>{const o=Object.create(xt);return u.toFlatObject(t,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),v.call(o,t.message,e,s,i,n),o.cause=t,o.name=t.name,r&&Object.assign(o,r),o};const di=null;function qe(t){return u.isPlainObject(t)||u.isArray(t)}function Ot(t){return u.endsWith(t,"[]")?t.slice(0,-2):t}function Rt(t,e,s){return t?t.concat(e).map(function(i,n){return i=Ot(i),!s&&n?"["+i+"]":i}).join(s?".":""):e}function hi(t){return u.isArray(t)&&!t.some(qe)}const fi=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function Te(t,e,s){if(!u.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=u.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,w){return!u.isUndefined(w[h])});const i=s.metaTokens,n=s.visitor||l,r=s.dots,o=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(e);if(!u.isFunction(n))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(u.isDate(h))return h.toISOString();if(!a&&u.isBlob(h))throw new v("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(h)||u.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,w,p){let E=h;if(h&&!p&&typeof h=="object"){if(u.endsWith(w,"{}"))w=i?w:w.slice(0,-2),h=JSON.stringify(h);else if(u.isArray(h)&&hi(h)||(u.isFileList(h)||u.endsWith(w,"[]"))&&(E=u.toArray(h)))return w=Ot(w),E.forEach(function(T,x){!(u.isUndefined(T)||T===null)&&e.append(o===!0?Rt([w],x,r):o===null?w:w+"[]",c(T))}),!1}return qe(h)?!0:(e.append(Rt(p,w,r),c(h)),!1)}const d=[],g=Object.assign(fi,{defaultVisitor:l,convertValue:c,isVisitable:qe});function b(h,w){if(!u.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(h),u.forEach(h,function(p,E){(!(u.isUndefined(p)||p===null)&&n.call(e,p,u.isString(E)?E.trim():E,w,g))===!0&&b(p,w?w.concat(E):[E])}),d.pop()}}if(!u.isObject(t))throw new TypeError("data must be an object");return b(t),e}function kt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Be(t,e){this._pairs=[],t&&Te(t,this,e)}const At=Be.prototype;At.append=function(t,e){this._pairs.push([t,e])},At.toString=function(t){const e=t?function(s){return t.call(this,s,kt)}:kt;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function pi(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Dt(t,e,s){if(!e)return t;const i=s&&s.encode||pi;u.isFunction(s)&&(s={serialize:s});const n=s&&s.serialize;let r;if(n?r=n(e,s):r=u.isURLSearchParams(e)?e.toString():new Be(e,s).toString(i),r){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}class It{constructor(){this.handlers=[]}use(e,s,i){return this.handlers.push({fulfilled:e,rejected:s,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){u.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Pt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mi=typeof URLSearchParams<"u"?URLSearchParams:Be,gi=typeof FormData<"u"?FormData:null,bi=typeof Blob<"u"?Blob:null,yi={isBrowser:!0,classes:{URLSearchParams:mi,FormData:gi,Blob:bi},protocols:["http","https","file","blob","url","data"]},$e=typeof window<"u"&&typeof document<"u",He=typeof navigator=="object"&&navigator||void 0,_i=$e&&(!He||["ReactNative","NativeScript","NS"].indexOf(He.product)<0),wi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vi=$e&&window.location.href||"http://localhost",Ei=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$e,hasStandardBrowserEnv:_i,hasStandardBrowserWebWorkerEnv:wi,navigator:He,origin:vi},Symbol.toStringTag,{value:"Module"})),U={...Ei,...yi};function Ti(t,e){return Te(t,new U.classes.URLSearchParams,Object.assign({visitor:function(s,i,n,r){return U.isNode&&u.isBuffer(s)?(this.append(i,s.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Si(t){return u.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xi(t){const e={},s=Object.keys(t);let i;const n=s.length;let r;for(i=0;i<n;i++)r=s[i],e[r]=t[r];return e}function Nt(t){function e(s,i,n,r){let o=s[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=r>=s.length;return o=!o&&u.isArray(n)?n.length:o,c?(u.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i,!a):((!n[o]||!u.isObject(n[o]))&&(n[o]=[]),e(s,i,n[o],r)&&u.isArray(n[o])&&(n[o]=xi(n[o])),!a)}if(u.isFormData(t)&&u.isFunction(t.entries)){const s={};return u.forEachEntry(t,(i,n)=>{e(Si(i),n,s,0)}),s}return null}function Ci(t,e,s){if(u.isString(t))try{return(e||JSON.parse)(t),u.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(s||JSON.stringify)(t)}const le={transitional:Pt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,n=u.isObject(t);if(n&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return i?JSON.stringify(Nt(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t)||u.isReadableStream(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ti(t,this.formSerializer).toString();if((r=u.isFileList(t))||s.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Te(r?{"files[]":t}:t,o&&new o,this.formSerializer)}}return n||i?(e.setContentType("application/json",!1),Ci(t)):t}],transformResponse:[function(t){const e=this.transitional||le.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(u.isResponse(t)||u.isReadableStream(t))return t;if(t&&u.isString(t)&&(s&&!this.responseType||i)){const n=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(r){if(n)throw r.name==="SyntaxError"?v.from(r,v.ERR_BAD_RESPONSE,this,null,this.response):r}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],t=>{le.headers[t]={}});const Oi=u.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"]),Ri=t=>{const e={};let s,i,n;return t&&t.split(`
3
- `).forEach(function(r){n=r.indexOf(":"),s=r.substring(0,n).trim().toLowerCase(),i=r.substring(n+1).trim(),!(!s||e[s]&&Oi[s])&&(s==="set-cookie"?e[s]?e[s].push(i):e[s]=[i]:e[s]=e[s]?e[s]+", "+i:i)}),e},jt=Symbol("internals");function ue(t){return t&&String(t).trim().toLowerCase()}function Se(t){return t===!1||t==null?t:u.isArray(t)?t.map(Se):String(t)}function ki(t){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=s.exec(t);)e[i[1]]=i[2];return e}const Ai=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ze(t,e,s,i,n){if(u.isFunction(i))return i.call(this,e,s);if(n&&(e=s),!!u.isString(e)){if(u.isString(i))return e.indexOf(i)!==-1;if(u.isRegExp(i))return i.test(e)}}function Di(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,i)=>s.toUpperCase()+i)}function Ii(t,e){const s=u.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+s,{value:function(n,r,o){return this[i].call(this,e,n,r,o)},configurable:!0})})}let V=class{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function n(o,a,c){const l=ue(a);if(!l)throw new Error("header name must be a non-empty string");const d=u.findKey(i,l);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||a]=Se(o))}const r=(o,a)=>u.forEach(o,(c,l)=>n(c,l,a));if(u.isPlainObject(t)||t instanceof this.constructor)r(t,e);else if(u.isString(t)&&(t=t.trim())&&!Ai(t))r(Ri(t),e);else if(u.isObject(t)&&u.isIterable(t)){let o={},a,c;for(const l of t){if(!u.isArray(l))throw TypeError("Object iterator must return a key-value pair");o[c=l[0]]=(a=o[c])?u.isArray(a)?[...a,l[1]]:[a,l[1]]:l[1]}r(o,e)}else t!=null&&n(e,t,s);return this}get(t,e){if(t=ue(t),t){const s=u.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return ki(i);if(u.isFunction(e))return e.call(this,i,s);if(u.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ue(t),t){const s=u.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||ze(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function n(r){if(r=ue(r),r){const o=u.findKey(s,r);o&&(!e||ze(s,s[o],o,e))&&(delete s[o],i=!0)}}return u.isArray(t)?t.forEach(n):n(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const n=e[s];(!t||ze(this,this[n],n,t,!0))&&(delete this[n],i=!0)}return i}normalize(t){const e=this,s={};return u.forEach(this,(i,n)=>{const r=u.findKey(s,n);if(r){e[r]=Se(i),delete e[n];return}const o=t?Di(n):String(n).trim();o!==n&&delete e[n],e[o]=Se(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return u.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&u.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
4
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(i=>s.set(i)),s}static accessor(t){const e=(this[jt]=this[jt]={accessors:{}}).accessors,s=this.prototype;function i(n){const r=ue(n);e[r]||(Ii(s,n),e[r]=!0)}return u.isArray(t)?t.forEach(i):i(t),this}};V.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(V.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[s]=i}}}),u.freezeMethods(V);function Je(t,e){const s=this||le,i=e||s,n=V.from(i.headers);let r=i.data;return u.forEach(t,function(o){r=o.call(s,r,n.normalize(),e?e.status:void 0)}),n.normalize(),r}function Ut(t){return!!(t&&t.__CANCEL__)}function ne(t,e,s){v.call(this,t??"canceled",v.ERR_CANCELED,e,s),this.name="CanceledError"}u.inherits(ne,v,{__CANCEL__:!0});function Lt(t,e,s){const i=s.config.validateStatus;!s.status||!i||i(s.status)?t(s):e(new v("Request failed with status code "+s.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Pi(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ni(t,e){t=t||10;const s=new Array(t),i=new Array(t);let n=0,r=0,o;return e=e!==void 0?e:1e3,function(a){const c=Date.now(),l=i[r];o||(o=c),s[n]=a,i[n]=c;let d=r,g=0;for(;d!==n;)g+=s[d++],d=d%t;if(n=(n+1)%t,n===r&&(r=(r+1)%t),c-o<e)return;const b=l&&c-l;return b?Math.round(g*1e3/b):void 0}}function ji(t,e){let s=0,i=1e3/e,n,r;const o=(a,c=Date.now())=>{s=c,n=null,r&&(clearTimeout(r),r=null),t.apply(null,a)};return[(...a)=>{const c=Date.now(),l=c-s;l>=i?o(a,c):(n=a,r||(r=setTimeout(()=>{r=null,o(n)},i-l)))},()=>n&&o(n)]}const xe=(t,e,s=3)=>{let i=0;const n=Ni(50,250);return ji(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,c=o-i,l=n(c),d=o<=a;i=o;const g={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&d?(a-o)/l:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(g)},s)},Ft=(t,e)=>{const s=t!=null;return[i=>e[0]({lengthComputable:s,total:t,loaded:i}),e[1]]},Mt=t=>(...e)=>u.asap(()=>t(...e)),Ui=U.hasStandardBrowserEnv?((t,e)=>s=>(s=new URL(s,U.origin),t.protocol===s.protocol&&t.host===s.host&&(e||t.port===s.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,Li=U.hasStandardBrowserEnv?{write(t,e,s,i,n,r){const o=[t+"="+encodeURIComponent(e)];u.isNumber(s)&&o.push("expires="+new Date(s).toGMTString()),u.isString(i)&&o.push("path="+i),u.isString(n)&&o.push("domain="+n),r===!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 Fi(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Mi(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Vt(t,e,s){let i=!Fi(e);return t&&(i||s==!1)?Mi(t,e):e}const qt=t=>t instanceof V?{...t}:t;function G(t,e){e=e||{};const s={};function i(l,d,g,b){return u.isPlainObject(l)&&u.isPlainObject(d)?u.merge.call({caseless:b},l,d):u.isPlainObject(d)?u.merge({},d):u.isArray(d)?d.slice():d}function n(l,d,g,b){if(u.isUndefined(d)){if(!u.isUndefined(l))return i(void 0,l,g,b)}else return i(l,d,g,b)}function r(l,d){if(!u.isUndefined(d))return i(void 0,d)}function o(l,d){if(u.isUndefined(d)){if(!u.isUndefined(l))return i(void 0,l)}else return i(void 0,d)}function a(l,d,g){if(g in e)return i(l,d);if(g in t)return i(void 0,l)}const c={url:r,method:r,data:r,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:a,headers:(l,d,g)=>n(qt(l),qt(d),g,!0)};return u.forEach(Object.keys(Object.assign({},t,e)),function(l){const d=c[l]||n,g=d(t[l],e[l],l);u.isUndefined(g)&&d!==a||(s[l]=g)}),s}const Bt=t=>{const e=G({},t);let{data:s,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:r,headers:o,auth:a}=e;e.headers=o=V.from(o),e.url=Dt(Vt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(u.isFormData(s)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...d]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...d].join("; "))}}if(U.hasStandardBrowserEnv&&(i&&u.isFunction(i)&&(i=i(e)),i||i!==!1&&Ui(e.url))){const l=n&&r&&Li.read(r);l&&o.set(n,l)}return e},Vi=typeof XMLHttpRequest<"u",qi=Vi&&function(t){return new Promise(function(e,s){const i=Bt(t);let n=i.data;const r=V.from(i.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:c}=i,l,d,g,b,h;function w(){b&&b(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function E(){if(!p)return;const x=V.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),O={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:x,config:t,request:p};Lt(function(j){e(j),w()},function(j){s(j),w()},O),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(s(new v("Request aborted",v.ECONNABORTED,t,p)),p=null)},p.onerror=function(){s(new v("Network Error",v.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const O=i.transitional||Pt;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),s(new v(x,O.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},n===void 0&&r.setContentType(null),"setRequestHeader"in p&&u.forEach(r.toJSON(),function(x,O){p.setRequestHeader(O,x)}),u.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),o&&o!=="json"&&(p.responseType=i.responseType),c&&([g,h]=xe(c,!0),p.addEventListener("progress",g)),a&&p.upload&&([d,b]=xe(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(l=x=>{p&&(s(!x||x.type?new ne(null,t,p):x),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const T=Pi(i.url);if(T&&U.protocols.indexOf(T)===-1){s(new v("Unsupported protocol "+T+":",v.ERR_BAD_REQUEST,t));return}p.send(n||null)})},Bi=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let i=new AbortController,n;const r=function(l){if(!n){n=!0,a();const d=l instanceof Error?l:this.reason;i.abort(d instanceof v?d:new ne(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,r(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(r):l.removeEventListener("abort",r)}),t=null)};t.forEach(l=>l.addEventListener("abort",r));const{signal:c}=i;return c.unsubscribe=()=>u.asap(a),c}},$i=function*(t,e){let s=t.byteLength;if(s<e){yield t;return}let i=0,n;for(;i<s;)n=i+e,yield t.slice(i,n),i=n},Hi=async function*(t,e){for await(const s of zi(t))yield*$i(s,e)},zi=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:s,value:i}=await e.read();if(s)break;yield i}}finally{await e.cancel()}},$t=(t,e,s,i)=>{const n=Hi(t,e);let r=0,o,a=c=>{o||(o=!0,i&&i(c))};return new ReadableStream({async pull(c){try{const{done:l,value:d}=await n.next();if(l){a(),c.close();return}let g=d.byteLength;if(s){let b=r+=g;s(b)}c.enqueue(new Uint8Array(d))}catch(l){throw a(l),l}},cancel(c){return a(c),n.return()}},{highWaterMark:2})},Ce=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ht=Ce&&typeof ReadableStream=="function",Ji=Ce&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),zt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Wi=Ht&&zt(()=>{let t=!1;const e=new Request(U.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Jt=64*1024,We=Ht&&zt(()=>u.isReadableStream(new Response("").body)),Oe={stream:We&&(t=>t.body)};Ce&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Oe[e]&&(Oe[e]=u.isFunction(t[e])?s=>s[e]():(s,i)=>{throw new v(`Response type '${e}' is not supported`,v.ERR_NOT_SUPPORT,i)})})})(new Response);const Ki=async t=>{if(t==null)return 0;if(u.isBlob(t))return t.size;if(u.isSpecCompliantForm(t))return(await new Request(U.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(u.isArrayBufferView(t)||u.isArrayBuffer(t))return t.byteLength;if(u.isURLSearchParams(t)&&(t=t+""),u.isString(t))return(await Ji(t)).byteLength},Zi=async(t,e)=>u.toFiniteNumber(t.getContentLength())??Ki(e),Gi=Ce&&(async t=>{let{url:e,method:s,data:i,signal:n,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:d,withCredentials:g="same-origin",fetchOptions:b}=Bt(t);l=l?(l+"").toLowerCase():"text";let h=Bi([n,r&&r.toAbortSignal()],o),w;const p=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let E;try{if(c&&Wi&&s!=="get"&&s!=="head"&&(E=await Zi(d,i))!==0){let _=new Request(e,{method:"POST",body:i,duplex:"half"}),k;if(u.isFormData(i)&&(k=_.headers.get("content-type"))&&d.setContentType(k),_.body){const[D,q]=Ft(E,xe(Mt(c)));i=$t(_.body,Jt,D,q)}}u.isString(g)||(g=g?"include":"omit");const T="credentials"in Request.prototype;w=new Request(e,{...b,signal:h,method:s.toUpperCase(),headers:d.normalize().toJSON(),body:i,duplex:"half",credentials:T?g:void 0});let x=await fetch(w);const O=We&&(l==="stream"||l==="response");if(We&&(a||O&&p)){const _={};["status","statusText","headers"].forEach($=>{_[$]=x[$]});const k=u.toFiniteNumber(x.headers.get("content-length")),[D,q]=a&&Ft(k,xe(Mt(a),!0))||[];x=new Response($t(x.body,Jt,D,()=>{q&&q(),p&&p()}),_)}l=l||"text";let j=await Oe[u.findKey(Oe,l)||"text"](x,t);return!O&&p&&p(),await new Promise((_,k)=>{Lt(_,k,{data:j,headers:V.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:w})})}catch(T){throw p&&p(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,t,w),{cause:T.cause||T}):v.from(T,T&&T.code,t,w)}}),Ke={http:di,xhr:qi,fetch:Gi};u.forEach(Ke,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Wt=t=>`- ${t}`,Xi=t=>u.isFunction(t)||t===null||t===!1,Kt={getAdapter:t=>{t=u.isArray(t)?t:[t];const{length:e}=t;let s,i;const n={};for(let r=0;r<e;r++){s=t[r];let o;if(i=s,!Xi(s)&&(i=Ke[(o=String(s)).toLowerCase()],i===void 0))throw new v(`Unknown adapter '${o}'`);if(i)break;n[o||"#"+r]=i}if(!i){const r=Object.entries(n).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since :
1
+ System.register(["./main-5dc41c7d1aed03caf8c4.js","vue","vue-router","single-spa","vuex","vuetify"],function(_s,Er){"use strict";var at,ct,lt,ut,dt,ht,ft,C,L,A,pt,f,m,ge,J,K,te,oe,F,Ue,Le,se,Fe,mt,Me;return{setters:[R=>{at=R.d,ct=R._,lt=R.N,ut=R.R,dt=R.w,ht=R.a,ft=R.v},R=>{C=R.resolveComponent,L=R.createBlock,A=R.openBlock,pt=R.Teleport,f=R.createVNode,m=R.withCtx,ge=R.createElementVNode,J=R.toDisplayString,K=R.createElementBlock,te=R.Fragment,oe=R.renderList,F=R.createTextVNode,Ue=R.mergeProps,Le=R.createSlots,se=R.createCommentVNode,Fe=R.normalizeStyle,mt=R.withModifiers,Me=R.withKeys},null,null,null,null],execute:function(){var R=document.createElement("style");R.textContent=`.title-font[data-v-f98b189b]{font-size:1.125rem}.v-progress-linear__determinate[data-v-f98b189b]{transition:none!important}
2
+ /*$vite$:1*/`,document.head.appendChild(R);const ws={props:{menus:{type:Array,default:function(){return[]}},title:{type:String,default:""}},methods:{formatDT:function(t){return t.replaceAll(" ","-").toLowerCase()},subMenuClick(t){t.command(t),this.$refs.topmenu[0].isActive=!1}},mounted(){document.title=this.title}},vs={class:"app-title mr-2"};function Es(t,e,s,i,n,r){const o=C("v-col"),a=C("v-row"),c=C("v-icon"),l=C("v-btn"),d=C("v-divider"),g=C("v-list-item-title"),b=C("v-list-item"),h=C("v-list"),w=C("v-menu"),p=C("v-radio"),E=C("v-list-item-action"),T=C("v-radio-group"),x=C("v-checkbox");return A(),L(pt,{to:"#openc3-menu"},[f(a,{"no-gutters":""},{default:m(()=>[f(o,{"align-self":"end"},{default:m(()=>[ge("span",vs,J(s.title),1)]),_:1})]),_:1}),f(a,{dense:"",class:"flex-nowrap"},{default:m(()=>[(A(!0),K(te,null,oe(s.menus,(O,j)=>(A(),L(w,{ref_for:!0,ref:"topmenu",key:j},{activator:m(({props:_})=>[f(l,Ue({ref_for:!0},_,{variant:"outlined",class:"mx-1 menu-button",text:O.label,"data-test":r.formatDT(`${s.title} ${O.label}`)}),{append:m(()=>[f(c,{class:"menu-button-icon"},{default:m(()=>e[0]||(e[0]=[F(" mdi-menu-down ")])),_:1})]),_:2},1040,["text","data-test"])]),default:m(()=>[f(h,null,{default:m(()=>[(A(!0),K(te,null,oe(O.items,(_,k)=>(A(),K(te,null,[_.divider?(A(),L(d,{key:k+"-divider"})):_.subMenu&&_.subMenu.length>0?(A(),K("div",{key:k+"-submenu"},[(A(),L(w,{"open-on-hover":"",location:"right",key:k},{activator:m(({props:D})=>[(A(),L(b,Ue({ref_for:!0},D,{disabled:_.disabled,key:k}),Le({append:m(()=>[f(c,null,{default:m(()=>e[1]||(e[1]=[F(" mdi-chevron-right ")])),_:1})]),default:m(()=>[!_.radio&&!_.checkbox?(A(),L(g,{key:0,style:Fe("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[F(J(_.label),1)]),_:2},1032,["style"])):se("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[f(c,{disabled:_.disabled},{default:m(()=>[F(J(_.icon),1)]),_:2},1032,["disabled"])]),key:"0"}:void 0]),1040,["disabled"]))]),default:m(()=>[f(h,null,{default:m(()=>[(A(!0),K(te,null,oe(_.subMenu,(D,q)=>(A(),L(b,{key:q,"prepend-icon":D.icon,onClick:$=>r.subMenuClick(D)},{default:m(()=>[f(g,null,{default:m(()=>[F(J(D.label),1)]),_:2},1024)]),_:2},1032,["prepend-icon","onClick"]))),128))]),_:2},1024)]),_:2},1024))])):_.radioGroup?(A(),L(T,{"model-value":_.value,"onUpdate:modelValue":_.command,key:k+"-radio-group","hide-details":"",density:"compact",class:"ma-0 pa-0"},{default:m(()=>[(A(!0),K(te,null,oe(_.choices,(D,q)=>(A(),L(b,{key:q+"-choice"},{default:m(()=>[f(E,{class:"list-action"},{default:m(()=>[f(p,{color:"secondary",label:D.label,value:D.value,density:"compact","hide-details":""},null,8,["label","value"])]),_:2},1024)]),_:2},1024))),128))]),_:2},1032,["model-value","onUpdate:modelValue"])):(A(),L(b,{onClick:D=>_.command(_),disabled:_.disabled,"data-test":r.formatDT(`${s.title} ${O.label} ${_.label}`),key:k+"-list"},Le({default:m(()=>[_.checkbox?(A(),L(E,{key:0,class:"list-action"},{default:m(()=>[f(x,{modelValue:_.checked,"onUpdate:modelValue":D=>_.checked=D,label:_.label,color:"secondary",density:"compact","hide-details":""},null,8,["modelValue","onUpdate:modelValue","label"])]),_:2},1024)):se("",!0),!_.radio&&!_.checkbox?(A(),L(g,{key:1,style:Fe("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[F(J(_.label),1)]),_:2},1032,["style"])):se("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[f(c,{icon:_.icon,disabled:_.disabled},null,8,["icon","disabled"])]),key:"0"}:void 0]),1032,["onClick","disabled","data-test"]))],64))),256))]),_:2},1024)]),_:2},1024))),128))]),_:1})])}const Ts=at(ws,[["render",Es],["__scopeId","data-v-4d454b93"]]);var Ss=Object.defineProperty,xs=(t,e,s)=>e in t?Ss(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,be=(t,e,s)=>xs(t,typeof e!="symbol"?e+"":e,s);function gt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Cs}=Object.prototype,{getPrototypeOf:Ve}=Object,{iterator:ye,toStringTag:bt}=Symbol,_e=(t=>e=>{const s=Cs.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),H=t=>(t=t.toLowerCase(),e=>_e(e)===t),we=t=>e=>typeof e===t,{isArray:ie}=Array,ae=we("undefined");function Os(t){return t!==null&&!ae(t)&&t.constructor!==null&&!ae(t.constructor)&&M(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const yt=H("ArrayBuffer");function Rs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&yt(t.buffer),e}const ks=we("string"),M=we("function"),_t=we("number"),ve=t=>t!==null&&typeof t=="object",As=t=>t===!0||t===!1,Ee=t=>{if(_e(t)!=="object")return!1;const e=Ve(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(bt in t)&&!(ye in t)},Ds=H("Date"),Is=H("File"),Ps=H("Blob"),Ns=H("FileList"),js=t=>ve(t)&&M(t.pipe),Us=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||M(t.append)&&((e=_e(t))==="formdata"||e==="object"&&M(t.toString)&&t.toString()==="[object FormData]"))},Ls=H("URLSearchParams"),[Fs,Ms,Vs,qs]=["ReadableStream","Request","Response","Headers"].map(H),Bs=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ce(t,e,{allOwnKeys:s=!1}={}){if(t===null||typeof t>"u")return;let i,n;if(typeof t!="object"&&(t=[t]),ie(t))for(i=0,n=t.length;i<n;i++)e.call(null,t[i],i,t);else{const r=s?Object.getOwnPropertyNames(t):Object.keys(t),o=r.length;let a;for(i=0;i<o;i++)a=r[i],e.call(null,t[a],a,t)}}function wt(t,e){e=e.toLowerCase();const s=Object.keys(t);let i=s.length,n;for(;i-- >0;)if(n=s[i],e===n.toLowerCase())return n;return null}const Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,vt=t=>!ae(t)&&t!==Z;function qe(){const{caseless:t}=vt(this)&&this||{},e={},s=(i,n)=>{const r=t&&wt(e,n)||n;Ee(e[r])&&Ee(i)?e[r]=qe(e[r],i):Ee(i)?e[r]=qe({},i):ie(i)?e[r]=i.slice():e[r]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&ce(arguments[i],s);return e}const $s=(t,e,s,{allOwnKeys:i}={})=>(ce(e,(n,r)=>{s&&M(n)?t[r]=gt(n,s):t[r]=n},{allOwnKeys:i}),t),Hs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),zs=(t,e,s,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),s&&Object.assign(t.prototype,s)},Js=(t,e,s,i)=>{let n,r,o;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),r=n.length;r-- >0;)o=n[r],(!i||i(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=s!==!1&&Ve(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Ws=(t,e,s)=>{t=String(t),(s===void 0||s>t.length)&&(s=t.length),s-=e.length;const i=t.indexOf(e,s);return i!==-1&&i===s},Ks=t=>{if(!t)return null;if(ie(t))return t;let e=t.length;if(!_t(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},Zs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ve(Uint8Array)),Gs=(t,e)=>{const s=(t&&t[ye]).call(t);let i;for(;(i=s.next())&&!i.done;){const n=i.value;e.call(t,n[0],n[1])}},Xs=(t,e)=>{let s;const i=[];for(;(s=t.exec(e))!==null;)i.push(s);return i},Qs=H("HTMLFormElement"),Ys=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),Et=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),ei=H("RegExp"),Tt=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),i={};ce(s,(n,r)=>{let o;(o=e(n,r,t))!==!1&&(i[r]=o||n)}),Object.defineProperties(t,i)},ti=t=>{Tt(t,(e,s)=>{if(M(t)&&["arguments","caller","callee"].indexOf(s)!==-1)return!1;const i=t[s];if(M(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+s+"'")})}})},si=(t,e)=>{const s={},i=n=>{n.forEach(r=>{s[r]=!0})};return ie(t)?i(t):i(String(t).split(e)),s},ii=()=>{},ni=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ri(t){return!!(t&&M(t.append)&&t[bt]==="FormData"&&t[ye])}const oi=t=>{const e=new Array(10),s=(i,n)=>{if(ve(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[n]=i;const r=ie(i)?[]:{};return ce(i,(o,a)=>{const c=s(o,n+1);!ae(c)&&(r[a]=c)}),e[n]=void 0,r}}return i};return s(t,0)},ai=H("AsyncFunction"),ci=t=>t&&(ve(t)||M(t))&&M(t.then)&&M(t.catch),St=((t,e)=>t?setImmediate:e?((s,i)=>(Z.addEventListener("message",({source:n,data:r})=>{n===Z&&r===s&&i.length&&i.shift()()},!1),n=>{i.push(n),Z.postMessage(s,"*")}))(`axios@${Math.random()}`,[]):s=>setTimeout(s))(typeof setImmediate=="function",M(Z.postMessage)),li=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||St,ui=t=>t!=null&&M(t[ye]),u={isArray:ie,isArrayBuffer:yt,isBuffer:Os,isFormData:Us,isArrayBufferView:Rs,isString:ks,isNumber:_t,isBoolean:As,isObject:ve,isPlainObject:Ee,isReadableStream:Fs,isRequest:Ms,isResponse:Vs,isHeaders:qs,isUndefined:ae,isDate:Ds,isFile:Is,isBlob:Ps,isRegExp:ei,isFunction:M,isStream:js,isURLSearchParams:Ls,isTypedArray:Zs,isFileList:Ns,forEach:ce,merge:qe,extend:$s,trim:Bs,stripBOM:Hs,inherits:zs,toFlatObject:Js,kindOf:_e,kindOfTest:H,endsWith:Ws,toArray:Ks,forEachEntry:Gs,matchAll:Xs,isHTMLForm:Qs,hasOwnProperty:Et,hasOwnProp:Et,reduceDescriptors:Tt,freezeMethods:ti,toObjectSet:si,toCamelCase:Ys,noop:ii,toFiniteNumber:ni,findKey:wt,global:Z,isContextDefined:vt,isSpecCompliantForm:ri,toJSONObject:oi,isAsyncFn:ai,isThenable:ci,setImmediate:St,asap:li,isIterable:ui};function v(t,e,s,i,n){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),s&&(this.config=s),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}u.inherits(v,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:u.toJSONObject(this.config),code:this.code,status:this.status}}});const xt=v.prototype,Ct={};["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=>{Ct[t]={value:t}}),Object.defineProperties(v,Ct),Object.defineProperty(xt,"isAxiosError",{value:!0}),v.from=(t,e,s,i,n,r)=>{const o=Object.create(xt);return u.toFlatObject(t,o,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),v.call(o,t.message,e,s,i,n),o.cause=t,o.name=t.name,r&&Object.assign(o,r),o};const di=null;function Be(t){return u.isPlainObject(t)||u.isArray(t)}function Ot(t){return u.endsWith(t,"[]")?t.slice(0,-2):t}function Rt(t,e,s){return t?t.concat(e).map(function(i,n){return i=Ot(i),!s&&n?"["+i+"]":i}).join(s?".":""):e}function hi(t){return u.isArray(t)&&!t.some(Be)}const fi=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function Te(t,e,s){if(!u.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,s=u.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(h,w){return!u.isUndefined(w[h])});const i=s.metaTokens,n=s.visitor||l,r=s.dots,o=s.indexes,a=(s.Blob||typeof Blob<"u"&&Blob)&&u.isSpecCompliantForm(e);if(!u.isFunction(n))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(u.isDate(h))return h.toISOString();if(!a&&u.isBlob(h))throw new v("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(h)||u.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,w,p){let E=h;if(h&&!p&&typeof h=="object"){if(u.endsWith(w,"{}"))w=i?w:w.slice(0,-2),h=JSON.stringify(h);else if(u.isArray(h)&&hi(h)||(u.isFileList(h)||u.endsWith(w,"[]"))&&(E=u.toArray(h)))return w=Ot(w),E.forEach(function(T,x){!(u.isUndefined(T)||T===null)&&e.append(o===!0?Rt([w],x,r):o===null?w:w+"[]",c(T))}),!1}return Be(h)?!0:(e.append(Rt(p,w,r),c(h)),!1)}const d=[],g=Object.assign(fi,{defaultVisitor:l,convertValue:c,isVisitable:Be});function b(h,w){if(!u.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(h),u.forEach(h,function(p,E){(!(u.isUndefined(p)||p===null)&&n.call(e,p,u.isString(E)?E.trim():E,w,g))===!0&&b(p,w?w.concat(E):[E])}),d.pop()}}if(!u.isObject(t))throw new TypeError("data must be an object");return b(t),e}function kt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function $e(t,e){this._pairs=[],t&&Te(t,this,e)}const At=$e.prototype;At.append=function(t,e){this._pairs.push([t,e])},At.toString=function(t){const e=t?function(s){return t.call(this,s,kt)}:kt;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function pi(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Dt(t,e,s){if(!e)return t;const i=s&&s.encode||pi;u.isFunction(s)&&(s={serialize:s});const n=s&&s.serialize;let r;if(n?r=n(e,s):r=u.isURLSearchParams(e)?e.toString():new $e(e,s).toString(i),r){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}class It{constructor(){this.handlers=[]}use(e,s,i){return this.handlers.push({fulfilled:e,rejected:s,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){u.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Pt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mi=typeof URLSearchParams<"u"?URLSearchParams:$e,gi=typeof FormData<"u"?FormData:null,bi=typeof Blob<"u"?Blob:null,yi={isBrowser:!0,classes:{URLSearchParams:mi,FormData:gi,Blob:bi},protocols:["http","https","file","blob","url","data"]},He=typeof window<"u"&&typeof document<"u",ze=typeof navigator=="object"&&navigator||void 0,_i=He&&(!ze||["ReactNative","NativeScript","NS"].indexOf(ze.product)<0),wi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vi=He&&window.location.href||"http://localhost",Ei=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:He,hasStandardBrowserEnv:_i,hasStandardBrowserWebWorkerEnv:wi,navigator:ze,origin:vi},Symbol.toStringTag,{value:"Module"})),U={...Ei,...yi};function Ti(t,e){return Te(t,new U.classes.URLSearchParams,Object.assign({visitor:function(s,i,n,r){return U.isNode&&u.isBuffer(s)?(this.append(i,s.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Si(t){return u.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function xi(t){const e={},s=Object.keys(t);let i;const n=s.length;let r;for(i=0;i<n;i++)r=s[i],e[r]=t[r];return e}function Nt(t){function e(s,i,n,r){let o=s[r++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=r>=s.length;return o=!o&&u.isArray(n)?n.length:o,c?(u.hasOwnProp(n,o)?n[o]=[n[o],i]:n[o]=i,!a):((!n[o]||!u.isObject(n[o]))&&(n[o]=[]),e(s,i,n[o],r)&&u.isArray(n[o])&&(n[o]=xi(n[o])),!a)}if(u.isFormData(t)&&u.isFunction(t.entries)){const s={};return u.forEachEntry(t,(i,n)=>{e(Si(i),n,s,0)}),s}return null}function Ci(t,e,s){if(u.isString(t))try{return(e||JSON.parse)(t),u.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(s||JSON.stringify)(t)}const le={transitional:Pt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const s=e.getContentType()||"",i=s.indexOf("application/json")>-1,n=u.isObject(t);if(n&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return i?JSON.stringify(Nt(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t)||u.isReadableStream(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Ti(t,this.formSerializer).toString();if((r=u.isFileList(t))||s.indexOf("multipart/form-data")>-1){const o=this.env&&this.env.FormData;return Te(r?{"files[]":t}:t,o&&new o,this.formSerializer)}}return n||i?(e.setContentType("application/json",!1),Ci(t)):t}],transformResponse:[function(t){const e=this.transitional||le.transitional,s=e&&e.forcedJSONParsing,i=this.responseType==="json";if(u.isResponse(t)||u.isReadableStream(t))return t;if(t&&u.isString(t)&&(s&&!this.responseType||i)){const n=!(e&&e.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(r){if(n)throw r.name==="SyntaxError"?v.from(r,v.ERR_BAD_RESPONSE,this,null,this.response):r}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};u.forEach(["delete","get","head","post","put","patch"],t=>{le.headers[t]={}});const Oi=u.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"]),Ri=t=>{const e={};let s,i,n;return t&&t.split(`
3
+ `).forEach(function(r){n=r.indexOf(":"),s=r.substring(0,n).trim().toLowerCase(),i=r.substring(n+1).trim(),!(!s||e[s]&&Oi[s])&&(s==="set-cookie"?e[s]?e[s].push(i):e[s]=[i]:e[s]=e[s]?e[s]+", "+i:i)}),e},jt=Symbol("internals");function ue(t){return t&&String(t).trim().toLowerCase()}function Se(t){return t===!1||t==null?t:u.isArray(t)?t.map(Se):String(t)}function ki(t){const e=Object.create(null),s=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=s.exec(t);)e[i[1]]=i[2];return e}const Ai=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Je(t,e,s,i,n){if(u.isFunction(i))return i.call(this,e,s);if(n&&(e=s),!!u.isString(e)){if(u.isString(i))return e.indexOf(i)!==-1;if(u.isRegExp(i))return i.test(e)}}function Di(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,i)=>s.toUpperCase()+i)}function Ii(t,e){const s=u.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+s,{value:function(n,r,o){return this[i].call(this,e,n,r,o)},configurable:!0})})}let V=class{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function n(o,a,c){const l=ue(a);if(!l)throw new Error("header name must be a non-empty string");const d=u.findKey(i,l);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||a]=Se(o))}const r=(o,a)=>u.forEach(o,(c,l)=>n(c,l,a));if(u.isPlainObject(t)||t instanceof this.constructor)r(t,e);else if(u.isString(t)&&(t=t.trim())&&!Ai(t))r(Ri(t),e);else if(u.isObject(t)&&u.isIterable(t)){let o={},a,c;for(const l of t){if(!u.isArray(l))throw TypeError("Object iterator must return a key-value pair");o[c=l[0]]=(a=o[c])?u.isArray(a)?[...a,l[1]]:[a,l[1]]:l[1]}r(o,e)}else t!=null&&n(e,t,s);return this}get(t,e){if(t=ue(t),t){const s=u.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return ki(i);if(u.isFunction(e))return e.call(this,i,s);if(u.isRegExp(e))return e.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=ue(t),t){const s=u.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||Je(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function n(r){if(r=ue(r),r){const o=u.findKey(s,r);o&&(!e||Je(s,s[o],o,e))&&(delete s[o],i=!0)}}return u.isArray(t)?t.forEach(n):n(t),i}clear(t){const e=Object.keys(this);let s=e.length,i=!1;for(;s--;){const n=e[s];(!t||Je(this,this[n],n,t,!0))&&(delete this[n],i=!0)}return i}normalize(t){const e=this,s={};return u.forEach(this,(i,n)=>{const r=u.findKey(s,n);if(r){e[r]=Se(i),delete e[n];return}const o=t?Di(n):String(n).trim();o!==n&&delete e[n],e[o]=Se(i),s[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return u.forEach(this,(s,i)=>{s!=null&&s!==!1&&(e[i]=t&&u.isArray(s)?s.join(", "):s)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
4
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const s=new this(t);return e.forEach(i=>s.set(i)),s}static accessor(t){const e=(this[jt]=this[jt]={accessors:{}}).accessors,s=this.prototype;function i(n){const r=ue(n);e[r]||(Ii(s,n),e[r]=!0)}return u.isArray(t)?t.forEach(i):i(t),this}};V.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),u.reduceDescriptors(V.prototype,({value:t},e)=>{let s=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[s]=i}}}),u.freezeMethods(V);function We(t,e){const s=this||le,i=e||s,n=V.from(i.headers);let r=i.data;return u.forEach(t,function(o){r=o.call(s,r,n.normalize(),e?e.status:void 0)}),n.normalize(),r}function Ut(t){return!!(t&&t.__CANCEL__)}function ne(t,e,s){v.call(this,t??"canceled",v.ERR_CANCELED,e,s),this.name="CanceledError"}u.inherits(ne,v,{__CANCEL__:!0});function Lt(t,e,s){const i=s.config.validateStatus;!s.status||!i||i(s.status)?t(s):e(new v("Request failed with status code "+s.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(s.status/100)-4],s.config,s.request,s))}function Pi(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ni(t,e){t=t||10;const s=new Array(t),i=new Array(t);let n=0,r=0,o;return e=e!==void 0?e:1e3,function(a){const c=Date.now(),l=i[r];o||(o=c),s[n]=a,i[n]=c;let d=r,g=0;for(;d!==n;)g+=s[d++],d=d%t;if(n=(n+1)%t,n===r&&(r=(r+1)%t),c-o<e)return;const b=l&&c-l;return b?Math.round(g*1e3/b):void 0}}function ji(t,e){let s=0,i=1e3/e,n,r;const o=(a,c=Date.now())=>{s=c,n=null,r&&(clearTimeout(r),r=null),t.apply(null,a)};return[(...a)=>{const c=Date.now(),l=c-s;l>=i?o(a,c):(n=a,r||(r=setTimeout(()=>{r=null,o(n)},i-l)))},()=>n&&o(n)]}const xe=(t,e,s=3)=>{let i=0;const n=Ni(50,250);return ji(r=>{const o=r.loaded,a=r.lengthComputable?r.total:void 0,c=o-i,l=n(c),d=o<=a;i=o;const g={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&d?(a-o)/l:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(g)},s)},Ft=(t,e)=>{const s=t!=null;return[i=>e[0]({lengthComputable:s,total:t,loaded:i}),e[1]]},Mt=t=>(...e)=>u.asap(()=>t(...e)),Ui=U.hasStandardBrowserEnv?((t,e)=>s=>(s=new URL(s,U.origin),t.protocol===s.protocol&&t.host===s.host&&(e||t.port===s.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,Li=U.hasStandardBrowserEnv?{write(t,e,s,i,n,r){const o=[t+"="+encodeURIComponent(e)];u.isNumber(s)&&o.push("expires="+new Date(s).toGMTString()),u.isString(i)&&o.push("path="+i),u.isString(n)&&o.push("domain="+n),r===!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 Fi(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Mi(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Vt(t,e,s){let i=!Fi(e);return t&&(i||s==!1)?Mi(t,e):e}const qt=t=>t instanceof V?{...t}:t;function G(t,e){e=e||{};const s={};function i(l,d,g,b){return u.isPlainObject(l)&&u.isPlainObject(d)?u.merge.call({caseless:b},l,d):u.isPlainObject(d)?u.merge({},d):u.isArray(d)?d.slice():d}function n(l,d,g,b){if(u.isUndefined(d)){if(!u.isUndefined(l))return i(void 0,l,g,b)}else return i(l,d,g,b)}function r(l,d){if(!u.isUndefined(d))return i(void 0,d)}function o(l,d){if(u.isUndefined(d)){if(!u.isUndefined(l))return i(void 0,l)}else return i(void 0,d)}function a(l,d,g){if(g in e)return i(l,d);if(g in t)return i(void 0,l)}const c={url:r,method:r,data:r,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:a,headers:(l,d,g)=>n(qt(l),qt(d),g,!0)};return u.forEach(Object.keys(Object.assign({},t,e)),function(l){const d=c[l]||n,g=d(t[l],e[l],l);u.isUndefined(g)&&d!==a||(s[l]=g)}),s}const Bt=t=>{const e=G({},t);let{data:s,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:r,headers:o,auth:a}=e;e.headers=o=V.from(o),e.url=Dt(Vt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(u.isFormData(s)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((c=o.getContentType())!==!1){const[l,...d]=c?c.split(";").map(g=>g.trim()).filter(Boolean):[];o.setContentType([l||"multipart/form-data",...d].join("; "))}}if(U.hasStandardBrowserEnv&&(i&&u.isFunction(i)&&(i=i(e)),i||i!==!1&&Ui(e.url))){const l=n&&r&&Li.read(r);l&&o.set(n,l)}return e},Vi=typeof XMLHttpRequest<"u",qi=Vi&&function(t){return new Promise(function(e,s){const i=Bt(t);let n=i.data;const r=V.from(i.headers).normalize();let{responseType:o,onUploadProgress:a,onDownloadProgress:c}=i,l,d,g,b,h;function w(){b&&b(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(l),i.signal&&i.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(i.method.toUpperCase(),i.url,!0),p.timeout=i.timeout;function E(){if(!p)return;const x=V.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),O={data:!o||o==="text"||o==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:x,config:t,request:p};Lt(function(j){e(j),w()},function(j){s(j),w()},O),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(s(new v("Request aborted",v.ECONNABORTED,t,p)),p=null)},p.onerror=function(){s(new v("Network Error",v.ERR_NETWORK,t,p)),p=null},p.ontimeout=function(){let x=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const O=i.transitional||Pt;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),s(new v(x,O.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},n===void 0&&r.setContentType(null),"setRequestHeader"in p&&u.forEach(r.toJSON(),function(x,O){p.setRequestHeader(O,x)}),u.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),o&&o!=="json"&&(p.responseType=i.responseType),c&&([g,h]=xe(c,!0),p.addEventListener("progress",g)),a&&p.upload&&([d,b]=xe(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(l=x=>{p&&(s(!x||x.type?new ne(null,t,p):x),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(l),i.signal&&(i.signal.aborted?l():i.signal.addEventListener("abort",l)));const T=Pi(i.url);if(T&&U.protocols.indexOf(T)===-1){s(new v("Unsupported protocol "+T+":",v.ERR_BAD_REQUEST,t));return}p.send(n||null)})},Bi=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let i=new AbortController,n;const r=function(l){if(!n){n=!0,a();const d=l instanceof Error?l:this.reason;i.abort(d instanceof v?d:new ne(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,r(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(r):l.removeEventListener("abort",r)}),t=null)};t.forEach(l=>l.addEventListener("abort",r));const{signal:c}=i;return c.unsubscribe=()=>u.asap(a),c}},$i=function*(t,e){let s=t.byteLength;if(s<e){yield t;return}let i=0,n;for(;i<s;)n=i+e,yield t.slice(i,n),i=n},Hi=async function*(t,e){for await(const s of zi(t))yield*$i(s,e)},zi=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:s,value:i}=await e.read();if(s)break;yield i}}finally{await e.cancel()}},$t=(t,e,s,i)=>{const n=Hi(t,e);let r=0,o,a=c=>{o||(o=!0,i&&i(c))};return new ReadableStream({async pull(c){try{const{done:l,value:d}=await n.next();if(l){a(),c.close();return}let g=d.byteLength;if(s){let b=r+=g;s(b)}c.enqueue(new Uint8Array(d))}catch(l){throw a(l),l}},cancel(c){return a(c),n.return()}},{highWaterMark:2})},Ce=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Ht=Ce&&typeof ReadableStream=="function",Ji=Ce&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),zt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Wi=Ht&&zt(()=>{let t=!1;const e=new Request(U.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Jt=64*1024,Ke=Ht&&zt(()=>u.isReadableStream(new Response("").body)),Oe={stream:Ke&&(t=>t.body)};Ce&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Oe[e]&&(Oe[e]=u.isFunction(t[e])?s=>s[e]():(s,i)=>{throw new v(`Response type '${e}' is not supported`,v.ERR_NOT_SUPPORT,i)})})})(new Response);const Ki=async t=>{if(t==null)return 0;if(u.isBlob(t))return t.size;if(u.isSpecCompliantForm(t))return(await new Request(U.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(u.isArrayBufferView(t)||u.isArrayBuffer(t))return t.byteLength;if(u.isURLSearchParams(t)&&(t=t+""),u.isString(t))return(await Ji(t)).byteLength},Zi=async(t,e)=>u.toFiniteNumber(t.getContentLength())??Ki(e),Gi=Ce&&(async t=>{let{url:e,method:s,data:i,signal:n,cancelToken:r,timeout:o,onDownloadProgress:a,onUploadProgress:c,responseType:l,headers:d,withCredentials:g="same-origin",fetchOptions:b}=Bt(t);l=l?(l+"").toLowerCase():"text";let h=Bi([n,r&&r.toAbortSignal()],o),w;const p=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let E;try{if(c&&Wi&&s!=="get"&&s!=="head"&&(E=await Zi(d,i))!==0){let _=new Request(e,{method:"POST",body:i,duplex:"half"}),k;if(u.isFormData(i)&&(k=_.headers.get("content-type"))&&d.setContentType(k),_.body){const[D,q]=Ft(E,xe(Mt(c)));i=$t(_.body,Jt,D,q)}}u.isString(g)||(g=g?"include":"omit");const T="credentials"in Request.prototype;w=new Request(e,{...b,signal:h,method:s.toUpperCase(),headers:d.normalize().toJSON(),body:i,duplex:"half",credentials:T?g:void 0});let x=await fetch(w);const O=Ke&&(l==="stream"||l==="response");if(Ke&&(a||O&&p)){const _={};["status","statusText","headers"].forEach($=>{_[$]=x[$]});const k=u.toFiniteNumber(x.headers.get("content-length")),[D,q]=a&&Ft(k,xe(Mt(a),!0))||[];x=new Response($t(x.body,Jt,D,()=>{q&&q(),p&&p()}),_)}l=l||"text";let j=await Oe[u.findKey(Oe,l)||"text"](x,t);return!O&&p&&p(),await new Promise((_,k)=>{Lt(_,k,{data:j,headers:V.from(x.headers),status:x.status,statusText:x.statusText,config:t,request:w})})}catch(T){throw p&&p(),T&&T.name==="TypeError"&&/Load failed|fetch/i.test(T.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,t,w),{cause:T.cause||T}):v.from(T,T&&T.code,t,w)}}),Ze={http:di,xhr:qi,fetch:Gi};u.forEach(Ze,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Wt=t=>`- ${t}`,Xi=t=>u.isFunction(t)||t===null||t===!1,Kt={getAdapter:t=>{t=u.isArray(t)?t:[t];const{length:e}=t;let s,i;const n={};for(let r=0;r<e;r++){s=t[r];let o;if(i=s,!Xi(s)&&(i=Ze[(o=String(s)).toLowerCase()],i===void 0))throw new v(`Unknown adapter '${o}'`);if(i)break;n[o||"#"+r]=i}if(!i){const r=Object.entries(n).map(([a,c])=>`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let o=e?r.length>1?`since :
5
5
  `+r.map(Wt).join(`
6
- `):" "+Wt(r[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:Ke};function Ze(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ne(null,t)}function Zt(t){return Ze(t),t.headers=V.from(t.headers),t.data=Je.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Kt.getAdapter(t.adapter||le.adapter)(t).then(function(e){return Ze(t),e.data=Je.call(t,t.transformResponse,e),e.headers=V.from(e.headers),e},function(e){return Ut(e)||(Ze(t),e&&e.response&&(e.response.data=Je.call(t,t.transformResponse,e.response),e.response.headers=V.from(e.response.headers))),Promise.reject(e)})}const Gt="1.9.0",Re={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Re[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Xt={};Re.transitional=function(t,e,s){function i(n,r){return"[Axios v"+Gt+"] Transitional option '"+n+"'"+r+(s?". "+s:"")}return(n,r,o)=>{if(t===!1)throw new v(i(r," has been removed"+(e?" in "+e:"")),v.ERR_DEPRECATED);return e&&!Xt[r]&&(Xt[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,r,o):!0}},Re.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Qi(t,e,s){if(typeof t!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let n=i.length;for(;n-- >0;){const r=i[n],o=e[r];if(o){const a=t[r],c=a===void 0||o(a,r,t);if(c!==!0)throw new v("option "+r+" must be "+c,v.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new v("Unknown option "+r,v.ERR_BAD_OPTION)}}const ke={assertOptions:Qi,validators:Re},W=ke.validators;let X=class{constructor(t){this.defaults=t||{},this.interceptors={request:new It,response:new It}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const n=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?n&&!String(s.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(s.stack+=`
7
- `+n):s.stack=n}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=G(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:n}=e;s!==void 0&&ke.assertOptions(s,{silentJSONParsing:W.transitional(W.boolean),forcedJSONParsing:W.transitional(W.boolean),clarifyTimeoutError:W.transitional(W.boolean)},!1),i!=null&&(u.isFunction(i)?e.paramsSerializer={serialize:i}:ke.assertOptions(i,{encode:W.function,serialize:W.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),ke.assertOptions(e,{baseUrl:W.spelling("baseURL"),withXsrfToken:W.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let r=n&&u.merge(n.common,n[e.method]);n&&u.forEach(["delete","get","head","post","put","patch","common"],h=>{delete n[h]}),e.headers=V.concat(r,n);const o=[];let a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(e)===!1||(a=a&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let l,d=0,g;if(!a){const h=[Zt.bind(this),void 0];for(h.unshift.apply(h,o),h.push.apply(h,c),g=h.length,l=Promise.resolve(e);d<g;)l=l.then(h[d++],h[d++]);return l}g=o.length;let b=e;for(d=0;d<g;){const h=o[d++],w=o[d++];try{b=h(b)}catch(p){w.call(this,p);break}}try{l=Zt.call(this,b)}catch(h){return Promise.reject(h)}for(d=0,g=c.length;d<g;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=G(this.defaults,t);const e=Vt(t.baseURL,t.url,t.allowAbsoluteUrls);return Dt(e,t.params,t.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(t){X.prototype[t]=function(e,s){return this.request(G(s||{},{method:t,url:e,data:(s||{}).data}))}}),u.forEach(["post","put","patch"],function(t){function e(s){return function(i,n,r){return this.request(G(r||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}X.prototype[t]=e(),X.prototype[t+"Form"]=e(!0)});let Yi=class ys{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(n){s=n});const i=this;this.promise.then(n=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](n);i._listeners=null}),this.promise.then=n=>{let r;const o=new Promise(a=>{i.subscribe(a),r=a}).then(n);return o.cancel=function(){i.unsubscribe(r)},o},e(function(n,r,o){i.reason||(i.reason=new ne(n,r,o),s(i.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 s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const e=new AbortController,s=i=>{e.abort(i)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new ys(function(s){e=s}),cancel:e}}};function en(t){return function(e){return t.apply(null,e)}}function tn(t){return u.isObject(t)&&t.isAxiosError===!0}const Ge={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(Ge).forEach(([t,e])=>{Ge[e]=t});function Qt(t){const e=new X(t),s=gt(X.prototype.request,e);return u.extend(s,X.prototype,e,{allOwnKeys:!0}),u.extend(s,e,null,{allOwnKeys:!0}),s.create=function(i){return Qt(G(t,i))},s}const I=Qt(le);I.Axios=X,I.CanceledError=ne,I.CancelToken=Yi,I.isCancel=Ut,I.VERSION=Gt,I.toFormData=Te,I.AxiosError=v,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=en,I.isAxiosError=tn,I.mergeConfig=G,I.AxiosHeaders=V,I.formToJSON=t=>Nt(u.isHTMLForm(t)?new FormData(t):t),I.getAdapter=Kt.getAdapter,I.HttpStatusCode=Ge,I.default=I;const{Axios:Tr,AxiosError:Sr,CanceledError:xr,isCancel:Cr,CancelToken:Or,VERSION:Rr,all:kr,Cancel:Ar,isAxiosError:Dr,spread:Ir,toFormData:Pr,AxiosHeaders:Nr,HttpStatusCode:jr,formToJSON:Ur,getAdapter:Lr,mergeConfig:Fr}=I,Yt=I.create({baseURL:location.origin,timeout:6e4,params:{}});Yt.interceptors.response.use(t=>t,t=>{var e,s,i,n,r,o,a,c,l,d,g;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(w){w&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let b=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(b+=`${t.response.statusText} `),(i=(s=t.response)==null?void 0:s.config)!=null&&i.data&&(b+=`${t.response.config.data} `),(r=(n=t.response)==null?void 0:n.data)!=null&&r.message?b+=`${t.response.data.message}`:(a=(o=t.response)==null?void 0:o.data)!=null&&a.exception?b+=`${t.response.data.exception}`:(d=(l=(c=t.response)==null?void 0:c.data)==null?void 0:l.error)!=null&&d.message?(t.response.data.error.class&&(b+=`${t.response.data.error.class} `),b+=`${t.response.data.error.message}`):b+=`${(g=t.response)==null?void 0:g.data}`;const{$cosmosNotify:h}=window;throw h&&h.serious({title:"Network error",body:b}),t}else throw t});let Ae=()=>({emit(t,...e){for(let s=this.events[t]||[],i=0,n=s.length;i<n;i++)s[i](...e)},events:{},on(t,e){var s;return((s=this.events)[t]||(s[t]=[])).push(e),()=>{var i;this.events[t]=(i=this.events[t])==null?void 0:i.filter(n=>e!==n)}}});class de extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class Xe extends de{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class sn extends de{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class z extends de{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class nn extends z{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function es(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let s=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${s}`}).join(",")}}`:""}class rn{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,s){if(!this._info)return this._info={id:e,info:s},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((s,{id:i,info:n})=>(s[i]=n,s),{})}}const Q=Symbol("state");class ts{constructor(e={}){this.emitter=Ae(),this.params=Object.freeze(e),this.presence=new rn(this),this.initialConnect=!0,this[Q]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=es({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[Q]}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[Q]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[Q]="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[Q]="connected";let e=!0,s=!0;this.initialConnect=!1,this.emit("connect",{reconnect:s,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[Q]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[Q]="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,s){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,s)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(s){let i=this.receiver?this.receiver.logger:null;i&&i.warn("whisper failed: ",s)}}receive(e,s){this.emit("message",e,s)}on(e,s){return this.emitter.on(e,s)}once(e,s){let i=this.emitter.on(e,(...n)=>{i(),s(...n)});return i}emit(e,...s){return this.emitter.emit(e,...s)}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,s)=>{let i=[()=>delete this._pendingSubscribe];i.push(this.on("connect",()=>{i.forEach(n=>n()),e()})),i.push(this.on("close",n=>{i.forEach(r=>r()),s(n||new de("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class on{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 s=this.channels.indexOf(e);s>-1&&this.channels.splice(s,1)}notify(e,...s){this.state=e==="restored"?"connected":e,s.length===1?this.channels.forEach(i=>i[e](s[0])):this.channels.forEach(i=>i[e]())}pending(e){this._checkIntent(e);let s=this._pendings[0];return!s||s.intent!==e?Promise.resolve():s.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 s,i={promise:new Promise(r=>{s=r}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(i),1),s(i)},canceled:!1,acquired:!1},n=this._pendingTop;return this._pendings.push(i),n&&await n.promise,this.gvl&&await this.gvl.acquire(i,e),i.acquired=!0,i}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 s=this._pendingTop;return!s||s.acquired||s.intent!==e?!1:(this._pendings.pop(),s.canceled=!0,!0)}}class an{constructor(){this.queue=[]}async acquire(e,s){s==="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 cn{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new an),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:s,unsubscribe:i}){let n=this._subscriptions[e]=new on(e);return n.remoteId=this._localToRemote[e],n.subscriber=s,n.unsubscriber=i,n.gvl=this.glv,n}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,s){this._localToRemote[e]=s;let i=this.get(e);i&&(i.remoteId=s)}}class ln{constructor(e={}){this.subscriptions=new cn(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,s){this._remoteToLocal[s]=e,this.subscriptions.storeRemoteId(e,s),this.flush(s)}unsubscribe(e){let s=this.subscriptions.get(e);if(!s)return;let i=s.remoteId;i&&delete this._remoteToLocal[i],this.subscriptions.remove(e)}transmit(e,s,i){let n=this._remoteToLocal[e];if(!n){this._pendingMessages.push([e,s,i]);return}let r=this.subscriptions.get(n);r&&r.channels.forEach(o=>{o.receive(s,i)})}notify(e,s,i){let n=this._remoteToLocal[e];if(!n)return;let r=this.subscriptions.get(n);r&&r.channels.forEach(o=>o.emit(s,i))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let s=[];for(let i of this._pendingMessages)i[0]===e?this.transmit(i[0],i[1],i[2]):s.push(i);this._pendingMessages=s}}const ss={debug:0,info:1,warn:2,error:3};class is{constructor(e){this.level=e||"warn"}log(e,s,i){ss[e]<ss[this.level]||this.writeLogEntry(e,s,i)}writeLogEntry(){throw Error("Not implemented")}debug(e,s){this.log("debug",e,s)}info(e,s){this.log("info",e,s)}warn(e,s){this.log("warn",e,s)}error(e,s){this.log("error",e,s)}}class he extends is{writeLogEntry(){}}class un{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let dn=0;class ns{constructor(e={}){let{logger:s}=e;this.logger=s||new he,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,s){let i={channel:e};s&&Object.assign(i,s);let n=es(i);if(this.pendingUnsubscriptions[n]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},o)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let r=this.subscribeRetryInterval;return new Promise((o,a)=>{let c=++dn;this.pendingSubscriptions[n]={resolve:o,reject:a,id:c},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(c,n,r)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,s,i){setTimeout(()=>{let n=this.pendingSubscriptions[s];n&&n.id===e&&(this.logger.warn(`no subscription ack received in ${i}ms, retrying subscribe`,s),this.cable.send(this.buildSubscribeRequest(s)),this.maybeExpireSubscribe(e,s,i))},i)}maybeExpireSubscribe(e,s,i){setTimeout(()=>{let n=this.pendingSubscriptions[s];n&&n.id===e&&(delete this.pendingSubscriptions[s],n.reject(new sn(`Haven't received subscription ack in ${i*2}ms for ${s}`)))},i)}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,s,i){return s==="$whisper"?this.whisper(e,i):(i||(i={}),i.action=s,this.cable.send({command:"message",identifier:e,data:JSON.stringify(i)}),Promise.resolve())}whisper(e,s){return this.cable.send({command:"whisper",identifier:e,data:s}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:i,message:n,reason:r,reconnect:o}=e;if(s==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(s==="disconnect"){let a=new z(r);this.reset(a),o===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[i];if(!a){this.logger.error("subscription not found, unsubscribing",{type:s,identifier:i}),this.unsubscribe(i);return}return delete this.pendingSubscriptions[i],a.resolve(i)}if(s==="reject_subscription"){let a=this.pendingSubscriptions[i];return a?(delete this.pendingSubscriptions[i],a.reject(new Xe)):this.logger.error("subscription not found",{type:s,identifier:i})}if(n)return{identifier:i,message:n};this.logger.warn(`unknown message type: ${s}`,{message:e})}reset(e){for(let s in this.pendingSubscriptions)this.pendingSubscriptions[s].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const rs=()=>Date.now()/1e3|0;class hn extends ns{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=rs()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let s in this.pendingPresence)this.pendingPresence[s].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:i,message:n}=e;if(s==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(s==="reject_subscription")return super.receive(e);if(s==="confirm_subscription")return this.subscriptionStreams[i]||(this.subscriptionStreams[i]=new Set),super.receive(e);if(s==="ping")return this.restoreSince&&(this.restoreSince=rs()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",i);return}if(s==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",i);return}if(s==="welcome"){if(this.disableSessionRecovery||(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId)),e.restored){let r=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of r)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(r)}return this.cable.connected(this.sessionId)}if(s==="presence"){let r=n.type;if(r==="info"){let o=this.pendingPresence[i];o&&(delete this.pendingPresence[i],o.resolve(n))}else if(r==="error"){let o=this.pendingPresence[i];o&&(delete this.pendingPresence[i],o.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:i,message:n}}if(n){let r=this.trackStreamPosition(i,e.stream_id,e.epoch,e.offset);return{identifier:i,message:n,meta:r}}this.logger.warn(`unknown message type: ${s}`,{message:e})}perform(e,s,i){switch(s){case"$presence:join":return this.join(e,i);case"$presence:leave":return this.leave(e,i);case"$presence:info":return this.presence(e,i)}return super.perform(e,s,i)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let s=super.buildSubscribeRequest(e),i=this.historyRequestFor(e);i&&(s.history=i,this.pendingHistory[e]=!0);let n=this.presenceInfo[e];return n&&(s.presence=n),s}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let s={},i=!1;if(this.subscriptionStreams[e])for(let n of this.subscriptionStreams[e]){let r=this.streamsPositions[n];r&&(i=!0,s[n]=r)}if(!(!i&&!this.restoreSince))return{since:this.restoreSince,streams:s}}trackStreamPosition(e,s,i,n){if(!(!s||!i))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(s),this.streamsPositions[s]={epoch:i,offset:n},{stream:s,epoch:i,offset:n}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,s){return this.presenceInfo[e]=s,this.cable.send({command:"join",identifier:e,presence:s}),Promise.resolve()}async leave(e,s){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:s}),Promise.resolve()}presence(e,s){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((i,n)=>{this.pendingPresence[e]={resolve:i,reject:n},this.cable.send({command:"presence",identifier:e,data:s})})}}class fn extends de{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class Qe extends ts{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}be(Qe,"identifier","__ghost__");const pn="$pubsub";class Ye extends ts{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}be(Ye,"identifier",pn);const Y=Symbol("state");let mn=class{constructor({transport:t,protocol:e,encoder:s,logger:i,lazy:n,hubOptions:r,performFailures:o,transportConfigurator:a}){this.emitter=Ae(),this.transport=t,this.encoder=s,this.logger=i||new he,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new ln(r||{}),this[Y]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,n===!1&&this.connect().catch(()=>{})}get state(){return this[Y]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[Y]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(s){this.handleClose(s)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[Y]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new z("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[Y]="connected",this.hub.subscriptions.all().forEach(i=>{t&&i.remoteId&&t.includes(i.remoteId)?i.notify("restored"):(i.notify("disconnected",new z("recovery_failed")),this._resubscribe(i))});let e=!this.initialConnect,s=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:s})}notify(t,e,s){e&&typeof e!="string"&&(s=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:s}):this.emit("info",{type:t,data:s})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new z(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[Y]="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 z?t:new z(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[Y]="closed";let s=e||new z("cable_closed");this.hub.subscriptions.all().forEach(i=>i.notify("disconnected",s)),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 s=this.protocol.receive(e);if(s){this.logger.debug("processed incoming message",s);let{type:i,identifier:n,message:r,meta:o}=s;i?this.hub.notify(n,i,r):this.hub.transmit(n,r,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 Ye({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new Ye({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,i;return typeof t=="string"&&(i=t,t=Qe),s=i?new t(i,e):new t(e),this.subscribe(s)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let s=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:i=>this._subscribe(i,t.channelId,t.params),unsubscribe:i=>this._unsubscribe(i)});return s.add(t),s.intent==="subscribed"&&s.state==="connected"&&t.connected(),s.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,s){let i=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:i});return}this.logger.debug("acquiring subscribe lock",{identifier:i});let n=await t.acquire("subscribed");if(n.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:i}),n.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:i}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),n.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:i}),n.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:i}),t.notify("connected"),n.release();return}let r={identifier:e,params:s};this.logger.debug("subscribing",r);try{let o=await this.protocol.subscribe(e,s);this.hub.subscribe(i,o),this.logger.debug("subscribed",{...r,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof Xe&&this.logger.warn("rejected",r),o instanceof z){this.logger.debug("disconnected during subscription; will retry on connect",r),n.release();return}this.logger.error("failed to subscribe",{error:o,...r})}t.close(o),this.hub.unsubscribe(i)}n.release()}unsubscribe(t){let e=t.identifier,s=this.hub.subscriptions.get(e);if(!s)throw Error(`Subscription not found: ${e}`);s.remove(t),t.closed(),s.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let s=await t.acquire("unsubscribed");if(s.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),s.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}),s.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),s.release();return}let i=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:i}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),s.release();return}try{await this.protocol.unsubscribe(i),this.logger.debug("unsubscribed remotely",{id:e})}catch(n){n&&(n instanceof z?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:n}):this.logger.error("unsubscribe failed",{id:e,error:n}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",s.release()}async perform(t,e,s){if(this.performFailures==="throw")return this._perform(t,e,s);try{return await this._perform(t,e,s)}catch(i){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:i});return}}async _perform(t,e,s){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new fn;let i=this.hub.subscriptions.get(t);if(!i)throw Error(`Subscription not found: ${t}`);if(await i.pending("subscribed"),i.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let n=i.remoteId,r={id:n,action:e,payload:s};this.logger.debug("perform",r);try{let o=await this.protocol.perform(n,e,s);return o&&this.logger.debug("perform result",{message:o,request:r}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:r}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...i)=>{s(),e(...i)});return s}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let s=[()=>delete this._pendingConnect];s.push(this.on("connect",()=>{s.forEach(i=>i()),t()})),s.push(this.on("close",i=>{s.forEach(n=>n()),e(i)})),s.push(this.on("disconnect",i=>{s.forEach(n=>n()),e(i)}))}),this._pendingConnect)}};const gn={maxMissingPings:2,maxReconnectAttempts:1/0},re=()=>Date.now(),os=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:i,maxInterval:n}=e;return s=s||2,i===void 0&&(i=.5),r=>{let o=t*s**r,a=o*s,c=o+(a-o)*Math.random(),l=2*(Math.random()-.5)*i;return c=c*(1+l),n&&n<c&&(c=n),c}};let as=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},gn,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 he,this.state="pending_connect",this.attempts=0,this.disconnectedAt=re()}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=re(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=re(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=re(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=re()})),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=re()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new nn))}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 bn{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=Ae(),this.unbind=[],this.logger=s.logger||new he}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let s=this.transports[e];try{this.transport=s,this.resetListeners(),this.logger.debug(`Trying to connect via ${s.displayName()}`),await s.open(),this.logger.debug(`Connected via ${s.displayName()}`);return}catch(i){this.logger.debug(`Failed to connect via ${s.displayName()}: ${i.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,s){this.transports.forEach(i=>{i.setParam(e,s)})}setToken(e,s){this.transports.forEach(i=>{i.setToken(e,s)})}on(e,s){return this.emitter.on(e,s)}once(e,s){let i=this.emitter.on(e,(...n)=>{i(),s(...n)});return i}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 yn{constructor(e,s={}){this.url=e;let i=s.websocketImplementation;if(i)this.Impl=i;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Ae();let{format:n,subprotocol:r,authStrategy:o}=s;this.format=n||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=r}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((s,i)=>{let n=[];n.push(this.once("open",()=>{n.forEach(r=>r()),s()})),n.push(this.once("close",()=>{n.forEach(r=>r()),i(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,s){let i=new URL(this.url);i.searchParams.set(e,s);let n=`${i.protocol}//${i.host}${i.pathname}?${i.searchParams}`;this.setURL(n)}setToken(e,s="jid"){if(this.authStrategy==="param")this.setParam(s,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let i=`x-${s}`.toLowerCase();i=Object.keys(this.connectionOptions.headers).find(n=>n.toLowerCase()===i)||i,this.connectionOptions.headers[i]=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,s){return this.emitter.on(e,s)}once(e,s){let i=this.emitter.on(e,(...n)=>{i(),s(...n)});return i}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 s=e.data;this.format==="binary"&&(s=new Uint8Array(s)),this.emitter.emit("data",s)},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 cs={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function _n(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({},cs,e);let{protocol:s,websocketImplementation:i,websocketFormat:n,websocketOptions:r,websocketAuthStrategy:o,fallbacks:a,logLevel:c,logger:l,transport:d,encoder:g,lazy:b,monitor:h,pingInterval:w,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,subprotocol:x,tokenRefresher:O,historyTimestamp:j,protocolOptions:_,concurrentSubscribes:k,performFailures:D,transportConfigurator:q,auth:$}=e;if(l=l||new he(c),typeof s=="string"){x=x||s;let P=s.substring(0,s.lastIndexOf("-")),B=s.substring(s.lastIndexOf("-")+1);if(_=_||{},P==="actioncable-v1")s=new ns({logger:l,..._});else if(P==="actioncable-v1-ext")s=new hn({logger:l,historyTimestamp:j,..._});else throw Error(`Protocol is not supported yet: ${s}`);if(B==="json")g=g||new un,n=n||"text";else if(B==="msgpack"){if(n="binary",!g)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(B==="protobuf"){if(n=n||"binary",!g)throw Error("Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own")}else throw Error(`Protocol is not supported yet: ${s}`)}if(!s)throw Error("Protocol must be specified");d=d||new yn(t,{websocketImplementation:i,websocketOptions:r,subprotocol:x,authStrategy:o,format:n}),a&&(d=new bn([d,...a],{logger:l})),$&&$.token&&d.setToken($.token,$.param||"jid"),p=p||os(w),h!==!1&&(h=h||new as({pingInterval:w,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,logger:l}));let pe={concurrentSubscribes:k},y=new mn({protocol:s,transport:d,encoder:g,logger:l,lazy:b,hubOptions:pe,performFailures:D,transportConfigurator:q});return h&&(h.watch(y),y.monitor=h),O&&wn(y,async()=>{try{await O(d)}catch(P){return l.error("Failed to refresh authentication token: "+P),!1}return y.connect().catch(()=>{}),!0}),y}function wn(t,e){let s=!1;t.on("connect",()=>s=!1),t.on("close",async i=>{if(i){if(s){t.logger.warn("Token auto-refresh is disabled",i);return}i.reason==="token_expired"&&(s=!0,await e())}})}class vn{constructor(e){this.channel=e}notify(e,...s){typeof this[e]=="function"&&this[e](...s)}perform(e,s={}){this.channel.perform(e,s)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class En extends Qe{constructor(e,s,i){super(e,s),this.subscription=new vn(this),Object.assign(this.subscription,i),this.on("connect",({reconnect:n})=>this.subscription.notify("connected",{reconnected:n})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",n=>this.subscription.notify("received",n)),this.on("close",n=>{n&&n instanceof Xe?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Tn{constructor(e){this.cable=e}create(e,s){let i,n;typeof e=="object"?(i=e.channel,delete e.channel,n=e):(i=e,n={});let r=new En(i,n,s);return r.subscription.notify("initialized"),this.cable.subscribe(r),r.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class Sn{constructor(e){this.cable=e,this.subscriptions=new Tn(e)}}class xn extends is{writeLogEntry(e,s,i){i?console[e](s,i):console[e](s)}}class Cn extends as{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")},s=n=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:n})},i=()=>this.disconnect(new z("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",s,!1),window.addEventListener("resume",s,!1),window.addEventListener("freeze",i,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",s,!1),window.removeEventListener("online",s,!1),window.removeEventListener("resume",s,!1),window.removeEventListener("freeze",i,!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 On=["cable","action-cable"],Rn="/cable",De=(t,e)=>{for(let s of On){let i=t.head.querySelector(`meta[name='${s}-${e}']`);if(i)return i.getAttribute("content")}},ls=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,kn=()=>{if(typeof document<"u"&&document.head){let t=De(document,"url");if(t)return ls(t)}return ls(Rn)},An=()=>{if(typeof document<"u"&&document.head){let t=De(document,"history-timestamp");if(t)return t|0}},Dn=()=>{if(typeof document<"u"&&document.head)return De(document,"token")},In=()=>{if(typeof document<"u"&&document.head)return De(document,"token-param")};function Pn(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||kn(),e=e||{},e.historyTimestamp||(e.historyTimestamp=An());let s=Dn();if(s){let l=In();e.auth=Object.assign({token:s,param:l},e.auth||{})}e=Object.assign({},cs,e);let{logLevel:i,logger:n,pingInterval:r,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:c}=e;return n=e.logger=e.logger||new xn(i),o=e.reconnectStrategy=e.reconnectStrategy||os(r),e.monitor!==!1&&(e.monitor=e.monitor||new Cn({pingInterval:r,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:c,logger:n})),_n(t,e)}function Nn(t,e){let s=Pn(t,e);return new Sn(s)}class jn{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,i={},n={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(r=>{if(r&&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=Nn(o)}return this._cable.subscriptions.create({channel:e,...n},i)})}recordPing(){}}function et(t){return Un.test(t)}const Un=/^-?[0-9]+$/;function us(t){return Ln.test(t)}const Ln=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ds(t,e){const s=Number.parseFloat(t),i=String(s),n=hs(t),r=hs(i);return!!(n===r||(e==null?void 0:e.approx)===!0&&!et(t)&&r.length>=14&&n.startsWith(r.substring(0,14)))}let fe=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Fn(t){if(ds(t,{approx:!1}))return;if(et(t))return fe.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?fe.underflow:fe.truncate_float:fe.overflow}function hs(t){return t.replace(Mn,"").replace(qn,"").replace(Bn,"").replace(Vn,"")}const Mn=/[eE][+-]?\d+$/,Vn=/^-?(0*)?/,qn=/\./,Bn=/0+$/;class $n{constructor(e){if(be(this,"isLosslessNumber",!0),!us(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Fn(this.value);if(e===void 0||e===fe.truncate_float)return Number.parseFloat(this.value);if(et(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 Hn(t){return t&&typeof t=="object"&&t.isLosslessNumber===!0||!1}function zn(t){return new $n(t)}function Jn(t,e){return tt({"":t},"",t,e)}function tt(t,e,s,i){return Array.isArray(s)?i.call(t,e,Kn(s,i)):s&&typeof s=="object"&&!Hn(s)?i.call(t,e,Wn(s,i)):i.call(t,e,s)}function Wn(t,e){for(const s of Object.keys(t)){const i=tt(t,s,t[s],e);i!==void 0?t[s]=i:delete t[s]}return t}function Kn(t,e){for(let s=0;s<t.length;s++)t[s]=tt(t,String(s),t[s],e);return t}function Zn(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zn,i=0;const n=a();return w(n),E(),e?Jn(n,e):n;function r(){if(t.charCodeAt(i)===tr){i++,l();const S={};let N=!0;for(;i<t.length&&t.charCodeAt(i)!==ps;){N?N=!1:(b(),l());const ee=i,me=d();if(me===void 0){O();return}l(),h();const ot=a();if(ot===void 0){$();return}Object.prototype.hasOwnProperty.call(S,me)&&!st(ot,S[me])&&j(me,ee+1),S[me]=ot}return t.charCodeAt(i)!==ps&&_(),i++,S}}function o(){if(t.charCodeAt(i)===sr){i++,l();const S=[];let N=!0;for(;i<t.length&&t.charCodeAt(i)!==ms;){N?N=!1:b();const ee=a();p(ee),S.push(ee)}return t.charCodeAt(i)!==ms&&k(),i++,S}}function a(){l();const S=d()??g()??r()??o()??c("true",!0)??c("false",!1)??c("null",null);return l(),S}function c(S,N){if(t.slice(i,i+S.length)===S)return i+=S.length,N}function l(){for(;Gn(t.charCodeAt(i));)i++}function d(){if(t.charCodeAt(i)===it){i++;let S="";for(;i<t.length&&t.charCodeAt(i)!==it;){if(t.charCodeAt(i)===er){const N=t[i+1],ee=Yn[N];ee!==void 0?(S+=ee,i++):N==="u"?Ie(t.charCodeAt(i+2))&&Ie(t.charCodeAt(i+3))&&Ie(t.charCodeAt(i+4))&&Ie(t.charCodeAt(i+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):pe(i):q(i)}else Qn(t.charCodeAt(i))?S+=t[i]:D(t[i]);i++}return x(),i++,S}}function g(){const S=i;if(t.charCodeAt(i)===gs&&(i++,T(S)),t.charCodeAt(i)===nt)i++;else if(Xn(t.charCodeAt(i)))for(i++;Pe(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===ur)for(i++,T(S);Pe(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===mr||t.charCodeAt(i)===pr)for(i++,(t.charCodeAt(i)===gs||t.charCodeAt(i)===ar)&&i++,T(S);Pe(t.charCodeAt(i));)i++;if(i>S)return s(t.slice(S,i))}function b(){if(t.charCodeAt(i)!==lr)throw new SyntaxError(`Comma ',' expected after value ${B()}`);i++}function h(){if(t.charCodeAt(i)!==dr)throw new SyntaxError(`Colon ':' expected after property name ${B()}`);i++}function w(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${B()}`)}function p(S){if(S===void 0)throw new SyntaxError(`Array item expected ${B()}`)}function E(){if(i<t.length)throw new SyntaxError(`Expected end of input ${B()}`)}function T(S){if(!Pe(t.charCodeAt(i))){const N=t.slice(S,i);throw new SyntaxError(`Invalid number '${N}', expecting a digit ${B()}`)}}function x(){if(t.charCodeAt(i)!==it)throw new SyntaxError(`End of string '"' expected ${B()}`)}function O(){throw new SyntaxError(`Quoted object key expected ${B()}`)}function j(S,N){throw new SyntaxError(`Duplicate key '${S}' encountered at position ${N}`)}function _(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${B()}`)}function k(){throw new SyntaxError(`Array item or end of array ']' expected ${B()}`)}function D(S){throw new SyntaxError(`Invalid character '${S}' ${y()}`)}function q(S){const N=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${N}' ${y()}`)}function $(){throw new SyntaxError(`Object value expected after ':' ${y()}`)}function pe(S){const N=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${N}' ${y()}`)}function y(){return`at position ${i}`}function P(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function B(){return`${P()} ${y()}`}}function Gn(t){return t===ir||t===nr||t===rr||t===or}function Ie(t){return t>=nt&&t<=rt||t>=hr&&t<=gr||t>=fr&&t<=br}function Pe(t){return t>=nt&&t<=rt}function Xn(t){return t>=cr&&t<=rt}function Qn(t){return t>=32&&t<=1114111}function st(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,i)=>st(s,e[i])):fs(t)&&fs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>st(t[s],e[s])):!1}function fs(t){return typeof t=="object"&&t!==null}const Yn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
8
- `,r:"\r",t:" "},er=92,tr=123,ps=125,sr=91,ms=93,ir=32,nr=10,rr=9,or=13,it=34,ar=43,gs=45,nt=48,cr=49,rt=57,lr=44,ur=46,dr=58,hr=65,fr=97,pr=69,mr=101,gr=70,br=102;function bs(t,e,s,i){return n(t);function n(c,l){if(Array.isArray(i)){const d=i.find(g=>g.test(c));if(d){const g=d.stringify(c);if(typeof g!="string"||!us(g))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${g})`);return g}}if(typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c===null||c instanceof Date||c instanceof Boolean||c instanceof Number||c instanceof String)return JSON.stringify(c);if(c!=null&&c.isLosslessNumber||typeof c=="bigint")return c.toString();if(Array.isArray(c))return r(c);if(c&&typeof c=="object")return o(c)}function r(c,l){if(c.length===0)return"[]";let d="[";for(let g=0;g<c.length;g++){const b=c[g];typeof b<"u"&&typeof b!="function"?d+=n(b):d+="null",g<c.length-1&&(d+=",")}return d+="]",d}function o(c,l){if(typeof c.toJSON=="function")return bs(c.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(c);if(d.length===0)return"{}";let g=!0,b="{";for(const h of d){const w=c[h];if(a(h,w)){g?g=!1:b+=",";const p=JSON.stringify(h);b+=`${p}:`,b+=n(w)}}return b+="}",b}function a(c,l){return typeof l<"u"&&typeof l!="function"&&typeof l!="symbol"}}function yr(t){return ds(t)?parseFloat(t):BigInt(t)}class _r{constructor(){be(this,"id",1)}async exec(e,s,i={},n={},r=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return i.scope=window.openc3Scope,n.manual=!0,(await Yt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:s,id:this.id,keyword_params:i},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...n},timeout:r,transformRequest:[(o,a)=>bs(o)],transformResponse:[o=>Zn(o,void 0,yr)]})).data.result}catch(o){let a=new Error;throw o.response?(a.name=o.response.data.error.data.class,a.message=o.response.data.error.data.message,a.object=o.response.data.error):o.request?(a.name="Request error",a.message="Request error, no response received"):a.name="Unknown error",a}}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,s){return this.exec("map_target_to_interface",[e,s])}connect_interface(e,...s){return s.length>0?this.exec("connect_interface",[e,...s]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,s,...i){return this.exec("interface_cmd",[e,s,...i])}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,s,i){return this.exec("get_item",[e,s,i])}get_param(e,s,i){return this.exec("get_param",[e,s,i])}get_parameter(e,s,i){return this.exec("get_param",[e,s,i])}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,s){return this.exec("get_tlm",[e,s])}get_telemetry(e,s){return this.exec("get_tlm",[e,s])}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,s=!1){return this.exec("get_all_tlm_names",[e],{hidden:s})}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,s,i,n=30){const r=await this.exec("get_tlm_packet",[e,s],{type:i,stale_time:n});if(r!=null){let o=r.length,a=null;for(let c=0;c<o;c++)a=this.decode_openc3_type(r[c][1]),a!==null&&(r[c][1]=a)}return r}get_packet_derived_items(e,s){return this.exec("get_packet_derived_items",[e,s])}get_tlm_buffer(e,s){return this.exec("get_tlm_buffer",[e,s])}async get_tlm_values(e,s=30,i=null){let n={stale_time:s};i!==null&&(n.cache_timeout=i);const r=await this.exec("get_tlm_values",[e],n,{},1e4);let o=r[0].length,a=null;for(let c=0;c<o;c++)a=this.decode_openc3_type(r[0][c]),a!==null&&(r[0][c]=a);return r}get_limits(e,s,i){return this.exec("get_limits",[e,s,i])}async tlm(e,s,i,n="CONVERTED"){let r=null;if(s===void 0)r=await this.exec("tlm",[e]);else if(i===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))r=await this.exec("tlm",[e],{type:s});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${s}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else r=await this.exec("tlm",[e,s,i],{type:n});let o=this.decode_openc3_type(r);return o!==null&&(r=o),r}async inject_tlm(e,s,i=null,n="CONVERTED"){await this.exec("inject_tlm",[e,s,i],{type:n})}set_tlm(e,s,i,n){return this.exec("set_tlm",[e,s,i],{type:n})}override_tlm(e,s,i,n){return this.exec("override_tlm",[e,s,i],{type:n})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,s,i,n){return this.exec("normalize_tlm",[e,s,i],{type:n})}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,s=!1){return this.exec("get_all_cmd_names",[e],{hidden:s})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,s){return this.exec("get_cmd",[e,s])}get_command(e,s){return this.exec("get_cmd",[e,s])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,s,i,n="CONVERTED"){return this.exec("get_cmd_value",[e,s,i,n])}get_cmd_buffer(e,s){return this.exec("get_cmd_buffer",[e,s])}_cmd(e,s,i,n,r){let o=null;for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o=this.encode_openc3_type(n[a]),o!==null&&(n[a]=o));return this.exec(e,[s,i,n],{},r)}get_cmd_hazardous(e,s,i,n={}){return s===void 0?this.exec("get_cmd_hazardous",e,{},n):this._cmd("get_cmd_hazardous",e,s,i,n)}cmd(e,s,i,n={}){return s===void 0?this.exec("cmd",e,{},n):this._cmd("cmd",e,s,i,n)}cmd_no_range_check(e,s,i,n={}){return s===void 0?this.exec("cmd_no_range_check",e,{},n):this._cmd("cmd_no_range_check",e,s,i,n)}cmd_raw(e,s,i,n={}){return s===void 0?this.exec("cmd_raw",e,{},n):this._cmd("cmd_raw",e,s,i,n)}cmd_raw_no_range_check(e,s,i,n={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,{},n):this._cmd("cmd_raw_no_range_check",e,s,i,n)}cmd_no_hazardous_check(e,s,i,n={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,{},n):this._cmd("cmd_no_hazardous_check",e,s,i,n)}cmd_no_checks(e,s,i,n={}){return s===void 0?this.exec("cmd_no_checks",e,{},n):this._cmd("cmd_no_checks",e,s,i,n)}cmd_raw_no_hazardous_check(e,s,i,n={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},n):this._cmd("cmd_raw_no_hazardous_check",e,s,i,n)}cmd_raw_no_checks(e,s,i,n={}){return s===void 0?this.exec("cmd_raw_no_checks",e,{},n):this._cmd("cmd_raw_no_checks",e,s,i,n)}build_cmd(e,s,i){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,i)}build_command(e,s,i){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,i)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,s){return this.exec("send_raw",[e,s])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,s){return this.exec("load_config",[e,s])}save_config(e,s,i){return this.exec("save_config",[e,s,i])}delete_config(e,s){return this.exec("delete_config",[e,s])}enable_limits(e,s,i){return this.exec("enable_limits",[e,s,i])}disable_limits(e,s,i){return this.exec("disable_limits",[e,s,i])}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,s){return this.exec("set_setting",[e,s])}update_news(){return this.exec("update_news",[])}save_setting(e,s){return this.exec("set_setting",[e,s])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const s=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",s),n=new Uint8Array(i);return Array.from(n).map(r=>r.toString(16).padStart(2,"0")).join("")}}}let Ne=[];const wr={components:{OpenConfigDialog:ft,SaveConfigDialog:ht,TargetPacketItemChooser:dt,TopBar:Ts},mixins:[lt,ut],data(){return{title:"Data Extractor",configKey:"data_extractor",openConfig:!1,saveConfig:!1,api:null,timeZone:"local",progress:0,packetsReceived:0,totalPacketsReceived:0,itemsReceived:0,totalItemsReceived:0,processButtonText:"Process",todaysDate:null,startDate:null,startTime:null,endTime:null,endDate:null,startDateTime:null,endDateTime:null,startDateTimeFilename:"",rules:{required:t=>!!t||"Required"},cmdOrTlm:"tlm",items:[],search:"",headers:[{title:"Target",value:"targetName"},{title:"Packet",value:"packetName"},{title:"Item",value:"itemName"},{title:"Mode",value:"mode"},{title:"ValueType",value:"valueType"},{title:"ReducedType",value:"reducedType"},{title:"Edit",value:"edit"},{title:"Delete",value:"delete"}],itemsPerPage:20,columnMap:{},delimiter:",",columnMode:"normal",fileCount:0,skipIgnored:!0,fillDown:!1,matlabHeader:!1,uniqueOnly:!1,keyMap:{},modes:["DECOM","REDUCED_MINUTE","REDUCED_HOUR","REDUCED_DAY"],valueTypes:["CONVERTED","RAW","FORMATTED","WITH_UNITS"],reducedTypes:["SAMPLE","MIN","MAX","AVG","STDDEV"],editAll:!1,allItemMode:"DECOM",allItemValueType:"CONVERTED",allItemReducedType:"SAMPLE",cable:new jn,subscription:null}},computed:{menus:function(){return[{label:"File",items:[{label:"Open Configuration",icon:"mdi-folder-open",command:()=>{this.openConfig=!0}},{label:"Save Configuration",icon:"mdi-content-save",command:()=>{this.saveConfig=!0}},{label:"Reset Configuration",icon:"mdi-monitor-shimmer",command:()=>{this.resetConfig(),this.resetConfigBase()}},{divider:!0},{radioGroup:!0,value:this.delimiter,command:t=>{this.delimiter=t},choices:[{label:"Comma Delimited",value:","},{label:"Tab Delimited",value:" "}]}]},{label:"Mode",items:[{label:"Fill Down",checkbox:!0,checked:this.fillDown,command:()=>{this.fillDown=!this.fillDown}},{label:"Matlab Header",checkbox:!0,checked:this.matlabHeader,command:t=>{this.matlabHeader=!this.matlabHeader}},{label:"Unique Only",checkbox:!0,checked:this.uniqueOnly,command:t=>{this.uniqueOnly=!this.uniqueOnly}},{divider:!0},{radioGroup:!0,value:this.columnMode,command:t=>{this.columnMode=t},choices:[{label:"Normal Columns",value:"normal"},{label:"Full Column Names",value:"full"}]}]}]},currentConfig:function(){return{delimiter:this.delimiter,fillDown:this.fillDown,matlabHeader:this.matlabHeader,uniqueOnly:this.uniqueOnly,columnMode:this.columnMode,cmdOrTlm:this.cmdOrTlm,items:this.items,itemsPerPage:this.itemsPerPage}}},watch:{delimiter:function(){this.saveDefaultConfig(this.currentConfig)},fillDown:function(){this.saveDefaultConfig(this.currentConfig)},matlabHeader:function(){this.saveDefaultConfig(this.currentConfig)},uniqueOnly:function(){this.saveDefaultConfig(this.currentConfig)},columnNode:function(){this.saveDefaultConfig(this.currentConfig)},cmdOrTlm:function(){this.items.length===0?this.saveDefaultConfig(this.currentConfig):this.items=[]},items:{handler:function(){this.saveDefaultConfig(this.currentConfig)},deep:!0},itemsPerPage:function(){this.saveDefaultConfig(this.currentConfig)}},async created(){this.api=new _r,await this.api.get_setting("time_zone").then(e=>{e&&(this.timeZone=e)}).catch(e=>{});let t=new Date;this.todaysDate=this.formatDate(t,this.timeZone),this.startDate=this.formatDate(t-36e5,this.timeZone),this.startTime=this.formatTimeHMS(t-36e5,this.timeZone),this.endTime=this.formatTimeHMS(t,this.timeZone),this.endDate=this.formatDate(t,this.timeZone)},mounted:function(){if(this.$route.query&&this.$route.query.config)this.openConfiguration(this.$route.query.config,!0);else{let t=this.loadDefaultConfig();JSON.stringify(t)!=="{}"&&this.applyConfig(t)}},unmounted:function(){this.subscription&&this.subscription.unsubscribe(),this.cable.disconnect()},methods:{resetConfig:function(){this.delimiter=",",this.fillDown=!1,this.matlabHeader=!1,this.uniqueOnly=!1,this.columnMode="normal";let t=new Date;this.startDate=this.formatDate(t-36e5,this.timeZone),this.startTime=this.formatTimeHMS(t-36e5,this.timeZone),this.endTime=this.formatTimeHMS(t,this.timeZone),this.endDate=this.formatDate(t,this.timeZone),this.cmdOrTlm="tlm",this.items=[],this.itemsPerPage=20,this.applyConfig(this.currentConfig)},applyConfig:function(t){this.delimiter=t.delimiter||",",this.menus[0].radioGroup=this.delimiter===","?"Comma Delimited":"Tab Delimited",this.fillDown=t.fillDown,this.menus[1].items[0].checked=this.fillDown||!1,this.matlabHeader=t.matlabHeader,this.menus[1].items[1].checked=this.matlabHeader||!1,this.uniqueOnly=t.uniqueOnly,this.menus[1].items[2].checked=this.uniqueOnly||!1,this.columnMode=t.columnMode,this.menus[1].radioGroup=this.columnMode==="normal"?"Normal Columns":"Full Column Names",this.cmdOrTlm=t.cmdOrTlm,this.items=t.items,this.itemsPerPage=t.itemsPerPage},openConfiguration:function(t,e=!1){this.openConfigBase(t,e,s=>{this.applyConfig(s),this.startDate=s.startDate,this.startTime=s.startTime,this.endTime=s.endTime,this.endDate=s.endDate,this.saveDefaultConfig(this.currentConfig)})},saveConfiguration:function(t){let e=this.currentConfig;e.startDate=this.startDate,e.startTime=this.startTime,e.endTime=this.endTime,e.endDate=this.endDate,this.saveConfigBase(t,e)},addItem:function(t){for(const e of this.items)if(e.itemName===t.itemName&&e.packetName===t.packetName&&e.targetName===t.targetName&&e.valueType==="CONVERTED"&&e.reducedType==="SAMPLE"&&e.mode==="DECOM"){this.$notify.caution({body:"This item has already been added!"});return}t.cmdOrTlm=this.cmdOrTlm.toUpperCase(),t.edit=!1,t.valueType="CONVERTED",t.reducedType="SAMPLE",t.mode="DECOM",this.items.push(t)},deleteItem:function(t){let e=this.items.indexOf(t);this.items.splice(e,1)},deleteAll:function(){this.items=[]},editAllItems:function(){this.editAll=!1;for(let t of this.items)t.mode=this.allItemMode,t.valueType=this.allItemValueType,t.reducedType=this.allItemReducedType},getItemLabel:function(t){let e=[`${t.targetName} - ${t.packetName} - ${t.itemName}`];return t.mode!=="DECOM"&&e.push(`{ ${t.mode} }`),t.valueType!=="CONVERTED"&&e.push(`( ${t.valueType} )`),t.reducedType!=="SAMPLE"&&e.push(`[ ${t.reducedType} ]`),e.join(" ")},setTimestamps:function(){this.startDateTimeFilename=this.startDate+"_"+this.startTime,this.startDateTimeFilename=this.startDateTimeFilename.replace(/(:|-|\.)\s*/g,"_");let t,e;try{this.timeZone==="local"?(t=new Date(this.startDate+" "+this.startTime),e=new Date(this.endDate+" "+this.endTime)):(t=new Date(this.startDate+" "+this.startTime+"Z"),e=new Date(this.endDate+" "+this.endTime+"Z"),this.startDateTimeFilename+="_UTC")}catch{return}this.startDateTime=t.getTime()*1e6,this.endDateTime=e.getTime()*1e6},processItems:function(){if(this.processButtonText==="Cancel"){this.finished();return}if(this.setTimestamps(),!this.startDateTime||!this.endDateTime){this.$notify.caution({body:"Invalid date/time selected!"});return}if(this.startDateTime===this.endDateTime){this.$notify.caution({body:"Start date/time is equal to end date/time!"});return}if(this.endDateTime-this.startDateTime<0){this.$notify.caution({body:"Start date/time is greater then end date/time!"});return}new Date(this.endDateTime/1e6)>Date.now()&&this.$notify.caution({title:"Note",body:`End date/time is greater than current date/time. Data will
6
+ `):" "+Wt(r[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:Ze};function Ge(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ne(null,t)}function Zt(t){return Ge(t),t.headers=V.from(t.headers),t.data=We.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Kt.getAdapter(t.adapter||le.adapter)(t).then(function(e){return Ge(t),e.data=We.call(t,t.transformResponse,e),e.headers=V.from(e.headers),e},function(e){return Ut(e)||(Ge(t),e&&e.response&&(e.response.data=We.call(t,t.transformResponse,e.response),e.response.headers=V.from(e.response.headers))),Promise.reject(e)})}const Gt="1.9.0",Re={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Re[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Xt={};Re.transitional=function(t,e,s){function i(n,r){return"[Axios v"+Gt+"] Transitional option '"+n+"'"+r+(s?". "+s:"")}return(n,r,o)=>{if(t===!1)throw new v(i(r," has been removed"+(e?" in "+e:"")),v.ERR_DEPRECATED);return e&&!Xt[r]&&(Xt[r]=!0,console.warn(i(r," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,r,o):!0}},Re.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Qi(t,e,s){if(typeof t!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const i=Object.keys(t);let n=i.length;for(;n-- >0;){const r=i[n],o=e[r];if(o){const a=t[r],c=a===void 0||o(a,r,t);if(c!==!0)throw new v("option "+r+" must be "+c,v.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new v("Unknown option "+r,v.ERR_BAD_OPTION)}}const ke={assertOptions:Qi,validators:Re},W=ke.validators;let X=class{constructor(t){this.defaults=t||{},this.interceptors={request:new It,response:new It}}async request(t,e){try{return await this._request(t,e)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const n=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?n&&!String(s.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(s.stack+=`
7
+ `+n):s.stack=n}catch{}}throw s}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=G(this.defaults,e);const{transitional:s,paramsSerializer:i,headers:n}=e;s!==void 0&&ke.assertOptions(s,{silentJSONParsing:W.transitional(W.boolean),forcedJSONParsing:W.transitional(W.boolean),clarifyTimeoutError:W.transitional(W.boolean)},!1),i!=null&&(u.isFunction(i)?e.paramsSerializer={serialize:i}:ke.assertOptions(i,{encode:W.function,serialize:W.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),ke.assertOptions(e,{baseUrl:W.spelling("baseURL"),withXsrfToken:W.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let r=n&&u.merge(n.common,n[e.method]);n&&u.forEach(["delete","get","head","post","put","patch","common"],h=>{delete n[h]}),e.headers=V.concat(r,n);const o=[];let a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(e)===!1||(a=a&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});const c=[];this.interceptors.response.forEach(function(h){c.push(h.fulfilled,h.rejected)});let l,d=0,g;if(!a){const h=[Zt.bind(this),void 0];for(h.unshift.apply(h,o),h.push.apply(h,c),g=h.length,l=Promise.resolve(e);d<g;)l=l.then(h[d++],h[d++]);return l}g=o.length;let b=e;for(d=0;d<g;){const h=o[d++],w=o[d++];try{b=h(b)}catch(p){w.call(this,p);break}}try{l=Zt.call(this,b)}catch(h){return Promise.reject(h)}for(d=0,g=c.length;d<g;)l=l.then(c[d++],c[d++]);return l}getUri(t){t=G(this.defaults,t);const e=Vt(t.baseURL,t.url,t.allowAbsoluteUrls);return Dt(e,t.params,t.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(t){X.prototype[t]=function(e,s){return this.request(G(s||{},{method:t,url:e,data:(s||{}).data}))}}),u.forEach(["post","put","patch"],function(t){function e(s){return function(i,n,r){return this.request(G(r||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}X.prototype[t]=e(),X.prototype[t+"Form"]=e(!0)});let Yi=class ys{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let s;this.promise=new Promise(function(n){s=n});const i=this;this.promise.then(n=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](n);i._listeners=null}),this.promise.then=n=>{let r;const o=new Promise(a=>{i.subscribe(a),r=a}).then(n);return o.cancel=function(){i.unsubscribe(r)},o},e(function(n,r,o){i.reason||(i.reason=new ne(n,r,o),s(i.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 s=this._listeners.indexOf(e);s!==-1&&this._listeners.splice(s,1)}toAbortSignal(){const e=new AbortController,s=i=>{e.abort(i)};return this.subscribe(s),e.signal.unsubscribe=()=>this.unsubscribe(s),e.signal}static source(){let e;return{token:new ys(function(s){e=s}),cancel:e}}};function en(t){return function(e){return t.apply(null,e)}}function tn(t){return u.isObject(t)&&t.isAxiosError===!0}const Xe={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(Xe).forEach(([t,e])=>{Xe[e]=t});function Qt(t){const e=new X(t),s=gt(X.prototype.request,e);return u.extend(s,X.prototype,e,{allOwnKeys:!0}),u.extend(s,e,null,{allOwnKeys:!0}),s.create=function(i){return Qt(G(t,i))},s}const I=Qt(le);I.Axios=X,I.CanceledError=ne,I.CancelToken=Yi,I.isCancel=Ut,I.VERSION=Gt,I.toFormData=Te,I.AxiosError=v,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=en,I.isAxiosError=tn,I.mergeConfig=G,I.AxiosHeaders=V,I.formToJSON=t=>Nt(u.isHTMLForm(t)?new FormData(t):t),I.getAdapter=Kt.getAdapter,I.HttpStatusCode=Xe,I.default=I;const{Axios:Tr,AxiosError:Sr,CanceledError:xr,isCancel:Cr,CancelToken:Or,VERSION:Rr,all:kr,Cancel:Ar,isAxiosError:Dr,spread:Ir,toFormData:Pr,AxiosHeaders:Nr,HttpStatusCode:jr,formToJSON:Ur,getAdapter:Lr,mergeConfig:Fr}=I,Yt=I.create({baseURL:location.origin,timeout:6e4,params:{}});Yt.interceptors.response.use(t=>t,t=>{var e,s,i,n,r,o,a,c,l,d,g;if(t.response){if(t.response.status===401&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(w){w&&OpenC3Auth.setTokens()}),t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);let b=`HTTP ${t.response.status} - `;(e=t.response)!=null&&e.statusText&&(b+=`${t.response.statusText} `),(i=(s=t.response)==null?void 0:s.config)!=null&&i.data&&(b+=`${t.response.config.data} `),(r=(n=t.response)==null?void 0:n.data)!=null&&r.message?b+=`${t.response.data.message}`:(a=(o=t.response)==null?void 0:o.data)!=null&&a.exception?b+=`${t.response.data.exception}`:(d=(l=(c=t.response)==null?void 0:c.data)==null?void 0:l.error)!=null&&d.message?(t.response.data.error.class&&(b+=`${t.response.data.error.class} `),b+=`${t.response.data.error.message}`):b+=`${(g=t.response)==null?void 0:g.data}`;const{$cosmosNotify:h}=window;throw h&&h.serious({title:"Network error",body:b}),t}else throw t});let Ae=()=>({emit(t,...e){for(let s=this.events[t]||[],i=0,n=s.length;i<n;i++)s[i](...e)},events:{},on(t,e){var s;return((s=this.events)[t]||(s[t]=[])).push(e),()=>{var i;this.events[t]=(i=this.events[t])==null?void 0:i.filter(n=>e!==n)}}});class de extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class Qe extends de{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class sn extends de{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class z extends de{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class nn extends z{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function es(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let s=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${s}`}).join(",")}}`:""}class rn{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,s){if(!this._info)return this._info={id:e,info:s},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((s,{id:i,info:n})=>(s[i]=n,s),{})}}const Q=Symbol("state");class ts{constructor(e={}){this.emitter=Ae(),this.params=Object.freeze(e),this.presence=new rn(this),this.initialConnect=!0,this[Q]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=es({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[Q]}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[Q]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[Q]="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[Q]="connected";let e=!0,s=!0;this.initialConnect=!1,this.emit("connect",{reconnect:s,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[Q]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[Q]="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,s){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,s)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(s){let i=this.receiver?this.receiver.logger:null;i&&i.warn("whisper failed: ",s)}}receive(e,s){this.emit("message",e,s)}on(e,s){return this.emitter.on(e,s)}once(e,s){let i=this.emitter.on(e,(...n)=>{i(),s(...n)});return i}emit(e,...s){return this.emitter.emit(e,...s)}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,s)=>{let i=[()=>delete this._pendingSubscribe];i.push(this.on("connect",()=>{i.forEach(n=>n()),e()})),i.push(this.on("close",n=>{i.forEach(r=>r()),s(n||new de("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class on{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 s=this.channels.indexOf(e);s>-1&&this.channels.splice(s,1)}notify(e,...s){this.state=e==="restored"?"connected":e,s.length===1?this.channels.forEach(i=>i[e](s[0])):this.channels.forEach(i=>i[e]())}pending(e){this._checkIntent(e);let s=this._pendings[0];return!s||s.intent!==e?Promise.resolve():s.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 s,i={promise:new Promise(r=>{s=r}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(i),1),s(i)},canceled:!1,acquired:!1},n=this._pendingTop;return this._pendings.push(i),n&&await n.promise,this.gvl&&await this.gvl.acquire(i,e),i.acquired=!0,i}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 s=this._pendingTop;return!s||s.acquired||s.intent!==e?!1:(this._pendings.pop(),s.canceled=!0,!0)}}class an{constructor(){this.queue=[]}async acquire(e,s){s==="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 cn{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new an),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:s,unsubscribe:i}){let n=this._subscriptions[e]=new on(e);return n.remoteId=this._localToRemote[e],n.subscriber=s,n.unsubscriber=i,n.gvl=this.glv,n}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,s){this._localToRemote[e]=s;let i=this.get(e);i&&(i.remoteId=s)}}class ln{constructor(e={}){this.subscriptions=new cn(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,s){this._remoteToLocal[s]=e,this.subscriptions.storeRemoteId(e,s),this.flush(s)}unsubscribe(e){let s=this.subscriptions.get(e);if(!s)return;let i=s.remoteId;i&&delete this._remoteToLocal[i],this.subscriptions.remove(e)}transmit(e,s,i){let n=this._remoteToLocal[e];if(!n){this._pendingMessages.push([e,s,i]);return}let r=this.subscriptions.get(n);r&&r.channels.forEach(o=>{o.receive(s,i)})}notify(e,s,i){let n=this._remoteToLocal[e];if(!n)return;let r=this.subscriptions.get(n);r&&r.channels.forEach(o=>o.emit(s,i))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let s=[];for(let i of this._pendingMessages)i[0]===e?this.transmit(i[0],i[1],i[2]):s.push(i);this._pendingMessages=s}}const ss={debug:0,info:1,warn:2,error:3};class is{constructor(e){this.level=e||"warn"}log(e,s,i){ss[e]<ss[this.level]||this.writeLogEntry(e,s,i)}writeLogEntry(){throw Error("Not implemented")}debug(e,s){this.log("debug",e,s)}info(e,s){this.log("info",e,s)}warn(e,s){this.log("warn",e,s)}error(e,s){this.log("error",e,s)}}class he extends is{writeLogEntry(){}}class un{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let dn=0;class ns{constructor(e={}){let{logger:s}=e;this.logger=s||new he,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,s){let i={channel:e};s&&Object.assign(i,s);let n=es(i);if(this.pendingUnsubscriptions[n]){let o=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${o}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},o)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let r=this.subscribeRetryInterval;return new Promise((o,a)=>{let c=++dn;this.pendingSubscriptions[n]={resolve:o,reject:a,id:c},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(c,n,r)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,s,i){setTimeout(()=>{let n=this.pendingSubscriptions[s];n&&n.id===e&&(this.logger.warn(`no subscription ack received in ${i}ms, retrying subscribe`,s),this.cable.send(this.buildSubscribeRequest(s)),this.maybeExpireSubscribe(e,s,i))},i)}maybeExpireSubscribe(e,s,i){setTimeout(()=>{let n=this.pendingSubscriptions[s];n&&n.id===e&&(delete this.pendingSubscriptions[s],n.reject(new sn(`Haven't received subscription ack in ${i*2}ms for ${s}`)))},i)}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,s,i){return s==="$whisper"?this.whisper(e,i):(i||(i={}),i.action=s,this.cable.send({command:"message",identifier:e,data:JSON.stringify(i)}),Promise.resolve())}whisper(e,s){return this.cable.send({command:"whisper",identifier:e,data:s}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:i,message:n,reason:r,reconnect:o}=e;if(s==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="welcome"){let a=e.sid;return a&&this.cable.setSessionId(a),this.cable.connected()}if(s==="disconnect"){let a=new z(r);this.reset(a),o===!1?this.cable.closed(a):this.cable.disconnected(a);return}if(s==="confirm_subscription"){let a=this.pendingSubscriptions[i];if(!a){this.logger.error("subscription not found, unsubscribing",{type:s,identifier:i}),this.unsubscribe(i);return}return delete this.pendingSubscriptions[i],a.resolve(i)}if(s==="reject_subscription"){let a=this.pendingSubscriptions[i];return a?(delete this.pendingSubscriptions[i],a.reject(new Qe)):this.logger.error("subscription not found",{type:s,identifier:i})}if(n)return{identifier:i,message:n};this.logger.warn(`unknown message type: ${s}`,{message:e})}reset(e){for(let s in this.pendingSubscriptions)this.pendingSubscriptions[s].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const rs=()=>Date.now()/1e3|0;class hn extends ns{constructor(e={}){super(e),this.streamsPositions={},this.subscriptionStreams={},this.pendingHistory={},this.pendingPresence={},this.presenceInfo={},this.restoreSince=e.historyTimestamp,this.disableSessionRecovery=e.disableSessionRecovery,this.restoreSince===void 0&&(this.restoreSince=rs()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let s in this.pendingPresence)this.pendingPresence[s].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:s,identifier:i,message:n}=e;if(s==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(s==="reject_subscription")return super.receive(e);if(s==="confirm_subscription")return this.subscriptionStreams[i]||(this.subscriptionStreams[i]=new Set),super.receive(e);if(s==="ping")return this.restoreSince&&(this.restoreSince=rs()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),s==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",i);return}if(s==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",i);return}if(s==="welcome"){if(this.disableSessionRecovery||(this.sessionId=e.sid,this.sessionId&&this.cable.setSessionId(this.sessionId)),e.restored){let r=e.restored_ids||Object.keys(this.subscriptionStreams);for(let o of r)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(r)}return this.cable.connected(this.sessionId)}if(s==="presence"){let r=n.type;if(r==="info"){let o=this.pendingPresence[i];o&&(delete this.pendingPresence[i],o.resolve(n))}else if(r==="error"){let o=this.pendingPresence[i];o&&(delete this.pendingPresence[i],o.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:i,message:n}}if(n){let r=this.trackStreamPosition(i,e.stream_id,e.epoch,e.offset);return{identifier:i,message:n,meta:r}}this.logger.warn(`unknown message type: ${s}`,{message:e})}perform(e,s,i){switch(s){case"$presence:join":return this.join(e,i);case"$presence:leave":return this.leave(e,i);case"$presence:info":return this.presence(e,i)}return super.perform(e,s,i)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let s=super.buildSubscribeRequest(e),i=this.historyRequestFor(e);i&&(s.history=i,this.pendingHistory[e]=!0);let n=this.presenceInfo[e];return n&&(s.presence=n),s}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let s={},i=!1;if(this.subscriptionStreams[e])for(let n of this.subscriptionStreams[e]){let r=this.streamsPositions[n];r&&(i=!0,s[n]=r)}if(!(!i&&!this.restoreSince))return{since:this.restoreSince,streams:s}}trackStreamPosition(e,s,i,n){if(!(!s||!i))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(s),this.streamsPositions[s]={epoch:i,offset:n},{stream:s,epoch:i,offset:n}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,s){return this.presenceInfo[e]=s,this.cable.send({command:"join",identifier:e,presence:s}),Promise.resolve()}async leave(e,s){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:s}),Promise.resolve()}presence(e,s){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((i,n)=>{this.pendingPresence[e]={resolve:i,reject:n},this.cable.send({command:"presence",identifier:e,data:s})})}}class fn extends de{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class Ye extends ts{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}be(Ye,"identifier","__ghost__");const pn="$pubsub";class et extends ts{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}be(et,"identifier",pn);const Y=Symbol("state");let mn=class{constructor({transport:t,protocol:e,encoder:s,logger:i,lazy:n,hubOptions:r,performFailures:o,transportConfigurator:a}){this.emitter=Ae(),this.transport=t,this.encoder=s,this.logger=i||new he,this.protocol=e,this.performFailures=o||"throw",this.protocol.attached(this),this.hub=new ln(r||{}),this[Y]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=a,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,n===!1&&this.connect().catch(()=>{})}get state(){return this[Y]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[Y]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(s){this.handleClose(s)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[Y]="connected",this.recovering&&this.hub.subscriptions.all().forEach(e=>e.notify("disconnected",new z("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[Y]="connected",this.hub.subscriptions.all().forEach(i=>{t&&i.remoteId&&t.includes(i.remoteId)?i.notify("restored"):(i.notify("disconnected",new z("recovery_failed")),this._resubscribe(i))});let e=!this.initialConnect,s=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:s})}notify(t,e,s){e&&typeof e!="string"&&(s=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:s}):this.emit("info",{type:t,data:s})}handleClose(t){this.logger.debug("transport closed",{error:t}),this.disconnected(new z(t,"transport_closed"))}disconnected(t){(this.state==="connected"||this.state==="connecting")&&(this.logger.info("disconnected",{reason:t}),this[Y]="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 z?t:new z(t,void 0)),this.logger.info("closed",{reason:t||"user"}),this[Y]="closed";let s=e||new z("cable_closed");this.hub.subscriptions.all().forEach(i=>i.notify("disconnected",s)),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 s=this.protocol.receive(e);if(s){this.logger.debug("processed incoming message",s);let{type:i,identifier:n,message:r,meta:o}=s;i?this.hub.notify(n,i,r):this.hub.transmit(n,r,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 et({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new et({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,i;return typeof t=="string"&&(i=t,t=Ye),s=i?new t(i,e):new t(e),this.subscribe(s)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let s=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:i=>this._subscribe(i,t.channelId,t.params),unsubscribe:i=>this._unsubscribe(i)});return s.add(t),s.intent==="subscribed"&&s.state==="connected"&&t.connected(),s.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,s){let i=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:i});return}this.logger.debug("acquiring subscribe lock",{identifier:i});let n=await t.acquire("subscribed");if(n.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:i}),n.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:i}),t.intent!=="subscribed"){this.logger.debug("cancel subscribe request, already unsubscribed"),n.release();return}if(this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:i}),n.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:i}),t.notify("connected"),n.release();return}let r={identifier:e,params:s};this.logger.debug("subscribing",r);try{let o=await this.protocol.subscribe(e,s);this.hub.subscribe(i,o),this.logger.debug("subscribed",{...r,remoteId:o}),t.notify("connected")}catch(o){if(o){if(o instanceof Qe&&this.logger.warn("rejected",r),o instanceof z){this.logger.debug("disconnected during subscription; will retry on connect",r),n.release();return}this.logger.error("failed to subscribe",{error:o,...r})}t.close(o),this.hub.unsubscribe(i)}n.release()}unsubscribe(t){let e=t.identifier,s=this.hub.subscriptions.get(e);if(!s)throw Error(`Subscription not found: ${e}`);s.remove(t),t.closed(),s.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let s=await t.acquire("unsubscribed");if(s.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),s.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}),s.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),s.release();return}let i=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:i}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),s.release();return}try{await this.protocol.unsubscribe(i),this.logger.debug("unsubscribed remotely",{id:e})}catch(n){n&&(n instanceof z?this.logger.debug("cable disconnected during the unsubscribe command execution",{id:e,error:n}):this.logger.error("unsubscribe failed",{id:e,error:n}))}t.intent==="unsubscribed"?(t.close(),this.hub.unsubscribe(e)):t.state="closed",s.release()}async perform(t,e,s){if(this.performFailures==="throw")return this._perform(t,e,s);try{return await this._perform(t,e,s)}catch(i){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:i});return}}async _perform(t,e,s){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new fn;let i=this.hub.subscriptions.get(t);if(!i)throw Error(`Subscription not found: ${t}`);if(await i.pending("subscribed"),i.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let n=i.remoteId,r={id:n,action:e,payload:s};this.logger.debug("perform",r);try{let o=await this.protocol.perform(n,e,s);return o&&this.logger.debug("perform result",{message:o,request:r}),o}catch(o){throw this.logger.error("perform failed",{error:o,request:r}),o}}on(t,e){return this.emitter.on(t,e)}once(t,e){let s=this.emitter.on(t,(...i)=>{s(),e(...i)});return s}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let s=[()=>delete this._pendingConnect];s.push(this.on("connect",()=>{s.forEach(i=>i()),t()})),s.push(this.on("close",i=>{s.forEach(n=>n()),e(i)})),s.push(this.on("disconnect",i=>{s.forEach(n=>n()),e(i)}))}),this._pendingConnect)}};const gn={maxMissingPings:2,maxReconnectAttempts:1/0},re=()=>Date.now(),os=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:i,maxInterval:n}=e;return s=s||2,i===void 0&&(i=.5),r=>{let o=t*s**r,a=o*s,c=o+(a-o)*Math.random(),l=2*(Math.random()-.5)*i;return c=c*(1+l),n&&n<c&&(c=n),c}};let as=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},gn,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 he,this.state="pending_connect",this.attempts=0,this.disconnectedAt=re()}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=re(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=re(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=re(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=re()})),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=re()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new nn))}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 bn{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=Ae(),this.unbind=[],this.logger=s.logger||new he}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let s=this.transports[e];try{this.transport=s,this.resetListeners(),this.logger.debug(`Trying to connect via ${s.displayName()}`),await s.open(),this.logger.debug(`Connected via ${s.displayName()}`);return}catch(i){this.logger.debug(`Failed to connect via ${s.displayName()}: ${i.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,s){this.transports.forEach(i=>{i.setParam(e,s)})}setToken(e,s){this.transports.forEach(i=>{i.setToken(e,s)})}on(e,s){return this.emitter.on(e,s)}once(e,s){let i=this.emitter.on(e,(...n)=>{i(),s(...n)});return i}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 yn{constructor(e,s={}){this.url=e;let i=s.websocketImplementation;if(i)this.Impl=i;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Ae();let{format:n,subprotocol:r,authStrategy:o}=s;this.format=n||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=o||"param",this.authProtocol="",this.subprotocol=r}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((s,i)=>{let n=[];n.push(this.once("open",()=>{n.forEach(r=>r()),s()})),n.push(this.once("close",()=>{n.forEach(r=>r()),i(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,s){let i=new URL(this.url);i.searchParams.set(e,s);let n=`${i.protocol}//${i.host}${i.pathname}?${i.searchParams}`;this.setURL(n)}setToken(e,s="jid"){if(this.authStrategy==="param")this.setParam(s,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let i=`x-${s}`.toLowerCase();i=Object.keys(this.connectionOptions.headers).find(n=>n.toLowerCase()===i)||i,this.connectionOptions.headers[i]=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,s){return this.emitter.on(e,s)}once(e,s){let i=this.emitter.on(e,(...n)=>{i(),s(...n)});return i}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 s=e.data;this.format==="binary"&&(s=new Uint8Array(s)),this.emitter.emit("data",s)},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 cs={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function _n(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({},cs,e);let{protocol:s,websocketImplementation:i,websocketFormat:n,websocketOptions:r,websocketAuthStrategy:o,fallbacks:a,logLevel:c,logger:l,transport:d,encoder:g,lazy:b,monitor:h,pingInterval:w,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,subprotocol:x,tokenRefresher:O,historyTimestamp:j,protocolOptions:_,concurrentSubscribes:k,performFailures:D,transportConfigurator:q,auth:$}=e;if(l=l||new he(c),typeof s=="string"){x=x||s;let P=s.substring(0,s.lastIndexOf("-")),B=s.substring(s.lastIndexOf("-")+1);if(_=_||{},P==="actioncable-v1")s=new ns({logger:l,..._});else if(P==="actioncable-v1-ext")s=new hn({logger:l,historyTimestamp:j,..._});else throw Error(`Protocol is not supported yet: ${s}`);if(B==="json")g=g||new un,n=n||"text";else if(B==="msgpack"){if(n="binary",!g)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(B==="protobuf"){if(n=n||"binary",!g)throw Error("Protobuf encoder must be specified explicitly. Use `@anycable/protobuf-encoder` package or build your own")}else throw Error(`Protocol is not supported yet: ${s}`)}if(!s)throw Error("Protocol must be specified");d=d||new yn(t,{websocketImplementation:i,websocketOptions:r,subprotocol:x,authStrategy:o,format:n}),a&&(d=new bn([d,...a],{logger:l})),$&&$.token&&d.setToken($.token,$.param||"jid"),p=p||os(w),h!==!1&&(h=h||new as({pingInterval:w,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,logger:l}));let pe={concurrentSubscribes:k},y=new mn({protocol:s,transport:d,encoder:g,logger:l,lazy:b,hubOptions:pe,performFailures:D,transportConfigurator:q});return h&&(h.watch(y),y.monitor=h),O&&wn(y,async()=>{try{await O(d)}catch(P){return l.error("Failed to refresh authentication token: "+P),!1}return y.connect().catch(()=>{}),!0}),y}function wn(t,e){let s=!1;t.on("connect",()=>s=!1),t.on("close",async i=>{if(i){if(s){t.logger.warn("Token auto-refresh is disabled",i);return}i.reason==="token_expired"&&(s=!0,await e())}})}class vn{constructor(e){this.channel=e}notify(e,...s){typeof this[e]=="function"&&this[e](...s)}perform(e,s={}){this.channel.perform(e,s)}send(e){this.channel.send(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class En extends Ye{constructor(e,s,i){super(e,s),this.subscription=new vn(this),Object.assign(this.subscription,i),this.on("connect",({reconnect:n})=>this.subscription.notify("connected",{reconnected:n})),this.on("disconnect",()=>this.subscription.notify("disconnected",{allowReconnect:!0})),this.on("message",n=>this.subscription.notify("received",n)),this.on("close",n=>{n&&n instanceof Qe?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Tn{constructor(e){this.cable=e}create(e,s){let i,n;typeof e=="object"?(i=e.channel,delete e.channel,n=e):(i=e,n={});let r=new En(i,n,s);return r.subscription.notify("initialized"),this.cable.subscribe(r),r.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class Sn{constructor(e){this.cable=e,this.subscriptions=new Tn(e)}}class xn extends is{writeLogEntry(e,s,i){i?console[e](s,i):console[e](s)}}class Cn extends as{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")},s=n=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:n})},i=()=>this.disconnect(new z("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",s,!1),window.addEventListener("online",s,!1),window.addEventListener("resume",s,!1),window.addEventListener("freeze",i,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",s,!1),window.removeEventListener("online",s,!1),window.removeEventListener("resume",s,!1),window.removeEventListener("freeze",i,!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 On=["cable","action-cable"],Rn="/cable",De=(t,e)=>{for(let s of On){let i=t.head.querySelector(`meta[name='${s}-${e}']`);if(i)return i.getAttribute("content")}},ls=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,kn=()=>{if(typeof document<"u"&&document.head){let t=De(document,"url");if(t)return ls(t)}return ls(Rn)},An=()=>{if(typeof document<"u"&&document.head){let t=De(document,"history-timestamp");if(t)return t|0}},Dn=()=>{if(typeof document<"u"&&document.head)return De(document,"token")},In=()=>{if(typeof document<"u"&&document.head)return De(document,"token-param")};function Pn(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||kn(),e=e||{},e.historyTimestamp||(e.historyTimestamp=An());let s=Dn();if(s){let l=In();e.auth=Object.assign({token:s,param:l},e.auth||{})}e=Object.assign({},cs,e);let{logLevel:i,logger:n,pingInterval:r,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:c}=e;return n=e.logger=e.logger||new xn(i),o=e.reconnectStrategy=e.reconnectStrategy||os(r),e.monitor!==!1&&(e.monitor=e.monitor||new Cn({pingInterval:r,reconnectStrategy:o,maxMissingPings:a,maxReconnectAttempts:c,logger:n})),_n(t,e)}function Nn(t,e){let s=Pn(t,e);return new Sn(s)}class jn{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e}disconnect(){this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,s,i={},n={}){return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(r=>{if(r&&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=Nn(o)}return this._cable.subscriptions.create({channel:e,...n},i)})}recordPing(){}}function Ie(t){return Un.test(t)}const Un=/^-?[0-9]+$/;function us(t){return Ln.test(t)}const Ln=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ds(t,e){const s=Number.parseFloat(t),i=String(s),n=hs(t),r=hs(i);return!!(n===r||(e==null?void 0:e.approx)===!0&&!Ie(t)&&r.length>=14&&n.startsWith(r.substring(0,14)))}let fe=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Fn(t){if(ds(t,{approx:!1}))return;if(Ie(t))return fe.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?fe.underflow:fe.truncate_float:fe.overflow}function hs(t){return t.replace(Mn,"").replace(qn,"").replace(Bn,"").replace(Vn,"")}const Mn=/[eE][+-]?\d+$/,Vn=/^-?(0*)?/,qn=/\./,Bn=/0+$/;class $n{constructor(e){if(be(this,"isLosslessNumber",!0),!us(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Fn(this.value);if(e===void 0||e===fe.truncate_float)return Number.parseFloat(this.value);if(Ie(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 Hn(t){return t&&typeof t=="object"&&t.isLosslessNumber===!0||!1}function zn(t){return new $n(t)}function Jn(t,e){return tt({"":t},"",t,e)}function tt(t,e,s,i){return Array.isArray(s)?i.call(t,e,Kn(s,i)):s&&typeof s=="object"&&!Hn(s)?i.call(t,e,Wn(s,i)):i.call(t,e,s)}function Wn(t,e){for(const s of Object.keys(t)){const i=tt(t,s,t[s],e);i!==void 0?t[s]=i:delete t[s]}return t}function Kn(t,e){for(let s=0;s<t.length;s++)t[s]=tt(t,String(s),t[s],e);return t}function Zn(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zn,i=0;const n=a();return w(n),E(),e?Jn(n,e):n;function r(){if(t.charCodeAt(i)===tr){i++,l();const S={};let N=!0;for(;i<t.length&&t.charCodeAt(i)!==ps;){N?N=!1:(b(),l());const ee=i,me=d();if(me===void 0){O();return}l(),h();const ot=a();if(ot===void 0){$();return}Object.prototype.hasOwnProperty.call(S,me)&&!st(ot,S[me])&&j(me,ee+1),S[me]=ot}return t.charCodeAt(i)!==ps&&_(),i++,S}}function o(){if(t.charCodeAt(i)===sr){i++,l();const S=[];let N=!0;for(;i<t.length&&t.charCodeAt(i)!==ms;){N?N=!1:b();const ee=a();p(ee),S.push(ee)}return t.charCodeAt(i)!==ms&&k(),i++,S}}function a(){l();const S=d()??g()??r()??o()??c("true",!0)??c("false",!1)??c("null",null);return l(),S}function c(S,N){if(t.slice(i,i+S.length)===S)return i+=S.length,N}function l(){for(;Gn(t.charCodeAt(i));)i++}function d(){if(t.charCodeAt(i)===it){i++;let S="";for(;i<t.length&&t.charCodeAt(i)!==it;){if(t.charCodeAt(i)===er){const N=t[i+1],ee=Yn[N];ee!==void 0?(S+=ee,i++):N==="u"?Pe(t.charCodeAt(i+2))&&Pe(t.charCodeAt(i+3))&&Pe(t.charCodeAt(i+4))&&Pe(t.charCodeAt(i+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):pe(i):q(i)}else Qn(t.charCodeAt(i))?S+=t[i]:D(t[i]);i++}return x(),i++,S}}function g(){const S=i;if(t.charCodeAt(i)===gs&&(i++,T(S)),t.charCodeAt(i)===nt)i++;else if(Xn(t.charCodeAt(i)))for(i++;Ne(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===ur)for(i++,T(S);Ne(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===mr||t.charCodeAt(i)===pr)for(i++,(t.charCodeAt(i)===gs||t.charCodeAt(i)===ar)&&i++,T(S);Ne(t.charCodeAt(i));)i++;if(i>S)return s(t.slice(S,i))}function b(){if(t.charCodeAt(i)!==lr)throw new SyntaxError(`Comma ',' expected after value ${B()}`);i++}function h(){if(t.charCodeAt(i)!==dr)throw new SyntaxError(`Colon ':' expected after property name ${B()}`);i++}function w(S){if(S===void 0)throw new SyntaxError(`JSON value expected ${B()}`)}function p(S){if(S===void 0)throw new SyntaxError(`Array item expected ${B()}`)}function E(){if(i<t.length)throw new SyntaxError(`Expected end of input ${B()}`)}function T(S){if(!Ne(t.charCodeAt(i))){const N=t.slice(S,i);throw new SyntaxError(`Invalid number '${N}', expecting a digit ${B()}`)}}function x(){if(t.charCodeAt(i)!==it)throw new SyntaxError(`End of string '"' expected ${B()}`)}function O(){throw new SyntaxError(`Quoted object key expected ${B()}`)}function j(S,N){throw new SyntaxError(`Duplicate key '${S}' encountered at position ${N}`)}function _(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${B()}`)}function k(){throw new SyntaxError(`Array item or end of array ']' expected ${B()}`)}function D(S){throw new SyntaxError(`Invalid character '${S}' ${y()}`)}function q(S){const N=t.slice(S,S+2);throw new SyntaxError(`Invalid escape character '${N}' ${y()}`)}function $(){throw new SyntaxError(`Object value expected after ':' ${y()}`)}function pe(S){const N=t.slice(S,S+6);throw new SyntaxError(`Invalid unicode character '${N}' ${y()}`)}function y(){return`at position ${i}`}function P(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function B(){return`${P()} ${y()}`}}function Gn(t){return t===ir||t===nr||t===rr||t===or}function Pe(t){return t>=nt&&t<=rt||t>=hr&&t<=gr||t>=fr&&t<=br}function Ne(t){return t>=nt&&t<=rt}function Xn(t){return t>=cr&&t<=rt}function Qn(t){return t>=32&&t<=1114111}function st(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,i)=>st(s,e[i])):fs(t)&&fs(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>st(t[s],e[s])):!1}function fs(t){return typeof t=="object"&&t!==null}const Yn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
8
+ `,r:"\r",t:" "},er=92,tr=123,ps=125,sr=91,ms=93,ir=32,nr=10,rr=9,or=13,it=34,ar=43,gs=45,nt=48,cr=49,rt=57,lr=44,ur=46,dr=58,hr=65,fr=97,pr=69,mr=101,gr=70,br=102;function bs(t,e,s,i){return n(t);function n(c,l){if(Array.isArray(i)){const d=i.find(g=>g.test(c));if(d){const g=d.stringify(c);if(typeof g!="string"||!us(g))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${g})`);return g}}if(typeof c=="boolean"||typeof c=="number"||typeof c=="string"||c===null||c instanceof Date||c instanceof Boolean||c instanceof Number||c instanceof String)return JSON.stringify(c);if(c!=null&&c.isLosslessNumber||typeof c=="bigint")return c.toString();if(Array.isArray(c))return r(c);if(c&&typeof c=="object")return o(c)}function r(c,l){if(c.length===0)return"[]";let d="[";for(let g=0;g<c.length;g++){const b=c[g];typeof b<"u"&&typeof b!="function"?d+=n(b):d+="null",g<c.length-1&&(d+=",")}return d+="]",d}function o(c,l){if(typeof c.toJSON=="function")return bs(c.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(c);if(d.length===0)return"{}";let g=!0,b="{";for(const h of d){const w=c[h];if(a(h,w)){g?g=!1:b+=",";const p=JSON.stringify(h);b+=`${p}:`,b+=n(w)}}return b+="}",b}function a(c,l){return typeof l<"u"&&typeof l!="function"&&typeof l!="symbol"}}function yr(t){return Ie(t)&&!ds(t)?BigInt(t):parseFloat(t)}class _r{constructor(){be(this,"id",1)}async exec(e,s,i={},n={},r=6e4){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch{OpenC3Auth.login()}this.id=this.id+1;try{return i.scope=window.openc3Scope,n.manual=!0,(await Yt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:s,id:this.id,keyword_params:i},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...n},timeout:r,transformRequest:[(o,a)=>bs(o)],transformResponse:[o=>Zn(o,void 0,yr)]})).data.result}catch(o){let a=new Error;throw o.response?(a.name=o.response.data.error.data.class,a.message=o.response.data.error.data.message,a.object=o.response.data.error):o.request?(a.name="Request error",a.message="Request error, no response received"):a=o,a}}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,s){return this.exec("map_target_to_interface",[e,s])}connect_interface(e,...s){return s.length>0?this.exec("connect_interface",[e,...s]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,s,...i){return this.exec("interface_cmd",[e,s,...i])}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,s,i){return this.exec("get_item",[e,s,i])}get_param(e,s,i){return this.exec("get_param",[e,s,i])}get_parameter(e,s,i){return this.exec("get_param",[e,s,i])}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,s){return this.exec("get_tlm",[e,s])}get_telemetry(e,s){return this.exec("get_tlm",[e,s])}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,s=!1){return this.exec("get_all_tlm_names",[e],{hidden:s})}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,s,i,n=30){const r=await this.exec("get_tlm_packet",[e,s],{type:i,stale_time:n});if(r!=null){let o=r.length,a=null;for(let c=0;c<o;c++)a=this.decode_openc3_type(r[c][1]),a!==null&&(r[c][1]=a)}return r}get_packet_derived_items(e,s){return this.exec("get_packet_derived_items",[e,s])}get_tlm_buffer(e,s){return this.exec("get_tlm_buffer",[e,s])}async get_tlm_values(e,s=30,i=null){let n={stale_time:s};i!==null&&(n.cache_timeout=i);const r=await this.exec("get_tlm_values",[e],n,{},1e4);let o=r[0].length,a=null;for(let c=0;c<o;c++)a=this.decode_openc3_type(r[0][c]),a!==null&&(r[0][c]=a);return r}get_limits(e,s,i){return this.exec("get_limits",[e,s,i])}async tlm(e,s,i,n="CONVERTED"){let r=null;if(s===void 0)r=await this.exec("tlm",[e]);else if(i===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))r=await this.exec("tlm",[e],{type:s});else{let a=new Error;throw a.name="TypeError",a.message=`Invalid data type ${s}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`,a}else r=await this.exec("tlm",[e,s,i],{type:n});let o=this.decode_openc3_type(r);return o!==null&&(r=o),r}async inject_tlm(e,s,i=null,n="CONVERTED"){await this.exec("inject_tlm",[e,s,i],{type:n})}set_tlm(e,s,i,n){return this.exec("set_tlm",[e,s,i],{type:n})}override_tlm(e,s,i,n){return this.exec("override_tlm",[e,s,i],{type:n})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,s,i,n){return this.exec("normalize_tlm",[e,s,i],{type:n})}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,s=!1){return this.exec("get_all_cmd_names",[e],{hidden:s})}get_all_command_names(e){return this.exec("get_all_cmd_names",[e])}get_cmd(e,s){return this.exec("get_cmd",[e,s])}get_command(e,s){return this.exec("get_cmd",[e,s])}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,s,i,n="CONVERTED"){return this.exec("get_cmd_value",[e,s,i,n])}get_cmd_buffer(e,s){return this.exec("get_cmd_buffer",[e,s])}_cmd(e,s,i,n,r){let o=null;for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o=this.encode_openc3_type(n[a]),o!==null&&(n[a]=o));return this.exec(e,[s,i,n],{},r)}get_cmd_hazardous(e,s,i,n={}){return s===void 0?this.exec("get_cmd_hazardous",e,{},n):this._cmd("get_cmd_hazardous",e,s,i,n)}cmd(e,s,i,n={}){return s===void 0?this.exec("cmd",e,{},n):this._cmd("cmd",e,s,i,n)}cmd_no_range_check(e,s,i,n={}){return s===void 0?this.exec("cmd_no_range_check",e,{},n):this._cmd("cmd_no_range_check",e,s,i,n)}cmd_raw(e,s,i,n={}){return s===void 0?this.exec("cmd_raw",e,{},n):this._cmd("cmd_raw",e,s,i,n)}cmd_raw_no_range_check(e,s,i,n={}){return s===void 0?this.exec("cmd_raw_no_range_check",e,{},n):this._cmd("cmd_raw_no_range_check",e,s,i,n)}cmd_no_hazardous_check(e,s,i,n={}){return s===void 0?this.exec("cmd_no_hazardous_check",e,{},n):this._cmd("cmd_no_hazardous_check",e,s,i,n)}cmd_no_checks(e,s,i,n={}){return s===void 0?this.exec("cmd_no_checks",e,{},n):this._cmd("cmd_no_checks",e,s,i,n)}cmd_raw_no_hazardous_check(e,s,i,n={}){return s===void 0?this.exec("cmd_raw_no_hazardous_check",e,{},n):this._cmd("cmd_raw_no_hazardous_check",e,s,i,n)}cmd_raw_no_checks(e,s,i,n={}){return s===void 0?this.exec("cmd_raw_no_checks",e,{},n):this._cmd("cmd_raw_no_checks",e,s,i,n)}build_cmd(e,s,i){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,i)}build_command(e,s,i){return s===void 0?this.exec("build_cmd",e):this._cmd("build_cmd",e,s,i)}get_interface_names(){return this.exec("get_interface_names",[])}send_raw(e,s){return this.exec("send_raw",[e,s])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,s){return this.exec("load_config",[e,s])}save_config(e,s,i){return this.exec("save_config",[e,s,i])}delete_config(e,s){return this.exec("delete_config",[e,s])}enable_limits(e,s,i){return this.exec("enable_limits",[e,s,i])}disable_limits(e,s,i){return this.exec("disable_limits",[e,s,i])}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,s){return this.exec("set_setting",[e,s])}update_news(){return this.exec("update_news",[])}save_setting(e,s){return this.exec("set_setting",[e,s])}get_metrics(){return this.exec("get_metrics",[])}async hashString(e){if(window.isSecureContext){const s=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",s),n=new Uint8Array(i);return Array.from(n).map(r=>r.toString(16).padStart(2,"0")).join("")}}}let je=[];const wr={components:{OpenConfigDialog:ft,SaveConfigDialog:ht,TargetPacketItemChooser:dt,TopBar:Ts},mixins:[lt,ut],data(){return{title:"Data Extractor",configKey:"data_extractor",openConfig:!1,saveConfig:!1,api:null,timeZone:"local",progress:0,packetsReceived:0,totalPacketsReceived:0,itemsReceived:0,totalItemsReceived:0,processButtonText:"Process",todaysDate:null,startDate:null,startTime:null,endTime:null,endDate:null,startDateTime:null,endDateTime:null,startDateTimeFilename:"",rules:{required:t=>!!t||"Required"},cmdOrTlm:"tlm",items:[],search:"",headers:[{title:"Target",value:"targetName"},{title:"Packet",value:"packetName"},{title:"Item",value:"itemName"},{title:"Mode",value:"mode"},{title:"ValueType",value:"valueType"},{title:"ReducedType",value:"reducedType"},{title:"Edit",value:"edit"},{title:"Delete",value:"delete"}],itemsPerPage:20,columnMap:{},delimiter:",",columnMode:"normal",fileCount:0,skipIgnored:!0,fillDown:!1,matlabHeader:!1,uniqueOnly:!1,keyMap:{},modes:["DECOM","REDUCED_MINUTE","REDUCED_HOUR","REDUCED_DAY"],valueTypes:["CONVERTED","RAW","FORMATTED","WITH_UNITS"],reducedTypes:["SAMPLE","MIN","MAX","AVG","STDDEV"],editAll:!1,allItemMode:"DECOM",allItemValueType:"CONVERTED",allItemReducedType:"SAMPLE",cable:new jn,subscription:null}},computed:{menus:function(){return[{label:"File",items:[{label:"Open Configuration",icon:"mdi-folder-open",command:()=>{this.openConfig=!0}},{label:"Save Configuration",icon:"mdi-content-save",command:()=>{this.saveConfig=!0}},{label:"Reset Configuration",icon:"mdi-monitor-shimmer",command:()=>{this.resetConfig(),this.resetConfigBase()}},{divider:!0},{radioGroup:!0,value:this.delimiter,command:t=>{this.delimiter=t},choices:[{label:"Comma Delimited",value:","},{label:"Tab Delimited",value:" "}]}]},{label:"Mode",items:[{label:"Fill Down",checkbox:!0,checked:this.fillDown,command:()=>{this.fillDown=!this.fillDown}},{label:"Matlab Header",checkbox:!0,checked:this.matlabHeader,command:t=>{this.matlabHeader=!this.matlabHeader}},{label:"Unique Only",checkbox:!0,checked:this.uniqueOnly,command:t=>{this.uniqueOnly=!this.uniqueOnly}},{divider:!0},{radioGroup:!0,value:this.columnMode,command:t=>{this.columnMode=t},choices:[{label:"Normal Columns",value:"normal"},{label:"Full Column Names",value:"full"}]}]}]},currentConfig:function(){return{delimiter:this.delimiter,fillDown:this.fillDown,matlabHeader:this.matlabHeader,uniqueOnly:this.uniqueOnly,columnMode:this.columnMode,cmdOrTlm:this.cmdOrTlm,items:this.items,itemsPerPage:this.itemsPerPage}}},watch:{delimiter:function(){this.saveDefaultConfig(this.currentConfig)},fillDown:function(){this.saveDefaultConfig(this.currentConfig)},matlabHeader:function(){this.saveDefaultConfig(this.currentConfig)},uniqueOnly:function(){this.saveDefaultConfig(this.currentConfig)},columnNode:function(){this.saveDefaultConfig(this.currentConfig)},cmdOrTlm:function(){this.items.length===0?this.saveDefaultConfig(this.currentConfig):this.items=[]},items:{handler:function(){this.saveDefaultConfig(this.currentConfig)},deep:!0},itemsPerPage:function(){this.saveDefaultConfig(this.currentConfig)}},async created(){this.api=new _r,await this.api.get_setting("time_zone").then(e=>{e&&(this.timeZone=e)}).catch(e=>{});let t=new Date;this.todaysDate=this.formatDate(t,this.timeZone),this.startDate=this.formatDate(t-36e5,this.timeZone),this.startTime=this.formatTimeHMS(t-36e5,this.timeZone),this.endTime=this.formatTimeHMS(t,this.timeZone),this.endDate=this.formatDate(t,this.timeZone)},mounted:function(){if(this.$route.query&&this.$route.query.config)this.openConfiguration(this.$route.query.config,!0);else{let t=this.loadDefaultConfig();JSON.stringify(t)!=="{}"&&this.applyConfig(t)}},unmounted:function(){this.subscription&&this.subscription.unsubscribe(),this.cable.disconnect()},methods:{resetConfig:function(){this.delimiter=",",this.fillDown=!1,this.matlabHeader=!1,this.uniqueOnly=!1,this.columnMode="normal";let t=new Date;this.startDate=this.formatDate(t-36e5,this.timeZone),this.startTime=this.formatTimeHMS(t-36e5,this.timeZone),this.endTime=this.formatTimeHMS(t,this.timeZone),this.endDate=this.formatDate(t,this.timeZone),this.cmdOrTlm="tlm",this.items=[],this.itemsPerPage=20,this.applyConfig(this.currentConfig)},applyConfig:function(t){this.delimiter=t.delimiter||",",this.menus[0].radioGroup=this.delimiter===","?"Comma Delimited":"Tab Delimited",this.fillDown=t.fillDown,this.menus[1].items[0].checked=this.fillDown||!1,this.matlabHeader=t.matlabHeader,this.menus[1].items[1].checked=this.matlabHeader||!1,this.uniqueOnly=t.uniqueOnly,this.menus[1].items[2].checked=this.uniqueOnly||!1,this.columnMode=t.columnMode,this.menus[1].radioGroup=this.columnMode==="normal"?"Normal Columns":"Full Column Names",this.cmdOrTlm=t.cmdOrTlm,this.items=t.items,this.itemsPerPage=t.itemsPerPage},openConfiguration:function(t,e=!1){this.openConfigBase(t,e,s=>{this.applyConfig(s),this.startDate=s.startDate,this.startTime=s.startTime,this.endTime=s.endTime,this.endDate=s.endDate,this.saveDefaultConfig(this.currentConfig)})},saveConfiguration:function(t){let e=this.currentConfig;e.startDate=this.startDate,e.startTime=this.startTime,e.endTime=this.endTime,e.endDate=this.endDate,this.saveConfigBase(t,e)},addItem:function(t){for(const e of this.items)if(e.itemName===t.itemName&&e.packetName===t.packetName&&e.targetName===t.targetName&&e.valueType==="CONVERTED"&&e.reducedType==="SAMPLE"&&e.mode==="DECOM"){this.$notify.caution({body:"This item has already been added!"});return}t.cmdOrTlm=this.cmdOrTlm.toUpperCase(),t.edit=!1,t.valueType="CONVERTED",t.reducedType="SAMPLE",t.mode="DECOM",this.items.push(t)},deleteItem:function(t){let e=this.items.indexOf(t);this.items.splice(e,1)},deleteAll:function(){this.items=[]},editAllItems:function(){this.editAll=!1;for(let t of this.items)t.mode=this.allItemMode,t.valueType=this.allItemValueType,t.reducedType=this.allItemReducedType},getItemLabel:function(t){let e=[`${t.targetName} - ${t.packetName} - ${t.itemName}`];return t.mode!=="DECOM"&&e.push(`{ ${t.mode} }`),t.valueType!=="CONVERTED"&&e.push(`( ${t.valueType} )`),t.reducedType!=="SAMPLE"&&e.push(`[ ${t.reducedType} ]`),e.join(" ")},setTimestamps:function(){this.startDateTimeFilename=this.startDate+"_"+this.startTime,this.startDateTimeFilename=this.startDateTimeFilename.replace(/(:|-|\.)\s*/g,"_");let t,e;try{this.timeZone==="local"?(t=new Date(this.startDate+" "+this.startTime),e=new Date(this.endDate+" "+this.endTime)):(t=new Date(this.startDate+" "+this.startTime+"Z"),e=new Date(this.endDate+" "+this.endTime+"Z"),this.startDateTimeFilename+="_UTC")}catch{return}this.startDateTime=t.getTime()*1e6,this.endDateTime=e.getTime()*1e6},processItems:function(){if(this.processButtonText==="Cancel"){this.finished();return}if(this.setTimestamps(),!this.startDateTime||!this.endDateTime){this.$notify.caution({body:"Invalid date/time selected!"});return}if(this.startDateTime===this.endDateTime){this.$notify.caution({body:"Start date/time is equal to end date/time!"});return}if(this.endDateTime-this.startDateTime<0){this.$notify.caution({body:"Start date/time is greater then end date/time!"});return}new Date(this.endDateTime/1e6)>Date.now()&&this.$notify.caution({title:"Note",body:`End date/time is greater than current date/time. Data will
9
9
  continue to stream in real-time until
10
- ${new Date(this.endDateTime/1e6).toISOString()} is reached.`}),this.progress=0,this.processButtonText="Cancel",this.cable.createSubscription("StreamingChannel",window.openc3Scope,{received:t=>this.received(t),connected:()=>this.onConnected(),disconnected:t=>{t.allowReconnect&&this.$notify.caution({body:"OpenC3 backend connection disconnected."})},rejected:()=>{this.$notify.caution({body:"OpenC3 backend connection rejected."})}}).then(t=>{this.subscription=t})},resetAllVars:function(){this.fileCount=0,this.totalPacketsReceived=0,this.totalItemsReceived=0,this.columnHeaders=[],this.columnMap={},this.keyMap={},this.resetPerFileVars()},resetPerFileVars:function(){Ne=[],this.packetsReceived=0,this.itemsReceived=0},onConnected:function(){this.resetAllVars();let t=[];this.items.forEach((e,s)=>{let i=`${e.mode}__${e.cmdOrTlm}__${e.targetName}__${e.packetName}__${e.itemName}__${e.valueType}`;e.reducedType!=="SAMPLE"&&(i=i+"__"+e.reducedType);let n=String(s);this.keyMap[n]=i,t.push([i,n])}),OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(e=>{e&&OpenC3Auth.setTokens(),this.subscription.perform("add",{scope:window.openc3Scope,token:localStorage.openc3Token,items:t,start_time:this.startDateTime,end_time:this.endDateTime})})},received:function(t){if(this.cable.recordPing(),t.error){this.$notify.serious({body:t.error});return}if(this.packetsReceived+=t.length,this.totalPacketsReceived+=t.length,t.length>0){let e=new Set;for(let n of t){let r=Object.keys(n);r.forEach(e.add,e),this.itemsReceived+=r.length-2,this.totalItemsReceived+=r.length-2}e.delete("__type"),e.delete("__time"),this.buildHeaders([...e]),Ne.push(t),this.progress=Math.ceil(100*(t[0].__time-this.startDateTime)/(this.endDateTime-this.startDateTime)),this.columnHeaders.length*this.packetsReceived+this.itemsReceived*8>1e8&&this.createFile()}else this.finished();t=null},buildHeaders:function(t){this.columnHeaders.length===0&&this.columnMode==="normal"&&(this.columnHeaders.push("TIME"),this.columnHeaders.push("TARGET"),this.columnHeaders.push("PACKET")),t.forEach(e=>{if(e.slice(0,2)==="__"||this.columnMap[e])return;this.columnMap[e]=this.columnHeaders.length,e=this.keyMap[e];const[s,i,n,r,o,a,c]=e.split("__");let l=o;this.columnMode==="full"&&(l=n+" "+r+" "+o),s&&s!=="DECOM"&&(l=l+" {"+s+"}"),a&&a!=="CONVERTED"&&(l=l+" ("+a+")"),c&&(l=l+" ["+c+"]"),this.columnHeaders.push(l)})},createFile:async function(){let t=Ne.flat(),e=this.columnHeaders,s=this.columnMap,i=[];this.resetPerFileVars();let n="";this.matlabHeader&&(n+="% "),n+=e.join(this.delimiter),i.push(n),await this.yieldToMain(),t.sort((h,w)=>h.__time-w.__time),await this.yieldToMain();let r=[],o=[],a=null,c=0;for(let h of t){let w=!1;this.fillDown&&a?o=[...a]:o=[];let p="";if(Object.keys(h).forEach(E=>{if(E.slice(0,2)==="__")return;p=E;let T=s[E];if(typeof h[E]=="object")if(h[E]===null)o[T]="";else if(Array.isArray(h[E]))o[T]='"['+h[E]+']"';else{let x=h[E].raw;if(Array.isArray(x)){let O="";x.forEach(j=>{O+=j.toString(16)}),o[T]=O}else o[T]="'"+x+"'"}else o[T]=h[E];this.uniqueOnly&&r[T]!==o[T]&&(w=!0),r[T]=o[T]}),this.fillDown&&(a=[...o]),!this.uniqueOnly||w){if(this.columnMode==="normal"){p=this.keyMap[p];const[E,T,x,O,j,_,k]=p.split("__");o[0]=new Date(h.__time/1e6).toISOString(),o[1]=x,o[2]=O}i.push(o.join(this.delimiter))}c+=1,c%1e3==0&&await this.yieldToMain()}let l=".csv",d="text/csv";this.delimiter===" "&&(l=".txt",d="text/tab-separated-values"),await this.yieldToMain();const g=new Blob([i.join(`
11
- `)],{type:d});await this.yieldToMain();const b=document.createElement("a");b.href=URL.createObjectURL(g),b.setAttribute("download",this.startDateTimeFilename+"_"+this.fileCount+l),b.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),Ne.length!==0)await this.createFile();else if(this.fileCount===0){let t=new Date(this.startDateTime/1e6).toISOString(),e=new Date(this.endDateTime/1e6).toISOString();this.$notify.caution({body:`No data found for the items in the requested time range of ${t} to ${e}`})}this.progress=100,this.processButtonText="Process"}}};function vr(t,e,s,i,n,r){const o=C("top-bar"),a=C("v-text-field"),c=C("v-col"),l=C("v-row"),d=C("v-radio"),g=C("v-radio-group"),b=C("target-packet-item-chooser"),h=C("v-container"),w=C("v-progress-circular"),p=C("v-spacer"),E=C("v-btn"),T=C("v-toolbar"),x=C("v-card-title"),O=C("v-select"),j=C("v-card-text"),_=C("v-card-actions"),k=C("v-card"),D=C("v-dialog"),q=C("v-data-table"),$=C("open-config-dialog"),pe=C("save-config-dialog");return A(),K("div",null,[f(o,{menus:r.menus,title:n.title},null,8,["menus","title"]),f(k,null,{default:m(()=>[f(h,null,{default:m(()=>[f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(a,{modelValue:n.startDate,"onUpdate:modelValue":e[0]||(e[0]=y=>n.startDate=y),label:"Start Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"start-date"},null,8,["modelValue","max","rules"])]),_:1}),f(c,null,{default:m(()=>[f(a,{modelValue:n.startTime,"onUpdate:modelValue":e[1]||(e[1]=y=>n.startTime=y),label:"Start Time",type:"time",step:"1",rules:[n.rules.required],"data-test":"start-time"},null,8,["modelValue","rules"])]),_:1}),f(c,null,{default:m(()=>[f(a,{modelValue:n.endDate,"onUpdate:modelValue":e[2]||(e[2]=y=>n.endDate=y),label:"End Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"end-date"},null,8,["modelValue","max","rules"])]),_:1}),f(c,null,{default:m(()=>[f(a,{modelValue:n.endTime,"onUpdate:modelValue":e[3]||(e[3]=y=>n.endTime=y),label:"End Time",type:"time",step:"1",rules:[n.rules.required],"data-test":"end-time"},null,8,["modelValue","rules"])]),_:1})]),_:1}),f(l,{"no-gutters":""},{default:m(()=>[f(c,null,{default:m(()=>[f(g,{modelValue:n.cmdOrTlm,"onUpdate:modelValue":e[4]||(e[4]=y=>n.cmdOrTlm=y),inline:"","hide-details":"",class:"mt-0"},{default:m(()=>[f(d,{label:"Command",value:"cmd","data-test":"cmd-radio"}),f(d,{label:"Telemetry",value:"tlm","data-test":"tlm-radio"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(b,{"button-text":"Add Item",mode:n.cmdOrTlm,hidden:!0,"choose-item":"","allow-all":"",onAddItem:e[5]||(e[5]=y=>r.addItem(y))},null,8,["mode"])]),_:1})]),_:1})]),_:1}),f(T,{class:"pl-3"},{default:m(()=>[f(w,{"model-value":n.progress},null,8,["model-value"]),F("   Processed: "+J(n.totalPacketsReceived)+" packets, "+J(n.totalItemsReceived)+" items ",1),f(p),f(E,{class:"bg-primary",disabled:n.items.length<1,onClick:r.processItems},{default:m(()=>[F(J(n.processButtonText),1)]),_:1},8,["disabled","onClick"]),f(p),f(E,{icon:"mdi-pencil-box-multiple",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"editAll","aria-label":"Edit All Items",onClick:e[6]||(e[6]=y=>n.editAll=!0)},null,8,["disabled"]),f(E,{icon:"mdi-delete-sweep",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"delete-all","aria-label":"Delete All Items",onClick:r.deleteAll},null,8,["disabled","onClick"])]),_:1}),f(k,{width:"100%"},{default:m(()=>[f(x,null,{default:m(()=>[e[18]||(e[18]=F(" Items ")),f(p),f(a,{modelValue:n.search,"onUpdate:modelValue":e[7]||(e[7]=y=>n.search=y),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),f(q,{"items-per-page":n.itemsPerPage,"onUpdate:itemsPerPage":e[8]||(e[8]=y=>n.itemsPerPage=y),headers:n.headers,items:n.items,search:n.search,"items-per-page-options":[10,20,50,100,-1],"multi-sort":"",density:"compact"},{"item.edit":m(({item:y})=>[f(E,{icon:"mdi-pencil",variant:"text","data-test":"edit-row","aria-label":"Edit Item",onClick:mt(P=>y.edit=!0,["stop"])},null,8,["onClick"]),f(D,{modelValue:y.edit,"onUpdate:modelValue":P=>y.edit=P,"max-width":"600",onKeydown:Fe(P=>y.edit=!1,["esc"])},{default:m(()=>[f(k,null,{default:m(()=>[f(T,{height:"24"},{default:m(()=>[f(p),e[19]||(e[19]=ge("span",null," DataExtractor: Edit Item Mode ",-1)),f(p)]),_:1}),f(j,null,{default:m(()=>[f(l,{class:"mt-3 title-font"},{default:m(()=>[f(c,null,{default:m(()=>[F(J(r.getItemLabel(y)),1)]),_:2},1024)]),_:2},1024),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:y.mode,"onUpdate:modelValue":P=>y.mode=P,"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:y.valueType,"onUpdate:modelValue":P=>y.valueType=P,"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:y.reducedType,"onUpdate:modelValue":P=>y.reducedType=P,"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024)]),_:2},1024),f(_,{class:"px-2"},{default:m(()=>[f(p),f(E,{variant:"flat",onClick:P=>y.edit=!1},{default:m(()=>e[20]||(e[20]=[F(" Close ")])),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","onKeydown"])]),"item.delete":m(({item:y})=>[f(E,{icon:"mdi-delete",variant:"text","data-test":"delete-row","aria-label":"Delete Item",onClick:P=>r.deleteItem(y)},null,8,["onClick"])]),_:1},8,["items-per-page","headers","items","search"])]),_:1})]),_:1}),f(D,{modelValue:n.editAll,"onUpdate:modelValue":e[14]||(e[14]=y=>n.editAll=y),"max-width":"600",onKeydown:e[15]||(e[15]=Fe(y=>n.editAll=!n.editAll,["esc"]))},{default:m(()=>[f(k,null,{default:m(()=>[f(T,{height:"24"},{default:m(()=>[f(p),e[21]||(e[21]=ge("span",null," DataExtractor: Edit All Items",-1)),f(p)]),_:1}),f(j,null,{default:m(()=>[f(l,{class:"mt-3"},{default:m(()=>[f(c,null,{default:m(()=>e[22]||(e[22]=[F(" This will change all items to the following data type! ")])),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:n.allItemMode,"onUpdate:modelValue":e[9]||(e[9]=y=>n.allItemMode=y),"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:n.allItemValueType,"onUpdate:modelValue":e[10]||(e[10]=y=>n.allItemValueType=y),"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:n.allItemReducedType,"onUpdate:modelValue":e[11]||(e[11]=y=>n.allItemReducedType=y),"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1})]),_:1}),f(_,{class:"px-2"},{default:m(()=>[f(p),f(E,{variant:"outlined",onClick:e[12]||(e[12]=y=>n.editAll=!n.editAll)},{default:m(()=>e[23]||(e[23]=[F(" Cancel ")])),_:1}),f(E,{variant:"flat",disabled:!n.allItemValueType,onClick:e[13]||(e[13]=y=>r.editAllItems())},{default:m(()=>e[24]||(e[24]=[F(" Ok ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),n.openConfig?(A(),L($,{key:0,modelValue:n.openConfig,"onUpdate:modelValue":e[16]||(e[16]=y=>n.openConfig=y),"config-key":n.configKey,onSuccess:r.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):se("",!0),n.saveConfig?(A(),L(pe,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[17]||(e[17]=y=>n.saveConfig=y),"config-key":n.configKey,onSuccess:r.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):se("",!0)])}const Mr=_s("default",ct(wr,[["render",vr],["__scopeId","data-v-f98b189b"]]))}}});
10
+ ${new Date(this.endDateTime/1e6).toISOString()} is reached.`}),this.progress=0,this.processButtonText="Cancel",this.cable.createSubscription("StreamingChannel",window.openc3Scope,{received:t=>this.received(t),connected:()=>this.onConnected(),disconnected:t=>{t.allowReconnect&&this.$notify.caution({body:"OpenC3 backend connection disconnected."})},rejected:()=>{this.$notify.caution({body:"OpenC3 backend connection rejected."})}}).then(t=>{this.subscription=t})},resetAllVars:function(){this.fileCount=0,this.totalPacketsReceived=0,this.totalItemsReceived=0,this.columnHeaders=[],this.columnMap={},this.keyMap={},this.resetPerFileVars()},resetPerFileVars:function(){je=[],this.packetsReceived=0,this.itemsReceived=0},onConnected:function(){this.resetAllVars();let t=[];this.items.forEach((e,s)=>{let i=`${e.mode}__${e.cmdOrTlm}__${e.targetName}__${e.packetName}__${e.itemName}__${e.valueType}`;e.reducedType!=="SAMPLE"&&(i=i+"__"+e.reducedType);let n=String(s);this.keyMap[n]=i,t.push([i,n])}),OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(e=>{e&&OpenC3Auth.setTokens(),this.subscription.perform("add",{scope:window.openc3Scope,token:localStorage.openc3Token,items:t,start_time:this.startDateTime,end_time:this.endDateTime})})},received:function(t){if(this.cable.recordPing(),t.error){this.$notify.serious({body:t.error});return}if(this.packetsReceived+=t.length,this.totalPacketsReceived+=t.length,t.length>0){let e=new Set;for(let n of t){let r=Object.keys(n);r.forEach(e.add,e),this.itemsReceived+=r.length-2,this.totalItemsReceived+=r.length-2}e.delete("__type"),e.delete("__time"),this.buildHeaders([...e]),je.push(t),this.progress=Math.ceil(100*(t[0].__time-this.startDateTime)/(this.endDateTime-this.startDateTime)),this.columnHeaders.length*this.packetsReceived+this.itemsReceived*8>1e8&&this.createFile()}else this.finished();t=null},buildHeaders:function(t){this.columnHeaders.length===0&&this.columnMode==="normal"&&(this.columnHeaders.push("TIME"),this.columnHeaders.push("TARGET"),this.columnHeaders.push("PACKET")),t.forEach(e=>{if(e.slice(0,2)==="__"||this.columnMap[e])return;this.columnMap[e]=this.columnHeaders.length,e=this.keyMap[e];const[s,i,n,r,o,a,c]=e.split("__");let l=o;this.columnMode==="full"&&(l=n+" "+r+" "+o),s&&s!=="DECOM"&&(l=l+" {"+s+"}"),a&&a!=="CONVERTED"&&(l=l+" ("+a+")"),c&&(l=l+" ["+c+"]"),this.columnHeaders.push(l)})},createFile:async function(){let t=je.flat(),e=this.columnHeaders,s=this.columnMap,i=[];this.resetPerFileVars();let n="";this.matlabHeader&&(n+="% "),n+=e.join(this.delimiter),i.push(n),await this.yieldToMain(),t.sort((h,w)=>h.__time-w.__time),await this.yieldToMain();let r=[],o=[],a=null,c=0;for(let h of t){let w=!1;this.fillDown&&a?o=[...a]:o=[];let p="";if(Object.keys(h).forEach(E=>{if(E.slice(0,2)==="__")return;p=E;let T=s[E];if(typeof h[E]=="object")if(h[E]===null)o[T]="";else if(Array.isArray(h[E]))o[T]='"['+h[E]+']"';else{let x=h[E].raw;if(Array.isArray(x)){let O="";x.forEach(j=>{O+=j.toString(16)}),o[T]=O}else o[T]="'"+x+"'"}else o[T]=h[E];this.uniqueOnly&&r[T]!==o[T]&&(w=!0),r[T]=o[T]}),this.fillDown&&(a=[...o]),!this.uniqueOnly||w){if(this.columnMode==="normal"){p=this.keyMap[p];const[E,T,x,O,j,_,k]=p.split("__");o[0]=new Date(h.__time/1e6).toISOString(),o[1]=x,o[2]=O}i.push(o.join(this.delimiter))}c+=1,c%1e3==0&&await this.yieldToMain()}let l=".csv",d="text/csv";this.delimiter===" "&&(l=".txt",d="text/tab-separated-values"),await this.yieldToMain();const g=new Blob([i.join(`
11
+ `)],{type:d});await this.yieldToMain();const b=document.createElement("a");b.href=URL.createObjectURL(g),b.setAttribute("download",this.startDateTimeFilename+"_"+this.fileCount+l),b.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),je.length!==0)await this.createFile();else if(this.fileCount===0){let t=new Date(this.startDateTime/1e6).toISOString(),e=new Date(this.endDateTime/1e6).toISOString();this.$notify.caution({body:`No data found for the items in the requested time range of ${t} to ${e}`})}this.progress=100,this.processButtonText="Process"}}};function vr(t,e,s,i,n,r){const o=C("top-bar"),a=C("v-text-field"),c=C("v-col"),l=C("v-row"),d=C("v-radio"),g=C("v-radio-group"),b=C("target-packet-item-chooser"),h=C("v-container"),w=C("v-progress-circular"),p=C("v-spacer"),E=C("v-btn"),T=C("v-toolbar"),x=C("v-card-title"),O=C("v-select"),j=C("v-card-text"),_=C("v-card-actions"),k=C("v-card"),D=C("v-dialog"),q=C("v-data-table"),$=C("open-config-dialog"),pe=C("save-config-dialog");return A(),K("div",null,[f(o,{menus:r.menus,title:n.title},null,8,["menus","title"]),f(k,null,{default:m(()=>[f(h,null,{default:m(()=>[f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(a,{modelValue:n.startDate,"onUpdate:modelValue":e[0]||(e[0]=y=>n.startDate=y),label:"Start Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"start-date"},null,8,["modelValue","max","rules"])]),_:1}),f(c,null,{default:m(()=>[f(a,{modelValue:n.startTime,"onUpdate:modelValue":e[1]||(e[1]=y=>n.startTime=y),label:"Start Time",type:"time",step:"1",rules:[n.rules.required],"data-test":"start-time"},null,8,["modelValue","rules"])]),_:1}),f(c,null,{default:m(()=>[f(a,{modelValue:n.endDate,"onUpdate:modelValue":e[2]||(e[2]=y=>n.endDate=y),label:"End Date",type:"date",max:n.todaysDate,rules:[n.rules.required],"data-test":"end-date"},null,8,["modelValue","max","rules"])]),_:1}),f(c,null,{default:m(()=>[f(a,{modelValue:n.endTime,"onUpdate:modelValue":e[3]||(e[3]=y=>n.endTime=y),label:"End Time",type:"time",step:"1",rules:[n.rules.required],"data-test":"end-time"},null,8,["modelValue","rules"])]),_:1})]),_:1}),f(l,{"no-gutters":""},{default:m(()=>[f(c,null,{default:m(()=>[f(g,{modelValue:n.cmdOrTlm,"onUpdate:modelValue":e[4]||(e[4]=y=>n.cmdOrTlm=y),inline:"","hide-details":"",class:"mt-0"},{default:m(()=>[f(d,{label:"Command",value:"cmd","data-test":"cmd-radio"}),f(d,{label:"Telemetry",value:"tlm","data-test":"tlm-radio"})]),_:1},8,["modelValue"])]),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(b,{"button-text":"Add Item",mode:n.cmdOrTlm,hidden:!0,"choose-item":"","allow-all":"",onAddItem:e[5]||(e[5]=y=>r.addItem(y))},null,8,["mode"])]),_:1})]),_:1})]),_:1}),f(T,{class:"pl-3"},{default:m(()=>[f(w,{"model-value":n.progress},null,8,["model-value"]),F("   Processed: "+J(n.totalPacketsReceived)+" packets, "+J(n.totalItemsReceived)+" items ",1),f(p),f(E,{class:"bg-primary",disabled:n.items.length<1,onClick:r.processItems},{default:m(()=>[F(J(n.processButtonText),1)]),_:1},8,["disabled","onClick"]),f(p),f(E,{icon:"mdi-pencil-box-multiple",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"editAll","aria-label":"Edit All Items",onClick:e[6]||(e[6]=y=>n.editAll=!0)},null,8,["disabled"]),f(E,{icon:"mdi-delete-sweep",variant:"text",density:"compact",disabled:n.items.length<1,"data-test":"delete-all","aria-label":"Delete All Items",onClick:r.deleteAll},null,8,["disabled","onClick"])]),_:1}),f(k,{width:"100%"},{default:m(()=>[f(x,null,{default:m(()=>[e[18]||(e[18]=F(" Items ")),f(p),f(a,{modelValue:n.search,"onUpdate:modelValue":e[7]||(e[7]=y=>n.search=y),label:"Search","prepend-inner-icon":"mdi-magnify",clearable:"",variant:"outlined",density:"compact","single-line":"","hide-details":"",class:"search"},null,8,["modelValue"])]),_:1}),f(q,{"items-per-page":n.itemsPerPage,"onUpdate:itemsPerPage":e[8]||(e[8]=y=>n.itemsPerPage=y),headers:n.headers,items:n.items,search:n.search,"items-per-page-options":[10,20,50,100,-1],"multi-sort":"",density:"compact"},{"item.edit":m(({item:y})=>[f(E,{icon:"mdi-pencil",variant:"text","data-test":"edit-row","aria-label":"Edit Item",onClick:mt(P=>y.edit=!0,["stop"])},null,8,["onClick"]),f(D,{modelValue:y.edit,"onUpdate:modelValue":P=>y.edit=P,"max-width":"600",onKeydown:Me(P=>y.edit=!1,["esc"])},{default:m(()=>[f(k,null,{default:m(()=>[f(T,{height:"24"},{default:m(()=>[f(p),e[19]||(e[19]=ge("span",null," DataExtractor: Edit Item Mode ",-1)),f(p)]),_:1}),f(j,null,{default:m(()=>[f(l,{class:"mt-3 title-font"},{default:m(()=>[f(c,null,{default:m(()=>[F(J(r.getItemLabel(y)),1)]),_:2},1024)]),_:2},1024),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:y.mode,"onUpdate:modelValue":P=>y.mode=P,"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:y.valueType,"onUpdate:modelValue":P=>y.valueType=P,"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:y.reducedType,"onUpdate:modelValue":P=>y.reducedType=P,"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024)]),_:2},1024)]),_:2},1024),f(_,{class:"px-2"},{default:m(()=>[f(p),f(E,{variant:"flat",onClick:P=>y.edit=!1},{default:m(()=>e[20]||(e[20]=[F(" Close ")])),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["modelValue","onUpdate:modelValue","onKeydown"])]),"item.delete":m(({item:y})=>[f(E,{icon:"mdi-delete",variant:"text","data-test":"delete-row","aria-label":"Delete Item",onClick:P=>r.deleteItem(y)},null,8,["onClick"])]),_:1},8,["items-per-page","headers","items","search"])]),_:1})]),_:1}),f(D,{modelValue:n.editAll,"onUpdate:modelValue":e[14]||(e[14]=y=>n.editAll=y),"max-width":"600",onKeydown:e[15]||(e[15]=Me(y=>n.editAll=!n.editAll,["esc"]))},{default:m(()=>[f(k,null,{default:m(()=>[f(T,{height:"24"},{default:m(()=>[f(p),e[21]||(e[21]=ge("span",null," DataExtractor: Edit All Items",-1)),f(p)]),_:1}),f(j,null,{default:m(()=>[f(l,{class:"mt-3"},{default:m(()=>[f(c,null,{default:m(()=>e[22]||(e[22]=[F(" This will change all items to the following data type! ")])),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:n.allItemMode,"onUpdate:modelValue":e[9]||(e[9]=y=>n.allItemMode=y),"hide-details":"",items:n.modes,label:"Mode",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:n.allItemValueType,"onUpdate:modelValue":e[10]||(e[10]=y=>n.allItemValueType=y),"hide-details":"",items:n.valueTypes,label:"Value Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1}),f(l,null,{default:m(()=>[f(c,null,{default:m(()=>[f(O,{modelValue:n.allItemReducedType,"onUpdate:modelValue":e[11]||(e[11]=y=>n.allItemReducedType=y),"hide-details":"",items:n.reducedTypes,label:"Reduced Type",variant:"outlined"},null,8,["modelValue","items"])]),_:1})]),_:1})]),_:1}),f(_,{class:"px-2"},{default:m(()=>[f(p),f(E,{variant:"outlined",onClick:e[12]||(e[12]=y=>n.editAll=!n.editAll)},{default:m(()=>e[23]||(e[23]=[F(" Cancel ")])),_:1}),f(E,{variant:"flat",disabled:!n.allItemValueType,onClick:e[13]||(e[13]=y=>r.editAllItems())},{default:m(()=>e[24]||(e[24]=[F(" Ok ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),n.openConfig?(A(),L($,{key:0,modelValue:n.openConfig,"onUpdate:modelValue":e[16]||(e[16]=y=>n.openConfig=y),"config-key":n.configKey,onSuccess:r.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):se("",!0),n.saveConfig?(A(),L(pe,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[17]||(e[17]=y=>n.saveConfig=y),"config-key":n.configKey,onSuccess:r.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):se("",!0)])}const Mr=_s("default",ct(wr,[["render",vr],["__scopeId","data-v-f98b189b"]]))}}});