openc3-cosmos-tool-dataextractor 6.7.0 → 6.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/tools/dataextractor/ArrayWidget-j3ncPuPx-56b701d91ed1fe2b1769.js +2 -0
  3. data/tools/dataextractor/ArrayplotWidget-DuLaiGa9-d459d698e04a45070d28.js +1 -0
  4. data/tools/dataextractor/BarColumn-BWJ0Dd4O-2125fd6b4f24c35cebd1.js +1 -0
  5. data/tools/dataextractor/BlockWidget-Bf5Dd6Cr-a43f4733fccaf6339f08.js +2 -0
  6. data/tools/dataextractor/ButtonWidget-bl_mGFYh-4433fb6d71d83a14882e.js +2 -0
  7. data/tools/dataextractor/CanvasWidget-boDemgx1-5a7a7af7492c6ef65101.js +1 -0
  8. data/tools/dataextractor/CanvasdotWidget-BZBbJcER-97a41304ababf9affb82.js +1 -0
  9. data/tools/dataextractor/CanvasimageWidget-6ywvT5jd-2354cda41e734c3ab766.js +1 -0
  10. data/tools/dataextractor/CanvasimagevalueWidget-DjWrA3gX-c54d7e717571163b148e.js +1 -0
  11. data/tools/dataextractor/CanvaslabelWidget-Bq4V2BQh-e29b3d44f730072edcf9.js +1 -0
  12. data/tools/dataextractor/CanvaslabelvalueWidget-C8oNcFLi-a64071b2536d6a17892a.js +1 -0
  13. data/tools/dataextractor/CanvaslineWidget-nvbL2GoL-f8e7eb57a8ec2274cd31.js +1 -0
  14. data/tools/dataextractor/CanvaslinevalueWidget-ZACQedKx-f05bea9d368275db5534.js +1 -0
  15. data/tools/dataextractor/CheckbuttonWidget-B82UE8AB-5f3f4ab9a5a99a6619b2.js +1 -0
  16. data/tools/dataextractor/ComboboxWidget-4OFiSkI6-2a09a7ed4f73b48b53b0.js +1 -0
  17. data/tools/dataextractor/DataExtractor-693d45ce9a72b9f26bbd.js +11 -0
  18. data/tools/dataextractor/DateWidget-BmwtdirF-52db70a13176dafbaf27.js +1 -0
  19. data/tools/dataextractor/DetailsDialog-CLKEfU0s-c4fc5796e5eb39ef7960.js +1 -0
  20. data/tools/dataextractor/DynamicWidget-CfMtj7H8-7d3fb369b554a6cac2a7.js +1 -0
  21. data/tools/dataextractor/FormatvalueWidget-C8exC3bj-c56fdb7df08aafa373a0.js +1 -0
  22. data/tools/dataextractor/Graph-CWcrowaT-3b74b8cf4d368cce8c05.js +1 -0
  23. data/tools/dataextractor/GraphWidget-CvzxZYVx-c3c75204a79de4f21d30.js +1 -0
  24. data/tools/dataextractor/HorizontalWidget-Ck151zVw-de3e0955f871c518264b.js +1 -0
  25. data/tools/dataextractor/HorizontalboxWidget-D3P-cl9V-408057ae9a6a3841b776.js +1 -0
  26. data/tools/dataextractor/HorizontallineWidget-BE1TjPU8-c362e99eb60eb47a081f.js +1 -0
  27. data/tools/dataextractor/IframeWidget-BgJCgues-629d1673d0e599d8df4f.js +1 -0
  28. data/tools/dataextractor/ImageLoader-CWn-PLOk-66ac8c898ca7bcf018dd.js +1 -0
  29. data/tools/dataextractor/ImageviewerWidget-BlhFZD2f-a782d5597ecf0b26fa79.js +1 -0
  30. data/tools/dataextractor/LabelWidget-Cwosk4x2-e24e63a7b7d86c290db4.js +1 -0
  31. data/tools/dataextractor/LabelledWidget-Dl6rAFTQ-b8a49a3f714f9eafe1eb.js +1 -0
  32. data/tools/dataextractor/LabelprogressbarWidget-MuAKesOz-b3751113d93f1d8a9266.js +1 -0
  33. data/tools/dataextractor/LabelsparklineWidget-6LA6Ox3d-91690de5b56b4119461d.js +1 -0
  34. data/tools/dataextractor/LabelvalueWidget-BxAXx-Tf-25d16fa6124893429840.js +1 -0
  35. data/tools/dataextractor/LabelvaluedescWidget-Dwwlnd1g-144a30dd3094dc9ac17b.js +1 -0
  36. data/tools/dataextractor/LabelvaluelimitsbarWidget-Dv8Qk8kK-5a4bbbf68544b1d627a2.js +1 -0
  37. data/tools/dataextractor/LabelvaluelimitscolumnWidget-D-_gl6fq-a458c49fe928e2455e05.js +1 -0
  38. data/tools/dataextractor/LabelvaluerangebarWidget-B3MKT-3Y-782bf90047d7db81696e.js +1 -0
  39. data/tools/dataextractor/Layout-Bkb6VP3e-59cc40cf8b955fec30f3.js +1 -0
  40. data/tools/dataextractor/LedWidget-DOuDD8LI-1ecfeb5ba72d5b743795.js +1 -0
  41. data/tools/dataextractor/LimitsbarWidget-D1U6SvVL-c05ac49b1943a7ab2714.js +1 -0
  42. data/tools/dataextractor/LimitscolorWidget-iSMGusqt-2330f616fc27a72a8630.js +1 -0
  43. data/tools/dataextractor/LimitscolumnWidget-DjxZTt_r-b82d0cba3e2e663e291c.js +1 -0
  44. data/tools/dataextractor/LinegraphWidget-BHKU6zlT-8bec40abb923be84efaa.js +1 -0
  45. data/tools/dataextractor/MatrixbycolumnsWidget-BKO-A2QD-6349c90852888427131d.js +1 -0
  46. data/tools/dataextractor/ProgressbarWidget-fbr2qu_N-3f3c3b9c0f43beb4cd40.js +1 -0
  47. data/tools/dataextractor/RadiobuttonWidget-DL08zcQT-77b452e9764571f31f10.js +1 -0
  48. data/tools/dataextractor/RadiogroupWidget-DW9Xpj3c-e04c3a05609ba1961d35.js +1 -0
  49. data/tools/dataextractor/RangebarWidget-o9q55kjc-35bd54a960d10a19bbe1.js +1 -0
  50. data/tools/dataextractor/RollupWidget-BHnjj-DF-1701f074a1db981937fa.js +1 -0
  51. data/tools/dataextractor/ScrollwindowWidget-D-QVwztC-1ceecbcdf24e8556835a.js +1 -0
  52. data/tools/dataextractor/SignalWidget-CsWuufdx-879a31cf775a0c6b677d.js +1 -0
  53. data/tools/dataextractor/SpacerWidget-Di9-qunj-f084e67061579b4796cd.js +1 -0
  54. data/tools/dataextractor/SparklineWidget-B6-zhdPW-cc7804496ed4a2f4e1a5.js +1 -0
  55. data/tools/dataextractor/TabbookWidget-B1E1_mzA-84aa4fa8137319215c57.js +1 -0
  56. data/tools/dataextractor/TextboxWidget-CBVEXPw_-85406ec9eb7c888420d0.js +1 -0
  57. data/tools/dataextractor/TextfieldWidget-DZMHrtQa-4bc47577f09c04daa99b.js +1 -0
  58. data/tools/dataextractor/TimeWidget-K4MNmJ7J-b860f9c3e8a973627904.js +1 -0
  59. data/tools/dataextractor/TitleWidget-8IcwweFE-901a83023c09df942adf.js +1 -0
  60. data/tools/dataextractor/VWidget-CoIgX3hM-20d548a1bf1327b379d6.js +1 -0
  61. data/tools/dataextractor/ValueWidget-BvT1ASar-7be9281d20e0973c37b4.js +1 -0
  62. data/tools/dataextractor/ValuelimitsbarWidget-C5lBnUmB-696e8ce0fb0cc7371dc2.js +1 -0
  63. data/tools/dataextractor/ValuelimitscolumnWidget-DHYI0WBL-6e8c2ef09117a09cb7e0.js +1 -0
  64. data/tools/dataextractor/ValuerangebarWidget-BSszZhlE-915a6e8f5cdc093decb5.js +1 -0
  65. data/tools/dataextractor/VerticalWidget-1GhgYrC3-988d3fefd0f7485307d0.js +1 -0
  66. data/tools/dataextractor/VerticalboxWidget-DYHJqEzd-1b76e32caaf934ad707a.js +1 -0
  67. data/tools/dataextractor/Widget-B8t93Oid-8864cb0779392be58d51.js +1 -0
  68. data/tools/dataextractor/main-cdb15e872e9fb01b1c2d.js +1502 -0
  69. data/tools/dataextractor/main.js +1 -1
  70. metadata +69 -69
  71. data/tools/dataextractor/ArrayWidget-BSG8KEtf-fc7eedbf12b6f5556a63.js +0 -2
  72. data/tools/dataextractor/ArrayplotWidget-WVu76Kqn-311276b8b816111b1c82.js +0 -1
  73. data/tools/dataextractor/BarColumn-Cflh9pUz-3e3d6b6286c147db1e32.js +0 -1
  74. data/tools/dataextractor/BlockWidget-B7ryWGCq-fa92dfb29fd54c6ed260.js +0 -2
  75. data/tools/dataextractor/ButtonWidget-BKih3ix9-507626c319f38e20260a.js +0 -2
  76. data/tools/dataextractor/CanvasWidget-DT9xMSfb-4e6487a3d3f19ac2667a.js +0 -1
  77. data/tools/dataextractor/CanvasdotWidget-7H5Hvcn--518dcba718c1ed3a14f1.js +0 -1
  78. data/tools/dataextractor/CanvasimageWidget-BbWYx6Gj-2f538ce4f386edc2049c.js +0 -1
  79. data/tools/dataextractor/CanvasimagevalueWidget-Blvoe2X4-7e0c5444516f01f2a276.js +0 -1
  80. data/tools/dataextractor/CanvaslabelWidget-BPx_Rm4o-8596a53177bef35002f9.js +0 -1
  81. data/tools/dataextractor/CanvaslabelvalueWidget-DzdWvL0W-20d45ae5a5c8cf767246.js +0 -1
  82. data/tools/dataextractor/CanvaslineWidget-CqskilGk-ea6e03714a2d60e23290.js +0 -1
  83. data/tools/dataextractor/CanvaslinevalueWidget-C0JIKdvZ-5ff9302e9ab2219de70b.js +0 -1
  84. data/tools/dataextractor/CheckbuttonWidget-C9FbJx2v-1459a7187199f158bc47.js +0 -1
  85. data/tools/dataextractor/ComboboxWidget-BbNKT0s8-f77fc5a9a9ac387ecc3e.js +0 -1
  86. data/tools/dataextractor/DataExtractor-461f278a4f3f762da55a.js +0 -11
  87. data/tools/dataextractor/DateWidget-CBMsdRUE-8be0c67529e8e7bb2930.js +0 -1
  88. data/tools/dataextractor/DetailsDialog-DRVahE5z-512cc119f31f149412d0.js +0 -1
  89. data/tools/dataextractor/DynamicWidget-CfMtj7H8-c593ea2067a083bd36fa.js +0 -1
  90. data/tools/dataextractor/FormatvalueWidget-BLWsqhIZ-285aa9bb543c28fc6530.js +0 -1
  91. data/tools/dataextractor/Graph-BiU56Qj2-1bc138c9171768ed8819.js +0 -1
  92. data/tools/dataextractor/GraphWidget-Ga0AEfrJ-a5acf8398b8ddbc49e2f.js +0 -1
  93. data/tools/dataextractor/HorizontalWidget-CsVhLwZO-1aa587e9a3a7a96a213c.js +0 -1
  94. data/tools/dataextractor/HorizontalboxWidget-xC6PADl3-f0d5efaca7841b40e6bd.js +0 -1
  95. data/tools/dataextractor/HorizontallineWidget-NZIxmRVN-a44ad040ec386e3f8f7a.js +0 -1
  96. data/tools/dataextractor/IframeWidget-BgzjSfag-cd99fb0a06e3e48afeb8.js +0 -1
  97. data/tools/dataextractor/ImageLoader-DbFVK1Ui-2c76ce2e62b7e3084266.js +0 -1
  98. data/tools/dataextractor/ImageviewerWidget-BnT5m-nw-e387618aa84e50c15d6e.js +0 -1
  99. data/tools/dataextractor/LabelWidget-DSDYmz6X-7ae3a88e8215afbdf7b3.js +0 -1
  100. data/tools/dataextractor/LabelledWidget-DMb-myxs-57355929bb55986c4168.js +0 -1
  101. data/tools/dataextractor/LabelprogressbarWidget-CkjDJBao-f89f25448a1b7f4adc3d.js +0 -1
  102. data/tools/dataextractor/LabelsparklineWidget-DBYPFz3Y-2defdcf04f659318dfff.js +0 -1
  103. data/tools/dataextractor/LabelvalueWidget-DlTkJC4i-1ef8b1d24b33f90b954a.js +0 -1
  104. data/tools/dataextractor/LabelvaluedescWidget-dRqnGZub-96ef5bb42a5744e372ef.js +0 -1
  105. data/tools/dataextractor/LabelvaluelimitsbarWidget-CS4NAPJ1-b0e3f081661c9a01964c.js +0 -1
  106. data/tools/dataextractor/LabelvaluelimitscolumnWidget-D9x4Ppv8-99696ddb6af9ef8979c4.js +0 -1
  107. data/tools/dataextractor/LabelvaluerangebarWidget-Dhyng4-n-e5417bae98ff61028900.js +0 -1
  108. data/tools/dataextractor/Layout-mWR35VAD-8e5913a3cc7af10f83ea.js +0 -1
  109. data/tools/dataextractor/LedWidget-D8cq4pUv-8402d4230fed1c0f3fc1.js +0 -1
  110. data/tools/dataextractor/LimitsbarWidget-VGJnDuVM-ba9dc95903034f97f6be.js +0 -1
  111. data/tools/dataextractor/LimitscolorWidget-CG6Pqi12-e4377b35881e3e751152.js +0 -1
  112. data/tools/dataextractor/LimitscolumnWidget-DjovQdiT-e96ea3ea889ce82bb638.js +0 -1
  113. data/tools/dataextractor/LinegraphWidget-DSWAhXgZ-99857071bc00e54b56aa.js +0 -1
  114. data/tools/dataextractor/MatrixbycolumnsWidget-C3cuhRxz-6991ab5333a020ce3532.js +0 -1
  115. data/tools/dataextractor/ProgressbarWidget-oCgAEFBO-d8a02151a3081c51dfad.js +0 -1
  116. data/tools/dataextractor/RadiobuttonWidget-D4Dak3lc-e238c26550e676552aa7.js +0 -1
  117. data/tools/dataextractor/RadiogroupWidget-Dbe9T4fp-ed44ff201c172872ef2a.js +0 -1
  118. data/tools/dataextractor/RangebarWidget-CIVrgqrW-8f2bb2562e4ecdaefdcb.js +0 -1
  119. data/tools/dataextractor/RollupWidget-CH1-XNLV-f9afac285942d30fe6ed.js +0 -1
  120. data/tools/dataextractor/ScrollwindowWidget-BwFG6Wn8-56400cee39ce40c0b037.js +0 -1
  121. data/tools/dataextractor/SignalWidget-Gz2gHrUm-ccfe982f73edab3d5c27.js +0 -1
  122. data/tools/dataextractor/SpacerWidget-Bg7VDB0k-bfceb1ca950786354660.js +0 -1
  123. data/tools/dataextractor/SparklineWidget-D_b5rfJv-3d02377626b61624da22.js +0 -1
  124. data/tools/dataextractor/TabbookWidget-C30f9B6z-3b1809cb2f2f73e198ab.js +0 -1
  125. data/tools/dataextractor/TextboxWidget-CDqxsgys-e3be392b55f45068ebdc.js +0 -1
  126. data/tools/dataextractor/TextfieldWidget-CAyjKJs6-5024e2ade3b1cf62e576.js +0 -1
  127. data/tools/dataextractor/TimeWidget-BQsP0G2X-125a034253ee9d500925.js +0 -1
  128. data/tools/dataextractor/TitleWidget-DXVba53S-fd761d97eb2ee52fed39.js +0 -1
  129. data/tools/dataextractor/VWidget-CFTCukCL-2fbce8873b42f7e67ae0.js +0 -1
  130. data/tools/dataextractor/ValueWidget-B-TWLPdM-a0619bd9fba60a01325e.js +0 -1
  131. data/tools/dataextractor/ValuelimitsbarWidget-jsDXdPdC-e6ed29b3dde852d13a14.js +0 -1
  132. data/tools/dataextractor/ValuelimitscolumnWidget-I-uwnXM2-80ef6441c08956f5b66a.js +0 -1
  133. data/tools/dataextractor/ValuerangebarWidget-OyhSTScu-e384eaa4fb7e28c6f4c7.js +0 -1
  134. data/tools/dataextractor/VerticalWidget-CkFbX1Gq-bc030fc8b3c5d7290c80.js +0 -1
  135. data/tools/dataextractor/VerticalboxWidget-FEQgPM9r-21c33668ac053139ee34.js +0 -1
  136. data/tools/dataextractor/Widget-C3-TBgP7-b333f8a0c692a7d607b1.js +0 -1
  137. data/tools/dataextractor/main-578bc0655a22d2a15a27.js +0 -1502
