openc3-cosmos-tool-cmdtlmserver 7.4.0 → 7.5.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.
- checksums.yaml +4 -4
- data/tools/cmdtlmserver/{ArrayWidget-CIDdZjk3-e93771de14c32c248c92.js → ArrayWidget-9OSo49r--717a71fa5a93a4306ec7.js} +2 -2
- data/tools/cmdtlmserver/{ArrayplotWidget-BfO1atvG-8b8fb63663cdcaf7deb3.js → ArrayplotWidget-D5C_WTX2-8ef1f79db3f1944b9c0b.js} +1 -1
- data/tools/cmdtlmserver/{BarColumn-CHX_3ye3-bd438bf972b67e4ed46c.js → BarColumn-CvHnnifr-c4951578f3fd3f76bfc6.js} +1 -1
- data/tools/cmdtlmserver/{BlockWidget-DSbunlY_-8140c3fc46c60895b065.js → BlockWidget-DuEDZ4dJ-967eda15c1451fca34fa.js} +2 -2
- data/tools/cmdtlmserver/{ButtonWidget-BB4ZOCI8-877b51169cdd22a77791.js → ButtonWidget-CZIUtd9z-61acef92520109286c0d.js} +1 -1
- data/tools/cmdtlmserver/CanvasWidget-C4-pXiKY-264004bbfd5904f1e69d.js +1 -0
- data/tools/cmdtlmserver/CanvasdotWidget-Bh0HHx67-b6476c69d59257ab08bc.js +1 -0
- data/tools/cmdtlmserver/{CanvasimageWidget-DY1DDf0a-a34fd029ec2d25c17273.js → CanvasimageWidget-Bu5NmsDs-cda2f1f9742ea195853b.js} +1 -1
- data/tools/cmdtlmserver/{CanvasimagevalueWidget-0lc2cCPV-2e9d2826ca46f991f111.js → CanvasimagevalueWidget-Dv8dQrnj-0b0689a4caece450db22.js} +1 -1
- data/tools/cmdtlmserver/CanvaslabelWidget-68IeeM3a-d8ee974f80ae555b6320.js +1 -0
- data/tools/cmdtlmserver/{CanvaslabelvalueWidget-Cf_dcDW2-bdf8b368fdb1fa71ebca.js → CanvaslabelvalueWidget-C6j_A4z6-2d9163c26db0115868c1.js} +1 -1
- data/tools/cmdtlmserver/{CanvaslineWidget-jg2ozQ0N-eb531c51bbb4d3dc6a91.js → CanvaslineWidget-BgQ6wLDv-6f3059055f7afe642488.js} +1 -1
- data/tools/cmdtlmserver/{CanvaslinevalueWidget-CKpjqlKA-17dde2a6a449ad806015.js → CanvaslinevalueWidget-C6-HkTJp-5717f7b45d0b57a344a4.js} +1 -1
- data/tools/cmdtlmserver/CheckbuttonWidget-DJmT73t9-dc118daa630bbe52aa2d.js +1 -0
- data/tools/cmdtlmserver/{CmdPacketsTab-f0d7bb17079717aaa76e.js → CmdPacketsTab-6f0b12d43c14a7da6718.js} +1 -1
- data/tools/cmdtlmserver/{CmdTlmServer-32bff3fcc4b2ce263346.js → CmdTlmServer-af3b7b8e2ea9bae2b3bd.js} +2 -2
- data/tools/cmdtlmserver/{ComboboxWidget-BzKkyRDT-d2609655726e617e6140.js → ComboboxWidget-vTtsjxRm-a15e957bce84abaae94e.js} +1 -1
- data/tools/cmdtlmserver/{DataFlowsTab-f8fa7ccddb2e11c0f4bd.js → DataFlowsTab-11ed530e003aefd013b6.js} +1 -1
- data/tools/cmdtlmserver/DateWidget-BjKIDtsf-a0a25d555d3032f182ea.js +1 -0
- data/tools/cmdtlmserver/{DetailsDialog-CLPj0nP0-a923096c03a16ab24ce5.js → DetailsDialog-S1nw1d0h-f0e9c707fdcfdc375368.js} +1 -1
- data/tools/cmdtlmserver/{DynamicWidget-yna_ejyc-67de1a2e4d3ca8e77d13.js → DynamicWidget-yna_ejyc-303515b4f32d2d98c6ee.js} +1 -1
- data/tools/cmdtlmserver/{FilechecksumWidget-DqNThsOX-9a244d23a05ba0cd4bc2.js → FilechecksumWidget-obppYSP4-700a6df90c74ce721080.js} +1 -1
- data/tools/cmdtlmserver/{FiledisplayWidget-BRhhiVEs-8aee77b81ad52706adde.js → FiledisplayWidget-BstroKFo-1648b09c912608be064e.js} +1 -1
- data/tools/cmdtlmserver/{FormatvalueWidget-pEjAh0h2-a8635e2292e64cf5e39f.js → FormatvalueWidget-MJIJg6Bf-0cd3eaea15a6bcd3ae72.js} +1 -1
- data/tools/cmdtlmserver/Graph-BL-czUPp-f5cc2eb30bdaad73b5ea.js +1 -0
- data/tools/cmdtlmserver/{GraphWidget-BZjBkefj-d9dcbf0fe719cf812d83.js → GraphWidget-C8KRp-QN-c0cd6dae0bf948656c58.js} +1 -1
- data/tools/cmdtlmserver/{HorizontalWidget-Brag6E4y-48ed7a3d841d69afb943.js → HorizontalWidget-Cn9qnYVh-badf3d172451b91a6d6f.js} +1 -1
- data/tools/cmdtlmserver/{HorizontalboxWidget-BnkH4cVq-a81cc9f7c04e629754a0.js → HorizontalboxWidget-gz8uYYFZ-96c1c64165978ab6eb9e.js} +1 -1
- data/tools/cmdtlmserver/HorizontallineWidget-CrDua5-L-debe3a4eea3dca880b37.js +1 -0
- data/tools/cmdtlmserver/{IframeWidget-Ciu5u58E-f35e28d26845c9ce425c.js → IframeWidget-CtS7MjKL-d9da1888b15c35e9c70b.js} +1 -1
- data/tools/cmdtlmserver/ImageLoader-Vpn27aUN-3490506bebda6aeb65a9.js +1 -0
- data/tools/cmdtlmserver/{ImageviewerWidget-vWMGPveb-3e068b180f6cf32ccd24.js → ImageviewerWidget-Kmzt8wuP-cc3b7e2f8ed939331fe4.js} +1 -1
- data/tools/cmdtlmserver/InterfaceFlowChart-50ef94018198e0750f4e.js +27 -0
- data/tools/cmdtlmserver/InterfacesTab-06eb69d86c8c7763e5cf.js +1 -0
- data/tools/cmdtlmserver/{LabelWidget-DVp0CmFH-97b4d14caae36b2b70fe.js → LabelWidget-DIZpHxYX-271eae93ef3508c18934.js} +1 -1
- data/tools/cmdtlmserver/LabelledWidget-CGxDI8XZ-eaf078ad95a37f4eeb80.js +1 -0
- data/tools/cmdtlmserver/{LabelprogressbarWidget-DME-BrZe-03f95b34969c5b14cff6.js → LabelprogressbarWidget-CXOc5p8G-b43b9d95abd873ade105.js} +1 -1
- data/tools/cmdtlmserver/LabelsparklineWidget-B_LuqFcA-1606a15bb9d50691d10e.js +1 -0
- data/tools/cmdtlmserver/LabelvalueWidget--G4wHMZL-160516ab83399994b95e.js +1 -0
- data/tools/cmdtlmserver/{LabelvaluedescWidget-c5BUCRxB-2656a7bcfe6096dc52cd.js → LabelvaluedescWidget-DqLK0wvi-b6d7c8ef799c34a4fb16.js} +1 -1
- data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-BWOQJkLP-e669bc66e0d31684a5b1.js +1 -0
- data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-BfF73Y2F-191505c7e8b4e463139d.js +1 -0
- data/tools/cmdtlmserver/LabelvaluerangebarWidget-CKsFRW6t-5d1f6dbda4b998ccdabd.js +1 -0
- data/tools/cmdtlmserver/{Layout-Df-lJgpB-914d505c295d7f5a9791.js → Layout-CGL1JfeU-73de442baff32d7d5e6d.js} +1 -1
- data/tools/cmdtlmserver/{LedWidget-C97EJXBo-ce386ba85aedd75e9d27.js → LedWidget-DrAJ8_fN-c3588bb9b46e0569d22d.js} +1 -1
- data/tools/cmdtlmserver/{LimitsBar-DNV39okL-cd07952d9c04ed1affbf.js → LimitsBar-CxPzG0Zv-7f26c239a2c59217ec3d.js} +1 -1
- data/tools/cmdtlmserver/{LimitsbarWidget-BIO6xztx-28058ac54835f172dbaf.js → LimitsbarWidget-1IayV5D7-e6979d0bff067d206a17.js} +1 -1
- data/tools/cmdtlmserver/{LimitscolorWidget-BGrNA65J-a076cfb171ef2babaa50.js → LimitscolorWidget-C7LY3BQ7-a99b7c32677dc6dd0e0c.js} +1 -1
- data/tools/cmdtlmserver/{LimitscolumnWidget-Bw6EXJs9-d6e1e239d7c084c9f7bf.js → LimitscolumnWidget-JhIc5Sjl-3b17971ca7ecfc14b21e.js} +1 -1
- data/tools/cmdtlmserver/{LinegraphWidget-Drf9tTPN-7c9a449d8dd3306582bf.js → LinegraphWidget-BaROxuUn-59d99dd742687e40b25c.js} +1 -1
- data/tools/cmdtlmserver/{MatrixbycolumnsWidget-C33-g7kK-76c56ce004a1c3313336.js → MatrixbycolumnsWidget-i0gGPMOV-10eb0a46073fb0d00269.js} +1 -1
- data/tools/cmdtlmserver/{OpenC3TimePicker-cOr0aOVn-5ffe76ce1ab1f7ec0439.js → OpenC3TimePicker-DDTLwTEw-8a687401b8e481dd9f49.js} +1 -1
- data/tools/cmdtlmserver/{ProgressbarWidget-DqfSMI10-ce9c22710e61dc0b0e7c.js → ProgressbarWidget-QxEq8C4A-6708ed1493b466f3ad73.js} +1 -1
- data/tools/cmdtlmserver/{RadiobuttonWidget-CSQeEacF-29953a844e8a06d304b9.js → RadiobuttonWidget-DYf3qvBq-c45fbd59c85839b1c318.js} +1 -1
- data/tools/cmdtlmserver/RadiogroupWidget-C0b_ckej-49f9b3ab6551820edc3b.js +1 -0
- data/tools/cmdtlmserver/{RangebarWidget-CJSUof1--8b45d597a2fa911a953e.js → RangebarWidget-DcSEHktI-3e039851d9a494b6e2ae.js} +1 -1
- data/tools/cmdtlmserver/{RawBuffer-d28de8d99b97e4d9e74a.js → RawBuffer-20fcdaa013d70717df58.js} +1 -1
- data/tools/cmdtlmserver/{RawDialog-d0bdc67425dd15985b00.js → RawDialog-6255b78ac1df55878a41.js} +1 -1
- data/tools/cmdtlmserver/{RollupWidget-C977Lkcx-5ea74809c15bc60824cc.js → RollupWidget-AVS4drYX-b0a691257195289fcde6.js} +1 -1
- data/tools/cmdtlmserver/RoutersTab-516132811cc284689266.js +1 -0
- data/tools/cmdtlmserver/{ScrollwindowWidget-BFxz61oW-6a02d29fb76c6bc1625a.js → ScrollwindowWidget-Dpf3BScA-1f5fbe37bb33cad8cf87.js} +1 -1
- data/tools/cmdtlmserver/{SignalWidget-BT6AcbBx-2f3a2c5e5b84c96df438.js → SignalWidget-Q1YtPsNw-e755da3f6cb293fbfb21.js} +1 -1
- data/tools/cmdtlmserver/SpacerWidget-DGEOqhu_-b6e91ca4474e9fced162.js +1 -0
- data/tools/cmdtlmserver/SparklineWidget-DbNWbNzY-7b515c109437aabe3fd7.js +1 -0
- data/tools/cmdtlmserver/{StatusTab-575b3032342d08db5f96.js → StatusTab-8631fd8a07a20ba8efba.js} +1 -1
- data/tools/cmdtlmserver/TabbookWidget-CrkPPZIF-e6f81964bd00b58621c6.js +1 -0
- data/tools/cmdtlmserver/{TargetsTab-b9f1a2b988ce8badd79d.js → TargetsTab-266cdd09e5f9024e2e14.js} +1 -1
- data/tools/cmdtlmserver/TextboxWidget-CfQEzaRr-e866fabef32754083217.js +1 -0
- data/tools/cmdtlmserver/TextfieldWidget-BQL8dOTg-c36896326e3dd7157a9b.js +1 -0
- data/tools/cmdtlmserver/{TimeWidget-BTaXBxVm-c61be141d1e5cc25062c.js → TimeWidget-DiE_oc7J-bb6ed7460bd103205f07.js} +1 -1
- data/tools/cmdtlmserver/TitleWidget-C5a_ZsqM-2cd2d562e7df0e7c2632.js +1 -0
- data/tools/cmdtlmserver/{TlmPacketsTab-f24389ab30f97699f498.js → TlmPacketsTab-a593eaef44a42f06465a.js} +1 -1
- data/tools/cmdtlmserver/{Updater-f4069804660e1d2bb1fb.js → Updater-72956875f00bf04ede7a.js} +1 -1
- data/tools/cmdtlmserver/VWidget-D4ipW0SF-3c58c7bbca21ca655106.js +1 -0
- data/tools/cmdtlmserver/ValueWidget-9JNo-Sk8-ad0f7e86109c8aa425a5.js +1 -0
- data/tools/cmdtlmserver/{ValuelimitsbarWidget-CqRkPwWS-51f01694576524ab034a.js → ValuelimitsbarWidget-CqiFVnaT-548886eac7b4e05b16a7.js} +1 -1
- data/tools/cmdtlmserver/ValuelimitscolumnWidget-DWDFVRNg-27123b8e5c3ac13ee8c8.js +1 -0
- data/tools/cmdtlmserver/ValuerangebarWidget-BAVMrD0L-ab4e3bf7f05c9ddde140.js +1 -0
- data/tools/cmdtlmserver/{VerticalWidget-CoJiy2TT-aaba0f3431f867ad36d1.js → VerticalWidget-Dw0j42K2-a0e847b1aea8f4d4919f.js} +1 -1
- data/tools/cmdtlmserver/{VerticalboxWidget-BD5Eq3BH-8de3b73d0af06049b633.js → VerticalboxWidget-xusQtXo0-16edecad2b21c8c04312.js} +1 -1
- data/tools/cmdtlmserver/{Widget-ClRi417b-9e12a24a4c1c96620549.js → Widget-Dy-YgkeU-68b553c0438f37998671.js} +1 -1
- data/tools/cmdtlmserver/main-19e35e0fd00beb1bdc37.js +1493 -0
- data/tools/cmdtlmserver/main.js +1 -1
- data/tools/cmdtlmserver/services-31b16a6b1924df6608ce.js +10 -0
- metadata +84 -84
- data/tools/cmdtlmserver/CanvasWidget-DsyMt7xW-7cfb9d7eaec179010426.js +0 -1
- data/tools/cmdtlmserver/CanvasdotWidget-BZpkCAoH-adf05ba917ad02a80cab.js +0 -1
- data/tools/cmdtlmserver/CanvaslabelWidget-C6TDW9WO-da217b5f77c7ca2537f1.js +0 -1
- data/tools/cmdtlmserver/CheckbuttonWidget-BWXinMaT-a54626829bc2de216d16.js +0 -1
- data/tools/cmdtlmserver/DateWidget-qUbLzQsX-b058fb471e3fcd797726.js +0 -1
- data/tools/cmdtlmserver/Graph-GVQZltap-916f8970fd5d42822d89.js +0 -1
- data/tools/cmdtlmserver/HorizontallineWidget-k7fL4EPN-3583b50d2753936758e5.js +0 -1
- data/tools/cmdtlmserver/ImageLoader-DH5e4lg8-3426a1c0f41a2bf44392.js +0 -1
- data/tools/cmdtlmserver/InterfaceFlowChart-9ca67c593f3f2b877ee3.js +0 -27
- data/tools/cmdtlmserver/InterfacesTab-b3f53afb2ca5b30d2920.js +0 -1
- data/tools/cmdtlmserver/LabelledWidget-1DeE1-6G-12aab221c27e077c7d31.js +0 -1
- data/tools/cmdtlmserver/LabelsparklineWidget-4iDHGnPL-f5ce9a4673c260d290c5.js +0 -1
- data/tools/cmdtlmserver/LabelvalueWidget-C6NQSHTb-84fc8a12ee8e4f0de54c.js +0 -1
- data/tools/cmdtlmserver/LabelvaluelimitsbarWidget-DBKZLpXJ-af39812293b33f70b279.js +0 -1
- data/tools/cmdtlmserver/LabelvaluelimitscolumnWidget-NdEu06go-fef2aa9ed08cdf93d61d.js +0 -1
- data/tools/cmdtlmserver/LabelvaluerangebarWidget-CL5HLK0t-5e27588fee9cb4b7e9b8.js +0 -1
- data/tools/cmdtlmserver/RadiogroupWidget-DlQN9z-Z-bf4604885d001ad1f14f.js +0 -1
- data/tools/cmdtlmserver/RoutersTab-06e215b54b2908b15301.js +0 -1
- data/tools/cmdtlmserver/SpacerWidget-B_f09KAi-d35a958be49dff620492.js +0 -1
- data/tools/cmdtlmserver/SparklineWidget-Bji9DILO-bc83a95dc405fc0453c5.js +0 -1
- data/tools/cmdtlmserver/TabbookWidget-B74U8t2i-9274e9ec55c4292f274e.js +0 -1
- data/tools/cmdtlmserver/TextboxWidget-CbKE9aSW-41ad0a5667b4b674d749.js +0 -1
- data/tools/cmdtlmserver/TextfieldWidget-CpdmfNk5-5fd1754fbc27b848e303.js +0 -1
- data/tools/cmdtlmserver/TitleWidget-ulO_gdVY-db3241f7de1f3c57a698.js +0 -1
- data/tools/cmdtlmserver/VWidget-C4VLQ7-b-4ba9d3f0cbd835b6e437.js +0 -1
- data/tools/cmdtlmserver/ValueWidget-B3-Jjoux-a1da92404f65428e9c38.js +0 -1
- data/tools/cmdtlmserver/ValuelimitscolumnWidget-CF4CN14a-7d5d1d7a571bb56f6f9b.js +0 -1
- data/tools/cmdtlmserver/ValuerangebarWidget-DJtrknKH-4e5ab6bdc8c7135368d5.js +0 -1
- data/tools/cmdtlmserver/main-c7bd98cfab79a58efd19.js +0 -1493
- data/tools/cmdtlmserver/services-cd44604ec0d9ce785778.js +0 -10
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
System.register([],(function(Qe,Po){"use strict";return{execute:(function(){function Ot(t,e){return function(){return t.apply(e,arguments)}}const{toString:Xr}=Object.prototype,{getPrototypeOf:Y}=Object,{iterator:be,toStringTag:Rt}=Symbol,_e=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),xt=t=>typeof t=="string"&&(t==="__proto__"||t==="constructor"||t==="prototype"),At=(t,e,r)=>t===Object.prototype||!r&&e===null,Qr=t=>{if(!Object.isExtensible(t))return!1;const e=Object.getOwnPropertyNames(t);return Object.getOwnPropertySymbols&&e.push(...Object.getOwnPropertySymbols(t)),e.every(r=>{if(xt(r))return!1;const s=Object.getOwnPropertyDescriptor(t,r);return!!s&&s.configurable&&s.writable===!0})},ye=(t,e)=>{let r=t;const s=[];for(;r!=null;){if(s.indexOf(r)!==-1)return!1;s.push(r);const n=Y(r);if(At(r,n,r===t))return!1;if(_e(r,e))return!0;r=n}return!1},Gr=(t,e)=>t!=null&&ye(t,e)?t[e]:void 0,Zr=t=>{if(t==null||typeof t!="object"&&typeof t!="function")return t;const e=Y(t);if(e===null&&Qr(t))return t;const r=Object.create(null),s=Object.create(null),n=[];let o=t;for(;o!=null&&n.indexOf(o)===-1;){n.push(o);const i=o===t?e:Y(o);if(At(o,i,o===t))break;const c=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&c.push(...Object.getOwnPropertySymbols(o));for(const l of c)xt(l)||_e(s,l)||(r[l]=t[l],s[l]=!0);o=i}return r},Ge=(t=>e=>{const r=Xr.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),$=t=>(t=t.toLowerCase(),e=>Ge(e)===t),Ie=t=>e=>typeof e===t,{isArray:te}=Array,re=Ie("undefined");function de(t){return t!==null&&!re(t)&&t.constructor!==null&&!re(t.constructor)&&D(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Pt=$("ArrayBuffer");function Yr(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Pt(t.buffer),e}const es=Ie("string"),D=Ie("function"),Ct=Ie("number"),fe=t=>t!==null&&typeof t=="object",ts=t=>t===!0||t===!1,Le=t=>{if(!fe(t))return!1;const e=Y(t);return(e===null||e===Object.prototype||Y(e)===null)&&!ye(t,Rt)&&!ye(t,be)},rs=t=>{if(!fe(t)||de(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},ss=$("Date"),ns=$("File"),is=t=>!!(t&&typeof t.uri<"u"),os=t=>t&&typeof t.getParts<"u",cs=$("Blob"),as=$("FileList"),ls=$("Set"),us=t=>fe(t)&&D(t.pipe);function hs(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Tt=hs(),jt=typeof Tt.FormData<"u"?Tt.FormData:void 0,ds=t=>{if(!t)return!1;if(jt&&t instanceof jt)return!0;const e=Y(t);if(!e||e===Object.prototype||!D(t.append))return!1;const r=Ge(t);return r==="formdata"||r==="object"&&D(t.toString)&&t.toString()==="[object FormData]"},fs=$("URLSearchParams"),[ps,gs,ms,bs]=["ReadableStream","Request","Response","Headers"].map($),_s=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function we(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,n;if(typeof t!="object"&&(t=[t]),te(t))for(s=0,n=t.length;s<n;s++)e.call(null,t[s],s,t);else{if(de(t))return;const o=r?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let c;for(s=0;s<i;s++)c=o[s],e.call(null,t[c],c,t)}}function kt(t,e){if(de(t))return null;e=e.toLowerCase();const r=Object.keys(t);let s=r.length,n;for(;s-- >0;)if(n=r[s],e===n.toLowerCase())return n;return null}const se=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Nt=t=>!re(t)&&t!==se;function Ze(...t){const{caseless:e,skipUndefined:r}=Nt(this)&&this||{},s={},n=(o,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const c=e&&typeof i=="string"&&kt(s,i)||i,l=_e(s,c)?s[c]:void 0;Le(l)&&Le(o)?s[c]=Ze(l,o):Le(o)?s[c]=Ze({},o):te(o)?s[c]=o.slice():(!r||!re(o))&&(s[c]=o)};for(let o=0,i=t.length;o<i;o++){const c=t[o];if(!c||de(c)||(we(c,n),typeof c!="object"||te(c)))continue;const l=Object.getOwnPropertySymbols(c);for(let h=0;h<l.length;h++){const u=l[h];Ts.call(c,u)&&n(c[u],u)}}return s}const ys=(t,e,r,{allOwnKeys:s}={})=>(we(e,(n,o)=>{r&&D(n)?Object.defineProperty(t,o,{__proto__:null,value:Ot(n,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,o,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),t),ws=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Es=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:e.prototype}),r&&Object.assign(t.prototype,r)},Ss=(t,e,r,s)=>{let n,o,i;const c={};if(e=e||{},t==null)return e;do{for(n=Object.getOwnPropertyNames(t),o=n.length;o-- >0;)i=n[o],(!s||s(i,t,e))&&!c[i]&&(e[i]=t[i],c[i]=!0);t=r!==!1&&Y(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},vs=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const s=t.indexOf(e,r);return s!==-1&&s===r},Os=t=>{if(!t)return null;if(te(t))return t;let e=t.length;if(!Ct(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Rs=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Y(Uint8Array)),xs=(t,e)=>{const r=(t&&t[be]).call(t);let s;for(;(s=r.next())&&!s.done;){const n=s.value;e.call(t,n[0],n[1])}},As=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},Ps=$("HTMLFormElement"),Cs=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,r,s){return r.toUpperCase()+s}),{propertyIsEnumerable:Ts}=Object.prototype,js=$("RegExp"),It=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};we(r,(n,o)=>{let i;(i=e(n,o,t))!==!1&&(s[o]=i||n)}),Object.defineProperties(t,s)},ks=t=>{It(t,(e,r)=>{if(D(t)&&["arguments","caller","callee"].includes(r))return!1;const s=t[r];if(D(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Ns=(t,e)=>{const r={},s=n=>{n.forEach(o=>{r[o]=!0})};return te(t)?s(t):s(String(t).split(e)),r},Is=()=>{},Ls=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Us(t){return!!(t&&D(t.append)&&t[Rt]==="FormData"&&t[be])}const Ds=t=>{const e=new WeakSet,r=s=>{if(fe(s)){if(e.has(s))return;if(de(s))return s;if(!("toJSON"in s)){e.add(s);let n;if(ls(s)){n=[];for(const o of s){const i=r(o);!re(i)&&n.push(i)}}else n=te(s)?[]:{},we(s,(o,i)=>{const c=r(o);!re(c)&&(n[i]=c)});return e.delete(s),n}}return s};return r(t)},Fs=$("AsyncFunction"),$s=t=>t&&(fe(t)||D(t))&&D(t.then)&&D(t.catch),Lt=((t,e)=>t?setImmediate:e?((r,s)=>(se.addEventListener("message",({source:n,data:o})=>{n===se&&o===r&&s.length&&s.shift()()},!1),n=>{s.push(n),se.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",D(se.postMessage)),qs=typeof queueMicrotask<"u"?queueMicrotask.bind(se):typeof process<"u"&&process.nextTick||Lt,Ut=t=>t!=null&&D(t[be]),Bs=t=>t!=null&&ye(t,be)&&Ut(t),a={isArray:te,isArrayBuffer:Pt,isBuffer:de,isFormData:ds,isArrayBufferView:Yr,isString:es,isNumber:Ct,isBoolean:ts,isObject:fe,isPlainObject:Le,isEmptyObject:rs,isReadableStream:ps,isRequest:gs,isResponse:ms,isHeaders:bs,isUndefined:re,isDate:ss,isFile:ns,isReactNativeBlob:is,isReactNative:os,isBlob:cs,isRegExp:js,isFunction:D,isStream:us,isURLSearchParams:fs,isTypedArray:Rs,isFileList:as,forEach:we,merge:Ze,extend:ys,trim:_s,stripBOM:ws,inherits:Es,toFlatObject:Ss,kindOf:Ge,kindOfTest:$,endsWith:vs,toArray:Os,forEachEntry:xs,matchAll:As,isHTMLForm:Ps,hasOwnProperty:_e,hasOwnProp:_e,hasOwnInPrototypeChain:ye,getSafeProp:Gr,toSafeFlatObject:Zr,reduceDescriptors:It,freezeMethods:ks,toObjectSet:Ns,toCamelCase:Cs,noop:Is,toFiniteNumber:Ls,findKey:kt,global:se,isContextDefined:Nt,isSpecCompliantForm:Us,toJSONObject:Ds,isAsyncFn:Fs,isThenable:$s,setImmediate:Lt,asap:qs,isIterable:Ut,isSafeIterable:Bs},Ms=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zs=t=>{const e={};let r,s,n;return t&&t.split(`
|
|
2
|
-
`).forEach(function(o){n=o.indexOf(":"),r=o.substring(0,n).trim().toLowerCase(),s=o.substring(n+1).trim();const i=a.hasOwnProp(e,r);!r||i&&a.hasOwnProp(Ms,r)||(r==="set-cookie"?i?e[r].push(s):e[r]=[s]:e[r]=i?e[r]+", "+s:s)}),e};function Ws(t){let e=0,r=t.length;for(;e<r;){const s=t.charCodeAt(e);if(s!==9&&s!==32)break;e+=1}for(;r>e;){const s=t.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return e===0&&r===t.length?t:t.slice(e,r)}const Js=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Hs=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Ye(t,e){return a.isArray(t)?t.map(r=>Ye(r,e)):Ws(String(t).replace(e,""))}const Vs=t=>Ye(t,Js),Ks=t=>Ye(t,Hs);function Dt(t){const e=Object.create(null);return a.forEach(t.toJSON(),(r,s)=>{e[s]=Ks(r)}),e}const Ft=Symbol("internals");function Ee(t){return t&&String(t).trim().toLowerCase()}function Ue(t){return t===!1||t==null?t:a.isArray(t)?t.map(Ue):Vs(String(t))}function Xs(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}const Qs=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function et(t){let e=0,r=t.length;for(;e<r;){const s=t.charCodeAt(e);if(s!==9&&s!==32)break;e+=1}for(;r>e;){const s=t.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return e===0&&r===t.length?t:t.slice(e,r)}function Gs(t){const e=t.length-1;if(e<1||t.charCodeAt(0)!==34||t.charCodeAt(e)!==34)return t;let r="";for(let s=1;s<e;s++){const n=t.charCodeAt(s);if(n===34||n===92&&(s+=1,s>=e))return t;r+=t[s]}return r}function Zs(t){const e=Object.create(null),r=String(t);let s=0,n=!1,o=!1;function i(c){const l=et(r.slice(s,c)),h=l.indexOf("=");if(h<1)return;const u=et(l.slice(0,h));if(!Qs.test(u))return;const d=u.toLowerCase();if(d==="__proto__"||d==="constructor"||d==="prototype")return;const p=et(l.slice(h+1));e[d]=Gs(p)}for(let c=0;c<r.length;c++){const l=r.charCodeAt(c);n?o?o=!1:l===92?o=!0:l===34&&(n=!1):l===34?n=!0:(l===44||l===59)&&(i(c),s=c+1)}return i(r.length),e}const Ys=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function tt(t,e,r,s,n){if(a.isFunction(s))return s.call(this,e,r);if(n&&(e=r),!!a.isString(e)){if(a.isString(s))return e.indexOf(s)!==-1;if(a.isRegExp(s))return s.test(e)}}function en(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function tn(t,e){const r=a.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{__proto__:null,value:function(n,o,i){return this[s].call(this,e,n,o,i)},configurable:!0})})}let k=class{constructor(t){t&&this.set(t)}set(t,e,r){const s=this;function n(i,c,l){const h=Ee(c);if(!h)return;const u=a.findKey(s,h);(!u||s[u]===void 0||l===!0||l===void 0&&s[u]!==!1)&&(s[u||c]=Ue(i))}const o=(i,c)=>a.forEach(i,(l,h)=>n(l,h,c));if(a.isPlainObject(t)||t instanceof this.constructor)o(t,e);else if(a.isString(t)&&(t=t.trim())&&!Ys(t))o(zs(t),e);else if(a.isObject(t)&&a.isSafeIterable(t)){let i=Object.create(null),c,l;for(const h of t){if(!a.isArray(h))throw new TypeError("Object iterator must return a key-value pair");l=h[0],a.hasOwnProp(i,l)?(c=i[l],i[l]=a.isArray(c)?[...c,h[1]]:[c,h[1]]):i[l]=h[1]}o(i,e)}else t!=null&&n(e,t,r);return this}get(t,e){if(t=Ee(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!e)return s;if(e===!0)return Xs(s);if(a.isFunction(e))return e.call(this,s,r);if(a.isRegExp(e))return e.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Ee(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!e||tt(this,this[r],r,e)))}return!1}delete(t,e){const r=this;let s=!1;function n(o){if(o=Ee(o),o){const i=a.findKey(r,o);i&&(!e||tt(r,r[i],i,e))&&(delete r[i],s=!0)}}return a.isArray(t)?t.forEach(n):n(t),s}clear(t){const e=Object.keys(this);let r=e.length,s=!1;for(;r--;){const n=e[r];(!t||tt(this,this[n],n,t,!0))&&(delete this[n],s=!0)}return s}normalize(t){const e=this,r={};return a.forEach(this,(s,n)=>{const o=a.findKey(r,n);if(o){e[o]=Ue(s),delete e[n];return}const i=t?en(n):String(n).trim();i!==n&&delete e[n],e[i]=Ue(s),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(e[s]=t&&a.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
|
|
3
|
-
`)}getSetCookie(){const t=this.get("set-cookie");return a.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Zs(t)}static concat(t,...e){const r=new this(t);return e.forEach(s=>r.set(s)),r}static accessor(t){const e=(this[Ft]=this[Ft]={accessors:{}}).accessors,r=this.prototype;function s(n){const o=Ee(n);e[o]||(tn(r,n),e[o]=!0)}return a.isArray(t)?t.forEach(s):s(t),this}};k.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(k.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}}),a.freezeMethods(k);const De="[REDACTED ****]";function rn(t){if(a.hasOwnProp(t,"toJSON"))return!0;let e=Object.getPrototypeOf(t);for(;e&&e!==Object.prototype;){if(a.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function sn(t,e){const r=new Set(e.map(o=>String(o).toLowerCase())),s=[],n=o=>{if(o===null||typeof o!="object"||a.isBuffer(o))return o;if(s.indexOf(o)!==-1)return;o instanceof k&&(o=o.toJSON()),s.push(o);let i;if(a.isArray(o))i=[],o.forEach((c,l)=>{const h=n(c);a.isUndefined(h)||(i[l]=h)});else{if(!a.isPlainObject(o)&&rn(o))return s.pop(),o;i=Object.create(null);for(const[c,l]of Object.entries(o)){const h=r.has(c.toLowerCase())?De:n(l);a.isUndefined(h)||(i[c]=h)}}return s.pop(),i};return n(t)}function $t(t){try{return String(t)}catch{return""}}function nn(t){return t.errors.map(e=>{try{return e&&e.message?$t(e.message):$t(e)}catch{return""}}).filter(Boolean).join("; ")||t.name||"AggregateError"}let f=class Vr extends Error{static from(e,r,s,n,o,i){let c=e.message;!c&&a.isArray(e.errors)&&e.errors.length&&(c=nn(e));const l=new Vr(c,r||e.code,s,n,o);return Object.defineProperty(l,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),l.name=e.name,e.status!=null&&l.status==null&&(l.status=e.status),i&&Object.assign(l,i),l}constructor(e,r,s,n,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),s&&(this.config=s),n&&(this.request=n),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,r=e&&a.hasOwnProp(e,"redact")?e.redact:void 0,s=a.isArray(r)&&r.length>0?sn(e,r):a.toJSONObject(e);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:s,code:this.code,status:this.status}}};f.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",f.ERR_BAD_OPTION="ERR_BAD_OPTION",f.ECONNABORTED="ECONNABORTED",f.ETIMEDOUT="ETIMEDOUT",f.ECONNREFUSED="ECONNREFUSED",f.ERR_NETWORK="ERR_NETWORK",f.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",f.ERR_DEPRECATED="ERR_DEPRECATED",f.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",f.ERR_BAD_REQUEST="ERR_BAD_REQUEST",f.ERR_CANCELED="ERR_CANCELED",f.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",f.ERR_INVALID_URL="ERR_INVALID_URL",f.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const on=null,qt=100;function rt(t){return a.isPlainObject(t)||a.isArray(t)}function Bt(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function st(t,e,r){return t?t.concat(e).map(function(s,n){return s=Bt(s),!r&&n?"["+s+"]":s}).join(r?".":""):e}function cn(t){return a.isArray(t)&&!t.some(rt)}const an=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function Fe(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const s=(g,_)=>{const E=a.getSafeProp(r,g);return a.isUndefined(E)?_:E},n=s("metaTokens",!0),o=s("visitor")||x,i=s("dots",!1),c=s("indexes",!1),l=s("Blob")||typeof Blob<"u"&&Blob,h=s("maxDepth",qt),u=l&&a.isSpecCompliantForm(e),d=[];if(!a.isFunction(o))throw new TypeError("visitor must be a function");function p(g){if(g===null)return"";if(a.isDate(g))return g.toISOString();if(a.isBoolean(g))return g.toString();if(!u&&a.isBlob(g))throw new f("Blob is not supported. Use a Buffer instead.");if(a.isArrayBuffer(g)||a.isTypedArray(g)){if(u&&typeof l=="function")return new l([g]);throw new f("Blob is not supported. Use a Buffer instead.",f.ERR_NOT_SUPPORT)}return g}function m(g){if(g>h)throw new f("Object is too deeply nested ("+g+" levels). Max depth: "+h,f.ERR_FORM_DATA_DEPTH_EXCEEDED)}function v(g,_){if(h===1/0)return JSON.stringify(g);const E=[];return JSON.stringify(g,function(A,R){if(!a.isObject(R))return R;for(;E.length&&E[E.length-1]!==this;)E.pop();return E.push(R),m(_+E.length-1),R})}function x(g,_,E){let A=g;if(a.isReactNative(e)&&a.isReactNativeBlob(g))return e.append(st(E,_,i),p(g)),!1;if(g&&!E&&typeof g=="object"){if(a.endsWith(_,"{}"))_=n?_:_.slice(0,-2),g=v(g,1);else if(a.isArray(g)&&cn(g)||(a.isFileList(g)||a.endsWith(_,"[]"))&&(A=a.toArray(g)))return _=Bt(_),A.forEach(function(R,ae){!(a.isUndefined(R)||R===null)&&e.append(c===!0?st([_],ae,i):c===null?_:_+"[]",p(R))}),!1}return rt(g)?!0:(e.append(st(E,_,i),p(g)),!1)}const b=Object.assign(an,{defaultVisitor:x,convertValue:p,isVisitable:rt});function y(g,_,E=0){if(!a.isUndefined(g)){if(m(E),d.indexOf(g)!==-1)throw new Error("Circular reference detected in "+_.join("."));d.push(g),a.forEach(g,function(A,R){(!(a.isUndefined(A)||A===null)&&o.call(e,A,a.isString(R)?R.trim():R,_,b))===!0&&y(A,_?_.concat(R):[R],E+1)}),d.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return y(t),e}function Mt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(r){return e[r]})}function nt(t,e){this._pairs=[],t&&Fe(t,this,e)}const zt=nt.prototype;zt.append=function(t,e){this._pairs.push([t,e])},zt.toString=function(t){const e=t?r=>t.call(this,r,Mt):Mt;return this._pairs.map(function(r){return e(r[0])+"="+e(r[1])},"").join("&")};function ln(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Wt(t,e,r){if(!e)return t;t=t||"";const s=a.isFunction(r)?{serialize:r}:r,n=a.getSafeProp(s,"encode")||ln,o=a.getSafeProp(s,"serialize");let i;if(o?i=o(e,s):i=a.isURLSearchParams(e)?e.toString():new nt(e,s).toString(n),i){const c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}const Se=Symbol("internals");function Jt(t){return t?t.length:0}function Ht(t){if(t)for(;t.length&&t[t.length-1]===null;)t.pop()}function ve(t,e){const r=t.handlers,s=Jt(r);r!==e.handlersRef?(e.handlersRef=r,e.handlerEntries.clear()):s!==e.handlersLength&&(s?e.handlerEntries.forEach(function(n,o){r[n.index]!==n.handler&&e.handlerEntries.delete(o)}):e.handlerEntries.clear()),e.handlersLength=s}class Vt{constructor(){this.handlers=[],this[Se]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,r,s){const n={fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null},o=this[Se];this.handlers==null&&(this.handlers=[]),ve(this,o);const i=o.nextId++;return this.handlers.push(n),o.handlerEntries.set(i,{handler:n,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}eject(e){const r=this[Se];ve(this,r);const s=r.handlerEntries.get(e);if(s){if(r.handlerEntries.delete(e),this.handlers[s.index]!==s.handler)return;this.handlers[s.index]=null,r.iterationDepth||(Ht(this.handlers),r.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],ve(this,this[Se]))}forEach(e){const r=this[Se];ve(this,r),r.iterationDepth++;try{a.forEach(this.handlers,function(s){s!==null&&e(s)})}finally{--r.iterationDepth||(ve(this,r),Ht(this.handlers),r.handlersLength=Jt(this.handlers))}}}const it={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},un=typeof URLSearchParams<"u"?URLSearchParams:nt,hn=typeof FormData<"u"?FormData:null,dn=typeof Blob<"u"?Blob:null,fn={isBrowser:!0,classes:{URLSearchParams:un,FormData:hn,Blob:dn},protocols:["http","https","file","blob","url","data"]},ot=typeof window<"u"&&typeof document<"u",ct=typeof navigator=="object"&&navigator||void 0,pn=ot&&(!ct||["ReactNative","NativeScript","NS"].indexOf(ct.product)<0),gn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",mn=ot&&window.location.href||"http://localhost",bn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ot,hasStandardBrowserEnv:pn,hasStandardBrowserWebWorkerEnv:gn,navigator:ct,origin:mn},Symbol.toStringTag,{value:"Module"})),j={...bn,...fn};function _n(t,e){return Fe(t,new j.classes.URLSearchParams,{visitor:function(r,s,n,o){return j.isNode&&a.isBuffer(r)?(this.append(s,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...e})}const Kt=qt;function Xt(t){if(t>Kt)throw new f("FormData field is too deeply nested ("+t+" levels). Max depth: "+Kt,f.ERR_FORM_DATA_DEPTH_EXCEEDED)}function yn(t){const e=[],r=/[^.[\]]+|\[([^.[\]]*)]/g;let s;for(;(s=r.exec(t))!==null;)Xt(e.length),e.push(s[0]==="[]"?"":s[1]||s[0]);return e}function wn(t){const e={},r=Object.keys(t);let s;const n=r.length;let o;for(s=0;s<n;s++)o=r[s],e[o]=t[o];return e}function Qt(t){function e(r,s,n,o){Xt(o);let i=r[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),l=o>=r.length;return i=!i&&a.isArray(n)?n.length:i,l?(a.hasOwnProp(n,i)?n[i]=a.isArray(n[i])?n[i].concat(s):[n[i],s]:n[i]=s,!c):((!a.hasOwnProp(n,i)||!a.isObject(n[i]))&&(n[i]=[]),e(r,s,n[i],o)&&a.isArray(n[i])&&(n[i]=wn(n[i])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const r={};return a.forEachEntry(t,(s,n)=>{e(yn(s),n,r,0)}),r}return null}const Gt=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),pe=(t,e)=>t!=null&&a.hasOwnProp(t,e)?t[e]:void 0;function En(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}const Oe={transitional:it,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const r=e.getContentType()||"",s=r.indexOf("application/json")>-1,n=a.isObject(t);if(n&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(Qt(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let o;if(n){const i=pe(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return _n(t,i).toString();if((o=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=pe(this,"env"),l=c&&c.FormData;return Fe(o?{"files[]":t}:t,l&&new l,i)}}return n||s?(e.setContentType("application/json",!1),En(t)):t}],transformResponse:[function(t){const e=pe(this,"transitional")||Oe.transitional,r=e&&e.forcedJSONParsing,s=pe(this,"responseType"),n=s==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!s||n)){const o=!(e&&e.silentJSONParsing)&&n;try{return JSON.parse(t,pe(this,"parseReviver"))}catch(i){if(o)throw i.name==="SyntaxError"?f.from(i,f.ERR_BAD_RESPONSE,this,null,pe(this,"response")):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:j.classes.FormData,Blob:j.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(Gt,t=>{Oe.headers[t]={}});function at(t,e){const r=this||Oe,s=e||r,n=k.from(s.headers);let o=s.data;return a.forEach(t,function(i){o=i.call(r,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function Zt(t){return!!(t&&t.__CANCEL__)}let Re=class extends f{constructor(t,e,r){super(t??"canceled",f.ERR_CANCELED,e,r),this.name="CanceledError",this.__CANCEL__=!0}};function Yt(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new f("Request failed with status code "+r.status,r.status>=400&&r.status<500?f.ERR_BAD_REQUEST:f.ERR_BAD_RESPONSE,r.config,r.request,r))}const Sn=/[\t\n\r]/g;function er(t){if(typeof t!="string")return t;let e=0;for(;e<t.length&&t.charCodeAt(e)<=32;)e++;return t.slice(e).replace(Sn,"")}function lt(t){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(t);return e&&e[1]||""}function vn(t,e){t=t||10;const r=new Array(t),s=new Array(t);let n=0,o=0,i;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),h=s[o];i||(i=l),r[n]=c,s[n]=l;let u=o,d=0;for(;u!==n;)d+=r[u++],u=u%t;if(n=(n+1)%t,n===o&&(o=(o+1)%t),l-i<e)return;const p=h&&l-h;return p?Math.round(d*1e3/p):void 0}}function On(t,e){let r=0,s=1e3/e,n,o;const i=(c,l=Date.now())=>{r=l,n=null,o&&(clearTimeout(o),o=null),t(...c)};return[(...c)=>{const l=Date.now(),h=l-r;h>=s?i(c,l):(n=c,o||(o=setTimeout(()=>{o=null,i(n)},s-h)))},()=>n&&i(n),(...c)=>i(c)]}const $e=(t,e,r=3)=>{let s=0;const n=vn(50,250);return On(o=>{if(!o||!a.isNumber(o.loaded))return;const i=o.loaded,c=o.lengthComputable?o.total:void 0,l=Math.max(0,c!=null?Math.min(i,c):i),h=Math.max(0,l-s),u=n(h);s=Math.max(s,l);const d={loaded:l,total:c,progress:c?l/c:void 0,bytes:h,rate:u||void 0,estimated:u&&c?(c-l)/u:void 0,event:o,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(d)},r)},tr=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},rr=(t,e=a.asap)=>(...r)=>e(()=>t(...r)),Rn=j.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,j.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(j.origin),j.navigator&&/(msie|trident)/i.test(j.navigator.userAgent)):()=>!0,xn=j.hasStandardBrowserEnv?{write(t,e,r,s,n,o,i){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(e)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(s)&&c.push(`path=${s}`),a.isString(n)&&c.push(`domain=${n}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let r=0;r<e.length;r++){const s=e[r].replace(/^\s+/,""),n=s.indexOf("=");if(n!==-1&&s.slice(0,n)===t)try{return decodeURIComponent(s.slice(n+1))}catch{return s.slice(n+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function An(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Pn(t,e){if(!e)return t;let r=t.length;for(;r>0&&t.charCodeAt(r-1)===47;)r--;return t.slice(0,r)+"/"+e.replace(/^\/+/,"")}const Cn=/^https?:(?!\/\/)/i;function Tn(t){return t&&t.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,r,s="")=>`${r}${s}${De}`)}function jn(t){const e=t.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${De}@`),r=e.indexOf("#"),s=(r===-1?e:e.slice(0,r)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${De}`);return r===-1?s:`${s}#${Tn(e.slice(r+1))}`}function sr(t,e){if(typeof t=="string"){const r=er(t);if(Cn.test(r))throw new f(`Invalid URL ${JSON.stringify(jn(r))}: missing "//" after protocol`,f.ERR_INVALID_URL,e)}}function nr(t,e,r,s){sr(e,s);let n=!An(e);return t&&(n||r===!1)?(sr(t,s),Pn(t,e)):e}const ir=t=>t instanceof k?{...t}:t,kn=t=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(t).concat(Object.getOwnPropertySymbols(t).filter(e=>Object.getOwnPropertyDescriptor(t,e).enumerable)):Object.keys(t);function ne(t,e){t=t||{},e=e||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function s(u,d,p,m){return a.isPlainObject(u)&&a.isPlainObject(d)?a.merge.call({caseless:m},u,d):a.isPlainObject(d)?a.merge({},d):a.isArray(d)?d.slice():d}function n(u,d,p,m){if(a.isUndefined(d)){if(!a.isUndefined(u))return s(void 0,u,p,m)}else return s(u,d,p,m)}function o(u,d){if(!a.isUndefined(d))return s(void 0,d)}function i(u,d){if(a.isUndefined(d)){if(!a.isUndefined(u))return s(void 0,u)}else return s(void 0,d)}function c(u){const d=a.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!a.isUndefined(d))if(a.isPlainObject(d)){if(a.hasOwnProp(d,u))return d[u]}else return;const p=a.hasOwnProp(t,"transitional")?t.transitional:void 0;if(a.isPlainObject(p)&&a.hasOwnProp(p,u))return p[u]}function l(u,d,p){if(a.hasOwnProp(e,p))return s(u,d);if(a.hasOwnProp(t,p))return s(void 0,u)}const h={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutErrorMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,allowedSocketPaths:i,responseEncoding:i,validateStatus:l,headers:(u,d,p)=>n(ir(u),ir(d),p,!0)};return a.forEach(kn({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const d=a.hasOwnProp(h,u)?h[u]:n,p=a.hasOwnProp(t,u)?t[u]:void 0,m=a.hasOwnProp(e,u)?e[u]:void 0,v=d(p,m,u);a.isUndefined(v)&&d!==l||(r[u]=v)}),a.hasOwnProp(e,"validateStatus")&&a.isUndefined(e.validateStatus)&&c("validateStatusUndefinedResolves")===!1&&(a.hasOwnProp(t,"validateStatus")?r.validateStatus=s(void 0,t.validateStatus):delete r.validateStatus),r}const Nn=["content-type","content-length"];function In(t,e,r){if(r!=="content-only"){t.set(e);return}Object.entries(e||{}).forEach(([s,n])=>{Nn.includes(s.toLowerCase())&&t.set(s,n)})}const Ln=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,r)=>String.fromCharCode(parseInt(r,16)));function or(t){const e=ne({},t),r=p=>a.hasOwnProp(e,p)?e[p]:void 0,s=r("data");let n=r("withXSRFToken");const o=r("xsrfHeaderName"),i=r("xsrfCookieName");let c=r("headers");const l=r("auth"),h=r("baseURL"),u=r("allowAbsoluteUrls"),d=r("url");if(e.headers=c=k.from(c),e.url=Wt(nr(h,d,u,e),r("params"),r("paramsSerializer")),l){const p=a.getSafeProp(l,"username")||"",m=a.getSafeProp(l,"password")||"";try{c.set("Authorization","Basic "+btoa(p+":"+(m?Ln(m):"")))}catch(v){throw f.from(v,f.ERR_BAD_OPTION_VALUE,t)}}if(a.isFormData(s)){const p=a.getSafeProp(s,"getHeaders");j.hasStandardBrowserEnv||j.hasStandardBrowserWebWorkerEnv||a.isReactNative(s)?c.setContentType(void 0):a.isFunction(p)&&In(c,p.call(s),r("formDataHeaderPolicy"))}if(j.hasStandardBrowserEnv&&(a.isFunction(n)&&(n=n(e)),n===!0||n==null&&Rn(e.url))){const p=o&&i&&xn.read(i);p&&c.set(o,p)}return e}const Un=typeof XMLHttpRequest<"u",Dn=Un&&function(t){return new Promise(function(e,r){const s=or(t);let n=s.data;const o=k.from(s.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:l}=s,h,u,d,p,m,v;function x(){p&&p(),m&&m(),s.cancelToken&&s.cancelToken.unsubscribe(h),s.signal&&s.signal.removeEventListener("abort",h)}let b=new XMLHttpRequest;b.open(s.method.toUpperCase(),s.url,!0),b.timeout=s.timeout;function y(_){if(!b)return;if(b.status===0&&(lt(er(s.url))||lt(j.origin))!=="file"&&!(b.responseURL&&b.responseURL.startsWith("file:"))){r(new f("Request aborted",f.ECONNABORTED,t,b)),x(),b=null;return}try{_?v&&v(_):m&&m()}catch(R){setTimeout(()=>{throw R})}if(!b)return;const E=k.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),A={data:!i||i==="text"||i==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:E,config:t,request:b};Yt(function(R){e(R),x()},function(R){r(R),x()},A),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(y)},b.onabort=function(){b&&(r(new f("Request aborted",f.ECONNABORTED,t,b)),x(),b=null)},b.onerror=function(_){const E=_&&_.message?_.message:"Network Error",A=new f(E,f.ERR_NETWORK,t,b);A.event=_||null,r(A),x(),b=null},b.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||it;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),r(new f(_,E.clarifyTimeoutError?f.ETIMEDOUT:f.ECONNABORTED,t,b)),x(),b=null},n===void 0&&o.setContentType(null),"setRequestHeader"in b&&a.forEach(Dt(o),function(_,E){b.setRequestHeader(E,_)}),a.isUndefined(s.withCredentials)||(b.withCredentials=!!s.withCredentials),i&&i!=="json"&&(b.responseType=s.responseType),l&&([d,m,v]=$e(l,!0),b.addEventListener("progress",d)),c&&b.upload&&([u,p]=$e(c),b.upload.addEventListener("progress",u),b.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(h=_=>{b&&(r(!_||_.type?new Re(null,t,b):_),b.abort(),x(),b=null)},s.cancelToken&&s.cancelToken.subscribe(h),s.signal&&(s.signal.aborted?h():s.signal.addEventListener("abort",h)));const g=lt(s.url);if(g&&!j.protocols.includes(g)){r(new f("Unsupported protocol "+g+":",f.ERR_BAD_REQUEST,t)),x();return}b.send(n||null)})},Fn=(t,e)=>{if(t=t?t.filter(Boolean):[],!e&&!t.length)return;const r=new AbortController;let s=!1;const n=function(l){if(!s){s=!0,i();const h=l instanceof Error?l:this.reason;r.abort(h instanceof f?h:new Re(h instanceof Error?h.message:h))}};let o=e&&setTimeout(()=>{o=null,n(new f(`timeout of ${e}ms exceeded`,f.ETIMEDOUT))},e);const i=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(n):l.removeEventListener("abort",n)}),t=null)};t.forEach(l=>{if(!s){if(l.aborted){n.call(l);return}l.addEventListener("abort",n,{once:!0})}});const{signal:c}=r;return c.unsubscribe=()=>a.asap(i),c},$n=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,n;for(;s<r;)n=s+e,yield t.slice(s,n),s=n},qn=async function*(t,e){for await(const r of Bn(t))yield*$n(r,e)},Bn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},cr=(t,e,r,s)=>{const n=qn(t,e);let o=0,i,c=l=>{i||(i=!0,s&&s(l))};return new ReadableStream({async pull(l){try{const{done:h,value:u}=await n.next();if(h){c(),l.close();return}let d=u.byteLength;if(r){let p=o+=d;r(p)}l.enqueue(new Uint8Array(u))}catch(h){throw c(h),h}},cancel(l){return c(l),n.return()}},{highWaterMark:2})},ar=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,lr=(t,e,r)=>e+2<r&&ar(t.charCodeAt(e+1))&&ar(t.charCodeAt(e+2)),ur=t=>t<=57?t-48:(t&223)-55,Mn=t=>t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===43||t===47||t===45||t===95,zn=t=>t===9||t===10||t===12||t===13||t===32,Wn=t=>{const e=Math.floor(t/4),r=t%4;return e*3+(r===2?1:r===3?2:0)},Jn=t=>{const e=t.length;let r=0;return e>0&&t.charCodeAt(e-1)===61&&(r++,e>1&&t.charCodeAt(e-2)===61&&r++),Math.floor((e-r)*3/4)},Hn=t=>{const e=t.length;let r=0,s=0,n=!1;for(let o=0;o<e;o++){let i=t.charCodeAt(o);if(i===37&&lr(t,o,e)&&(i=ur(t.charCodeAt(o+1))*16+ur(t.charCodeAt(o+2)),o+=2),!zn(i)){if(i===61){s++;continue}if(!Mn(i)||s>0){n=!0;continue}r++}}return n||s>2||s>0&&(r+s)%4!==0||r%4===1?Jn(t):Wn(r)},Vn=(t,e)=>{if(!t||typeof t!="string"||!t.startsWith("data:"))return 0;const r=t.indexOf(",");if(r<0)return 0;const s=t.slice(5,r),n=t.slice(r+1);if(/;base64/i.test(s))return e(n);let o=0;for(let i=0,c=n.length;i<c;i++){const l=n.charCodeAt(i);if(l===37&&lr(n,i,c))o+=1,i+=2;else if(l<128)o+=1;else if(l<2048)o+=2;else if(l>=55296&&l<=56319&&i+1<c){const h=n.charCodeAt(i+1);h>=56320&&h<=57343?(o+=4,i++):o+=3}else o+=3}return o};function Kn(t){const e=typeof t=="string"?t.indexOf("#"):-1;return Vn(e===-1?t:t.slice(0,e),Hn)}const ut="1.20.0",hr=64*1024,Xn={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:qe}=a,Qn=t=>encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(e,r)=>String.fromCharCode(parseInt(r,16))),dr=t=>{if(!a.isString(t))return t;try{return decodeURIComponent(t)}catch{return t}},fr=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Gn=t=>{const e=t.indexOf("://");let r=t;return e!==-1&&(r=r.slice(e+3)),r.includes("@")||r.includes(":")},Zn=t=>{const e=a.global!==void 0&&a.global!==null?a.global:globalThis,{ReadableStream:r,TextEncoder:s}=e;t=a.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},t);const{fetch:n,Request:o,Response:i}=t,c=n?qe(n):typeof fetch=="function",l=qe(o),h=qe(i);if(!c)return!1;const u=c&&qe(r),d=c&&(typeof s=="function"?(y=>g=>y.encode(g))(new s):async y=>new Uint8Array(await new o(y).arrayBuffer())),p=l&&u&&fr(()=>{let y=!1;const g=new o(j.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),_=g.headers.has("Content-Type");return g.body!=null&&g.body.cancel(),y&&!_}),m=h&&u&&fr(()=>a.isReadableStream(new i("").body)),v={stream:m&&(y=>y.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!v[y]&&(v[y]=(g,_)=>{let E=g&&g[y];if(E)return E.call(g);throw new f(`Response type '${y}' is not supported`,f.ERR_NOT_SUPPORT,_)})});const x=async y=>{if(y==null)return 0;if(a.isBlob(y))return y.size;if(a.isSpecCompliantForm(y))return(await new o(j.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(a.isArrayBufferView(y)||a.isArrayBuffer(y))return y.byteLength;if(a.isURLSearchParams(y)&&(y=y+""),a.isString(y))return(await d(y)).byteLength},b=async(y,g)=>a.toFiniteNumber(y.getContentLength())??x(g);return async y=>{let{url:g,method:_,data:E,signal:A,cancelToken:R,timeout:ae,onDownloadProgress:le,onUploadProgress:V,responseType:q,headers:I,withCredentials:W="same-origin",fetchOptions:X,maxContentLength:L,maxBodyLength:me,maxRedirects:B}=or(y);const w=a.isNumber(L)&&L>-1,P=a.isNumber(me)&&me>-1,J=O=>a.hasOwnProp(y,O)?y[O]:void 0;let K=n||fetch;q=q?(q+"").toLowerCase():"text";let F=Fn([A,R&&R.toAbortSignal()],ae),T=null;const ue=F&&F.unsubscribe&&(()=>{F.unsubscribe()});let je,ke=null;const zr=()=>new f("Request body larger than maxBodyLength limit",f.ERR_BAD_REQUEST,y,T);try{let O;const M=J("auth");if(M){const S=a.getSafeProp(M,"username")||"",U=a.getSafeProp(M,"password")||"";O={username:S,password:U}}if(Gn(g)){const S=new URL(g,j.origin);if(!O&&(S.username||S.password)){const U=dr(S.username),ee=dr(S.password);O={username:U,password:ee}}(S.username||S.password)&&(S.username="",S.password="",g=S.href)}if(O&&(I.delete("authorization"),I.set("Authorization","Basic "+btoa(Qn((O.username||"")+":"+(O.password||""))))),w&&typeof g=="string"&&g.startsWith("data:")&&Kn(g)>L)throw new f("maxContentLength size of "+L+" exceeded",f.ERR_BAD_RESPONSE,y,T);if(P&&_!=="get"&&_!=="head"){const S=await x(E);if(typeof S=="number"&&isFinite(S)&&(je=S,S>me))throw zr()}const Xe=P&&(a.isReadableStream(E)||a.isStream(E)),Wr=(S,U,ee)=>cr(S,hr,he=>{if(P&&he>me)throw ke=zr();U&&U(he)},ee);if(p&&_!=="get"&&_!=="head"&&(V||Xe)){if(je=je??await b(I,E),je!==0||Xe){let S=new o(g,{method:"POST",body:E,duplex:"half"}),U;if(a.isFormData(E)&&(U=S.headers.get("content-type"))&&I.setContentType(U),S.body){const[ee,he]=V&&tr(je,$e(rr(V)))||[];E=Wr(S.body,ee,he)}}}else if(Xe&&!l&&u&&_!=="get"&&_!=="head")E=Wr(E);else if(Xe&&l&&!p&&_!=="get"&&_!=="head")throw new f("Stream request bodies are not supported by the current fetch implementation",f.ERR_NOT_SUPPORT,y,T);a.isString(W)||(W=W?"include":"omit");const xo=l&&"credentials"in o.prototype;if(a.isFormData(E)){const S=I.getContentType();S&&/^multipart\/form-data/i.test(S)&&!/boundary=/i.test(S)&&I.delete("content-type")}I.set("User-Agent","axios/"+ut,!1);const H=X==null?X:Object.assign(Object.create(null),X);H&&(delete H.body,delete H.headers,delete H.method,delete H.signal,delete H.duplex,delete H.credentials);const Q=Object.assign(Object.create(null),H,{signal:F,method:_.toUpperCase(),headers:Dt(I.normalize()),body:E,duplex:"half",credentials:xo?W:void 0});l&&(a.forEach(Xn,(S,U)=>{Q[U]===void 0&&(Q[U]=S)}),Q.signal===void 0&&(Q.signal=null),Q.body===void 0&&(Q.body=null)),B===0&&(Q.redirect="manual",H&&(H.redirect="manual")),T=l&&new o(g,Q);let G=await(l?K(T,H):K(g,Q));const Jr=k.from(G.headers);if(w){const S=a.toFiniteNumber(Jr.getContentLength());if(S!=null&&S>L)throw new f("maxContentLength size of "+L+" exceeded",f.ERR_BAD_RESPONSE,y,T)}const vt=m&&(q==="stream"||q==="response");if(m&&G.body&&(le||w||vt&&ue)){const S={};["status","statusText","headers"].forEach(Ne=>{S[Ne]=G[Ne]});const U=a.toFiniteNumber(Jr.getContentLength()),[ee,he]=le&&tr(U,$e(rr(le),!0))||[];let Hr=0;const Ao=Ne=>{if(w&&(Hr=Ne,Hr>L))throw new f("maxContentLength size of "+L+" exceeded",f.ERR_BAD_RESPONSE,y,T);ee&&ee(Ne)};G=new i(cr(G.body,hr,Ao,()=>{he&&he(),ue&&ue()}),S)}q=q||"text";let Z=await v[a.findKey(v,q)||"text"](G,y);if(w&&!m&&!vt){let S;if(Z!=null&&(typeof Z.byteLength=="number"?S=Z.byteLength:typeof Z.size=="number"?S=Z.size:typeof Z=="string"&&(S=typeof s=="function"?new s().encode(Z).byteLength:Z.length)),typeof S=="number"&&S>L)throw new f("maxContentLength size of "+L+" exceeded",f.ERR_BAD_RESPONSE,y,T)}return!vt&&ue&&ue(),await new Promise((S,U)=>{Yt(S,U,{data:Z,headers:k.from(G.headers),status:G.status,statusText:G.statusText,config:y,request:T})})}catch(O){if(ue&&ue(),F&&F.aborted&&F.reason instanceof f){const M=F.reason;throw M.config=y,T&&(M.request=T),O!==M&&Object.defineProperty(M,"cause",{__proto__:null,value:O,writable:!0,enumerable:!1,configurable:!0}),M}if(ke)throw T&&!ke.request&&(ke.request=T),ke;if(O instanceof f)throw T&&!O.request&&(O.request=T),O;if(O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message)){const M=new f("Network Error",f.ERR_NETWORK,y,T,O&&O.response);throw Object.defineProperty(M,"cause",{__proto__:null,value:O.cause||O,writable:!0,enumerable:!1,configurable:!0}),M}throw f.from(O,O&&O.code,y,T,O&&O.response)}}},Yn=new Map,pr=t=>{let e=t&&t.env||{};const{fetch:r,Request:s,Response:n}=e,o=[s,n,r];let i=o.length,c=i,l,h,u=Yn;for(;c--;)l=o[c],h=u.get(l),h===void 0&&u.set(l,h=c?new Map:Zn(e)),u=h;return h};pr();const ht={http:on,xhr:Dn,fetch:{get:pr}};a.forEach(ht,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(t,"adapterName",{__proto__:null,value:e})}});const gr=t=>`- ${t}`,ei=t=>a.isFunction(t)||t===null||t===!1;function ti(t,e){t=a.isArray(t)?t:[t];const{length:r}=t;let s,n;const o={};for(let i=0;i<r;i++){s=t[i];let c;if(n=s,!ei(s)&&(n=ht[(c=String(s)).toLowerCase()],n===void 0))throw new f(`Unknown adapter '${c}'`);if(n&&(a.isFunction(n)||(n=n.get(e))))break;o[c||"#"+i]=n}if(!n){const i=Object.entries(o).map(([l,h])=>`adapter ${l} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=r?i.length>1?`since :
|
|
4
|
-
`+i.map(gr).join(`
|
|
5
|
-
`):" "+gr(i[0]):"as no adapter specified";throw new f("There is no suitable adapter to dispatch the request "+c,f.ERR_NOT_SUPPORT)}return n}const mr={getAdapter:ti,adapters:ht};function dt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Re(null,t)}function ft(t){const e=a.toSafeFlatObject(t);return dt(e),e.headers=k.from(a.getSafeProp(e,"headers")),e.data=at.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),mr.getAdapter(e.adapter||Oe.adapter,e)(e).then(function(r){dt(e),e.response=r;try{r.data=at.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=k.from(r.headers),r},function(r){if(!Zt(r)&&(dt(e),r&&r.response)){e.response=r.response;try{r.response.data=at.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=k.from(r.response.headers)}return Promise.reject(r)})}const Be={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Be[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const br={};Be.transitional=function(t,e,r){function s(n,o){return"[Axios v"+ut+"] Transitional option '"+n+"'"+o+(r?". "+r:"")}return(n,o,i)=>{if(t===!1)throw new f(s(o," has been removed"+(e?" in "+e:"")),f.ERR_DEPRECATED);return e&&!br[o]&&(br[o]=!0,console.warn(s(o," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,o,i):!0}},Be.spelling=function(t){return(e,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function ri(t,e,r){if(typeof t!="object"||t===null)throw new f("options must be an object",f.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let n=s.length;for(;n-- >0;){const o=s[n],i=Object.prototype.hasOwnProperty.call(e,o)?e[o]:void 0;if(i){const c=t[o],l=c===void 0||i(c,o,t);if(l!==!0)throw new f("option "+o+" must be "+l,f.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new f("Unknown option "+o,f.ERR_BAD_OPTION)}}const Me={assertOptions:ri,validators:Be},N=Me.validators;let ie=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Vt,response:new Vt}}async request(t,e){try{return await this._request(t,e)}catch(r){if(r instanceof Error)try{let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const n=s.stack;let o="";if(typeof n=="string"){const i=n.indexOf(`
|
|
6
|
-
`);o=i===-1?"":n.slice(i+1)}if(!r.stack)r.stack=o;else if(o){const i=o.indexOf(`
|
|
7
|
-
`),c=i===-1?-1:o.indexOf(`
|
|
8
|
-
`,i+1),l=c===-1?"":o.slice(c+1);String(r.stack).endsWith(l)||(r.stack+=`
|
|
9
|
-
`+o)}}catch{}throw r}}_request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=ne(this.defaults,e);const{transitional:r,paramsSerializer:s,headers:n}=e;r!==void 0&&Me.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean),legacyInterceptorReqResOrdering:N.transitional(N.boolean),advertiseZstdAcceptEncoding:N.transitional(N.boolean),validateStatusUndefinedResolves:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?e.paramsSerializer={serialize:s}:Me.assertOptions(s,{encode:N.function,serialize:N.function},!0)),e.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Me.assertOptions(e,{baseUrl:N.spelling("baseURL"),withXsrfToken:N.spelling("withXSRFToken")},!0),e.method=(a.getSafeProp(e,"method")||a.getSafeProp(this.defaults,"method")||"get").toLowerCase();let o=n&&a.merge(n.common,n[e.method]);n&&a.forEach(Gt.concat("common"),m=>{delete n[m]}),e.headers=k.concat(o,n);const i=[];let c=!0;this.interceptors.request.forEach(function(m){if(typeof m.runWhen=="function"&&m.runWhen(e)===!1)return;c=c&&m.synchronous;const v=e.transitional||it;v&&v.legacyInterceptorReqResOrdering?i.unshift(m.fulfilled,m.rejected):i.push(m.fulfilled,m.rejected)});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let h,u=0,d;if(!c){const m=[ft.bind(this),void 0];for(m.unshift(...i),m.push(...l),d=m.length,h=Promise.resolve(e);u<d;)h=h.then(m[u++],m[u++]);return h}d=i.length;let p=e;for(;u<d;){const m=i[u++],v=i[u++];try{p=m?m(p):p}catch(x){if(!v){h=Promise.reject(x);break}try{const b=v.call(this,x);a.isThenable(b)&&(h=Promise.resolve(b).then(()=>ft.call(this,p)))}catch(b){h=Promise.reject(b)}break}}if(!h)try{h=ft.call(this,p)}catch(m){h=Promise.reject(m)}for(u=0,d=l.length;u<d;)h=h.then(l[u++],l[u++]);return h}getUri(t){t=ne(this.defaults,t);const e=nr(t.baseURL,t.url,t.allowAbsoluteUrls,t);return Wt(e,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){ie.prototype[t]=function(e,r){return this.request(ne(r||{},{method:t,url:e,data:r&&a.hasOwnProp(r,"data")?r.data:void 0}))}}),a.forEach(["post","put","patch","query"],function(t){function e(r){return function(s,n,o){return this.request(ne(o||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:n}))}}ie.prototype[t]=e(),t!=="query"&&(ie.prototype[t+"Form"]=e(!0))});let si=class Kr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(n){r=n});const s=this;this.promise.then(n=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](n);s._listeners=null}),this.promise.then=n=>{let o;const i=new Promise(c=>{s.subscribe(c),o=c}).then(n);return i.cancel=function(){s.unsubscribe(o)},i},e(function(n,o,i){s.reason||(s.reason=new Re(n,o,i),r(s.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 r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Kr(function(r){e=r}),cancel:e}}};function ni(t){return function(e){return t.apply(null,e)}}function ii(t){return a.isObject(t)&&t.isAxiosError===!0}const ze={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ze).forEach(([t,e])=>{ze[e]===void 0&&(ze[e]=t)});function _r(t){const e=new ie(t),r=Ot(ie.prototype.request,e);return a.extend(r,ie.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return _r(ne(t,s))},r}const C=_r(Oe);C.Axios=ie,C.CanceledError=Re,C.CancelToken=si,C.isCancel=Zt,C.VERSION=ut,C.toFormData=Fe,C.AxiosError=f,C.Cancel=C.CanceledError,C.all=function(t){return Promise.all(t)},C.spread=ni,C.isAxiosError=ii,C.mergeConfig=ne,C.AxiosHeaders=k,C.formToJSON=t=>Qt(a.isHTMLForm(t)?new FormData(t):t),C.getAdapter=mr.getAdapter,C.HttpStatusCode=ze,C.default=C;const{Axios:Co,AxiosError:To,CanceledError:jo,isCancel:ko,CancelToken:No,VERSION:Io,all:Lo,Cancel:Uo,isAxiosError:Do,spread:Fo,toFormData:$o,AxiosHeaders:qo,HttpStatusCode:Bo,formToJSON:Mo,getAdapter:zo,mergeConfig:Wo,create:Jo}=C;function xe(t){return t?.name==="AuthRequiredError"}const oi=new Set(["OpenC3::AuthError","OpenC3::ForbiddenError"]);function ci(t){return t?.response?.status===401||t?.status===401||oi.has(t?.name)}function ai(t){!xe(t)&&!ci(t)&&console.error(t)}class yr extends Error{constructor(e="Authentication required"){super(e),this.name="AuthRequiredError"}}globalThis.__openc3AuthRejectionHandler||(globalThis.__openc3AuthRejectionHandler=!0,globalThis.addEventListener?.("unhandledrejection",t=>{xe(t.reason)&&t.preventDefault()}));let wr=!1;function Er(){wr||(wr=!0,OpenC3Auth.login())}async function pt(){try{await OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity)&&OpenC3Auth.setTokens()}catch(t){throw xe(t)?t:(Er(),new yr(t?.message))}if(!localStorage.openc3Token)throw Er(),new yr}const gt=C.create({baseURL:location.origin,timeout:6e4,params:{}});gt.interceptors.response.use(t=>t,t=>{if(t.response){if(t.response.config.headers["Ignore-Errors"]&&t.response.config.headers["Ignore-Errors"].includes(t.response.status.toString()))return Promise.reject(t);if(t.response.status===401)return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity,!0).then(function(n){n&&OpenC3Auth.setTokens()}).catch(ai),Promise.reject(t);const e=t.response?.data?.error?.data?.class;if(e==="HazardousError"||e==="CriticalCmdError")return Promise.reject(t);let r=`HTTP ${t.response.status} - `;t.response?.statusText&&(r+=`${t.response.statusText} `),t.response?.config?.data&&(r+=`${t.response.config.data} `),t.response?.data?.message?r+=`${t.response.data.message}`:t.response?.data?.exception?r+=`${t.response.data.exception}`:t.response?.data?.error?.message?(t.response.data.error.class&&(r+=`${t.response.data.error.class} `),r+=`${t.response.data.error.message}`):r+=`${t.response?.data}`;const{$cosmosNotify:s}=window;throw s&&s.serious({title:"Network error",body:r}),t}else throw t});const We=async function(t,e,{data:r,params:s={},headers:n,noAuth:o=!1,optionalAuth:i=!1,noScope:c=!1,onUploadProgress:l=!1,responseType:h}={}){if(!o)if(i){try{await pt()}catch(u){if(!xe(u))throw u}localStorage.openc3Token&&(n.Authorization=localStorage.openc3Token)}else await pt(),n.Authorization=localStorage.openc3Token;return n.manual=!0,!c&&!s.scope&&(s.scope=window.openc3Scope),gt({method:t,url:e,data:r,params:s,headers:n,onUploadProgress:l,responseType:h})},mt={Accept:"application/json"},Sr={...mt,"Content-Type":"application/json"},Ho=Qe("W",{get:function(t,{params:e,headers:r=mt,noScope:s,noAuth:n,optionalAuth:o,onUploadProgress:i,responseType:c}={}){return We("get",t,{params:e,headers:r,noScope:s,noAuth:n,optionalAuth:o,onUploadProgress:i,responseType:c})},put:function(t,{data:e,params:r,headers:s=Sr,noScope:n,noAuth:o,onUploadProgress:i}={}){return We("put",t,{data:e,params:r,headers:s,noScope:n,noAuth:o,onUploadProgress:i})},post:function(t,{data:e,params:r,headers:s=Sr,noScope:n,noAuth:o,onUploadProgress:i,responseType:c}={}){return We("post",t,{data:e,params:r,headers:s,noScope:n,noAuth:o,onUploadProgress:i,responseType:c})},delete:function(t,{params:e,headers:r=mt,noScope:s,noAuth:n,onUploadProgress:o}={}){return We("delete",t,{params:e,headers:r,noScope:s,noAuth:n,onUploadProgress:o})}});let Je=()=>({emit(t,...e){for(let r=this.events[t]||[],s=0,n=r.length;s<n;s++)r[s](...e)},events:{},on(t,e){return(this.events[t]||=[]).push(e),()=>{this.events[t]=this.events[t]?.filter(r=>e!==r)}}});class Ae extends Error{constructor(e,r){e instanceof Error?(super(e.message),this.cause=e):super(e),this.reason=r,this.name="ReasonError"}}class bt extends Ae{constructor(e){super("Rejected",e),this.name="SubscriptionRejectedError"}}class li extends Ae{constructor(e){super(e||"Timed out to receive subscription ack"),this.name="SubscriptionTimeoutError"}}class z extends Ae{constructor(e,r){r?super(e,r):super("Disconnected",e),this.name="DisconnectedError"}}class ui extends z{constructor(e){super(e,"stale_connection"),this.name="StaleConnectionError"}}function vr(t){return t?`{${Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>{let r=JSON.stringify(t[e]);return`${JSON.stringify(e)}:${r}`}).join(",")}}`:""}class hi{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,r){if(!this._info)return this._info={id:String(e),info:r},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((r,{id:s,info:n})=>(r[s]=n,r),{})}}const oe=Symbol("state");class Or{constructor(e={}){this.emitter=Je(),this.params=Object.freeze(e),this.presence=new hi(this),this.initialConnect=!0,this[oe]="idle"}get identifier(){return this._identifier?this._identifier:(this._identifier=vr({channel:this.channelId,...this.params}),this._identifier)}get channelId(){return this.constructor.identifier}get state(){return this[oe]}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[oe]="connecting"}connected(){if(this.state==="connected"||this.state==="closed")return;this[oe]="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[oe]="connected";let e=!0,r=!0;this.initialConnect=!1,this.emit("connect",{reconnect:r,restored:e})}disconnected(e){this.state==="disconnected"||this.state==="closed"||(this[oe]="disconnected",this.presence.reset(),this.emit("disconnect",e))}closed(e){this.state!=="closed"&&(this[oe]="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,r){if(this.state==="idle"||this.state==="closed")throw Error("Channel is not subscribed");return this.receiver.perform(this.identifier,e,r)}async send(e){return this.perform(void 0,e)}async whisper(e){try{await this.perform("$whisper",e)}catch(r){let s=this.receiver?this.receiver.logger:null;s&&s.warn("whisper failed: ",r)}}receive(e,r){this.emit("message",e,r)}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}emit(e,...r){return this.emitter.emit(e,...r)}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,r)=>{let s=[()=>delete this._pendingSubscribe];s.push(this.on("connect",()=>{s.forEach(n=>n()),e()})),s.push(this.on("close",n=>{s.forEach(o=>o()),r(n||new Ae("Channel was disconnected before subscribing","canceled"))}))}),this._pendingSubscribe)}}class di{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 r=this.channels.indexOf(e);r>-1&&this.channels.splice(r,1)}notify(e,...r){this.state=e==="restored"?"connected":e,r.length===1?this.channels.forEach(s=>s[e](r[0])):this.channels.forEach(s=>s[e]())}pending(e){this._checkIntent(e);let r=this._pendings[0];return!r||r.intent!==e?Promise.resolve():r.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 r,s={promise:new Promise(o=>{r=o}),intent:e,release:()=>{this._pendings.splice(this._pendings.indexOf(s),1),r(s)},canceled:!1,acquired:!1},n=this._pendingTop;return this._pendings.push(s),n&&await n.promise,this.gvl&&await this.gvl.acquire(s,e),s.acquired=!0,s}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 r=this._pendingTop;return!r||r.acquired||r.intent!==e?!1:(this._pendings.pop(),r.canceled=!0,!0)}}class fi{constructor(){this.queue=[]}async acquire(e,r){r==="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 pi{constructor(e){e.concurrentSubscribes===!1&&(this.glv=new fi),this._subscriptions={},this._localToRemote={}}all(){return Object.values(this._subscriptions)}get(e){return this._subscriptions[e]}create(e,{subscribe:r,unsubscribe:s}){let n=this._subscriptions[e]=new di(e);return n.remoteId=this._localToRemote[e],n.subscriber=r,n.unsubscriber=s,n.gvl=this.glv,n}remove(e){delete this._subscriptions[e],delete this._localToRemote[e]}storeRemoteId(e,r){this._localToRemote[e]=r;let s=this.get(e);s&&(s.remoteId=r)}}class gi{constructor(e={}){this.subscriptions=new pi(e),this._pendingMessages=[],this._remoteToLocal={}}subscribe(e,r){this._remoteToLocal[r]=e,this.subscriptions.storeRemoteId(e,r),this.flush(r)}unsubscribe(e){let r=this.subscriptions.get(e);if(!r)return;let s=r.remoteId;s&&delete this._remoteToLocal[s],this.subscriptions.remove(e)}transmit(e,r,s){let n=this._remoteToLocal[e];if(!n){this._pendingMessages.push([e,r,s]);return}let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>{i.receive(r,s)})}notify(e,r,s){let n=this._remoteToLocal[e];if(!n)return;let o=this.subscriptions.get(n);o&&o.channels.forEach(i=>i.emit(r,s))}close(){this._pendingMessages.length=0}get size(){return this.channels.length}get channels(){return this.subscriptions.all().flatMap(e=>e.channels)}flush(e){let r=[];for(let s of this._pendingMessages)s[0]===e?this.transmit(s[0],s[1],s[2]):r.push(s);this._pendingMessages=r}}const Rr={debug:0,info:1,warn:2,error:3};class xr{constructor(e){this.level=e||"warn"}log(e,r,s){Rr[e]<Rr[this.level]||this.writeLogEntry(e,r,s)}writeLogEntry(){throw Error("Not implemented")}debug(e,r){this.log("debug",e,r)}info(e,r){this.log("info",e,r)}warn(e,r){this.log("warn",e,r)}error(e,r){this.log("error",e,r)}}class Pe extends xr{writeLogEntry(){}}class mi{encode(e){return JSON.stringify(e)}decode(e){try{return JSON.parse(e)}catch{}}}let bi=0;class Ar{constructor(e={}){let{logger:r}=e;this.logger=r||new Pe,this.pendingSubscriptions={},this.pendingUnsubscriptions={},this.subscribeCooldownInterval=e.subscribeCooldownInterval||250,this.subscribeRetryInterval=e.subscribeRetryInterval||5e3}attached(e){this.cable=e}subscribe(e,r){let s={channel:e};r&&Object.assign(s,r);let n=vr(s);if(this.pendingUnsubscriptions[n]){let i=this.subscribeCooldownInterval*1.5;return this.logger.debug(`unsubscribed recently, cooldown for ${i}`,n),new Promise(c=>{setTimeout(()=>{c(this.subscribe(e,r))},i)})}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((i,c)=>{let l=++bi;this.pendingSubscriptions[n]={resolve:i,reject:c,id:l},this.cable.send(this.buildSubscribeRequest(n)),this.maybeRetrySubscribe(l,n,o)})}buildSubscribeRequest(e){return{command:"subscribe",identifier:e}}maybeRetrySubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(this.logger.warn(`no subscription ack received in ${s}ms, retrying subscribe`,r),this.cable.send(this.buildSubscribeRequest(r)),this.maybeExpireSubscribe(e,r,s))},s)}maybeExpireSubscribe(e,r,s){setTimeout(()=>{let n=this.pendingSubscriptions[r];n&&n.id===e&&(delete this.pendingSubscriptions[r],n.reject(new li(`Haven't received subscription ack in ${s*2}ms for ${r}`)))},s)}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,r,s){return r==="$whisper"?this.whisper(e,s):(s||(s={}),s.action||=r,this.cable.send({command:"message",identifier:e,data:JSON.stringify(s)}),Promise.resolve())}whisper(e,r){return this.cable.send({command:"whisper",identifier:e,data:r}),Promise.resolve()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n,reason:o,reconnect:i}=e;if(r==="ping")return this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="welcome"){let c=e.sid;return c&&this.cable.setSessionId(c),this.cable.connected()}if(r==="disconnect"){let c=new z(o);this.reset(c),i===!1?this.cable.closed(c):this.cable.disconnected(c);return}if(r==="confirm_subscription"){let c=this.pendingSubscriptions[s];if(!c){this.logger.error("subscription not found, unsubscribing",{type:r,identifier:s}),this.unsubscribe(s);return}return delete this.pendingSubscriptions[s],c.resolve(s)}if(r==="reject_subscription"){let c=this.pendingSubscriptions[s];return c?(delete this.pendingSubscriptions[s],c.reject(new bt)):this.logger.error("subscription not found",{type:r,identifier:s})}if(n)return{identifier:s,message:n};this.logger.warn(`unknown message type: ${r}`,{message:e})}reset(e){for(let r in this.pendingSubscriptions)this.pendingSubscriptions[r].reject(e);this.pendingSubscriptions={}}recoverableClosure(){return!1}}const Pr=()=>Date.now()/1e3|0;class _i extends Ar{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=Pr()),this.sessionId=void 0,this.sendPongs=e.pongs}reset(e){for(let r in this.pendingPresence)this.pendingPresence[r].reject(e);return this.pendingPresence={},super.reset()}receive(e){if(typeof e!="object"){this.logger.error("unsupported message format",{message:e});return}let{type:r,identifier:s,message:n}=e;if(r==="disconnect")return delete this.sessionId,this.cable.setSessionId(""),super.receive(e);if(r==="reject_subscription")return super.receive(e);if(r==="confirm_subscription")return this.subscriptionStreams[s]||(this.subscriptionStreams[s]=new Set),super.receive(e);if(r==="ping")return this.restoreSince&&(this.restoreSince=Pr()),this.sendPongs&&this.sendPong(),this.cable.keepalive(e.message);if(this.cable.keepalive(),r==="confirm_history"){this.logger.debug("history result received",e),this.cable.notify("history_received",s);return}if(r==="reject_history"){this.logger.warn("failed to retrieve history",e),this.cable.notify("history_not_found",s);return}if(r==="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 i of o)this.cable.send({identifier:i,command:"history",history:this.historyRequestFor(i)}),this.presenceInfo[i]&&this.cable.send({identifier:i,command:"join",presence:this.presenceInfo[i]});return this.cable.restored(o)}return this.cable.connected(this.sessionId)}if(r==="presence"){let o=n.type;if(o==="info"){let i=this.pendingPresence[s];i&&(delete this.pendingPresence[s],i.resolve(n))}else if(o==="error"){let i=this.pendingPresence[s];i&&(delete this.pendingPresence[s],i.reject(new Error("failed to retrieve presence")))}return{type:r,identifier:s,message:n}}if(n){let o=this.trackStreamPosition(s,e.stream_id,e.epoch,e.offset);return{identifier:s,message:n,meta:o}}this.logger.warn(`unknown message type: ${r}`,{message:e})}perform(e,r,s){switch(r){case"$presence:join":return this.join(e,s);case"$presence:leave":return this.leave(e,s);case"$presence:info":return this.presence(e,s)}return super.perform(e,r,s)}unsubscribe(e){return delete this.presenceInfo[e],super.unsubscribe(e)}buildSubscribeRequest(e){let r=super.buildSubscribeRequest(e),s=this.historyRequestFor(e);s&&(r.history=s,this.pendingHistory[e]=!0);let n=this.presenceInfo[e];return n&&(r.presence=n),r}recoverableClosure(){return!!this.sessionId}historyRequestFor(e){let r={},s=!1;if(this.subscriptionStreams[e])for(let n of this.subscriptionStreams[e]){let o=this.streamsPositions[n];o&&(s=!0,r[n]=o)}if(!(!s&&!this.restoreSince))return{since:this.restoreSince,streams:r}}trackStreamPosition(e,r,s,n){if(!(!r||!s))return this.subscriptionStreams[e]||(this.subscriptionStreams[e]=new Set),this.subscriptionStreams[e].add(r),this.streamsPositions[r]={epoch:s,offset:n},{stream:r,epoch:s,offset:n}}async sendPong(){await new Promise(e=>setTimeout(e,0)),this.cable.state==="connected"&&this.cable.send({command:"pong"})}async join(e,r){return this.presenceInfo[e]=r,this.cable.send({command:"join",identifier:e,presence:r}),Promise.resolve()}async leave(e,r){return delete this.presenceInfo[e],this.cable.send({command:"leave",identifier:e,presence:r}),Promise.resolve()}presence(e,r){return this.pendingPresence[e]?(this.logger.warn("presence is already pending, skipping",e),Promise.reject(Error("presence request is already pending"))):new Promise((s,n)=>{this.pendingPresence[e]={resolve:s,reject:n},this.cable.send({command:"presence",identifier:e,data:r})})}}class yi extends Ae{constructor(){super("No connection","closed"),this.name="NoConnectionError"}}class Cr extends Or{static identifier="__ghost__";constructor(e,r){super(r),this.channelId=e}set channelId(e){this._channelId=e}get channelId(){return this._channelId}}const wi="$pubsub";class Tr extends Or{static identifier=wi;async perform(e,r){if(e.startsWith("$"))return super.perform(e,r);throw Error("not implemented")}}const ce=Symbol("state");let Ei=class{constructor({transport:t,protocol:e,encoder:r,logger:s,lazy:n,hubOptions:o,performFailures:i,transportConfigurator:c}){this.emitter=Je(),this.transport=t,this.encoder=r,this.logger=s||new Pe,this.protocol=e,this.performFailures=i||"throw",this.protocol.attached(this),this.hub=new gi(o||{}),this[ce]="idle",this.handleClose=this.handleClose.bind(this),this.handleIncoming=this.handleIncoming.bind(this),this.transportConfigurator=c,this.transport.on("close",this.handleClose),this.transport.on("data",this.handleIncoming),this.initialConnect=!0,this.recovering=!1,n===!1&&this.connect().catch(()=>{})}get state(){return this[ce]}async connect(){if(this.state==="connected")return Promise.resolve();if(this.state==="connecting")return this.pendingConnect();let t=this.state==="idle";this[ce]="connecting";let e=this.pendingConnect();this.logger.debug("connecting");try{this.transportConfigurator&&await this.transportConfigurator(this.transport,{initial:t}),await this.transport.open()}catch(r){this.handleClose(r)}return e}setSessionId(t){this.sessionId=t,this.transport.setParam("sid",t)}connected(){if(this.state==="connected")return;this.logger.info("connected"),this[ce]="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[ce]="connected",this.hub.subscriptions.all().forEach(s=>{t&&s.remoteId&&t.includes(s.remoteId)?s.notify("restored"):(s.notify("disconnected",new z("recovery_failed")),this._resubscribe(s))});let e=!this.initialConnect,r=!0;this.recovering=!1,this.initialConnect=!1,this.emit("connect",{reconnect:e,restored:r})}notify(t,e,r){e&&typeof e!="string"&&(r=e,e=void 0),e?this.hub.notify(e,"info",{type:t,data:r}):this.emit("info",{type:t,data:r})}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[ce]="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[ce]="closed";let r=e||new z("cable_closed");this.hub.subscriptions.all().forEach(s=>s.notify("disconnected",r)),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 r=this.protocol.receive(e);if(r){this.logger.debug("processed incoming message",r);let{type:s,identifier:n,message:o,meta:i}=r;s?this.hub.notify(n,s,o):this.hub.transmit(n,o,i)}}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 Tr({stream_name:t});return this.subscribe(e)}streamFromSigned(t){let e=new Tr({signed_stream_name:t});return this.subscribe(e)}subscribeTo(t,e){let r,s;return typeof t=="string"&&(s=t,t=Cr),r=s?new t(s,e):new t(e),this.subscribe(r)}subscribe(t){if(!t.attached(this))return t;let e=t.identifier;t.connecting();let r=this.hub.subscriptions.get(e)||this.hub.subscriptions.create(e,{subscribe:s=>this._subscribe(s,t.channelId,t.params),unsubscribe:s=>this._unsubscribe(s)});return r.add(t),r.intent==="subscribed"&&r.state==="connected"&&t.connected(),r.ensureSubscribed(),t}async _resubscribe(t){t.intent!=="subscribed"||!t.channels[0]||(t.notify("connecting"),t.ensureResubscribed())}async _subscribe(t,e,r){let s=t.id;if(this.state==="idle"&&this.connect().catch(()=>{}),this.state!=="connected"){this.logger.debug("cancel subscribe, no connection",{identifier:s});return}this.logger.debug("acquiring subscribe lock",{identifier:s});let n=await t.acquire("subscribed");if(n.canceled){this.logger.debug("subscribe lock has been canceled",{identifier:s}),n.release();return}if(this.logger.debug("subscribe lock has been acquired",{identifier:s}),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:s}),n.release();return}if(t.state==="connected"){this.logger.debug("already connected, skip subscribe command",{identifier:s}),t.notify("connected"),n.release();return}let o={identifier:e,params:r};this.logger.debug("subscribing",o);try{let i=await this.protocol.subscribe(e,r);this.hub.subscribe(s,i),this.logger.debug("subscribed",{...o,remoteId:i}),t.notify("connected")}catch(i){if(i){if(i instanceof bt&&this.logger.warn("rejected",o),i instanceof z){this.logger.debug("disconnected during subscription; will retry on connect",o),n.release();return}this.logger.error("failed to subscribe",{error:i,...o})}t.close(i),this.hub.unsubscribe(s)}n.release()}unsubscribe(t){let e=t.identifier,r=this.hub.subscriptions.get(e);if(!r)throw Error(`Subscription not found: ${e}`);r.remove(t),t.closed(),r.maybeUnsubscribe()}async _unsubscribe(t){let e=t.id;this.logger.debug("acquiring unsubscribe lock",{identifier:e});let r=await t.acquire("unsubscribed");if(r.canceled){this.logger.debug("unsubscribe lock has been canceled",{identifier:e}),r.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}),r.release();return}if(t.state==="disconnected"||t.state==="closed"){this.logger.debug(`already ${t.state} connected, skip unsubscribe command`,{identifier:e}),r.release();return}let s=t.remoteId;if(this.logger.debug("unsubscribing...",{remoteId:s}),this.state!=="connected"){this.logger.debug("unsubscribe skipped (cable is not connected)",{id:e}),t.close(),this.hub.unsubscribe(e),r.release();return}try{await this.protocol.unsubscribe(s),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",r.release()}async perform(t,e,r){if(this.performFailures==="throw")return this._perform(t,e,r);try{return await this._perform(t,e,r)}catch(s){this.performFailures==="warn"&&this.logger.warn("perform failed",{error:s});return}}async _perform(t,e,r){if(this.state==="connecting"&&await this.pendingConnect(),this.state==="closed"||this.state==="disconnected")throw new yi;let s=this.hub.subscriptions.get(t);if(!s)throw Error(`Subscription not found: ${t}`);if(await s.pending("subscribed"),s.intent!=="subscribed")throw Error(`Subscription is closed: ${t}`);let n=s.remoteId,o={id:n,action:e,payload:r};this.logger.debug("perform",o);try{let i=await this.protocol.perform(n,e,r);return i&&this.logger.debug("perform result",{message:i,request:o}),i}catch(i){throw this.logger.error("perform failed",{error:i,request:o}),i}}on(t,e){return this.emitter.on(t,e)}once(t,e){let r=this.emitter.on(t,(...s)=>{r(),e(...s)});return r}emit(t,...e){return this.emitter.emit(t,...e)}pendingConnect(){return this._pendingConnect?this._pendingConnect:(this._pendingConnect=new Promise((t,e)=>{let r=[()=>delete this._pendingConnect];r.push(this.on("connect",()=>{r.forEach(s=>s()),t()})),r.push(this.on("close",s=>{r.forEach(n=>n()),e(s)})),r.push(this.on("disconnect",s=>{r.forEach(n=>n()),e(s)}))}),this._pendingConnect)}};const Si={maxMissingPings:2,maxReconnectAttempts:1/0},ge=()=>Date.now(),jr=(t,e)=>{e=e||{};let{backoffRate:r,jitterRatio:s,maxInterval:n}=e;return r=r||2,s===void 0&&(s=.5),o=>{let i=t*r**o,c=i*r,l=i+(c-i)*Math.random(),h=2*(Math.random()-.5)*s;return l=l*(1+h),n&&n<l&&(l=n),l}};let kr=class{constructor({pingInterval:t,...e}){if(this.pingInterval=t,!this.pingInterval)throw Error(`Incorrect pingInterval is provided: ${t}`);if(e=Object.assign({},Si,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=ge()}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=ge(),this.state="connected",this.cancelReconnect(),this.startPolling()})),this.unbind.push(this.target.on("disconnect",()=>{this.disconnectedAt=ge(),this.state="disconnected",this.stopPolling(),this.scheduleReconnect()})),this.unbind.push(this.target.on("close",()=>{this.disconnectedAt=ge(),this.state="closed",this.cancelReconnect(),this.stopPolling()})),this.unbind.push(this.target.on("keepalive",()=>{this.pingedAt=ge()})),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=ge()-this.pingedAt;t>this.maxMissingPings*this.pingInterval&&(this.logger.warn(`Stale connection: ${t}ms without pings`),this.state="pending_disconnect",this.target.disconnected(new ui))}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 vi{constructor(e,r={}){this.transports=e,this.transport=null,this.emitter=Je(),this.unbind=[],this.logger=r.logger||new Pe}displayName(){return"fallbacked transport"}async open(){for(let e=0;e<this.transports.length;e++){let r=this.transports[e];try{this.transport=r,this.resetListeners(),this.logger.debug(`Trying to connect via ${r.displayName()}`),await r.open(),this.logger.debug(`Connected via ${r.displayName()}`);return}catch(s){this.logger.debug(`Failed to connect via ${r.displayName()}: ${s.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,r){this.transports.forEach(s=>{s.setParam(e,r)})}setToken(e,r){this.transports.forEach(s=>{s.setToken(e,r)})}on(e,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 Oi{constructor(e,r={}){this.url=e;let s=r.websocketImplementation;if(s)this.Impl=s;else if(typeof WebSocket<"u")this.Impl=WebSocket;else throw new Error("No WebSocket support");this.connected=!1,this.emitter=Je();let{format:n,subprotocol:o,authStrategy:i}=r;this.format=n||"text",this.connectionOptions=r.websocketOptions,this.authStrategy=i||"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((r,s)=>{let n=[];n.push(this.once("open",()=>{n.forEach(o=>o()),r()})),n.push(this.once("close",()=>{n.forEach(o=>o()),s(Error("WS connection closed"))}))})}setURL(e){this.url=e}setParam(e,r){let s=new URL(this.url);s.searchParams.set(e,r);let n=`${s.protocol}//${s.host}${s.pathname}?${s.searchParams}`;this.setURL(n)}setToken(e,r="jid"){if(this.authStrategy==="param")this.setParam(r,e);else if(this.authStrategy==="header"){this.connectionOptions=this.connectionOptions||{},this.connectionOptions.headers=this.connectionOptions.headers||{};let s=`x-${r}`.toLowerCase();s=Object.keys(this.connectionOptions.headers).find(n=>n.toLowerCase()===s)||s,this.connectionOptions.headers[s]=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,r){return this.emitter.on(e,r)}once(e,r){let s=this.emitter.on(e,(...n)=>{s(),r(...n)});return s}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 r=e.data;this.format==="binary"&&(r=new Uint8Array(r)),this.emitter.emit("data",r)},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")}}class Ri{constructor(e){this.channel=e}notify(e,...r){typeof this[e]=="function"&&this[e](...r)}perform(e,r={}){this.channel.perform(e,r)}send(e){this.channel.send(e)}whisper(e){return this.channel.whisper(e)}get identifier(){return this.channel.identifier}unsubscribe(){return this.channel.disconnect()}}class xi extends Cr{constructor(e,r,s){super(e,r),this.subscription=new Ri(this),Object.assign(this.subscription,s),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 bt?this.subscription.notify("rejected"):this.subscription.notify("disconnected",{allowReconnect:!1})})}}class Ai{constructor(e){this.cable=e}create(e,r){let s,n;typeof e=="object"?(s=e.channel,delete e.channel,n=e):(s=e,n={});let o=new xi(s,n,r);return o.subscription.notify("initialized"),this.cable.subscribe(o),o.subscription}findAll(e){return this.cable.hub.channels.filter(r=>r.identifier===e).map(r=>r.subscription)}}class Pi{constructor(e){this.cable=e,this.subscriptions=new Ai(e)}send(e){return this.cable.send(e)}connect(){return this.cable.connect()}disconnect(){return this.cable.disconnect()}ensureActiveConnection(){return this.cable.connect()}}const Nr={protocol:"actioncable-v1-json",pingInterval:3e3,maxReconnectAttempts:1/0,maxMissingPings:2,logLevel:"warn",lazy:!0};function Ci(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({},Nr,e);let{protocol:r,websocketImplementation:s,websocketFormat:n,websocketOptions:o,websocketAuthStrategy:i,fallbacks:c,logLevel:l,logger:h,transport:u,encoder:d,lazy:p,monitor:m,pingInterval:v,reconnectStrategy:x,maxMissingPings:b,maxReconnectAttempts:y,subprotocol:g,tokenRefresher:_,historyTimestamp:E,protocolOptions:A,concurrentSubscribes:R,performFailures:ae,transportConfigurator:le,auth:V}=e;if(h=h||new Pe(l),typeof r=="string"){g=g||r;let W=r.substring(0,r.lastIndexOf("-")),X=r.substring(r.lastIndexOf("-")+1);if(A=A||{},W==="actioncable-v1")r=new Ar({logger:h,...A});else if(W==="actioncable-v1-ext")r=new _i({logger:h,historyTimestamp:E,...A});else throw Error(`Protocol is not supported yet: ${r}`);if(X==="json")d=d||new mi,n=n||"text";else if(X==="msgpack"){if(n="binary",!d)throw Error("Msgpack encoder must be specified explicitly. Use `@anycable/msgpack-encoder` package or build your own")}else if(X==="protobuf"){if(n=n||"binary",!d)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: ${r}`)}if(!r)throw Error("Protocol must be specified");u=u||new Oi(t,{websocketImplementation:s,websocketOptions:o,subprotocol:g,authStrategy:i,format:n}),c&&(u=new vi([u,...c],{logger:h})),V&&V.token&&u.setToken(V.token,V.param||"jid"),x=x||jr(v),m!==!1&&(m=m||new kr({pingInterval:v,reconnectStrategy:x,maxMissingPings:b,maxReconnectAttempts:y,logger:h}));let q={concurrentSubscribes:R},I=new Ei({protocol:r,transport:u,encoder:d,logger:h,lazy:p,hubOptions:q,performFailures:ae,transportConfigurator:le});return m&&(m.watch(I),I.monitor=m),_&&Ti(I,async()=>{try{await _(u)}catch(W){return h.error("Failed to refresh authentication token: "+W),!1}return I.connect().catch(()=>{}),!0}),I}function Ti(t,e){let r=!1;t.on("connect",()=>r=!1),t.on("close",async s=>{if(s){if(r){t.logger.warn("Token auto-refresh is disabled",s);return}s.reason==="token_expired"&&(r=!0,await e())}})}class ji extends xr{writeLogEntry(e,r,s){s?console[e](r,s):console[e](r)}}class ki extends kr{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")},r=n=>{this.reconnectNow()&&this.logger.debug("Trigger reconnect",{event:n})},s=()=>this.disconnect(new z("page_frozen"));document.addEventListener("visibilitychange",e,!1),window.addEventListener("focus",r,!1),window.addEventListener("online",r,!1),window.addEventListener("resume",r,!1),window.addEventListener("freeze",s,!1),this.unbind.push(()=>{document.removeEventListener("visibilitychange",e,!1),window.removeEventListener("focus",r,!1),window.removeEventListener("online",r,!1),window.removeEventListener("resume",r,!1),window.removeEventListener("freeze",s,!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 Ni=["cable","action-cable"],Ii="/cable",He=(t,e)=>{for(let r of Ni){let s=t.head.querySelector(`meta[name='${r}-${e}']`);if(s)return s.getAttribute("content")}},Ir=t=>t.match(/wss?:\/\//)?t:typeof window<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.host}${t}`:t,Li=()=>{if(typeof document<"u"&&document.head){let t=He(document,"url");if(t)return Ir(t)}return Ir(Ii)},Ui=()=>{if(typeof document<"u"&&document.head){let t=He(document,"history-timestamp");if(t)return t|0}},Di=()=>{if(typeof document<"u"&&document.head)return He(document,"token")},Fi=()=>{if(typeof document<"u"&&document.head)return He(document,"token-param")};function $i(t,e){typeof t=="object"&&typeof e>"u"&&(e=t,t=void 0),t=t||Li(),e=e||{},e.historyTimestamp||=Ui();let r=Di();if(r){let h=Fi();e.auth=Object.assign({token:r,param:h},e.auth||{})}e=Object.assign({},Nr,e);let{logLevel:s,logger:n,pingInterval:o,reconnectStrategy:i,maxMissingPings:c,maxReconnectAttempts:l}=e;return n=e.logger=e.logger||new ji(s),i=e.reconnectStrategy=e.reconnectStrategy||jr(o),e.monitor!==!1&&(e.monitor=e.monitor||new ki({pingInterval:o,reconnectStrategy:i,maxMissingPings:c,maxReconnectAttempts:l,logger:n})),Ci(t,e)}function qi(t,e){let r=$i(t,e);return new Pi(r)}const Bi=1e3;class Mi{constructor(e,r,s,n,o){this._cable=e,this._channel=r,this._scope=s,this._callbacks=n,this._additionalOptions=o,this._subscription=null,this._unsubscribed=!1}get identifier(){return this._subscription?.identifier}perform(e,r){return this._subscription?.perform(e,r)}send(e){return this._subscription?.send(e)}unsubscribe(){return this._unsubscribed=!0,this._cable._forget(this),this._subscription?.unsubscribe()}_subscribe(e){this._unsubscribed||(this._subscription=e.subscriptions.create({channel:this._channel,token:localStorage.openc3Token,...this._additionalOptions},{...this._callbacks,disconnected:r=>{this._unsubscribed||(r?.allowReconnect===!1&&this._cable._scheduleRecovery(),this._callbacks.disconnected?.(r))}}))}}class zi{constructor(e="/openc3-api/cable"){this._cable=null,this._url=e,this._subscriptions=new Set,this._recovery=null}disconnect(){this._cancelRecovery(),this._subscriptions.forEach(e=>{e._unsubscribed=!0}),this._subscriptions.clear(),this._cable&&(this._cable.cable.disconnect(),this._cable=null)}createSubscription(e,r,s={},n={}){const o=new Mi(this,e,r,s,n);return this._subscriptions.add(o),this._resubscribe(o).then(()=>o)}_resubscribe(e){if(this._cable==null){const r=new URL(this._url,document.baseURI);r.searchParams.set("scope",e._scope),this._cable=qi(r.href)}return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(r=>{r&&OpenC3Auth.setTokens(),this._cable&&e._subscribe(this._cable)}).catch(r=>{if(!xe(r))throw r})}_scheduleRecovery(){this._recovery||(this._recovery=setTimeout(()=>{const e=[...this._subscriptions];this._cable&&(this._cable.cable.disconnect(),this._cable=null),e.reduce((r,s)=>r.then(()=>this._resubscribe(s)),Promise.resolve()).catch(r=>console.error("failed to recover cable",r)).finally(()=>{this._recovery=null})},Bi))}_cancelRecovery(){this._recovery&&(clearTimeout(this._recovery),this._recovery=null)}_forget(e){this._subscriptions.delete(e),this._subscriptions.size===0&&this._cancelRecovery()}recordPing(){}}Qe("X",zi);function Ce(t){return Wi.test(t)}const Wi=/^-?[0-9]+$/;function Lr(t){return Ji.test(t)}const Ji=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Ur(t,e){if(Ce(t))return Number.isSafeInteger(Number.parseInt(t,10));const r=Number.parseFloat(t),s=String(r);if(t===s)return!0;const n=Dr(t),o=Dr(s);return!!(n===o||e?.approx===!0&&!Ce(t)&&o.length>=14&&n.startsWith(o.substring(0,14)))}let Te=(function(t){return t.underflow="underflow",t.overflow="overflow",t.truncate_integer="truncate_integer",t.truncate_float="truncate_float",t})({});function Hi(t){if(Ur(t,{approx:!1}))return;if(Ce(t))return Te.truncate_integer;const e=Number.parseFloat(t);return Number.isFinite(e)?e===0?Te.underflow:Te.truncate_float:Te.overflow}function Dr(t){const{start:e,end:r}=Vi(t),s=t.substring(e,r),n=s.indexOf(".");return n===-1?s:s.substring(0,n)+s.substring(n+1)}function Vi(t){let e=0;for(t[0]==="-"&&e++;t[e]==="0"||t[e]===".";)e++;let r=t.lastIndexOf("e");for(r===-1&&(r=t.lastIndexOf("E")),r===-1&&(r=t.length);(t[r-1]==="0"||t[r-1]===".")&&r>e;)r--;return{start:e,end:r}}class Ki{isLosslessNumber=!0;constructor(e){if(!Lr(e))throw new Error(`Invalid number (value: "${e}")`);this.value=e}valueOf(){const e=Hi(this.value);if(e===void 0||e===Te.truncate_float)return Number.parseFloat(this.value);if(Ce(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 Xi(t){return t&&typeof t=="object"&&t.isLosslessNumber||!1}function Qi(t){return new Ki(t)}function Gi(t,e){return _t({"":t},"",t,e)}function _t(t,e,r,s){return Array.isArray(r)?s.call(t,e,Yi(r,s)):r&&typeof r=="object"&&!Xi(r)?s.call(t,e,Zi(r,s)):s.call(t,e,r)}function Zi(t,e){for(const r of Object.keys(t)){const s=_t(t,r,t[r],e);s!==void 0?t[r]=s:delete t[r]}return t}function Yi(t,e){for(let r=0;r<t.length;r++)t[r]=_t(t,String(r),t[r],e);return t}function eo(t,e,r){const s=typeof r=="function"?{parseNumber:r}:r,n=s?.parseNumber??Qi,o=s?.onDuplicateKey??ae;let i=0;const c=u();return y(c),_(),e?Gi(c,e):c;function l(){if(t.charCodeAt(i)===oo){i++,p();const w={};let P=!0;for(;i<t.length&&t.charCodeAt(i)!==$r;){P?P=!1:(x(),p());const J=i,K=m();if(K===void 0){R();return}p(),b();const F=u();if(F===void 0){W();return}if(Object.prototype.hasOwnProperty.call(w,K)&&!yt(F,w[K])){const T=o({key:K,position:J+1,oldValue:w[K],newValue:F});T!==void 0&&(w[K]=T)}else w[K]=F}return t.charCodeAt(i)!==$r&&le(),i++,w}}function h(){if(t.charCodeAt(i)===co){i++,p();const w=[];let P=!0;for(;i<t.length&&t.charCodeAt(i)!==qr;){P?P=!1:x();const J=u();g(J),w.push(J)}return t.charCodeAt(i)!==qr&&V(),i++,w}}function u(){p();const w=m()??v()??l()??h()??d("true",!0)??d("false",!1)??d("null",null);return p(),w}function d(w,P){if(t.slice(i,i+w.length)===w)return i+=w.length,P}function p(){for(;to(t.charCodeAt(i));)i++}function m(){if(t.charCodeAt(i)===wt){i++;let w="";for(;i<t.length&&t.charCodeAt(i)!==wt;){if(t.charCodeAt(i)===io){const P=t[i+1],J=no[P];J!==void 0?(w+=J,i++):P==="u"?Ve(t.charCodeAt(i+2))&&Ve(t.charCodeAt(i+3))&&Ve(t.charCodeAt(i+4))&&Ve(t.charCodeAt(i+5))?(w+=String.fromCharCode(Number.parseInt(t.slice(i+2,i+6),16)),i+=5):X(i):I(i)}else so(t.charCodeAt(i))?w+=t[i]:q(t[i]);i++}return A(),i++,w}}function v(){const w=i;if(t.charCodeAt(i)===Br&&(i++,E(w)),t.charCodeAt(i)===Et)i++;else if(ro(t.charCodeAt(i)))for(i++;Ke(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===mo)for(i++,E(w);Ke(t.charCodeAt(i));)i++;if(t.charCodeAt(i)===Eo||t.charCodeAt(i)===wo)for(i++,(t.charCodeAt(i)===Br||t.charCodeAt(i)===fo)&&i++,E(w);Ke(t.charCodeAt(i));)i++;if(i>w)return n(t.slice(w,i))}function x(){if(t.charCodeAt(i)!==go)throw new SyntaxError(`Comma ',' expected after value ${B()}`);i++}function b(){if(t.charCodeAt(i)!==bo)throw new SyntaxError(`Colon ':' expected after property name ${B()}`);i++}function y(w){if(w===void 0)throw new SyntaxError(`JSON value expected ${B()}`)}function g(w){if(w===void 0)throw new SyntaxError(`Array item expected ${B()}`)}function _(){if(i<t.length)throw new SyntaxError(`Expected end of input ${B()}`)}function E(w){if(!Ke(t.charCodeAt(i))){const P=t.slice(w,i);throw new SyntaxError(`Invalid number '${P}', expecting a digit ${B()}`)}}function A(){if(t.charCodeAt(i)!==wt)throw new SyntaxError(`End of string '"' expected ${B()}`)}function R(){throw new SyntaxError(`Quoted object key expected ${B()}`)}function ae(w){let{key:P,position:J}=w;throw new SyntaxError(`Duplicate key '${P}' encountered at position ${J}`)}function le(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${B()}`)}function V(){throw new SyntaxError(`Array item or end of array ']' expected ${B()}`)}function q(w){throw new SyntaxError(`Invalid character '${w}' ${L()}`)}function I(w){const P=t.slice(w,w+2);throw new SyntaxError(`Invalid escape character '${P}' ${L()}`)}function W(){throw new SyntaxError(`Object value expected after ':' ${L()}`)}function X(w){const P=t.slice(w,w+6);throw new SyntaxError(`Invalid unicode character '${P}' ${L()}`)}function L(){return`at position ${i}`}function me(){return i<t.length?`but got '${t[i]}'`:"but reached end of input"}function B(){return`${me()} ${L()}`}}function to(t){return t===ao||t===lo||t===uo||t===ho}function Ve(t){return t>=Et&&t<=St||t>=_o&&t<=So||t>=yo&&t<=vo}function Ke(t){return t>=Et&&t<=St}function ro(t){return t>=po&&t<=St}function so(t){return t>=32&&t<=1114111}function yt(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>yt(r,e[s])):Fr(t)&&Fr(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(r=>yt(t[r],e[r])):!1}function Fr(t){return typeof t=="object"&&t!==null}const no={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
10
|
-
`,r:"\r",t:" "},io=92,oo=123,$r=125,co=91,qr=93,ao=32,lo=10,uo=9,ho=13,wt=34,fo=43,Br=45,Et=48,po=49,St=57,go=44,mo=46,bo=58,_o=65,yo=97,wo=69,Eo=101,So=70,vo=102;function Mr(t,e,r,s){return n(t);function n(l,h){if(Array.isArray(s)){const u=s.find(d=>d.test(l));if(u){const d=u.stringify(l);if(typeof d!="string"||!Lr(d))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${d})`);return d}}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?.isLosslessNumber||typeof l=="bigint")return l.toString();if(Array.isArray(l))return o(l);if(l&&typeof l=="object")return i(l)}function o(l,h){if(l.length===0)return"[]";let u="[";for(let d=0;d<l.length;d++){const p=l[d];typeof p<"u"&&typeof p!="function"?u+=n(p):u+="null",d<l.length-1&&(u+=",")}return u+="]",u}function i(l,h){if(typeof l.toJSON=="function")return Mr(l.toJSON(),e,r,void 0);const u=Array.isArray(e)?e.map(String):Object.keys(l);if(u.length===0)return"{}";let d=!0,p="{";for(const m of u){const v=l[m];if(c(m,v)){d?d=!1:p+=",";const x=JSON.stringify(m);p+=`${x}:`,p+=n(v)}}return p+="}",p}function c(l,h){return typeof h<"u"&&typeof h!="function"&&typeof h!="symbol"}}function Oo(t){return Ce(t)&&!Ur(t)?BigInt(t):Number.parseFloat(t)}class Ro{id=1;constructor(){}async exec(e,r,s={},n={},o=6e4){await pt(),this.id=this.id+1;try{return s.scope=window.openc3Scope,n.manual=!0,(await gt.post("/openc3-api/api",{jsonrpc:"2.0",method:e,params:r,id:this.id,keyword_params:s},{headers:{Authorization:localStorage.openc3Token,"Content-Type":"application/json-rpc",...n},timeout:o,transformRequest:[(i,c)=>Mr(i)],transformResponse:[i=>{try{return eo(i,void 0,Oo)}catch{const c=typeof i=="string"?i.substring(0,200):String(i),l=new Error(`Server returned non-JSON response: ${c}`);throw l.name="ServerError",l}}]})).data.result}catch(i){let c=new Error;throw i.response?(c.name=i.response.data.error.data.class,c.message=i.response.data.error.data.message,c.object=i.response.data.error):i.request?(c.name="Request error",c.message="Request error, no response received"):c=i,c}}decode_openc3_type(e){if(e!==null&&typeof e=="object"&&e.json_class=="Float"&&e.raw){if(e.raw=="NaN")return NaN;if(e.raw=="Infinity")return 1/0;if(e.raw=="-Infinity")return-1/0}return null}encode_openc3_type(e){return Number.isNaN(e)?{json_class:"Float",raw:"NaN"}:e==Number.POSITIVE_INFINITY?{json_class:"Float",raw:"Infinity"}:e==Number.NEGATIVE_INFINITY?{json_class:"Float",raw:"-Infinity"}:null}ensure_offline_access(){this.offline_access_needed().then(e=>{e&&(localStorage.openc3OfflineToken?this.set_offline_access(localStorage.openc3OfflineToken).then(()=>{delete localStorage.openc3OfflineToken}):OpenC3Auth.getOfflineAccess())})}offline_access_needed(){return this.exec("offline_access_needed",[])}set_offline_access(e){return this.exec("set_offline_access",[e])}get_all_interface_info(){return this.exec("get_all_interface_info",[])}map_target_to_interface(e,r,s,n,o){return this.exec("map_target_to_interface",[e,r],{cmd_only:s,tlm_only:n,unmap_old:o})}unmap_target_from_interface(e,r,s,n){return this.exec("unmap_target_from_interface",[e,r],{cmd_only:s,tlm_only:n})}connect_interface(e,...r){return r.length>0?this.exec("connect_interface",[e,...r]):this.exec("connect_interface",[e])}disconnect_interface(e){return this.exec("disconnect_interface",[e])}interface_cmd(e,r,...s){return this.exec("interface_cmd",[e,r,...s])}interface_target_enable(e,r,s=!1,n=!1){return this.exec("interface_target_enable",[e,r],{cmd_only:s,tlm_only:n})}interface_target_disable(e,r,s=!1,n=!1){return this.exec("interface_target_disable",[e,r],{cmd_only:s,tlm_only:n})}interface_details(e){return this.exec("interface_details",[e])}get_all_router_info(){return this.exec("get_all_router_info",[])}map_target_to_router(e,r,s,n,o){return this.exec("map_target_to_router",[e,r],{cmd_only:s,tlm_only:n,unmap_old:o})}unmap_target_from_router(e,r,s,n){return this.exec("unmap_target_from_router",[e,r],{cmd_only:s,tlm_only:n})}connect_router(e){return this.exec("connect_router",[e])}disconnect_router(e){return this.exec("disconnect_router",[e])}router_target_enable(e,r,s=!1,n=!1){return this.exec("router_target_enable",[e,r],{cmd_only:s,tlm_only:n})}router_target_disable(e,r,s=!1,n=!1){return this.exec("router_target_disable",[e,r],{cmd_only:s,tlm_only:n})}router_details(e){return this.exec("router_details",[e])}get_target_interfaces(){return this.exec("get_target_interfaces",[])}get_tlm_cnts(e){return this.exec("get_tlm_cnts",[e])}get_item(e,r,s){return this.exec("get_item",[e,r,s])}get_param(e,r,s){return this.exec("get_param",[e,r,s])}get_parameter(e,r,s){return this.get_param(e,r,s)}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])}delete_limits_set(e){return this.exec("delete_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.get_target_names()}get_tlm(e,r){return this.exec("get_tlm",[e,r])}get_telemetry(e,r){return this.get_tlm(e,r)}get_all_tlm(e){return this.exec("get_all_tlm",[e])}get_all_telemetry(e){return this.get_all_tlm(e)}get_all_tlm_names(e,r=!1){return this.exec("get_all_tlm_names",[e],{hidden:r})}get_all_telemetry_names(e){return this.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,r,s,n=30){const o=await this.exec("get_tlm_packet",[e,r],{type:s,stale_time:n});if(o!=null){let i=o.length,c=null;for(let l=0;l<i;l++)c=this.decode_openc3_type(o[l][1]),c!==null&&(o[l][1]=c)}return o}get_packet_derived_items(e,r){return this.exec("get_packet_derived_items",[e,r])}get_tlm_buffer(e,r){return this.exec("get_tlm_buffer",[e,r])}get_tlm_available(e,r={},s={}){return this.exec("get_tlm_available",[e],r,s)}async get_tlm_values(e,r=30,s=null,n=null,o=null,i={}){let c={stale_time:r};s!==null&&(c.cache_timeout=s),n!==null&&(c.start_time=n.toISOString()),o!==null&&(c.end_time=o.toISOString());const l=await this.exec("get_tlm_values",[e],c,i,1e4);if(l&&l.length>0){let h=l.length,u=null;for(let d=0;d<h;d++)u=this.decode_openc3_type(l[d][0]),u!==null&&(l[d][0]=u)}return l}get_limits(e,r,s){return this.exec("get_limits",[e,r,s])}async tlm(e,r,s,n="CONVERTED"){let o=null;if(r===void 0)o=await this.exec("tlm",[e]);else if(s===void 0)if(["RAW","CONVERTED","FORMATTED"].includes(r))o=await this.exec("tlm",[e],{type:r});else{let c=new Error;throw c.name="TypeError",c.message=`Invalid data type ${r}. Valid options are RAW, CONVERTED or FORMATTED.`,c}else o=await this.exec("tlm",[e,r,s],{type:n});let i=this.decode_openc3_type(o);return i!==null&&(o=i),o}async inject_tlm(e,r,s=null,n="CONVERTED",o=!1){await this.exec("inject_tlm",[e,r,s],{type:n,stored:o})}set_tlm(e,r,s,n){return this.exec("set_tlm",[e,r,s],{type:n})}override_tlm(e,r,s,n){return this.exec("override_tlm",[e,r,s],{type:n})}get_overrides(){return this.exec("get_overrides")}normalize_tlm(e,r,s,n){return this.exec("normalize_tlm",[e,r,s],{type:n})}get_all_cmds(e){return this.exec("get_all_cmds",[e])}get_all_commands(e){return this.get_all_cmds(e)}get_all_cmd_names(e,r=!1){return this.exec("get_all_cmd_names",[e],{hidden:r})}get_all_command_names(e){return this.get_all_cmd_names(e)}get_cmd(e,r){return this.exec("get_cmd",[e,r])}get_command(e,r){return this.get_cmd(e,r)}get_cmd_cnts(e){return this.exec("get_cmd_cnts",[e])}get_cmd_value(e,r,s,n="CONVERTED"){return this.exec("get_cmd_value",[e,r,s,n])}get_cmd_buffer(e,r){return this.exec("get_cmd_buffer",[e,r])}_cmd(e,r,s,n,o,i={}){let c=null;for(let l in n)Object.prototype.hasOwnProperty.call(n,l)&&(c=this.encode_openc3_type(n[l]),c!==null&&(n[l]=c));return this.exec(e,[r,s,n],i,o)}get_cmd_hazardous(e,r,s,n={}){return r===void 0?this.exec("get_cmd_hazardous",e,{},n):this._cmd("get_cmd_hazardous",e,r,s,n)}cmd(e,r,s,n={},o={}){return r===void 0?this.exec("cmd",e,o,n):this._cmd("cmd",e,r,s,n,o)}cmd_no_range_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_range_check",e,o,n):this._cmd("cmd_no_range_check",e,r,s,n,o)}cmd_raw(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw",e,o,n):this._cmd("cmd_raw",e,r,s,n,o)}cmd_raw_no_range_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_range_check",e,o,n):this._cmd("cmd_raw_no_range_check",e,r,s,n,o)}cmd_no_hazardous_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_hazardous_check",e,o,n):this._cmd("cmd_no_hazardous_check",e,r,s,n,o)}cmd_no_checks(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_no_checks",e,o,n):this._cmd("cmd_no_checks",e,r,s,n,o)}cmd_raw_no_hazardous_check(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_hazardous_check",e,o,n):this._cmd("cmd_raw_no_hazardous_check",e,r,s,n,o)}cmd_raw_no_checks(e,r,s,n={},o={}){return r===void 0?this.exec("cmd_raw_no_checks",e,o,n):this._cmd("cmd_raw_no_checks",e,r,s,n,o)}build_cmd(e,r,s,n={},o={}){return r===void 0?this.exec("build_cmd",e,o,n):this._cmd("build_cmd",e,r,s,n,o)}build_command(e,r,s,n={},o={}){return this.build_cmd(e,r,s,n,o)}get_interface_names(){return this.exec("get_interface_names",[])}get_router_names(){return this.exec("get_router_names",[])}send_raw(e,r){return this.exec("send_raw",[e,r])}list_configs(e){return this.exec("list_configs",[e])}load_config(e,r){return this.exec("load_config",[e,r])}save_config(e,r,s){return this.exec("save_config",[e,r,s])}delete_config(e,r){return this.exec("delete_config",[e,r])}enable_limits(e,r,s){return this.exec("enable_limits",[e,r,s])}disable_limits(e,r,s){return this.exec("disable_limits",[e,r,s])}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,r){return this.exec("get_setting",[e],r)}get_settings(e,r){return this.exec("get_settings",e,r)}set_setting(e,r){return this.exec("set_setting",[e,r])}update_news(){return this.exec("update_news",[])}update_plugin_store(){return this.exec("update_plugin_store",[])}save_setting(e,r){return this.set_setting(e,r)}get_metrics(){return this.exec("get_metrics",[])}open_tab(e){window.open(e,"_blank")}async hashString(e){if(window.isSecureContext){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",r),n=new Uint8Array(s);return Array.from(n).map(o=>o.toString(16).padStart(2,"0")).join("")}}}Qe("Q",Ro)})}}));
|