@@ -1,11 +0,0 @@
1
- System.register(["./main-578bc0655a22d2a15a27.js","vue","./Graph-BiU56Qj2-1bc138c9171768ed8819.js","vue-router","single-spa","vuex","vuetify"],function(ws,wr){"use strict";var ct,lt,ut,dt,ht,ft,C,L,A,pt,f,m,ye,J,K,te,oe,F,Le,Fe,se,Me,mt,Ve,gt;return{setters:[O=>{ct=O.d,lt=O._,ut=O.a,dt=O.R,ht=O.f,ft=O.u},O=>{C=O.resolveComponent,L=O.createBlock,A=O.openBlock,pt=O.Teleport,f=O.createVNode,m=O.withCtx,ye=O.createElementVNode,J=O.toDisplayString,K=O.createElementBlock,te=O.Fragment,oe=O.renderList,F=O.createTextVNode,Le=O.mergeProps,Fe=O.createSlots,se=O.createCommentVNode,Me=O.normalizeStyle,mt=O.withModifiers,Ve=O.withKeys},O=>{gt=O.r},null,null,null,null],execute:function(){var O=document.createElement("style");O.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(O);const vs={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}},Es={class:"app-title mr-2"};function Ts(t,e,s,i,n,o){const r=C("v-col"),a=C("v-row"),l=C("v-icon"),c=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(r,{"align-self":"end"},{default:m(()=>[ye("span",Es,J(s.title),1)]),_:1})]),_:1}),f(a,{dense:"",class:"flex-nowrap"},{default:m(()=>[(A(!0),K(te,null,oe(s.menus,(R,j)=>(A(),L(w,{ref_for:!0,ref:"topmenu",key:j},{activator:m(({props:_})=>[f(c,Le({ref_for:!0},_,{variant:"outlined",class:"mx-1 menu-button",text:R.label,"data-test":o.formatDT(`${s.title} ${R.label}`)}),{append:m(()=>[f(l,{class:"menu-button-icon"},{default:m(()=>e[0]||(e[0]=[F(" mdi-menu-down ",-1)])),_:1,__:[0]})]),_:2},1040,["text","data-test"])]),default:m(()=>[f(h,null,{default:m(()=>[(A(!0),K(te,null,oe(R.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,Le({ref_for:!0},D,{disabled:_.disabled,key:k}),Fe({append:m(()=>[f(l,null,{default:m(()=>e[1]||(e[1]=[F(" mdi-chevron-right ",-1)])),_:1,__:[1]})]),default:m(()=>[!_.radio&&!_.checkbox?(A(),L(g,{key:0,style:Me("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[F(J(_.label),1)]),_:2},1032,["style"])):se("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[f(l,{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:$=>o.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":o.formatDT(`${s.title} ${R.label} ${_.label}`),key:k+"-list"},Fe({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:Me("cursor: pointer;"+(_.disabled?"opacity: 0.2":""))},{default:m(()=>[F(J(_.label),1)]),_:2},1032,["style"])):se("",!0)]),_:2},[_.icon?{name:"prepend",fn:m(()=>[f(l,{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 Ss=ct(vs,[["render",Ts],["__scopeId","data-v-4d454b93"]]);var xs=Object.defineProperty,Cs=(t,e,s)=>e in t?xs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,_e=(t,e,s)=>Cs(t,typeof e!="symbol"?e+"":e,s);function bt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Os}=Object.prototype,{getPrototypeOf:qe}=Object,{iterator:we,toStringTag:yt}=Symbol,ve=(t=>e=>{const s=Os.call(e);return t[s]||(t[s]=s.slice(8,-1).toLowerCase())})(Object.create(null)),H=t=>(t=t.toLowerCase(),e=>ve(e)===t),Ee=t=>e=>typeof e===t,{isArray:ie}=Array,ae=Ee("undefined");function ce(t){return t!==null&&!ae(t)&&t.constructor!==null&&!ae(t.constructor)&&M(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const _t=H("ArrayBuffer");function Rs(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&_t(t.buffer),e}const ks=Ee("string"),M=Ee("function"),wt=Ee("number"),le=t=>t!==null&&typeof t=="object",As=t=>t===!0||t===!1,Te=t=>{if(ve(t)!=="object")return!1;const e=qe(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(yt in t)&&!(we in t)},Ds=t=>{if(!le(t)||ce(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Is=H("Date"),Ps=H("File"),Ns=H("Blob"),js=H("FileList"),Us=t=>le(t)&&M(t.pipe),Ls=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||M(t.append)&&((e=ve(t))==="formdata"||e==="object"&&M(t.toString)&&t.toString()==="[object FormData]"))},Fs=H("URLSearchParams"),[Ms,Vs,qs,Bs]=["ReadableStream","Request","Response","Headers"].map(H),$s=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ue(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{if(ce(t))return;const o=s?Object.getOwnPropertyNames(t):Object.keys(t),r=o.length;let a;for(i=0;i<r;i++)a=o[i],e.call(null,t[a],a,t)}}function vt(t,e){if(ce(t))return null;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,Et=t=>!ae(t)&&t!==Z;function Be(){const{caseless:t}=Et(this)&&this||{},e={},s=(i,n)=>{const o=t&&vt(e,n)||n;Te(e[o])&&Te(i)?e[o]=Be(e[o],i):Te(i)?e[o]=Be({},i):ie(i)?e[o]=i.slice():e[o]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&ue(arguments[i],s);return e}const Hs=(t,e,s,{allOwnKeys:i}={})=>(ue(e,(n,o)=>{s&&M(n)?t[o]=bt(n,s):t[o]=n},{allOwnKeys:i}),t),zs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Js=(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)},Ws=(t,e,s,i)=>{let n,o,r;const a={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),o=n.length;o-- >0;)r=n[o],(!i||i(r,t,e))&&!a[r]&&(e[r]=t[r],a[r]=!0);t=s!==!1&&qe(t)}while(t&&(!s||s(t,e))&&t!==Object.prototype);return e},Ks=(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},Zs=t=>{if(!t)return null;if(ie(t))return t;let e=t.length;if(!wt(e))return null;const s=new Array(e);for(;e-- >0;)s[e]=t[e];return s},Gs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&qe(Uint8Array)),Xs=(t,e)=>{const s=(t&&t[we]).call(t);let i;for(;(i=s.next())&&!i.done;){const n=i.value;e.call(t,n[0],n[1])}},Qs=(t,e)=>{let s;const i=[];for(;(s=t.exec(e))!==null;)i.push(s);return i},Ys=H("HTMLFormElement"),ei=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,s,i){return s.toUpperCase()+i}),Tt=(({hasOwnProperty:t})=>(e,s)=>t.call(e,s))(Object.prototype),ti=H("RegExp"),St=(t,e)=>{const s=Object.getOwnPropertyDescriptors(t),i={};ue(s,(n,o)=>{let r;(r=e(n,o,t))!==!1&&(i[o]=r||n)}),Object.defineProperties(t,i)},si=t=>{St(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+"'")})}})},ii=(t,e)=>{const s={},i=n=>{n.forEach(o=>{s[o]=!0})};return ie(t)?i(t):i(String(t).split(e)),s},ni=()=>{},ri=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function oi(t){return!!(t&&M(t.append)&&t[yt]==="FormData"&&t[we])}const ai=t=>{const e=new Array(10),s=(i,n)=>{if(le(i)){if(e.indexOf(i)>=0)return;if(ce(i))return i;if(!("toJSON"in i)){e[n]=i;const o=ie(i)?[]:{};return ue(i,(r,a)=>{const l=s(r,n+1);!ae(l)&&(o[a]=l)}),e[n]=void 0,o}}return i};return s(t,0)},ci=H("AsyncFunction"),li=t=>t&&(le(t)||M(t))&&M(t.then)&&M(t.catch),xt=((t,e)=>t?setImmediate:e?((s,i)=>(Z.addEventListener("message",({source:n,data:o})=>{n===Z&&o===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)),ui=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||xt,di=t=>t!=null&&M(t[we]),u={isArray:ie,isArrayBuffer:_t,isBuffer:ce,isFormData:Ls,isArrayBufferView:Rs,isString:ks,isNumber:wt,isBoolean:As,isObject:le,isPlainObject:Te,isEmptyObject:Ds,isReadableStream:Ms,isRequest:Vs,isResponse:qs,isHeaders:Bs,isUndefined:ae,isDate:Is,isFile:Ps,isBlob:Ns,isRegExp:ti,isFunction:M,isStream:Us,isURLSearchParams:Fs,isTypedArray:Gs,isFileList:js,forEach:ue,merge:Be,extend:Hs,trim:$s,stripBOM:zs,inherits:Js,toFlatObject:Ws,kindOf:ve,kindOfTest:H,endsWith:Ks,toArray:Zs,forEachEntry:Xs,matchAll:Qs,isHTMLForm:Ys,hasOwnProperty:Tt,hasOwnProp:Tt,reduceDescriptors:St,freezeMethods:si,toObjectSet:ii,toCamelCase:ei,noop:ni,toFiniteNumber:ri,findKey:vt,global:Z,isContextDefined:Et,isSpecCompliantForm:oi,toJSONObject:ai,isAsyncFn:ci,isThenable:li,setImmediate:xt,asap:ui,isIterable:di};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 Ct=v.prototype,Ot={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Ot[t]={value:t}}),Object.defineProperties(v,Ot),Object.defineProperty(Ct,"isAxiosError",{value:!0}),v.from=(t,e,s,i,n,o)=>{const r=Object.create(Ct);return u.toFlatObject(t,r,function(a){return a!==Error.prototype},a=>a!=="isAxiosError"),v.call(r,t.message,e,s,i,n),r.cause=t,r.name=t.name,o&&Object.assign(r,o),r};const hi=null;function $e(t){return u.isPlainObject(t)||u.isArray(t)}function Rt(t){return u.endsWith(t,"[]")?t.slice(0,-2):t}function kt(t,e,s){return t?t.concat(e).map(function(i,n){return i=Rt(i),!s&&n?"["+i+"]":i}).join(s?".":""):e}function fi(t){return u.isArray(t)&&!t.some($e)}const pi=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function Se(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||c,o=s.dots,r=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 l(h){if(h===null)return"";if(u.isDate(h))return h.toISOString();if(u.isBoolean(h))return h.toString();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 c(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)&&fi(h)||(u.isFileList(h)||u.endsWith(w,"[]"))&&(E=u.toArray(h)))return w=Rt(w),E.forEach(function(T,x){!(u.isUndefined(T)||T===null)&&e.append(r===!0?kt([w],x,o):r===null?w:w+"[]",l(T))}),!1}return $e(h)?!0:(e.append(kt(p,w,o),l(h)),!1)}const d=[],g=Object.assign(pi,{defaultVisitor:c,convertValue:l,isVisitable:$e});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 At(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function He(t,e){this._pairs=[],t&&Se(t,this,e)}const Dt=He.prototype;Dt.append=function(t,e){this._pairs.push([t,e])},Dt.toString=function(t){const e=t?function(s){return t.call(this,s,At)}:At;return this._pairs.map(function(s){return e(s[0])+"="+e(s[1])},"").join("&")};function mi(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function It(t,e,s){if(!e)return t;const i=s&&s.encode||mi;u.isFunction(s)&&(s={serialize:s});const n=s&&s.serialize;let o;if(n?o=n(e,s):o=u.isURLSearchParams(e)?e.toString():new He(e,s).toString(i),o){const r=t.indexOf("#");r!==-1&&(t=t.slice(0,r)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class Pt{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 Nt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gi=typeof URLSearchParams<"u"?URLSearchParams:He,bi=typeof FormData<"u"?FormData:null,yi=typeof Blob<"u"?Blob:null,_i={isBrowser:!0,classes:{URLSearchParams:gi,FormData:bi,Blob:yi},protocols:["http","https","file","blob","url","data"]},ze=typeof window<"u"&&typeof document<"u",Je=typeof navigator=="object"&&navigator||void 0,wi=ze&&(!Je||["ReactNative","NativeScript","NS"].indexOf(Je.product)<0),vi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ei=ze&&window.location.href||"http://localhost",Ti=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ze,hasStandardBrowserEnv:wi,hasStandardBrowserWebWorkerEnv:vi,navigator:Je,origin:Ei},Symbol.toStringTag,{value:"Module"})),U={...Ti,..._i};function Si(t,e){return Se(t,new U.classes.URLSearchParams,{visitor:function(s,i,n,o){return U.isNode&&u.isBuffer(s)?(this.append(i,s.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}function xi(t){return u.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Ci(t){const e={},s=Object.keys(t);let i;const n=s.length;let o;for(i=0;i<n;i++)o=s[i],e[o]=t[o];return e}function jt(t){function e(s,i,n,o){let r=s[o++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=o>=s.length;return r=!r&&u.isArray(n)?n.length:r,l?(u.hasOwnProp(n,r)?n[r]=[n[r],i]:n[r]=i,!a):((!n[r]||!u.isObject(n[r]))&&(n[r]=[]),e(s,i,n[r],o)&&u.isArray(n[r])&&(n[r]=Ci(n[r])),!a)}if(u.isFormData(t)&&u.isFunction(t.entries)){const s={};return u.forEachEntry(t,(i,n)=>{e(xi(i),n,s,0)}),s}return null}function Oi(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 de={transitional:Nt,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(jt(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 o;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return Si(t,this.formSerializer).toString();if((o=u.isFileList(t))||s.indexOf("multipart/form-data")>-1){const r=this.env&&this.env.FormData;return Se(o?{"files[]":t}:t,r&&new r,this.formSerializer)}}return n||i?(e.setContentType("application/json",!1),Oi(t)):t}],transformResponse:[function(t){const e=this.transitional||de.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(o){if(n)throw o.name==="SyntaxError"?v.from(o,v.ERR_BAD_RESPONSE,this,null,this.response):o}}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=>{de.headers[t]={}});const Ri=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"]),ki=t=>{const e={};let s,i,n;return t&&t.split(`
3
- `).forEach(function(o){n=o.indexOf(":"),s=o.substring(0,n).trim().toLowerCase(),i=o.substring(n+1).trim(),!(!s||e[s]&&Ri[s])&&(s==="set-cookie"?e[s]?e[s].push(i):e[s]=[i]:e[s]=e[s]?e[s]+", "+i:i)}),e},Ut=Symbol("internals");function he(t){return t&&String(t).trim().toLowerCase()}function xe(t){return t===!1||t==null?t:u.isArray(t)?t.map(xe):String(t)}function Ai(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 Di=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function We(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 Ii(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,s,i)=>s.toUpperCase()+i)}function Pi(t,e){const s=u.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+s,{value:function(n,o,r){return this[i].call(this,e,n,o,r)},configurable:!0})})}let V=class{constructor(t){t&&this.set(t)}set(t,e,s){const i=this;function n(r,a,l){const c=he(a);if(!c)throw new Error("header name must be a non-empty string");const d=u.findKey(i,c);(!d||i[d]===void 0||l===!0||l===void 0&&i[d]!==!1)&&(i[d||a]=xe(r))}const o=(r,a)=>u.forEach(r,(l,c)=>n(l,c,a));if(u.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(u.isString(t)&&(t=t.trim())&&!Di(t))o(ki(t),e);else if(u.isObject(t)&&u.isIterable(t)){let r={},a,l;for(const c of t){if(!u.isArray(c))throw TypeError("Object iterator must return a key-value pair");r[l=c[0]]=(a=r[l])?u.isArray(a)?[...a,c[1]]:[a,c[1]]:c[1]}o(r,e)}else t!=null&&n(e,t,s);return this}get(t,e){if(t=he(t),t){const s=u.findKey(this,t);if(s){const i=this[s];if(!e)return i;if(e===!0)return Ai(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=he(t),t){const s=u.findKey(this,t);return!!(s&&this[s]!==void 0&&(!e||We(this,this[s],s,e)))}return!1}delete(t,e){const s=this;let i=!1;function n(o){if(o=he(o),o){const r=u.findKey(s,o);r&&(!e||We(s,s[r],r,e))&&(delete s[r],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||We(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 o=u.findKey(s,n);if(o){e[o]=xe(i),delete e[n];return}const r=t?Ii(n):String(n).trim();r!==n&&delete e[n],e[r]=xe(i),s[r]=!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[Ut]=this[Ut]={accessors:{}}).accessors,s=this.prototype;function i(n){const o=he(n);e[o]||(Pi(s,n),e[o]=!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 Ke(t,e){const s=this||de,i=e||s,n=V.from(i.headers);let o=i.data;return u.forEach(t,function(r){o=r.call(s,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function Lt(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 Ft(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 Ni(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function ji(t,e){t=t||10;const s=new Array(t),i=new Array(t);let n=0,o=0,r;return e=e!==void 0?e:1e3,function(a){const l=Date.now(),c=i[o];r||(r=l),s[n]=a,i[n]=l;let d=o,g=0;for(;d!==n;)g+=s[d++],d=d%t;if(n=(n+1)%t,n===o&&(o=(o+1)%t),l-r<e)return;const b=c&&l-c;return b?Math.round(g*1e3/b):void 0}}function Ui(t,e){let s=0,i=1e3/e,n,o;const r=(a,l=Date.now())=>{s=l,n=null,o&&(clearTimeout(o),o=null),t(...a)};return[(...a)=>{const l=Date.now(),c=l-s;c>=i?r(a,l):(n=a,o||(o=setTimeout(()=>{o=null,r(n)},i-c)))},()=>n&&r(n)]}const Ce=(t,e,s=3)=>{let i=0;const n=ji(50,250);return Ui(o=>{const r=o.loaded,a=o.lengthComputable?o.total:void 0,l=r-i,c=n(l),d=r<=a;i=r;const g={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&d?(a-r)/c:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(g)},s)},Mt=(t,e)=>{const s=t!=null;return[i=>e[0]({lengthComputable:s,total:t,loaded:i}),e[1]]},Vt=t=>(...e)=>u.asap(()=>t(...e)),Li=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,Fi=U.hasStandardBrowserEnv?{write(t,e,s,i,n,o){const r=[t+"="+encodeURIComponent(e)];u.isNumber(s)&&r.push("expires="+new Date(s).toGMTString()),u.isString(i)&&r.push("path="+i),u.isString(n)&&r.push("domain="+n),o===!0&&r.push("secure"),document.cookie=r.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 Mi(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Vi(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function qt(t,e,s){let i=!Mi(e);return t&&(i||s==!1)?Vi(t,e):e}const Bt=t=>t instanceof V?{...t}:t;function G(t,e){e=e||{};const s={};function i(c,d,g,b){return u.isPlainObject(c)&&u.isPlainObject(d)?u.merge.call({caseless:b},c,d):u.isPlainObject(d)?u.merge({},d):u.isArray(d)?d.slice():d}function n(c,d,g,b){if(u.isUndefined(d)){if(!u.isUndefined(c))return i(void 0,c,g,b)}else return i(c,d,g,b)}function o(c,d){if(!u.isUndefined(d))return i(void 0,d)}function r(c,d){if(u.isUndefined(d)){if(!u.isUndefined(c))return i(void 0,c)}else return i(void 0,d)}function a(c,d,g){if(g in e)return i(c,d);if(g in t)return i(void 0,c)}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(c,d,g)=>n(Bt(c),Bt(d),g,!0)};return u.forEach(Object.keys({...t,...e}),function(c){const d=l[c]||n,g=d(t[c],e[c],c);u.isUndefined(g)&&d!==a||(s[c]=g)}),s}const $t=t=>{const e=G({},t);let{data:s,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:o,headers:r,auth:a}=e;e.headers=r=V.from(r),e.url=It(qt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if(u.isFormData(s)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if((l=r.getContentType())!==!1){const[c,...d]=l?l.split(";").map(g=>g.trim()).filter(Boolean):[];r.setContentType([c||"multipart/form-data",...d].join("; "))}}if(U.hasStandardBrowserEnv&&(i&&u.isFunction(i)&&(i=i(e)),i||i!==!1&&Li(e.url))){const c=n&&o&&Fi.read(o);c&&r.set(n,c)}return e},qi=typeof XMLHttpRequest<"u",Bi=qi&&function(t){return new Promise(function(e,s){const i=$t(t);let n=i.data;const o=V.from(i.headers).normalize();let{responseType:r,onUploadProgress:a,onDownloadProgress:l}=i,c,d,g,b,h;function w(){b&&b(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}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()),R={data:!r||r==="text"||r==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:x,config:t,request:p};Ft(function(j){e(j),w()},function(j){s(j),w()},R),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 R=i.transitional||Nt;i.timeoutErrorMessage&&(x=i.timeoutErrorMessage),s(new v(x,R.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,t,p)),p=null},n===void 0&&o.setContentType(null),"setRequestHeader"in p&&u.forEach(o.toJSON(),function(x,R){p.setRequestHeader(R,x)}),u.isUndefined(i.withCredentials)||(p.withCredentials=!!i.withCredentials),r&&r!=="json"&&(p.responseType=i.responseType),l&&([g,h]=Ce(l,!0),p.addEventListener("progress",g)),a&&p.upload&&([d,b]=Ce(a),p.upload.addEventListener("progress",d),p.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(c=x=>{p&&(s(!x||x.type?new ne(null,t,p):x),p.abort(),p=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const T=Ni(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)})},$i=(t,e)=>{const{length:s}=t=t?t.filter(Boolean):[];if(e||s){let i=new AbortController,n;const o=function(c){if(!n){n=!0,a();const d=c instanceof Error?c:this.reason;i.abort(d instanceof v?d:new ne(d instanceof Error?d.message:d))}};let r=e&&setTimeout(()=>{r=null,o(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const a=()=>{t&&(r&&clearTimeout(r),r=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),t=null)};t.forEach(c=>c.addEventListener("abort",o));const{signal:l}=i;return l.unsubscribe=()=>u.asap(a),l}},Hi=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},zi=async function*(t,e){for await(const s of Ji(t))yield*Hi(s,e)},Ji=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()}},Ht=(t,e,s,i)=>{const n=zi(t,e);let o=0,r,a=l=>{r||(r=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:c,value:d}=await n.next();if(c){a(),l.close();return}let g=d.byteLength;if(s){let b=o+=g;s(b)}l.enqueue(new Uint8Array(d))}catch(c){throw a(c),c}},cancel(l){return a(l),n.return()}},{highWaterMark:2})},Oe=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",zt=Oe&&typeof ReadableStream=="function",Wi=Oe&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),Jt=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Ki=zt&&Jt(()=>{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}),Wt=64*1024,Ze=zt&&Jt(()=>u.isReadableStream(new Response("").body)),Re={stream:Ze&&(t=>t.body)};Oe&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Re[e]&&(Re[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 Zi=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 Wi(t)).byteLength},Gi=async(t,e)=>u.toFiniteNumber(t.getContentLength())??Zi(e),Xi=Oe&&(async t=>{let{url:e,method:s,data:i,signal:n,cancelToken:o,timeout:r,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:d,withCredentials:g="same-origin",fetchOptions:b}=$t(t);c=c?(c+"").toLowerCase():"text";let h=$i([n,o&&o.toAbortSignal()],r),w;const p=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let E;try{if(l&&Ki&&s!=="get"&&s!=="head"&&(E=await Gi(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]=Mt(E,Ce(Vt(l)));i=Ht(_.body,Wt,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,b);const R=Ze&&(c==="stream"||c==="response");if(Ze&&(a||R&&p)){const _={};["status","statusText","headers"].forEach($=>{_[$]=x[$]});const k=u.toFiniteNumber(x.headers.get("content-length")),[D,q]=a&&Mt(k,Ce(Vt(a),!0))||[];x=new Response(Ht(x.body,Wt,D,()=>{q&&q(),p&&p()}),_)}c=c||"text";let j=await Re[u.findKey(Re,c)||"text"](x,t);return!R&&p&&p(),await new Promise((_,k)=>{Ft(_,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)}}),Ge={http:hi,xhr:Bi,fetch:Xi};u.forEach(Ge,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Kt=t=>`- ${t}`,Qi=t=>u.isFunction(t)||t===null||t===!1,Zt={getAdapter:t=>{t=u.isArray(t)?t:[t];const{length:e}=t;let s,i;const n={};for(let o=0;o<e;o++){s=t[o];let r;if(i=s,!Qi(s)&&(i=Ge[(r=String(s)).toLowerCase()],i===void 0))throw new v(`Unknown adapter '${r}'`);if(i)break;n[r||"#"+o]=i}if(!i){const o=Object.entries(n).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let r=e?o.length>1?`since :
5
- `+o.map(Kt).join(`
6
- `):" "+Kt(o[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:Ge};function Xe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ne(null,t)}function Gt(t){return Xe(t),t.headers=V.from(t.headers),t.data=Ke.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Zt.getAdapter(t.adapter||de.adapter)(t).then(function(e){return Xe(t),e.data=Ke.call(t,t.transformResponse,e),e.headers=V.from(e.headers),e},function(e){return Lt(e)||(Xe(t),e&&e.response&&(e.response.data=Ke.call(t,t.transformResponse,e.response),e.response.headers=V.from(e.response.headers))),Promise.reject(e)})}const Xt="1.11.0",ke={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ke[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Qt={};ke.transitional=function(t,e,s){function i(n,o){return"[Axios v"+Xt+"] Transitional option '"+n+"'"+o+(s?". "+s:"")}return(n,o,r)=>{if(t===!1)throw new v(i(o," has been removed"+(e?" in "+e:"")),v.ERR_DEPRECATED);return e&&!Qt[o]&&(Qt[o]=!0,console.warn(i(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,o,r):!0}},ke.spelling=function(t){return(e,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Yi(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 o=i[n],r=e[o];if(r){const a=t[o],l=a===void 0||r(a,o,t);if(l!==!0)throw new v("option "+o+" must be "+l,v.ERR_BAD_OPTION_VALUE);continue}if(s!==!0)throw new v("Unknown option "+o,v.ERR_BAD_OPTION)}}const Ae={assertOptions:Yi,validators:ke},W=Ae.validators;let X=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Pt,response:new Pt}}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&&Ae.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}:Ae.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),Ae.assertOptions(e,{baseUrl:W.spelling("baseURL"),withXsrfToken:W.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=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(o,n);const r=[];let a=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(e)===!1||(a=a&&h.synchronous,r.unshift(h.fulfilled,h.rejected))});const l=[];this.interceptors.response.forEach(function(h){l.push(h.fulfilled,h.rejected)});let c,d=0,g;if(!a){const h=[Gt.bind(this),void 0];for(h.unshift(...r),h.push(...l),g=h.length,c=Promise.resolve(e);d<g;)c=c.then(h[d++],h[d++]);return c}g=r.length;let b=e;for(d=0;d<g;){const h=r[d++],w=r[d++];try{b=h(b)}catch(p){w.call(this,p);break}}try{c=Gt.call(this,b)}catch(h){return Promise.reject(h)}for(d=0,g=l.length;d<g;)c=c.then(l[d++],l[d++]);return c}getUri(t){t=G(this.defaults,t);const e=qt(t.baseURL,t.url,t.allowAbsoluteUrls);return It(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,o){return this.request(G(o||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}X.prototype[t]=e(),X.prototype[t+"Form"]=e(!0)});let en=class _s{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 o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(n);return r.cancel=function(){i.unsubscribe(o)},r},e(function(n,o,r){i.reason||(i.reason=new ne(n,o,r),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 _s(function(s){e=s}),cancel:e}}};function tn(t){return function(e){return t.apply(null,e)}}function sn(t){return u.isObject(t)&&t.isAxiosError===!0}const Qe={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(Qe).forEach(([t,e])=>{Qe[e]=t});function Yt(t){const e=new X(t),s=bt(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 Yt(G(t,i))},s}const I=Yt(de);I.Axios=X,I.CanceledError=ne,I.CancelToken=en,I.isCancel=Lt,I.VERSION=Xt,I.toFormData=Se,I.AxiosError=v,I.Cancel=I.CanceledError,I.all=function(t){return Promise.all(t)},I.spread=tn,I.isAxiosError=sn,I.mergeConfig=G,I.AxiosHeaders=V,I.formToJSON=t=>jt(u.isHTMLForm(t)?new FormData(t):t),I.getAdapter=Zt.getAdapter,I.HttpStatusCode=Qe,I.default=I;const{Axios:vr,AxiosError:Er,CanceledError:Tr,isCancel:Sr,CancelToken:xr,VERSION:Cr,all:Or,Cancel:Rr,isAxiosError:kr,spread:Ar,toFormData:Dr,AxiosHeaders:Ir,HttpStatusCode:Pr,formToJSON:Nr,getAdapter:jr,mergeConfig:Ur}=I,es=I.create({baseURL:location.origin,timeout:6e4,params:{}});es.interceptors.response.use(t=>t,t=>{var e,s,i,n,o,r,a,l,c,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} `),(o=(n=t.response)==null?void 0:n.data)!=null&&o.message?b+=`${t.response.data.message}`:(a=(r=t.response)==null?void 0:r.data)!=null&&a.exception?b+=`${t.response.data.exception}`:(d=(c=(l=t.response)==null?void 0:l.data)==null?void 0:c.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 De=()=>({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 fe extends Error{constructor(e,s){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=s,this.name="ReasonError"}}class Ye extends fe{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class nn extends fe{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class z extends fe{constructor(e,s){s?super(e,s):super("Disconnected",e),this.name="DisconnectedError"}}class rn extends z{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function ts(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 on{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 ss{constructor(e={}){this.emitter=De(),this.params=Object.freeze(e),this.presence=new on(this),this.initialConnect=!0,this[Q]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=ts({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(o=>o()),s(n||new fe("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class an{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(o=>{s=o}),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 cn{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 ln{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new cn),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 an(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 un{constructor(e={}){this.subscriptions=new ln(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 o=this.subscriptions.get(n);o&&o.channels.forEach(r=>{r.receive(s,i)})}notify(e,s,i){let n=this._remoteToLocal[e];if(!n)return;let o=this.subscriptions.get(n);o&&o.channels.forEach(r=>r.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 is={debug:0,info:1,warn:2,error:3};class ns{constructor(e){this.level=e||"warn"}log(e,s,i){is[e]<is[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 pe extends ns{writeLogEntry(){}}class dn{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let hn=0;class rs{constructor(e={}){let{logger:s}=e;this.logger=s||new pe,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=ts(i);if(this.pendingUnsubscriptions[n]){let r=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${r}`,n),new Promise(a=>{setTimeout(()=>{a(this.subscribe(e,s))},r)})}if(this.pendingSubscriptions[n])return this.logger.warn("subscription is already pending, skipping",n),Promise.reject(Error("Already subscribing"));let o=this.subscribeRetryInterval;return new Promise((r,a)=>{let l=++hn;this.pendingSubscriptions[n]={resolve:r,reject:a,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,n,o)})}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 nn(`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:o,reconnect:r}=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(o);this.reset(a),r===!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 Ye)):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 os=()=>Date.now()/1e3|0;class fn extends rs{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=os()),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=os()),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 o=e.restored_ids||Object.keys(this.subscriptionStreams);for(let r of o)this.cable.send({identifier:r,command:"history",history:this.historyRequestFor(r)}),this.presenceInfo[r]&&this.cable.send({identifier:r,command:"join",presence:this.presenceInfo[r]});return this.cable.restored(o)}return this.cable.connected(this.sessionId)}if(s==="presence"){let o=n.type;if(o==="info"){let r=this.pendingPresence[i];r&&(delete this.pendingPresence[i],r.resolve(n))}else if(o==="error"){let r=this.pendingPresence[i];r&&(delete this.pendingPresence[i],r.reject(new Error("failed to retrieve presence")))}return{type:s,identifier:i,message:n}}if(n){let o=this.trackStreamPosition(i,e.stream_id,e.epoch,e.offset);return{identifier:i,message:n,meta:o}}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 o=this.streamsPositions[n];o&&(i=!0,s[n]=o)}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 pn extends fe{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class et extends ss{constructor(e,s){super(s),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}_e(et,"identifier","__ghost__");const mn="$pubsub";class tt extends ss{async perform(e,s){if(e.startsWith("$"))return super.perform(e,s);throw Error("not implemented")}}_e(tt,"identifier",mn);const Y=Symbol("state");let gn=class{constructor({transport:t,protocol:e,encoder:s,logger:i,lazy:n,hubOptions:o,performFailures:r,transportConfigurator:a}){this.emitter=De(),this.transport=t,this.encoder=s,this.logger=i||new pe,this.protocol=e,this.performFailures=r||"throw",this.protocol.attached(this),this.hub=new un(o||{}),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:o,meta:r}=s;i?this.hub.notify(n,i,o):this.hub.transmit(n,o,r)}}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 tt({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new tt({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let s,i;return typeof t=="string"&&(i=t,t=et),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 o={identifier:e,params:s};this.logger.debug("subscribing",o);try{let r=await this.protocol.subscribe(e,s);this.hub.subscribe(i,r),this.logger.debug("subscribed",{...o,remoteId:r}),t.notify("connected")}catch(r){if(r){if(r instanceof Ye&&this.logger.warn("rejected",o),r instanceof z){this.logger.debug("disconnected during subscription; will retry on connect",o),n.release();return}this.logger.error("failed to subscribe",{error:r,...o})}t.close(r),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 pn;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,o={id:n,action:e,payload:s};this.logger.debug("perform",o);try{let r=await this.protocol.perform(n,e,s);return r&&this.logger.debug("perform result",{message:r,request:o}),r}catch(r){throw this.logger.error("perform failed",{error:r,request:o}),r}}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 bn={maxMissingPings:2,maxReconnectAttempts:1/0},re=()=>Date.now(),as=(t,e)=>{e=e||{};let{backoffRate:s,jitterRatio:i,maxInterval:n}=e;return s=s||2,i===void 0&&(i=.5),o=>{let r=t*s**o,a=r*s,l=r+(a-r)*Math.random(),c=2*(Math.random()-.5)*i;return l=l*(1+c),n&&n<l&&(l=n),l}};let cs=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},bn,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 pe,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 rn))}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 yn{constructor(e,s={}){this.transports=e,this.transport=null,this.emitter=De(),this.unbind=[],this.logger=s.logger||new pe}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 _n{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=De();let{format:n,subprotocol:o,authStrategy:r}=s;this.format=n||"text",this.connectionOptions=s.websocketOptions,this.authStrategy=r||"param",this.authProtocol="",this.subprotocol=o}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(o=>o()),s()})),n.push(this.once("close",()=>{n.forEach(o=>o()),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 ls={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function wn(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({},ls,e);let{protocol:s,websocketImplementation:i,websocketFormat:n,websocketOptions:o,websocketAuthStrategy:r,fallbacks:a,logLevel:l,logger:c,transport:d,encoder:g,lazy:b,monitor:h,pingInterval:w,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,subprotocol:x,tokenRefresher:R,historyTimestamp:j,protocolOptions:_,concurrentSubscribes:k,performFailures:D,transportConfigurator:q,auth:$}=e;if(c=c||new pe(l),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 rs({logger:c,..._});else if(P==="actioncable-v1-ext")s=new fn({logger:c,historyTimestamp:j,..._});else throw Error(`Protocol is not supported yet: ${s}`);if(B==="json")g=g||new dn,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 _n(t,{websocketImplementation:i,websocketOptions:o,subprotocol:x,authStrategy:r,format:n}),a&&(d=new yn([d,...a],{logger:c})),$&&$.token&&d.setToken($.token,$.param||"jid"),p=p||as(w),h!==!1&&(h=h||new cs({pingInterval:w,reconnectStrategy:p,maxMissingPings:E,maxReconnectAttempts:T,logger:c}));let ge={concurrentSubscribes:k},y=new gn({protocol:s,transport:d,encoder:g,logger:c,lazy:b,hubOptions:ge,performFailures:D,transportConfigurator:q});return h&&(h.watch(y),y.monitor=h),R&&vn(y,async()=>{try{await R(d)}catch(P){return c.error("Failed to refresh authentication token: "+P),!1}return y.connect().catch(()=>{}),!0}),y}function vn(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 En{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 Tn extends et{constructor(e,s,i){super(e,s),this.subscription=new En(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 Ye?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Sn{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 o=new Tn(i,n,s);return o.subscription.notify("initialized"),this.cable.subscribe(o),o.subscription}findAll(e){return this.cable.hub.channels.filter(s=>s.identifier===e).map(s=>s.subscription)}}class xn{constructor(e){this.cable=e,this.subscriptions=new Sn(e)}}class Cn extends ns{writeLogEntry(e,s,i){i?console[e](s,i):console[e](s)}}class On extends cs{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 Rn=["cable","action-cable"],kn="/cable",Ie=(t,e)=>{for(let s of Rn){let i=t.head.querySelector(`meta[name='${s}-${e}']`);if(i)return i.getAttribute("content")}},us=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,An=()=>{if(typeof document<"u"&&document.head){let t=Ie(document,"url");if(t)return us(t)}return us(kn)},Dn=()=>{if(typeof document<"u"&&document.head){let t=Ie(document,"history-timestamp");if(t)return t|0}},In=()=>{if(typeof document<"u"&&document.head)return Ie(document,"token")},Pn=()=>{if(typeof document<"u"&&document.head)return Ie(document,"token-param")};function Nn(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||An(),e=e||{},e.historyTimestamp||(e.historyTimestamp=Dn());let s=In();if(s){let c=Pn();e.auth=Object.assign({token:s,param:c},e.auth||{})}e=Object.assign({},ls,e);let{logLevel:i,logger:n,pingInterval:o,reconnectStrategy:r,maxMissingPings:a,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new Cn(i),r=e.reconnectStrategy=e.reconnectStrategy||as(o),e.monitor!==!1&&(e.monitor=e.monitor||new On({pingInterval:o,reconnectStrategy:r,maxMissingPings:a,maxReconnectAttempts:l,logger:n})),wn(t,e)}function jn(t,e){let s=Nn(t,e);return new xn(s)}class Un{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(o=>{if(o&&OpenC3Auth.setTokens(),this._cable==null){let r=this._url+"?scope="+encodeURIComponent(window.openc3Scope)+"&authorization="+encodeURIComponent(localStorage.openc3Token);r=new URL(r,document.baseURI).href,this._cable=jn(r)}return this._cable.subscriptions.create({channel:e,...n},i)})}recordPing(){}}function Pe(t){return Ln.test(t)}const Ln=/^-?[0-9]+$/;function ds(t){return Fn.test(t)}const Fn=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function hs(t,e){const s=Number.parseFloat(t),i=String(s);if(t===i)return!0;const n=fs(t),o=fs(i);return!!(n===o||(e==null?void 0:e.approx)===!0&&!Pe(t)&&o.length>=14&&n.startsWith(o.substring(0,14)))}let me=function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t}({});function Mn(t){if(hs(t,{approx:!1}))return;if(Pe(t))return me.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?me.underflow:me.truncate_float:me.overflow}function fs(t){const{start:e,end:s}=Vn(t),i=t.substring(e,s),n=i.indexOf(".");return n===-1?i:i.substring(0,n)+i.substring(n+1)}function Vn(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let s=t.lastIndexOf("e");for(s===-1&&(s=t.lastIndexOf("E")),s===-1&&(s=t.length);(t[s-1]==="0"||t[s-1]===".")&&s>e;)s--;return{start:e,end:s}}class qn{constructor(e){if(_e(this,"isLosslessNumber",!0),!ds(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Mn(this.value);if(e===void 0||e===me.truncate_float)return Number.parseFloat(this.value);if(Pe(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 Bn(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function $n(t){return new qn(t)}function Hn(t,e){return st({"":t},"",t,e)}function st(t,e,s,i){return Array.isArray(s)?i.call(t,e,Jn(s,i)):s&&typeof s=="object"&&!Bn(s)?i.call(t,e,zn(s,i)):i.call(t,e,s)}function zn(t,e){for(const s of Object.keys(t)){const i=st(t,s,t[s],e);i!==void 0?t[s]=i:delete t[s]}return t}function Jn(t,e){for(let s=0;s<t.length;s++)t[s]=st(t,String(s),t[s],e);return t}function Wn(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$n,i=0;const n=a();return w(n),E(),e?Hn(n,e):n;function o(){if(t.charCodeAt(i)===Yn){i++,c();const S={};let N=!0;for(;i<t.length&&t.charCodeAt(i)!==ms;){N?N=!1:(b(),c());const ee=i,be=d();if(be===void 0){R();return}c(),h();const at=a();if(at===void 0){$();return}Object.prototype.hasOwnProperty.call(S,be)&&!it(at,S[be])&&j(be,ee+1),S[be]=at}return t.charCodeAt(i)!==ms&&_(),i++,S}}function r(){if(t.charCodeAt(i)===er){i++,c();const S=[];let N=!0;for(;i<t.length&&t.charCodeAt(i)!==gs;){N?N=!1:b();const ee=a();p(ee),S.push(ee)}return t.charCodeAt(i)!==gs&&k(),i++,S}}function a(){c();const S=d()??g()??o()??r()??l("true",!0)??l("false",!1)??l("null",null);return c(),S}function l(S,N){if(t.slice(i,i+S.length)===S)return i+=S.length,N}function c(){for(;Kn(t.charCodeAt(i));)i++}function d(){if(t.charCodeAt(i)===nt){i++;let S="";for(;i<t.length&&t.charCodeAt(i)!==nt;){if(t.charCodeAt(i)===Qn){const N=t[i+1],ee=Xn[N];ee!==void 0?(S+=ee,i++):N==="u"?Ne(t.charCodeAt(i+2))&&Ne(t.charCodeAt(i+3))&&Ne(t.charCodeAt(i+4))&&Ne(t.charCodeAt(i+5))?(S+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):ge(i):q(i)}else Gn(t.charCodeAt(i))?S+=t[i]:D(t[i]);i++}return x(),i++,S}}function g(){const S=i;if(t.charCodeAt(i)===bs&&(i++,T(S)),t.charCodeAt(i)===rt)i++;else if(Zn(t.charCodeAt(i)))for(i++;je(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===cr)for(i++,T(S);je(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===fr||t.charCodeAt(i)===hr)for(i++,(t.charCodeAt(i)===bs||t.charCodeAt(i)===rr)&&i++,T(S);je(t.charCodeAt(i));)i++;if(i>S)return s(t.slice(S,i))}function b(){if(t.charCodeAt(i)!==ar)throw new SyntaxError(`Comma ',' expected after value ${B()}`);i++}function h(){if(t.charCodeAt(i)!==lr)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(!je(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)!==nt)throw new SyntaxError(`End of string '"' expected ${B()}`)}function R(){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 ge(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 Kn(t){return t===tr||t===sr||t===ir||t===nr}function Ne(t){return t>=rt&&t<=ot||t>=ur&&t<=pr||t>=dr&&t<=mr}function je(t){return t>=rt&&t<=ot}function Zn(t){return t>=or&&t<=ot}function Gn(t){return t>=32&&t<=1114111}function it(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((s,i)=>it(s,e[i])):ps(t)&&ps(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>it(t[s],e[s])):!1}function ps(t){return typeof t=="object"&&t!==null}const Xn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
8
- `,r:"\r",t:" "},Qn=92,Yn=123,ms=125,er=91,gs=93,tr=32,sr=10,ir=9,nr=13,nt=34,rr=43,bs=45,rt=48,or=49,ot=57,ar=44,cr=46,lr=58,ur=65,dr=97,hr=69,fr=101,pr=70,mr=102;function ys(t,e,s,i){return n(t);function n(l,c){if(Array.isArray(i)){const d=i.find(g=>g.test(l));if(d){const g=d.stringify(l);if(typeof g!="string"||!ds(g))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${g})`);return g}}if(typeof l=="boolean"||typeof l=="number"||typeof l=="string"||l===null||l instanceof Date||l instanceof Boolean||l instanceof Number||l instanceof String)return JSON.stringify(l);if(l!=null&&l.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return o(l);if(l&&typeof l=="object")return r(l)}function o(l,c){if(l.length===0)return"[]";let d="[";for(let g=0;g<l.length;g++){const b=l[g];typeof b<"u"&&typeof b!="function"?d+=n(b):d+="null",g<l.length-1&&(d+=",")}return d+="]",d}function r(l,c){if(typeof l.toJSON=="function")return ys(l.toJSON(),e,s,void 0);const d=Array.isArray(e)?e.map(String):Object.keys(l);if(d.length===0)return"{}";let g=!0,b="{";for(const h of d){const w=l[h];if(a(h,w)){g?g=!1:b+=",";const p=JSON.stringify(h);b+=`${p}:`,b+=n(w)}}return b+="}",b}function a(l,c){return typeof c<"u"&&typeof c!="function"&&typeof c!="symbol"}}function gr(t){return Pe(t)&&!hs(t)?BigInt(t):parseFloat(t)}class br{constructor(){_e(this,"id",1)}async exec(e,s,i={},n={},o=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 es.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:o,transformRequest:[(r,a)=>ys(r)],transformResponse:[r=>Wn(r,void 0,gr)]})).data.result}catch(r){let a=new Error;throw r.response?(a.name=r.response.data.error.data.class,a.message=r.response.data.error.data.message,a.object=r.response.data.error):r.request?(a.name="Request error",a.message="Request error, no response received"):a=r,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 o=await this.exec("get_tlm_packet",[e,s],{type:i,stale_time:n});if(o!=null){let r=o.length,a=null;for(let l=0;l<r;l++)a=this.decode_openc3_type(o[l][1]),a!==null&&(o[l][1]=a)}return o}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])}get_tlm_available(e){return this.exec("get_tlm_available",[e])}async get_tlm_values(e,s=30,i=null,n=null,o=null){let r={stale_time:s};i!==null&&(r.cache_timeout=i),n!==null&&(r.start_time=n.toISOString()),o!==null&&(r.end_time=o.toISOString());const a=await this.exec("get_tlm_values",[e],r,{},1e4);if(a&&a.length>0){let l=a[0].length,c=null;for(let d=0;d<l;d++)c=this.decode_openc3_type(a[0][d]),c!==null&&(a[0][d]=c)}return a}get_limits(e,s,i){return this.exec("get_limits",[e,s,i])}async tlm(e,s,i,n="CONVERTED"){let o=null;if(s===void 0)o=await this.exec("tlm",[e]);else if(i===void 0)if(["RAW","CONVERTED","FORMATTED","WITH_UNITS"].includes(s))o=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 o=await this.exec("tlm",[e,s,i],{type:n});let r=this.decode_openc3_type(o);return r!==null&&(o=r),o}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,o){let r=null;for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r=this.encode_openc3_type(n[a]),r!==null&&(n[a]=r));return this.exec(e,[s,i,n],{},o)}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,s){return this.exec("get_setting",[e],s)}get_settings(e,s){return this.exec("get_settings",e,s)}set_setting(e,s){return this.exec("set_setting",[e,s])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}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(o=>o.toString(16).padStart(2,"0")).join("")}}}let Ue=[];const yr={components:{OpenConfigDialog:ft,SaveConfigDialog:ht,TargetPacketItemChooser:gt,TopBar:Ss},mixins:[ut,dt],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 Un,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 br,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
- 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(){Ue=[],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 o=Object.keys(n);o.forEach(e.add,e),this.itemsReceived+=o.length-2,this.totalItemsReceived+=o.length-2}e.delete("__type"),e.delete("__time"),this.buildHeaders([...e]),Ue.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,o,r,a,l]=e.split("__");let c=r;this.columnMode==="full"&&(c=n+" "+o+" "+r),s&&s!=="DECOM"&&(c=c+" {"+s+"}"),a&&a!=="CONVERTED"&&(c=c+" ("+a+")"),l&&(c=c+" ["+l+"]"),this.columnHeaders.push(c)})},createFile:async function(){let t=Ue.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 o=[],r=[],a=null,l=0;for(let h of t){let w=!1;this.fillDown&&a?r=[...a]:r=[];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)r[T]="";else if(Array.isArray(h[E]))r[T]='"['+h[E]+']"';else{let x=h[E].raw;if(Array.isArray(x)){let R="";x.forEach(j=>{R+=j.toString(16)}),r[T]=R}else r[T]="'"+x+"'"}else r[T]=h[E];this.uniqueOnly&&o[T]!==r[T]&&(w=!0),o[T]=r[T]}),this.fillDown&&(a=[...r]),!this.uniqueOnly||w){if(this.columnMode==="normal"){p=this.keyMap[p];const[E,T,x,R,j,_,k]=p.split("__");r[0]=new Date(h.__time/1e6).toISOString(),r[1]=x,r[2]=R}i.push(r.join(this.delimiter))}l+=1,l%1e3==0&&await this.yieldToMain()}let c=".csv",d="text/csv";this.delimiter===" "&&(c=".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+c),b.click(),this.fileCount+=1},yieldToMain:function(){return new Promise(t=>{setTimeout(t,0)})},finished:async function(){if(this.progress=95,this.subscription.unsubscribe(),Ue.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 _r(t,e,s,i,n,o){const r=C("top-bar"),a=C("v-text-field"),l=C("v-col"),c=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"),R=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"),ge=C("save-config-dialog");return A(),K("div",null,[f(r,{menus:o.menus,title:n.title},null,8,["menus","title"]),f(k,null,{default:m(()=>[f(h,null,{default:m(()=>[f(c,null,{default:m(()=>[f(l,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(l,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(l,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(l,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(c,{"no-gutters":""},{default:m(()=>[f(l,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(c,null,{default:m(()=>[f(l,null,{default:m(()=>[f(b,{"button-text":"Add Item",mode:n.cmdOrTlm,hidden:!0,"choose-item":"","allow-all":"",onAddItem:e[5]||(e[5]=y=>o.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:o.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:o.deleteAll},null,8,["disabled","onClick"])]),_:1}),f(k,{width:"100%"},{default:m(()=>[f(x,null,{default:m(()=>[e[18]||(e[18]=F(" Items ",-1)),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,__:[18]}),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:Ve(P=>y.edit=!1,["esc"])},{default:m(()=>[f(k,null,{default:m(()=>[f(T,{height:"24"},{default:m(()=>[f(p),e[19]||(e[19]=ye("span",null," DataExtractor: Edit Item Mode ",-1)),f(p)]),_:1,__:[19]}),f(j,null,{default:m(()=>[f(c,{class:"mt-3 title-font"},{default:m(()=>[f(l,null,{default:m(()=>[F(J(o.getItemLabel(y)),1)]),_:2},1024)]),_:2},1024),f(c,null,{default:m(()=>[f(l,null,{default:m(()=>[f(R,{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(c,null,{default:m(()=>[f(l,null,{default:m(()=>[f(R,{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(c,null,{default:m(()=>[f(l,null,{default:m(()=>[f(R,{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 ",-1)])),_:2,__:[20]},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=>o.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]=Ve(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]=ye("span",null," DataExtractor: Edit All Items",-1)),f(p)]),_:1,__:[21]}),f(j,null,{default:m(()=>[f(c,{class:"mt-3"},{default:m(()=>[f(l,null,{default:m(()=>e[22]||(e[22]=[F(" This will change all items to the following data type! ",-1)])),_:1,__:[22]})]),_:1}),f(c,null,{default:m(()=>[f(l,null,{default:m(()=>[f(R,{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(c,null,{default:m(()=>[f(l,null,{default:m(()=>[f(R,{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(c,null,{default:m(()=>[f(l,null,{default:m(()=>[f(R,{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)])),_:1,__:[23]}),f(E,{variant:"flat",disabled:!n.allItemValueType,onClick:e[13]||(e[13]=y=>o.editAllItems())},{default:m(()=>e[24]||(e[24]=[F(" Ok ",-1)])),_:1,__:[24]},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:o.openConfiguration},null,8,["modelValue","config-key","onSuccess"])):se("",!0),n.saveConfig?(A(),L(ge,{key:1,modelValue:n.saveConfig,"onUpdate:modelValue":e[17]||(e[17]=y=>n.saveConfig=y),"config-key":n.configKey,onSuccess:o.saveConfiguration},null,8,["modelValue","config-key","onSuccess"])):se("",!0)])}const Lr=ws("default",lt(yr,[["render",_r],["__scopeId","data-v-f98b189b"]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","./main-578bc0655a22d2a15a27.js","vue","vue-router","single-spa","vuex","vuetify"],function(d,V){"use strict";var l,a,n,r,s,u,o;return{setters:[e=>{l=e.o},e=>{a=e.d,n=e.R},e=>{r=e.resolveComponent,s=e.createBlock,u=e.openBlock,o=e.normalizeStyle},null,null,null,null],execute:function(){const e={mixins:[l,n],data(){return{label:"Date",dateValue:""}},created(){this.parameters[0]&&(this.label=this.parameters[0]),this.dateValue=this.formatDate(new Date,this.screenTimeZone)},methods:{text(){return this.dateValue},date(){return this.dateValue}}};function c(m,i,v,y,t,b){const h=r("v-text-field");return u(),s(h,{modelValue:t.dateValue,"onUpdate:modelValue":i[0]||(i[0]=p=>t.dateValue=p),label:t.label,style:o(m.computedStyle),type:"date","hide-details":""},null,8,["modelValue","label","style"])}const f=d("default",a(e,[["render",c]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./main-578bc0655a22d2a15a27.js","vue"],function(C,F){"use strict";var V,L,m,d,r,e,t,v,s,_,h,g,k,w;return{setters:[o=>{V=o.d,L=o.P},o=>{m=o.resolveComponent,d=o.createBlock,r=o.openBlock,e=o.withCtx,t=o.createVNode,v=o.createElementVNode,s=o.createTextVNode,_=o.toDisplayString,h=o.createCommentVNode,g=o.createElementBlock,k=o.Fragment,w=o.renderList}],execute:function(){const o={props:{type:{default:"tlm",validator:function(u){return["cmd","tlm"].indexOf(u)!==-1}},targetName:String,packetName:String,itemName:String,modelValue:Boolean},data(){return{details:Object,updater:null,rawValue:null,convertedValue:null,formattedValue:null,unitsValue:null}},computed:{show:{get(){return this.modelValue},set(u){this.$emit("update:modelValue",u)}}},watch:{modelValue:function(u,a){u?(this.requestDetails(),this.type==="tlm"&&(this.updater=setInterval(()=>{this.api.get_tlm_values([`${this.targetName}__${this.packetName}__${this.itemName}__RAW`,`${this.targetName}__${this.packetName}__${this.itemName}__CONVERTED`,`${this.targetName}__${this.packetName}__${this.itemName}__FORMATTED`,`${this.targetName}__${this.packetName}__${this.itemName}__WITH_UNITS`]).then(c=>{for(let p of c){let i=null;if(p[0].json_class==="String"&&p[0].raw!==void 0?i=p[0].raw:this.details.data_type==="BLOCK"&&(i=p[0]),i!==null){i=i.slice(0,parseInt(this.details.bit_size)/8);let b=!1;i.length>64&&(b=!0),p[0]=Array.from(i.slice(0,64),function(N){return N===" "?"20":("0"+(N&255).toString(16)).slice(-2)}).join(" ").toUpperCase(),b&&(p[0]+="...")}}this.details.data_type.includes("INT")&&!this.details.array_size?this.rawValue=`${c[0][0]} (0x${c[0][0].toString(16).toUpperCase()})`:this.rawValue=c[0][0],this.convertedValue=c[1][0],this.formattedValue=c[2][0],this.unitsValue=c[3][0]})},1e3))):(clearInterval(this.updater),this.updater=null)}},created(){this.api=new L},beforeUnmount(){clearInterval(this.updater),this.updater=null},methods:{hasLimits(u){let a=!1;return u.limits.DEFAULT&&(a=!0),u.states&&Object.getOwnPropertyNames(u.states).forEach(c=>{u.states[c].color&&(a=!0)}),a},async requestDetails(){this.type==="tlm"?await this.api.get_item(this.targetName,this.packetName,this.itemName).then(u=>{this.details=u,this.hasLimits(u)||(this.details.limits=null)}):await this.api.get_parameter(this.targetName,this.packetName,this.itemName).then(u=>{this.details=u})},async changeLimitsEnabled(){this.details.limits.enabled?await this.api.enable_limits(this.targetName,this.packetName,this.itemName):await this.api.disable_limits(this.targetName,this.packetName,this.itemName)},formatLimit(u){return u.hasOwnProperty("green_low")?"RL/"+u.red_low+" YL/"+u.yellow_low+" YH/"+u.yellow_high+" RH/"+u.red_high+" GL/"+u.green_low+" GH/"+u.green_high:u.hasOwnProperty("red_low")?"RL/"+u.red_low+" YL/"+u.yellow_low+" YH/"+u.yellow_high+" RH/"+u.red_high:u}}},S={key:5},$={key:7},E={key:3},x={key:9};function B(u,a,c,p,i,b){const N=m("v-spacer"),D=m("v-toolbar"),T=m("v-card-title"),U=m("v-card-subtitle"),l=m("v-col"),n=m("v-row"),I=m("v-switch"),O=m("v-container"),R=m("v-card-text"),P=m("v-card"),z=m("v-dialog");return r(),d(z,{modelValue:b.show,"onUpdate:modelValue":a[1]||(a[1]=y=>b.show=y),width:"700"},{default:e(()=>[t(P,null,{default:e(()=>[t(D,{height:24},{default:e(()=>[t(N),a[2]||(a[2]=v("span",null," Details ",-1)),t(N)]),_:1,__:[2]}),t(T,null,{default:e(()=>[s(_(c.targetName)+" "+_(c.packetName)+" "+_(c.itemName),1)]),_:1}),t(U,null,{default:e(()=>[s(_(i.details.description),1)]),_:1}),t(R,null,{default:e(()=>[t(O,{fluid:""},{default:e(()=>[c.type==="tlm"?(r(),d(n,{key:0,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[3]||(a[3]=[s("Item Values",-1)])),_:1,__:[3]}),t(l)]),_:1})):h("",!0),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>a[4]||(a[4]=[s("Raw Value",-1)])),_:1,__:[4]}),t(l,null,{default:e(()=>[s(_(i.rawValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>a[5]||(a[5]=[s("Converted Value",-1)])),_:1,__:[5]}),t(l,null,{default:e(()=>[s(_(i.convertedValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>a[6]||(a[6]=[s("Formatted Value",-1)])),_:1,__:[6]}),t(l,null,{default:e(()=>[s(_(i.formattedValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>a[7]||(a[7]=[s("With Units Value",-1)])),_:1,__:[7]}),t(l,null,{default:e(()=>[s(_(i.unitsValue),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[8]||(a[8]=[s("Bit Offset",-1)])),_:1,__:[8]}),t(l,null,{default:e(()=>[s(_(i.details.bit_offset),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[9]||(a[9]=[s("Bit Size",-1)])),_:1,__:[9]}),t(l,null,{default:e(()=>[s(_(i.details.bit_size),1)]),_:1})]),_:1}),i.details.array_size?(r(),d(n,{key:1,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[10]||(a[10]=[s("Array Size",-1)])),_:1,__:[10]}),t(l,null,{default:e(()=>[s(_(i.details.array_size),1)]),_:1})]),_:1})):h("",!0),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[11]||(a[11]=[s("Data Type",-1)])),_:1,__:[11]}),t(l,null,{default:e(()=>[s(_(i.details.data_type),1)]),_:1})]),_:1}),c.type==="cmd"?(r(),d(n,{key:2,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[12]||(a[12]=[s("Minimum",-1)])),_:1,__:[12]}),t(l,null,{default:e(()=>[s(_(i.details.minimum),1)]),_:1})]),_:1})):h("",!0),c.type==="cmd"?(r(),d(n,{key:3,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[13]||(a[13]=[s("Maximum",-1)])),_:1,__:[13]}),t(l,null,{default:e(()=>[s(_(i.details.maximum),1)]),_:1})]),_:1})):h("",!0),c.type==="cmd"?(r(),d(n,{key:4,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[14]||(a[14]=[s("Default",-1)])),_:1,__:[14]}),t(l,null,{default:e(()=>[s(_(i.details.default),1)]),_:1})]),_:1})):h("",!0),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[15]||(a[15]=[s("Format String",-1)])),_:1,__:[15]}),t(l,null,{default:e(()=>[s(_(i.details.format_string),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[16]||(a[16]=[s("Read Conversion",-1)])),_:1,__:[16]}),i.details.read_conversion?(r(),d(l,{key:0},{default:e(()=>[s(" Class: "+_(i.details.read_conversion.class)+" ",1),a[17]||(a[17]=v("br",null,null,-1)),s(" Params: "+_(i.details.read_conversion.params),1)]),_:1,__:[17]})):(r(),d(l,{key:1}))]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[18]||(a[18]=[s("Write Conversion",-1)])),_:1,__:[18]}),i.details.write_conversion?(r(),d(l,{key:0},{default:e(()=>[s(" Class: "+_(i.details.write_conversion.class)+" ",1),a[19]||(a[19]=v("br",null,null,-1)),s(" Params: "+_(i.details.write_conversion.params),1)]),_:1,__:[19]})):(r(),d(l,{key:1}))]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[20]||(a[20]=[s("Id Value",-1)])),_:1,__:[20]}),t(l,null,{default:e(()=>[s(_(i.details.id_value),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[21]||(a[21]=[s("Units Full",-1)])),_:1,__:[21]}),t(l,null,{default:e(()=>[s(_(i.details.units_full),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[22]||(a[22]=[s("Units Abbr",-1)])),_:1,__:[22]}),t(l,null,{default:e(()=>[s(_(i.details.units),1)]),_:1})]),_:1}),t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[23]||(a[23]=[s("Endianness",-1)])),_:1,__:[23]}),t(l,null,{default:e(()=>[s(_(i.details.endianness),1)]),_:1})]),_:1}),i.details.states?(r(),g("div",S,[t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[24]||(a[24]=[s("States",-1)])),_:1,__:[24]}),t(l)]),_:1}),(r(!0),g(k,null,w(i.details.states,(y,f)=>(r(),d(n,{key:f,"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[s(_(f),1)]),_:2},1024),t(l,null,{default:e(()=>[s(_(y.value),1)]),_:2},1024)]),_:2},1024))),128))])):(r(),d(n,{key:6,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[25]||(a[25]=[s("States",-1)])),_:1,__:[25]}),t(l,null,{default:e(()=>a[26]||(a[26]=[s("None",-1)])),_:1,__:[26]})]),_:1})),i.details.limits?(r(),g("div",$,[t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[27]||(a[27]=[s("Limits",-1)])),_:1,__:[27]}),t(l)]),_:1}),(r(!0),g(k,null,w(i.details.limits,(y,f)=>(r(),d(n,{key:f,"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),f==="enabled"?(r(),d(l,{key:0,cols:"4",class:"label"},{default:e(()=>a[28]||(a[28]=[s("Enabled",-1)])),_:1,__:[28]})):h("",!0),f==="enabled"?(r(),d(I,{key:1,modelValue:i.details.limits.enabled,"onUpdate:modelValue":[a[0]||(a[0]=A=>i.details.limits.enabled=A),b.changeLimitsEnabled],density:"compact",color:"primary",class:"compact-switch","hide-details":""},null,8,["modelValue","onUpdate:modelValue"])):h("",!0),f!=="enabled"?(r(),d(l,{key:2,cols:"4",class:"label"},{default:e(()=>[s(_(f),1)]),_:2},1024)):h("",!0),f!=="enabled"?(r(),g("div",E,_(b.formatLimit(y)),1)):h("",!0),t(l)]),_:2},1024))),128))])):(r(),d(n,{key:8,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[29]||(a[29]=[s("Limits",-1)])),_:1,__:[29]}),t(l,null,{default:e(()=>a[30]||(a[30]=[s("None",-1)])),_:1,__:[30]})]),_:1})),i.details.meta?(r(),g("div",x,[t(n,{"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[31]||(a[31]=[s("Meta",-1)])),_:1,__:[31]}),t(l)]),_:1}),(r(!0),g(k,null,w(i.details.meta,(y,f)=>(r(),d(n,{key:f,"no-gutters":""},{default:e(()=>[t(l,{cols:"1"}),t(l,{cols:"4",class:"label"},{default:e(()=>[s(_(f),1)]),_:2},1024),t(l,null,{default:e(()=>[s(_(y.join(", ")),1)]),_:2},1024)]),_:2},1024))),128))])):(r(),d(n,{key:10,"no-gutters":""},{default:e(()=>[t(l,{cols:"5",class:"label"},{default:e(()=>a[32]||(a[32]=[s("Meta",-1)])),_:1,__:[32]}),t(l,null,{default:e(()=>a[33]||(a[33]=[s("None",-1)])),_:1,__:[33]})]),_:1}))]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const j=C("P",V(o,[["render",B],["__scopeId","data-v-6065a19b"]]))}}});
@@ -1 +0,0 @@
1
- System.register(["vue","./main-578bc0655a22d2a15a27.js","vue-router","single-spa","vuex","vuetify"],function(a,p){"use strict";var t,n,r,o,i,s;return{setters:[e=>{t=e.createBlock,n=e.openBlock,r=e.resolveDynamicComponent,o=e.normalizeProps,i=e.guardReactiveProps},e=>{s=e.d},null,null,null,null],execute:function(){const e={data(){return{widgetType:null}},props:{name:{default:null}},computed:{url:function(){return`${window.location.origin}/tools/widgets/${this.name}/${this.name}.umd.min.js`}},async mounted(){try{this.widgetType=await System.import(this.url)}catch{throw new Error(`Unknown widget: ${this.name}`)}}};function l(u,d,w,g,c,y){return n(),t(r(c.widgetType),o(i({...u.$props,...u.$attrs})),null,16)}const m=a("default",s(e,[["render",l]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","./ValueWidget-B-TWLPdM-a0619bd9fba60a01325e.js","vue","./main-578bc0655a22d2a15a27.js","./DetailsDialog-DRVahE5z-512cc119f31f149412d0.js","single-spa","./VWidget-CFTCukCL-2fbce8873b42f7e67ae0.js","vue-router","vuex","vuetify"],function(m,v){"use strict";var r,s,n,a,l,i,o,c,u;return{setters:[e=>{r=e.o},e=>{s=e.default},e=>{n=e.resolveComponent,a=e.createElementBlock,l=e.openBlock,i=e.normalizeStyle,o=e.createVNode,c=e.mergeProps},e=>{u=e.d},null,null,null,null,null,null],execute:function(){const p={components:{ValueWidget:s},mixins:[r],computed:{getParameters(){return[this.parameters[0],this.parameters[1],this.parameters[2],this.parameters[4]]}},created(){this.setWidth(parseInt(this.parameters[5])+4,"ch",16)}};function g(t,y,V,B,C,d){const f=n("value-widget");return l(),a("div",{ref:"container",class:"d-flex flex-row",style:i(t.computedStyle)},[o(f,c(t.$attrs,{parameters:d.getParameters,settings:t.appliedSettings,"screen-values":t.screenValues,"screen-time-zone":t.screenTimeZone,"format-string":t.parameters[3]}),null,16,["parameters","settings","screen-values","screen-time-zone","format-string"])],4)}const h=m("default",u(p,[["render",g]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./main-578bc0655a22d2a15a27.js","vue"],function(Q,Ve){"use strict";var E,G,X,A,R,ee,W,H,B,o,C,g,K,s,N,k,n,M,q,I,P,V,$,v,te,ie,Z,ae,se;return{setters:[p=>{E=p.d,G=p.R,X=p.B,A=p.b,R=p.P,ee=p.N,W=p.l,H=p.$,B=p.c},p=>{o=p.resolveComponent,C=p.createElementBlock,g=p.openBlock,K=p.withModifiers,s=p.createVNode,N=p.createBlock,k=p.createCommentVNode,n=p.withCtx,M=p.withDirectives,q=p.normalizeClass,I=p.createElementVNode,P=p.vShow,V=p.toDisplayString,$=p.Fragment,v=p.createTextVNode,te=p.normalizeProps,ie=p.guardReactiveProps,Z=p.withKeys,ae=p.renderList,se=p.createSlots}],execute:function(){const p={props:{allowAll:{type:Boolean,default:!1},allowAllTargets:{type:Boolean,default:!1},allowAllArrayIndex:{type:Boolean,default:!1},buttonText:{type:String,default:null},chooseItem:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},initialTargetName:{type:String,default:""},initialPacketName:{type:String,default:""},initialItemName:{type:String,default:""},selectTypes:{type:Boolean,default:!1},showLatest:{type:Boolean,default:!1},mode:{type:String,default:"tlm",validator:t=>["cmd","tlm"].includes(t)},unknown:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},hidden:{type:Boolean,default:!1},lockTarget:{type:Boolean,default:!1},lockPacket:{type:Boolean,default:!1}},emits:["on-set","addItem"],data(){var t,e,i;return{targetNames:[],selectedTargetName:(t=this.initialTargetName)==null?void 0:t.toUpperCase(),packetNames:[],selectedPacketName:(e=this.initialPacketName)==null?void 0:e.toUpperCase(),itemNames:[],selectedItemName:(i=this.initialItemName)==null?void 0:i.toUpperCase(),valueTypes:["CONVERTED","RAW"],selectedValueType:"CONVERTED",reductionModes:[{title:"NONE",value:"DECOM"},{title:"REDUCED_MINUTE",value:"REDUCED_MINUTE"},{title:"REDUCED_HOUR",value:"REDUCED_HOUR"},{title:"REDUCED_DAY",value:"REDUCED_DAY"}],selectedArrayIndex:null,selectedReduced:"DECOM",reducedTypes:["MIN","MAX","AVG","STDDEV"],selectedReducedType:"AVG",description:"",hazardous:!1,internalDisabled:!1,packetsDisabled:!1,itemsDisabled:!1,api:null,ALL:{label:"[ ALL ]",value:"ALL",description:"ALL"},UNKNOWN:{label:"[ UNKNOWN ]",value:"UNKNOWN",description:"UNKNOWN"}}},computed:{actualButtonText:function(){return this.selectedPacketName==="ALL"?"Add Target":this.selectedItemName==="ALL"?"Add Packet":this.buttonText},autocompleteDisabled:function(){return this.disabled||this.internalDisabled},buttonDisabled:function(){return this.disabled||this.internalDisabled||this.selectedTargetName===null||this.selectedPacketName===null||this.selectedItemNameWIndex===null},colSize:function(){return this.vertical?12:!1},selectedItemNameWIndex:function(){return this.itemIsArray&&this.selectedArrayIndex!==null&&this.selectedArrayIndex!==this.ALL.label?`${this.selectedItemName}[${this.selectedArrayIndex}]`:this.selectedItemName},includeLatestPacketInDropdown:function(){return this.showLatest&&this.mode==="tlm"},arrayIndexes:function(){let t=this.itemNames.findIndex(i=>i.value===this.selectedItemName),e=[...Array(this.itemNames[t].array).keys()];return(this.allowAll||this.allowAllArrayIndex)&&e.unshift(this.ALL.label),e},itemIsArray:function(){let t=this.itemNames.findIndex(e=>e.value===this.selectedItemName);return!(t===-1||isNaN(this.itemNames[t].array))}},watch:{initialTargetName:function(t){t&&(this.selectedTargetName=t.toUpperCase())},initialPacketName:function(t){t&&(this.selectedPacketName=t.toUpperCase())},initialItemName:function(t){t&&(this.selectedItemName=t.toUpperCase())},mode:function(t,e){this.selectedPacketName=null,this.selectedItemName=null,this.targetNameChanged(this.selectedTargetName)},chooseItem:function(t,e){t?this.updateItems():this.itemNames=[]},itemIsArray:function(t){t?this.selectedArrayIndex||(this.selectedArrayIndex=0):this.selectedArrayIndex=null}},created(){this.internalDisabled=!0,this.api=new R,this.api.get_target_names().then(t=>{this.targetNames=t.flatMap(e=>e=="UNKNOWN"?[]:{label:e,value:e}),this.allowAllTargets&&this.targetNames.unshift(this.ALL),this.selectedTargetName?this.updatePackets():(this.selectedTargetName=this.targetNames[0].value,this.targetNameChanged(this.selectedTargetName)),this.unknown&&this.targetNames.push(this.UNKNOWN)})},methods:{updatePackets:function(){if(this.selectedTargetName==="UNKNOWN"){this.packetNames=[this.UNKNOWN],this.selectedPacketName=this.packetNames[0].value,this.updatePacketDetails(this.UNKNOWN.value),this.description="UNKNOWN";return}if(this.selectedTargetName==="ALL"){this.packetNames=[this.ALL],this.selectedPacketName=this.packetNames[0].value,this.updatePacketDetails(this.ALL.value),this.description="ALL";return}this.internalDisabled=!0;const t=this.mode==="tlm"?"get_all_tlm_names":"get_all_cmd_names";this.api[t](this.selectedTargetName,this.hidden).then(e=>{this.packetNames=e.map(i=>({label:i,value:i})),this.allowAll&&this.packetNames.unshift(this.ALL),this.selectedPacketName||(this.packetNames.length===0?this.selectedPacketName=null:this.selectedPacketName=this.packetNames[0].value),this.updatePacketDetails(this.selectedPacketName),this.packetNames.find(i=>i.value===this.selectedPacketName)&&this.chooseItem&&this.updateItems(),this.internalDisabled=!1})},updateItems:function(){if(this.selectedPacketName!=="ALL")if(this.internalDisabled=!0,this.selectedPacketName==="LATEST")this.api.get_all_tlm_item_names(this.selectedTargetName).then(t=>{this.itemNames=t.map(e=>({label:e,value:e,description:`LATEST ${e}`})),this.finishUpdateItems()});else{const t=this.mode==="tlm"?"get_tlm":"get_cmd";this.api[t](this.selectedTargetName,this.selectedPacketName).then(e=>{this.itemNames=e.items.map(i=>{let d=i.name;return i.data_type=="DERIVED"&&(d+=" *"),{label:d,value:i.name,description:i.description,array:i.array_size/i.bit_size}}),this.itemNames.sort((i,d)=>i.label>d.label?1:-1),this.finishUpdateItems()})}},finishUpdateItems:function(){this.allowAll&&this.itemNames.unshift(this.ALL),this.selectedItemName||(this.selectedItemName=this.itemNames[0].value),this.description=this.itemNames[0].description,this.$emit("on-set",{targetName:this.selectedTargetName,packetName:this.selectedPacketName,itemName:this.selectedItemNameWIndex,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType}),this.internalDisabled=!1},targetNameChanged:function(t){this.selectedTargetName=t,this.selectedPacketName="",this.selectedItemName="",t!==null&&this.updatePackets()},packetNameChanged:function(t){this.selectedItemName="",t!==null&&this.updatePacketDetails(t)},updatePacketDetails:function(t){if(t==="ALL")this.itemsDisabled=!0,this.internalDisabled=!1;else if(t==="LATEST")this.itemsDisabled=!1,this.selectedPacketName="LATEST";else{this.itemsDisabled=!1;const e=this.packetNames.find(i=>t===i.value);if(e){this.selectedPacketName=e.value;const i=this.mode==="tlm"?"get_tlm":"get_cmd";this.api[i](this.selectedTargetName,this.selectedPacketName).then(d=>{this.description=d.description,this.hazardous=d.hazardous})}}this.chooseItem?this.updateItems():this.$emit("on-set",{targetName:this.selectedTargetName,packetName:this.selectedPacketName,itemName:this.selectedItemNameWIndex,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType})},itemNameChanged:function(t){const e=this.itemNames.find(i=>t===i.value);e&&(this.selectedItemName=e.value,this.description=e.description,this.$emit("on-set",{targetName:this.selectedTargetName,packetName:this.selectedPacketName,itemName:this.selectedItemNameWIndex,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType}))},indexChanged:function(t){this.$emit("on-set",{targetName:this.selectedTargetName,packetName:this.selectedPacketName,itemName:this.selectedItemNameWIndex,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType})},buttonPressed:function(){this.selectedPacketName==="ALL"?this.allTargetPacketItems():this.selectedItemName==="ALL"?this.allPacketItems():this.chooseItem?this.$emit("addItem",{targetName:this.selectedTargetName,packetName:this.selectedPacketName,itemName:this.selectedItemNameWIndex,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType}):this.$emit("addItem",{targetName:this.selectedTargetName,packetName:this.selectedPacketName,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType})},allTargetPacketItems:function(){this.packetNames.forEach(t=>{if(t===this.ALL)return;const e=this.mode==="tlm"?"get_tlm":"get_cmd";this.api[e](this.selectedTargetName,t.value).then(i=>{i.items.forEach(d=>{this.$emit("addItem",{targetName:this.selectedTargetName,packetName:t.value,itemName:d.name,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType})})})})},allPacketItems:function(){this.itemNames.forEach(t=>{t!==this.ALL&&this.$emit("addItem",{targetName:this.selectedTargetName,packetName:this.selectedPacketName,itemName:t.value,valueType:this.selectedValueType,reduced:this.selectedReduced,reducedType:this.selectedReducedType})})}}},ne={class:"pt-4 pb-4"};function de(t,e,i,d,a,l){const r=o("v-autocomplete"),h=o("v-col"),b=o("v-list-item"),f=o("v-divider"),x=o("v-combobox"),_=o("v-btn"),T=o("v-row");return g(),C("div",ne,[s(T,{"no-gutters":!i.vertical},{default:n(()=>[s(h,{cols:l.colSize,class:"tpic-select pr-4","data-test":"select-target"},{default:n(()=>[s(r,{modelValue:a.selectedTargetName,"onUpdate:modelValue":[e[0]||(e[0]=m=>a.selectedTargetName=m),l.targetNameChanged],label:"Select Target","hide-details":"",density:"compact",variant:"outlined",disabled:l.autocompleteDisabled||i.lockTarget,items:a.targetNames,"item-title":"label","item-value":"value"},null,8,["modelValue","disabled","items","onUpdate:modelValue"])]),_:1},8,["cols"]),s(h,{cols:l.colSize,class:"tpic-select pr-4","data-test":"select-packet"},{default:n(()=>[s(r,{modelValue:a.selectedPacketName,"onUpdate:modelValue":[e[2]||(e[2]=m=>a.selectedPacketName=m),l.packetNameChanged],label:"Select Packet","hide-details":"",density:"compact",variant:"outlined",disabled:a.packetsDisabled||l.autocompleteDisabled||i.lockPacket,items:a.packetNames,"item-title":"label","item-value":"value"},se({_:2},[l.includeLatestPacketInDropdown?{name:"prepend-item",fn:n(()=>[s(b,{title:"LATEST",onClick:e[1]||(e[1]=m=>l.packetNameChanged("LATEST"))}),s(f)]),key:"0"}:void 0]),1032,["modelValue","disabled","items","onUpdate:modelValue"])]),_:1},8,["cols"]),i.chooseItem?(g(),N(h,{key:0,cols:l.colSize,class:"tpic-select pr-4","data-test":"select-item"},{default:n(()=>[s(r,{modelValue:a.selectedItemName,"onUpdate:modelValue":[e[3]||(e[3]=m=>a.selectedItemName=m),e[4]||(e[4]=m=>l.itemNameChanged(m))],label:"Select Item","hide-details":"",density:"compact",variant:"outlined",disabled:a.itemsDisabled||l.autocompleteDisabled,items:a.itemNames,"item-title":"label","item-value":"value"},null,8,["modelValue","disabled","items"])]),_:1},8,["cols"])):k("",!0),i.chooseItem&&l.itemIsArray?(g(),N(h,{key:1,cols:"1",class:"tpic-select pr-4","data-test":"array-index",style:{"min-width":"105px"}},{default:n(()=>[s(x,{modelValue:a.selectedArrayIndex,"onUpdate:modelValue":[e[5]||(e[5]=m=>a.selectedArrayIndex=m),e[6]||(e[6]=m=>l.indexChanged(m))],label:"Index","hide-details":"",density:"compact",variant:"outlined",disabled:a.itemsDisabled||l.autocompleteDisabled,items:l.arrayIndexes,"item-title":"label","item-value":"value"},null,8,["modelValue","disabled","items"])]),_:1})):k("",!0),i.buttonText?(g(),N(h,{key:2,cols:l.colSize,style:{"max-width":"140px"}},{default:n(()=>[s(_,{disabled:l.buttonDisabled,color:"primary","data-test":"select-send",onClick:l.buttonPressed},{default:n(()=>[v(V(l.actualButtonText),1)]),_:1},8,["disabled","onClick"])]),_:1},8,["cols"])):k("",!0)]),_:1},8,["no-gutters"]),i.selectTypes?(g(),N(T,{key:0,class:"pt-6","no-gutters":""},{default:n(()=>[s(h,{cols:l.colSize,class:"tpic-select pr-4","data-test":"data-type"},{default:n(()=>[s(r,{modelValue:a.selectedValueType,"onUpdate:modelValue":e[7]||(e[7]=m=>a.selectedValueType=m),label:"Value Type","hide-details":"",density:"compact",variant:"outlined",items:a.valueTypes},null,8,["modelValue","items"])]),_:1},8,["cols"]),s(h,{cols:l.colSize,class:"tpic-select pr-4","data-test":"reduced"},{default:n(()=>[s(r,{modelValue:a.selectedReduced,"onUpdate:modelValue":e[8]||(e[8]=m=>a.selectedReduced=m),label:"Reduced","hide-details":"",density:"compact",variant:"outlined",items:a.reductionModes},null,8,["modelValue","items"])]),_:1},8,["cols"]),s(h,{cols:l.colSize,class:"tpic-select pr-4","data-test":"reduced-type"},{default:n(()=>[s(r,{modelValue:a.selectedReducedType,"onUpdate:modelValue":e[9]||(e[9]=m=>a.selectedReducedType=m),label:"Reduced Type","hide-details":"",density:"compact",variant:"outlined",disabled:a.selectedReduced==="DECOM",items:a.reducedTypes},null,8,["modelValue","disabled","items"])]),_:1},8,["cols"]),s(h,{cols:l.colSize,style:{"max-width":"140px"}},null,8,["cols"])]),_:1})):k("",!0),s(T,{"no-gutters":"",class:"pa-3"},{default:n(()=>[s(h,{cols:l.colSize,class:q({"openc3-yellow":a.hazardous})},{default:n(()=>[v(" Description: "+V(a.description)+" ",1),a.hazardous?(g(),C($,{key:0},[v(" (HAZARDOUS) ")],64)):k("",!0)]),_:1},8,["cols","class"])]),_:1})])}const re=Q("r",E(p,[["render",de],["__scopeId","data-v-fe1b8081"]])),oe={components:{TargetPacketItemChooser:re},mixins:[G],props:{modelValue:Boolean,title:{type:String,required:!0},legendPosition:{type:String,required:!0},items:{type:Array,required:!0},graphMinY:{type:Number},graphMaxY:{type:Number},lines:{type:Array,required:!0},colors:{type:Array,required:!0},startDateTime:{type:Number},endDateTime:{type:Number},timeZone:{type:String,required:!0},xAxisItemPacket:{type:Object,default:void 0},xAxisItem:{type:String,default:"__time"}},emits:["cancel","ok","remove","update:modelValue","update:xAxisItem"],data:function(){return{tab:0,graph:{},customXAxisEnabled:!1,selectedXAxisItem:null,pendingXAxisSelection:null,legendPositions:["top","bottom","left","right"],startDate:null,startTime:null,endDate:null,endTime:null,lineHeaders:[{title:"Y Value",value:"yValue"},{title:"Color",value:"color"},{title:"Actions",value:"actions",sortable:!1}],itemHeaders:[{title:"Target Name",value:"targetName"},{title:"Packet Name",value:"packetName"},{title:"Item Name",value:"itemName"},{title:"Actions",value:"actions",sortable:!1}],rules:{date:t=>{if(!t)return!0;try{return H(B(t,"yyyy-MM-dd",new Date))||"Invalid date (YYYY-MM-DD)"}catch{return"Invalid date (YYYY-MM-DD)"}},time:t=>{if(!t)return!0;try{return H(B(t,"HH:mm:ss",new Date))||"Invalid time (HH:MM:SS)"}catch{return"Invalid time (HH:MM:SS)"}}}}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},editItems:function(){if(!this.items)return[];let t=0;return this.items.map(e=>(t+=1,{...e,itemId:t}))},initialXAxisItem:function(){if(this.xAxisItem!=="__time")return this.xAxisItem.split("__").at(4)}},created(){if(this.graph={title:this.title,legendPosition:this.legendPosition,items:this.items,graphMinY:this.graphMinY,graphMaxY:this.graphMaxY,lines:[...this.lines]},this.customXAxisEnabled=this.xAxisItem&&this.xAxisItem!=="__time",this.selectedXAxisItem=this.xAxisItem,this.startDateTime){let t=W(this.startDateTime/1e6);this.startDate=this.formatDate(t,this.timeZone),this.startTime=this.formatTimeHMS(t,this.timeZone)}else{let t=new Date-36e5;this.startDate=this.formatDate(t,this.timeZone),this.startTime=this.formatTimeHMS(t,this.timeZone)}if(this.endDateTime){let t=W(this.endDateTime/1e6);this.endDate=this.formatDate(t,this.timeZone),this.endTime=this.formatTimeHMS(t,this.timeZone)}},methods:{closeOk(){this.startDate&&this.startTime?this.graph.startDateTime=this.startDate+" "+this.startTime:this.graph.startDateTime=null,this.endDate&&this.endTime?this.graph.endDateTime=this.endDate+" "+this.endTime:this.graph.endDateTime=null,this.$emit("ok",this.graph)},addLine(){this.graph.lines.push({yValue:0,color:"white"})},removeLine(t){let e=this.graph.lines.indexOf(t);this.graph.lines.splice(e,1)},customXAxisToggled(t){t||(this.selectedXAxisItem="__time",this.$emit("update:xAxisItem","__time"))},xAxisItemChanged(t){this.pendingXAxisSelection=t},xAxisItemSelected(t){if(t.targetName&&t.packetName&&t.itemName){const e=`DECOM__TLM__${t.targetName}__${t.packetName}__${t.itemName}__CONVERTED`;this.selectedXAxisItem=e,this.$emit("update:xAxisItem",e)}}}},he={class:"edit-box"},ce={class:"edit-box"},me={class:"edit-box"},ue={class:"edit-box"},pe={class:"edit-box"};function fe(t,e,i,d,a,l){const r=o("v-spacer"),h=o("v-toolbar"),b=o("v-tab"),f=o("v-tabs"),x=o("v-text-field"),_=o("v-card-text"),T=o("v-col"),m=o("v-select"),y=o("v-row"),L=o("v-tabs-window-item"),D=o("v-btn"),w=o("v-list-item"),O=o("v-list"),U=o("v-checkbox"),j=o("target-packet-item-chooser"),F=o("v-data-table"),S=o("v-tabs-window"),J=o("v-card-actions"),u=o("v-card"),Ae=o("v-dialog");return g(),N(Ae,{modelValue:l.show,"onUpdate:modelValue":e[13]||(e[13]=c=>l.show=c),"max-width":"700",onKeydown:e[14]||(e[14]=Z(c=>t.$emit("cancel"),["esc"]))},{default:n(()=>[s(h,{height:"24"},{default:n(()=>[s(r),e[15]||(e[15]=I("span",null," Edit Graph ",-1)),s(r)]),_:1,__:[15]}),s(u,{class:"pa-3"},{default:n(()=>[s(f,{modelValue:t.tab,"onUpdate:modelValue":e[0]||(e[0]=c=>t.tab=c),class:"ml-3"},{default:n(()=>[s(b,{value:"0"},{default:n(()=>e[16]||(e[16]=[v(" Settings ",-1)])),_:1,__:[16]}),s(b,{value:"1"},{default:n(()=>e[17]||(e[17]=[v(" Scale / Lines ",-1)])),_:1,__:[17]}),s(b,{value:"2"},{default:n(()=>e[18]||(e[18]=[v(" Items ",-1)])),_:1,__:[18]})]),_:1},8,["modelValue"]),s(S,{modelValue:t.tab,"onUpdate:modelValue":e[11]||(e[11]=c=>t.tab=c)},{default:n(()=>[s(L,{value:"0",eager:""},{default:n(()=>[I("div",he,[s(y,null,{default:n(()=>[s(T,null,{default:n(()=>[s(_,{class:"pa-0"},{default:n(()=>[s(x,{modelValue:t.graph.title,"onUpdate:modelValue":e[1]||(e[1]=c=>t.graph.title=c),class:"pb-2",label:"Title","hide-details":""},null,8,["modelValue"])]),_:1})]),_:1}),s(T,null,{default:n(()=>[s(m,{modelValue:t.graph.legendPosition,"onUpdate:modelValue":e[2]||(e[2]=c=>t.graph.legendPosition=c),label:"Legend Position","hide-details":"",items:t.legendPositions,style:{"max-width":"280px"}},null,8,["modelValue","items"])]),_:1})]),_:1})]),I("div",ce,[s(_,{class:"pa-0"},{default:n(()=>e[19]||(e[19]=[v(" Select a start date/time for the graph. Leave blank for start now. ",-1)])),_:1,__:[19]}),s(y,null,{default:n(()=>[s(T,null,{default:n(()=>[s(x,{modelValue:t.startDate,"onUpdate:modelValue":e[3]||(e[3]=c=>t.startDate=c),label:"Start Date",name:`date${Date.now()}`,rules:[t.rules.date],type:"date"},null,8,["modelValue","name","rules"])]),_:1}),s(T,null,{default:n(()=>[s(x,{modelValue:t.startTime,"onUpdate:modelValue":e[4]||(e[4]=c=>t.startTime=c),label:"Start Time",name:`time${Date.now()}`,rules:[t.rules.time],type:"time",step:"1"},null,8,["modelValue","name","rules"])]),_:1})]),_:1}),s(_,{class:"pa-0"},{default:n(()=>e[20]||(e[20]=[v(" Select a end date/time for the graph. Leave blank for continuous real-time graphing. ",-1)])),_:1,__:[20]}),s(y,null,{default:n(()=>[s(T,null,{default:n(()=>[s(x,{modelValue:t.endDate,"onUpdate:modelValue":e[5]||(e[5]=c=>t.endDate=c),label:"End Date",name:`date${Date.now()}`,rules:[t.rules.date],type:"date"},null,8,["modelValue","name","rules"])]),_:1}),s(T,null,{default:n(()=>[s(x,{modelValue:t.endTime,"onUpdate:modelValue":e[6]||(e[6]=c=>t.endTime=c),label:"End Time",name:`time${Date.now()}`,rules:[t.rules.time],type:"time",step:"1"},null,8,["modelValue","name","rules"])]),_:1})]),_:1})])]),_:1}),s(L,{value:"1",eager:""},{default:n(()=>[I("div",me,[s(_,{class:"pa-0"},{default:n(()=>e[21]||(e[21]=[v(" Set a min or max Y value to override automatic scaling ",-1)])),_:1,__:[21]}),s(y,{dense:""},{default:n(()=>[s(T,{class:"px-2"},{default:n(()=>[s(x,{modelValue:t.graph.graphMinY,"onUpdate:modelValue":e[7]||(e[7]=c=>t.graph.graphMinY=c),"hide-details":"",label:"Min Y Axis (Optional)",type:"number"},null,8,["modelValue"])]),_:1}),s(T,{class:"px-2"},{default:n(()=>[s(x,{modelValue:t.graph.graphMaxY,"onUpdate:modelValue":e[8]||(e[8]=c=>t.graph.graphMaxY=c),"hide-details":"",label:"Max Y Axis (Optional)",type:"number"},null,8,["modelValue"])]),_:1})]),_:1})]),I("div",ue,[s(O,{density:"compact",class:"horizontal-lines"},{default:n(()=>[s(w,null,{default:n(()=>[e[23]||(e[23]=I("span",{style:{"padding-top":"5px"}}," Add horizontal lines to the graph ",-1)),s(r),s(D,{onClick:e[9]||(e[9]=c=>l.addLine())},{default:n(()=>e[22]||(e[22]=[v(" New Line ",-1)])),_:1,__:[22]})]),_:1,__:[23]}),(g(!0),C($,null,ae(t.graph.lines,(c,le)=>(g(),N(w,{key:le,value:c,color:"primary"},{default:n(()=>[s(y,null,{default:n(()=>[s(T,null,{default:n(()=>[s(x,{modelValue:c.yValue,"onUpdate:modelValue":Y=>c.yValue=Y,label:"Y Value"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),s(T,null,{default:n(()=>[s(m,{modelValue:c.color,"onUpdate:modelValue":Y=>c.color=Y,label:"Color","hide-details":"",items:i.colors},null,8,["modelValue","onUpdate:modelValue","items"])]),_:2},1024),s(T,null,{default:n(()=>[s(D,{style:{padding:"30px"},icon:"mdi-delete",variant:"text","aria-label":"Remove Line",onClick:Y=>l.removeLine(c)},null,8,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1})]),I("div",pe,[s(_,{class:"pa-0 text-medium-emphasis"},{default:n(()=>e[24]||(e[24]=[v(" Choose a different item to use for the graph's X axis. If unchecked, the graph will use the packet's PACKET_TIME item if it exists, otherwise it will use the system received time for the packet. ",-1)])),_:1,__:[24]}),s(U,{modelValue:t.customXAxisEnabled,"onUpdate:modelValue":[e[10]||(e[10]=c=>t.customXAxisEnabled=c),l.customXAxisToggled],disabled:!i.xAxisItemPacket,label:"Custom X axis item",density:"compact","hide-details":""},null,8,["modelValue","disabled","onUpdate:modelValue"]),i.xAxisItemPacket?k("",!0):(g(),N(_,{key:0,class:"pa-0 text-medium-emphasis"},{default:n(()=>e[25]||(e[25]=[v(" All items on the graph must be in the same packet to enable this feature. ",-1)])),_:1,__:[25]})),t.customXAxisEnabled&&i.xAxisItemPacket?(g(),N(j,{key:1,"initial-target-name":i.xAxisItemPacket.targetName,"initial-packet-name":i.xAxisItemPacket.packetName,"initial-item-name":l.initialXAxisItem,"choose-item":"","lock-target":"","lock-packet":"","button-text":"Set",onOnSet:l.xAxisItemChanged,onAddItem:l.xAxisItemSelected},null,8,["initial-target-name","initial-packet-name","initial-item-name","onOnSet","onAddItem"])):k("",!0)])]),_:1}),s(L,{value:"2",eager:""},{default:n(()=>[s(F,{"item-key":"itemId",class:"elevation-1 my-2","data-test":"edit-graph-items",headers:t.itemHeaders,items:l.editItems,"items-per-page":5,"footer-props":{"items-per-page-options":[5]}},{"item.actions":n(({item:c})=>[s(D,{icon:"mdi-delete",variant:"text","aria-label":"Remove Item",onClick:le=>t.$emit("remove",c)},null,8,["onClick"])]),"no-data":n(()=>e[26]||(e[26]=[I("span",null," Currently no items on this graph ",-1)])),_:1},8,["headers","items"])]),_:1})]),_:1},8,["modelValue"]),s(J,{class:"px-2"},{default:n(()=>[s(r),s(D,{variant:"outlined",onClick:e[12]||(e[12]=c=>t.$emit("cancel"))},{default:n(()=>e[27]||(e[27]=[v(" Cancel ",-1)])),_:1,__:[27]}),s(D,{variant:"flat",onClick:l.closeOk},{default:n(()=>e[28]||(e[28]=[v(" Ok ",-1)])),_:1,__:[28]},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])}const ge=E(oe,[["render",fe]]),ve={props:{modelValue:Boolean,item:{type:Object,required:!0},colors:{type:Array,required:!0}},emits:["cancel","changeColor","changeLimits","close","update:modelValue"],data:function(){return{editItem:null,limitsName:"NONE",limits:{NONE:[]},valueTypes:["CONVERTED","RAW"],reduction:[{title:"NONE",value:"DECOM"},{title:"REDUCED_MINUTE",value:"REDUCED_MINUTE"},{title:"REDUCED_HOUR",value:"REDUCED_HOUR"},{title:"REDUCED_DAY",value:"REDUCED_DAY"}],reducedTypes:["MIN","MAX","AVG","STDDEV"]}},computed:{show:{get(){return this.modelValue},set(t){this.$emit("update:modelValue",t)}},limitsNames(){return Object.keys(this.limits)}},async created(){this.editItem={...this.item},new R().get_item(this.item.targetName,this.item.packetName,this.item.itemName).then(t=>{for(const[e,i]of Object.entries(t.limits))Object.keys(i).includes("red_low")&&(this.limits[e]=Object.values(i));this.limitsName=Object.keys(this.limits).find(e=>this.limits[e]+""==this.editItem.limits+"")})}},ye={key:0},xe={class:"pa-3"};function Ne(t,e,i,d,a,l){const r=o("v-card-title"),h=o("v-select"),b=o("v-card-text"),f=o("v-spacer"),x=o("v-btn"),_=o("v-card-actions"),T=o("v-card"),m=o("v-dialog");return g(),N(m,{modelValue:l.show,"onUpdate:modelValue":e[9]||(e[9]=y=>l.show=y),width:"400",onKeydown:e[10]||(e[10]=Z(y=>t.success(),["enter"]))},{default:n(()=>[s(T,null,{default:n(()=>[s(r,{class:"mb-2"},{default:n(()=>e[11]||(e[11]=[v("Edit Item",-1)])),_:1,__:[11]}),s(b,null,{default:n(()=>[s(h,{modelValue:t.editItem.valueType,"onUpdate:modelValue":e[0]||(e[0]=y=>t.editItem.valueType=y),variant:"outlined","hide-details":"",label:"Value Type",items:t.valueTypes,class:"mb-2"},null,8,["modelValue","items"]),s(h,{modelValue:t.editItem.reduced,"onUpdate:modelValue":e[1]||(e[1]=y=>t.editItem.reduced=y),variant:"outlined","hide-details":"",label:"Reduction",items:t.reduction,class:"mb-2"},null,8,["modelValue","items"]),s(h,{modelValue:t.editItem.reducedType,"onUpdate:modelValue":e[2]||(e[2]=y=>t.editItem.reducedType=y),variant:"outlined","hide-details":"",label:"Reduced Type",items:t.reducedTypes,disabled:t.editItem.reduced==="DECOM",class:"mb-2"},null,8,["modelValue","items","disabled"]),s(h,{modelValue:t.editItem.color,"onUpdate:modelValue":[e[3]||(e[3]=y=>t.editItem.color=y),e[4]||(e[4]=y=>t.$emit("changeColor",y))],variant:"outlined","hide-details":"",label:"Color",items:i.colors,class:"mb-2"},null,8,["modelValue","items"]),l.limitsNames.length>1?(g(),C("div",ye,[s(h,{modelValue:t.limitsName,"onUpdate:modelValue":[e[5]||(e[5]=y=>t.limitsName=y),e[6]||(e[6]=y=>t.$emit("changeLimits",t.limits[t.limitsName]))],variant:"outlined","hide-details":"",label:"Display Limits",items:l.limitsNames},null,8,["modelValue","items"]),I("div",xe,V(t.limitsName)+": "+V(t.limits[t.limitsName]),1)])):k("",!0)]),_:1}),s(_,{class:"px-2"},{default:n(()=>[s(f),s(x,{variant:"outlined",onClick:e[7]||(e[7]=y=>t.$emit("cancel"))},{default:n(()=>e[12]||(e[12]=[v(" Cancel ",-1)])),_:1,__:[12]}),s(x,{variant:"flat",onClick:e[8]||(e[8]=y=>t.$emit("close",t.editItem))},{default:n(()=>e[13]||(e[13]=[v(" Ok ",-1)])),_:1,__:[13]})]),_:1})]),_:1})]),_:1},8,["modelValue"])}const be=E(ve,[["render",Ne]]),z="__time",Te={components:{GraphEditDialog:ge,GraphEditItemDialog:be},mixins:[G],props:{id:{type:Number,required:!0},selectedGraphId:{type:Number,default:null},state:{type:String,required:!0},startTime:{type:Number,default:null},secondsGraphed:{type:Number,required:!0},pointsSaved:{type:Number,required:!0},pointsGraphed:{type:Number,required:!0},refreshIntervalMs:{type:Number,default:200},hideToolbar:{type:Boolean,default:!1},hideOverview:{type:Boolean,default:!1},sparkline:{type:Boolean,default:!1},initialItems:{type:Array,default:()=>[]},initialXAxisItem:{type:String,default:z},height:{type:Number,default:null},width:{type:Number,default:null},timeZone:{type:String,default:"local"}},emits:["click","close-graph","edit","min-max-graph","pause","resize","start","started"],data(){return{api:null,lines:[],active:!0,expand:!0,fullWidth:!0,fullHeight:!0,graph:null,editGraph:!1,editGraphMenu:!1,editGraphMenuX:0,editGraphMenuY:0,editItem:!1,itemMenu:!1,itemMenuX:0,itemMenuY:0,legendMenu:!1,legendMenuX:0,legendMenuY:0,legendPosition:"bottom",selectedItem:null,hideToolbarData:this.hideToolbar,showOverview:!this.hideOverview,hideOverviewData:this.hideOverview,title:"",overview:null,data:[[]],dataChanged:!1,timeout:null,graphMinY:null,graphMaxY:null,graphStartDateTime:null,graphEndDateTime:null,xAxisItem:this.initialXAxisItem,indexes:{},items:this.initialItems,graphItems:[],lastPlaybackDateTime:null,limitsValues:[],drawInterval:null,zoomChart:!1,zoomOverview:!1,cable:new ee,subscription:null,needToUpdate:!1,errorDialog:!1,errors:[],colorIndex:0,colors:["#00c7cb","#938bdb","#4dacff","lime","darkorange","red","gold","hotpink","tan","cyan","maroon","blue","teal","purple","green","brown","lightblue","white","black"]}},computed:{calcFullSize:function(){return this.fullWidth||this.fullHeight},error:function(){return this.errorDialog&&this.errors.length>0?JSON.stringify(this.errors,null,4):null},allowableXAxisItemPacket:function(){if(!this.canUseCustomXAxisItem||this.items.length===0)return;const{targetName:t,packetName:e}=this.items[0];return{targetName:t,packetName:e}},canUseCustomXAxisItem:function(){if(this.items.length===0)return!0;const{targetName:t,packetName:e}=this.items[0];return this.items.every(i=>i.targetName===t&&i.packetName===e)},actualXAxisItem:function(){return this.canUseCustomXAxisItem&&this.xAxisItem?this.xAxisItem:z},xAxisConverter:function(){return this.xAxisIsDefault?t=>t/1e9:t=>t},xAxisFormatter:function(){return t=>t==null?"--":this.xAxisIsTime?this.formatSeconds(t,this.timeZone):t},xAxisLabel:function(){return this.xAxisIsTime?"Time":this.actualXAxisItem.split("__").at(-2)},xAxisIsDefault:function(){return this.actualXAxisItem===z},xAxisIsTime:function(){const t=["PACKET_TIMESECONDS","RECEIVED_TIMESECONDS"];return this.xAxisIsDefault||t.includes(this.actualXAxisItem.split("__").at(4))},playbackMode:function(){return this.$store.state.playback.playbackMode},playbackDateTime:function(){return this.$store.state.playback.playbackDateTime},playbackStep:function(){return this.$store.state.playback.playbackStep}},watch:{state:function(t,e){switch(t){case"start":e==="stop"&&this.startGraph();break;case"stop":this.stopGraph();break}},playbackMode:function(t,e){this.playbackMode==="playback"?this.setupPlaybackMode():(this.lastPlaybackDateTime=null,this.clearAllData(),this.startGraph())},playbackDateTime:function(t,e){this.playbackMode==="playback"&&(this.lastPlaybackDateTime===null||this.lastPlaybackDateTime>this.playbackDateTime?this.clearAllData():this.api.get_tlm_values(this.graphItems,30,null,this.lastPlaybackDateTime,this.playbackDateTime).then(i=>{if(i.length>0){if(Array.isArray(i[0])&&Array.isArray(i[0][0]))for(let d=0;d<i.length;d++)for(let a=0;a<i[d].length;a++)if(a===0){let l=i[d][a][0],r=new Date(l);this.data[0].push(r.getTime()/1e3)}else this.data[a].push(i[d][a][0]);else if(Array.isArray(i)&&i.length>=2)for(let d=0;d<i.length;d++)if(d===0){let a=i[d][0],l=new Date(a);this.data[0].push(l.getTime()/1e3)}else this.data[d].push(i[d][0])}this.dataChanged=!0,this.updateGraphData()}),this.lastPlaybackDateTime=this.playbackDateTime)},data:function(t,e){this.dataChanged=!0},graphMinY:function(t,e){let i=parseFloat(t);isNaN(i)||(this.graphMinY=i),this.setGraphRange()},graphMaxY:function(t,e){let i=parseFloat(t);isNaN(i)||(this.graphMaxY=i),this.setGraphRange()},graphStartDateTime:function(t,e){t&&typeof t=="string"?(this.graphStartDateTime=this.parseDateTime(this.graphStartDateTime,this.timeZone)*1e6,this.graphStartDateTime!==e&&(this.needToUpdate=!0)):t===null&&e&&(this.graphStartDateTime=null,this.needToUpdate=!0)},graphEndDateTime:function(t,e){t&&typeof t=="string"?(this.graphEndDateTime=this.parseDateTime(this.graphEndDateTime,this.timeZone)*1e6,this.graphEndDateTime!==e&&(this.needToUpdate=!0)):t===null&&e&&(this.graphEndDateTime=null,this.needToUpdate=!0)},actualXAxisItem:function(t,e){let i=JSON.parse(JSON.stringify(this.items));this.removeItems(i),this.graph.destroy(),this.chartOpts.series[0].label=this.xAxisLabel,this.chartOpts.scales.x.time=this.xAxisIsTime,this.graph=new A(this.chartOpts,this.data,document.getElementById(`chart${this.id}`)),this.hideOverview||(this.overview.destroy(),this.overviewOpts.scales.x.time=this.xAxisIsTime,this.overview=new A(this.overviewOpts,this.data,document.getElementById(`overview${this.id}`))),this.addItems(i)}},created(){this.api=new R,this.title=`Graph ${this.id}`;for(const[t,e]of this.items.entries())this.data.push([]),this.indexes[this.subscriptionKey(e)]=t+1,e.color===void 0&&(e.color=this.colors[this.colorIndex]),this.colorIndex++,this.colorIndex===this.colors.length&&(this.colorIndex=0)},mounted(){const{chartSeries:t,overviewSeries:e}=this.items.reduce((i,d)=>{const a={spanGaps:!0};return i.chartSeries.push({...a,item:d,label:this.formatLabel(d),stroke:(l,r)=>this.items[r-1].color,width:2,value:(l,r)=>typeof r=="string"||isNaN(r)?"NaN":r==null?"--":r.toFixed(3)}),i.overviewSeries.push({...a}),i},{chartSeries:[],overviewSeries:[]});if(this.chartOpts={},this.sparkline)this.hideToolbarData=!0,this.hideOverviewData=!0,this.showOverview=!1,this.chartOpts={width:this.width,height:this.height,pxAlign:!1,cursor:{show:!1},select:{show:!1},legend:{show:!1},scales:{x:{time:!1}},axes:[{show:!1},{show:!1}],series:[{},{stroke:"white"}]},this.graph=new A(this.chartOpts,this.data,document.getElementById(`chart${this.id}`));else{let i=Intl.DateTimeFormat().resolvedOptions().timeZone;this.timeZone&&this.timeZone!=="local"&&(i=this.timeZone),this.chartOpts={...this.getSize("chart"),...this.getScales(),...this.getAxes("chart"),plugins:[this.linesPlugin()],tzDate:d=>A.tzDate(new Date(d*1e3),i),series:[{label:this.xAxisLabel,value:(d,a)=>this.xAxisFormatter(a)},...t],cursor:{drag:{x:!0,y:!1},sync:{key:"openc3"},bind:{mouseup:(d,a,l)=>r=>{this.state==="pause"&&d.select.width===0&&this.$emit("start"),l(r)}}},hooks:{setScale:[(d,a)=>{if(a==="x"&&!this.zoomOverview&&this.overview){this.zoomChart=!0;let l=Math.round(this.overview.valToPos(d.scales.x.min,"x")),r=Math.round(this.overview.valToPos(d.scales.x.max,"x"));this.overview.setSelect({left:l,width:r-l}),this.zoomChart=!1}}],setSelect:[d=>{this.state==="start"&&d.select.width>0&&this.$emit("pause")}],ready:[d=>{d.root.querySelector(".u-over").addEventListener("contextmenu",l=>{l.preventDefault(),this.itemMenu=!1,this.legendMenu=!1,this.editGraphMenuX=l.clientX,this.editGraphMenuY=l.clientY,this.editGraphMenu=!0});let a=d.root.querySelector(".u-legend");a.addEventListener("contextmenu",l=>{l.preventDefault(),this.editGraphMenu=!1,this.legendMenu=!1,this.itemMenuX=l.clientX,this.itemMenuY=l.clientY;let r=l.target.closest(".u-series"),h=Array.prototype.slice.call(a.childNodes[0].childNodes).indexOf(r),b=d.series[h];b.item?(this.selectedItem=b.item,this.itemMenu=!0):(this.itemMenu=!1,this.legendMenuX=l.clientX,this.legendMenuY=l.clientY,this.legendMenu=!0)}),a.querySelector("tbody").appendChild(this.$refs.info)}]}},this.graph=new A(this.chartOpts,this.data,document.getElementById(`chart${this.id}`)),this.overviewOpts={...this.getSize("overview"),...this.getScales(),...this.getAxes("overview"),tzDate:d=>A.tzDate(new Date(d*1e3),i),series:[...e],cursor:{y:!1,drag:{setScale:!1,x:!0,y:!1}},legend:{show:!1},hooks:{setSelect:[d=>{if(!this.zoomChart){this.state==="start"&&d.select.width>0&&this.$emit("pause"),this.zoomOverview=!0;let a=d.posToVal(d.select.left,"x"),l=d.posToVal(d.select.left+d.select.width,"x");this.graph.setScale("x",{min:a,max:l}),this.zoomOverview=!1}}]}},this.hideOverview||(this.overview=new A(this.overviewOpts,this.data,document.getElementById(`overview${this.id}`))),this.moveLegend(this.legendPosition),window.addEventListener("resize",this.resize)}this.playbackMode!=="playback"?this.state!=="stop"&&this.startGraph():this.setupPlaybackMode()},beforeUnmount:function(){this.stopGraph(),this.cable.disconnect(),window.removeEventListener("resize",this.resize)},methods:{setupPlaybackMode:function(){this.stopGraph(),this.clearAllData();const t=this.items.map(e=>this.subscriptionKey(e).split("__").slice(2).join("__"));t.unshift("INST__HEALTH_STATUS__PACKET_TIMESECONDS__RAW"),this.api.get_tlm_available(t).then(e=>{this.graphItems=e,t.length!=e.length&&console.log("Error getting tlm available",t,this.graphItems)})},startGraph:function(){this.subscribe(),this.timeout=setTimeout(()=>{this.updateTimeout()},this.refreshIntervalMs)},stopGraph:function(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=null),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},updateTimeout:function(){this.updateGraphData(),this.timeout=setTimeout(()=>{this.updateTimeout()},this.refreshIntervalMs)},updateGraphData:function(){if(this.state==="pause"||!this.dataChanged)return;this.graph.setData(this.data),this.overview&&this.overview.setData(this.data);let t=this.data[0][this.data[0].length-1],e=this.data[0][this.data[0].length-this.pointsGraphed],i=this.data[0][0];i<t-this.secondsGraphed&&(i=t-this.secondsGraphed),e>i&&(i=e),this.graph.setScale("x",{min:i,max:t}),this.dataChanged=!1},formatLabel(t){if(t.valueType==="CONVERTED"&&t.reduced==="DECOM")return t.itemName;{let e="";return t.valueType!=="CONVERTED"&&(e+=t.valueType),t.reduced!=="DECOM"&&(e!==""&&(e+=" "),e+=`${t.reduced.split("_")[1]} ${t.reducedType}`),`${t.itemName} (${e})`}},moveLegend:function(t){switch(t){case"bottom":this.graph.root.classList.remove("side-legend"),this.graph.root.classList.remove("left-legend"),this.graph.root.classList.remove("top-legend");break;case"top":this.graph.root.classList.remove("side-legend"),this.graph.root.classList.remove("left-legend"),this.graph.root.classList.add("top-legend");break;case"left":this.graph.root.classList.remove("top-legend"),this.graph.root.classList.add("side-legend"),this.graph.root.classList.add("left-legend");break;case"right":this.graph.root.classList.remove("top-legend"),this.graph.root.classList.remove("left-legend"),this.graph.root.classList.add("side-legend");break}this.legendPosition=t,this.resize()},clearErrors:function(){this.errors=[]},editGraphClose:function(t){this.editGraph=!1,this.title=t.title,this.legendPosition=t.legendPosition,this.graphMinY=t.graphMinY,this.graphMaxY=t.graphMaxY,this.lines=[...t.lines],this.graphStartDateTime=t.startDateTime,this.graphEndDateTime=t.endDateTime,this.$nextTick(()=>{if(this.needToUpdate){if(this.subscription==null)this.startGraph();else{let e=JSON.parse(JSON.stringify(this.items));this.removeItems(e),setTimeout(()=>{this.addItems(e)},0)}this.needToUpdate=!1}}),this.moveLegend(this.legendPosition),this.$emit("edit")},resize:function(){this.graph.setSize(this.getSize("chart")),this.overview&&this.overview.setSize(this.getSize("overview")),this.$emit("resize",this.id)},expandAll:function(){this.fullWidth=!0,this.fullHeight=!0,this.resize()},collapseAll:function(){this.fullWidth=!1,this.fullHeight=!1,this.resize()},expandWidth:function(){this.fullWidth=!0,this.resize()},collapseWidth:function(){this.fullWidth=!1,this.resize()},expandHeight:function(){this.fullHeight=!0,this.resize()},collapseHeight:function(){this.fullHeight=!1,this.resize()},minMaxTransition:function(){this.expand=!this.expand,this.$emit("min-max-graph",this.id)},setGraphRange:function(){let t=.1;(this.graphMinY||this.graphMinY===0||this.graphMaxY||this.graphMaxY===0)&&(t=0),this.graph.scales.y.range=(e,i,d)=>{let a=i;(this.graphMinY||this.graphMinY===0)&&(a=this.graphMinY);let l=d;return(this.graphMaxY||this.graphMaxY===0)&&(l=this.graphMaxY),A.rangeNum(a,l,t,!0)}},subscribe:function(){this.cable.createSubscription("StreamingChannel",window.openc3Scope,{received:t=>this.received(t),connected:()=>{const t=[...this.items];this.actualXAxisItem!==z&&t.push(this.actualXAxisItem),this.addItemsToSubscription(t)},disconnected:t=>{t.allowReconnect&&this.errors.push({type:"disconnected",message:"OpenC3 backend connection disconnected",time:new Date().getTime()})},rejected:()=>{this.errors.push({type:"rejected",message:"OpenC3 backend connection rejected",time:new Date().getTime()})}}).then(t=>{this.subscription=t})},getSize:function(t){let e=0;const i=document.getElementById("openc3-nav-drawer");i&&(e=i.classList.contains("v-navigation-drawer--active")?i.clientWidth:0);let d=0;(this.legendPosition==="right"||this.legendPosition==="left")&&(d=document.getElementsByClassName("u-legend")[0].clientWidth);const a=Math.max(document.documentElement.clientWidth,window.innerWidth||0)-e-d,l=Math.max(document.documentElement.clientHeight,window.innerHeight||0),r=document.getElementsByClassName("v-expansion-panel")[0];let h=100;t==="overview"?this.fullHeight&&!this.hideOverviewData?this.showOverview=!0:this.showOverview=!1:(h=l-r.clientHeight-h-250,this.fullHeight||(h=h/2+10));let b=a-70;return this.fullWidth||(b=b/2-12),{width:this.width||b,height:this.height||h}},getScales:function(){return{scales:{x:{range(t,e,i){return e==null?this.xAxisIsTime?[1566453600,1566497660]:[0,1]:[e,i]},time:this.xAxisIsTime},y:{range(t,e,i){return e==null?[-100,100]:A.rangeNum(e,i,.1,!0)}}}}},getAxes:function(t){let e="rgba(255, 255, 255, .1)",i="white";return{axes:[{stroke:i,grid:{show:!0,stroke:e,width:2}},{size:80,stroke:i,grid:{show:t!=="overview",stroke:e,width:2},values(d,a){return(a.some(l=>l>=1e7)||a.every(l=>l<.01))&&(a=a.map(l=>l.toExponential(3))),a}}]}},closeEditItem:function(t){this.editItem=!1,(this.graphEndDateTime!==null&&this.selectedItem!==t||this.selectedItem.valueType!==t.valueType||this.selectedItem.reduced!==t.reduced||this.selectedItem.reducedType!==t.reducedType)&&this.changeItem(t)},changeColor:function(t){let e=this.subscriptionKey(this.selectedItem),i=this.indexes[e];this.items[i-1].color=t,this.selectedItem.color=t,this.graph.root.querySelectorAll(".u-marker")[i].style.borderColor=t},changeLimits:function(t){let e=this.subscriptionKey(this.selectedItem),i=this.indexes[e];this.items[i-1].limits=t,this.selectedItem.limits=t,this.limitsValues=t},linesPlugin:function(){return{hooks:{draw:t=>{const{ctx:e,bbox:i}=t,d=t.valToPos(t.scales.y.min,"y",!0),a=t.valToPos(t.scales.y.max,"y",!0),l=t.valToPos(this.limitsValues[0],"y",!0),r=t.valToPos(this.limitsValues[1],"y",!0),h=t.valToPos(this.limitsValues[2],"y",!0),b=t.valToPos(this.limitsValues[3],"y",!0);if(this.lines.forEach(f=>{t.scales.y.min<=f.yValue&&f.yValue<=t.scales.y.max&&(e.save(),e.beginPath(),e.strokeStyle=f.color,e.lineWidth=2,e.moveTo(i.left,t.valToPos(f.yValue,"y",!0)),e.lineTo(i.left+i.width,t.valToPos(f.yValue,"y",!0)),e.stroke(),e.restore())}),e.save(),e.beginPath(),e.fillStyle="rgba(255,0,0,0.15)",t.scales.y.min<this.limitsValues[0]){let f=l<a?a:l;e.fillRect(i.left,l,i.width,d-f)}if(t.scales.y.max>this.limitsValues[3]){let f=d<b?d:b;e.fillRect(i.left,a,i.width,f-a)}if(e.fillStyle="rgba(255,255,0,0.15)",t.scales.y.min<this.limitsValues[1]&&t.scales.y.max>this.limitsValues[0]){let f=r<a?a:r;e.fillRect(i.left,f,i.width,l-f)}if(t.scales.y.max>this.limitsValues[2]&&t.scales.y.min<this.limitsValues[3]){let f=d<b?d:b,x=d<h?d:h;e.fillRect(i.left,f,i.width,x-f)}if(e.fillStyle="rgba(0,255,0,0.15)",this.limitsValues.length===4){if(t.scales.y.min<this.limitsValues[2]&&t.scales.y.max>this.limitsValues[1]){let f=h<a?a:h,x=d<r?d:r;e.fillRect(i.left,f,i.width,x-f)}}else{const f=t.valToPos(this.limitsValues[4],"y",!0),x=t.valToPos(this.limitsValues[5],"y",!0);if(t.scales.y.min<this.limitsValues[4]&&t.scales.y.max>this.limitsValues[1]){let m=f<a?a:f;e.fillRect(i.left,m,i.width,r-m)}if(t.scales.y.max>this.limitsValues[5]&&t.scales.y.min<this.limitsValues[2]){let m=d<h?d:h,y=d<x?d:x;e.fillRect(i.left,m,i.width,y-m)}e.fillStyle="rgba(0,0,255,0.15)";let _=x<a?a:x,T=d<f?d:f;e.fillRect(i.left,_,i.width,T-_)}e.stroke(),e.restore()}}}},changeItem:function(t){this.removeItems([this.selectedItem]),this.selectedItem.valueType=t.valueType,this.selectedItem.reduced=t.reduced,this.selectedItem.reducedType=t.reducedType,setTimeout(()=>{this.addItems([this.selectedItem])},0)},addItems:function(t,e="CONVERTED"){t.forEach(i=>{i.valueType||(i.valueType=e),i.color||(i.color=this.colors[this.colorIndex]),i.limits||(i.limits=[]),i.limits.length>0&&(this.limitsValues=i.limits),this.colorIndex=(this.colorIndex+1)%this.colors.length,this.items.push(i);const d=this.data.length;this.graph.addSeries(this.createSeriesConfig(i),d),this.overview&&this.overview.addSeries(this.createOverviewSeriesConfig(),d),this.data.splice(d,0,Array(this.data[0].length)),this.indexes[this.subscriptionKey(i)]=d}),this.updateColorIndex(t),this.xAxisIsDefault||t.push(this.actualXAxisItem),this.addItemsToSubscription(t),this.$emit("resize"),this.$emit("edit")},createSeriesConfig:function(t){return{spanGaps:!0,item:t,label:this.formatLabel(t),stroke:(e,i)=>this.items[i-1].color,width:2,value:(e,i)=>typeof i=="string"||isNaN(i)?"NaN":i==null?"--":Math.abs(i)<.01&&i!==0||Math.abs(i)>=1e7?i.toExponential(6):i.toFixed(6)}},createOverviewSeriesConfig:function(){return{spanGaps:!0,stroke:(t,e)=>this.items[e-1].color}},updateColorIndex:function(t){const e=t[t.length-1];if(e){const i=this.colors.indexOf(e.color);i!==-1&&(this.colorIndex=(i+1)%this.colors.length)}},addItemsToSubscription:function(t=this.items){let e=this.startTime;this.graphStartDateTime&&(e=this.graphStartDateTime);const i=t.map(d=>{if(typeof d=="object")return this.subscriptionKey(d);if(typeof d=="string")return d;throw new Error(`Invalid subscription item type for ${d}: ${typeof d}`)});this.subscription&&OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(d=>{d&&OpenC3Auth.setTokens(),this.subscription.perform("add",{scope:window.openc3Scope,token:localStorage.openc3Token,items:i,start_time:e,end_time:this.graphEndDateTime})})},clearAllData:function(){this.data[0]=[],this.clearData(this.items)},clearData:function(t){for(const e of t.map(this.subscriptionKey)){let i=this.indexes[e];this.data[i]=Array(this.data[0].length).fill(null),this.graph.setData(this.data),this.overview&&this.overview.setData(this.data)}this.data.length===2&&(this.data[0]=[],this.graph.setData(this.data),this.overview&&this.overview.setData(this.data))},removeItems:function(t){this.removeItemsFromSubscription(t);for(const e of t.map(this.subscriptionKey)){const i=this.reorderIndexes(e);this.items.splice(i-1,1),this.data.splice(i,1),this.graph.delSeries(i),this.graph.setData(this.data),this.overview&&(this.overview.delSeries(i),this.overview.setData(this.data))}this.data.length===1&&(this.data[0]=[],this.graph.setData(this.data),this.overview&&this.overview.setData(this.data)),this.$emit("resize"),this.$emit("edit")},removeItemsFromSubscription:function(t=this.items){if(this.subscription){const e=t.map(i=>{if(typeof i=="object")return this.subscriptionKey(i);if(typeof i=="string")return i;throw new Error(`Invalid subscription item type for ${i}: ${typeof i}`)});this.subscription.perform("remove",{scope:window.openc3Scope,token:localStorage.openc3Token,items:e})}},reorderIndexes:function(t){let e=this.indexes[t];delete this.indexes[t];for(let i in this.indexes)this.indexes[i]>e&&(this.indexes[i]-=1);return e},received:function(t){this.cable.recordPing();for(let e=0;e<t.length;e++){if(!t[e].hasOwnProperty(this.actualXAxisItem))continue;let i=this.xAxisConverter(t[e][this.actualXAxisItem]),d=this.data[0].length;if(d===0||i>this.data[0][d-1]){for(let a=0;a<this.data.length;a++)this.data[a].push(null);this.set_data_at_index(this.data[0].length-1,i,t[e])}else{let a=X(this.data[0],i,this.bs_comparator);if(a>=0){if(!Number.isFinite(i))throw new RangeError(`Invalid x-axis value: ${i}`);for(;a>=0;)i-=1e-5,a=X(this.data[0],i,this.bs_comparator);let l=-a-1;for(let r=0;r<this.data.length;r++)this.data[r].splice(l,0,null);this.set_data_at_index(l,i,t[e])}else{let l=-a-1;for(let r=0;r<this.data.length;r++)this.data[r].splice(l,0,null);this.set_data_at_index(l,i,t[e])}}}if(this.startTime==null&&this.data[0][0]){let e=this.data[0][0]*1e9;this.$emit("started",e)}this.dataChanged=!0},bs_comparator:function(t,e){return t-e},set_data_at_index:function(t,e,i){this.data[0][t]=e;for(const[d,a]of Object.entries(i)){if(d==="time"||d===this.actualXAxisItem)continue;let l=this.indexes[d];if(l){let r=this.data[l];if(a!=null&&a.raw)r[t]=null;else if(typeof a=="string"){if(r[t]=null,!d.includes("__RAW")){for(let h of this.items)if(this.subscriptionKey(h)===d){this.selectedItem=h;break}this.changeItem({valueType:"RAW",reduced:this.selectedItem.reduced,reducedType:this.selectedItem.reducedType})}}else r[t]=a}}},subscriptionKey:function(t){let e=`${t.reduced}__TLM__${t.targetName}__${t.packetName}__${t.itemName}__${t.valueType}`;return(t.reduced==="REDUCED_MINUTE"||t.reduced==="REDUCED_HOUR"||t.reduced==="REDUCED_DAY")&&(e+=`__${t.reducedType}`),e}}},ke={id:"chart",ref:"chart",class:"pa-1"},Ie=["id"],_e=["id"],De={key:5,ref:"info",class:"u-series"};function we(t,e,i,d,a,l){const r=o("v-btn"),h=o("v-spacer"),b=o("v-toolbar"),f=o("v-expand-transition"),x=o("v-card"),_=o("graph-edit-dialog"),T=o("v-text-field"),m=o("v-row"),y=o("v-textarea"),L=o("v-dialog"),D=o("v-list-item-title"),w=o("v-list-item"),O=o("v-list"),U=o("v-menu"),j=o("graph-edit-item-dialog"),F=o("v-list-subheader"),S=o("v-icon"),J=o("v-tooltip");return g(),C("div",{onClick:e[22]||(e[22]=K(u=>t.$emit("click"),["prevent"]))},[s(x,null,{default:n(()=>[M(s(b,{height:"24",class:q(["pl-2 pr-2",i.selectedGraphId===i.id?"active":""])},{default:n(()=>[M(s(r,{class:"mx-2",icon:"mdi-alert",density:"compact",variant:"text","aria-label":"Show Errors",onClick:e[0]||(e[0]=()=>{a.errorDialog=!0})},null,512),[[P,a.errors.length!==0]]),s(r,{icon:"mdi-pencil",variant:"text",density:"compact","data-test":"edit-graph-icon","aria-label":"Edit Graph",onClick:e[1]||(e[1]=()=>{a.editGraph=!0})}),s(h),I("span",null,V(a.title),1),s(h),a.expand?(g(),C($,{key:0},[l.calcFullSize?(g(),N(r,{key:0,icon:"mdi-arrow-collapse",variant:"text",density:"compact","data-test":"collapse-all",onClick:l.collapseAll},null,8,["onClick"])):(g(),N(r,{key:1,icon:"mdi-arrow-expand",variant:"text",density:"compact","data-test":"expand-all",onClick:l.expandAll},null,8,["onClick"])),a.fullWidth?(g(),N(r,{key:2,icon:"mdi-arrow-collapse-horizontal",variant:"text",density:"compact","data-test":"collapse-width",onClick:l.collapseWidth},null,8,["onClick"])):(g(),N(r,{key:3,icon:"mdi-arrow-expand-horizontal",variant:"text",density:"compact","data-test":"expand-width",onClick:l.expandWidth},null,8,["onClick"])),a.fullHeight?(g(),N(r,{key:4,icon:"mdi-arrow-collapse-vertical",variant:"text",density:"compact","data-test":"collapse-height",onClick:l.collapseHeight},null,8,["onClick"])):(g(),N(r,{key:5,icon:"mdi-arrow-expand-vertical",variant:"text",density:"compact","data-test":"expand-height",onClick:l.expandHeight},null,8,["onClick"]))],64)):k("",!0),a.expand?(g(),N(r,{key:1,icon:"mdi-window-minimize",variant:"text",density:"compact","data-test":"minimize-screen-icon",onClick:l.minMaxTransition},null,8,["onClick"])):(g(),N(r,{key:2,icon:"mdi-window-maximize",variant:"text",density:"compact","data-test":"maximize-screen-icon",onClick:l.minMaxTransition},null,8,["onClick"])),s(r,{icon:"mdi-close-box",variant:"text",density:"compact","data-test":"close-graph-icon",onClick:e[2]||(e[2]=K(u=>t.$emit("close-graph"),["stop"]))})]),_:1},8,["class"]),[[P,!a.hideToolbarData]]),s(f,null,{default:n(()=>[M(I("div",ke,[I("div",{id:`chart${i.id}`},null,8,Ie),e[23]||(e[23]=I("div",{id:"betweenCharts"},null,-1)),M(I("div",{id:`overview${i.id}`},null,8,_e),[[P,a.showOverview]])],512),[[P,a.expand]])]),_:1})]),_:1}),a.editGraph?(g(),N(_,{key:0,modelValue:a.editGraph,"onUpdate:modelValue":e[3]||(e[3]=u=>a.editGraph=u),"x-axis-item":a.xAxisItem,"onUpdate:xAxisItem":e[4]||(e[4]=u=>a.xAxisItem=u),title:a.title,"legend-position":a.legendPosition,items:a.items,"graph-min-y":a.graphMinY,"graph-max-y":a.graphMaxY,lines:a.lines,colors:a.colors,"start-date-time":a.graphStartDateTime,"end-date-time":a.graphEndDateTime,"time-zone":i.timeZone,"x-axis-item-packet":l.allowableXAxisItemPacket,onRemove:e[5]||(e[5]=u=>l.removeItems([u])),onOk:l.editGraphClose,onCancel:e[6]||(e[6]=u=>a.editGraph=!1)},null,8,["modelValue","x-axis-item","title","legend-position","items","graph-min-y","graph-max-y","lines","colors","start-date-time","end-date-time","time-zone","x-axis-item-packet","onOk"])):k("",!0),s(L,{modelValue:a.errorDialog,"onUpdate:modelValue":e[8]||(e[8]=u=>a.errorDialog=u),"max-width":"600"},{default:n(()=>[s(b,{height:"24"},{default:n(()=>[s(h),e[24]||(e[24]=I("span",null," Errors ",-1)),s(h)]),_:1,__:[24]}),s(x,{class:"pa-3"},{default:n(()=>[s(m,{dense:""},{default:n(()=>[s(T,{modelValue:a.title,"onUpdate:modelValue":e[7]||(e[7]=u=>a.title=u),readonly:"","hide-details":"",class:"pb-2",label:"Graph Title"},null,8,["modelValue"])]),_:1}),s(m,{class:"my-3"},{default:n(()=>[s(y,{readonly:"",rows:"8",value:l.error},null,8,["value"])]),_:1}),s(m,null,{default:n(()=>[s(r,{block:"",onClick:l.clearErrors},{default:n(()=>e[25]||(e[25]=[v(" Clear ",-1)])),_:1,__:[25]},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a.editGraphMenu?(g(),N(U,{key:1,modelValue:a.editGraphMenu,"onUpdate:modelValue":e[10]||(e[10]=u=>a.editGraphMenu=u),target:[a.editGraphMenuX,a.editGraphMenuY],absolute:"","offset-y":""},{default:n(()=>[s(O,null,{default:n(()=>[s(w,{onClick:e[9]||(e[9]=u=>a.editGraph=!0)},{default:n(()=>[s(D,{style:{cursor:"pointer"}},{default:n(()=>[v(" Edit "+V(a.title),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue","target"])):k("",!0),a.editItem?(g(),N(j,{key:2,modelValue:a.editItem,"onUpdate:modelValue":e[11]||(e[11]=u=>a.editItem=u),colors:a.colors,item:a.selectedItem,onChangeColor:l.changeColor,onChangeLimits:l.changeLimits,onCancel:e[12]||(e[12]=u=>a.editItem=!1),onClose:l.closeEditItem},null,8,["modelValue","colors","item","onChangeColor","onChangeLimits","onClose"])):k("",!0),a.itemMenu?(g(),N(U,{key:3,modelValue:a.itemMenu,"onUpdate:modelValue":e[16]||(e[16]=u=>a.itemMenu=u),target:[a.itemMenuX,a.itemMenuY],absolute:"","offset-y":""},{default:n(()=>[s(O,{nav:"",density:"compact"},{default:n(()=>[s(F,null,{default:n(()=>[v(V(a.selectedItem.targetName)+" "+V(a.selectedItem.packetName)+" "+V(a.selectedItem.itemName),1)]),_:1}),s(w,{onClick:e[13]||(e[13]=u=>a.editItem=!0)},{prepend:n(()=>[s(S,{icon:"mdi-pencil"})]),default:n(()=>[s(D,null,{default:n(()=>e[26]||(e[26]=[v(" Edit ",-1)])),_:1,__:[26]})]),_:1}),s(w,{onClick:e[14]||(e[14]=u=>l.clearData([a.selectedItem]))},{prepend:n(()=>[s(S,{icon:"mdi-eraser"})]),default:n(()=>[s(D,null,{default:n(()=>e[27]||(e[27]=[v(" Clear ",-1)])),_:1,__:[27]})]),_:1}),s(w,{onClick:e[15]||(e[15]=u=>l.removeItems([a.selectedItem]))},{prepend:n(()=>[s(S,{icon:"mdi-delete"})]),default:n(()=>[s(D,null,{default:n(()=>e[28]||(e[28]=[v(" Delete ",-1)])),_:1,__:[28]})]),_:1})]),_:1})]),_:1},8,["modelValue","target"])):k("",!0),a.legendMenu?(g(),N(U,{key:4,modelValue:a.legendMenu,"onUpdate:modelValue":e[21]||(e[21]=u=>a.legendMenu=u),target:[a.legendMenuX,a.legendMenuY],absolute:"","offset-y":""},{default:n(()=>[s(O,null,{default:n(()=>[s(w,{onClick:e[17]||(e[17]=u=>l.moveLegend("top"))},{default:n(()=>[s(D,{style:{cursor:"pointer"}},{default:n(()=>e[29]||(e[29]=[v(" Legend Top ",-1)])),_:1,__:[29]})]),_:1}),s(w,{onClick:e[18]||(e[18]=u=>l.moveLegend("bottom"))},{default:n(()=>[s(D,{style:{cursor:"pointer"}},{default:n(()=>e[30]||(e[30]=[v(" Legend Bottom ",-1)])),_:1,__:[30]})]),_:1}),s(w,{onClick:e[19]||(e[19]=u=>l.moveLegend("left"))},{default:n(()=>[s(D,{style:{cursor:"pointer"}},{default:n(()=>e[31]||(e[31]=[v(" Legend Left ",-1)])),_:1,__:[31]})]),_:1}),s(w,{onClick:e[20]||(e[20]=u=>l.moveLegend("right"))},{default:n(()=>[s(D,{style:{cursor:"pointer"}},{default:n(()=>e[32]||(e[32]=[v(" Legend RIght ",-1)])),_:1,__:[32]})]),_:1})]),_:1})]),_:1},8,["modelValue","target"])):k("",!0),i.sparkline?k("",!0):(g(),C("div",De,[s(J,{text:"Click item to toggle, Right click to edit",location:"top"},{activator:n(({props:u})=>[s(S,te(ie(u)),{default:n(()=>e[33]||(e[33]=[v(" mdi-information-variant-circle ",-1)])),_:2,__:[33]},1040)]),_:1})],512))])}const Ce=Q("P",E(Te,[["render",we],["__scopeId","data-v-f2b1570f"]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","./main-578bc0655a22d2a15a27.js"],function(u,M){"use strict";var m,d,h,o,p;return{setters:[n=>{m=n.o},n=>{d=n.l,h=n.y,o=n.c,p=n.z}],execute:function(){function n(e,t,i){const s=d(e,void 0);if(isNaN(t))return h(e,NaN);if(!t)return s;const a=s.getDate(),r=h(e,s.getTime());r.setMonth(s.getMonth()+t+1,0);const c=r.getDate();return a>=c?r:(s.setFullYear(r.getFullYear(),r.getMonth(),a),s)}function l(e,t,i){return p(e,-t,i)}function N(e,t,i){return n(e,-t)}function T(e,t,i){const{years:s=0,months:a=0,weeks:r=0,days:c=0,hours:g=0,minutes:f=0,seconds:k=0}=t,y=N(e,a+s*12),E=l(y,c+r*7,i),S=f+g*60,I=(k+S*60)*1e3;return h(e,+E-I)}const D=u("M",{mixins:[m],data:function(){return{id:Math.floor(Math.random()*1e11),state:"start",items:[{targetName:this.parameters[0],packetName:this.parameters[1],itemName:this.parameters[2],valueType:this.parameters[3]||"CONVERTED",reduced:this.parameters[4]||"DECOM",reducedType:this.parameters[5]||null}],startTime:null,secondsGraphed:3600,pointsSaved:3600,pointsGraphed:3600,size:{height:300,width:400}}},created:function(){this.appliedSettings.forEach(e=>{switch(e[0]){case"ITEM":this.items.push({targetName:e[1],packetName:e[2],itemName:e[3],valueType:e[4]||"CONVERTED",reduced:e[5]||"DECOM",reducedType:e[6]||null});break;case"STARTTIME":let t=o(e[1],"yyyy/MM/dd HH:mm:ss",new Date);this.startTime=t.getTime()*1e6;break;case"HISTORY":let i=parseInt(e[1].slice(0,e[1].length-1)),s=null,a=1;switch(e[1][e[1].length-1]){case"d":s="days",a=3600*24;break;case"h":s="hours",a=3600;break;case"m":s="minutes",a=60;break;case"s":s="seconds";break;default:throw new Error(`Unknown time suffix: ${e[1]}!`)}let r={};r[s]=i,this.startTime=T(new Date,r).getTime()*1e6,i*a>this.secondsGraphed&&(this.secondsGraphed=i*a),i*a>this.pointsSaved&&(this.pointsSaved=i*a),i*a>this.pointsGraphed&&(this.pointsGraphed=i*a);break;case"SECONDSGRAPHED":this.secondsGraphed=parseInt(e[1]);break;case"POINTSSAVED":this.pointsSaved=parseInt(e[1]);break;case"POINTSGRAPHED":this.pointsGraphed=parseInt(e[1]);break;case"SIZE":this.size.width=parseInt(e[1]),this.size.height=parseInt(e[2]);break}}),this.items=this.items.map(e=>{if(e.itemName,e.itemName.includes("[["))e.itemName=e.itemName.replace("[[","[").replace("]]","]"),e.itemName;else if(e.itemName.includes("[")){let t=e.itemName.match(/\[(\d+)\]/);this.arrayIndex=parseInt(t[1]),e.itemName.replace(t[0],"")}return e})}})}}});
@@ -1 +0,0 @@
1
- System.register(["./Layout-mWR35VAD-8e5913a3cc7af10f83ea.js","vue","./main-578bc0655a22d2a15a27.js","./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","vue-router","single-spa","vuex","vuetify"],function(d,k){"use strict";var a,i,r,c,o,u,m,g,p,f;return{setters:[e=>{a=e.r},e=>{i=e.createElementBlock,r=e.openBlock,c=e.normalizeStyle,o=e.Fragment,u=e.renderList,m=e.createBlock,g=e.resolveDynamicComponent,p=e.mergeProps},e=>{f=e.d},null,null,null,null,null],execute:function(){const e={mixins:[a],created:function(){if(this.parameters[0]){let n=this.parameters[0];this.widgets.forEach(l=>{l.settings.find(s=>s[0]==="MARGIN"||s[0].startsWith("RAW")&&s[1].toUpperCase().includes("MARGIN"))===void 0&&l.settings.push(["MARGIN",n])})}}};function y(n,l,s,B,w,x){return r(),i("div",{ref:"container",class:"d-flex flex-row",style:c(n.computedStyle)},[(r(!0),i(o,null,u(n.widgets,(t,v)=>(r(),m(g(t.type),p({ref_for:!0},n.listeners,{key:v,target:t.target,parameters:t.parameters,settings:t.settings,"screen-values":n.screenValues,"screen-time-zone":n.screenTimeZone,widgets:t.widgets,name:t.name,line:t.line,"line-number":t.lineNumber}),null,16,["target","parameters","settings","screen-values","screen-time-zone","widgets","name","line","line-number"]))),128))],4)}const h=d("default",f(e,[["render",y]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./LabelWidget-DSDYmz6X-7ae3a88e8215afbdf7b3.js","./HorizontallineWidget-NZIxmRVN-a44ad040ec386e3f8f7a.js","./HorizontalWidget-CsVhLwZO-1aa587e9a3a7a96a213c.js","./Layout-mWR35VAD-8e5913a3cc7af10f83ea.js","vue","./main-578bc0655a22d2a15a27.js","./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","vue-router","single-spa","vuex","vuetify"],function(p,S){"use strict";var r,l,a,o,n,g,s,c,d,i,u,m;return{setters:[e=>{r=e.default},e=>{l=e.default},e=>{a=e.default},e=>{o=e.r},e=>{n=e.resolveComponent,g=e.createElementBlock,s=e.openBlock,c=e.createBlock,d=e.createCommentVNode,i=e.createVNode,u=e.mergeProps},e=>{m=e.d},null,null,null,null,null],execute:function(){const e={components:{LabelWidget:r,HorizontalLineWidget:l,HorizontalWidget:a},mixins:[o],created(){this.labelSettings=[...this.appliedSettings],this.labelSettings.find(t=>t[0]==="0"&&t[1].startsWith("RAW")&&t[2]==="font-weight")||this.labelSettings.push(["0","RAW__font-weight","font-weight","bold"])}};function h(t,z,b,V,j,k){const w=n("label-widget"),f=n("horizontal-line-widget"),W=n("horizontal-widget");return s(),g("div",null,[t.parameters.length>0?(s(),c(w,{key:0,parameters:t.parameters.slice(0,1),settings:[...t.labelSettings],"widget-index":0},null,8,["parameters","settings"])):d("",!0),i(f,{settings:[...t.appliedSettings],"widget-index":1},null,8,["settings"]),i(W,u(t.listeners,{parameters:t.parameters.slice(1),settings:t.appliedSettings,widgets:t.widgets,"screen-values":t.screenValues,"screen-time-zone":t.screenTimeZone,"screen-id":t.screenId}),null,16,["parameters","settings","widgets","screen-values","screen-time-zone","screen-id"])])}const v=p("default",m(e,[["render",h]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","vue","./main-578bc0655a22d2a15a27.js","vue-router","single-spa","vuex","vuetify"],function(o,i){"use strict";var t,n,l,r,u;return{setters:[e=>{t=e.o},e=>{n=e.createElementBlock,l=e.openBlock,r=e.normalizeStyle},e=>{u=e.d},null,null,null,null],execute:function(){const e={mixins:[t]};function c(s,m,f,y,d,p){return l(),n("hr",{style:r(s.computedStyle)},null,4)}const a=o("default",u(e,[["render",c]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","vue","./main-578bc0655a22d2a15a27.js","vue-router","single-spa","vuex","vuetify"],function(y,P){"use strict";var h,g,m,p,R;return{setters:[r=>{h=r.o},r=>{g=r.createElementBlock,m=r.openBlock,p=r.normalizeStyle},r=>{R=r.d},null,null,null,null],execute:function(){var r={},t={},d;function B(){return d||(d=1,Object.defineProperty(t,"__esModule",{value:!0}),t.BLANK_URL=t.relativeFirstCharacters=t.whitespaceEscapeCharsRegex=t.urlSchemeRegex=t.ctrlCharactersRegex=t.htmlCtrlEntityRegex=t.htmlEntitiesRegex=t.invalidProtocolRegex=void 0,t.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im,t.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g,t.htmlCtrlEntityRegex=/&(newline|tab);/gi,t.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,t.urlSchemeRegex=/^.+(:|&colon;)/gim,t.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g,t.relativeFirstCharacters=[".","/"],t.BLANK_URL="about:blank"),t}var f;function U(){if(f)return r;f=1,Object.defineProperty(r,"__esModule",{value:!0}),r.sanitizeUrl=void 0;var e=B();function v(i){return e.relativeFirstCharacters.indexOf(i[0])>-1}function x(i){var l=i.replace(e.ctrlCharactersRegex,"");return l.replace(e.htmlEntitiesRegex,function(a,n){return String.fromCharCode(n)})}function C(i){return URL.canParse(i)}function o(i){try{return decodeURIComponent(i)}catch{return i}}function w(i){if(!i)return e.BLANK_URL;var l,a=o(i.trim());do a=x(a).replace(e.htmlCtrlEntityRegex,"").replace(e.ctrlCharactersRegex,"").replace(e.whitespaceEscapeCharsRegex,"").trim(),a=o(a),l=a.match(e.ctrlCharactersRegex)||a.match(e.htmlEntitiesRegex)||a.match(e.htmlCtrlEntityRegex)||a.match(e.whitespaceEscapeCharsRegex);while(l&&l.length>0);var n=a;if(!n)return e.BLANK_URL;if(v(n))return n;var E=n.trimStart(),L=E.match(e.urlSchemeRegex);if(!L)return n;var c=L[0].toLowerCase().trim();if(e.invalidProtocolRegex.test(c))return e.BLANK_URL;var u=E.replace(/\\/g,"/");if(c==="mailto:"||c.includes("://"))return u;if(c==="http:"||c==="https:"){if(!C(u))return e.BLANK_URL;var s=new URL(u);return s.protocol=s.protocol.toLowerCase(),s.hostname=s.hostname.toLowerCase(),s.toString()}return u}return r.sanitizeUrl=w,r}var F=U();const S={mixins:[h],data:function(){return{width:800,height:600,url:F.sanitizeUrl(this.parameters[0])}},created:function(){this.setWidth(this.parameters[1],"px",this.width),this.setHeight(this.parameters[2],"px",this.height)}},_=["src","width","height"];function N(e,v,x,C,o,w){return m(),g("iframe",{title:"IFrameWidget",src:e.url,width:e.width,height:e.height,style:p(e.computedStyle)},null,12,_)}const b=y("default",R(S,[["render",N]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./main-578bc0655a22d2a15a27.js"],function(r,s){"use strict";var e;return{setters:[o=>{e=o.D}],execute:function(){const o=r("s",{props:{target:{type:String,require:!0}},methods:{getPresignedUrl:async function(n){let t="targets_modified";return await e.get(`/openc3-api/storage/exists/${encodeURIComponent(`${window.openc3Scope}/${t}/${this.target}/public/${n}`)}?bucket=OPENC3_CONFIG_BUCKET`,{headers:{Accept:"application/json","Ignore-Errors":"404"}}).catch(a=>{t="targets"}),(await e.get(`/openc3-api/storage/download/${encodeURIComponent(`${window.openc3Scope}/${t}/${this.target}/public/${n}`)}?bucket=OPENC3_CONFIG_BUCKET`)).data.url}}})}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","vue","./main-578bc0655a22d2a15a27.js","vue-router","single-spa","vuex","vuetify"],function(l,o){"use strict";var a,n,r,s,i;return{setters:[e=>{a=e.o},e=>{n=e.createElementBlock,r=e.openBlock,s=e.normalizeStyle},e=>{i=e.d},null,null,null,null],execute:function(){const e={mixins:[a],data:function(){return{valueId:null,imageData:""}},computed:{src:function(){return`data:image/${this.parameters[3]};base64, ${this.screenValues[this.valueId][0]}`}},created:function(){this.valueId=`${this.parameters[0]}__${this.parameters[1]}__${this.parameters[2]}__CONVERTED`,this.$emit("addItem",this.valueId)},unmounted:function(){this.$emit("deleteItem",this.valueId)}},u=["src","alt","width","height"];function c(t,h,p,v,$,m){return r(),n("img",{src:m.src,alt:t.valueId,width:t.parameters[4],height:t.parameters[5],style:s(t.computedStyle)},null,12,u)}const d=l("default",i(e,[["render",c]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","vue","./main-578bc0655a22d2a15a27.js","vue-router","single-spa","vuex","vuetify"],function(m,h){"use strict";var s,n,i,l,a,r;return{setters:[t=>{s=t.o},t=>{n=t.createElementBlock,i=t.openBlock,l=t.normalizeStyle,a=t.toDisplayString},t=>{r=t.d},null,null,null,null],execute:function(){const t={mixins:[s],data(){return{fontFamily:null,fontSize:null,fontWeight:"normal",fontStyle:"normal"}},computed:{labelText(){return this.parameters[0]},cssProps(){let e=null;return this.fontSize&&(e=this.fontSize+"px"),{"--font-family":this.fontFamily,"--font-size":e,"--font-weight":this.fontWeight,"--font-style":this.fontStyle}}},created(){this.verifyNumParams("LABEL",1,5,"LABEL <Text> <Font Family> <Font Size> <Font Weight> <Font Style>"),this.parameters[1]&&(this.fontFamily=this.parameters[1]),this.parameters[2]&&(this.fontSize=this.parameters[2]),this.parameters[3]&&(this.fontWeight=this.parameters[3]),this.parameters[4]&&(this.fontStyle=this.parameters[4])}};function f(e,p,c,y,S,o){return i(),n("div",{"data-test":"label",class:"pa-1 label",style:l([o.cssProps,e.computedStyle])},a(o.labelText),5)}const u=m("default",r(t,[["render",f],["__scopeId","data-v-60d4d785"]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","./LabelWidget-DSDYmz6X-7ae3a88e8215afbdf7b3.js","./LedWidget-D8cq4pUv-8402d4230fed1c0f3fc1.js","vue","./main-578bc0655a22d2a15a27.js","./DetailsDialog-DRVahE5z-512cc119f31f149412d0.js","single-spa","vue-router","vuex","vuetify"],function(g,x){"use strict";var l,r,a,s,i,o,c,n,u,d;return{setters:[e=>{l=e.o},e=>{r=e.default},e=>{a=e.default},e=>{s=e.resolveComponent,i=e.createElementBlock,o=e.openBlock,c=e.normalizeStyle,n=e.createVNode,u=e.mergeProps},e=>{d=e.d},null,null,null,null,null],execute:function(){const e={mixins:[l],components:{LabelWidget:r,LedWidget:a},computed:{labelName(){return[this.parameters[2]+":"]}}};function p(t,b,w,y,D,m){const f=s("label-widget"),v=s("led-widget");return o(),i("div",{ref:"container",class:"d-flex flex-row",style:c(t.computedStyle)},[n(f,{parameters:m.labelName,settings:[...t.appliedSettings],"widget-index":0},null,8,["parameters","settings"]),n(v,u(t.$attrs,{parameters:t.parameters,settings:[...t.appliedSettings],"screen-values":t.screenValues,"widget-index":1}),null,16,["parameters","settings","screen-values"])],4)}const S=g("default",d(e,[["render",p]]))}}});
@@ -1 +0,0 @@
1
- System.register(["./Widget-C3-TBgP7-b333f8a0c692a7d607b1.js","./LabelWidget-DSDYmz6X-7ae3a88e8215afbdf7b3.js","./ProgressbarWidget-oCgAEFBO-d8a02151a3081c51dfad.js","vue","./main-578bc0655a22d2a15a27.js","vue-router","single-spa","vuex","vuetify"],function(d,y){"use strict";var n,l,a,s,o,i,c,r,u,g;return{setters:[e=>{n=e.o},e=>{l=e.default},e=>{a=e.default},e=>{s=e.resolveComponent,o=e.createElementBlock,i=e.openBlock,c=e.normalizeStyle,r=e.createVNode,u=e.mergeProps},e=>{g=e.d},null,null,null,null],execute:function(){const e={mixins:[n],components:{LabelWidget:l,ProgressbarWidget:a},computed:{labelName(){return[this.parameters[2]+":"]}}};function p(t,S,x,w,B,m){const f=s("label-widget"),v=s("progressbar-widget");return i(),o("div",{ref:"container",class:"d-flex flex-row",style:c(t.computedStyle)},[r(f,{parameters:m.labelName,settings:[...t.appliedSettings],"widget-index":0},null,8,["parameters","settings"]),r(v,u(t.$attrs,{parameters:t.parameters,settings:[...t.appliedSettings],"screen-values":t.screenValues,style:t.computedStyle,"widget-index":1}),null,16,["parameters","settings","screen-values","style"])],4)}const b=d("default",g(e,[["render",p]]))}}});