From eb8997fbe823c9debc23fe4e13289dd22b99a424 Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Tue, 3 Mar 2026 02:33:09 +0000 Subject: [PATCH] Release v0.9.304 Automated sync from private repository. Built with obfuscation enabled. --- frontend/dist/VERSION | 2 +- ...BUuyWAmX.js => AnalyzerFilterPanel-DdXhKyZf.js} | 2 +- ...pLayer-NuqTvOvz.js => BasemapLayer-CeyADeA1.js} | 4 ++-- ...atBubble-BuuYl9Rr.js => ChatBubble-DKx9qJbz.js} | 2 +- ...ZJRMz.js => CollisionExplorerModal-D9V91Yz1.js} | 2 +- ...ation-tKO62oR_.js => Configuration-DaPSiY3g.js} | 2 +- ...mModal-D2DSFKRK.js => ConfirmModal-4-j2cctt.js} | 2 +- .../{Contacts-DyjGy2DF.js => Contacts-2Yx_cmAj.js} | 6 +++--- ...B-sbLVsX.js => ContactsMapMapLibre-46MKHZ47.js} | 2 +- ...Dashboard-B3SyL0YD.js => Dashboard-6pffDPFe.js} | 14 +++++++------- .../{DataBox-CwAsAwyY.js => DataBox-ABvJ7hn1.js} | 2 +- ...DataValue-CjX4hzMo.js => DataValue-DoI73agL.js} | 2 +- .../assets/{Grid-suKoG48i.js => Grid-xhoz0JJL.js} | 2 +- ...Button-BQwZ8hrN.js => KeycapButton-BshTHlF3.js} | 2 +- ...line-BjpzakdT.js => LightSparkline-CIu8T-_d.js} | 2 +- .../{Login-CO56EEwr.js => Login-EFNGv6qi.js} | 2 +- .../assets/{Logs-BreOeqGn.js => Logs-BT5P96Jv.js} | 2 +- ...MeshGraph-8GIpDJZb.js => MeshGraph-V9pZlvEq.js} | 6 +++--- .../assets/{Mqtt-BaDp61mH.js => Mqtt-DrmwIl2T.js} | 2 +- ...Badge-CGW6hCWV.js => MqttModeBadge-xEEk549C.js} | 2 +- ...CtqEav-P.js => NodeInformationCard-DJ0EACZ1.js} | 2 +- ...cketList-Bpo20OVL.js => PacketList-3khSiIZq.js} | 6 +++--- ...y-CoKryHKi.js => PacketObservatory-CGzUdg1y.js} | 4 ++-- .../{Packets-CNQvqRHc.js => Packets-D9oGi0fh.js} | 2 +- ...geLayout-B8orsDlo.js => PageLayout-CjepFyhn.js} | 2 +- ...bre-CNUY5MTe.js => PathMapMapLibre-XWZ321IJ.js} | 2 +- ...omServer-DuVH7Mva.js => RoomServer-BWTs1Hn2.js} | 2 +- .../{Sessions-Q_JqsA8g.js => Sessions-DpqaKj0P.js} | 2 +- ...tor-B0ppyCo-.js => SignalIndicator-B1hS3JQG.js} | 2 +- ...atistics-Bw6LiBHK.js => Statistics-Dzy8J7Q2.js} | 2 +- .../{System-Bt641EGB.js => System-CNYv76nU.js} | 2 +- .../{Terminal-Bhn7RvtT.js => Terminal-xFWzIyff.js} | 4 ++-- .../{activity-CctJQ0y-.js => activity-CzPYx3Pb.js} | 2 +- .../{antenna-DiJxjpBL.js => antenna-CzKXc7OF.js} | 2 +- .../{arrow-up-DQmOy4Je.js => arrow-up-pO4AtOWx.js} | 2 +- ...colors-MuK22b26.js => badge-colors-BgV-I1O5.js} | 2 +- ...at-utils-BUBqf9vH.js => chat-utils-CPRl3lbc.js} | 2 +- ...right-1kmv-Vqa.js => chevron-right-Ewog5LA3.js} | 2 +- ...-check-DW83e7Fg.js => circle-check-6eqe109E.js} | 2 +- ...DUlGgWh.js => circle-question-mark-CJt3zunX.js} | 2 +- ...le-stop-B5RN0x4p.js => circle-stop-e_aFfaa6.js} | 2 +- .../{circle-x-BDVzq0qX.js => circle-x-DAvnTI4S.js} | 2 +- ...y-BsBD_8RF.js => consumer-registry-DcpFyHd4.js} | 2 +- .../assets/{cpu-DRQNCIcF.js => cpu-CGipD77S.js} | 2 +- .../{database-bNR-4XQS.js => database-Hkah1WM3.js} | 2 +- .../{download-CNAyp-3r.js => download-7lpHRyVo.js} | 2 +- .../{easing-CvrBfrm0.js => easing-CgZkd7Dy.js} | 2 +- ...nt-CM_Y2Bj0.js => element-movement-CSsBUmDY.js} | 2 +- .../{funnel-DLa9oQpD.js => funnel-B4y6lzBW.js} | 2 +- .../assets/{hash-CTme6GHI.js => hash-Bwa-X17j.js} | 2 +- .../{index-CvSa8h-C.js => index-WhzslczH.js} | 6 +++--- .../{index-CPifxb0-.js => index-WiXmWhPS.js} | 2 +- ...key-round-CYJwakCI.js => key-round-m5pQJFxH.js} | 2 +- .../{layers-Cnw2L-3K.js => layers-rhF42Hfn.js} | 2 +- ...coring-DaKaf0kz.js => link-scoring-DGx3Bvuc.js} | 2 +- .../{listbox-Xbs80tag.js => listbox-B9_kY-R5.js} | 2 +- .../{map-pin-BCwmmHGs.js => map-pin-BXCqDxIA.js} | 2 +- ...ibre-gl-CFrumWyy.js => maplibre-gl-7drIhCrs.js} | 2 +- .../assets/{max-B4xU84un.js => max-Ch6kRxV_.js} | 2 +- ...uare-DODYXl2V.js => message-square-D2zm03U4.js} | 2 +- ...-D-7zPu_H.js => monitor-smartphone-h2eaOleh.js} | 2 +- .../{network-VirimdjG.js => network-BXTFbhix.js} | 2 +- ...de-types-BJsOTMm_.js => node-types-BuI9FfZZ.js} | 2 +- .../assets/{ping-D0xwlHyD.js => ping-BA7i2ph0.js} | 2 +- .../assets/{plus-CNNHSjgp.js => plus-Q9JrSYS-.js} | 2 +- ...imitives-BahnzDua.js => primitives-Bq_jqX-t.js} | 2 +- ...fresh-cw-DQJSjSjI.js => refresh-cw-BLqMXKuf.js} | 2 +- .../{search-BZtD4Hr8.js => search-DttoJEPu.js} | 2 +- ...ttings-2-CLi8XLBD.js => settings-2-DdLL0vPm.js} | 2 +- .../{shield-DDEEZTF6.js => shield-DWGSxaaG.js} | 2 +- .../{system-CteuZERM.js => system-Dr_EmFwL.js} | 2 +- .../{target-M8AQjykJ.js => target-PpDPv2u2.js} | 2 +- .../{trash-2-DUG72tk9.js => trash-2-dqn51YO_.js} | 2 +- ...lert-C7tm61-l.js => triangle-alert-BsvKjxO1.js} | 2 +- ...ore-1D-N8rLK.js => useMapViewStore-7rwVBEII.js} | 2 +- ...re-pGK8Y5O7.js => usePipelineStore-DZf0BPc-.js} | 4 ++-- ...3jubF3.js => webgl-device-QoBMYpnS-C8RX9Ou8.js} | 2 +- .../assets/{wifi-DV8DJqF0.js => wifi-B-dNXYIH.js} | 2 +- .../{wifi-off-B6--LVD1.js => wifi-off-DjfOg4sJ.js} | 2 +- .../assets/{zap-mngIm3qT.js => zap-Ec1PEQMI.js} | 2 +- frontend/dist/index.html | 2 +- frontend/package.json | 2 +- 82 files changed, 100 insertions(+), 100 deletions(-) rename frontend/dist/assets/{AnalyzerFilterPanel-BUuyWAmX.js => AnalyzerFilterPanel-DdXhKyZf.js} (98%) rename frontend/dist/assets/{BasemapLayer-NuqTvOvz.js => BasemapLayer-CeyADeA1.js} (99%) rename frontend/dist/assets/{ChatBubble-BuuYl9Rr.js => ChatBubble-DKx9qJbz.js} (93%) rename frontend/dist/assets/{CollisionExplorerModal-BC_ZJRMz.js => CollisionExplorerModal-D9V91Yz1.js} (96%) rename frontend/dist/assets/{Configuration-tKO62oR_.js => Configuration-DaPSiY3g.js} (98%) rename frontend/dist/assets/{ConfirmModal-D2DSFKRK.js => ConfirmModal-4-j2cctt.js} (84%) rename frontend/dist/assets/{Contacts-DyjGy2DF.js => Contacts-2Yx_cmAj.js} (92%) rename frontend/dist/assets/{ContactsMapMapLibre-B-sbLVsX.js => ContactsMapMapLibre-46MKHZ47.js} (99%) rename frontend/dist/assets/{Dashboard-B3SyL0YD.js => Dashboard-6pffDPFe.js} (51%) rename frontend/dist/assets/{DataBox-CwAsAwyY.js => DataBox-ABvJ7hn1.js} (91%) rename frontend/dist/assets/{DataValue-CjX4hzMo.js => DataValue-DoI73agL.js} (92%) rename frontend/dist/assets/{Grid-suKoG48i.js => Grid-xhoz0JJL.js} (95%) rename frontend/dist/assets/{KeycapButton-BQwZ8hrN.js => KeycapButton-BshTHlF3.js} (98%) rename frontend/dist/assets/{LightSparkline-BjpzakdT.js => LightSparkline-CIu8T-_d.js} (96%) rename frontend/dist/assets/{Login-CO56EEwr.js => Login-EFNGv6qi.js} (99%) rename frontend/dist/assets/{Logs-BreOeqGn.js => Logs-BT5P96Jv.js} (92%) rename frontend/dist/assets/{MeshGraph-8GIpDJZb.js => MeshGraph-V9pZlvEq.js} (99%) rename frontend/dist/assets/{Mqtt-BaDp61mH.js => Mqtt-DrmwIl2T.js} (98%) rename frontend/dist/assets/{MqttModeBadge-CGW6hCWV.js => MqttModeBadge-xEEk549C.js} (98%) rename frontend/dist/assets/{NodeInformationCard-CtqEav-P.js => NodeInformationCard-DJ0EACZ1.js} (90%) rename frontend/dist/assets/{PacketList-Bpo20OVL.js => PacketList-3khSiIZq.js} (99%) rename frontend/dist/assets/{PacketObservatory-CoKryHKi.js => PacketObservatory-CGzUdg1y.js} (99%) rename frontend/dist/assets/{Packets-CNQvqRHc.js => Packets-D9oGi0fh.js} (96%) rename frontend/dist/assets/{PageLayout-B8orsDlo.js => PageLayout-CjepFyhn.js} (89%) rename frontend/dist/assets/{PathMapMapLibre-CNUY5MTe.js => PathMapMapLibre-XWZ321IJ.js} (98%) rename frontend/dist/assets/{RoomServer-DuVH7Mva.js => RoomServer-BWTs1Hn2.js} (97%) rename frontend/dist/assets/{Sessions-Q_JqsA8g.js => Sessions-DpqaKj0P.js} (96%) rename frontend/dist/assets/{SignalIndicator-B0ppyCo-.js => SignalIndicator-B1hS3JQG.js} (99%) rename frontend/dist/assets/{Statistics-Bw6LiBHK.js => Statistics-Dzy8J7Q2.js} (98%) rename frontend/dist/assets/{System-Bt641EGB.js => System-CNYv76nU.js} (98%) rename frontend/dist/assets/{Terminal-Bhn7RvtT.js => Terminal-xFWzIyff.js} (99%) rename frontend/dist/assets/{activity-CctJQ0y-.js => activity-CzPYx3Pb.js} (89%) rename frontend/dist/assets/{antenna-DiJxjpBL.js => antenna-CzKXc7OF.js} (90%) rename frontend/dist/assets/{arrow-up-DQmOy4Je.js => arrow-up-pO4AtOWx.js} (92%) rename frontend/dist/assets/{badge-colors-MuK22b26.js => badge-colors-BgV-I1O5.js} (96%) rename frontend/dist/assets/{chat-utils-BUBqf9vH.js => chat-utils-CPRl3lbc.js} (94%) rename frontend/dist/assets/{chevron-right-1kmv-Vqa.js => chevron-right-Ewog5LA3.js} (85%) rename frontend/dist/assets/{circle-check-DW83e7Fg.js => circle-check-6eqe109E.js} (87%) rename frontend/dist/assets/{circle-question-mark-DDUlGgWh.js => circle-question-mark-CJt3zunX.js} (89%) rename frontend/dist/assets/{circle-stop-B5RN0x4p.js => circle-stop-e_aFfaa6.js} (94%) rename frontend/dist/assets/{circle-x-BDVzq0qX.js => circle-x-DAvnTI4S.js} (99%) rename frontend/dist/assets/{consumer-registry-BsBD_8RF.js => consumer-registry-DcpFyHd4.js} (92%) rename frontend/dist/assets/{cpu-DRQNCIcF.js => cpu-CGipD77S.js} (94%) rename frontend/dist/assets/{database-bNR-4XQS.js => database-Hkah1WM3.js} (89%) rename frontend/dist/assets/{download-CNAyp-3r.js => download-7lpHRyVo.js} (89%) rename frontend/dist/assets/{easing-CvrBfrm0.js => easing-CgZkd7Dy.js} (90%) rename frontend/dist/assets/{element-movement-CM_Y2Bj0.js => element-movement-CSsBUmDY.js} (98%) rename frontend/dist/assets/{funnel-DLa9oQpD.js => funnel-B4y6lzBW.js} (89%) rename frontend/dist/assets/{hash-CTme6GHI.js => hash-Bwa-X17j.js} (90%) rename frontend/dist/assets/{index-CvSa8h-C.js => index-WhzslczH.js} (99%) rename frontend/dist/assets/{index-CPifxb0-.js => index-WiXmWhPS.js} (99%) rename frontend/dist/assets/{key-round-CYJwakCI.js => key-round-m5pQJFxH.js} (91%) rename frontend/dist/assets/{layers-Cnw2L-3K.js => layers-rhF42Hfn.js} (92%) rename frontend/dist/assets/{link-scoring-DaKaf0kz.js => link-scoring-DGx3Bvuc.js} (94%) rename frontend/dist/assets/{listbox-Xbs80tag.js => listbox-B9_kY-R5.js} (99%) rename frontend/dist/assets/{map-pin-BCwmmHGs.js => map-pin-BXCqDxIA.js} (99%) rename frontend/dist/assets/{maplibre-gl-CFrumWyy.js => maplibre-gl-7drIhCrs.js} (99%) rename frontend/dist/assets/{max-B4xU84un.js => max-Ch6kRxV_.js} (99%) rename frontend/dist/assets/{message-square-DODYXl2V.js => message-square-D2zm03U4.js} (89%) rename frontend/dist/assets/{monitor-smartphone-D-7zPu_H.js => monitor-smartphone-h2eaOleh.js} (91%) rename frontend/dist/assets/{network-VirimdjG.js => network-BXTFbhix.js} (92%) rename frontend/dist/assets/{node-types-BJsOTMm_.js => node-types-BuI9FfZZ.js} (95%) rename frontend/dist/assets/{ping-D0xwlHyD.js => ping-BA7i2ph0.js} (94%) rename frontend/dist/assets/{plus-CNNHSjgp.js => plus-Q9JrSYS-.js} (86%) rename frontend/dist/assets/{primitives-BahnzDua.js => primitives-Bq_jqX-t.js} (99%) rename frontend/dist/assets/{refresh-cw-DQJSjSjI.js => refresh-cw-BLqMXKuf.js} (91%) rename frontend/dist/assets/{search-BZtD4Hr8.js => search-DttoJEPu.js} (87%) rename frontend/dist/assets/{settings-2-CLi8XLBD.js => settings-2-DdLL0vPm.js} (89%) rename frontend/dist/assets/{shield-DDEEZTF6.js => shield-DWGSxaaG.js} (90%) rename frontend/dist/assets/{system-CteuZERM.js => system-Dr_EmFwL.js} (91%) rename frontend/dist/assets/{target-M8AQjykJ.js => target-PpDPv2u2.js} (94%) rename frontend/dist/assets/{trash-2-DUG72tk9.js => trash-2-dqn51YO_.js} (91%) rename frontend/dist/assets/{triangle-alert-C7tm61-l.js => triangle-alert-BsvKjxO1.js} (89%) rename frontend/dist/assets/{useMapViewStore-1D-N8rLK.js => useMapViewStore-7rwVBEII.js} (97%) rename frontend/dist/assets/{usePipelineStore-pGK8Y5O7.js => usePipelineStore-DZf0BPc-.js} (97%) rename frontend/dist/assets/{webgl-device-QoBMYpnS-Br3jubF3.js => webgl-device-QoBMYpnS-C8RX9Ou8.js} (99%) rename frontend/dist/assets/{wifi-DV8DJqF0.js => wifi-B-dNXYIH.js} (90%) rename frontend/dist/assets/{wifi-off-B6--LVD1.js => wifi-off-DjfOg4sJ.js} (93%) rename frontend/dist/assets/{zap-mngIm3qT.js => zap-Ec1PEQMI.js} (89%) diff --git a/frontend/dist/VERSION b/frontend/dist/VERSION index f5895470..62ee9ffe 100644 --- a/frontend/dist/VERSION +++ b/frontend/dist/VERSION @@ -1 +1 @@ -0.9.303 +0.9.304 diff --git a/frontend/dist/assets/AnalyzerFilterPanel-BUuyWAmX.js b/frontend/dist/assets/AnalyzerFilterPanel-DdXhKyZf.js similarity index 98% rename from frontend/dist/assets/AnalyzerFilterPanel-BUuyWAmX.js rename to frontend/dist/assets/AnalyzerFilterPanel-DdXhKyZf.js index dc2c911e..ee21316b 100644 --- a/frontend/dist/assets/AnalyzerFilterPanel-BUuyWAmX.js +++ b/frontend/dist/assets/AnalyzerFilterPanel-DdXhKyZf.js @@ -1,4 +1,4 @@ -import{d as U,a8 as J,R as q,c0 as G,r as d,j as n,bo as K,B as Q}from"./index-CvSa8h-C.js";import{c as V}from"./node-types-BJsOTMm_.js";import{M as Y}from"./monitor-smartphone-D-7zPu_H.js";import{C as Z}from"./circle-question-mark-DDUlGgWh.js";import{F as W}from"./funnel-DLa9oQpD.js";import{S as ee}from"./search-BZtD4Hr8.js";/** +import{d as U,a8 as J,R as q,c0 as G,r as d,j as n,bo as K,B as Q}from"./index-WhzslczH.js";import{c as V}from"./node-types-BuI9FfZZ.js";import{M as Y}from"./monitor-smartphone-h2eaOleh.js";import{C as Z}from"./circle-question-mark-CJt3zunX.js";import{F as W}from"./funnel-B4y6lzBW.js";import{S as ee}from"./search-DttoJEPu.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/BasemapLayer-NuqTvOvz.js b/frontend/dist/assets/BasemapLayer-CeyADeA1.js similarity index 99% rename from frontend/dist/assets/BasemapLayer-NuqTvOvz.js rename to frontend/dist/assets/BasemapLayer-CeyADeA1.js index b9577f89..55c44791 100644 --- a/frontend/dist/assets/BasemapLayer-NuqTvOvz.js +++ b/frontend/dist/assets/BasemapLayer-CeyADeA1.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CvSa8h-C.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); -import{r as i,_ as $,aO as B,e as G}from"./index-CvSa8h-C.js";const H=i.createContext(null);function K(){var s;const e=(s=i.useContext(H))==null?void 0:s.maps,t=i.useContext(w);return i.useMemo(()=>({...e,current:t==null?void 0:t.map}),[e,t])}function Y(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&s===r}function v(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=t[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const a of J)a in r&&(o[a]=r[a])}return o||s});return{...e,layers:n}}const A={version:8,sources:{},layers:[]},U={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},F={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},N={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},X=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Q=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class b{constructor(t,n,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[N[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||P(this._map.transform);const r=this.props[F[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=P(o),z(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[U[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._MapClass=t,this.props=n,this._initialize(s)}get map(){return this._map}setProps(t){const n=this.props;this.props=t;const s=this._updateSettings(t,n),o=this._updateSize(t),r=this._updateViewState(t);this._updateStyle(t,n),this._updateStyleComponents(t),this._updateHandlers(t,n),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const s=b.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(n.className=r.className;r.childNodes.length>0;)n.appendChild(r.childNodes[0]);o._container=n;const a=o._resizeObserver;a&&(a.disconnect(),a.observe(n)),s.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:c}=t;return c&&(c.bounds?o.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):s._updateViewState(c)),o.isStyleLoaded()?o.fire("load"):o.once("style.load",()=>o.fire("load")),o._update(),s}_initialize(t){const{props:n}=this,{mapStyle:s=A}=n,o={...n,...n.initialViewState,container:t,style:O(s)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),n.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,n.gl)}const a=new this._MapClass(o);r.padding&&a.setPadding(r.padding),n.cursor&&(a.getCanvas().style.cursor=n.cursor),a.transformCameraUpdate=this._onCameraUpdate,a.on("style.load",()=>{var c;this._styleComponents={light:a.getLight(),sky:a.getSky(),projection:(c=a.getProjection)==null?void 0:c.call(a),terrain:a.getTerrain()},this._updateStyleComponents(this.props)}),a.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in U)a.on(c,this._onPointerEvent);for(const c in F)a.on(c,this._onCameraEvent);for(const c in N)a.on(c,this._onEvent);this._map=a}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),b.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_updateSize(t){const{viewState:n}=t;if(n){const s=this._map;if(n.width!==s.transform.width||n.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(t){const n=this._map,s=n.transform;if(!n.isMoving()){const r=z(s,t);if(Object.keys(r).length>0)return this._internalUpdate=!0,n.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(t,n){const s=this._map;let o=!1;for(const r of X)if(r in t&&!v(t[r],n[r])){o=!0;const a=s[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(s,t[r])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:s=A,styleDiffing:o=!0}=t,r={diff:o};"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(O(s),r)}}_updateStyleComponents({light:t,projection:n,sky:s,terrain:o}){var c,u;const r=this._map,a=this._styleComponents;r.style._loaded&&(t&&!v(t,a.light)&&(a.light=t,r.setLight(t)),n&&!v(n,a.projection)&&n!==((c=a.projection)==null?void 0:c.type)&&(a.projection=typeof n=="string"?{type:n}:n,(u=r.setProjection)==null||u.call(r,a.projection)),s&&!v(s,a.sky)&&(a.sky=s,r.setSky(s)),o!==void 0&&!v(o,a.terrain)&&(!o||r.getSource(o.source))&&(a.terrain=o,r.setTerrain(o)))}_updateHandlers(t,n){const s=this._map;for(const o of Q){const r=t[o]??!0,a=n[o]??!0;v(r,a)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(t){const n=this._map,{interactiveLayerIds:s=[]}=this.props;try{return n.queryRenderedFeatures(t,{layers:s.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(t.point),u=c.length>0;!u&&a&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=c,u&&!a&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}}b.savedMaps=[];const ee=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function te(e){if(!e)return null;const t=e.map,n={getMap:()=>t};for(const s of ne(t))!(s in n)&&!ee.includes(s)&&(n[s]=t[s].bind(t));return n}function ne(e){const t=new Set;let n=e;for(;n;){for(const s of Object.getOwnPropertyNames(n))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&t.add(s);n=Object.getPrototypeOf(n)}return Array.from(t)}const oe=typeof document<"u"?i.useLayoutEffect:i.useEffect;function re(e,t){const{RTLTextPlugin:n,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=t;if(n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:a,lazy:c=!0}=typeof n=="string"?{pluginUrl:n}:n;e.setRTLTextPlugin(a,u=>{u&&console.error(u)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const w=i.createContext(null);function se(e,t){const n=i.useContext(H),[s,o]=i.useState(null),r=i.useRef(),{current:a}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const l=e.mapLib;let d=!0,f;return Promise.resolve(l||$(()=>import("./maplibre-gl-CFrumWyy.js").then(m=>m.m),__vite__mapDeps([0,1]))).then(m=>{if(!d)return;if(!m)throw new Error("Invalid mapLib");const y="Map"in m?m:m.default;if(!y.Map)throw new Error("Invalid mapLib");re(y,e),e.reuseMaps&&(f=b.reuse(e,r.current)),f||(f=new b(y.Map,e,r.current)),a.map=te(f),a.mapLib=y,o(f),n==null||n.onMapMount(a.map,e.id)}).catch(m=>{const{onError:y}=e;y?y({type:"error",target:null,originalEvent:null,error:m}):console.error(m)}),()=>{d=!1,f&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?f.recycle():f.destroy())}},[]),oe(()=>{s&&s.setProps(e)}),i.useImperativeHandle(t,()=>a.map,[s]);const c=i.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),u={height:"100%"};return i.createElement("div",{id:e.id,ref:r,style:c},s&&i.createElement(w.Provider,{value:a},i.createElement("div",{"mapboxgl-children":"",style:u},e.children)))}const Me=i.forwardRef(se),ae=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function L(e,t){if(!e||!t)return;const n=e.style;for(const s in t){const o=t[s];Number.isFinite(o)&&!ae.test(s)?n[s]=`${o}px`:n[s]=o}}function Z(e,t){if(e===t)return null;const n=D(e),s=D(t),o=[];for(const r of s)n.has(r)||o.push(r);for(const r of n)s.has(r)||o.push(r);return o.length===0?null:o}function D(e){return new Set(e?e.trim().split(/\s+/):[])}const be=i.memo(i.forwardRef((e,t)=>{const{map:n,mapLib:s}=i.useContext(w),o=i.useRef({props:e}),r=i.useMemo(()=>{let E=!1;i.Children.forEach(e.children,h=>{h&&(E=!0)});const k={...e,element:E?document.createElement("div"):void 0},p=new s.Marker(k);return p.setLngLat([e.longitude,e.latitude]),p.getElement().addEventListener("click",h=>{var g,_;(_=(g=o.current.props).onClick)==null||_.call(g,{type:"click",target:p,originalEvent:h})}),p.on("dragstart",h=>{var _,S;const g=h;g.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragStart)==null||S.call(_,g)}),p.on("drag",h=>{var _,S;const g=h;g.lngLat=r.getLngLat(),(S=(_=o.current.props).onDrag)==null||S.call(_,g)}),p.on("dragend",h=>{var _,S;const g=h;g.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragEnd)==null||S.call(_,g)}),p},[]);i.useEffect(()=>(r.addTo(n.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:c,offset:u,style:l,draggable:d=!1,popup:f=null,rotation:m=0,rotationAlignment:y="auto",pitchAlignment:C="auto"}=e;i.useEffect(()=>{L(r.getElement(),l)},[l]),i.useImperativeHandle(t,()=>r,[]);const T=o.current.props;(r.getLngLat().lng!==a||r.getLngLat().lat!==c)&&r.setLngLat([a,c]),u&&!Y(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==d&&r.setDraggable(d),r.getRotation()!==m&&r.setRotation(m),r.getRotationAlignment()!==y&&r.setRotationAlignment(y),r.getPitchAlignment()!==C&&r.setPitchAlignment(C),r.getPopup()!==f&&r.setPopup(f);const x=Z(T.className,e.className);if(x)for(const E of x)r.toggleClassName(E);return o.current.props=e,B.createPortal(e.children,r.getElement())})),xe=i.memo(i.forwardRef((e,t)=>{const{map:n,mapLib:s}=i.useContext(w),o=i.useMemo(()=>document.createElement("div"),[]),r=i.useRef({props:e}),a=i.useMemo(()=>{const c={...e},u=new s.Popup(c);return u.setLngLat([e.longitude,e.latitude]),u.once("open",l=>{var d,f;(f=(d=r.current.props).onOpen)==null||f.call(d,l)}),u},[]);if(i.useEffect(()=>{const c=u=>{var l,d;(d=(l=r.current.props).onClose)==null||d.call(l,u)};return a.on("close",c),a.setDOMContent(o).addTo(n.getMap()),()=>{a.off("close",c),a.isOpen()&&a.remove()}},[]),i.useEffect(()=>{L(a.getElement(),e.style)},[e.style]),i.useImperativeHandle(t,()=>a,[]),a.isOpen()){const c=r.current.props;(a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!v(c.offset,e.offset)&&a.setOffset(e.offset),(c.anchor!==e.anchor||c.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth));const u=Z(c.className,e.className);if(u)for(const l of u)a.toggleClassName(l);r.current.props=e}return B.createPortal(e.children,o)}));function M(e,t,n,s){const o=i.useContext(w),r=i.useMemo(()=>e(o),[]);return i.useEffect(()=>{const a=t,c=null,u=typeof t=="function"?t:null,{map:l}=o;return l.hasControl(r)||(l.addControl(r,a==null?void 0:a.position),c&&c(o)),()=>{u&&u(o),l.hasControl(r)&&l.removeControl(r)}},[]),r}function ie(e){const t=M(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(ie);function ce(e){const t=M(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{L(t._controlContainer,e.style)},[e.style]),null}i.memo(ce);function le(e,t){const n=i.useRef({props:e}),s=M(({mapLib:o})=>{const r=new o.GeolocateControl(e),a=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||a()},r.on("geolocate",c=>{var u,l;(l=(u=n.current.props).onGeolocate)==null||l.call(u,c)}),r.on("error",c=>{var u,l;(l=(u=n.current.props).onError)==null||l.call(u,c)}),r.on("outofmaxbounds",c=>{var u,l;(l=(u=n.current.props).onOutOfMaxBounds)==null||l.call(u,c)}),r.on("trackuserlocationstart",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationStart)==null||l.call(u,c)}),r.on("trackuserlocationend",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationEnd)==null||l.call(u,c)}),r},{position:e.position});return n.current.props=e,i.useImperativeHandle(t,()=>s,[]),i.useEffect(()=>{L(s._container,e.style)},[e.style]),null}i.memo(i.forwardRef(le));function ue(e){const t=M(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(ue);function fe(e){const t=M(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),n=i.useRef(e),s=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&t.setUnit(e.unit),i.useEffect(()=>{L(t._container,o)},[o]),null}const ke=i.memo(fe);function de(e){const t=M(({mapLib:n})=>new n.TerrainControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(de);function me(e){const t=M(({mapLib:n})=>new n.LogoControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(me);function R(e,t){if(!e)throw new Error(t)}let ye=0;function ge(e,t,n){if(e.style&&e.style._loaded){const s={...n};return delete s.id,delete s.children,e.addSource(t,s),e.getSource(t)}return null}function he(e,t,n){var a,c,u;R(t.id===n.id,"source id changed"),R(t.type===n.type,"source type changed");let s="",o=0;for(const l in t)l!=="children"&&l!=="id"&&!v(n[l],t[l])&&(s=l,o++);if(!o)return;const r=t.type;if(r==="geojson")e.setData(t.data);else if(r==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else switch(s){case"coordinates":(a=e.setCoordinates)==null||a.call(e,t.coordinates);break;case"url":(c=e.setUrl)==null||c.call(e,t.url);break;case"tiles":(u=e.setTiles)==null||u.call(e,t.tiles);break;default:console.warn(`Unable to update prop: ${s}`)}}function Re(e){const t=i.useContext(w).map.getMap(),n=i.useRef(e),[,s]=i.useState(0),o=i.useMemo(()=>e.id||`jsx-source-${ye++}`,[]);i.useEffect(()=>{if(t){const a=()=>setTimeout(()=>s(c=>c+1),0);return t.on("styledata",a),a(),()=>{var c;if(t.off("styledata",a),t.style&&t.style._loaded&&t.getSource(o)){const u=(c=t.getStyle())==null?void 0:c.layers;if(u)for(const l of u)l.source===o&&t.removeLayer(l.id);t.removeSource(o)}}}},[t]);let r=t&&t.style&&t.getSource(o);return r?he(r,e,n.current):r=ge(t,o,e),n.current=e,r&&i.Children.map(e.children,a=>a&&i.cloneElement(a,{source:o}))||null}function pe(e,t,n,s){if(R(n.id===s.id,"layer id changed"),R(n.type===s.type,"layer type changed"),n.type==="custom"||s.type==="custom")return;const{layout:o={},paint:r={},filter:a,minzoom:c,maxzoom:u,beforeId:l}=n;if(l!==s.beforeId&&e.moveLayer(t,l),o!==s.layout){const d=s.layout||{};for(const f in o)v(o[f],d[f])||e.setLayoutProperty(t,f,o[f]);for(const f in d)o.hasOwnProperty(f)||e.setLayoutProperty(t,f,void 0)}if(r!==s.paint){const d=s.paint||{};for(const f in r)v(r[f],d[f])||e.setPaintProperty(t,f,r[f]);for(const f in d)r.hasOwnProperty(f)||e.setPaintProperty(t,f,void 0)}v(a,s.filter)||e.setFilter(t,a),(c!==s.minzoom||u!==s.maxzoom)&&e.setLayerZoomRange(t,c,u)}function ve(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const s={...n,id:t};delete s.beforeId,e.addLayer(s,n.beforeId)}}let _e=0;function Ie(e){const t=i.useContext(w).map.getMap(),n=i.useRef(e),[,s]=i.useState(0),o=i.useMemo(()=>e.id||`jsx-layer-${_e++}`,[]);if(i.useEffect(()=>{if(t){const a=()=>s(c=>c+1);return t.on("styledata",a),a(),()=>{t.off("styledata",a),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{pe(t,o,e,n.current)}catch(a){console.warn(a)}else ve(t,o,e);return n.current=e,null}const V="pymc-basemap-mode",j="dark";function Le(){if(typeof window>"u")return j;try{const e=localStorage.getItem(V);if(e==="light"||e==="dark")return e}catch{}return j}function W(e){if(!(typeof window>"u"))try{localStorage.setItem(V,e)}catch{}}const q=G(e=>({mode:Le(),toggle:()=>e(t=>{const n=t.mode==="light"?"dark":"light";return W(n),{mode:n}}),setMode:t=>{W(t),e({mode:t})}})),Te=()=>q(e=>e.mode),Pe=()=>q(e=>e.toggle),Ce={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},Se={light:"basemap-light-",dark:"basemap-dark-"},I={};async function Ee(e){if(I[e])return I[e];const n=await(await fetch(Ce[e])).json();return I[e]=n,n}function ze({mode:e}){const{current:t}=K(),[n,s]=i.useState(null),o=i.useRef({light:!1,dark:!1}),r=i.useRef({light:[],dark:[]});i.useEffect(()=>{const l=()=>{var y;const m=(y=t==null?void 0:t.getMap)==null?void 0:y.call(t);m&&!n&&s(m)};l();const d=setInterval(l,50),f=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(f)}},[t,n]);const a=i.useCallback(async(l,d,f)=>{var E,k;if(o.current[d])return;const m=Se[d],y=await Ee(d),C=[];for(const[p,h]of Object.entries(y.sources||{})){const g=m+p;l.getSource(g)||l.addSource(g,h)}const x=(k=(((E=l.getStyle())==null?void 0:E.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:k.id;for(const p of y.layers||[]){const h=m+p.id;if(C.push(h),l.getLayer(h))continue;const g={...p,id:h};"source"in g&&typeof g.source=="string"&&(g.source=m+g.source),g.layout||(g.layout={}),g.layout.visibility=f?"visible":"none";try{l.addLayer(g,x)}catch(_){console.warn(`[BasemapLayer] Failed to add layer ${h}:`,_)}}r.current[d]=C,o.current[d]=!0},[]),c=i.useCallback((l,d,f)=>{const m=r.current[d],y=f?"visible":"none";for(const C of m)if(l.getLayer(C))try{l.setLayoutProperty(C,"visibility",y)}catch{}},[]),u=i.useCallback(l=>{var m;const f=(((m=l.getStyle())==null?void 0:m.layers)||[]).filter(y=>!y.id.startsWith("basemap-light-")&&!y.id.startsWith("basemap-dark-"));for(const y of f)try{l.moveLayer(y.id)}catch{}},[]);return i.useEffect(()=>{if(!n)return;const l=d=>{n.hasImage(d.id)||n.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return n.on("styleimagemissing",l),()=>{n.off("styleimagemissing",l)}},[n]),i.useEffect(()=>{if(!n)return;let l=!1;const d=async()=>{if(!l)try{await Promise.all([a(n,"light",e==="light"),a(n,"dark",e==="dark")]),l||u(n)}catch(m){console.error("[BasemapLayer] Setup error:",m)}};n.isStyleLoaded()?d():(n.once("style.load",d),n.once("load",()=>{!l&&!o.current.light&&d()}));const f=()=>{l||setTimeout(()=>{!l&&o.current.light&&o.current.dark&&u(n)},100)};return n.on("styledata",f),()=>{l=!0,n.off("styledata",f)}},[n,a,u,e]),i.useEffect(()=>{n&&(!o.current.light||!o.current.dark||(c(n,"light",e==="light"),c(n,"dark",e==="dark")))},[n,e,c]),null}export{ze as B,Ie as L,Me as M,xe as P,Re as S,be as a,K as b,Pe as c,ke as d,Te as u}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-WhzslczH.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); +import{r as i,_ as $,aO as B,e as G}from"./index-WhzslczH.js";const H=i.createContext(null);function K(){var s;const e=(s=i.useContext(H))==null?void 0:s.maps,t=i.useContext(w);return i.useMemo(()=>({...e,current:t==null?void 0:t.map}),[e,t])}function Y(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(t)?t[0]:t?t.x:0,r=Array.isArray(t)?t[1]:t?t.y:0;return n===o&&s===r}function v(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=t[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const a of J)a in r&&(o[a]=r[a])}return o||s});return{...e,layers:n}}const A={version:8,sources:{},layers:[]},U={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},F={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},N={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},X=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],Q=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class b{constructor(t,n,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[N[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||P(this._map.transform);const r=this.props[F[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=P(o),z(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[U[o.type]];r&&(this.props.interactiveLayerIds&&o.type!=="mouseover"&&o.type!=="mouseout"&&(o.features=this._hoveredFeatures||this._queryRenderedFeatures(o.point)),r(o),delete o.features)},this._MapClass=t,this.props=n,this._initialize(s)}get map(){return this._map}setProps(t){const n=this.props;this.props=t;const s=this._updateSettings(t,n),o=this._updateSize(t),r=this._updateViewState(t);this._updateStyle(t,n),this._updateStyleComponents(t),this._updateHandlers(t,n),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const s=b.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(n.className=r.className;r.childNodes.length>0;)n.appendChild(r.childNodes[0]);o._container=n;const a=o._resizeObserver;a&&(a.disconnect(),a.observe(n)),s.setProps({...t,styleDiffing:!1}),o.resize();const{initialViewState:c}=t;return c&&(c.bounds?o.fitBounds(c.bounds,{...c.fitBoundsOptions,duration:0}):s._updateViewState(c)),o.isStyleLoaded()?o.fire("load"):o.once("style.load",()=>o.fire("load")),o._update(),s}_initialize(t){const{props:n}=this,{mapStyle:s=A}=n,o={...n,...n.initialViewState,container:t,style:O(s)},r=o.initialViewState||o.viewState||o;if(Object.assign(o,{center:[r.longitude||0,r.latitude||0],zoom:r.zoom||0,pitch:r.pitch||0,bearing:r.bearing||0}),n.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,n.gl)}const a=new this._MapClass(o);r.padding&&a.setPadding(r.padding),n.cursor&&(a.getCanvas().style.cursor=n.cursor),a.transformCameraUpdate=this._onCameraUpdate,a.on("style.load",()=>{var c;this._styleComponents={light:a.getLight(),sky:a.getSky(),projection:(c=a.getProjection)==null?void 0:c.call(a),terrain:a.getTerrain()},this._updateStyleComponents(this.props)}),a.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in U)a.on(c,this._onPointerEvent);for(const c in F)a.on(c,this._onCameraEvent);for(const c in N)a.on(c,this._onEvent);this._map=a}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),b.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_updateSize(t){const{viewState:n}=t;if(n){const s=this._map;if(n.width!==s.transform.width||n.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(t){const n=this._map,s=n.transform;if(!n.isMoving()){const r=z(s,t);if(Object.keys(r).length>0)return this._internalUpdate=!0,n.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(t,n){const s=this._map;let o=!1;for(const r of X)if(r in t&&!v(t[r],n[r])){o=!0;const a=s[`set${r[0].toUpperCase()}${r.slice(1)}`];a==null||a.call(s,t[r])}return o}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor||""),t.mapStyle!==n.mapStyle){const{mapStyle:s=A,styleDiffing:o=!0}=t,r={diff:o};"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(O(s),r)}}_updateStyleComponents({light:t,projection:n,sky:s,terrain:o}){var c,u;const r=this._map,a=this._styleComponents;r.style._loaded&&(t&&!v(t,a.light)&&(a.light=t,r.setLight(t)),n&&!v(n,a.projection)&&n!==((c=a.projection)==null?void 0:c.type)&&(a.projection=typeof n=="string"?{type:n}:n,(u=r.setProjection)==null||u.call(r,a.projection)),s&&!v(s,a.sky)&&(a.sky=s,r.setSky(s)),o!==void 0&&!v(o,a.terrain)&&(!o||r.getSource(o.source))&&(a.terrain=o,r.setTerrain(o)))}_updateHandlers(t,n){const s=this._map;for(const o of Q){const r=t[o]??!0,a=n[o]??!0;v(r,a)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(t){const n=this._map,{interactiveLayerIds:s=[]}=this.props;try{return n.queryRenderedFeatures(t,{layers:s.filter(n.getLayer.bind(n))})}catch{return[]}}_updateHover(t){var o;const{props:n}=this;if(n.interactiveLayerIds&&(n.onMouseMove||n.onMouseEnter||n.onMouseLeave)){const r=t.type,a=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(t.point),u=c.length>0;!u&&a&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=c,u&&!a&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=r}else this._hoveredFeatures=null}}b.savedMaps=[];const ee=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function te(e){if(!e)return null;const t=e.map,n={getMap:()=>t};for(const s of ne(t))!(s in n)&&!ee.includes(s)&&(n[s]=t[s].bind(t));return n}function ne(e){const t=new Set;let n=e;for(;n;){for(const s of Object.getOwnPropertyNames(n))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&t.add(s);n=Object.getPrototypeOf(n)}return Array.from(t)}const oe=typeof document<"u"?i.useLayoutEffect:i.useEffect;function re(e,t){const{RTLTextPlugin:n,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=t;if(n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:a,lazy:c=!0}=typeof n=="string"?{pluginUrl:n}:n;e.setRTLTextPlugin(a,u=>{u&&console.error(u)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const w=i.createContext(null);function se(e,t){const n=i.useContext(H),[s,o]=i.useState(null),r=i.useRef(),{current:a}=i.useRef({mapLib:null,map:null});i.useEffect(()=>{const l=e.mapLib;let d=!0,f;return Promise.resolve(l||$(()=>import("./maplibre-gl-7drIhCrs.js").then(m=>m.m),__vite__mapDeps([0,1]))).then(m=>{if(!d)return;if(!m)throw new Error("Invalid mapLib");const y="Map"in m?m:m.default;if(!y.Map)throw new Error("Invalid mapLib");re(y,e),e.reuseMaps&&(f=b.reuse(e,r.current)),f||(f=new b(y.Map,e,r.current)),a.map=te(f),a.mapLib=y,o(f),n==null||n.onMapMount(a.map,e.id)}).catch(m=>{const{onError:y}=e;y?y({type:"error",target:null,originalEvent:null,error:m}):console.error(m)}),()=>{d=!1,f&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?f.recycle():f.destroy())}},[]),oe(()=>{s&&s.setProps(e)}),i.useImperativeHandle(t,()=>a.map,[s]);const c=i.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),u={height:"100%"};return i.createElement("div",{id:e.id,ref:r,style:c},s&&i.createElement(w.Provider,{value:a},i.createElement("div",{"mapboxgl-children":"",style:u},e.children)))}const Me=i.forwardRef(se),ae=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function L(e,t){if(!e||!t)return;const n=e.style;for(const s in t){const o=t[s];Number.isFinite(o)&&!ae.test(s)?n[s]=`${o}px`:n[s]=o}}function Z(e,t){if(e===t)return null;const n=D(e),s=D(t),o=[];for(const r of s)n.has(r)||o.push(r);for(const r of n)s.has(r)||o.push(r);return o.length===0?null:o}function D(e){return new Set(e?e.trim().split(/\s+/):[])}const be=i.memo(i.forwardRef((e,t)=>{const{map:n,mapLib:s}=i.useContext(w),o=i.useRef({props:e}),r=i.useMemo(()=>{let E=!1;i.Children.forEach(e.children,h=>{h&&(E=!0)});const k={...e,element:E?document.createElement("div"):void 0},p=new s.Marker(k);return p.setLngLat([e.longitude,e.latitude]),p.getElement().addEventListener("click",h=>{var g,_;(_=(g=o.current.props).onClick)==null||_.call(g,{type:"click",target:p,originalEvent:h})}),p.on("dragstart",h=>{var _,S;const g=h;g.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragStart)==null||S.call(_,g)}),p.on("drag",h=>{var _,S;const g=h;g.lngLat=r.getLngLat(),(S=(_=o.current.props).onDrag)==null||S.call(_,g)}),p.on("dragend",h=>{var _,S;const g=h;g.lngLat=r.getLngLat(),(S=(_=o.current.props).onDragEnd)==null||S.call(_,g)}),p},[]);i.useEffect(()=>(r.addTo(n.getMap()),()=>{r.remove()}),[]);const{longitude:a,latitude:c,offset:u,style:l,draggable:d=!1,popup:f=null,rotation:m=0,rotationAlignment:y="auto",pitchAlignment:C="auto"}=e;i.useEffect(()=>{L(r.getElement(),l)},[l]),i.useImperativeHandle(t,()=>r,[]);const T=o.current.props;(r.getLngLat().lng!==a||r.getLngLat().lat!==c)&&r.setLngLat([a,c]),u&&!Y(r.getOffset(),u)&&r.setOffset(u),r.isDraggable()!==d&&r.setDraggable(d),r.getRotation()!==m&&r.setRotation(m),r.getRotationAlignment()!==y&&r.setRotationAlignment(y),r.getPitchAlignment()!==C&&r.setPitchAlignment(C),r.getPopup()!==f&&r.setPopup(f);const x=Z(T.className,e.className);if(x)for(const E of x)r.toggleClassName(E);return o.current.props=e,B.createPortal(e.children,r.getElement())})),xe=i.memo(i.forwardRef((e,t)=>{const{map:n,mapLib:s}=i.useContext(w),o=i.useMemo(()=>document.createElement("div"),[]),r=i.useRef({props:e}),a=i.useMemo(()=>{const c={...e},u=new s.Popup(c);return u.setLngLat([e.longitude,e.latitude]),u.once("open",l=>{var d,f;(f=(d=r.current.props).onOpen)==null||f.call(d,l)}),u},[]);if(i.useEffect(()=>{const c=u=>{var l,d;(d=(l=r.current.props).onClose)==null||d.call(l,u)};return a.on("close",c),a.setDOMContent(o).addTo(n.getMap()),()=>{a.off("close",c),a.isOpen()&&a.remove()}},[]),i.useEffect(()=>{L(a.getElement(),e.style)},[e.style]),i.useImperativeHandle(t,()=>a,[]),a.isOpen()){const c=r.current.props;(a.getLngLat().lng!==e.longitude||a.getLngLat().lat!==e.latitude)&&a.setLngLat([e.longitude,e.latitude]),e.offset&&!v(c.offset,e.offset)&&a.setOffset(e.offset),(c.anchor!==e.anchor||c.maxWidth!==e.maxWidth)&&(a.options.anchor=e.anchor,a.setMaxWidth(e.maxWidth));const u=Z(c.className,e.className);if(u)for(const l of u)a.toggleClassName(l);r.current.props=e}return B.createPortal(e.children,o)}));function M(e,t,n,s){const o=i.useContext(w),r=i.useMemo(()=>e(o),[]);return i.useEffect(()=>{const a=t,c=null,u=typeof t=="function"?t:null,{map:l}=o;return l.hasControl(r)||(l.addControl(r,a==null?void 0:a.position),c&&c(o)),()=>{u&&u(o),l.hasControl(r)&&l.removeControl(r)}},[]),r}function ie(e){const t=M(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(ie);function ce(e){const t=M(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return i.useEffect(()=>{L(t._controlContainer,e.style)},[e.style]),null}i.memo(ce);function le(e,t){const n=i.useRef({props:e}),s=M(({mapLib:o})=>{const r=new o.GeolocateControl(e),a=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||a()},r.on("geolocate",c=>{var u,l;(l=(u=n.current.props).onGeolocate)==null||l.call(u,c)}),r.on("error",c=>{var u,l;(l=(u=n.current.props).onError)==null||l.call(u,c)}),r.on("outofmaxbounds",c=>{var u,l;(l=(u=n.current.props).onOutOfMaxBounds)==null||l.call(u,c)}),r.on("trackuserlocationstart",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationStart)==null||l.call(u,c)}),r.on("trackuserlocationend",c=>{var u,l;(l=(u=n.current.props).onTrackUserLocationEnd)==null||l.call(u,c)}),r},{position:e.position});return n.current.props=e,i.useImperativeHandle(t,()=>s,[]),i.useEffect(()=>{L(s._container,e.style)},[e.style]),null}i.memo(i.forwardRef(le));function ue(e){const t=M(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(ue);function fe(e){const t=M(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),n=i.useRef(e),s=n.current;n.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&t.setUnit(e.unit),i.useEffect(()=>{L(t._container,o)},[o]),null}const ke=i.memo(fe);function de(e){const t=M(({mapLib:n})=>new n.TerrainControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(de);function me(e){const t=M(({mapLib:n})=>new n.LogoControl(e),{position:e.position});return i.useEffect(()=>{L(t._container,e.style)},[e.style]),null}i.memo(me);function R(e,t){if(!e)throw new Error(t)}let ye=0;function ge(e,t,n){if(e.style&&e.style._loaded){const s={...n};return delete s.id,delete s.children,e.addSource(t,s),e.getSource(t)}return null}function he(e,t,n){var a,c,u;R(t.id===n.id,"source id changed"),R(t.type===n.type,"source type changed");let s="",o=0;for(const l in t)l!=="children"&&l!=="id"&&!v(n[l],t[l])&&(s=l,o++);if(!o)return;const r=t.type;if(r==="geojson")e.setData(t.data);else if(r==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else switch(s){case"coordinates":(a=e.setCoordinates)==null||a.call(e,t.coordinates);break;case"url":(c=e.setUrl)==null||c.call(e,t.url);break;case"tiles":(u=e.setTiles)==null||u.call(e,t.tiles);break;default:console.warn(`Unable to update prop: ${s}`)}}function Re(e){const t=i.useContext(w).map.getMap(),n=i.useRef(e),[,s]=i.useState(0),o=i.useMemo(()=>e.id||`jsx-source-${ye++}`,[]);i.useEffect(()=>{if(t){const a=()=>setTimeout(()=>s(c=>c+1),0);return t.on("styledata",a),a(),()=>{var c;if(t.off("styledata",a),t.style&&t.style._loaded&&t.getSource(o)){const u=(c=t.getStyle())==null?void 0:c.layers;if(u)for(const l of u)l.source===o&&t.removeLayer(l.id);t.removeSource(o)}}}},[t]);let r=t&&t.style&&t.getSource(o);return r?he(r,e,n.current):r=ge(t,o,e),n.current=e,r&&i.Children.map(e.children,a=>a&&i.cloneElement(a,{source:o}))||null}function pe(e,t,n,s){if(R(n.id===s.id,"layer id changed"),R(n.type===s.type,"layer type changed"),n.type==="custom"||s.type==="custom")return;const{layout:o={},paint:r={},filter:a,minzoom:c,maxzoom:u,beforeId:l}=n;if(l!==s.beforeId&&e.moveLayer(t,l),o!==s.layout){const d=s.layout||{};for(const f in o)v(o[f],d[f])||e.setLayoutProperty(t,f,o[f]);for(const f in d)o.hasOwnProperty(f)||e.setLayoutProperty(t,f,void 0)}if(r!==s.paint){const d=s.paint||{};for(const f in r)v(r[f],d[f])||e.setPaintProperty(t,f,r[f]);for(const f in d)r.hasOwnProperty(f)||e.setPaintProperty(t,f,void 0)}v(a,s.filter)||e.setFilter(t,a),(c!==s.minzoom||u!==s.maxzoom)&&e.setLayerZoomRange(t,c,u)}function ve(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const s={...n,id:t};delete s.beforeId,e.addLayer(s,n.beforeId)}}let _e=0;function Ie(e){const t=i.useContext(w).map.getMap(),n=i.useRef(e),[,s]=i.useState(0),o=i.useMemo(()=>e.id||`jsx-layer-${_e++}`,[]);if(i.useEffect(()=>{if(t){const a=()=>s(c=>c+1);return t.on("styledata",a),a(),()=>{t.off("styledata",a),t.style&&t.style._loaded&&t.getLayer(o)&&t.removeLayer(o)}}},[t]),t&&t.style&&t.getLayer(o))try{pe(t,o,e,n.current)}catch(a){console.warn(a)}else ve(t,o,e);return n.current=e,null}const V="pymc-basemap-mode",j="dark";function Le(){if(typeof window>"u")return j;try{const e=localStorage.getItem(V);if(e==="light"||e==="dark")return e}catch{}return j}function W(e){if(!(typeof window>"u"))try{localStorage.setItem(V,e)}catch{}}const q=G(e=>({mode:Le(),toggle:()=>e(t=>{const n=t.mode==="light"?"dark":"light";return W(n),{mode:n}}),setMode:t=>{W(t),e({mode:t})}})),Te=()=>q(e=>e.mode),Pe=()=>q(e=>e.toggle),Ce={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},Se={light:"basemap-light-",dark:"basemap-dark-"},I={};async function Ee(e){if(I[e])return I[e];const n=await(await fetch(Ce[e])).json();return I[e]=n,n}function ze({mode:e}){const{current:t}=K(),[n,s]=i.useState(null),o=i.useRef({light:!1,dark:!1}),r=i.useRef({light:[],dark:[]});i.useEffect(()=>{const l=()=>{var y;const m=(y=t==null?void 0:t.getMap)==null?void 0:y.call(t);m&&!n&&s(m)};l();const d=setInterval(l,50),f=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(f)}},[t,n]);const a=i.useCallback(async(l,d,f)=>{var E,k;if(o.current[d])return;const m=Se[d],y=await Ee(d),C=[];for(const[p,h]of Object.entries(y.sources||{})){const g=m+p;l.getSource(g)||l.addSource(g,h)}const x=(k=(((E=l.getStyle())==null?void 0:E.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:k.id;for(const p of y.layers||[]){const h=m+p.id;if(C.push(h),l.getLayer(h))continue;const g={...p,id:h};"source"in g&&typeof g.source=="string"&&(g.source=m+g.source),g.layout||(g.layout={}),g.layout.visibility=f?"visible":"none";try{l.addLayer(g,x)}catch(_){console.warn(`[BasemapLayer] Failed to add layer ${h}:`,_)}}r.current[d]=C,o.current[d]=!0},[]),c=i.useCallback((l,d,f)=>{const m=r.current[d],y=f?"visible":"none";for(const C of m)if(l.getLayer(C))try{l.setLayoutProperty(C,"visibility",y)}catch{}},[]),u=i.useCallback(l=>{var m;const f=(((m=l.getStyle())==null?void 0:m.layers)||[]).filter(y=>!y.id.startsWith("basemap-light-")&&!y.id.startsWith("basemap-dark-"));for(const y of f)try{l.moveLayer(y.id)}catch{}},[]);return i.useEffect(()=>{if(!n)return;const l=d=>{n.hasImage(d.id)||n.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return n.on("styleimagemissing",l),()=>{n.off("styleimagemissing",l)}},[n]),i.useEffect(()=>{if(!n)return;let l=!1;const d=async()=>{if(!l)try{await Promise.all([a(n,"light",e==="light"),a(n,"dark",e==="dark")]),l||u(n)}catch(m){console.error("[BasemapLayer] Setup error:",m)}};n.isStyleLoaded()?d():(n.once("style.load",d),n.once("load",()=>{!l&&!o.current.light&&d()}));const f=()=>{l||setTimeout(()=>{!l&&o.current.light&&o.current.dark&&u(n)},100)};return n.on("styledata",f),()=>{l=!0,n.off("styledata",f)}},[n,a,u,e]),i.useEffect(()=>{n&&(!o.current.light||!o.current.dark||(c(n,"light",e==="light"),c(n,"dark",e==="dark")))},[n,e,c]),null}export{ze as B,Ie as L,Me as M,xe as P,Re as S,be as a,K as b,Pe as c,ke as d,Te as u}; diff --git a/frontend/dist/assets/ChatBubble-BuuYl9Rr.js b/frontend/dist/assets/ChatBubble-DKx9qJbz.js similarity index 93% rename from frontend/dist/assets/ChatBubble-BuuYl9Rr.js rename to frontend/dist/assets/ChatBubble-DKx9qJbz.js index 91ded5f8..81933f83 100644 --- a/frontend/dist/assets/ChatBubble-BuuYl9Rr.js +++ b/frontend/dist/assets/ChatBubble-DKx9qJbz.js @@ -1,4 +1,4 @@ -import{d as h,r as u,j as e,c as t}from"./index-CvSa8h-C.js";import{e as f,g as p,a as g,b as j,f as b}from"./chat-utils-BUBqf9vH.js";/** +import{d as h,r as u,j as e,c as t}from"./index-WhzslczH.js";import{e as f,g as p,a as g,b as j,f as b}from"./chat-utils-CPRl3lbc.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/CollisionExplorerModal-BC_ZJRMz.js b/frontend/dist/assets/CollisionExplorerModal-D9V91Yz1.js similarity index 96% rename from frontend/dist/assets/CollisionExplorerModal-BC_ZJRMz.js rename to frontend/dist/assets/CollisionExplorerModal-D9V91Yz1.js index deee437a..9f422e71 100644 --- a/frontend/dist/assets/CollisionExplorerModal-BC_ZJRMz.js +++ b/frontend/dist/assets/CollisionExplorerModal-D9V91Yz1.js @@ -1,4 +1,4 @@ -import{d as k,r as c,K as L,bS as S,P as H,j as e,am as R,an as B,bD as E,c as N,x as w,F as T,D,E as _,c0 as P}from"./index-CvSa8h-C.js";import{u as I,M as z,B as W,S as q,L as F,a as U}from"./BasemapLayer-NuqTvOvz.js";import{T as A}from"./triangle-alert-C7tm61-l.js";import{M as Y}from"./map-pin-BCwmmHGs.js";import{M as $}from"./monitor-smartphone-D-7zPu_H.js";/** +import{d as k,r as c,K as L,bS as S,P as H,j as e,am as R,an as B,bD as E,c as N,x as w,F as T,D,E as _,c0 as P}from"./index-WhzslczH.js";import{u as I,M as z,B as W,S as q,L as F,a as U}from"./BasemapLayer-CeyADeA1.js";import{T as A}from"./triangle-alert-BsvKjxO1.js";import{M as Y}from"./map-pin-BXCqDxIA.js";import{M as $}from"./monitor-smartphone-h2eaOleh.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Configuration-tKO62oR_.js b/frontend/dist/assets/Configuration-DaPSiY3g.js similarity index 98% rename from frontend/dist/assets/Configuration-tKO62oR_.js rename to frontend/dist/assets/Configuration-DaPSiY3g.js index 4a8380ac..32cf8fae 100644 --- a/frontend/dist/assets/Configuration-tKO62oR_.js +++ b/frontend/dist/assets/Configuration-DaPSiY3g.js @@ -1,5 +1,5 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/latin-400-BcR6IdUc.css","assets/latin-500-DCnAHIrw.css","assets/latin-600-CnkPk-vb.css","assets/latin-700-UC1i-VSI.css"])))=>i.map(i=>d[i]); -import{d as ue,r as t,j as e,c as l,L as H,D as B,bo as J,ao as Ts,dT as Re,dU as ss,dV as Ze,_ as Te,T as ie,M as et,S as st,dW as tt,N as X,cr as Qe,c2 as at,dX as nt,z as lt,dY as _s,dZ as rt,d_ as it,d$ as ot,R as ct,B as F,e0 as qe,I as dt,E as ut,F as mt}from"./index-CvSa8h-C.js";import{g as xt,a as ft,c as ht,r as pt,s as yt,b as gt,u as bt,d as jt}from"./system-CteuZERM.js";import{C as vt}from"./ConfirmModal-D2DSFKRK.js";import{N as Nt}from"./NodeInformationCard-CtqEav-P.js";import{i as kt,g as wt,s as Ct,a as St,k as Tt}from"./keycap-sfx-ByZp-njj.js";import{C as Y,P as _t,a as Ft,B as Et}from"./PageLayout-B8orsDlo.js";import{T as Is}from"./trash-2-DUG72tk9.js";import{R as te,C as _e}from"./Grid-suKoG48i.js";import{A as Rt}from"./antenna-DiJxjpBL.js";import{P as Fs}from"./plus-CNNHSjgp.js";import{K as Ge}from"./key-round-CYJwakCI.js";import{C as Pt}from"./circle-check-DW83e7Fg.js";import{T as Be}from"./triangle-alert-C7tm61-l.js";import{R as Dt}from"./refresh-cw-DQJSjSjI.js";import{C as It}from"./chevron-right-1kmv-Vqa.js";import"./DataBox-CwAsAwyY.js";/** +import{d as ue,r as t,j as e,c as l,L as H,D as B,bo as J,ao as Ts,dT as Re,dU as ss,dV as Ze,_ as Te,T as ie,M as et,S as st,dW as tt,N as X,cr as Qe,c2 as at,dX as nt,z as lt,dY as _s,dZ as rt,d_ as it,d$ as ot,R as ct,B as F,e0 as qe,I as dt,E as ut,F as mt}from"./index-WhzslczH.js";import{g as xt,a as ft,c as ht,r as pt,s as yt,b as gt,u as bt,d as jt}from"./system-Dr_EmFwL.js";import{C as vt}from"./ConfirmModal-4-j2cctt.js";import{N as Nt}from"./NodeInformationCard-DJ0EACZ1.js";import{i as kt,g as wt,s as Ct,a as St,k as Tt}from"./keycap-sfx-ByZp-njj.js";import{C as Y,P as _t,a as Ft,B as Et}from"./PageLayout-CjepFyhn.js";import{T as Is}from"./trash-2-dqn51YO_.js";import{R as te,C as _e}from"./Grid-xhoz0JJL.js";import{A as Rt}from"./antenna-CzKXc7OF.js";import{P as Fs}from"./plus-Q9JrSYS-.js";import{K as Ge}from"./key-round-m5pQJFxH.js";import{C as Pt}from"./circle-check-6eqe109E.js";import{T as Be}from"./triangle-alert-BsvKjxO1.js";import{R as Dt}from"./refresh-cw-BLqMXKuf.js";import{C as It}from"./chevron-right-Ewog5LA3.js";import"./DataBox-ABvJ7hn1.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ConfirmModal-D2DSFKRK.js b/frontend/dist/assets/ConfirmModal-4-j2cctt.js similarity index 84% rename from frontend/dist/assets/ConfirmModal-D2DSFKRK.js rename to frontend/dist/assets/ConfirmModal-4-j2cctt.js index 60cfdb47..053ff984 100644 --- a/frontend/dist/assets/ConfirmModal-D2DSFKRK.js +++ b/frontend/dist/assets/ConfirmModal-4-j2cctt.js @@ -1 +1 @@ -import{r as d,j as s,am as m,dK as x,c as f,an as g,e2 as C,B as a}from"./index-CvSa8h-C.js";import{T as j}from"./triangle-alert-C7tm61-l.js";const p={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},u={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:o="default",onConfirm:c,onCancel:e}){return s.jsxs(m,{open:n,onClose:e,size:"sm",children:[s.jsx(x,{icon:s.jsx(j,{className:f("w-5 h-5",p[o])}),title:r,onClose:e}),s.jsx(g,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(C,{children:[s.jsx(a,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(a,{color:u[o],onClick:c,className:"flex-1",children:t})]})]})}const A=d.memo(N);export{A as C}; +import{r as d,j as s,am as m,dK as x,c as f,an as g,e2 as C,B as a}from"./index-WhzslczH.js";import{T as j}from"./triangle-alert-BsvKjxO1.js";const p={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},u={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:o="default",onConfirm:c,onCancel:e}){return s.jsxs(m,{open:n,onClose:e,size:"sm",children:[s.jsx(x,{icon:s.jsx(j,{className:f("w-5 h-5",p[o])}),title:r,onClose:e}),s.jsx(g,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(C,{children:[s.jsx(a,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(a,{color:u[o],onClick:c,className:"flex-1",children:t})]})]})}const A=d.memo(N);export{A as C}; diff --git a/frontend/dist/assets/Contacts-DyjGy2DF.js b/frontend/dist/assets/Contacts-2Yx_cmAj.js similarity index 92% rename from frontend/dist/assets/Contacts-DyjGy2DF.js rename to frontend/dist/assets/Contacts-2Yx_cmAj.js index 46a309ba..06265037 100644 --- a/frontend/dist/assets/Contacts-DyjGy2DF.js +++ b/frontend/dist/assets/Contacts-2Yx_cmAj.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-B-sbLVsX.js","assets/index-CvSa8h-C.js","assets/BasemapLayer-NuqTvOvz.js","assets/consumer-registry-BsBD_8RF.js","assets/link-scoring-DaKaf0kz.js","assets/ConfirmModal-D2DSFKRK.js","assets/triangle-alert-C7tm61-l.js","assets/max-B4xU84un.js","assets/download-CNAyp-3r.js","assets/database-bNR-4XQS.js","assets/useMapViewStore-1D-N8rLK.js","assets/index-CPifxb0-.js","assets/refresh-cw-DQJSjSjI.js","assets/target-M8AQjykJ.js","assets/funnel-DLa9oQpD.js","assets/plus-CNNHSjgp.js","assets/easing-CvrBfrm0.js","assets/zap-mngIm3qT.js","assets/trash-2-DUG72tk9.js","assets/wifi-off-B6--LVD1.js","assets/wifi-DV8DJqF0.js","assets/badge-colors-MuK22b26.js","assets/chevron-right-1kmv-Vqa.js","assets/node-types-BJsOTMm_.js","assets/LightSparkline-BjpzakdT.js","assets/map-pin-BCwmmHGs.js","assets/usePipelineStore-pGK8Y5O7.js","assets/ping-D0xwlHyD.js","assets/PageLayout-B8orsDlo.js","assets/listbox-Xbs80tag.js","assets/element-movement-CM_Y2Bj0.js","assets/MqttModeBadge-CGW6hCWV.js","assets/chat-utils-BUBqf9vH.js","assets/SignalIndicator-B0ppyCo-.js","assets/CollisionExplorerModal-BC_ZJRMz.js","assets/monitor-smartphone-D-7zPu_H.js","assets/DataBox-CwAsAwyY.js","assets/circle-question-mark-DDUlGgWh.js","assets/network-VirimdjG.js","assets/activity-CctJQ0y-.js","assets/search-BZtD4Hr8.js","assets/index-1OCG5H5s.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); -import{d as P,ab as ss,j as e,r as a,_ as ts,bZ as Ee,b_ as Fe,a8 as oe,D as ke,aj as Pe,b$ as ns,c0 as he,R as pe,x as k,c1 as as,L as Oe,c2 as rs,Q as os,c3 as cs,c4 as is,c5 as ls,P as ds,c6 as ms,c7 as xs,V as us,ak as ps,W as Ne,c8 as hs,c9 as fs,bj as re,v as gs,I as js,bo as ys,c as we}from"./index-CvSa8h-C.js";import{useDiscoveredNodes as bs}from"./usePipelineStore-pGK8Y5O7.js";import{p as Ns}from"./ping-D0xwlHyD.js";import{c as Ce}from"./node-types-BJsOTMm_.js";import{P as vs,a as ws,B as ks}from"./PageLayout-B8orsDlo.js";import{L as Cs,a as ue}from"./listbox-Xbs80tag.js";import{T as Te,M as Ms}from"./MqttModeBadge-CGW6hCWV.js";import{u as Ss,e as _s,f as Rs,r as Ps}from"./consumer-registry-BsBD_8RF.js";import{e as Ts,g as Ls,a as $s}from"./chat-utils-BUBqf9vH.js";import{A as Es,b as Fs}from"./SignalIndicator-B0ppyCo-.js";import{C as Os,S as zs}from"./CollisionExplorerModal-BC_ZJRMz.js";import{E as Ds,T as Hs}from"./target-M8AQjykJ.js";import{D as As}from"./DataBox-CwAsAwyY.js";import{a as Z,C as Is}from"./badge-colors-MuK22b26.js";import{C as ze}from"./circle-question-mark-DDUlGgWh.js";import{N as Bs}from"./network-VirimdjG.js";import{A as De}from"./activity-CctJQ0y-.js";import{T as Vs}from"./trash-2-DUG72tk9.js";import{C as qs}from"./ConfirmModal-D2DSFKRK.js";import{M as Le}from"./monitor-smartphone-D-7zPu_H.js";import{M as Us}from"./map-pin-BCwmmHGs.js";import{S as Ws}from"./search-BZtD4Hr8.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-46MKHZ47.js","assets/index-WhzslczH.js","assets/BasemapLayer-CeyADeA1.js","assets/consumer-registry-DcpFyHd4.js","assets/link-scoring-DGx3Bvuc.js","assets/ConfirmModal-4-j2cctt.js","assets/triangle-alert-BsvKjxO1.js","assets/max-Ch6kRxV_.js","assets/download-7lpHRyVo.js","assets/database-Hkah1WM3.js","assets/useMapViewStore-7rwVBEII.js","assets/index-WiXmWhPS.js","assets/refresh-cw-BLqMXKuf.js","assets/target-PpDPv2u2.js","assets/funnel-B4y6lzBW.js","assets/plus-Q9JrSYS-.js","assets/easing-CgZkd7Dy.js","assets/zap-Ec1PEQMI.js","assets/trash-2-dqn51YO_.js","assets/wifi-off-DjfOg4sJ.js","assets/wifi-B-dNXYIH.js","assets/badge-colors-BgV-I1O5.js","assets/chevron-right-Ewog5LA3.js","assets/node-types-BuI9FfZZ.js","assets/LightSparkline-CIu8T-_d.js","assets/map-pin-BXCqDxIA.js","assets/usePipelineStore-DZf0BPc-.js","assets/ping-BA7i2ph0.js","assets/PageLayout-CjepFyhn.js","assets/listbox-B9_kY-R5.js","assets/element-movement-CSsBUmDY.js","assets/MqttModeBadge-xEEk549C.js","assets/chat-utils-CPRl3lbc.js","assets/SignalIndicator-B1hS3JQG.js","assets/CollisionExplorerModal-D9V91Yz1.js","assets/monitor-smartphone-h2eaOleh.js","assets/DataBox-ABvJ7hn1.js","assets/circle-question-mark-CJt3zunX.js","assets/network-BXTFbhix.js","assets/activity-CzPYx3Pb.js","assets/search-DttoJEPu.js","assets/index-1OCG5H5s.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); +import{d as P,ab as ss,j as e,r as a,_ as ts,bZ as Ee,b_ as Fe,a8 as oe,D as ke,aj as Pe,b$ as ns,c0 as he,R as pe,x as k,c1 as as,L as Oe,c2 as rs,Q as os,c3 as cs,c4 as is,c5 as ls,P as ds,c6 as ms,c7 as xs,V as us,ak as ps,W as Ne,c8 as hs,c9 as fs,bj as re,v as gs,I as js,bo as ys,c as we}from"./index-WhzslczH.js";import{useDiscoveredNodes as bs}from"./usePipelineStore-DZf0BPc-.js";import{p as Ns}from"./ping-BA7i2ph0.js";import{c as Ce}from"./node-types-BuI9FfZZ.js";import{P as vs,a as ws,B as ks}from"./PageLayout-CjepFyhn.js";import{L as Cs,a as ue}from"./listbox-B9_kY-R5.js";import{T as Te,M as Ms}from"./MqttModeBadge-xEEk549C.js";import{u as Ss,e as _s,f as Rs,r as Ps}from"./consumer-registry-DcpFyHd4.js";import{e as Ts,g as Ls,a as $s}from"./chat-utils-CPRl3lbc.js";import{A as Es,b as Fs}from"./SignalIndicator-B1hS3JQG.js";import{C as Os,S as zs}from"./CollisionExplorerModal-D9V91Yz1.js";import{E as Ds,T as Hs}from"./target-PpDPv2u2.js";import{D as As}from"./DataBox-ABvJ7hn1.js";import{a as Z,C as Is}from"./badge-colors-BgV-I1O5.js";import{C as ze}from"./circle-question-mark-CJt3zunX.js";import{N as Bs}from"./network-BXTFbhix.js";import{A as De}from"./activity-CzPYx3Pb.js";import{T as Vs}from"./trash-2-dqn51YO_.js";import{C as qs}from"./ConfirmModal-4-j2cctt.js";import{M as Le}from"./monitor-smartphone-h2eaOleh.js";import{M as Us}from"./map-pin-BXCqDxIA.js";import{S as Ws}from"./search-DttoJEPu.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -49,4 +49,4 @@ import{d as P,ab as ss,j as e,r as a,_ as ts,bZ as Ee,b_ as Fe,a8 as oe,D as ke, * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dt=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],mt=P("trending-down",dt);class xt extends a.Component{constructor(c){super(c),this.state={hasError:!1}}static getDerivedStateFromError(c){return{hasError:!0,error:c}}render(){var c;return this.state.hasError?e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"alert","aria-live":"assertive",children:e.jsxs("div",{className:"text-center text-fg-muted p-4",children:[e.jsx("p",{className:"text-lg mb-2",children:"Map failed to load"}),e.jsx("p",{className:"text-sm text-fg-muted",children:((c=this.state.error)==null?void 0:c.message)||"Unknown error"}),e.jsx("p",{className:"text-xs text-fg-muted mt-2",children:"Try refreshing the page or check your browser's WebGL support."})]})}):this.props.children}}const ut=a.lazy(()=>ts(()=>import("./ContactsMapMapLibre-B-sbLVsX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))),$e=()=>e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"status","aria-live":"polite","aria-label":"Loading map",children:e.jsxs("div",{className:"text-fg-muted flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-sys-blue border-t-transparent rounded-full animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading map..."})]})});function pt({neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:p,highlightedGhost:d}){return ss()===!1?e.jsx($e,{}):e.jsx(xt,{children:e.jsx(a.Suspense,{fallback:e.jsx($e,{}),children:e.jsx(ut,{neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:p,highlightedGhost:d})})})}function ht({hash:o,className:c="",size:f="sm",collisionInfo:x,isViterbiResolved:g}){const v=Ee(),p=Fe(),[d,T]=a.useState(!1),S=a.useMemo(()=>oe(o),[o]),L=a.useMemo(()=>x!==void 0?x:S?v.find(j=>j.prefix===S)??null:null,[S,v,x]),$=g??(p.totalPaths>0&&p.avgPathConfidence>=.7),O=a.useCallback(j=>{j.preventDefault(),j.stopPropagation(),T(!0)},[]),B=a.useCallback(()=>{T(!1)},[]);if(!L)return null;const w=f==="sm"?"w-3.5 h-3.5":"w-4 h-4",H=$?"text-sys-cyan hover:text-sys-cyan hover:bg-sys-cyan/10 focus:ring-sys-cyan/50":"text-signal-fair hover:text-sys-indigo hover:bg-signal-fair/10 focus:ring-signal-fair/50",_=$?`Prefix conflict resolved by Viterbi HMM (${(p.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${L.candidateCount} nodes share prefix "${S}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:O,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${H} ${c}`,title:_,"aria-label":`View prefix conflict for ${S}${$?" (Viterbi resolved)":""}`,children:$?e.jsxs("span",{className:"relative",children:[e.jsx(Ds,{className:w}),e.jsx(ke,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(et,{className:w})}),e.jsx(Os,{isOpen:d,prefix:L.prefix,candidateHashes:L.candidateHashes,onClose:B})]})}const ft=a.memo(ht),Ae=[{target:"Contacts",fn:"name",minStage:1,when:_s},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Rs}];Ps(Ae);function gt(o){return o<1e3?`${Math.round(o)}m`:`${(o/1e3).toFixed(1)}km`}function jt({hash:o,contact:c,isHub:f,isNeighbor:x,distance:g,centrality:v,sparklineData:p,neighborSignal:d,collisionInfo:T,isViterbiResolved:S,isPinging:L,isPingingThis:$,pingResult:O,pingError:B,gatewayInfo:w,lastForwarderPrefix:H,isMobile:_,pathStability:j,onRowClick:E,onPing:fe,onRemove:V}){Ss(Ae);const X=c.latitude&&c.longitude&&c.latitude!==0&&c.longitude!==0,h=c.node_name||c.name||"Unknown",q=x&&d,z=Ce(c),{isRepeater:U,isCompanion:b,isRoomServer:W,isClient:J,label:ee}=z,ge=x?`${ee} — Direct RF contact (zero-hop neighbor)`:`${ee} — Flood routing (multi-hop via mesh)`,G=c.first_seen?Pe(c.first_seen).replace(/ ago$/i," old"):null;return e.jsxs("div",{className:`contacts-grid-row ${f?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${X?"cursor-pointer hover:bg-subtle-fill":""}`,onClick:()=>E(o),children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[q&&(d==null?void 0:d.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${ns(d.avgSnr)}`}):e.jsx("div",{className:"w-2 flex-shrink-0"}),e.jsx("div",{className:"w-6 h-6 flex items-center justify-center flex-shrink-0",title:ge,children:(()=>{if(W&&U)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(he,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(zs,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(W)return e.jsx(he,{className:"w-5 h-5 text-sys-pink"});if(U)return e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(pe,{className:"w-3.5 h-3.5 text-sys-blue"})});if((b||J)&&h!=="Unknown"){const{emoji:y,cleanName:D}=Ts(h);return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",style:{backgroundColor:Ls(D)},children:y?e.jsx("span",{className:"text-sm leading-none",children:y}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:$s(h)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-amber"})})})()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.jsx("span",{className:"roster-title truncate",title:h,children:h}),x&&e.jsx(k,{color:Z.neighbor,compact:!0,className:"flex-shrink-0",children:"NBR"}),f&&e.jsxs(k,{color:Z.hub,compact:!0,className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(Bs,{className:"w-3 h-3"}),"HUB"]}),U&&e.jsx(k,{color:Z.repeater,compact:!0,className:"flex-shrink-0",children:"RPT"}),W&&e.jsx(k,{color:Z.room,compact:!0,className:"flex-shrink-0",children:"ROOM"}),b&&e.jsx(k,{color:Z.companion,compact:!0,className:"flex-shrink-0",children:"COMP"}),J&&e.jsx(k,{color:Z.client,compact:!0,className:"flex-shrink-0",children:"CLIENT"}),_&&e.jsxs(k,{color:"cyan",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",children:[e.jsx(ot,{className:"w-2.5 h-2.5"}),"MOBILE"]}),!X&&e.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0 text-fg-muted/50",title:"No GPS location provided",children:e.jsx(at,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(As,{copy:!0,size:"compact",truncate:[8,6],children:o}),e.jsx(ft,{hash:o,collisionInfo:T,isViterbiResolved:S}),!x&&w&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Via ${w.name||w.prefix} (${w.hopCount} hop${w.hopCount!==1?"s":""})`,children:[e.jsx(Es,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:w.prefix}),w.hopCount>1&&e.jsxs("span",{className:"opacity-60",children:["+",w.hopCount-1]})]}),H&&!x&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Last forwarded by ${H}`,children:[e.jsx(Qs,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:H})]}),j!=null&&j!==0&&e.jsx(k,{color:j>0?"green":"amber",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:j>0?"Path stability improving":"Path stability declining",children:j>0?e.jsx(as,{className:"w-2.5 h-2.5"}):e.jsx(mt,{className:"w-2.5 h-2.5"})}),p.length>0&&(()=>{const y=p.reduce((je,se)=>je+se.count,0);if(y===0)return null;const D=y/24;return e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`${y} packets in last 24h (~${D.toFixed(1)}/hr)`,children:[e.jsx(it,{className:"w-2.5 h-2.5"}),e.jsxs("span",{children:[D<1?"<1":D.toFixed(0),"/hr"]})]})})(),G&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0 opacity-70",title:`First discovered ${G}`,children:[e.jsx(Xs,{className:"w-2.5 h-2.5"}),e.jsx("span",{children:G})]})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[q&&(d==null?void 0:d.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Fs,{rssi:d.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(d.avgRssi)})]}),q&&(d==null?void 0:d.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[d.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:g!=null&&e.jsxs(e.Fragment,{children:[e.jsx(He,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:gt(g)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:v>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-3 h-3 text-sys-indigo"}),e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[(v*100).toFixed(0),"%"]})]})}),e.jsx("div",{className:"contacts-col-seen flex items-center justify-end",children:e.jsx("span",{className:"type-data-xs text-fg-primary whitespace-nowrap",children:c.last_seen?Pe(c.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[x&&e.jsx(e.Fragment,{children:O?e.jsxs("div",{className:"flex items-center gap-1 text-sys-green",title:`RTT: ${O.rtt_ms.toFixed(0)}ms`,children:[e.jsx(ke,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"type-data-xs hidden sm:inline",children:[O.snr_db.toFixed(1),"dB"]})]}):B?e.jsx("span",{className:"text-sys-red text-xs",title:B,children:"✗"}):e.jsx("button",{onClick:y=>fe(o,y),disabled:L,className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-blue hover:bg-sys-blue/10 transition-base disabled:opacity-50 disabled:cursor-not-allowed",title:"Ping neighbor for updated signal info",children:$?e.jsx(Oe,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Hs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:y=>{y.stopPropagation(),V(o,h)},className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-red hover:bg-sys-red/10 transition-base",title:"Remove contact",children:e.jsx(Vs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const yt=a.memo(jt),bt=6371e3,Nt=[],vt=[{field:"lastHeard",icon:Is,label:"Recent"},{field:"distance",icon:He,label:"Distance"},{field:"centrality",icon:De,label:"Centrality"}];function wt(o){switch(o){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function kt(o){const c=Ce(o);return wt(c.type)}function ve(o,c){const{color:f="primary",border:x=!1}=c??{};return we("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",o?f==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",x&&(o?f==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function Ct(o,c,f,x){const g=(f-o)*Math.PI/180,v=(x-c)*Math.PI/180,p=Math.sin(g/2)*Math.sin(g/2)+Math.cos(o*Math.PI/180)*Math.cos(f*Math.PI/180)*Math.sin(v/2)*Math.sin(v/2),d=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return bt*d}function Mt(){const{stats:o}=rs(),c=os(),f=cs(),x=is(),g=ls(),v=ds(),p=ms(),d=xs(),T=us(),S=ps(),L=Ne[T],$=Ee(),O=Fe(),B=hs(),w=O.totalPaths>0&&O.avgPathConfidence>=.7,H=a.useMemo(()=>{const s=new Map;for(const t of $)s.set(t.prefix,t);return s},[$]),[_,j]=a.useState(null),[E,fe]=a.useState("lastHeard"),[V,X]=a.useState("desc"),[h,q]=a.useState(""),[z,U]=a.useState(!1),[b,W]=a.useState(new Set),[J,ee]=a.useState(!1),[ge,G]=a.useState(null),[y,D]=a.useState(null),[je,se]=a.useState(new Map),[Ie,te]=a.useState(new Map),[C,Be]=a.useState(25),[Q,ce]=a.useState(25),ye=a.useRef(null),ne=a.useMemo(()=>(o==null?void 0:o.neighbors)??{},[o==null?void 0:o.neighbors]),be=bs(),ie=a.useMemo(()=>{if(be.size===0)return ne;const s=new Set;for(const n of Object.keys(ne))s.add((n.startsWith("0x")?n.slice(2):n).toLowerCase());let t=null;for(const[n,r]of be){const i=(n.startsWith("0x")?n.slice(2):n).toLowerCase();s.has(i)||(t||(t={...ne}),t[n]={last_seen:r.lastSeen,name:r.name??void 0,node_name:r.name??void 0,latitude:r.latitude,longitude:r.longitude,is_repeater:r.nodeType==="repeater",contact_type:r.nodeType==="repeater"?"Repeater":r.nodeType==="companion"?"Companion":r.nodeType==="room_server"?"Room Server":void 0})}return t??ne},[ne,be]),A=a.useMemo(()=>{const t=Date.now()/1e3-L.minutes*60;return Object.fromEntries(Object.entries(ie).filter(([n,r])=>c.has(n)?!1:(r.last_seen??0)>=t))},[ie,c,L.minutes]),R=fs(),K=o==null?void 0:o.local_hash,Ve=a.useMemo(()=>{const s=new Map;if(!K||p.size===0)return s;for(const[t,n]of p)if(t.endsWith(`→${K}`)&&n.hops.length>1){const r=t.split("→")[0],i=n.hops[n.hops.length-1];s.set(r,i)}return s},[p,K]),le=a.useMemo(()=>{const s=new Map;if(!(R!=null&&R.latitude)||!(R!=null&&R.longitude))return s;for(const[t,n]of Object.entries(A))n.latitude&&n.longitude&&n.latitude!==0&&n.longitude!==0?s.set(t,Ct(R.latitude,R.longitude,n.latitude,n.longitude)):s.set(t,null);return s},[A,R]),{neighborHashSet:de,neighborSignalMap:qe}=a.useMemo(()=>{const s=new Set,t=new Map;for(const n of v)s.add(n.hash),t.set(n.hash,{avgRssi:n.avgRssi,avgSnr:n.avgSnr});return{neighborHashSet:s,neighborSignalMap:t}},[v]),Me=a.useMemo(()=>{const s=h.toLowerCase().trim(),t=s==="neighbor"||s==="neighbors",n=z||t,r=b.size>0;return Object.fromEntries(Object.entries(A).filter(([i,l])=>{if(r){const M=kt(l);if(!b.has(M))return!1}if(n&&!de.has(i))return!1;if(t||!s)return!0;const I=(l.node_name||l.name||"").toLowerCase(),N=oe(i).toLowerCase();return I.includes(s)||N.includes(s)||i.toLowerCase().includes(s)}))},[A,h,z,de,b]),u=a.useMemo(()=>{const s=Object.entries(Me),t=h.toLowerCase().trim(),n=t.length===2&&/^[0-9a-f]{2}$/i.test(t);return s.sort(([r,i],[l,I])=>{if(n){const M=oe(r).toLowerCase(),F=oe(l).toLowerCase(),ae=M===t,me=F===t;if(ae&&!me)return-1;if(me&&!ae)return 1}let N=0;switch(E){case"lastHeard":N=(i.last_seen||0)-(I.last_seen||0);break;case"distance":{const M=le.get(r)??null,F=le.get(l)??null;M===null&&F===null?N=0:M===null?N=1:F===null?N=-1:N=M-F;break}case"centrality":{const M=g.get(r)||0,F=g.get(l)||0;N=M-F;break}}return V==="desc"?-N:N})},[Me,E,V,le,g,h]),m=a.useMemo(()=>{let s=0,t=0,n=0,r=0,i=0;for(const[,l]of u){const I=Ce(l),N=l.latitude&&l.longitude&&l.latitude!==0&&l.longitude!==0;switch(I.type){case"room_server":n++;break;case"repeater":t++;break;case"companion":s++;break;case"unknown":i++;break}N&&r++}return{companions:s,repeaters:t,roomServers:n,total:u.length,withLocation:r,unknown:i}},[u]),Ue=a.useMemo(()=>new Set(x),[x]),Se=a.useMemo(()=>C===0?u:u.slice(0,Q),[u,Q,C]);a.useEffect(()=>{ce(C||u.length)},[E,V,h,z,b,C,u.length]),a.useEffect(()=>{const s=t=>{t.target.closest("[data-dropdown]")||ee(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),a.useEffect(()=>{if(C===0)return;const s=new IntersectionObserver(t=>{t[0].isIntersecting&&QMath.min(n+C,u.length))},{threshold:.1,rootMargin:"100px"});return ye.current&&s.observe(ye.current),()=>s.disconnect()},[C,Q,u.length]);const We=a.useCallback(s=>{Be(s),ce(s||u.length)},[u.length]),Ge=a.useCallback(s=>{E===s?X(t=>t==="desc"?"asc":"desc"):(fe(s),X("desc"))},[E]),Qe=a.useCallback(s=>{const t=A[s];t!=null&&t.latitude&&(t!=null&&t.longitude)&&t.latitude!==0&&t.longitude!==0&&G(s)},[A]),Ke=a.useCallback(()=>{G(null)},[]),Ye=a.useCallback((s,t)=>{j({hash:s,name:t})},[]),Ze=a.useCallback(async(s,t)=>{if(t.stopPropagation(),!y){D(s),se(n=>{const r=new Map(n);return r.delete(s),r}),te(n=>{const r=new Map(n);return r.delete(s),r});try{const n=s.startsWith("0x")?s.slice(0,4):`0x${s.slice(0,2)}`,r=await Ns(n,30);r.success&&r.data?(se(i=>new Map(i).set(s,r.data)),setTimeout(()=>{se(i=>{const l=new Map(i);return l.delete(s),l})},1e4)):(te(i=>new Map(i).set(s,r.error||"Ping failed")),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3))}catch(n){const r=n instanceof Error?n.message:"Ping failed";te(i=>new Map(i).set(s,r)),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3)}finally{D(null)}}},[y]);return e.jsxs(vs,{children:[e.jsx(ws,{title:"Contacts",icon:e.jsx(re,{}),subtitle:e.jsx(Ms,{}),controls:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-5",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Total:"}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${m.total} discovered node${m.total!==1?"s":""} on the mesh network`,children:[e.jsx(re,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:m.total})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Types:"}),m.repeaters>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Repeaters",children:[e.jsx(pe,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Companions",children:[e.jsx(Le,{className:"w-3.5 h-3.5 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Room Servers",children:[e.jsx(he,{className:"w-3.5 h-3.5 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),m.withLocation>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"With GPS location",children:[e.jsx(Us,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{children:m.withLocation})]}),m.unknown>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Unknown type",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{children:m.unknown})]})]})]}),e.jsxs("div",{className:"flex sm:hidden items-center gap-1.5",children:[e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(re,{className:"w-3 h-3 text-fg-secondary"}),e.jsx("span",{children:m.total})]}),m.repeaters>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(pe,{className:"w-3 h-3 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(Le,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(he,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S})})]})}),e.jsxs(ks,{children:[e.jsx(pt,{neighbors:A,localNode:R??void 0,localHash:K,onRemoveNode:f,selectedNodeHash:ge,onNodeSelected:Ke}),e.jsxs(gs,{noPadding:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-2.5 border-b border-edge-subtle",children:[e.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title flex-shrink-0",children:e.jsx(re,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(js,{type:"search",size:"sm",value:h,onChange:s=>q(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Ws,{className:"w-3.5 h-3.5"}),trailingIcon:h?e.jsx("button",{onClick:()=>{q(""),(h.toLowerCase().trim()==="neighbor"||h.toLowerCase().trim()==="neighbors")&&U(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(ys,{className:"w-3 h-3"})}):void 0,className:"w-24 sm:w-32 xl:w-44","aria-label":"Search contacts"}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsxs("div",{className:"relative","data-dropdown":!0,children:[e.jsxs("button",{onClick:()=>ee(!J),className:ve(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(tt,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Filter"}),b.size>0&&e.jsx("span",{className:"tabular-nums text-xs bg-sys-blue/30 px-1 rounded",children:b.size})]}),J&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 surface-elevated radius-inner py-1 min-w-[140px]",children:[[{key:"repeater",label:"Repeaters"},{key:"companion",label:"Companions"},{key:"room",label:"Rooms"}].map(({key:s,label:t})=>e.jsxs("button",{onClick:()=>{W(n=>{const r=new Set(n);return r.has(s)?r.delete(s):r.add(s),r})},className:"w-full px-3 py-1.5 text-sm text-left hover-bg transition-base flex items-center gap-2",children:[e.jsx("span",{className:we("w-4 h-4 flex items-center justify-center radius-badge border",b.has(s)?"bg-sys-blue border-sys-blue text-white":"border-edge-subtle"),children:b.has(s)&&e.jsx(ke,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:t})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>W(new Set),className:"w-full px-3 py-1.5 text-sm text-left text-fg-muted hover:text-fg-secondary hover-bg transition-base",children:"Clear filters"})]})]})]}),de.size>0&&e.jsxs("button",{onClick:()=>U(!z),className:ve(z,{color:"success",border:!0}),title:z?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(pe,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Neighbors"})]})]}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[vt.map(({field:s,icon:t,label:n})=>e.jsxs("button",{onClick:()=>Ge(s),className:ve(E===s),title:`Sort by ${n.toLowerCase()}`,children:[e.jsx(t,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:n}),E===s&&e.jsx(Ys,{className:we("w-3 h-3",V==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Cs,{value:C,onChange:We,className:"w-auto min-w-[50px] [&_button]:py-1 [&_button]:px-2 [&_button]:text-xs [&_button]:min-h-0","aria-label":"Items per page",children:[e.jsx(ue,{value:25,children:"25"}),e.jsx(ue,{value:50,children:"50"}),e.jsx(ue,{value:100,children:"100"}),e.jsx(ue,{value:0,children:"All"})]})]})]}),u.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden sm:grid contacts-grid-header border-b border-edge-subtle/50 px-3 py-2 type-micro text-fg-muted",children:[e.jsx("div",{className:"contacts-col-node",children:"Node"}),e.jsx("div",{className:"contacts-col-signal text-right",children:"Signal"}),e.jsx("div",{className:"contacts-col-distance text-right",children:"Distance"}),e.jsx("div",{className:"contacts-col-centrality text-right",children:"Centrality"}),e.jsx("div",{className:"contacts-col-seen text-right",children:"Last Seen"}),e.jsx("div",{className:"contacts-col-actions"})]}),e.jsx("div",{className:"divide-y divide-edge-subtle/30",children:Se.map(([s,t])=>{const n=oe(s),r=Ue.has(s),i=de.has(s),l=le.get(s)??null,I=g.get(s)||0,N=i?qe.get(s):void 0,M=n?H.get(n)??null:null,F=B.get(s)??Nt;let ae=null;if(!i&&K&&p.size>0){const Je=`${s}→${K}`,xe=p.get(Je);if(xe&&xe.hops.length>0){const _e=xe.hops[0],Re=Object.keys(ie).find(es=>es.toUpperCase().startsWith(_e.toUpperCase())),Y=Re?ie[Re]:null;ae={prefix:_e,name:(Y==null?void 0:Y.node_name)??(Y==null?void 0:Y.name)??null,hopCount:xe.hopCount}}}const me=d.has(s),Xe=Ve.get(s)??null;return e.jsx(yt,{hash:s,contact:t,isHub:r,isNeighbor:i,distance:l,centrality:I,sparklineData:F,neighborSignal:N,collisionInfo:M,isViterbiResolved:w,isPinging:y!==null,isPingingThis:y===s,pingResult:je.get(s),pingError:Ie.get(s),gatewayInfo:ae,lastForwarderPrefix:Xe,isMobile:me,onRowClick:Qe,onPing:Ze,onRemove:Ye},s)})}),C>0&&Q0&&Qce(s=>Math.min(s+C,u.length)),className:"text-sys-blue hover:text-sys-blue/80 transition-base",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(re,{className:"roster-empty-icon"}),e.jsx("div",{className:"type-label text-fg-secondary",children:"No Contacts Discovered"}),e.jsx("div",{className:"type-data-xs text-fg-muted mt-1",children:"Contacts will appear here as they advertise on the mesh network."})]})]})]}),e.jsx(qs,{isOpen:!!_,title:"Remove Contact",message:`Are you sure you would like to remove ${(_==null?void 0:_.name)||"this contact"}?`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{_&&f(_.hash),j(null)},onCancel:()=>j(null)})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:Mt},Symbol.toStringTag,{value:"Module"}));export{Kt as C,ft as P,He as R,mt as T}; + */const dt=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],mt=P("trending-down",dt);class xt extends a.Component{constructor(c){super(c),this.state={hasError:!1}}static getDerivedStateFromError(c){return{hasError:!0,error:c}}render(){var c;return this.state.hasError?e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"alert","aria-live":"assertive",children:e.jsxs("div",{className:"text-center text-fg-muted p-4",children:[e.jsx("p",{className:"text-lg mb-2",children:"Map failed to load"}),e.jsx("p",{className:"text-sm text-fg-muted",children:((c=this.state.error)==null?void 0:c.message)||"Unknown error"}),e.jsx("p",{className:"text-xs text-fg-muted mt-2",children:"Try refreshing the page or check your browser's WebGL support."})]})}):this.props.children}}const ut=a.lazy(()=>ts(()=>import("./ContactsMapMapLibre-46MKHZ47.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))),$e=()=>e.jsx("div",{className:"map-container-16-9 flex items-center justify-center rounded-2xl surface-base",role:"status","aria-live":"polite","aria-label":"Loading map",children:e.jsxs("div",{className:"text-fg-muted flex items-center gap-3",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-sys-blue border-t-transparent rounded-full animate-spin","aria-hidden":"true"}),e.jsx("span",{children:"Loading map..."})]})});function pt({neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:p,highlightedGhost:d}){return ss()===!1?e.jsx($e,{}):e.jsx(xt,{children:e.jsx(a.Suspense,{fallback:e.jsx($e,{}),children:e.jsx(ut,{neighbors:o,localNode:c,localHash:f,onRemoveNode:x,selectedNodeHash:g,onNodeSelected:v,highlightedEdgeKey:p,highlightedGhost:d})})})}function ht({hash:o,className:c="",size:f="sm",collisionInfo:x,isViterbiResolved:g}){const v=Ee(),p=Fe(),[d,T]=a.useState(!1),S=a.useMemo(()=>oe(o),[o]),L=a.useMemo(()=>x!==void 0?x:S?v.find(j=>j.prefix===S)??null:null,[S,v,x]),$=g??(p.totalPaths>0&&p.avgPathConfidence>=.7),O=a.useCallback(j=>{j.preventDefault(),j.stopPropagation(),T(!0)},[]),B=a.useCallback(()=>{T(!1)},[]);if(!L)return null;const w=f==="sm"?"w-3.5 h-3.5":"w-4 h-4",H=$?"text-sys-cyan hover:text-sys-cyan hover:bg-sys-cyan/10 focus:ring-sys-cyan/50":"text-signal-fair hover:text-sys-indigo hover:bg-signal-fair/10 focus:ring-signal-fair/50",_=$?`Prefix conflict resolved by Viterbi HMM (${(p.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${L.candidateCount} nodes share prefix "${S}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:O,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${H} ${c}`,title:_,"aria-label":`View prefix conflict for ${S}${$?" (Viterbi resolved)":""}`,children:$?e.jsxs("span",{className:"relative",children:[e.jsx(Ds,{className:w}),e.jsx(ke,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(et,{className:w})}),e.jsx(Os,{isOpen:d,prefix:L.prefix,candidateHashes:L.candidateHashes,onClose:B})]})}const ft=a.memo(ht),Ae=[{target:"Contacts",fn:"name",minStage:1,when:_s},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Rs}];Ps(Ae);function gt(o){return o<1e3?`${Math.round(o)}m`:`${(o/1e3).toFixed(1)}km`}function jt({hash:o,contact:c,isHub:f,isNeighbor:x,distance:g,centrality:v,sparklineData:p,neighborSignal:d,collisionInfo:T,isViterbiResolved:S,isPinging:L,isPingingThis:$,pingResult:O,pingError:B,gatewayInfo:w,lastForwarderPrefix:H,isMobile:_,pathStability:j,onRowClick:E,onPing:fe,onRemove:V}){Ss(Ae);const X=c.latitude&&c.longitude&&c.latitude!==0&&c.longitude!==0,h=c.node_name||c.name||"Unknown",q=x&&d,z=Ce(c),{isRepeater:U,isCompanion:b,isRoomServer:W,isClient:J,label:ee}=z,ge=x?`${ee} — Direct RF contact (zero-hop neighbor)`:`${ee} — Flood routing (multi-hop via mesh)`,G=c.first_seen?Pe(c.first_seen).replace(/ ago$/i," old"):null;return e.jsxs("div",{className:`contacts-grid-row ${f?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${X?"cursor-pointer hover:bg-subtle-fill":""}`,onClick:()=>E(o),children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[q&&(d==null?void 0:d.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${ns(d.avgSnr)}`}):e.jsx("div",{className:"w-2 flex-shrink-0"}),e.jsx("div",{className:"w-6 h-6 flex items-center justify-center flex-shrink-0",title:ge,children:(()=>{if(W&&U)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(he,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(zs,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(W)return e.jsx(he,{className:"w-5 h-5 text-sys-pink"});if(U)return e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(pe,{className:"w-3.5 h-3.5 text-sys-blue"})});if((b||J)&&h!=="Unknown"){const{emoji:y,cleanName:D}=Ts(h);return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center",style:{backgroundColor:Ls(D)},children:y?e.jsx("span",{className:"text-sm leading-none",children:y}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:$s(h)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-amber"})})})()}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.jsx("span",{className:"roster-title truncate",title:h,children:h}),x&&e.jsx(k,{color:Z.neighbor,compact:!0,className:"flex-shrink-0",children:"NBR"}),f&&e.jsxs(k,{color:Z.hub,compact:!0,className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx(Bs,{className:"w-3 h-3"}),"HUB"]}),U&&e.jsx(k,{color:Z.repeater,compact:!0,className:"flex-shrink-0",children:"RPT"}),W&&e.jsx(k,{color:Z.room,compact:!0,className:"flex-shrink-0",children:"ROOM"}),b&&e.jsx(k,{color:Z.companion,compact:!0,className:"flex-shrink-0",children:"COMP"}),J&&e.jsx(k,{color:Z.client,compact:!0,className:"flex-shrink-0",children:"CLIENT"}),_&&e.jsxs(k,{color:"cyan",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",children:[e.jsx(ot,{className:"w-2.5 h-2.5"}),"MOBILE"]}),!X&&e.jsx("span",{className:"flex items-center gap-0.5 flex-shrink-0 text-fg-muted/50",title:"No GPS location provided",children:e.jsx(at,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(As,{copy:!0,size:"compact",truncate:[8,6],children:o}),e.jsx(ft,{hash:o,collisionInfo:T,isViterbiResolved:S}),!x&&w&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Via ${w.name||w.prefix} (${w.hopCount} hop${w.hopCount!==1?"s":""})`,children:[e.jsx(Es,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:w.prefix}),w.hopCount>1&&e.jsxs("span",{className:"opacity-60",children:["+",w.hopCount-1]})]}),H&&!x&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`Last forwarded by ${H}`,children:[e.jsx(Qs,{className:"w-2.5 h-2.5"}),e.jsx("span",{className:"font-mono",children:H})]}),j!=null&&j!==0&&e.jsx(k,{color:j>0?"green":"amber",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:j>0?"Path stability improving":"Path stability declining",children:j>0?e.jsx(as,{className:"w-2.5 h-2.5"}):e.jsx(mt,{className:"w-2.5 h-2.5"})}),p.length>0&&(()=>{const y=p.reduce((je,se)=>je+se.count,0);if(y===0)return null;const D=y/24;return e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0",title:`${y} packets in last 24h (~${D.toFixed(1)}/hr)`,children:[e.jsx(it,{className:"w-2.5 h-2.5"}),e.jsxs("span",{children:[D<1?"<1":D.toFixed(0),"/hr"]})]})})(),G&&e.jsxs(k,{color:"zinc",compact:!0,className:"flex items-center gap-0.5 flex-shrink-0 opacity-70",title:`First discovered ${G}`,children:[e.jsx(Xs,{className:"w-2.5 h-2.5"}),e.jsx("span",{children:G})]})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[q&&(d==null?void 0:d.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Fs,{rssi:d.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(d.avgRssi)})]}),q&&(d==null?void 0:d.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[d.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:g!=null&&e.jsxs(e.Fragment,{children:[e.jsx(He,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:gt(g)})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:v>0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{className:"w-3 h-3 text-sys-indigo"}),e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[(v*100).toFixed(0),"%"]})]})}),e.jsx("div",{className:"contacts-col-seen flex items-center justify-end",children:e.jsx("span",{className:"type-data-xs text-fg-primary whitespace-nowrap",children:c.last_seen?Pe(c.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[x&&e.jsx(e.Fragment,{children:O?e.jsxs("div",{className:"flex items-center gap-1 text-sys-green",title:`RTT: ${O.rtt_ms.toFixed(0)}ms`,children:[e.jsx(ke,{className:"w-3.5 h-3.5"}),e.jsxs("span",{className:"type-data-xs hidden sm:inline",children:[O.snr_db.toFixed(1),"dB"]})]}):B?e.jsx("span",{className:"text-sys-red text-xs",title:B,children:"✗"}):e.jsx("button",{onClick:y=>fe(o,y),disabled:L,className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-blue hover:bg-sys-blue/10 transition-base disabled:opacity-50 disabled:cursor-not-allowed",title:"Ping neighbor for updated signal info",children:$?e.jsx(Oe,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Hs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:y=>{y.stopPropagation(),V(o,h)},className:"p-1 sm:p-1.5 radius-inner text-fg-muted/50 hover:text-sys-red hover:bg-sys-red/10 transition-base",title:"Remove contact",children:e.jsx(Vs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const yt=a.memo(jt),bt=6371e3,Nt=[],vt=[{field:"lastHeard",icon:Is,label:"Recent"},{field:"distance",icon:He,label:"Distance"},{field:"centrality",icon:De,label:"Centrality"}];function wt(o){switch(o){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function kt(o){const c=Ce(o);return wt(c.type)}function ve(o,c){const{color:f="primary",border:x=!1}=c??{};return we("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",o?f==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",x&&(o?f==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function Ct(o,c,f,x){const g=(f-o)*Math.PI/180,v=(x-c)*Math.PI/180,p=Math.sin(g/2)*Math.sin(g/2)+Math.cos(o*Math.PI/180)*Math.cos(f*Math.PI/180)*Math.sin(v/2)*Math.sin(v/2),d=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p));return bt*d}function Mt(){const{stats:o}=rs(),c=os(),f=cs(),x=is(),g=ls(),v=ds(),p=ms(),d=xs(),T=us(),S=ps(),L=Ne[T],$=Ee(),O=Fe(),B=hs(),w=O.totalPaths>0&&O.avgPathConfidence>=.7,H=a.useMemo(()=>{const s=new Map;for(const t of $)s.set(t.prefix,t);return s},[$]),[_,j]=a.useState(null),[E,fe]=a.useState("lastHeard"),[V,X]=a.useState("desc"),[h,q]=a.useState(""),[z,U]=a.useState(!1),[b,W]=a.useState(new Set),[J,ee]=a.useState(!1),[ge,G]=a.useState(null),[y,D]=a.useState(null),[je,se]=a.useState(new Map),[Ie,te]=a.useState(new Map),[C,Be]=a.useState(25),[Q,ce]=a.useState(25),ye=a.useRef(null),ne=a.useMemo(()=>(o==null?void 0:o.neighbors)??{},[o==null?void 0:o.neighbors]),be=bs(),ie=a.useMemo(()=>{if(be.size===0)return ne;const s=new Set;for(const n of Object.keys(ne))s.add((n.startsWith("0x")?n.slice(2):n).toLowerCase());let t=null;for(const[n,r]of be){const i=(n.startsWith("0x")?n.slice(2):n).toLowerCase();s.has(i)||(t||(t={...ne}),t[n]={last_seen:r.lastSeen,name:r.name??void 0,node_name:r.name??void 0,latitude:r.latitude,longitude:r.longitude,is_repeater:r.nodeType==="repeater",contact_type:r.nodeType==="repeater"?"Repeater":r.nodeType==="companion"?"Companion":r.nodeType==="room_server"?"Room Server":void 0})}return t??ne},[ne,be]),A=a.useMemo(()=>{const t=Date.now()/1e3-L.minutes*60;return Object.fromEntries(Object.entries(ie).filter(([n,r])=>c.has(n)?!1:(r.last_seen??0)>=t))},[ie,c,L.minutes]),R=fs(),K=o==null?void 0:o.local_hash,Ve=a.useMemo(()=>{const s=new Map;if(!K||p.size===0)return s;for(const[t,n]of p)if(t.endsWith(`→${K}`)&&n.hops.length>1){const r=t.split("→")[0],i=n.hops[n.hops.length-1];s.set(r,i)}return s},[p,K]),le=a.useMemo(()=>{const s=new Map;if(!(R!=null&&R.latitude)||!(R!=null&&R.longitude))return s;for(const[t,n]of Object.entries(A))n.latitude&&n.longitude&&n.latitude!==0&&n.longitude!==0?s.set(t,Ct(R.latitude,R.longitude,n.latitude,n.longitude)):s.set(t,null);return s},[A,R]),{neighborHashSet:de,neighborSignalMap:qe}=a.useMemo(()=>{const s=new Set,t=new Map;for(const n of v)s.add(n.hash),t.set(n.hash,{avgRssi:n.avgRssi,avgSnr:n.avgSnr});return{neighborHashSet:s,neighborSignalMap:t}},[v]),Me=a.useMemo(()=>{const s=h.toLowerCase().trim(),t=s==="neighbor"||s==="neighbors",n=z||t,r=b.size>0;return Object.fromEntries(Object.entries(A).filter(([i,l])=>{if(r){const M=kt(l);if(!b.has(M))return!1}if(n&&!de.has(i))return!1;if(t||!s)return!0;const I=(l.node_name||l.name||"").toLowerCase(),N=oe(i).toLowerCase();return I.includes(s)||N.includes(s)||i.toLowerCase().includes(s)}))},[A,h,z,de,b]),u=a.useMemo(()=>{const s=Object.entries(Me),t=h.toLowerCase().trim(),n=t.length===2&&/^[0-9a-f]{2}$/i.test(t);return s.sort(([r,i],[l,I])=>{if(n){const M=oe(r).toLowerCase(),F=oe(l).toLowerCase(),ae=M===t,me=F===t;if(ae&&!me)return-1;if(me&&!ae)return 1}let N=0;switch(E){case"lastHeard":N=(i.last_seen||0)-(I.last_seen||0);break;case"distance":{const M=le.get(r)??null,F=le.get(l)??null;M===null&&F===null?N=0:M===null?N=1:F===null?N=-1:N=M-F;break}case"centrality":{const M=g.get(r)||0,F=g.get(l)||0;N=M-F;break}}return V==="desc"?-N:N})},[Me,E,V,le,g,h]),m=a.useMemo(()=>{let s=0,t=0,n=0,r=0,i=0;for(const[,l]of u){const I=Ce(l),N=l.latitude&&l.longitude&&l.latitude!==0&&l.longitude!==0;switch(I.type){case"room_server":n++;break;case"repeater":t++;break;case"companion":s++;break;case"unknown":i++;break}N&&r++}return{companions:s,repeaters:t,roomServers:n,total:u.length,withLocation:r,unknown:i}},[u]),Ue=a.useMemo(()=>new Set(x),[x]),Se=a.useMemo(()=>C===0?u:u.slice(0,Q),[u,Q,C]);a.useEffect(()=>{ce(C||u.length)},[E,V,h,z,b,C,u.length]),a.useEffect(()=>{const s=t=>{t.target.closest("[data-dropdown]")||ee(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),a.useEffect(()=>{if(C===0)return;const s=new IntersectionObserver(t=>{t[0].isIntersecting&&QMath.min(n+C,u.length))},{threshold:.1,rootMargin:"100px"});return ye.current&&s.observe(ye.current),()=>s.disconnect()},[C,Q,u.length]);const We=a.useCallback(s=>{Be(s),ce(s||u.length)},[u.length]),Ge=a.useCallback(s=>{E===s?X(t=>t==="desc"?"asc":"desc"):(fe(s),X("desc"))},[E]),Qe=a.useCallback(s=>{const t=A[s];t!=null&&t.latitude&&(t!=null&&t.longitude)&&t.latitude!==0&&t.longitude!==0&&G(s)},[A]),Ke=a.useCallback(()=>{G(null)},[]),Ye=a.useCallback((s,t)=>{j({hash:s,name:t})},[]),Ze=a.useCallback(async(s,t)=>{if(t.stopPropagation(),!y){D(s),se(n=>{const r=new Map(n);return r.delete(s),r}),te(n=>{const r=new Map(n);return r.delete(s),r});try{const n=s.startsWith("0x")?s.slice(0,4):`0x${s.slice(0,2)}`,r=await Ns(n,30);r.success&&r.data?(se(i=>new Map(i).set(s,r.data)),setTimeout(()=>{se(i=>{const l=new Map(i);return l.delete(s),l})},1e4)):(te(i=>new Map(i).set(s,r.error||"Ping failed")),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3))}catch(n){const r=n instanceof Error?n.message:"Ping failed";te(i=>new Map(i).set(s,r)),setTimeout(()=>{te(i=>{const l=new Map(i);return l.delete(s),l})},5e3)}finally{D(null)}}},[y]);return e.jsxs(vs,{children:[e.jsx(ws,{title:"Contacts",icon:e.jsx(re,{}),subtitle:e.jsx(Ms,{}),controls:e.jsxs("div",{className:"flex items-center gap-3 sm:gap-5",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Total:"}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${m.total} discovered node${m.total!==1?"s":""} on the mesh network`,children:[e.jsx(re,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:m.total})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Types:"}),m.repeaters>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Repeaters",children:[e.jsx(pe,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Companions",children:[e.jsx(Le,{className:"w-3.5 h-3.5 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Room Servers",children:[e.jsx(he,{className:"w-3.5 h-3.5 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),m.withLocation>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"With GPS location",children:[e.jsx(Us,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{children:m.withLocation})]}),m.unknown>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Unknown type",children:[e.jsx(ze,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{children:m.unknown})]})]})]}),e.jsxs("div",{className:"flex sm:hidden items-center gap-1.5",children:[e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(re,{className:"w-3 h-3 text-fg-secondary"}),e.jsx("span",{children:m.total})]}),m.repeaters>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(pe,{className:"w-3 h-3 text-sys-blue"}),e.jsx("span",{children:m.repeaters})]}),m.companions>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(Le,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{children:m.companions})]}),m.roomServers>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(he,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:m.roomServers})]}),e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(Te,{ranges:Ne,selectedIndex:T,onSelect:S})})]})}),e.jsxs(ks,{children:[e.jsx(pt,{neighbors:A,localNode:R??void 0,localHash:K,onRemoveNode:f,selectedNodeHash:ge,onNodeSelected:Ke}),e.jsxs(gs,{noPadding:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 px-3 sm:px-4 py-2.5 border-b border-edge-subtle",children:[e.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title flex-shrink-0",children:e.jsx(re,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(js,{type:"search",size:"sm",value:h,onChange:s=>q(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(Ws,{className:"w-3.5 h-3.5"}),trailingIcon:h?e.jsx("button",{onClick:()=>{q(""),(h.toLowerCase().trim()==="neighbor"||h.toLowerCase().trim()==="neighbors")&&U(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(ys,{className:"w-3 h-3"})}):void 0,className:"w-24 sm:w-32 xl:w-44","aria-label":"Search contacts"}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsxs("div",{className:"relative","data-dropdown":!0,children:[e.jsxs("button",{onClick:()=>ee(!J),className:ve(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(tt,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Filter"}),b.size>0&&e.jsx("span",{className:"tabular-nums text-xs bg-sys-blue/30 px-1 rounded",children:b.size})]}),J&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 z-50 surface-elevated radius-inner py-1 min-w-[140px]",children:[[{key:"repeater",label:"Repeaters"},{key:"companion",label:"Companions"},{key:"room",label:"Rooms"}].map(({key:s,label:t})=>e.jsxs("button",{onClick:()=>{W(n=>{const r=new Set(n);return r.has(s)?r.delete(s):r.add(s),r})},className:"w-full px-3 py-1.5 text-sm text-left hover-bg transition-base flex items-center gap-2",children:[e.jsx("span",{className:we("w-4 h-4 flex items-center justify-center radius-badge border",b.has(s)?"bg-sys-blue border-sys-blue text-white":"border-edge-subtle"),children:b.has(s)&&e.jsx(ke,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:t})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>W(new Set),className:"w-full px-3 py-1.5 text-sm text-left text-fg-muted hover:text-fg-secondary hover-bg transition-base",children:"Clear filters"})]})]})]}),de.size>0&&e.jsxs("button",{onClick:()=>U(!z),className:ve(z,{color:"success",border:!0}),title:z?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(pe,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:"Neighbors"})]})]}),e.jsx("div",{className:"h-4 w-px bg-border-subtle flex-shrink-0"}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[vt.map(({field:s,icon:t,label:n})=>e.jsxs("button",{onClick:()=>Ge(s),className:ve(E===s),title:`Sort by ${n.toLowerCase()}`,children:[e.jsx(t,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:n}),E===s&&e.jsx(Ys,{className:we("w-3 h-3",V==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Cs,{value:C,onChange:We,className:"w-auto min-w-[50px] [&_button]:py-1 [&_button]:px-2 [&_button]:text-xs [&_button]:min-h-0","aria-label":"Items per page",children:[e.jsx(ue,{value:25,children:"25"}),e.jsx(ue,{value:50,children:"50"}),e.jsx(ue,{value:100,children:"100"}),e.jsx(ue,{value:0,children:"All"})]})]})]}),u.length>0?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"hidden sm:grid contacts-grid-header border-b border-edge-subtle/50 px-3 py-2 type-micro text-fg-muted",children:[e.jsx("div",{className:"contacts-col-node",children:"Node"}),e.jsx("div",{className:"contacts-col-signal text-right",children:"Signal"}),e.jsx("div",{className:"contacts-col-distance text-right",children:"Distance"}),e.jsx("div",{className:"contacts-col-centrality text-right",children:"Centrality"}),e.jsx("div",{className:"contacts-col-seen text-right",children:"Last Seen"}),e.jsx("div",{className:"contacts-col-actions"})]}),e.jsx("div",{className:"divide-y divide-edge-subtle/30",children:Se.map(([s,t])=>{const n=oe(s),r=Ue.has(s),i=de.has(s),l=le.get(s)??null,I=g.get(s)||0,N=i?qe.get(s):void 0,M=n?H.get(n)??null:null,F=B.get(s)??Nt;let ae=null;if(!i&&K&&p.size>0){const Je=`${s}→${K}`,xe=p.get(Je);if(xe&&xe.hops.length>0){const _e=xe.hops[0],Re=Object.keys(ie).find(es=>es.toUpperCase().startsWith(_e.toUpperCase())),Y=Re?ie[Re]:null;ae={prefix:_e,name:(Y==null?void 0:Y.node_name)??(Y==null?void 0:Y.name)??null,hopCount:xe.hopCount}}}const me=d.has(s),Xe=Ve.get(s)??null;return e.jsx(yt,{hash:s,contact:t,isHub:r,isNeighbor:i,distance:l,centrality:I,sparklineData:F,neighborSignal:N,collisionInfo:M,isViterbiResolved:w,isPinging:y!==null,isPingingThis:y===s,pingResult:je.get(s),pingError:Ie.get(s),gatewayInfo:ae,lastForwarderPrefix:Xe,isMobile:me,onRowClick:Qe,onPing:Ze,onRemove:Ye},s)})}),C>0&&Q0&&Qce(s=>Math.min(s+C,u.length)),className:"text-sys-blue hover:text-sys-blue/80 transition-base",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(re,{className:"roster-empty-icon"}),e.jsx("div",{className:"type-label text-fg-secondary",children:"No Contacts Discovered"}),e.jsx("div",{className:"type-data-xs text-fg-muted mt-1",children:"Contacts will appear here as they advertise on the mesh network."})]})]})]}),e.jsx(qs,{isOpen:!!_,title:"Remove Contact",message:`Are you sure you would like to remove ${(_==null?void 0:_.name)||"this contact"}?`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{_&&f(_.hash),j(null)},onCancel:()=>j(null)})]})}const Kt=Object.freeze(Object.defineProperty({__proto__:null,default:Mt},Symbol.toStringTag,{value:"Module"}));export{Kt as C,ft as P,He as R,mt as T}; diff --git a/frontend/dist/assets/ContactsMapMapLibre-B-sbLVsX.js b/frontend/dist/assets/ContactsMapMapLibre-46MKHZ47.js similarity index 99% rename from frontend/dist/assets/ContactsMapMapLibre-B-sbLVsX.js rename to frontend/dist/assets/ContactsMapMapLibre-46MKHZ47.js index 2c14bc13..d76bc035 100644 --- a/frontend/dist/assets/ContactsMapMapLibre-B-sbLVsX.js +++ b/frontend/dist/assets/ContactsMapMapLibre-46MKHZ47.js @@ -1,4 +1,4 @@ -import{d as X0,a7 as aa,r as j,e_ as ua,c2 as ca,cU as fa,cV as da,j as g,am as xo,cW as ha,an as wo,m as s0,D as hn,c as n0,L as Yn,d8 as e0,Z as I0,e$ as Os,f0 as vo,f1 as ma,bU as ga,b_ as pa,c0 as ya,a9 as bo,ao as ko,A as R0,b as Ur,B as Ot,d9 as xa,bW as us,M as zs,S as Hs,c$ as Co,e as Eo,R as So,bo as mn,bj as yi,f2 as Mo,G as wa,K as va,d7 as ba,f3 as ka,aj as Bo,bw as xi,by as Ca,E as Gs,F as Us,bY as Ea,aO as Sa,em as Do,f4 as Ma,c1 as Ba,f5 as Da,f6 as _o,a8 as dn,cb as _a,f7 as To,f8 as Ta,f9 as ja,ar as jo,x as x0,fa as Ro,bM as Ra,eY as Ia,bP as La,cZ as Io,d0 as Na,P as Fa,fb as Pa,ey as Qa,fc as cs}from"./index-CvSa8h-C.js";import{u as Lo,b as Ar,S as J0,L as t0,P as Oa,c as za,M as Ha,d as Ga,B as Ua}from"./BasemapLayer-NuqTvOvz.js";import{u as No,r as Fo,e as wi,f as vi,g as Va}from"./consumer-registry-BsBD_8RF.js";import{L as Hn,c as Wa}from"./link-scoring-DaKaf0kz.js";import{C as Ya}from"./ConfirmModal-D2DSFKRK.js";import{b as Ka,e as $a,a as Po,m as bi,s as Za,G as Cs,c as Qo,g as qa,M as Ja,E as Xa,u as Au,d as eu,i as tu,j as ru,k as nu}from"./max-B4xU84un.js";import{D as Oo}from"./download-CNAyp-3r.js";import{D as su}from"./database-bNR-4XQS.js";import{H as iu,A as un,D as ki,p as ou,c as lu,u as ur}from"./useMapViewStore-1D-N8rLK.js";import{R as zo}from"./refresh-cw-DQJSjSjI.js";import{E as Ho}from"./target-M8AQjykJ.js";import{F as au}from"./funnel-DLa9oQpD.js";import{P as uu}from"./plus-CNNHSjgp.js";import{C as cu,a as Go,b as Es,c as fu}from"./easing-CvrBfrm0.js";import{Z as du}from"./zap-mngIm3qT.js";import{T as Vs}from"./trash-2-DUG72tk9.js";import{W as hu}from"./wifi-off-B6--LVD1.js";import{W as mu}from"./wifi-DV8DJqF0.js";import{C as Uo,H as Ci,a as Lr,N as gu,b as pu}from"./badge-colors-MuK22b26.js";import{C as yu}from"./chevron-right-1kmv-Vqa.js";import{T as xu,P as wu,R as vu}from"./Contacts-DyjGy2DF.js";import{c as bu}from"./node-types-BJsOTMm_.js";import{L as ku}from"./LightSparkline-BjpzakdT.js";import{M as Cu}from"./map-pin-BCwmmHGs.js";import"./triangle-alert-C7tm61-l.js";import"./index-CPifxb0-.js";import"./usePipelineStore-pGK8Y5O7.js";import"./ping-D0xwlHyD.js";import"./PageLayout-B8orsDlo.js";import"./listbox-Xbs80tag.js";import"./element-movement-CM_Y2Bj0.js";import"./MqttModeBadge-CGW6hCWV.js";import"./chat-utils-BUBqf9vH.js";import"./SignalIndicator-B0ppyCo-.js";import"./CollisionExplorerModal-BC_ZJRMz.js";import"./monitor-smartphone-D-7zPu_H.js";import"./DataBox-CwAsAwyY.js";import"./circle-question-mark-DDUlGgWh.js";import"./network-VirimdjG.js";import"./activity-CctJQ0y-.js";import"./search-BZtD4Hr8.js";/** +import{d as X0,a7 as aa,r as j,e_ as ua,c2 as ca,cU as fa,cV as da,j as g,am as xo,cW as ha,an as wo,m as s0,D as hn,c as n0,L as Yn,d8 as e0,Z as I0,e$ as Os,f0 as vo,f1 as ma,bU as ga,b_ as pa,c0 as ya,a9 as bo,ao as ko,A as R0,b as Ur,B as Ot,d9 as xa,bW as us,M as zs,S as Hs,c$ as Co,e as Eo,R as So,bo as mn,bj as yi,f2 as Mo,G as wa,K as va,d7 as ba,f3 as ka,aj as Bo,bw as xi,by as Ca,E as Gs,F as Us,bY as Ea,aO as Sa,em as Do,f4 as Ma,c1 as Ba,f5 as Da,f6 as _o,a8 as dn,cb as _a,f7 as To,f8 as Ta,f9 as ja,ar as jo,x as x0,fa as Ro,bM as Ra,eY as Ia,bP as La,cZ as Io,d0 as Na,P as Fa,fb as Pa,ey as Qa,fc as cs}from"./index-WhzslczH.js";import{u as Lo,b as Ar,S as J0,L as t0,P as Oa,c as za,M as Ha,d as Ga,B as Ua}from"./BasemapLayer-CeyADeA1.js";import{u as No,r as Fo,e as wi,f as vi,g as Va}from"./consumer-registry-DcpFyHd4.js";import{L as Hn,c as Wa}from"./link-scoring-DGx3Bvuc.js";import{C as Ya}from"./ConfirmModal-4-j2cctt.js";import{b as Ka,e as $a,a as Po,m as bi,s as Za,G as Cs,c as Qo,g as qa,M as Ja,E as Xa,u as Au,d as eu,i as tu,j as ru,k as nu}from"./max-Ch6kRxV_.js";import{D as Oo}from"./download-7lpHRyVo.js";import{D as su}from"./database-Hkah1WM3.js";import{H as iu,A as un,D as ki,p as ou,c as lu,u as ur}from"./useMapViewStore-7rwVBEII.js";import{R as zo}from"./refresh-cw-BLqMXKuf.js";import{E as Ho}from"./target-PpDPv2u2.js";import{F as au}from"./funnel-B4y6lzBW.js";import{P as uu}from"./plus-Q9JrSYS-.js";import{C as cu,a as Go,b as Es,c as fu}from"./easing-CgZkd7Dy.js";import{Z as du}from"./zap-Ec1PEQMI.js";import{T as Vs}from"./trash-2-dqn51YO_.js";import{W as hu}from"./wifi-off-DjfOg4sJ.js";import{W as mu}from"./wifi-B-dNXYIH.js";import{C as Uo,H as Ci,a as Lr,N as gu,b as pu}from"./badge-colors-BgV-I1O5.js";import{C as yu}from"./chevron-right-Ewog5LA3.js";import{T as xu,P as wu,R as vu}from"./Contacts-2Yx_cmAj.js";import{c as bu}from"./node-types-BuI9FfZZ.js";import{L as ku}from"./LightSparkline-CIu8T-_d.js";import{M as Cu}from"./map-pin-BXCqDxIA.js";import"./triangle-alert-BsvKjxO1.js";import"./index-WiXmWhPS.js";import"./usePipelineStore-DZf0BPc-.js";import"./ping-BA7i2ph0.js";import"./PageLayout-CjepFyhn.js";import"./listbox-B9_kY-R5.js";import"./element-movement-CSsBUmDY.js";import"./MqttModeBadge-xEEk549C.js";import"./chat-utils-CPRl3lbc.js";import"./SignalIndicator-B1hS3JQG.js";import"./CollisionExplorerModal-D9V91Yz1.js";import"./monitor-smartphone-h2eaOleh.js";import"./DataBox-ABvJ7hn1.js";import"./circle-question-mark-CJt3zunX.js";import"./network-BXTFbhix.js";import"./activity-CzPYx3Pb.js";import"./search-DttoJEPu.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Dashboard-B3SyL0YD.js b/frontend/dist/assets/Dashboard-6pffDPFe.js similarity index 51% rename from frontend/dist/assets/Dashboard-B3SyL0YD.js rename to frontend/dist/assets/Dashboard-6pffDPFe.js index e8b10d63..7a52c978 100644 --- a/frontend/dist/assets/Dashboard-B3SyL0YD.js +++ b/frontend/dist/assets/Dashboard-6pffDPFe.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CvSa8h-C.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); -import{d as H,e as lt,_ as ke,f as Ce,h as Ee,k as dt,r as x,j as e,A as He,m as ae,S as ut,M as mt,U as ft,n as xt,o as ht,p as pt,q as gt,t as yt,v as I,w as be,x as Y,y as bt,z as jt,D as Te,E as Nt,L as oe,F as vt,G as re,H as wt,J as kt,K as ie,N as $e,T as Ct,O as Tt,B as Be,R as Ie,P as Oe,Q as Bt,V as J,W as E,X as ze,Y as Mt,$ as St,a0 as _t,a1 as Rt,a2 as Dt,a3 as Pt,a4 as Ft,a5 as de,u as je,a6 as At,a7 as Lt,a8 as Me,a9 as ue,aa as ee,ab as qe,ac as Et,ad as te,ae as Ht,af as $t,ag as It,ah as Se,ai as Ot,c as L,aj as zt,ak as We,al as _e,am as qt,an as Wt,ao as Ut,ap as Vt,aq as Gt,ar as Xt,as as me,at as Yt}from"./index-CvSa8h-C.js";import{C as Re,P as Kt,a as Jt,B as Zt}from"./PageLayout-B8orsDlo.js";import{u as z,r as q,h as Qt,a as es,b as ts,i as ss}from"./consumer-registry-BsBD_8RF.js";import{A as K,D as $,E as ns}from"./DataValue-CjX4hzMo.js";import{c as as}from"./node-types-BJsOTMm_.js";import{b as Ue,c as X,a as os,d as rs,F as se}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as is,u as ge,P as cs,T as ls,C as Ve}from"./PacketList-Bpo20OVL.js";import{useGetDecodedContent as ds,useResolveSource as us}from"./usePipelineStore-pGK8Y5O7.js";import{A as De}from"./SignalIndicator-B0ppyCo-.js";import{T as Ge,M as ms}from"./MqttModeBadge-CGW6hCWV.js";import{L as Xe}from"./LightSparkline-BjpzakdT.js";import{c as fs}from"./link-scoring-DaKaf0kz.js";import{Z as xs}from"./zap-mngIm3qT.js";import{N as hs}from"./NodeInformationCard-CtqEav-P.js";import{g as ps,e as fe,a as gs,f as ys}from"./chat-utils-BUBqf9vH.js";import{M as Ye,C as bs}from"./ChatBubble-BuuYl9Rr.js";import{C as Pe}from"./chevron-right-1kmv-Vqa.js";import{H as js}from"./hash-CTme6GHI.js";import{M as Ns}from"./message-square-DODYXl2V.js";import{H as vs}from"./useMapViewStore-1D-N8rLK.js";import{R as xe,C as he}from"./Grid-suKoG48i.js";import{C as ws}from"./circle-x-BDVzq0qX.js";import"./index-CPifxb0-.js";import"./primitives-BahnzDua.js";import"./badge-colors-MuK22b26.js";import"./arrow-up-DQmOy4Je.js";import"./map-pin-BCwmmHGs.js";import"./circle-question-mark-DDUlGgWh.js";import"./triangle-alert-C7tm61-l.js";import"./DataBox-CwAsAwyY.js";import"./layers-Cnw2L-3K.js";import"./activity-CctJQ0y-.js";import"./circle-check-DW83e7Fg.js";import"./database-bNR-4XQS.js";import"./shield-DDEEZTF6.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-WhzslczH.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); +import{d as H,e as lt,_ as ke,f as Ce,h as Ee,k as dt,r as h,j as e,A as He,m as ae,S as ut,M as mt,U as ft,n as ht,o as xt,p as pt,q as gt,t as yt,v as I,w as be,x as Y,y as bt,z as jt,D as Be,E as Nt,L as oe,F as vt,G as re,H as wt,J as kt,K as ie,N as $e,T as Ct,O as Bt,B as Te,R as Ie,P as Oe,Q as Tt,V as J,W as E,X as ze,Y as Mt,$ as St,a0 as _t,a1 as Rt,a2 as Dt,a3 as Pt,a4 as Ft,a5 as de,u as je,a6 as At,a7 as Lt,a8 as Me,a9 as ue,aa as ee,ab as qe,ac as Et,ad as te,ae as Ht,af as $t,ag as It,ah as Se,ai as Ot,c as L,aj as zt,ak as We,al as _e,am as qt,an as Wt,ao as Ut,ap as Vt,aq as Gt,ar as Xt,as as me,at as Yt}from"./index-WhzslczH.js";import{C as Re,P as Kt,a as Jt,B as Zt}from"./PageLayout-CjepFyhn.js";import{u as z,r as q,h as Qt,a as es,b as ts,i as ss}from"./consumer-registry-DcpFyHd4.js";import{A as K,D as $,E as ns}from"./DataValue-DoI73agL.js";import{c as as}from"./node-types-BuI9FfZZ.js";import{b as Ue,c as X,a as os,d as rs,F as se}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as is,u as ge,P as cs,T as ls,C as Ve}from"./PacketList-3khSiIZq.js";import{useGetDecodedContent as ds,useResolveSource as us}from"./usePipelineStore-DZf0BPc-.js";import{A as De}from"./SignalIndicator-B1hS3JQG.js";import{T as Ge,M as ms}from"./MqttModeBadge-xEEk549C.js";import{L as Xe}from"./LightSparkline-CIu8T-_d.js";import{c as fs}from"./link-scoring-DGx3Bvuc.js";import{Z as hs}from"./zap-Ec1PEQMI.js";import{N as xs}from"./NodeInformationCard-DJ0EACZ1.js";import{g as ps,e as fe,a as gs,f as ys}from"./chat-utils-CPRl3lbc.js";import{M as Ye,C as bs}from"./ChatBubble-DKx9qJbz.js";import{C as Pe}from"./chevron-right-Ewog5LA3.js";import{H as js}from"./hash-Bwa-X17j.js";import{M as Ns}from"./message-square-D2zm03U4.js";import{H as vs}from"./useMapViewStore-7rwVBEII.js";import{R as he,C as xe}from"./Grid-xhoz0JJL.js";import{C as ws}from"./circle-x-DAvnTI4S.js";import"./index-WiXmWhPS.js";import"./primitives-Bq_jqX-t.js";import"./badge-colors-BgV-I1O5.js";import"./arrow-up-pO4AtOWx.js";import"./map-pin-BXCqDxIA.js";import"./circle-question-mark-CJt3zunX.js";import"./triangle-alert-BsvKjxO1.js";import"./DataBox-ABvJ7hn1.js";import"./layers-rhF42Hfn.js";import"./activity-CzPYx3Pb.js";import"./circle-check-6eqe109E.js";import"./database-Hkah1WM3.js";import"./shield-DWGSxaaG.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -9,7 +9,7 @@ import{d as H,e as lt,_ as ke,f as Ce,h as Ee,k as dt,r as x,j as e,A as He,m as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ts=[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]],Bs=H("audio-waveform",Ts);/** + */const Bs=[["path",{d:"M2 13a2 2 0 0 0 2-2V7a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0V4a2 2 0 0 1 4 0v13a2 2 0 0 0 4 0v-4a2 2 0 0 1 2-2",key:"57tc96"}]],Ts=H("audio-waveform",Bs);/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -44,7 +44,7 @@ import{d as H,e as lt,_ as ke,f as Ce,h as Ee,k as dt,r as x,j as e,A as He,m as * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Is=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Os=H("timer",Is),O=lt(()=>({result:null,isComputing:!1})),zs=500,qs=300;let U=null,ne=null;function Ws(t){var a;const n=(a=t==null?void 0:t.config)==null?void 0:a.radio;return`${(n==null?void 0:n.spreading_factor)??7}:${(n==null?void 0:n.bandwidth)??125e3}:${(n==null?void 0:n.coding_rate)??5}:${(n==null?void 0:n.preamble_length)??8}`}function Us(){if(U)return U;if(typeof window>"u")return null;try{U=new Worker(new URL("/assets/dashboard-bucketing.worker-BwrZMAuc.js",import.meta.url),{type:"module"}),U.onmessage=t=>{if(t.data.type==="error"){console.error("[DashboardBucketing] Worker error:",t.data.error),O.setState({isComputing:!1});return}O.setState({result:t.data.payload,isComputing:!1})},U.onerror=t=>{console.error("[DashboardBucketing] Worker error:",t),O.setState({isComputing:!1})}}catch(t){console.error("[DashboardBucketing] Failed to init worker:",t)}return U}function Vs(t,n,a,s){const o=Us();if(!o)return;const r=t.length,u=new Float64Array(r),i=new Float64Array(r),m=new Uint16Array(r),l=new Uint8Array(r),d=new Uint8Array(r),b=new Uint8Array(r),c=new Uint8Array(r),y=new Float32Array(r),g=new Float32Array(r),h=new Uint32Array(r),N=new Map;let k=0;for(let C=0;CparseInt(n,10)).filter(n=>t[n]>0).sort((n,a)=>t[a]-t[n])}function Gs(t,n,a){const s={...t,received:[...t.received],unique_received:[...t.unique_received],transmitted:[...t.transmitted],forwarded:[...t.forwarded],dropped:[...t.dropped],receivedBytesBuckets:t.receivedBytesBuckets.map(d=>({...d,bytesByType:{...d.bytesByType},countByType:{...d.countByType}})),forwardedBytesBuckets:t.forwardedBytesBuckets.map(d=>({...d,bytesByType:{...d.bytesByType},countByType:{...d.countByType}})),droppedBytesBuckets:t.droppedBytesBuckets.map(d=>({...d,bytesByType:{...d.bytesByType},countByType:{...d.countByType}})),receivedTotalByType:{...t.receivedTotalByType},receivedCountByType:{...t.receivedCountByType},forwardedTotalByType:{...t.forwardedTotalByType},droppedTotalByType:{...t.droppedTotalByType}},{start_time:o,end_time:r,bucket_duration_seconds:u,bucket_count:i}=t,m=new Set;for(const d of n){const b=d.timestamp??0;if(br)continue;const c=Math.floor((b-o)/u);if(c<0||c>=i)continue;m.has(c)||(m.add(c),s.received[c]={...s.received[c]},s.unique_received[c]={...s.unique_received[c]},s.transmitted[c]={...s.transmitted[c]},s.forwarded[c]={...s.forwarded[c]},s.dropped[c]={...s.dropped[c]});const y=Ee(d,a),g=d.length??d.payload_length??0,h=d.type??d.payload_type??0,N=d.packet_origin;N==="tx_local"?(s.transmitted[c].count++,s.transmitted[c].airtime_ms+=y):N==="tx_forward"||d.transmitted?(s.forwarded[c].count++,s.forwarded[c].airtime_ms+=y,s.forwardedBytesBuckets[c].bytesByType[h]=(s.forwardedBytesBuckets[c].bytesByType[h]??0)+g,s.forwardedBytesBuckets[c].totalBytes+=g,s.forwardedBytesBuckets[c].countByType[h]=(s.forwardedBytesBuckets[c].countByType[h]??0)+1,s.forwardedBytesBuckets[c].totalCount++,s.forwardedTotalByType[h]=(s.forwardedTotalByType[h]??0)+g,s.totalForwardedCount++):d.drop_reason&&(s.dropped[c].count++,s.dropped[c].airtime_ms+=y,s.droppedBytesBuckets[c].bytesByType[h]=(s.droppedBytesBuckets[c].bytesByType[h]??0)+g,s.droppedBytesBuckets[c].totalBytes+=g,s.droppedBytesBuckets[c].countByType[h]=(s.droppedBytesBuckets[c].countByType[h]??0)+1,s.droppedBytesBuckets[c].totalCount++,s.droppedTotalByType[h]=(s.droppedTotalByType[h]??0)+g,s.totalDroppedCount++),N!=="tx_local"&&(s.received[c].count++,s.received[c].airtime_ms+=y,s.unique_received[c].count++,s.unique_received[c].airtime_ms+=y,s.receivedBytesBuckets[c].bytesByType[h]=(s.receivedBytesBuckets[c].bytesByType[h]??0)+g,s.receivedBytesBuckets[c].totalBytes+=g,s.receivedBytesBuckets[c].countByType[h]=(s.receivedBytesBuckets[c].countByType[h]??0)+1,s.receivedBytesBuckets[c].totalCount++,s.receivedTotalByType[h]=(s.receivedTotalByType[h]??0)+g,s.receivedCountByType[h]=(s.receivedCountByType[h]??0)+1,s.totalReceivedBytes+=g)}const l=s.time_range_minutes/60;return s.kbPerHour=l>0?Math.round(s.totalReceivedBytes/1024/l):0,s.forwardedRatePerHour=l>0?Math.round(s.totalForwardedCount/l):0,s.droppedRatePerHour=l>0?Math.round(s.totalDroppedCount/l):0,s.receivedActiveTypes=pe(s.receivedTotalByType),s.forwardedActiveTypes=pe(s.forwardedTotalByType),s.droppedActiveTypes=pe(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([ke(()=>import("./index-CvSa8h-C.js").then(t=>t.fJ),__vite__mapDeps([0,1])),ke(()=>import("./index-CvSa8h-C.js").then(t=>t.fI),__vite__mapDeps([0,1]))]).then(([t,n])=>{const{DASHBOARD_TIME_RANGES:a}=n;let s=0,o=-1,r="";t.useStore.subscribe(u=>{const i=u.packets.length,m=u.globalTimeRangeIndex,l=Ws(u.stats);if(i===s&&m===o&&l===r)return;const d=s,b=o,c=r;if(s=i,o=m,r=l,i===0)return;const y=a[m]??a[4],g=y.minutes,h=y.buckets,N=u.stats,k=Ce(N),w=i-d,C=m!==b,M=l!==c,_=O.getState().result;if(!C&&!M&&w>0&&w{ne=null;const f=t.useStore.getState();if(f.packets.length===0||!f.stats)return;const B=a[f.globalTimeRangeIndex]??a[4],j=Ce(f.stats);Vs(f.packets,B.minutes,B.buckets,j)},qs)})});const Xs=()=>O(t=>t.result),Ke=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:Qt}];q(Ke);function Ys(t){const a=new Date(t*1e3).getHours();return a>=6&&a<18}function Ks(t){return new Date(t*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function Js({buckets:t,activeTypes:n,totalByType:a,mode:s="bytes"}){z(Ke);const o=dt(),[r,u]=x.useState(null),[i,m]=x.useState(null),[l,d]=x.useState(null),b=x.useCallback((k,w,C)=>{u(w),m(C)},[]),c=t.length>0&&n.length>0,y=r?Ys(r.start):null,g=r?Ks(r.start):"",h=l!==null&&y!==null&&l!==y;y!==l&&d(y);const N=48;return e.jsxs("div",{className:"flex flex-col h-full relative",children:[e.jsx("div",{className:"h-5 relative mb-1 shrink-0",children:r&&i!==null&&e.jsxs("div",{className:"absolute flex items-center gap-1.5 type-data-sm -translate-x-1/2",style:{left:`calc(${N}px + ${i*100}% * (1 - ${N}px / 100%))`},children:[e.jsx(He,{mode:"wait",children:e.jsx(ae.span,{initial:h?{opacity:0,scale:.5,rotate:-90}:!1,animate:{opacity:1,scale:1,rotate:0},exit:{opacity:0,scale:.5,rotate:90},transition:{duration:.25,ease:"easeOut"},children:y?e.jsx(ut,{className:"w-4 h-4 text-sys-amber"}):e.jsx(mt,{className:"w-4 h-4 text-sys-blue"})},y?"sun":"moon")}),e.jsx("span",{className:"text-fg-secondary",children:g})]})}),e.jsx("div",{className:"flex-1 min-h-0",children:c&&e.jsx(ft,{buckets:t,activeTypes:n,gridColor:o.grid,axisTickColor:o.axisTick,onHover:b,yAxisFormat:s})}),e.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:c&&e.jsx(xt,{activeTypes:n,totalByType:a,formatMode:s})})]})}function Zs(t,n,a){var r,u;if(t.length<=a)return t;const s=t.length/a,o=[];for(let i=0;i0&&(b.bytesByType[y]=(b.bytesByType[y]??0)+g)}}o.push(b)}return o}function Qs(t,n,a,s,o,r,u){if(n.length===0)return;const i=Zs(n,a,gt.statsCard),m=i.length,l=r/m,d=i.map(c=>c.totalBytes),b=Math.max(...d);if(b!==0){for(let c=0;c{const u=t.map(m=>m.start),i=t.map(()=>1);return[u,i]},[t]);return x.useEffect(()=>{if(!a.current||t.length===0)return;const u=a.current;let i=null,m=null;const l=ht(()=>{const d=u.getBoundingClientRect(),b=Math.floor(d.width)||200,c=Math.floor(d.height)||60,y={width:b,height:c,padding:[0,0,0,0],cursor:{show:!1},scales:{x:{time:!1},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],legend:{show:!1},hooks:{draw:[g=>{const h=g.ctx,{left:N,top:k,width:w,height:C}=g.bbox;Qs(h,s.current,o.current,N,k,w,C)}]}};i=new pt(y,r,u),m=new ResizeObserver(()=>{const g=u.getBoundingClientRect();g.width>0&&g.height>0&&(i==null||i.setSize({width:Math.floor(g.width),height:Math.floor(g.height)}))}),m.observe(u)});return()=>{l(),m==null||m.disconnect(),i==null||i.destroy()}},[r,t.length]),t.length===0?e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx("div",{className:"w-full h-0.5 rounded-full bg-fg-muted/15"})}):e.jsx("div",{ref:a,className:"w-full h-full"})}const Je=x.memo(en),Ze=[{target:"ForwardedCard",fn:"type",minStage:1}];q(Ze);function tn({value:t,receivedCount:n,buckets:a,activeTypes:s,ratePerHour:o,timeRangeLabel:r,icon:u,isLoaded:i=!0}){z(Ze);const m=n>0?(t/n*100).toFixed(1):null;return i?e.jsxs(I,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3",children:[u&&e.jsx("span",{className:"icon-sm text-icon-card-title",children:u}),e.jsx("span",{className:"type-micro",children:"FORWARDED"}),r&&e.jsx(Y,{color:"zinc",className:"hidden sm:inline-flex",children:r})]}),e.jsx("div",{className:"type-data-xl text-fg-primary",children:e.jsx(K,{value:t,className:"font-mono tabular-nums",priority:"high"})}),e.jsx("div",{className:"flex-1 mt-1 overflow-hidden min-h-[40px] sm:min-h-[60px]",children:s.length>0?e.jsx(Je,{buckets:a,activeTypes:s}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"w-full h-0.5 rounded-full bg-fg-muted/15"})})}),e.jsx("div",{className:"pt-1.5 sm:pt-2 mt-1",children:e.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Rate"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[o,"/hr"]})]}),m!==null&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Ratio"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[m,"%"]})]})]})})]}):e.jsx(I,{children:e.jsx(be,{})})}const Qe=[{target:"DroppedCard",fn:"type",minStage:1}];q(Qe);function sn({value:t,crcCount:n=0,receivedCount:a,buckets:s,activeTypes:o,ratePerHour:r,timeRangeLabel:u,icon:i,isLoaded:m=!0}){z(Qe);const l=t+n,d=a>0?(l/a*100).toFixed(1):null;return m?e.jsxs(I,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3",children:[i&&e.jsx("span",{className:"icon-sm text-icon-card-title",children:i}),e.jsx("span",{className:"type-micro",children:"DROPPED"}),u&&e.jsx(Y,{color:"zinc",className:"hidden sm:inline-flex",children:u})]}),e.jsx("div",{className:"type-data-xl text-fg-primary",children:e.jsx(K,{value:l,className:"font-mono tabular-nums",priority:"high"})}),e.jsx("div",{className:"flex-1 mt-1 overflow-hidden min-h-[40px] sm:min-h-[60px]",children:o.length>0?e.jsx(Je,{buckets:s,activeTypes:o}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"w-full h-0.5 rounded-full bg-fg-muted/15"})})}),e.jsx("div",{className:"pt-1.5 sm:pt-2 mt-1",children:e.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Rate"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[r,"/hr"]})]}),d!==null&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Drop %"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[d,"%"]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"CRC"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:n})]})]})})]}):e.jsx(I,{children:e.jsx(be,{})})}const nn=2,an=1;function on(t,n,a){const s=m=>(m==null?void 0:m.reduce((l,d)=>l+d.count,0))??0,o=s(n),r=s(a),u=o||(t==null?void 0:t.rx_count)||1,i=r||(t==null?void 0:t.dropped_count)||0;return u>0?i/(u+i)*100:0}function rn(t,n,a){const s=o=>(o==null?void 0:o.reduce((r,u)=>r+u.count,0))??0;if(n!=null&&n.length&&a){const r=s(n)*100,u=n.length*a*1e3;return r/u*100}if(t){const o=(t.uptime_seconds||1)*1e3;return(t.total_airtime_ms||t.airtime_used_ms||0)/o*100}return 0}function Fe(t,n,a){return os(Math.max(n,Math.min(a,t)))}function cn(t,n,a,s,o){let r=Ue(t);n>20?r+=se*2:n>12&&(r+=se),a>8&&(r+=se);const u=Fe(r,0,nn);let i=rs(t);a>8&&(i+=se);const m=Fe(i,0,an),l=X(u),d=X(m),b=s!==null?X(s):null;let c="stable";return b!==null&&(l>b?c="increase":l{if(l!=="applying"){d("applying");try{const le=await jt({tx_delay_factor:A,direct_tx_delay_factor:ct});le!=null&&le.success?(d("success"),setTimeout(()=>d("idle"),2e3)):(d("error"),setTimeout(()=>d("idle"),2500))}catch{d("error"),setTimeout(()=>d("idle"),2500)}}},[l]);if(!u)return e.jsx(I,{children:e.jsx(be,{})});const y=10080*60,h=Math.floor(Date.now()/1e3)-y,N=Object.values((t==null?void 0:t.neighbors)??{}).filter(A=>A.zero_hop&&A.last_seen>=h&&as(A).isRepeater).length,k=b.filter(A=>A.status==="active"||A.lastSeen>=h).length,w=Math.max(N,k),C=on(t,n,a),M=rn(t,s,o),_=((Ne=(Q=t==null?void 0:t.config)==null?void 0:Q.delays)==null?void 0:Ne.tx_delay_factor)??null,T=((we=(ve=t==null?void 0:t.config)==null?void 0:ve.delays)==null?void 0:we.direct_tx_delay_factor)??null,f=cn(w,C,M,_),B=w!==1,j=Ue(w),v=[`${w} repeater${B?"s":""} heard in the last 7 days (base ×${j.toFixed(1)}).`];f.floodFactor===j&&C<=12&&M<=8?v.push("No modifiers applied — network looks healthy."):(C>20?v.push(`High duplicate rate (${C.toFixed(1)}%) suggests frequent collisions — window widened.`):C>12&&v.push(`Elevated duplicate rate (${C.toFixed(1)}%) — window widened one step.`),M>8&&v.push(`Channel is busy (${M.toFixed(1)}% TX util) — extra spacing added.`));const p=[`Direct uses one forwarder — ×${f.directFactor.toFixed(1)} backoff for channel contention.`];M>8&&p.push("Busy channel — small extra backoff.");const S=[`Flood ×${f.floodFactor.toFixed(1)} (${f.floodSlots} slot${f.floodSlots!==1?"s":""})`,...v,"",`Direct ×${f.directFactor.toFixed(1)}`,...p,"","Click to copy CLI commands"].join(` -`),R=_!==null?X(_):null,P=T!==null?X(T):null,D=R!==null&&f.floodSlots!==R,F=P!==null&&f.directSlots!==P,W=D||F,G=async()=>{const A=`set txdelay ${f.floodFactor.toFixed(1)} -set direct.txdelay ${f.directFactor.toFixed(1)}`;await vt(A),m(!0),setTimeout(()=>m(!1),1500)},ce=()=>c(f.floodFactor,f.directFactor);return e.jsxs(I,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3 flex-wrap",children:[e.jsx(is,{className:"w-4 h-4 text-icon-card-title flex-shrink-0"}),e.jsx("span",{className:"type-micro",children:"DELAY DOCTOR"}),r&&e.jsx(Y,{color:"zinc",className:"hidden sm:inline-flex",children:r})]}),e.jsxs("button",{onClick:G,className:"flex gap-3 mb-2 sm:mb-3 w-full text-left hover:bg-subtle-fill radius-inner transition-base p-1 -m-1 group",title:S,children:[e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("span",{className:"type-data-xl text-fg-primary",children:e.jsxs($,{children:["×",f.floodFactor.toFixed(1)]})}),e.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Flood"})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("span",{className:"type-data-xl text-sys-blue",children:e.jsxs($,{children:["×",f.directFactor.toFixed(1)]})}),e.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Direct"})]}),e.jsx("div",{className:"flex items-center self-center opacity-0 group-hover:opacity-100 transition-opacity",children:i?e.jsx(Te,{className:"w-4 h-4 text-sys-green"}):e.jsx(Nt,{className:"w-4 h-4 text-fg-muted"})})]}),e.jsx("div",{className:"flex-1 py-2",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"data-box-label",children:"Dupe"}),e.jsxs("div",{className:`data-box data-box-fill data-box-left ${f.duplicateRate>8?"text-status-warning":""}`,children:[f.duplicateRate.toFixed(1),"%"]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"data-box-label",children:"TX Util"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[f.txUtilization.toFixed(2),"%"]})]})]})}),e.jsx("div",{className:"pt-2 mt-auto",children:e.jsxs("div",{className:"flex items-end justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Current"}),e.jsx("div",{className:"flex gap-2",children:_!==null?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:["×",_.toFixed(2)]})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"data-box data-box-fill data-box-left",style:{color:"var(--sys-blue)"},children:["×",(T==null?void 0:T.toFixed(2))??"—"]})})]}):e.jsx("span",{className:"text-sm text-fg-muted",children:"No config"})})]}),W&&e.jsxs("button",{onClick:ce,disabled:l==="applying"||l==="success",className:`flex items-center gap-1.5 px-2.5 py-1.5 radius-inner type-micro font-medium transition-base - ${l==="success"?"bg-sys-green/15 text-sys-green":l==="error"?"bg-sys-red/15 text-sys-red":l==="applying"?"bg-subtle-fill text-fg-muted":"bg-sys-blue/10 text-sys-blue hover:bg-sys-blue/20"}`,title:`Apply ×${f.floodFactor.toFixed(1)} flood, ×${f.directFactor.toFixed(1)} direct`,children:[l==="success"?"Rx'd":l==="error"?"Failed":"Apply",l==="applying"?e.jsx(oe,{className:"w-3.5 h-3.5 animate-spin"}):l==="success"?e.jsx(Te,{className:"w-3.5 h-3.5"}):e.jsxs("span",{className:"relative inline-flex items-end w-6 h-3.5",children:[e.jsx(As,{className:"w-3.5 h-3.5 absolute left-0 bottom-0"}),e.jsx($s,{className:"w-3 h-3 absolute right-0 bottom-0"})]})]})]})})]})}const et=[{target:"RecentPackets",fn:"rssi",minStage:1},{target:"RecentPackets",fn:"snr",minStage:1}];q(et);const dn=25;function un(){z(et);const t=re(),n=wt(),a=kt(),s=ie(),o=ds(),r=ge(y=>y.requestChannel),[u,i]=x.useState(!0),m=x.useCallback(y=>i(y),[]),l=x.useMemo(()=>[...t.length<=100?t:t.slice(-100)].sort((g,h)=>(h.timestamp??0)-(g.timestamp??0)),[t]),d=s==null?void 0:s.local_hash,b=s==null?void 0:s.neighbors,c=us();return e.jsxs(I,{noPadding:!0,className:"!overflow-visible",children:[e.jsx($e,{listHeader:!0,icon:e.jsx(Ie,{}),title:"Recent Packets",actions:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ct,{enabled:u,onChange:m,label:"Hide Dupes",size:"sm"}),a&&e.jsx(Tt,{showLabel:!0}),e.jsxs(Be,{color:"primary",outline:!0,href:"/packets",children:["View all",e.jsx(De,{"data-slot":"icon"})]})]})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-1",children:e.jsx(cs,{packets:l,allPackets:t,localHash:d,neighbors:b,resolveSource:c,getDecodedContent:o,onChannelClick:r,loading:n,maxPackets:dn,showPagination:!1,flashNewest:!0,hideDupes:u,emptyMessage:"No packets received",footerAction:e.jsxs(Be,{color:"primary",outline:!0,href:"/packets",children:["View all",e.jsx(De,{"data-slot":"icon"})]})})})]})}const mn={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function fn({trend:t}){return e.jsx("span",{className:`mini-widget-trend ${t}`,children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:mn[t]})})})}function xn(){return e.jsx("div",{className:"mini-widget-loading",children:e.jsx("div",{className:"mini-widget-loading-spinner"})})}function hn({message:t}){return e.jsx("div",{className:"mini-widget-error",children:e.jsx("span",{title:t,children:"No data"})})}function V({title:t,icon:n,value:a,unit:s,valueSize:o="md",status:r,subtitle:u,subtitleValue:i,trend:m,children:l,isLoading:d=!1,error:b,className:c="",onClick:y}){const g=["mini-widget-value",o==="lg"&&"mini-widget-value-lg",o==="sm"&&"mini-widget-value-sm"].filter(Boolean).join(" "),h=["mini-widget",c].filter(Boolean).join(" ");return e.jsxs(I,{noPadding:!0,className:h,onClick:y,children:[e.jsxs("div",{className:"mini-widget-header",children:[n,e.jsx("span",{className:"mini-widget-title",children:t}),r&&r!=="unknown"&&e.jsx("div",{className:`mini-widget-status-dot ${r}`}),m&&e.jsx(fn,{trend:m})]}),d?e.jsx(xn,{}):b?e.jsx(hn,{message:b}):e.jsxs("div",{className:"mini-widget-content",children:[(a!==void 0||u||i)&&e.jsxs("div",{className:"mini-widget-value-row",children:[a!==void 0&&e.jsxs("div",{className:g,children:[typeof a=="number"?e.jsx(K,{value:a,className:"font-mono tabular-nums",priority:"medium",format:Number.isInteger(a)?void 0:{minimumFractionDigits:1,maximumFractionDigits:1}}):e.jsx($,{children:a}),s&&e.jsx("span",{className:"mini-widget-unit",children:s})]}),(u||i)&&e.jsxs("span",{className:"mini-widget-badge-group",children:[u&&!i&&e.jsx("span",{className:"data-box mini-widget-subtitle-box",children:u}),u&&i&&e.jsx("span",{className:"mini-widget-subtitle truncate",children:u}),i&&e.jsx("span",{className:"data-box mini-widget-subtitle-box",children:i})]})]}),l]})]})}const pn={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},tt={baselineMedian:null,baselineP10:null,baselineP90:null,currentMedian:null,currentSampleCount:0,delta:0,slope:0,jitter:0,penalty:0,penaltyReason:null,computedAt:0,isReliable:!1};function ye(t,n){if(t.length===0)return null;const a=[...t].sort((u,i)=>u-i),s=n/100*(a.length-1),o=Math.floor(s),r=Math.ceil(s);return o===r?a[o]:a[o]+(a[r]-a[o])*(s-o)}function Ae(t){return ye(t,50)}function gn(t){if(t.length<2)return 0;const n=t.reduce((o,r)=>o+r,0)/t.length,s=t.map(o=>Math.pow(o-n,2)).reduce((o,r)=>o+r,0)/t.length;return Math.sqrt(s)}function yn(t){if(t.length<2)return 0;const n=t.length;let a=0,s=0,o=0,r=0;const u=t[0].timestamp;for(const m of t){const l=(m.timestamp-u)/3600,d=m.value;a+=l,s+=d,o+=l*d,r+=l*l}const i=n*r-a*a;return Math.abs(i)<1e-4?0:(n*o-a*s)/i}function bn(t,n,a){const s=pn;return t>=s.DELTA_CRITICAL?[2,`Noise floor ${t.toFixed(1)} dB above baseline`]:n>=s.SLOPE_CRITICAL?[2,`Noise floor rising ${n.toFixed(1)} dB/hour`]:a>=s.JITTER_CRITICAL?[2,`Noise floor unstable (±${a.toFixed(1)} dB)`]:t>=s.DELTA_WARNING?[1,`Noise floor ${t.toFixed(1)} dB above baseline`]:n>=s.SLOPE_WARNING?[1,`Noise floor rising ${n.toFixed(1)} dB/hour`]:a>=s.JITTER_WARNING?[1,`Noise floor variable (±${a.toFixed(1)} dB)`]:[0,null]}function jn(t){if(t.length===0)return{...tt,computedAt:Math.floor(Date.now()/1e3)};const n=Math.floor(Date.now()/1e3),a=t.filter(N=>Number.isFinite(N)),s=t.length>0?[t[t.length-1]]:[],o=t.slice(-4).filter(N=>Number.isFinite(N)),r=Ae(a),u=ye(a,10),i=ye(a,90),m=Ae(s),l=m!==null&&u!==null?m-u:0,d=o.map((N,k)=>({timestamp:n-(o.length-1-k)*3600,value:N})),b=yn(d),c=gn(o),y=a.length>=12,[g,h]=y?bn(l,b,c):[0,null];return{baselineMedian:r,baselineP10:u,baselineP90:i,currentMedian:m,currentSampleCount:s.length,delta:l,slope:b,jitter:c,penalty:g,penaltyReason:h,computedAt:n,isReliable:y}}const Nn={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],noiseFloorWindowHistory:[],linkQuality:null,channelHealth:null,nfTrend:tt,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},st=x.createContext(Nn);function vn({children:t}){var P;const n=ie(),a=re(),s=Oe(),o=Bt(),r=J(),u=E[r],i=Math.max(1,u.minutes/60),m=n===null,[l,d]=x.useState(null),b=x.useCallback(async()=>{try{const D=await ze(Math.ceil(i));if(D.success&&D.data){d(D.data.history);return}const F=await Mt(Math.ceil(i));F.success&&F.data&&F.data.count>0&&d(null)}catch{}},[i]);x.useEffect(()=>{b();const D=setInterval(b,6e4);return()=>clearInterval(D)},[b]);const c=x.useMemo(()=>St(a,i,l),[a,i,l]),y=(n==null?void 0:n.noise_floor_dbm)??null,g=x.useMemo(()=>_t(y)?y:null,[y]),h=x.useMemo(()=>{var F;const D=(F=n==null?void 0:n.config)==null?void 0:F.radio;return D?{sf:D.spreading_factor??7,bwHz:D.bandwidth??125e3}:null},[(P=n==null?void 0:n.config)==null?void 0:P.radio]),N=Rt(i),k=Dt(i),w=n==null?void 0:n.neighbors,C=x.useMemo(()=>Object.fromEntries(Object.entries(w??{}).filter(([F])=>!o.has(F))),[w,o]),M=x.useMemo(()=>s.filter(D=>!o.has(D.hash)),[s,o]),_=x.useMemo(()=>jn(N),[N]),T=x.useMemo(()=>Pt(M,C,h),[M,C,h]),f=x.useMemo(()=>Ft(c,g,T),[c,g,T]),[B,j]=x.useState({noiseFloor:null,networkScore:null,channelHealth:null}),v=x.useRef(0);x.useEffect(()=>{const D=()=>{const W=Date.now();W-v.current>3e4&&(v.current=W,j({noiseFloor:g,networkScore:(T==null?void 0:T.networkScore)??null,channelHealth:(f==null?void 0:f.score)??null}))};D();const F=setInterval(D,5e3);return()=>clearInterval(F)},[g,T==null?void 0:T.networkScore,f==null?void 0:f.score]);const p=x.useMemo(()=>({noiseFloor:{current:g,previous:B.noiseFloor,trend:g!==null?de(g,B.noiseFloor,2,!0):"stable"},networkScore:{current:(T==null?void 0:T.networkScore)??0,previous:B.networkScore,trend:de((T==null?void 0:T.networkScore)??0,B.networkScore,3,!1)},channelHealth:{current:(f==null?void 0:f.score)??0,previous:B.channelHealth,trend:de((f==null?void 0:f.score)??0,B.channelHealth,3,!1)}}),[g,T==null?void 0:T.networkScore,f==null?void 0:f.score,B]),R={lbtStats:c,noiseFloor:g,sparklineNoiseFloor:N,noiseFloorWindowHistory:k,linkQuality:T,channelHealth:f,nfTrend:_,radioConfig:h,trends:p,stats:n,recentPackets:a,quickNeighbors:s,isLoading:m,error:null,refresh:async()=>{}};return e.jsx(st.Provider,{value:R,children:t})}function Z(){const t=x.useContext(st);if(t===void 0)throw new Error("useLBTData must be used within an LBTDataProvider");return t}function wn(t){return t<100?"excellent":t<250?"good":t<500?"fair":t<1e3?"congested":"critical"}function kn(t){return t===0?"No backoffs":"Retries"}function Cn(t,n){return t===0?void 0:`${n.toFixed(0)}%`}function Tn(){const{lbtStats:t,isLoading:n,error:a}=Z(),s=je(),o=(t==null?void 0:t.avgBackoffMs)??0,r=(t==null?void 0:t.retryRate)??0,u=t?wn(o):"unknown",i=t==null?void 0:t.sparklineBackoff,m=x.useMemo(()=>!i||i.length<2?[]:i.map((l,d)=>({timestamp:Date.now()-(i.length-1-d)*36e5,count:l})),[i]);return e.jsx(V,{title:"LBT Backoff",icon:e.jsx(Os,{className:"mini-widget-icon"}),value:Math.round(o),unit:"ms",status:u,subtitle:t?kn(o):void 0,subtitleValue:t?Cn(o,r):void 0,isLoading:n,error:a,onClick:()=>s("/packets"),children:e.jsx("div",{className:"mini-widget-sparkline w-full",children:e.jsx(Xe,{data:m,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function Bn(t){return t===0?"—":t<1?"<1":Math.round(t).toString()}function Mn(){const{lbtStats:t,isLoading:n,error:a}=Z(),s=je(),o=(t==null?void 0:t.channelBusyCount)??0,r=(t==null?void 0:t.totalPacketsWithLBT)??0,u=(t==null?void 0:t.channelBusyRate)??0,i=(t==null?void 0:t.retryRate)??0,m=(t==null?void 0:t.avgBackoffMs)??0,l=(t==null?void 0:t.crcErrorCount)??0,d=i>0?Math.max(0,(i-u)/i*100):100;return e.jsx(V,{title:"Ch. Busy",icon:e.jsx(ns,{className:"mini-widget-icon"}),isLoading:n,error:a,onClick:()=>s("/packets"),children:e.jsx("div",{className:"mini-widget-body-grid",children:e.jsxs("div",{className:"grid grid-cols-[auto_1fr] widget-4col gap-x-2 gap-y-1 w-full min-w-0 items-baseline",children:[e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`${o} packets exceeded max CAD attempts (5) out of ${r} total transmissions.`,children:"Failed"}),e.jsxs("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`${o} packets exceeded max CAD attempts (5) out of ${r} total transmissions.`,children:[e.jsx($,{children:o}),e.jsx("span",{className:"text-fg-muted punc-slash",children:"/"}),e.jsx($,{children:r})]}),e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`${d.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:"Sent"}),e.jsx("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`${d.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:e.jsxs($,{children:[d.toFixed(0),"%"]})}),e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`Average LBT backoff delay: ${m.toFixed(0)}ms.`,children:"Mean"}),e.jsxs("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`Average LBT backoff delay: ${m.toFixed(0)}ms.`,children:[e.jsx($,{children:Bn(m)}),e.jsx("span",{className:"text-fg-muted text-xs",children:"ms"})]}),e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`${l} packets failed hardware CRC check — corrupted by RF interference or collisions.`,children:"CRC"}),e.jsx("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`${l} packets failed hardware CRC check — corrupted by RF interference or collisions.`,children:e.jsx($,{children:l})})]})})})}function Sn(t){return t===null||t<-110?"excellent":t<-100?"good":t<-90?"fair":t<-80?"congested":"critical"}function _n(t){return t===null?"No reading":t<-115?"Very quiet":t<-105?"Quiet":t<-95?"Moderate":t<-85?"Elevated":"High interference"}function Rn(){const{noiseFloor:t,noiseFloorWindowHistory:n,trends:a,isLoading:s,error:o}=Z(),r=Sn(t),u=a==null?void 0:a.noiseFloor.trend,{timestamps:i,values:m}=x.useMemo(()=>!n||n.length<2?{timestamps:[],values:[]}:{timestamps:n.map(d=>d.timestamp),values:n.map(d=>d.noise_floor_dbm)},[n]),l=t!==null?Math.round(t):"—";return e.jsx(V,{title:"Noise Floor",icon:e.jsx(Bs,{className:"mini-widget-icon"}),value:l,unit:t!==null?"dBm":void 0,status:r,trend:u,subtitle:_n(t),isLoading:s,error:o,children:e.jsx("div",{className:"mini-widget-sparkline w-full",children:e.jsx(At,{timestamps:i,values:m,compact:!0,height:22})})})}const nt=[{target:"LinkLeaders",fn:"path",minStage:1,when:es},{target:"LinkLeaders",fn:"src_hash",minStage:1,when:ts}];q(nt);function Dn(){z(nt);const t=je(),n=Oe(),a=re(),s=ie(),o=J(),u=E[o].minutes*60,i=Lt(),m=x.useMemo(()=>{if(i===0)return a;const f=i-u;return a.filter(B=>B.timestamp>=f)},[a,u,i]),l=s===null,d=s!=null&&s.local_hash?Me(s.local_hash):"",b=(s==null?void 0:s.neighbors)??{},{neighborHashes:c,neighborNames:y}=x.useMemo(()=>{const f=new Set,B=new Map;for(const j of n){f.add(j.hash);const v=b[j.hash],p=(v==null?void 0:v.name)||(v==null?void 0:v.node_name)||j.prefix;B.set(j.hash,p)}return{neighborHashes:f,neighborNames:B}},[n,b]),g=x.useMemo(()=>{if(c.size===0||m.length===0||!d)return{champion:null,listener:null,loudest:null};const{scores:f}=fs(m,c,d),B=[];for(const[S,R]of f)R.blendedScore!==0&&B.push({...R,name:y.get(S)??Me(S)});let j=null,v=null,p=null;for(const S of B)(!j||S.blendedScore>j.blendedScore)&&(j=S),(!v||S.listenerScore>v.listenerScore)&&(v=S),(!p||S.loudScore>p.loudScore)&&(p=S);return{champion:j,listener:v,loudest:p}},[m,c,d,y]),h=f=>e.jsxs("div",{className:"max-w-[220px]",children:[e.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",f.name]}),e.jsxs("div",{className:"text-fg-muted mb-1",children:["Blended Score: ",f.blendedScore,e.jsx("span",{className:"text-fg-muted/60 ml-1",children:"(Listener + Loud)"})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 space-y-0.5",children:[e.jsxs("div",{children:["Listener: ",f.listenerScore,"/100 (",f.listenerCount," shared paths)"]}),e.jsxs("div",{children:["Loud: ",f.loudScore,"/100 (",f.loudCount," packets relayed)"]})]})]}),N=f=>e.jsxs("div",{className:"max-w-[220px]",children:[e.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",f.name]}),e.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",f.listenerScore,"/100"]}),e.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:e.jsxs("div",{children:[f.listenerCount," packets where they heard your transmissions"]})})]}),k=f=>e.jsxs("div",{className:"max-w-[220px]",children:[e.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",f.name]}),e.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",f.loudScore,"/100"]}),e.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:e.jsxs("div",{children:[f.loudCount," packets they relayed directly to you"]})})]}),{champion:w,listener:C,loudest:M}=g,T=w||C||M?e.jsxs("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:[w&&e.jsx(ue,{content:h(w),children:e.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[e.jsx(ls,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-map-neighbor-color flex-shrink-0"}),e.jsx("span",{className:"font-semibold text-map-neighbor-color font-mono truncate flex-1 min-w-0",children:w.name}),e.jsx("span",{className:"text-map-neighbor-color pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:w.blendedScore})]})}),C&&e.jsx(ue,{content:N(C),children:e.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[e.jsx(Rs,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:C.name}),e.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:C.listenerScore})]})}),M&&e.jsx(ue,{content:k(M),children:e.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[e.jsx(Ps,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:M.name}),e.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:M.loudScore})]})})]}):n.length===0?e.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No direct neighbors"}):e.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No routing data yet"});return e.jsx(V,{title:"Link Leaders",icon:e.jsx(Es,{className:"mini-widget-icon"}),isLoading:l,onClick:()=>t("/contacts"),children:T})}function Pn(t){const{retryRate:n,channelBusyCount:a,totalPacketsWithLBT:s,avgBackoffMs:o,maxBackoffMs:r,crcErrorCount:u,packetCount:i}=t;if(s===0&&u===0)return 0;const m=Math.min(s/10,1),l=.15,d=Math.log(1+n*l)/Math.log(1+100*l)*40,b=s>0?a/s*100:0,c=Math.min(b*.5,25);let y=0;o>100&&(y=Math.min(Math.log10(o/100)*8,15));let g=0;r>500&&o>0&&r>o*2&&(g=Math.min((r-500)/200,5));const h=(d+c+y+g)*m;let N=0;if(u>0){const k=i+u,w=u/k*100;N=Math.min(Math.log(1+w*.5)*10,15)}return Math.min(h+N,85)}function Fn(t){return t<15?"excellent":t<30?"good":t<45?"fair":t<60?"congested":"critical"}function An(t){return t<15?"Clear channel":t<30?"Light traffic":t<45?"Moderate traffic":t<60?"Heavy traffic":t<75?"Congested":"Severe congestion"}function Ln(){const{lbtStats:t,isLoading:n,error:a}=Z(),s=t?Pn(t):0,o=t?Fn(s):"unknown",r=(t==null?void 0:t.maxBackoffMs)??0,u=t?r>200?"Peak":An(s):void 0,i=t&&r>200?`${Math.round(r)}ms`:void 0,m=t==null?void 0:t.sparklineCollisionRisk,l=x.useMemo(()=>!m||m.length<2?[]:m.map((b,c)=>({timestamp:Date.now()-(m.length-1-c)*36e5,count:b})),[m]),d=Math.round(s*10)/10;return e.jsx(V,{title:"Collision Risk",icon:e.jsx(xs,{className:"mini-widget-icon"}),value:d,unit:"%",status:o,subtitle:u,subtitleValue:i,isLoading:n,error:a,children:e.jsx("div",{className:"mini-widget-sparkline w-full",children:e.jsx(Xe,{data:l,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function En(t){return t<30?"excellent":t<50?"good":t<70?"fair":t<90?"congested":"critical"}function Hn(t){return t<1e3?`${Math.round(t)}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${(t/6e4).toFixed(1)}m`}function $n(){var h,N;const[t,n]=x.useState(!1),[a]=x.useState(0),{stats:s,lbtStats:o,isLoading:r}=Z(),u=((N=(h=s==null?void 0:s.config)==null?void 0:h.duty_cycle)==null?void 0:N.enforcement_enabled)??!1,i=x.useMemo(()=>{if(!s)return null;if(!u){const _=s.airtime_used_ms??0,T=s.max_airtime_ms??1,f=T>0?_/T*100:0;return{usedMs:_,maxMs:T,remainingMs:Math.max(0,T-_),utilizationPercent:f}}const k=s.airtime_used_ms??0,w=s.max_airtime_ms??1,C=s.airtime_remaining_ms??0,M=s.utilization_percent??(w>0?k/w*100:0);return{usedMs:k,maxMs:w,remainingMs:C,utilizationPercent:M}},[s,u]),m=x.useMemo(()=>{if(!o||o.totalPacketsWithLBT===0)return 100;const k=o.totalPacketsWithLBT-o.packetsWithRetries,w=o.totalPacketsWithLBT;return k/w*100},[o]),l=(i==null?void 0:i.utilizationPercent)??0,d=En(l),b=(i==null?void 0:i.remainingMs)??0,c=m<95?"1st Try":"Remaining",y=m<95?`${m.toFixed(0)}%`:Hn(b),g=i?e.jsx("div",{className:"mini-widget-progress mt-auto",children:e.jsx("div",{className:`mini-widget-progress-bar ${d}`,style:{width:`${Math.min(l,100)}%`}})}):null;return e.jsx(V,{title:"Duty Cycle",icon:e.jsx(Ie,{className:"mini-widget-icon"}),value:l.toFixed(1),unit:"%",status:d,subtitle:c,subtitleValue:y,isLoading:r,children:g})}function In(){return e.jsxs("div",{className:"mini-widget",children:[e.jsxs("div",{className:"mini-widget-header",children:[e.jsx(ee,{className:"w-4 h-4"}),e.jsx(ee,{className:"h-3 w-16"})]}),e.jsx(ee,{className:"h-7 w-12 mt-2"}),e.jsx(ee,{className:"h-3 w-20 mt-2"})]})}function On(){return e.jsx("div",{className:"widget-row",children:Array.from({length:6}).map((t,n)=>e.jsx(In,{},n))})}const at=[{target:"MeshHealth",fn:"type",minStage:1}];q(at);function zn({className:t="",isLoaded:n}){z(at);const a=qe(),s=n??a??!0;return e.jsxs("div",{className:`mesh-health-container relative ${t}`,children:[e.jsxs("div",{className:"mesh-health-header",children:[e.jsx(Et,{className:"w-4 h-4 text-sys-blue"}),e.jsx("span",{className:"type-label text-fg-muted",children:"MESH HEALTH"})]}),s?e.jsx(vn,{children:e.jsxs("div",{className:"widget-row",children:[e.jsx(Tn,{}),e.jsx(Ln,{}),e.jsx(Rn,{}),e.jsx($n,{}),e.jsx(Mn,{}),e.jsx(Dn,{})]})}):e.jsx(On,{})]})}const ot=[{target:"PublicChannel",fn:"decrypt",minStage:2,when:ss}];q(ot);let rt="",it="",Le="";function qn(){const t=new Date,n=t.toDateString();if(n!==Le){Le=n,rt=n;const a=new Date(t);a.setDate(a.getDate()-1),it=a.toDateString()}}function Wn(t){qn();const n=new Date(t*1e3).toDateString();return n===rt?"Today":n===it?"Yesterday":new Date(t*1e3).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"})}function Un(t,n,a){return`${t||""}|${n}|${a}`}function Vn(t,n){const a=t.message,s=n.message;return a.timestamp===s.timestamp&&a.text===s.text&&a.senderName===s.senderName&&a.channelHash===s.channelHash&&a.channelName===s.channelName&&t.isChannelSelected===n.isChannelSelected&&t.onChannelClick===n.onChannelClick}const Gn=x.memo(function({message:n,onChannelClick:a,isChannelSelected:s}){const o=n.channelName||n.channelHash.slice(0,6);return e.jsx("div",{style:{transform:"translateZ(0)",willChange:"transform"},children:e.jsx(bs,{senderName:n.senderName||"Unknown",text:n.text,timestamp:n.timestamp,nameAccessory:e.jsx(Ve,{channelName:o,active:s,onClick:()=>a==null?void 0:a(n.channelHash)})})})},Vn);function Xn({open:t,onClose:n,messages:a,onLoadMore:s,hasMoreToLoad:o,isDecoding:r,initialChannel:u}){const i=x.useRef(null),m=x.useRef(!0),l=J(),d=We(),b=x.useRef(!1);x.useEffect(()=>{t?(b.current=!0,_e.resume()):b.current&&_e.pause()},[t]);const c=x.useMemo(()=>{const p=Date.now()/1e3,S=E[l].minutes,R=p-S*60;return[...a].filter(P=>P.timestamp>=R).sort((P,D)=>P.timestamp-D.timestamp)},[a,l]),y=x.useCallback(()=>{const p=i.current;p&&(m.current=p.scrollTop>=-50)},[]),g=x.useMemo(()=>{const p=new Map;for(const S of c){const R=S.channelHash,P=p.get(R);P?P.count++:p.set(R,{name:S.channelName||S.channelHash.slice(0,6),hash:S.channelHash,count:1})}return Array.from(p.values()).sort((S,R)=>R.count-S.count)},[c]),h=g.length,[N,k]=x.useState(null),[w,C]=x.useState(!1);x.useEffect(()=>{t&&u&&k(u)},[t,u]);const M=x.useCallback(()=>{s(N,g)},[s,N,g]),_=x.useMemo(()=>N?c.filter(p=>p.channelHash===N):c,[c,N]),T=x.useMemo(()=>{const p=[];let S="";for(const R of _){const P=Wn(R.timestamp);P!==S&&(p.push({type:"date",date:P}),S=P),p.push({type:"message",message:R})}return p},[_]);x.useLayoutEffect(()=>{const p=i.current;p&&m.current&&(p.scrollTop=0)},[_.length]);const f=19,B=g.slice(0,f),j=g.slice(f),v=j.length>0;return e.jsx(qt,{open:t,onClose:n,size:"lg",motionPlus:!0,solid:!0,children:e.jsxs(Wt,{className:"p-0 flex flex-col h-[80vh] max-h-[700px] rounded-2xl",children:[e.jsx("div",{className:"flex-shrink-0 px-4 sm:px-5 py-3 sm:py-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ye,{className:"size-5 text-icon-card-title flex-shrink-0"}),e.jsx("h2",{className:"type-micro",children:"Public Channels"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{ranges:E,selectedIndex:l,onSelect:d,size:"sm"}),e.jsx("button",{onClick:n,className:"sm:hidden min-h-[44px] min-w-[44px] px-3 flex items-center justify-center text-[15px] font-medium text-sys-blue active:text-sys-blue/70 transition-base radius-inner active:bg-subtle-fill",children:"Done"}),e.jsx("button",{onClick:n,className:"hidden sm:flex items-center justify-center p-2 text-fg-muted hover:text-fg-primary transition-base radius-inner hover:bg-subtle","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})}),e.jsx("div",{className:"flex-shrink-0 px-3 pb-2 relative z-10 isolate",style:{minHeight:h>0?void 0:0},children:h>0&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("button",{onClick:()=>k(null),className:L("px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",N===null?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:["All ",h]}),B.map(p=>e.jsx("button",{onClick:()=>k(p.hash),className:L("flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",N===p.hash?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:e.jsx("span",{className:"truncate max-w-[80px]",children:p.name})},p.hash)),v&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>C(!w),className:L("flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",w||j.some(p=>p.hash===N)?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:["+",j.length,e.jsx(Ut,{className:L("size-3 transition-transform",w&&"rotate-180")})]}),w&&e.jsx("div",{className:L("absolute top-full left-0 mt-1 z-50","min-w-[140px] max-h-[200px] overflow-y-auto","p-1 rounded-lg","bg-elevated backdrop-blur-xl","ring-1 ring-edge-subtle shadow-xl"),children:j.map(p=>e.jsxs("button",{onClick:()=>{k(p.hash),C(!1)},className:L("w-full flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-all text-left",N===p.hash?"bg-sys-blue/20 text-sys-blue":"text-fg-secondary hover:bg-subtle-fill-strong"),children:[e.jsx(js,{className:"size-2.5 opacity-60 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:p.name}),e.jsxs("span",{className:"opacity-60 ml-auto",children:["(",p.count,")"]})]},p.hash))})]})]})}),e.jsx("div",{ref:i,onScroll:y,className:L("flex-1 overflow-y-auto overflow-x-hidden","mx-3 mb-3 rounded-md","bg-body","ring-1 ring-inset ring-edge-subtle","flex flex-col-reverse"),children:r&&_.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[300px] text-fg-muted px-4 py-4",children:[e.jsx(oe,{className:"size-12 mb-4 text-sys-indigo animate-spin"}),e.jsx("p",{className:"text-lg font-medium",children:"Loading messages..."})]}):_.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[300px] text-fg-muted px-4 py-4",children:[e.jsx(Ns,{className:"size-16 mb-4 opacity-20"}),e.jsx("p",{className:"text-lg font-medium",children:"No messages yet"}),e.jsx("p",{className:"text-sm mt-1 opacity-70",children:N?"No messages in this channel":"Public channel messages will appear here"})]}):e.jsxs("div",{className:"px-4 py-4",children:[o&&e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("button",{onClick:M,disabled:r,className:L("px-4 py-1.5 rounded-full","text-[11px] font-medium","ring-1 ring-inset",r?"bg-subtle-fill text-fg-muted ring-edge-subtle cursor-wait":"bg-sys-blue/10 text-sys-blue ring-sys-blue/20 hover:bg-sys-blue/20 hover:ring-sys-blue/30"),children:r?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(oe,{className:"size-3 animate-spin"}),"Loading..."]}):"Load older messages"})}),T.map((p,S)=>{if(p.type==="date")return e.jsx("div",{className:"flex justify-center my-4",children:e.jsx("span",{className:L("px-3.5 py-1.5 rounded-full","bg-subtle-fill backdrop-blur-sm","text-[11px] text-fg-muted/80 font-medium","ring-1 ring-edge-subtle"),children:p.date})},`date-${p.date}-${S}`);const R=`msg-${p.message.timestamp}-${p.message.senderName||"anon"}-${p.message.channelHash}`;return e.jsx("div",{className:"mb-3",children:e.jsx(Gn,{message:p.message,onChannelClick:k,isChannelSelected:N===p.message.channelHash})},R)})]})}),e.jsx("div",{className:"flex-shrink-0 px-5 py-2 text-center",children:e.jsxs("p",{className:"text-[11px] text-fg-muted",children:[_.length," messages · ",h," ",h===1?"channel":"channels",r&&e.jsxs("span",{className:"ml-2 text-sys-indigo",children:[e.jsx(oe,{className:"inline size-3 animate-spin mr-1"}),"Decrypting..."]})]})})]})})}function Yn(t){const n=[],a=new Set;for(const s of t.values()){const o=s.decoded;if(!o||!o.decrypted||o.macCorrupted||!o.text)continue;const r=Un(o.senderName,o.channelHash,o.text);a.has(r)||(a.add(r),n.push({timestamp:s.timestamp,channelName:o.channelName,channelHash:o.channelHash,senderName:o.senderName,text:o.text,rssi:s.rssi,snr:s.snr}))}return n}function Kn({isLoaded:t}){const n=qe(),a=t??n??!0;z(ot);const s=re(),[o,r]=x.useState(!1),[u,i]=x.useState(null),m=J(),l=x.useCallback(()=>{i(null),r(!0),te.getState().queueDecryption(s)},[s]),d=ge(B=>B.requestedHash),b=ge(B=>B.clearRequest);x.useEffect(()=>{d&&(i(d),r(!0),te.getState().queueDecryption(s),b())},[d,b,s]);const c=Ht(),y=$t(),g=It(),h=x.useMemo(()=>Yn(c),[c]),N=x.useMemo(()=>{const B=Date.now()/1e3,j=E[m].minutes,v=B-j*60;return h.filter(p=>p.timestamp>=v)},[h,m]),k=x.useMemo(()=>N.length===0?null:N.reduce((B,j)=>j.timestamp>B.timestamp?j:B),[N]),w=y.isDecoding,M=x.useMemo(()=>{const B=Date.now()/1e3,j=E[m].minutes,v=B-j*60,p=new Set;let S=0;for(const R of s)(R.type??R.payload_type)===Se.GRP_TXT&&((R.timestamp??0){const B=Date.now()/1e3,j=E[m].minutes,v=B-j*60;for(const p of s)if((p.type??p.payload_type)===Se.GRP_TXT&&!((p.timestamp??0){if(!w){if(B){const v=j.find(p=>p.hash===B);if(v){console.log(`[PublicChannelCard] Fast-path load for #${v.name}`),te.getState().queueChannelDecryption(s,v.name);return}}te.getState().queueDecryption(s)}},[s,w]);return a?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:l,className:L("group cursor-pointer rounded-2xl transition-all duration-150","bg-surface/80 backdrop-blur-lg depth-raised","hover:bg-subtle-fill","px-3 py-2.5 sm:px-4 sm:py-3"),children:e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-shrink-0",children:[e.jsx(Ye,{className:"size-4 text-icon-card-title flex-shrink-0"}),e.jsx("span",{className:"type-micro",children:"CHAT ACTIVITY"}),M>0&&e.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-md bg-subtle-fill ring-1 ring-inset ring-edge-subtle text-sm tabular-nums text-fg-secondary",children:M}),e.jsx(Pe,{className:"size-4 text-fg-muted group-hover:text-sys-indigo transition-colors ml-auto sm:hidden"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-1.5 min-w-0 overflow-hidden",children:[e.jsx(He,{mode:"wait",initial:!1,children:k?e.jsxs(ae.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.2,ease:[.4,0,.2,1]},className:"flex items-center gap-2 sm:gap-1.5 min-w-0",children:[k.channelName&&e.jsx("span",{className:"hidden sm:inline-flex",children:e.jsx(Ve,{channelName:k.channelName})}),e.jsx("div",{className:"hidden sm:flex w-[30px] h-[30px] rounded-full items-center justify-center flex-shrink-0 ring-1 ring-edge-subtle",style:{backgroundColor:ps(fe(k.senderName||"").cleanName)},children:fe(k.senderName||"").emoji?e.jsx("span",{className:"text-base",children:fe(k.senderName||"").emoji}):e.jsx("span",{className:"text-white text-xs font-bold tracking-tighter",children:gs(k.senderName||"")})}),e.jsx("div",{className:"inline-flex items-center px-3 py-1.5 rounded-2xl rounded-tr-md bg-[#007AFF] shadow-sm min-w-0 flex-1 sm:flex-initial sm:max-w-xs sm:-ml-px",children:e.jsx("span",{className:"text-sm text-white truncate tracking-wide",children:ys(k.text)})}),e.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-md bg-subtle-fill ring-1 ring-inset ring-edge-subtle text-sm tabular-nums text-fg-secondary flex-shrink-0",children:zt(k.timestamp)})]},`msg-${k.timestamp}-${k.senderName}-${k.channelHash}`):g?e.jsx(ae.span,{initial:{opacity:0},animate:{opacity:1},className:"text-sm text-fg-muted italic",children:"No messages yet"},"empty"):e.jsxs(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,y:-16},transition:{duration:.15},className:"flex items-center gap-2 sm:gap-1.5",children:[e.jsx("div",{className:"hidden sm:block w-8 h-4 rounded bg-subtle-fill-strong animate-pulse"}),e.jsx("div",{className:"hidden sm:block w-[30px] h-[30px] rounded-full bg-subtle-fill-strong animate-pulse"}),e.jsx("div",{className:"h-8 w-32 sm:w-48 rounded-2xl bg-subtle-fill-strong animate-pulse"}),e.jsx("div",{className:"w-12 h-6 rounded-md bg-subtle-fill-strong animate-pulse"})]},"skeleton")}),e.jsx(Pe,{className:"size-4 text-fg-muted group-hover:text-sys-indigo transition-colors flex-shrink-0 hidden sm:block ml-1"})]})]})}),e.jsx(Xn,{open:o,onClose:()=>r(!1),messages:h,onLoadMore:f,hasMoreToLoad:T,isDecoding:w,initialChannel:u})]}):e.jsx("div",{className:"h-14 rounded-xl bg-elevated/50 animate-pulse"})}function Da(){var B;const t=ie(),n=Vt(),a=Gt(),s=Xs(),o=x.useRef(!1);a&&!o.current&&(o.current=!0);const r=o.current,u=J(),i=We(),m=Xt(),l=E[u]??E[4],d=m.isBackgroundLoading&&u>=5,[b,c]=x.useState([]),[y,g]=x.useState(0),[h,N]=x.useState(()=>localStorage.getItem("rx-crc-overlay")==="true"),k=x.useCallback(()=>{N(j=>{const v=!j;return localStorage.setItem("rx-crc-overlay",String(v)),v})},[]);x.useEffect(()=>{const j=l.minutes/60;ze(j).then(v=>{v.success&&v.data?(c(v.data.history),g(v.data.count)):(c([]),g(0))})},[l.minutes]);const w=x.useMemo(()=>{const j=G=>(G==null?void 0:G.reduce((ce,Q)=>ce+Q.count,0))??0,v=j(s==null?void 0:s.received),p=j(s==null?void 0:s.unique_received),S=j(s==null?void 0:s.forwarded),R=j(s==null?void 0:s.dropped),P=j(s==null?void 0:s.transmitted),D=((s==null?void 0:s.time_range_minutes)??l.minutes)/60,F=D>0?Math.round(v/D):0,W=D>0?Math.round(S/D):0;return{received:v,uniqueReceived:p,forwarded:S,dropped:R,transmitted:P,rxPerHour:F,fwdPerHour:W}},[s,l.minutes]),C=x.useMemo(()=>s?{totalBytes:s.totalReceivedBytes,kbPerHour:s.kbPerHour}:{totalBytes:0,kbPerHour:0},[s]),M=x.useMemo(()=>{if(!s)return[];const{receivedBytesBuckets:j,start_time:v,bucket_duration_seconds:p,bucket_count:S}=s,R=new Array(S).fill(0);for(const P of b){const D=Math.floor((P.timestamp-v)/p);D>=0&&D({start:P.start,end:P.end,bytesByType:{...P.countByType,...h&&R[D]>0?{[me]:R[D]}:{}},totalBytes:P.totalCount}))},[s,b,h]),_=x.useMemo(()=>{if(!s)return[];const{receivedCountByType:j}=s,v=Object.keys(j).map(p=>parseInt(p,10)).filter(p=>(j[p]??0)>0).sort((p,S)=>(j[S]??0)-(j[p]??0));return h&&y>0&&v.unshift(me),v},[s,y,h]),T=x.useMemo(()=>{if(!s)return{};const j={...s.receivedCountByType??{}};return h&&y>0&&(j[me]=y),j},[s,y,h]),f=(t==null?void 0:t.node_name)??((B=t==null?void 0:t.config)==null?void 0:B.node_name)??"Unknown Node";return x.useEffect(()=>{f&&f!=="Unknown Node"&&(document.title=`pyMC: ${f}`)},[f]),n?e.jsxs(Re,{neomorphic:!0,className:"p-8 text-center",children:[e.jsx("p",{className:"type-subheading text-sys-red mb-2",children:"Failed to connect to backend"}),e.jsx("p",{className:"type-body text-fg-muted",children:n}),e.jsx("p",{className:"type-data-sm text-fg-muted mt-4",children:"Make sure the backend is running on port 8000"})]}):e.jsxs(Kt,{children:[e.jsx(Jt,{title:f,icon:e.jsx(vs,{}),subtitle:e.jsx(ms,{}),controls:e.jsx(Ge,{ranges:E,selectedIndex:u,onSelect:i,isPending:d})}),e.jsxs(Zt,{ready:r,children:[e.jsx(Kn,{}),e.jsx(xe,{template:"hero-auto",children:e.jsxs(Re,{neomorphic:!0,children:[e.jsx($e,{icon:e.jsx(Ss,{}),title:"PACKETS RECEIVED",badge:l.label,badgeColor:"zinc",actions:r?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:k,className:"p-1 rounded hover:bg-zinc-500/20 active:bg-zinc-500/30 transition-colors touch-manipulation",title:h?"Hide CRC Errors":"Show CRC Errors","aria-label":h?"Hide CRC error overlay":"Show CRC error overlay","aria-pressed":h,children:e.jsx(Yt,{className:`w-3.5 h-3.5 transition-colors ${h?"text-sys-red":"text-fg-muted"}`})}),e.jsxs("div",{className:"data-box",children:[C.kbPerHour," KB/hr"]})]}):e.jsx("div",{className:"data-box opacity-0",children:"0 KB/hr"})}),e.jsxs("div",{className:"flex flex-wrap gap-4 sm:gap-8",children:[e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("div",{className:"type-data-xl text-fg-primary",children:r?e.jsx(K,{value:w.received,className:"font-mono tabular-nums",priority:"high"}):e.jsx("span",{className:"opacity-30",children:"—"})}),e.jsx(Y,{color:"zinc",className:"mb-0.5 sm:mb-1",children:"Total Rx"})]}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("div",{className:"type-data-xl text-fg-primary",children:r?e.jsx(K,{value:w.uniqueReceived,className:"font-mono tabular-nums",priority:"high"}):e.jsx("span",{className:"opacity-30",children:"—"})}),e.jsx(Y,{color:"zinc",className:"mb-0.5 sm:mb-1",children:"Unique"})]})]}),e.jsxs("div",{className:"mt-2 flex-1 min-h-0 relative",children:[e.jsx("div",{className:`absolute inset-0 flex items-end gap-1 transition-opacity duration-300 ${r?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":r,children:[45,72,33,58,80,42,65,28,55,75,38,62].map((j,v)=>e.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${j}%`}},v))}),e.jsx("div",{className:`h-full transition-opacity duration-300 ${r?"opacity-100":"opacity-0"}`,children:e.jsx(Js,{buckets:M,activeTypes:_,totalByType:T,mode:"count"})})]})]})}),e.jsxs(xe,{template:"compact",children:[e.jsx(he,{span:6,lg:4,children:e.jsx(tn,{value:w.forwarded,receivedCount:w.received,buckets:(s==null?void 0:s.forwardedBytesBuckets)??[],activeTypes:(s==null?void 0:s.forwardedActiveTypes)??[],ratePerHour:(s==null?void 0:s.forwardedRatePerHour)??0,timeRangeLabel:l.label,icon:e.jsx(Cs,{className:"w-4 h-4"})})}),e.jsx(he,{span:6,lg:4,children:e.jsx(sn,{value:w.dropped,crcCount:y,receivedCount:w.received,buckets:(s==null?void 0:s.droppedBytesBuckets)??[],activeTypes:(s==null?void 0:s.droppedActiveTypes)??[],ratePerHour:(s==null?void 0:s.droppedRatePerHour)??0,timeRangeLabel:l.label,icon:e.jsx(ws,{className:"w-4 h-4"})})}),e.jsx(he,{span:12,lg:4,children:e.jsx(ln,{stats:t,localHash:t==null?void 0:t.local_hash,receivedBuckets:s==null?void 0:s.received,droppedBuckets:s==null?void 0:s.dropped,forwardedBuckets:s==null?void 0:s.forwarded,bucketDurationSeconds:s==null?void 0:s.bucket_duration_seconds,timeRangeLabel:l.label})})]}),e.jsx(zn,{}),e.jsx(un,{}),t&&e.jsx(xe,{template:"auto",children:e.jsx(hs,{nodeName:f,repeaterVersion:t.version,coreVersion:t.core_version,localHash:t.local_hash,publicKey:t.public_key})})]})]})}export{Da as default}; + */const Is=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Os=H("timer",Is),O=lt(()=>({result:null,isComputing:!1})),zs=500,qs=300;let U=null,ne=null;function Ws(t){var a;const n=(a=t==null?void 0:t.config)==null?void 0:a.radio;return`${(n==null?void 0:n.spreading_factor)??7}:${(n==null?void 0:n.bandwidth)??125e3}:${(n==null?void 0:n.coding_rate)??5}:${(n==null?void 0:n.preamble_length)??8}`}function Us(){if(U)return U;if(typeof window>"u")return null;try{U=new Worker(new URL("/assets/dashboard-bucketing.worker-BwrZMAuc.js",import.meta.url),{type:"module"}),U.onmessage=t=>{if(t.data.type==="error"){console.error("[DashboardBucketing] Worker error:",t.data.error),O.setState({isComputing:!1});return}O.setState({result:t.data.payload,isComputing:!1})},U.onerror=t=>{console.error("[DashboardBucketing] Worker error:",t),O.setState({isComputing:!1})}}catch(t){console.error("[DashboardBucketing] Failed to init worker:",t)}return U}function Vs(t,n,a,s){const o=Us();if(!o)return;const r=t.length,u=new Float64Array(r),l=new Float64Array(r),m=new Uint16Array(r),c=new Uint8Array(r),d=new Uint8Array(r),y=new Uint8Array(r),i=new Uint8Array(r),g=new Float32Array(r),b=new Float32Array(r),x=new Uint32Array(r),j=new Map;let k=0;for(let C=0;CparseInt(n,10)).filter(n=>t[n]>0).sort((n,a)=>t[a]-t[n])}function Gs(t,n,a){const s={...t,received:[...t.received],unique_received:[...t.unique_received],transmitted:[...t.transmitted],forwarded:[...t.forwarded],dropped:[...t.dropped],receivedBytesBuckets:t.receivedBytesBuckets.map(d=>({...d,bytesByType:{...d.bytesByType},countByType:{...d.countByType}})),forwardedBytesBuckets:t.forwardedBytesBuckets.map(d=>({...d,bytesByType:{...d.bytesByType},countByType:{...d.countByType}})),droppedBytesBuckets:t.droppedBytesBuckets.map(d=>({...d,bytesByType:{...d.bytesByType},countByType:{...d.countByType}})),receivedTotalByType:{...t.receivedTotalByType},receivedCountByType:{...t.receivedCountByType},forwardedTotalByType:{...t.forwardedTotalByType},droppedTotalByType:{...t.droppedTotalByType}},{start_time:o,end_time:r,bucket_duration_seconds:u,bucket_count:l}=t,m=new Set;for(const d of n){const y=d.timestamp??0;if(yr)continue;const i=Math.floor((y-o)/u);if(i<0||i>=l)continue;m.has(i)||(m.add(i),s.received[i]={...s.received[i]},s.unique_received[i]={...s.unique_received[i]},s.transmitted[i]={...s.transmitted[i]},s.forwarded[i]={...s.forwarded[i]},s.dropped[i]={...s.dropped[i]});const g=Ee(d,a),b=d.length??d.payload_length??0,x=d.type??d.payload_type??0,j=d.packet_origin;j==="tx_local"?(s.transmitted[i].count++,s.transmitted[i].airtime_ms+=g):j==="tx_forward"||d.transmitted?(s.forwarded[i].count++,s.forwarded[i].airtime_ms+=g,s.forwardedBytesBuckets[i].bytesByType[x]=(s.forwardedBytesBuckets[i].bytesByType[x]??0)+b,s.forwardedBytesBuckets[i].totalBytes+=b,s.forwardedBytesBuckets[i].countByType[x]=(s.forwardedBytesBuckets[i].countByType[x]??0)+1,s.forwardedBytesBuckets[i].totalCount++,s.forwardedTotalByType[x]=(s.forwardedTotalByType[x]??0)+b,s.totalForwardedCount++):d.drop_reason&&(s.dropped[i].count++,s.dropped[i].airtime_ms+=g,s.droppedBytesBuckets[i].bytesByType[x]=(s.droppedBytesBuckets[i].bytesByType[x]??0)+b,s.droppedBytesBuckets[i].totalBytes+=b,s.droppedBytesBuckets[i].countByType[x]=(s.droppedBytesBuckets[i].countByType[x]??0)+1,s.droppedBytesBuckets[i].totalCount++,s.droppedTotalByType[x]=(s.droppedTotalByType[x]??0)+b,s.totalDroppedCount++),j!=="tx_local"&&(s.received[i].count++,s.received[i].airtime_ms+=g,s.unique_received[i].count++,s.unique_received[i].airtime_ms+=g,s.receivedBytesBuckets[i].bytesByType[x]=(s.receivedBytesBuckets[i].bytesByType[x]??0)+b,s.receivedBytesBuckets[i].totalBytes+=b,s.receivedBytesBuckets[i].countByType[x]=(s.receivedBytesBuckets[i].countByType[x]??0)+1,s.receivedBytesBuckets[i].totalCount++,s.receivedTotalByType[x]=(s.receivedTotalByType[x]??0)+b,s.receivedCountByType[x]=(s.receivedCountByType[x]??0)+1,s.totalReceivedBytes+=b)}const c=s.time_range_minutes/60;return s.kbPerHour=c>0?Math.round(s.totalReceivedBytes/1024/c):0,s.forwardedRatePerHour=c>0?Math.round(s.totalForwardedCount/c):0,s.droppedRatePerHour=c>0?Math.round(s.totalDroppedCount/c):0,s.receivedActiveTypes=pe(s.receivedTotalByType),s.forwardedActiveTypes=pe(s.forwardedTotalByType),s.droppedActiveTypes=pe(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([ke(()=>import("./index-WhzslczH.js").then(t=>t.fJ),__vite__mapDeps([0,1])),ke(()=>import("./index-WhzslczH.js").then(t=>t.fI),__vite__mapDeps([0,1]))]).then(([t,n])=>{const{DASHBOARD_TIME_RANGES:a}=n;let s=0,o=-1,r="";t.useStore.subscribe(u=>{const l=u.packets.length,m=u.globalTimeRangeIndex,c=Ws(u.stats);if(l===s&&m===o&&c===r)return;const d=s,y=o,i=r;if(s=l,o=m,r=c,l===0)return;const g=a[m]??a[4],b=g.minutes,x=g.buckets,j=u.stats,k=Ce(j),w=l-d,C=m!==y,T=c!==i,S=O.getState().result;if(!C&&!T&&w>0&&w{ne=null;const f=t.useStore.getState();if(f.packets.length===0||!f.stats)return;const M=a[f.globalTimeRangeIndex]??a[4],N=Ce(f.stats);Vs(f.packets,M.minutes,M.buckets,N)},qs)})});const Xs=()=>O(t=>t.result),Ke=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:Qt}];q(Ke);function Ys(t){const a=new Date(t*1e3).getHours();return a>=6&&a<18}function Ks(t){return new Date(t*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function Js({buckets:t,activeTypes:n,totalByType:a,mode:s="bytes"}){z(Ke);const o=dt(),[r,u]=h.useState(null),[l,m]=h.useState(null),[c,d]=h.useState(null),y=h.useCallback((k,w,C)=>{u(w),m(C)},[]),i=t.length>0&&n.length>0,g=r?Ys(r.start):null,b=r?Ks(r.start):"",x=c!==null&&g!==null&&c!==g;g!==c&&d(g);const j=48;return e.jsxs("div",{className:"flex flex-col h-full relative",children:[e.jsx("div",{className:"h-5 relative mb-1 shrink-0",children:r&&l!==null&&e.jsxs("div",{className:"absolute flex items-center gap-1.5 type-data-sm -translate-x-1/2",style:{left:`calc(${j}px + ${l*100}% * (1 - ${j}px / 100%))`},children:[e.jsx(He,{mode:"wait",children:e.jsx(ae.span,{initial:x?{opacity:0,scale:.5,rotate:-90}:!1,animate:{opacity:1,scale:1,rotate:0},exit:{opacity:0,scale:.5,rotate:90},transition:{duration:.25,ease:"easeOut"},children:g?e.jsx(ut,{className:"w-4 h-4 text-sys-amber"}):e.jsx(mt,{className:"w-4 h-4 text-sys-blue"})},g?"sun":"moon")}),e.jsx("span",{className:"text-fg-secondary",children:b})]})}),e.jsx("div",{className:"flex-1 min-h-0",children:i&&e.jsx(ft,{buckets:t,activeTypes:n,gridColor:o.grid,axisTickColor:o.axisTick,onHover:y,yAxisFormat:s})}),e.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:i&&e.jsx(ht,{activeTypes:n,totalByType:a,formatMode:s})})]})}function Zs(t,n,a){var r,u;if(t.length<=a)return t;const s=t.length/a,o=[];for(let l=0;l0&&(y.bytesByType[g]=(y.bytesByType[g]??0)+b)}}o.push(y)}return o}function Qs(t,n,a,s,o,r,u){if(n.length===0)return;const l=Zs(n,a,gt.statsCard),m=l.length,c=r/m,d=l.map(i=>i.totalBytes),y=Math.max(...d);if(y!==0){for(let i=0;i{const m=t.map(d=>d.start),c=t.map(()=>1);return[m,c]},[u]);return h.useEffect(()=>{if(!a.current||u===0)return;const m=a.current;let c=null;const d=xt(()=>{const y=m.getBoundingClientRect(),i=Math.floor(y.width)||200,g=Math.floor(y.height)||60,b={width:i,height:g,padding:[0,0,0,0],cursor:{show:!1},scales:{x:{time:!1},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],legend:{show:!1},hooks:{draw:[j=>{const k=j.ctx,{left:w,top:C,width:T,height:S}=j.bbox;Qs(k,o.current,r.current,w,C,T,S)}]}},x=new pt(b,l,m);s.current=x,c=new ResizeObserver(()=>{const j=m.getBoundingClientRect();j.width>0&&j.height>0&&s.current&&s.current.setSize({width:Math.floor(j.width),height:Math.floor(j.height)})}),c.observe(m)});return()=>{var y;d(),c==null||c.disconnect(),(y=s.current)==null||y.destroy(),s.current=null}},[u]),h.useEffect(()=>{s.current&&s.current.redraw()},[t,n]),t.length===0?e.jsx("div",{className:"h-full flex items-center justify-center",children:e.jsx("div",{className:"w-full h-0.5 rounded-full bg-fg-muted/15"})}):e.jsx("div",{ref:a,className:"w-full h-full"})}const Je=h.memo(en),Ze=[{target:"ForwardedCard",fn:"type",minStage:1}];q(Ze);function tn({value:t,receivedCount:n,buckets:a,activeTypes:s,ratePerHour:o,timeRangeLabel:r,icon:u,isLoaded:l=!0}){z(Ze);const m=n>0?(t/n*100).toFixed(1):null;return l?e.jsxs(I,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3",children:[u&&e.jsx("span",{className:"icon-sm text-icon-card-title",children:u}),e.jsx("span",{className:"type-micro",children:"FORWARDED"}),r&&e.jsx(Y,{color:"zinc",className:"hidden sm:inline-flex",children:r})]}),e.jsx("div",{className:"type-data-xl text-fg-primary",children:e.jsx(K,{value:t,className:"font-mono tabular-nums",priority:"high"})}),e.jsx("div",{className:"flex-1 mt-1 overflow-hidden min-h-[40px] sm:min-h-[60px]",children:s.length>0?e.jsx(Je,{buckets:a,activeTypes:s}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"w-full h-0.5 rounded-full bg-fg-muted/15"})})}),e.jsx("div",{className:"pt-1.5 sm:pt-2 mt-1",children:e.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Rate"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[o,"/hr"]})]}),m!==null&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Ratio"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[m,"%"]})]})]})})]}):e.jsx(I,{children:e.jsx(be,{})})}const Qe=[{target:"DroppedCard",fn:"type",minStage:1}];q(Qe);function sn({value:t,crcCount:n=0,receivedCount:a,buckets:s,activeTypes:o,ratePerHour:r,timeRangeLabel:u,icon:l,isLoaded:m=!0}){z(Qe);const c=t+n,d=a>0?(c/a*100).toFixed(1):null;return m?e.jsxs(I,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3",children:[l&&e.jsx("span",{className:"icon-sm text-icon-card-title",children:l}),e.jsx("span",{className:"type-micro",children:"DROPPED"}),u&&e.jsx(Y,{color:"zinc",className:"hidden sm:inline-flex",children:u})]}),e.jsx("div",{className:"type-data-xl text-fg-primary",children:e.jsx(K,{value:c,className:"font-mono tabular-nums",priority:"high"})}),e.jsx("div",{className:"flex-1 mt-1 overflow-hidden min-h-[40px] sm:min-h-[60px]",children:o.length>0?e.jsx(Je,{buckets:s,activeTypes:o}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx("div",{className:"w-full h-0.5 rounded-full bg-fg-muted/15"})})}),e.jsx("div",{className:"pt-1.5 sm:pt-2 mt-1",children:e.jsxs("div",{className:"flex gap-2 sm:gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Rate"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[r,"/hr"]})]}),d!==null&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Drop %"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[d,"%"]})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"CRC"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:n})]})]})})]}):e.jsx(I,{children:e.jsx(be,{})})}const nn=2,an=1;function on(t,n,a){const s=m=>(m==null?void 0:m.reduce((c,d)=>c+d.count,0))??0,o=s(n),r=s(a),u=o||(t==null?void 0:t.rx_count)||1,l=r||(t==null?void 0:t.dropped_count)||0;return u>0?l/(u+l)*100:0}function rn(t,n,a){const s=o=>(o==null?void 0:o.reduce((r,u)=>r+u.count,0))??0;if(n!=null&&n.length&&a){const r=s(n)*100,u=n.length*a*1e3;return r/u*100}if(t){const o=(t.uptime_seconds||1)*1e3;return(t.total_airtime_ms||t.airtime_used_ms||0)/o*100}return 0}function Fe(t,n,a){return os(Math.max(n,Math.min(a,t)))}function cn(t,n,a,s,o){let r=Ue(t);n>20?r+=se*2:n>12&&(r+=se),a>8&&(r+=se);const u=Fe(r,0,nn);let l=rs(t);a>8&&(l+=se);const m=Fe(l,0,an),c=X(u),d=X(m),y=s!==null?X(s):null;let i="stable";return y!==null&&(c>y?i="increase":c{if(c!=="applying"){d("applying");try{const le=await jt({tx_delay_factor:A,direct_tx_delay_factor:ct});le!=null&&le.success?(d("success"),setTimeout(()=>d("idle"),2e3)):(d("error"),setTimeout(()=>d("idle"),2500))}catch{d("error"),setTimeout(()=>d("idle"),2500)}}},[c]);if(!u)return e.jsx(I,{children:e.jsx(be,{})});const g=10080*60,x=Math.floor(Date.now()/1e3)-g,j=Object.values((t==null?void 0:t.neighbors)??{}).filter(A=>A.zero_hop&&A.last_seen>=x&&as(A).isRepeater).length,k=y.filter(A=>A.status==="active"||A.lastSeen>=x).length,w=Math.max(j,k),C=on(t,n,a),T=rn(t,s,o),S=((Ne=(Q=t==null?void 0:t.config)==null?void 0:Q.delays)==null?void 0:Ne.tx_delay_factor)??null,B=((we=(ve=t==null?void 0:t.config)==null?void 0:ve.delays)==null?void 0:we.direct_tx_delay_factor)??null,f=cn(w,C,T,S),M=w!==1,N=Ue(w),v=[`${w} repeater${M?"s":""} heard in the last 7 days (base ×${N.toFixed(1)}).`];f.floodFactor===N&&C<=12&&T<=8?v.push("No modifiers applied — network looks healthy."):(C>20?v.push(`High duplicate rate (${C.toFixed(1)}%) suggests frequent collisions — window widened.`):C>12&&v.push(`Elevated duplicate rate (${C.toFixed(1)}%) — window widened one step.`),T>8&&v.push(`Channel is busy (${T.toFixed(1)}% TX util) — extra spacing added.`));const p=[`Direct uses one forwarder — ×${f.directFactor.toFixed(1)} backoff for channel contention.`];T>8&&p.push("Busy channel — small extra backoff.");const _=[`Flood ×${f.floodFactor.toFixed(1)} (${f.floodSlots} slot${f.floodSlots!==1?"s":""})`,...v,"",`Direct ×${f.directFactor.toFixed(1)}`,...p,"","Click to copy CLI commands"].join(` +`),R=S!==null?X(S):null,P=B!==null?X(B):null,D=R!==null&&f.floodSlots!==R,F=P!==null&&f.directSlots!==P,W=D||F,G=async()=>{const A=`set txdelay ${f.floodFactor.toFixed(1)} +set direct.txdelay ${f.directFactor.toFixed(1)}`;await vt(A),m(!0),setTimeout(()=>m(!1),1500)},ce=()=>i(f.floodFactor,f.directFactor);return e.jsxs(I,{children:[e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3 flex-wrap",children:[e.jsx(is,{className:"w-4 h-4 text-icon-card-title flex-shrink-0"}),e.jsx("span",{className:"type-micro",children:"DELAY DOCTOR"}),r&&e.jsx(Y,{color:"zinc",className:"hidden sm:inline-flex",children:r})]}),e.jsxs("button",{onClick:G,className:"flex gap-3 mb-2 sm:mb-3 w-full text-left hover:bg-subtle-fill radius-inner transition-base p-1 -m-1 group",title:_,children:[e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("span",{className:"type-data-xl text-fg-primary",children:e.jsxs($,{children:["×",f.floodFactor.toFixed(1)]})}),e.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Flood"})]}),e.jsxs("div",{className:"flex-1 flex flex-col",children:[e.jsx("span",{className:"type-data-xl text-sys-blue",children:e.jsxs($,{children:["×",f.directFactor.toFixed(1)]})}),e.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Direct"})]}),e.jsx("div",{className:"flex items-center self-center opacity-0 group-hover:opacity-100 transition-opacity",children:l?e.jsx(Be,{className:"w-4 h-4 text-sys-green"}):e.jsx(Nt,{className:"w-4 h-4 text-fg-muted"})})]}),e.jsx("div",{className:"flex-1 py-2",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"data-box-label",children:"Dupe"}),e.jsxs("div",{className:`data-box data-box-fill data-box-left ${f.duplicateRate>8?"text-status-warning":""}`,children:[f.duplicateRate.toFixed(1),"%"]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"data-box-label",children:"TX Util"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[f.txUtilization.toFixed(2),"%"]})]})]})}),e.jsx("div",{className:"pt-2 mt-auto",children:e.jsxs("div",{className:"flex items-end justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Current"}),e.jsx("div",{className:"flex gap-2",children:S!==null?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:["×",S.toFixed(2)]})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"data-box data-box-fill data-box-left",style:{color:"var(--sys-blue)"},children:["×",(B==null?void 0:B.toFixed(2))??"—"]})})]}):e.jsx("span",{className:"text-sm text-fg-muted",children:"No config"})})]}),W&&e.jsxs("button",{onClick:ce,disabled:c==="applying"||c==="success",className:`flex items-center gap-1.5 px-2.5 py-1.5 radius-inner type-micro font-medium transition-base + ${c==="success"?"bg-sys-green/15 text-sys-green":c==="error"?"bg-sys-red/15 text-sys-red":c==="applying"?"bg-subtle-fill text-fg-muted":"bg-sys-blue/10 text-sys-blue hover:bg-sys-blue/20"}`,title:`Apply ×${f.floodFactor.toFixed(1)} flood, ×${f.directFactor.toFixed(1)} direct`,children:[c==="success"?"Rx'd":c==="error"?"Failed":"Apply",c==="applying"?e.jsx(oe,{className:"w-3.5 h-3.5 animate-spin"}):c==="success"?e.jsx(Be,{className:"w-3.5 h-3.5"}):e.jsxs("span",{className:"relative inline-flex items-end w-6 h-3.5",children:[e.jsx(As,{className:"w-3.5 h-3.5 absolute left-0 bottom-0"}),e.jsx($s,{className:"w-3 h-3 absolute right-0 bottom-0"})]})]})]})})]})}const et=[{target:"RecentPackets",fn:"rssi",minStage:1},{target:"RecentPackets",fn:"snr",minStage:1}];q(et);const dn=25;function un(){z(et);const t=re(),n=wt(),a=kt(),s=ie(),o=ds(),r=ge(g=>g.requestChannel),[u,l]=h.useState(!0),m=h.useCallback(g=>l(g),[]),c=h.useMemo(()=>[...t.length<=100?t:t.slice(-100)].sort((b,x)=>(x.timestamp??0)-(b.timestamp??0)),[t]),d=s==null?void 0:s.local_hash,y=s==null?void 0:s.neighbors,i=us();return e.jsxs(I,{noPadding:!0,className:"!overflow-visible",children:[e.jsx($e,{listHeader:!0,icon:e.jsx(Ie,{}),title:"Recent Packets",actions:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ct,{enabled:u,onChange:m,label:"Hide Dupes",size:"sm"}),a&&e.jsx(Bt,{showLabel:!0}),e.jsxs(Te,{color:"primary",outline:!0,href:"/packets",children:["View all",e.jsx(De,{"data-slot":"icon"})]})]})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-1",children:e.jsx(cs,{packets:c,allPackets:t,localHash:d,neighbors:y,resolveSource:i,getDecodedContent:o,onChannelClick:r,loading:n,maxPackets:dn,showPagination:!1,flashNewest:!0,hideDupes:u,emptyMessage:"No packets received",footerAction:e.jsxs(Te,{color:"primary",outline:!0,href:"/packets",children:["View all",e.jsx(De,{"data-slot":"icon"})]})})})]})}const mn={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function fn({trend:t}){return e.jsx("span",{className:`mini-widget-trend ${t}`,children:e.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:mn[t]})})})}function hn(){return e.jsx("div",{className:"mini-widget-loading",children:e.jsx("div",{className:"mini-widget-loading-spinner"})})}function xn({message:t}){return e.jsx("div",{className:"mini-widget-error",children:e.jsx("span",{title:t,children:"No data"})})}function V({title:t,icon:n,value:a,unit:s,valueSize:o="md",status:r,subtitle:u,subtitleValue:l,trend:m,children:c,isLoading:d=!1,error:y,className:i="",onClick:g}){const b=["mini-widget-value",o==="lg"&&"mini-widget-value-lg",o==="sm"&&"mini-widget-value-sm"].filter(Boolean).join(" "),x=["mini-widget",i].filter(Boolean).join(" ");return e.jsxs(I,{noPadding:!0,className:x,onClick:g,children:[e.jsxs("div",{className:"mini-widget-header",children:[n,e.jsx("span",{className:"mini-widget-title",children:t}),r&&r!=="unknown"&&e.jsx("div",{className:`mini-widget-status-dot ${r}`}),m&&e.jsx(fn,{trend:m})]}),d?e.jsx(hn,{}):y?e.jsx(xn,{message:y}):e.jsxs("div",{className:"mini-widget-content",children:[(a!==void 0||u||l)&&e.jsxs("div",{className:"mini-widget-value-row",children:[a!==void 0&&e.jsxs("div",{className:b,children:[typeof a=="number"?e.jsx(K,{value:a,className:"font-mono tabular-nums",priority:"medium",format:Number.isInteger(a)?void 0:{minimumFractionDigits:1,maximumFractionDigits:1}}):e.jsx($,{children:a}),s&&e.jsx("span",{className:"mini-widget-unit",children:s})]}),(u||l)&&e.jsxs("span",{className:"mini-widget-badge-group",children:[u&&!l&&e.jsx("span",{className:"data-box mini-widget-subtitle-box",children:u}),u&&l&&e.jsx("span",{className:"mini-widget-subtitle truncate",children:u}),l&&e.jsx("span",{className:"data-box mini-widget-subtitle-box",children:l})]})]}),c]})]})}const pn={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},tt={baselineMedian:null,baselineP10:null,baselineP90:null,currentMedian:null,currentSampleCount:0,delta:0,slope:0,jitter:0,penalty:0,penaltyReason:null,computedAt:0,isReliable:!1};function ye(t,n){if(t.length===0)return null;const a=[...t].sort((u,l)=>u-l),s=n/100*(a.length-1),o=Math.floor(s),r=Math.ceil(s);return o===r?a[o]:a[o]+(a[r]-a[o])*(s-o)}function Ae(t){return ye(t,50)}function gn(t){if(t.length<2)return 0;const n=t.reduce((o,r)=>o+r,0)/t.length,s=t.map(o=>Math.pow(o-n,2)).reduce((o,r)=>o+r,0)/t.length;return Math.sqrt(s)}function yn(t){if(t.length<2)return 0;const n=t.length;let a=0,s=0,o=0,r=0;const u=t[0].timestamp;for(const m of t){const c=(m.timestamp-u)/3600,d=m.value;a+=c,s+=d,o+=c*d,r+=c*c}const l=n*r-a*a;return Math.abs(l)<1e-4?0:(n*o-a*s)/l}function bn(t,n,a){const s=pn;return t>=s.DELTA_CRITICAL?[2,`Noise floor ${t.toFixed(1)} dB above baseline`]:n>=s.SLOPE_CRITICAL?[2,`Noise floor rising ${n.toFixed(1)} dB/hour`]:a>=s.JITTER_CRITICAL?[2,`Noise floor unstable (±${a.toFixed(1)} dB)`]:t>=s.DELTA_WARNING?[1,`Noise floor ${t.toFixed(1)} dB above baseline`]:n>=s.SLOPE_WARNING?[1,`Noise floor rising ${n.toFixed(1)} dB/hour`]:a>=s.JITTER_WARNING?[1,`Noise floor variable (±${a.toFixed(1)} dB)`]:[0,null]}function jn(t){if(t.length===0)return{...tt,computedAt:Math.floor(Date.now()/1e3)};const n=Math.floor(Date.now()/1e3),a=t.filter(j=>Number.isFinite(j)),s=t.length>0?[t[t.length-1]]:[],o=t.slice(-4).filter(j=>Number.isFinite(j)),r=Ae(a),u=ye(a,10),l=ye(a,90),m=Ae(s),c=m!==null&&u!==null?m-u:0,d=o.map((j,k)=>({timestamp:n-(o.length-1-k)*3600,value:j})),y=yn(d),i=gn(o),g=a.length>=12,[b,x]=g?bn(c,y,i):[0,null];return{baselineMedian:r,baselineP10:u,baselineP90:l,currentMedian:m,currentSampleCount:s.length,delta:c,slope:y,jitter:i,penalty:b,penaltyReason:x,computedAt:n,isReliable:g}}const Nn={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],noiseFloorWindowHistory:[],linkQuality:null,channelHealth:null,nfTrend:tt,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},st=h.createContext(Nn);function vn({children:t}){var P;const n=ie(),a=re(),s=Oe(),o=Tt(),r=J(),u=E[r],l=Math.max(1,u.minutes/60),m=n===null,[c,d]=h.useState(null),y=h.useCallback(async()=>{try{const D=await ze(Math.ceil(l));if(D.success&&D.data){d(D.data.history);return}const F=await Mt(Math.ceil(l));F.success&&F.data&&F.data.count>0&&d(null)}catch{}},[l]);h.useEffect(()=>{y();const D=setInterval(y,6e4);return()=>clearInterval(D)},[y]);const i=h.useMemo(()=>St(a,l,c),[a,l,c]),g=(n==null?void 0:n.noise_floor_dbm)??null,b=h.useMemo(()=>_t(g)?g:null,[g]),x=h.useMemo(()=>{var F;const D=(F=n==null?void 0:n.config)==null?void 0:F.radio;return D?{sf:D.spreading_factor??7,bwHz:D.bandwidth??125e3}:null},[(P=n==null?void 0:n.config)==null?void 0:P.radio]),j=Rt(l),k=Dt(l),w=n==null?void 0:n.neighbors,C=h.useMemo(()=>Object.fromEntries(Object.entries(w??{}).filter(([F])=>!o.has(F))),[w,o]),T=h.useMemo(()=>s.filter(D=>!o.has(D.hash)),[s,o]),S=h.useMemo(()=>jn(j),[j]),B=h.useMemo(()=>Pt(T,C,x),[T,C,x]),f=h.useMemo(()=>Ft(i,b,B),[i,b,B]),[M,N]=h.useState({noiseFloor:null,networkScore:null,channelHealth:null}),v=h.useRef(0);h.useEffect(()=>{const D=()=>{const W=Date.now();W-v.current>3e4&&(v.current=W,N({noiseFloor:b,networkScore:(B==null?void 0:B.networkScore)??null,channelHealth:(f==null?void 0:f.score)??null}))};D();const F=setInterval(D,5e3);return()=>clearInterval(F)},[b,B==null?void 0:B.networkScore,f==null?void 0:f.score]);const p=h.useMemo(()=>({noiseFloor:{current:b,previous:M.noiseFloor,trend:b!==null?de(b,M.noiseFloor,2,!0):"stable"},networkScore:{current:(B==null?void 0:B.networkScore)??0,previous:M.networkScore,trend:de((B==null?void 0:B.networkScore)??0,M.networkScore,3,!1)},channelHealth:{current:(f==null?void 0:f.score)??0,previous:M.channelHealth,trend:de((f==null?void 0:f.score)??0,M.channelHealth,3,!1)}}),[b,B==null?void 0:B.networkScore,f==null?void 0:f.score,M]),R={lbtStats:i,noiseFloor:b,sparklineNoiseFloor:j,noiseFloorWindowHistory:k,linkQuality:B,channelHealth:f,nfTrend:S,radioConfig:x,trends:p,stats:n,recentPackets:a,quickNeighbors:s,isLoading:m,error:null,refresh:async()=>{}};return e.jsx(st.Provider,{value:R,children:t})}function Z(){const t=h.useContext(st);if(t===void 0)throw new Error("useLBTData must be used within an LBTDataProvider");return t}function wn(t){return t<100?"excellent":t<250?"good":t<500?"fair":t<1e3?"congested":"critical"}function kn(t){return t===0?"No backoffs":"Retries"}function Cn(t,n){return t===0?void 0:`${n.toFixed(0)}%`}function Bn(){const{lbtStats:t,isLoading:n,error:a}=Z(),s=je(),o=(t==null?void 0:t.avgBackoffMs)??0,r=(t==null?void 0:t.retryRate)??0,u=t?wn(o):"unknown",l=t==null?void 0:t.sparklineBackoff,m=h.useMemo(()=>!l||l.length<2?[]:l.map((c,d)=>({timestamp:Date.now()-(l.length-1-d)*36e5,count:c})),[l]);return e.jsx(V,{title:"LBT Backoff",icon:e.jsx(Os,{className:"mini-widget-icon"}),value:Math.round(o),unit:"ms",status:u,subtitle:t?kn(o):void 0,subtitleValue:t?Cn(o,r):void 0,isLoading:n,error:a,onClick:()=>s("/packets"),children:e.jsx("div",{className:"mini-widget-sparkline w-full",children:e.jsx(Xe,{data:m,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function Tn(t){return t===0?"—":t<1?"<1":Math.round(t).toString()}function Mn(){const{lbtStats:t,isLoading:n,error:a}=Z(),s=je(),o=(t==null?void 0:t.channelBusyCount)??0,r=(t==null?void 0:t.totalPacketsWithLBT)??0,u=(t==null?void 0:t.channelBusyRate)??0,l=(t==null?void 0:t.retryRate)??0,m=(t==null?void 0:t.avgBackoffMs)??0,c=(t==null?void 0:t.crcErrorCount)??0,d=l>0?Math.max(0,(l-u)/l*100):100;return e.jsx(V,{title:"Ch. Busy",icon:e.jsx(ns,{className:"mini-widget-icon"}),isLoading:n,error:a,onClick:()=>s("/packets"),children:e.jsx("div",{className:"mini-widget-body-grid",children:e.jsxs("div",{className:"grid grid-cols-[auto_1fr] widget-4col gap-x-2 gap-y-1 w-full min-w-0 items-baseline",children:[e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`${o} packets exceeded max CAD attempts (5) out of ${r} total transmissions.`,children:"Failed"}),e.jsxs("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`${o} packets exceeded max CAD attempts (5) out of ${r} total transmissions.`,children:[e.jsx($,{children:o}),e.jsx("span",{className:"text-fg-muted punc-slash",children:"/"}),e.jsx($,{children:r})]}),e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`${d.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:"Sent"}),e.jsx("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`${d.toFixed(1)}% of packets that needed LBT retries were sent successfully.`,children:e.jsxs($,{children:[d.toFixed(0),"%"]})}),e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`Average LBT backoff delay: ${m.toFixed(0)}ms.`,children:"Mean"}),e.jsxs("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`Average LBT backoff delay: ${m.toFixed(0)}ms.`,children:[e.jsx($,{children:Tn(m)}),e.jsx("span",{className:"text-fg-muted text-xs",children:"ms"})]}),e.jsx("span",{className:"text-fg-muted text-[10px] sm:text-sm",title:`${c} packets failed hardware CRC check — corrupted by RF interference or collisions.`,children:"CRC"}),e.jsx("div",{className:"data-box data-box-compact sm:data-box justify-self-end",title:`${c} packets failed hardware CRC check — corrupted by RF interference or collisions.`,children:e.jsx($,{children:c})})]})})})}function Sn(t){return t===null||t<-110?"excellent":t<-100?"good":t<-90?"fair":t<-80?"congested":"critical"}function _n(t){return t===null?"No reading":t<-115?"Very quiet":t<-105?"Quiet":t<-95?"Moderate":t<-85?"Elevated":"High interference"}function Rn(){const{noiseFloor:t,noiseFloorWindowHistory:n,trends:a,isLoading:s,error:o}=Z(),r=Sn(t),u=a==null?void 0:a.noiseFloor.trend,{timestamps:l,values:m}=h.useMemo(()=>!n||n.length<2?{timestamps:[],values:[]}:{timestamps:n.map(d=>d.timestamp),values:n.map(d=>d.noise_floor_dbm)},[n]),c=t!==null?Math.round(t):"—";return e.jsx(V,{title:"Noise Floor",icon:e.jsx(Ts,{className:"mini-widget-icon"}),value:c,unit:t!==null?"dBm":void 0,status:r,trend:u,subtitle:_n(t),isLoading:s,error:o,children:e.jsx("div",{className:"mini-widget-sparkline w-full",children:e.jsx(At,{timestamps:l,values:m,compact:!0,height:22})})})}const nt=[{target:"LinkLeaders",fn:"path",minStage:1,when:es},{target:"LinkLeaders",fn:"src_hash",minStage:1,when:ts}];q(nt);function Dn(){z(nt);const t=je(),n=Oe(),a=re(),s=ie(),o=J(),u=E[o].minutes*60,l=Lt(),m=h.useMemo(()=>{if(l===0)return a;const f=l-u;return a.filter(M=>M.timestamp>=f)},[a,u,l]),c=s===null,d=s!=null&&s.local_hash?Me(s.local_hash):"",y=(s==null?void 0:s.neighbors)??{},{neighborHashes:i,neighborNames:g}=h.useMemo(()=>{const f=new Set,M=new Map;for(const N of n){f.add(N.hash);const v=y[N.hash],p=(v==null?void 0:v.name)||(v==null?void 0:v.node_name)||N.prefix;M.set(N.hash,p)}return{neighborHashes:f,neighborNames:M}},[n,y]),b=h.useMemo(()=>{if(i.size===0||m.length===0||!d)return{champion:null,listener:null,loudest:null};const{scores:f}=fs(m,i,d),M=[];for(const[_,R]of f)R.blendedScore!==0&&M.push({...R,name:g.get(_)??Me(_)});let N=null,v=null,p=null;for(const _ of M)(!N||_.blendedScore>N.blendedScore)&&(N=_),(!v||_.listenerScore>v.listenerScore)&&(v=_),(!p||_.loudScore>p.loudScore)&&(p=_);return{champion:N,listener:v,loudest:p}},[m,i,d,g]),x=f=>e.jsxs("div",{className:"max-w-[220px]",children:[e.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",f.name]}),e.jsxs("div",{className:"text-fg-muted mb-1",children:["Blended Score: ",f.blendedScore,e.jsx("span",{className:"text-fg-muted/60 ml-1",children:"(Listener + Loud)"})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 space-y-0.5",children:[e.jsxs("div",{children:["Listener: ",f.listenerScore,"/100 (",f.listenerCount," shared paths)"]}),e.jsxs("div",{children:["Loud: ",f.loudScore,"/100 (",f.loudCount," packets relayed)"]})]})]}),j=f=>e.jsxs("div",{className:"max-w-[220px]",children:[e.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",f.name]}),e.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",f.listenerScore,"/100"]}),e.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:e.jsxs("div",{children:[f.listenerCount," packets where they heard your transmissions"]})})]}),k=f=>e.jsxs("div",{className:"max-w-[220px]",children:[e.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",f.name]}),e.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",f.loudScore,"/100"]}),e.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:e.jsxs("div",{children:[f.loudCount," packets they relayed directly to you"]})})]}),{champion:w,listener:C,loudest:T}=b,B=w||C||T?e.jsxs("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:[w&&e.jsx(ue,{content:x(w),children:e.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[e.jsx(ls,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-map-neighbor-color flex-shrink-0"}),e.jsx("span",{className:"font-semibold text-map-neighbor-color font-mono truncate flex-1 min-w-0",children:w.name}),e.jsx("span",{className:"text-map-neighbor-color pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:w.blendedScore})]})}),C&&e.jsx(ue,{content:j(C),children:e.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[e.jsx(Rs,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:C.name}),e.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:C.listenerScore})]})}),T&&e.jsx(ue,{content:k(T),children:e.jsxs("div",{className:"flex items-center gap-1 text-xs sm:text-sm radius-badge px-1 -mx-1 hover-bg transition-base cursor-default",children:[e.jsx(Ps,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:T.name}),e.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:T.loudScore})]})})]}):n.length===0?e.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No direct neighbors"}):e.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No routing data yet"});return e.jsx(V,{title:"Link Leaders",icon:e.jsx(Es,{className:"mini-widget-icon"}),isLoading:c,onClick:()=>t("/contacts"),children:B})}function Pn(t){const{retryRate:n,channelBusyCount:a,totalPacketsWithLBT:s,avgBackoffMs:o,maxBackoffMs:r,crcErrorCount:u,packetCount:l}=t;if(s===0&&u===0)return 0;const m=Math.min(s/10,1),c=.15,d=Math.log(1+n*c)/Math.log(1+100*c)*40,y=s>0?a/s*100:0,i=Math.min(y*.5,25);let g=0;o>100&&(g=Math.min(Math.log10(o/100)*8,15));let b=0;r>500&&o>0&&r>o*2&&(b=Math.min((r-500)/200,5));const x=(d+i+g+b)*m;let j=0;if(u>0){const k=l+u,w=u/k*100;j=Math.min(Math.log(1+w*.5)*10,15)}return Math.min(x+j,85)}function Fn(t){return t<15?"excellent":t<30?"good":t<45?"fair":t<60?"congested":"critical"}function An(t){return t<15?"Clear channel":t<30?"Light traffic":t<45?"Moderate traffic":t<60?"Heavy traffic":t<75?"Congested":"Severe congestion"}function Ln(){const{lbtStats:t,isLoading:n,error:a}=Z(),s=t?Pn(t):0,o=t?Fn(s):"unknown",r=(t==null?void 0:t.maxBackoffMs)??0,u=t?r>200?"Peak":An(s):void 0,l=t&&r>200?`${Math.round(r)}ms`:void 0,m=t==null?void 0:t.sparklineCollisionRisk,c=h.useMemo(()=>!m||m.length<2?[]:m.map((y,i)=>({timestamp:Date.now()-(m.length-1-i)*36e5,count:y})),[m]),d=Math.round(s*10)/10;return e.jsx(V,{title:"Collision Risk",icon:e.jsx(hs,{className:"mini-widget-icon"}),value:d,unit:"%",status:o,subtitle:u,subtitleValue:l,isLoading:n,error:a,children:e.jsx("div",{className:"mini-widget-sparkline w-full",children:e.jsx(Xe,{data:c,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function En(t){return t<30?"excellent":t<50?"good":t<70?"fair":t<90?"congested":"critical"}function Hn(t){return t<1e3?`${Math.round(t)}ms`:t<6e4?`${(t/1e3).toFixed(1)}s`:`${(t/6e4).toFixed(1)}m`}function $n(){var x,j;const[t,n]=h.useState(!1),[a]=h.useState(0),{stats:s,lbtStats:o,isLoading:r}=Z(),u=((j=(x=s==null?void 0:s.config)==null?void 0:x.duty_cycle)==null?void 0:j.enforcement_enabled)??!1,l=h.useMemo(()=>{if(!s)return null;if(!u){const S=s.airtime_used_ms??0,B=s.max_airtime_ms??1,f=B>0?S/B*100:0;return{usedMs:S,maxMs:B,remainingMs:Math.max(0,B-S),utilizationPercent:f}}const k=s.airtime_used_ms??0,w=s.max_airtime_ms??1,C=s.airtime_remaining_ms??0,T=s.utilization_percent??(w>0?k/w*100:0);return{usedMs:k,maxMs:w,remainingMs:C,utilizationPercent:T}},[s,u]),m=h.useMemo(()=>{if(!o||o.totalPacketsWithLBT===0)return 100;const k=o.totalPacketsWithLBT-o.packetsWithRetries,w=o.totalPacketsWithLBT;return k/w*100},[o]),c=(l==null?void 0:l.utilizationPercent)??0,d=En(c),y=(l==null?void 0:l.remainingMs)??0,i=m<95?"1st Try":"Remaining",g=m<95?`${m.toFixed(0)}%`:Hn(y),b=l?e.jsx("div",{className:"mini-widget-progress mt-auto",children:e.jsx("div",{className:`mini-widget-progress-bar ${d}`,style:{width:`${Math.min(c,100)}%`}})}):null;return e.jsx(V,{title:"Duty Cycle",icon:e.jsx(Ie,{className:"mini-widget-icon"}),value:c.toFixed(1),unit:"%",status:d,subtitle:i,subtitleValue:g,isLoading:r,children:b})}function In(){return e.jsxs("div",{className:"mini-widget",children:[e.jsxs("div",{className:"mini-widget-header",children:[e.jsx(ee,{className:"w-4 h-4"}),e.jsx(ee,{className:"h-3 w-16"})]}),e.jsx(ee,{className:"h-7 w-12 mt-2"}),e.jsx(ee,{className:"h-3 w-20 mt-2"})]})}function On(){return e.jsx("div",{className:"widget-row",children:Array.from({length:6}).map((t,n)=>e.jsx(In,{},n))})}const at=[{target:"MeshHealth",fn:"type",minStage:1}];q(at);function zn({className:t="",isLoaded:n}){z(at);const a=qe(),s=n??a??!0;return e.jsxs("div",{className:`mesh-health-container relative ${t}`,children:[e.jsxs("div",{className:"mesh-health-header",children:[e.jsx(Et,{className:"w-4 h-4 text-sys-blue"}),e.jsx("span",{className:"type-label text-fg-muted",children:"MESH HEALTH"})]}),s?e.jsx(vn,{children:e.jsxs("div",{className:"widget-row",children:[e.jsx(Bn,{}),e.jsx(Ln,{}),e.jsx(Rn,{}),e.jsx($n,{}),e.jsx(Mn,{}),e.jsx(Dn,{})]})}):e.jsx(On,{})]})}const ot=[{target:"PublicChannel",fn:"decrypt",minStage:2,when:ss}];q(ot);let rt="",it="",Le="";function qn(){const t=new Date,n=t.toDateString();if(n!==Le){Le=n,rt=n;const a=new Date(t);a.setDate(a.getDate()-1),it=a.toDateString()}}function Wn(t){qn();const n=new Date(t*1e3).toDateString();return n===rt?"Today":n===it?"Yesterday":new Date(t*1e3).toLocaleDateString([],{weekday:"short",month:"short",day:"numeric"})}function Un(t,n,a){return`${t||""}|${n}|${a}`}function Vn(t,n){const a=t.message,s=n.message;return a.timestamp===s.timestamp&&a.text===s.text&&a.senderName===s.senderName&&a.channelHash===s.channelHash&&a.channelName===s.channelName&&t.isChannelSelected===n.isChannelSelected&&t.onChannelClick===n.onChannelClick}const Gn=h.memo(function({message:n,onChannelClick:a,isChannelSelected:s}){const o=n.channelName||n.channelHash.slice(0,6);return e.jsx("div",{style:{transform:"translateZ(0)",willChange:"transform"},children:e.jsx(bs,{senderName:n.senderName||"Unknown",text:n.text,timestamp:n.timestamp,nameAccessory:e.jsx(Ve,{channelName:o,active:s,onClick:()=>a==null?void 0:a(n.channelHash)})})})},Vn);function Xn({open:t,onClose:n,messages:a,onLoadMore:s,hasMoreToLoad:o,isDecoding:r,initialChannel:u}){const l=h.useRef(null),m=h.useRef(!0),c=J(),d=We(),y=h.useRef(!1);h.useEffect(()=>{t?(y.current=!0,_e.resume()):y.current&&_e.pause()},[t]);const i=h.useMemo(()=>{const p=Date.now()/1e3,_=E[c].minutes,R=p-_*60;return[...a].filter(P=>P.timestamp>=R).sort((P,D)=>P.timestamp-D.timestamp)},[a,c]),g=h.useCallback(()=>{const p=l.current;p&&(m.current=p.scrollTop>=-50)},[]),b=h.useMemo(()=>{const p=new Map;for(const _ of i){const R=_.channelHash,P=p.get(R);P?P.count++:p.set(R,{name:_.channelName||_.channelHash.slice(0,6),hash:_.channelHash,count:1})}return Array.from(p.values()).sort((_,R)=>R.count-_.count)},[i]),x=b.length,[j,k]=h.useState(null),[w,C]=h.useState(!1);h.useEffect(()=>{t&&u&&k(u)},[t,u]);const T=h.useCallback(()=>{s(j,b)},[s,j,b]),S=h.useMemo(()=>j?i.filter(p=>p.channelHash===j):i,[i,j]),B=h.useMemo(()=>{const p=[];let _="";for(const R of S){const P=Wn(R.timestamp);P!==_&&(p.push({type:"date",date:P}),_=P),p.push({type:"message",message:R})}return p},[S]);h.useLayoutEffect(()=>{const p=l.current;p&&m.current&&(p.scrollTop=0)},[S.length]);const f=19,M=b.slice(0,f),N=b.slice(f),v=N.length>0;return e.jsx(qt,{open:t,onClose:n,size:"lg",motionPlus:!0,solid:!0,children:e.jsxs(Wt,{className:"p-0 flex flex-col h-[80vh] max-h-[700px] rounded-2xl",children:[e.jsx("div",{className:"flex-shrink-0 px-4 sm:px-5 py-3 sm:py-4",children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ye,{className:"size-5 text-icon-card-title flex-shrink-0"}),e.jsx("h2",{className:"type-micro",children:"Public Channels"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ge,{ranges:E,selectedIndex:c,onSelect:d,size:"sm"}),e.jsx("button",{onClick:n,className:"sm:hidden min-h-[44px] min-w-[44px] px-3 flex items-center justify-center text-[15px] font-medium text-sys-blue active:text-sys-blue/70 transition-base radius-inner active:bg-subtle-fill",children:"Done"}),e.jsx("button",{onClick:n,className:"hidden sm:flex items-center justify-center p-2 text-fg-muted hover:text-fg-primary transition-base radius-inner hover:bg-subtle","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})}),e.jsx("div",{className:"flex-shrink-0 px-3 pb-2 relative z-10 isolate",style:{minHeight:x>0?void 0:0},children:x>0&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("button",{onClick:()=>k(null),className:L("px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",j===null?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:["All ",x]}),M.map(p=>e.jsx("button",{onClick:()=>k(p.hash),className:L("flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",j===p.hash?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:e.jsx("span",{className:"truncate max-w-[80px]",children:p.name})},p.hash)),v&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{onClick:()=>C(!w),className:L("flex items-center gap-0.5 px-2 py-0.5 rounded text-xs font-medium transition-all","ring-1 ring-inset",w||N.some(p=>p.hash===j)?"bg-sys-blue/20 text-sys-blue ring-sys-blue/30":"bg-subtle-fill text-fg-secondary ring-edge-subtle hover:bg-subtle-fill-strong"),children:["+",N.length,e.jsx(Ut,{className:L("size-3 transition-transform",w&&"rotate-180")})]}),w&&e.jsx("div",{className:L("absolute top-full left-0 mt-1 z-50","min-w-[140px] max-h-[200px] overflow-y-auto","p-1 rounded-lg","bg-elevated backdrop-blur-xl","ring-1 ring-edge-subtle shadow-xl"),children:N.map(p=>e.jsxs("button",{onClick:()=>{k(p.hash),C(!1)},className:L("w-full flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium transition-all text-left",j===p.hash?"bg-sys-blue/20 text-sys-blue":"text-fg-secondary hover:bg-subtle-fill-strong"),children:[e.jsx(js,{className:"size-2.5 opacity-60 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:p.name}),e.jsxs("span",{className:"opacity-60 ml-auto",children:["(",p.count,")"]})]},p.hash))})]})]})}),e.jsx("div",{ref:l,onScroll:g,className:L("flex-1 overflow-y-auto overflow-x-hidden","mx-3 mb-3 rounded-md","bg-body","ring-1 ring-inset ring-edge-subtle","flex flex-col-reverse"),children:r&&S.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[300px] text-fg-muted px-4 py-4",children:[e.jsx(oe,{className:"size-12 mb-4 text-sys-indigo animate-spin"}),e.jsx("p",{className:"text-lg font-medium",children:"Loading messages..."})]}):S.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[300px] text-fg-muted px-4 py-4",children:[e.jsx(Ns,{className:"size-16 mb-4 opacity-20"}),e.jsx("p",{className:"text-lg font-medium",children:"No messages yet"}),e.jsx("p",{className:"text-sm mt-1 opacity-70",children:j?"No messages in this channel":"Public channel messages will appear here"})]}):e.jsxs("div",{className:"px-4 py-4",children:[o&&e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("button",{onClick:T,disabled:r,className:L("px-4 py-1.5 rounded-full","text-[11px] font-medium","ring-1 ring-inset",r?"bg-subtle-fill text-fg-muted ring-edge-subtle cursor-wait":"bg-sys-blue/10 text-sys-blue ring-sys-blue/20 hover:bg-sys-blue/20 hover:ring-sys-blue/30"),children:r?e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(oe,{className:"size-3 animate-spin"}),"Loading..."]}):"Load older messages"})}),B.map((p,_)=>{if(p.type==="date")return e.jsx("div",{className:"flex justify-center my-4",children:e.jsx("span",{className:L("px-3.5 py-1.5 rounded-full","bg-subtle-fill backdrop-blur-sm","text-[11px] text-fg-muted/80 font-medium","ring-1 ring-edge-subtle"),children:p.date})},`date-${p.date}-${_}`);const R=`msg-${p.message.timestamp}-${p.message.senderName||"anon"}-${p.message.channelHash}`;return e.jsx("div",{className:"mb-3",children:e.jsx(Gn,{message:p.message,onChannelClick:k,isChannelSelected:j===p.message.channelHash})},R)})]})}),e.jsx("div",{className:"flex-shrink-0 px-5 py-2 text-center",children:e.jsxs("p",{className:"text-[11px] text-fg-muted",children:[S.length," messages · ",x," ",x===1?"channel":"channels",r&&e.jsxs("span",{className:"ml-2 text-sys-indigo",children:[e.jsx(oe,{className:"inline size-3 animate-spin mr-1"}),"Decrypting..."]})]})})]})})}function Yn(t){const n=[],a=new Set;for(const s of t.values()){const o=s.decoded;if(!o||!o.decrypted||o.macCorrupted||!o.text)continue;const r=Un(o.senderName,o.channelHash,o.text);a.has(r)||(a.add(r),n.push({timestamp:s.timestamp,channelName:o.channelName,channelHash:o.channelHash,senderName:o.senderName,text:o.text,rssi:s.rssi,snr:s.snr}))}return n}function Kn({isLoaded:t}){const n=qe(),a=t??n??!0;z(ot);const s=re(),[o,r]=h.useState(!1),[u,l]=h.useState(null),m=J(),c=h.useCallback(()=>{l(null),r(!0),te.getState().queueDecryption(s)},[s]),d=ge(M=>M.requestedHash),y=ge(M=>M.clearRequest);h.useEffect(()=>{d&&(l(d),r(!0),te.getState().queueDecryption(s),y())},[d,y,s]);const i=Ht(),g=$t(),b=It(),x=h.useMemo(()=>Yn(i),[i]),j=h.useMemo(()=>{const M=Date.now()/1e3,N=E[m].minutes,v=M-N*60;return x.filter(p=>p.timestamp>=v)},[x,m]),k=h.useMemo(()=>j.length===0?null:j.reduce((M,N)=>N.timestamp>M.timestamp?N:M),[j]),w=g.isDecoding,T=h.useMemo(()=>{const M=Date.now()/1e3,N=E[m].minutes,v=M-N*60,p=new Set;let _=0;for(const R of s)(R.type??R.payload_type)===Se.GRP_TXT&&((R.timestamp??0){const M=Date.now()/1e3,N=E[m].minutes,v=M-N*60;for(const p of s)if((p.type??p.payload_type)===Se.GRP_TXT&&!((p.timestamp??0){if(!w){if(M){const v=N.find(p=>p.hash===M);if(v){console.log(`[PublicChannelCard] Fast-path load for #${v.name}`),te.getState().queueChannelDecryption(s,v.name);return}}te.getState().queueDecryption(s)}},[s,w]);return a?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:c,className:L("group cursor-pointer rounded-2xl transition-all duration-150","bg-surface/80 backdrop-blur-lg depth-raised","hover:bg-subtle-fill","px-3 py-2.5 sm:px-4 sm:py-3"),children:e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 flex-shrink-0",children:[e.jsx(Ye,{className:"size-4 text-icon-card-title flex-shrink-0"}),e.jsx("span",{className:"type-micro",children:"CHAT ACTIVITY"}),T>0&&e.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-md bg-subtle-fill ring-1 ring-inset ring-edge-subtle text-sm tabular-nums text-fg-secondary",children:T}),e.jsx(Pe,{className:"size-4 text-fg-muted group-hover:text-sys-indigo transition-colors ml-auto sm:hidden"})]}),e.jsxs("div",{className:"flex items-center gap-2 sm:gap-1.5 min-w-0 overflow-hidden",children:[e.jsx(He,{mode:"wait",initial:!1,children:k?e.jsxs(ae.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:-16},transition:{duration:.2,ease:[.4,0,.2,1]},className:"flex items-center gap-2 sm:gap-1.5 min-w-0",children:[k.channelName&&e.jsx("span",{className:"hidden sm:inline-flex",children:e.jsx(Ve,{channelName:k.channelName})}),e.jsx("div",{className:"hidden sm:flex w-[30px] h-[30px] rounded-full items-center justify-center flex-shrink-0 ring-1 ring-edge-subtle",style:{backgroundColor:ps(fe(k.senderName||"").cleanName)},children:fe(k.senderName||"").emoji?e.jsx("span",{className:"text-base",children:fe(k.senderName||"").emoji}):e.jsx("span",{className:"text-white text-xs font-bold tracking-tighter",children:gs(k.senderName||"")})}),e.jsx("div",{className:"inline-flex items-center px-3 py-1.5 rounded-2xl rounded-tr-md bg-[#007AFF] shadow-sm min-w-0 flex-1 sm:flex-initial sm:max-w-xs sm:-ml-px",children:e.jsx("span",{className:"text-sm text-white truncate tracking-wide",children:ys(k.text)})}),e.jsx("span",{className:"inline-flex items-center px-2 py-1 rounded-md bg-subtle-fill ring-1 ring-inset ring-edge-subtle text-sm tabular-nums text-fg-secondary flex-shrink-0",children:zt(k.timestamp)})]},`msg-${k.timestamp}-${k.senderName}-${k.channelHash}`):b?e.jsx(ae.span,{initial:{opacity:0},animate:{opacity:1},className:"text-sm text-fg-muted italic",children:"No messages yet"},"empty"):e.jsxs(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,y:-16},transition:{duration:.15},className:"flex items-center gap-2 sm:gap-1.5",children:[e.jsx("div",{className:"hidden sm:block w-8 h-4 rounded bg-subtle-fill-strong animate-pulse"}),e.jsx("div",{className:"hidden sm:block w-[30px] h-[30px] rounded-full bg-subtle-fill-strong animate-pulse"}),e.jsx("div",{className:"h-8 w-32 sm:w-48 rounded-2xl bg-subtle-fill-strong animate-pulse"}),e.jsx("div",{className:"w-12 h-6 rounded-md bg-subtle-fill-strong animate-pulse"})]},"skeleton")}),e.jsx(Pe,{className:"size-4 text-fg-muted group-hover:text-sys-indigo transition-colors flex-shrink-0 hidden sm:block ml-1"})]})]})}),e.jsx(Xn,{open:o,onClose:()=>r(!1),messages:x,onLoadMore:f,hasMoreToLoad:B,isDecoding:w,initialChannel:u})]}):e.jsx("div",{className:"h-14 rounded-xl bg-elevated/50 animate-pulse"})}function Da(){var M;const t=ie(),n=Vt(),a=Gt(),s=Xs(),o=h.useRef(!1);a&&!o.current&&(o.current=!0);const r=o.current,u=J(),l=We(),m=Xt(),c=E[u]??E[4],d=m.isBackgroundLoading&&u>=5,[y,i]=h.useState([]),[g,b]=h.useState(0),[x,j]=h.useState(()=>localStorage.getItem("rx-crc-overlay")==="true"),k=h.useCallback(()=>{j(N=>{const v=!N;return localStorage.setItem("rx-crc-overlay",String(v)),v})},[]);h.useEffect(()=>{const N=c.minutes/60;ze(N).then(v=>{v.success&&v.data?(i(v.data.history),b(v.data.count)):(i([]),b(0))})},[c.minutes]);const w=h.useMemo(()=>{const N=G=>(G==null?void 0:G.reduce((ce,Q)=>ce+Q.count,0))??0,v=N(s==null?void 0:s.received),p=N(s==null?void 0:s.unique_received),_=N(s==null?void 0:s.forwarded),R=N(s==null?void 0:s.dropped),P=N(s==null?void 0:s.transmitted),D=((s==null?void 0:s.time_range_minutes)??c.minutes)/60,F=D>0?Math.round(v/D):0,W=D>0?Math.round(_/D):0;return{received:v,uniqueReceived:p,forwarded:_,dropped:R,transmitted:P,rxPerHour:F,fwdPerHour:W}},[s,c.minutes]),C=h.useMemo(()=>s?{totalBytes:s.totalReceivedBytes,kbPerHour:s.kbPerHour}:{totalBytes:0,kbPerHour:0},[s]),T=h.useMemo(()=>{if(!s)return[];const{receivedBytesBuckets:N,start_time:v,bucket_duration_seconds:p,bucket_count:_}=s,R=new Array(_).fill(0);for(const P of y){const D=Math.floor((P.timestamp-v)/p);D>=0&&D<_&&R[D]++}return N.map((P,D)=>({start:P.start,end:P.end,bytesByType:{...P.countByType,...x&&R[D]>0?{[me]:R[D]}:{}},totalBytes:P.totalCount}))},[s,y,x]),S=h.useMemo(()=>{if(!s)return[];const{receivedCountByType:N}=s,v=Object.keys(N).map(p=>parseInt(p,10)).filter(p=>(N[p]??0)>0).sort((p,_)=>(N[_]??0)-(N[p]??0));return x&&g>0&&v.unshift(me),v},[s,g,x]),B=h.useMemo(()=>{if(!s)return{};const N={...s.receivedCountByType??{}};return x&&g>0&&(N[me]=g),N},[s,g,x]),f=(t==null?void 0:t.node_name)??((M=t==null?void 0:t.config)==null?void 0:M.node_name)??"Unknown Node";return h.useEffect(()=>{f&&f!=="Unknown Node"&&(document.title=`pyMC: ${f}`)},[f]),n?e.jsxs(Re,{neomorphic:!0,className:"p-8 text-center",children:[e.jsx("p",{className:"type-subheading text-sys-red mb-2",children:"Failed to connect to backend"}),e.jsx("p",{className:"type-body text-fg-muted",children:n}),e.jsx("p",{className:"type-data-sm text-fg-muted mt-4",children:"Make sure the backend is running on port 8000"})]}):e.jsxs(Kt,{children:[e.jsx(Jt,{title:f,icon:e.jsx(vs,{}),subtitle:e.jsx(ms,{}),controls:e.jsx(Ge,{ranges:E,selectedIndex:u,onSelect:l,isPending:d})}),e.jsxs(Zt,{ready:r,children:[e.jsx(Kn,{}),e.jsx(he,{template:"hero-auto",children:e.jsxs(Re,{neomorphic:!0,children:[e.jsx($e,{icon:e.jsx(Ss,{}),title:"PACKETS RECEIVED",badge:c.label,badgeColor:"zinc",actions:r?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{type:"button",onClick:k,className:"p-1 rounded hover:bg-zinc-500/20 active:bg-zinc-500/30 transition-colors touch-manipulation",title:x?"Hide CRC Errors":"Show CRC Errors","aria-label":x?"Hide CRC error overlay":"Show CRC error overlay","aria-pressed":x,children:e.jsx(Yt,{className:`w-3.5 h-3.5 transition-colors ${x?"text-sys-red":"text-fg-muted"}`})}),e.jsxs("div",{className:"data-box",children:[C.kbPerHour," KB/hr"]})]}):e.jsx("div",{className:"data-box opacity-0",children:"0 KB/hr"})}),e.jsxs("div",{className:"flex flex-wrap gap-4 sm:gap-8",children:[e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("div",{className:"type-data-xl text-fg-primary",children:r?e.jsx(K,{value:w.received,className:"font-mono tabular-nums",priority:"high"}):e.jsx("span",{className:"opacity-30",children:"—"})}),e.jsx(Y,{color:"zinc",className:"mb-0.5 sm:mb-1",children:"Total Rx"})]}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx("div",{className:"type-data-xl text-fg-primary",children:r?e.jsx(K,{value:w.uniqueReceived,className:"font-mono tabular-nums",priority:"high"}):e.jsx("span",{className:"opacity-30",children:"—"})}),e.jsx(Y,{color:"zinc",className:"mb-0.5 sm:mb-1",children:"Unique"})]})]}),e.jsxs("div",{className:"mt-2 flex-1 min-h-0 relative",children:[e.jsx("div",{className:`absolute inset-0 flex items-end gap-1 transition-opacity duration-300 ${r?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":r,children:[45,72,33,58,80,42,65,28,55,75,38,62].map((N,v)=>e.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${N}%`}},v))}),e.jsx("div",{className:`h-full transition-opacity duration-300 ${r?"opacity-100":"opacity-0"}`,children:e.jsx(Js,{buckets:T,activeTypes:S,totalByType:B,mode:"count"})})]})]})}),e.jsxs(he,{template:"compact",children:[e.jsx(xe,{span:6,lg:4,children:e.jsx(tn,{value:w.forwarded,receivedCount:w.received,buckets:(s==null?void 0:s.forwardedBytesBuckets)??[],activeTypes:(s==null?void 0:s.forwardedActiveTypes)??[],ratePerHour:(s==null?void 0:s.forwardedRatePerHour)??0,timeRangeLabel:c.label,icon:e.jsx(Cs,{className:"w-4 h-4"})})}),e.jsx(xe,{span:6,lg:4,children:e.jsx(sn,{value:w.dropped,crcCount:g,receivedCount:w.received,buckets:(s==null?void 0:s.droppedBytesBuckets)??[],activeTypes:(s==null?void 0:s.droppedActiveTypes)??[],ratePerHour:(s==null?void 0:s.droppedRatePerHour)??0,timeRangeLabel:c.label,icon:e.jsx(ws,{className:"w-4 h-4"})})}),e.jsx(xe,{span:12,lg:4,children:e.jsx(ln,{stats:t,localHash:t==null?void 0:t.local_hash,receivedBuckets:s==null?void 0:s.received,droppedBuckets:s==null?void 0:s.dropped,forwardedBuckets:s==null?void 0:s.forwarded,bucketDurationSeconds:s==null?void 0:s.bucket_duration_seconds,timeRangeLabel:c.label})})]}),e.jsx(zn,{}),e.jsx(un,{}),t&&e.jsx(he,{template:"auto",children:e.jsx(xs,{nodeName:f,repeaterVersion:t.version,coreVersion:t.core_version,localHash:t.local_hash,publicKey:t.public_key})})]})]})}export{Da as default}; diff --git a/frontend/dist/assets/DataBox-CwAsAwyY.js b/frontend/dist/assets/DataBox-ABvJ7hn1.js similarity index 91% rename from frontend/dist/assets/DataBox-CwAsAwyY.js rename to frontend/dist/assets/DataBox-ABvJ7hn1.js index dd412f61..facc5834 100644 --- a/frontend/dist/assets/DataBox-CwAsAwyY.js +++ b/frontend/dist/assets/DataBox-ABvJ7hn1.js @@ -1 +1 @@ -import{r as i,F as E,j as e,c as s,D as S,E as T}from"./index-CvSa8h-C.js";const k={standard:"w-3 h-3",compact:"w-2.5 h-2.5",responsive:"w-2.5 h-2.5 sm:w-3 sm:h-3"};function $({children:a,copyValue:g,copy:n=!1,size:r="standard",className:u,title:f,color:x,truncate:l}){const[d,m]=i.useState(!1),[w,y]=i.useState(!1),p=i.useRef(null),o=g??(typeof a=="string"?a:""),C=k[r],h=(()=>{if(!l||typeof a!="string")return a;const t=a,[c,j]=l===!0?[6,4]:l;return t.length<=c+j+3?t:`${t.slice(0,c)}…${t.slice(-j)}`})(),N=i.useCallback(async t=>{if(!n)return;t.preventDefault(),t.stopPropagation(),p.current&&clearTimeout(p.current);const c=await E(o);m(!0),p.current=setTimeout(()=>m(!1),2e3),c||console.warn("Copy may have failed for:",o.slice(0,16)+"...")},[n,o]),v=r==="compact"?"data-box-compact":r==="responsive"?"data-box-responsive":"",b=n?f||`Click to copy: ${o}`:f;return n?e.jsxs("button",{type:"button",onClick:N,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:s("data-box interactive",v,"cursor-pointer select-none gap-1","hover-bg",x,u),title:b,"aria-label":`Copy ${o}`,children:[e.jsx("span",{className:s("transition-colors duration-200",d?"text-sys-green":""),children:h}),e.jsx("span",{className:s("flex items-center justify-center",r==="compact"?"w-3 h-3":"w-3.5 h-3.5"),children:d?e.jsx(S,{className:s("text-sys-green",C)}):e.jsx(T,{className:s("transition-opacity duration-200",w?"opacity-70":"opacity-40",C)})})]}):e.jsx("span",{className:s("data-box",v,x,u),title:b,children:h})}export{$ as D}; +import{r as i,F as E,j as e,c as s,D as S,E as T}from"./index-WhzslczH.js";const k={standard:"w-3 h-3",compact:"w-2.5 h-2.5",responsive:"w-2.5 h-2.5 sm:w-3 sm:h-3"};function $({children:a,copyValue:g,copy:n=!1,size:r="standard",className:u,title:f,color:x,truncate:l}){const[d,m]=i.useState(!1),[w,y]=i.useState(!1),p=i.useRef(null),o=g??(typeof a=="string"?a:""),C=k[r],h=(()=>{if(!l||typeof a!="string")return a;const t=a,[c,j]=l===!0?[6,4]:l;return t.length<=c+j+3?t:`${t.slice(0,c)}…${t.slice(-j)}`})(),N=i.useCallback(async t=>{if(!n)return;t.preventDefault(),t.stopPropagation(),p.current&&clearTimeout(p.current);const c=await E(o);m(!0),p.current=setTimeout(()=>m(!1),2e3),c||console.warn("Copy may have failed for:",o.slice(0,16)+"...")},[n,o]),v=r==="compact"?"data-box-compact":r==="responsive"?"data-box-responsive":"",b=n?f||`Click to copy: ${o}`:f;return n?e.jsxs("button",{type:"button",onClick:N,onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),className:s("data-box interactive",v,"cursor-pointer select-none gap-1","hover-bg",x,u),title:b,"aria-label":`Copy ${o}`,children:[e.jsx("span",{className:s("transition-colors duration-200",d?"text-sys-green":""),children:h}),e.jsx("span",{className:s("flex items-center justify-center",r==="compact"?"w-3 h-3":"w-3.5 h-3.5"),children:d?e.jsx(S,{className:s("text-sys-green",C)}):e.jsx(T,{className:s("transition-opacity duration-200",w?"opacity-70":"opacity-40",C)})})]}):e.jsx("span",{className:s("data-box",v,x,u),title:b,children:h})}export{$ as D}; diff --git a/frontend/dist/assets/DataValue-CjX4hzMo.js b/frontend/dist/assets/DataValue-DoI73agL.js similarity index 92% rename from frontend/dist/assets/DataValue-CjX4hzMo.js rename to frontend/dist/assets/DataValue-DoI73agL.js index a4265955..ed19b47c 100644 --- a/frontend/dist/assets/DataValue-CjX4hzMo.js +++ b/frontend/dist/assets/DataValue-DoI73agL.js @@ -1,4 +1,4 @@ -import{d as A,r as a,cv as g,j as o,cw as y}from"./index-CvSa8h-C.js";import{A as x}from"./index-CPifxb0-.js";/** +import{d as A,r as a,cv as g,j as o,cw as y}from"./index-WhzslczH.js";import{A as x}from"./index-WiXmWhPS.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Grid-suKoG48i.js b/frontend/dist/assets/Grid-xhoz0JJL.js similarity index 95% rename from frontend/dist/assets/Grid-suKoG48i.js rename to frontend/dist/assets/Grid-xhoz0JJL.js index f724847d..9894d75d 100644 --- a/frontend/dist/assets/Grid-suKoG48i.js +++ b/frontend/dist/assets/Grid-xhoz0JJL.js @@ -1 +1 @@ -import{r as b,j as c,c as d}from"./index-CvSa8h-C.js";const g={hero:{mobile:12},"hero-tall":{mobile:12},"hero-auto":{mobile:12},panel:{mobile:12,md:6},feature:{mobile:12,md:6,lg:4},standard:{mobile:12,sm:6,lg:4,xl:3},compact:{mobile:6,lg:3},widget:{mobile:6,sm:4,md:3,lg:2},auto:{mobile:12}},p={hero:"bento-row-hero","hero-tall":"bento-row-hero-tall","hero-auto":"bento-row-hero-auto",panel:"bento-row-panel",feature:"bento-row-feature",standard:"bento-row-standard",compact:"bento-row-compact",widget:"bento-row-widget",auto:"bento-row-auto"};function w({template:o,children:r,className:e,gap:n}){const t=g[o],m=p[o],a=n==="none"?"gap-0":n==="sm"?"bento-gap-sm":n==="lg"?"bento-gap-lg":"bento-gap",i=b.Children.map(r,l=>!b.isValidElement(l)||l.type===u?l:c.jsx(u,{span:t.mobile,sm:t.sm,md:t.md,lg:t.lg,xl:t.xl,children:l}));return c.jsx("div",{className:d("bento-row",m,a,e),children:i})}function s(o,r=""){const e=r?`${r}:`:"";return o==="full"?`${e}col-span-full`:o==="auto"?`${e}col-auto`:o===1.5?`${e}bento-col-1-5`:`${e}bento-col-${o}`}function u({children:o,span:r,sm:e,md:n,lg:t,xl:m,ratio:a,className:i}){const l=d("bento-cell",s(r),e&&s(e,"sm"),n&&s(n,"md"),t&&s(t,"lg"),m&&s(m,"xl"),i);return c.jsx("div",{className:l,"data-ratio":a??void 0,style:a?{"--cell-ratio":a}:void 0,children:o})}export{u as C,w as R}; +import{r as b,j as c,c as d}from"./index-WhzslczH.js";const g={hero:{mobile:12},"hero-tall":{mobile:12},"hero-auto":{mobile:12},panel:{mobile:12,md:6},feature:{mobile:12,md:6,lg:4},standard:{mobile:12,sm:6,lg:4,xl:3},compact:{mobile:6,lg:3},widget:{mobile:6,sm:4,md:3,lg:2},auto:{mobile:12}},p={hero:"bento-row-hero","hero-tall":"bento-row-hero-tall","hero-auto":"bento-row-hero-auto",panel:"bento-row-panel",feature:"bento-row-feature",standard:"bento-row-standard",compact:"bento-row-compact",widget:"bento-row-widget",auto:"bento-row-auto"};function w({template:o,children:r,className:e,gap:n}){const t=g[o],m=p[o],a=n==="none"?"gap-0":n==="sm"?"bento-gap-sm":n==="lg"?"bento-gap-lg":"bento-gap",i=b.Children.map(r,l=>!b.isValidElement(l)||l.type===u?l:c.jsx(u,{span:t.mobile,sm:t.sm,md:t.md,lg:t.lg,xl:t.xl,children:l}));return c.jsx("div",{className:d("bento-row",m,a,e),children:i})}function s(o,r=""){const e=r?`${r}:`:"";return o==="full"?`${e}col-span-full`:o==="auto"?`${e}col-auto`:o===1.5?`${e}bento-col-1-5`:`${e}bento-col-${o}`}function u({children:o,span:r,sm:e,md:n,lg:t,xl:m,ratio:a,className:i}){const l=d("bento-cell",s(r),e&&s(e,"sm"),n&&s(n,"md"),t&&s(t,"lg"),m&&s(m,"xl"),i);return c.jsx("div",{className:l,"data-ratio":a??void 0,style:a?{"--cell-ratio":a}:void 0,children:o})}export{u as C,w as R}; diff --git a/frontend/dist/assets/KeycapButton-BQwZ8hrN.js b/frontend/dist/assets/KeycapButton-BshTHlF3.js similarity index 98% rename from frontend/dist/assets/KeycapButton-BQwZ8hrN.js rename to frontend/dist/assets/KeycapButton-BshTHlF3.js index 3fe3816c..d95d30a2 100644 --- a/frontend/dist/assets/KeycapButton-BQwZ8hrN.js +++ b/frontend/dist/assets/KeycapButton-BshTHlF3.js @@ -1 +1 @@ -import{r as l,j as t,Z as O}from"./index-CvSa8h-C.js";import{b as F,c as x}from"./keycap-sfx-ByZp-njj.js";const R={a:"24,3 76,3 83,7 76,11 24,11 17,7",b:"88,22 93,27 93,71 88,76 83,71 83,27",c:"88,106 93,111 93,155 88,160 83,155 83,111",d:"24,171 76,171 83,175 76,179 24,179 17,175",e:"12,106 17,111 17,155 12,160 7,155 7,111",f:"12,22 17,27 17,71 12,76 7,71 7,27",g:"24,86 76,86 83,91 76,96 24,96 17,91"},w=Object.keys(R),N={0:"abcdef",1:"bc",2:"abdeg",3:"abcdg",4:"bcfg",5:"acdfg",6:"acdefg",7:"abc",8:"abcdefg",9:"abcdfg",A:"abcefg",B:"cdefg",C:"adef",D:"bcdeg",E:"adefg",F:"aefg",G:"acdef",H:"bcefg",I:"ef",J:"bcde",L:"def",M:"abcefg",N:"ceg",O:"abcdef",P:"abefg",Q:"abcfg",R:"eg",S:"acdfg",T:"defg",U:"bcdef",V:"cde",Y:"bcdfg",Z:"abdeg",a:"abcefg",b:"cdefg",c:"deg",d:"bcdeg",e:"adefg",f:"aefg",g:"abcdfg",h:"cefg",i:"c",j:"bcde",l:"def",m:"abcef",n:"ceg",o:"cdeg",p:"abefg",r:"eg",s:"acdfg",t:"defg",u:"cde",v:"cde",y:"bcdfg"," ":"",_:"d","-":"g","=":"dg","°":"abfg",'"':"bf","'":"f","(":"adef",")":"abcd","[":"adef","]":"abcd","!":"bc",".":"d"},C=6,D=56,L=2;function B(){return w.filter(()=>Math.random()>.45).join("")}function $(r,i){const n=Array.from(r).map(a=>N[a.toUpperCase()]??N[a]??""),d=Math.max(0,(i??0)-r.length);for(let a=0;a{if(a)return;const e=$(r,d),o=e.length,g=C+(o-1)*L;let y=0,b,E=!1;const k=()=>{if(!E){if(y++,y>=g){f(null);return}f(e.map((j,_)=>{const v=C+_*L;return y>=v?j:B()})),b=setTimeout(k,D)}};return k(),()=>{E=!0,clearTimeout(b)}},[r,d,a]);const c=(e,o)=>t.jsx("svg",{viewBox:"0 0 100 182",width:h,height:n,className:"seven-seg__char","aria-hidden":"true",children:w.map(g=>t.jsx("polygon",{points:R[g],fill:i,stroke:i,strokeWidth:4,strokeLinejoin:"round",opacity:e.includes(g)?1:M},g))},o),s=$(r,d),u=T??s;return t.jsxs("span",{className:`seven-seg${S?` ${S}`:""}`,children:[u.map((e,o)=>c(e,`${o}-${e}`)),t.jsx("span",{className:"sr-only",children:r})]})}const G={grey:"/assets/keycap.svg",red:"/assets/keycap-red.svg"},I=O[900],P="#FFDEB0";function Z({icon:r,variant:i="grey",onClick:n,onPress:d,sentDuration:a=2e3,title:S,disabled:h=!1,className:m,iconColor:M=I,iconActiveColor:T=P,indicators:f}){const c=!!d,[s,u]=l.useState("idle"),[e,o]=l.useState(!1),g=l.useRef(),y=c?s==="held":e,b=c&&(s==="sending"||s==="sent"),E=c?s==="held"||s==="sending":e;l.useEffect(()=>()=>clearTimeout(g.current),[]);const k=l.useCallback(()=>{h||b||(F(),c?u("held"):o(!0))},[h,b,c]),j=l.useCallback(async()=>{if(c){if(s!=="held")return;x(),u("sending");const p=await d();u(p?"sent":"idle"),p&&(g.current=setTimeout(()=>u("idle"),a))}else{if(!e)return;o(!1),x(),n==null||n()}},[c,s,d,a,e,n]),_=l.useCallback(()=>{c?s==="held"&&(x(),u("idle")):(e&&x(),o(!1))},[c,s,e]),v=t.jsx("button",{onMouseDown:k,onMouseUp:j,onMouseLeave:_,onTouchStart:k,onTouchEnd:j,onTouchCancel:_,disabled:h||b,className:`keycap-btn${i==="red"?" keycap-btn--red-cap":""}${E?" keycap-btn--pressed":""}${m&&!f?` ${m}`:""}`,title:S,children:t.jsxs("div",{className:"keycap-wrap",children:[t.jsx("img",{src:G[i],alt:"",className:"keycap-btn__img",draggable:!1}),t.jsx("span",{className:"keycap-icon-overlay",style:{color:y||s==="sending"?T:M},children:r})]})});return f!=null&&f.length?t.jsxs("div",{className:`keycap-group${m?` ${m}`:""}`,children:[v,t.jsx("div",{className:"indicator-key-pair",children:f.map(p=>{const A=p.trackPress?s:p.active?"active":"idle";return t.jsxs("div",{className:`indicator-key${A!=="idle"?` indicator-key--${A}`:""}`,children:[t.jsx("span",{className:"indicator-key__label",children:p.label}),t.jsx("span",{className:"indicator-key__led"})]},p.label)})})]}):v}export{Z as K,Y as S}; +import{r as l,j as t,Z as O}from"./index-WhzslczH.js";import{b as F,c as x}from"./keycap-sfx-ByZp-njj.js";const R={a:"24,3 76,3 83,7 76,11 24,11 17,7",b:"88,22 93,27 93,71 88,76 83,71 83,27",c:"88,106 93,111 93,155 88,160 83,155 83,111",d:"24,171 76,171 83,175 76,179 24,179 17,175",e:"12,106 17,111 17,155 12,160 7,155 7,111",f:"12,22 17,27 17,71 12,76 7,71 7,27",g:"24,86 76,86 83,91 76,96 24,96 17,91"},w=Object.keys(R),N={0:"abcdef",1:"bc",2:"abdeg",3:"abcdg",4:"bcfg",5:"acdfg",6:"acdefg",7:"abc",8:"abcdefg",9:"abcdfg",A:"abcefg",B:"cdefg",C:"adef",D:"bcdeg",E:"adefg",F:"aefg",G:"acdef",H:"bcefg",I:"ef",J:"bcde",L:"def",M:"abcefg",N:"ceg",O:"abcdef",P:"abefg",Q:"abcfg",R:"eg",S:"acdfg",T:"defg",U:"bcdef",V:"cde",Y:"bcdfg",Z:"abdeg",a:"abcefg",b:"cdefg",c:"deg",d:"bcdeg",e:"adefg",f:"aefg",g:"abcdfg",h:"cefg",i:"c",j:"bcde",l:"def",m:"abcef",n:"ceg",o:"cdeg",p:"abefg",r:"eg",s:"acdfg",t:"defg",u:"cde",v:"cde",y:"bcdfg"," ":"",_:"d","-":"g","=":"dg","°":"abfg",'"':"bf","'":"f","(":"adef",")":"abcd","[":"adef","]":"abcd","!":"bc",".":"d"},C=6,D=56,L=2;function B(){return w.filter(()=>Math.random()>.45).join("")}function $(r,i){const n=Array.from(r).map(a=>N[a.toUpperCase()]??N[a]??""),d=Math.max(0,(i??0)-r.length);for(let a=0;a{if(a)return;const e=$(r,d),o=e.length,g=C+(o-1)*L;let y=0,b,E=!1;const k=()=>{if(!E){if(y++,y>=g){f(null);return}f(e.map((j,_)=>{const v=C+_*L;return y>=v?j:B()})),b=setTimeout(k,D)}};return k(),()=>{E=!0,clearTimeout(b)}},[r,d,a]);const c=(e,o)=>t.jsx("svg",{viewBox:"0 0 100 182",width:h,height:n,className:"seven-seg__char","aria-hidden":"true",children:w.map(g=>t.jsx("polygon",{points:R[g],fill:i,stroke:i,strokeWidth:4,strokeLinejoin:"round",opacity:e.includes(g)?1:M},g))},o),s=$(r,d),u=T??s;return t.jsxs("span",{className:`seven-seg${S?` ${S}`:""}`,children:[u.map((e,o)=>c(e,`${o}-${e}`)),t.jsx("span",{className:"sr-only",children:r})]})}const G={grey:"/assets/keycap.svg",red:"/assets/keycap-red.svg"},I=O[900],P="#FFDEB0";function Z({icon:r,variant:i="grey",onClick:n,onPress:d,sentDuration:a=2e3,title:S,disabled:h=!1,className:m,iconColor:M=I,iconActiveColor:T=P,indicators:f}){const c=!!d,[s,u]=l.useState("idle"),[e,o]=l.useState(!1),g=l.useRef(),y=c?s==="held":e,b=c&&(s==="sending"||s==="sent"),E=c?s==="held"||s==="sending":e;l.useEffect(()=>()=>clearTimeout(g.current),[]);const k=l.useCallback(()=>{h||b||(F(),c?u("held"):o(!0))},[h,b,c]),j=l.useCallback(async()=>{if(c){if(s!=="held")return;x(),u("sending");const p=await d();u(p?"sent":"idle"),p&&(g.current=setTimeout(()=>u("idle"),a))}else{if(!e)return;o(!1),x(),n==null||n()}},[c,s,d,a,e,n]),_=l.useCallback(()=>{c?s==="held"&&(x(),u("idle")):(e&&x(),o(!1))},[c,s,e]),v=t.jsx("button",{onMouseDown:k,onMouseUp:j,onMouseLeave:_,onTouchStart:k,onTouchEnd:j,onTouchCancel:_,disabled:h||b,className:`keycap-btn${i==="red"?" keycap-btn--red-cap":""}${E?" keycap-btn--pressed":""}${m&&!f?` ${m}`:""}`,title:S,children:t.jsxs("div",{className:"keycap-wrap",children:[t.jsx("img",{src:G[i],alt:"",className:"keycap-btn__img",draggable:!1}),t.jsx("span",{className:"keycap-icon-overlay",style:{color:y||s==="sending"?T:M},children:r})]})});return f!=null&&f.length?t.jsxs("div",{className:`keycap-group${m?` ${m}`:""}`,children:[v,t.jsx("div",{className:"indicator-key-pair",children:f.map(p=>{const A=p.trackPress?s:p.active?"active":"idle";return t.jsxs("div",{className:`indicator-key${A!=="idle"?` indicator-key--${A}`:""}`,children:[t.jsx("span",{className:"indicator-key__label",children:p.label}),t.jsx("span",{className:"indicator-key__led"})]},p.label)})})]}):v}export{Z as K,Y as S}; diff --git a/frontend/dist/assets/LightSparkline-BjpzakdT.js b/frontend/dist/assets/LightSparkline-CIu8T-_d.js similarity index 96% rename from frontend/dist/assets/LightSparkline-BjpzakdT.js rename to frontend/dist/assets/LightSparkline-CIu8T-_d.js index f5bd4ff2..4a1fa4d4 100644 --- a/frontend/dist/assets/LightSparkline-BjpzakdT.js +++ b/frontend/dist/assets/LightSparkline-CIu8T-_d.js @@ -1 +1 @@ -import{r as y,j as t}from"./index-CvSa8h-C.js";const j="var(--sys-cyan)",k="var(--sys-blue)",v="var(--sys-indigo)",g="var(--sparkline-critical)",I="var(--fg-muted)";function E(f,o,s,e=2){if(f.length<2)return"";const r=f.map(n=>n.count),x=Math.max(...r,1),u=Math.min(...r),c=x-u||1,m=o-e*2,l=s-e*2,i=r.map((n,p)=>({x:e+p/(r.length-1)*m,y:e+l-(n-u)/c*l}));let a=`M ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)}`;for(let n=1;nE(o,s,e),[o,s,e]),a=!r&&o.length>=2,n=r??(a?`url(#${l})`:I);return u&&o.length<2?t.jsx("div",{className:`flex items-center justify-center ${c}`,style:{width:s,height:e},children:t.jsx("div",{className:"rounded animate-pulse bg-subtle-fill-hover",style:{width:s-8,height:e-6}})}):o.length<2?t.jsx("svg",{width:s,height:e,viewBox:`0 0 ${s} ${e}`,className:c,"aria-hidden":"true",children:t.jsx("line",{x1:4,y1:e/2,x2:s-4,y2:e/2,stroke:g,strokeWidth:1.5,strokeDasharray:"3,2"})}):t.jsxs("svg",{width:s,height:e,viewBox:`0 0 ${s} ${e}`,preserveAspectRatio:"none",className:c,"aria-hidden":"true",style:{maxWidth:"100%"},children:[a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,gradientUnits:"userSpaceOnUse",x1:0,y1:2,x2:0,y2:e-2,children:[t.jsx("stop",{offset:"0%",stopColor:x?v:j}),t.jsx("stop",{offset:"50%",stopColor:k}),t.jsx("stop",{offset:"100%",stopColor:x?j:v})]})}),t.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})});export{O as L}; +import{r as y,j as t}from"./index-WhzslczH.js";const j="var(--sys-cyan)",k="var(--sys-blue)",v="var(--sys-indigo)",g="var(--sparkline-critical)",I="var(--fg-muted)";function E(f,o,s,e=2){if(f.length<2)return"";const r=f.map(n=>n.count),x=Math.max(...r,1),u=Math.min(...r),c=x-u||1,m=o-e*2,l=s-e*2,i=r.map((n,p)=>({x:e+p/(r.length-1)*m,y:e+l-(n-u)/c*l}));let a=`M ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)}`;for(let n=1;nE(o,s,e),[o,s,e]),a=!r&&o.length>=2,n=r??(a?`url(#${l})`:I);return u&&o.length<2?t.jsx("div",{className:`flex items-center justify-center ${c}`,style:{width:s,height:e},children:t.jsx("div",{className:"rounded animate-pulse bg-subtle-fill-hover",style:{width:s-8,height:e-6}})}):o.length<2?t.jsx("svg",{width:s,height:e,viewBox:`0 0 ${s} ${e}`,className:c,"aria-hidden":"true",children:t.jsx("line",{x1:4,y1:e/2,x2:s-4,y2:e/2,stroke:g,strokeWidth:1.5,strokeDasharray:"3,2"})}):t.jsxs("svg",{width:s,height:e,viewBox:`0 0 ${s} ${e}`,preserveAspectRatio:"none",className:c,"aria-hidden":"true",style:{maxWidth:"100%"},children:[a&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:l,gradientUnits:"userSpaceOnUse",x1:0,y1:2,x2:0,y2:e-2,children:[t.jsx("stop",{offset:"0%",stopColor:x?v:j}),t.jsx("stop",{offset:"50%",stopColor:k}),t.jsx("stop",{offset:"100%",stopColor:x?j:v})]})}),t.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})});export{O as L}; diff --git a/frontend/dist/assets/Login-CO56EEwr.js b/frontend/dist/assets/Login-EFNGv6qi.js similarity index 99% rename from frontend/dist/assets/Login-CO56EEwr.js rename to frontend/dist/assets/Login-EFNGv6qi.js index c5aa3c3a..13743a06 100644 --- a/frontend/dist/assets/Login-CO56EEwr.js +++ b/frontend/dist/assets/Login-EFNGv6qi.js @@ -1,3 +1,3 @@ -import{r as o,j as e,u as F,g as Y,i as $,s as Z,l as X,m as L,a as q,b as S,c as H,I as A,C as O,A as z,B as U,Z as V}from"./index-CvSa8h-C.js";import{g as T,B as G,r as K,T as J}from"./ascii-burst-DN6etEs5.js";const w=["@@@@@@@ @@@ @@@ @@@@@@@@@@ @@@@@@@ ","@@@@@@@@ @@@ @@@ @@@@@@@@@@@ @@@@@@@@ ","@@! @@@ @@! !@@ @@! @@! @@! !@@ ","!@! @!@ !@! @!! !@! !@! !@! !@! ","@!@@!@! !@!@! @!! !!@ @!@ !@! ","!!@!!! @!!! !@! ! !@! !!! ","!!: !!: !!: !!: :!! ",":!: :!: :!: :!: :!: "," :: :: ::: :: ::: ::: "," : : : : :: :: : "],Q=J-1,ee=w.length,te=Math.max(...w.map(s=>s.length)),se=.994,ne=.08,re=.25,ae=8,oe=9.6,ie=20,W=.008,k=20,_=" . ˙·∙⁺˚°:;~*+✧✩×✴░✦✶✳oO▒#%&xX▓@MW8B█████",ce={" ":0,".":.08,":":.15,"!":.5,"@":.85,"#":.6,$:.7,"%":.65,"&":.6,"*":.3,"+":.25,"-":.1,"=":.2,_:.05,"~":.2,"^":.15,"|":.4,"/":.3,"\\":.3,"(":.35,")":.35,"[":.4,"]":.4,"{":.45,"}":.45,"<":.3,">":.3,"?":.4,";":.2,"'":.1,'"':.15,",":.08,"`":.05};function le(s){let t="",n=0,a=!1,x="",p=!1,l=!1,g=!1;for(;n",a=!1),x="",p=!1,l=!1,g=!1;else if(u==="1")p=!0,g=!0;else if(u==="2")l=!0,g=!0;else if(u.startsWith("38;2;")){const C=u.split(";");x=`rgb(${C[2]},${C[3]},${C[4]})`,g=!0}}else{if(g){a&&(t+="");const u=[];x&&u.push(`color:${x}`),p&&u.push("font-weight:700"),l&&u.push("opacity:0.6"),u.length>0?(t+=``,a=!0):a=!1,g=!1}const h=s[n];h==="<"?t+="<":h===">"?t+=">":h==="&"?t+="&":t+=h,n++}return a&&(t+=""),t}function P(s){let t="";for(let n=0;n0&&(t+=` +import{r as o,j as e,u as F,g as Y,i as $,s as Z,l as X,m as L,a as q,b as S,c as H,I as A,C as O,A as z,B as U,Z as V}from"./index-WhzslczH.js";import{g as T,B as G,r as K,T as J}from"./ascii-burst-DN6etEs5.js";const w=["@@@@@@@ @@@ @@@ @@@@@@@@@@ @@@@@@@ ","@@@@@@@@ @@@ @@@ @@@@@@@@@@@ @@@@@@@@ ","@@! @@@ @@! !@@ @@! @@! @@! !@@ ","!@! @!@ !@! @!! !@! !@! !@! !@! ","@!@@!@! !@!@! @!! !!@ @!@ !@! ","!!@!!! @!!! !@! ! !@! !!! ","!!: !!: !!: !!: :!! ",":!: :!: :!: :!: :!: "," :: :: ::: :: ::: ::: "," : : : : :: :: : "],Q=J-1,ee=w.length,te=Math.max(...w.map(s=>s.length)),se=.994,ne=.08,re=.25,ae=8,oe=9.6,ie=20,W=.008,k=20,_=" . ˙·∙⁺˚°:;~*+✧✩×✴░✦✶✳oO▒#%&xX▓@MW8B█████",ce={" ":0,".":.08,":":.15,"!":.5,"@":.85,"#":.6,$:.7,"%":.65,"&":.6,"*":.3,"+":.25,"-":.1,"=":.2,_:.05,"~":.2,"^":.15,"|":.4,"/":.3,"\\":.3,"(":.35,")":.35,"[":.4,"]":.4,"{":.45,"}":.45,"<":.3,">":.3,"?":.4,";":.2,"'":.1,'"':.15,",":.08,"`":.05};function le(s){let t="",n=0,a=!1,x="",p=!1,l=!1,g=!1;for(;n",a=!1),x="",p=!1,l=!1,g=!1;else if(u==="1")p=!0,g=!0;else if(u==="2")l=!0,g=!0;else if(u.startsWith("38;2;")){const C=u.split(";");x=`rgb(${C[2]},${C[3]},${C[4]})`,g=!0}}else{if(g){a&&(t+="");const u=[];x&&u.push(`color:${x}`),p&&u.push("font-weight:700"),l&&u.push("opacity:0.6"),u.length>0?(t+=``,a=!0):a=!1,g=!1}const h=s[n];h==="<"?t+="<":h===">"?t+=">":h==="&"?t+="&":t+=h,n++}return a&&(t+=""),t}function P(s){let t="";for(let n=0;n0&&(t+=` `),t+=le(s[n]);return t}const ue="rgb(91,91,214)",y=[[91,91,214],[72,70,200],[110,110,230],[150,150,245],[190,210,255],[0,240,255],[255,50,180],[80,255,180]];function R(s,t,n){return`rgb(${Math.round(s[0]+(t[0]-s[0])*n)},${Math.round(s[1]+(t[1]-s[1])*n)},${Math.round(s[2]+(t[2]-s[2])*n)})`}function de(s){const t=Math.max(0,Math.min(.999,s));return _[Math.floor(t*_.length)]}function me(s){return ce[s]??.5}function he(s,t){const n=Math.abs(s);if(n<.3)return R(y[0],y[2],n/.3);if(n<.6){const a=(n-.3)/.3;return R(y[3],y[4],a)}else{const a=Math.sin(t*17.3)*.5+.5;return a<.4?R(y[4],y[5],(n-.6)/.4):a<.6?`rgb(${y[6].join(",")})`:a<.7?`rgb(${y[7].join(",")})`:"rgb(255,252,255)"}}function I(s){let t="";for(let n=0;n0&&(t+=` `);const a=w[n]||"";for(let x=0;x0?Math.exp(-m*m/2):Math.exp(-m*m/12),j=c*re-C.radius*.4,M=Math.sin(j*Math.PI),d=b*C.strength;l+=b*M*C.strength,d>h&&(h=d,g=j+n*.1+x*.05)}if(l=Math.max(-1,Math.min(1,l)),Math.abs(l)${p}`;else{const r=me(p)+l*.5,i=Math.max(.02,Math.min(.98,r)),c=de(i),f=he(l,g);t+=`${c}`}}}return t}function Ce(){const s=o.useRef(null),t=o.useRef([]),n=o.useRef(0),[a,x]=o.useState(!1);o.useEffect(()=>{const r=s.current;if(!r)return;let i=0;r.innerHTML=P(T(w,0));const c=setInterval(()=>{if(i++,i>Q){clearInterval(c),x(!0);return}r.innerHTML=P(T(w,i))},G);return()=>{clearInterval(c),K()}},[]),o.useEffect(()=>{if(!a)return;const r=s.current;if(!r)return;let i=!0;const c=()=>{if(!i)return;const f=t.current;for(const m of f)m.radius+=ne,m.strength*=se;t.current=f.filter(m=>m.strength>W),t.current.length>0?r.innerHTML=I(t.current):r.innerHTML=I([]),n.current=requestAnimationFrame(c)};return n.current=requestAnimationFrame(c),()=>{i=!1,cancelAnimationFrame(n.current)}},[a]);const p=o.useRef(null),l=o.useCallback((r,i,c=1)=>{const f=s.current;if(!f||!a)return;const m=f.getBoundingClientRect(),b=r-m.left,j=i-m.top,M=b/oe,d=j/ie;t.current.length>=ae&&t.current.shift(),t.current.push({cx:M,cy:d,radius:0,strength:c}),p.current={x:r,y:i}},[a]),g=o.useCallback(r=>{const i=p.current;if(i){const c=r.clientX-i.x,f=r.clientY-i.y;if(Math.sqrt(c*c+f*f){l(r.clientX,r.clientY,1)},[l]),u=o.useCallback(r=>{p.current=null,l(r.clientX,r.clientY,.6)},[l]),C=o.useCallback(r=>{if(r.touches.length>0){const i=r.touches[0],c=p.current;if(c){const f=i.clientX-c.x,m=i.clientY-c.y;if(Math.sqrt(f*f+m*m)e.jsx("span",{className:"text-white/20 text-xs","aria-hidden":"true",children:"•"}),be=o.memo(function(){return e.jsx("div",{className:"fixed inset-0 -z-10",style:{backgroundColor:V[950]},"aria-hidden":"true"})}),ve=o.memo(function(){return e.jsxs(L.footer,{variants:v.footer,initial:"hidden",animate:"visible",className:"fixed bottom-0 inset-x-0 px-4 py-6",children:[e.jsx("p",{className:"text-center type-badge text-white/40 mb-3",children:"Powered By"}),e.jsx("div",{className:"mx-auto max-w-xs",children:e.jsxs("div",{className:"flex items-center justify-center gap-4",children:[e.jsx(E,{href:"https://github.com/rightup/pyMC_Repeater",children:e.jsx("img",{src:Le,alt:"pyMC",className:"h-14"})}),e.jsx(D,{}),e.jsx(E,{href:"https://meshcore.co.uk",children:e.jsx(xe,{height:12,className:"text-white"})}),e.jsx(D,{}),e.jsxs(E,{href:"https://wcmesh.com",children:[e.jsx("div",{className:"size-14 overflow-hidden radius-badge border border-white/10 -translate-y-1",children:e.jsx("img",{src:ge,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),je={session_expired:"Your session has expired. Please sign in again.",no_token:"Authentication required. Please sign in.",token_expired_away:"Your session expired while you were away."};function Ne(){const s=F(),[t,n]=o.useState("admin"),[a,x]=o.useState(""),[p,l]=o.useState(Y),[g,h]=o.useState(!1),[u,C]=o.useState(null),[r]=o.useState(()=>{try{const d=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),d?je[d]??null:null}catch{return null}}),i=t.length>0&&a.length>0&&!g;o.useEffect(()=>{$()&&s("/",{replace:!0})},[s]);const c=o.useCallback(()=>C(null),[]),f=o.useCallback(d=>{n(d.target.value),u&&c()},[u,c]),m=o.useCallback(d=>{x(d.target.value),u&&c()},[u,c]),b=o.useCallback(d=>{l(d),Z(d)},[]),j=o.useCallback(async d=>{if(d.preventDefault(),!i)return;h(!0),C(null);const N=await X(t,a,p);h(!1),N.success?window.location.href="/":C(N.error??"Login failed")},[i,t,a,p]),M=o.useCallback(d=>{d.key==="Enter"&&i&&d.target.tagName==="INPUT"&&(d.preventDefault(),d.currentTarget.requestSubmit())},[i]);return e.jsxs(e.Fragment,{children:[e.jsx(be,{}),e.jsx("main",{className:"flex min-h-svh items-center justify-center px-4 py-6 sm:px-6 lg:px-8 -mt-6",children:e.jsxs(L.div,{variants:v.container,initial:"hidden",animate:"visible",className:"w-full max-w-sm space-y-10",children:[e.jsx(L.div,{variants:v.item,className:"flex justify-center",children:e.jsx(fe,{})}),r&&!u&&e.jsx(L.div,{variants:v.item,className:"rounded-md bg-sys-amber/10 px-3 py-2.5 text-center",children:e.jsx("p",{className:"text-sm text-sys-amber",children:r})}),e.jsxs(L.form,{variants:v.item,onSubmit:j,onKeyDown:M,className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"username",className:B,children:"Username"}),e.jsx("div",{className:"mt-2",children:e.jsx(A,{id:"username",name:"username",type:"text",value:t,onChange:f,required:!0,autoComplete:"username",className:"font-mono text-sm font-semibold"})})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"password",className:B,children:"Password"}),e.jsx("div",{className:"mt-2",children:e.jsx(A,{id:"password",name:"password",type:"password",value:a,onChange:m,required:!0,autoComplete:"current-password",autoFocus:!0,className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(O,{checked:p,onChange:b,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(z,{mode:"wait",children:u&&e.jsx(L.div,{variants:v.error,initial:"hidden",animate:"visible",exit:"exit",role:"alert",className:"rounded-md bg-sys-red/10 p-3 overflow-hidden",children:e.jsx("p",{className:"text-sm text-sys-red text-center",children:u})},"error")}),e.jsx(L.div,{whileTap:i?{scale:.98}:void 0,children:e.jsx(U,{type:"submit",disabled:!i,className:"w-full py-3 radius-pill font-mono text-sm font-semibold uppercase tracking-wide text-white bg-sys-indigo hover:bg-sys-blue shadow-sm transition-colors",children:g?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(ye,{className:"size-4"}),"Signing in…"]}):"Sign in"})})]}),e.jsxs(L.p,{variants:v.item,className:"text-center text-sm/6 text-fg-muted",children:["A ",e.jsx("span",{className:"text-sys-blue",children:"@RightUp"})," X"," ",e.jsx("span",{className:"text-sys-blue",children:"@Treehouse⚡"})," Collab"]})]})}),e.jsx(ve,{})]})}export{Ne as default}; diff --git a/frontend/dist/assets/Logs-BreOeqGn.js b/frontend/dist/assets/Logs-BT5P96Jv.js similarity index 92% rename from frontend/dist/assets/Logs-BreOeqGn.js rename to frontend/dist/assets/Logs-BT5P96Jv.js index 556700eb..d8d6bcf4 100644 --- a/frontend/dist/assets/Logs-BreOeqGn.js +++ b/frontend/dist/assets/Logs-BT5P96Jv.js @@ -1 +1 @@ -import{dp as h,dq as f,J as j,dr as L,ds as v,r as l,dt as N,j as e,du as m,N as y,B as w,c as r,dv as b,de as C,m as S,dw as E}from"./index-CvSa8h-C.js";import{P,a as R,B as k,C as B}from"./PageLayout-B8orsDlo.js";import{C as I,a as T}from"./circle-stop-B5RN0x4p.js";const D=l.memo(function({log:a}){return e.jsx(S.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:r("type-data-sm w-14 shrink-0",E(a.level)),children:a.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:a.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(a.timestamp).toLocaleString()})]})]})})});function M({showDebug:s,onToggle:a}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:r("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(C,{enabled:s,onChange:a,size:"sm"})]})}function O(){const s=h(),a=f(),o=j(),i=L(),g=v(),[c,x]=l.useState(!1),u=l.useCallback(()=>{x(t=>!t)},[]),d=c?s:s.filter(t=>t.level!=="DEBUG"),n=l.useRef(i);return n.current=i,l.useEffect(()=>{if(!o)return;n.current();const t=setInterval(()=>n.current(),N.logs);return()=>clearInterval(t)},[o]),e.jsxs(P,{children:[e.jsx(R,{title:"System Logs",icon:e.jsx(m,{}),controls:e.jsx(M,{showDebug:c,onToggle:u})}),e.jsx(k,{ready:!0,children:e.jsxs(B,{neomorphic:!0,noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(m,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(w,{plain:!0,color:o?"danger":"primary",onClick:()=>g(!o),title:o?"Pause":"Resume",className:r(!o&&"animate-pulse-slow"),children:o?e.jsx(I,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(T,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:a&&s.length===0?e.jsx(b,{count:10}):d.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:s.length===0?"No logs available":"No logs match selected filters"}):d.map((t,p)=>e.jsx(D,{log:t},`${t.timestamp}-${p}`))})]})})]})}export{O as default}; +import{dp as h,dq as f,J as j,dr as L,ds as v,r as l,dt as N,j as e,du as m,N as y,B as w,c as r,dv as b,de as C,m as S,dw as E}from"./index-WhzslczH.js";import{P,a as R,B as k,C as B}from"./PageLayout-CjepFyhn.js";import{C as I,a as T}from"./circle-stop-e_aFfaa6.js";const D=l.memo(function({log:a}){return e.jsx(S.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15,ease:"easeOut"},className:"p-3 bg-subtle-fill/80 radius-inner depth-stroke-raised hover:bg-subtle-fill-strong transition-base",children:e.jsxs("div",{className:"flex items-baseline gap-3",children:[e.jsx("span",{className:r("type-data-sm w-14 shrink-0",E(a.level)),children:a.level}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"type-data-sm text-fg-primary break-words whitespace-pre-wrap",children:a.message}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:new Date(a.timestamp).toLocaleString()})]})]})})});function M({showDebug:s,onToggle:a}){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:r("type-data-sm",s?"text-sys-orange":"text-sys-cyan"),children:s?"DEBUG":"INFO"}),e.jsx(C,{enabled:s,onChange:a,size:"sm"})]})}function O(){const s=h(),a=f(),o=j(),i=L(),g=v(),[c,x]=l.useState(!1),u=l.useCallback(()=>{x(t=>!t)},[]),d=c?s:s.filter(t=>t.level!=="DEBUG"),n=l.useRef(i);return n.current=i,l.useEffect(()=>{if(!o)return;n.current();const t=setInterval(()=>n.current(),N.logs);return()=>clearInterval(t)},[o]),e.jsxs(P,{children:[e.jsx(R,{title:"System Logs",icon:e.jsx(m,{}),controls:e.jsx(M,{showDebug:c,onToggle:u})}),e.jsx(k,{ready:!0,children:e.jsxs(B,{neomorphic:!0,noPadding:!0,children:[e.jsx(y,{listHeader:!0,icon:e.jsx(m,{className:"icon-sm"}),title:"Log Entries",actions:e.jsx(w,{plain:!0,color:o?"danger":"primary",onClick:()=>g(!o),title:o?"Pause":"Resume",className:r(!o&&"animate-pulse-slow"),children:o?e.jsx(I,{"data-slot":"icon",className:"!w-5 !h-5"}):e.jsx(T,{"data-slot":"icon",className:"!w-5 !h-5"})})}),e.jsx("div",{className:"space-y-2 max-h-[calc(100dvh-226px)] sm:max-h-[calc(100dvh-234px)] lg:max-h-[calc(100vh-194px)] overflow-y-auto p-4",children:a&&s.length===0?e.jsx(b,{count:10}):d.length===0?e.jsx("div",{className:"text-center py-12 text-fg-muted",children:s.length===0?"No logs available":"No logs match selected filters"}):d.map((t,p)=>e.jsx(D,{log:t},`${t.timestamp}-${p}`))})]})})]})}export{O as default}; diff --git a/frontend/dist/assets/MeshGraph-8GIpDJZb.js b/frontend/dist/assets/MeshGraph-V9pZlvEq.js similarity index 99% rename from frontend/dist/assets/MeshGraph-8GIpDJZb.js rename to frontend/dist/assets/MeshGraph-V9pZlvEq.js index 2d5ec5a9..54d80023 100644 --- a/frontend/dist/assets/MeshGraph-8GIpDJZb.js +++ b/frontend/dist/assets/MeshGraph-V9pZlvEq.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-Br3jubF3.js","assets/index-CvSa8h-C.js","assets/max-B4xU84un.js","assets/consumer-registry-BsBD_8RF.js","assets/badge-colors-MuK22b26.js","assets/triangle-alert-C7tm61-l.js","assets/database-bNR-4XQS.js","assets/DataBox-CwAsAwyY.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/target-M8AQjykJ.js","assets/layers-Cnw2L-3K.js","assets/search-BZtD4Hr8.js","assets/download-CNAyp-3r.js","assets/settings-2-CLi8XLBD.js","assets/chevron-right-1kmv-Vqa.js","assets/network-VirimdjG.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); -var aL=Object.defineProperty;var lL=(i,e,t)=>e in i?aL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var b=(i,e,t)=>lL(i,typeof e!="symbol"?e+"":e,t);import{d as Vl,r as U,_ as p0,b6 as cn,c2 as pg,cU as cL,cV as uL,j as f,am as dL,an as m0,bo as Gl,c as oh,cW as hL,m as ga,D as J_,L as mg,cX as RS,cY as jh,cZ as PS,c_ as fL,cb as pL,A as Jc,c$ as mL,aq as gL,d0 as _L,d1 as yL,d2 as bL,d3 as vL,d4 as xL,d5 as wL,d6 as SL,K as EL,cn as CL,d7 as TL,d8 as Ge,Z as qt,d9 as g0,x as Di,a9 as be,da as kL,db as AL,R as gg,dc as IL,ao as Pc,dd as LL,aH as RL,de as PL,df as NL,B as ey,E as DL,F as ML,dg as OL}from"./index-CvSa8h-C.js";import{m as _0,t as _g,a as BL,b as FL,e as Rn,G as Gp,s as zL,c as UL,u as $L,d as jL,M as NS,f as HL,E as VL,g as y0,h as ty}from"./max-B4xU84un.js";import{u as GL,r as WL,f as b0,g as YL,e as qL}from"./consumer-registry-BsBD_8RF.js";import{C as XL,N as KL,b as ZL}from"./badge-colors-MuK22b26.js";import{T as QL}from"./triangle-alert-C7tm61-l.js";import{D as v0}from"./database-bNR-4XQS.js";import{D as JL}from"./DataBox-CwAsAwyY.js";import{e as eR,f as x0,g as tR}from"./meshcore-tx-constants-DgpFTAmf.js";import{E as iR,T as nR}from"./target-M8AQjykJ.js";import{L as w0}from"./layers-Cnw2L-3K.js";import{S as S0}from"./search-BZtD4Hr8.js";import{D as E0}from"./download-CNAyp-3r.js";import{S as C0}from"./settings-2-CLi8XLBD.js";import{C as Wp}from"./chevron-right-1kmv-Vqa.js";import{N as sR}from"./network-VirimdjG.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-C8RX9Ou8.js","assets/index-WhzslczH.js","assets/max-Ch6kRxV_.js","assets/consumer-registry-DcpFyHd4.js","assets/badge-colors-BgV-I1O5.js","assets/triangle-alert-BsvKjxO1.js","assets/database-Hkah1WM3.js","assets/DataBox-ABvJ7hn1.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/target-PpDPv2u2.js","assets/layers-rhF42Hfn.js","assets/search-DttoJEPu.js","assets/download-7lpHRyVo.js","assets/settings-2-DdLL0vPm.js","assets/chevron-right-Ewog5LA3.js","assets/network-BXTFbhix.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); +var aL=Object.defineProperty;var lL=(i,e,t)=>e in i?aL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var b=(i,e,t)=>lL(i,typeof e!="symbol"?e+"":e,t);import{d as Vl,r as U,_ as p0,b6 as cn,c2 as pg,cU as cL,cV as uL,j as f,am as dL,an as m0,bo as Gl,c as oh,cW as hL,m as ga,D as J_,L as mg,cX as RS,cY as jh,cZ as PS,c_ as fL,cb as pL,A as Jc,c$ as mL,aq as gL,d0 as _L,d1 as yL,d2 as bL,d3 as vL,d4 as xL,d5 as wL,d6 as SL,K as EL,cn as CL,d7 as TL,d8 as Ge,Z as qt,d9 as g0,x as Di,a9 as be,da as kL,db as AL,R as gg,dc as IL,ao as Pc,dd as LL,aH as RL,de as PL,df as NL,B as ey,E as DL,F as ML,dg as OL}from"./index-WhzslczH.js";import{m as _0,t as _g,a as BL,b as FL,e as Rn,G as Gp,s as zL,c as UL,u as $L,d as jL,M as NS,f as HL,E as VL,g as y0,h as ty}from"./max-Ch6kRxV_.js";import{u as GL,r as WL,f as b0,g as YL,e as qL}from"./consumer-registry-DcpFyHd4.js";import{C as XL,N as KL,b as ZL}from"./badge-colors-BgV-I1O5.js";import{T as QL}from"./triangle-alert-BsvKjxO1.js";import{D as v0}from"./database-Hkah1WM3.js";import{D as JL}from"./DataBox-ABvJ7hn1.js";import{e as eR,f as x0,g as tR}from"./meshcore-tx-constants-DgpFTAmf.js";import{E as iR,T as nR}from"./target-PpDPv2u2.js";import{L as w0}from"./layers-rhF42Hfn.js";import{S as S0}from"./search-DttoJEPu.js";import{D as E0}from"./download-7lpHRyVo.js";import{S as C0}from"./settings-2-DdLL0vPm.js";import{C as Wp}from"./chevron-right-Ewog5LA3.js";import{N as sR}from"./network-BXTFbhix.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -39,7 +39,7 @@ ${r}${o}${i.type.toUpperCase()}: ${i.message}

Compilation error in ${r}



 ${o}
-
`,l.style.top="10px",l.style.left="10px",l.style.position="absolute",l.style.zIndex="9999",l.style.width="100%",l.style.textAlign="left",document.body.appendChild(l),(n=document.getElementsByClassName("luma-compiler-log-error")[0])==null||n.scrollIntoView(),l.onclick=()=>{const c=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(c)}}};$(v2,"defaultProps",{..._n.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let ON=v2;function BN(i){return FN(i.source)||i.id||hy(`unnamed ${i.stage}-shader`)}function FN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const w2=class S2 extends _n{constructor(e,t){super(e,t,S2.defaultProps),$(this,"shaderLayout"),$(this,"bufferLayout"),$(this,"linkStatus","pending"),$(this,"hash",""),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}get[Symbol.toStringTag](){return"RenderPipeline"}};$(w2,"defaultProps",{..._n.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",colorAttachmentFormats:void 0,depthStencilAttachmentFormat:void 0,parameters:{},bindings:{},uniforms:{}});let Zh=w2;const E2=class C2 extends _n{constructor(e,t){super(e,t,C2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(E2,"defaultProps",{..._n.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let Q0=E2;function zN(i){return HN[i]}function UN(i){const[e,t]=jN[i],n=e==="i32"||e==="u32",s=e!=="u32",r=$N[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const $N={f32:4,f16:2,i32:4,u32:4},jN={f32:["f32",1],"vec2":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},HN={f32:{type:"f32",components:1},f16:{type:"f16",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"f16",components:2},"vec3":{type:"f16",components:3},"vec4":{type:"f16",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16},"mat2x2":{type:"f16",components:4},"mat2x3":{type:"f16",components:6},"mat2x4":{type:"f16",components:8},"mat3x2":{type:"f16",components:6},"mat3x3":{type:"f16",components:9},"mat3x4":{type:"f16",components:12},"mat4x2":{type:"f16",components:8},"mat4x3":{type:"f16",components:12},"mat4x4":{type:"f16",components:16},"mat2x2":{type:"i32",components:4},"mat2x3":{type:"i32",components:6},"mat2x4":{type:"i32",components:8},"mat3x2":{type:"i32",components:6},"mat3x3":{type:"i32",components:9},"mat3x4":{type:"i32",components:12},"mat4x2":{type:"i32",components:8},"mat4x3":{type:"i32",components:12},"mat4x4":{type:"i32",components:16},"mat2x2":{type:"u32",components:4},"mat2x3":{type:"u32",components:6},"mat2x4":{type:"u32",components:8},"mat3x2":{type:"u32",components:6},"mat3x3":{type:"u32",components:9},"mat3x4":{type:"u32",components:12},"mat4x2":{type:"u32",components:8},"mat4x3":{type:"u32",components:12},"mat4x4":{type:"u32",components:16}};function T2(i,e){const t={};for(const n of i.attributes){const s=VN(i,e,n.name);s&&(t[n.name]=s)}return t}function Rte(i,e,t=16){const n=T2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function VN(i,e,t){const n=GN(i,t),s=WN(e,t);if(!n)return null;const r=UN(n.type),o=uN(r),a=(s==null?void 0:s.vertexFormat)||o,l=py(a);return{attributeName:(s==null?void 0:s.attributeName)||n.name,bufferName:(s==null?void 0:s.bufferName)||n.name,location:n.location,shaderType:n.type,primitiveType:r.primitiveType,shaderComponents:r.components,vertexFormat:a,bufferDataType:l.type,bufferComponents:l.components,normalized:l.normalized,integer:r.integer,stepMode:(s==null?void 0:s.stepMode)||n.stepMode||"vertex",byteOffset:(s==null?void 0:s.byteOffset)||0,byteStride:(s==null?void 0:s.byteStride)||0}}function GN(i,e){const t=i.attributes.find(n=>n.name===e);return t||le.warn(`shader layout attribute "${e}" not present in shader`),t||null}function WN(i,e){YN(i);let t=qN(i,e);return t||(t=XN(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function YN(i){for(const e of i)(e.attributes&&e.format||!e.attributes&&!e.format)&&le.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function qN(i,e){for(const t of i)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function XN(i,e){var t;for(const n of i){let s=n.byteStride;if(typeof n.byteStride!="number")for(const o of n.attributes||[]){const a=py(o.format);s+=a.byteLength}const r=(t=n.attributes)==null?void 0:t.find(o=>o.attribute===e);if(r)return{attributeName:r.attribute,bufferName:n.name,stepMode:n.stepMode,vertexFormat:r.format,byteOffset:r.byteOffset,byteStride:s}}return null}let xd;function k2(i){return(!xd||xd.byteLengthr.type==="uniform"&&r.name===(e==null?void 0:e.name));if(!n)throw new Error(e==null?void 0:e.name);const s=n;for(const r of s.uniforms||[])this.bindingLayout[r.name]=r}}setUniforms(e){for(const[t,n]of Object.entries(e))this._setUniform(t,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){JN(this.uniforms[e],t)||(this.uniforms[e]=eD(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ri=class{constructor(e){$(this,"uniformBlocks",new Map),$(this,"uniformBufferLayouts",new Map),$(this,"uniformBuffers",new Map);for(const[t,n]of Object.entries(e)){const s=t,r=new QN(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new tD({name:t});o.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(s,o)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var t;for(const[n,s]of Object.entries(e))(t=this.uniformBlocks.get(n))==null||t.setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){var t;return((t=this.uniformBufferLayouts.get(e))==null?void 0:t.byteLength)||0}getUniformBufferData(e){var t,n;const s=((t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms())||{};return(n=this.uniformBufferLayouts.get(e))==null?void 0:n.getData(s)}createUniformBuffer(e,t,n){n&&this.setUniforms(n);const s=this.getUniformBufferByteLength(t),r=e.createBuffer({usage:ge.UNIFORM|ge.COPY_DST,byteLength:s}),o=this.getUniformBufferData(t);return r.write(o),r}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){const n=this.getUniformBufferByteLength(t),s=e.createBuffer({usage:ge.UNIFORM|ge.COPY_DST,byteLength:n});this.uniformBuffers.set(t,s)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(const t of this.uniformBlocks.keys()){const n=this.updateUniformBuffer(t);e||(e=n)}return e&&le.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var t;const n=this.uniformBlocks.get(e);let s=this.uniformBuffers.get(e),r=!1;if(s&&n!=null&&n.needsRedraw){r||(r=n.needsRedraw);const o=this.getUniformBufferData(e);s=this.uniformBuffers.get(e),s==null||s.write(o);const a=(t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms();le.log(4,`Writing to uniform buffer ${String(e)}`,o,a)()}return r}};var Do;(function(i){i[i.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",i[i.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",i[i.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i[i.ZERO=0]="ZERO",i[i.ONE=1]="ONE",i[i.SRC_COLOR=768]="SRC_COLOR",i[i.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",i[i.SRC_ALPHA=770]="SRC_ALPHA",i[i.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",i[i.DST_ALPHA=772]="DST_ALPHA",i[i.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",i[i.DST_COLOR=774]="DST_COLOR",i[i.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",i[i.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",i[i.CONSTANT_COLOR=32769]="CONSTANT_COLOR",i[i.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",i[i.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",i[i.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",i[i.FUNC_ADD=32774]="FUNC_ADD",i[i.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",i[i.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",i[i.BLEND_EQUATION=32777]="BLEND_EQUATION",i[i.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",i[i.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",i[i.BLEND_DST_RGB=32968]="BLEND_DST_RGB",i[i.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",i[i.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",i[i.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",i[i.BLEND_COLOR=32773]="BLEND_COLOR",i[i.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",i[i.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",i[i.LINE_WIDTH=2849]="LINE_WIDTH",i[i.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",i[i.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",i[i.CULL_FACE_MODE=2885]="CULL_FACE_MODE",i[i.FRONT_FACE=2886]="FRONT_FACE",i[i.DEPTH_RANGE=2928]="DEPTH_RANGE",i[i.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",i[i.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",i[i.DEPTH_FUNC=2932]="DEPTH_FUNC",i[i.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",i[i.STENCIL_FUNC=2962]="STENCIL_FUNC",i[i.STENCIL_FAIL=2964]="STENCIL_FAIL",i[i.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",i[i.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",i[i.STENCIL_REF=2967]="STENCIL_REF",i[i.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",i[i.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",i[i.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",i[i.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",i[i.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",i[i.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",i[i.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",i[i.VIEWPORT=2978]="VIEWPORT",i[i.SCISSOR_BOX=3088]="SCISSOR_BOX",i[i.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",i[i.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",i[i.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",i[i.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",i[i.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",i[i.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",i[i.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",i[i.RED_BITS=3410]="RED_BITS",i[i.GREEN_BITS=3411]="GREEN_BITS",i[i.BLUE_BITS=3412]="BLUE_BITS",i[i.ALPHA_BITS=3413]="ALPHA_BITS",i[i.DEPTH_BITS=3414]="DEPTH_BITS",i[i.STENCIL_BITS=3415]="STENCIL_BITS",i[i.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",i[i.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",i[i.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",i[i.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",i[i.SAMPLES=32937]="SAMPLES",i[i.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",i[i.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",i[i.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",i[i.VENDOR=7936]="VENDOR",i[i.RENDERER=7937]="RENDERER",i[i.VERSION=7938]="VERSION",i[i.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",i[i.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",i[i.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",i[i.STATIC_DRAW=35044]="STATIC_DRAW",i[i.STREAM_DRAW=35040]="STREAM_DRAW",i[i.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.BUFFER_SIZE=34660]="BUFFER_SIZE",i[i.BUFFER_USAGE=34661]="BUFFER_USAGE",i[i.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",i[i.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",i[i.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",i[i.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",i[i.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",i[i.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",i[i.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",i[i.CULL_FACE=2884]="CULL_FACE",i[i.FRONT=1028]="FRONT",i[i.BACK=1029]="BACK",i[i.FRONT_AND_BACK=1032]="FRONT_AND_BACK",i[i.BLEND=3042]="BLEND",i[i.DEPTH_TEST=2929]="DEPTH_TEST",i[i.DITHER=3024]="DITHER",i[i.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",i[i.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",i[i.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",i[i.SCISSOR_TEST=3089]="SCISSOR_TEST",i[i.STENCIL_TEST=2960]="STENCIL_TEST",i[i.NO_ERROR=0]="NO_ERROR",i[i.INVALID_ENUM=1280]="INVALID_ENUM",i[i.INVALID_VALUE=1281]="INVALID_VALUE",i[i.INVALID_OPERATION=1282]="INVALID_OPERATION",i[i.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",i[i.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",i[i.CW=2304]="CW",i[i.CCW=2305]="CCW",i[i.DONT_CARE=4352]="DONT_CARE",i[i.FASTEST=4353]="FASTEST",i[i.NICEST=4354]="NICEST",i[i.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.INT=5124]="INT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.FLOAT=5126]="FLOAT",i[i.DOUBLE=5130]="DOUBLE",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.ALPHA=6406]="ALPHA",i[i.RGB=6407]="RGB",i[i.RGBA=6408]="RGBA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",i[i.VERTEX_SHADER=35633]="VERTEX_SHADER",i[i.COMPILE_STATUS=35713]="COMPILE_STATUS",i[i.DELETE_STATUS=35712]="DELETE_STATUS",i[i.LINK_STATUS=35714]="LINK_STATUS",i[i.VALIDATE_STATUS=35715]="VALIDATE_STATUS",i[i.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",i[i.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",i[i.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",i[i.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",i[i.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",i[i.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",i[i.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",i[i.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",i[i.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",i[i.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",i[i.SHADER_TYPE=35663]="SHADER_TYPE",i[i.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",i[i.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",i[i.NEVER=512]="NEVER",i[i.LESS=513]="LESS",i[i.EQUAL=514]="EQUAL",i[i.LEQUAL=515]="LEQUAL",i[i.GREATER=516]="GREATER",i[i.NOTEQUAL=517]="NOTEQUAL",i[i.GEQUAL=518]="GEQUAL",i[i.ALWAYS=519]="ALWAYS",i[i.KEEP=7680]="KEEP",i[i.REPLACE=7681]="REPLACE",i[i.INCR=7682]="INCR",i[i.DECR=7683]="DECR",i[i.INVERT=5386]="INVERT",i[i.INCR_WRAP=34055]="INCR_WRAP",i[i.DECR_WRAP=34056]="DECR_WRAP",i[i.NEAREST=9728]="NEAREST",i[i.LINEAR=9729]="LINEAR",i[i.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",i[i.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",i[i.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",i[i.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",i[i.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",i[i.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",i[i.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",i[i.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE=5890]="TEXTURE",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i[i.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",i[i.TEXTURE0=33984]="TEXTURE0",i[i.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",i[i.REPEAT=10497]="REPEAT",i[i.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i[i.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",i[i.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",i[i.FLOAT_VEC2=35664]="FLOAT_VEC2",i[i.FLOAT_VEC3=35665]="FLOAT_VEC3",i[i.FLOAT_VEC4=35666]="FLOAT_VEC4",i[i.INT_VEC2=35667]="INT_VEC2",i[i.INT_VEC3=35668]="INT_VEC3",i[i.INT_VEC4=35669]="INT_VEC4",i[i.BOOL=35670]="BOOL",i[i.BOOL_VEC2=35671]="BOOL_VEC2",i[i.BOOL_VEC3=35672]="BOOL_VEC3",i[i.BOOL_VEC4=35673]="BOOL_VEC4",i[i.FLOAT_MAT2=35674]="FLOAT_MAT2",i[i.FLOAT_MAT3=35675]="FLOAT_MAT3",i[i.FLOAT_MAT4=35676]="FLOAT_MAT4",i[i.SAMPLER_2D=35678]="SAMPLER_2D",i[i.SAMPLER_CUBE=35680]="SAMPLER_CUBE",i[i.LOW_FLOAT=36336]="LOW_FLOAT",i[i.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",i[i.HIGH_FLOAT=36338]="HIGH_FLOAT",i[i.LOW_INT=36339]="LOW_INT",i[i.MEDIUM_INT=36340]="MEDIUM_INT",i[i.HIGH_INT=36341]="HIGH_INT",i[i.FRAMEBUFFER=36160]="FRAMEBUFFER",i[i.RENDERBUFFER=36161]="RENDERBUFFER",i[i.RGBA4=32854]="RGBA4",i[i.RGB5_A1=32855]="RGB5_A1",i[i.RGB565=36194]="RGB565",i[i.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",i[i.STENCIL_INDEX=6401]="STENCIL_INDEX",i[i.STENCIL_INDEX8=36168]="STENCIL_INDEX8",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",i[i.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",i[i.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",i[i.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",i[i.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",i[i.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",i[i.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",i[i.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",i[i.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",i[i.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",i[i.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",i[i.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",i[i.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",i[i.NONE=0]="NONE",i[i.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",i[i.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",i[i.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",i[i.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",i[i.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",i[i.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",i[i.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",i[i.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",i[i.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",i[i.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",i[i.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",i[i.READ_BUFFER=3074]="READ_BUFFER",i[i.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",i[i.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",i[i.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",i[i.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",i[i.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",i[i.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",i[i.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",i[i.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",i[i.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",i[i.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",i[i.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",i[i.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",i[i.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",i[i.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",i[i.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",i[i.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",i[i.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",i[i.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",i[i.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",i[i.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",i[i.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",i[i.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",i[i.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",i[i.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",i[i.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",i[i.RED=6403]="RED",i[i.RGB8=32849]="RGB8",i[i.RGBA8=32856]="RGBA8",i[i.RGB10_A2=32857]="RGB10_A2",i[i.TEXTURE_3D=32879]="TEXTURE_3D",i[i.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",i[i.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",i[i.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",i[i.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",i[i.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",i[i.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",i[i.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",i[i.SRGB=35904]="SRGB",i[i.SRGB8=35905]="SRGB8",i[i.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",i[i.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",i[i.RGBA32F=34836]="RGBA32F",i[i.RGB32F=34837]="RGB32F",i[i.RGBA16F=34842]="RGBA16F",i[i.RGB16F=34843]="RGB16F",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",i[i.R11F_G11F_B10F=35898]="R11F_G11F_B10F",i[i.RGB9_E5=35901]="RGB9_E5",i[i.RGBA32UI=36208]="RGBA32UI",i[i.RGB32UI=36209]="RGB32UI",i[i.RGBA16UI=36214]="RGBA16UI",i[i.RGB16UI=36215]="RGB16UI",i[i.RGBA8UI=36220]="RGBA8UI",i[i.RGB8UI=36221]="RGB8UI",i[i.RGBA32I=36226]="RGBA32I",i[i.RGB32I=36227]="RGB32I",i[i.RGBA16I=36232]="RGBA16I",i[i.RGB16I=36233]="RGB16I",i[i.RGBA8I=36238]="RGBA8I",i[i.RGB8I=36239]="RGB8I",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.R8=33321]="R8",i[i.RG8=33323]="RG8",i[i.R16F=33325]="R16F",i[i.R32F=33326]="R32F",i[i.RG16F=33327]="RG16F",i[i.RG32F=33328]="RG32F",i[i.R8I=33329]="R8I",i[i.R8UI=33330]="R8UI",i[i.R16I=33331]="R16I",i[i.R16UI=33332]="R16UI",i[i.R32I=33333]="R32I",i[i.R32UI=33334]="R32UI",i[i.RG8I=33335]="RG8I",i[i.RG8UI=33336]="RG8UI",i[i.RG16I=33337]="RG16I",i[i.RG16UI=33338]="RG16UI",i[i.RG32I=33339]="RG32I",i[i.RG32UI=33340]="RG32UI",i[i.R8_SNORM=36756]="R8_SNORM",i[i.RG8_SNORM=36757]="RG8_SNORM",i[i.RGB8_SNORM=36758]="RGB8_SNORM",i[i.RGBA8_SNORM=36759]="RGBA8_SNORM",i[i.RGB10_A2UI=36975]="RGB10_A2UI",i[i.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",i[i.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.HALF_FLOAT=5131]="HALF_FLOAT",i[i.RG=33319]="RG",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",i[i.CURRENT_QUERY=34917]="CURRENT_QUERY",i[i.QUERY_RESULT=34918]="QUERY_RESULT",i[i.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",i[i.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",i[i.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",i[i.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",i[i.DRAW_BUFFER0=34853]="DRAW_BUFFER0",i[i.DRAW_BUFFER1=34854]="DRAW_BUFFER1",i[i.DRAW_BUFFER2=34855]="DRAW_BUFFER2",i[i.DRAW_BUFFER3=34856]="DRAW_BUFFER3",i[i.DRAW_BUFFER4=34857]="DRAW_BUFFER4",i[i.DRAW_BUFFER5=34858]="DRAW_BUFFER5",i[i.DRAW_BUFFER6=34859]="DRAW_BUFFER6",i[i.DRAW_BUFFER7=34860]="DRAW_BUFFER7",i[i.DRAW_BUFFER8=34861]="DRAW_BUFFER8",i[i.DRAW_BUFFER9=34862]="DRAW_BUFFER9",i[i.DRAW_BUFFER10=34863]="DRAW_BUFFER10",i[i.DRAW_BUFFER11=34864]="DRAW_BUFFER11",i[i.DRAW_BUFFER12=34865]="DRAW_BUFFER12",i[i.DRAW_BUFFER13=34866]="DRAW_BUFFER13",i[i.DRAW_BUFFER14=34867]="DRAW_BUFFER14",i[i.DRAW_BUFFER15=34868]="DRAW_BUFFER15",i[i.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",i[i.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",i[i.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",i[i.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",i[i.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",i[i.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",i[i.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",i[i.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",i[i.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",i[i.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",i[i.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",i[i.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",i[i.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",i[i.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",i[i.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",i[i.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",i[i.SAMPLER_3D=35679]="SAMPLER_3D",i[i.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",i[i.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",i[i.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",i[i.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",i[i.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",i[i.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",i[i.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",i[i.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",i[i.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",i[i.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",i[i.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",i[i.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",i[i.MAX_SAMPLES=36183]="MAX_SAMPLES",i[i.SAMPLER_BINDING=35097]="SAMPLER_BINDING",i[i.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",i[i.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",i[i.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",i[i.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",i[i.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",i[i.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",i[i.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",i[i.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",i[i.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",i[i.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",i[i.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",i[i.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",i[i.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",i[i.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",i[i.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",i[i.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",i[i.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",i[i.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",i[i.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",i[i.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",i[i.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",i[i.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",i[i.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",i[i.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",i[i.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",i[i.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",i[i.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",i[i.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",i[i.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",i[i.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",i[i.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",i[i.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",i[i.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",i[i.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",i[i.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",i[i.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",i[i.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",i[i.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",i[i.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i[i.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",i[i.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",i[i.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",i[i.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",i[i.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",i[i.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",i[i.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",i[i.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",i[i.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",i[i.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",i[i.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",i[i.UNIFORM_TYPE=35383]="UNIFORM_TYPE",i[i.UNIFORM_SIZE=35384]="UNIFORM_SIZE",i[i.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",i[i.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",i[i.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",i[i.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",i[i.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",i[i.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",i[i.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",i[i.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",i[i.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",i[i.OBJECT_TYPE=37138]="OBJECT_TYPE",i[i.SYNC_CONDITION=37139]="SYNC_CONDITION",i[i.SYNC_STATUS=37140]="SYNC_STATUS",i[i.SYNC_FLAGS=37141]="SYNC_FLAGS",i[i.SYNC_FENCE=37142]="SYNC_FENCE",i[i.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",i[i.UNSIGNALED=37144]="UNSIGNALED",i[i.SIGNALED=37145]="SIGNALED",i[i.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",i[i.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",i[i.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",i[i.WAIT_FAILED=37149]="WAIT_FAILED",i[i.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",i[i.COLOR=6144]="COLOR",i[i.DEPTH=6145]="DEPTH",i[i.STENCIL=6146]="STENCIL",i[i.MIN=32775]="MIN",i[i.MAX=32776]="MAX",i[i.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",i[i.STREAM_READ=35041]="STREAM_READ",i[i.STREAM_COPY=35042]="STREAM_COPY",i[i.STATIC_READ=35045]="STATIC_READ",i[i.STATIC_COPY=35046]="STATIC_COPY",i[i.DYNAMIC_READ=35049]="DYNAMIC_READ",i[i.DYNAMIC_COPY=35050]="DYNAMIC_COPY",i[i.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",i[i.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",i[i.INVALID_INDEX=4294967295]="INVALID_INDEX",i[i.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",i[i.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",i[i.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",i[i.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",i[i.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",i[i.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",i[i.R16_EXT=33322]="R16_EXT",i[i.RG16_EXT=33324]="RG16_EXT",i[i.RGB16_EXT=32852]="RGB16_EXT",i[i.RGBA16_EXT=32859]="RGBA16_EXT",i[i.R16_SNORM_EXT=36760]="R16_SNORM_EXT",i[i.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",i[i.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",i[i.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",i[i.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",i[i.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",i[i.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",i[i.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",i[i.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",i[i.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",i[i.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",i[i.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",i[i.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",i[i.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",i[i.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",i[i.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",i[i.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",i[i.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",i[i.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",i[i.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",i[i.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",i[i.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",i[i.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",i[i.LINE_WEBGL=6913]="LINE_WEBGL",i[i.FILL_WEBGL=6914]="FILL_WEBGL",i[i.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",i[i.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",i[i.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",i[i.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",i[i.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",i[i.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",i[i.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",i[i.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",i[i.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",i[i.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",i[i.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",i[i.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",i[i.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",i[i.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",i[i.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",i[i.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",i[i.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",i[i.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",i[i.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",i[i.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",i[i.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",i[i.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",i[i.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",i[i.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Do||(Do={}));const iD={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},nD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),sD=i=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return i.createVertexArray()},deleteVertexArrayOES(e){return i.deleteVertexArray(e)},isVertexArrayOES(e){return i.isVertexArray(e)},bindVertexArrayOES(e){return i.bindVertexArray(e)}}),rD=i=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return i.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return i.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return i.vertexAttribDivisor(...e)}});function oD(i=!0){const e=HTMLCanvasElement.prototype;if(!i&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(t,n){if(t==="webgl"||t==="experimental-webgl"){const s=this.originalGetContext("webgl2",n);return s instanceof HTMLElement&&aD(s),s}return this.originalGetContext(t,n)}}function aD(i){i.getExtension("EXT_color_buffer_float");const e={...iD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:nD(i),OES_vertex_array_object:sD(i),ANGLE_instanced_arrays:rD(i)},t=i.getExtension;i.getExtension=function(s){return t.call(i,s)||(s in e?e[s]:null)};const n=i.getSupportedExtensions;i.getSupportedExtensions=function(){const s=n.apply(i)||[];return s==null?void 0:s.concat(Object.keys(e))}}async function A2(i,e){const t=document.getElementsByTagName("head")[0];if(!t)throw new Error("loadScript");const n=document.createElement("script");return n.setAttribute("type","text/javascript"),n.setAttribute("src",i),new Promise((s,r)=>{n.onload=s,n.onerror=o=>r(new Error(`Unable to load script '${i}': ${o}`)),t.appendChild(n)})}const lD=1;let hi=null,J0=!1;const gy={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function cD(i){if(!globalThis.SPECTOR)try{await A2(i.debugSpectorJSUrl||gy.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Dte(i){var e;if(i={...gy,...i},!i.debugSpectorJS)return null;if(!hi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(lD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;hi=new t,globalThis.luma&&(globalThis.luma.spector=hi)}if(!hi)return null;if(J0||(J0=!0,hi.spyCanvases(),hi==null||hi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),hi==null||hi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),hi==null||hi.getResultUI(),hi==null||hi.resultView.display(),hi==null||hi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;hi==null||hi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),hi==null||hi.stopCapture()})}return hi}const uD="https://unpkg.com/webgl-debug@2.0.1/index.js";function I2(i){return i.luma=i.luma||{},i.luma}async function dD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await A2(uD))}function Mte(i,e={}){return e.debugWebGL||e.traceWebGL?fD(i,e):hD(i)}function hD(i){const e=I2(i);return e.realContext?e.realContext:i}function fD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=I2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Do,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,pD.bind(null,e),mD.bind(null,e));for(const o in Do)!(o in n)&&typeof Do[o]=="number"&&(n[o]=Do[o]);class s{}Object.setPrototypeOf(n,Object.getPrototypeOf(i)),Object.setPrototypeOf(s,n);const r=Object.create(s);return t.realContext=i,t.debugContext=r,r.debug=!0,r}function ex(i,e){e=Array.from(e).map(n=>n===void 0?"undefined":n);let t=globalThis.WebGLDebugUtils.glFunctionArgsToString(i,e);return t=`${t.slice(0,100)}${t.length>100?"...":""}`,`gl.${i}(${t})`}function pD(i,e,t,n){n=Array.from(n).map(a=>a===void 0?"undefined":a);const s=globalThis.WebGLDebugUtils.glEnumToString(e),r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,n),o=`${s} in gl.${t}(${r})`;le.error(o)();debugger}function mD(i,e,t){let n="";le.level>=1&&(n=ex(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||ex(e,t);debugger}}const wd=1;class gD extends TN{constructor(){super(),$(this,"type","webgl"),Eg.defaultProps={...Eg.defaultProps,...gy}}enforceWebGL2(e){oD(e)}isSupported(){return typeof WebGL2RenderingContext<"u"}isDeviceHandle(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:(typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext&&le.warn("WebGL1 is not supported",e)(),!1)}async attach(e,t={}){const{WebGLDevice:n}=await p0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-Br3jubF3.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!_D(e))throw new Error("Invalid WebGL2RenderingContext");const s=t.createCanvasContext===!0?{}:t.createCanvasContext;return new n({...t,_handle:e,createCanvasContext:{canvas:e.canvas,autoResize:!1,...s}})}async create(e={}){const{WebGLDevice:t}=await p0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-Br3jubF3.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));le.groupCollapsed(wd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(dD()),e.debugSpectorJS&&n.push(cD(e));const s=await Promise.allSettled(n);for(const a of s)a.status==="rejected"&&le.error(`Failed to initialize debug libraries ${a.reason}`)();const r=new t(e),o=`${r._reused?"Reusing":"Created"} device with WebGL2 ${r.props.debug?"debug ":""}context: ${r.info.vendor}, ${r.info.renderer} for canvas: ${r.canvasContext.id}`;return le.probe(wd,o)(),le.table(wd,r.info)(),r}finally{le.groupEnd(wd)()}}}function _D(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const yD=new gD,bD="#b3b3b3",vD=void 0,kg=void 0,xD=1,wD=4,SD="#666666",ED=.1,CD=1,TD=1,L2="#222222",pe={enableSimulation:!0,spaceSize:8192,pointSizeScale:1,linkWidthScale:1,linkArrowsSizeScale:1,renderLinks:!0,curvedLinks:!1,curvedLinkSegments:19,curvedLinkWeight:.8,curvedLinkControlPointDistance:.5,linkArrows:!1,linkVisibilityDistanceRange:[50,150],linkVisibilityMinTransparency:.25,hoveredPointCursor:"auto",hoveredLinkCursor:"auto",renderHoveredPointRing:!1,hoveredPointRingColor:"white",hoveredLinkColor:void 0,hoveredLinkWidthIncrease:5,focusedPointRingColor:"white",focusedPointIndex:void 0,simulation:{decay:5e3,gravity:.25,center:0,repulsion:1,repulsionTheta:1.15,linkSpring:1,linkDistance:10,linkDistRandomVariationRange:[1,1.2],repulsionFromMouse:2,friction:.85,cluster:.1},showFPSMonitor:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||2,scalePointsOnZoom:!1,scaleLinksOnZoom:!1,enableZoom:!0,enableSimulationDuringZoom:!1,enableDrag:!1,fitViewOnInit:!0,fitViewDelay:250,fitViewPadding:.1,fitViewDuration:250,pointSamplingDistance:150,attribution:"",rescalePositions:void 0,enableRightClickRepulsion:!1},kD=.7,AD=.95,ID=3;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:R2,setPrototypeOf:tx,isFrozen:LD,getPrototypeOf:RD,getOwnPropertyDescriptor:PD}=Object;let{freeze:hn,seal:_s,create:P2}=Object,{apply:Ag,construct:Ig}=typeof Reflect<"u"&&Reflect;hn||(hn=function(i){return i});_s||(_s=function(i){return i});Ag||(Ag=function(i,e,t){return i.apply(e,t)});Ig||(Ig=function(i,e){return new i(...e)});const Sd=fn(Array.prototype.forEach),ND=fn(Array.prototype.lastIndexOf),ix=fn(Array.prototype.pop),lc=fn(Array.prototype.push),DD=fn(Array.prototype.splice),hh=fn(String.prototype.toLowerCase),im=fn(String.prototype.toString),nx=fn(String.prototype.match),cc=fn(String.prototype.replace),MD=fn(String.prototype.indexOf),OD=fn(String.prototype.trim),Ms=fn(Object.prototype.hasOwnProperty),sn=fn(RegExp.prototype.test),uc=BD(TypeError);function fn(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:hh;tx&&tx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(LD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function FD(i){for(let e=0;e/gm),HD=_s(/\$\{[\w\W]*/gm),VD=_s(/^data-[\-\w.\u00B7-\uFFFF]+$/),GD=_s(/^aria-[\-\w]+$/),N2=_s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WD=_s(/^(?:\w+script|data):/i),YD=_s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),D2=_s(/^html$/i),qD=_s(/^[a-z][.\w]*(-[.\w]+)+$/i);var lx=Object.freeze({__proto__:null,ARIA_ATTR:GD,ATTR_WHITESPACE:YD,CUSTOM_ELEMENT:qD,DATA_ATTR:VD,DOCTYPE_NAME:D2,ERB_EXPR:jD,IS_ALLOWED_URI:N2,IS_SCRIPT_OR_DATA:WD,MUSTACHE_EXPR:$D,TMPLIT_EXPR:HD});const hc={element:1,text:3,progressingInstruction:7,comment:8,document:9},XD=function(){return typeof window>"u"?null:window},KD=function(i,e){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let t=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(t=e.getAttribute(n));const s="dompurify"+(t?"#"+t:"");try{return i.createPolicy(s,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},cx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function M2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:XD();const e=L=>M2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==hc.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=i,m=l.prototype,y=dc(m,"cloneNode"),g=dc(m,"remove"),_=dc(m,"nextSibling"),S=dc(m,"childNodes"),C=dc(m,"parentNode");if(typeof o=="function"){const L=t.createElement("template");L.content&&L.content.ownerDocument&&(t=L.content.ownerDocument)}let x,A="";const{implementation:I,createNodeIterator:O,createDocumentFragment:H,getElementsByTagName:Z}=t,{importNode:te}=n;let M=cx();e.isSupported=typeof R2=="function"&&typeof C=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:he,ERB_EXPR:se,TMPLIT_EXPR:R,DATA_ATTR:J,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:ie,CUSTOM_ELEMENT:ee}=lx;let{IS_ALLOWED_URI:ae}=lx,Q=null;const Se=ot({},[...sx,...nm,...sm,...rm,...rx]);let xe=null;const Je=ot({},[...ox,...om,...ax,...Ed]);let de=Object.seal(P2(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),bt=null,Xe=null,ht=!0,re=!0,Te=!1,Pe=!0,q=!1,We=!0,He=!1,it=!1,Vt=!1,me=!1,nt=!1,ui=!1,_i=!0,Zn=!1;const Qo="user-content-";let Zs=!0,Li=!1,en={},Ri=null;const ai=ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let vo=null;const Es=ot({},["audio","video","img","source","image","track"]);let Qn=null;const Jn=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cs="http://www.w3.org/1998/Math/MathML",zi="http://www.w3.org/2000/svg",Ei="http://www.w3.org/1999/xhtml";let ii=Ei,bn=!1,vn=null;const Ts=ot({},[Cs,zi,Ei],im);let On=ot({},["mi","mo","mn","ms","mtext"]),es=ot({},["annotation-xml"]);const Dr=ot({},["title","style","font","a","script"]);let xn=null;const Qs=["application/xhtml+xml","text/html"],Jo="text/html";let Zt=null,Ot=null;const ks=t.createElement("form"),xo=function(L){return L instanceof RegExp||L instanceof Function},Js=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ot&&Ot===L)){if((!L||typeof L!="object")&&(L={}),L=Hr(L),xn=Qs.indexOf(L.PARSER_MEDIA_TYPE)===-1?Jo:L.PARSER_MEDIA_TYPE,Zt=xn==="application/xhtml+xml"?im:hh,Q=Ms(L,"ALLOWED_TAGS")?ot({},L.ALLOWED_TAGS,Zt):Se,xe=Ms(L,"ALLOWED_ATTR")?ot({},L.ALLOWED_ATTR,Zt):Je,vn=Ms(L,"ALLOWED_NAMESPACES")?ot({},L.ALLOWED_NAMESPACES,im):Ts,Qn=Ms(L,"ADD_URI_SAFE_ATTR")?ot(Hr(Jn),L.ADD_URI_SAFE_ATTR,Zt):Jn,vo=Ms(L,"ADD_DATA_URI_TAGS")?ot(Hr(Es),L.ADD_DATA_URI_TAGS,Zt):Es,Ri=Ms(L,"FORBID_CONTENTS")?ot({},L.FORBID_CONTENTS,Zt):ai,bt=Ms(L,"FORBID_TAGS")?ot({},L.FORBID_TAGS,Zt):Hr({}),Xe=Ms(L,"FORBID_ATTR")?ot({},L.FORBID_ATTR,Zt):Hr({}),en=Ms(L,"USE_PROFILES")?L.USE_PROFILES:!1,ht=L.ALLOW_ARIA_ATTR!==!1,re=L.ALLOW_DATA_ATTR!==!1,Te=L.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=L.SAFE_FOR_TEMPLATES||!1,We=L.SAFE_FOR_XML!==!1,He=L.WHOLE_DOCUMENT||!1,me=L.RETURN_DOM||!1,nt=L.RETURN_DOM_FRAGMENT||!1,ui=L.RETURN_TRUSTED_TYPE||!1,Vt=L.FORCE_BODY||!1,_i=L.SANITIZE_DOM!==!1,Zn=L.SANITIZE_NAMED_PROPS||!1,Zs=L.KEEP_CONTENT!==!1,Li=L.IN_PLACE||!1,ae=L.ALLOWED_URI_REGEXP||N2,ii=L.NAMESPACE||Ei,On=L.MATHML_TEXT_INTEGRATION_POINTS||On,es=L.HTML_INTEGRATION_POINTS||es,de=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&xo(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(de.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&xo(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(de.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(re=!1),nt&&(me=!0),en&&(Q=ot({},rx),xe=[],en.html===!0&&(ot(Q,sx),ot(xe,ox)),en.svg===!0&&(ot(Q,nm),ot(xe,om),ot(xe,Ed)),en.svgFilters===!0&&(ot(Q,sm),ot(xe,om),ot(xe,Ed)),en.mathMl===!0&&(ot(Q,rm),ot(xe,ax),ot(xe,Ed))),L.ADD_TAGS&&(Q===Se&&(Q=Hr(Q)),ot(Q,L.ADD_TAGS,Zt)),L.ADD_ATTR&&(xe===Je&&(xe=Hr(xe)),ot(xe,L.ADD_ATTR,Zt)),L.ADD_URI_SAFE_ATTR&&ot(Qn,L.ADD_URI_SAFE_ATTR,Zt),L.FORBID_CONTENTS&&(Ri===ai&&(Ri=Hr(Ri)),ot(Ri,L.FORBID_CONTENTS,Zt)),Zs&&(Q["#text"]=!0),He&&ot(Q,["html","head","body"]),Q.table&&(ot(Q,["tbody"]),delete bt.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,A=x.createHTML("")}else x===void 0&&(x=KD(p,s)),x!==null&&typeof A=="string"&&(A=x.createHTML(""));hn&&hn(L),Ot=L}},Rt=ot({},[...nm,...sm,...zD]),Mr=ot({},[...rm,...UD]),ea=function(L){let V=C(L);(!V||!V.tagName)&&(V={namespaceURI:ii,tagName:"template"});const E=hh(L.tagName),G=hh(V.tagName);return vn[L.namespaceURI]?L.namespaceURI===zi?V.namespaceURI===Ei?E==="svg":V.namespaceURI===Cs?E==="svg"&&(G==="annotation-xml"||On[G]):!!Rt[E]:L.namespaceURI===Cs?V.namespaceURI===Ei?E==="math":V.namespaceURI===zi?E==="math"&&es[G]:!!Mr[E]:L.namespaceURI===Ei?V.namespaceURI===zi&&!es[G]||V.namespaceURI===Cs&&!On[G]?!1:!Mr[E]&&(Dr[E]||!Rt[E]):!!(xn==="application/xhtml+xml"&&vn[L.namespaceURI]):!1},ts=function(L){lc(e.removed,{element:L});try{C(L).removeChild(L)}catch{g(L)}},di=function(L,V){try{lc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{lc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(L),L==="is")if(me||nt)try{ts(V)}catch{}else try{V.setAttribute(L,"")}catch{}},Bn=function(L){let V=null,E=null;if(Vt)L=""+L;else{const Ce=nx(L,/^[\r\n\t ]+/);E=Ce&&Ce[0]}xn==="application/xhtml+xml"&&ii===Ei&&(L=''+L+"");const G=x?x.createHTML(L):L;if(ii===Ei)try{V=new h().parseFromString(G,xn)}catch{}if(!V||!V.documentElement){V=I.createDocument(ii,"template",null);try{V.documentElement.innerHTML=bn?A:G}catch{}}const ne=V.body||V.documentElement;return L&&E&&ne.insertBefore(t.createTextNode(E),ne.childNodes[0]||null),ii===Ei?Z.call(V,He?"html":"body")[0]:He?V.documentElement:ne},wo=function(L){return O.call(L.ownerDocument||L,L,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ut=function(L){return L instanceof d&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},Or=function(L){return typeof a=="function"&&L instanceof a};function st(L,V,E){Sd(L,G=>{G.call(e,V,E,Ot)})}const wn=function(L){let V=null;if(st(M.beforeSanitizeElements,L,null),ut(L))return ts(L),!0;const E=Zt(L.nodeName);if(st(M.uponSanitizeElement,L,{tagName:E,allowedTags:Q}),We&&L.hasChildNodes()&&!Or(L.firstElementChild)&&sn(/<[/\w!]/g,L.innerHTML)&&sn(/<[/\w!]/g,L.textContent)||L.nodeType===hc.progressingInstruction||We&&L.nodeType===hc.comment&&sn(/<[/\w]/g,L.data))return ts(L),!0;if(!Q[E]||bt[E]){if(!bt[E]&&er(E)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E)))return!1;if(Zs&&!Ri[E]){const G=C(L)||L.parentNode,ne=S(L)||L.childNodes;if(ne&&G){const Ce=ne.length;for(let At=Ce-1;At>=0;--At){const rt=y(ne[At],!0);rt.__removalCount=(L.__removalCount||0)+1,G.insertBefore(rt,_(L))}}}return ts(L),!0}return L instanceof l&&!ea(L)||(E==="noscript"||E==="noembed"||E==="noframes")&&sn(/<\/no(script|embed|frames)/i,L.innerHTML)?(ts(L),!0):(q&&L.nodeType===hc.text&&(V=L.textContent,Sd([he,se,R],G=>{V=cc(V,G," ")}),L.textContent!==V&&(lc(e.removed,{element:L.cloneNode()}),L.textContent=V)),st(M.afterSanitizeElements,L,null),!1)},Br=function(L,V,E){if(_i&&(V==="id"||V==="name")&&(E in t||E in ks))return!1;if(!(re&&!Xe[V]&&sn(J,V))&&!(ht&&sn(F,V))){if(!xe[V]||Xe[V]){if(!(er(L)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,L)||de.tagNameCheck instanceof Function&&de.tagNameCheck(L))&&(de.attributeNameCheck instanceof RegExp&&sn(de.attributeNameCheck,V)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(V))||V==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E))))return!1}else if(!Qn[V]&&!sn(ae,cc(E,ie,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&MD(E,"data:")===0&&vo[L])&&!(Te&&!sn(X,cc(E,ie,"")))&&E)return!1}return!0},er=function(L){return L!=="annotation-xml"&&nx(L,ee)},Fn=function(L){st(M.beforeSanitizeAttributes,L,null);const{attributes:V}=L;if(!V||ut(L))return;const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const ne=V[G],{name:Ce,namespaceURI:At,value:rt}=ne,et=Zt(Ce),yi=rt;let ft=Ce==="value"?yi:OD(yi);if(E.attrName=et,E.attrValue=ft,E.keepAttr=!0,E.forceKeepAttr=void 0,st(M.uponSanitizeAttribute,L,E),ft=E.attrValue,Zn&&(et==="id"||et==="name")&&(di(Ce,L),ft=Qo+ft),We&&sn(/((--!?|])>)|<\/(style|title)/i,ft)){di(Ce,L);continue}if(E.forceKeepAttr)continue;if(!E.keepAttr){di(Ce,L);continue}if(!Pe&&sn(/\/>/i,ft)){di(Ce,L);continue}q&&Sd([he,se,R],Bt=>{ft=cc(ft,Bt," ")});const tr=Zt(L.nodeName);if(!Br(tr,et,ft)){di(Ce,L);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!At)switch(p.getAttributeType(tr,et)){case"TrustedHTML":{ft=x.createHTML(ft);break}case"TrustedScriptURL":{ft=x.createScriptURL(ft);break}}if(ft!==yi)try{At?L.setAttributeNS(At,Ce,ft):L.setAttribute(Ce,ft),ut(L)?ts(L):ix(e.removed)}catch{di(Ce,L)}}st(M.afterSanitizeAttributes,L,null)},tn=function L(V){let E=null;const G=wo(V);for(st(M.beforeSanitizeShadowDOM,V,null);E=G.nextNode();)st(M.uponSanitizeShadowNode,E,null),wn(E),Fn(E),E.content instanceof r&&L(E.content);st(M.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(L){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,G=null,ne=null,Ce=null;if(bn=!L,bn&&(L=""),typeof L!="string"&&!Or(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw uc("dirty is not a string, aborting")}else throw uc("toString is not a function");if(!e.isSupported)return L;if(it||Js(V),e.removed=[],typeof L=="string"&&(Li=!1),Li){if(L.nodeName){const et=Zt(L.nodeName);if(!Q[et]||bt[et])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)E=Bn(""),G=E.ownerDocument.importNode(L,!0),G.nodeType===hc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?E=G:E.appendChild(G);else{if(!me&&!q&&!He&&L.indexOf("<")===-1)return x&&ui?x.createHTML(L):L;if(E=Bn(L),!E)return me?null:ui?A:""}E&&Vt&&ts(E.firstChild);const At=wo(Li?L:E);for(;ne=At.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&tn(ne.content);if(Li)return L;if(me){if(nt)for(Ce=H.call(E.ownerDocument);E.firstChild;)Ce.appendChild(E.firstChild);else Ce=E;return(xe.shadowroot||xe.shadowrootmode)&&(Ce=te.call(n,Ce,!0)),Ce}let rt=He?E.outerHTML:E.innerHTML;return He&&Q["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&sn(D2,E.ownerDocument.doctype.name)&&(rt=" +`,l.style.top="10px",l.style.left="10px",l.style.position="absolute",l.style.zIndex="9999",l.style.width="100%",l.style.textAlign="left",document.body.appendChild(l),(n=document.getElementsByClassName("luma-compiler-log-error")[0])==null||n.scrollIntoView(),l.onclick=()=>{const c=`data:text/plain,${encodeURIComponent(this.source)}`;navigator.clipboard.writeText(c)}}};$(v2,"defaultProps",{..._n.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let ON=v2;function BN(i){return FN(i.source)||i.id||hy(`unnamed ${i.stage}-shader`)}function FN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const w2=class S2 extends _n{constructor(e,t){super(e,t,S2.defaultProps),$(this,"shaderLayout"),$(this,"bufferLayout"),$(this,"linkStatus","pending"),$(this,"hash",""),this.shaderLayout=this.props.shaderLayout,this.bufferLayout=this.props.bufferLayout||[]}get[Symbol.toStringTag](){return"RenderPipeline"}};$(w2,"defaultProps",{..._n.defaultProps,vs:null,vertexEntryPoint:"vertexMain",vsConstants:{},fs:null,fragmentEntryPoint:"fragmentMain",fsConstants:{},shaderLayout:null,bufferLayout:[],topology:"triangle-list",colorAttachmentFormats:void 0,depthStencilAttachmentFormat:void 0,parameters:{},bindings:{},uniforms:{}});let Zh=w2;const E2=class C2 extends _n{constructor(e,t){super(e,t,C2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(E2,"defaultProps",{..._n.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let Q0=E2;function zN(i){return HN[i]}function UN(i){const[e,t]=jN[i],n=e==="i32"||e==="u32",s=e!=="u32",r=$N[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const $N={f32:4,f16:2,i32:4,u32:4},jN={f32:["f32",1],"vec2":["f32",2],"vec3":["f32",3],"vec4":["f32",4],f16:["f16",1],"vec2":["f16",2],"vec3":["f16",3],"vec4":["f16",4],i32:["i32",1],"vec2":["i32",2],"vec3":["i32",3],"vec4":["i32",4],u32:["u32",1],"vec2":["u32",2],"vec3":["u32",3],"vec4":["u32",4]},HN={f32:{type:"f32",components:1},f16:{type:"f16",components:1},i32:{type:"i32",components:1},u32:{type:"u32",components:1},"vec2":{type:"f32",components:2},"vec3":{type:"f32",components:3},"vec4":{type:"f32",components:4},"vec2":{type:"f16",components:2},"vec3":{type:"f16",components:3},"vec4":{type:"f16",components:4},"vec2":{type:"i32",components:2},"vec3":{type:"i32",components:3},"vec4":{type:"i32",components:4},"vec2":{type:"u32",components:2},"vec3":{type:"u32",components:3},"vec4":{type:"u32",components:4},"mat2x2":{type:"f32",components:4},"mat2x3":{type:"f32",components:6},"mat2x4":{type:"f32",components:8},"mat3x2":{type:"f32",components:6},"mat3x3":{type:"f32",components:9},"mat3x4":{type:"f32",components:12},"mat4x2":{type:"f32",components:8},"mat4x3":{type:"f32",components:12},"mat4x4":{type:"f32",components:16},"mat2x2":{type:"f16",components:4},"mat2x3":{type:"f16",components:6},"mat2x4":{type:"f16",components:8},"mat3x2":{type:"f16",components:6},"mat3x3":{type:"f16",components:9},"mat3x4":{type:"f16",components:12},"mat4x2":{type:"f16",components:8},"mat4x3":{type:"f16",components:12},"mat4x4":{type:"f16",components:16},"mat2x2":{type:"i32",components:4},"mat2x3":{type:"i32",components:6},"mat2x4":{type:"i32",components:8},"mat3x2":{type:"i32",components:6},"mat3x3":{type:"i32",components:9},"mat3x4":{type:"i32",components:12},"mat4x2":{type:"i32",components:8},"mat4x3":{type:"i32",components:12},"mat4x4":{type:"i32",components:16},"mat2x2":{type:"u32",components:4},"mat2x3":{type:"u32",components:6},"mat2x4":{type:"u32",components:8},"mat3x2":{type:"u32",components:6},"mat3x3":{type:"u32",components:9},"mat3x4":{type:"u32",components:12},"mat4x2":{type:"u32",components:8},"mat4x3":{type:"u32",components:12},"mat4x4":{type:"u32",components:16}};function T2(i,e){const t={};for(const n of i.attributes){const s=VN(i,e,n.name);s&&(t[n.name]=s)}return t}function Rte(i,e,t=16){const n=T2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function VN(i,e,t){const n=GN(i,t),s=WN(e,t);if(!n)return null;const r=UN(n.type),o=uN(r),a=(s==null?void 0:s.vertexFormat)||o,l=py(a);return{attributeName:(s==null?void 0:s.attributeName)||n.name,bufferName:(s==null?void 0:s.bufferName)||n.name,location:n.location,shaderType:n.type,primitiveType:r.primitiveType,shaderComponents:r.components,vertexFormat:a,bufferDataType:l.type,bufferComponents:l.components,normalized:l.normalized,integer:r.integer,stepMode:(s==null?void 0:s.stepMode)||n.stepMode||"vertex",byteOffset:(s==null?void 0:s.byteOffset)||0,byteStride:(s==null?void 0:s.byteStride)||0}}function GN(i,e){const t=i.attributes.find(n=>n.name===e);return t||le.warn(`shader layout attribute "${e}" not present in shader`),t||null}function WN(i,e){YN(i);let t=qN(i,e);return t||(t=XN(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function YN(i){for(const e of i)(e.attributes&&e.format||!e.attributes&&!e.format)&&le.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`)}function qN(i,e){for(const t of i)if(t.format&&t.name===e)return{attributeName:t.name,bufferName:e,stepMode:t.stepMode,vertexFormat:t.format,byteOffset:0,byteStride:t.byteStride||0};return null}function XN(i,e){var t;for(const n of i){let s=n.byteStride;if(typeof n.byteStride!="number")for(const o of n.attributes||[]){const a=py(o.format);s+=a.byteLength}const r=(t=n.attributes)==null?void 0:t.find(o=>o.attribute===e);if(r)return{attributeName:r.attribute,bufferName:n.name,stepMode:n.stepMode,vertexFormat:r.format,byteOffset:r.byteOffset,byteStride:s}}return null}let xd;function k2(i){return(!xd||xd.byteLengthr.type==="uniform"&&r.name===(e==null?void 0:e.name));if(!n)throw new Error(e==null?void 0:e.name);const s=n;for(const r of s.uniforms||[])this.bindingLayout[r.name]=r}}setUniforms(e){for(const[t,n]of Object.entries(e))this._setUniform(t,n),this.needsRedraw||this.setNeedsRedraw(`${this.name}.${t}=${n}`)}setNeedsRedraw(e){this.needsRedraw=this.needsRedraw||e}getAllUniforms(){return this.modifiedUniforms={},this.needsRedraw=!1,this.uniforms||{}}_setUniform(e,t){JN(this.uniforms[e],t)||(this.uniforms[e]=eD(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ri=class{constructor(e){$(this,"uniformBlocks",new Map),$(this,"uniformBufferLayouts",new Map),$(this,"uniformBuffers",new Map);for(const[t,n]of Object.entries(e)){const s=t,r=new QN(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new tD({name:t});o.setUniforms(n.defaultUniforms||{}),this.uniformBlocks.set(s,o)}}destroy(){for(const e of this.uniformBuffers.values())e.destroy()}setUniforms(e){var t;for(const[n,s]of Object.entries(e))(t=this.uniformBlocks.get(n))==null||t.setUniforms(s);this.updateUniformBuffers()}getUniformBufferByteLength(e){var t;return((t=this.uniformBufferLayouts.get(e))==null?void 0:t.byteLength)||0}getUniformBufferData(e){var t,n;const s=((t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms())||{};return(n=this.uniformBufferLayouts.get(e))==null?void 0:n.getData(s)}createUniformBuffer(e,t,n){n&&this.setUniforms(n);const s=this.getUniformBufferByteLength(t),r=e.createBuffer({usage:ge.UNIFORM|ge.COPY_DST,byteLength:s}),o=this.getUniformBufferData(t);return r.write(o),r}getManagedUniformBuffer(e,t){if(!this.uniformBuffers.get(t)){const n=this.getUniformBufferByteLength(t),s=e.createBuffer({usage:ge.UNIFORM|ge.COPY_DST,byteLength:n});this.uniformBuffers.set(t,s)}return this.uniformBuffers.get(t)}updateUniformBuffers(){let e=!1;for(const t of this.uniformBlocks.keys()){const n=this.updateUniformBuffer(t);e||(e=n)}return e&&le.log(3,`UniformStore.updateUniformBuffers(): ${e}`)(),e}updateUniformBuffer(e){var t;const n=this.uniformBlocks.get(e);let s=this.uniformBuffers.get(e),r=!1;if(s&&n!=null&&n.needsRedraw){r||(r=n.needsRedraw);const o=this.getUniformBufferData(e);s=this.uniformBuffers.get(e),s==null||s.write(o);const a=(t=this.uniformBlocks.get(e))==null?void 0:t.getAllUniforms();le.log(4,`Writing to uniform buffer ${String(e)}`,o,a)()}return r}};var Do;(function(i){i[i.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",i[i.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",i[i.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN",i[i.ZERO=0]="ZERO",i[i.ONE=1]="ONE",i[i.SRC_COLOR=768]="SRC_COLOR",i[i.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",i[i.SRC_ALPHA=770]="SRC_ALPHA",i[i.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",i[i.DST_ALPHA=772]="DST_ALPHA",i[i.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",i[i.DST_COLOR=774]="DST_COLOR",i[i.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",i[i.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",i[i.CONSTANT_COLOR=32769]="CONSTANT_COLOR",i[i.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",i[i.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",i[i.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",i[i.FUNC_ADD=32774]="FUNC_ADD",i[i.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",i[i.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",i[i.BLEND_EQUATION=32777]="BLEND_EQUATION",i[i.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",i[i.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",i[i.BLEND_DST_RGB=32968]="BLEND_DST_RGB",i[i.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",i[i.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",i[i.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",i[i.BLEND_COLOR=32773]="BLEND_COLOR",i[i.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",i[i.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",i[i.LINE_WIDTH=2849]="LINE_WIDTH",i[i.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",i[i.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",i[i.CULL_FACE_MODE=2885]="CULL_FACE_MODE",i[i.FRONT_FACE=2886]="FRONT_FACE",i[i.DEPTH_RANGE=2928]="DEPTH_RANGE",i[i.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",i[i.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",i[i.DEPTH_FUNC=2932]="DEPTH_FUNC",i[i.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",i[i.STENCIL_FUNC=2962]="STENCIL_FUNC",i[i.STENCIL_FAIL=2964]="STENCIL_FAIL",i[i.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",i[i.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",i[i.STENCIL_REF=2967]="STENCIL_REF",i[i.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",i[i.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",i[i.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",i[i.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",i[i.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",i[i.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",i[i.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",i[i.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",i[i.VIEWPORT=2978]="VIEWPORT",i[i.SCISSOR_BOX=3088]="SCISSOR_BOX",i[i.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",i[i.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",i[i.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",i[i.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",i[i.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",i[i.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",i[i.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",i[i.RED_BITS=3410]="RED_BITS",i[i.GREEN_BITS=3411]="GREEN_BITS",i[i.BLUE_BITS=3412]="BLUE_BITS",i[i.ALPHA_BITS=3413]="ALPHA_BITS",i[i.DEPTH_BITS=3414]="DEPTH_BITS",i[i.STENCIL_BITS=3415]="STENCIL_BITS",i[i.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",i[i.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",i[i.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",i[i.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",i[i.SAMPLES=32937]="SAMPLES",i[i.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",i[i.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",i[i.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",i[i.VENDOR=7936]="VENDOR",i[i.RENDERER=7937]="RENDERER",i[i.VERSION=7938]="VERSION",i[i.IMPLEMENTATION_COLOR_READ_TYPE=35738]="IMPLEMENTATION_COLOR_READ_TYPE",i[i.IMPLEMENTATION_COLOR_READ_FORMAT=35739]="IMPLEMENTATION_COLOR_READ_FORMAT",i[i.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",i[i.STATIC_DRAW=35044]="STATIC_DRAW",i[i.STREAM_DRAW=35040]="STREAM_DRAW",i[i.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",i[i.BUFFER_SIZE=34660]="BUFFER_SIZE",i[i.BUFFER_USAGE=34661]="BUFFER_USAGE",i[i.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",i[i.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",i[i.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",i[i.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",i[i.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",i[i.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",i[i.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",i[i.CULL_FACE=2884]="CULL_FACE",i[i.FRONT=1028]="FRONT",i[i.BACK=1029]="BACK",i[i.FRONT_AND_BACK=1032]="FRONT_AND_BACK",i[i.BLEND=3042]="BLEND",i[i.DEPTH_TEST=2929]="DEPTH_TEST",i[i.DITHER=3024]="DITHER",i[i.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",i[i.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",i[i.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",i[i.SCISSOR_TEST=3089]="SCISSOR_TEST",i[i.STENCIL_TEST=2960]="STENCIL_TEST",i[i.NO_ERROR=0]="NO_ERROR",i[i.INVALID_ENUM=1280]="INVALID_ENUM",i[i.INVALID_VALUE=1281]="INVALID_VALUE",i[i.INVALID_OPERATION=1282]="INVALID_OPERATION",i[i.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",i[i.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",i[i.CW=2304]="CW",i[i.CCW=2305]="CCW",i[i.DONT_CARE=4352]="DONT_CARE",i[i.FASTEST=4353]="FASTEST",i[i.NICEST=4354]="NICEST",i[i.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",i[i.BYTE=5120]="BYTE",i[i.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",i[i.SHORT=5122]="SHORT",i[i.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",i[i.INT=5124]="INT",i[i.UNSIGNED_INT=5125]="UNSIGNED_INT",i[i.FLOAT=5126]="FLOAT",i[i.DOUBLE=5130]="DOUBLE",i[i.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",i[i.ALPHA=6406]="ALPHA",i[i.RGB=6407]="RGB",i[i.RGBA=6408]="RGBA",i[i.LUMINANCE=6409]="LUMINANCE",i[i.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",i[i.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",i[i.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",i[i.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",i[i.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",i[i.VERTEX_SHADER=35633]="VERTEX_SHADER",i[i.COMPILE_STATUS=35713]="COMPILE_STATUS",i[i.DELETE_STATUS=35712]="DELETE_STATUS",i[i.LINK_STATUS=35714]="LINK_STATUS",i[i.VALIDATE_STATUS=35715]="VALIDATE_STATUS",i[i.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",i[i.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",i[i.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",i[i.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",i[i.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",i[i.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",i[i.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",i[i.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",i[i.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",i[i.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",i[i.SHADER_TYPE=35663]="SHADER_TYPE",i[i.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",i[i.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",i[i.NEVER=512]="NEVER",i[i.LESS=513]="LESS",i[i.EQUAL=514]="EQUAL",i[i.LEQUAL=515]="LEQUAL",i[i.GREATER=516]="GREATER",i[i.NOTEQUAL=517]="NOTEQUAL",i[i.GEQUAL=518]="GEQUAL",i[i.ALWAYS=519]="ALWAYS",i[i.KEEP=7680]="KEEP",i[i.REPLACE=7681]="REPLACE",i[i.INCR=7682]="INCR",i[i.DECR=7683]="DECR",i[i.INVERT=5386]="INVERT",i[i.INCR_WRAP=34055]="INCR_WRAP",i[i.DECR_WRAP=34056]="DECR_WRAP",i[i.NEAREST=9728]="NEAREST",i[i.LINEAR=9729]="LINEAR",i[i.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",i[i.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",i[i.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",i[i.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",i[i.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",i[i.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",i[i.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",i[i.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",i[i.TEXTURE_2D=3553]="TEXTURE_2D",i[i.TEXTURE=5890]="TEXTURE",i[i.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",i[i.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",i[i.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",i[i.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",i[i.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",i[i.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",i[i.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",i[i.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",i[i.TEXTURE0=33984]="TEXTURE0",i[i.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",i[i.REPEAT=10497]="REPEAT",i[i.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",i[i.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",i[i.TEXTURE_WIDTH=4096]="TEXTURE_WIDTH",i[i.TEXTURE_HEIGHT=4097]="TEXTURE_HEIGHT",i[i.FLOAT_VEC2=35664]="FLOAT_VEC2",i[i.FLOAT_VEC3=35665]="FLOAT_VEC3",i[i.FLOAT_VEC4=35666]="FLOAT_VEC4",i[i.INT_VEC2=35667]="INT_VEC2",i[i.INT_VEC3=35668]="INT_VEC3",i[i.INT_VEC4=35669]="INT_VEC4",i[i.BOOL=35670]="BOOL",i[i.BOOL_VEC2=35671]="BOOL_VEC2",i[i.BOOL_VEC3=35672]="BOOL_VEC3",i[i.BOOL_VEC4=35673]="BOOL_VEC4",i[i.FLOAT_MAT2=35674]="FLOAT_MAT2",i[i.FLOAT_MAT3=35675]="FLOAT_MAT3",i[i.FLOAT_MAT4=35676]="FLOAT_MAT4",i[i.SAMPLER_2D=35678]="SAMPLER_2D",i[i.SAMPLER_CUBE=35680]="SAMPLER_CUBE",i[i.LOW_FLOAT=36336]="LOW_FLOAT",i[i.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",i[i.HIGH_FLOAT=36338]="HIGH_FLOAT",i[i.LOW_INT=36339]="LOW_INT",i[i.MEDIUM_INT=36340]="MEDIUM_INT",i[i.HIGH_INT=36341]="HIGH_INT",i[i.FRAMEBUFFER=36160]="FRAMEBUFFER",i[i.RENDERBUFFER=36161]="RENDERBUFFER",i[i.RGBA4=32854]="RGBA4",i[i.RGB5_A1=32855]="RGB5_A1",i[i.RGB565=36194]="RGB565",i[i.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",i[i.STENCIL_INDEX=6401]="STENCIL_INDEX",i[i.STENCIL_INDEX8=36168]="STENCIL_INDEX8",i[i.DEPTH_STENCIL=34041]="DEPTH_STENCIL",i[i.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",i[i.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",i[i.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",i[i.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",i[i.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",i[i.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",i[i.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",i[i.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",i[i.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",i[i.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",i[i.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",i[i.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",i[i.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",i[i.NONE=0]="NONE",i[i.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",i[i.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",i[i.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",i[i.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",i[i.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",i[i.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER",i[i.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER",i[i.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",i[i.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",i[i.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",i[i.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",i[i.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",i[i.READ_BUFFER=3074]="READ_BUFFER",i[i.UNPACK_ROW_LENGTH=3314]="UNPACK_ROW_LENGTH",i[i.UNPACK_SKIP_ROWS=3315]="UNPACK_SKIP_ROWS",i[i.UNPACK_SKIP_PIXELS=3316]="UNPACK_SKIP_PIXELS",i[i.PACK_ROW_LENGTH=3330]="PACK_ROW_LENGTH",i[i.PACK_SKIP_ROWS=3331]="PACK_SKIP_ROWS",i[i.PACK_SKIP_PIXELS=3332]="PACK_SKIP_PIXELS",i[i.TEXTURE_BINDING_3D=32874]="TEXTURE_BINDING_3D",i[i.UNPACK_SKIP_IMAGES=32877]="UNPACK_SKIP_IMAGES",i[i.UNPACK_IMAGE_HEIGHT=32878]="UNPACK_IMAGE_HEIGHT",i[i.MAX_3D_TEXTURE_SIZE=32883]="MAX_3D_TEXTURE_SIZE",i[i.MAX_ELEMENTS_VERTICES=33e3]="MAX_ELEMENTS_VERTICES",i[i.MAX_ELEMENTS_INDICES=33001]="MAX_ELEMENTS_INDICES",i[i.MAX_TEXTURE_LOD_BIAS=34045]="MAX_TEXTURE_LOD_BIAS",i[i.MAX_FRAGMENT_UNIFORM_COMPONENTS=35657]="MAX_FRAGMENT_UNIFORM_COMPONENTS",i[i.MAX_VERTEX_UNIFORM_COMPONENTS=35658]="MAX_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_ARRAY_TEXTURE_LAYERS=35071]="MAX_ARRAY_TEXTURE_LAYERS",i[i.MIN_PROGRAM_TEXEL_OFFSET=35076]="MIN_PROGRAM_TEXEL_OFFSET",i[i.MAX_PROGRAM_TEXEL_OFFSET=35077]="MAX_PROGRAM_TEXEL_OFFSET",i[i.MAX_VARYING_COMPONENTS=35659]="MAX_VARYING_COMPONENTS",i[i.FRAGMENT_SHADER_DERIVATIVE_HINT=35723]="FRAGMENT_SHADER_DERIVATIVE_HINT",i[i.RASTERIZER_DISCARD=35977]="RASTERIZER_DISCARD",i[i.VERTEX_ARRAY_BINDING=34229]="VERTEX_ARRAY_BINDING",i[i.MAX_VERTEX_OUTPUT_COMPONENTS=37154]="MAX_VERTEX_OUTPUT_COMPONENTS",i[i.MAX_FRAGMENT_INPUT_COMPONENTS=37157]="MAX_FRAGMENT_INPUT_COMPONENTS",i[i.MAX_SERVER_WAIT_TIMEOUT=37137]="MAX_SERVER_WAIT_TIMEOUT",i[i.MAX_ELEMENT_INDEX=36203]="MAX_ELEMENT_INDEX",i[i.RED=6403]="RED",i[i.RGB8=32849]="RGB8",i[i.RGBA8=32856]="RGBA8",i[i.RGB10_A2=32857]="RGB10_A2",i[i.TEXTURE_3D=32879]="TEXTURE_3D",i[i.TEXTURE_WRAP_R=32882]="TEXTURE_WRAP_R",i[i.TEXTURE_MIN_LOD=33082]="TEXTURE_MIN_LOD",i[i.TEXTURE_MAX_LOD=33083]="TEXTURE_MAX_LOD",i[i.TEXTURE_BASE_LEVEL=33084]="TEXTURE_BASE_LEVEL",i[i.TEXTURE_MAX_LEVEL=33085]="TEXTURE_MAX_LEVEL",i[i.TEXTURE_COMPARE_MODE=34892]="TEXTURE_COMPARE_MODE",i[i.TEXTURE_COMPARE_FUNC=34893]="TEXTURE_COMPARE_FUNC",i[i.SRGB=35904]="SRGB",i[i.SRGB8=35905]="SRGB8",i[i.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8",i[i.COMPARE_REF_TO_TEXTURE=34894]="COMPARE_REF_TO_TEXTURE",i[i.RGBA32F=34836]="RGBA32F",i[i.RGB32F=34837]="RGB32F",i[i.RGBA16F=34842]="RGBA16F",i[i.RGB16F=34843]="RGB16F",i[i.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",i[i.TEXTURE_BINDING_2D_ARRAY=35869]="TEXTURE_BINDING_2D_ARRAY",i[i.R11F_G11F_B10F=35898]="R11F_G11F_B10F",i[i.RGB9_E5=35901]="RGB9_E5",i[i.RGBA32UI=36208]="RGBA32UI",i[i.RGB32UI=36209]="RGB32UI",i[i.RGBA16UI=36214]="RGBA16UI",i[i.RGB16UI=36215]="RGB16UI",i[i.RGBA8UI=36220]="RGBA8UI",i[i.RGB8UI=36221]="RGB8UI",i[i.RGBA32I=36226]="RGBA32I",i[i.RGB32I=36227]="RGB32I",i[i.RGBA16I=36232]="RGBA16I",i[i.RGB16I=36233]="RGB16I",i[i.RGBA8I=36238]="RGBA8I",i[i.RGB8I=36239]="RGB8I",i[i.RED_INTEGER=36244]="RED_INTEGER",i[i.RGB_INTEGER=36248]="RGB_INTEGER",i[i.RGBA_INTEGER=36249]="RGBA_INTEGER",i[i.R8=33321]="R8",i[i.RG8=33323]="RG8",i[i.R16F=33325]="R16F",i[i.R32F=33326]="R32F",i[i.RG16F=33327]="RG16F",i[i.RG32F=33328]="RG32F",i[i.R8I=33329]="R8I",i[i.R8UI=33330]="R8UI",i[i.R16I=33331]="R16I",i[i.R16UI=33332]="R16UI",i[i.R32I=33333]="R32I",i[i.R32UI=33334]="R32UI",i[i.RG8I=33335]="RG8I",i[i.RG8UI=33336]="RG8UI",i[i.RG16I=33337]="RG16I",i[i.RG16UI=33338]="RG16UI",i[i.RG32I=33339]="RG32I",i[i.RG32UI=33340]="RG32UI",i[i.R8_SNORM=36756]="R8_SNORM",i[i.RG8_SNORM=36757]="RG8_SNORM",i[i.RGB8_SNORM=36758]="RGB8_SNORM",i[i.RGBA8_SNORM=36759]="RGBA8_SNORM",i[i.RGB10_A2UI=36975]="RGB10_A2UI",i[i.TEXTURE_IMMUTABLE_FORMAT=37167]="TEXTURE_IMMUTABLE_FORMAT",i[i.TEXTURE_IMMUTABLE_LEVELS=33503]="TEXTURE_IMMUTABLE_LEVELS",i[i.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",i[i.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",i[i.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",i[i.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",i[i.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",i[i.HALF_FLOAT=5131]="HALF_FLOAT",i[i.RG=33319]="RG",i[i.RG_INTEGER=33320]="RG_INTEGER",i[i.INT_2_10_10_10_REV=36255]="INT_2_10_10_10_REV",i[i.CURRENT_QUERY=34917]="CURRENT_QUERY",i[i.QUERY_RESULT=34918]="QUERY_RESULT",i[i.QUERY_RESULT_AVAILABLE=34919]="QUERY_RESULT_AVAILABLE",i[i.ANY_SAMPLES_PASSED=35887]="ANY_SAMPLES_PASSED",i[i.ANY_SAMPLES_PASSED_CONSERVATIVE=36202]="ANY_SAMPLES_PASSED_CONSERVATIVE",i[i.MAX_DRAW_BUFFERS=34852]="MAX_DRAW_BUFFERS",i[i.DRAW_BUFFER0=34853]="DRAW_BUFFER0",i[i.DRAW_BUFFER1=34854]="DRAW_BUFFER1",i[i.DRAW_BUFFER2=34855]="DRAW_BUFFER2",i[i.DRAW_BUFFER3=34856]="DRAW_BUFFER3",i[i.DRAW_BUFFER4=34857]="DRAW_BUFFER4",i[i.DRAW_BUFFER5=34858]="DRAW_BUFFER5",i[i.DRAW_BUFFER6=34859]="DRAW_BUFFER6",i[i.DRAW_BUFFER7=34860]="DRAW_BUFFER7",i[i.DRAW_BUFFER8=34861]="DRAW_BUFFER8",i[i.DRAW_BUFFER9=34862]="DRAW_BUFFER9",i[i.DRAW_BUFFER10=34863]="DRAW_BUFFER10",i[i.DRAW_BUFFER11=34864]="DRAW_BUFFER11",i[i.DRAW_BUFFER12=34865]="DRAW_BUFFER12",i[i.DRAW_BUFFER13=34866]="DRAW_BUFFER13",i[i.DRAW_BUFFER14=34867]="DRAW_BUFFER14",i[i.DRAW_BUFFER15=34868]="DRAW_BUFFER15",i[i.MAX_COLOR_ATTACHMENTS=36063]="MAX_COLOR_ATTACHMENTS",i[i.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1",i[i.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2",i[i.COLOR_ATTACHMENT3=36067]="COLOR_ATTACHMENT3",i[i.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4",i[i.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5",i[i.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6",i[i.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7",i[i.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8",i[i.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9",i[i.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10",i[i.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11",i[i.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12",i[i.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13",i[i.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14",i[i.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15",i[i.SAMPLER_3D=35679]="SAMPLER_3D",i[i.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW",i[i.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY",i[i.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW",i[i.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW",i[i.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D",i[i.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D",i[i.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE",i[i.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY",i[i.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D",i[i.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D",i[i.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE",i[i.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY",i[i.MAX_SAMPLES=36183]="MAX_SAMPLES",i[i.SAMPLER_BINDING=35097]="SAMPLER_BINDING",i[i.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER",i[i.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER",i[i.PIXEL_PACK_BUFFER_BINDING=35053]="PIXEL_PACK_BUFFER_BINDING",i[i.PIXEL_UNPACK_BUFFER_BINDING=35055]="PIXEL_UNPACK_BUFFER_BINDING",i[i.COPY_READ_BUFFER=36662]="COPY_READ_BUFFER",i[i.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER",i[i.COPY_READ_BUFFER_BINDING=36662]="COPY_READ_BUFFER_BINDING",i[i.COPY_WRITE_BUFFER_BINDING=36663]="COPY_WRITE_BUFFER_BINDING",i[i.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3",i[i.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4",i[i.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2",i[i.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4",i[i.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2",i[i.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3",i[i.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2",i[i.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3",i[i.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4",i[i.UNSIGNED_NORMALIZED=35863]="UNSIGNED_NORMALIZED",i[i.SIGNED_NORMALIZED=36764]="SIGNED_NORMALIZED",i[i.VERTEX_ATTRIB_ARRAY_INTEGER=35069]="VERTEX_ATTRIB_ARRAY_INTEGER",i[i.VERTEX_ATTRIB_ARRAY_DIVISOR=35070]="VERTEX_ATTRIB_ARRAY_DIVISOR",i[i.TRANSFORM_FEEDBACK_BUFFER_MODE=35967]="TRANSFORM_FEEDBACK_BUFFER_MODE",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS=35968]="MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS",i[i.TRANSFORM_FEEDBACK_VARYINGS=35971]="TRANSFORM_FEEDBACK_VARYINGS",i[i.TRANSFORM_FEEDBACK_BUFFER_START=35972]="TRANSFORM_FEEDBACK_BUFFER_START",i[i.TRANSFORM_FEEDBACK_BUFFER_SIZE=35973]="TRANSFORM_FEEDBACK_BUFFER_SIZE",i[i.TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN=35976]="TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN",i[i.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS=35978]="MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS",i[i.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS=35979]="MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS",i[i.INTERLEAVED_ATTRIBS=35980]="INTERLEAVED_ATTRIBS",i[i.SEPARATE_ATTRIBS=35981]="SEPARATE_ATTRIBS",i[i.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER",i[i.TRANSFORM_FEEDBACK_BUFFER_BINDING=35983]="TRANSFORM_FEEDBACK_BUFFER_BINDING",i[i.TRANSFORM_FEEDBACK=36386]="TRANSFORM_FEEDBACK",i[i.TRANSFORM_FEEDBACK_PAUSED=36387]="TRANSFORM_FEEDBACK_PAUSED",i[i.TRANSFORM_FEEDBACK_ACTIVE=36388]="TRANSFORM_FEEDBACK_ACTIVE",i[i.TRANSFORM_FEEDBACK_BINDING=36389]="TRANSFORM_FEEDBACK_BINDING",i[i.FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING=33296]="FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING",i[i.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE=33297]="FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE",i[i.FRAMEBUFFER_ATTACHMENT_RED_SIZE=33298]="FRAMEBUFFER_ATTACHMENT_RED_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_GREEN_SIZE=33299]="FRAMEBUFFER_ATTACHMENT_GREEN_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_BLUE_SIZE=33300]="FRAMEBUFFER_ATTACHMENT_BLUE_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE=33301]="FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE=33302]="FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE",i[i.FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE=33303]="FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE",i[i.FRAMEBUFFER_DEFAULT=33304]="FRAMEBUFFER_DEFAULT",i[i.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8",i[i.DRAW_FRAMEBUFFER_BINDING=36006]="DRAW_FRAMEBUFFER_BINDING",i[i.READ_FRAMEBUFFER_BINDING=36010]="READ_FRAMEBUFFER_BINDING",i[i.RENDERBUFFER_SAMPLES=36011]="RENDERBUFFER_SAMPLES",i[i.FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER=36052]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER",i[i.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE=36182]="FRAMEBUFFER_INCOMPLETE_MULTISAMPLE",i[i.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",i[i.UNIFORM_BUFFER_BINDING=35368]="UNIFORM_BUFFER_BINDING",i[i.UNIFORM_BUFFER_START=35369]="UNIFORM_BUFFER_START",i[i.UNIFORM_BUFFER_SIZE=35370]="UNIFORM_BUFFER_SIZE",i[i.MAX_VERTEX_UNIFORM_BLOCKS=35371]="MAX_VERTEX_UNIFORM_BLOCKS",i[i.MAX_FRAGMENT_UNIFORM_BLOCKS=35373]="MAX_FRAGMENT_UNIFORM_BLOCKS",i[i.MAX_COMBINED_UNIFORM_BLOCKS=35374]="MAX_COMBINED_UNIFORM_BLOCKS",i[i.MAX_UNIFORM_BUFFER_BINDINGS=35375]="MAX_UNIFORM_BUFFER_BINDINGS",i[i.MAX_UNIFORM_BLOCK_SIZE=35376]="MAX_UNIFORM_BLOCK_SIZE",i[i.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS=35377]="MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS",i[i.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS=35379]="MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS",i[i.UNIFORM_BUFFER_OFFSET_ALIGNMENT=35380]="UNIFORM_BUFFER_OFFSET_ALIGNMENT",i[i.ACTIVE_UNIFORM_BLOCKS=35382]="ACTIVE_UNIFORM_BLOCKS",i[i.UNIFORM_TYPE=35383]="UNIFORM_TYPE",i[i.UNIFORM_SIZE=35384]="UNIFORM_SIZE",i[i.UNIFORM_BLOCK_INDEX=35386]="UNIFORM_BLOCK_INDEX",i[i.UNIFORM_OFFSET=35387]="UNIFORM_OFFSET",i[i.UNIFORM_ARRAY_STRIDE=35388]="UNIFORM_ARRAY_STRIDE",i[i.UNIFORM_MATRIX_STRIDE=35389]="UNIFORM_MATRIX_STRIDE",i[i.UNIFORM_IS_ROW_MAJOR=35390]="UNIFORM_IS_ROW_MAJOR",i[i.UNIFORM_BLOCK_BINDING=35391]="UNIFORM_BLOCK_BINDING",i[i.UNIFORM_BLOCK_DATA_SIZE=35392]="UNIFORM_BLOCK_DATA_SIZE",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORMS=35394]="UNIFORM_BLOCK_ACTIVE_UNIFORMS",i[i.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES=35395]="UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES",i[i.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER=35396]="UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER",i[i.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER=35398]="UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER",i[i.OBJECT_TYPE=37138]="OBJECT_TYPE",i[i.SYNC_CONDITION=37139]="SYNC_CONDITION",i[i.SYNC_STATUS=37140]="SYNC_STATUS",i[i.SYNC_FLAGS=37141]="SYNC_FLAGS",i[i.SYNC_FENCE=37142]="SYNC_FENCE",i[i.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE",i[i.UNSIGNALED=37144]="UNSIGNALED",i[i.SIGNALED=37145]="SIGNALED",i[i.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED",i[i.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED",i[i.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED",i[i.WAIT_FAILED=37149]="WAIT_FAILED",i[i.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT",i[i.COLOR=6144]="COLOR",i[i.DEPTH=6145]="DEPTH",i[i.STENCIL=6146]="STENCIL",i[i.MIN=32775]="MIN",i[i.MAX=32776]="MAX",i[i.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24",i[i.STREAM_READ=35041]="STREAM_READ",i[i.STREAM_COPY=35042]="STREAM_COPY",i[i.STATIC_READ=35045]="STATIC_READ",i[i.STATIC_COPY=35046]="STATIC_COPY",i[i.DYNAMIC_READ=35049]="DYNAMIC_READ",i[i.DYNAMIC_COPY=35050]="DYNAMIC_COPY",i[i.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F",i[i.DEPTH32F_STENCIL8=36013]="DEPTH32F_STENCIL8",i[i.INVALID_INDEX=4294967295]="INVALID_INDEX",i[i.TIMEOUT_IGNORED=-1]="TIMEOUT_IGNORED",i[i.MAX_CLIENT_WAIT_TIMEOUT_WEBGL=37447]="MAX_CLIENT_WAIT_TIMEOUT_WEBGL",i[i.UNMASKED_VENDOR_WEBGL=37445]="UNMASKED_VENDOR_WEBGL",i[i.UNMASKED_RENDERER_WEBGL=37446]="UNMASKED_RENDERER_WEBGL",i[i.MAX_TEXTURE_MAX_ANISOTROPY_EXT=34047]="MAX_TEXTURE_MAX_ANISOTROPY_EXT",i[i.TEXTURE_MAX_ANISOTROPY_EXT=34046]="TEXTURE_MAX_ANISOTROPY_EXT",i[i.R16_EXT=33322]="R16_EXT",i[i.RG16_EXT=33324]="RG16_EXT",i[i.RGB16_EXT=32852]="RGB16_EXT",i[i.RGBA16_EXT=32859]="RGBA16_EXT",i[i.R16_SNORM_EXT=36760]="R16_SNORM_EXT",i[i.RG16_SNORM_EXT=36761]="RG16_SNORM_EXT",i[i.RGB16_SNORM_EXT=36762]="RGB16_SNORM_EXT",i[i.RGBA16_SNORM_EXT=36763]="RGBA16_SNORM_EXT",i[i.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",i[i.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",i[i.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",i[i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",i[i.COMPRESSED_RED_RGTC1_EXT=36283]="COMPRESSED_RED_RGTC1_EXT",i[i.COMPRESSED_SIGNED_RED_RGTC1_EXT=36284]="COMPRESSED_SIGNED_RED_RGTC1_EXT",i[i.COMPRESSED_RED_GREEN_RGTC2_EXT=36285]="COMPRESSED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT=36286]="COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT",i[i.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",i[i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",i[i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",i[i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",i[i.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",i[i.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",i[i.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",i[i.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",i[i.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",i[i.COMPRESSED_RGBA8_ETC2_EAC=37493]="COMPRESSED_RGBA8_ETC2_EAC",i[i.COMPRESSED_SRGB8_ETC2=37494]="COMPRESSED_SRGB8_ETC2",i[i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37495]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",i[i.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37496]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37497]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",i[i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",i[i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",i[i.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",i[i.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",i[i.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",i[i.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x4_KHR=37809]="COMPRESSED_RGBA_ASTC_5x4_KHR",i[i.COMPRESSED_RGBA_ASTC_5x5_KHR=37810]="COMPRESSED_RGBA_ASTC_5x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x5_KHR=37811]="COMPRESSED_RGBA_ASTC_6x5_KHR",i[i.COMPRESSED_RGBA_ASTC_6x6_KHR=37812]="COMPRESSED_RGBA_ASTC_6x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x5_KHR=37813]="COMPRESSED_RGBA_ASTC_8x5_KHR",i[i.COMPRESSED_RGBA_ASTC_8x6_KHR=37814]="COMPRESSED_RGBA_ASTC_8x6_KHR",i[i.COMPRESSED_RGBA_ASTC_8x8_KHR=37815]="COMPRESSED_RGBA_ASTC_8x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x5_KHR=37816]="COMPRESSED_RGBA_ASTC_10x5_KHR",i[i.COMPRESSED_RGBA_ASTC_10x6_KHR=37817]="COMPRESSED_RGBA_ASTC_10x6_KHR",i[i.COMPRESSED_RGBA_ASTC_10x8_KHR=37818]="COMPRESSED_RGBA_ASTC_10x8_KHR",i[i.COMPRESSED_RGBA_ASTC_10x10_KHR=37819]="COMPRESSED_RGBA_ASTC_10x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x10_KHR=37820]="COMPRESSED_RGBA_ASTC_12x10_KHR",i[i.COMPRESSED_RGBA_ASTC_12x12_KHR=37821]="COMPRESSED_RGBA_ASTC_12x12_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR=37840]="COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR=37841]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR=37842]="COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR=37843]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR=37844]="COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR=37845]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR=37846]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR=37847]="COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR=37848]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR=37849]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR=37850]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR=37851]="COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR=37852]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR",i[i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR=37853]="COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR",i[i.QUERY_COUNTER_BITS_EXT=34916]="QUERY_COUNTER_BITS_EXT",i[i.CURRENT_QUERY_EXT=34917]="CURRENT_QUERY_EXT",i[i.QUERY_RESULT_EXT=34918]="QUERY_RESULT_EXT",i[i.QUERY_RESULT_AVAILABLE_EXT=34919]="QUERY_RESULT_AVAILABLE_EXT",i[i.TIME_ELAPSED_EXT=35007]="TIME_ELAPSED_EXT",i[i.TIMESTAMP_EXT=36392]="TIMESTAMP_EXT",i[i.GPU_DISJOINT_EXT=36795]="GPU_DISJOINT_EXT",i[i.COMPLETION_STATUS_KHR=37297]="COMPLETION_STATUS_KHR",i[i.DEPTH_CLAMP_EXT=34383]="DEPTH_CLAMP_EXT",i[i.FIRST_VERTEX_CONVENTION_WEBGL=36429]="FIRST_VERTEX_CONVENTION_WEBGL",i[i.LAST_VERTEX_CONVENTION_WEBGL=36430]="LAST_VERTEX_CONVENTION_WEBGL",i[i.PROVOKING_VERTEX_WEBL=36431]="PROVOKING_VERTEX_WEBL",i[i.POLYGON_MODE_WEBGL=2880]="POLYGON_MODE_WEBGL",i[i.POLYGON_OFFSET_LINE_WEBGL=10754]="POLYGON_OFFSET_LINE_WEBGL",i[i.LINE_WEBGL=6913]="LINE_WEBGL",i[i.FILL_WEBGL=6914]="FILL_WEBGL",i[i.MAX_CLIP_DISTANCES_WEBGL=3378]="MAX_CLIP_DISTANCES_WEBGL",i[i.MAX_CULL_DISTANCES_WEBGL=33529]="MAX_CULL_DISTANCES_WEBGL",i[i.MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL=33530]="MAX_COMBINED_CLIP_AND_CULL_DISTANCES_WEBGL",i[i.CLIP_DISTANCE0_WEBGL=12288]="CLIP_DISTANCE0_WEBGL",i[i.CLIP_DISTANCE1_WEBGL=12289]="CLIP_DISTANCE1_WEBGL",i[i.CLIP_DISTANCE2_WEBGL=12290]="CLIP_DISTANCE2_WEBGL",i[i.CLIP_DISTANCE3_WEBGL=12291]="CLIP_DISTANCE3_WEBGL",i[i.CLIP_DISTANCE4_WEBGL=12292]="CLIP_DISTANCE4_WEBGL",i[i.CLIP_DISTANCE5_WEBGL=12293]="CLIP_DISTANCE5_WEBGL",i[i.CLIP_DISTANCE6_WEBGL=12294]="CLIP_DISTANCE6_WEBGL",i[i.CLIP_DISTANCE7_WEBGL=12295]="CLIP_DISTANCE7_WEBGL",i[i.POLYGON_OFFSET_CLAMP_EXT=36379]="POLYGON_OFFSET_CLAMP_EXT",i[i.LOWER_LEFT_EXT=36001]="LOWER_LEFT_EXT",i[i.UPPER_LEFT_EXT=36002]="UPPER_LEFT_EXT",i[i.NEGATIVE_ONE_TO_ONE_EXT=37726]="NEGATIVE_ONE_TO_ONE_EXT",i[i.ZERO_TO_ONE_EXT=37727]="ZERO_TO_ONE_EXT",i[i.CLIP_ORIGIN_EXT=37724]="CLIP_ORIGIN_EXT",i[i.CLIP_DEPTH_MODE_EXT=37725]="CLIP_DEPTH_MODE_EXT",i[i.SRC1_COLOR_WEBGL=35065]="SRC1_COLOR_WEBGL",i[i.SRC1_ALPHA_WEBGL=34185]="SRC1_ALPHA_WEBGL",i[i.ONE_MINUS_SRC1_COLOR_WEBGL=35066]="ONE_MINUS_SRC1_COLOR_WEBGL",i[i.ONE_MINUS_SRC1_ALPHA_WEBGL=35067]="ONE_MINUS_SRC1_ALPHA_WEBGL",i[i.MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL=35068]="MAX_DUAL_SOURCE_DRAW_BUFFERS_WEBGL",i[i.MIRROR_CLAMP_TO_EDGE_EXT=34627]="MIRROR_CLAMP_TO_EDGE_EXT"})(Do||(Do={}));const iD={WEBGL_depth_texture:{UNSIGNED_INT_24_8_WEBGL:34042},OES_element_index_uint:{},OES_texture_float:{},OES_texture_half_float:{HALF_FLOAT_OES:5131},EXT_color_buffer_float:{},OES_standard_derivatives:{FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723},EXT_frag_depth:{},EXT_blend_minmax:{MIN_EXT:32775,MAX_EXT:32776},EXT_shader_texture_lod:{}},nD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),sD=i=>({VERTEX_ARRAY_BINDING_OES:34229,createVertexArrayOES(){return i.createVertexArray()},deleteVertexArrayOES(e){return i.deleteVertexArray(e)},isVertexArrayOES(e){return i.isVertexArray(e)},bindVertexArrayOES(e){return i.bindVertexArray(e)}}),rD=i=>({VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,drawArraysInstancedANGLE(...e){return i.drawArraysInstanced(...e)},drawElementsInstancedANGLE(...e){return i.drawElementsInstanced(...e)},vertexAttribDivisorANGLE(...e){return i.vertexAttribDivisor(...e)}});function oD(i=!0){const e=HTMLCanvasElement.prototype;if(!i&&e.originalGetContext){e.getContext=e.originalGetContext,e.originalGetContext=void 0;return}e.originalGetContext=e.getContext,e.getContext=function(t,n){if(t==="webgl"||t==="experimental-webgl"){const s=this.originalGetContext("webgl2",n);return s instanceof HTMLElement&&aD(s),s}return this.originalGetContext(t,n)}}function aD(i){i.getExtension("EXT_color_buffer_float");const e={...iD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:nD(i),OES_vertex_array_object:sD(i),ANGLE_instanced_arrays:rD(i)},t=i.getExtension;i.getExtension=function(s){return t.call(i,s)||(s in e?e[s]:null)};const n=i.getSupportedExtensions;i.getSupportedExtensions=function(){const s=n.apply(i)||[];return s==null?void 0:s.concat(Object.keys(e))}}async function A2(i,e){const t=document.getElementsByTagName("head")[0];if(!t)throw new Error("loadScript");const n=document.createElement("script");return n.setAttribute("type","text/javascript"),n.setAttribute("src",i),new Promise((s,r)=>{n.onload=s,n.onerror=o=>r(new Error(`Unable to load script '${i}': ${o}`)),t.appendChild(n)})}const lD=1;let hi=null,J0=!1;const gy={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function cD(i){if(!globalThis.SPECTOR)try{await A2(i.debugSpectorJSUrl||gy.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function Dte(i){var e;if(i={...gy,...i},!i.debugSpectorJS)return null;if(!hi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(lD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;hi=new t,globalThis.luma&&(globalThis.luma.spector=hi)}if(!hi)return null;if(J0||(J0=!0,hi.spyCanvases(),hi==null||hi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),hi==null||hi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),hi==null||hi.getResultUI(),hi==null||hi.resultView.display(),hi==null||hi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;hi==null||hi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),hi==null||hi.stopCapture()})}return hi}const uD="https://unpkg.com/webgl-debug@2.0.1/index.js";function I2(i){return i.luma=i.luma||{},i.luma}async function dD(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await A2(uD))}function Mte(i,e={}){return e.debugWebGL||e.traceWebGL?fD(i,e):hD(i)}function hD(i){const e=I2(i);return e.realContext?e.realContext:i}function fD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=I2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Do,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,pD.bind(null,e),mD.bind(null,e));for(const o in Do)!(o in n)&&typeof Do[o]=="number"&&(n[o]=Do[o]);class s{}Object.setPrototypeOf(n,Object.getPrototypeOf(i)),Object.setPrototypeOf(s,n);const r=Object.create(s);return t.realContext=i,t.debugContext=r,r.debug=!0,r}function ex(i,e){e=Array.from(e).map(n=>n===void 0?"undefined":n);let t=globalThis.WebGLDebugUtils.glFunctionArgsToString(i,e);return t=`${t.slice(0,100)}${t.length>100?"...":""}`,`gl.${i}(${t})`}function pD(i,e,t,n){n=Array.from(n).map(a=>a===void 0?"undefined":a);const s=globalThis.WebGLDebugUtils.glEnumToString(e),r=globalThis.WebGLDebugUtils.glFunctionArgsToString(t,n),o=`${s} in gl.${t}(${r})`;le.error(o)();debugger}function mD(i,e,t){let n="";le.level>=1&&(n=ex(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||ex(e,t);debugger}}const wd=1;class gD extends TN{constructor(){super(),$(this,"type","webgl"),Eg.defaultProps={...Eg.defaultProps,...gy}}enforceWebGL2(e){oD(e)}isSupported(){return typeof WebGL2RenderingContext<"u"}isDeviceHandle(e){return typeof WebGL2RenderingContext<"u"&&e instanceof WebGL2RenderingContext?!0:(typeof WebGLRenderingContext<"u"&&e instanceof WebGLRenderingContext&&le.warn("WebGL1 is not supported",e)(),!1)}async attach(e,t={}){const{WebGLDevice:n}=await p0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-C8RX9Ou8.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!_D(e))throw new Error("Invalid WebGL2RenderingContext");const s=t.createCanvasContext===!0?{}:t.createCanvasContext;return new n({...t,_handle:e,createCanvasContext:{canvas:e.canvas,autoResize:!1,...s}})}async create(e={}){const{WebGLDevice:t}=await p0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-C8RX9Ou8.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]));le.groupCollapsed(wd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(dD()),e.debugSpectorJS&&n.push(cD(e));const s=await Promise.allSettled(n);for(const a of s)a.status==="rejected"&&le.error(`Failed to initialize debug libraries ${a.reason}`)();const r=new t(e),o=`${r._reused?"Reusing":"Created"} device with WebGL2 ${r.props.debug?"debug ":""}context: ${r.info.vendor}, ${r.info.renderer} for canvas: ${r.canvasContext.id}`;return le.probe(wd,o)(),le.table(wd,r.info)(),r}finally{le.groupEnd(wd)()}}}function _D(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const yD=new gD,bD="#b3b3b3",vD=void 0,kg=void 0,xD=1,wD=4,SD="#666666",ED=.1,CD=1,TD=1,L2="#222222",pe={enableSimulation:!0,spaceSize:8192,pointSizeScale:1,linkWidthScale:1,linkArrowsSizeScale:1,renderLinks:!0,curvedLinks:!1,curvedLinkSegments:19,curvedLinkWeight:.8,curvedLinkControlPointDistance:.5,linkArrows:!1,linkVisibilityDistanceRange:[50,150],linkVisibilityMinTransparency:.25,hoveredPointCursor:"auto",hoveredLinkCursor:"auto",renderHoveredPointRing:!1,hoveredPointRingColor:"white",hoveredLinkColor:void 0,hoveredLinkWidthIncrease:5,focusedPointRingColor:"white",focusedPointIndex:void 0,simulation:{decay:5e3,gravity:.25,center:0,repulsion:1,repulsionTheta:1.15,linkSpring:1,linkDistance:10,linkDistRandomVariationRange:[1,1.2],repulsionFromMouse:2,friction:.85,cluster:.1},showFPSMonitor:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||2,scalePointsOnZoom:!1,scaleLinksOnZoom:!1,enableZoom:!0,enableSimulationDuringZoom:!1,enableDrag:!1,fitViewOnInit:!0,fitViewDelay:250,fitViewPadding:.1,fitViewDuration:250,pointSamplingDistance:150,attribution:"",rescalePositions:void 0,enableRightClickRepulsion:!1},kD=.7,AD=.95,ID=3;/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:R2,setPrototypeOf:tx,isFrozen:LD,getPrototypeOf:RD,getOwnPropertyDescriptor:PD}=Object;let{freeze:hn,seal:_s,create:P2}=Object,{apply:Ag,construct:Ig}=typeof Reflect<"u"&&Reflect;hn||(hn=function(i){return i});_s||(_s=function(i){return i});Ag||(Ag=function(i,e,t){return i.apply(e,t)});Ig||(Ig=function(i,e){return new i(...e)});const Sd=fn(Array.prototype.forEach),ND=fn(Array.prototype.lastIndexOf),ix=fn(Array.prototype.pop),lc=fn(Array.prototype.push),DD=fn(Array.prototype.splice),hh=fn(String.prototype.toLowerCase),im=fn(String.prototype.toString),nx=fn(String.prototype.match),cc=fn(String.prototype.replace),MD=fn(String.prototype.indexOf),OD=fn(String.prototype.trim),Ms=fn(Object.prototype.hasOwnProperty),sn=fn(RegExp.prototype.test),uc=BD(TypeError);function fn(i){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:hh;tx&&tx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(LD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function FD(i){for(let e=0;e/gm),HD=_s(/\$\{[\w\W]*/gm),VD=_s(/^data-[\-\w.\u00B7-\uFFFF]+$/),GD=_s(/^aria-[\-\w]+$/),N2=_s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WD=_s(/^(?:\w+script|data):/i),YD=_s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),D2=_s(/^html$/i),qD=_s(/^[a-z][.\w]*(-[.\w]+)+$/i);var lx=Object.freeze({__proto__:null,ARIA_ATTR:GD,ATTR_WHITESPACE:YD,CUSTOM_ELEMENT:qD,DATA_ATTR:VD,DOCTYPE_NAME:D2,ERB_EXPR:jD,IS_ALLOWED_URI:N2,IS_SCRIPT_OR_DATA:WD,MUSTACHE_EXPR:$D,TMPLIT_EXPR:HD});const hc={element:1,text:3,progressingInstruction:7,comment:8,document:9},XD=function(){return typeof window>"u"?null:window},KD=function(i,e){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let t=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(t=e.getAttribute(n));const s="dompurify"+(t?"#"+t:"");try{return i.createPolicy(s,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},cx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function M2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:XD();const e=L=>M2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==hc.document||!i.Element)return e.isSupported=!1,e;let{document:t}=i;const n=t,s=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:o,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:d,DOMParser:h,trustedTypes:p}=i,m=l.prototype,y=dc(m,"cloneNode"),g=dc(m,"remove"),_=dc(m,"nextSibling"),S=dc(m,"childNodes"),C=dc(m,"parentNode");if(typeof o=="function"){const L=t.createElement("template");L.content&&L.content.ownerDocument&&(t=L.content.ownerDocument)}let x,A="";const{implementation:I,createNodeIterator:O,createDocumentFragment:H,getElementsByTagName:Z}=t,{importNode:te}=n;let M=cx();e.isSupported=typeof R2=="function"&&typeof C=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:he,ERB_EXPR:se,TMPLIT_EXPR:R,DATA_ATTR:J,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:ie,CUSTOM_ELEMENT:ee}=lx;let{IS_ALLOWED_URI:ae}=lx,Q=null;const Se=ot({},[...sx,...nm,...sm,...rm,...rx]);let xe=null;const Je=ot({},[...ox,...om,...ax,...Ed]);let de=Object.seal(P2(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),bt=null,Xe=null,ht=!0,re=!0,Te=!1,Pe=!0,q=!1,We=!0,He=!1,it=!1,Vt=!1,me=!1,nt=!1,ui=!1,_i=!0,Zn=!1;const Qo="user-content-";let Zs=!0,Li=!1,en={},Ri=null;const ai=ot({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let vo=null;const Es=ot({},["audio","video","img","source","image","track"]);let Qn=null;const Jn=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Cs="http://www.w3.org/1998/Math/MathML",zi="http://www.w3.org/2000/svg",Ei="http://www.w3.org/1999/xhtml";let ii=Ei,bn=!1,vn=null;const Ts=ot({},[Cs,zi,Ei],im);let On=ot({},["mi","mo","mn","ms","mtext"]),es=ot({},["annotation-xml"]);const Dr=ot({},["title","style","font","a","script"]);let xn=null;const Qs=["application/xhtml+xml","text/html"],Jo="text/html";let Zt=null,Ot=null;const ks=t.createElement("form"),xo=function(L){return L instanceof RegExp||L instanceof Function},Js=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ot&&Ot===L)){if((!L||typeof L!="object")&&(L={}),L=Hr(L),xn=Qs.indexOf(L.PARSER_MEDIA_TYPE)===-1?Jo:L.PARSER_MEDIA_TYPE,Zt=xn==="application/xhtml+xml"?im:hh,Q=Ms(L,"ALLOWED_TAGS")?ot({},L.ALLOWED_TAGS,Zt):Se,xe=Ms(L,"ALLOWED_ATTR")?ot({},L.ALLOWED_ATTR,Zt):Je,vn=Ms(L,"ALLOWED_NAMESPACES")?ot({},L.ALLOWED_NAMESPACES,im):Ts,Qn=Ms(L,"ADD_URI_SAFE_ATTR")?ot(Hr(Jn),L.ADD_URI_SAFE_ATTR,Zt):Jn,vo=Ms(L,"ADD_DATA_URI_TAGS")?ot(Hr(Es),L.ADD_DATA_URI_TAGS,Zt):Es,Ri=Ms(L,"FORBID_CONTENTS")?ot({},L.FORBID_CONTENTS,Zt):ai,bt=Ms(L,"FORBID_TAGS")?ot({},L.FORBID_TAGS,Zt):Hr({}),Xe=Ms(L,"FORBID_ATTR")?ot({},L.FORBID_ATTR,Zt):Hr({}),en=Ms(L,"USE_PROFILES")?L.USE_PROFILES:!1,ht=L.ALLOW_ARIA_ATTR!==!1,re=L.ALLOW_DATA_ATTR!==!1,Te=L.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=L.SAFE_FOR_TEMPLATES||!1,We=L.SAFE_FOR_XML!==!1,He=L.WHOLE_DOCUMENT||!1,me=L.RETURN_DOM||!1,nt=L.RETURN_DOM_FRAGMENT||!1,ui=L.RETURN_TRUSTED_TYPE||!1,Vt=L.FORCE_BODY||!1,_i=L.SANITIZE_DOM!==!1,Zn=L.SANITIZE_NAMED_PROPS||!1,Zs=L.KEEP_CONTENT!==!1,Li=L.IN_PLACE||!1,ae=L.ALLOWED_URI_REGEXP||N2,ii=L.NAMESPACE||Ei,On=L.MATHML_TEXT_INTEGRATION_POINTS||On,es=L.HTML_INTEGRATION_POINTS||es,de=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&xo(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(de.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&xo(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(de.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(re=!1),nt&&(me=!0),en&&(Q=ot({},rx),xe=[],en.html===!0&&(ot(Q,sx),ot(xe,ox)),en.svg===!0&&(ot(Q,nm),ot(xe,om),ot(xe,Ed)),en.svgFilters===!0&&(ot(Q,sm),ot(xe,om),ot(xe,Ed)),en.mathMl===!0&&(ot(Q,rm),ot(xe,ax),ot(xe,Ed))),L.ADD_TAGS&&(Q===Se&&(Q=Hr(Q)),ot(Q,L.ADD_TAGS,Zt)),L.ADD_ATTR&&(xe===Je&&(xe=Hr(xe)),ot(xe,L.ADD_ATTR,Zt)),L.ADD_URI_SAFE_ATTR&&ot(Qn,L.ADD_URI_SAFE_ATTR,Zt),L.FORBID_CONTENTS&&(Ri===ai&&(Ri=Hr(Ri)),ot(Ri,L.FORBID_CONTENTS,Zt)),Zs&&(Q["#text"]=!0),He&&ot(Q,["html","head","body"]),Q.table&&(ot(Q,["tbody"]),delete bt.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw uc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,A=x.createHTML("")}else x===void 0&&(x=KD(p,s)),x!==null&&typeof A=="string"&&(A=x.createHTML(""));hn&&hn(L),Ot=L}},Rt=ot({},[...nm,...sm,...zD]),Mr=ot({},[...rm,...UD]),ea=function(L){let V=C(L);(!V||!V.tagName)&&(V={namespaceURI:ii,tagName:"template"});const E=hh(L.tagName),G=hh(V.tagName);return vn[L.namespaceURI]?L.namespaceURI===zi?V.namespaceURI===Ei?E==="svg":V.namespaceURI===Cs?E==="svg"&&(G==="annotation-xml"||On[G]):!!Rt[E]:L.namespaceURI===Cs?V.namespaceURI===Ei?E==="math":V.namespaceURI===zi?E==="math"&&es[G]:!!Mr[E]:L.namespaceURI===Ei?V.namespaceURI===zi&&!es[G]||V.namespaceURI===Cs&&!On[G]?!1:!Mr[E]&&(Dr[E]||!Rt[E]):!!(xn==="application/xhtml+xml"&&vn[L.namespaceURI]):!1},ts=function(L){lc(e.removed,{element:L});try{C(L).removeChild(L)}catch{g(L)}},di=function(L,V){try{lc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{lc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(L),L==="is")if(me||nt)try{ts(V)}catch{}else try{V.setAttribute(L,"")}catch{}},Bn=function(L){let V=null,E=null;if(Vt)L=""+L;else{const Ce=nx(L,/^[\r\n\t ]+/);E=Ce&&Ce[0]}xn==="application/xhtml+xml"&&ii===Ei&&(L=''+L+"");const G=x?x.createHTML(L):L;if(ii===Ei)try{V=new h().parseFromString(G,xn)}catch{}if(!V||!V.documentElement){V=I.createDocument(ii,"template",null);try{V.documentElement.innerHTML=bn?A:G}catch{}}const ne=V.body||V.documentElement;return L&&E&&ne.insertBefore(t.createTextNode(E),ne.childNodes[0]||null),ii===Ei?Z.call(V,He?"html":"body")[0]:He?V.documentElement:ne},wo=function(L){return O.call(L.ownerDocument||L,L,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ut=function(L){return L instanceof d&&(typeof L.nodeName!="string"||typeof L.textContent!="string"||typeof L.removeChild!="function"||!(L.attributes instanceof u)||typeof L.removeAttribute!="function"||typeof L.setAttribute!="function"||typeof L.namespaceURI!="string"||typeof L.insertBefore!="function"||typeof L.hasChildNodes!="function")},Or=function(L){return typeof a=="function"&&L instanceof a};function st(L,V,E){Sd(L,G=>{G.call(e,V,E,Ot)})}const wn=function(L){let V=null;if(st(M.beforeSanitizeElements,L,null),ut(L))return ts(L),!0;const E=Zt(L.nodeName);if(st(M.uponSanitizeElement,L,{tagName:E,allowedTags:Q}),We&&L.hasChildNodes()&&!Or(L.firstElementChild)&&sn(/<[/\w!]/g,L.innerHTML)&&sn(/<[/\w!]/g,L.textContent)||L.nodeType===hc.progressingInstruction||We&&L.nodeType===hc.comment&&sn(/<[/\w]/g,L.data))return ts(L),!0;if(!Q[E]||bt[E]){if(!bt[E]&&er(E)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E)))return!1;if(Zs&&!Ri[E]){const G=C(L)||L.parentNode,ne=S(L)||L.childNodes;if(ne&&G){const Ce=ne.length;for(let At=Ce-1;At>=0;--At){const rt=y(ne[At],!0);rt.__removalCount=(L.__removalCount||0)+1,G.insertBefore(rt,_(L))}}}return ts(L),!0}return L instanceof l&&!ea(L)||(E==="noscript"||E==="noembed"||E==="noframes")&&sn(/<\/no(script|embed|frames)/i,L.innerHTML)?(ts(L),!0):(q&&L.nodeType===hc.text&&(V=L.textContent,Sd([he,se,R],G=>{V=cc(V,G," ")}),L.textContent!==V&&(lc(e.removed,{element:L.cloneNode()}),L.textContent=V)),st(M.afterSanitizeElements,L,null),!1)},Br=function(L,V,E){if(_i&&(V==="id"||V==="name")&&(E in t||E in ks))return!1;if(!(re&&!Xe[V]&&sn(J,V))&&!(ht&&sn(F,V))){if(!xe[V]||Xe[V]){if(!(er(L)&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,L)||de.tagNameCheck instanceof Function&&de.tagNameCheck(L))&&(de.attributeNameCheck instanceof RegExp&&sn(de.attributeNameCheck,V)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(V))||V==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&sn(de.tagNameCheck,E)||de.tagNameCheck instanceof Function&&de.tagNameCheck(E))))return!1}else if(!Qn[V]&&!sn(ae,cc(E,ie,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&MD(E,"data:")===0&&vo[L])&&!(Te&&!sn(X,cc(E,ie,"")))&&E)return!1}return!0},er=function(L){return L!=="annotation-xml"&&nx(L,ee)},Fn=function(L){st(M.beforeSanitizeAttributes,L,null);const{attributes:V}=L;if(!V||ut(L))return;const E={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const ne=V[G],{name:Ce,namespaceURI:At,value:rt}=ne,et=Zt(Ce),yi=rt;let ft=Ce==="value"?yi:OD(yi);if(E.attrName=et,E.attrValue=ft,E.keepAttr=!0,E.forceKeepAttr=void 0,st(M.uponSanitizeAttribute,L,E),ft=E.attrValue,Zn&&(et==="id"||et==="name")&&(di(Ce,L),ft=Qo+ft),We&&sn(/((--!?|])>)|<\/(style|title)/i,ft)){di(Ce,L);continue}if(E.forceKeepAttr)continue;if(!E.keepAttr){di(Ce,L);continue}if(!Pe&&sn(/\/>/i,ft)){di(Ce,L);continue}q&&Sd([he,se,R],Bt=>{ft=cc(ft,Bt," ")});const tr=Zt(L.nodeName);if(!Br(tr,et,ft)){di(Ce,L);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!At)switch(p.getAttributeType(tr,et)){case"TrustedHTML":{ft=x.createHTML(ft);break}case"TrustedScriptURL":{ft=x.createScriptURL(ft);break}}if(ft!==yi)try{At?L.setAttributeNS(At,Ce,ft):L.setAttribute(Ce,ft),ut(L)?ts(L):ix(e.removed)}catch{di(Ce,L)}}st(M.afterSanitizeAttributes,L,null)},tn=function L(V){let E=null;const G=wo(V);for(st(M.beforeSanitizeShadowDOM,V,null);E=G.nextNode();)st(M.uponSanitizeShadowNode,E,null),wn(E),Fn(E),E.content instanceof r&&L(E.content);st(M.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(L){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},E=null,G=null,ne=null,Ce=null;if(bn=!L,bn&&(L=""),typeof L!="string"&&!Or(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw uc("dirty is not a string, aborting")}else throw uc("toString is not a function");if(!e.isSupported)return L;if(it||Js(V),e.removed=[],typeof L=="string"&&(Li=!1),Li){if(L.nodeName){const et=Zt(L.nodeName);if(!Q[et]||bt[et])throw uc("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)E=Bn(""),G=E.ownerDocument.importNode(L,!0),G.nodeType===hc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?E=G:E.appendChild(G);else{if(!me&&!q&&!He&&L.indexOf("<")===-1)return x&&ui?x.createHTML(L):L;if(E=Bn(L),!E)return me?null:ui?A:""}E&&Vt&&ts(E.firstChild);const At=wo(Li?L:E);for(;ne=At.nextNode();)wn(ne),Fn(ne),ne.content instanceof r&&tn(ne.content);if(Li)return L;if(me){if(nt)for(Ce=H.call(E.ownerDocument);E.firstChild;)Ce.appendChild(E.firstChild);else Ce=E;return(xe.shadowroot||xe.shadowrootmode)&&(Ce=te.call(n,Ce,!0)),Ce}let rt=He?E.outerHTML:E.innerHTML;return He&&Q["!doctype"]&&E.ownerDocument&&E.ownerDocument.doctype&&E.ownerDocument.doctype.name&&sn(D2,E.ownerDocument.doctype.name)&&(rt=" `+rt),q&&Sd([he,se,R],et=>{rt=cc(rt,et," ")}),x&&ui?x.createHTML(rt):rt},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Js(L),it=!0},e.clearConfig=function(){Ot=null,it=!1},e.isValidAttribute=function(L,V,E){Ot||Js({});const G=Zt(L),ne=Zt(V);return Br(G,ne,E)},e.addHook=function(L,V){typeof V=="function"&&lc(M[L],V)},e.removeHook=function(L,V){if(V!==void 0){const E=ND(M[L],V);return E===-1?void 0:DD(M[L],E,1)[0]}return ix(M[L])},e.removeHooks=function(L){M[L]=[]},e.removeAllHooks=function(){M=cx()},e}var ZD=M2();const QD=i=>typeof i=="function",O2=i=>Array.isArray(i),JD=i=>i instanceof Object,eM=i=>i instanceof Object?i.constructor.name!=="Function"&&i.constructor.name!=="Object":!1,ux=i=>JD(i)&&!O2(i)&&!QD(i)&&!eM(i);function Mo(i){let e;if(O2(i))e=i;else{const t=Uo(i),n=t==null?void 0:t.rgb();e=[(n==null?void 0:n.r)||0,(n==null?void 0:n.g)||0,(n==null?void 0:n.b)||0,(t==null?void 0:t.opacity)??1]}return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function tM(i,e,t){return .2126*i+.7152*e+.0722*t}function jn(i,e,t=0,n=0,s,r){return i.readPixelsToArrayWebGL(e,{sourceX:t,sourceY:n,sourceWidth:s,sourceHeight:r})}function iM(i,e,t){return Math.min(Math.max(i,e),t)}function rs(i){return i!=null&&!Number.isNaN(i)}function nM(i,e){return ZD.sanitize(i,{ALLOWED_TAGS:["a","b","i","em","strong","span","div","p","br"],ALLOWED_ATTR:["href","target","class","id","style"],ALLOW_DATA_ATTR:!1,...e})}class sM{constructor(){this.enableSimulation=pe.enableSimulation,this.backgroundColor=L2,this.spaceSize=pe.spaceSize,this.pointColor=bD,this.pointDefaultColor=void 0,this.pointGreyoutOpacity=vD,this.pointGreyoutColor=kg,this.pointSize=wD,this.pointDefaultSize=void 0,this.pointOpacity=xD,this.pointSizeScale=pe.pointSizeScale,this.hoveredPointCursor=pe.hoveredPointCursor,this.hoveredLinkCursor=pe.hoveredLinkCursor,this.renderHoveredPointRing=pe.renderHoveredPointRing,this.hoveredPointRingColor=pe.hoveredPointRingColor,this.focusedPointRingColor=pe.focusedPointRingColor,this.focusedPointIndex=pe.focusedPointIndex,this.linkColor=SD,this.linkDefaultColor=void 0,this.linkOpacity=CD,this.linkGreyoutOpacity=ED,this.linkWidth=TD,this.linkDefaultWidth=void 0,this.linkWidthScale=pe.linkWidthScale,this.hoveredLinkColor=pe.hoveredLinkColor,this.hoveredLinkWidthIncrease=pe.hoveredLinkWidthIncrease,this.renderLinks=pe.renderLinks,this.curvedLinks=pe.curvedLinks,this.curvedLinkSegments=pe.curvedLinkSegments,this.curvedLinkWeight=pe.curvedLinkWeight,this.curvedLinkControlPointDistance=pe.curvedLinkControlPointDistance,this.linkArrows=pe.linkArrows,this.linkDefaultArrows=void 0,this.linkArrowsSizeScale=pe.linkArrowsSizeScale,this.scaleLinksOnZoom=pe.scaleLinksOnZoom,this.linkVisibilityDistanceRange=pe.linkVisibilityDistanceRange,this.linkVisibilityMinTransparency=pe.linkVisibilityMinTransparency,this.simulationDecay=pe.simulation.decay,this.simulationGravity=pe.simulation.gravity,this.simulationCenter=pe.simulation.center,this.simulationRepulsion=pe.simulation.repulsion,this.simulationRepulsionTheta=pe.simulation.repulsionTheta,this.simulationLinkSpring=pe.simulation.linkSpring,this.simulationLinkDistance=pe.simulation.linkDistance,this.simulationLinkDistRandomVariationRange=pe.simulation.linkDistRandomVariationRange,this.simulationRepulsionFromMouse=pe.simulation.repulsionFromMouse,this.enableRightClickRepulsion=pe.enableRightClickRepulsion,this.simulationFriction=pe.simulation.friction,this.simulationCluster=pe.simulation.cluster,this.onSimulationStart=void 0,this.onSimulationTick=void 0,this.onSimulationEnd=void 0,this.onSimulationPause=void 0,this.onSimulationRestart=void 0,this.onSimulationUnpause=void 0,this.onClick=void 0,this.onPointClick=void 0,this.onLinkClick=void 0,this.onBackgroundClick=void 0,this.onMouseMove=void 0,this.onPointMouseOver=void 0,this.onPointMouseOut=void 0,this.onLinkMouseOver=void 0,this.onLinkMouseOut=void 0,this.onZoomStart=void 0,this.onZoom=void 0,this.onZoomEnd=void 0,this.onDragStart=void 0,this.onDrag=void 0,this.onDragEnd=void 0,this.showFPSMonitor=pe.showFPSMonitor,this.pixelRatio=pe.pixelRatio,this.scalePointsOnZoom=pe.scalePointsOnZoom,this.initialZoomLevel=void 0,this.enableZoom=pe.enableZoom,this.enableSimulationDuringZoom=pe.enableSimulationDuringZoom,this.enableDrag=pe.enableDrag,this.fitViewOnInit=pe.fitViewOnInit,this.fitViewDelay=pe.fitViewDelay,this.fitViewPadding=pe.fitViewPadding,this.fitViewDuration=pe.fitViewDuration,this.fitViewByPointsInRect=void 0,this.fitViewByPointIndices=void 0,this.randomSeed=void 0,this.pointSamplingDistance=pe.pointSamplingDistance,this.attribution=pe.attribution,this.rescalePositions=pe.rescalePositions}init(e){Object.keys(e).forEach(t=>{this.deepMergeConfig(this.getConfig(),e,t)})}deepMergeConfig(e,t,n){ux(e[n])&&ux(t[n])?Object.keys(t[n]).forEach(s=>{this.deepMergeConfig(e[n],t[n],s)}):e[n]=t[n]}getConfig(){return this}}function _y(i,e){if(!i)throw new Error(e||"shadertools: assertion failed.")}const am={number:{type:"number",validate(i,e){return Number.isFinite(i)&&typeof e=="object"&&(e.max===void 0||i<=e.max)&&(e.min===void 0||i>=e.min)}},array:{type:"array",validate(i,e){return Array.isArray(i)||ArrayBuffer.isView(i)}}};function rM(i){const e={};for(const[t,n]of Object.entries(i))e[t]=oM(n);return e}function oM(i){let e=dx(i);if(e!=="object")return{value:i,...am[e],type:e};if(typeof i=="object")return i?i.type!==void 0?{...i,...am[i.type],type:i.type}:i.value===void 0?{type:"object",value:i}:(e=dx(i.value),{...i,...am[e],type:e}):{type:"object",value:null};throw new Error("props")}function dx(i){return Array.isArray(i)||ArrayBuffer.isView(i)?"array":typeof i}const aM=`#ifdef MODULE_LOGDEPTH logdepth_adjustPosition(gl_Position); #endif diff --git a/frontend/dist/assets/Mqtt-BaDp61mH.js b/frontend/dist/assets/Mqtt-DrmwIl2T.js similarity index 98% rename from frontend/dist/assets/Mqtt-BaDp61mH.js rename to frontend/dist/assets/Mqtt-DrmwIl2T.js index 19bbe66b..7331b7c6 100644 --- a/frontend/dist/assets/Mqtt-BaDp61mH.js +++ b/frontend/dist/assets/Mqtt-DrmwIl2T.js @@ -1,4 +1,4 @@ -import{d as re,eM as f,eN as Me,r as c,j as e,I as W,B as ne,c as C,en as Pe,eo as ke,ao as pe,ep as Re,T as Ne,x as H,D as ae,bo as Ae,eO as xe,cT as fe,eP as be,eQ as Be,R as ie,N as Ue,ci as Te}from"./index-CvSa8h-C.js";import{C as ee,P as De,a as Oe,B as Ge}from"./PageLayout-B8orsDlo.js";import{L as Ee,a as de}from"./listbox-Xbs80tag.js";import{S as Ie}from"./settings-2-CLi8XLBD.js";import{P as se}from"./plus-CNNHSjgp.js";import{M as He}from"./map-pin-BCwmmHGs.js";import{C as Ke,u as Fe,a as ze}from"./circle-x-BDVzq0qX.js";import{Z as Q}from"./zap-mngIm3qT.js";import{S as je}from"./search-BZtD4Hr8.js";import{C as oe}from"./chevron-right-1kmv-Vqa.js";import{H as Ve}from"./hash-CTme6GHI.js";import{F as We}from"./funnel-DLa9oQpD.js";import{a as $e,C as Ze}from"./circle-stop-B5RN0x4p.js";import{T as Ye}from"./trash-2-DUG72tk9.js";import{M as Je}from"./message-square-DODYXl2V.js";import{C as Xe}from"./cpu-DRQNCIcF.js";import{R as me,C as he}from"./Grid-suKoG48i.js";import{W as _e}from"./wifi-DV8DJqF0.js";import{W as qe}from"./wifi-off-B6--LVD1.js";import{T as Qe}from"./triangle-alert-C7tm61-l.js";import"./element-movement-CM_Y2Bj0.js";/** +import{d as re,eM as f,eN as Me,r as c,j as e,I as W,B as ne,c as C,en as Pe,eo as ke,ao as pe,ep as Re,T as Ne,x as H,D as ae,bo as Ae,eO as xe,cT as fe,eP as be,eQ as Be,R as ie,N as Ue,ci as Te}from"./index-WhzslczH.js";import{C as ee,P as De,a as Oe,B as Ge}from"./PageLayout-CjepFyhn.js";import{L as Ee,a as de}from"./listbox-B9_kY-R5.js";import{S as Ie}from"./settings-2-DdLL0vPm.js";import{P as se}from"./plus-Q9JrSYS-.js";import{M as He}from"./map-pin-BXCqDxIA.js";import{C as Ke,u as Fe,a as ze}from"./circle-x-DAvnTI4S.js";import{Z as Q}from"./zap-Ec1PEQMI.js";import{S as je}from"./search-DttoJEPu.js";import{C as oe}from"./chevron-right-Ewog5LA3.js";import{H as Ve}from"./hash-Bwa-X17j.js";import{F as We}from"./funnel-B4y6lzBW.js";import{a as $e,C as Ze}from"./circle-stop-e_aFfaa6.js";import{T as Ye}from"./trash-2-dqn51YO_.js";import{M as Je}from"./message-square-D2zm03U4.js";import{C as Xe}from"./cpu-CGipD77S.js";import{R as me,C as he}from"./Grid-xhoz0JJL.js";import{W as _e}from"./wifi-B-dNXYIH.js";import{W as qe}from"./wifi-off-DjfOg4sJ.js";import{T as Qe}from"./triangle-alert-BsvKjxO1.js";import"./element-movement-CSsBUmDY.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MqttModeBadge-CGW6hCWV.js b/frontend/dist/assets/MqttModeBadge-xEEk549C.js similarity index 98% rename from frontend/dist/assets/MqttModeBadge-CGW6hCWV.js rename to frontend/dist/assets/MqttModeBadge-xEEk549C.js index 37ba90d0..fa0a7cd5 100644 --- a/frontend/dist/assets/MqttModeBadge-CGW6hCWV.js +++ b/frontend/dist/assets/MqttModeBadge-xEEk549C.js @@ -1,4 +1,4 @@ -import{aA as Le,aX as ve,az as Ke,cx as Pe,aC as Qe,aB as Z,r as l,aF as qe,aG as ee,aK as z,aJ as J,au as k,aN as Q,cy as se,cz as _e,aS as He,aT as Ve,aY as We,aU as re,aZ as Ye,aV as me,cA as Fe,cB as q,cC as A,cD as he,cE as G,cF as ge,aW as le,b6 as C,cG as ye,cH as xe,a_ as we,ay as Xe,a$ as Te,b0 as Oe,b2 as Ze,b3 as ze,b5 as Ee,cI as Je,cJ as je,b7 as Ue,cK as et,cL as tt,b8 as Ie,cM as nt,cN as at,cO as ot,av as st,be as rt,b1 as U,cP as Ne,bg as lt,bi as ie,cQ as ut,cR as ct,cS as it,d as dt,j as P,c as M,A as pt,m as ft,cw as bt,cT as vt,u as mt,x as ht,R as ke}from"./index-CvSa8h-C.js";import{C as yt}from"./chevron-right-1kmv-Vqa.js";import{F as xt,y as Pt,R as gt,T as $t,w as St,A as Ct}from"./map-pin-BCwmmHGs.js";var wt=Object.defineProperty,It=(e,n,t)=>n in e?wt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Be=(e,n,t)=>(It(e,typeof n!="symbol"?n+"":n,t),t),g=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(g||{}),kt=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(kt||{});let Bt={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,n){return e.button===n.button?e:{...e,button:n.button}},3(e,n){return e.buttonId===n.buttonId?e:{...e,buttonId:n.buttonId}},4(e,n){return e.panel===n.panel?e:{...e,panel:n.panel}},5(e,n){return e.panelId===n.panelId?e:{...e,panelId:n.panelId}}};class $e extends Le{constructor(n){super(n),Be(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let f=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;f==null||f.focus()},open:()=>this.send({type:0}),setButtonId:t=>this.send({type:3,buttonId:t}),setButton:t=>this.send({type:2,button:t}),setPanelId:t=>this.send({type:5,panelId:t}),setPanel:t=>this.send({type:4,panel:t})}),Be(this,"selectors",{isPortalled:t=>{var f;if(!t.button||!t.panel)return!1;let m=(f=Ke(t.button))!=null?f:document;for(let $ of m.querySelectorAll("body > *"))if(Number($==null?void 0:$.contains(t.button))^Number($==null?void 0:$.contains(t.panel)))return!0;let c=Pe(m),r=c.indexOf(t.button),a=(r+c.length-1)%c.length,S=(r+1)%c.length,y=c[a],s=c[S];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,f=Qe.get(null);this.on(0,()=>f.actions.push(t)),this.on(1,()=>f.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new $e({id:n,__demoMode:t,popoverState:t?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(n,t){return Z(t.type,Bt,n,t)}}const Me=l.createContext(null);function de(e){let n=l.useContext(Me);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function _t({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>$e.new({id:e,__demoMode:n}),[]);return qe(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function Re(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function Ft(){return l.useContext(pe)}let Tt="div";function Ot(e,n){var t;let f=l.useId(),{__demoMode:m=!1,...c}=e,r=_t({id:f,__demoMode:m}),a=l.useRef(null),S=J(n,et(u=>{a.current=u})),[y,s,$,w,B]=z(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),I=tt((t=a.current)!=null?t:s),b=Ie(w),p=Ie(B),v=l.useMemo(()=>({buttonId:b,panelId:p,close:r.actions.close}),[b,p,r]),x=Re(),i=x==null?void 0:x.registerPopover,_=k(()=>{var u,F;let O=se((u=a.current)!=null?u:s);return(F=x==null?void 0:x.isFocusWithinPopoverGroup())!=null?F:O&&((s==null?void 0:s.contains(O))||($==null?void 0:$.contains(O)))});l.useEffect(()=>i==null?void 0:i(v),[i,v]);let[te,ne]=nt(),L=at(s),R=ot({mainTreeNode:L,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});st(I,"focus",u=>{var F,O,j,Y,N,X;u.target!==window&&ut(u.target)&&r.state.popoverState===g.Open&&(_()||r.state.button&&r.state.panel&&(R.contains(u.target)||(O=(F=r.state.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&O.call(F,u.target)||(Y=(j=r.state.afterPanelSentinel.current)==null?void 0:j.contains)!=null&&Y.call(j,u.target)||(X=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&X.call(N,u.target)||r.actions.close()))},!0);let H=y===g.Open;rt(H,R.resolveContainers,(u,F)=>{r.actions.close(),ct(F,it.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===g.Open,close:r.actions.refocusableClose}),oe=z(r,l.useCallback(u=>Z(u.popoverState,{[g.Open]:U.Open,[g.Closed]:U.Closed}),[])),V={ref:S},W=le();return C.createElement(Ne,{node:L},C.createElement(Ct,null,C.createElement(pe.Provider,{value:null},C.createElement(Me.Provider,{value:r},C.createElement(je,{value:r.actions.refocusableClose},C.createElement(lt,{value:oe},C.createElement(ne,null,W({ourProps:V,theirProps:c,slot:ae,defaultTag:Tt,name:"Popover"}))))))))}let Et="button";function jt(e,n){let t=l.useId(),{id:f=`headlessui-popover-button-${t}`,disabled:m=!1,autoFocus:c=!1,...r}=e,a=de("Popover.Button"),[S,y,s,$,w,B,I]=z(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),b=l.useRef(null),p=`headlessui-focus-sentinel-${l.useId()}`,v=Re(),x=v==null?void 0:v.closeOthers,i=Ft()!==null;l.useEffect(()=>{if(!i)return a.actions.setButtonId(f),()=>a.actions.setButtonId(null)},[i,f,a]);let[_]=l.useState(()=>Symbol()),te=J(b,n,xt(),k(o=>{if(!i){if(o)a.state.buttons.current.push(_);else{let d=a.state.buttons.current.indexOf(_);d!==-1&&a.state.buttons.current.splice(d,1)}a.state.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),o&&a.actions.setButton(o)}})),ne=J(b,n),L=k(o=>{var d,T,E;if(i){if(a.state.popoverState===g.Closed)return;switch(o.key){case Q.Space:case Q.Enter:o.preventDefault(),(T=(d=o.target).click)==null||T.call(d),a.actions.close(),(E=a.state.button)==null||E.focus();break}}else switch(o.key){case Q.Space:case Q.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close();break;case Q.Escape:if(a.state.popoverState!==g.Open)return x==null?void 0:x(a.state.buttonId);if(!b.current)return;let D=se(b.current);if(D&&!b.current.contains(D))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),R=k(o=>{i||o.key===Q.Space&&o.preventDefault()}),H=k(o=>{var d,T;_e(o.currentTarget)||m||(i?(a.actions.close(),(d=a.state.button)==null||d.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close(),(T=a.state.button)==null||T.focus()))}),ae=k(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:V}=He({autoFocus:c}),{isHovered:W,hoverProps:u}=Ve({isDisabled:m}),{pressed:F,pressProps:O}=We({disabled:m}),j=S===g.Open,Y=re({open:j,active:F||j,disabled:m,hover:W,focus:oe,autofocus:c}),N=Ye(e,s),X=i?me({ref:ne,type:N,onKeyDown:L,onClick:H,disabled:m||void 0,autoFocus:c},V,u,O):me({ref:te,id:$,type:N,"aria-expanded":S===g.Open,"aria-controls":w?B:void 0,disabled:m||void 0,autoFocus:c,onKeyDown:L,onKeyUp:R,onClick:H,onMouseDown:ae},V,u,O),ue=Fe(),fe=k(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function d(){Z(ue.current,{[A.Forwards]:()=>q(o,G.First),[A.Backwards]:()=>q(o,G.Last)})===he.Error&&q(Pe(ge(a.state.button)).filter(T=>T.dataset.headlessuiFocusGuard!=="true"),Z(ue.current,{[A.Forwards]:G.Next,[A.Backwards]:G.Previous}),{relativeTo:a.state.button})}d()}),h=le();return C.createElement(C.Fragment,null,h({ourProps:X,theirProps:r,slot:Y,defaultTag:Et,name:"Popover.Button"}),j&&!i&&y&&C.createElement(ye,{id:p,ref:I,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Nt="div",Mt=ie.RenderStrategy|ie.Static;function De(e,n){let t=l.useId(),{id:f=`headlessui-popover-backdrop-${t}`,transition:m=!1,...c}=e,r=de("Popover.Backdrop"),a=z(r,l.useCallback(v=>v.popoverState,[])),[S,y]=l.useState(null),s=J(n,y),$=Te(),[w,B]=Oe(m,S,$!==null?($&U.Open)===U.Open:a===g.Open),I=k(v=>{if(_e(v.currentTarget))return v.preventDefault();r.actions.close()}),b=re({open:a===g.Open}),p={ref:s,id:f,"aria-hidden":!0,onClick:I,...Ee(B)};return le()({ourProps:p,theirProps:c,slot:b,defaultTag:Nt,features:Mt,visible:w,name:"Popover.Backdrop"})}let Rt="div",Dt=ie.RenderStrategy|ie.Static;function At(e,n){let t=l.useId(),{id:f=`headlessui-popover-panel-${t}`,focus:m=!1,anchor:c,portal:r=!1,modal:a=!1,transition:S=!1,...y}=e,s=de("Popover.Panel"),$=z(s,s.selectors.isPortalled),[w,B,I,b,p]=z(s,l.useCallback(h=>[h.popoverState,h.button,h.__demoMode,h.beforePanelSentinel,h.afterPanelSentinel],[])),v=`headlessui-focus-sentinel-before-${t}`,x=`headlessui-focus-sentinel-after-${t}`,i=l.useRef(null),_=Pt(c),[te,ne]=gt(_),L=$t();_&&(r=!0);let[R,H]=l.useState(null),ae=J(i,n,_?te:null,s.actions.setPanel,H),oe=we(B),V=we(i.current);Xe(()=>(s.actions.setPanelId(f),()=>s.actions.setPanelId(null)),[f,s]);let W=Te(),[u,F]=Oe(S,R,W!==null?(W&U.Open)===U.Open:w===g.Open);Ze(u,B,s.actions.close),ze(I?!1:a&&u,V);let O=k(h=>{var o;switch(h.key){case Q.Escape:if(s.state.popoverState!==g.Open||!i.current)return;let d=se(i.current);if(d&&!i.current.contains(d))return;h.preventDefault(),h.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var h;e.static||w===g.Closed&&((h=e.unmount)==null||h)&&s.actions.setPanel(null)},[w,e.unmount,e.static,s]),l.useEffect(()=>{if(I||!m||w!==g.Open||!i.current)return;let h=se(i.current);i.current.contains(h)||q(i.current,G.First)},[I,m,i.current,w]);let j=re({open:w===g.Open,close:s.actions.refocusableClose}),Y=me(_?L():{},{ref:ae,id:f,onKeyDown:O,onBlur:m&&w===g.Open?h=>{var o,d,T,E,D;let K=h.relatedTarget;K&&i.current&&((o=i.current)!=null&&o.contains(K)||(s.actions.close(),((T=(d=b.current)==null?void 0:d.contains)!=null&&T.call(d,K)||(D=(E=p.current)==null?void 0:E.contains)!=null&&D.call(E,K))&&K.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":St(u,B,!0).width},...Ee(F)}),N=Fe(),X=k(()=>{let h=i.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;q(h,G.First)===he.Error&&((d=s.state.afterPanelSentinel.current)==null||d.focus())},[A.Backwards]:()=>{var d;(d=s.state.button)==null||d.focus({preventScroll:!0})}})}o()}),ue=k(()=>{let h=i.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;if(!s.state.button)return;let T=(d=ge(s.state.button))!=null?d:document.body,E=Pe(T),D=E.indexOf(s.state.button),K=E.slice(0,D+1),ce=[...E.slice(D+1),...K];for(let be of ce.slice())if(be.dataset.headlessuiFocusGuard==="true"||R!=null&&R.contains(be)){let Ce=ce.indexOf(be);Ce!==-1&&ce.splice(Ce,1)}q(ce,G.First,{sorted:!1})},[A.Backwards]:()=>{var d;q(h,G.Previous)===he.Error&&((d=s.state.button)==null||d.focus())}})}o()}),fe=le();return C.createElement(Je,null,C.createElement(pe.Provider,{value:f},C.createElement(je,{value:s.actions.refocusableClose},C.createElement(Ue,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&$&&C.createElement(ye,{id:v,ref:b,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:X}),fe({ourProps:Y,theirProps:y,slot:j,defaultTag:Rt,features:Dt,visible:u,name:"Popover.Panel"}),u&&$&&C.createElement(ye,{id:x,ref:p,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Gt="div";function Lt(e,n){let t=l.useRef(null),f=J(t,n),[m,c]=l.useState([]),r=k(b=>{c(p=>{let v=p.indexOf(b);if(v!==-1){let x=p.slice();return x.splice(v,1),x}return p})}),a=k(b=>(c(p=>[...p,b]),()=>r(b))),S=k(()=>{var b;let p=ge(t.current);if(!p)return!1;let v=se(t.current);return(b=t.current)!=null&&b.contains(v)?!0:m.some(x=>{var i,_;return((i=p.getElementById(x.buttonId.current))==null?void 0:i.contains(v))||((_=p.getElementById(x.panelId.current))==null?void 0:_.contains(v))})}),y=k(b=>{for(let p of m)p.buttonId.current!==b&&p.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:S,closeOthers:y}),[a,r,S,y]),$=re({}),w=e,B={ref:f},I=le();return C.createElement(Ne,null,C.createElement(Se.Provider,{value:s},I({ourProps:B,theirProps:w,slot:$,defaultTag:Gt,name:"Popover.Group"})))}let Kt=ee(Ot),Ae=ee(jt),Qt=ee(De),qt=ee(De),Ge=ee(At),Ht=ee(Lt),Vt=Object.assign(Kt,{Button:Ae,Backdrop:qt,Overlay:Qt,Panel:Ge,Group:Ht});/** +import{aA as Le,aX as ve,az as Ke,cx as Pe,aC as Qe,aB as Z,r as l,aF as qe,aG as ee,aK as z,aJ as J,au as k,aN as Q,cy as se,cz as _e,aS as He,aT as Ve,aY as We,aU as re,aZ as Ye,aV as me,cA as Fe,cB as q,cC as A,cD as he,cE as G,cF as ge,aW as le,b6 as C,cG as ye,cH as xe,a_ as we,ay as Xe,a$ as Te,b0 as Oe,b2 as Ze,b3 as ze,b5 as Ee,cI as Je,cJ as je,b7 as Ue,cK as et,cL as tt,b8 as Ie,cM as nt,cN as at,cO as ot,av as st,be as rt,b1 as U,cP as Ne,bg as lt,bi as ie,cQ as ut,cR as ct,cS as it,d as dt,j as P,c as M,A as pt,m as ft,cw as bt,cT as vt,u as mt,x as ht,R as ke}from"./index-WhzslczH.js";import{C as yt}from"./chevron-right-Ewog5LA3.js";import{F as xt,y as Pt,R as gt,T as $t,w as St,A as Ct}from"./map-pin-BXCqDxIA.js";var wt=Object.defineProperty,It=(e,n,t)=>n in e?wt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Be=(e,n,t)=>(It(e,typeof n!="symbol"?n+"":n,t),t),g=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(g||{}),kt=(e=>(e[e.OpenPopover=0]="OpenPopover",e[e.ClosePopover=1]="ClosePopover",e[e.SetButton=2]="SetButton",e[e.SetButtonId=3]="SetButtonId",e[e.SetPanel=4]="SetPanel",e[e.SetPanelId=5]="SetPanelId",e))(kt||{});let Bt={0:e=>e.popoverState===0?e:{...e,popoverState:0,__demoMode:!1},1(e){return e.popoverState===1?e:{...e,popoverState:1,__demoMode:!1}},2(e,n){return e.button===n.button?e:{...e,button:n.button}},3(e,n){return e.buttonId===n.buttonId?e:{...e,buttonId:n.buttonId}},4(e,n){return e.panel===n.panel?e:{...e,panel:n.panel}},5(e,n){return e.panelId===n.panelId?e:{...e,panelId:n.panelId}}};class $e extends Le{constructor(n){super(n),Be(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let f=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;f==null||f.focus()},open:()=>this.send({type:0}),setButtonId:t=>this.send({type:3,buttonId:t}),setButton:t=>this.send({type:2,button:t}),setPanelId:t=>this.send({type:5,panelId:t}),setPanel:t=>this.send({type:4,panel:t})}),Be(this,"selectors",{isPortalled:t=>{var f;if(!t.button||!t.panel)return!1;let m=(f=Ke(t.button))!=null?f:document;for(let $ of m.querySelectorAll("body > *"))if(Number($==null?void 0:$.contains(t.button))^Number($==null?void 0:$.contains(t.panel)))return!0;let c=Pe(m),r=c.indexOf(t.button),a=(r+c.length-1)%c.length,S=(r+1)%c.length,y=c[a],s=c[S];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,f=Qe.get(null);this.on(0,()=>f.actions.push(t)),this.on(1,()=>f.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new $e({id:n,__demoMode:t,popoverState:t?0:1,buttons:{current:[]},button:null,buttonId:null,panel:null,panelId:null,beforePanelSentinel:{current:null},afterPanelSentinel:{current:null},afterButtonSentinel:{current:null}})}reduce(n,t){return Z(t.type,Bt,n,t)}}const Me=l.createContext(null);function de(e){let n=l.useContext(Me);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function _t({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>$e.new({id:e,__demoMode:n}),[]);return qe(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function Re(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function Ft(){return l.useContext(pe)}let Tt="div";function Ot(e,n){var t;let f=l.useId(),{__demoMode:m=!1,...c}=e,r=_t({id:f,__demoMode:m}),a=l.useRef(null),S=J(n,et(u=>{a.current=u})),[y,s,$,w,B]=z(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),I=tt((t=a.current)!=null?t:s),b=Ie(w),p=Ie(B),v=l.useMemo(()=>({buttonId:b,panelId:p,close:r.actions.close}),[b,p,r]),x=Re(),i=x==null?void 0:x.registerPopover,_=k(()=>{var u,F;let O=se((u=a.current)!=null?u:s);return(F=x==null?void 0:x.isFocusWithinPopoverGroup())!=null?F:O&&((s==null?void 0:s.contains(O))||($==null?void 0:$.contains(O)))});l.useEffect(()=>i==null?void 0:i(v),[i,v]);let[te,ne]=nt(),L=at(s),R=ot({mainTreeNode:L,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});st(I,"focus",u=>{var F,O,j,Y,N,X;u.target!==window&&ut(u.target)&&r.state.popoverState===g.Open&&(_()||r.state.button&&r.state.panel&&(R.contains(u.target)||(O=(F=r.state.beforePanelSentinel.current)==null?void 0:F.contains)!=null&&O.call(F,u.target)||(Y=(j=r.state.afterPanelSentinel.current)==null?void 0:j.contains)!=null&&Y.call(j,u.target)||(X=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&X.call(N,u.target)||r.actions.close()))},!0);let H=y===g.Open;rt(H,R.resolveContainers,(u,F)=>{r.actions.close(),ct(F,it.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===g.Open,close:r.actions.refocusableClose}),oe=z(r,l.useCallback(u=>Z(u.popoverState,{[g.Open]:U.Open,[g.Closed]:U.Closed}),[])),V={ref:S},W=le();return C.createElement(Ne,{node:L},C.createElement(Ct,null,C.createElement(pe.Provider,{value:null},C.createElement(Me.Provider,{value:r},C.createElement(je,{value:r.actions.refocusableClose},C.createElement(lt,{value:oe},C.createElement(ne,null,W({ourProps:V,theirProps:c,slot:ae,defaultTag:Tt,name:"Popover"}))))))))}let Et="button";function jt(e,n){let t=l.useId(),{id:f=`headlessui-popover-button-${t}`,disabled:m=!1,autoFocus:c=!1,...r}=e,a=de("Popover.Button"),[S,y,s,$,w,B,I]=z(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),b=l.useRef(null),p=`headlessui-focus-sentinel-${l.useId()}`,v=Re(),x=v==null?void 0:v.closeOthers,i=Ft()!==null;l.useEffect(()=>{if(!i)return a.actions.setButtonId(f),()=>a.actions.setButtonId(null)},[i,f,a]);let[_]=l.useState(()=>Symbol()),te=J(b,n,xt(),k(o=>{if(!i){if(o)a.state.buttons.current.push(_);else{let d=a.state.buttons.current.indexOf(_);d!==-1&&a.state.buttons.current.splice(d,1)}a.state.buttons.current.length>1&&console.warn("You are already using a but only 1 is supported."),o&&a.actions.setButton(o)}})),ne=J(b,n),L=k(o=>{var d,T,E;if(i){if(a.state.popoverState===g.Closed)return;switch(o.key){case Q.Space:case Q.Enter:o.preventDefault(),(T=(d=o.target).click)==null||T.call(d),a.actions.close(),(E=a.state.button)==null||E.focus();break}}else switch(o.key){case Q.Space:case Q.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close();break;case Q.Escape:if(a.state.popoverState!==g.Open)return x==null?void 0:x(a.state.buttonId);if(!b.current)return;let D=se(b.current);if(D&&!b.current.contains(D))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),R=k(o=>{i||o.key===Q.Space&&o.preventDefault()}),H=k(o=>{var d,T;_e(o.currentTarget)||m||(i?(a.actions.close(),(d=a.state.button)==null||d.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===g.Closed?(x==null||x(a.state.buttonId),a.actions.open()):a.actions.close(),(T=a.state.button)==null||T.focus()))}),ae=k(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:V}=He({autoFocus:c}),{isHovered:W,hoverProps:u}=Ve({isDisabled:m}),{pressed:F,pressProps:O}=We({disabled:m}),j=S===g.Open,Y=re({open:j,active:F||j,disabled:m,hover:W,focus:oe,autofocus:c}),N=Ye(e,s),X=i?me({ref:ne,type:N,onKeyDown:L,onClick:H,disabled:m||void 0,autoFocus:c},V,u,O):me({ref:te,id:$,type:N,"aria-expanded":S===g.Open,"aria-controls":w?B:void 0,disabled:m||void 0,autoFocus:c,onKeyDown:L,onKeyUp:R,onClick:H,onMouseDown:ae},V,u,O),ue=Fe(),fe=k(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function d(){Z(ue.current,{[A.Forwards]:()=>q(o,G.First),[A.Backwards]:()=>q(o,G.Last)})===he.Error&&q(Pe(ge(a.state.button)).filter(T=>T.dataset.headlessuiFocusGuard!=="true"),Z(ue.current,{[A.Forwards]:G.Next,[A.Backwards]:G.Previous}),{relativeTo:a.state.button})}d()}),h=le();return C.createElement(C.Fragment,null,h({ourProps:X,theirProps:r,slot:Y,defaultTag:Et,name:"Popover.Button"}),j&&!i&&y&&C.createElement(ye,{id:p,ref:I,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Nt="div",Mt=ie.RenderStrategy|ie.Static;function De(e,n){let t=l.useId(),{id:f=`headlessui-popover-backdrop-${t}`,transition:m=!1,...c}=e,r=de("Popover.Backdrop"),a=z(r,l.useCallback(v=>v.popoverState,[])),[S,y]=l.useState(null),s=J(n,y),$=Te(),[w,B]=Oe(m,S,$!==null?($&U.Open)===U.Open:a===g.Open),I=k(v=>{if(_e(v.currentTarget))return v.preventDefault();r.actions.close()}),b=re({open:a===g.Open}),p={ref:s,id:f,"aria-hidden":!0,onClick:I,...Ee(B)};return le()({ourProps:p,theirProps:c,slot:b,defaultTag:Nt,features:Mt,visible:w,name:"Popover.Backdrop"})}let Rt="div",Dt=ie.RenderStrategy|ie.Static;function At(e,n){let t=l.useId(),{id:f=`headlessui-popover-panel-${t}`,focus:m=!1,anchor:c,portal:r=!1,modal:a=!1,transition:S=!1,...y}=e,s=de("Popover.Panel"),$=z(s,s.selectors.isPortalled),[w,B,I,b,p]=z(s,l.useCallback(h=>[h.popoverState,h.button,h.__demoMode,h.beforePanelSentinel,h.afterPanelSentinel],[])),v=`headlessui-focus-sentinel-before-${t}`,x=`headlessui-focus-sentinel-after-${t}`,i=l.useRef(null),_=Pt(c),[te,ne]=gt(_),L=$t();_&&(r=!0);let[R,H]=l.useState(null),ae=J(i,n,_?te:null,s.actions.setPanel,H),oe=we(B),V=we(i.current);Xe(()=>(s.actions.setPanelId(f),()=>s.actions.setPanelId(null)),[f,s]);let W=Te(),[u,F]=Oe(S,R,W!==null?(W&U.Open)===U.Open:w===g.Open);Ze(u,B,s.actions.close),ze(I?!1:a&&u,V);let O=k(h=>{var o;switch(h.key){case Q.Escape:if(s.state.popoverState!==g.Open||!i.current)return;let d=se(i.current);if(d&&!i.current.contains(d))return;h.preventDefault(),h.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var h;e.static||w===g.Closed&&((h=e.unmount)==null||h)&&s.actions.setPanel(null)},[w,e.unmount,e.static,s]),l.useEffect(()=>{if(I||!m||w!==g.Open||!i.current)return;let h=se(i.current);i.current.contains(h)||q(i.current,G.First)},[I,m,i.current,w]);let j=re({open:w===g.Open,close:s.actions.refocusableClose}),Y=me(_?L():{},{ref:ae,id:f,onKeyDown:O,onBlur:m&&w===g.Open?h=>{var o,d,T,E,D;let K=h.relatedTarget;K&&i.current&&((o=i.current)!=null&&o.contains(K)||(s.actions.close(),((T=(d=b.current)==null?void 0:d.contains)!=null&&T.call(d,K)||(D=(E=p.current)==null?void 0:E.contains)!=null&&D.call(E,K))&&K.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":St(u,B,!0).width},...Ee(F)}),N=Fe(),X=k(()=>{let h=i.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;q(h,G.First)===he.Error&&((d=s.state.afterPanelSentinel.current)==null||d.focus())},[A.Backwards]:()=>{var d;(d=s.state.button)==null||d.focus({preventScroll:!0})}})}o()}),ue=k(()=>{let h=i.current;if(!h)return;function o(){Z(N.current,{[A.Forwards]:()=>{var d;if(!s.state.button)return;let T=(d=ge(s.state.button))!=null?d:document.body,E=Pe(T),D=E.indexOf(s.state.button),K=E.slice(0,D+1),ce=[...E.slice(D+1),...K];for(let be of ce.slice())if(be.dataset.headlessuiFocusGuard==="true"||R!=null&&R.contains(be)){let Ce=ce.indexOf(be);Ce!==-1&&ce.splice(Ce,1)}q(ce,G.First,{sorted:!1})},[A.Backwards]:()=>{var d;q(h,G.Previous)===he.Error&&((d=s.state.button)==null||d.focus())}})}o()}),fe=le();return C.createElement(Je,null,C.createElement(pe.Provider,{value:f},C.createElement(je,{value:s.actions.refocusableClose},C.createElement(Ue,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&$&&C.createElement(ye,{id:v,ref:b,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:X}),fe({ourProps:Y,theirProps:y,slot:j,defaultTag:Rt,features:Dt,visible:u,name:"Popover.Panel"}),u&&$&&C.createElement(ye,{id:x,ref:p,features:xe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Gt="div";function Lt(e,n){let t=l.useRef(null),f=J(t,n),[m,c]=l.useState([]),r=k(b=>{c(p=>{let v=p.indexOf(b);if(v!==-1){let x=p.slice();return x.splice(v,1),x}return p})}),a=k(b=>(c(p=>[...p,b]),()=>r(b))),S=k(()=>{var b;let p=ge(t.current);if(!p)return!1;let v=se(t.current);return(b=t.current)!=null&&b.contains(v)?!0:m.some(x=>{var i,_;return((i=p.getElementById(x.buttonId.current))==null?void 0:i.contains(v))||((_=p.getElementById(x.panelId.current))==null?void 0:_.contains(v))})}),y=k(b=>{for(let p of m)p.buttonId.current!==b&&p.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:S,closeOthers:y}),[a,r,S,y]),$=re({}),w=e,B={ref:f},I=le();return C.createElement(Ne,null,C.createElement(Se.Provider,{value:s},I({ourProps:B,theirProps:w,slot:$,defaultTag:Gt,name:"Popover.Group"})))}let Kt=ee(Ot),Ae=ee(jt),Qt=ee(De),qt=ee(De),Ge=ee(At),Ht=ee(Lt),Vt=Object.assign(Kt,{Button:Ae,Backdrop:qt,Overlay:Qt,Panel:Ge,Group:Ht});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/NodeInformationCard-CtqEav-P.js b/frontend/dist/assets/NodeInformationCard-DJ0EACZ1.js similarity index 90% rename from frontend/dist/assets/NodeInformationCard-CtqEav-P.js rename to frontend/dist/assets/NodeInformationCard-DJ0EACZ1.js index 814c4736..5fca2d48 100644 --- a/frontend/dist/assets/NodeInformationCard-CtqEav-P.js +++ b/frontend/dist/assets/NodeInformationCard-DJ0EACZ1.js @@ -1 +1 @@ -import{j as s,N as i,R as d,cX as c}from"./index-CvSa8h-C.js";import{C as n}from"./PageLayout-B8orsDlo.js";import{D as m}from"./DataBox-CwAsAwyY.js";function j({nodeName:e,repeaterVersion:a,coreVersion:t,localHash:r,publicKey:l}){return s.jsxs(n,{neomorphic:!0,children:[s.jsx(i,{icon:s.jsx(d,{}),title:"Node Information"}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-4",children:[s.jsxs("div",{className:"min-w-0 col-span-2 sm:col-span-1",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Node Name"}),s.jsx("p",{className:"type-body text-fg-primary mt-0.5 sm:mt-1 truncate",title:e,children:e})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Repeater"}),s.jsxs("p",{className:"type-data text-fg-primary mt-0.5 sm:mt-1 truncate",title:`v${a}`,children:["v",a]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Core"}),s.jsxs("p",{className:"type-data text-fg-primary mt-0.5 sm:mt-1 truncate",title:`v${t}`,children:["v",t]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Console"}),s.jsxs("p",{className:"type-data text-fg-primary mt-0.5 sm:mt-1 truncate",title:`v${c}`,children:["v",c]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Local Hash"}),s.jsx("div",{className:"mt-0.5 sm:mt-1",children:r?s.jsx(m,{copy:!0,size:"compact",children:r}):s.jsx("span",{className:"type-data-sm text-fg-secondary",children:"N/A"})})]})]}),l&&s.jsxs("div",{className:"mt-3 sm:mt-4 pt-3 sm:pt-4 border-t border-edge-subtle",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Public Key"}),s.jsx("div",{className:"mt-0.5 sm:mt-1",children:s.jsx(m,{copy:!0,size:"responsive",children:l})})]})]})}export{j as N}; +import{j as s,N as i,R as d,cX as c}from"./index-WhzslczH.js";import{C as n}from"./PageLayout-CjepFyhn.js";import{D as m}from"./DataBox-ABvJ7hn1.js";function j({nodeName:e,repeaterVersion:a,coreVersion:t,localHash:r,publicKey:l}){return s.jsxs(n,{neomorphic:!0,children:[s.jsx(i,{icon:s.jsx(d,{}),title:"Node Information"}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3 sm:gap-4",children:[s.jsxs("div",{className:"min-w-0 col-span-2 sm:col-span-1",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Node Name"}),s.jsx("p",{className:"type-body text-fg-primary mt-0.5 sm:mt-1 truncate",title:e,children:e})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Repeater"}),s.jsxs("p",{className:"type-data text-fg-primary mt-0.5 sm:mt-1 truncate",title:`v${a}`,children:["v",a]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Core"}),s.jsxs("p",{className:"type-data text-fg-primary mt-0.5 sm:mt-1 truncate",title:`v${t}`,children:["v",t]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Console"}),s.jsxs("p",{className:"type-data text-fg-primary mt-0.5 sm:mt-1 truncate",title:`v${c}`,children:["v",c]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Local Hash"}),s.jsx("div",{className:"mt-0.5 sm:mt-1",children:r?s.jsx(m,{copy:!0,size:"compact",children:r}):s.jsx("span",{className:"type-data-sm text-fg-secondary",children:"N/A"})})]})]}),l&&s.jsxs("div",{className:"mt-3 sm:mt-4 pt-3 sm:pt-4 border-t border-edge-subtle",children:[s.jsx("span",{className:"type-label text-fg-secondary",children:"Public Key"}),s.jsx("div",{className:"mt-0.5 sm:mt-1",children:s.jsx(m,{copy:!0,size:"responsive",children:l})})]})]})}export{j as N}; diff --git a/frontend/dist/assets/PacketList-Bpo20OVL.js b/frontend/dist/assets/PacketList-3khSiIZq.js similarity index 99% rename from frontend/dist/assets/PacketList-Bpo20OVL.js rename to frontend/dist/assets/PacketList-3khSiIZq.js index 2c477df0..5b4f7663 100644 --- a/frontend/dist/assets/PacketList-Bpo20OVL.js +++ b/frontend/dist/assets/PacketList-3khSiIZq.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-CNUY5MTe.js","assets/index-CvSa8h-C.js","assets/BasemapLayer-NuqTvOvz.js","assets/useMapViewStore-1D-N8rLK.js","assets/index-CPifxb0-.js","assets/index-1OCG5H5s.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); -import{d as ye,bp as as,bq as Pt,br as ns,bs as rs,j as e,c as R,B as nt,e as ls,r as h,E as rt,x as M,bt as Mt,bu as Bt,bv as Lt,R as de,bw as Rt,bx as Ht,by as Ft,bz as he,bA as Xe,a8 as Ee,_ as is,bB as cs,bC as os,bD as ds,bE as xs,bF as ms,bG as hs,m as oe,ah as re,F as us,D as ps,bH as fs,bI as le,bJ as ht,bK as gs,bL as ys,bM as js,bN as bs,bO as Ns,bP as vs,bQ as Ze,bR as ws,ad as ks,K as Dt,bS as Cs,bT as _s,bU as Ss,bV as Ts,am as At,an as Et,A as qe,bW as Ps,ao as Ms,bX as Bs,bY as lt}from"./index-CvSa8h-C.js";import{a as Ls,u as Rs}from"./circle-x-BDVzq0qX.js";import{p as Hs,d as Fs,e as It,g as Ds,b as As}from"./primitives-BahnzDua.js";import{u as Es,r as Is,a as zs,b as $s,c as Us,d as Os,i as Vs}from"./consumer-registry-BsBD_8RF.js";import{D as Pe,R as Ie,P as Me,g as Gs,C as xe}from"./badge-colors-MuK22b26.js";import{g as zt,e as _e,a as $t}from"./chat-utils-BUBqf9vH.js";import{A as ue,S as ze,i as $e,a as Qs,g as ut}from"./SignalIndicator-B0ppyCo-.js";import{a as Ws,A as Ut}from"./arrow-up-DQmOy4Je.js";import{C as it}from"./chevron-right-1kmv-Vqa.js";import{M as Ue}from"./map-pin-BCwmmHGs.js";import{C as qs}from"./circle-question-mark-DDUlGgWh.js";import{T as Je}from"./triangle-alert-C7tm61-l.js";import{D as X}from"./DataBox-CwAsAwyY.js";import{L as Ks}from"./layers-Cnw2L-3K.js";import{H as Ot}from"./hash-CTme6GHI.js";import{A as Ys}from"./activity-CctJQ0y-.js";import{C as Xs}from"./circle-check-DW83e7Fg.js";import{D as Zs}from"./database-bNR-4XQS.js";import{H as Js,D as et,u as ea}from"./useMapViewStore-1D-N8rLK.js";import{S as we}from"./shield-DDEEZTF6.js";import{C as Vt}from"./MqttModeBadge-CGW6hCWV.js";import{Z as pt}from"./zap-mngIm3qT.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-XWZ321IJ.js","assets/index-WhzslczH.js","assets/BasemapLayer-CeyADeA1.js","assets/useMapViewStore-7rwVBEII.js","assets/index-WiXmWhPS.js","assets/index-1OCG5H5s.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); +import{d as ye,bp as as,bq as Pt,br as ns,bs as rs,j as e,c as R,B as nt,e as ls,r as h,E as rt,x as M,bt as Mt,bu as Bt,bv as Lt,R as de,bw as Rt,bx as Ht,by as Ft,bz as he,bA as Xe,a8 as Ee,_ as is,bB as cs,bC as os,bD as ds,bE as xs,bF as ms,bG as hs,m as oe,ah as re,F as us,D as ps,bH as fs,bI as le,bJ as ht,bK as gs,bL as ys,bM as js,bN as bs,bO as Ns,bP as vs,bQ as Ze,bR as ws,ad as ks,K as Dt,bS as Cs,bT as _s,bU as Ss,bV as Ts,am as At,an as Et,A as qe,bW as Ps,ao as Ms,bX as Bs,bY as lt}from"./index-WhzslczH.js";import{a as Ls,u as Rs}from"./circle-x-DAvnTI4S.js";import{p as Hs,d as Fs,e as It,g as Ds,b as As}from"./primitives-Bq_jqX-t.js";import{u as Es,r as Is,a as zs,b as $s,c as Us,d as Os,i as Vs}from"./consumer-registry-DcpFyHd4.js";import{D as Pe,R as Ie,P as Me,g as Gs,C as xe}from"./badge-colors-BgV-I1O5.js";import{g as zt,e as _e,a as $t}from"./chat-utils-CPRl3lbc.js";import{A as ue,S as ze,i as $e,a as Qs,g as ut}from"./SignalIndicator-B1hS3JQG.js";import{a as Ws,A as Ut}from"./arrow-up-pO4AtOWx.js";import{C as it}from"./chevron-right-Ewog5LA3.js";import{M as Ue}from"./map-pin-BXCqDxIA.js";import{C as qs}from"./circle-question-mark-CJt3zunX.js";import{T as Je}from"./triangle-alert-BsvKjxO1.js";import{D as X}from"./DataBox-ABvJ7hn1.js";import{L as Ks}from"./layers-rhF42Hfn.js";import{H as Ot}from"./hash-Bwa-X17j.js";import{A as Ys}from"./activity-CzPYx3Pb.js";import{C as Xs}from"./circle-check-6eqe109E.js";import{D as Zs}from"./database-Hkah1WM3.js";import{H as Js,D as et,u as ea}from"./useMapViewStore-7rwVBEII.js";import{S as we}from"./shield-DWGSxaaG.js";import{C as Vt}from"./MqttModeBadge-xEEk549C.js";import{Z as pt}from"./zap-Ec1PEQMI.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -39,7 +39,7 @@ import{d as ye,bp as as,bq as Pt,br as ns,bs as rs,j as e,c as R,B as nt,e as ls * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xa=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ke=ye("user",xa);function ma(t){t.values.forEach(a=>a.stop())}function tt(t,a){[...a].reverse().forEach(n=>{const r=t.getVariant(n);r&&Pt(t,r),t.variantChildren&&t.variantChildren.forEach(i=>{tt(i,a)})})}function ha(t,a){if(Array.isArray(a))return tt(t,a);if(typeof a=="string")return tt(t,[a]);Pt(t,a)}function ua(){const t=new Set,a={subscribe(s){return t.add(s),()=>void t.delete(s)},start(s,n){const r=[];return t.forEach(i=>{r.push(as(i,s,{transitionOverride:n}))}),Promise.all(r)},set(s){return t.forEach(n=>{ha(n,s)})},stop(){t.forEach(s=>{ma(s)})},mount(){return()=>{a.stop()}}};return a}function pa(){const t=ns(ua);return rs(t.mount,[]),t}function fa({"aria-label":t="Page navigation",className:a,...s}){return e.jsx("nav",{"aria-label":t,...s,className:R("flex gap-x-2",a)})}function ga({onClick:t,disabled:a=!1,className:s,children:n="Previous"}){return e.jsx("span",{className:R("grow basis-0",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Previous page",className:R("gap-1",a&&"invisible"),children:[e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2.75 8H13.25M2.75 8L5.25 5.5M2.75 8L5.25 10.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),n]})})}function ya({onClick:t,disabled:a=!1,className:s,children:n="Next"}){return e.jsx("span",{className:R("flex grow basis-0 justify-end",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Next page",className:R("gap-1",a&&"invisible"),children:[n,e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M13.25 8L2.75 8M13.25 8L10.75 10.5M13.25 8L10.75 5.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})]})})}function ja({className:t,...a}){return e.jsx("span",{...a,className:R("hidden items-baseline gap-x-2 sm:flex",t)})}function ba({page:t,current:a=!1,onClick:s,className:n,children:r}){return e.jsx(nt,{plain:!a,outline:a,onClick:()=>s==null?void 0:s(t),"aria-label":`Page ${t}`,"aria-current":a?"page":void 0,className:R("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:r??t})}function Na({className:t,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:R("w-[2.25rem] select-none text-center text-sm text-fg-muted",t),children:"…"})}function va(t,a,s=1){if(a<=7)return Array.from({length:a},(m,g)=>g+1);const n=Math.max(t-s,1),r=Math.min(t+s,a),i=n>2,l=ry+1),"gap",a]}if(i&&!l){const m=3+2*s;return[1,"gap",...Array.from({length:m},(u,y)=>a-m+y+1)]}return[1,"gap",...Array.from({length:r-n+1},(m,g)=>n+g),"gap",a]}const dr=ls(t=>({requestedHash:null,requestChannel:a=>t({requestedHash:a}),clearRequest:()=>t({requestedHash:null})}));function wa(t){if(t.length===0)return[];const a=[];let s=0;for(;s{const l=i===t.length-1,o=n&&r.toUpperCase()===n;return e.jsxs("span",{className:"flex items-center flex-shrink-0",children:[o?e.jsx("span",{className:"px-1 py-0.5 rounded bg-sys-amber/20 text-sys-amber text-[9px] font-medium",children:"You"}):e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill-hover text-fg-secondary",children:r.toUpperCase()}),!l&&e.jsx(it,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${r}-${i}`)})})}const Wt=h.memo(Ta);function qt({channelName:t,onClick:a,active:s,compact:n,className:r}){const i=t.startsWith("#")?t:`#${t}`,l=R("inline-flex items-center flex-shrink-0","font-medium",n?"px-1.5 h-4 leading-4 rounded text-[10px]":"px-2 h-5 leading-5 rounded text-xs",s?"bg-sys-blue/20 text-sys-blue":"bg-sys-blue/10 text-sys-blue",a&&!s&&"hover:bg-sys-blue/20 cursor-pointer",r);return a?e.jsx("button",{type:"button",onClick:a,className:l,children:i}):e.jsx("span",{className:l,children:i})}function Se(t){return{"--data-box-accent":he[t]}}function Kt(t){const a=t.payload_type_name||Ht(t.payload_type??t.type),s=t.route_type_name||Ft(t.route_type??t.route),n=Me[a]??"zinc",r=Ie[s]??"zinc";return{payloadType:a,routeType:s,payloadColor:n,routeColor:r}}function Oe(t){if(!t)return[];if(Array.isArray(t))return t;try{const a=JSON.parse(t);return Array.isArray(a)?a:[]}catch{return[]}}function Yt(t,a){if(a){const s=a(t);return{name:s.name,isCompanion:s.isCompanion,isRepeater:s.isRepeater}}return{name:null,isCompanion:!1,isRepeater:!1}}function Pa({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,onTraceHover:o,traceTag:m,onViewTraceReport:g,dupeGroupPosition:u,isDupeGroupHovered:y=!1,onDupeGroupHover:w,dupeCount:j,getDecodedContent:x,onChannelClick:k}){const B=j?!1:Mt(t.is_duplicate),d=u!==void 0,{payloadType:b,routeType:f,payloadColor:_,routeColor:v}=Kt(t),p=t.packet_origin==="tx_local",E=b==="TRACE",O=Oe(t.original_path),G=Oe(t.forwarded_path),K=G.length>0?G:O,D=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:Y,isRepeater:I}=Yt(t,r);let H=null,$=null,U=null,J=null;if(b==="GRP_TXT"&&x){const S=x(t);S!=null&&S.decrypted&&($=S.senderName,U=S.channelName,J=S.channelHash,S.text&&(H=S.text))}else if(b==="TXT_MSG"&&t.raw_packet)try{const S=Bt.fromHex(t.raw_packet);if(S.success&&S.packet){const ce=Lt(S.packet.payload);ce&&!ce.encrypted&&(H=ce.text)}}catch{}const T=$||(I?null:Y),z=!!T,te=!z&&I&&!!Y,se=!z&&!te&&b==="GRP_TXT"&&!H,c=t.payload_length??t.length??0;t.lbt_attempts;const Z=h.useCallback(()=>{E&&m&&g?g(m):a(t)},[E,m,g,a,t]),q=h.useCallback(()=>{E&&m&&o&&o(m),d&&w&&t.packet_hash&&w(t.packet_hash)},[E,m,o,d,w,t.packet_hash]),ie=h.useCallback(()=>{o&&o(null),w&&w(null)},[o,w]),P=he[_]||he.zinc,F=y,ae=()=>{const S={pointerEvents:"none"};return u==="first"?{...S,borderTop:`2px solid ${P}`,borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:u==="middle"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:u==="last"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:`2px solid ${P}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...S,border:`2px solid ${P}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:Z,onMouseEnter:q,onMouseLeave:ie,className:R("group relative cursor-pointer","hover:bg-subtle-fill",B&&!y&&"opacity-40",i&&"flash-row",p&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:R("absolute pointer-events-none transition-opacity duration-75",d?F?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:ae()}),e.jsxs("div",{className:"relative flex items-center gap-2 min-[600px]:gap-3 px-2 py-2 min-[600px]:px-3 min-[600px]:py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("div",{className:"relative flex-shrink-0",children:z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(_e(T).cleanName)},children:_e(T).emoji?e.jsx("span",{className:"text-base leading-none",children:_e(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(T)})}):te?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):se?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:z?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:T}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):te?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:Y}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:D||"—"}),Y&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate max-w-[70px]",children:Y})]})})]}),e.jsxs("div",{className:"flex-1 flex items-center gap-1 min-[600px]:gap-1.5 min-[900px]:gap-2 min-w-0",children:[e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(_),children:b}),p&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se("indigo"),children:"LOCAL"}),j&&j>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",j]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(v),children:f}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[c,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:H||U?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[U&&e.jsx(qt,{channelName:U,compact:!0,onClick:k&&J?S=>{S.stopPropagation(),k(J)}:void 0}),H&&e.jsx("span",{className:"italic truncate",children:H})]}):e.jsx(Wt,{path:K,localHash:s})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("span",{className:"data-box data-box-compact",children:Rt(t.timestamp)}),e.jsx(ze,{rssi:t.rssi,snr:t.snr,compact:!0,showValues:!0,validated:$e(t)})]})]})]})}function Ma({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,traceTag:o,onViewTraceReport:m,dupeGroupPosition:g,isDupeGroupHovered:u=!1,onDupeGroupHover:y,dupeCount:w,getDecodedContent:j,onChannelClick:x}){const{payloadType:k,routeType:B,payloadColor:d,routeColor:b}=Kt(t),f=t.packet_origin==="tx_local",_=k==="TRACE",v=w?!1:Mt(t.is_duplicate),p=Oe(t.original_path),E=Oe(t.forwarded_path),O=E.length>0?E:p,G=t._hopCount??O.length,K=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:D,isRepeater:Y}=Yt(t,r);let I=null,H=null,$=null,U=null;if(k==="GRP_TXT"&&j){const P=j(t);P!=null&&P.decrypted&&(H=P.senderName,$=P.channelName,U=P.channelHash,P.text&&(I=P.text))}else if(k==="TXT_MSG"&&t.raw_packet)try{const P=Bt.fromHex(t.raw_packet);if(P.success&&P.packet){const F=Lt(P.packet.payload);F&&!F.encrypted&&(I=F.text)}}catch{}const J=H||(Y?null:D),T=!!J,z=!T&&Y&&!!D,te=!T&&!z&&k==="GRP_TXT"&&!I,se=t.payload_length??t.length??0,c=t.lbt_attempts??0,Z=()=>{_&&o&&m?m(o):a(t)},q=he[d]||he.zinc,ie=()=>{if(!g)return{opacity:0};const P=u?1:.4,F=u?"3px":"2px";return g==="first"?{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:g==="middle"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:0,borderRadius:0}:g==="last"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:Z,className:R("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",v&&"opacity-40",i&&"flash-row",f&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:"absolute left-0 transition-all",style:ie()}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"relative flex-shrink-0 mt-0.5",children:T?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(_e(J).cleanName)},children:_e(J).emoji?e.jsx("span",{className:"text-base leading-none",children:_e(J).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(J)})}):z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):te?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[T?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:J}):z?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:D}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:K||"—"}),D&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:D})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(d),children:k}),f&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se("indigo"),children:"LOCAL"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(b),children:B}),w&&w>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",w]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx("span",{className:"type-data-xs text-fg-muted w-[28px] text-right",children:t.rssi}),e.jsx(ze,{rssi:t.rssi,compact:!0,showValues:!1,validated:$e(t)})]})]}),e.jsxs("div",{className:"flex items-center gap-1 type-data-xs text-fg-muted",children:[e.jsx("span",{className:"data-box data-box-compact flex-shrink-0",children:Rt(t.timestamp)}),se>0&&e.jsxs("span",{children:[se,"B"]}),c>0&&e.jsxs("span",{className:c>1?"text-sys-amber/60":void 0,children:["LBT:",c]}),t.snr!=null&&e.jsxs("span",{children:[t.snr.toFixed(0),"dB"]}),I||$?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[$&&e.jsx(qt,{channelName:$,compact:!0,onClick:x&&U?P=>{P.stopPropagation(),x(U)}:void 0}),I&&e.jsx("span",{className:"italic truncate",children:I})]}):G>0?e.jsx(Wt,{path:O,localHash:s}):null]})]})]})]})}const Ba=h.memo(Pa),La=h.memo(Ma);function Ra(t,a,s,n,r=!1){const i=t.toUpperCase(),l=[],o=s&&Xe(i,s);o&&l.push(s);for(const j of Object.keys(a))Xe(i,j)&&l.push(j);if(r&&o&&s&&l.length===1)return{matches:l,probability:1,bestMatch:s};if(r&&o&&l.length>1){const j=l.filter(x=>x!==s);if(j.length===1)return{matches:l,probability:1,bestMatch:j[0]}}const m=l.length>0?1/l.length:0,g=[...l].sort();let u=null,y=-1;if(g.length===1)u=g[0];else if(g.length>1&&n){for(const j of g){const x=n.get(j),k=x?typeof x=="number"?x:x.combinedScore:0;k>y&&(y=k,u=j)}u||(u=g[0])}else g.length>0&&(u=g[0]);let w=m;if(l.length>1&&n&&y>0){let j=0;for(const x of l){const k=n.get(x);j+=k?typeof k=="number"?k:k.combinedScore:0}j>0&&(w=Math.min(.95,y/j))}return{matches:l,probability:w,bestMatch:u}}function Ha(t,a,s,n){const i=(s-t)*Math.PI/180,l=(n-a)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t*Math.PI/180)*Math.cos(s*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 6371e3*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function Fa(t){return t<100?1:t<500?.9:t<1e3?.7:t<5e3?.5:t<1e4?.3:.1}const Da=h.lazy(()=>is(()=>import("./PathMapMapLibre-CNUY5MTe.js"),__vite__mapDeps([0,1,2,3,4,5,6])));function Aa(t,a,s,n,r=!1,i,l,o){const m=cs(a);let g;l&&(g=os(l,t,{position:o,isLastHop:r}).confidence);const{matches:u,probability:y}=Ra(t,m,n,i,r),w=u.length,j=[],x=t.toUpperCase(),k=s&&s.latitude!==void 0&&s.longitude!==void 0&&(s.latitude!==0||s.longitude!==0);for(const d of u){if(n&&Xe(x,n)&&d===n&&k&&s){j.push({hash:d,name:s.name||"Local Node",latitude:s.latitude,longitude:s.longitude,probability:r?1:y,isLocal:!0});continue}const b=m[d];b!=null&&b.latitude&&(b!=null&&b.longitude)&&!(b.latitude===0&&b.longitude===0)&&j.push({hash:d,name:b.node_name||b.name||"Unknown",latitude:b.latitude,longitude:b.longitude,probability:y,isLocal:!1,isDirectNeighbor:b.zero_hop===!0})}const B=j.length;if(B===1)j[0].probability=g??1;else if(B>1)if(g!==void 0&&g>0){const d=j[0];d.probability=g;const b=1-g,f=B-1;j.slice(1).forEach(_=>{_.probability=b/f})}else{let d=0;const b=j.map(f=>{if(f.isLocal)return{candidate:f,score:1};const _=i==null?void 0:i.get(f.hash);let v=.5;if(k&&s){const E=Ha(s.latitude,s.longitude,f.latitude,f.longitude);v=Fa(E)}let p;return _?p=v*.3+_.hopConsistencyScore*.3+_.frequencyScore*.4:(p=v,f.isDirectNeighbor&&(p=Math.max(p,.8))),d+=p,{candidate:f,score:p}});if(d>0)b.forEach(({candidate:f,score:_})=>{f.probability=Math.min(.95,_/d)});else{const f=1/B;j.forEach(_=>_.probability=f)}}return{candidates:j,totalMatches:w}}function Ea(t,a,s,n,r,i){if(!t||t.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const l=t.length-1,o=t.map((u,y)=>{const w=y===l,j=t.length-y,{candidates:x,totalMatches:k}=Aa(u,a,s,n,w,r,i,j),B=x.length>0?Math.max(...x.map(d=>d.probability)):0;return{prefix:u,candidates:x,confidence:B,totalMatches:k}}),m=o.reduce((u,y)=>y.confidence===0?0:u*y.confidence,1),g=o.some(u=>u.candidates.length>0);return{hops:o,overallConfidence:m,hasValidPath:g}}function Ia(t){return`${(t*100).toFixed(0)}%`}function za(t){return t>=1?"text-sys-green":t>=.5?"text-sys-indigo":t>=.25?"text-signal-poor":t>0?"text-sys-red":"text-fg-muted"}function $a(t,a,s){let n;return a===0?n=s.muted:t>=1?n=s.success:t>=.5?n=s.secondary:t>=.25?n=s.poor:t>0?n=s.danger:n=s.muted,{color:n}}class Ua extends h.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?e.jsxs("div",{className:"h-[200px] flex items-center justify-center text-fg-muted",children:[e.jsx(Je,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function Ve({path:t,neighbors:a,localNode:s,localHash:n,srcHash:r,dstHash:i,neighborAffinity:l,prefixLookup:o,hubNodes:m,traceSnr:g,advertiserSource:u}){const[y,w]=h.useState(null),j=h.useMemo(()=>{if(!u)return null;const f=u.nodeType==="wardrive";return{prefix:u.prefix||"??",candidates:[{hash:u.publicKey||u.prefix||"source",name:u.name,latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isWardrive:f}],confidence:1,totalMatches:1,isSource:!0}},[u]),x=h.useMemo(()=>{if(u||!r)return null;const f=Ee(r),_=a[r];if((_==null?void 0:_.latitude)&&(_==null?void 0:_.longitude)&&!(_.latitude===0&&_.longitude===0))return{prefix:f,candidates:[{hash:r,name:_.node_name||_.name||"Source",latitude:_.latitude,longitude:_.longitude,probability:1,isLocal:!1,isDirectNeighbor:_.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const p=(_==null?void 0:_.node_name)||(_==null?void 0:_.name)||r.slice(0,8);return{prefix:f,candidates:[{hash:r,name:p,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[u,r,a]),k=h.useMemo(()=>{const f=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!f||f==="00"||f==="0000000000000000")&&s&&n){const G=Ee(n),K=s.latitude!==0||s.longitude!==0;return{prefix:G,candidates:[{hash:n,name:s.name||"Local Node",latitude:K?s.latitude:0,longitude:K?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const v=Ee(i);if(n&&i===n&&s){const G=s.latitude!==0||s.longitude!==0;return{prefix:v,candidates:[{hash:i,name:s.name||"Local Node",latitude:G?s.latitude:0,longitude:G?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const p=a[i];if((p==null?void 0:p.latitude)&&(p==null?void 0:p.longitude)&&!(p.latitude===0&&p.longitude===0))return{prefix:v,candidates:[{hash:i,name:p.node_name||p.name||"Destination",latitude:p.latitude,longitude:p.longitude,probability:1,isLocal:!1,isDirectNeighbor:p.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const O=(p==null?void 0:p.node_name)||(p==null?void 0:p.name)||i.slice(0,8);return{prefix:v,candidates:[{hash:i,name:O,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,a,s,n]),B=h.useMemo(()=>Ea(t,a,s,n,l,o),[t,a,s,n,l,o]),d=h.useMemo(()=>{const f=[];j?f.push(j):x&&f.push(x),f.push(...B.hops),k&&f.push(k);const _=f.reduce((p,E)=>E.confidence===0?0:p*E.confidence,1),v=f.some(p=>p.candidates.some(E=>E.latitude!==0||E.longitude!==0));return{hops:f,overallConfidence:_,hasValidPath:v}},[j,x,B,k]),b=h.useMemo(()=>{const f=getComputedStyle(document.documentElement);return{success:f.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:f.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:f.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:f.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:f.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return d.hasValidPath?e.jsxs("div",{className:"h-full flex flex-col space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Path Confidence:"}),e.jsx("span",{className:za(d.overallConfidence),children:Ia(d.overallConfidence)}),e.jsx("button",{className:"text-fg-muted hover:text-fg-secondary transition-colors",title:"Confidence is calculated based on how many known nodes match each path prefix. Multiple matches reduce confidence due to collision probability.",children:e.jsx(qs,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-green"}),e.jsx("span",{className:"text-fg-muted",children:"Exact"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-indigo"}),e.jsx("span",{className:"text-fg-muted",children:"Multi"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-fg-muted"}),e.jsx("span",{className:"text-fg-muted",children:"Unknown"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(Ua,{children:e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"h-full bg-elevated flex items-center justify-center text-fg-muted text-sm",children:"Loading map..."}),children:e.jsx(Da,{resolvedPath:d,localNode:s,hubNodes:m,hoveredHopIndex:y,onHoverHop:w,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:d.hops.map((f,_)=>{var G,K,D;const v=f.isSource===!0,p=f.isDestination===!0,E=y===_;let O;return v?O=`Source: ${((G=f.candidates[0])==null?void 0:G.name)||"Unknown"}`:p?O=`Destination: ${((K=f.candidates[0])==null?void 0:K.name)||"Unknown"}`:f.totalMatches===0?O="No matching nodes found":f.totalMatches===1?O=`Exact match: ${((D=f.candidates[0])==null?void 0:D.name)||"Unknown"}`:O=`${f.totalMatches} possible matches (${(f.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:R("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",E?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",v&&"border border-sys-green/30",p&&"border border-sys-blue/30"),title:O,onMouseEnter:()=>w(_),onMouseLeave:()=>w(null),children:[v&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),p&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:$a(f.confidence,f.totalMatches,b),children:f.prefix}),!v&&!p&&f.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",f.totalMatches]}),!v&&!p&&f.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},_)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const Ke=16;function Ge(t){return t.match(/.{1,2}/g)||[]}function je(t){return t!==null&&t.startsWith("payload:")}const Te={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` + */const xa=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],ke=ye("user",xa);function ma(t){t.values.forEach(a=>a.stop())}function tt(t,a){[...a].reverse().forEach(n=>{const r=t.getVariant(n);r&&Pt(t,r),t.variantChildren&&t.variantChildren.forEach(i=>{tt(i,a)})})}function ha(t,a){if(Array.isArray(a))return tt(t,a);if(typeof a=="string")return tt(t,[a]);Pt(t,a)}function ua(){const t=new Set,a={subscribe(s){return t.add(s),()=>void t.delete(s)},start(s,n){const r=[];return t.forEach(i=>{r.push(as(i,s,{transitionOverride:n}))}),Promise.all(r)},set(s){return t.forEach(n=>{ha(n,s)})},stop(){t.forEach(s=>{ma(s)})},mount(){return()=>{a.stop()}}};return a}function pa(){const t=ns(ua);return rs(t.mount,[]),t}function fa({"aria-label":t="Page navigation",className:a,...s}){return e.jsx("nav",{"aria-label":t,...s,className:R("flex gap-x-2",a)})}function ga({onClick:t,disabled:a=!1,className:s,children:n="Previous"}){return e.jsx("span",{className:R("grow basis-0",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Previous page",className:R("gap-1",a&&"invisible"),children:[e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M2.75 8H13.25M2.75 8L5.25 5.5M2.75 8L5.25 10.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})}),n]})})}function ya({onClick:t,disabled:a=!1,className:s,children:n="Next"}){return e.jsx("span",{className:R("flex grow basis-0 justify-end",s),children:e.jsxs(nt,{plain:!0,onClick:t,disabled:a,"aria-label":"Next page",className:R("gap-1",a&&"invisible"),children:[n,e.jsx("svg",{className:"size-4 stroke-current",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M13.25 8L2.75 8M13.25 8L10.75 10.5M13.25 8L10.75 5.5",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})]})})}function ja({className:t,...a}){return e.jsx("span",{...a,className:R("hidden items-baseline gap-x-2 sm:flex",t)})}function ba({page:t,current:a=!1,onClick:s,className:n,children:r}){return e.jsx(nt,{plain:!a,outline:a,onClick:()=>s==null?void 0:s(t),"aria-label":`Page ${t}`,"aria-current":a?"page":void 0,className:R("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",a&&"before:bg-subtle-fill",n),children:r??t})}function Na({className:t,...a}){return e.jsx("span",{"aria-hidden":"true",...a,className:R("w-[2.25rem] select-none text-center text-sm text-fg-muted",t),children:"…"})}function va(t,a,s=1){if(a<=7)return Array.from({length:a},(m,g)=>g+1);const n=Math.max(t-s,1),r=Math.min(t+s,a),i=n>2,l=ry+1),"gap",a]}if(i&&!l){const m=3+2*s;return[1,"gap",...Array.from({length:m},(u,y)=>a-m+y+1)]}return[1,"gap",...Array.from({length:r-n+1},(m,g)=>n+g),"gap",a]}const dr=ls(t=>({requestedHash:null,requestChannel:a=>t({requestedHash:a}),clearRequest:()=>t({requestedHash:null})}));function wa(t){if(t.length===0)return[];const a=[];let s=0;for(;s{const l=i===t.length-1,o=n&&r.toUpperCase()===n;return e.jsxs("span",{className:"flex items-center flex-shrink-0",children:[o?e.jsx("span",{className:"px-1 py-0.5 rounded bg-sys-amber/20 text-sys-amber text-[9px] font-medium",children:"You"}):e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill-hover text-fg-secondary",children:r.toUpperCase()}),!l&&e.jsx(it,{className:"w-2.5 h-2.5 text-fg-muted mx-0.5 flex-shrink-0"})]},`${r}-${i}`)})})}const Wt=h.memo(Ta);function qt({channelName:t,onClick:a,active:s,compact:n,className:r}){const i=t.startsWith("#")?t:`#${t}`,l=R("inline-flex items-center flex-shrink-0","font-medium",n?"px-1.5 h-4 leading-4 rounded text-[10px]":"px-2 h-5 leading-5 rounded text-xs",s?"bg-sys-blue/20 text-sys-blue":"bg-sys-blue/10 text-sys-blue",a&&!s&&"hover:bg-sys-blue/20 cursor-pointer",r);return a?e.jsx("button",{type:"button",onClick:a,className:l,children:i}):e.jsx("span",{className:l,children:i})}function Se(t){return{"--data-box-accent":he[t]}}function Kt(t){const a=t.payload_type_name||Ht(t.payload_type??t.type),s=t.route_type_name||Ft(t.route_type??t.route),n=Me[a]??"zinc",r=Ie[s]??"zinc";return{payloadType:a,routeType:s,payloadColor:n,routeColor:r}}function Oe(t){if(!t)return[];if(Array.isArray(t))return t;try{const a=JSON.parse(t);return Array.isArray(a)?a:[]}catch{return[]}}function Yt(t,a){if(a){const s=a(t);return{name:s.name,isCompanion:s.isCompanion,isRepeater:s.isRepeater}}return{name:null,isCompanion:!1,isRepeater:!1}}function Pa({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,onTraceHover:o,traceTag:m,onViewTraceReport:g,dupeGroupPosition:u,isDupeGroupHovered:y=!1,onDupeGroupHover:w,dupeCount:j,getDecodedContent:x,onChannelClick:k}){const B=j?!1:Mt(t.is_duplicate),d=u!==void 0,{payloadType:b,routeType:f,payloadColor:_,routeColor:v}=Kt(t),p=t.packet_origin==="tx_local",E=b==="TRACE",O=Oe(t.original_path),G=Oe(t.forwarded_path),K=G.length>0?G:O,D=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:Y,isRepeater:I}=Yt(t,r);let H=null,$=null,U=null,J=null;if(b==="GRP_TXT"&&x){const S=x(t);S!=null&&S.decrypted&&($=S.senderName,U=S.channelName,J=S.channelHash,S.text&&(H=S.text))}else if(b==="TXT_MSG"&&t.raw_packet)try{const S=Bt.fromHex(t.raw_packet);if(S.success&&S.packet){const ce=Lt(S.packet.payload);ce&&!ce.encrypted&&(H=ce.text)}}catch{}const T=$||(I?null:Y),z=!!T,te=!z&&I&&!!Y,se=!z&&!te&&b==="GRP_TXT"&&!H,c=t.payload_length??t.length??0;t.lbt_attempts;const Z=h.useCallback(()=>{E&&m&&g?g(m):a(t)},[E,m,g,a,t]),q=h.useCallback(()=>{E&&m&&o&&o(m),d&&w&&t.packet_hash&&w(t.packet_hash)},[E,m,o,d,w,t.packet_hash]),ie=h.useCallback(()=>{o&&o(null),w&&w(null)},[o,w]),P=he[_]||he.zinc,F=y,ae=()=>{const S={pointerEvents:"none"};return u==="first"?{...S,borderTop:`2px solid ${P}`,borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:"8px 8px 0 0",inset:"-2px -2px 0 -2px"}:u==="middle"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:"none",borderRadius:0,inset:"0 -2px"}:u==="last"?{...S,borderTop:"none",borderLeft:`2px solid ${P}`,borderRight:`2px solid ${P}`,borderBottom:`2px solid ${P}`,borderRadius:"0 0 8px 8px",inset:"0 -2px -2px -2px"}:{...S,border:`2px solid ${P}`,borderRadius:"8px",inset:"-2px"}};return e.jsxs("div",{onClick:Z,onMouseEnter:q,onMouseLeave:ie,className:R("group relative cursor-pointer","hover:bg-subtle-fill",B&&!y&&"opacity-40",i&&"flash-row",p&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:R("absolute pointer-events-none transition-opacity duration-75",d?F?"opacity-100":"opacity-0":"opacity-0 group-hover:opacity-100"),style:ae()}),e.jsxs("div",{className:"relative flex items-center gap-2 min-[600px]:gap-3 px-2 py-2 min-[600px]:px-3 min-[600px]:py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("div",{className:"relative flex-shrink-0",children:z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(_e(T).cleanName)},children:_e(T).emoji?e.jsx("span",{className:"text-base leading-none",children:_e(T).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(T)})}):te?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):se?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsx("div",{className:"min-w-0",children:z?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:T}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):te?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-semibold text-[13px] text-fg-primary font-sans truncate max-w-[90px]",children:Y}),D&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate",children:D})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"font-bold text-[13px] text-fg-primary font-sans truncate",children:D||"—"}),Y&&e.jsx("div",{className:"hidden min-[900px]:block text-[9px] text-fg-muted truncate max-w-[70px]",children:Y})]})})]}),e.jsxs("div",{className:"flex-1 flex items-center gap-1 min-[600px]:gap-1.5 min-[900px]:gap-2 min-w-0",children:[e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(_),children:b}),p&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se("indigo"),children:"LOCAL"}),j&&j>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",j]}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(v),children:f}),e.jsxs("span",{className:"hidden min-[520px]:inline type-data-xs text-fg-muted flex-shrink-0",children:[c,"B"]}),e.jsx("div",{className:"flex-1 min-w-0 overflow-hidden",children:H||U?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate block flex items-center gap-1",children:[U&&e.jsx(qt,{channelName:U,compact:!0,onClick:k&&J?S=>{S.stopPropagation(),k(J)}:void 0}),H&&e.jsx("span",{className:"italic truncate",children:H})]}):e.jsx(Wt,{path:K,localHash:s})})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("span",{className:"data-box data-box-compact",children:Rt(t.timestamp)}),e.jsx(ze,{rssi:t.rssi,snr:t.snr,compact:!0,showValues:!0,validated:$e(t)})]})]})]})}function Ma({packet:t,onClick:a,localHash:s,neighbors:n,resolveSource:r,isFlashing:i=!1,isTraceHighlighted:l,traceTag:o,onViewTraceReport:m,dupeGroupPosition:g,isDupeGroupHovered:u=!1,onDupeGroupHover:y,dupeCount:w,getDecodedContent:j,onChannelClick:x}){const{payloadType:k,routeType:B,payloadColor:d,routeColor:b}=Kt(t),f=t.packet_origin==="tx_local",_=k==="TRACE",v=w?!1:Mt(t.is_duplicate),p=Oe(t.original_path),E=Oe(t.forwarded_path),O=E.length>0?E:p,G=t._hopCount??O.length,K=t.src_hash?(t.src_hash.startsWith("0x")?t.src_hash.slice(2,6):t.src_hash.slice(0,4)).toUpperCase():null,{name:D,isRepeater:Y}=Yt(t,r);let I=null,H=null,$=null,U=null;if(k==="GRP_TXT"&&j){const P=j(t);P!=null&&P.decrypted&&(H=P.senderName,$=P.channelName,U=P.channelHash,P.text&&(I=P.text))}else if(k==="TXT_MSG"&&t.raw_packet)try{const P=Bt.fromHex(t.raw_packet);if(P.success&&P.packet){const F=Lt(P.packet.payload);F&&!F.encrypted&&(I=F.text)}}catch{}const J=H||(Y?null:D),T=!!J,z=!T&&Y&&!!D,te=!T&&!z&&k==="GRP_TXT"&&!I,se=t.payload_length??t.length??0,c=t.lbt_attempts??0,Z=()=>{_&&o&&m?m(o):a(t)},q=he[d]||he.zinc,ie=()=>{if(!g)return{opacity:0};const P=u?1:.4,F=u?"3px":"2px";return g==="first"?{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:0,borderRadius:"0 9999px 0 0"}:g==="middle"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:0,borderRadius:0}:g==="last"?{backgroundColor:q,opacity:P,width:F,top:0,bottom:"6px",borderRadius:"0 0 9999px 0"}:{backgroundColor:q,opacity:P,width:F,top:"6px",bottom:"6px",borderRadius:"9999px"}};return e.jsxs("div",{onClick:Z,className:R("relative pl-3 pr-2.5 py-2 cursor-pointer","active:bg-subtle-fill-hover",v&&"opacity-40",i&&"flash-row",f&&"bg-sys-indigo/5",l&&"bg-sys-teal/10"),children:[e.jsx("div",{className:"absolute left-0 transition-all",style:ie()}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("div",{className:"relative flex-shrink-0 mt-0.5",children:T?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-1 ring-edge-subtle",style:{backgroundColor:zt(_e(J).cleanName)},children:_e(J).emoji?e.jsx("span",{className:"text-base leading-none",children:_e(J).emoji}):e.jsx("span",{className:"text-white text-[10px] font-bold tracking-tighter",children:$t(J)})}):z?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-blue",children:e.jsx(de,{className:"size-5 text-sys-blue"})}):te?e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center bg-zinc-500/20 ring-1 ring-edge-subtle",children:e.jsx(Gt,{className:"size-4 text-fg-muted"})}):e.jsx(Qt,{packet:t,variant:"avatar",size:"sm"})}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[T?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:J}):z?e.jsx("span",{className:"font-medium text-[14px] text-fg-primary tracking-tight truncate min-w-0",children:D}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"font-semibold text-[14px] text-fg-primary tracking-tight flex-shrink-0",children:K||"—"}),D&&e.jsx("span",{className:"text-[12px] text-fg-muted truncate min-w-0",children:D})]}),e.jsx("div",{className:"flex-1"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(d),children:k}),f&&e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se("indigo"),children:"LOCAL"}),e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:Se(b),children:B}),w&&w>1&&e.jsxs("span",{className:"data-box data-box-compact flex-shrink-0",children:["×",w]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[e.jsx("span",{className:"type-data-xs text-fg-muted w-[28px] text-right",children:t.rssi}),e.jsx(ze,{rssi:t.rssi,compact:!0,showValues:!1,validated:$e(t)})]})]}),e.jsxs("div",{className:"flex items-center gap-1 type-data-xs text-fg-muted",children:[e.jsx("span",{className:"data-box data-box-compact flex-shrink-0",children:Rt(t.timestamp)}),se>0&&e.jsxs("span",{children:[se,"B"]}),c>0&&e.jsxs("span",{className:c>1?"text-sys-amber/60":void 0,children:["LBT:",c]}),t.snr!=null&&e.jsxs("span",{children:[t.snr.toFixed(0),"dB"]}),I||$?e.jsxs("span",{className:"text-[11px] text-fg-secondary truncate flex items-center gap-1 min-w-0",children:[$&&e.jsx(qt,{channelName:$,compact:!0,onClick:x&&U?P=>{P.stopPropagation(),x(U)}:void 0}),I&&e.jsx("span",{className:"italic truncate",children:I})]}):G>0?e.jsx(Wt,{path:O,localHash:s}):null]})]})]})]})}const Ba=h.memo(Pa),La=h.memo(Ma);function Ra(t,a,s,n,r=!1){const i=t.toUpperCase(),l=[],o=s&&Xe(i,s);o&&l.push(s);for(const j of Object.keys(a))Xe(i,j)&&l.push(j);if(r&&o&&s&&l.length===1)return{matches:l,probability:1,bestMatch:s};if(r&&o&&l.length>1){const j=l.filter(x=>x!==s);if(j.length===1)return{matches:l,probability:1,bestMatch:j[0]}}const m=l.length>0?1/l.length:0,g=[...l].sort();let u=null,y=-1;if(g.length===1)u=g[0];else if(g.length>1&&n){for(const j of g){const x=n.get(j),k=x?typeof x=="number"?x:x.combinedScore:0;k>y&&(y=k,u=j)}u||(u=g[0])}else g.length>0&&(u=g[0]);let w=m;if(l.length>1&&n&&y>0){let j=0;for(const x of l){const k=n.get(x);j+=k?typeof k=="number"?k:k.combinedScore:0}j>0&&(w=Math.min(.95,y/j))}return{matches:l,probability:w,bestMatch:u}}function Ha(t,a,s,n){const i=(s-t)*Math.PI/180,l=(n-a)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t*Math.PI/180)*Math.cos(s*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 6371e3*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))}function Fa(t){return t<100?1:t<500?.9:t<1e3?.7:t<5e3?.5:t<1e4?.3:.1}const Da=h.lazy(()=>is(()=>import("./PathMapMapLibre-XWZ321IJ.js"),__vite__mapDeps([0,1,2,3,4,5,6])));function Aa(t,a,s,n,r=!1,i,l,o){const m=cs(a);let g;l&&(g=os(l,t,{position:o,isLastHop:r}).confidence);const{matches:u,probability:y}=Ra(t,m,n,i,r),w=u.length,j=[],x=t.toUpperCase(),k=s&&s.latitude!==void 0&&s.longitude!==void 0&&(s.latitude!==0||s.longitude!==0);for(const d of u){if(n&&Xe(x,n)&&d===n&&k&&s){j.push({hash:d,name:s.name||"Local Node",latitude:s.latitude,longitude:s.longitude,probability:r?1:y,isLocal:!0});continue}const b=m[d];b!=null&&b.latitude&&(b!=null&&b.longitude)&&!(b.latitude===0&&b.longitude===0)&&j.push({hash:d,name:b.node_name||b.name||"Unknown",latitude:b.latitude,longitude:b.longitude,probability:y,isLocal:!1,isDirectNeighbor:b.zero_hop===!0})}const B=j.length;if(B===1)j[0].probability=g??1;else if(B>1)if(g!==void 0&&g>0){const d=j[0];d.probability=g;const b=1-g,f=B-1;j.slice(1).forEach(_=>{_.probability=b/f})}else{let d=0;const b=j.map(f=>{if(f.isLocal)return{candidate:f,score:1};const _=i==null?void 0:i.get(f.hash);let v=.5;if(k&&s){const E=Ha(s.latitude,s.longitude,f.latitude,f.longitude);v=Fa(E)}let p;return _?p=v*.3+_.hopConsistencyScore*.3+_.frequencyScore*.4:(p=v,f.isDirectNeighbor&&(p=Math.max(p,.8))),d+=p,{candidate:f,score:p}});if(d>0)b.forEach(({candidate:f,score:_})=>{f.probability=Math.min(.95,_/d)});else{const f=1/B;j.forEach(_=>_.probability=f)}}return{candidates:j,totalMatches:w}}function Ea(t,a,s,n,r,i){if(!t||t.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const l=t.length-1,o=t.map((u,y)=>{const w=y===l,j=t.length-y,{candidates:x,totalMatches:k}=Aa(u,a,s,n,w,r,i,j),B=x.length>0?Math.max(...x.map(d=>d.probability)):0;return{prefix:u,candidates:x,confidence:B,totalMatches:k}}),m=o.reduce((u,y)=>y.confidence===0?0:u*y.confidence,1),g=o.some(u=>u.candidates.length>0);return{hops:o,overallConfidence:m,hasValidPath:g}}function Ia(t){return`${(t*100).toFixed(0)}%`}function za(t){return t>=1?"text-sys-green":t>=.5?"text-sys-indigo":t>=.25?"text-signal-poor":t>0?"text-sys-red":"text-fg-muted"}function $a(t,a,s){let n;return a===0?n=s.muted:t>=1?n=s.success:t>=.5?n=s.secondary:t>=.25?n=s.poor:t>0?n=s.danger:n=s.muted,{color:n}}class Ua extends h.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?e.jsxs("div",{className:"h-[200px] flex items-center justify-center text-fg-muted",children:[e.jsx(Je,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function Ve({path:t,neighbors:a,localNode:s,localHash:n,srcHash:r,dstHash:i,neighborAffinity:l,prefixLookup:o,hubNodes:m,traceSnr:g,advertiserSource:u}){const[y,w]=h.useState(null),j=h.useMemo(()=>{if(!u)return null;const f=u.nodeType==="wardrive";return{prefix:u.prefix||"??",candidates:[{hash:u.publicKey||u.prefix||"source",name:u.name,latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isWardrive:f}],confidence:1,totalMatches:1,isSource:!0}},[u]),x=h.useMemo(()=>{if(u||!r)return null;const f=Ee(r),_=a[r];if((_==null?void 0:_.latitude)&&(_==null?void 0:_.longitude)&&!(_.latitude===0&&_.longitude===0))return{prefix:f,candidates:[{hash:r,name:_.node_name||_.name||"Source",latitude:_.latitude,longitude:_.longitude,probability:1,isLocal:!1,isDirectNeighbor:_.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const p=(_==null?void 0:_.node_name)||(_==null?void 0:_.name)||r.slice(0,8);return{prefix:f,candidates:[{hash:r,name:p,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[u,r,a]),k=h.useMemo(()=>{const f=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!f||f==="00"||f==="0000000000000000")&&s&&n){const G=Ee(n),K=s.latitude!==0||s.longitude!==0;return{prefix:G,candidates:[{hash:n,name:s.name||"Local Node",latitude:K?s.latitude:0,longitude:K?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const v=Ee(i);if(n&&i===n&&s){const G=s.latitude!==0||s.longitude!==0;return{prefix:v,candidates:[{hash:i,name:s.name||"Local Node",latitude:G?s.latitude:0,longitude:G?s.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const p=a[i];if((p==null?void 0:p.latitude)&&(p==null?void 0:p.longitude)&&!(p.latitude===0&&p.longitude===0))return{prefix:v,candidates:[{hash:i,name:p.node_name||p.name||"Destination",latitude:p.latitude,longitude:p.longitude,probability:1,isLocal:!1,isDirectNeighbor:p.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const O=(p==null?void 0:p.node_name)||(p==null?void 0:p.name)||i.slice(0,8);return{prefix:v,candidates:[{hash:i,name:O,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,a,s,n]),B=h.useMemo(()=>Ea(t,a,s,n,l,o),[t,a,s,n,l,o]),d=h.useMemo(()=>{const f=[];j?f.push(j):x&&f.push(x),f.push(...B.hops),k&&f.push(k);const _=f.reduce((p,E)=>E.confidence===0?0:p*E.confidence,1),v=f.some(p=>p.candidates.some(E=>E.latitude!==0||E.longitude!==0));return{hops:f,overallConfidence:_,hasValidPath:v}},[j,x,B,k]),b=h.useMemo(()=>{const f=getComputedStyle(document.documentElement);return{success:f.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:f.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:f.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:f.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:f.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return d.hasValidPath?e.jsxs("div",{className:"h-full flex flex-col space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Path Confidence:"}),e.jsx("span",{className:za(d.overallConfidence),children:Ia(d.overallConfidence)}),e.jsx("button",{className:"text-fg-muted hover:text-fg-secondary transition-colors",title:"Confidence is calculated based on how many known nodes match each path prefix. Multiple matches reduce confidence due to collision probability.",children:e.jsx(qs,{className:"w-3 h-3"})})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-green"}),e.jsx("span",{className:"text-fg-muted",children:"Exact"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-sys-indigo"}),e.jsx("span",{className:"text-fg-muted",children:"Multi"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-fg-muted"}),e.jsx("span",{className:"text-fg-muted",children:"Unknown"})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:e.jsx(Ua,{children:e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"h-full bg-elevated flex items-center justify-center text-fg-muted text-sm",children:"Loading map..."}),children:e.jsx(Da,{resolvedPath:d,localNode:s,hubNodes:m,hoveredHopIndex:y,onHoverHop:w,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:d.hops.map((f,_)=>{var G,K,D;const v=f.isSource===!0,p=f.isDestination===!0,E=y===_;let O;return v?O=`Source: ${((G=f.candidates[0])==null?void 0:G.name)||"Unknown"}`:p?O=`Destination: ${((K=f.candidates[0])==null?void 0:K.name)||"Unknown"}`:f.totalMatches===0?O="No matching nodes found":f.totalMatches===1?O=`Exact match: ${((D=f.candidates[0])==null?void 0:D.name)||"Unknown"}`:O=`${f.totalMatches} possible matches (${(f.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:R("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",E?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",v&&"border border-sys-green/30",p&&"border border-sys-blue/30"),title:O,onMouseEnter:()=>w(_),onMouseLeave:()=>w(null),children:[v&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),p&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:$a(f.confidence,f.totalMatches,b),children:f.prefix}),!v&&!p&&f.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",f.totalMatches]}),!v&&!p&&f.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},_)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const Ke=16;function Ge(t){return t.match(/.{1,2}/g)||[]}function je(t){return t!==null&&t.startsWith("payload:")}const Te={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` var(--depth-stroke-tl), var(--depth-stroke-br) `,selectionBorderWidth:2},st={type:"tween",duration:.25,ease:[.25,.1,.25,1]};function Oa(t,a){return t?`inset 0 0 0 ${Te.selectionBorderWidth}px ${he[a]}`:Te.cardRestShadow}function Va(t,a){return t?a:`color-mix(in srgb, ${a} ${Te.hexRestOpacity}%, transparent)`}function Ga({segments:t,selectedSegment:a,onSegmentClick:s}){const[n,r]=h.useState(null),[i,l]=h.useState(null),o=t.some(u=>u.id!==void 0)&&s,m=[];for(const u of t){const y=Ge(u.hex);for(const w of y)m.push({byte:w.toUpperCase(),color:u.color,id:u.id})}const g=[];for(let u=0;u{const w=u.length{const d=B===u.length-1,b=w&&d,f=he[x],p=(k?n===k:i===x)||!!(k&&a===k);return e.jsx("span",{className:`w-[1.75rem] text-xs text-center py-0.5 font-mono select-text ${o?"cursor-pointer":""}`,style:{backgroundColor:Va(p,f),color:p?"rgba(255,255,255,0.95)":f,transition:p?"none":"background-color 0.15s ease-out, color 0.15s ease-out",touchAction:"manipulation",...b?{borderRadius:"0 0.375rem 0.375rem 0"}:{}},onMouseEnter:()=>{k?r(k):l(x)},onMouseLeave:()=>{r(null),l(null)},onClick:()=>k&&(s==null?void 0:s(k)),onTouchStart:()=>{k?r(k):l(x)},onTouchEnd:()=>{r(null),l(null)},children:j},B)})},y)})})}function Qa({rawHex:t,hexSegments:a,selectedSegment:s,onSegmentClick:n}){const[r,i]=h.useState(!1),l=h.useCallback(async()=>{await us(t.toUpperCase()),i(!0),setTimeout(()=>i(!1),2e3)},[t]);return e.jsxs("div",{className:"bg-inset radius-inner p-6 relative depth-stroke-inset",children:[e.jsx(Ga,{segments:a,selectedSegment:s,onSegmentClick:n}),e.jsx("button",{onClick:l,className:"absolute bottom-3 right-3 flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg bg-subtle-fill-hover hover:bg-subtle-fill-strong text-fg-muted hover:text-fg-secondary transition-all text-xs font-sans",title:"Copy raw packet hex",children:r?e.jsxs(e.Fragment,{children:[e.jsx(ps,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{className:"text-sys-green",children:"Copied"})]}):e.jsxs(e.Fragment,{children:[e.jsx(rt,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Copy"})]})})]})}function Wa(t,a){const s=[];let n=0;const r=a.slice(0,64);s.push({id:"payload:publicKey",title:"Public Key",color:"pink",hex:r,startByte:n,endByte:n+31,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:t.publicKey.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Ed25519 public key (32 bytes)"})]})}),n+=32;const i=a.slice(64,72);s.push({id:"payload:timestamp",title:"Timestamp",color:"orange",hex:i,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:i.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.timestamp," (",le(t.timestamp),")"]})]})}),n+=4;const l=a.slice(72,200);s.push({id:"payload:signature",title:"Signature",color:"teal",hex:l,startByte:n,endByte:n+63,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:t.signature.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Ed25519 signature (64 bytes)"})]})}),n+=64;const o=a.slice(200,202);if(s.push({id:"payload:flags",title:"Flags",color:"blue",hex:o,startByte:n,endByte:n,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(X,{size:"standard",copy:!0,children:["0x",t.flags.toString(16).padStart(2,"0").toUpperCase()]}),e.jsx("p",{className:"text-xs text-fg-primary mt-1",children:t.flagsDescription}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Node Type: ",t.nodeType]})]})}),n+=1,t.latitude!==void 0){const m=a.slice(n*2,n*2+8);s.push({id:"payload:latitude",title:"Latitude",color:"green",hex:m,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:m.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.latitude.toFixed(6),"°"]})]})}),n+=4}if(t.longitude!==void 0){const m=a.slice(n*2,n*2+8);s.push({id:"payload:longitude",title:"Longitude",color:"indigo",hex:m,startByte:n,endByte:n+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:m.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.longitude.toFixed(6),"°"]})]})}),n+=4}if(t.name){const m=a.slice(n*2),g=m.length/2;s.push({id:"payload:name",title:"Name",color:"amber",hex:m,startByte:n,endByte:n+g-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:m.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:['"',t.name,'"']})]})})}return s}function qa(t,a){return[{id:"payload:crc",title:"CRC",color:"green",hex:a.slice(0,8),startByte:0,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(X,{size:"standard",copy:!0,children:["0x",t.crc]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"CRC32 of acknowledged packet"})]})}]}function Ka(t,a){const s=[];s.push({id:"payload:channelHash",title:"Channel Hash",color:"blue",hex:a.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(X,{size:"standard",copy:!0,children:["0x",t.channelHash]}),t.channelName&&e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:["Channel: ",t.channelName]})]})}),t.macHex&&s.push({id:"payload:mac",title:"MAC",color:"indigo",hex:a.slice(2,6),startByte:1,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:t.macHex.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Truncated HMAC-SHA256"})]})});const n=a.slice(6);return n&&s.push({id:"payload:ciphertext",title:t.decrypted?"Message":"Ciphertext",color:t.decrypted?"green":"zinc",hex:n,startByte:3,endByte:3+n.length/2-1,decoded:t.decrypted?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-fg-primary",children:['"',t.text,'"']}),t.senderName&&e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:["From: ",t.senderName]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:n.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"AES-128-ECB encrypted"})]})}),s}function Ya(t,a){const s=[];s.push({id:"payload:channelHash",title:"Channel Hash",color:"blue",hex:a.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(X,{size:"standard",copy:!0,children:["0x",t.channelHash]}),t.channelName&&e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:["Channel: ",t.channelName]})]})}),t.macHex&&s.push({id:"payload:mac",title:"MAC",color:"indigo",hex:a.slice(2,6),startByte:1,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:t.macHex.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Truncated HMAC-SHA256"})]})});const n=a.slice(6);return n&&s.push({id:"payload:ciphertext",title:t.decrypted?"Decrypted Data":"Encrypted Data",color:t.decrypted?"green":"zinc",hex:n,startByte:3,endByte:3+n.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:(t.decryptedHex||n).toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[t.dataLength," bytes",t.decrypted?"":" (AES-128-ECB encrypted)"]})]})}),s}function Xa(t,a){const s=[];if(s.push({id:"payload:pathLength",title:"Path Length",color:"blue",hex:a.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",children:t.pathLength}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[t.pathLength," hop",t.pathLength!==1?"s":""]})]})}),t.path.length>0){const n=a.slice(2,2+t.pathLength*2);s.push({id:"payload:path",title:"Path Hops",color:"amber",hex:n,startByte:1,endByte:t.pathLength,decoded:e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:t.path.map((r,i)=>e.jsxs("span",{className:"flex items-center gap-1",children:[i>0&&e.jsx(ue,{className:"w-3 h-3 text-fg-muted"}),e.jsx(M,{color:"amber",className:"font-mono",children:r})]},i))})})})}if(t.extraType!=null){const n=1+t.pathLength;s.push({id:"payload:extraType",title:"Extra Type",color:"indigo",hex:a.slice(n*2,n*2+2),startByte:n,endByte:n,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",children:t.extraTypeName??`0x${t.extraType.toString(16).padStart(2,"0")}`}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Bundled payload type"})]})})}if(t.extraData){const n=1+t.pathLength+1,r=a.slice(n*2);r&&s.push({id:"payload:extraData",title:"Extra Data",color:"indigo",hex:r,startByte:n,endByte:n+r.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:r.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[r.length/2," bytes"]})]})})}return s}function Za(t,a){const s=[];s.push({id:"payload:crc",title:"Trace Tag",color:"blue",hex:a.slice(0,8),startByte:0,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(X,{size:"standard",copy:!0,children:["0x",t.traceTag]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique trace request identifier"})]})}),s.push({id:"payload:mac",title:"Auth Code",color:"indigo",hex:a.slice(8,16),startByte:4,endByte:7,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:t.authCode}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Authentication/verification code"})]})}),s.push({id:"payload:flags",title:"Flags",color:"amber",hex:a.slice(16,18),startByte:8,endByte:8,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(X,{size:"standard",copy:!0,children:["0x",t.flags.toString(16).toUpperCase().padStart(2,"0")]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:t.flags===0?"No flags set":`Flags: ${t.flags.toString(2).padStart(8,"0")}b`})]})});const n=a.slice(18);return n&&s.push({id:"payload:path",title:"Target Path",color:"indigo",hex:n,startByte:9,endByte:9+n.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:t.pathHashes.map((r,i)=>{const l=t.snrValues[i],o=l!==void 0?Gs(l):"zinc";return e.jsxs("span",{className:"flex items-center gap-1",children:[i>0&&e.jsx(ue,{className:"w-3 h-3 text-fg-muted"}),e.jsx(M,{color:"indigo",className:"font-mono",children:r}),l!==void 0&&e.jsxs(M,{color:o,className:"font-mono",children:[l>=0?"+":"",Number.isInteger(l)?l:l.toFixed(1),"dB"]})]},i)})}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[t.pathHashes.length," target ",t.pathHashes.length===1?"hop":"hops",t.snrValues.length>0&&` • ${t.snrValues.length} SNR ${t.snrValues.length===1?"value":"values"} collected`,t.isComplete&&" • ✓ Complete"]})]})}),s}function Ja(t,a){const s=[];s.push({id:"payload:msgId",title:"Message ID",color:"blue",hex:a.slice(0,4),startByte:0,endByte:1,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:t.messageId.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique message identifier"})]})}),s.push({id:"payload:partNum",title:"Part Number",color:"amber",hex:a.slice(4,6),startByte:2,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:t.partNumber}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"0-indexed part number"})]})}),s.push({id:"payload:totalParts",title:"Total Parts",color:"orange",hex:a.slice(6,8),startByte:3,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(X,{size:"standard",copy:!0,children:t.totalParts}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:["Part ",t.partNumber+1," of ",t.totalParts]})]})});const n=a.slice(8);return n&&s.push({id:"payload:partData",title:"Part Data",color:"cyan",hex:n,startByte:4,endByte:4+n.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:n.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[n.length/2," bytes"]})]})}),s}function en(t,a){switch(t.type){case"advert":return Wa(t,a);case"ack":return qa(t,a);case"grp_txt":return Ka(t,a);case"grp_data":return Ya(t,a);case"path":return Xa(t,a);case"trace":return Za(t,a);case"multipart":return Ja(t,a);default:return[{id:"payload:ciphertext",title:"Raw Data",color:"zinc",hex:a,startByte:0,endByte:a.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-[11px] text-fg-secondary break-all p-2 rounded bg-body/50 font-mono",children:a.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[a.length/2," bytes"]})]})}]}}function tn(t){return t.map(a=>({id:a.id,hex:a.hex,color:a.color}))}function sn({bits:t,field:a,value:s,binary:n}){const r=()=>{if(a==="Payload Type"){const i=Me[s]||"zinc";return e.jsx(M,{color:i,children:s})}if(a==="Route Type"){const i=Ie[s]||"zinc";return e.jsx(M,{color:i,children:s})}return e.jsx("span",{className:"text-sm text-fg-primary",children:s})};return e.jsxs("tr",{children:[e.jsx("td",{className:"py-1.5 text-xs text-fg-muted tabular-nums",children:t}),e.jsx("td",{className:"py-1.5 text-sm text-fg-secondary",children:a}),e.jsx("td",{className:"py-1.5",children:r()}),e.jsx("td",{className:"py-1.5 type-data-xs text-sys-cyan",children:n})]})}function jt({id:t,title:a,color:s,hexBytes:n,startByte:r,endByte:i,isSelected:l,children:o}){const m=n?Ge(n):[];return e.jsxs(oe.div,{layout:"position",layoutId:t,transition:st,className:"w-full min-w-0 overflow-hidden radius-inner p-4 sm:p-5 space-y-4",style:{backgroundColor:Te.cardRestBg,boxShadow:Oa(l,s)},children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-0.5 min-w-0",children:[e.jsx(M,{color:s,children:a}),m.length>0&&m.length<=16&&m.map((g,u)=>e.jsx(M,{color:s,className:"font-mono",children:g.toUpperCase()},u))]}),e.jsxs("span",{className:"type-data-xs text-fg-muted flex-shrink-0",children:["Bytes ",r,"-",i]})]}),e.jsx("div",{className:"min-w-0 overflow-hidden",children:o})]})}function an({advert:t,timestamp:a}){const s=a?le(a):le(t.timestamp);return e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"rounded-2xl overflow-hidden bg-sys-indigo/10",style:{backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[e.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shadow-lg",style:{background:"linear-gradient(135deg, var(--sys-indigo) 0%, var(--sys-blue) 100%)"},children:e.jsx(de,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg font-semibold text-fg-primary font-sans truncate leading-tight",children:t.name||"Unknown Node"}),e.jsx("p",{className:"text-sm text-fg-muted font-sans mt-0.5",children:t.nodeType})]})]}),e.jsx("div",{className:"mx-4 border-t border-edge-subtle"}),e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[t.latitude!==void 0&&t.longitude!==void 0&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ue,{className:"w-4 h-4 text-sys-indigo flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-fg-secondary font-mono",children:[t.latitude.toFixed(5),"°, ",t.longitude.toFixed(5),"°"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:"w-4 h-4 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:s})]})]})]})})}function nn({decoded:t,timestamp:a}){const s=a?le(a):"Unknown";return e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"rounded-2xl overflow-hidden bg-sys-teal/10",style:{backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},children:[e.jsxs("div",{className:"px-4 pt-4 pb-3 flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl flex items-center justify-center shadow-lg",style:{background:"linear-gradient(135deg, var(--sys-teal) 0%, var(--sys-cyan) 100%)"},children:e.jsx(Zs,{className:"w-6 h-6 text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:"text-lg font-semibold text-fg-primary font-sans truncate leading-tight",children:t.channelName||"Channel Data"}),e.jsxs("p",{className:"text-sm text-fg-muted font-sans mt-0.5",children:[t.dataLength," bytes • ",t.decrypted?"Decrypted":"Encrypted"]})]})]}),e.jsx("div",{className:"mx-4 border-t border-edge-subtle"}),e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ot,{className:"w-4 h-4 text-sys-teal flex-shrink-0"}),e.jsxs("span",{className:"text-sm text-fg-secondary font-sans",children:["Channel: ",e.jsxs("span",{className:"font-mono",children:["0x",t.channelHash]})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:"w-4 h-4 text-sys-teal flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:s})]}),t.decrypted&&t.decryptedHex&&e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle",children:[e.jsx("p",{className:"type-micro text-fg-muted mb-1 font-sans",children:"Decrypted Data"}),e.jsx("div",{className:"max-w-full overflow-x-auto",children:e.jsx(X,{size:"compact",copy:!0,className:"inline-block",children:e.jsx("span",{className:"break-all text-xs",children:t.decryptedHex.toUpperCase()})})})]})]})]})})}function rn({decoded:t,timestamp:a,isLoading:s=!1,onDecrypted:n}){const r=a?le(a):"Unknown",[i,l]=h.useState(""),[o,m]=h.useState(!1),[g,u]=h.useState(null),[y,w]=h.useState(!1),j=h.useCallback(async()=>{if(!(!i.trim()||!t.ciphertextHex||!t.macHex)){m(!0),u(null);try{const x=parseInt(t.channelHash,16),k=ht(t.macHex),B=ht(t.ciphertextHex),d=await gs(i.trim(),x,k,B);if(d.success){const b=d.result.plaintext,f=new TextDecoder("utf-8",{fatal:!1}).decode(b.slice(5)),_=f.indexOf(": "),v={...t,channelName:d.result.channelName,decrypted:!0,timestamp:b[0]|b[1]<<8|b[2]<<16|b[3]<<24,flags:b[4],senderName:_>0?f.slice(0,_):void 0,text:_>0?f.slice(_+2):f};n==null||n(v),l(""),w(!1)}else u(d.error)}catch(x){u(x instanceof Error?x.message:"Unknown error")}finally{m(!1)}}},[i,t,n]);return s?e.jsx("div",{className:"mb-4",children:e.jsxs("div",{className:"rounded-xl p-4 sm:p-5",style:{backgroundColor:"color-mix(in srgb, var(--elevated) 60%, var(--body))",boxShadow:` diff --git a/frontend/dist/assets/PacketObservatory-CoKryHKi.js b/frontend/dist/assets/PacketObservatory-CGzUdg1y.js similarity index 99% rename from frontend/dist/assets/PacketObservatory-CoKryHKi.js rename to frontend/dist/assets/PacketObservatory-CGzUdg1y.js index 2f04b72a..72a20265 100644 --- a/frontend/dist/assets/PacketObservatory-CoKryHKi.js +++ b/frontend/dist/assets/PacketObservatory-CGzUdg1y.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-pGK8Y5O7.js","assets/index-CvSa8h-C.js","assets/node-types-BJsOTMm_.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); -import{bY as O,r as T,ed as Fe,ee as Ee,ef as Oe,eg as ze,by as Be,eh as Ie,ei as Ge,ej as Ke,ek as Ve,bx as Ne,_ as ue,el as Ue,em as we,bC as pe,j as e,en as G,eo as K,ep as V,dS as xe,eq as qe,x as M,bK as We,bV as Ce,c2 as Ye,er as Ze,es as Xe,et as Je,eu as Qe,ev as et,ew as Q,ex as tt,ey as st,ez as nt,eA as he,ad as me,a8 as Se,e as rt,eB as at,G as lt,K as ot,eC as ct,bk as it,dc as dt}from"./index-CvSa8h-C.js";import{usePipelineStore as Y}from"./usePipelineStore-pGK8Y5O7.js";import{e as Te,p as ut,a as pt,A as I,S as U,c as se,f as E,K as i,H as A,B as xt,R as F,T as d,P as re,h as ht,i as S,C as _e,s as ee,j as mt}from"./primitives-BahnzDua.js";import{m as ke,i as gt}from"./node-types-BJsOTMm_.js";function ft(t){const s=t.type??t.payload_type,r=t.duplicates??[],c=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const x=[t.rssi,...r.map(g=>g.rssi).filter(g=>g!=null)],m=[t.snr,...r.map(g=>g.snr).filter(g=>g!=null)];x.length>1&&(n=[Math.min(...x),Math.max(...x)]),m.length>1&&(l=[Math.min(...m),Math.max(...m)])}const o=s===O.TRACE;return{isDuplicate:c,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:o}}function bt(t,s,r){const c={traceTag:null,siblingCount:0,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:[],thisPathLen:0,minPathLen:0,firstHopPrefix:null};let a=t._traceTag;if(!a&&t.payload&&(a=Te(t.payload)),!a)return{...c,evidence:["no traceTag — cannot correlate"]};const n=s.get(a)??[],l=N=>N.path_length!=null?N.path_length:Array.isArray(N.original_path)?N.original_path.length:0,o=l(t),x=n.length>0?Math.min(...n.map(l)):o,m=t.payload?t.payload.slice(18):"",g=m.length>=2?m.slice(0,2).toUpperCase():null,u=[];if(u.push(`traceTag: ${a}`),u.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return u.push("packet_origin = tx_local → we initiated this trace"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return u.push(`sibling (hash ${v.packet_hash}) has packet_origin = tx_local`),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),g){if(u.push(`first hop in target path: ${g}`),o===0)return u.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),u.push("initiator is a direct RF neighbor"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"min_path_len",confidence:"speculative",inferredSrc:null,inferredName:null,evidence:[...u,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:o,minPathLen:x,firstHopPrefix:g};const f=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===g);if(f.length===1){const[k,$]=f[0],h=$.name||$.node_name||null;return u.push(`first hop ${g} → unique neighbor: ${h??k}`),u.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:g,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}else f.length>1?u.push(`first hop ${g} matches ${f.length} neighbors (ambiguous)`):u.push(`first hop ${g} is not a known neighbor`)}return u.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-pGK8Y5O7.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-CvSa8h-C.js").then(t=>t.fJ),__vite__mapDeps([1,3])).then(t=>{ce=t})},0);const He={advertSender:null,advertNodeType:null,advertFlags:null,advertHasLocation:null,advertHasName:null,advertName:null,advertLatitude:null,advertLongitude:null,channelHash:null,byteLength:void 0,hopCount:0,isZeroHop:!0,preComputed:!1};function yt(t,s){const r=t.type??t.payload_type,c=Ne(r),a=Be(t.route),n=r===O.ADVERT,l=r===O.TRACE,o=r===O.PATH,x=r===O.GRP_TXT||r===O.GRP_DATA,m=Ie(t.snr,t.rssi),g=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ve(t.route),f=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${f}`:f,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=gt(r),p=s.advertNodeType!=null?ke(s.advertNodeType):"unknown",_=y!=="unknown"?y:p,H=t.packet_origin??"rx",C=Math.floor(Date.now()/1e3)-t.timestamp,D=C<10?"live":C<300?"recent":C<3600?"warm":C<86400?"stale":"historic",L=t.path_length??(Array.isArray(t.original_path)?t.original_path.length:void 0),P=Array.isArray(t.original_path)&&t.original_path.length>0,R=L??0,b=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),w=ft(t);return{pType:r,payloadTypeName:c,routeTypeName:a,isAdvert:n,isTrace:l,isPath:o,isGrp:x,signalClass:g,routeClass:k,isFlood:u,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:$,inferredType:y,advertType:p,effectiveType:_,origin:H,age:D,pathLen:L,pathAvail:P,pathHopCount:R,byteLen:b,dupeAnalysis:w}}function jt(t){var f,k,$,h,y,p;const s=pt(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:c}=s;if(r.length<2||!ne||!ce)return null;const a=ne.usePipelineStore.getState().srcHashResolverMap,n=ne.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,o=ce.useStore.getState().stats,x=(o==null?void 0:o.neighbors)??{},m=o==null?void 0:o.local_hash,g=(k=(f=o==null?void 0:o.config)==null?void 0:f.repeater)==null?void 0:k.latitude,u=(h=($=o==null?void 0:o.config)==null?void 0:$.repeater)==null?void 0:h.longitude,v=Object.keys(x).length>0?Ue([],x,m,g,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=ge(H,_,L,a,v),R=[H,..._+20?N:null}function ge(t,s,r,c,a){if(s===0){const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.8};if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}}else{if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function vt(t){var l;const s=t.raw_packet;if(!s||s.length<2)return null;const r=s.replace(/\s/g,""),c=Math.floor(r.length/2),a=((l=r.match(/.{1,2}/g))==null?void 0:l.join(" "))??"";let n="";for(let o=0;o=32&&x<=126?String.fromCharCode(x):"·"}return{hexBytes:a,utf8:n,byteCount:c}}function Nt(t){const s=new Map;let r=0,c="";for(const a of t){if((a.type??a.payload_type)!==O.TRACE)continue;r++,c=a.packet_hash;const l=a._traceTag??(a.payload?Te(a.payload):null);if(!l)continue;let o=s.get(l);o||(o=[],s.set(l,o)),o.push(a)}return{index:s,fingerprint:`${r}:${c}`}}function wt(t,s,r){const c=T.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=T.useMemo(()=>t?vt(t):null,[t]),n=T.useMemo(()=>{if(!s||s.length<4)return c.current.parse=0,c.current.decode=0,null;const h=performance.now(),y=ut(s),p=performance.now()-h;return y?(c.current.parse=p,c.current.decode=0,{protocolPacket:y.packet,display:{headerFields:y.headerFields,transportCodesHex:y.transportCodesHex,pathLengthHex:y.pathLengthHex,pathDataHex:y.pathDataHex,payloadHex:y.payloadHex,payloadByteOffset:y.payloadStartByte,pathByteOffset:y.pathByteOffset,pathLenByteOffset:y.pathLenByteOffset},decoded:y.decoded,error:null}):(c.current.parse=p,c.current.decode=0,{protocolPacket:null,display:null,decoded:null,error:"Packet.fromHex() returned failure"})},[s]),l=T.useMemo(()=>{if(!t)return c.current.enrich=0,He;const h=performance.now();if(t._advertSender!==void 0)return c.current.enrich=performance.now()-h,{advertSender:t._advertSender??null,advertNodeType:t._advertNodeType??null,advertFlags:t._advertFlags??null,advertHasLocation:t._advertHasLocation??null,advertHasName:t._advertHasName??null,advertName:t._advertName??null,advertLatitude:t._advertLatitude??null,advertLongitude:t._advertLongitude??null,channelHash:t._channelHash??null,byteLength:t._byteLength,hopCount:t._hopCount??0,isZeroHop:t._isZeroHop??!0,preComputed:!0};const y=t.type??t.payload_type,p=Fe(s,y),_=Ee(s,y),H=Oe(s,t),C=ze(t);return c.current.enrich=performance.now()-h,{...p,channelHash:_,byteLength:H,...C,preComputed:!1}},[t,s]),o=T.useRef({fingerprint:"",index:new Map}),x=T.useMemo(()=>{const h=performance.now(),{index:y,fingerprint:p}=Nt(r);return c.current.traceIndex=performance.now()-h,p===o.current.fingerprint?o.current.index:(o.current={fingerprint:p,index:y},y)},[r]),m=T.useMemo(()=>{const h=c.current;return{parse:h.parse,decode:h.decode,enrich:h.enrich,traceIndex:h.traceIndex,total:h.parse+h.decode+h.enrich+h.traceIndex}},[n,l,x]);if(!t)return null;const g=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",u=(n==null?void 0:n.protocolPacket)??null,v=u?u.payloadVersion:null,N=v===0,f=v===1,k=yt(t,l);let $=null;return k.isTrace&&($=jt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:g,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:f,enrichment:l,traceTagIndex:x,analysis:k,traceHopDetail:$,timing:m}}function ae({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:`w-16 shrink-0 font-medium ${l.active?"text-fg-primary":"text-fg-muted"}`,children:l.label}),l.detail&&e.jsx("span",{className:l.active?"text-fg-primary/70":"text-fg-muted",children:l.detail})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}function Ct({tokens:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-muted shrink-0",children:l.fn}),e.jsxs("span",{className:l.active?"text-fg-primary":"text-fg-muted",children:["(",l.value??"",")"]})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}const St={0:"border-l-sys-green",1:"border-l-sys-blue",2:"border-l-sys-teal",3:"border-l-sys-purple"};function le({stage:t,name:s,fn:r,verdict:c,timeMs:a,skipped:n,skipReason:l,children:o}){const x=St[t]??"";return e.jsx(e.Fragment,{children:e.jsx(G,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${x}`,children:[e.jsxs(K,{className:"px-3 py-2 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs font-bold text-sys-blue shrink-0",children:t}),e.jsx("span",{className:"font-mono text-xs font-medium text-fg-primary truncate",children:s}),r&&!c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-zinc-500/20 text-fg-muted",children:"N/A"}),a!=null&&!n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})]})]}),e.jsx(V,{children:e.jsx("div",{className:"px-3 pb-3 font-mono text-xs",children:n?e.jsx("p",{className:"text-fg-muted italic",children:l??"Not applicable for this packet type"}):o})})]})})})}function Tt(t,s){return s?"manual":t._stripped?"bulk-tier":qe.isConnected()?"ws-push":"rest-poll"}const _t={connected:"green",degraded:"amber",offline:"red"};function kt({packet:t,isSynthetic:s}){const r=xe(g=>g.wsState),c=xe(g=>g.health),a=Tt(t,s),l=!!t._stripped?"WARM":"HOT",o=[{label:"ws-push",detail:"wsConnected && onPacket()",active:a==="ws-push",color:"green"},{label:"rest-poll",detail:"!wsConnected, 3s interval",active:a==="rest-poll",color:"amber"},{label:"catchup",detail:"wsReconnected, delta > 50",active:a==="catchup",color:"amber"},{label:"bulk-tier",detail:"user extends time range → gzip",active:a==="bulk-tier",color:"blue"},{label:"manual",detail:"hex input — no transport",active:a==="manual",color:"zinc"}],x=[{fn:"transport",value:a,group:"transport",color:a==="ws-push"?"green":a==="bulk-tier"?"blue":"amber"},{fn:"tier",value:l,group:"transport",color:"blue"},{fn:"wsState",value:r,group:"transport",color:r==="connected"?"green":"amber"},{fn:"health",value:c,group:"transport",color:_t[c]}],m=s?"manual hex input":`${a} (${c})`;return e.jsx(le,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:m,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(U,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(ae,{options:o,nextFn:"ingest()"}),e.jsx(se,{tokens:x})]})})})}function q({start:t,end:s}){const r=s!=null&&s!==t?`[${t}..${s}]`:`[${t}]`;return e.jsx("span",{className:"text-fg-muted text-[9px] font-mono mr-1 select-none",children:r})}const Ht={advert:"decodeAdvert()",ack:"decodeAck()",path:"decodePath()",trace:"decodeTraceWithSnr()",txt_msg:"decodeTextMessage()",grp_txt:"decodeGroupText()",grp_data:"decodeGroupData()",multipart:"decodeMultipart()",control:"decodeControl()",req:"decodeRequest()",response:"decodeResponse()",anon_req:"decodeAnonReq()",generic:"decodeGeneric()"};function $t({rawHex:t,display:s,protocolPacket:r,parseError:c,parseTimeMs:a,payloadVersion:n,isV1:l,isV2:o}){return e.jsx("dl",{className:"space-y-0.5",children:s&&r&&t?e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse — Packet.fromHex()"}),a>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})}),e.jsxs(i,{label:"header byte",children:[e.jsx(q,{start:0}),e.jsx(A,{value:t.slice(0,2)})," ",e.jsx(xt,{value:parseInt(t.slice(0,2),16)})]}),s.headerFields.map(x=>e.jsx(i,{label:` ${x.field}`,children:e.jsx(F,{raw:e.jsxs("span",{className:"text-[10px]",children:["bits[",x.bits,"] = ",x.binary]}),children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:x.value})})},x.field)),e.jsx(i,{label:" version",children:n!=null?e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(d,{fn:"payloadVer",value:`${n}`,color:"amber"}),e.jsx(M,{color:l?"green":o?"blue":"zinc",children:l?"v1":o?"v2":`v${n}`}),l&&e.jsx("span",{className:"text-fg-muted text-[10px]",children:"1-byte hashes, 2-byte MAC"}),o&&e.jsx("span",{className:"text-sys-blue text-[10px]",children:"2-byte hashes, 4-byte MAC (speculative)"})]}):e.jsx("span",{className:"text-fg-muted",children:"unknown"})}),e.jsx(E,{title:"Wire Framing"}),e.jsx(i,{label:"transportCodes",children:s.transportCodesHex?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:1,end:4}),e.jsx(d,{fn:"transport",value:s.transportCodesHex,color:"amber"})]}):e.jsx("span",{className:"text-fg-muted",children:"N/A (non-transport route)"})}),e.jsx(i,{label:"pathLen",children:e.jsx(F,{raw:e.jsxs(e.Fragment,{children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(A,{value:s.pathLengthHex})]}),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(d,{fn:"pathLen",value:`${r.pathLen} hop${r.pathLen!==1?"s":""}`,color:"amber"})]})})}),e.jsx(i,{label:"path",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.pathLen>0&&e.jsx(q,{start:s.pathByteOffset,end:s.pathByteOffset+r.pathLen-1}),e.jsx(re,{hops:r.pathHexArray,hexPrefix:s.pathDataHex||void 0})]})}),e.jsx(i,{label:"payloadLen",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.payloadByteOffset,end:s.payloadByteOffset+s.payloadHex.length/2-1}),e.jsx(d,{fn:"payloadLen",value:`${s.payloadHex.length/2} bytes`,color:"amber"})]})}),e.jsx(i,{label:"payloadHex",children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber break-all",children:s.payloadHex})})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse"}),e.jsxs(i,{label:"result",children:[e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:"Skipped"}),e.jsx("span",{className:"ml-1 text-fg-muted",children:c??"No raw_packet (warm-tier)"})]})]})})}function Dt({decoded:t,packet:s}){if(!t)return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode"}),e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:"No decoded payload"})]});const r=Ht[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode — decodePayload()"}),e.jsx(U,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(E,{}),e.jsx(Lt,{decoded:t,packet:s})]})})]})}function Lt({decoded:t,packet:s}){var r;switch(t.type){case"advert":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"publicKey",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px] break-all",children:t.publicKey}),children:e.jsx(d,{fn:"publicKey",value:t.publicKey,color:"green"})})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(F,{raw:e.jsx(A,{value:t.flags}),children:e.jsx(d,{fn:"flags",value:t.flagsDescription,color:"green"})})}),e.jsx(i,{label:"nodeType",children:e.jsx(d,{fn:"nodeType",value:t.nodeType,color:"green"})}),t.latitude!=null&&e.jsx(i,{label:"latitude",children:e.jsx(d,{fn:"lat",value:t.latitude.toFixed(6),color:"green"})}),t.longitude!=null&&e.jsx(i,{label:"longitude",children:e.jsx(d,{fn:"lon",value:t.longitude.toFixed(6),color:"green"})}),t.name&&e.jsx(i,{label:"name",children:e.jsx(d,{fn:"name",value:t.name,color:"green"})})]});case"ack":return e.jsx(i,{label:"crc",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const c=s!=null&&s.src_hash?s.src_hash.replace(/^0x/i,"").slice(0,2).toUpperCase():null;return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"traceTag",children:e.jsx(d,{fn:"traceTag",value:t.traceTag,color:"green"})}),e.jsx(i,{label:"authCode",children:e.jsx(d,{fn:"authCode",value:String(t.authCode),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(A,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(re,{hops:t.pathHashes.map(a=>a.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),e.jsx(i,{label:"complete",children:t.isComplete?e.jsxs("span",{className:"text-sys-green",children:["✓ all ",t.pathHashes.length," hops reported SNR"]}):e.jsxs("span",{className:"text-sys-amber",children:["✗ ",t.snrValues.length,"/",t.pathHashes.length," hops reported"]})}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1 text-[10px]",children:"Directional Edge SNR — per-hop link quality"}),t.snrValues.length===0?e.jsx("p",{className:"text-fg-muted italic text-[11px] ml-2",children:"No SNR values in path field"}):e.jsx("div",{className:"space-y-0.5 ml-2",children:t.snrValues.map((a,n)=>{var g,u,v,N,f;const l=((g=t.pathHashes[n])==null?void 0:g.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(f=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:f.spreading_factor,m=we(a,x);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted w-3 text-right",children:n}),e.jsx("span",{className:"text-fg-primary",children:o}),e.jsx("span",{className:"text-fg-muted",children:"→"}),e.jsx("span",{className:"text-fg-primary",children:l}),e.jsx("span",{className:"text-fg-muted",children:"@"}),e.jsxs("span",{className:"font-bold text-sys-green",children:[a>0?"+":"",a.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:m})]},n)})})]})]})}case"path":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"pathLength",children:e.jsx(d,{fn:"pathLength",value:String(t.pathLength),color:"green"})}),e.jsx(i,{label:"path",children:t.path&&t.path.length>0?e.jsx(re,{hops:t.path.map(c=>c.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),t.extraType!=null&&e.jsx(i,{label:"extraType",children:e.jsx(d,{fn:"extraType",value:t.extraTypeName??String(t.extraType),color:"purple"})}),t.extraData&&e.jsxs(i,{label:"extraData",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.extraData}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.extraData.length/2,"B)"]})]})]});case"txt_msg":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),e.jsx(i,{label:"encrypted",children:e.jsx(d,{fn:"encrypted",value:String(t.encrypted),color:"green"})})]});case"grp_txt":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),t.channelName&&e.jsx(i,{label:"channelName",children:e.jsx(d,{fn:"channel",value:t.channelName,color:"green"})}),e.jsx(i,{label:"decrypted",children:e.jsx(d,{fn:"decrypted",value:String(t.decrypted),color:"green"})}),t.text&&e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),t.senderName&&e.jsx(i,{label:"senderName",children:e.jsx(d,{fn:"sender",value:t.senderName,color:"green"})}),t.macCorrupted&&e.jsx(i,{label:"macCorrupted",children:e.jsx(d,{fn:"macCorrupted",value:"true",color:"green"})})]});case"grp_data":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),e.jsx(i,{label:"dataLength",children:t.dataLength}),e.jsx(i,{label:"decrypted",children:String(t.decrypted)})]});case"multipart":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"messageId",children:t.messageId}),e.jsxs(i,{label:"part",children:[t.partNumber+1," / ",t.totalParts]})]});case"control":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"controlType",children:e.jsx(F,{raw:e.jsx(A,{value:t.controlType}),children:e.jsx(d,{fn:"controlType",value:t.subtypeName,color:"green"})})}),e.jsx(i,{label:"subtype",children:e.jsx(d,{fn:"subtype",value:`0x${t.subtype.toString(16).padStart(2,"0")}`,color:"green"})}),t.nodeTypeName&&e.jsxs(i,{label:"nodeType",children:[e.jsx(d,{fn:"nodeType",value:t.nodeTypeName,color:"green"}),e.jsxs("span",{className:"text-fg-muted text-[10px] ml-1",children:["(flags & 0x0F = 0x",(r=t.nodeType)==null?void 0:r.toString(16).padStart(2,"0"),")"]})]}),t.snrDb!=null&&e.jsxs(i,{label:"snr",children:[e.jsxs("span",{className:"font-bold text-sys-green",children:[t.snrDb>0?"+":"",t.snrDb.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:t.snrDb>=5?"strong":t.snrDb>=0?"fair":"weak"})]}),t.tag&&e.jsx(i,{label:"tag",children:e.jsx(d,{fn:"tag",value:t.tag,color:"green"})}),t.publicKey&&e.jsxs(i,{label:"publicKey",children:[e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.publicKey}),e.jsx(M,{color:t.publicKeyFull?"green":"amber",children:t.publicKeyFull?"32B full":`${t.publicKey.length/2}B prefix`})]}),t.typeFilter!=null&&e.jsx(i,{label:"typeFilter",children:e.jsx(F,{raw:e.jsx(A,{value:t.typeFilter}),children:e.jsx(d,{fn:"typeFilter",value:t.typeFilterDescription??"none",color:"green"})})}),t.prefixOnly!=null&&e.jsx(i,{label:"prefixOnly",children:e.jsx(d,{fn:"prefixOnly",value:String(t.prefixOnly),color:"green"})}),t.since!=null&&e.jsx(i,{label:"since",children:e.jsx(d,{fn:"since",value:t.since===0?"all (0)":String(t.since),color:"green"})}),!t.nodeTypeName&&t.typeFilter==null&&t.dataLength>0&&e.jsxs(i,{label:"data",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.dataHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.dataLength,"B)"]})]})]});case"req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"response":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"anon_req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"senderPubKey",children:e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.senderPublicKey})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"generic":return e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"payloadType",children:[e.jsx(ht,{value:t.payloadType})," (",t.payloadTypeName,")"]}),e.jsx(i,{label:"length",children:t.length}),e.jsx(i,{label:"rawHex",children:e.jsx("span",{className:"break-all",children:t.rawHex})})]});default:return e.jsx("p",{className:"text-fg-muted",children:"Unknown decoded type"})}}function Pt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,c=r===Ze||r===Xe,a=T.useMemo(()=>{if(!c||!t)return null;const p=t.payload;return p.length<4?null:{channelHash:p[0],mac:p.slice(1,3),ciphertext:p.slice(3)}},[t,c]),[n,l]=T.useState("pending"),[o,x]=T.useState([]),[m,g]=T.useState(0);T.useEffect(()=>{if(!a){l(null);return}let p=!1;return(async()=>{const H=performance.now(),C=await Je(a.channelHash,a.mac,a.ciphertext);p||(l(C),g(performance.now()-H));const D=await Qe(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,f]=T.useState(null),[k,$]=T.useState(!1),h=T.useCallback(async()=>{if(!(!a||!u.trim())){$(!0);try{const p=await We(u.trim(),a.channelHash,a.mac,a.ciphertext);if(p.success){const _=new TextDecoder("utf-8",{fatal:!1}).decode(p.result.plaintext.slice(5));f({success:!0,text:_})}else f({success:!1,error:p.error})}catch(p){f({success:!1,error:String(p)})}finally{$(!1)}}},[a,u]),y=Ce(s);return!c||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"C. Decrypt — tryDecryptGroupMessage()"}),m>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:m<1?`${(m*1e3).toFixed(0)}µs`:`${m.toFixed(2)}ms`})}),e.jsx(U,{prefix:"tryDecryptGroupMessage",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"channelHash",children:e.jsx(d,{fn:"channelHash",value:`0x${a.channelHash.toString(16).toUpperCase().padStart(2,"0")}`,color:"teal"})}),e.jsx(i,{label:"mac",children:e.jsx(d,{fn:"mac",value:Array.from(a.mac).map(p=>p.toString(16).padStart(2,"0")).join(""),color:"teal"})}),e.jsx(i,{label:"cipherLen",children:e.jsx(d,{fn:"cipherLen",value:`${a.ciphertext.length}B`,color:"teal"})}),e.jsx(i,{label:"candidates",children:e.jsx(d,{fn:"candidates",value:o.length>0?`${o.length} names`:"0",color:o.length>0?"teal":"zinc"})}),o.length>0&&e.jsxs("details",{className:"mt-1",children:[e.jsx("summary",{className:"text-fg-muted cursor-pointer hover:text-fg-primary text-[10px]",children:"show candidate names"}),e.jsx("div",{className:"mt-1 text-[10px] text-fg-muted break-all max-h-24 overflow-y-auto",children:o.join(", ")})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"Result:"}),n==="pending"?e.jsx("p",{className:"text-fg-muted italic",children:"decrypting…"}):n?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:n.channelName,color:"teal"})}),e.jsx(i,{label:"plaintext",children:e.jsx(d,{fn:"plaintext",value:new TextDecoder("utf-8",{fatal:!1}).decode(n.plaintext.slice(5)).trim()||"(empty)",color:"teal"})}),e.jsx(i,{label:"macValid",children:e.jsx(d,{fn:"macValid",value:n.macCorrupted?"false":"true",color:"teal"})})]}):e.jsxs(i,{label:"decrypt",children:[e.jsx(d,{fn:"decrypt",value:"failed",color:"red"}),e.jsx("span",{className:"text-fg-muted ml-1",children:"channel not in known list"})]})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"testChannelName() — manual test:"}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("input",{type:"text",value:u,onChange:p=>{v(p.target.value),f(null)},onKeyDown:p=>p.key==="Enter"&&h(),placeholder:"channel name",className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-40"}),e.jsx("button",{onClick:h,disabled:k||!u.trim(),className:"px-2 py-1 rounded text-[10px] font-mono bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 disabled:opacity-40 transition-colors",children:k?"…":"Try"})]}),N&&e.jsx("div",{className:"mt-1",children:N.success?e.jsx(i,{label:"result",children:e.jsx(d,{fn:"plaintext",value:N.text??"(empty)",color:"teal"})}):e.jsx(i,{label:"error",children:e.jsx(d,{fn:"error",value:N.error??"unknown",color:"red"})})})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"useDecodedMessage() store result:"}),y?y.decoded?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:y.decoded.channelName??"?",color:"teal"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:y.decoded.text,color:"teal"})})]}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"failed",color:"red"})}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"pending",color:"zinc"})})]})]})})]})}function Mt(t){const{rawHex:s,display:r,protocolPacket:c,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m,packetHash:g,packet:u}=t,v=!!s&&s.length>=4;return e.jsxs(G,{children:[e.jsx(K,{className:"w-full mt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[10px] font-mono text-fg-muted",children:"🔬"}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-fg-muted",children:"Wire Inspection"}),e.jsx("span",{className:"text-[9px] text-fg-muted/50",children:"observatory diagnostic — not a runtime stage"})]})}),e.jsx(V,{children:e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-lg p-3 space-y-1 bg-surface/30",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/50 mb-2",children:"The backend parsed these fields server-side. This panel verifies the wire-level encoding client-side."}),v?e.jsxs(e.Fragment,{children:[e.jsx($t,{rawHex:s,display:r,protocolPacket:c,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m}),e.jsx(Dt,{decoded:a,packet:u}),e.jsx(Pt,{protocolPacket:c,packetHash:g})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function fe(t){if(!t)return[{fn:"decode",value:"no raw_packet",group:"decode",color:"zinc"}];switch(t.type){case"advert":{const s=t,r=[{fn:"decode.nodeType",value:s.nodeType,group:"decode",color:"blue"}];return s.name&&r.push({fn:"decode.name",value:s.name,group:"decode",color:"blue"}),s.latitude!=null&&s.longitude!=null&&r.push({fn:"decode.location",value:`${s.latitude.toFixed(4)}, ${s.longitude.toFixed(4)}`,group:"decode",color:"blue"}),r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:"blue"}),r}case"trace":{const s=t;return[{fn:"decode.traceTag",value:s.traceTag,group:"decode",color:"blue"},{fn:"decode.hops",value:s.pathHashes.length>0?s.pathString:"empty",group:"decode",color:"blue"},{fn:"decode.snr",value:s.snrValues.length>0?`${s.snrValues.length} values`:"none",group:"decode",color:s.snrValues.length>0?"blue":"zinc"},{fn:"decode.complete",value:s.isComplete?"yes":"partial",group:"decode",color:s.isComplete?"green":"amber"}]}case"path":{const s=t,r=[{fn:"decode.pathLength",value:String(s.pathLength),group:"decode",color:"blue"},{fn:"decode.path",value:s.path.length>0?s.pathString:"empty",group:"decode",color:"blue"}];return s.extraType!=null&&r.push({fn:"decode.extraType",value:s.extraTypeName??String(s.extraType),group:"decode",color:"purple"}),s.extraData&&r.push({fn:"decode.extraData",value:`${s.extraData.length/2}B`,group:"decode",color:"purple"}),r}case"ack":return[{fn:"decode.crc",value:t.crc,group:"decode",color:"blue"}];case"grp_txt":return[{fn:"decode.channelHash",value:t.channelHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:"true — decrypt at cascade",group:"decode",color:"zinc"}];case"grp_data":{const s=t;return[{fn:"decode.channelHash",value:s.channelHash,group:"decode",color:"blue"},{fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"}]}case"txt_msg":{const s=t;return[{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:s.encrypted?"true":"false",group:"decode",color:s.encrypted?"zinc":"green"},...s.encrypted?[]:[{fn:"decode.text",value:s.text,group:"decode",color:"blue"}]]}case"multipart":{const s=t;return[{fn:"decode.part",value:`${s.partNumber+1}/${s.totalParts}`,group:"decode",color:"blue"},{fn:"decode.msgId",value:s.messageId,group:"decode",color:"blue"}]}case"control":{const s=t,r=[{fn:"decode.subtype",value:s.subtypeName,group:"decode",color:"blue"}];return s.nodeTypeName&&r.push({fn:"decode.nodeType",value:s.nodeTypeName,group:"decode",color:"blue"}),s.snrDb!=null&&r.push({fn:"decode.snr",value:`${s.snrDb>0?"+":""}${s.snrDb.toFixed(1)} dB`,group:"decode",color:"blue"}),s.tag&&r.push({fn:"decode.tag",value:s.tag,group:"decode",color:"blue"}),s.publicKey&&r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:s.publicKeyFull?"green":"blue"}),s.typeFilter!=null&&r.push({fn:"decode.typeFilter",value:s.typeFilterDescription??`0x${s.typeFilter.toString(16)}`,group:"decode",color:"blue"}),s.prefixOnly!=null&&r.push({fn:"decode.prefixOnly",value:String(s.prefixOnly),group:"decode",color:"blue"}),!s.nodeTypeName&&!s.tag&&(r.push({fn:"decode.subtypeFlags",value:`0x${s.subtypeFlags.toString(16)}`,group:"decode",color:"blue"}),r.push({fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"})),r}case"req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"response":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"anon_req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.senderPubKey",value:s.senderPublicKey,group:"decode",color:"green"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"generic":return[{fn:"decode.raw",value:`${t.length}B`,group:"decode",color:"zinc"}];default:return[]}}function Rt({packet:t,pipeline:s,rawHex:r,traceTagIndex:c,neighbors:a}){const{enrichment:n,timing:l,display:o,protocolPacket:x,decoded:m,parseError:g,payloadVersion:u,isV1:v,isV2:N,analysis:f}=s,$=(t.type??t.payload_type)===et,h=f.dupeAnalysis,y=T.useRef(0),p=T.useMemo(()=>{if(!$)return null;const D=performance.now(),L=bt(t,c,a);return y.current=performance.now()-D,L},[t,c,a,$]),_=l.enrich+y.current,H=[];f.byteLen&&H.push(`${f.byteLen}B`),H.push(f.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):f.pathHopCount>0&&H.push(`${f.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const C=H.join(" — ");return e.jsxs(le,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:C,timeMs:_,children:[e.jsx(Mt,{rawHex:r,display:o,protocolPacket:x,decoded:m,parseError:g,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(U,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(M,{color:"green",children:"PacketCache"}):e.jsx(M,{color:"amber",children:"computed"}),e.jsx("span",{className:"text-[10px] text-fg-muted ml-1.5",children:n.preComputed?"pre-enriched by real pipeline":"synthetic — computed on the fly"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 mb-1",children:[e.jsx(d,{fn:"_byteLength",value:n.byteLength!=null?`${n.byteLength}B`:void 0,color:"blue"}),e.jsx(d,{fn:"_hopCount",value:String(n.hopCount),color:"blue"}),e.jsx(d,{fn:"_isZeroHop",value:String(n.isZeroHop),color:n.isZeroHop?"green":"blue"}),n.isZeroHop&&e.jsx(M,{color:"blue",children:"direct"}),n.channelHash!=null&&e.jsx(d,{fn:"_channelHash",value:n.channelHash,color:"blue"}),$&&t._traceTag&&e.jsx(d,{fn:"_traceTag",value:t._traceTag,color:"blue"})]}),n.advertSender||n.advertNodeType!=null||n.advertName!=null?e.jsxs("div",{className:"mt-1 mb-1",children:[e.jsx("p",{className:"text-[10px] text-sys-blue font-medium mb-0.5",children:"ADVERT Enrichment"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1",children:[n.advertSender&&e.jsx(d,{fn:"_advertSender",value:n.advertSender.slice(0,16)+"…",color:"blue"}),n.advertNodeType!=null&&e.jsx(d,{fn:"_advertNodeType",value:ke(n.advertNodeType),color:"blue"}),n.advertName!=null&&e.jsx(d,{fn:"_advertName",value:n.advertName,color:"blue"}),n.advertFlags!=null&&e.jsx(d,{fn:"_advertFlags",value:`0x${n.advertFlags.toString(16).padStart(2,"0")}`,color:"blue"}),n.advertHasLocation!=null&&e.jsx(d,{fn:"_advertHasLocation",value:String(n.advertHasLocation),color:"blue"}),n.advertHasName!=null&&e.jsx(d,{fn:"_advertHasName",value:String(n.advertHasName),color:"blue"}),n.advertLatitude!=null&&n.advertLongitude!=null&&e.jsx(d,{fn:"location",value:`${n.advertLatitude.toFixed(4)}, ${n.advertLongitude.toFixed(4)}`,color:"blue"})]})]}):e.jsx("p",{className:"text-[10px] text-fg-muted/30 mb-1",children:"ADVERT fields: N/A (non-ADVERT packet)"}),e.jsx(E,{title:"Payload Decode"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${m?"bg-sys-blue":"bg-zinc-500/40"}`}),e.jsx("span",{className:"font-mono text-[10px] font-medium text-fg-primary",children:"decodePayload()"}),e.jsx("span",{className:"text-[9px] text-fg-muted",children:"sync — wire data only, no crypto"})]}),e.jsx("div",{className:"ml-3",children:m?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:fe(m).map((D,L)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:D.fn,value:D.value,color:D.color})},L))}):e.jsx(S,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"dupe:"}),h.isDuplicate?e.jsx(d,{fn:"is_duplicate",value:"true",color:"purple"}):e.jsx(S,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(S,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),p&&e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"TRACE SRC:"}),p.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:p.inferredSrc,color:"purple"}),p.inferredName&&e.jsx(d,{fn:"name",value:p.inferredName,color:"purple"})]}):e.jsx(S,{children:"unresolvable"}),e.jsx(_e,{color:"purple",children:p.method}),e.jsxs(S,{children:["(",p.confidence,")"]}),e.jsxs(S,{children:["siblings=",p.siblingCount]})]})]}),(()=>{const D=f.pType!=null?`0x${f.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,L=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=fe(m),R=f.signalClass==="excellent"||f.signalClass==="good"?"green":f.signalClass==="fair"?"amber":"red",b=f.senderTier==="pubkey"?"green":f.senderTier==="prefix"?"amber":f.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:f.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:f.routeTypeName,raw:L,group:"wire",color:"blue"},{fn:"src_hash",value:t.src_hash||void 0,group:"wire",color:"blue"},{fn:"rssi",value:`${t.rssi}dBm`,group:"wire",color:"blue"},{fn:"snr",value:`${t.snr}dB`,group:"wire",color:"blue"},{fn:"_byteLength",value:f.byteLen?`${f.byteLen}B`:void 0,group:"enrichment",color:"blue"},{fn:"_hopCount",value:String(n.hopCount),group:"enrichment",color:"blue"},{fn:"_isZeroHop",value:String(n.isZeroHop),group:"enrichment",color:"blue"},{fn:"_advertSender",value:n.advertSender||void 0,group:"enrichment",color:"blue"},{fn:"_advertNodeType",value:f.advertType!=="unknown"?f.advertType:void 0,group:"enrichment",color:"blue"},{fn:"_advertName",value:n.advertName||void 0,group:"enrichment",color:"blue"},{fn:"_channelHash",value:n.channelHash||void 0,group:"enrichment",color:"blue"},...P,{fn:"is_duplicate",value:String(h.isDuplicate),group:"analysis",color:"purple"},p!=null&&p.inferredSrc?{fn:"traceSrc",value:p.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:f.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:f.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:f.senderTier,group:"analysis",color:b},{fn:"_origin",value:f.origin,group:"analysis",color:f.origin==="tx_local"?"green":f.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:f.pathAvail?`${f.pathHopCount} hops`:"none",group:"analysis",color:f.pathAvail?"green":"zinc"},{fn:"_age",value:f.age,group:"analysis",color:f.age==="live"||f.age==="recent"?"green":"zinc"},...h.dupeCount>0?[{fn:"_dupeCount",value:`×${h.dupeCount}`,group:"analysis",color:"purple"},...h.rssiRange?[{fn:"_multipath",value:`Δ${Math.abs(h.rssiRange[1]-h.rssiRange[0])}dB`,group:"analysis",color:Math.abs(h.rssiRange[1]-h.rssiRange[0])>6?"amber":"green"}]:[]]:[],...t.lbt_attempts!=null?[{fn:"_lbt",value:`${t.lbt_attempts} attempt${t.lbt_attempts!==1?"s":""}`,group:"analysis",color:(t.lbt_attempts??0)>1?"amber":"green"}]:[],...t.drop_reason?[{fn:"_dropReason",value:t.drop_reason,group:"analysis",color:"red"}]:[]];return e.jsx(se,{tokens:w})})()]})})]})}function be(t){switch(t){case"excellent":return"green";case"good":return"green";case"fair":return"amber";case"poor":return"red";case"critical":return"red";default:return"zinc"}}function ye(t){return`${Math.round(t*100)}%`}function je(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function At({hops:t}){return t.length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle/40",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/40 uppercase tracking-widest font-mono mb-1.5",children:"per-hop trace inspection"}),e.jsx("div",{className:"space-y-1",children:t.map(s=>e.jsx(U,{prefix:`trace.hop[${s.hopIndex}]`,children:e.jsxs("div",{className:"border border-edge-subtle/40 rounded px-2 py-1.5",children:[e.jsxs(i,{label:"link",children:[e.jsx(re,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(_e,{color:be(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(F,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:be(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:je(s.fromName,s.fromHash,s.fromPrefix),color:s.fromHash?s.fromConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:je(s.toName,s.toHash,s.toPrefix),color:s.toHash?s.toConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(se,{label:"trace contributes",tokens:Ft(t)})]})}function Ft(t){const s=t.reduce((n,l)=>n+(l.fromHash?1:0)+(l.toHash?1:0),0),r=t.length*2,c=r-s,a=t.length>0?t.reduce((n,l)=>n+l.snrRaw,0)/t.length:0;return[{fn:"hops",value:String(t.length),group:"wire",color:"blue"},{fn:"resolved",value:`${s}/${r}`,group:"worker",color:"green"},...c>0?[{fn:"ghosts",value:String(c),group:"worker",color:"purple"}]:[],{fn:"avgSnr",value:`${a.toFixed(1)} dB`,group:"analysis",color:a>=5?"green":a>=0?"amber":"red"}]}function Et(t){if(!t)return"never";const s=Math.floor((Date.now()-t)/1e3);return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:`${Math.floor(s/3600)}h ago`}function Ot(t){if(!t)return[];const s=t.decoded;if(!s)return[{fn:"decrypt.result",value:"failed",group:"crypto",color:"red"}];if(!s.decrypted)return[{fn:"decrypt.result",value:"no key match",group:"crypto",color:"zinc"}];const r=[];return s.channelName&&r.push({fn:"decrypt.channelName",value:s.channelName,group:"crypto",color:"teal"}),s.senderName&&r.push({fn:"decrypt.senderName",value:s.senderName,group:"crypto",color:"teal"}),s.text&&r.push({fn:"decrypt.text",value:s.text,group:"crypto",color:"teal"}),s.timestamp&&r.push({fn:"decrypt.timestamp",value:new Date(s.timestamp*1e3).toISOString().slice(11,19),group:"crypto",color:"teal"}),s.macCorrupted&&r.push({fn:"decrypt.macCorrupted",value:"true",group:"crypto",color:"amber"}),r}function zt({packet:t,decrypted:s,pipeline:r}){var b;const c=Q(w=>w.isComputing),a=Q(w=>w.lastUpdated),n=Q(w=>w.lastComputeTimeMs),l=Q(w=>w.topology.edges.length),o=Q(w=>w.topology.discoveredNodes.length),x=tt(),m=st(),g=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),f=me(w=>w.initialDecodeComplete),k=t.type??t.payload_type,$=k===O.GRP_TXT||k===O.GRP_DATA,h=k===O.TRACE,y=k===O.PATH,p=$,_=[{label:"full",detail:"all GRP_TXT → decryption worker",active:p&&f,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!f,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!p,color:"zinc"}],H=Ot(s),C=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,D=c?"running":`${l}e ${o}g`,L=u?"running":`${v}n`,P=p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A",R=`topo ${c?"○":"✓"} ${D} · spark ${u?"○":"✓"} ${L} · decrypt ${P}`;return e.jsx(le,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:R,children:e.jsx(U,{prefix:"cascade",children:e.jsxs("div",{className:"space-y-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 py-1.5 text-[11px] font-mono",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${c?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"topology"}),e.jsxs("span",{className:"text-fg-muted",children:[l,"e ",o,"g"]}),(h||y)&&e.jsx("span",{className:"text-sys-green text-[9px]",children:"↑signal"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"sparkline"}),e.jsxs("span",{className:"text-fg-muted",children:[v,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.isDecoding?"bg-sys-amber animate-pulse":p?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:p?"text-sys-teal":"text-fg-muted",children:p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A"})]})]}),e.jsxs(G,{defaultOpen:h||y,children:[e.jsx(K,{className:"text-[10px] w-full border-t border-edge-subtle pt-1.5",children:e.jsx("span",{className:"font-mono text-fg-muted/50",children:"topology detail…"})}),e.jsx(V,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:c?"running":"idle",color:c?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Et(a),color:"zinc"}),n>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",n<1e3?`${n.toFixed(0)}ms`:`${(n/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(l),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(o),color:"purple"})]}),m&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(x.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(x.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(x.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${x.meanSnr.toFixed(1)} dB`,color:x.meanSnr>=5?"green":x.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${x.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(x.avgConfidence*100)}%`,color:"zinc"})]}),h&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(x.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(x.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(x.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(x.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(x.qualityCounts.critical),color:"red"})]}),g.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(g.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(g.confirmedLinks.length),color:"teal"})]})]}),h&&(r==null?void 0:r.traceHopDetail)&&e.jsx(At,{hops:r.traceHopDetail})]})})]}),p&&e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"mode",children:e.jsx(ae,{options:_,nextFn:"queueDecryption()"})}),e.jsx(i,{label:"result",children:e.jsx(d,{fn:"decrypt",value:C?"decrypted":s?"failed":"pending",color:C?"teal":s?"red":"zinc"})}),C&&e.jsx("div",{className:"mt-1 flex flex-wrap gap-x-1.5 gap-y-1",children:H.map((w,oe)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:w.fn,value:w.value,color:w.color})},oe))})]})}),(()=>{const w=[{fn:"topology.edges",value:String(l),group:"worker",color:"green"},{fn:"topology.ghostNodes",value:String(o),group:"worker",color:"purple"},{fn:"sparkline.nodes",value:`${v}`,group:"worker",color:"green"},...m?[{fn:"trace.directedLinks",value:String(x.totalDirectedLinks),group:"worker",color:"teal"},{fn:"trace.meanSnr",value:`${x.meanSnr.toFixed(1)} dB`,group:"worker",color:"teal"}]:[],...H];return e.jsx(se,{tokens:w})})()]})})})}function Bt(t,s,r,c){var n;const a=t.src_hash?Se(t.src_hash):"";if(t._advertSender&&s.hash&&s.confident)return{tier:1,label:"_advertSender → pubkey",detail:"ADVERT carried full 32-byte public key — definitive match"};if(c&&s.confident&&((n=s.name)==null?void 0:n.toLowerCase())===c.toLowerCase())return{tier:1.5,label:"decrypt.senderName → nameToHash",detail:`Decrypted sender name “${c}” matched neighbor — high-confidence`};if(a&&r.crossClassPrefixes.has(a))return{tier:2,label:"cross-class prefix",detail:"Prefix has mixed types (repeater + non-repeater); payload type narrows to one class"};if(s.confident){const l=r.prefixIndex.get(a);return(l==null?void 0:l.length)===1?{tier:3,label:"single candidate",detail:"Only one node matches this prefix — unambiguous"}:{tier:3,label:"resolver",detail:"Multi-signal scoring selected best candidate from collision set"}}return{tier:4,label:"ambiguous",detail:"Cannot confidently resolve — multiple same-class candidates, insufficient scoring separation"}}function It(t,s){const r=t.original_path??t.forwarded_path,c=new Set;if(r&&Array.isArray(r))for(const a of r){const n=String(a).toUpperCase().slice(0,2);n.length>=2&&n!==s&&c.add(n)}return c}function Gt(t,s,r,c,a,n,l){const o=Math.floor(Date.now()/1e3),x=new Map(r.map(m=>[m.hash,m]));return t.map(m=>{const g=s[m.hash],u=x.get(m.hash);let v=!0,N="";c!=="unknown"?m.type!=="unknown"&&m.type!==c?(v=!1,N=`${m.type} ≠ required ${c}`):m.type===c?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const f=!!(g!=null&&g.zero_hop),k=(g==null?void 0:g.last_seen)??0;let $=0;if(f&&k>0){const b=(o-k)/3600;$=50*Math.exp(-b/l)}let h=0;if(k>0){const b=(o-k)/3600;h=Math.exp(-b/n)}const y=h*20,p=!!(g!=null&&g.latitude&&(g!=null&&g.longitude)&&(g.latitude!==0||g.longitude!==0)),_=p?5:0,H=(u==null?void 0:u.advertCount)??0,C=Math.min(H*2,30),D=(u==null?void 0:u.forwarderPrefixes.size)??0,L=Math.min(D*3,15);let P=0;if(u&&u.totalForwarderObservations>0&&a.size>0){let b=0;for(const w of a)u.forwarderPrefixes.has(w)&&b++;P=b/a.size}const R=$+y+_+C+L;return{hash:m.hash,name:m.name,type:m.type,roleCompatible:v,roleReason:N,zeroHop:f,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,g)=>g.total-m.total)}function Kt({packet:t,pipeline:s,resolved:r,resolveTimeMs:c,advertName:a,neighbors:n,decrypted:l}){var ie,de;const o=Y(j=>j.neighborContext),x=Y(j=>j.topologyProfiles),m=Y(j=>j.config),{analysis:g}=s,u=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Se(t.src_hash):"",N=v?o.prefixIndex.get(v)??[]:[],f=v?x.get(v)??[]:[],k=g.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=g.inferredType,y=g.advertType,p=g.effectiveType,_=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((ie=l==null?void 0:l.decoded)==null?void 0:ie.senderName)??null,C=Bt(t,u,o,H),D=T.useMemo(()=>It(t,v),[t,v]),L=g.pathLen,P=T.useMemo(()=>Gt(N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours]),R=P.filter(j=>!j.roleCompatible),b=P.filter(j=>j.roleCompatible),w=t._advertSender?o.pubKeyMap.get(t._advertSender)??null:null,oe=C.tier===1,De=[{fn:"src_hash",value:v||"",active:!!v,color:"blue"},{fn:"_advertSender",value:t._advertSender?t._advertSender.slice(0,12)+"…":"",active:!!t._advertSender,color:"blue"},{fn:"_advertNodeType",value:_?`0x${_}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:L!=null?L===0?"zero-hop":String(L):"",active:L!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!w,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!w,color:"zinc"}],Pe=[{label:"payload",detail:`inferDeviceType(0x${$}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:_?`mapAdvertTypeCode(0x${_}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:p==="unknown",color:"zinc"}],Me=u.name??((de=u.hash)==null?void 0:de.slice(0,12))??"?",Re=u.confident?"confident":"ambiguous",Ae=`→ ${Me} (${Re}, Tier ${C.tier})`;return e.jsx(le,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Ae,timeMs:c,children:e.jsx(U,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(Ct,{tokens:De,nextFn:"resolvePacketSource()"})}),t.src_hash?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(ae,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:w?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:w,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),u.name&&a===u.name&&e.jsx(S,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(M,{color:"green",children:"Tier 1"}),e.jsx(S,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(S,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(S,{children:"no _advertSender — skip to prefix resolution"})})})]}),oe?e.jsx("div",{className:"border-t border-edge-subtle py-2",children:e.jsx("p",{className:"text-[11px] text-fg-muted/40 font-mono ml-3",children:"Steps 2–5 bypassed — pubkey definitive"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"2"})," ","CANDIDATE POOL — ",N.length," node",N.length!==1?"s":"",' match "',v,'"']}),e.jsxs("div",{className:"space-y-0.5 ml-3",children:[P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"break-all text-[10px]",children:j.hash}),e.jsx(M,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]},j.hash)),N.length===0&&e.jsx(S,{children:"no known nodes for this prefix"})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(ae,{options:Pe,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:p,color:p!=="unknown"?h!=="unknown"?"amber":"green":"zinc"})})})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"4"})," ","ROLE-TYPE SCRUB"]}),e.jsx("div",{className:"space-y-0.5 ml-3",children:P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:j.roleCompatible?"text-sys-green":"text-sys-red",children:j.roleCompatible?"✓":"✗"}),e.jsx("span",{className:`break-all text-[10px] ${j.roleCompatible?"":"line-through text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(S,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),R.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[R.length," eliminated, ",b.length," surviving"]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),b.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):b.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(S,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:b[0].hash}),b[0].name&&e.jsx(S,{c:"text-fg-muted ml-1",children:b[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[b.length," candidates scored…"]})}),e.jsx(V,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:b.map(j=>{const J=j.hash===u.hash;return e.jsxs("div",{className:`text-[11px] leading-relaxed rounded px-2 py-1 ${J?"bg-sys-green/8 border border-sys-green/20":"bg-zinc-500/5"}`,children:[e.jsxs("div",{className:"flex gap-2 items-center mb-0.5",children:[e.jsx(S,{c:J?"text-sys-green":"text-fg-muted",children:J?"→":" "}),e.jsx("span",{className:`break-all text-[10px] ${J?"text-fg-primary":"text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:J?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]}),e.jsxs("div",{className:"ml-4 flex flex-wrap gap-x-3 gap-y-0.5",children:[e.jsxs("span",{children:[e.jsx(S,{children:"zero_hop:"})," ",e.jsx(S,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"recency:"})," ",e.jsx(S,{c:"text-fg-primary",children:mt(j.lastSeen)})," ",e.jsxs(M,{color:ee(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"gps:"})," ",e.jsx(S,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"adverts:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(M,{color:ee(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"topo:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(M,{color:ee(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(S,{children:"score ≈"})," ",e.jsx(S,{c:"text-fg-primary font-bold",children:j.total.toFixed(1)})]})]},j.hash)})})})]})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:u.hash?e.jsx(d,{fn:"resolved.hash",value:u.hash,color:"green"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:u.type,color:u.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:u.name?e.jsx(d,{fn:"resolved.name",value:u.name,color:u.confident?"green":"amber"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(S,{c:u.confident?"text-sys-green":"text-sys-red",children:String(u.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(M,{color:C.tier<=2?"green":C.tier===3?"amber":"red",children:C.tier}),e.jsx(S,{c:"text-fg-primary ml-1",children:C.label})]})]})]})]}):e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx(S,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),u.confident?e.jsxs(S,{c:"text-sys-green",children:["→ resolved via ",C.label]}):e.jsx(S,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:u.hash??"null",group:"resolution",color:u.confident?"green":"zinc"},{fn:"resolved.type",value:u.type,group:"resolution",color:u.type!=="unknown"?u.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:u.name??"null",group:"resolution",color:u.confident?"green":u.name?"amber":"zinc"},{fn:"resolved.confident",value:String(u.confident),group:"resolution",color:u.confident?"green":"red"}];return e.jsx(se,{tokens:j})})()]})})})}const Vt={id:"packet-parse",label:"Packet Parse",inputs:["rawPacket"],outputs:["parsedPacket","decoded","headerFields"],emits:[{fn:"routeType",group:"wire",color:"blue"},{fn:"payloadType",group:"wire",color:"blue"},{fn:"pathLength",group:"wire",color:"blue"},{fn:"version",group:"wire",color:"blue"}],async:!1,observatoryStage:0},Ut={id:"enrichment",label:"Ingestion Enrichment",inputs:["parsedPacket"],outputs:["advertSender","channelHash","hopData","byteLength"],emits:[{fn:"_advertSender",group:"enrichment",color:"blue"},{fn:"_advertNodeType",group:"enrichment",color:"blue"},{fn:"_channelHash",group:"enrichment",color:"blue"},{fn:"_hopCount",group:"enrichment",color:"blue"},{fn:"_isZeroHop",group:"enrichment",color:"blue"},{fn:"_byteLength",group:"enrichment",color:"blue"}],async:!1,observatoryStage:1},qt={id:"topology",label:"Topology Analysis",inputs:["packets","neighbors","srcHashResolver"],outputs:["edges","nodeMetrics","pathHealth","ghostNodes","centrality","loops"],emits:[{fn:"edges",group:"worker",color:"green"},{fn:"ghostNodes",group:"worker",color:"purple"},{fn:"loops",group:"analysis",color:"amber"},{fn:"nodeMetrics",group:"worker",color:"green"},{fn:"pathHealth",group:"worker",color:"green"},{fn:"centrality",group:"worker",color:"green"}],async:!0,worker:"topology.worker.ts",observatoryStage:2},Wt={id:"trace-enrichment",label:"Trace Link Quality",inputs:["packets","prefixLookup","srcHashResolver","edges","pathHealth","nodeMetrics"],outputs:["traceLinks","traceLinkSummary","traceDisambiguationFeedback"],emits:[{fn:"traceLinks.directed",group:"worker",color:"teal"},{fn:"traceLinks.bidir",group:"worker",color:"teal"},{fn:"traceSummary.meanSnr",group:"analysis",color:"green"},{fn:"traceSummary.medianSnr",group:"analysis",color:"zinc"},{fn:"traceSummary.confidence",group:"analysis",color:"zinc"},{fn:"feedback.confirmed",group:"worker",color:"teal"},{fn:"feedback.links",group:"worker",color:"teal"}],async:!1,observatoryStage:2},Yt={id:"disambiguation",label:"Source Disambiguation",inputs:["packets","neighbors","decodedMessages"],outputs:["srcHashResolverMap","neighborContext"],emits:[{fn:"resolvedHash",group:"resolution",color:"purple"},{fn:"resolvedName",group:"resolution",color:"purple"},{fn:"resolvedType",group:"resolution",color:"purple"},{fn:"confidence",group:"resolution",color:"green"}],async:!1,observatoryStage:3},Zt={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},Xt={id:"decryption",label:"Channel Decryption",inputs:["packets","channelKeys"],outputs:["decodedMessages"],emits:[{fn:"decrypt.text",group:"crypto",color:"teal"},{fn:"decrypt.senderName",group:"crypto",color:"teal"},{fn:"decrypt.channelName",group:"crypto",color:"teal"},{fn:"decrypt.macCorrupted",group:"crypto",color:"amber"}],async:!0,worker:"decryption.worker.ts",observatoryStage:2},Jt={id:"decoded-content",label:"Decoded Content Policy",inputs:["decodedMessages","packets"],outputs:["decodedContent","contentInheritance"],emits:[{fn:"content.senderName",group:"crypto",color:"teal"},{fn:"content.text",group:"crypto",color:"teal"},{fn:"content.channelName",group:"crypto",color:"teal"},{fn:"content.corrupted",group:"crypto",color:"amber"},{fn:"content.inherited",group:"analysis",color:"purple"}],async:!1},Z=[Vt,Ut,qt,Wt,Yt,Zt,Xt,Jt],Qt=new Map(Z.map(t=>[t.id,t])),es=new Map;for(const t of Z)for(const s of t.emits)es.set(s.fn,t);const $e=new Map;for(const t of Z)for(const s of t.outputs)$e.set(s,t);function ts(){const t=new Map,s=new Map;for(const a of Z)t.has(a.id)||t.set(a.id,0),s.has(a.id)||s.set(a.id,new Set);for(const a of Z)for(const n of a.inputs){const l=$e.get(n);if(l&&l.id!==a.id){const o=s.get(l.id);o.has(a.id)||(o.add(a.id),t.set(a.id,(t.get(a.id)??0)+1))}}const r=[];for(const[a,n]of t)n===0&&r.push(a);const c=[];for(;r.length>0;){const a=r.shift(),n=Qt.get(a);n&&c.push(n);for(const l of s.get(a)??[]){const o=(t.get(l)??1)-1;t.set(l,o),o===0&&r.push(l)}}for(const a of Z)c.includes(a)||c.push(a);return c}const ss={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function ns({stage:t,isActive:s,onClick:r}){const c=t.observatoryStage!=null?ss[t.observatoryStage]??"text-fg-muted":"text-fg-muted/40";return e.jsxs("button",{type:"button",onClick:r,className:` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-DZf0BPc-.js","assets/index-WhzslczH.js","assets/node-types-BuI9FfZZ.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); +import{bY as O,r as T,ed as Fe,ee as Ee,ef as Oe,eg as ze,by as Be,eh as Ie,ei as Ge,ej as Ke,ek as Ve,bx as Ne,_ as ue,el as Ue,em as we,bC as pe,j as e,en as G,eo as K,ep as V,dS as xe,eq as qe,x as M,bK as We,bV as Ce,c2 as Ye,er as Ze,es as Xe,et as Je,eu as Qe,ev as et,ew as Q,ex as tt,ey as st,ez as nt,eA as he,ad as me,a8 as Se,e as rt,eB as at,G as lt,K as ot,eC as ct,bk as it,dc as dt}from"./index-WhzslczH.js";import{usePipelineStore as Y}from"./usePipelineStore-DZf0BPc-.js";import{e as Te,p as ut,a as pt,A as I,S as U,c as se,f as E,K as i,H as A,B as xt,R as F,T as d,P as re,h as ht,i as S,C as _e,s as ee,j as mt}from"./primitives-Bq_jqX-t.js";import{m as ke,i as gt}from"./node-types-BuI9FfZZ.js";function ft(t){const s=t.type??t.payload_type,r=t.duplicates??[],c=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const x=[t.rssi,...r.map(g=>g.rssi).filter(g=>g!=null)],m=[t.snr,...r.map(g=>g.snr).filter(g=>g!=null)];x.length>1&&(n=[Math.min(...x),Math.max(...x)]),m.length>1&&(l=[Math.min(...m),Math.max(...m)])}const o=s===O.TRACE;return{isDuplicate:c,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:o}}function bt(t,s,r){const c={traceTag:null,siblingCount:0,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:[],thisPathLen:0,minPathLen:0,firstHopPrefix:null};let a=t._traceTag;if(!a&&t.payload&&(a=Te(t.payload)),!a)return{...c,evidence:["no traceTag — cannot correlate"]};const n=s.get(a)??[],l=N=>N.path_length!=null?N.path_length:Array.isArray(N.original_path)?N.original_path.length:0,o=l(t),x=n.length>0?Math.min(...n.map(l)):o,m=t.payload?t.payload.slice(18):"",g=m.length>=2?m.slice(0,2).toUpperCase():null,u=[];if(u.push(`traceTag: ${a}`),u.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return u.push("packet_origin = tx_local → we initiated this trace"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return u.push(`sibling (hash ${v.packet_hash}) has packet_origin = tx_local`),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!0,method:"tx_local",confidence:"certain",inferredSrc:"LOCAL",inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g};if(u.push(`this observation: path_len=${o}, min across siblings: ${x}`),g){if(u.push(`first hop in target path: ${g}`),o===0)return u.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),u.push("initiator is a direct RF neighbor"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"min_path_len",confidence:"speculative",inferredSrc:null,inferredName:null,evidence:[...u,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:o,minPathLen:x,firstHopPrefix:g};const f=Object.entries(r).filter(([k])=>k.replace(/^0x/i,"").slice(0,2).toUpperCase()===g);if(f.length===1){const[k,$]=f[0],h=$.name||$.node_name||null;return u.push(`first hop ${g} → unique neighbor: ${h??k}`),u.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:g,inferredName:h,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}else f.length>1?u.push(`first hop ${g} matches ${f.length} neighbors (ambiguous)`):u.push(`first hop ${g} is not a known neighbor`)}return u.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:u,thisPathLen:o,minPathLen:x,firstHopPrefix:g}}let ne=null,ce=null;typeof window<"u"&&setTimeout(()=>{ue(()=>import("./usePipelineStore-DZf0BPc-.js"),__vite__mapDeps([0,1,2,3])).then(t=>{ne=t}),ue(()=>import("./index-WhzslczH.js").then(t=>t.fJ),__vite__mapDeps([1,3])).then(t=>{ce=t})},0);const He={advertSender:null,advertNodeType:null,advertFlags:null,advertHasLocation:null,advertHasName:null,advertName:null,advertLatitude:null,advertLongitude:null,channelHash:null,byteLength:void 0,hopCount:0,isZeroHop:!0,preComputed:!1};function yt(t,s){const r=t.type??t.payload_type,c=Ne(r),a=Be(t.route),n=r===O.ADVERT,l=r===O.TRACE,o=r===O.PATH,x=r===O.GRP_TXT||r===O.GRP_DATA,m=Ie(t.snr,t.rssi),g=(m==null?void 0:m.finalGrade)??"critical",u=Ge(t.route),v=Ke(t.route),N=Ve(t.route),f=t.route==null?"unknown":u?"flood":v?"direct":"unknown",k=N?`transport-${f}`:f,$=!!s.advertSender;let h="none";$?h="pubkey":x?h="encrypted":t.src_hash&&(h="prefix");const y=gt(r),p=s.advertNodeType!=null?ke(s.advertNodeType):"unknown",_=y!=="unknown"?y:p,H=t.packet_origin??"rx",C=Math.floor(Date.now()/1e3)-t.timestamp,D=C<10?"live":C<300?"recent":C<3600?"warm":C<86400?"stale":"historic",L=t.path_length??(Array.isArray(t.original_path)?t.original_path.length:void 0),P=Array.isArray(t.original_path)&&t.original_path.length>0,R=L??0,b=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),w=ft(t);return{pType:r,payloadTypeName:c,routeTypeName:a,isAdvert:n,isTrace:l,isPath:o,isGrp:x,signalClass:g,routeClass:k,isFlood:u,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:$,inferredType:y,advertType:p,effectiveType:_,origin:H,age:D,pathLen:L,pathAvail:P,pathHopCount:R,byteLen:b,dupeAnalysis:w}}function jt(t){var f,k,$,h,y,p;const s=pt(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:c}=s;if(r.length<2||!ne||!ce)return null;const a=ne.usePipelineStore.getState().srcHashResolverMap,n=ne.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,o=ce.useStore.getState().stats,x=(o==null?void 0:o.neighbors)??{},m=o==null?void 0:o.local_hash,g=(k=(f=o==null?void 0:o.config)==null?void 0:f.repeater)==null?void 0:k.latitude,u=(h=($=o==null?void 0:o.config)==null?void 0:$.repeater)==null?void 0:h.longitude,v=Object.keys(x).length>0?Ue([],x,m,g,u):null,N=[];for(let _=0;_0?[r[_-1].toUpperCase()]:[]],P=ge(H,_,L,a,v),R=[H,..._+20?N:null}function ge(t,s,r,c,a){if(s===0){const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.8};if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}}else{if(a){const o=pe(a,t,{position:s,adjacentPrefixes:r});if(o.hash)return{hash:o.hash,confidence:o.confidence}}const l=c==null?void 0:c.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function vt(t){var l;const s=t.raw_packet;if(!s||s.length<2)return null;const r=s.replace(/\s/g,""),c=Math.floor(r.length/2),a=((l=r.match(/.{1,2}/g))==null?void 0:l.join(" "))??"";let n="";for(let o=0;o=32&&x<=126?String.fromCharCode(x):"·"}return{hexBytes:a,utf8:n,byteCount:c}}function Nt(t){const s=new Map;let r=0,c="";for(const a of t){if((a.type??a.payload_type)!==O.TRACE)continue;r++,c=a.packet_hash;const l=a._traceTag??(a.payload?Te(a.payload):null);if(!l)continue;let o=s.get(l);o||(o=[],s.set(l,o)),o.push(a)}return{index:s,fingerprint:`${r}:${c}`}}function wt(t,s,r){const c=T.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=T.useMemo(()=>t?vt(t):null,[t]),n=T.useMemo(()=>{if(!s||s.length<4)return c.current.parse=0,c.current.decode=0,null;const h=performance.now(),y=ut(s),p=performance.now()-h;return y?(c.current.parse=p,c.current.decode=0,{protocolPacket:y.packet,display:{headerFields:y.headerFields,transportCodesHex:y.transportCodesHex,pathLengthHex:y.pathLengthHex,pathDataHex:y.pathDataHex,payloadHex:y.payloadHex,payloadByteOffset:y.payloadStartByte,pathByteOffset:y.pathByteOffset,pathLenByteOffset:y.pathLenByteOffset},decoded:y.decoded,error:null}):(c.current.parse=p,c.current.decode=0,{protocolPacket:null,display:null,decoded:null,error:"Packet.fromHex() returned failure"})},[s]),l=T.useMemo(()=>{if(!t)return c.current.enrich=0,He;const h=performance.now();if(t._advertSender!==void 0)return c.current.enrich=performance.now()-h,{advertSender:t._advertSender??null,advertNodeType:t._advertNodeType??null,advertFlags:t._advertFlags??null,advertHasLocation:t._advertHasLocation??null,advertHasName:t._advertHasName??null,advertName:t._advertName??null,advertLatitude:t._advertLatitude??null,advertLongitude:t._advertLongitude??null,channelHash:t._channelHash??null,byteLength:t._byteLength,hopCount:t._hopCount??0,isZeroHop:t._isZeroHop??!0,preComputed:!0};const y=t.type??t.payload_type,p=Fe(s,y),_=Ee(s,y),H=Oe(s,t),C=ze(t);return c.current.enrich=performance.now()-h,{...p,channelHash:_,byteLength:H,...C,preComputed:!1}},[t,s]),o=T.useRef({fingerprint:"",index:new Map}),x=T.useMemo(()=>{const h=performance.now(),{index:y,fingerprint:p}=Nt(r);return c.current.traceIndex=performance.now()-h,p===o.current.fingerprint?o.current.index:(o.current={fingerprint:p,index:y},y)},[r]),m=T.useMemo(()=>{const h=c.current;return{parse:h.parse,decode:h.decode,enrich:h.enrich,traceIndex:h.traceIndex,total:h.parse+h.decode+h.enrich+h.traceIndex}},[n,l,x]);if(!t)return null;const g=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",u=(n==null?void 0:n.protocolPacket)??null,v=u?u.payloadVersion:null,N=v===0,f=v===1,k=yt(t,l);let $=null;return k.isTrace&&($=jt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:g,protocolPacket:u,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:f,enrichment:l,traceTagIndex:x,analysis:k,traceHopDetail:$,timing:m}}function ae({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:`w-16 shrink-0 font-medium ${l.active?"text-fg-primary":"text-fg-muted"}`,children:l.label}),l.detail&&e.jsx("span",{className:l.active?"text-fg-primary/70":"text-fg-muted",children:l.detail})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}function Ct({tokens:t,nextFn:s}){var n;const r=t.find(l=>l.active),c=(r==null?void 0:r.color)??"green",a=((n=I[c])==null?void 0:n.stem)??"bg-edge-subtle";return e.jsxs("div",{className:"flex flex-col items-start py-1 gap-0 px-2",children:[e.jsx("div",{className:`w-px h-2 ml-4 ${a}`}),e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-md overflow-hidden w-full",children:[t.map((l,o)=>{const x=I[l.color??"green"]??I.green;return e.jsxs("div",{className:`flex items-center gap-1 px-2 py-px font-mono text-[10px] leading-relaxed transition-opacity ${l.active?x.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?x.dot:"border border-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-muted shrink-0",children:l.fn}),e.jsxs("span",{className:l.active?"text-fg-primary":"text-fg-muted",children:["(",l.value??"",")"]})]},o)}),s&&e.jsx("div",{className:"flex items-center px-2 py-0.5 border-t border-edge-subtle",children:e.jsxs("span",{className:"text-[10px] text-fg-muted font-mono",children:["→ ",s]})})]}),e.jsx("div",{className:`w-px h-2 ml-4 ${a}`})]})}const St={0:"border-l-sys-green",1:"border-l-sys-blue",2:"border-l-sys-teal",3:"border-l-sys-purple"};function le({stage:t,name:s,fn:r,verdict:c,timeMs:a,skipped:n,skipReason:l,children:o}){const x=St[t]??"";return e.jsx(e.Fragment,{children:e.jsx(G,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${x}`,children:[e.jsxs(K,{className:"px-3 py-2 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"font-mono text-xs font-bold text-sys-blue shrink-0",children:t}),e.jsx("span",{className:"font-mono text-xs font-medium text-fg-primary truncate",children:s}),r&&!c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),c&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:c})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-zinc-500/20 text-fg-muted",children:"N/A"}),a!=null&&!n&&e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})]})]}),e.jsx(V,{children:e.jsx("div",{className:"px-3 pb-3 font-mono text-xs",children:n?e.jsx("p",{className:"text-fg-muted italic",children:l??"Not applicable for this packet type"}):o})})]})})})}function Tt(t,s){return s?"manual":t._stripped?"bulk-tier":qe.isConnected()?"ws-push":"rest-poll"}const _t={connected:"green",degraded:"amber",offline:"red"};function kt({packet:t,isSynthetic:s}){const r=xe(g=>g.wsState),c=xe(g=>g.health),a=Tt(t,s),l=!!t._stripped?"WARM":"HOT",o=[{label:"ws-push",detail:"wsConnected && onPacket()",active:a==="ws-push",color:"green"},{label:"rest-poll",detail:"!wsConnected, 3s interval",active:a==="rest-poll",color:"amber"},{label:"catchup",detail:"wsReconnected, delta > 50",active:a==="catchup",color:"amber"},{label:"bulk-tier",detail:"user extends time range → gzip",active:a==="bulk-tier",color:"blue"},{label:"manual",detail:"hex input — no transport",active:a==="manual",color:"zinc"}],x=[{fn:"transport",value:a,group:"transport",color:a==="ws-push"?"green":a==="bulk-tier"?"blue":"amber"},{fn:"tier",value:l,group:"transport",color:"blue"},{fn:"wsState",value:r,group:"transport",color:r==="connected"?"green":"amber"},{fn:"health",value:c,group:"transport",color:_t[c]}],m=s?"manual hex input":`${a} (${c})`;return e.jsx(le,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:m,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(U,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(ae,{options:o,nextFn:"ingest()"}),e.jsx(se,{tokens:x})]})})})}function q({start:t,end:s}){const r=s!=null&&s!==t?`[${t}..${s}]`:`[${t}]`;return e.jsx("span",{className:"text-fg-muted text-[9px] font-mono mr-1 select-none",children:r})}const Ht={advert:"decodeAdvert()",ack:"decodeAck()",path:"decodePath()",trace:"decodeTraceWithSnr()",txt_msg:"decodeTextMessage()",grp_txt:"decodeGroupText()",grp_data:"decodeGroupData()",multipart:"decodeMultipart()",control:"decodeControl()",req:"decodeRequest()",response:"decodeResponse()",anon_req:"decodeAnonReq()",generic:"decodeGeneric()"};function $t({rawHex:t,display:s,protocolPacket:r,parseError:c,parseTimeMs:a,payloadVersion:n,isV1:l,isV2:o}){return e.jsx("dl",{className:"space-y-0.5",children:s&&r&&t?e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse — Packet.fromHex()"}),a>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:a<1?`${(a*1e3).toFixed(0)}µs`:`${a.toFixed(2)}ms`})}),e.jsxs(i,{label:"header byte",children:[e.jsx(q,{start:0}),e.jsx(A,{value:t.slice(0,2)})," ",e.jsx(xt,{value:parseInt(t.slice(0,2),16)})]}),s.headerFields.map(x=>e.jsx(i,{label:` ${x.field}`,children:e.jsx(F,{raw:e.jsxs("span",{className:"text-[10px]",children:["bits[",x.bits,"] = ",x.binary]}),children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:x.value})})},x.field)),e.jsx(i,{label:" version",children:n!=null?e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[e.jsx(d,{fn:"payloadVer",value:`${n}`,color:"amber"}),e.jsx(M,{color:l?"green":o?"blue":"zinc",children:l?"v1":o?"v2":`v${n}`}),l&&e.jsx("span",{className:"text-fg-muted text-[10px]",children:"1-byte hashes, 2-byte MAC"}),o&&e.jsx("span",{className:"text-sys-blue text-[10px]",children:"2-byte hashes, 4-byte MAC (speculative)"})]}):e.jsx("span",{className:"text-fg-muted",children:"unknown"})}),e.jsx(E,{title:"Wire Framing"}),e.jsx(i,{label:"transportCodes",children:s.transportCodesHex?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:1,end:4}),e.jsx(d,{fn:"transport",value:s.transportCodesHex,color:"amber"})]}):e.jsx("span",{className:"text-fg-muted",children:"N/A (non-transport route)"})}),e.jsx(i,{label:"pathLen",children:e.jsx(F,{raw:e.jsxs(e.Fragment,{children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(A,{value:s.pathLengthHex})]}),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.pathLenByteOffset}),e.jsx(d,{fn:"pathLen",value:`${r.pathLen} hop${r.pathLen!==1?"s":""}`,color:"amber"})]})})}),e.jsx(i,{label:"path",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.pathLen>0&&e.jsx(q,{start:s.pathByteOffset,end:s.pathByteOffset+r.pathLen-1}),e.jsx(re,{hops:r.pathHexArray,hexPrefix:s.pathDataHex||void 0})]})}),e.jsx(i,{label:"payloadLen",children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(q,{start:s.payloadByteOffset,end:s.payloadByteOffset+s.payloadHex.length/2-1}),e.jsx(d,{fn:"payloadLen",value:`${s.payloadHex.length/2} bytes`,color:"amber"})]})}),e.jsx(i,{label:"payloadHex",children:e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber break-all",children:s.payloadHex})})]}):e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"A. Parse"}),e.jsxs(i,{label:"result",children:[e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-2 py-0.5 font-mono text-[11px] text-sys-amber",children:"Skipped"}),e.jsx("span",{className:"ml-1 text-fg-muted",children:c??"No raw_packet (warm-tier)"})]})]})})}function Dt({decoded:t,packet:s}){if(!t)return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode"}),e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:"No decoded payload"})]});const r=Ht[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"B. Decode — decodePayload()"}),e.jsx(U,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(E,{}),e.jsx(Lt,{decoded:t,packet:s})]})})]})}function Lt({decoded:t,packet:s}){var r;switch(t.type){case"advert":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"publicKey",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px] break-all",children:t.publicKey}),children:e.jsx(d,{fn:"publicKey",value:t.publicKey,color:"green"})})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(F,{raw:e.jsx(A,{value:t.flags}),children:e.jsx(d,{fn:"flags",value:t.flagsDescription,color:"green"})})}),e.jsx(i,{label:"nodeType",children:e.jsx(d,{fn:"nodeType",value:t.nodeType,color:"green"})}),t.latitude!=null&&e.jsx(i,{label:"latitude",children:e.jsx(d,{fn:"lat",value:t.latitude.toFixed(6),color:"green"})}),t.longitude!=null&&e.jsx(i,{label:"longitude",children:e.jsx(d,{fn:"lon",value:t.longitude.toFixed(6),color:"green"})}),t.name&&e.jsx(i,{label:"name",children:e.jsx(d,{fn:"name",value:t.name,color:"green"})})]});case"ack":return e.jsx(i,{label:"crc",children:e.jsx(F,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const c=s!=null&&s.src_hash?s.src_hash.replace(/^0x/i,"").slice(0,2).toUpperCase():null;return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"traceTag",children:e.jsx(d,{fn:"traceTag",value:t.traceTag,color:"green"})}),e.jsx(i,{label:"authCode",children:e.jsx(d,{fn:"authCode",value:String(t.authCode),color:"green"})}),e.jsx(i,{label:"flags",children:e.jsx(A,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(re,{hops:t.pathHashes.map(a=>a.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),e.jsx(i,{label:"complete",children:t.isComplete?e.jsxs("span",{className:"text-sys-green",children:["✓ all ",t.pathHashes.length," hops reported SNR"]}):e.jsxs("span",{className:"text-sys-amber",children:["✗ ",t.snrValues.length,"/",t.pathHashes.length," hops reported"]})}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1 text-[10px]",children:"Directional Edge SNR — per-hop link quality"}),t.snrValues.length===0?e.jsx("p",{className:"text-fg-muted italic text-[11px] ml-2",children:"No SNR values in path field"}):e.jsx("div",{className:"space-y-0.5 ml-2",children:t.snrValues.map((a,n)=>{var g,u,v,N,f;const l=((g=t.pathHashes[n])==null?void 0:g.toUpperCase())??"??",o=n===0?c??"SRC":((u=t.pathHashes[n-1])==null?void 0:u.toUpperCase())??"??",x=(f=(N=(v=Ye.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:f.spreading_factor,m=we(a,x);return e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted w-3 text-right",children:n}),e.jsx("span",{className:"text-fg-primary",children:o}),e.jsx("span",{className:"text-fg-muted",children:"→"}),e.jsx("span",{className:"text-fg-primary",children:l}),e.jsx("span",{className:"text-fg-muted",children:"@"}),e.jsxs("span",{className:"font-bold text-sys-green",children:[a>0?"+":"",a.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:m})]},n)})})]})]})}case"path":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"pathLength",children:e.jsx(d,{fn:"pathLength",value:String(t.pathLength),color:"green"})}),e.jsx(i,{label:"path",children:t.path&&t.path.length>0?e.jsx(re,{hops:t.path.map(c=>c.toUpperCase()),color:"green"}):e.jsx("span",{className:"text-fg-muted italic",children:"∅ empty"})}),t.extraType!=null&&e.jsx(i,{label:"extraType",children:e.jsx(d,{fn:"extraType",value:t.extraTypeName??String(t.extraType),color:"purple"})}),t.extraData&&e.jsxs(i,{label:"extraData",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.extraData}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.extraData.length/2,"B)"]})]})]});case"txt_msg":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsx(i,{label:"timestamp",children:e.jsx(d,{fn:"timestamp",value:String(t.timestamp),color:"green"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),e.jsx(i,{label:"encrypted",children:e.jsx(d,{fn:"encrypted",value:String(t.encrypted),color:"green"})})]});case"grp_txt":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),t.channelName&&e.jsx(i,{label:"channelName",children:e.jsx(d,{fn:"channel",value:t.channelName,color:"green"})}),e.jsx(i,{label:"decrypted",children:e.jsx(d,{fn:"decrypted",value:String(t.decrypted),color:"green"})}),t.text&&e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:t.text,color:"green"})}),t.senderName&&e.jsx(i,{label:"senderName",children:e.jsx(d,{fn:"sender",value:t.senderName,color:"green"})}),t.macCorrupted&&e.jsx(i,{label:"macCorrupted",children:e.jsx(d,{fn:"macCorrupted",value:"true",color:"green"})})]});case"grp_data":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channelHash",children:e.jsx(A,{value:t.channelHash})}),e.jsx(i,{label:"dataLength",children:t.dataLength}),e.jsx(i,{label:"decrypted",children:String(t.decrypted)})]});case"multipart":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"messageId",children:t.messageId}),e.jsxs(i,{label:"part",children:[t.partNumber+1," / ",t.totalParts]})]});case"control":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"controlType",children:e.jsx(F,{raw:e.jsx(A,{value:t.controlType}),children:e.jsx(d,{fn:"controlType",value:t.subtypeName,color:"green"})})}),e.jsx(i,{label:"subtype",children:e.jsx(d,{fn:"subtype",value:`0x${t.subtype.toString(16).padStart(2,"0")}`,color:"green"})}),t.nodeTypeName&&e.jsxs(i,{label:"nodeType",children:[e.jsx(d,{fn:"nodeType",value:t.nodeTypeName,color:"green"}),e.jsxs("span",{className:"text-fg-muted text-[10px] ml-1",children:["(flags & 0x0F = 0x",(r=t.nodeType)==null?void 0:r.toString(16).padStart(2,"0"),")"]})]}),t.snrDb!=null&&e.jsxs(i,{label:"snr",children:[e.jsxs("span",{className:"font-bold text-sys-green",children:[t.snrDb>0?"+":"",t.snrDb.toFixed(1)," dB"]}),e.jsx(M,{color:"green",children:t.snrDb>=5?"strong":t.snrDb>=0?"fair":"weak"})]}),t.tag&&e.jsx(i,{label:"tag",children:e.jsx(d,{fn:"tag",value:t.tag,color:"green"})}),t.publicKey&&e.jsxs(i,{label:"publicKey",children:[e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.publicKey}),e.jsx(M,{color:t.publicKeyFull?"green":"amber",children:t.publicKeyFull?"32B full":`${t.publicKey.length/2}B prefix`})]}),t.typeFilter!=null&&e.jsx(i,{label:"typeFilter",children:e.jsx(F,{raw:e.jsx(A,{value:t.typeFilter}),children:e.jsx(d,{fn:"typeFilter",value:t.typeFilterDescription??"none",color:"green"})})}),t.prefixOnly!=null&&e.jsx(i,{label:"prefixOnly",children:e.jsx(d,{fn:"prefixOnly",value:String(t.prefixOnly),color:"green"})}),t.since!=null&&e.jsx(i,{label:"since",children:e.jsx(d,{fn:"since",value:t.since===0?"all (0)":String(t.since),color:"green"})}),!t.nodeTypeName&&t.typeFilter==null&&t.dataLength>0&&e.jsxs(i,{label:"data",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.dataHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.dataLength,"B)"]})]})]});case"req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"response":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.srcHash}),children:e.jsx(d,{fn:"srcHash",value:t.srcHash,color:"green"})})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"anon_req":return e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"destHash",children:e.jsx(F,{raw:e.jsx(A,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"senderPubKey",children:e.jsx("span",{className:"break-all text-[10px] font-mono text-sys-green",children:t.senderPublicKey})}),e.jsx(i,{label:"cipherMac",children:e.jsx(d,{fn:"cipherMac",value:t.cipherMac,color:"purple"})}),e.jsxs(i,{label:"ciphertext",children:[e.jsx("span",{className:"break-all text-[10px] font-mono",children:t.ciphertextHex}),e.jsxs("span",{className:"text-fg-muted ml-1",children:["(",t.ciphertextLength,"B)"]})]})]});case"generic":return e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"payloadType",children:[e.jsx(ht,{value:t.payloadType})," (",t.payloadTypeName,")"]}),e.jsx(i,{label:"length",children:t.length}),e.jsx(i,{label:"rawHex",children:e.jsx("span",{className:"break-all",children:t.rawHex})})]});default:return e.jsx("p",{className:"text-fg-muted",children:"Unknown decoded type"})}}function Pt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,c=r===Ze||r===Xe,a=T.useMemo(()=>{if(!c||!t)return null;const p=t.payload;return p.length<4?null:{channelHash:p[0],mac:p.slice(1,3),ciphertext:p.slice(3)}},[t,c]),[n,l]=T.useState("pending"),[o,x]=T.useState([]),[m,g]=T.useState(0);T.useEffect(()=>{if(!a){l(null);return}let p=!1;return(async()=>{const H=performance.now(),C=await Je(a.channelHash,a.mac,a.ciphertext);p||(l(C),g(performance.now()-H));const D=await Qe(a.channelHash);p||x(D)})(),()=>{p=!0}},[a]);const[u,v]=T.useState(""),[N,f]=T.useState(null),[k,$]=T.useState(!1),h=T.useCallback(async()=>{if(!(!a||!u.trim())){$(!0);try{const p=await We(u.trim(),a.channelHash,a.mac,a.ciphertext);if(p.success){const _=new TextDecoder("utf-8",{fatal:!1}).decode(p.result.plaintext.slice(5));f({success:!0,text:_})}else f({success:!1,error:p.error})}catch(p){f({success:!1,error:String(p)})}finally{$(!1)}}},[a,u]),y=Ce(s);return!c||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(E,{title:"C. Decrypt — tryDecryptGroupMessage()"}),m>0&&e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"font-mono text-[10px] px-1.5 py-0.5 rounded bg-sys-green/15 text-sys-green",children:m<1?`${(m*1e3).toFixed(0)}µs`:`${m.toFixed(2)}ms`})}),e.jsx(U,{prefix:"tryDecryptGroupMessage",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"channelHash",children:e.jsx(d,{fn:"channelHash",value:`0x${a.channelHash.toString(16).toUpperCase().padStart(2,"0")}`,color:"teal"})}),e.jsx(i,{label:"mac",children:e.jsx(d,{fn:"mac",value:Array.from(a.mac).map(p=>p.toString(16).padStart(2,"0")).join(""),color:"teal"})}),e.jsx(i,{label:"cipherLen",children:e.jsx(d,{fn:"cipherLen",value:`${a.ciphertext.length}B`,color:"teal"})}),e.jsx(i,{label:"candidates",children:e.jsx(d,{fn:"candidates",value:o.length>0?`${o.length} names`:"0",color:o.length>0?"teal":"zinc"})}),o.length>0&&e.jsxs("details",{className:"mt-1",children:[e.jsx("summary",{className:"text-fg-muted cursor-pointer hover:text-fg-primary text-[10px]",children:"show candidate names"}),e.jsx("div",{className:"mt-1 text-[10px] text-fg-muted break-all max-h-24 overflow-y-auto",children:o.join(", ")})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"Result:"}),n==="pending"?e.jsx("p",{className:"text-fg-muted italic",children:"decrypting…"}):n?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:n.channelName,color:"teal"})}),e.jsx(i,{label:"plaintext",children:e.jsx(d,{fn:"plaintext",value:new TextDecoder("utf-8",{fatal:!1}).decode(n.plaintext.slice(5)).trim()||"(empty)",color:"teal"})}),e.jsx(i,{label:"macValid",children:e.jsx(d,{fn:"macValid",value:n.macCorrupted?"false":"true",color:"teal"})})]}):e.jsxs(i,{label:"decrypt",children:[e.jsx(d,{fn:"decrypt",value:"failed",color:"red"}),e.jsx("span",{className:"text-fg-muted ml-1",children:"channel not in known list"})]})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"testChannelName() — manual test:"}),e.jsxs("div",{className:"flex gap-1.5 items-center",children:[e.jsx("input",{type:"text",value:u,onChange:p=>{v(p.target.value),f(null)},onKeyDown:p=>p.key==="Enter"&&h(),placeholder:"channel name",className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-40"}),e.jsx("button",{onClick:h,disabled:k||!u.trim(),className:"px-2 py-1 rounded text-[10px] font-mono bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 disabled:opacity-40 transition-colors",children:k?"…":"Try"})]}),N&&e.jsx("div",{className:"mt-1",children:N.success?e.jsx(i,{label:"result",children:e.jsx(d,{fn:"plaintext",value:N.text??"(empty)",color:"teal"})}):e.jsx(i,{label:"error",children:e.jsx(d,{fn:"error",value:N.error??"unknown",color:"red"})})})]}),e.jsx(E,{}),e.jsxs("div",{children:[e.jsx("p",{className:"text-fg-muted mb-1",children:"useDecodedMessage() store result:"}),y?y.decoded?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"channel",children:e.jsx(d,{fn:"channel",value:y.decoded.channelName??"?",color:"teal"})}),e.jsx(i,{label:"text",children:e.jsx(d,{fn:"text",value:y.decoded.text,color:"teal"})})]}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"failed",color:"red"})}):e.jsx(i,{label:"decrypt",children:e.jsx(d,{fn:"decrypt",value:"pending",color:"zinc"})})]})]})})]})}function Mt(t){const{rawHex:s,display:r,protocolPacket:c,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m,packetHash:g,packet:u}=t,v=!!s&&s.length>=4;return e.jsxs(G,{children:[e.jsx(K,{className:"w-full mt-2 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-[10px] font-mono text-fg-muted",children:"🔬"}),e.jsx("span",{className:"text-[10px] font-mono font-medium text-fg-muted",children:"Wire Inspection"}),e.jsx("span",{className:"text-[9px] text-fg-muted/50",children:"observatory diagnostic — not a runtime stage"})]})}),e.jsx(V,{children:e.jsxs("div",{className:"border border-dashed border-edge-subtle rounded-lg p-3 space-y-1 bg-surface/30",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/50 mb-2",children:"The backend parsed these fields server-side. This panel verifies the wire-level encoding client-side."}),v?e.jsxs(e.Fragment,{children:[e.jsx($t,{rawHex:s,display:r,protocolPacket:c,parseError:n,parseTimeMs:l,payloadVersion:o,isV1:x,isV2:m}),e.jsx(Dt,{decoded:a,packet:u}),e.jsx(Pt,{protocolPacket:c,packetHash:g})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function fe(t){if(!t)return[{fn:"decode",value:"no raw_packet",group:"decode",color:"zinc"}];switch(t.type){case"advert":{const s=t,r=[{fn:"decode.nodeType",value:s.nodeType,group:"decode",color:"blue"}];return s.name&&r.push({fn:"decode.name",value:s.name,group:"decode",color:"blue"}),s.latitude!=null&&s.longitude!=null&&r.push({fn:"decode.location",value:`${s.latitude.toFixed(4)}, ${s.longitude.toFixed(4)}`,group:"decode",color:"blue"}),r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:"blue"}),r}case"trace":{const s=t;return[{fn:"decode.traceTag",value:s.traceTag,group:"decode",color:"blue"},{fn:"decode.hops",value:s.pathHashes.length>0?s.pathString:"empty",group:"decode",color:"blue"},{fn:"decode.snr",value:s.snrValues.length>0?`${s.snrValues.length} values`:"none",group:"decode",color:s.snrValues.length>0?"blue":"zinc"},{fn:"decode.complete",value:s.isComplete?"yes":"partial",group:"decode",color:s.isComplete?"green":"amber"}]}case"path":{const s=t,r=[{fn:"decode.pathLength",value:String(s.pathLength),group:"decode",color:"blue"},{fn:"decode.path",value:s.path.length>0?s.pathString:"empty",group:"decode",color:"blue"}];return s.extraType!=null&&r.push({fn:"decode.extraType",value:s.extraTypeName??String(s.extraType),group:"decode",color:"purple"}),s.extraData&&r.push({fn:"decode.extraData",value:`${s.extraData.length/2}B`,group:"decode",color:"purple"}),r}case"ack":return[{fn:"decode.crc",value:t.crc,group:"decode",color:"blue"}];case"grp_txt":return[{fn:"decode.channelHash",value:t.channelHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:"true — decrypt at cascade",group:"decode",color:"zinc"}];case"grp_data":{const s=t;return[{fn:"decode.channelHash",value:s.channelHash,group:"decode",color:"blue"},{fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"}]}case"txt_msg":{const s=t;return[{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.encrypted",value:s.encrypted?"true":"false",group:"decode",color:s.encrypted?"zinc":"green"},...s.encrypted?[]:[{fn:"decode.text",value:s.text,group:"decode",color:"blue"}]]}case"multipart":{const s=t;return[{fn:"decode.part",value:`${s.partNumber+1}/${s.totalParts}`,group:"decode",color:"blue"},{fn:"decode.msgId",value:s.messageId,group:"decode",color:"blue"}]}case"control":{const s=t,r=[{fn:"decode.subtype",value:s.subtypeName,group:"decode",color:"blue"}];return s.nodeTypeName&&r.push({fn:"decode.nodeType",value:s.nodeTypeName,group:"decode",color:"blue"}),s.snrDb!=null&&r.push({fn:"decode.snr",value:`${s.snrDb>0?"+":""}${s.snrDb.toFixed(1)} dB`,group:"decode",color:"blue"}),s.tag&&r.push({fn:"decode.tag",value:s.tag,group:"decode",color:"blue"}),s.publicKey&&r.push({fn:"decode.publicKey",value:s.publicKey,group:"decode",color:s.publicKeyFull?"green":"blue"}),s.typeFilter!=null&&r.push({fn:"decode.typeFilter",value:s.typeFilterDescription??`0x${s.typeFilter.toString(16)}`,group:"decode",color:"blue"}),s.prefixOnly!=null&&r.push({fn:"decode.prefixOnly",value:String(s.prefixOnly),group:"decode",color:"blue"}),!s.nodeTypeName&&!s.tag&&(r.push({fn:"decode.subtypeFlags",value:`0x${s.subtypeFlags.toString(16)}`,group:"decode",color:"blue"}),r.push({fn:"decode.dataLength",value:`${s.dataLength}B`,group:"decode",color:"blue"})),r}case"req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"response":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.srcHash",value:s.srcHash,group:"decode",color:"blue"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"anon_req":{const s=t;return[{fn:"decode.destHash",value:s.destHash,group:"decode",color:"blue"},{fn:"decode.senderPubKey",value:s.senderPublicKey,group:"decode",color:"green"},{fn:"decode.cipherMac",value:s.cipherMac,group:"decode",color:"purple"},{fn:"decode.ciphertext",value:`${s.ciphertextLength}B`,group:"decode",color:"zinc"}]}case"generic":return[{fn:"decode.raw",value:`${t.length}B`,group:"decode",color:"zinc"}];default:return[]}}function Rt({packet:t,pipeline:s,rawHex:r,traceTagIndex:c,neighbors:a}){const{enrichment:n,timing:l,display:o,protocolPacket:x,decoded:m,parseError:g,payloadVersion:u,isV1:v,isV2:N,analysis:f}=s,$=(t.type??t.payload_type)===et,h=f.dupeAnalysis,y=T.useRef(0),p=T.useMemo(()=>{if(!$)return null;const D=performance.now(),L=bt(t,c,a);return y.current=performance.now()-D,L},[t,c,a,$]),_=l.enrich+y.current,H=[];f.byteLen&&H.push(`${f.byteLen}B`),H.push(f.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):f.pathHopCount>0&&H.push(`${f.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const C=H.join(" — ");return e.jsxs(le,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:C,timeMs:_,children:[e.jsx(Mt,{rawHex:r,display:o,protocolPacket:x,decoded:m,parseError:g,parseTimeMs:l.parse,payloadVersion:u,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(E,{title:"Cache Enrichment"}),e.jsx(U,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(M,{color:"green",children:"PacketCache"}):e.jsx(M,{color:"amber",children:"computed"}),e.jsx("span",{className:"text-[10px] text-fg-muted ml-1.5",children:n.preComputed?"pre-enriched by real pipeline":"synthetic — computed on the fly"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 mb-1",children:[e.jsx(d,{fn:"_byteLength",value:n.byteLength!=null?`${n.byteLength}B`:void 0,color:"blue"}),e.jsx(d,{fn:"_hopCount",value:String(n.hopCount),color:"blue"}),e.jsx(d,{fn:"_isZeroHop",value:String(n.isZeroHop),color:n.isZeroHop?"green":"blue"}),n.isZeroHop&&e.jsx(M,{color:"blue",children:"direct"}),n.channelHash!=null&&e.jsx(d,{fn:"_channelHash",value:n.channelHash,color:"blue"}),$&&t._traceTag&&e.jsx(d,{fn:"_traceTag",value:t._traceTag,color:"blue"})]}),n.advertSender||n.advertNodeType!=null||n.advertName!=null?e.jsxs("div",{className:"mt-1 mb-1",children:[e.jsx("p",{className:"text-[10px] text-sys-blue font-medium mb-0.5",children:"ADVERT Enrichment"}),e.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1",children:[n.advertSender&&e.jsx(d,{fn:"_advertSender",value:n.advertSender.slice(0,16)+"…",color:"blue"}),n.advertNodeType!=null&&e.jsx(d,{fn:"_advertNodeType",value:ke(n.advertNodeType),color:"blue"}),n.advertName!=null&&e.jsx(d,{fn:"_advertName",value:n.advertName,color:"blue"}),n.advertFlags!=null&&e.jsx(d,{fn:"_advertFlags",value:`0x${n.advertFlags.toString(16).padStart(2,"0")}`,color:"blue"}),n.advertHasLocation!=null&&e.jsx(d,{fn:"_advertHasLocation",value:String(n.advertHasLocation),color:"blue"}),n.advertHasName!=null&&e.jsx(d,{fn:"_advertHasName",value:String(n.advertHasName),color:"blue"}),n.advertLatitude!=null&&n.advertLongitude!=null&&e.jsx(d,{fn:"location",value:`${n.advertLatitude.toFixed(4)}, ${n.advertLongitude.toFixed(4)}`,color:"blue"})]})]}):e.jsx("p",{className:"text-[10px] text-fg-muted/30 mb-1",children:"ADVERT fields: N/A (non-ADVERT packet)"}),e.jsx(E,{title:"Payload Decode"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${m?"bg-sys-blue":"bg-zinc-500/40"}`}),e.jsx("span",{className:"font-mono text-[10px] font-medium text-fg-primary",children:"decodePayload()"}),e.jsx("span",{className:"text-[9px] text-fg-muted",children:"sync — wire data only, no crypto"})]}),e.jsx("div",{className:"ml-3",children:m?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:fe(m).map((D,L)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:D.fn,value:D.value,color:D.color})},L))}):e.jsx(S,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"dupe:"}),h.isDuplicate?e.jsx(d,{fn:"is_duplicate",value:"true",color:"purple"}):e.jsx(S,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(S,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),p&&e.jsxs(e.Fragment,{children:[e.jsx(E,{}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx("span",{className:"text-fg-muted",children:"TRACE SRC:"}),p.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:p.inferredSrc,color:"purple"}),p.inferredName&&e.jsx(d,{fn:"name",value:p.inferredName,color:"purple"})]}):e.jsx(S,{children:"unresolvable"}),e.jsx(_e,{color:"purple",children:p.method}),e.jsxs(S,{children:["(",p.confidence,")"]}),e.jsxs(S,{children:["siblings=",p.siblingCount]})]})]}),(()=>{const D=f.pType!=null?`0x${f.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,L=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=fe(m),R=f.signalClass==="excellent"||f.signalClass==="good"?"green":f.signalClass==="fair"?"amber":"red",b=f.senderTier==="pubkey"?"green":f.senderTier==="prefix"?"amber":f.senderTier==="encrypted"?"teal":"zinc",w=[{fn:"type",value:f.payloadTypeName,raw:D,group:"wire",color:"blue"},{fn:"route",value:f.routeTypeName,raw:L,group:"wire",color:"blue"},{fn:"src_hash",value:t.src_hash||void 0,group:"wire",color:"blue"},{fn:"rssi",value:`${t.rssi}dBm`,group:"wire",color:"blue"},{fn:"snr",value:`${t.snr}dB`,group:"wire",color:"blue"},{fn:"_byteLength",value:f.byteLen?`${f.byteLen}B`:void 0,group:"enrichment",color:"blue"},{fn:"_hopCount",value:String(n.hopCount),group:"enrichment",color:"blue"},{fn:"_isZeroHop",value:String(n.isZeroHop),group:"enrichment",color:"blue"},{fn:"_advertSender",value:n.advertSender||void 0,group:"enrichment",color:"blue"},{fn:"_advertNodeType",value:f.advertType!=="unknown"?f.advertType:void 0,group:"enrichment",color:"blue"},{fn:"_advertName",value:n.advertName||void 0,group:"enrichment",color:"blue"},{fn:"_channelHash",value:n.channelHash||void 0,group:"enrichment",color:"blue"},...P,{fn:"is_duplicate",value:String(h.isDuplicate),group:"analysis",color:"purple"},p!=null&&p.inferredSrc?{fn:"traceSrc",value:p.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:f.signalClass,group:"analysis",color:R},{fn:"_routeClass",value:f.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:f.senderTier,group:"analysis",color:b},{fn:"_origin",value:f.origin,group:"analysis",color:f.origin==="tx_local"?"green":f.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:f.pathAvail?`${f.pathHopCount} hops`:"none",group:"analysis",color:f.pathAvail?"green":"zinc"},{fn:"_age",value:f.age,group:"analysis",color:f.age==="live"||f.age==="recent"?"green":"zinc"},...h.dupeCount>0?[{fn:"_dupeCount",value:`×${h.dupeCount}`,group:"analysis",color:"purple"},...h.rssiRange?[{fn:"_multipath",value:`Δ${Math.abs(h.rssiRange[1]-h.rssiRange[0])}dB`,group:"analysis",color:Math.abs(h.rssiRange[1]-h.rssiRange[0])>6?"amber":"green"}]:[]]:[],...t.lbt_attempts!=null?[{fn:"_lbt",value:`${t.lbt_attempts} attempt${t.lbt_attempts!==1?"s":""}`,group:"analysis",color:(t.lbt_attempts??0)>1?"amber":"green"}]:[],...t.drop_reason?[{fn:"_dropReason",value:t.drop_reason,group:"analysis",color:"red"}]:[]];return e.jsx(se,{tokens:w})})()]})})]})}function be(t){switch(t){case"excellent":return"green";case"good":return"green";case"fair":return"amber";case"poor":return"red";case"critical":return"red";default:return"zinc"}}function ye(t){return`${Math.round(t*100)}%`}function je(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function At({hops:t}){return t.length===0?null:e.jsxs("div",{className:"mt-2 pt-2 border-t border-edge-subtle/40",children:[e.jsx("p",{className:"text-[9px] text-fg-muted/40 uppercase tracking-widest font-mono mb-1.5",children:"per-hop trace inspection"}),e.jsx("div",{className:"space-y-1",children:t.map(s=>e.jsx(U,{prefix:`trace.hop[${s.hopIndex}]`,children:e.jsxs("div",{className:"border border-edge-subtle/40 rounded px-2 py-1.5",children:[e.jsxs(i,{label:"link",children:[e.jsx(re,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(_e,{color:be(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(F,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:be(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:je(s.fromName,s.fromHash,s.fromPrefix),color:s.fromHash?s.fromConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:je(s.toName,s.toHash,s.toPrefix),color:s.toHash?s.toConfidence>=.8?"green":"amber":"purple"}),e.jsx("span",{className:"ml-1",children:e.jsx(d,{fn:"conf",value:ye(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(se,{label:"trace contributes",tokens:Ft(t)})]})}function Ft(t){const s=t.reduce((n,l)=>n+(l.fromHash?1:0)+(l.toHash?1:0),0),r=t.length*2,c=r-s,a=t.length>0?t.reduce((n,l)=>n+l.snrRaw,0)/t.length:0;return[{fn:"hops",value:String(t.length),group:"wire",color:"blue"},{fn:"resolved",value:`${s}/${r}`,group:"worker",color:"green"},...c>0?[{fn:"ghosts",value:String(c),group:"worker",color:"purple"}]:[],{fn:"avgSnr",value:`${a.toFixed(1)} dB`,group:"analysis",color:a>=5?"green":a>=0?"amber":"red"}]}function Et(t){if(!t)return"never";const s=Math.floor((Date.now()-t)/1e3);return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:`${Math.floor(s/3600)}h ago`}function Ot(t){if(!t)return[];const s=t.decoded;if(!s)return[{fn:"decrypt.result",value:"failed",group:"crypto",color:"red"}];if(!s.decrypted)return[{fn:"decrypt.result",value:"no key match",group:"crypto",color:"zinc"}];const r=[];return s.channelName&&r.push({fn:"decrypt.channelName",value:s.channelName,group:"crypto",color:"teal"}),s.senderName&&r.push({fn:"decrypt.senderName",value:s.senderName,group:"crypto",color:"teal"}),s.text&&r.push({fn:"decrypt.text",value:s.text,group:"crypto",color:"teal"}),s.timestamp&&r.push({fn:"decrypt.timestamp",value:new Date(s.timestamp*1e3).toISOString().slice(11,19),group:"crypto",color:"teal"}),s.macCorrupted&&r.push({fn:"decrypt.macCorrupted",value:"true",group:"crypto",color:"amber"}),r}function zt({packet:t,decrypted:s,pipeline:r}){var b;const c=Q(w=>w.isComputing),a=Q(w=>w.lastUpdated),n=Q(w=>w.lastComputeTimeMs),l=Q(w=>w.topology.edges.length),o=Q(w=>w.topology.discoveredNodes.length),x=tt(),m=st(),g=nt(),u=he(w=>w.isComputing),v=he(w=>w.nodeCount),N=me(w=>w.progress),f=me(w=>w.initialDecodeComplete),k=t.type??t.payload_type,$=k===O.GRP_TXT||k===O.GRP_DATA,h=k===O.TRACE,y=k===O.PATH,p=$,_=[{label:"full",detail:"all GRP_TXT → decryption worker",active:p&&f,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:p&&!f,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!p,color:"zinc"}],H=Ot(s),C=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,D=c?"running":`${l}e ${o}g`,L=u?"running":`${v}n`,P=p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A",R=`topo ${c?"○":"✓"} ${D} · spark ${u?"○":"✓"} ${L} · decrypt ${P}`;return e.jsx(le,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:R,children:e.jsx(U,{prefix:"cascade",children:e.jsxs("div",{className:"space-y-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 py-1.5 text-[11px] font-mono",children:[e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${c?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"topology"}),e.jsxs("span",{className:"text-fg-muted",children:[l,"e ",o,"g"]}),(h||y)&&e.jsx("span",{className:"text-sys-green text-[9px]",children:"↑signal"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u?"bg-sys-amber animate-pulse":"bg-sys-green"}`}),e.jsx("span",{className:"text-fg-primary",children:"sparkline"}),e.jsxs("span",{className:"text-fg-muted",children:[v,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.isDecoding?"bg-sys-amber animate-pulse":p?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:p?"text-sys-teal":"text-fg-muted",children:p?C?"decrypted":N.isDecoding?`${N.percent}%`:"pending":"N/A"})]})]}),e.jsxs(G,{defaultOpen:h||y,children:[e.jsx(K,{className:"text-[10px] w-full border-t border-edge-subtle pt-1.5",children:e.jsx("span",{className:"font-mono text-fg-muted/50",children:"topology detail…"})}),e.jsx(V,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:c?"running":"idle",color:c?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Et(a),color:"zinc"}),n>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",n<1e3?`${n.toFixed(0)}ms`:`${(n/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(l),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(o),color:"purple"})]}),m&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(x.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(x.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(x.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${x.meanSnr.toFixed(1)} dB`,color:x.meanSnr>=5?"green":x.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${x.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(x.avgConfidence*100)}%`,color:"zinc"})]}),h&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(x.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(x.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(x.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(x.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(x.qualityCounts.critical),color:"red"})]}),g.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(g.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(g.confirmedLinks.length),color:"teal"})]})]}),h&&(r==null?void 0:r.traceHopDetail)&&e.jsx(At,{hops:r.traceHopDetail})]})})]}),p&&e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"mode",children:e.jsx(ae,{options:_,nextFn:"queueDecryption()"})}),e.jsx(i,{label:"result",children:e.jsx(d,{fn:"decrypt",value:C?"decrypted":s?"failed":"pending",color:C?"teal":s?"red":"zinc"})}),C&&e.jsx("div",{className:"mt-1 flex flex-wrap gap-x-1.5 gap-y-1",children:H.map((w,oe)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:w.fn,value:w.value,color:w.color})},oe))})]})}),(()=>{const w=[{fn:"topology.edges",value:String(l),group:"worker",color:"green"},{fn:"topology.ghostNodes",value:String(o),group:"worker",color:"purple"},{fn:"sparkline.nodes",value:`${v}`,group:"worker",color:"green"},...m?[{fn:"trace.directedLinks",value:String(x.totalDirectedLinks),group:"worker",color:"teal"},{fn:"trace.meanSnr",value:`${x.meanSnr.toFixed(1)} dB`,group:"worker",color:"teal"}]:[],...H];return e.jsx(se,{tokens:w})})()]})})})}function Bt(t,s,r,c){var n;const a=t.src_hash?Se(t.src_hash):"";if(t._advertSender&&s.hash&&s.confident)return{tier:1,label:"_advertSender → pubkey",detail:"ADVERT carried full 32-byte public key — definitive match"};if(c&&s.confident&&((n=s.name)==null?void 0:n.toLowerCase())===c.toLowerCase())return{tier:1.5,label:"decrypt.senderName → nameToHash",detail:`Decrypted sender name “${c}” matched neighbor — high-confidence`};if(a&&r.crossClassPrefixes.has(a))return{tier:2,label:"cross-class prefix",detail:"Prefix has mixed types (repeater + non-repeater); payload type narrows to one class"};if(s.confident){const l=r.prefixIndex.get(a);return(l==null?void 0:l.length)===1?{tier:3,label:"single candidate",detail:"Only one node matches this prefix — unambiguous"}:{tier:3,label:"resolver",detail:"Multi-signal scoring selected best candidate from collision set"}}return{tier:4,label:"ambiguous",detail:"Cannot confidently resolve — multiple same-class candidates, insufficient scoring separation"}}function It(t,s){const r=t.original_path??t.forwarded_path,c=new Set;if(r&&Array.isArray(r))for(const a of r){const n=String(a).toUpperCase().slice(0,2);n.length>=2&&n!==s&&c.add(n)}return c}function Gt(t,s,r,c,a,n,l){const o=Math.floor(Date.now()/1e3),x=new Map(r.map(m=>[m.hash,m]));return t.map(m=>{const g=s[m.hash],u=x.get(m.hash);let v=!0,N="";c!=="unknown"?m.type!=="unknown"&&m.type!==c?(v=!1,N=`${m.type} ≠ required ${c}`):m.type===c?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const f=!!(g!=null&&g.zero_hop),k=(g==null?void 0:g.last_seen)??0;let $=0;if(f&&k>0){const b=(o-k)/3600;$=50*Math.exp(-b/l)}let h=0;if(k>0){const b=(o-k)/3600;h=Math.exp(-b/n)}const y=h*20,p=!!(g!=null&&g.latitude&&(g!=null&&g.longitude)&&(g.latitude!==0||g.longitude!==0)),_=p?5:0,H=(u==null?void 0:u.advertCount)??0,C=Math.min(H*2,30),D=(u==null?void 0:u.forwarderPrefixes.size)??0,L=Math.min(D*3,15);let P=0;if(u&&u.totalForwarderObservations>0&&a.size>0){let b=0;for(const w of a)u.forwarderPrefixes.has(w)&&b++;P=b/a.size}const R=$+y+_+C+L;return{hash:m.hash,name:m.name,type:m.type,roleCompatible:v,roleReason:N,zeroHop:f,zeroHopScore:$,lastSeen:k,recencyScore:h,recencyPoints:y,hasGps:p,gpsScore:_,advertCount:H,advertScore:C,topoWidth:D,topoScore:L,affinity:P,total:R}}).sort((m,g)=>g.total-m.total)}function Kt({packet:t,pipeline:s,resolved:r,resolveTimeMs:c,advertName:a,neighbors:n,decrypted:l}){var ie,de;const o=Y(j=>j.neighborContext),x=Y(j=>j.topologyProfiles),m=Y(j=>j.config),{analysis:g}=s,u=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Se(t.src_hash):"",N=v?o.prefixIndex.get(v)??[]:[],f=v?x.get(v)??[]:[],k=g.pType??-1,$=k>=0?k.toString(16).toUpperCase().padStart(2,"0"):"??",h=g.inferredType,y=g.advertType,p=g.effectiveType,_=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((ie=l==null?void 0:l.decoded)==null?void 0:ie.senderName)??null,C=Bt(t,u,o,H),D=T.useMemo(()=>It(t,v),[t,v]),L=g.pathLen,P=T.useMemo(()=>Gt(N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours),[N,n,f,p,D,m.recencyDecayHours,m.zeroHopDecayHours]),R=P.filter(j=>!j.roleCompatible),b=P.filter(j=>j.roleCompatible),w=t._advertSender?o.pubKeyMap.get(t._advertSender)??null:null,oe=C.tier===1,De=[{fn:"src_hash",value:v||"",active:!!v,color:"blue"},{fn:"_advertSender",value:t._advertSender?t._advertSender.slice(0,12)+"…":"",active:!!t._advertSender,color:"blue"},{fn:"_advertNodeType",value:_?`0x${_}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:L!=null?L===0?"zero-hop":String(L):"",active:L!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!w,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!w,color:"zinc"}],Pe=[{label:"payload",detail:`inferDeviceType(0x${$}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:_?`mapAdvertTypeCode(0x${_}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:p==="unknown",color:"zinc"}],Me=u.name??((de=u.hash)==null?void 0:de.slice(0,12))??"?",Re=u.confident?"confident":"ambiguous",Ae=`→ ${Me} (${Re}, Tier ${C.tier})`;return e.jsx(le,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Ae,timeMs:c,children:e.jsx(U,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(Ct,{tokens:De,nextFn:"resolvePacketSource()"})}),t.src_hash?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(ae,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:w?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:w,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),u.name&&a===u.name&&e.jsx(S,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(M,{color:"green",children:"Tier 1"}),e.jsx(S,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(S,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(S,{children:"no _advertSender — skip to prefix resolution"})})})]}),oe?e.jsx("div",{className:"border-t border-edge-subtle py-2",children:e.jsx("p",{className:"text-[11px] text-fg-muted/40 font-mono ml-3",children:"Steps 2–5 bypassed — pubkey definitive"})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"2"})," ","CANDIDATE POOL — ",N.length," node",N.length!==1?"s":"",' match "',v,'"']}),e.jsxs("div",{className:"space-y-0.5 ml-3",children:[P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:"break-all text-[10px]",children:j.hash}),e.jsx(M,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]},j.hash)),N.length===0&&e.jsx(S,{children:"no known nodes for this prefix"})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(ae,{options:Pe,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:p,color:p!=="unknown"?h!=="unknown"?"amber":"green":"zinc"})})})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"4"})," ","ROLE-TYPE SCRUB"]}),e.jsx("div",{className:"space-y-0.5 ml-3",children:P.map(j=>e.jsxs("div",{className:"flex gap-2 items-center text-[11px]",children:[e.jsx("span",{className:j.roleCompatible?"text-sys-green":"text-sys-red",children:j.roleCompatible?"✓":"✗"}),e.jsx("span",{className:`break-all text-[10px] ${j.roleCompatible?"":"line-through text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(S,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),R.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[R.length," eliminated, ",b.length," surviving"]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),b.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):b.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(S,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:b[0].hash}),b[0].name&&e.jsx(S,{c:"text-fg-muted ml-1",children:b[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[b.length," candidates scored…"]})}),e.jsx(V,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:b.map(j=>{const J=j.hash===u.hash;return e.jsxs("div",{className:`text-[11px] leading-relaxed rounded px-2 py-1 ${J?"bg-sys-green/8 border border-sys-green/20":"bg-zinc-500/5"}`,children:[e.jsxs("div",{className:"flex gap-2 items-center mb-0.5",children:[e.jsx(S,{c:J?"text-sys-green":"text-fg-muted",children:J?"→":" "}),e.jsx("span",{className:`break-all text-[10px] ${J?"text-fg-primary":"text-fg-muted"}`,children:j.hash}),e.jsx(M,{color:J?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(S,{children:j.name})]}),e.jsxs("div",{className:"ml-4 flex flex-wrap gap-x-3 gap-y-0.5",children:[e.jsxs("span",{children:[e.jsx(S,{children:"zero_hop:"})," ",e.jsx(S,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"recency:"})," ",e.jsx(S,{c:"text-fg-primary",children:mt(j.lastSeen)})," ",e.jsxs(M,{color:ee(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"gps:"})," ",e.jsx(S,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(M,{color:ee(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"adverts:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(M,{color:ee(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(S,{children:"topo:"})," ",e.jsx(S,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(M,{color:ee(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(S,{children:"score ≈"})," ",e.jsx(S,{c:"text-fg-primary font-bold",children:j.total.toFixed(1)})]})]},j.hash)})})})]})]})]}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:[e.jsxs("p",{className:"text-fg-muted mb-1",children:[e.jsx(S,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:u.hash?e.jsx(d,{fn:"resolved.hash",value:u.hash,color:"green"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:u.type,color:u.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:u.name?e.jsx(d,{fn:"resolved.name",value:u.name,color:u.confident?"green":"amber"}):e.jsx(S,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(S,{c:u.confident?"text-sys-green":"text-sys-red",children:String(u.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(M,{color:C.tier<=2?"green":C.tier===3?"amber":"red",children:C.tier}),e.jsx(S,{c:"text-fg-primary ml-1",children:C.label})]})]})]})]}):e.jsx("div",{className:"border-t border-edge-subtle pt-2 pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-mono",children:[e.jsx(S,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),u.confident?e.jsxs(S,{c:"text-sys-green",children:["→ resolved via ",C.label]}):e.jsx(S,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:u.hash??"null",group:"resolution",color:u.confident?"green":"zinc"},{fn:"resolved.type",value:u.type,group:"resolution",color:u.type!=="unknown"?u.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:u.name??"null",group:"resolution",color:u.confident?"green":u.name?"amber":"zinc"},{fn:"resolved.confident",value:String(u.confident),group:"resolution",color:u.confident?"green":"red"}];return e.jsx(se,{tokens:j})})()]})})})}const Vt={id:"packet-parse",label:"Packet Parse",inputs:["rawPacket"],outputs:["parsedPacket","decoded","headerFields"],emits:[{fn:"routeType",group:"wire",color:"blue"},{fn:"payloadType",group:"wire",color:"blue"},{fn:"pathLength",group:"wire",color:"blue"},{fn:"version",group:"wire",color:"blue"}],async:!1,observatoryStage:0},Ut={id:"enrichment",label:"Ingestion Enrichment",inputs:["parsedPacket"],outputs:["advertSender","channelHash","hopData","byteLength"],emits:[{fn:"_advertSender",group:"enrichment",color:"blue"},{fn:"_advertNodeType",group:"enrichment",color:"blue"},{fn:"_channelHash",group:"enrichment",color:"blue"},{fn:"_hopCount",group:"enrichment",color:"blue"},{fn:"_isZeroHop",group:"enrichment",color:"blue"},{fn:"_byteLength",group:"enrichment",color:"blue"}],async:!1,observatoryStage:1},qt={id:"topology",label:"Topology Analysis",inputs:["packets","neighbors","srcHashResolver"],outputs:["edges","nodeMetrics","pathHealth","ghostNodes","centrality","loops"],emits:[{fn:"edges",group:"worker",color:"green"},{fn:"ghostNodes",group:"worker",color:"purple"},{fn:"loops",group:"analysis",color:"amber"},{fn:"nodeMetrics",group:"worker",color:"green"},{fn:"pathHealth",group:"worker",color:"green"},{fn:"centrality",group:"worker",color:"green"}],async:!0,worker:"topology.worker.ts",observatoryStage:2},Wt={id:"trace-enrichment",label:"Trace Link Quality",inputs:["packets","prefixLookup","srcHashResolver","edges","pathHealth","nodeMetrics"],outputs:["traceLinks","traceLinkSummary","traceDisambiguationFeedback"],emits:[{fn:"traceLinks.directed",group:"worker",color:"teal"},{fn:"traceLinks.bidir",group:"worker",color:"teal"},{fn:"traceSummary.meanSnr",group:"analysis",color:"green"},{fn:"traceSummary.medianSnr",group:"analysis",color:"zinc"},{fn:"traceSummary.confidence",group:"analysis",color:"zinc"},{fn:"feedback.confirmed",group:"worker",color:"teal"},{fn:"feedback.links",group:"worker",color:"teal"}],async:!1,observatoryStage:2},Yt={id:"disambiguation",label:"Source Disambiguation",inputs:["packets","neighbors","decodedMessages"],outputs:["srcHashResolverMap","neighborContext"],emits:[{fn:"resolvedHash",group:"resolution",color:"purple"},{fn:"resolvedName",group:"resolution",color:"purple"},{fn:"resolvedType",group:"resolution",color:"purple"},{fn:"confidence",group:"resolution",color:"green"}],async:!1,observatoryStage:3},Zt={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},Xt={id:"decryption",label:"Channel Decryption",inputs:["packets","channelKeys"],outputs:["decodedMessages"],emits:[{fn:"decrypt.text",group:"crypto",color:"teal"},{fn:"decrypt.senderName",group:"crypto",color:"teal"},{fn:"decrypt.channelName",group:"crypto",color:"teal"},{fn:"decrypt.macCorrupted",group:"crypto",color:"amber"}],async:!0,worker:"decryption.worker.ts",observatoryStage:2},Jt={id:"decoded-content",label:"Decoded Content Policy",inputs:["decodedMessages","packets"],outputs:["decodedContent","contentInheritance"],emits:[{fn:"content.senderName",group:"crypto",color:"teal"},{fn:"content.text",group:"crypto",color:"teal"},{fn:"content.channelName",group:"crypto",color:"teal"},{fn:"content.corrupted",group:"crypto",color:"amber"},{fn:"content.inherited",group:"analysis",color:"purple"}],async:!1},Z=[Vt,Ut,qt,Wt,Yt,Zt,Xt,Jt],Qt=new Map(Z.map(t=>[t.id,t])),es=new Map;for(const t of Z)for(const s of t.emits)es.set(s.fn,t);const $e=new Map;for(const t of Z)for(const s of t.outputs)$e.set(s,t);function ts(){const t=new Map,s=new Map;for(const a of Z)t.has(a.id)||t.set(a.id,0),s.has(a.id)||s.set(a.id,new Set);for(const a of Z)for(const n of a.inputs){const l=$e.get(n);if(l&&l.id!==a.id){const o=s.get(l.id);o.has(a.id)||(o.add(a.id),t.set(a.id,(t.get(a.id)??0)+1))}}const r=[];for(const[a,n]of t)n===0&&r.push(a);const c=[];for(;r.length>0;){const a=r.shift(),n=Qt.get(a);n&&c.push(n);for(const l of s.get(a)??[]){const o=(t.get(l)??1)-1;t.set(l,o),o===0&&r.push(l)}}for(const a of Z)c.includes(a)||c.push(a);return c}const ss={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function ns({stage:t,isActive:s,onClick:r}){const c=t.observatoryStage!=null?ss[t.observatoryStage]??"text-fg-muted":"text-fg-muted/40";return e.jsxs("button",{type:"button",onClick:r,className:` flex items-center gap-1.5 w-full px-1.5 py-1 rounded transition-base text-left ${s?"bg-sys-blue/10 ring-1 ring-sys-blue/30":"hover:bg-zinc-500/5"} `,children:[e.jsx("span",{className:`font-mono text-[9px] font-bold w-3 shrink-0 text-center ${c}`,children:t.observatoryStage??"·"}),e.jsx("span",{className:"font-mono text-[9px] text-fg-primary truncate flex-1",children:t.label}),t.async&&e.jsx("span",{className:"font-mono text-[7px] px-1 py-px rounded bg-sys-amber/15 text-sys-amber shrink-0 leading-tight",children:"⚡"}),t.emits.length>0&&e.jsxs("span",{className:"flex items-center gap-px shrink-0",children:[t.emits.slice(0,6).map(a=>{var n;return e.jsx("span",{className:`inline-block w-1 h-1 rounded-full ${((n=I[a.color])==null?void 0:n.dot)??"bg-zinc-500"}`,title:`${a.fn} [${a.group}]`},a.fn)}),t.emits.length>6&&e.jsxs("span",{className:"font-mono text-[7px] text-fg-muted/40 ml-0.5",children:["+",t.emits.length-6]})]})]})}function rs({activeStageId:t,onStageClick:s}){const r=T.useMemo(()=>ts(),[]),c=T.useMemo(()=>{const a=new Map;for(const l of r){const o=l.observatoryStage??"other";let x=a.get(o);x||(x=[],a.set(o,x)),x.push(l)}const n=[];for(const l of[0,1,2,3,"other"]){const o=a.get(l);o!=null&&o.length&&n.push({key:l,stages:o})}return n},[r]);return e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"font-mono text-[8px] text-fg-muted/40 uppercase tracking-widest",children:"Pipeline DAG"}),e.jsxs("span",{className:"font-mono text-[8px] text-fg-muted/30",children:[r.length," stages"]})]}),e.jsx("div",{className:"space-y-px",children:c.map((a,n)=>e.jsxs("div",{children:[n>0&&e.jsx("div",{className:"flex items-center pl-2.5 py-px",children:e.jsx("svg",{width:"6",height:"8",viewBox:"0 0 6 8",className:"text-fg-muted/20",children:e.jsx("path",{d:"M3 0 L3 6 M1 4 L3 6 L5 4",fill:"none",stroke:"currentColor",strokeWidth:"1"})})}),a.stages.map(l=>e.jsx(ns,{stage:l,isActive:t===l.id,onClick:s?()=>s(l.id):void 0},l.id))]},String(a.key)))})]})}const ve=200,z={status:"idle",lastDurationMs:null,lastTs:null,runCount:0};function as(t,s,r){var c,a,n;switch(t.type){case"transport:ws:state":s.wsState=((c=t.data)==null?void 0:c.state)??r.wsState;break;case"transport:ws:packet":s.wsPacketCount=(s.wsPacketCount??r.wsPacketCount)+1;break;case"transport:ws:stats":s.wsStatsCount=(s.wsStatsCount??r.wsStatsCount)+1;break;case"transport:rest:stats":s.restStatsCount=(s.restStatsCount??r.restStatsCount)+1;break;case"transport:rest:packets":s.restPacketsCount=(s.restPacketsCount??r.restPacketsCount)+1;break;case"store:packets:ws-merge":s.wsMergeCount=(s.wsMergeCount??r.wsMergeCount)+1;break;case"cascade:hydrate":s.lastHydrateTs=t.ts,s.hydrateCount=(s.hydrateCount??r.hydrateCount)+1;break;case"worker:topology:start":case"worker:sparkline:start":{const l=t.type.split(":")[1],o=s.workers??r.workers,x=o[l]??{...z};s.workers={...o,[l]:{...x,status:"running",lastTs:t.ts}}}break;case"worker:topology:done":case"worker:sparkline:done":{const l=t.type.split(":")[1],o=s.workers??r.workers,x=o[l]??{...z},m=((a=t.data)==null?void 0:a.ms)??null;s.workers={...o,[l]:{...x,status:"done",lastDurationMs:m,lastTs:t.ts,runCount:x.runCount+1}}}break;case"worker:decryption:batch":{const l=s.workers??r.workers,o=l.decryption??{...z},x=((n=t.data)==null?void 0:n.ms)??null;s.workers={...l,decryption:{...o,status:"done",lastDurationMs:x,lastTs:t.ts,runCount:o.runCount+1}}}break;case"pipeline:disambig:recompute":s.disambigCount=(s.disambigCount??r.disambigCount)+1;break}}const te=rt(t=>({events:[],eventCount:0,wsState:"disconnected",wsPacketCount:0,wsStatsCount:0,restStatsCount:0,restPacketsCount:0,workers:{topology:{...z},sparkline:{...z},decryption:{...z}},wsMergeCount:0,lastHydrateTs:null,hydrateCount:0,disambigCount:0,lastDisambigMs:null,_pushBatch:s=>t(r=>{if(s.length===0)return r;let c=[...r.events,...s];c.length>ve&&(c=c.slice(c.length-ve));const a={events:c,eventCount:r.eventCount+s.length};for(const n of s)as(n,a,r);return a}),clear:()=>t({events:[],eventCount:0,wsState:"disconnected",wsPacketCount:0,wsStatsCount:0,restStatsCount:0,restPacketsCount:0,workers:{topology:{...z},sparkline:{...z},decryption:{...z}},wsMergeCount:0,lastHydrateTs:null,hydrateCount:0,disambigCount:0,lastDisambigMs:null})}));let W=null,B=[],X=null;function ls(){if(X=null,B.length===0)return;const t=B;B=[],te.getState()._pushBatch(t)}function os(){W||(B=[],W=at.subscribe(t=>{B.push(t),X===null&&(X=requestAnimationFrame(ls))}))}function cs(){if(W==null||W(),W=null,X!==null&&(cancelAnimationFrame(X),X=null),B.length>0){const t=B;B=[],te.getState()._pushBatch(t)}}function is(t){switch(t){case"active":return"●";case"skipped":return"○";case"inferred":return"◌"}}function ds(t){switch(t){case"active":return"text-sys-green";case"skipped":return"text-fg-muted/30";case"inferred":return"text-sys-amber"}}function us(t){switch(t){case"transport":return"text-sys-blue";case"store":return"text-sys-amber";case"worker":return"text-sys-violet";case"pipeline":return"text-sys-green";case"consumer":return"text-sys-teal"}}function ps(t,s,r,c,a){var m,g;const n=[];if(a?n.push({label:"Hex Input",detail:"Manual hex — no transport",status:"skipped",lane:"transport"}):s.age==="live"||s.age==="recent"?n.push({label:"WebSocket",detail:"ws:packet → real-time push",status:"active",lane:"transport"}):n.push({label:"REST Poll",detail:"fetchPackets → packetCache.poll()",status:"inferred",lane:"transport"}),!a){n.push({label:"Cache Merge",detail:"packetCache.mergePacketsDirectly()",status:"active",lane:"store"});const u=s.age==="live"||s.age==="recent";n.push({label:"Flash",detail:u?"flashReceived++ → sidebar blink":"Not newest — no flash",status:u?"active":"skipped",lane:"store"}),n.push({label:"Hydrate Cascade",detail:"hydrateDownstream() → schedule workers",status:"active",lane:"store"})}const l=s.pathAvail||s.pathHopCount>0;n.push({label:"Topology Worker",detail:l?`Path data (${s.pathHopCount} hops) → edge extraction`:"No path data — still included in batch recompute",status:"active",lane:"worker"}),n.push({label:"Sparkline Worker",detail:`Contributes to sparkline for src ${((m=t.src_hash)==null?void 0:m.slice(0,4))??"??"}`,status:"active",lane:"worker"});const o=s.isGrp;n.push({label:"Decryption Worker",detail:o?`GRP_TXT → queued for channel key search${c?" → decrypted ✓":""}`:`${s.payloadTypeName} — not encrypted, skipped`,status:o?"active":"skipped",lane:"worker"}),n.push({label:"Source Disambiguation",detail:r?`→ ${r.name??((g=r.hash)==null?void 0:g.slice(0,8))??"?"} (${r.type}${r.confident?", confident":", ambiguous"})`:"Pending recompute",status:r?"active":"inferred",lane:"pipeline"}),s.isAdvert&&n.push({label:"ADVERT Discovery",detail:"pubkey → extended hash-to-type + name extraction",status:"active",lane:"pipeline"}),o&&(c!=null&&c.decoded)&&n.push({label:"Decoded Content Policy",detail:`macCorrupted=${c.decoded.macCorrupted?"true":"false"} → cross-hash inheritance`,status:"active",lane:"pipeline"});const x=["Packets","Dashboard","Statistics"];return l&&x.push("Map","Graph"),s.isTrace&&x.push("Trace Detail"),n.push({label:"Page Hydration",detail:x.join(", "),status:"active",lane:"consumer"}),n}const xs=[],hs=["transport","store","worker","pipeline","consumer"],ms={transport:"Transport",store:"Store",worker:"Workers",pipeline:"Pipeline",consumer:"Consumers"};function gs(t){return t.replace("transport:","").replace("store:packets:","").replace("cascade:","").replace("worker:","w:").replace("pipeline:","p:").replace("packet","pkt").replace("sparkline","spark").replace("topology","topo").replace("decryption","dec").replace("disambig","dis").replace("recompute","recomp")}function fs(t){return t.startsWith("transport:")?"text-sys-blue":t.startsWith("store:")||t.startsWith("cascade:")?"text-sys-amber":t.startsWith("worker:")?"text-sys-violet":t.startsWith("pipeline:")?"text-sys-green":"text-fg-muted"}const bs=T.memo(function({event:s}){const r=`${(s.ts/1e3).toFixed(1)}s`,c=s.data?Object.entries(s.data).map(([a,n])=>{var l;return`${a}=${typeof n=="number"?((l=n.toFixed)==null?void 0:l.call(n,1))??n:n}`}).join(" "):"";return e.jsxs("div",{className:"flex gap-2 text-[9px] font-mono leading-tight",children:[e.jsx("span",{className:"text-fg-muted/40 w-12 shrink-0 text-right",children:r}),e.jsx("span",{className:`w-20 shrink-0 ${fs(s.type)}`,children:gs(s.type)}),e.jsx("span",{className:"text-fg-muted/60 truncate",children:c})]})});function ys({packet:t,pipeline:s,resolved:r,decrypted:c,isSynthetic:a,liveMode:n}){const[l,o]=T.useState(!1);T.useEffect(()=>{if(l)return os(),()=>{cs()}},[l]);const x=s==null?void 0:s.analysis,m=T.useMemo(()=>!t||!x?null:ps(t,x,r,c,a),[t,x,r,c,a]),g=T.useMemo(()=>{if(!m)return null;const h=new Map;for(const y of m){let p=h.get(y.lane);p||(p=[],h.set(y.lane,p)),p.push(y)}return h},[m]),u=te(h=>l?h.events:xs),v=te(h=>l?h.eventCount:0),N=te(h=>h.clear),f=T.useRef(null);T.useEffect(()=>{l&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[v,l]);const k=(m==null?void 0:m.filter(h=>h.status==="active").length)??0,$=(m==null?void 0:m.length)??0;return e.jsxs(G,{defaultOpen:!0,children:[e.jsx(K,{className:"text-[10px]",children:e.jsxs("span",{className:"flex items-center gap-2 font-mono",children:[e.jsx("span",{className:"text-sys-green",children:"CFT"}),e.jsx("span",{className:"text-fg-muted/40",children:"Control Flow Trace"}),t&&e.jsxs("span",{className:"text-fg-muted/30",children:["— ",k,"/",$," stages active"]})]})}),e.jsx(V,{children:e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3 space-y-3",children:[t?g?e.jsx("div",{className:"space-y-2",children:hs.map(h=>{const y=g.get(h);return y?e.jsxs("div",{children:[e.jsx("div",{className:`text-[8px] uppercase tracking-widest font-mono mb-0.5 ${us(h)}`,children:ms[h]}),y.map((p,_)=>e.jsxs("div",{className:"flex items-start gap-1.5 text-[10px] font-mono leading-snug ml-1",children:[e.jsx("span",{className:`shrink-0 ${ds(p.status)}`,children:is(p.status)}),e.jsx("span",{className:"text-fg-primary",children:p.label}),e.jsx("span",{className:"text-fg-muted/50 truncate",children:p.detail})]},_))]},h):null})}):null:e.jsx("div",{className:"text-[9px] text-fg-muted/30 font-mono py-2 text-center",children:"Select a packet to trace its flow"}),e.jsxs("div",{className:"border-t border-edge-subtle pt-2 flex items-center gap-2",children:[e.jsx("button",{onClick:()=>o(h=>!h),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${l?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:l?"● LIVE":"○ LIVE"}),e.jsx("span",{className:"text-[9px] text-fg-muted/40 font-mono",children:l?`${v} events`:"Subscribe to all pipeline events"}),l&&e.jsx("button",{onClick:N,className:"text-[9px] text-fg-muted/40 hover:text-fg-muted font-mono transition-colors ml-auto",children:"clear"})]}),l&&e.jsx("div",{ref:f,className:"max-h-32 overflow-y-auto space-y-px",children:u.length===0?e.jsx("div",{className:"text-[9px] text-fg-muted/30 font-mono py-1 text-center",children:"Waiting for events…"}):u.map((h,y)=>e.jsx(bs,{event:h},`${h.ts}-${y}`))})]})})]})}function js(t){const s=Ne(t.type??t.payload_type??-1).padEnd(7),r=t.packet_hash.slice(0,8),c=(t.src_hash??"—").replace(/^0x/i,"").slice(0,4).toUpperCase(),a=t._hopCount!=null?`${t._hopCount}h`:"",n=dt(t.timestamp);return`${r} ${s} ←${c} ${t.rssi}dBm ${a} ${n}`}function Ss(){const t=lt(),s=ot(),r=ct(),c=(s==null?void 0:s.neighbors)??{},a=Y(b=>b.resolveSource),n=Y(b=>b.config),l=Y(b=>b.setConfig),[o,x]=T.useState(-1),m=T.useMemo(()=>{let b=t;return o!==-1&&(b=t.filter(w=>(w.type??w.payload_type)===o)),b.slice(-50).reverse()},[t,o]),[g,u]=T.useState(""),[v,N]=T.useState(""),[f,k]=T.useState(!1),$=T.useRef(r);T.useEffect(()=>{f&&r!==$.current&&m.length>0&&(u(m[0].packet_hash),N("")),$.current=r},[r,f,m]),T.useEffect(()=>{!g&&m.length>0&&!v&&u(m[0].packet_hash)},[g,m,v]);const h=T.useMemo(()=>v.trim()?null:m.find(b=>b.packet_hash===g)??null,[g,m,v]),y=T.useMemo(()=>{const b=v.replace(/\s+/g,"").trim();return b?{packet_hash:"manual-hex-input",timestamp:0,rssi:0,snr:0,transmitted:!1,drop_reason:null,is_duplicate:!1,raw_packet:b}:null},[v]),p=h??y,_=!!v.trim(),H=v.trim().replace(/\s+/g,"")||(p==null?void 0:p.raw_packet),C=wt(p,H,t),D=(C==null?void 0:C.enrichment)??He,L=Ce((p==null?void 0:p.packet_hash)??""),P=T.useRef(0),R=T.useMemo(()=>{if(!p)return null;const b=performance.now(),w=a(p);return P.current=performance.now()-b,w},[p,a]);return e.jsxs("div",{className:"max-w-[960px] mx-auto",children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("h1",{className:"text-sm font-bold text-fg-primary tracking-wide font-mono",children:"PACKET OBSERVATORY"}),e.jsx("p",{className:"text-[11px] text-fg-muted font-mono",children:"Pipeline introspection — select a packet to trace its journey"})]}),e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3 mb-3",children:[e.jsxs("div",{className:"flex gap-2 items-center flex-wrap",children:[e.jsxs("select",{value:o,onChange:b=>{x(Number(b.target.value)),u("")},className:"surface-input px-2 py-1 rounded text-[11px] font-mono text-fg-primary w-36",children:[e.jsx("option",{value:-1,children:"ALL TYPES"}),Object.entries(it).map(([b,w])=>e.jsxs("option",{value:Number(b),children:["0x",Number(b).toString(16).toUpperCase().padStart(2,"0")," ",w]},b))]}),e.jsxs("select",{value:g,onChange:b=>{u(b.target.value),N("")},className:"surface-input flex-1 min-w-0 px-2 py-1 rounded text-[11px] font-mono text-fg-primary truncate",children:[m.map((b,w)=>e.jsx("option",{value:b.packet_hash,children:js(b)},`${b.packet_hash}-${w}`)),m.length===0&&e.jsxs("option",{value:"",children:["No packets",o!==-1?" matching filter":" loaded"]})]}),e.jsx("button",{onClick:()=>k(b=>!b),className:`px-2 py-1 rounded text-[11px] font-mono transition-colors shrink-0 ${f?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:f?"● LIVE":"○ LIVE"})]}),e.jsxs(G,{children:[e.jsx(K,{className:"text-[10px] text-fg-muted/50 hover:text-fg-muted mt-1.5",children:e.jsx("span",{className:"font-mono",children:"Paste hex…"})}),e.jsx(V,{children:e.jsx("textarea",{value:v,onChange:b=>N(b.target.value),placeholder:"Paste raw packet hex (overrides dropdown)",rows:2,className:"surface-input w-full mt-1 px-2 py-1 rounded text-[11px] font-mono text-fg-primary resize-y"})})]})]}),e.jsxs(G,{children:[e.jsx(K,{className:"text-[11px] mb-3 w-full",children:e.jsxs("span",{className:"flex items-center gap-2 font-mono",children:[e.jsx("span",{className:"text-fg-muted/50",children:"⚙"}),e.jsx("span",{className:"text-fg-muted/50",children:"Pipeline Config & Dev Tools"}),e.jsxs("span",{className:"text-fg-muted/30 text-[10px]",children:["disambig=",n.disambiguationEnabled?"on":"off"," mac=",n.macCorruptedPolicy," decay=",n.recencyDecayHours,"h"]})]})}),e.jsx(V,{children:e.jsxs("div",{className:"space-y-3 mb-4",children:[e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3",children:[e.jsx("h2",{className:"text-[10px] text-fg-muted/50 uppercase tracking-widest font-mono mb-2",children:"Pipeline Config"}),e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Disambiguation"}),e.jsx("button",{onClick:()=>l({disambiguationEnabled:!n.disambiguationEnabled}),className:`px-2 py-0.5 rounded text-[11px] font-mono transition-colors ${n.disambiguationEnabled?"bg-sys-green/20 text-sys-green":"bg-sys-red/20 text-sys-red"}`,children:n.disambiguationEnabled?"● ON":"○ OFF"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"MAC policy"}),e.jsxs("select",{value:n.macCorruptedPolicy,onChange:b=>l({macCorruptedPolicy:b.target.value}),className:"surface-input px-1.5 py-0.5 rounded text-[11px] font-mono text-fg-primary",children:[e.jsx("option",{value:"strict",children:"strict (drop)"}),e.jsx("option",{value:"name-only",children:"name-only"}),e.jsx("option",{value:"permissive",children:"permissive"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Recency decay"}),e.jsx("input",{type:"range",min:1,max:48,step:1,value:n.recencyDecayHours,onChange:b=>l({recencyDecayHours:Number(b.target.value)}),className:"flex-1 h-1 accent-sys-blue"}),e.jsxs("span",{className:"text-[11px] font-mono text-fg-primary w-8 text-right",children:[n.recencyDecayHours,"h"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{className:"text-[11px] text-fg-muted w-24 shrink-0",children:"Zero-hop decay"}),e.jsx("input",{type:"range",min:12,max:168,step:6,value:n.zeroHopDecayHours,onChange:b=>l({zeroHopDecayHours:Number(b.target.value)}),className:"flex-1 h-1 accent-sys-blue"}),e.jsxs("span",{className:"text-[11px] font-mono text-fg-primary w-10 text-right",children:[n.zeroHopDecayHours,"h"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsx(ys,{packet:p,pipeline:C,resolved:R,decrypted:L??null,isSynthetic:_,liveMode:f}),e.jsx(rs,{})]})]})})]}),p?e.jsxs("div",{className:"space-y-1",children:[e.jsx(kt,{packet:p,isSynthetic:_}),e.jsx(Rt,{packet:p,pipeline:C,rawHex:H,traceTagIndex:(C==null?void 0:C.traceTagIndex)??new Map,neighbors:c}),e.jsx(zt,{packet:p,decrypted:L??void 0,pipeline:C}),e.jsx(Kt,{packet:p,pipeline:C,resolved:R,decrypted:L??void 0,resolveTimeMs:P.current,neighbors:c,advertName:D.advertName})]}):e.jsx("div",{className:"surface-base rounded-lg border border-edge-subtle p-8 text-center",children:e.jsx("p",{className:"text-fg-muted text-xs",children:"Select a packet from the dropdown or paste hex above"})})]})}export{Ss as default}; diff --git a/frontend/dist/assets/Packets-CNQvqRHc.js b/frontend/dist/assets/Packets-D9oGi0fh.js similarity index 96% rename from frontend/dist/assets/Packets-CNQvqRHc.js rename to frontend/dist/assets/Packets-D9oGi0fh.js index fb95739b..258f6291 100644 --- a/frontend/dist/assets/Packets-CNQvqRHc.js +++ b/frontend/dist/assets/Packets-D9oGi0fh.js @@ -1,4 +1,4 @@ -import{r as c,au as _,av as ut,aw as We,ax as Te,ay as ie,az as dt,aA as pt,aB as ce,aC as Ye,aD as mt,aE as bt,aF as ft,aG as ge,aH as vt,aI as xt,aJ as Oe,aK as U,aL as gt,aM as ke,aN as X,aO as re,aP as $e,aQ as je,aR as ht,aS as Xe,aT as Qe,aU as he,aV as Pe,aW as ye,aX as yt,aY as St,aZ as Ct,a_ as Re,a$ as Ot,b0 as Nt,b1 as Ce,b2 as wt,b3 as Et,b4 as jt,b5 as Pt,b6 as W,b7 as It,b8 as Tt,b9 as kt,ba as $t,bb as Rt,bc as Mt,bd as Ft,be as Dt,bf as _t,bg as At,bh as Vt,bi as Me,d as Lt,j as l,c as Q,ao as zt,D as Bt,E as Ht,bj as Ut,G as Gt,K as Kt,Q as qt,V as Wt,ak as Yt,ar as Xt,W as Fe,bk as De,bl as _e,bm as Ae,B as we,bn as Ve,N as Le,bo as ze,T as Qt}from"./index-CvSa8h-C.js";import{c as Jt}from"./node-types-BJsOTMm_.js";import{u as Zt,C as eo}from"./circle-x-BDVzq0qX.js";import{c as H,p as to,a as ve,f as Be,b as oo,L as ao,S as me,s as no,u as He,d as so,g as lo,e as io,h as ro}from"./element-movement-CM_Y2Bj0.js";import{F as co,y as uo,R as po,T as mo,w as Ue,A as bo}from"./map-pin-BCwmmHGs.js";import{g as Je,u as fo,R as vo,P as xo}from"./PacketList-Bpo20OVL.js";import{useGetDecodedContent as go,useResolveSource as ho}from"./usePipelineStore-pGK8Y5O7.js";import{c as yo,a as So,D as Co,b as Oo}from"./AnalyzerFilterPanel-BUuyWAmX.js";import{u as No,r as wo}from"./consumer-registry-BsBD_8RF.js";import{A as Eo}from"./arrow-up-DQmOy4Je.js";import{A as jo}from"./SignalIndicator-B0ppyCo-.js";import{P as Po,a as Io,B as To,C as Ge}from"./PageLayout-B8orsDlo.js";import{T as ko,M as $o}from"./MqttModeBadge-CGW6hCWV.js";import{F as Ke}from"./funnel-DLa9oQpD.js";import{S as Ro}from"./search-BZtD4Hr8.js";import"./primitives-BahnzDua.js";import"./badge-colors-MuK22b26.js";import"./chat-utils-BUBqf9vH.js";import"./chevron-right-1kmv-Vqa.js";import"./circle-question-mark-DDUlGgWh.js";import"./triangle-alert-C7tm61-l.js";import"./DataBox-CwAsAwyY.js";import"./layers-Cnw2L-3K.js";import"./hash-CTme6GHI.js";import"./activity-CctJQ0y-.js";import"./circle-check-DW83e7Fg.js";import"./database-bNR-4XQS.js";import"./useMapViewStore-1D-N8rLK.js";import"./index-CPifxb0-.js";import"./shield-DDEEZTF6.js";import"./zap-mngIm3qT.js";import"./monitor-smartphone-D-7zPu_H.js";function Ze(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return ut(e,"blur",t=>{let s=t.target;Te(s)&&(o.current={value:s.value,selectionStart:s.selectionStart,selectionEnd:s.selectionEnd})}),_(()=>{if(!We(e)&&Te(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==o.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:t,selectionEnd:s}=o.current;t!==null&&s!==null&&e.setSelectionRange(t,s)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}function Mo(e,{container:o,accept:t,walk:s}){let a=c.useRef(t),i=c.useRef(s);c.useEffect(()=>{a.current=t,i.current=s},[t,s]),ie(()=>{if(!o||!e)return;let u=dt(o);if(!u)return;let f=a.current,d=i.current,b=Object.assign(N=>f(N),{acceptNode:f}),h=u.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,b,!1);for(;h.nextNode();)d(h.currentNode)},[o,e,a,i])}var Fo=Object.defineProperty,Do=(e,o,t)=>o in e?Fo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,qe=(e,o,t)=>(Do(e,typeof o!="symbol"?o+"":o,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),J=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(J||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(oe||{}),et=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.DefaultToFirstOption=6]="DefaultToFirstOption",e[e.SetActivationTrigger=7]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",e[e.SetInputElement=9]="SetInputElement",e[e.SetButtonElement=10]="SetButtonElement",e[e.SetOptionsElement=11]="SetOptionsElement",e[e.MarkInputAsMoved=12]="MarkInputAsMoved",e))(et||{});function Ee(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,s=o(e.options.slice()),a=s.length>0&&s[0].dataRef.current.order!==null?s.sort((u,f)=>u.dataRef.current.order-f.dataRef.current.order):bt(s,u=>u.dataRef.current.domRef.current),i=t?a.indexOf(t):null;return i===-1&&(i=null),{options:a,activeOptionIndex:i}}let _o={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?ve.Tracked(oo(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:t,__demoMode:!1}},0(e){var o,t;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let s=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(s!==-1)return{...e,activeOptionIndex:s,comboboxState:0,__demoMode:!1,inputPositionState:ve.Idle}}return{...e,comboboxState:0,inputPositionState:ve.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,s,a,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((s=e.dataRef.current)!=null&&s.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:b,disabled:h}=e.virtual,N=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>b,resolveActiveIndex:()=>{var v,m;return(m=(v=e.activeOptionIndex)!=null?v:b.findIndex(P=>!h(P)))!=null?m:null},resolveDisabled:h,resolveId(){throw new Error("Function not implemented.")}}),C=(a=o.trigger)!=null?a:2;return e.activeOptionIndex===N&&e.activationTrigger===C?e:{...e,activeOptionIndex:N,activationTrigger:C,isTyping:!1,__demoMode:!1}}let u=Ee(e);if(u.activeOptionIndex===null){let b=u.options.findIndex(h=>!h.dataRef.current.disabled);b!==-1&&(u.activeOptionIndex=b)}let f=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:b=>b.id,resolveDisabled:b=>b.dataRef.current.disabled}),d=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===f&&e.activationTrigger===d?e:{...e,...u,isTyping:!1,activeOptionIndex:f,activationTrigger:d,__demoMode:!1}},4:(e,o)=>{var t,s,a,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let u=o.payload,f=Ee(e,b=>(b.push(u),b));e.activeOptionIndex===null&&(a=(s=e.dataRef.current).isSelected)!=null&&a.call(s,o.payload.dataRef.current.value)&&(f.activeOptionIndex=f.options.indexOf(u));let d={...e,...f,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(d.activeOptionIndex=0),d},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(a=>a.id!==o.id)};let s=Ee(e,a=>{let i=a.findIndex(u=>u.id===o.id);return i!==-1&&a.splice(i,1),a});return{...e,...s,activationTrigger:2}},6:(e,o)=>e.defaultToFirstOption===o.value?e:{...e,defaultToFirstOption:o.value},7:(e,o)=>e.activationTrigger===o.trigger?e:{...e,activationTrigger:o.trigger},8:(e,o)=>{var t,s;if(e.virtual===null)return{...e,virtual:{options:o.options,disabled:(t=o.disabled)!=null?t:()=>!1}};if(e.virtual.options===o.options&&e.virtual.disabled===o.disabled)return e;let a=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?a=i:a=null}return{...e,activeOptionIndex:a,virtual:{options:o.options,disabled:(s=o.disabled)!=null?s:()=>!1}}},9:(e,o)=>e.inputElement===o.element?e:{...e,inputElement:o.element},10:(e,o)=>e.buttonElement===o.element?e:{...e,buttonElement:o.element},11:(e,o)=>e.optionsElement===o.element?e:{...e,optionsElement:o.element},12(e){return e.inputPositionState.kind!=="Tracked"?e:{...e,inputPositionState:ve.Moved}}};class Ie extends pt{constructor(o){super(o),qe(this,"actions",{onChange:t=>{let{onChange:s,compare:a,mode:i,value:u}=this.state.dataRef.current;return ce(i,{0:()=>s==null?void 0:s(t),1:()=>{let f=u.slice(),d=f.findIndex(b=>a(b,t));return d===-1?f.push(t):f.splice(d,1),s==null?void 0:s(f)}})},registerOption:(t,s)=>(this.send({type:4,payload:{id:t,dataRef:s}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(s.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,s)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:s})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,s;this.send({type:1}),this.send({type:6,value:!1}),(s=(t=this.state.dataRef.current).onClose)==null||s.call(t)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:t=>{this.send({type:7,trigger:t})},selectActiveOption:()=>{let t=this.selectors.activeOptionIndex(this.state);if(t!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[t]);else{let{dataRef:s}=this.state.options[t];this.actions.onChange(s.current.value)}this.actions.goToOption({focus:H.Specific,idx:t})}},setInputElement:t=>{this.send({type:9,element:t})},setButtonElement:t=>{this.send({type:10,element:t})},setOptionsElement:t=>{this.send({type:11,element:t})}}),qe(this,"selectors",{activeDescendantId:t=>{var s,a;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(a=t.options.find(u=>!u.dataRef.current.disabled&&t.dataRef.current.compare(u.dataRef.current.value,t.virtual.options[i])))==null?void 0:a.id:(s=t.options[i])==null?void 0:s.id},activeOptionIndex:t=>{if(t.defaultToFirstOption&&t.activeOptionIndex===null&&(t.virtual?t.virtual.options.length>0:t.options.length>0)){if(t.virtual){let{options:a,disabled:i}=t.virtual,u=a.findIndex(f=>{var d;return!((d=i==null?void 0:i(f))!=null&&d)});if(u!==-1)return u}let s=t.options.findIndex(a=>!a.dataRef.current.disabled);if(s!==-1)return s}return t.activeOptionIndex},activeOption:t=>{var s,a;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(a=(s=t.options[i])==null?void 0:s.dataRef.current.value)!=null?a:null},isActive:(t,s,a)=>{var i;let u=this.selectors.activeOptionIndex(t);return u===null?!1:t.virtual?u===t.dataRef.current.calculateIndex(s):((i=t.options[u])==null?void 0:i.id)===a},shouldScrollIntoView:(t,s,a)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,s,a)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,s=Ye.get(null);this.disposables.add(s.on(mt.Push,a=>{!s.selectors.isTop(a,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>s.actions.push(t)),this.on(1,()=>s.actions.pop(t))}this.disposables.group(t=>{this.on(1,s=>{s.inputElement&&(t.dispose(),t.add(to(s.inputElement,s.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:s=!1}){var a;return new Ie({id:o,dataRef:{current:{}},comboboxState:s?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(a=t.disabled)!=null?a:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:s,inputPositionState:ve.Idle})}reduce(o,t){return ce(t.type,_o,o,t)}}const tt=c.createContext(null);function Se(e){let o=c.useContext(tt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ot),t}return o}function ot({id:e,virtual:o=null,__demoMode:t=!1}){let s=c.useMemo(()=>Ie.new({id:e,virtual:o,__demoMode:t}),[]);return ft(()=>s.dispose()),s}let xe=c.createContext(null);xe.displayName="ComboboxDataContext";function ue(e){let o=c.useContext(xe);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ue),t}return o}let at=c.createContext(null);function Ao(e){let o=Se("VirtualProvider"),t=ue("VirtualProvider"),{options:s}=t.virtual,a=U(o,v=>v.optionsElement),[i,u]=c.useMemo(()=>{let v=a;if(!v)return[0,0];let m=window.getComputedStyle(v);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[a]),f=Zt({enabled:s.length!==0,scrollPaddingStart:i,scrollPaddingEnd:u,count:s.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[d,b]=c.useState(0);ie(()=>{b(v=>v+1)},[s]);let h=f.getVirtualItems(),N=U(o,v=>v.activationTrigger===oe.Pointer),C=U(o,o.selectors.activeOptionIndex);return h.length===0?null:W.createElement(at.Provider,{value:f},W.createElement("div",{style:{position:"relative",width:"100%",height:`${f.getTotalSize()}px`},ref:v=>{v&&(N||C!==null&&s.length>C&&f.scrollToIndex(C))}},h.map(v=>{var m;return W.createElement(c.Fragment,{key:v.key},W.cloneElement((m=e.children)==null?void 0:m.call(e,{...e.slot,option:s[v.index]}),{key:`${d}-${v.key}`,"data-index":v.index,"aria-setsize":s.length,"aria-posinset":v.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${v.start}px)`,overflowAnchor:"none"}}))})))}let Vo=c.Fragment;function Lo(e,o){let t=c.useId(),s=Rt(),{value:a,defaultValue:i,onChange:u,form:f,name:d,by:b,invalid:h=!1,disabled:N=s||!1,onClose:C,__demoMode:v=!1,multiple:m=!1,immediate:P=!1,virtual:p=null,nullable:M,...y}=e,O=Mt(i),[T=m?[]:void 0,L]=Ft(a,u,O),E=ot({id:t,virtual:p,__demoMode:v}),A=c.useRef({static:!1,hold:!1}),$=ro(b),F=_(I=>p?b===null?p.options.indexOf(I):p.options.findIndex(se=>$(se,I)):E.state.options.findIndex(se=>$(se.dataRef.current.value,I))),G=c.useCallback(I=>ce(V.mode,{[J.Multi]:()=>T.some(se=>$(se,I)),[J.Single]:()=>$(T,I)}),[T]),K=U(E,I=>I.virtual),j=_(()=>C==null?void 0:C()),V=c.useMemo(()=>({__demoMode:v,immediate:P,optionsPropsRef:A,value:T,defaultValue:O,disabled:N,invalid:h,mode:m?J.Multi:J.Single,virtual:p?K:null,onChange:L,isSelected:G,calculateIndex:F,compare:$,onClose:j}),[v,P,A,T,O,N,h,m,p,K,L,G,F,$,j]);ie(()=>{var I;p&&E.send({type:et.UpdateVirtualConfiguration,options:p.options,disabled:(I=p.disabled)!=null?I:null})},[p,p==null?void 0:p.options,p==null?void 0:p.disabled]),ie(()=>{E.state.dataRef.current=V},[V]);let[z,w,Y,le]=U(E,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),Z=Ye.get(null),ee=U(Z,c.useCallback(I=>Z.selectors.isTop(I,t),[Z,t]));Dt(ee,[w,Y,le],()=>E.actions.closeCombobox());let ae=U(E,E.selectors.activeOptionIndex),ne=U(E,E.selectors.activeOption),x=he({open:z===S.Open,disabled:N,invalid:h,activeIndex:ae,activeOption:ne,value:T}),[q,R]=_t(),D=o===null?{}:{ref:o},k=c.useCallback(()=>{if(O!==void 0)return L==null?void 0:L(O)},[L,O]),B=ye();return W.createElement(R,{value:q,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:z===S.Open,disabled:N}},W.createElement(bo,null,W.createElement(xe.Provider,{value:V},W.createElement(tt.Provider,{value:E},W.createElement(At,{value:ce(z,{[S.Open]:Ce.Open,[S.Closed]:Ce.Closed})},d!=null&&W.createElement(Vt,{disabled:N,data:T!=null?{[d]:T}:{},form:f,onReset:k}),B({ourProps:D,theirProps:y,slot:x,defaultTag:Vo,name:"Combobox"}))))))}let zo="input";function Bo(e,o){var t,s;let a=Se("Combobox.Input"),i=ue("Combobox.Input"),u=c.useId(),f=xt(),{id:d=f||`headlessui-combobox-input-${u}`,onChange:b,displayValue:h,disabled:N=i.disabled||!1,autoFocus:C=!1,type:v="text",...m}=e,P=c.useRef(null),p=Oe(P,o,co(),a.actions.setInputElement),[M,y]=U(a,x=>[x.comboboxState,x.isTyping]),O=gt(),T=_(()=>{a.actions.onChange(null),a.state.optionsElement&&(a.state.optionsElement.scrollTop=0),a.actions.goToOption({focus:H.Nothing})}),L=c.useMemo(()=>{var x;return typeof h=="function"&&i.value!==void 0?(x=h(i.value))!=null?x:"":typeof i.value=="string"?i.value:""},[i.value,h]);ke(([x,q],[R,D])=>{if(a.state.isTyping)return;let k=P.current;k&&((D===S.Open&&q===S.Closed||x!==R)&&(k.value=x),requestAnimationFrame(()=>{if(a.state.isTyping||!k||We(k))return;let{selectionStart:B,selectionEnd:I}=k;Math.abs((I??0)-(B??0))===0&&B===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[L,M,y]),ke(([x],[q])=>{if(x===S.Open&&q===S.Closed){if(a.state.isTyping)return;let R=P.current;if(!R)return;let D=R.value,{selectionStart:k,selectionEnd:B,selectionDirection:I}=R;R.value="",R.value=D,I!==null?R.setSelectionRange(k,B,I):R.setSelectionRange(k,B)}},[M]);let E=c.useRef(!1),A=_(()=>{E.current=!0}),$=_(()=>{O.nextFrame(()=>{E.current=!1})}),F=_(x=>{switch(a.actions.setIsTyping(!0),x.key){case X.Enter:if(a.state.comboboxState!==S.Open||E.current)return;if(x.preventDefault(),x.stopPropagation(),a.selectors.activeOptionIndex(a.state)===null){a.actions.closeCombobox();return}a.actions.selectActiveOption(),i.mode===J.Single&&a.actions.closeCombobox();break;case X.ArrowDown:return x.preventDefault(),x.stopPropagation(),ce(a.state.comboboxState,{[S.Open]:()=>a.actions.goToOption({focus:H.Next}),[S.Closed]:()=>a.actions.openCombobox()});case X.ArrowUp:return x.preventDefault(),x.stopPropagation(),ce(a.state.comboboxState,{[S.Open]:()=>a.actions.goToOption({focus:H.Previous}),[S.Closed]:()=>{re.flushSync(()=>a.actions.openCombobox()),i.value||a.actions.goToOption({focus:H.Last})}});case X.Home:if(a.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.First});case X.PageUp:return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.First});case X.End:if(a.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.Last});case X.PageDown:return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.Last});case X.Escape:return a.state.comboboxState!==S.Open?void 0:(x.preventDefault(),a.state.optionsElement&&!i.optionsPropsRef.current.static&&x.stopPropagation(),i.mode===J.Single&&i.value===null&&T(),a.actions.closeCombobox());case X.Tab:if(a.actions.setIsTyping(!1),a.state.comboboxState!==S.Open)return;i.mode===J.Single&&a.state.activationTrigger!==oe.Focus&&a.actions.selectActiveOption(),a.actions.closeCombobox();break}}),G=_(x=>{b==null||b(x),i.mode===J.Single&&x.target.value===""&&T(),a.actions.openCombobox()}),K=_(x=>{var q,R,D;let k=(q=x.relatedTarget)!=null?q:$e.find(B=>B!==x.currentTarget);if(!((R=a.state.optionsElement)!=null&&R.contains(k))&&!((D=a.state.buttonElement)!=null&&D.contains(k))&&a.state.comboboxState===S.Open)return x.preventDefault(),i.mode===J.Single&&i.value===null&&T(),a.actions.closeCombobox()}),j=_(x=>{var q,R,D;let k=(q=x.relatedTarget)!=null?q:$e.find(B=>B!==x.currentTarget);(R=a.state.buttonElement)!=null&&R.contains(k)||(D=a.state.optionsElement)!=null&&D.contains(k)||i.disabled||i.immediate&&a.state.comboboxState!==S.Open&&O.microTask(()=>{re.flushSync(()=>a.actions.openCombobox()),a.actions.setActivationTrigger(oe.Focus)})}),V=je(),z=ht(),{isFocused:w,focusProps:Y}=Xe({autoFocus:C}),{isHovered:le,hoverProps:Z}=Qe({isDisabled:N}),ee=U(a,x=>x.optionsElement),ae=he({open:M===S.Open,disabled:N,invalid:i.invalid,hover:le,focus:w,autofocus:C}),ne=Pe({ref:p,id:d,role:"combobox",type:v,"aria-controls":ee==null?void 0:ee.id,"aria-expanded":M===S.Open,"aria-activedescendant":U(a,a.selectors.activeDescendantId),"aria-labelledby":V,"aria-describedby":z,"aria-autocomplete":"list",defaultValue:(s=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?h==null?void 0:h(i.defaultValue):null)!=null?s:i.defaultValue,disabled:N||void 0,autoFocus:C,onCompositionStart:A,onCompositionEnd:$,onKeyDown:F,onChange:G,onFocus:j,onBlur:K},Y,Z);return ye()({ourProps:ne,theirProps:m,slot:ae,defaultTag:zo,name:"Combobox.Input"})}let Ho="button";function Uo(e,o){let t=Se("Combobox.Button"),s=ue("Combobox.Button"),[a,i]=c.useState(null),u=Oe(o,i,t.actions.setButtonElement),f=c.useId(),{id:d=`headlessui-combobox-button-${f}`,disabled:b=s.disabled||!1,autoFocus:h=!1,...N}=e,[C,v,m]=U(t,j=>[j.comboboxState,j.inputElement,j.optionsElement]),P=Ze(v),p=C===S.Open;ao(p,{trigger:a,action:c.useCallback(j=>{if(a!=null&&a.contains(j.target))return me.Ignore;if(v!=null&&v.contains(j.target))return me.Ignore;let V=j.target.closest('[role="option"]:not([data-disabled])');return yt(V)?me.Select(V):m!=null&&m.contains(j.target)?me.Ignore:me.Close},[a,v,m]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let M=_(j=>{switch(j.key){case X.Space:case X.Enter:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&re.flushSync(()=>t.actions.openCombobox()),P();return;case X.ArrowDown:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.First})),P();return;case X.ArrowUp:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.Last})),P();return;case X.Escape:if(t.state.comboboxState!==S.Open)return;j.preventDefault(),t.state.optionsElement&&!s.optionsPropsRef.current.static&&j.stopPropagation(),re.flushSync(()=>t.actions.closeCombobox()),P();return;default:return}}),y=no(()=>{t.state.comboboxState===S.Open?t.actions.closeCombobox():t.actions.openCombobox(),P()}),O=je([d]),{isFocusVisible:T,focusProps:L}=Xe({autoFocus:h}),{isHovered:E,hoverProps:A}=Qe({isDisabled:b}),{pressed:$,pressProps:F}=St({disabled:b}),G=he({open:C===S.Open,active:$||C===S.Open,disabled:b,invalid:s.invalid,value:s.value,hover:E,focus:T}),K=Pe({ref:u,id:d,type:Ct(e,a),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":C===S.Open,"aria-labelledby":O,disabled:b||void 0,autoFocus:h,onKeyDown:M},y,L,A,F);return ye()({ourProps:K,theirProps:N,slot:G,defaultTag:Ho,name:"Combobox.Button"})}let Go="div",Ko=Me.RenderStrategy|Me.Static;function qo(e,o){var t,s,a;let i=c.useId(),{id:u=`headlessui-combobox-options-${i}`,hold:f=!1,anchor:d,portal:b=!1,modal:h=!0,transition:N=!1,...C}=e,v=Se("Combobox.Options"),m=ue("Combobox.Options"),P=uo(d);P&&(b=!0);let[p,M]=po(P),[y,O]=c.useState(null),T=mo(),L=Oe(o,P?p:null,v.actions.setOptionsElement,O),[E,A,$,F,G]=U(v,n=>[n.comboboxState,n.inputElement,n.buttonElement,n.optionsElement,n.activationTrigger]),K=Re(A||$),j=Re(F),V=Ot(),[z,w]=Nt(N,y,V!==null?(V&Ce.Open)===Ce.Open:E===S.Open);wt(z,A,v.actions.closeCombobox);let Y=m.__demoMode?!1:h&&E===S.Open;Et(Y,j);let le=m.__demoMode?!1:h&&E===S.Open;jt(le,{allowed:c.useCallback(()=>[A,$,F],[A,$,F])});let Z=U(v,v.selectors.didInputMove)?!1:z;ie(()=>{var n;m.optionsPropsRef.current.static=(n=e.static)!=null?n:!1},[m.optionsPropsRef,e.static]),ie(()=>{m.optionsPropsRef.current.hold=f},[m.optionsPropsRef,f]),Mo(E===S.Open,{container:F,accept(n){return n.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:n.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(n){n.setAttribute("role","none")}});let ee=je([$==null?void 0:$.id]),ae=he({open:E===S.Open,option:void 0}),ne=_(()=>{v.actions.setActivationTrigger(oe.Pointer)}),x=_(n=>{n.preventDefault(),v.actions.setActivationTrigger(oe.Pointer)}),q=Pe(P?T():{},{"aria-labelledby":ee,role:"listbox","aria-multiselectable":m.mode===J.Multi?!0:void 0,id:u,ref:L,style:{...C.style,...M,"--input-width":Ue(z,A,!0).width,"--button-width":Ue(z,$,!0).width},onWheel:G===oe.Pointer?void 0:ne,onMouseDown:x,...Pt(w)}),R=z&&E===S.Closed&&!e.static,D=He(R,(t=m.virtual)==null?void 0:t.options),k=He(R,m.value),B=c.useCallback(n=>m.compare(k,n),[m.compare,k]),I=c.useMemo(()=>{if(!m.virtual)return m;if(D===void 0)throw new Error("Missing `options` in virtual mode");return D!==m.virtual.options?{...m,virtual:{...m.virtual,options:D}}:m},[m,D,(s=m.virtual)==null?void 0:s.options]);m.virtual&&Object.assign(C,{children:W.createElement(xe.Provider,{value:I},W.createElement(Ao,{slot:ae},C.children))});let se=ye(),Ne=c.useMemo(()=>m.mode===J.Multi?m:{...m,isSelected:B},[m,B]);return W.createElement(It,{enabled:b?e.static||z:!1,ownerDocument:K},W.createElement(xe.Provider,{value:Ne},se({ourProps:q,theirProps:{...C,children:W.createElement(so,{freeze:R},typeof C.children=="function"?(a=C.children)==null?void 0:a.call(C,ae):C.children)},slot:ae,defaultTag:Go,features:Ko,visible:Z,name:"Combobox.Options"})))}let Wo="div";function Yo(e,o){var t,s,a;let i=ue("Combobox.Option"),u=Se("Combobox.Option"),f=c.useId(),{id:d=`headlessui-combobox-option-${f}`,value:b,disabled:h=(a=(s=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:s.call(t,b))!=null?a:!1,order:N=null,...C}=e,[v]=U(u,w=>[w.inputElement]),m=Ze(v),P=U(u,c.useCallback(w=>u.selectors.isActive(w,b,d),[b,d])),p=i.isSelected(b),M=c.useRef(null),y=Tt({disabled:h,value:b,domRef:M,order:N}),O=c.useContext(at),T=Oe(o,M,O?O.measureElement:null),L=_(()=>{u.actions.setIsTyping(!1),u.actions.onChange(b)});ie(()=>u.actions.registerOption(d,y),[y,d]);let E=U(u,c.useCallback(w=>u.selectors.shouldScrollIntoView(w,b,d),[b,d]));ie(()=>{if(E)return kt().requestAnimationFrame(()=>{var w,Y;(Y=(w=M.current)==null?void 0:w.scrollIntoView)==null||Y.call(w,{block:"nearest"})})},[E,M]);let A=_(w=>{w.preventDefault(),w.button===lo.Left&&(h||(L(),$t()||requestAnimationFrame(()=>m()),i.mode===J.Single&&u.actions.closeCombobox()))}),$=_(()=>{if(h)return u.actions.goToOption({focus:H.Nothing});let w=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:w})}),F=io(),G=_(w=>F.update(w)),K=_(w=>{if(!F.wasMoved(w)||h||P&&u.state.activationTrigger===oe.Pointer)return;let Y=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:Y},oe.Pointer)}),j=_(w=>{F.wasMoved(w)&&(h||P&&(i.optionsPropsRef.current.hold||u.state.activationTrigger===oe.Pointer&&u.actions.goToOption({focus:H.Nothing})))}),V=he({active:P,focus:P,selected:p,disabled:h}),z={id:d,ref:T,role:"option",tabIndex:h===!0?void 0:-1,"aria-disabled":h===!0?!0:void 0,"aria-selected":p,disabled:void 0,onMouseDown:A,onFocus:$,onPointerEnter:G,onMouseEnter:G,onPointerMove:K,onMouseMove:K,onPointerLeave:j,onMouseLeave:j};return ye()({ourProps:z,theirProps:C,slot:V,defaultTag:Wo,name:"Combobox.Option"})}let Xo=ge(Lo),nt=ge(Uo),st=ge(Bo),Qo=vt,lt=ge(qo),it=ge(Yo),Jo=Object.assign(Xo,{Input:st,Button:nt,Label:Qo,Options:lt,Option:it});/** +import{r as c,au as _,av as ut,aw as We,ax as Te,ay as ie,az as dt,aA as pt,aB as ce,aC as Ye,aD as mt,aE as bt,aF as ft,aG as ge,aH as vt,aI as xt,aJ as Oe,aK as U,aL as gt,aM as ke,aN as X,aO as re,aP as $e,aQ as je,aR as ht,aS as Xe,aT as Qe,aU as he,aV as Pe,aW as ye,aX as yt,aY as St,aZ as Ct,a_ as Re,a$ as Ot,b0 as Nt,b1 as Ce,b2 as wt,b3 as Et,b4 as jt,b5 as Pt,b6 as W,b7 as It,b8 as Tt,b9 as kt,ba as $t,bb as Rt,bc as Mt,bd as Ft,be as Dt,bf as _t,bg as At,bh as Vt,bi as Me,d as Lt,j as l,c as Q,ao as zt,D as Bt,E as Ht,bj as Ut,G as Gt,K as Kt,Q as qt,V as Wt,ak as Yt,ar as Xt,W as Fe,bk as De,bl as _e,bm as Ae,B as we,bn as Ve,N as Le,bo as ze,T as Qt}from"./index-WhzslczH.js";import{c as Jt}from"./node-types-BuI9FfZZ.js";import{u as Zt,C as eo}from"./circle-x-DAvnTI4S.js";import{c as H,p as to,a as ve,f as Be,b as oo,L as ao,S as me,s as no,u as He,d as so,g as lo,e as io,h as ro}from"./element-movement-CSsBUmDY.js";import{F as co,y as uo,R as po,T as mo,w as Ue,A as bo}from"./map-pin-BXCqDxIA.js";import{g as Je,u as fo,R as vo,P as xo}from"./PacketList-3khSiIZq.js";import{useGetDecodedContent as go,useResolveSource as ho}from"./usePipelineStore-DZf0BPc-.js";import{c as yo,a as So,D as Co,b as Oo}from"./AnalyzerFilterPanel-DdXhKyZf.js";import{u as No,r as wo}from"./consumer-registry-DcpFyHd4.js";import{A as Eo}from"./arrow-up-pO4AtOWx.js";import{A as jo}from"./SignalIndicator-B1hS3JQG.js";import{P as Po,a as Io,B as To,C as Ge}from"./PageLayout-CjepFyhn.js";import{T as ko,M as $o}from"./MqttModeBadge-xEEk549C.js";import{F as Ke}from"./funnel-B4y6lzBW.js";import{S as Ro}from"./search-DttoJEPu.js";import"./primitives-Bq_jqX-t.js";import"./badge-colors-BgV-I1O5.js";import"./chat-utils-CPRl3lbc.js";import"./chevron-right-Ewog5LA3.js";import"./circle-question-mark-CJt3zunX.js";import"./triangle-alert-BsvKjxO1.js";import"./DataBox-ABvJ7hn1.js";import"./layers-rhF42Hfn.js";import"./hash-Bwa-X17j.js";import"./activity-CzPYx3Pb.js";import"./circle-check-6eqe109E.js";import"./database-Hkah1WM3.js";import"./useMapViewStore-7rwVBEII.js";import"./index-WiXmWhPS.js";import"./shield-DWGSxaaG.js";import"./zap-Ec1PEQMI.js";import"./monitor-smartphone-h2eaOleh.js";function Ze(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return ut(e,"blur",t=>{let s=t.target;Te(s)&&(o.current={value:s.value,selectionStart:s.selectionStart,selectionEnd:s.selectionEnd})}),_(()=>{if(!We(e)&&Te(e)&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==o.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:t,selectionEnd:s}=o.current;t!==null&&s!==null&&e.setSelectionRange(t,s)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}function Mo(e,{container:o,accept:t,walk:s}){let a=c.useRef(t),i=c.useRef(s);c.useEffect(()=>{a.current=t,i.current=s},[t,s]),ie(()=>{if(!o||!e)return;let u=dt(o);if(!u)return;let f=a.current,d=i.current,b=Object.assign(N=>f(N),{acceptNode:f}),h=u.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,b,!1);for(;h.nextNode();)d(h.currentNode)},[o,e,a,i])}var Fo=Object.defineProperty,Do=(e,o,t)=>o in e?Fo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,qe=(e,o,t)=>(Do(e,typeof o!="symbol"?o+"":o,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),J=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(J||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(oe||{}),et=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.DefaultToFirstOption=6]="DefaultToFirstOption",e[e.SetActivationTrigger=7]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=8]="UpdateVirtualConfiguration",e[e.SetInputElement=9]="SetInputElement",e[e.SetButtonElement=10]="SetButtonElement",e[e.SetOptionsElement=11]="SetOptionsElement",e[e.MarkInputAsMoved=12]="MarkInputAsMoved",e))(et||{});function Ee(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,s=o(e.options.slice()),a=s.length>0&&s[0].dataRef.current.order!==null?s.sort((u,f)=>u.dataRef.current.order-f.dataRef.current.order):bt(s,u=>u.dataRef.current.domRef.current),i=t?a.indexOf(t):null;return i===-1&&(i=null),{options:a,activeOptionIndex:i}}let _o={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?ve.Tracked(oo(e.inputElement)):e.inputPositionState;return{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,inputPositionState:t,__demoMode:!1}},0(e){var o,t;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let s=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(s!==-1)return{...e,activeOptionIndex:s,comboboxState:0,__demoMode:!1,inputPositionState:ve.Idle}}return{...e,comboboxState:0,inputPositionState:ve.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,s,a,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((s=e.dataRef.current)!=null&&s.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:b,disabled:h}=e.virtual,N=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>b,resolveActiveIndex:()=>{var v,m;return(m=(v=e.activeOptionIndex)!=null?v:b.findIndex(P=>!h(P)))!=null?m:null},resolveDisabled:h,resolveId(){throw new Error("Function not implemented.")}}),C=(a=o.trigger)!=null?a:2;return e.activeOptionIndex===N&&e.activationTrigger===C?e:{...e,activeOptionIndex:N,activationTrigger:C,isTyping:!1,__demoMode:!1}}let u=Ee(e);if(u.activeOptionIndex===null){let b=u.options.findIndex(h=>!h.dataRef.current.disabled);b!==-1&&(u.activeOptionIndex=b)}let f=o.focus===H.Specific?o.idx:Be(o,{resolveItems:()=>u.options,resolveActiveIndex:()=>u.activeOptionIndex,resolveId:b=>b.id,resolveDisabled:b=>b.dataRef.current.disabled}),d=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===f&&e.activationTrigger===d?e:{...e,...u,isTyping:!1,activeOptionIndex:f,activationTrigger:d,__demoMode:!1}},4:(e,o)=>{var t,s,a,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let u=o.payload,f=Ee(e,b=>(b.push(u),b));e.activeOptionIndex===null&&(a=(s=e.dataRef.current).isSelected)!=null&&a.call(s,o.payload.dataRef.current.value)&&(f.activeOptionIndex=f.options.indexOf(u));let d={...e,...f,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(d.activeOptionIndex=0),d},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(a=>a.id!==o.id)};let s=Ee(e,a=>{let i=a.findIndex(u=>u.id===o.id);return i!==-1&&a.splice(i,1),a});return{...e,...s,activationTrigger:2}},6:(e,o)=>e.defaultToFirstOption===o.value?e:{...e,defaultToFirstOption:o.value},7:(e,o)=>e.activationTrigger===o.trigger?e:{...e,activationTrigger:o.trigger},8:(e,o)=>{var t,s;if(e.virtual===null)return{...e,virtual:{options:o.options,disabled:(t=o.disabled)!=null?t:()=>!1}};if(e.virtual.options===o.options&&e.virtual.disabled===o.disabled)return e;let a=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?a=i:a=null}return{...e,activeOptionIndex:a,virtual:{options:o.options,disabled:(s=o.disabled)!=null?s:()=>!1}}},9:(e,o)=>e.inputElement===o.element?e:{...e,inputElement:o.element},10:(e,o)=>e.buttonElement===o.element?e:{...e,buttonElement:o.element},11:(e,o)=>e.optionsElement===o.element?e:{...e,optionsElement:o.element},12(e){return e.inputPositionState.kind!=="Tracked"?e:{...e,inputPositionState:ve.Moved}}};class Ie extends pt{constructor(o){super(o),qe(this,"actions",{onChange:t=>{let{onChange:s,compare:a,mode:i,value:u}=this.state.dataRef.current;return ce(i,{0:()=>s==null?void 0:s(t),1:()=>{let f=u.slice(),d=f.findIndex(b=>a(b,t));return d===-1?f.push(t):f.splice(d,1),s==null?void 0:s(f)}})},registerOption:(t,s)=>(this.send({type:4,payload:{id:t,dataRef:s}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(s.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,s)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:s})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,s;this.send({type:1}),this.send({type:6,value:!1}),(s=(t=this.state.dataRef.current).onClose)==null||s.call(t)},openCombobox:()=>{this.send({type:0}),this.send({type:6,value:!0})},setActivationTrigger:t=>{this.send({type:7,trigger:t})},selectActiveOption:()=>{let t=this.selectors.activeOptionIndex(this.state);if(t!==null){if(this.actions.setIsTyping(!1),this.state.virtual)this.actions.onChange(this.state.virtual.options[t]);else{let{dataRef:s}=this.state.options[t];this.actions.onChange(s.current.value)}this.actions.goToOption({focus:H.Specific,idx:t})}},setInputElement:t=>{this.send({type:9,element:t})},setButtonElement:t=>{this.send({type:10,element:t})},setOptionsElement:t=>{this.send({type:11,element:t})}}),qe(this,"selectors",{activeDescendantId:t=>{var s,a;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(a=t.options.find(u=>!u.dataRef.current.disabled&&t.dataRef.current.compare(u.dataRef.current.value,t.virtual.options[i])))==null?void 0:a.id:(s=t.options[i])==null?void 0:s.id},activeOptionIndex:t=>{if(t.defaultToFirstOption&&t.activeOptionIndex===null&&(t.virtual?t.virtual.options.length>0:t.options.length>0)){if(t.virtual){let{options:a,disabled:i}=t.virtual,u=a.findIndex(f=>{var d;return!((d=i==null?void 0:i(f))!=null&&d)});if(u!==-1)return u}let s=t.options.findIndex(a=>!a.dataRef.current.disabled);if(s!==-1)return s}return t.activeOptionIndex},activeOption:t=>{var s,a;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(a=(s=t.options[i])==null?void 0:s.dataRef.current.value)!=null?a:null},isActive:(t,s,a)=>{var i;let u=this.selectors.activeOptionIndex(t);return u===null?!1:t.virtual?u===t.dataRef.current.calculateIndex(s):((i=t.options[u])==null?void 0:i.id)===a},shouldScrollIntoView:(t,s,a)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,s,a)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,s=Ye.get(null);this.disposables.add(s.on(mt.Push,a=>{!s.selectors.isTop(a,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>s.actions.push(t)),this.on(1,()=>s.actions.pop(t))}this.disposables.group(t=>{this.on(1,s=>{s.inputElement&&(t.dispose(),t.add(to(s.inputElement,s.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:s=!1}){var a;return new Ie({id:o,dataRef:{current:{}},comboboxState:s?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(a=t.disabled)!=null?a:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:s,inputPositionState:ve.Idle})}reduce(o,t){return ce(t.type,_o,o,t)}}const tt=c.createContext(null);function Se(e){let o=c.useContext(tt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ot),t}return o}function ot({id:e,virtual:o=null,__demoMode:t=!1}){let s=c.useMemo(()=>Ie.new({id:e,virtual:o,__demoMode:t}),[]);return ft(()=>s.dispose()),s}let xe=c.createContext(null);xe.displayName="ComboboxDataContext";function ue(e){let o=c.useContext(xe);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ue),t}return o}let at=c.createContext(null);function Ao(e){let o=Se("VirtualProvider"),t=ue("VirtualProvider"),{options:s}=t.virtual,a=U(o,v=>v.optionsElement),[i,u]=c.useMemo(()=>{let v=a;if(!v)return[0,0];let m=window.getComputedStyle(v);return[parseFloat(m.paddingBlockStart||m.paddingTop),parseFloat(m.paddingBlockEnd||m.paddingBottom)]},[a]),f=Zt({enabled:s.length!==0,scrollPaddingStart:i,scrollPaddingEnd:u,count:s.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[d,b]=c.useState(0);ie(()=>{b(v=>v+1)},[s]);let h=f.getVirtualItems(),N=U(o,v=>v.activationTrigger===oe.Pointer),C=U(o,o.selectors.activeOptionIndex);return h.length===0?null:W.createElement(at.Provider,{value:f},W.createElement("div",{style:{position:"relative",width:"100%",height:`${f.getTotalSize()}px`},ref:v=>{v&&(N||C!==null&&s.length>C&&f.scrollToIndex(C))}},h.map(v=>{var m;return W.createElement(c.Fragment,{key:v.key},W.cloneElement((m=e.children)==null?void 0:m.call(e,{...e.slot,option:s[v.index]}),{key:`${d}-${v.key}`,"data-index":v.index,"aria-setsize":s.length,"aria-posinset":v.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${v.start}px)`,overflowAnchor:"none"}}))})))}let Vo=c.Fragment;function Lo(e,o){let t=c.useId(),s=Rt(),{value:a,defaultValue:i,onChange:u,form:f,name:d,by:b,invalid:h=!1,disabled:N=s||!1,onClose:C,__demoMode:v=!1,multiple:m=!1,immediate:P=!1,virtual:p=null,nullable:M,...y}=e,O=Mt(i),[T=m?[]:void 0,L]=Ft(a,u,O),E=ot({id:t,virtual:p,__demoMode:v}),A=c.useRef({static:!1,hold:!1}),$=ro(b),F=_(I=>p?b===null?p.options.indexOf(I):p.options.findIndex(se=>$(se,I)):E.state.options.findIndex(se=>$(se.dataRef.current.value,I))),G=c.useCallback(I=>ce(V.mode,{[J.Multi]:()=>T.some(se=>$(se,I)),[J.Single]:()=>$(T,I)}),[T]),K=U(E,I=>I.virtual),j=_(()=>C==null?void 0:C()),V=c.useMemo(()=>({__demoMode:v,immediate:P,optionsPropsRef:A,value:T,defaultValue:O,disabled:N,invalid:h,mode:m?J.Multi:J.Single,virtual:p?K:null,onChange:L,isSelected:G,calculateIndex:F,compare:$,onClose:j}),[v,P,A,T,O,N,h,m,p,K,L,G,F,$,j]);ie(()=>{var I;p&&E.send({type:et.UpdateVirtualConfiguration,options:p.options,disabled:(I=p.disabled)!=null?I:null})},[p,p==null?void 0:p.options,p==null?void 0:p.disabled]),ie(()=>{E.state.dataRef.current=V},[V]);let[z,w,Y,le]=U(E,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),Z=Ye.get(null),ee=U(Z,c.useCallback(I=>Z.selectors.isTop(I,t),[Z,t]));Dt(ee,[w,Y,le],()=>E.actions.closeCombobox());let ae=U(E,E.selectors.activeOptionIndex),ne=U(E,E.selectors.activeOption),x=he({open:z===S.Open,disabled:N,invalid:h,activeIndex:ae,activeOption:ne,value:T}),[q,R]=_t(),D=o===null?{}:{ref:o},k=c.useCallback(()=>{if(O!==void 0)return L==null?void 0:L(O)},[L,O]),B=ye();return W.createElement(R,{value:q,props:{htmlFor:Y==null?void 0:Y.id},slot:{open:z===S.Open,disabled:N}},W.createElement(bo,null,W.createElement(xe.Provider,{value:V},W.createElement(tt.Provider,{value:E},W.createElement(At,{value:ce(z,{[S.Open]:Ce.Open,[S.Closed]:Ce.Closed})},d!=null&&W.createElement(Vt,{disabled:N,data:T!=null?{[d]:T}:{},form:f,onReset:k}),B({ourProps:D,theirProps:y,slot:x,defaultTag:Vo,name:"Combobox"}))))))}let zo="input";function Bo(e,o){var t,s;let a=Se("Combobox.Input"),i=ue("Combobox.Input"),u=c.useId(),f=xt(),{id:d=f||`headlessui-combobox-input-${u}`,onChange:b,displayValue:h,disabled:N=i.disabled||!1,autoFocus:C=!1,type:v="text",...m}=e,P=c.useRef(null),p=Oe(P,o,co(),a.actions.setInputElement),[M,y]=U(a,x=>[x.comboboxState,x.isTyping]),O=gt(),T=_(()=>{a.actions.onChange(null),a.state.optionsElement&&(a.state.optionsElement.scrollTop=0),a.actions.goToOption({focus:H.Nothing})}),L=c.useMemo(()=>{var x;return typeof h=="function"&&i.value!==void 0?(x=h(i.value))!=null?x:"":typeof i.value=="string"?i.value:""},[i.value,h]);ke(([x,q],[R,D])=>{if(a.state.isTyping)return;let k=P.current;k&&((D===S.Open&&q===S.Closed||x!==R)&&(k.value=x),requestAnimationFrame(()=>{if(a.state.isTyping||!k||We(k))return;let{selectionStart:B,selectionEnd:I}=k;Math.abs((I??0)-(B??0))===0&&B===0&&k.setSelectionRange(k.value.length,k.value.length)}))},[L,M,y]),ke(([x],[q])=>{if(x===S.Open&&q===S.Closed){if(a.state.isTyping)return;let R=P.current;if(!R)return;let D=R.value,{selectionStart:k,selectionEnd:B,selectionDirection:I}=R;R.value="",R.value=D,I!==null?R.setSelectionRange(k,B,I):R.setSelectionRange(k,B)}},[M]);let E=c.useRef(!1),A=_(()=>{E.current=!0}),$=_(()=>{O.nextFrame(()=>{E.current=!1})}),F=_(x=>{switch(a.actions.setIsTyping(!0),x.key){case X.Enter:if(a.state.comboboxState!==S.Open||E.current)return;if(x.preventDefault(),x.stopPropagation(),a.selectors.activeOptionIndex(a.state)===null){a.actions.closeCombobox();return}a.actions.selectActiveOption(),i.mode===J.Single&&a.actions.closeCombobox();break;case X.ArrowDown:return x.preventDefault(),x.stopPropagation(),ce(a.state.comboboxState,{[S.Open]:()=>a.actions.goToOption({focus:H.Next}),[S.Closed]:()=>a.actions.openCombobox()});case X.ArrowUp:return x.preventDefault(),x.stopPropagation(),ce(a.state.comboboxState,{[S.Open]:()=>a.actions.goToOption({focus:H.Previous}),[S.Closed]:()=>{re.flushSync(()=>a.actions.openCombobox()),i.value||a.actions.goToOption({focus:H.Last})}});case X.Home:if(a.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.First});case X.PageUp:return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.First});case X.End:if(a.state.comboboxState===S.Closed||x.shiftKey)break;return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.Last});case X.PageDown:return x.preventDefault(),x.stopPropagation(),a.actions.goToOption({focus:H.Last});case X.Escape:return a.state.comboboxState!==S.Open?void 0:(x.preventDefault(),a.state.optionsElement&&!i.optionsPropsRef.current.static&&x.stopPropagation(),i.mode===J.Single&&i.value===null&&T(),a.actions.closeCombobox());case X.Tab:if(a.actions.setIsTyping(!1),a.state.comboboxState!==S.Open)return;i.mode===J.Single&&a.state.activationTrigger!==oe.Focus&&a.actions.selectActiveOption(),a.actions.closeCombobox();break}}),G=_(x=>{b==null||b(x),i.mode===J.Single&&x.target.value===""&&T(),a.actions.openCombobox()}),K=_(x=>{var q,R,D;let k=(q=x.relatedTarget)!=null?q:$e.find(B=>B!==x.currentTarget);if(!((R=a.state.optionsElement)!=null&&R.contains(k))&&!((D=a.state.buttonElement)!=null&&D.contains(k))&&a.state.comboboxState===S.Open)return x.preventDefault(),i.mode===J.Single&&i.value===null&&T(),a.actions.closeCombobox()}),j=_(x=>{var q,R,D;let k=(q=x.relatedTarget)!=null?q:$e.find(B=>B!==x.currentTarget);(R=a.state.buttonElement)!=null&&R.contains(k)||(D=a.state.optionsElement)!=null&&D.contains(k)||i.disabled||i.immediate&&a.state.comboboxState!==S.Open&&O.microTask(()=>{re.flushSync(()=>a.actions.openCombobox()),a.actions.setActivationTrigger(oe.Focus)})}),V=je(),z=ht(),{isFocused:w,focusProps:Y}=Xe({autoFocus:C}),{isHovered:le,hoverProps:Z}=Qe({isDisabled:N}),ee=U(a,x=>x.optionsElement),ae=he({open:M===S.Open,disabled:N,invalid:i.invalid,hover:le,focus:w,autofocus:C}),ne=Pe({ref:p,id:d,role:"combobox",type:v,"aria-controls":ee==null?void 0:ee.id,"aria-expanded":M===S.Open,"aria-activedescendant":U(a,a.selectors.activeDescendantId),"aria-labelledby":V,"aria-describedby":z,"aria-autocomplete":"list",defaultValue:(s=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?h==null?void 0:h(i.defaultValue):null)!=null?s:i.defaultValue,disabled:N||void 0,autoFocus:C,onCompositionStart:A,onCompositionEnd:$,onKeyDown:F,onChange:G,onFocus:j,onBlur:K},Y,Z);return ye()({ourProps:ne,theirProps:m,slot:ae,defaultTag:zo,name:"Combobox.Input"})}let Ho="button";function Uo(e,o){let t=Se("Combobox.Button"),s=ue("Combobox.Button"),[a,i]=c.useState(null),u=Oe(o,i,t.actions.setButtonElement),f=c.useId(),{id:d=`headlessui-combobox-button-${f}`,disabled:b=s.disabled||!1,autoFocus:h=!1,...N}=e,[C,v,m]=U(t,j=>[j.comboboxState,j.inputElement,j.optionsElement]),P=Ze(v),p=C===S.Open;ao(p,{trigger:a,action:c.useCallback(j=>{if(a!=null&&a.contains(j.target))return me.Ignore;if(v!=null&&v.contains(j.target))return me.Ignore;let V=j.target.closest('[role="option"]:not([data-disabled])');return yt(V)?me.Select(V):m!=null&&m.contains(j.target)?me.Ignore:me.Close},[a,v,m]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let M=_(j=>{switch(j.key){case X.Space:case X.Enter:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&re.flushSync(()=>t.actions.openCombobox()),P();return;case X.ArrowDown:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.First})),P();return;case X.ArrowUp:j.preventDefault(),j.stopPropagation(),t.state.comboboxState===S.Closed&&(re.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:H.Last})),P();return;case X.Escape:if(t.state.comboboxState!==S.Open)return;j.preventDefault(),t.state.optionsElement&&!s.optionsPropsRef.current.static&&j.stopPropagation(),re.flushSync(()=>t.actions.closeCombobox()),P();return;default:return}}),y=no(()=>{t.state.comboboxState===S.Open?t.actions.closeCombobox():t.actions.openCombobox(),P()}),O=je([d]),{isFocusVisible:T,focusProps:L}=Xe({autoFocus:h}),{isHovered:E,hoverProps:A}=Qe({isDisabled:b}),{pressed:$,pressProps:F}=St({disabled:b}),G=he({open:C===S.Open,active:$||C===S.Open,disabled:b,invalid:s.invalid,value:s.value,hover:E,focus:T}),K=Pe({ref:u,id:d,type:Ct(e,a),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":C===S.Open,"aria-labelledby":O,disabled:b||void 0,autoFocus:h,onKeyDown:M},y,L,A,F);return ye()({ourProps:K,theirProps:N,slot:G,defaultTag:Ho,name:"Combobox.Button"})}let Go="div",Ko=Me.RenderStrategy|Me.Static;function qo(e,o){var t,s,a;let i=c.useId(),{id:u=`headlessui-combobox-options-${i}`,hold:f=!1,anchor:d,portal:b=!1,modal:h=!0,transition:N=!1,...C}=e,v=Se("Combobox.Options"),m=ue("Combobox.Options"),P=uo(d);P&&(b=!0);let[p,M]=po(P),[y,O]=c.useState(null),T=mo(),L=Oe(o,P?p:null,v.actions.setOptionsElement,O),[E,A,$,F,G]=U(v,n=>[n.comboboxState,n.inputElement,n.buttonElement,n.optionsElement,n.activationTrigger]),K=Re(A||$),j=Re(F),V=Ot(),[z,w]=Nt(N,y,V!==null?(V&Ce.Open)===Ce.Open:E===S.Open);wt(z,A,v.actions.closeCombobox);let Y=m.__demoMode?!1:h&&E===S.Open;Et(Y,j);let le=m.__demoMode?!1:h&&E===S.Open;jt(le,{allowed:c.useCallback(()=>[A,$,F],[A,$,F])});let Z=U(v,v.selectors.didInputMove)?!1:z;ie(()=>{var n;m.optionsPropsRef.current.static=(n=e.static)!=null?n:!1},[m.optionsPropsRef,e.static]),ie(()=>{m.optionsPropsRef.current.hold=f},[m.optionsPropsRef,f]),Mo(E===S.Open,{container:F,accept(n){return n.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:n.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(n){n.setAttribute("role","none")}});let ee=je([$==null?void 0:$.id]),ae=he({open:E===S.Open,option:void 0}),ne=_(()=>{v.actions.setActivationTrigger(oe.Pointer)}),x=_(n=>{n.preventDefault(),v.actions.setActivationTrigger(oe.Pointer)}),q=Pe(P?T():{},{"aria-labelledby":ee,role:"listbox","aria-multiselectable":m.mode===J.Multi?!0:void 0,id:u,ref:L,style:{...C.style,...M,"--input-width":Ue(z,A,!0).width,"--button-width":Ue(z,$,!0).width},onWheel:G===oe.Pointer?void 0:ne,onMouseDown:x,...Pt(w)}),R=z&&E===S.Closed&&!e.static,D=He(R,(t=m.virtual)==null?void 0:t.options),k=He(R,m.value),B=c.useCallback(n=>m.compare(k,n),[m.compare,k]),I=c.useMemo(()=>{if(!m.virtual)return m;if(D===void 0)throw new Error("Missing `options` in virtual mode");return D!==m.virtual.options?{...m,virtual:{...m.virtual,options:D}}:m},[m,D,(s=m.virtual)==null?void 0:s.options]);m.virtual&&Object.assign(C,{children:W.createElement(xe.Provider,{value:I},W.createElement(Ao,{slot:ae},C.children))});let se=ye(),Ne=c.useMemo(()=>m.mode===J.Multi?m:{...m,isSelected:B},[m,B]);return W.createElement(It,{enabled:b?e.static||z:!1,ownerDocument:K},W.createElement(xe.Provider,{value:Ne},se({ourProps:q,theirProps:{...C,children:W.createElement(so,{freeze:R},typeof C.children=="function"?(a=C.children)==null?void 0:a.call(C,ae):C.children)},slot:ae,defaultTag:Go,features:Ko,visible:Z,name:"Combobox.Options"})))}let Wo="div";function Yo(e,o){var t,s,a;let i=ue("Combobox.Option"),u=Se("Combobox.Option"),f=c.useId(),{id:d=`headlessui-combobox-option-${f}`,value:b,disabled:h=(a=(s=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:s.call(t,b))!=null?a:!1,order:N=null,...C}=e,[v]=U(u,w=>[w.inputElement]),m=Ze(v),P=U(u,c.useCallback(w=>u.selectors.isActive(w,b,d),[b,d])),p=i.isSelected(b),M=c.useRef(null),y=Tt({disabled:h,value:b,domRef:M,order:N}),O=c.useContext(at),T=Oe(o,M,O?O.measureElement:null),L=_(()=>{u.actions.setIsTyping(!1),u.actions.onChange(b)});ie(()=>u.actions.registerOption(d,y),[y,d]);let E=U(u,c.useCallback(w=>u.selectors.shouldScrollIntoView(w,b,d),[b,d]));ie(()=>{if(E)return kt().requestAnimationFrame(()=>{var w,Y;(Y=(w=M.current)==null?void 0:w.scrollIntoView)==null||Y.call(w,{block:"nearest"})})},[E,M]);let A=_(w=>{w.preventDefault(),w.button===lo.Left&&(h||(L(),$t()||requestAnimationFrame(()=>m()),i.mode===J.Single&&u.actions.closeCombobox()))}),$=_(()=>{if(h)return u.actions.goToOption({focus:H.Nothing});let w=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:w})}),F=io(),G=_(w=>F.update(w)),K=_(w=>{if(!F.wasMoved(w)||h||P&&u.state.activationTrigger===oe.Pointer)return;let Y=i.calculateIndex(b);u.actions.goToOption({focus:H.Specific,idx:Y},oe.Pointer)}),j=_(w=>{F.wasMoved(w)&&(h||P&&(i.optionsPropsRef.current.hold||u.state.activationTrigger===oe.Pointer&&u.actions.goToOption({focus:H.Nothing})))}),V=he({active:P,focus:P,selected:p,disabled:h}),z={id:d,ref:T,role:"option",tabIndex:h===!0?void 0:-1,"aria-disabled":h===!0?!0:void 0,"aria-selected":p,disabled:void 0,onMouseDown:A,onFocus:$,onPointerEnter:G,onMouseEnter:G,onPointerMove:K,onMouseMove:K,onPointerLeave:j,onMouseLeave:j};return ye()({ourProps:z,theirProps:C,slot:V,defaultTag:Wo,name:"Combobox.Option"})}let Xo=ge(Lo),nt=ge(Uo),st=ge(Bo),Qo=vt,lt=ge(qo),it=ge(Yo),Jo=Object.assign(Xo,{Input:st,Button:nt,Label:Qo,Options:lt,Option:it});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PageLayout-B8orsDlo.js b/frontend/dist/assets/PageLayout-CjepFyhn.js similarity index 89% rename from frontend/dist/assets/PageLayout-B8orsDlo.js rename to frontend/dist/assets/PageLayout-CjepFyhn.js index 23c40c86..d00302c8 100644 --- a/frontend/dist/assets/PageLayout-B8orsDlo.js +++ b/frontend/dist/assets/PageLayout-CjepFyhn.js @@ -1 +1 @@ -import{j as e,v as o,c as x,aq as d,r,eX as f}from"./index-CvSa8h-C.js";function p({children:a,className:s}){return e.jsx("div",{className:x("section-gap",s),children:a})}function j({children:a,className:s,ready:t}){const n=d(),i=t??n,[m,c]=r.useState(!1);return r.useEffect(()=>{if(!i){c(!1);return}let l=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{l||r.startTransition(()=>c(!0))})}),()=>{l=!0}},[i]),e.jsx(f.Provider,{value:m,children:e.jsx("div",{className:x("bento-section",s),children:a})})}function g({title:a,icon:s,controls:t,subtitle:n}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[e.jsxs("h1",{className:"type-title text-fg-primary flex items-baseline gap-2 sm:gap-3 min-w-0",children:[s&&e.jsx("span",{className:"text-icon-page-title flex-shrink-0 translate-y-[0.1em] [&>svg]:h-[1em] [&>svg]:w-[1em] [&>svg]:stroke-[1.5]",children:s}),e.jsx("span",{className:"truncate",children:a})]}),t&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:t})]}),n&&e.jsx("div",{children:n})]})}function h({size:a,...s}){return e.jsx(o,{...s})}export{j as B,h as C,p as P,g as a}; +import{j as e,v as o,c as x,aq as d,r,eX as f}from"./index-WhzslczH.js";function p({children:a,className:s}){return e.jsx("div",{className:x("section-gap",s),children:a})}function j({children:a,className:s,ready:t}){const n=d(),i=t??n,[m,c]=r.useState(!1);return r.useEffect(()=>{if(!i){c(!1);return}let l=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{l||r.startTransition(()=>c(!0))})}),()=>{l=!0}},[i]),e.jsx(f.Provider,{value:m,children:e.jsx("div",{className:x("bento-section",s),children:a})})}function g({title:a,icon:s,controls:t,subtitle:n}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[e.jsxs("h1",{className:"type-title text-fg-primary flex items-baseline gap-2 sm:gap-3 min-w-0",children:[s&&e.jsx("span",{className:"text-icon-page-title flex-shrink-0 translate-y-[0.1em] [&>svg]:h-[1em] [&>svg]:w-[1em] [&>svg]:stroke-[1.5]",children:s}),e.jsx("span",{className:"truncate",children:a})]}),t&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:t})]}),n&&e.jsx("div",{children:n})]})}function h({size:a,...s}){return e.jsx(o,{...s})}export{j as B,h as C,p as P,g as a}; diff --git a/frontend/dist/assets/PathMapMapLibre-CNUY5MTe.js b/frontend/dist/assets/PathMapMapLibre-XWZ321IJ.js similarity index 98% rename from frontend/dist/assets/PathMapMapLibre-CNUY5MTe.js rename to frontend/dist/assets/PathMapMapLibre-XWZ321IJ.js index a14aedde..2fb3dd65 100644 --- a/frontend/dist/assets/PathMapMapLibre-CNUY5MTe.js +++ b/frontend/dist/assets/PathMapMapLibre-XWZ321IJ.js @@ -1,4 +1,4 @@ -import{d as ae,r as a,bM as ie,bD as le,eY as de,Z as q,bP as ce,j as t,x as Z,c as G,eZ as ue}from"./index-CvSa8h-C.js";import{u as pe,M as me,B as fe,S as ge,L as xe,a as Q,P as he}from"./BasemapLayer-NuqTvOvz.js";import{H as ye}from"./useMapViewStore-1D-N8rLK.js";import"./index-CPifxb0-.js";/** +import{d as ae,r as a,bM as ie,bD as le,eY as de,Z as q,bP as ce,j as t,x as Z,c as G,eZ as ue}from"./index-WhzslczH.js";import{u as pe,M as me,B as fe,S as ge,L as xe,a as Q,P as he}from"./BasemapLayer-CeyADeA1.js";import{H as ye}from"./useMapViewStore-7rwVBEII.js";import"./index-WiXmWhPS.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RoomServer-DuVH7Mva.js b/frontend/dist/assets/RoomServer-BWTs1Hn2.js similarity index 97% rename from frontend/dist/assets/RoomServer-DuVH7Mva.js rename to frontend/dist/assets/RoomServer-BWTs1Hn2.js index 9810b694..b23864a7 100644 --- a/frontend/dist/assets/RoomServer-DuVH7Mva.js +++ b/frontend/dist/assets/RoomServer-BWTs1Hn2.js @@ -1,4 +1,4 @@ -import{d as U,j as e,dd as Fe,c as L,aH as Oe,e1 as Be,r as o,c0 as Y,R as qe,am as ze,dK as He,an as Ge,x as V,I as q,e2 as Ue,B as F,bL as Me,ao as ue,d8 as Ve,N as se,F as Re,D as W,E as We,e3 as Te,e4 as Ye,bj as Le,e5 as Ie,e6 as Xe,e7 as Ze,e8 as Je,e9 as Qe,ea as es,eb as ss,ec as ts,K as as,G as ns,dY as rs,c2 as xe}from"./index-CvSa8h-C.js";import{C as G,P as pe,a as he,B as ls}from"./PageLayout-B8orsDlo.js";import{R as os,C as ge}from"./Grid-suKoG48i.js";import{c as is,m as cs}from"./node-types-BJsOTMm_.js";import{L as ds,a as ms,b as us}from"./listbox-Xbs80tag.js";import{P as xs}from"./plus-CNNHSjgp.js";import{M as J}from"./map-pin-BCwmmHGs.js";import{T as Ee}from"./trash-2-DUG72tk9.js";import{S as Q,K as I}from"./KeycapButton-BQwZ8hrN.js";import{C as fe}from"./ConfirmModal-D2DSFKRK.js";import{S as ps,C as hs,M as gs}from"./ChatBubble-BuuYl9Rr.js";import{e as fs,g as js,a as vs}from"./chat-utils-BUBqf9vH.js";import{W as ee}from"./wifi-DV8DJqF0.js";import{K as ys}from"./key-round-CYJwakCI.js";import"./element-movement-CM_Y2Bj0.js";import"./keycap-sfx-ByZp-njj.js";import"./triangle-alert-C7tm61-l.js";/** +import{d as U,j as e,dd as Fe,c as L,aH as Oe,e1 as Be,r as o,c0 as Y,R as qe,am as ze,dK as He,an as Ge,x as V,I as q,e2 as Ue,B as F,bL as Me,ao as ue,d8 as Ve,N as se,F as Re,D as W,E as We,e3 as Te,e4 as Ye,bj as Le,e5 as Ie,e6 as Xe,e7 as Ze,e8 as Je,e9 as Qe,ea as es,eb as ss,ec as ts,K as as,G as ns,dY as rs,c2 as xe}from"./index-WhzslczH.js";import{C as G,P as pe,a as he,B as ls}from"./PageLayout-CjepFyhn.js";import{R as os,C as ge}from"./Grid-xhoz0JJL.js";import{c as is,m as cs}from"./node-types-BuI9FfZZ.js";import{L as ds,a as ms,b as us}from"./listbox-B9_kY-R5.js";import{P as xs}from"./plus-Q9JrSYS-.js";import{M as J}from"./map-pin-BXCqDxIA.js";import{T as Ee}from"./trash-2-dqn51YO_.js";import{S as Q,K as I}from"./KeycapButton-BshTHlF3.js";import{C as fe}from"./ConfirmModal-4-j2cctt.js";import{S as ps,C as hs,M as gs}from"./ChatBubble-DKx9qJbz.js";import{e as fs,g as js,a as vs}from"./chat-utils-CPRl3lbc.js";import{W as ee}from"./wifi-B-dNXYIH.js";import{K as ys}from"./key-round-m5pQJFxH.js";import"./element-movement-CSsBUmDY.js";import"./keycap-sfx-ByZp-njj.js";import"./triangle-alert-BsvKjxO1.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Sessions-Q_JqsA8g.js b/frontend/dist/assets/Sessions-DpqaKj0P.js similarity index 96% rename from frontend/dist/assets/Sessions-Q_JqsA8g.js rename to frontend/dist/assets/Sessions-DpqaKj0P.js index 74aaf8fc..3140ae51 100644 --- a/frontend/dist/assets/Sessions-Q_JqsA8g.js +++ b/frontend/dist/assets/Sessions-DpqaKj0P.js @@ -1,4 +1,4 @@ -import{d as x,r as l,eK as G,eL as O,dH as U,j as e,B as b,L as M,D as V,bj as C,c as N,e4 as J,cs as Q,c0 as Z}from"./index-CvSa8h-C.js";import{C as W}from"./ConfirmModal-D2DSFKRK.js";import{D as X}from"./DataBox-CwAsAwyY.js";import{P as Y,a as ee,B as se,C as D}from"./PageLayout-B8orsDlo.js";import{R as ae}from"./refresh-cw-DQJSjSjI.js";import{R as T,C as j}from"./Grid-suKoG48i.js";import{C as te}from"./circle-question-mark-DDUlGgWh.js";import{T as le}from"./triangle-alert-C7tm61-l.js";import{S as ie}from"./shield-DDEEZTF6.js";import{A as ne}from"./antenna-DiJxjpBL.js";import{T as K}from"./trash-2-DUG72tk9.js";/** +import{d as x,r as l,eK as G,eL as O,dH as U,j as e,B as b,L as M,D as V,bj as C,c as N,e4 as J,cs as Q,c0 as Z}from"./index-WhzslczH.js";import{C as W}from"./ConfirmModal-4-j2cctt.js";import{D as X}from"./DataBox-ABvJ7hn1.js";import{P as Y,a as ee,B as se,C as D}from"./PageLayout-CjepFyhn.js";import{R as ae}from"./refresh-cw-BLqMXKuf.js";import{R as T,C as j}from"./Grid-xhoz0JJL.js";import{C as te}from"./circle-question-mark-CJt3zunX.js";import{T as le}from"./triangle-alert-BsvKjxO1.js";import{S as ie}from"./shield-DWGSxaaG.js";import{A as ne}from"./antenna-CzKXc7OF.js";import{T as K}from"./trash-2-dqn51YO_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/SignalIndicator-B0ppyCo-.js b/frontend/dist/assets/SignalIndicator-B1hS3JQG.js similarity index 99% rename from frontend/dist/assets/SignalIndicator-B0ppyCo-.js rename to frontend/dist/assets/SignalIndicator-B1hS3JQG.js index 78ef69a8..e8ed987a 100644 --- a/frontend/dist/assets/SignalIndicator-B0ppyCo-.js +++ b/frontend/dist/assets/SignalIndicator-B1hS3JQG.js @@ -1,4 +1,4 @@ -import{d as i,r as m,c as l,j as r,ca as j,cb as _,cc as k}from"./index-CvSa8h-C.js";/** +import{d as i,r as m,c as l,j as r,ca as j,cb as _,cc as k}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Statistics-Bw6LiBHK.js b/frontend/dist/assets/Statistics-Dzy8J7Q2.js similarity index 98% rename from frontend/dist/assets/Statistics-Bw6LiBHK.js rename to frontend/dist/assets/Statistics-Dzy8J7Q2.js index 91a78051..d22eab02 100644 --- a/frontend/dist/assets/Statistics-Bw6LiBHK.js +++ b/frontend/dist/assets/Statistics-Dzy8J7Q2.js @@ -1,4 +1,4 @@ -var Rt=Object.defineProperty;var Tt=(t,s,n)=>s in t?Rt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var ye=(t,s,n)=>Tt(t,typeof s!="symbol"?s+"":s,n);import{d as He,r as o,j as e,t as Ae,c as at,bk as Nt,cd as vt,ce as et,h as we,cf as Dt,x as _e,cg as Et,ch as Lt,ci as It,k as Pt,cj as Ot,ck as Ft,cl as Ht,cm as Bt,cn as $t,bM as zt,co as $e,bP as Wt,cp as Ut,cq as Gt,N as ke,cr as Vt,X as kt,Y as qt,cs as Kt,bm as Yt,K as Xt,Q as Zt,P as Qt,G as Jt,aq as es,ar as ts,V as ss,ak as ns,ct as ze,a2 as as,cu as it,ac as is,R as rs,a6 as ls}from"./index-CvSa8h-C.js";import{L as Se}from"./layers-Cnw2L-3K.js";import{u as tt,h as os,r as st}from"./consumer-registry-BsBD_8RF.js";import{C as We,e as cs}from"./easing-CvrBfrm0.js";import{T as ms,M as ds}from"./MqttModeBadge-CGW6hCWV.js";import{C as he,P as us,a as hs,B as xs}from"./PageLayout-B8orsDlo.js";import{D as ps}from"./DataBox-CwAsAwyY.js";import{E as fs,A as Ue,D as Pe}from"./DataValue-CjX4hzMo.js";import{C as gs}from"./CollisionExplorerModal-BC_ZJRMz.js";import{H as rt}from"./hash-CTme6GHI.js";import{T as lt}from"./triangle-alert-C7tm61-l.js";import{L as Oe}from"./LightSparkline-BjpzakdT.js";import{A as bs}from"./activity-CctJQ0y-.js";import{c as ys,a as js,A as Ns}from"./AnalyzerFilterPanel-BUuyWAmX.js";import{useResolveSource as vs}from"./usePipelineStore-pGK8Y5O7.js";import{R as je,C as Ce}from"./Grid-suKoG48i.js";import{S as ks}from"./settings-2-CLi8XLBD.js";import{N as ws}from"./network-VirimdjG.js";import"./chevron-right-1kmv-Vqa.js";import"./map-pin-BCwmmHGs.js";import"./index-CPifxb0-.js";import"./BasemapLayer-NuqTvOvz.js";import"./monitor-smartphone-D-7zPu_H.js";import"./node-types-BJsOTMm_.js";import"./circle-question-mark-DDUlGgWh.js";import"./funnel-DLa9oQpD.js";import"./search-BZtD4Hr8.js";/** +var Rt=Object.defineProperty;var Tt=(t,s,n)=>s in t?Rt(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var ye=(t,s,n)=>Tt(t,typeof s!="symbol"?s+"":s,n);import{d as He,r as o,j as e,t as Ae,c as at,bk as Nt,cd as vt,ce as et,h as we,cf as Dt,x as _e,cg as Et,ch as Lt,ci as It,k as Pt,cj as Ot,ck as Ft,cl as Ht,cm as Bt,cn as $t,bM as zt,co as $e,bP as Wt,cp as Ut,cq as Gt,N as ke,cr as Vt,X as kt,Y as qt,cs as Kt,bm as Yt,K as Xt,Q as Zt,P as Qt,G as Jt,aq as es,ar as ts,V as ss,ak as ns,ct as ze,a2 as as,cu as it,ac as is,R as rs,a6 as ls}from"./index-WhzslczH.js";import{L as Se}from"./layers-rhF42Hfn.js";import{u as tt,h as os,r as st}from"./consumer-registry-DcpFyHd4.js";import{C as We,e as cs}from"./easing-CgZkd7Dy.js";import{T as ms,M as ds}from"./MqttModeBadge-xEEk549C.js";import{C as he,P as us,a as hs,B as xs}from"./PageLayout-CjepFyhn.js";import{D as ps}from"./DataBox-ABvJ7hn1.js";import{E as fs,A as Ue,D as Pe}from"./DataValue-DoI73agL.js";import{C as gs}from"./CollisionExplorerModal-D9V91Yz1.js";import{H as rt}from"./hash-Bwa-X17j.js";import{T as lt}from"./triangle-alert-BsvKjxO1.js";import{L as Oe}from"./LightSparkline-CIu8T-_d.js";import{A as bs}from"./activity-CzPYx3Pb.js";import{c as ys,a as js,A as Ns}from"./AnalyzerFilterPanel-DdXhKyZf.js";import{useResolveSource as vs}from"./usePipelineStore-DZf0BPc-.js";import{R as je,C as Ce}from"./Grid-xhoz0JJL.js";import{S as ks}from"./settings-2-DdLL0vPm.js";import{N as ws}from"./network-BXTFbhix.js";import"./chevron-right-Ewog5LA3.js";import"./map-pin-BXCqDxIA.js";import"./index-WiXmWhPS.js";import"./BasemapLayer-CeyADeA1.js";import"./monitor-smartphone-h2eaOleh.js";import"./node-types-BuI9FfZZ.js";import"./circle-question-mark-CJt3zunX.js";import"./funnel-B4y6lzBW.js";import"./search-DttoJEPu.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/System-Bt641EGB.js b/frontend/dist/assets/System-CNYv76nU.js similarity index 98% rename from frontend/dist/assets/System-Bt641EGB.js rename to frontend/dist/assets/System-CNYv76nU.js index 6080b616..f34fffdc 100644 --- a/frontend/dist/assets/System-Bt641EGB.js +++ b/frontend/dist/assets/System-CNYv76nU.js @@ -1,4 +1,4 @@ -import{d as q,dh as B,d8 as A,r as l,p as J,j as e,q as Y,c as F,N as E,di as te,dj as se,dk as re,dl as ne,cd as ae,B as oe,dm as le,dn as G}from"./index-CvSa8h-C.js";import{C as P,P as ce,a as ie,B as de}from"./PageLayout-B8orsDlo.js";import{T as me}from"./triangle-alert-C7tm61-l.js";import{a as ue,A as xe}from"./arrow-up-DQmOy4Je.js";import{N as fe}from"./network-VirimdjG.js";import{A as L}from"./activity-CctJQ0y-.js";import{R as pe}from"./refresh-cw-DQJSjSjI.js";import{C as he}from"./cpu-DRQNCIcF.js";import{R as H,C as $}from"./Grid-suKoG48i.js";/** +import{d as q,dh as B,d8 as A,r as l,p as J,j as e,q as Y,c as F,N as E,di as te,dj as se,dk as re,dl as ne,cd as ae,B as oe,dm as le,dn as G}from"./index-WhzslczH.js";import{C as P,P as ce,a as ie,B as de}from"./PageLayout-CjepFyhn.js";import{T as me}from"./triangle-alert-BsvKjxO1.js";import{a as ue,A as xe}from"./arrow-up-pO4AtOWx.js";import{N as fe}from"./network-BXTFbhix.js";import{A as L}from"./activity-CzPYx3Pb.js";import{R as pe}from"./refresh-cw-BLqMXKuf.js";import{C as he}from"./cpu-CGipD77S.js";import{R as H,C as $}from"./Grid-xhoz0JJL.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Terminal-Bhn7RvtT.js b/frontend/dist/assets/Terminal-xFWzIyff.js similarity index 99% rename from frontend/dist/assets/Terminal-Bhn7RvtT.js rename to frontend/dist/assets/Terminal-xFWzIyff.js index a6979f0c..d8c99566 100644 --- a/frontend/dist/assets/Terminal-Bhn7RvtT.js +++ b/frontend/dist/assets/Terminal-xFWzIyff.js @@ -1,4 +1,4 @@ -var Ua=Object.defineProperty;var ja=(e,t,i)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var D=(e,t,i)=>ja(e,typeof t!="symbol"?t+"":t,i);import{d as ls,Z as si,d8 as pe,dx as Ka,dy as rt,dz as es,dA as qa,cc as Co,cY as xo,cZ as Va,z as ko,dB as Ga,dC as Ya,dD as Xa,e as Eo,cX as Ja,bu as Za,dE as Qa,bJ as Ro,dF as ge,bl as el,bk as tl,c2 as xt,dG as il,dH as sl,dI as rl,dJ as nl,dn as zr,j as m,am as Bo,dK as Mo,an as Lo,B as ol,r as U,A as fs,m as $i,dL as Ur,dM as jr,cw as al,dN as ll,c as ts,dO as hl,dP as cl,K as dl,dQ as ul,dR as _l,dS as fl}from"./index-CvSa8h-C.js";import{a as pl}from"./ping-D0xwlHyD.js";import{g as ml,r as gl}from"./system-CteuZERM.js";import{g as vi,B as Do,r as To,T as $o}from"./ascii-burst-DN6etEs5.js";import{P as vl,B as Sl,C as yl}from"./PageLayout-B8orsDlo.js";import{K as Ao,S as wl}from"./KeycapButton-BQwZ8hrN.js";import{D as Kr}from"./download-CNAyp-3r.js";import{S as qr}from"./search-BZtD4Hr8.js";import{C as bl}from"./chevron-right-1kmv-Vqa.js";import"./keycap-sfx-ByZp-njj.js";/** +var Ua=Object.defineProperty;var ja=(e,t,i)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var D=(e,t,i)=>ja(e,typeof t!="symbol"?t+"":t,i);import{d as ls,Z as si,d8 as pe,dx as Ka,dy as rt,dz as es,dA as qa,cc as Co,cY as xo,cZ as Va,z as ko,dB as Ga,dC as Ya,dD as Xa,e as Eo,cX as Ja,bu as Za,dE as Qa,bJ as Ro,dF as ge,bl as el,bk as tl,c2 as xt,dG as il,dH as sl,dI as rl,dJ as nl,dn as zr,j as m,am as Bo,dK as Mo,an as Lo,B as ol,r as U,A as fs,m as $i,dL as Ur,dM as jr,cw as al,dN as ll,c as ts,dO as hl,dP as cl,K as dl,dQ as ul,dR as _l,dS as fl}from"./index-WhzslczH.js";import{a as pl}from"./ping-BA7i2ph0.js";import{g as ml,r as gl}from"./system-Dr_EmFwL.js";import{g as vi,B as Do,r as To,T as $o}from"./ascii-burst-DN6etEs5.js";import{P as vl,B as Sl,C as yl}from"./PageLayout-CjepFyhn.js";import{K as Ao,S as wl}from"./KeycapButton-BshTHlF3.js";import{D as Kr}from"./download-7lpHRyVo.js";import{S as qr}from"./search-DttoJEPu.js";import{C as bl}from"./chevron-right-Ewog5LA3.js";import"./keycap-sfx-ByZp-njj.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -142,7 +142,7 @@ The web user needs polkit permissions to restart the service. See: /etc/polkit-1/localauthority/50-local.d/pymc-repeater.pkla`,"error");return}i.update(r,n.error||"Restart failed","error")}catch(n){const o=n instanceof Error?n.message:"";o.includes("ERR_NETWORK")||o.includes("ECONNRESET")||o.includes("Failed to fetch")||o.includes("Load failed")||o.includes("network connection was lost")||o.includes("abort")||o.includes("timeout")||n instanceof DOMException&&n.name==="TimeoutError"||n instanceof DOMException&&n.name==="AbortError"?(i.update(r,"Service is restarting (connection dropped).","success"),await this.waitForService(i)):i.update(r,`Error: ${o||"Restart failed"}`,"error")}}waitForService(i){return new Promise(s=>{const r=i.write("Waiting for service...","system");let n=0;const o=30;setTimeout(()=>{const a=setInterval(async()=>{n++,i.update(r,`Waiting for service... ${n}s`,"system");try{const h=new AbortController,l=setTimeout(()=>h.abort(),3e3);await fetch(`${nl}/api/stats`,{signal:h.signal}),clearTimeout(l),clearInterval(a),i.update(r,`Service connected. (${n+4}s)`,"success"),s();return}catch{}n>=o&&(clearInterval(a),i.update(r,`Service did not respond within ${o+4}s. Check manually.`,"warning"),s())},1e3)},4e3)})}}const Wt="\x1B[",Ie=`${Wt}0m`,Fa=`${Wt}32m`,Fr=`${Wt}33m`,Hr=`${Wt}31m`,R_=`${Wt}36m`,Mt=`${Wt}90m`,Ha=`${Wt}1m`;function Xt(e){return e>=1073741824?`${(e/1073741824).toFixed(1)}G`:e>=1048576?`${(e/1048576).toFixed(0)}M`:e>=1024?`${(e/1024).toFixed(0)}K`:`${e}B`}function co(e){const t=Math.floor(e/86400),i=Math.floor(e%86400/3600),s=Math.floor(e%3600/60);return t>0?`${t}d ${i}h ${s}m`:i>0?`${i}h ${s}m`:`${s}m`}function B_(e,t){const i=Math.max(0,Math.min(100,e)),s=Math.round(i/100*t),r=t-s,n=i>=90?Hr:i>=70?Fr:Fa,o=`${n}${"█".repeat(s)}${Ie}${Mt}${"░".repeat(r)}${Ie}`,a=`${i.toFixed(1)}%`.padStart(6);return`[${o}] ${n}${a}${Ie}`}function M_(e){return e>=80?`${Hr}${Ha}${e.toFixed(1)}°C${Ie}`:e>=60?`${Fr}${e.toFixed(1)}°C${Ie}`:`${Fa}${e.toFixed(1)}°C${Ie}`}const Ci=2,uo=" ";function Jt(e,t){const i=" ".repeat(Ci),s=t-Ci,r=uo.length,n=[];let o="",a=0;for(const h of e){const l=cu(h);a===0?(o=h,a=l):a+r+l<=s?(o+=uo+h,a+=r+l):(n.push(i+o),o=h,a=l)}return a>0&&n.push(i+o),n}function L_(e,t,i){var d,u;const s=e.node_name||"unknown",r=e.version?`v${e.version}`:"",n=(d=t.system)!=null&&d.uptime?co(t.system.uptime):"?",o=co(e.uptime_seconds||0),a=Math.max(3,i-Ci*2),h=((u=t.cpu.load_avg)==null?void 0:u["1min"].toFixed(2))??"?",l=t.cpu.load_avg?`${h} ${t.cpu.load_avg["5min"].toFixed(2)} ${t.cpu.load_avg["15min"].toFixed(2)}`:"?",c=i>=60?l:h;return[` ${R_}${Ha}${s}${Ie} ${Mt}${r}${Ie}`,` ${Mt}${"─".repeat(a)}${Ie}`,...Jt([b("Sys",y(n)),b("Svc",y(o)),b("Load",y(c))],i)]}function D_(e,t){const s=Ci+4+1+2+6,r=Math.max(6,Math.min(30,t-s)),n=s+r,o=t-n-2,a=[""],h=`${e.cpu.count} core${e.cpu.count>1?"s":""}`,l=`${Xt(e.memory.used)}/${Xt(e.memory.total)}`,c=`${Xt(e.disk.used)}/${Xt(e.disk.total)}`,d=(f,_,p)=>{const g=B_(_,r),x=o>=p.length?` ${Ae(p)}`:"";return` ${w(f.padEnd(4))}${g}${x}`};a.push(d("CPU",e.cpu.usage_percent,h)),a.push(d("Mem",e.memory.usage_percent,l)),a.push(d("Dsk",e.disk.usage_percent,c));const u=Object.entries(e.temperatures||{});if(u.length>0){const f=u.map(([_,p])=>`${Ae(_+":")} ${M_(p)}`);a.push(...Jt(f,t))}return a}function T_(e,t){var l,c;const i=e.neighbors||{},s=Object.keys(i).length,r=Object.values(i).filter(d=>d.zero_hop).length,n=((c=(l=e.config)==null?void 0:l.repeater)==null?void 0:c.mode)||"?",o=e.noise_floor_dbm!=null?`${e.noise_floor_dbm}dBm`:"?",a=e.duty_cycle_percent??0,h=["",` ${Mt}MESH${Ie}`];return h.push(...Jt([b("Mode",y(n)),b("Nbrs",`${y(String(r))}${Ae(`/${s}`)}`),b("Noise",y(o)),b("Air",y(`${a.toFixed(1)}%`))],t)),h.push(...Jt([b("RX",y(String(e.rx_count??0))),b("TX",y(String(e.tx_count??0))),b("FWD",y(String(e.forwarded_count??0))),b("Drop",y(String(e.dropped_count??0)))],t)),h.push(...Jt([b("RX/h",y(String(Math.round(e.rx_per_hour??0)))),b("FWD/h",y(String(Math.round(e.forwarded_per_hour??0))))],t)),h}function $_(e,t){if(!e.network)return[];const i=["",` ${Mt}NET${Ie}`];return i.push(...Jt([b("TX",y(Xt(e.network.bytes_sent))),b("RX",y(Xt(e.network.bytes_recv))),b("Pkt",`${y(String(e.network.packets_sent))}${Ae("/")}${y(String(e.network.packets_recv))}`)],t)),i}function A_(e,t,i){if(e.length===0)return[];const s=t>=50,r=t>=50?6:5,n=t>=50?6:5,o=s?7:0,a=Ci+0,h=Math.max(4,t-a-o-r-n-4),l=3,c=t>=50?8:5,d=i!=null?Math.max(0,Math.min(c,i-l)):c;if(d<=0)return[];const u=["",` ${Mt}PROCS${Ie}`],f=(s?"PID".padEnd(o):"")+"CPU".padStart(r)+"MEM".padStart(n)+" NAME";u.push(` ${Ae(f)}`);for(const _ of e.slice(0,d)){const p=s?Ae(String(_.pid).padEnd(o)):"",g=(t>=50?_.cpu_percent.toFixed(1):_.cpu_percent.toFixed(0)).padStart(r),x=(t>=50?_.memory_percent.toFixed(1):_.memory_percent.toFixed(0)).padStart(n),z=_.name.length>h?_.name.slice(0,h-1)+"…":_.name,O=_.cpu_percent>=50?Hr:_.cpu_percent>=20?Fr:"",M=O?`${O}${g}${Ie}`:g;u.push(` ${p}${M}${Ae(x)} ${z}`)}return u}function P_(){return new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function _o(e,t,i,s,r){if(!e||!t)return` ${Mt}Waiting for data…${Ie}`;const n=L_(e,t,s),o=D_(t,s),a=T_(e,s),h=$_(t,s),l=["",` ${Mt}${P_()} · Ctrl+C to exit${Ie}`],c=[...n,...o,...a,...h,...l],d=r?wr(c,s):0,u=r?Math.max(0,r-d):void 0,f=A_(i,s,u),_=[...c.slice(0,-l.length),...f,...l];return r&&_.length>r&&(_.length=r),_.join(` `)}const N_=3e3;class I_ extends te{constructor(){super(...arguments);D(this,"name","top");D(this,"description","Live system overview (Ctrl+C to exit)");D(this,"aliases",["htop"])}async execute({output:i,rawInput:s,cols:r,signal:n}){var l,c;if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("top"),` ${w("Live-updating system overview combining hardware")}`,` ${w("stats, mesh metrics, and running processes.")}`,` ${w("Refreshes every 3s. Press Ctrl+C to exit.")}`,"",E("top","start live display"),"",W("Sections"),` ${w("Header Node name, version, uptime, load average")}`,` ${w("Gauges CPU, memory, disk usage with bar charts")}`,` ${w("Mesh Mode, neighbors, packet counts, airtime")}`,` ${w("Network TCP/IP bytes and packet counters")}`,` ${w("Processes Top 8 processes by CPU usage")}`,"",W("Aliases"),` ${w("htop")}`].join(` `));return}let o=null,a=[],h=xt.getState().stats;try{const[d,u]=await Promise.all([es(),zr()]);d.success&&d.data&&(o=d.data),u.success&&u.data&&(a=u.data.processes.sort((f,_)=>_.cpu_percent-f.cpu_percent))}catch{}if(!n.aborted){(l=i.enterFullscreen)==null||l.call(i);try{const d=i.write(_o(h,o,a,i.cols??r,i.rows));await new Promise(u=>{if(n.aborted){u();return}const f=async()=>{h=xt.getState().stats;try{const[p,g]=await Promise.all([es(),zr()]);p.success&&p.data&&(o=p.data),g.success&&g.data&&(a=g.data.processes.sort((x,z)=>z.cpu_percent-x.cpu_percent))}catch{}n.aborted||i.update(d,_o(h,o,a,i.cols??r,i.rows))},_=setInterval(()=>{if(n.aborted){clearInterval(_),u();return}f()},N_);n.addEventListener("abort",()=>{clearInterval(_),u()},{once:!0})})}finally{(c=i.exitFullscreen)==null||c.call(i)}}}}const fo=["DONT PANIC","C0FFEE","FEED C0DE","LOL","I CANNOT DO THAT"];function Wr(){return fo[Math.floor(Math.random()*fo.length)]}const Cr=new EventTarget,xr="shell-phrase";function Wa(e){Cr.dispatchEvent(new CustomEvent(xr,{detail:e??Wr()}))}function O_(e){const t=i=>e(i.detail);return Cr.addEventListener(xr,t),()=>Cr.removeEventListener(xr,t)}class F_ extends te{constructor(){super(...arguments);D(this,"name","fortune");D(this,"description","Display a fortune on the header");D(this,"aliases",["lol"])}execute({output:i}){const s=Wr();Wa(s),i.write(w(` ${s}`))}}const kr=new EventTarget,Er="party-time";function H_(){kr.dispatchEvent(new Event(Er))}function W_(e){return kr.addEventListener(Er,e),()=>kr.removeEventListener(Er,e)}class z_ extends te{constructor(){super(...arguments);D(this,"name","partytime");D(this,"description","Party on, Garth!");D(this,"aliases",["party","excellent","waynesworld"])}execute({output:i}){H_(),Wa("PARTY 0N GARTH"),i.write(w(" SCHWING!"))}}class U_ extends te{constructor(){super(...arguments);D(this,"name","ver");D(this,"description","Show version info");D(this,"aliases",["version"])}async execute({output:i,rawInput:s}){if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("ver"),` ${w("Display pyMC_Repeater, core, and console version.")}`,` ${w('Equivalent to firmware serial CLI "ver" command.')}`,"",E("ver","show version"),"",W("Aliases"),` ${w("version")}`].join(` -`));return}const r=i.write("processing...","system");try{const n=await rt();i.update(r,[` ${b("pyMC_Repeater",y(`v${n.version||"?"}`))}`,` ${b("pyMC_Core",y(n.core_version||"?"))}`,` ${b("pyMC_Console",y("v0.9.303"))}`].join(` +`));return}const r=i.write("processing...","system");try{const n=await rt();i.update(r,[` ${b("pyMC_Repeater",y(`v${n.version||"?"}`))}`,` ${b("pyMC_Core",y(n.core_version||"?"))}`,` ${b("pyMC_Console",y("v0.9.304"))}`].join(` `),"value")}catch(n){i.update(r,`Error: ${n instanceof Error?n.message:"Command failed"}`,"error")}}}class j_ extends te{constructor(){super(...arguments);D(this,"name","clock");D(this,"description","Show system UTC time")}execute({output:i,rawInput:s}){if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("clock"),` ${w("Display the current system UTC time.")}`,` ${w('Equivalent to firmware serial CLI "clock" command.')}`,` ${w("Use to verify NTP sync and correlate packet timestamps.")}`,"",E("clock","show UTC time")].join(` `));return}const r=new Date;i.write([` ${b("UTC",y(r.toUTCString()))}`,` ${b("ISO",y(r.toISOString()))}`,` ${b("Unix",y(String(Math.floor(r.getTime()/1e3))))}`].join(` `),"value")}}class K_ extends te{constructor(){super(...arguments);D(this,"name","stats-packets");D(this,"description","Packet counters")}async execute({output:i,rawInput:s}){if(this.argsAfterName(s).toLowerCase().trim()==="help"){i.write([W("stats-packets"),` ${w("Display packet counters: sent, received, forwarded, dropped.")}`,` ${w('Equivalent to firmware serial CLI "stats-packets" command.')}`,"",E("stats-packets","show packet counters")].join(` diff --git a/frontend/dist/assets/activity-CctJQ0y-.js b/frontend/dist/assets/activity-CzPYx3Pb.js similarity index 89% rename from frontend/dist/assets/activity-CctJQ0y-.js rename to frontend/dist/assets/activity-CzPYx3Pb.js index 452551fc..842426ce 100644 --- a/frontend/dist/assets/activity-CctJQ0y-.js +++ b/frontend/dist/assets/activity-CzPYx3Pb.js @@ -1,4 +1,4 @@ -import{d as t}from"./index-CvSa8h-C.js";/** +import{d as t}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/antenna-DiJxjpBL.js b/frontend/dist/assets/antenna-CzKXc7OF.js similarity index 90% rename from frontend/dist/assets/antenna-DiJxjpBL.js rename to frontend/dist/assets/antenna-CzKXc7OF.js index 33702bbb..d77240bd 100644 --- a/frontend/dist/assets/antenna-DiJxjpBL.js +++ b/frontend/dist/assets/antenna-CzKXc7OF.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/arrow-up-DQmOy4Je.js b/frontend/dist/assets/arrow-up-pO4AtOWx.js similarity index 92% rename from frontend/dist/assets/arrow-up-DQmOy4Je.js rename to frontend/dist/assets/arrow-up-pO4AtOWx.js index f8c4b18b..787b5289 100644 --- a/frontend/dist/assets/arrow-up-DQmOy4Je.js +++ b/frontend/dist/assets/arrow-up-pO4AtOWx.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-CvSa8h-C.js";/** +import{d as o}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/badge-colors-MuK22b26.js b/frontend/dist/assets/badge-colors-BgV-I1O5.js similarity index 96% rename from frontend/dist/assets/badge-colors-MuK22b26.js rename to frontend/dist/assets/badge-colors-BgV-I1O5.js index 157df475..00983575 100644 --- a/frontend/dist/assets/badge-colors-MuK22b26.js +++ b/frontend/dist/assets/badge-colors-BgV-I1O5.js @@ -1,4 +1,4 @@ -import{d as r}from"./index-CvSa8h-C.js";/** +import{d as r}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/chat-utils-BUBqf9vH.js b/frontend/dist/assets/chat-utils-CPRl3lbc.js similarity index 94% rename from frontend/dist/assets/chat-utils-BUBqf9vH.js rename to frontend/dist/assets/chat-utils-CPRl3lbc.js index 76541ba1..3c69bdac 100644 --- a/frontend/dist/assets/chat-utils-BUBqf9vH.js +++ b/frontend/dist/assets/chat-utils-CPRl3lbc.js @@ -1 +1 @@ -import{d8 as a,r as l}from"./index-CvSa8h-C.js";const s=[a.green,a.blue,a.amber,a.pink,a.purple,a.cyan,a.orange,a.teal];function m(e){let n=0;for(let t=0;t0){const t=n[0],o=e.replace(i,"").trim();return{emoji:t,cleanName:o||e}}return{emoji:null,cleanName:e}}function f(e){const{cleanName:n}=u(e),t=n.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const r=Array.from(t[0])[0]||"",c=Array.from(t[1])[0]||"";return(r+c).toUpperCase()}return Array.from(n).slice(0,2).join("").toUpperCase()}function p(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function g(e){const n=/@\[([^\]]+)\]/g,t=[];let o=0,r;for(;(r=n.exec(e))!==null;)r.index>o&&t.push(e.slice(o,r.index)),t.push(l.createElement("span",{key:r.index,className:"font-extrabold text-white"},r[1])),o=r.index+r[0].length;return o0?t:e}export{f as a,p as b,u as e,g as f,m as g}; +import{d8 as a,r as l}from"./index-WhzslczH.js";const s=[a.green,a.blue,a.amber,a.pink,a.purple,a.cyan,a.orange,a.teal];function m(e){let n=0;for(let t=0;t0){const t=n[0],o=e.replace(i,"").trim();return{emoji:t,cleanName:o||e}}return{emoji:null,cleanName:e}}function f(e){const{cleanName:n}=u(e),t=n.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const r=Array.from(t[0])[0]||"",c=Array.from(t[1])[0]||"";return(r+c).toUpperCase()}return Array.from(n).slice(0,2).join("").toUpperCase()}function p(e){return new Date(e*1e3).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}function g(e){const n=/@\[([^\]]+)\]/g,t=[];let o=0,r;for(;(r=n.exec(e))!==null;)r.index>o&&t.push(e.slice(o,r.index)),t.push(l.createElement("span",{key:r.index,className:"font-extrabold text-white"},r[1])),o=r.index+r[0].length;return o0?t:e}export{f as a,p as b,u as e,g as f,m as g}; diff --git a/frontend/dist/assets/chevron-right-1kmv-Vqa.js b/frontend/dist/assets/chevron-right-Ewog5LA3.js similarity index 85% rename from frontend/dist/assets/chevron-right-1kmv-Vqa.js rename to frontend/dist/assets/chevron-right-Ewog5LA3.js index b46c838f..50f29a9a 100644 --- a/frontend/dist/assets/chevron-right-1kmv-Vqa.js +++ b/frontend/dist/assets/chevron-right-Ewog5LA3.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-CvSa8h-C.js";/** +import{d as o}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-check-DW83e7Fg.js b/frontend/dist/assets/circle-check-6eqe109E.js similarity index 87% rename from frontend/dist/assets/circle-check-DW83e7Fg.js rename to frontend/dist/assets/circle-check-6eqe109E.js index a2609bfe..8deb4958 100644 --- a/frontend/dist/assets/circle-check-DW83e7Fg.js +++ b/frontend/dist/assets/circle-check-6eqe109E.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CvSa8h-C.js";/** +import{d as c}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-question-mark-DDUlGgWh.js b/frontend/dist/assets/circle-question-mark-CJt3zunX.js similarity index 89% rename from frontend/dist/assets/circle-question-mark-DDUlGgWh.js rename to frontend/dist/assets/circle-question-mark-CJt3zunX.js index f91f764b..3f6c1b07 100644 --- a/frontend/dist/assets/circle-question-mark-DDUlGgWh.js +++ b/frontend/dist/assets/circle-question-mark-CJt3zunX.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CvSa8h-C.js";/** +import{d as c}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-stop-B5RN0x4p.js b/frontend/dist/assets/circle-stop-e_aFfaa6.js similarity index 94% rename from frontend/dist/assets/circle-stop-B5RN0x4p.js rename to frontend/dist/assets/circle-stop-e_aFfaa6.js index ef492d05..3d0fd14a 100644 --- a/frontend/dist/assets/circle-stop-B5RN0x4p.js +++ b/frontend/dist/assets/circle-stop-e_aFfaa6.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CvSa8h-C.js";/** +import{d as c}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/circle-x-BDVzq0qX.js b/frontend/dist/assets/circle-x-DAvnTI4S.js similarity index 99% rename from frontend/dist/assets/circle-x-BDVzq0qX.js rename to frontend/dist/assets/circle-x-DAvnTI4S.js index 9ecb3261..61fbddb2 100644 --- a/frontend/dist/assets/circle-x-BDVzq0qX.js +++ b/frontend/dist/assets/circle-x-DAvnTI4S.js @@ -1,4 +1,4 @@ -import{r as y,aO as _,d as A}from"./index-CvSa8h-C.js";function S(r,l,e){let s=e.initialDeps??[],t,n=!0;function o(){var i,h,u;let c;e.key&&((i=e.debug)!=null&&i.call(e))&&(c=Date.now());const f=r();if(!(f.length!==s.length||f.some((p,d)=>s[d]!==p)))return t;s=f;let m;if(e.key&&((h=e.debug)!=null&&h.call(e))&&(m=Date.now()),t=l(...f),e.key&&((u=e.debug)!=null&&u.call(e))){const p=Math.round((Date.now()-c)*100)/100,d=Math.round((Date.now()-m)*100)/100,b=d/16,x=(g,E)=>{for(g=String(g);g.lengths[d]!==p)))return t;s=f;let m;if(e.key&&((h=e.debug)!=null&&h.call(e))&&(m=Date.now()),t=l(...f),e.key&&((u=e.debug)!=null&&u.call(e))){const p=Math.round((Date.now()-c)*100)/100,d=Math.round((Date.now()-m)*100)/100,b=d/16,x=(g,E)=>{for(g=String(g);g.length{s=i},o}function M(r,l){if(r===void 0)throw new Error("Unexpected undefined");return r}const R=(r,l)=>Math.abs(r-l)<1.01,k=(r,l,e)=>{let s;return function(...t){r.clearTimeout(s),s=r.setTimeout(()=>l.apply(this,t),e)}},z=r=>{const{offsetWidth:l,offsetHeight:e}=r;return{width:l,height:e}},T=r=>r,W=r=>{const l=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1),s=[];for(let t=l;t<=e;t++)s.push(t);return s},D=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;const t=o=>{const{width:i,height:h}=o;l({width:Math.round(i),height:Math.round(h)})};if(t(z(e)),!s.ResizeObserver)return()=>{};const n=new s.ResizeObserver(o=>{const i=()=>{const h=o[0];if(h!=null&&h.borderBoxSize){const u=h.borderBoxSize[0];if(u){t({width:u.inlineSize,height:u.blockSize});return}}t(z(e))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return n.observe(e,{box:"border-box"}),()=>{n.unobserve(e)}},C={passive:!0},O=typeof window>"u"?!0:"onscrollend"in window,L=(r,l)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;let t=0;const n=r.options.useScrollendEvent&&O?()=>{}:k(s,()=>{l(t,!1)},r.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:f,isRtl:a}=r.options;t=f?e.scrollLeft*(a&&-1||1):e.scrollTop,n(),l(t,c)},i=o(!0),h=o(!1);e.addEventListener("scroll",i,C);const u=r.options.useScrollendEvent&&O;return u&&e.addEventListener("scrollend",h,C),()=>{e.removeEventListener("scroll",i),u&&e.removeEventListener("scrollend",h)}},j=(r,l,e)=>{if(l!=null&&l.borderBoxSize){const s=l.borderBoxSize[0];if(s)return Math.round(s[e.options.horizontal?"inlineSize":"blockSize"])}return r[e.options.horizontal?"offsetWidth":"offsetHeight"]},P=(r,{adjustments:l=0,behavior:e},s)=>{var t,n;const o=r+l;(n=(t=s.scrollElement)==null?void 0:t.scrollTo)==null||n.call(t,{[s.options.horizontal?"left":"top"]:o,behavior:e})};class N{constructor(l){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const s=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(t=>{t.forEach(n=>{const o=()=>{this._measureElement(n.target,n)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var t;(t=s())==null||t.disconnect(),e=null},observe:t=>{var n;return(n=s())==null?void 0:n.observe(t,{box:"border-box"})},unobserve:t=>{var n;return(n=s())==null?void 0:n.unobserve(t)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([s,t])=>{typeof t>"u"&&delete e[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:T,rangeExtractor:W,onChange:()=>{},measureElement:j,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var s,t;(t=(s=this.options).onChange)==null||t.call(s,this,e)},this.maybeNotify=S(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,n)=>{this.scrollAdjustments=0,this.scrollDirection=n?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,s)=>{const t=new Map,n=new Map;for(let o=s-1;o>=0;o--){const i=e[o];if(t.has(i.lane))continue;const h=n.get(i.lane);if(h==null||i.end>h.end?n.set(i.lane,i):i.endo.end===i.end?o.index-i.index:o.end-i.end)[0]:void 0},this.getMeasurementOptions=S(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,s,t,n,o,i)=>(this.prevLanes!==void 0&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:o,lanes:i}),{key:!1}),this.getMeasurements=S(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:s,scrollMargin:t,getItemKey:n,enabled:o,lanes:i},h)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const a of this.laneAssignments.keys())a>=e&&this.laneAssignments.delete(a);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(a=>{this.itemSizeCache.set(a.key,a.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const c=this.measurementsCache.slice(0,u),f=new Array(i).fill(void 0);for(let a=0;a1){d=p;const v=f[d],w=v!==void 0?c[v]:void 0;b=w?w.end+this.options.gap:s+t}else{const v=this.options.lanes===1?c[a-1]:this.getFurthestMeasurement(c,a);b=v?v.end+this.options.gap:s+t,d=v?v.lane:a%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(a,d)}const x=h.get(m),g=typeof x=="number"?x:this.options.estimateSize(a),E=b+g;c[a]={index:a,start:b,size:g,end:E,key:m,lane:d},f[d]=a}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=S(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,s,t,n)=>this.range=e.length>0&&s>0?B({measurements:e,outerSize:s,scrollOffset:t,lanes:n}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=S(()=>{let e=null,s=null;const t=this.calculateRange();return t&&(e=t.startIndex,s=t.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,s]},(e,s,t,n,o)=>n===null||o===null?[]:e({startIndex:n,endIndex:o,overscan:s,count:t}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const s=this.options.indexAttribute,t=e.getAttribute(s);return t?parseInt(t,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(e,s)=>{const t=this.indexFromElement(e),n=this.measurementsCache[t];if(!n)return;const o=n.key,i=this.elementsCache.get(o);i!==e&&(i&&this.observer.unobserve(i),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(t,this.options.measureElement(e,s,this))},this.resizeItem=(e,s)=>{const t=this.measurementsCache[e];if(!t)return;const n=this.itemSizeCache.get(t.key)??t.size,o=s-n;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(t,o,this):t.start{if(!e){this.elementsCache.forEach((s,t)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=S(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,s)=>{const t=[];for(let n=0,o=e.length;nthis.options.debug}),this.getVirtualItemForOffset=e=>{const s=this.getMeasurements();if(s.length!==0)return M(s[F(0,s.length-1,t=>M(s[t]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,s,t=0)=>{if(!this.scrollElement)return 0;const n=this.getSize(),o=this.getScrollOffset();s==="auto"&&(s=e>=o+n?"end":"start"),s==="center"?e+=(t-n)/2:s==="end"&&(e-=n);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,s="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const t=this.measurementsCache[e];if(!t)return;const n=this.getSize(),o=this.getScrollOffset();if(s==="auto")if(t.end>=o+n-this.options.scrollPaddingEnd)s="end";else if(t.start<=o+this.options.scrollPaddingStart)s="start";else return[o,s];if(s==="end"&&e===this.options.count-1)return[this.getMaxScrollOffset(),s];const i=s==="end"?t.end+this.options.scrollPaddingEnd:t.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,s,t.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:s="start",behavior:t}={})=>{t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,s),{adjustments:void 0,behavior:t})},this.scrollToIndex=(e,{align:s="auto",behavior:t}={})=>{t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let n=0;const o=10,i=u=>{if(!this.targetWindow)return;const c=this.getOffsetForIndex(e,u);if(!c){console.warn("Failed to get offset for index:",e);return}const[f,a]=c;this._scrollToOffset(f,{adjustments:void 0,behavior:t}),this.targetWindow.requestAnimationFrame(()=>{const m=()=>{if(this.currentScrollToIndex!==e)return;const p=this.getScrollOffset(),d=this.getOffsetForIndex(e,a);if(!d){console.warn("Failed to get offset for index:",e);return}R(d[0],p)||h(a)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(m):m()})},h=u=>{this.targetWindow&&this.currentScrollToIndex===e&&(n++,ni(u)):console.warn(`Failed to scroll to index ${e} after ${o} attempts.`))};i(s)},this.scrollBy=(e,{behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var e;const s=this.getMeasurements();let t;if(s.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=((e=s[s.length-1])==null?void 0:e.end)??0;else{const n=Array(this.options.lanes).fill(null);let o=s.length-1;for(;o>=0&&n.some(i=>i===null);){const i=s[o];n[i.lane]===null&&(n[i.lane]=i.end),o--}t=Math.max(...n.filter(i=>i!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:s,behavior:t})=>{this.options.scrollToFn(e,{behavior:t,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(l)}}const F=(r,l,e,s)=>{for(;r<=l;){const t=(r+l)/2|0,n=e(t);if(ns)l=t-1;else return t}return r>0?r-1:0};function B({measurements:r,outerSize:l,scrollOffset:e,lanes:s}){const t=r.length-1,n=h=>r[h].start;if(r.length<=s)return{startIndex:0,endIndex:t};let o=F(0,t,n,e),i=o;if(s===1)for(;i1){const h=Array(s).fill(0);for(;ic=0&&u.some(c=>c>=e);){const c=r[o];u[c.lane]=c.start,o--}o=Math.max(0,o-o%s),i=Math.min(t,i+(s-1-i%s))}return{startIndex:o,endIndex:i}}const I=typeof document<"u"?y.useLayoutEffect:y.useEffect;function H({useFlushSync:r=!0,...l}){const e=y.useReducer(()=>({}),{})[1],s={...l,onChange:(n,o)=>{var i;r&&o?_.flushSync(e):e(),(i=l.onChange)==null||i.call(l,n,o)}},[t]=y.useState(()=>new N(s));return t.setOptions(s),I(()=>t._didMount(),[]),I(()=>t._willUpdate()),t}function U(r){return H({observeElementRect:D,observeElementOffset:L,scrollToFn:P,...r})}/** diff --git a/frontend/dist/assets/consumer-registry-BsBD_8RF.js b/frontend/dist/assets/consumer-registry-DcpFyHd4.js similarity index 92% rename from frontend/dist/assets/consumer-registry-BsBD_8RF.js rename to frontend/dist/assets/consumer-registry-DcpFyHd4.js index b501e96f..0275182b 100644 --- a/frontend/dist/assets/consumer-registry-BsBD_8RF.js +++ b/frontend/dist/assets/consumer-registry-DcpFyHd4.js @@ -1 +1 @@ -import{ah as n,r as i}from"./index-CvSa8h-C.js";const p=t=>(t.type??t.payload_type)===n.ADVERT,l=t=>(t.type??t.payload_type)===n.TRACE,h=t=>(t.type??t.payload_type)===n.TXT_MSG,_=t=>(t.type??t.payload_type)===n.PATH,d=t=>(t.type??t.payload_type)===n.ACK,g=t=>{const e=t.type??t.payload_type;return e===n.GRP_TXT||e===n.GRP_DATA},m=t=>(t.path_length??(Array.isArray(t.original_path)?t.original_path.length:0))>0,A=t=>!!t.src_hash,T=t=>t.airtime_ms!=null,c=new Set,o=new Map;function a(t,e){return`${t}|${e}`}function u(t,e){const s=a(t,e);o.set(s,(o.get(s)??0)+1)}function y(t,e){const s=a(t,e),r=o.get(s)??0;r>1?o.set(s,r-1):o.delete(s)}function C(t){for(const e of t){const s=a(e.target,e.fn);c.has(s)||c.add(s)}}function P(t){i.useEffect(()=>{for(const e of t)u(e.target,e.fn);return()=>{for(const e of t)y(e.target,e.fn)}},[t])}export{m as a,A as b,h as c,d,p as e,l as f,_ as g,T as h,g as i,C as r,P as u}; +import{ah as n,r as i}from"./index-WhzslczH.js";const p=t=>(t.type??t.payload_type)===n.ADVERT,l=t=>(t.type??t.payload_type)===n.TRACE,h=t=>(t.type??t.payload_type)===n.TXT_MSG,_=t=>(t.type??t.payload_type)===n.PATH,d=t=>(t.type??t.payload_type)===n.ACK,g=t=>{const e=t.type??t.payload_type;return e===n.GRP_TXT||e===n.GRP_DATA},m=t=>(t.path_length??(Array.isArray(t.original_path)?t.original_path.length:0))>0,A=t=>!!t.src_hash,T=t=>t.airtime_ms!=null,c=new Set,o=new Map;function a(t,e){return`${t}|${e}`}function u(t,e){const s=a(t,e);o.set(s,(o.get(s)??0)+1)}function y(t,e){const s=a(t,e),r=o.get(s)??0;r>1?o.set(s,r-1):o.delete(s)}function C(t){for(const e of t){const s=a(e.target,e.fn);c.has(s)||c.add(s)}}function P(t){i.useEffect(()=>{for(const e of t)u(e.target,e.fn);return()=>{for(const e of t)y(e.target,e.fn)}},[t])}export{m as a,A as b,h as c,d,p as e,l as f,_ as g,T as h,g as i,C as r,P as u}; diff --git a/frontend/dist/assets/cpu-DRQNCIcF.js b/frontend/dist/assets/cpu-CGipD77S.js similarity index 94% rename from frontend/dist/assets/cpu-DRQNCIcF.js rename to frontend/dist/assets/cpu-CGipD77S.js index 36f234a0..d585e041 100644 --- a/frontend/dist/assets/cpu-DRQNCIcF.js +++ b/frontend/dist/assets/cpu-CGipD77S.js @@ -1,4 +1,4 @@ -import{d as h}from"./index-CvSa8h-C.js";/** +import{d as h}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/database-bNR-4XQS.js b/frontend/dist/assets/database-Hkah1WM3.js similarity index 89% rename from frontend/dist/assets/database-bNR-4XQS.js rename to frontend/dist/assets/database-Hkah1WM3.js index 96760d0a..8556100c 100644 --- a/frontend/dist/assets/database-bNR-4XQS.js +++ b/frontend/dist/assets/database-Hkah1WM3.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/download-CNAyp-3r.js b/frontend/dist/assets/download-7lpHRyVo.js similarity index 89% rename from frontend/dist/assets/download-CNAyp-3r.js rename to frontend/dist/assets/download-7lpHRyVo.js index 10967c07..97c2db96 100644 --- a/frontend/dist/assets/download-CNAyp-3r.js +++ b/frontend/dist/assets/download-7lpHRyVo.js @@ -1,4 +1,4 @@ -import{d as o}from"./index-CvSa8h-C.js";/** +import{d as o}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/easing-CvrBfrm0.js b/frontend/dist/assets/easing-CgZkd7Dy.js similarity index 90% rename from frontend/dist/assets/easing-CvrBfrm0.js rename to frontend/dist/assets/easing-CgZkd7Dy.js index ef620935..60e51bf1 100644 --- a/frontend/dist/assets/easing-CvrBfrm0.js +++ b/frontend/dist/assets/easing-CgZkd7Dy.js @@ -1,4 +1,4 @@ -import{d as s,fd as a}from"./index-CvSa8h-C.js";/** +import{d as s,fd as a}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/element-movement-CM_Y2Bj0.js b/frontend/dist/assets/element-movement-CSsBUmDY.js similarity index 98% rename from frontend/dist/assets/element-movement-CM_Y2Bj0.js rename to frontend/dist/assets/element-movement-CSsBUmDY.js index 61e04f1b..47ba76e7 100644 --- a/frontend/dist/assets/element-movement-CM_Y2Bj0.js +++ b/frontend/dist/assets/element-movement-CSsBUmDY.js @@ -1 +1 @@ -import{r as o,au as v,cz as b,eU as h,eV as w,cQ as x,b6 as c,b9 as R}from"./index-CvSa8h-C.js";function y(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function z(e=y){return o.useCallback((t,r)=>{if(typeof e=="string"){let u=e;return(t==null?void 0:t[u])===(r==null?void 0:r[u])}return e(t,r)},[e])}var $=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))($||{});function N(e){let t=o.useRef(null),r=v(l=>{t.current=l.pointerType,!b(l.currentTarget)&&l.pointerType==="mouse"&&l.button===$.Left&&(l.preventDefault(),e(l))}),u=v(l=>{t.current!=="mouse"&&(b(l.currentTarget)||e(l))});return{onPointerDown:r,onClick:u}}var S=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(S||{});const j={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,k=5;function F(e,{trigger:t,action:r,close:u,select:l}){let n=o.useRef(null),i=o.useRef(null),a=o.useRef(null);h(e&&t!==null,"pointerdown",s=>{w(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(i.current=s.x,a.current=s.y,n.current=s.timeStamp)}),h(e&&t!==null,"pointerup",s=>{var d,f;let g=n.current;if(g===null||(n.current=null,!x(s.target))||Math.abs(s.x-((d=i.current)!=null?d:s.x))I&&(l(p.target),u());break}case 2:{u();break}}},{capture:!0})}function m(e){return[e.screenX,e.screenY]}function P(){let e=o.useRef([-1,-1]);return{wasMoved(t){let r=m(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=m(t)}}}function L({children:e,freeze:t},r){let u=E(t,e);return o.isValidElement(u)?o.cloneElement(u,{ref:r}):c.createElement(c.Fragment,null,u)}const U=c.forwardRef(L);function E(e,t){let[r,u]=o.useState(t);return!e&&r!==t&&u(t),e?r:t}function T(e){throw new Error("Unexpected object: "+e)}var C=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(C||{});function V(e,t){let r=t.resolveItems();if(r.length<=0)return null;let u=t.resolveActiveIndex(),l=u??-1;switch(e.focus){case 0:{for(let n=0;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 2:{for(let n=l+1;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 4:{for(let n=0;n({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function D(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function B(e,t,r){let u=R();if(t.kind==="Tracked"){let l=function(){n!==D(e)&&(u.dispose(),r())},{position:n}=t,i=new ResizeObserver(l);i.observe(e),u.add(()=>i.disconnect()),u.addEventListener(window,"scroll",l,{passive:!0}),u.addEventListener(window,"resize",l)}return()=>u.dispose()}export{F as L,j as S,A as a,D as b,C as c,U as d,P as e,V as f,$ as g,z as h,B as p,N as s,E as u}; +import{r as o,au as v,cz as b,eU as h,eV as w,cQ as x,b6 as c,b9 as R}from"./index-WhzslczH.js";function y(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function z(e=y){return o.useCallback((t,r)=>{if(typeof e=="string"){let u=e;return(t==null?void 0:t[u])===(r==null?void 0:r[u])}return e(t,r)},[e])}var $=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))($||{});function N(e){let t=o.useRef(null),r=v(l=>{t.current=l.pointerType,!b(l.currentTarget)&&l.pointerType==="mouse"&&l.button===$.Left&&(l.preventDefault(),e(l))}),u=v(l=>{t.current!=="mouse"&&(b(l.currentTarget)||e(l))});return{onPointerDown:r,onClick:u}}var S=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(S||{});const j={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,k=5;function F(e,{trigger:t,action:r,close:u,select:l}){let n=o.useRef(null),i=o.useRef(null),a=o.useRef(null);h(e&&t!==null,"pointerdown",s=>{w(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(i.current=s.x,a.current=s.y,n.current=s.timeStamp)}),h(e&&t!==null,"pointerup",s=>{var d,f;let g=n.current;if(g===null||(n.current=null,!x(s.target))||Math.abs(s.x-((d=i.current)!=null?d:s.x))I&&(l(p.target),u());break}case 2:{u();break}}},{capture:!0})}function m(e){return[e.screenX,e.screenY]}function P(){let e=o.useRef([-1,-1]);return{wasMoved(t){let r=m(t);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(t){e.current=m(t)}}}function L({children:e,freeze:t},r){let u=E(t,e);return o.isValidElement(u)?o.cloneElement(u,{ref:r}):c.createElement(c.Fragment,null,u)}const U=c.forwardRef(L);function E(e,t){let[r,u]=o.useState(t);return!e&&r!==t&&u(t),e?r:t}function T(e){throw new Error("Unexpected object: "+e)}var C=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(C||{});function V(e,t){let r=t.resolveItems();if(r.length<=0)return null;let u=t.resolveActiveIndex(),l=u??-1;switch(e.focus){case 0:{for(let n=0;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 2:{for(let n=l+1;n=0;--n)if(!t.resolveDisabled(r[n],n,r))return n;return u}case 4:{for(let n=0;n({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function D(e){let t=e.getBoundingClientRect();return`${t.x},${t.y}`}function B(e,t,r){let u=R();if(t.kind==="Tracked"){let l=function(){n!==D(e)&&(u.dispose(),r())},{position:n}=t,i=new ResizeObserver(l);i.observe(e),u.add(()=>i.disconnect()),u.addEventListener(window,"scroll",l,{passive:!0}),u.addEventListener(window,"resize",l)}return()=>u.dispose()}export{F as L,j as S,A as a,D as b,C as c,U as d,P as e,V as f,$ as g,z as h,B as p,N as s,E as u}; diff --git a/frontend/dist/assets/funnel-DLa9oQpD.js b/frontend/dist/assets/funnel-B4y6lzBW.js similarity index 89% rename from frontend/dist/assets/funnel-DLa9oQpD.js rename to frontend/dist/assets/funnel-B4y6lzBW.js index 97d5065f..df69c025 100644 --- a/frontend/dist/assets/funnel-DLa9oQpD.js +++ b/frontend/dist/assets/funnel-B4y6lzBW.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/hash-CTme6GHI.js b/frontend/dist/assets/hash-Bwa-X17j.js similarity index 90% rename from frontend/dist/assets/hash-CTme6GHI.js rename to frontend/dist/assets/hash-Bwa-X17j.js index d459c9a1..4f9593f0 100644 --- a/frontend/dist/assets/hash-CTme6GHI.js +++ b/frontend/dist/assets/hash-Bwa-X17j.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/index-CvSa8h-C.js b/frontend/dist/assets/index-WhzslczH.js similarity index 99% rename from frontend/dist/assets/index-CvSa8h-C.js rename to frontend/dist/assets/index-WhzslczH.js index 883ed370..b86cb95e 100644 --- a/frontend/dist/assets/index-CvSa8h-C.js +++ b/frontend/dist/assets/index-WhzslczH.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login-CO56EEwr.js","assets/ascii-burst-DN6etEs5.js","assets/Dashboard-B3SyL0YD.js","assets/PageLayout-B8orsDlo.js","assets/consumer-registry-BsBD_8RF.js","assets/DataValue-CjX4hzMo.js","assets/index-CPifxb0-.js","assets/node-types-BJsOTMm_.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-Bpo20OVL.js","assets/circle-x-BDVzq0qX.js","assets/primitives-BahnzDua.js","assets/badge-colors-MuK22b26.js","assets/chat-utils-BUBqf9vH.js","assets/SignalIndicator-B0ppyCo-.js","assets/arrow-up-DQmOy4Je.js","assets/chevron-right-1kmv-Vqa.js","assets/map-pin-BCwmmHGs.js","assets/circle-question-mark-DDUlGgWh.js","assets/triangle-alert-C7tm61-l.js","assets/DataBox-CwAsAwyY.js","assets/layers-Cnw2L-3K.js","assets/hash-CTme6GHI.js","assets/activity-CctJQ0y-.js","assets/circle-check-DW83e7Fg.js","assets/database-bNR-4XQS.js","assets/useMapViewStore-1D-N8rLK.js","assets/shield-DDEEZTF6.js","assets/MqttModeBadge-CGW6hCWV.js","assets/zap-mngIm3qT.js","assets/usePipelineStore-pGK8Y5O7.js","assets/LightSparkline-BjpzakdT.js","assets/link-scoring-DaKaf0kz.js","assets/NodeInformationCard-CtqEav-P.js","assets/ChatBubble-BuuYl9Rr.js","assets/message-square-DODYXl2V.js","assets/Grid-suKoG48i.js","assets/Packets-CNQvqRHc.js","assets/element-movement-CM_Y2Bj0.js","assets/AnalyzerFilterPanel-BUuyWAmX.js","assets/monitor-smartphone-D-7zPu_H.js","assets/funnel-DLa9oQpD.js","assets/search-BZtD4Hr8.js","assets/Contacts-DyjGy2DF.js","assets/ping-D0xwlHyD.js","assets/listbox-Xbs80tag.js","assets/CollisionExplorerModal-BC_ZJRMz.js","assets/BasemapLayer-NuqTvOvz.js","assets/target-M8AQjykJ.js","assets/network-VirimdjG.js","assets/trash-2-DUG72tk9.js","assets/ConfirmModal-D2DSFKRK.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-Bw6LiBHK.js","assets/easing-CvrBfrm0.js","assets/settings-2-CLi8XLBD.js","assets/MeshGraph-8GIpDJZb.js","assets/max-B4xU84un.js","assets/download-CNAyp-3r.js","assets/System-Bt641EGB.js","assets/refresh-cw-DQJSjSjI.js","assets/cpu-DRQNCIcF.js","assets/Logs-BreOeqGn.js","assets/circle-stop-B5RN0x4p.js","assets/Terminal-Bhn7RvtT.js","assets/system-CteuZERM.js","assets/KeycapButton-BQwZ8hrN.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-tKO62oR_.js","assets/antenna-DiJxjpBL.js","assets/plus-CNNHSjgp.js","assets/key-round-CYJwakCI.js","assets/RoomServer-DuVH7Mva.js","assets/wifi-DV8DJqF0.js","assets/PacketObservatory-CoKryHKi.js","assets/Sessions-Q_JqsA8g.js","assets/Mqtt-BaDp61mH.js","assets/wifi-off-B6--LVD1.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login-EFNGv6qi.js","assets/ascii-burst-DN6etEs5.js","assets/Dashboard-6pffDPFe.js","assets/PageLayout-CjepFyhn.js","assets/consumer-registry-DcpFyHd4.js","assets/DataValue-DoI73agL.js","assets/index-WiXmWhPS.js","assets/node-types-BuI9FfZZ.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-3khSiIZq.js","assets/circle-x-DAvnTI4S.js","assets/primitives-Bq_jqX-t.js","assets/badge-colors-BgV-I1O5.js","assets/chat-utils-CPRl3lbc.js","assets/SignalIndicator-B1hS3JQG.js","assets/arrow-up-pO4AtOWx.js","assets/chevron-right-Ewog5LA3.js","assets/map-pin-BXCqDxIA.js","assets/circle-question-mark-CJt3zunX.js","assets/triangle-alert-BsvKjxO1.js","assets/DataBox-ABvJ7hn1.js","assets/layers-rhF42Hfn.js","assets/hash-Bwa-X17j.js","assets/activity-CzPYx3Pb.js","assets/circle-check-6eqe109E.js","assets/database-Hkah1WM3.js","assets/useMapViewStore-7rwVBEII.js","assets/shield-DWGSxaaG.js","assets/MqttModeBadge-xEEk549C.js","assets/zap-Ec1PEQMI.js","assets/usePipelineStore-DZf0BPc-.js","assets/LightSparkline-CIu8T-_d.js","assets/link-scoring-DGx3Bvuc.js","assets/NodeInformationCard-DJ0EACZ1.js","assets/ChatBubble-DKx9qJbz.js","assets/message-square-D2zm03U4.js","assets/Grid-xhoz0JJL.js","assets/Packets-D9oGi0fh.js","assets/element-movement-CSsBUmDY.js","assets/AnalyzerFilterPanel-DdXhKyZf.js","assets/monitor-smartphone-h2eaOleh.js","assets/funnel-B4y6lzBW.js","assets/search-DttoJEPu.js","assets/Contacts-2Yx_cmAj.js","assets/ping-BA7i2ph0.js","assets/listbox-B9_kY-R5.js","assets/CollisionExplorerModal-D9V91Yz1.js","assets/BasemapLayer-CeyADeA1.js","assets/target-PpDPv2u2.js","assets/network-BXTFbhix.js","assets/trash-2-dqn51YO_.js","assets/ConfirmModal-4-j2cctt.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-Dzy8J7Q2.js","assets/easing-CgZkd7Dy.js","assets/settings-2-DdLL0vPm.js","assets/MeshGraph-V9pZlvEq.js","assets/max-Ch6kRxV_.js","assets/download-7lpHRyVo.js","assets/System-CNYv76nU.js","assets/refresh-cw-BLqMXKuf.js","assets/cpu-CGipD77S.js","assets/Logs-BT5P96Jv.js","assets/circle-stop-e_aFfaa6.js","assets/Terminal-xFWzIyff.js","assets/system-Dr_EmFwL.js","assets/KeycapButton-BshTHlF3.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-DaPSiY3g.js","assets/antenna-CzKXc7OF.js","assets/plus-Q9JrSYS-.js","assets/key-round-m5pQJFxH.js","assets/RoomServer-BWTs1Hn2.js","assets/wifi-B-dNXYIH.js","assets/PacketObservatory-CGzUdg1y.js","assets/Sessions-DpqaKj0P.js","assets/Mqtt-DrmwIl2T.js","assets/wifi-off-DjfOg4sJ.js"])))=>i.map(i=>d[i]); var o9=Object.defineProperty;var hx=e=>{throw TypeError(e)};var s9=(e,t,n)=>t in e?o9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Le=(e,t,n)=>s9(e,typeof t!="symbol"?t+"":t,n),Ly=(e,t,n)=>t.has(e)||hx("Cannot "+n);var me=(e,t,n)=>(Ly(e,t,"read from private field"),n?n.call(e):t.get(e)),Gt=(e,t,n)=>t.has(e)?hx("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),St=(e,t,n,r)=>(Ly(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),mt=(e,t,n)=>(Ly(e,t,"access private method"),n);var kh=(e,t,n,r)=>({set _(o){St(e,t,o,n)},get _(){return me(e,t,r)}});function i9(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function a9(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iy={exports:{}},qu={},Ny={exports:{}},$t={};/** * @license React * react.production.min.js @@ -261,7 +261,7 @@ Please change the parent to {k.contains(A)&&k.removeChild(A)}},[t]),P.jsx(rV,{isPresent:t,childRef:i,sizeRef:l,children:D.cloneElement(e,{ref:d})})}const sV=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:l,anchorY:c,root:f})=>{const d=n2(iV),h=D.useId();let p=!0,g=D.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:o,onExitComplete:y=>{d.set(y,!0);for(const b of d.values())if(!b)return;r&&r()},register:y=>(d.set(y,!1),()=>d.delete(y))}),[n,d,r]);return s&&p&&(g={...g}),D.useMemo(()=>{d.forEach((y,b)=>d.set(b,!1))},[n]),D.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),i==="popLayout"&&(e=P.jsx(oV,{isPresent:n,anchorX:l,anchorY:c,root:f,children:e})),P.jsx(sd.Provider,{value:g,children:e})};function iV(){return new Map}function M4(e=!0){const t=D.useContext(sd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=D.useId();D.useEffect(()=>{if(e)return o(s)},[e]);const i=D.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}function Rte(){return aV(D.useContext(sd))}function aV(e){return e===null?!0:e.isPresent}const jh=e=>e.key||"";function qA(e){const t=[];return D.Children.forEach(e,n=>{D.isValidElement(n)&&t.push(n)}),t}const au=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:l="left",anchorY:c="top",root:f})=>{const[d,h]=M4(i),p=D.useMemo(()=>qA(e),[e]),g=i&&!d?[]:p.map(jh),y=D.useRef(!0),b=D.useRef(p),E=n2(()=>new Map),x=D.useRef(new Set),[v,C]=D.useState(p),[A,k]=D.useState(p);r2(()=>{y.current=!1,b.current=p;for(let B=0;B{const M=jh(B),I=i&&!d?!1:p===A||g.includes(M),O=()=>{if(x.current.has(M))return;if(x.current.add(M),E.has(M))E.set(M,!0);else return;let j=!0;E.forEach(z=>{z||(j=!1)}),j&&(L==null||L(),k(b.current),i&&(h==null||h()),r&&r())};return P.jsx(sV,{isPresent:I,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:I?void 0:O,anchorX:l,anchorY:c,children:B},M)})})},lV=D.createContext(null);function cV(){const e=D.useRef(!1);return r2(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function uV(){const e=cV(),[t,n]=D.useState(0),r=D.useCallback(()=>{e.current&&n(t+1)},[t]);return[D.useCallback(()=>wn.postRender(r),[r]),t]}const R4=e=>e===!0,fV=e=>R4(e===!0)||e==="id",dV=({children:e,id:t,inherit:n=!0})=>{const r=D.useContext($f),o=D.useContext(lV),[s,i]=uV(),l=D.useRef(null),c=r.id||o;l.current===null&&(fV(n)&&c&&(t=t?c+"-"+t:c),l.current={id:t,group:R4(n)&&r.group||WA()});const f=D.useMemo(()=>({...l.current,forceRender:s}),[i]);return P.jsx($f.Provider,{value:f,children:e})},L4=D.createContext({strict:!1}),GA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let KA=!1;function hV(){if(KA)return;const e={};for(const t in GA)e[t]={isEnabled:n=>GA[t].some(r=>!!n[r])};c4(e),KA=!0}function I4(){return hV(),qU()}function pV(e){const t=I4();for(const n in e)t[n]={...t[n],...e[n]};c4(t)}const mV=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function pm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||mV.has(e)}let N4=e=>!pm(e);function gV(e){typeof e=="function"&&(N4=t=>t.startsWith("on")?!pm(t):e(t))}try{gV(require("@emotion/is-prop-valid").default)}catch{}function yV(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(N4(o)||n===!0&&pm(o)||!t&&!pm(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const tg=D.createContext({});function bV(e,t){if(eg(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Wf(n)?n:void 0,animate:Wf(r)?r:void 0}}return e.inherit!==!1?t:{}}function vV(e){const{initial:t,animate:n}=bV(e,D.useContext(tg));return D.useMemo(()=>({initial:t,animate:n}),[YA(t),YA(n)])}function YA(e){return Array.isArray(e)?e.join(" "):e}const M2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function j4(e,t,n){for(const r in t)!Nr(t[r])&&!g4(r,n)&&(e[r]=t[r])}function wV({transformTemplate:e},t){return D.useMemo(()=>{const n=M2();return F2(n,t,e),Object.assign({},n.vars,n.style)},[t])}function EV(e,t){const n=e.style||{},r={};return j4(r,n,e),Object.assign(r,wV(e,t)),r}function CV(e,t){const n={},r=EV(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const O4=()=>({...M2(),attrs:{}});function xV(e,t,n,r){const o=D.useMemo(()=>{const s=O4();return y4(s,t,v4(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};j4(s,e.style,e),o.style={...s,...o.style}}return o}const kV=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function R2(e){return typeof e!="string"||e.includes("-")?!1:!!(kV.indexOf(e)>-1||/[A-Z]/u.test(e))}function AV(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??R2(e)?xV:CV)(t,r,o,e),f=yV(t,typeof e=="string",s),d=e!==D.Fragment?{...f,...c,ref:n}:{},{children:h}=t,p=D.useMemo(()=>Nr(h)?h.get():h,[h]);return D.createElement(e,{...d,children:p})}function SV({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:_V(n,r,o,e),renderState:t()}}function _V(e,t,n,r){const o={},s=r(e,{});for(const p in s)o[p]=yp(s[p]);let{initial:i,animate:l}=e;const c=eg(e),f=l4(e);t&&f&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const h=d?l:i;if(h&&typeof h!="boolean"&&!Zm(h)){const p=Array.isArray(h)?h:[h];for(let g=0;g(t,n)=>{const r=D.useContext(tg),o=D.useContext(sd),s=()=>SV(e,t,r,o);return n?s():n2(s)},DV=$4({scrapeMotionValuesFromProps:B2,createRenderState:M2}),TV=$4({scrapeMotionValuesFromProps:w4,createRenderState:O4}),FV=Symbol.for("motionComponentSymbol");function BV(e,t,n){const r=D.useRef(n);D.useInsertionEffect(()=>{r.current=n});const o=D.useRef(null);return D.useCallback(s=>{var l;s&&((l=e.onMount)==null||l.call(e,s)),t&&(s?t.mount(s):t.unmount());const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s)},[t])}const U4=D.createContext({});function lf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function PV(e,t,n,r,o,s){var x,v;const{visualElement:i}=D.useContext(tg),l=D.useContext(L4),c=D.useContext(sd),f=D.useContext(P2).reducedMotion,d=D.useRef(null),h=D.useRef(!1);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f,isSVG:s}),h.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const p=d.current,g=D.useContext(U4);p&&!p.projection&&o&&(p.type==="html"||p.type==="svg")&&MV(d.current,n,o,g);const y=D.useRef(!1);D.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const b=n[K6],E=D.useRef(!!b&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,b))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,b)));return r2(()=>{h.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),E.current&&p.animationState&&p.animationState.animateChanges())}),D.useEffect(()=>{p&&(!E.current&&p.animationState&&p.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,b)}),E.current=!1),p.enteringChildren=void 0)}),p}function MV(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:l,layoutScroll:c,layoutRoot:f,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:z4(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||l&&lf(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:f})}function z4(e){if(e)return e.options.allowProjection!==!1?e.projection:z4(e.parent)}function b0(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&pV(r);const s=n?n==="svg":R2(e),i=s?TV:DV;function l(f,d){let h;const p={...D.useContext(P2),...f,layoutId:RV(f)},{isStatic:g}=p,y=vV(f),b=i(f,g);if(!g&&d6){LV();const E=IV(p);h=E.MeasureLayout,y.visualElement=PV(e,b,p,o,E.ProjectionNode,s)}return P.jsxs(tg.Provider,{value:y,children:[h&&y.visualElement?P.jsx(h,{visualElement:y.visualElement,...p}):null,AV(e,f,BV(b,y.visualElement,d),b,g,t,s)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=D.forwardRef(l);return c[FV]=e,c}function RV({layoutId:e}){const t=D.useContext($f).id;return t&&e!==void 0?t+"-"+e:e}function LV(e,t){D.useContext(L4).strict}function IV(e){const t=I4(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function NV(e,t){if(typeof Proxy>"u")return b0;const n=new Map,r=(s,i)=>b0(s,i,e,t),o=(s,i)=>r(s,i);return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,b0(i,void 0,e,t)),n.get(i))})}const jV=(e,t)=>t.isSVG??R2(e)?new cz(t):new rz(t,{allowProjection:e!==D.Fragment});class OV extends Ta{constructor(t){super(t),t.animationState||(t.animationState=pz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Zm(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let $V=0;class UV extends Ta{constructor(){super(...arguments),this.id=$V++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const zV={animation:{Feature:OV},exit:{Feature:UV}};function cd(e){return{point:{x:e.pageX,y:e.pageY}}}const VV=e=>t=>_2(t)&&e(t,cd(t));function Tf(e,t,n,r){return qf(e,t,VV(n),r)}const V4=({current:e})=>e?e.ownerDocument.defaultView:null,QA=(e,t)=>Math.abs(e-t);function WV(e,t){const n=QA(e.x,t.x),r=QA(e.y,t.y);return Math.sqrt(n**2+r**2)}const XA=new Set(["auto","scroll"]);class W4{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=g=>{this.handleScroll(g.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=w0(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=WV(g.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!b)return;const{point:E}=g,{timestamp:x}=kr;this.history.push({...E,timestamp:x});const{onStart:v,onMove:C}=this.handlers;y||(v&&v(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,g)},this.handlePointerMove=(g,y)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=v0(y,this.transformPagePoint),wn.update(this.updatePoint,!0)},this.handlePointerUp=(g,y)=>{this.end();const{onEnd:b,onSessionEnd:E,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=w0(g.type==="pointercancel"?this.lastMoveEventInfo:v0(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(g,v),E&&E(g,v)},!_2(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=cd(t),f=v0(c,this.transformPagePoint),{point:d}=f,{timestamp:h}=kr;this.history=[{...d,timestamp:h}];const{onSessionStart:p}=n;p&&p(t,w0(f,this.history)),this.removeListeners=id(Tf(this.contextWindow,"pointermove",this.handlePointerMove),Tf(this.contextWindow,"pointerup",this.handlePointerUp),Tf(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(XA.has(r.overflowX)||XA.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),wn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ka(this.updatePoint)}}function v0(e,t){return t?{point:t(e.point)}:e}function JA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function w0({point:e},t){return{point:e,delta:JA(e,H4(t)),offset:JA(e,HV(t)),velocity:qV(t,.1)}}function HV(e){return e[0]}function H4(e){return e[e.length-1]}function qV(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=H4(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ei(t)));)n--;if(!r)return{x:0,y:0};const s=es(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function GV(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?jn(n,e,r.max):Math.min(e,n)),e}function ZA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function KV(e,{top:t,left:n,bottom:r,right:o}){return{x:ZA(e.x,n,o),y:ZA(e.y,t,r)}}function eS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Uf(t.min,t.max-r,e.min):r>o&&(n=Uf(e.min,e.max-o,t.min)),Ws(0,1,n)}function XV(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yb=.35;function JV(e=Yb){return e===!1?e=0:e===!0&&(e=Yb),{x:tS(e,"left","right"),y:tS(e,"top","bottom")}}function tS(e,t,n){return{min:nS(e,t),max:nS(e,n)}}function nS(e,t){return typeof e=="number"?e:e[t]||0}const ZV=new WeakMap;class eW{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=cr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=h=>{n?(this.stopAnimation(),this.snapToCursor(cd(h).point)):this.pauseAnimation()},i=(h,p)=>{this.stopAnimation();const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=RU(g),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Jo(x=>{let v=this.getAxisMotionValue(x).get()||0;if(zs.test(v)){const{projection:C}=this.visualElement;if(C&&C.layout){const A=C.layout.layoutBox[x];A&&(v=eo(A)*(parseFloat(v)/100))}}this.originPoint[x]=v}),b&&wn.postRender(()=>b(h,p)),zb(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},l=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:b,onDrag:E}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:x}=p;if(y&&this.currentDirection===null){this.currentDirection=tW(x),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),E&&E(h,p)},c=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>Jo(h=>{var p;return this.getAnimationState(h)==="paused"&&((p=this.getAxisMotionValue(h).animation)==null?void 0:p.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new W4(t,{onSessionStart:s,onStart:i,onMove:l,onSessionEnd:c,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:V4(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:l}=this.getProps();l&&wn.postRender(()=>l(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Oh(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=GV(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&lf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=KV(r.layoutBox,t):this.constraints=!1,this.elastic=JV(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Jo(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=XV(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!lf(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=XU(r,o.root,this.visualElement.getTransformPagePoint());let i=YV(o.layout.layoutBox,s);if(n){const l=n(KU(i));this.hasMutatedConstraints=!!l,l&&(i=f4(l))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},f=Jo(d=>{if(!Oh(d,n,this.currentDirection))return;let h=c&&c[d]||{};i&&(h={min:0,max:0});const p=o?200:1e6,g=o?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(d,y)});return Promise.all(f).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return zb(this.visualElement,t),r.start(C2(t,r,0,n,this.visualElement,!1))}stopAnimation(){Jo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Jo(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Jo(n=>{const{drag:r}=this.getProps();if(!Oh(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:l}=o.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-jn(i,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!lf(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Jo(i=>{const l=this.getAxisMotionValue(i);if(l&&this.constraints!==!1){const c=l.get();o[i]=QV({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Jo(i=>{if(!Oh(i,t,null))return;const l=this.getAxisMotionValue(i),{min:c,max:f}=this.constraints[i];l.set(jn(c,f,o[i]))})}addListeners(){if(!this.visualElement.current)return;ZV.set(this.visualElement,this);const t=this.visualElement.current,n=Tf(t,"pointerdown",c=>{const{drag:f,dragListener:d=!0}=this.getProps(),h=c.target,p=h!==t&&s4(h);f&&d&&!p&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();lf(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),wn.read(r);const i=qf(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:f})=>{this.isDragging&&f&&(Jo(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())}));return()=>{i(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Yb,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:l}}}function Oh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function tW(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class nW extends Ta{constructor(t){super(t),this.removeGroupControls=ts,this.removeListeners=ts,this.controls=new eW(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ts}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const rS=e=>(t,n)=>{e&&wn.postRender(()=>e(t,n))};class rW extends Ta{constructor(){super(...arguments),this.removePointerDownListener=ts}onPointerDown(t){this.session=new W4(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V4(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:rS(t),onStart:rS(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&wn.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Tf(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let E0=!1;class oW extends D.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),E0&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),bp.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),E0=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||wn.postRender(()=>{const l=i.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),S2.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;E0=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function q4(e){const[t,n]=M4(),r=D.useContext($f);return P.jsx(oW,{...e,layoutGroup:r,switchLayoutGroup:D.useContext(U4),isPresent:t,safeToRemove:n})}const sW={pan:{Feature:rW},drag:{Feature:nW,ProjectionNode:P4,MeasureLayout:q4}};function oS(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&wn.postRender(()=>s(t,cd(t)))}class iW extends Ta{mount(){const{current:t}=this.node;t&&(this.unmount=LU(t,(n,r)=>(oS(this.node,r,"Start"),o=>oS(this.node,o,"End"))))}unmount(){}}class aW extends Ta{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=id(qf(this.node.current,"focus",()=>this.onFocus()),qf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sS(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&wn.postRender(()=>s(t,cd(t)))}class lW extends Ta{mount(){const{current:t}=this.node;t&&(this.unmount=jU(t,(n,r)=>(sS(this.node,r,"Start"),(o,{success:s})=>sS(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Qb=new WeakMap,C0=new WeakMap,cW=e=>{const t=Qb.get(e.target);t&&t(e)},uW=e=>{e.forEach(cW)};function fW({root:e,...t}){const n=e||document;C0.has(n)||C0.set(n,{});const r=C0.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(uW,{root:e,...t})),r[o]}function dW(e,t,n){const r=fW(t);return Qb.set(e,n),r.observe(e),()=>{Qb.delete(e),r.unobserve(e)}}const hW={some:0,all:1};class pW extends Ta{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:hW[o]},l=c=>{const{isIntersecting:f}=c;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=f?d:h;p&&p(c)};return dW(this.node.current,i,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(mW(t,n))&&this.startObserver()}unmount(){}}function mW({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const gW={inView:{Feature:pW},tap:{Feature:lW},focus:{Feature:aW},hover:{Feature:iW}},yW={layout:{ProjectionNode:P4,MeasureLayout:q4}},bW={...zV,...gW,...sW,...yW},to=NV(bW,jV),vW=350,wW={duration:.15,ease:[.4,0,.2,1]},EW={type:"tween",duration:.25,ease:[.4,0,.2,1]},CW={type:"tween",duration:.3,ease:[.4,0,.2,1]},G4=D.createContext(!1);function Lte(){return D.useContext(G4)}const K4=D.createContext(void 0);function Y4(){return D.useContext(K4)}const di={bg:"#F8F8F8",border:"rgba(0, 0, 0, 0.12)",text:"#1A1A1A",textSecondary:"#4A4A4A",textMuted:"#737373",hoverBg:"rgba(0, 0, 0, 0.06)",ring:"rgba(0, 0, 0, 0.08)"},xW={xs:"sm:max-w-xs",sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl","3xl":"sm:max-w-3xl","4xl":"sm:max-w-4xl","5xl":"sm:max-w-5xl",full:"sm:max-w-[calc(100vw-2rem)]"};function Ite({open:e,onClose:t,size:n="md",className:r,children:o,bottomSheet:s=!0,motionPlus:i=!1,basemapMode:l,solid:c=!1}){const f=l==="light",[d,h]=D.useState(!1),p=D.useRef(null);D.useEffect(()=>(p.current&&(clearTimeout(p.current),p.current=null),e?p.current=setTimeout(()=>{h(!0)},vW):queueMicrotask(()=>h(!1)),()=>{p.current&&(clearTimeout(p.current),p.current=null)}),[e]);const g=D.useCallback((x,v)=>{(v.offset.y>100||v.velocity.y>500)&&t()},[t]),y=i?CW:EW,b=i?.98:.99,E=s?8:4;return P.jsx(au,{mode:"wait",children:e&&P.jsxs(QD,{static:!0,open:e,onClose:t,className:"relative z-[10010]",children:[P.jsx(to.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:wW,className:"fixed inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":"true"}),P.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:P.jsx("div",{className:He("flex min-h-full justify-center",s?"items-end sm:items-center sm:p-4":"items-center p-4"),children:P.jsx(to.div,{drag:s?"y":!1,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.4},onDragEnd:g,initial:{opacity:0,scale:b,y:E},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.99,y:s?40:4},transition:y,style:{willChange:"transform, opacity"},className:He(s&&"w-full sm:w-auto"),children:P.jsx(Kw,{className:He("relative w-full shadow-2xl flex flex-col",!l&&!c&&"bg-surface/80 backdrop-blur-xl",!l&&c&&"bg-surface",!l&&"ring-1 ring-inset ring-edge-subtle",xW[n],s?"radius-card overflow-hidden pb-safe":"radius-card overflow-hidden",r),style:l?{backgroundColor:f?di.bg:"var(--surface)",boxShadow:`inset 0 0 0 1px ${f?di.ring:"rgba(255, 255, 255, 0.1)"}`}:void 0,children:P.jsx(K4.Provider,{value:l,children:P.jsx(G4.Provider,{value:d,children:o})})})})})})]})})}function kW({className:e,...t}){const n=Y4(),r=n==="light";return P.jsx(YD,{...t,className:He("text-base font-semibold sm:text-lg",!n&&"text-fg-primary",e),style:n?{color:r?di.text:"var(--fg-primary)"}:void 0})}function Nte({icon:e,title:t,onClose:n,className:r}){const o=Y4(),s=o==="light";return P.jsxs("div",{className:He("flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b",!o&&"border-edge-subtle",r),style:o?{borderColor:s?di.border:"var(--edge-subtle)"}:void 0,children:[P.jsxs("div",{className:"flex items-center gap-3",children:[e&&P.jsx("div",{className:He(!o&&"text-icon-card-title"),style:o?{color:s?di.textSecondary:"var(--icon-card-title)"}:void 0,children:e}),P.jsx(kW,{children:t})]}),n&&P.jsxs(P.Fragment,{children:[P.jsx("button",{onClick:n,className:"sm:hidden min-h-[44px] min-w-[44px] px-3 flex items-center justify-center text-[15px] font-medium text-sys-blue active:text-sys-blue/70 transition-base radius-inner active:bg-subtle-fill",children:"Done"}),P.jsx("button",{onClick:n,className:He("hidden sm:flex items-center justify-center p-2 radius-inner transition-colors",!o&&"text-fg-muted hover:text-fg-primary hover:bg-subtle"),style:o?{color:s?di.textMuted:"var(--fg-muted)"}:void 0,onMouseEnter:i=>{o&&(i.currentTarget.style.color=s?di.text:"var(--fg-primary)",i.currentTarget.style.backgroundColor=s?di.hoverBg:"var(--subtle)")},onMouseLeave:i=>{o&&(i.currentTarget.style.color=s?di.textMuted:"var(--fg-muted)",i.currentTarget.style.backgroundColor="transparent")},"aria-label":"Close",children:P.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:P.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})}function jte({className:e,...t}){return P.jsx("div",{...t,className:He("px-6 py-5",e)})}function Ote({className:e,...t}){return P.jsx("div",{...t,className:He("flex flex-col-reverse gap-3 px-6 pb-6 pt-0","sm:flex-row sm:justify-end","*:w-full sm:*:w-auto",e)})}const x0={snappy:{type:"spring",stiffness:500,damping:30},smooth:{type:"spring",stiffness:300,damping:30},gentle:{type:"spring",stiffness:200,damping:25}},AW={fast:.15,normal:.2,medium:.3},SW={easeOut:[0,0,.2,1],easeIn:[.4,0,1,1]},$te={dropdown:{type:"spring",stiffness:500,damping:30},fade:{duration:AW.fast,ease:SW.easeOut},numberTicker:{type:"spring",visualDuration:.4,bounce:.15,opacity:{duration:.15,ease:"linear"}},numberReveal:{type:"spring",visualDuration:.6,bounce:.25,opacity:{duration:.2,ease:"linear"}}},Ute={normal:.05};function _W({className:e,...t}){return P.jsx("nav",{...t,className:He(e,"flex h-full min-h-0 flex-col")})}function DW({className:e,...t}){return P.jsx("div",{...t,className:He(e,"flex flex-col border-b border-edge-subtle p-4","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function TW({className:e,...t}){return P.jsx("div",{...t,className:He(e,"flex flex-1 flex-col p-3","overflow-y-auto sidebar-scroll","[&>[data-slot=section]+[data-slot=section]]:mt-6")})}function FW({className:e,...t}){return P.jsx("div",{...t,className:He(e,"mt-auto flex flex-col","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function BW({className:e,...t}){const n=D.useId();return P.jsx(dV,{id:n,children:P.jsx("div",{...t,"data-slot":"section",className:He(e,"flex flex-col gap-0.5")})})}const PW=D.forwardRef(function(t,n){const{current:r,className:o,children:s,accentColor:i,...l}=t,c=!!i,f=He("relative isolate flex w-full items-center gap-3 radius-inner px-3 py-1.5 text-left","min-h-[34px]","text-sm font-medium","[&>svg]:w-4 [&>svg]:h-4 [&>svg]:flex-shrink-0",r?c?"text-white":"text-white [&_svg]:text-sys-blue":"text-fg-muted hover:text-fg-primary hover:bg-elevated [&_svg]:text-fg-muted hover:[&_svg]:text-fg-primary","transition-all duration-150"),d=c?{willChange:"transform",backgroundColor:i,boxShadow:[`0 0 10px 2px color-mix(in oklch, ${i} 50%, transparent)`,`0 0 4px 0 color-mix(in oklch, ${i} 70%, transparent)`].join(", ")}:{willChange:"transform"},h=c?{willChange:"transform",background:"transparent",boxShadow:[`inset 0 0 0 1.5px ${i}`,`inset 0 0 3px 0.5px color-mix(in oklch, ${i} 30%, transparent)`,`inset 0 0 6px 1px color-mix(in oklch, ${i} 14%, transparent)`,`inset 0 0 10px 2px color-mix(in oklch, ${i} 5%, transparent)`,`0 0 20px -4px color-mix(in oklch, ${i} 22%, transparent)`,`0 0 8px -2px color-mix(in oklch, ${i} 14%, transparent)`].join(", ")}:{willChange:"transform"};return P.jsxs("span",{className:He(o,"relative"),children:[r&&P.jsx(to.span,{layout:"position",layoutId:"sidebar-current-indicator",className:He("absolute inset-y-1.5 -left-3 w-0.5 rounded-full",!c&&"bg-sys-blue sidebar-neo-indicator"),style:d,transition:x0.snappy}),typeof l.href=="string"?P.jsxs(Bm,{to:l.href,onClick:l.onClick,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,className:f,"data-current":r?"true":void 0,ref:n,children:[r&&P.jsx(to.span,{layout:"position",layoutId:"sidebar-current-highlight",className:He("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:x0.snappy}),s]}):P.jsxs(Vm,{...l,className:He("cursor-default",f),"data-current":r?"true":void 0,ref:n,children:[r&&P.jsx(to.span,{layout:"position",layoutId:"sidebar-current-highlight",className:He("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:x0.snappy}),s]})]})});function MW({className:e,...t}){return P.jsx("span",{...t,className:He(e,"truncate")})}function vp({className:e,variant:t="default",...n}){const r={default:"bg-subtle text-fg-muted",accent:"bg-sys-blue/20 text-sys-blue",success:"bg-sys-green/20 text-sys-green",warning:"bg-sys-indigo/20 text-sys-indigo",danger:"bg-sys-red/20 text-sys-red"};return P.jsx("span",{...n,className:He("ml-auto flex items-center gap-1 px-1.5 py-0.5 rounded-full","text-xs font-medium",r[t],e)})}const Q4=D.createContext(null);function RW(){const e=D.useContext(Q4);if(!e)throw new Error("useSidebar must be used within a SidebarLayout");return e}const X4={type:"spring",visualDuration:.35,bounce:.15},LW=X4.visualDuration*1e3;function IW({open:e,onClose:t,children:n}){return P.jsx(au,{children:e&&P.jsxs(QD,{static:!0,open:e,onClose:t,className:"lg:hidden relative z-[10002]",children:[P.jsx(to.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25,ease:"easeOut"},className:"fixed inset-0 bg-black/60 backdrop-blur-sm","aria-hidden":"true"}),P.jsx(to.div,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:X4,className:"fixed inset-y-0 left-0 w-72 max-w-[85vw] z-[10003]",children:P.jsx(Kw,{className:"h-full",children:P.jsxs("div",{className:"flex h-full flex-col sidebar-panel",children:[P.jsx("div",{className:"absolute top-4 right-4 z-10",children:P.jsx(ZL,{className:"p-2 rounded-lg text-fg-muted hover:text-fg-primary hover:bg-subtle-fill transition-colors","aria-label":"Close navigation",children:P.jsx(f6,{className:"w-5 h-5"})})}),n]})})})]})})}function NW({sidebar:e,navbar:t,children:n,className:r}){const[o,s]=D.useState(!1),i=()=>s(!0),l=()=>s(!1),c={isOpen:o,open:i,close:l,toggle:()=>s(f=>!f)};return P.jsx(Q4.Provider,{value:c,children:P.jsxs("div",{className:"flex h-screen overflow-hidden bg-body",children:[P.jsx("aside",{className:"hidden lg:flex flex-col w-64 flex-shrink-0 h-full relative sidebar-panel",children:e}),P.jsx(IW,{open:o,onClose:l,children:e}),P.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[P.jsx("header",{className:"lg:hidden sticky top-0 z-[10001] h-14 mobile-header",children:P.jsxs("div",{className:"flex items-center h-full px-4",children:[P.jsx("button",{onClick:i,className:"w-10 h-10 flex items-center justify-center rounded-lg hover:bg-subtle-fill active:bg-subtle-fill transition-colors mr-2","aria-label":"Open navigation",children:P.jsx(Hj,{className:"w-5 h-5 text-fg-primary"})}),P.jsx("div",{className:"flex-1 min-w-0",children:t})]})}),P.jsx("main",{className:He("flex-1 overflow-y-auto main-content",r),children:n})]})]})})}function jW({className:e,...t}){return P.jsx("nav",{...t,className:He(e,"flex flex-1 items-center gap-3")})}function iS({className:e,...t}){return P.jsx("div",{...t,className:He(e,"flex items-center gap-3")})}function OW({className:e,...t}){return P.jsx("div",{"aria-hidden":"true",...t,className:He(e,"flex-1")})}const $W=[45,72,33,58,80,42,65,28,55,75,38,62];function Bt({className:e,style:t}){return P.jsx("div",{className:He("animate-pulse bg-subtle-fill radius-badge",e),style:t})}function UW(){return P.jsx("div",{className:"p-3 radius-inner border-card bg-subtle",children:P.jsxs("div",{className:"flex items-start gap-3",children:[P.jsx(Bt,{className:"w-14 h-6 rounded shrink-0"}),P.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[P.jsx(Bt,{className:"h-4 w-full"}),P.jsx(Bt,{className:"h-4 w-3/4"}),P.jsx(Bt,{className:"h-3 w-32 mt-1"})]})]})})}function zte({count:e=8}){return P.jsx("div",{className:"space-y-2",children:Array.from({length:e}).map((t,n)=>P.jsx(UW,{},n))})}function zW(){return P.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-24"})]}),P.jsx(Bt,{className:"h-8 w-20"}),P.jsxs("div",{className:"flex-1 flex flex-col justify-end gap-2",children:[P.jsx(Bt,{className:"h-3 w-full"}),P.jsx(Bt,{className:"h-3 w-3/4"})]})]})}function VW(){return P.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-24"})]}),P.jsx("div",{className:"flex-1 flex items-end gap-1",children:$W.slice(0,8).map((e,t)=>P.jsx(Bt,{className:"flex-1",style:{height:`${e}%`}},t))})]})}function WW({rows:e=5}){return P.jsxs("div",{className:"flex flex-col h-full","aria-hidden":"true",children:[P.jsx("div",{className:"pb-3 border-b border-edge-subtle",children:P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-24"})]})}),P.jsx("div",{className:"flex-1 pt-3 flex flex-col gap-3",children:Array.from({length:e}).map((t,n)=>P.jsx(Bt,{className:"h-6 w-full"},n))})]})}const J4=D.createContext(void 0);function Vte(){return D.useContext(J4)}const HW={sm:"radius-inner",md:"radius-inset",lg:"radius-card",xl:"radius-hero",full:"radius-pill",none:"radius-none"},Wte=D.forwardRef(function({children:t,elevated:n,compact:r,noPadding:o,radius:s="lg",glass:i=!0,stroke:l=!0,shadow:c,reflex:f=!1,glow:d=!1,neomorphic:h=!0,onClick:p,className:g,style:y,isLoaded:b,skeletonType:E="card",...x},v){const C=D.useContext(J4),[A,k]=D.useState(!1);D.useEffect(()=>{let j=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{j||k(!0)})}),()=>{j=!0}},[]);const F=b??C??A,L=c??n??!1,B=l,M={...y,...f?{"--surface-reflex":"1"}:{}},I=()=>{switch(E){case"chart":return P.jsx(VW,{});case"list":return P.jsx(WW,{});default:return P.jsx(zW,{})}},O=He(HW[s],i&&(n?"bg-surface/85 backdrop-blur-xl":"bg-surface/80 backdrop-blur-lg"),!i&&"bg-surface",h&&"depth-raised",B&&!h&&!d&&"ring-1 ring-inset ring-edge-subtle",d&&"ring-1 ring-inset ring-sys-blue/40",L&&(n?"shadow-xl":"shadow-lg"),f&&"surface-reflex","h-full flex flex-col relative",!o&&(r?"p-3 sm:p-4":"p-4 sm:p-5"),p&&"cursor-pointer",g);return F?P.jsx("div",{ref:v,"data-card-surface":!0,className:O,style:M,onClick:p,...x,children:t}):P.jsx("div",{ref:v,"data-card-surface":!0,className:O,style:M,...x,children:I()})});function Hte({title:e,icon:t,badge:n,badgeColor:r="teal",subtitle:o,actions:s,iconColor:i="text-icon-card-title",listHeader:l=!1,stackActionsOnMobile:c=!1,stackBreakpoint:f="sm",titleExtra:d,onClick:h,className:p}){const g="px-5 py-4 border-b border-edge-subtle",y={sm:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 min-h-[32px]",md:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 min-h-[32px]",lg:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-2 min-h-[32px]"},b=P.jsxs(P.Fragment,{children:[t&&P.jsx("span",{className:He("icon-md flex items-center justify-center",i),children:t}),P.jsx("span",{className:"type-micro",children:e}),n&&P.jsx(hj,{color:r,children:n}),d]}),E=h?"button":"div",x=h?{onClick:h,type:"button"}:{};return c&&s?P.jsxs(E,{...x,className:He("flex flex-col gap-1 flex-shrink-0",l?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[P.jsxs("div",{className:y[f],children:[P.jsx("div",{className:"flex items-center gap-3",children:b}),P.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:s})]}),o&&P.jsx("p",{className:"type-label text-fg-muted ml-8",children:o})]}):P.jsxs(E,{...x,className:He("flex flex-col gap-1 flex-shrink-0",l?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[P.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-[32px]",children:[P.jsx("div",{className:"flex items-center gap-3",children:b}),s&&P.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:s})]}),o&&P.jsx("p",{className:"type-label text-fg-muted ml-8",children:o})]})}D.forwardRef(function({children:t,icon:n,className:r,...o},s){return P.jsxs("h3",{ref:s,className:He("flex items-center gap-2","text-base font-semibold text-fg-primary",r),...o,children:[n&&P.jsx("span",{className:"text-icon-card-title w-5 h-5 flex-shrink-0",children:n}),t]})});D.forwardRef(function({children:t,className:n,...r},o){return P.jsx("p",{ref:o,className:He("text-sm text-fg-muted",n),...r,children:t})});const qte=D.forwardRef(function({children:t,centered:n,className:r,...o},s){return P.jsx("div",{ref:s,className:He("flex-1 min-h-0",n&&"flex items-center justify-center",r),...o,children:t})});D.forwardRef(function({children:t,className:n,...r},o){return P.jsx("div",{ref:o,className:He("flex items-center justify-end gap-3","pt-4 mt-4","border-t border-edge-subtle",n),...r,children:t})});D.forwardRef(function({children:t,border:n,className:r,...o},s){return P.jsx("div",{ref:s,className:He(n&&"pt-4 mt-4 border-t border-edge-subtle",r),...o,children:t})});function qW({defaultOpen:e=!1,className:t,children:n}){return P.jsx(JD,{defaultOpen:e,children:P.jsx("div",{className:He("flex flex-col",t),children:n})})}const GW=D.forwardRef(function({className:t,icon:n,children:r,...o},s){return P.jsx(am,{ref:s,className:He("flex w-full items-center justify-between gap-3","px-3 py-2 radius-inner","text-sm font-medium text-fg-muted","row-hover hover:text-fg-primary","ring-focus",t),...o,children:({open:i})=>P.jsxs(P.Fragment,{children:[r,P.jsx("span",{className:He("transition-transform duration-200",i?"rotate-180":"rotate-0"),children:n||P.jsx(Db,{className:"w-4 h-4"})})]})})});function KW({direction:e="down",className:t,children:n}){const r={hidden:{height:0,opacity:0,y:e==="up"?8:-8},visible:{height:"auto",opacity:1,y:0}};return P.jsx(Zw,{static:!0,children:({open:o})=>P.jsx(au,{initial:!1,children:o&&P.jsx(to.div,{initial:"hidden",animate:"visible",exit:"hidden",variants:r,transition:{height:{duration:.2,ease:[.4,0,.2,1]},opacity:{duration:.15},y:{duration:.15}},className:He("overflow-hidden",t),children:P.jsx("div",{className:He(e==="up"?"pb-2":"pt-2"),children:n})})})})}function YW({label:e,icon:t,defaultOpen:n=!0,direction:r="down",className:o,dataId:s,children:i}){const l=s?{[`data-${s}-disclosure`]:!0}:{},c=P.jsxs("span",{className:"flex items-center gap-3",children:[t&&P.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),P.jsx("span",{className:"type-micro",children:e})]});return r==="up"?P.jsx(JD,{defaultOpen:n,children:({open:f})=>P.jsxs("div",{className:He("relative",o),children:[P.jsx(Zw,{static:!0,className:"relative z-50",children:P.jsx(au,{initial:!1,mode:"wait",children:f&&P.jsxs(to.div,{initial:{y:12,scale:.97,opacity:0},animate:{y:0,scale:1,opacity:1},exit:{y:6,scale:.98,opacity:0},transition:{type:"spring",stiffness:400,damping:32,mass:.8,opacity:{duration:.15,ease:[.4,0,.2,1]}},className:"absolute bottom-full left-0 right-0 z-50 mb-1 origin-bottom radius-inset shadow-lg border-card bg-surface/75 backdrop-blur-sm",children:[P.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[P.jsxs("span",{className:"flex items-center gap-3",children:[t&&P.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),P.jsx("span",{className:"type-micro",children:e})]}),P.jsx(am,{className:"p-1 rounded hover:bg-subtle-fill-strong transition-colors",children:P.jsx(to.span,{initial:{rotate:0},animate:{rotate:180},exit:{rotate:0},transition:{type:"spring",stiffness:400,damping:25},children:P.jsx(Db,{className:"w-4 h-4"})})})]}),P.jsx("div",{className:"px-3 pb-3",children:i})]})})}),P.jsx(to.div,{animate:{opacity:f?.4:1,scale:f?.98:1},transition:{type:"spring",stiffness:500,damping:35},children:P.jsxs(am,{...l,className:He("flex w-full items-center justify-between gap-3","px-3 py-3.5 rounded-none rounded-t-lg","bg-surface depth-stroke-raised","text-sm font-medium text-fg-muted","hover:bg-elevated hover:text-fg-primary transition-colors","ring-focus"),children:[c,P.jsx(to.span,{animate:{rotate:f?180:0},transition:{type:"spring",stiffness:400,damping:25},children:P.jsx(Db,{className:"w-4 h-4"})})]})})]})}):P.jsxs(qW,{defaultOpen:n,className:o,children:[P.jsx(GW,{...l,children:c}),P.jsx(KW,{direction:"down",children:P.jsx("div",{className:"bg-subtle-fill radius-inset mx-1 mt-1",children:i})})]})}const $h=8;function QW(e,t,n){const r=window.scrollY,o=window.scrollX;switch(n){case"top":return{top:e.top+r-t.height-$h,left:e.left+o+(e.width-t.width)/2};case"bottom":return{top:e.bottom+r+$h,left:e.left+o+(e.width-t.width)/2};case"left":return{top:e.top+r+(e.height-t.height)/2,left:e.left+o-t.width-$h};case"right":return{top:e.top+r+(e.height-t.height)/2,left:e.right+o+$h}}}const XW=e=>({hidden:{opacity:0,scale:.96,...{top:{y:4},bottom:{y:-4},left:{x:4},right:{x:-4}}[e]},visible:{opacity:1,scale:1,x:0,y:0}});function JW({placement:e}){const t=He("absolute w-2 h-2 rotate-45",e==="top"&&"bottom-[-4px] left-1/2 -translate-x-1/2",e==="bottom"&&"top-[-4px] left-1/2 -translate-x-1/2",e==="left"&&"right-[-4px] top-1/2 -translate-y-1/2",e==="right"&&"left-[-4px] top-1/2 -translate-y-1/2");return P.jsx("span",{className:t,style:{backgroundColor:"var(--tooltip-bg)"}})}function ZW({content:e,children:t,placement:n="top",delay:r=200,arrow:o=!0,disabled:s=!1,className:i}){const[l,c]=D.useState(!1),[f,d]=D.useState({top:0,left:0}),[h,p]=D.useState(!1),g=D.useRef(null),y=D.useRef(null),b=D.useRef();D.useEffect(()=>{p(!0)},[]),D.useEffect(()=>{if(!l||!g.current||!y.current)return;const k=g.current.getBoundingClientRect(),F=y.current.getBoundingClientRect(),L=QW(k,F,n),B=window.innerWidth-F.width-8,M=window.innerHeight+window.scrollY-F.height-8;d({top:Math.max(8,Math.min(L.top,M)),left:Math.max(8,Math.min(L.left,B))})},[l,n]);const E=D.useCallback(()=>{s||(b.current=setTimeout(()=>{c(!0)},r))},[r,s]),x=D.useCallback(()=>{b.current&&clearTimeout(b.current),c(!1)},[]);if(D.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),!D.isValidElement(t))return t;const v=D.cloneElement(t,{ref:g,onMouseEnter:k=>{var F,L;E(),(L=(F=t.props).onMouseEnter)==null||L.call(F,k)},onMouseLeave:k=>{var F,L;x(),(L=(F=t.props).onMouseLeave)==null||L.call(F,k)},onFocus:k=>{var F,L;E(),(L=(F=t.props).onFocus)==null||L.call(F,k)},onBlur:k=>{var F,L;x(),(L=(F=t.props).onBlur)==null||L.call(F,k)}}),C=XW(n),A=P.jsx(au,{children:l&&P.jsxs(to.div,{ref:y,initial:"hidden",animate:"visible",exit:"hidden",variants:C,transition:{duration:.15,ease:"easeOut"},className:He("fixed z-[10020] px-2.5 py-1.5 text-xs font-medium","rounded-lg","pointer-events-none",i),style:{top:f.top,left:f.left,backgroundColor:"var(--tooltip-bg)",color:"var(--tooltip-fg)",border:"1px solid var(--tooltip-border)",boxShadow:"var(--tooltip-shadow)"},role:"tooltip",children:[e,o&&P.jsx(JW,{placement:n})]})});return P.jsxs(P.Fragment,{children:[v,h&&Xc.createPortal(A,document.body)]})}const Z4={sm:{track:"h-5 w-9",thumb:"h-3.5 w-3.5",translate:"translate-x-[18px]",icon:"w-3 h-3",dot:"w-2 h-2"},md:{track:"h-6 w-11",thumb:"h-4 w-4",translate:"translate-x-[22px]",icon:"w-4 h-4",dot:"w-2.5 h-2.5"},lg:{track:"h-7 w-14",thumb:"h-5 w-5",translate:"translate-x-[30px]",icon:"w-4 h-4",dot:"w-3 h-3"}},Gte=D.forwardRef(function({enabled:t,onChange:n,label:r,description:o,tooltip:s,size:i="md",color:l="muted",dangerOff:c=!1,disabled:f=!1,status:d="idle",name:h,className:p},g){const y=Z4[i],b=d==="loading",E=l==="muted";return P.jsxs(Jm,{disabled:f||b,className:He("flex items-center gap-3",p),children:[P.jsx(ZD,{ref:g,checked:t,onChange:n,name:h,className:He(E?"toggle-switch-track":"group relative inline-flex shrink-0 items-center rounded-full border-2",y.track,!E&&(t?"bg-toggle-on border-toggle-on":"bg-toggle-off border-edge-subtle"),"disabled:opacity-50 disabled:cursor-not-allowed","ring-focus","transition-all duration-200"),"data-size":i,children:P.jsx("span",{className:He(E?"toggle-switch-thumb":"relative inline-flex items-center justify-center bg-white shadow-lg","transform rounded-full transition-transform duration-200",y.thumb,t?y.translate:"translate-x-[4px]"),children:E&&P.jsx("span",{className:He("toggle-switch-dot",y.dot,c?He("opacity-100",!t&&"toggle-switch-dot-danger"):t?"opacity-100":"opacity-0")})})}),(r||o||s)&&P.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r&&P.jsx(nd,{className:He("text-sm font-medium cursor-pointer select-none",f?"text-fg-muted":"text-fg-primary"),children:r}),s&&P.jsx(ZW,{content:s,placement:"top",children:P.jsx("span",{className:"text-fg-muted hover:text-fg-secondary cursor-help transition-colors",children:P.jsx(Mj,{className:"w-3.5 h-3.5"})})}),o&&!s&&P.jsx(ru,{className:"text-xs text-fg-muted",children:o})]}),d!=="idle"&&P.jsxs("div",{className:"flex items-center shrink-0",children:[d==="loading"&&P.jsx(Nj,{className:He(y.icon,"text-fg-muted animate-spin")}),d==="success"&&P.jsx(t2,{className:He(y.icon,"text-sys-green")}),d==="error"&&P.jsx(f6,{className:He(y.icon,"text-sys-red")})]})]})}),Kte=D.forwardRef(function({enabled:t,onChange:n,size:r="md",disabled:o=!1,"aria-label":s,className:i},l){const c=Z4[r];return P.jsx(ZD,{ref:l,checked:t,onChange:n,disabled:o,"aria-label":s,className:He("toggle-switch-track",c.track,"disabled:opacity-50 disabled:cursor-not-allowed","ring-focus","transition-all duration-200",i),"data-size":r,children:P.jsx("span",{className:He("toggle-switch-thumb","transform rounded-full transition-transform duration-200",c.thumb,t?c.translate:"translate-x-[4px]"),children:P.jsx("span",{className:He("toggle-switch-dot",c.dot,t?"opacity-100":"opacity-0")})})})}),eH={sm:{input:"h-8 text-sm px-3",icon:"w-4 h-4",iconPadding:"pl-8",trailingIconPadding:"pr-8"},md:{input:"h-[38px] text-sm px-4",icon:"w-4 h-4",iconPadding:"pl-10",trailingIconPadding:"pr-10"},lg:{input:"h-11 text-base px-4",icon:"w-5 h-5",iconPadding:"pl-11",trailingIconPadding:"pr-11"}},e8=D.forwardRef(function({type:t="text",size:n="md",invalid:r=!1,leadingIcon:o,trailingIcon:s,leadingAddon:i,trailingAddon:l,className:c,disabled:f,...d},h){const p=eH[n],g=o||i,y=s||l;return i||l?P.jsxs("div",{className:He("flex",c),children:[i&&P.jsx("span",{className:He("inline-flex items-center px-3 rounded-l-lg border border-r-0","bg-input-bg text-fg-muted text-sm",r?"border-sys-red":"border-input-border"),children:i}),P.jsx("input",{ref:h,type:t,disabled:f,className:He("flex-1 min-w-0 font-mono",p.input,"bg-input-bg",r?"border border-sys-red":"border border-input-border","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!f&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",i&&!l&&"rounded-r-lg",l&&!i&&"rounded-l-lg",!i&&!l&&"radius-inner"),...d}),l&&P.jsx("span",{className:He("inline-flex items-center px-3 rounded-r-lg border border-l-0","bg-input-bg text-fg-muted text-sm",r?"border-sys-red":"border-input-border"),children:l})]}):P.jsxs("div",{className:He("relative",c),children:[o&&P.jsx("div",{className:He("absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none","text-fg-muted"),children:P.jsx("span",{className:p.icon,children:o})}),P.jsx("input",{ref:h,type:t,disabled:f,className:He("w-full radius-inner font-mono",p.input,g&&p.iconPadding,y&&p.trailingIconPadding,"bg-input-bg",r?"border border-sys-red":"border border-input-border","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!f&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors"),...d}),s&&P.jsx("div",{className:He("absolute inset-y-0 right-0 flex items-center pr-3","text-fg-muted"),children:P.jsx("span",{className:p.icon,children:s})})]})}),Yte=D.forwardRef(function({label:t,description:n,errorMessage:r,required:o,invalid:s,className:i,...l},c){const f=s&&r;return P.jsxs(Jm,{className:He("flex flex-col gap-1.5",i),children:[t&&P.jsxs(nd,{className:"text-sm font-medium text-fg-primary",children:[t,o&&P.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!f&&P.jsx(ru,{className:"text-xs text-fg-muted -mt-0.5",children:n}),P.jsx(e8,{ref:c,invalid:s,...l}),f&&P.jsx("p",{className:"text-xs text-sys-red",children:r})]})});D.forwardRef(function({value:t,onChange:n,min:r,max:o,step:s=1,precision:i,...l},c){const f=h=>{const p=h.target.value;if(p===""||p==="-"){n(0);return}const g=parseFloat(p);if(!isNaN(g)){const y=r!==void 0&&o!==void 0?Math.min(Math.max(g,r),o):r!==void 0?Math.max(g,r):o!==void 0?Math.min(g,o):g;n(y)}},d=i!==void 0&&typeof t=="number"?t.toFixed(i):t;return P.jsx(e8,{ref:c,type:"number",value:d,onChange:f,min:r,max:o,step:s,...l})});const tH={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},nH=D.forwardRef(function({rows:t=3,resize:n="vertical",invalid:r=!1,disabled:o,className:s,...i},l){return P.jsx("textarea",{ref:l,rows:t,disabled:o,className:He("w-full radius-inner px-4 py-3 text-sm",tH[n],"bg-subtle",r?"border border-sys-red":"border-control","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!o&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",s),...i})});D.forwardRef(function({label:t,description:n,errorMessage:r,required:o,invalid:s,showCount:i,maxLength:l,value:c,className:f,...d},h){const p=s&&r,g=typeof c=="string"?c.length:0;return P.jsxs(Jm,{className:He("flex flex-col gap-1.5",f),children:[t&&P.jsxs(nd,{className:"text-sm font-medium text-fg-primary",children:[t,o&&P.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!p&&P.jsx(ru,{className:"text-xs text-fg-muted -mt-0.5",children:n}),P.jsx(nH,{ref:h,invalid:s,maxLength:l,value:c,...d}),P.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p?P.jsx("p",{className:"text-xs text-sys-red flex-1",children:r}):P.jsx("span",{}),i&&l&&P.jsxs("span",{className:He("text-xs",g>l?"text-sys-red":"text-fg-muted"),children:[g,"/",l]})]})]})});const rH={sm:{box:"h-4 w-4",icon:"h-3 w-3",radius:"rounded"},md:{box:"h-5 w-5",icon:"h-3.5 w-3.5",radius:"rounded-md"},lg:{box:"h-6 w-6",icon:"h-4 w-4",radius:"rounded-md"}},Qte=D.forwardRef(function({checked:t,onChange:n,indeterminate:r=!1,label:o,description:s,size:i="md",disabled:l=!1,name:c,value:f,className:d},h){const p=rH[i];return P.jsxs(Jm,{disabled:l,className:He("flex items-start gap-3",d),children:[P.jsxs(QL,{ref:h,checked:t,onChange:n,name:c,value:f,className:He("group relative flex shrink-0 items-center justify-center",p.box,p.radius,"border-2 transition-all duration-150",!t&&!r&&"border-edge-subtle bg-subtle",(t||r)&&"border-sys-blue bg-sys-blue",!t&&!r&&!l&&"hover:border-edge-strong","ring-focus","disabled:opacity-50 disabled:cursor-not-allowed"),children:[t&&!r&&P.jsx(t2,{className:He(p.icon,"text-white stroke-[3]")}),r&&P.jsx(Yj,{className:He(p.icon,"text-white stroke-[3]")})]}),(o||s)&&P.jsxs("div",{className:"flex-1 min-w-0 select-none",children:[o&&P.jsx(nd,{className:He("text-sm font-medium cursor-pointer",l?"text-fg-muted":"text-fg-primary"),children:o}),s&&P.jsx(ru,{className:"text-xs text-fg-muted mt-0.5",children:s})]})]})});D.createContext({variant:"default",divider:"subtle",grid:!0});const t8="0.9.303",aS="'JetBrains Mono', monospace";function oH({height:e=16,responsive:t=!1,className:n=""}){const r="var(--sys-blue)",o="var(--fg-primary)";if(t)return P.jsxs("svg",{className:n,viewBox:"0 0 145 24",preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"pyMC:Console",style:{display:"block",width:"80%",height:"auto"},children:[P.jsx("style",{children:` + `),()=>{k.contains(A)&&k.removeChild(A)}},[t]),P.jsx(rV,{isPresent:t,childRef:i,sizeRef:l,children:D.cloneElement(e,{ref:d})})}const sV=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:s,mode:i,anchorX:l,anchorY:c,root:f})=>{const d=n2(iV),h=D.useId();let p=!0,g=D.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:o,onExitComplete:y=>{d.set(y,!0);for(const b of d.values())if(!b)return;r&&r()},register:y=>(d.set(y,!1),()=>d.delete(y))}),[n,d,r]);return s&&p&&(g={...g}),D.useMemo(()=>{d.forEach((y,b)=>d.set(b,!1))},[n]),D.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),i==="popLayout"&&(e=P.jsx(oV,{isPresent:n,anchorX:l,anchorY:c,root:f,children:e})),P.jsx(sd.Provider,{value:g,children:e})};function iV(){return new Map}function M4(e=!0){const t=D.useContext(sd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,s=D.useId();D.useEffect(()=>{if(e)return o(s)},[e]);const i=D.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,i]:[!0]}function Rte(){return aV(D.useContext(sd))}function aV(e){return e===null?!0:e.isPresent}const jh=e=>e.key||"";function qA(e){const t=[];return D.Children.forEach(e,n=>{D.isValidElement(n)&&t.push(n)}),t}const au=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:s="sync",propagate:i=!1,anchorX:l="left",anchorY:c="top",root:f})=>{const[d,h]=M4(i),p=D.useMemo(()=>qA(e),[e]),g=i&&!d?[]:p.map(jh),y=D.useRef(!0),b=D.useRef(p),E=n2(()=>new Map),x=D.useRef(new Set),[v,C]=D.useState(p),[A,k]=D.useState(p);r2(()=>{y.current=!1,b.current=p;for(let B=0;B{const M=jh(B),I=i&&!d?!1:p===A||g.includes(M),O=()=>{if(x.current.has(M))return;if(x.current.add(M),E.has(M))E.set(M,!0);else return;let j=!0;E.forEach(z=>{z||(j=!1)}),j&&(L==null||L(),k(b.current),i&&(h==null||h()),r&&r())};return P.jsx(sV,{isPresent:I,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:s,root:f,onExitComplete:I?void 0:O,anchorX:l,anchorY:c,children:B},M)})})},lV=D.createContext(null);function cV(){const e=D.useRef(!1);return r2(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function uV(){const e=cV(),[t,n]=D.useState(0),r=D.useCallback(()=>{e.current&&n(t+1)},[t]);return[D.useCallback(()=>wn.postRender(r),[r]),t]}const R4=e=>e===!0,fV=e=>R4(e===!0)||e==="id",dV=({children:e,id:t,inherit:n=!0})=>{const r=D.useContext($f),o=D.useContext(lV),[s,i]=uV(),l=D.useRef(null),c=r.id||o;l.current===null&&(fV(n)&&c&&(t=t?c+"-"+t:c),l.current={id:t,group:R4(n)&&r.group||WA()});const f=D.useMemo(()=>({...l.current,forceRender:s}),[i]);return P.jsx($f.Provider,{value:f,children:e})},L4=D.createContext({strict:!1}),GA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let KA=!1;function hV(){if(KA)return;const e={};for(const t in GA)e[t]={isEnabled:n=>GA[t].some(r=>!!n[r])};c4(e),KA=!0}function I4(){return hV(),qU()}function pV(e){const t=I4();for(const n in e)t[n]={...t[n],...e[n]};c4(t)}const mV=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function pm(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||mV.has(e)}let N4=e=>!pm(e);function gV(e){typeof e=="function"&&(N4=t=>t.startsWith("on")?!pm(t):e(t))}try{gV(require("@emotion/is-prop-valid").default)}catch{}function yV(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(N4(o)||n===!0&&pm(o)||!t&&!pm(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const tg=D.createContext({});function bV(e,t){if(eg(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Wf(n)?n:void 0,animate:Wf(r)?r:void 0}}return e.inherit!==!1?t:{}}function vV(e){const{initial:t,animate:n}=bV(e,D.useContext(tg));return D.useMemo(()=>({initial:t,animate:n}),[YA(t),YA(n)])}function YA(e){return Array.isArray(e)?e.join(" "):e}const M2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function j4(e,t,n){for(const r in t)!Nr(t[r])&&!g4(r,n)&&(e[r]=t[r])}function wV({transformTemplate:e},t){return D.useMemo(()=>{const n=M2();return F2(n,t,e),Object.assign({},n.vars,n.style)},[t])}function EV(e,t){const n=e.style||{},r={};return j4(r,n,e),Object.assign(r,wV(e,t)),r}function CV(e,t){const n={},r=EV(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const O4=()=>({...M2(),attrs:{}});function xV(e,t,n,r){const o=D.useMemo(()=>{const s=O4();return y4(s,t,v4(r),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};j4(s,e.style,e),o.style={...s,...o.style}}return o}const kV=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function R2(e){return typeof e!="string"||e.includes("-")?!1:!!(kV.indexOf(e)>-1||/[A-Z]/u.test(e))}function AV(e,t,n,{latestValues:r},o,s=!1,i){const c=(i??R2(e)?xV:CV)(t,r,o,e),f=yV(t,typeof e=="string",s),d=e!==D.Fragment?{...f,...c,ref:n}:{},{children:h}=t,p=D.useMemo(()=>Nr(h)?h.get():h,[h]);return D.createElement(e,{...d,children:p})}function SV({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:_V(n,r,o,e),renderState:t()}}function _V(e,t,n,r){const o={},s=r(e,{});for(const p in s)o[p]=yp(s[p]);let{initial:i,animate:l}=e;const c=eg(e),f=l4(e);t&&f&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||i===!1;const h=d?l:i;if(h&&typeof h!="boolean"&&!Zm(h)){const p=Array.isArray(h)?h:[h];for(let g=0;g(t,n)=>{const r=D.useContext(tg),o=D.useContext(sd),s=()=>SV(e,t,r,o);return n?s():n2(s)},DV=$4({scrapeMotionValuesFromProps:B2,createRenderState:M2}),TV=$4({scrapeMotionValuesFromProps:w4,createRenderState:O4}),FV=Symbol.for("motionComponentSymbol");function BV(e,t,n){const r=D.useRef(n);D.useInsertionEffect(()=>{r.current=n});const o=D.useRef(null);return D.useCallback(s=>{var l;s&&((l=e.onMount)==null||l.call(e,s)),t&&(s?t.mount(s):t.unmount());const i=r.current;if(typeof i=="function")if(s){const c=i(s);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):i(s);else i&&(i.current=s)},[t])}const U4=D.createContext({});function lf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function PV(e,t,n,r,o,s){var x,v;const{visualElement:i}=D.useContext(tg),l=D.useContext(L4),c=D.useContext(sd),f=D.useContext(P2).reducedMotion,d=D.useRef(null),h=D.useRef(!1);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:f,isSVG:s}),h.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const p=d.current,g=D.useContext(U4);p&&!p.projection&&o&&(p.type==="html"||p.type==="svg")&&MV(d.current,n,o,g);const y=D.useRef(!1);D.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const b=n[K6],E=D.useRef(!!b&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,b))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,b)));return r2(()=>{h.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),E.current&&p.animationState&&p.animationState.animateChanges())}),D.useEffect(()=>{p&&(!E.current&&p.animationState&&p.animationState.animateChanges(),E.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,b)}),E.current=!1),p.enteringChildren=void 0)}),p}function MV(e,t,n,r){const{layoutId:o,layout:s,drag:i,dragConstraints:l,layoutScroll:c,layoutRoot:f,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:z4(e.parent)),e.projection.setOptions({layoutId:o,layout:s,alwaysMeasureLayout:!!i||l&&lf(l),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:f})}function z4(e){if(e)return e.options.allowProjection!==!1?e.projection:z4(e.parent)}function b0(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&pV(r);const s=n?n==="svg":R2(e),i=s?TV:DV;function l(f,d){let h;const p={...D.useContext(P2),...f,layoutId:RV(f)},{isStatic:g}=p,y=vV(f),b=i(f,g);if(!g&&d6){LV();const E=IV(p);h=E.MeasureLayout,y.visualElement=PV(e,b,p,o,E.ProjectionNode,s)}return P.jsxs(tg.Provider,{value:y,children:[h&&y.visualElement?P.jsx(h,{visualElement:y.visualElement,...p}):null,AV(e,f,BV(b,y.visualElement,d),b,g,t,s)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=D.forwardRef(l);return c[FV]=e,c}function RV({layoutId:e}){const t=D.useContext($f).id;return t&&e!==void 0?t+"-"+e:e}function LV(e,t){D.useContext(L4).strict}function IV(e){const t=I4(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function NV(e,t){if(typeof Proxy>"u")return b0;const n=new Map,r=(s,i)=>b0(s,i,e,t),o=(s,i)=>r(s,i);return new Proxy(o,{get:(s,i)=>i==="create"?r:(n.has(i)||n.set(i,b0(i,void 0,e,t)),n.get(i))})}const jV=(e,t)=>t.isSVG??R2(e)?new cz(t):new rz(t,{allowProjection:e!==D.Fragment});class OV extends Ta{constructor(t){super(t),t.animationState||(t.animationState=pz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Zm(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let $V=0;class UV extends Ta{constructor(){super(...arguments),this.id=$V++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const zV={animation:{Feature:OV},exit:{Feature:UV}};function cd(e){return{point:{x:e.pageX,y:e.pageY}}}const VV=e=>t=>_2(t)&&e(t,cd(t));function Tf(e,t,n,r){return qf(e,t,VV(n),r)}const V4=({current:e})=>e?e.ownerDocument.defaultView:null,QA=(e,t)=>Math.abs(e-t);function WV(e,t){const n=QA(e.x,t.x),r=QA(e.y,t.y);return Math.sqrt(n**2+r**2)}const XA=new Set(["auto","scroll"]);class W4{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:s=!1,distanceThreshold:i=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=g=>{this.handleScroll(g.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=w0(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=WV(g.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!b)return;const{point:E}=g,{timestamp:x}=kr;this.history.push({...E,timestamp:x});const{onStart:v,onMove:C}=this.handlers;y||(v&&v(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),C&&C(this.lastMoveEvent,g)},this.handlePointerMove=(g,y)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=v0(y,this.transformPagePoint),wn.update(this.updatePoint,!0)},this.handlePointerUp=(g,y)=>{this.end();const{onEnd:b,onSessionEnd:E,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=w0(g.type==="pointercancel"?this.lastMoveEventInfo:v0(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(g,v),E&&E(g,v)},!_2(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=o||window;const c=cd(t),f=v0(c,this.transformPagePoint),{point:d}=f,{timestamp:h}=kr;this.history=[{...d,timestamp:h}];const{onSessionStart:p}=n;p&&p(t,w0(f,this.history)),this.removeListeners=id(Tf(this.contextWindow,"pointermove",this.handlePointerMove),Tf(this.contextWindow,"pointerup",this.handlePointerUp),Tf(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(XA.has(r.overflowX)||XA.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:o.x-n.x,y:o.y-n.y};s.x===0&&s.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,o),wn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ka(this.updatePoint)}}function v0(e,t){return t?{point:t(e.point)}:e}function JA(e,t){return{x:e.x-t.x,y:e.y-t.y}}function w0({point:e},t){return{point:e,delta:JA(e,H4(t)),offset:JA(e,HV(t)),velocity:qV(t,.1)}}function HV(e){return e[0]}function H4(e){return e[e.length-1]}function qV(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=H4(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Ei(t)));)n--;if(!r)return{x:0,y:0};const s=es(o.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const i={x:(o.x-r.x)/s,y:(o.y-r.y)/s};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function GV(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?jn(n,e,r.max):Math.min(e,n)),e}function ZA(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function KV(e,{top:t,left:n,bottom:r,right:o}){return{x:ZA(e.x,n,o),y:ZA(e.y,t,r)}}function eS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Uf(t.min,t.max-r,e.min):r>o&&(n=Uf(e.min,e.max-o,t.min)),Ws(0,1,n)}function XV(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Yb=.35;function JV(e=Yb){return e===!1?e=0:e===!0&&(e=Yb),{x:tS(e,"left","right"),y:tS(e,"top","bottom")}}function tS(e,t,n){return{min:nS(e,t),max:nS(e,n)}}function nS(e,t){return typeof e=="number"?e:e[t]||0}const ZV=new WeakMap;class eW{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=cr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const s=h=>{n?(this.stopAnimation(),this.snapToCursor(cd(h).point)):this.pauseAnimation()},i=(h,p)=>{this.stopAnimation();const{drag:g,dragPropagation:y,onDragStart:b}=this.getProps();if(g&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=RU(g),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Jo(x=>{let v=this.getAxisMotionValue(x).get()||0;if(zs.test(v)){const{projection:C}=this.visualElement;if(C&&C.layout){const A=C.layout.layoutBox[x];A&&(v=eo(A)*(parseFloat(v)/100))}}this.originPoint[x]=v}),b&&wn.postRender(()=>b(h,p)),zb(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},l=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:b,onDrag:E}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:x}=p;if(y&&this.currentDirection===null){this.currentDirection=tW(x),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),E&&E(h,p)},c=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>Jo(h=>{var p;return this.getAnimationState(h)==="paused"&&((p=this.getAxisMotionValue(h).animation)==null?void 0:p.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new W4(t,{onSessionStart:s,onStart:i,onMove:l,onSessionEnd:c,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:V4(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!o||!r)return;const{velocity:i}=o;this.startAnimation(i);const{onDragEnd:l}=this.getProps();l&&wn.postRender(()=>l(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!Oh(t,o,this.currentDirection))return;const s=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=GV(i,this.constraints[t],this.elastic[t])),s.set(i)}resolveConstraints(){var s;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,o=this.constraints;t&&lf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=KV(r.layoutBox,t):this.constraints=!1,this.elastic=JV(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Jo(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=XV(r.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!lf(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const s=XU(r,o.root,this.visualElement.getTransformPagePoint());let i=YV(o.layout.layoutBox,s);if(n){const l=n(KU(i));this.hasMutatedConstraints=!!l,l&&(i=f4(l))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:s,dragSnapToOrigin:i,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},f=Jo(d=>{if(!Oh(d,n,this.currentDirection))return;let h=c&&c[d]||{};i&&(h={min:0,max:0});const p=o?200:1e6,g=o?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...h};return this.startAxisValueAnimation(d,y)});return Promise.all(f).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return zb(this.visualElement,t),r.start(C2(t,r,0,n,this.visualElement,!1))}stopAnimation(){Jo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Jo(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Jo(n=>{const{drag:r}=this.getProps();if(!Oh(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,s=this.getAxisMotionValue(n);if(o&&o.layout){const{min:i,max:l}=o.layout.layoutBox[n],c=s.get()||0;s.set(t[n]-jn(i,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!lf(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Jo(i=>{const l=this.getAxisMotionValue(i);if(l&&this.constraints!==!1){const c=l.get();o[i]=QV({min:c,max:c},this.constraints[i])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Jo(i=>{if(!Oh(i,t,null))return;const l=this.getAxisMotionValue(i),{min:c,max:f}=this.constraints[i];l.set(jn(c,f,o[i]))})}addListeners(){if(!this.visualElement.current)return;ZV.set(this.visualElement,this);const t=this.visualElement.current,n=Tf(t,"pointerdown",c=>{const{drag:f,dragListener:d=!0}=this.getProps(),h=c.target,p=h!==t&&s4(h);f&&d&&!p&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();lf(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),wn.read(r);const i=qf(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:f})=>{this.isDragging&&f&&(Jo(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())}));return()=>{i(),n(),s(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:s=!1,dragElastic:i=Yb,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:s,dragElastic:i,dragMomentum:l}}}function Oh(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function tW(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class nW extends Ta{constructor(t){super(t),this.removeGroupControls=ts,this.removeListeners=ts,this.controls=new eW(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ts}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const rS=e=>(t,n)=>{e&&wn.postRender(()=>e(t,n))};class rW extends Ta{constructor(){super(...arguments),this.removePointerDownListener=ts}onPointerDown(t){this.session=new W4(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V4(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:rS(t),onStart:rS(n),onMove:r,onEnd:(s,i)=>{delete this.session,o&&wn.postRender(()=>o(s,i))}}}mount(){this.removePointerDownListener=Tf(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let E0=!1;class oW extends D.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:s}=t;s&&(n.group&&n.group.add(s),r&&r.register&&o&&r.register(s),E0&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),bp.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:s}=this.props,{projection:i}=r;return i&&(i.isPresent=s,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),E0=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==s?i.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?i.promote():i.relegate()||wn.postRender(()=>{const l=i.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),S2.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;E0=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function q4(e){const[t,n]=M4(),r=D.useContext($f);return P.jsx(oW,{...e,layoutGroup:r,switchLayoutGroup:D.useContext(U4),isPresent:t,safeToRemove:n})}const sW={pan:{Feature:rW},drag:{Feature:nW,ProjectionNode:P4,MeasureLayout:q4}};function oS(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,s=r[o];s&&wn.postRender(()=>s(t,cd(t)))}class iW extends Ta{mount(){const{current:t}=this.node;t&&(this.unmount=LU(t,(n,r)=>(oS(this.node,r,"Start"),o=>oS(this.node,o,"End"))))}unmount(){}}class aW extends Ta{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=id(qf(this.node.current,"focus",()=>this.onFocus()),qf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function sS(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),s=r[o];s&&wn.postRender(()=>s(t,cd(t)))}class lW extends Ta{mount(){const{current:t}=this.node;t&&(this.unmount=jU(t,(n,r)=>(sS(this.node,r,"Start"),(o,{success:s})=>sS(this.node,o,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Qb=new WeakMap,C0=new WeakMap,cW=e=>{const t=Qb.get(e.target);t&&t(e)},uW=e=>{e.forEach(cW)};function fW({root:e,...t}){const n=e||document;C0.has(n)||C0.set(n,{});const r=C0.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(uW,{root:e,...t})),r[o]}function dW(e,t,n){const r=fW(t);return Qb.set(e,n),r.observe(e),()=>{Qb.delete(e),r.unobserve(e)}}const hW={some:0,all:1};class pW extends Ta{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:s}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:hW[o]},l=c=>{const{isIntersecting:f}=c;if(this.isInView===f||(this.isInView=f,s&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=f?d:h;p&&p(c)};return dW(this.node.current,i,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(mW(t,n))&&this.startObserver()}unmount(){}}function mW({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const gW={inView:{Feature:pW},tap:{Feature:lW},focus:{Feature:aW},hover:{Feature:iW}},yW={layout:{ProjectionNode:P4,MeasureLayout:q4}},bW={...zV,...gW,...sW,...yW},to=NV(bW,jV),vW=350,wW={duration:.15,ease:[.4,0,.2,1]},EW={type:"tween",duration:.25,ease:[.4,0,.2,1]},CW={type:"tween",duration:.3,ease:[.4,0,.2,1]},G4=D.createContext(!1);function Lte(){return D.useContext(G4)}const K4=D.createContext(void 0);function Y4(){return D.useContext(K4)}const di={bg:"#F8F8F8",border:"rgba(0, 0, 0, 0.12)",text:"#1A1A1A",textSecondary:"#4A4A4A",textMuted:"#737373",hoverBg:"rgba(0, 0, 0, 0.06)",ring:"rgba(0, 0, 0, 0.08)"},xW={xs:"sm:max-w-xs",sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl","3xl":"sm:max-w-3xl","4xl":"sm:max-w-4xl","5xl":"sm:max-w-5xl",full:"sm:max-w-[calc(100vw-2rem)]"};function Ite({open:e,onClose:t,size:n="md",className:r,children:o,bottomSheet:s=!0,motionPlus:i=!1,basemapMode:l,solid:c=!1}){const f=l==="light",[d,h]=D.useState(!1),p=D.useRef(null);D.useEffect(()=>(p.current&&(clearTimeout(p.current),p.current=null),e?p.current=setTimeout(()=>{h(!0)},vW):queueMicrotask(()=>h(!1)),()=>{p.current&&(clearTimeout(p.current),p.current=null)}),[e]);const g=D.useCallback((x,v)=>{(v.offset.y>100||v.velocity.y>500)&&t()},[t]),y=i?CW:EW,b=i?.98:.99,E=s?8:4;return P.jsx(au,{mode:"wait",children:e&&P.jsxs(QD,{static:!0,open:e,onClose:t,className:"relative z-[10010]",children:[P.jsx(to.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:wW,className:"fixed inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":"true"}),P.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:P.jsx("div",{className:He("flex min-h-full justify-center",s?"items-end sm:items-center sm:p-4":"items-center p-4"),children:P.jsx(to.div,{drag:s?"y":!1,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.4},onDragEnd:g,initial:{opacity:0,scale:b,y:E},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.99,y:s?40:4},transition:y,style:{willChange:"transform, opacity"},className:He(s&&"w-full sm:w-auto"),children:P.jsx(Kw,{className:He("relative w-full shadow-2xl flex flex-col",!l&&!c&&"bg-surface/80 backdrop-blur-xl",!l&&c&&"bg-surface",!l&&"ring-1 ring-inset ring-edge-subtle",xW[n],s?"radius-card overflow-hidden pb-safe":"radius-card overflow-hidden",r),style:l?{backgroundColor:f?di.bg:"var(--surface)",boxShadow:`inset 0 0 0 1px ${f?di.ring:"rgba(255, 255, 255, 0.1)"}`}:void 0,children:P.jsx(K4.Provider,{value:l,children:P.jsx(G4.Provider,{value:d,children:o})})})})})})]})})}function kW({className:e,...t}){const n=Y4(),r=n==="light";return P.jsx(YD,{...t,className:He("text-base font-semibold sm:text-lg",!n&&"text-fg-primary",e),style:n?{color:r?di.text:"var(--fg-primary)"}:void 0})}function Nte({icon:e,title:t,onClose:n,className:r}){const o=Y4(),s=o==="light";return P.jsxs("div",{className:He("flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b",!o&&"border-edge-subtle",r),style:o?{borderColor:s?di.border:"var(--edge-subtle)"}:void 0,children:[P.jsxs("div",{className:"flex items-center gap-3",children:[e&&P.jsx("div",{className:He(!o&&"text-icon-card-title"),style:o?{color:s?di.textSecondary:"var(--icon-card-title)"}:void 0,children:e}),P.jsx(kW,{children:t})]}),n&&P.jsxs(P.Fragment,{children:[P.jsx("button",{onClick:n,className:"sm:hidden min-h-[44px] min-w-[44px] px-3 flex items-center justify-center text-[15px] font-medium text-sys-blue active:text-sys-blue/70 transition-base radius-inner active:bg-subtle-fill",children:"Done"}),P.jsx("button",{onClick:n,className:He("hidden sm:flex items-center justify-center p-2 radius-inner transition-colors",!o&&"text-fg-muted hover:text-fg-primary hover:bg-subtle"),style:o?{color:s?di.textMuted:"var(--fg-muted)"}:void 0,onMouseEnter:i=>{o&&(i.currentTarget.style.color=s?di.text:"var(--fg-primary)",i.currentTarget.style.backgroundColor=s?di.hoverBg:"var(--subtle)")},onMouseLeave:i=>{o&&(i.currentTarget.style.color=s?di.textMuted:"var(--fg-muted)",i.currentTarget.style.backgroundColor="transparent")},"aria-label":"Close",children:P.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:P.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})}function jte({className:e,...t}){return P.jsx("div",{...t,className:He("px-6 py-5",e)})}function Ote({className:e,...t}){return P.jsx("div",{...t,className:He("flex flex-col-reverse gap-3 px-6 pb-6 pt-0","sm:flex-row sm:justify-end","*:w-full sm:*:w-auto",e)})}const x0={snappy:{type:"spring",stiffness:500,damping:30},smooth:{type:"spring",stiffness:300,damping:30},gentle:{type:"spring",stiffness:200,damping:25}},AW={fast:.15,normal:.2,medium:.3},SW={easeOut:[0,0,.2,1],easeIn:[.4,0,1,1]},$te={dropdown:{type:"spring",stiffness:500,damping:30},fade:{duration:AW.fast,ease:SW.easeOut},numberTicker:{type:"spring",visualDuration:.4,bounce:.15,opacity:{duration:.15,ease:"linear"}},numberReveal:{type:"spring",visualDuration:.6,bounce:.25,opacity:{duration:.2,ease:"linear"}}},Ute={normal:.05};function _W({className:e,...t}){return P.jsx("nav",{...t,className:He(e,"flex h-full min-h-0 flex-col")})}function DW({className:e,...t}){return P.jsx("div",{...t,className:He(e,"flex flex-col border-b border-edge-subtle p-4","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function TW({className:e,...t}){return P.jsx("div",{...t,className:He(e,"flex flex-1 flex-col p-3","overflow-y-auto sidebar-scroll","[&>[data-slot=section]+[data-slot=section]]:mt-6")})}function FW({className:e,...t}){return P.jsx("div",{...t,className:He(e,"mt-auto flex flex-col","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function BW({className:e,...t}){const n=D.useId();return P.jsx(dV,{id:n,children:P.jsx("div",{...t,"data-slot":"section",className:He(e,"flex flex-col gap-0.5")})})}const PW=D.forwardRef(function(t,n){const{current:r,className:o,children:s,accentColor:i,...l}=t,c=!!i,f=He("relative isolate flex w-full items-center gap-3 radius-inner px-3 py-1.5 text-left","min-h-[34px]","text-sm font-medium","[&>svg]:w-4 [&>svg]:h-4 [&>svg]:flex-shrink-0",r?c?"text-white":"text-white [&_svg]:text-sys-blue":"text-fg-muted hover:text-fg-primary hover:bg-elevated [&_svg]:text-fg-muted hover:[&_svg]:text-fg-primary","transition-all duration-150"),d=c?{willChange:"transform",backgroundColor:i,boxShadow:[`0 0 10px 2px color-mix(in oklch, ${i} 50%, transparent)`,`0 0 4px 0 color-mix(in oklch, ${i} 70%, transparent)`].join(", ")}:{willChange:"transform"},h=c?{willChange:"transform",background:"transparent",boxShadow:[`inset 0 0 0 1.5px ${i}`,`inset 0 0 3px 0.5px color-mix(in oklch, ${i} 30%, transparent)`,`inset 0 0 6px 1px color-mix(in oklch, ${i} 14%, transparent)`,`inset 0 0 10px 2px color-mix(in oklch, ${i} 5%, transparent)`,`0 0 20px -4px color-mix(in oklch, ${i} 22%, transparent)`,`0 0 8px -2px color-mix(in oklch, ${i} 14%, transparent)`].join(", ")}:{willChange:"transform"};return P.jsxs("span",{className:He(o,"relative"),children:[r&&P.jsx(to.span,{layout:"position",layoutId:"sidebar-current-indicator",className:He("absolute inset-y-1.5 -left-3 w-0.5 rounded-full",!c&&"bg-sys-blue sidebar-neo-indicator"),style:d,transition:x0.snappy}),typeof l.href=="string"?P.jsxs(Bm,{to:l.href,onClick:l.onClick,onMouseEnter:l.onMouseEnter,onMouseLeave:l.onMouseLeave,className:f,"data-current":r?"true":void 0,ref:n,children:[r&&P.jsx(to.span,{layout:"position",layoutId:"sidebar-current-highlight",className:He("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:x0.snappy}),s]}):P.jsxs(Vm,{...l,className:He("cursor-default",f),"data-current":r?"true":void 0,ref:n,children:[r&&P.jsx(to.span,{layout:"position",layoutId:"sidebar-current-highlight",className:He("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:x0.snappy}),s]})]})});function MW({className:e,...t}){return P.jsx("span",{...t,className:He(e,"truncate")})}function vp({className:e,variant:t="default",...n}){const r={default:"bg-subtle text-fg-muted",accent:"bg-sys-blue/20 text-sys-blue",success:"bg-sys-green/20 text-sys-green",warning:"bg-sys-indigo/20 text-sys-indigo",danger:"bg-sys-red/20 text-sys-red"};return P.jsx("span",{...n,className:He("ml-auto flex items-center gap-1 px-1.5 py-0.5 rounded-full","text-xs font-medium",r[t],e)})}const Q4=D.createContext(null);function RW(){const e=D.useContext(Q4);if(!e)throw new Error("useSidebar must be used within a SidebarLayout");return e}const X4={type:"spring",visualDuration:.35,bounce:.15},LW=X4.visualDuration*1e3;function IW({open:e,onClose:t,children:n}){return P.jsx(au,{children:e&&P.jsxs(QD,{static:!0,open:e,onClose:t,className:"lg:hidden relative z-[10002]",children:[P.jsx(to.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25,ease:"easeOut"},className:"fixed inset-0 bg-black/60 backdrop-blur-sm","aria-hidden":"true"}),P.jsx(to.div,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:X4,className:"fixed inset-y-0 left-0 w-72 max-w-[85vw] z-[10003]",children:P.jsx(Kw,{className:"h-full",children:P.jsxs("div",{className:"flex h-full flex-col sidebar-panel",children:[P.jsx("div",{className:"absolute top-4 right-4 z-10",children:P.jsx(ZL,{className:"p-2 rounded-lg text-fg-muted hover:text-fg-primary hover:bg-subtle-fill transition-colors","aria-label":"Close navigation",children:P.jsx(f6,{className:"w-5 h-5"})})}),n]})})})]})})}function NW({sidebar:e,navbar:t,children:n,className:r}){const[o,s]=D.useState(!1),i=()=>s(!0),l=()=>s(!1),c={isOpen:o,open:i,close:l,toggle:()=>s(f=>!f)};return P.jsx(Q4.Provider,{value:c,children:P.jsxs("div",{className:"flex h-screen overflow-hidden bg-body",children:[P.jsx("aside",{className:"hidden lg:flex flex-col w-64 flex-shrink-0 h-full relative sidebar-panel",children:e}),P.jsx(IW,{open:o,onClose:l,children:e}),P.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[P.jsx("header",{className:"lg:hidden sticky top-0 z-[10001] h-14 mobile-header",children:P.jsxs("div",{className:"flex items-center h-full px-4",children:[P.jsx("button",{onClick:i,className:"w-10 h-10 flex items-center justify-center rounded-lg hover:bg-subtle-fill active:bg-subtle-fill transition-colors mr-2","aria-label":"Open navigation",children:P.jsx(Hj,{className:"w-5 h-5 text-fg-primary"})}),P.jsx("div",{className:"flex-1 min-w-0",children:t})]})}),P.jsx("main",{className:He("flex-1 overflow-y-auto main-content",r),children:n})]})]})})}function jW({className:e,...t}){return P.jsx("nav",{...t,className:He(e,"flex flex-1 items-center gap-3")})}function iS({className:e,...t}){return P.jsx("div",{...t,className:He(e,"flex items-center gap-3")})}function OW({className:e,...t}){return P.jsx("div",{"aria-hidden":"true",...t,className:He(e,"flex-1")})}const $W=[45,72,33,58,80,42,65,28,55,75,38,62];function Bt({className:e,style:t}){return P.jsx("div",{className:He("animate-pulse bg-subtle-fill radius-badge",e),style:t})}function UW(){return P.jsx("div",{className:"p-3 radius-inner border-card bg-subtle",children:P.jsxs("div",{className:"flex items-start gap-3",children:[P.jsx(Bt,{className:"w-14 h-6 rounded shrink-0"}),P.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[P.jsx(Bt,{className:"h-4 w-full"}),P.jsx(Bt,{className:"h-4 w-3/4"}),P.jsx(Bt,{className:"h-3 w-32 mt-1"})]})]})})}function zte({count:e=8}){return P.jsx("div",{className:"space-y-2",children:Array.from({length:e}).map((t,n)=>P.jsx(UW,{},n))})}function zW(){return P.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-24"})]}),P.jsx(Bt,{className:"h-8 w-20"}),P.jsxs("div",{className:"flex-1 flex flex-col justify-end gap-2",children:[P.jsx(Bt,{className:"h-3 w-full"}),P.jsx(Bt,{className:"h-3 w-3/4"})]})]})}function VW(){return P.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-24"})]}),P.jsx("div",{className:"flex-1 flex items-end gap-1",children:$W.slice(0,8).map((e,t)=>P.jsx(Bt,{className:"flex-1",style:{height:`${e}%`}},t))})]})}function WW({rows:e=5}){return P.jsxs("div",{className:"flex flex-col h-full","aria-hidden":"true",children:[P.jsx("div",{className:"pb-3 border-b border-edge-subtle",children:P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-24"})]})}),P.jsx("div",{className:"flex-1 pt-3 flex flex-col gap-3",children:Array.from({length:e}).map((t,n)=>P.jsx(Bt,{className:"h-6 w-full"},n))})]})}const J4=D.createContext(void 0);function Vte(){return D.useContext(J4)}const HW={sm:"radius-inner",md:"radius-inset",lg:"radius-card",xl:"radius-hero",full:"radius-pill",none:"radius-none"},Wte=D.forwardRef(function({children:t,elevated:n,compact:r,noPadding:o,radius:s="lg",glass:i=!0,stroke:l=!0,shadow:c,reflex:f=!1,glow:d=!1,neomorphic:h=!0,onClick:p,className:g,style:y,isLoaded:b,skeletonType:E="card",...x},v){const C=D.useContext(J4),[A,k]=D.useState(!1);D.useEffect(()=>{let j=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{j||k(!0)})}),()=>{j=!0}},[]);const F=b??C??A,L=c??n??!1,B=l,M={...y,...f?{"--surface-reflex":"1"}:{}},I=()=>{switch(E){case"chart":return P.jsx(VW,{});case"list":return P.jsx(WW,{});default:return P.jsx(zW,{})}},O=He(HW[s],i&&(n?"bg-surface/85 backdrop-blur-xl":"bg-surface/80 backdrop-blur-lg"),!i&&"bg-surface",h&&"depth-raised",B&&!h&&!d&&"ring-1 ring-inset ring-edge-subtle",d&&"ring-1 ring-inset ring-sys-blue/40",L&&(n?"shadow-xl":"shadow-lg"),f&&"surface-reflex","h-full flex flex-col relative",!o&&(r?"p-3 sm:p-4":"p-4 sm:p-5"),p&&"cursor-pointer",g);return F?P.jsx("div",{ref:v,"data-card-surface":!0,className:O,style:M,onClick:p,...x,children:t}):P.jsx("div",{ref:v,"data-card-surface":!0,className:O,style:M,...x,children:I()})});function Hte({title:e,icon:t,badge:n,badgeColor:r="teal",subtitle:o,actions:s,iconColor:i="text-icon-card-title",listHeader:l=!1,stackActionsOnMobile:c=!1,stackBreakpoint:f="sm",titleExtra:d,onClick:h,className:p}){const g="px-5 py-4 border-b border-edge-subtle",y={sm:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 min-h-[32px]",md:"flex flex-col md:flex-row md:items-center md:justify-between gap-2 min-h-[32px]",lg:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-2 min-h-[32px]"},b=P.jsxs(P.Fragment,{children:[t&&P.jsx("span",{className:He("icon-md flex items-center justify-center",i),children:t}),P.jsx("span",{className:"type-micro",children:e}),n&&P.jsx(hj,{color:r,children:n}),d]}),E=h?"button":"div",x=h?{onClick:h,type:"button"}:{};return c&&s?P.jsxs(E,{...x,className:He("flex flex-col gap-1 flex-shrink-0",l?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[P.jsxs("div",{className:y[f],children:[P.jsx("div",{className:"flex items-center gap-3",children:b}),P.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:s})]}),o&&P.jsx("p",{className:"type-label text-fg-muted ml-8",children:o})]}):P.jsxs(E,{...x,className:He("flex flex-col gap-1 flex-shrink-0",l?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[P.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-[32px]",children:[P.jsx("div",{className:"flex items-center gap-3",children:b}),s&&P.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:s})]}),o&&P.jsx("p",{className:"type-label text-fg-muted ml-8",children:o})]})}D.forwardRef(function({children:t,icon:n,className:r,...o},s){return P.jsxs("h3",{ref:s,className:He("flex items-center gap-2","text-base font-semibold text-fg-primary",r),...o,children:[n&&P.jsx("span",{className:"text-icon-card-title w-5 h-5 flex-shrink-0",children:n}),t]})});D.forwardRef(function({children:t,className:n,...r},o){return P.jsx("p",{ref:o,className:He("text-sm text-fg-muted",n),...r,children:t})});const qte=D.forwardRef(function({children:t,centered:n,className:r,...o},s){return P.jsx("div",{ref:s,className:He("flex-1 min-h-0",n&&"flex items-center justify-center",r),...o,children:t})});D.forwardRef(function({children:t,className:n,...r},o){return P.jsx("div",{ref:o,className:He("flex items-center justify-end gap-3","pt-4 mt-4","border-t border-edge-subtle",n),...r,children:t})});D.forwardRef(function({children:t,border:n,className:r,...o},s){return P.jsx("div",{ref:s,className:He(n&&"pt-4 mt-4 border-t border-edge-subtle",r),...o,children:t})});function qW({defaultOpen:e=!1,className:t,children:n}){return P.jsx(JD,{defaultOpen:e,children:P.jsx("div",{className:He("flex flex-col",t),children:n})})}const GW=D.forwardRef(function({className:t,icon:n,children:r,...o},s){return P.jsx(am,{ref:s,className:He("flex w-full items-center justify-between gap-3","px-3 py-2 radius-inner","text-sm font-medium text-fg-muted","row-hover hover:text-fg-primary","ring-focus",t),...o,children:({open:i})=>P.jsxs(P.Fragment,{children:[r,P.jsx("span",{className:He("transition-transform duration-200",i?"rotate-180":"rotate-0"),children:n||P.jsx(Db,{className:"w-4 h-4"})})]})})});function KW({direction:e="down",className:t,children:n}){const r={hidden:{height:0,opacity:0,y:e==="up"?8:-8},visible:{height:"auto",opacity:1,y:0}};return P.jsx(Zw,{static:!0,children:({open:o})=>P.jsx(au,{initial:!1,children:o&&P.jsx(to.div,{initial:"hidden",animate:"visible",exit:"hidden",variants:r,transition:{height:{duration:.2,ease:[.4,0,.2,1]},opacity:{duration:.15},y:{duration:.15}},className:He("overflow-hidden",t),children:P.jsx("div",{className:He(e==="up"?"pb-2":"pt-2"),children:n})})})})}function YW({label:e,icon:t,defaultOpen:n=!0,direction:r="down",className:o,dataId:s,children:i}){const l=s?{[`data-${s}-disclosure`]:!0}:{},c=P.jsxs("span",{className:"flex items-center gap-3",children:[t&&P.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),P.jsx("span",{className:"type-micro",children:e})]});return r==="up"?P.jsx(JD,{defaultOpen:n,children:({open:f})=>P.jsxs("div",{className:He("relative",o),children:[P.jsx(Zw,{static:!0,className:"relative z-50",children:P.jsx(au,{initial:!1,mode:"wait",children:f&&P.jsxs(to.div,{initial:{y:12,scale:.97,opacity:0},animate:{y:0,scale:1,opacity:1},exit:{y:6,scale:.98,opacity:0},transition:{type:"spring",stiffness:400,damping:32,mass:.8,opacity:{duration:.15,ease:[.4,0,.2,1]}},className:"absolute bottom-full left-0 right-0 z-50 mb-1 origin-bottom radius-inset shadow-lg border-card bg-surface/75 backdrop-blur-sm",children:[P.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[P.jsxs("span",{className:"flex items-center gap-3",children:[t&&P.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),P.jsx("span",{className:"type-micro",children:e})]}),P.jsx(am,{className:"p-1 rounded hover:bg-subtle-fill-strong transition-colors",children:P.jsx(to.span,{initial:{rotate:0},animate:{rotate:180},exit:{rotate:0},transition:{type:"spring",stiffness:400,damping:25},children:P.jsx(Db,{className:"w-4 h-4"})})})]}),P.jsx("div",{className:"px-3 pb-3",children:i})]})})}),P.jsx(to.div,{animate:{opacity:f?.4:1,scale:f?.98:1},transition:{type:"spring",stiffness:500,damping:35},children:P.jsxs(am,{...l,className:He("flex w-full items-center justify-between gap-3","px-3 py-3.5 rounded-none rounded-t-lg","bg-surface depth-stroke-raised","text-sm font-medium text-fg-muted","hover:bg-elevated hover:text-fg-primary transition-colors","ring-focus"),children:[c,P.jsx(to.span,{animate:{rotate:f?180:0},transition:{type:"spring",stiffness:400,damping:25},children:P.jsx(Db,{className:"w-4 h-4"})})]})})]})}):P.jsxs(qW,{defaultOpen:n,className:o,children:[P.jsx(GW,{...l,children:c}),P.jsx(KW,{direction:"down",children:P.jsx("div",{className:"bg-subtle-fill radius-inset mx-1 mt-1",children:i})})]})}const $h=8;function QW(e,t,n){const r=window.scrollY,o=window.scrollX;switch(n){case"top":return{top:e.top+r-t.height-$h,left:e.left+o+(e.width-t.width)/2};case"bottom":return{top:e.bottom+r+$h,left:e.left+o+(e.width-t.width)/2};case"left":return{top:e.top+r+(e.height-t.height)/2,left:e.left+o-t.width-$h};case"right":return{top:e.top+r+(e.height-t.height)/2,left:e.right+o+$h}}}const XW=e=>({hidden:{opacity:0,scale:.96,...{top:{y:4},bottom:{y:-4},left:{x:4},right:{x:-4}}[e]},visible:{opacity:1,scale:1,x:0,y:0}});function JW({placement:e}){const t=He("absolute w-2 h-2 rotate-45",e==="top"&&"bottom-[-4px] left-1/2 -translate-x-1/2",e==="bottom"&&"top-[-4px] left-1/2 -translate-x-1/2",e==="left"&&"right-[-4px] top-1/2 -translate-y-1/2",e==="right"&&"left-[-4px] top-1/2 -translate-y-1/2");return P.jsx("span",{className:t,style:{backgroundColor:"var(--tooltip-bg)"}})}function ZW({content:e,children:t,placement:n="top",delay:r=200,arrow:o=!0,disabled:s=!1,className:i}){const[l,c]=D.useState(!1),[f,d]=D.useState({top:0,left:0}),[h,p]=D.useState(!1),g=D.useRef(null),y=D.useRef(null),b=D.useRef();D.useEffect(()=>{p(!0)},[]),D.useEffect(()=>{if(!l||!g.current||!y.current)return;const k=g.current.getBoundingClientRect(),F=y.current.getBoundingClientRect(),L=QW(k,F,n),B=window.innerWidth-F.width-8,M=window.innerHeight+window.scrollY-F.height-8;d({top:Math.max(8,Math.min(L.top,M)),left:Math.max(8,Math.min(L.left,B))})},[l,n]);const E=D.useCallback(()=>{s||(b.current=setTimeout(()=>{c(!0)},r))},[r,s]),x=D.useCallback(()=>{b.current&&clearTimeout(b.current),c(!1)},[]);if(D.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),!D.isValidElement(t))return t;const v=D.cloneElement(t,{ref:g,onMouseEnter:k=>{var F,L;E(),(L=(F=t.props).onMouseEnter)==null||L.call(F,k)},onMouseLeave:k=>{var F,L;x(),(L=(F=t.props).onMouseLeave)==null||L.call(F,k)},onFocus:k=>{var F,L;E(),(L=(F=t.props).onFocus)==null||L.call(F,k)},onBlur:k=>{var F,L;x(),(L=(F=t.props).onBlur)==null||L.call(F,k)}}),C=XW(n),A=P.jsx(au,{children:l&&P.jsxs(to.div,{ref:y,initial:"hidden",animate:"visible",exit:"hidden",variants:C,transition:{duration:.15,ease:"easeOut"},className:He("fixed z-[10020] px-2.5 py-1.5 text-xs font-medium","rounded-lg","pointer-events-none",i),style:{top:f.top,left:f.left,backgroundColor:"var(--tooltip-bg)",color:"var(--tooltip-fg)",border:"1px solid var(--tooltip-border)",boxShadow:"var(--tooltip-shadow)"},role:"tooltip",children:[e,o&&P.jsx(JW,{placement:n})]})});return P.jsxs(P.Fragment,{children:[v,h&&Xc.createPortal(A,document.body)]})}const Z4={sm:{track:"h-5 w-9",thumb:"h-3.5 w-3.5",translate:"translate-x-[18px]",icon:"w-3 h-3",dot:"w-2 h-2"},md:{track:"h-6 w-11",thumb:"h-4 w-4",translate:"translate-x-[22px]",icon:"w-4 h-4",dot:"w-2.5 h-2.5"},lg:{track:"h-7 w-14",thumb:"h-5 w-5",translate:"translate-x-[30px]",icon:"w-4 h-4",dot:"w-3 h-3"}},Gte=D.forwardRef(function({enabled:t,onChange:n,label:r,description:o,tooltip:s,size:i="md",color:l="muted",dangerOff:c=!1,disabled:f=!1,status:d="idle",name:h,className:p},g){const y=Z4[i],b=d==="loading",E=l==="muted";return P.jsxs(Jm,{disabled:f||b,className:He("flex items-center gap-3",p),children:[P.jsx(ZD,{ref:g,checked:t,onChange:n,name:h,className:He(E?"toggle-switch-track":"group relative inline-flex shrink-0 items-center rounded-full border-2",y.track,!E&&(t?"bg-toggle-on border-toggle-on":"bg-toggle-off border-edge-subtle"),"disabled:opacity-50 disabled:cursor-not-allowed","ring-focus","transition-all duration-200"),"data-size":i,children:P.jsx("span",{className:He(E?"toggle-switch-thumb":"relative inline-flex items-center justify-center bg-white shadow-lg","transform rounded-full transition-transform duration-200",y.thumb,t?y.translate:"translate-x-[4px]"),children:E&&P.jsx("span",{className:He("toggle-switch-dot",y.dot,c?He("opacity-100",!t&&"toggle-switch-dot-danger"):t?"opacity-100":"opacity-0")})})}),(r||o||s)&&P.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r&&P.jsx(nd,{className:He("text-sm font-medium cursor-pointer select-none",f?"text-fg-muted":"text-fg-primary"),children:r}),s&&P.jsx(ZW,{content:s,placement:"top",children:P.jsx("span",{className:"text-fg-muted hover:text-fg-secondary cursor-help transition-colors",children:P.jsx(Mj,{className:"w-3.5 h-3.5"})})}),o&&!s&&P.jsx(ru,{className:"text-xs text-fg-muted",children:o})]}),d!=="idle"&&P.jsxs("div",{className:"flex items-center shrink-0",children:[d==="loading"&&P.jsx(Nj,{className:He(y.icon,"text-fg-muted animate-spin")}),d==="success"&&P.jsx(t2,{className:He(y.icon,"text-sys-green")}),d==="error"&&P.jsx(f6,{className:He(y.icon,"text-sys-red")})]})]})}),Kte=D.forwardRef(function({enabled:t,onChange:n,size:r="md",disabled:o=!1,"aria-label":s,className:i},l){const c=Z4[r];return P.jsx(ZD,{ref:l,checked:t,onChange:n,disabled:o,"aria-label":s,className:He("toggle-switch-track",c.track,"disabled:opacity-50 disabled:cursor-not-allowed","ring-focus","transition-all duration-200",i),"data-size":r,children:P.jsx("span",{className:He("toggle-switch-thumb","transform rounded-full transition-transform duration-200",c.thumb,t?c.translate:"translate-x-[4px]"),children:P.jsx("span",{className:He("toggle-switch-dot",c.dot,t?"opacity-100":"opacity-0")})})})}),eH={sm:{input:"h-8 text-sm px-3",icon:"w-4 h-4",iconPadding:"pl-8",trailingIconPadding:"pr-8"},md:{input:"h-[38px] text-sm px-4",icon:"w-4 h-4",iconPadding:"pl-10",trailingIconPadding:"pr-10"},lg:{input:"h-11 text-base px-4",icon:"w-5 h-5",iconPadding:"pl-11",trailingIconPadding:"pr-11"}},e8=D.forwardRef(function({type:t="text",size:n="md",invalid:r=!1,leadingIcon:o,trailingIcon:s,leadingAddon:i,trailingAddon:l,className:c,disabled:f,...d},h){const p=eH[n],g=o||i,y=s||l;return i||l?P.jsxs("div",{className:He("flex",c),children:[i&&P.jsx("span",{className:He("inline-flex items-center px-3 rounded-l-lg border border-r-0","bg-input-bg text-fg-muted text-sm",r?"border-sys-red":"border-input-border"),children:i}),P.jsx("input",{ref:h,type:t,disabled:f,className:He("flex-1 min-w-0 font-mono",p.input,"bg-input-bg",r?"border border-sys-red":"border border-input-border","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!f&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",i&&!l&&"rounded-r-lg",l&&!i&&"rounded-l-lg",!i&&!l&&"radius-inner"),...d}),l&&P.jsx("span",{className:He("inline-flex items-center px-3 rounded-r-lg border border-l-0","bg-input-bg text-fg-muted text-sm",r?"border-sys-red":"border-input-border"),children:l})]}):P.jsxs("div",{className:He("relative",c),children:[o&&P.jsx("div",{className:He("absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none","text-fg-muted"),children:P.jsx("span",{className:p.icon,children:o})}),P.jsx("input",{ref:h,type:t,disabled:f,className:He("w-full radius-inner font-mono",p.input,g&&p.iconPadding,y&&p.trailingIconPadding,"bg-input-bg",r?"border border-sys-red":"border border-input-border","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!f&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors"),...d}),s&&P.jsx("div",{className:He("absolute inset-y-0 right-0 flex items-center pr-3","text-fg-muted"),children:P.jsx("span",{className:p.icon,children:s})})]})}),Yte=D.forwardRef(function({label:t,description:n,errorMessage:r,required:o,invalid:s,className:i,...l},c){const f=s&&r;return P.jsxs(Jm,{className:He("flex flex-col gap-1.5",i),children:[t&&P.jsxs(nd,{className:"text-sm font-medium text-fg-primary",children:[t,o&&P.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!f&&P.jsx(ru,{className:"text-xs text-fg-muted -mt-0.5",children:n}),P.jsx(e8,{ref:c,invalid:s,...l}),f&&P.jsx("p",{className:"text-xs text-sys-red",children:r})]})});D.forwardRef(function({value:t,onChange:n,min:r,max:o,step:s=1,precision:i,...l},c){const f=h=>{const p=h.target.value;if(p===""||p==="-"){n(0);return}const g=parseFloat(p);if(!isNaN(g)){const y=r!==void 0&&o!==void 0?Math.min(Math.max(g,r),o):r!==void 0?Math.max(g,r):o!==void 0?Math.min(g,o):g;n(y)}},d=i!==void 0&&typeof t=="number"?t.toFixed(i):t;return P.jsx(e8,{ref:c,type:"number",value:d,onChange:f,min:r,max:o,step:s,...l})});const tH={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},nH=D.forwardRef(function({rows:t=3,resize:n="vertical",invalid:r=!1,disabled:o,className:s,...i},l){return P.jsx("textarea",{ref:l,rows:t,disabled:o,className:He("w-full radius-inner px-4 py-3 text-sm",tH[n],"bg-subtle",r?"border border-sys-red":"border-control","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!o&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",s),...i})});D.forwardRef(function({label:t,description:n,errorMessage:r,required:o,invalid:s,showCount:i,maxLength:l,value:c,className:f,...d},h){const p=s&&r,g=typeof c=="string"?c.length:0;return P.jsxs(Jm,{className:He("flex flex-col gap-1.5",f),children:[t&&P.jsxs(nd,{className:"text-sm font-medium text-fg-primary",children:[t,o&&P.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!p&&P.jsx(ru,{className:"text-xs text-fg-muted -mt-0.5",children:n}),P.jsx(nH,{ref:h,invalid:s,maxLength:l,value:c,...d}),P.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p?P.jsx("p",{className:"text-xs text-sys-red flex-1",children:r}):P.jsx("span",{}),i&&l&&P.jsxs("span",{className:He("text-xs",g>l?"text-sys-red":"text-fg-muted"),children:[g,"/",l]})]})]})});const rH={sm:{box:"h-4 w-4",icon:"h-3 w-3",radius:"rounded"},md:{box:"h-5 w-5",icon:"h-3.5 w-3.5",radius:"rounded-md"},lg:{box:"h-6 w-6",icon:"h-4 w-4",radius:"rounded-md"}},Qte=D.forwardRef(function({checked:t,onChange:n,indeterminate:r=!1,label:o,description:s,size:i="md",disabled:l=!1,name:c,value:f,className:d},h){const p=rH[i];return P.jsxs(Jm,{disabled:l,className:He("flex items-start gap-3",d),children:[P.jsxs(QL,{ref:h,checked:t,onChange:n,name:c,value:f,className:He("group relative flex shrink-0 items-center justify-center",p.box,p.radius,"border-2 transition-all duration-150",!t&&!r&&"border-edge-subtle bg-subtle",(t||r)&&"border-sys-blue bg-sys-blue",!t&&!r&&!l&&"hover:border-edge-strong","ring-focus","disabled:opacity-50 disabled:cursor-not-allowed"),children:[t&&!r&&P.jsx(t2,{className:He(p.icon,"text-white stroke-[3]")}),r&&P.jsx(Yj,{className:He(p.icon,"text-white stroke-[3]")})]}),(o||s)&&P.jsxs("div",{className:"flex-1 min-w-0 select-none",children:[o&&P.jsx(nd,{className:He("text-sm font-medium cursor-pointer",l?"text-fg-muted":"text-fg-primary"),children:o}),s&&P.jsx(ru,{className:"text-xs text-fg-muted mt-0.5",children:s})]})]})});D.createContext({variant:"default",divider:"subtle",grid:!0});const t8="0.9.304",aS="'JetBrains Mono', monospace";function oH({height:e=16,responsive:t=!1,className:n=""}){const r="var(--sys-blue)",o="var(--fg-primary)";if(t)return P.jsxs("svg",{className:n,viewBox:"0 0 145 24",preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"pyMC:Console",style:{display:"block",width:"80%",height:"auto"},children:[P.jsx("style",{children:` .logo-text { font-family: ${aS}; } @@ -295,4 +295,4 @@ safe-buffer/index.js: text-xs text-fg-primary leading-relaxed transition-opacity ${t.visible?"opacity-100":"opacity-0"} - `,style:{left:o.x,top:o.y,visibility:t.visible?"visible":"hidden"},children:t.content}),document.body)]})}function Nre({content:e,children:t,delay:n=150}){const{show:r,hide:o,updatePosition:s}=Lee(),i=D.useRef(null),l=D.useRef(null),c=D.useRef(!1),f=()=>{l.current&&(clearTimeout(l.current),l.current=null)},d=D.useCallback(b=>{f(),l.current=setTimeout(()=>{c.current=!0,r(e,b.clientX,b.clientY)},n)},[r,e,n]),h=D.useCallback(b=>{c.current&&s(b.clientX,b.clientY)},[s]),p=D.useCallback(()=>{f(),c.current=!1,o()},[o]),g=D.useCallback(()=>{if(f(),!i.current)return;const b=i.current.getBoundingClientRect();l.current=setTimeout(()=>{c.current=!0,r(e,b.left+b.width/2,b.top)},n)},[r,e,n]),y=D.useCallback(()=>{f(),c.current=!1,o()},[o]);return D.useEffect(()=>()=>{f(),c.current&&(c.current=!1,o())},[o]),D.useEffect(()=>{const b=()=>{c.current&&(f(),c.current=!1,o())};return document.addEventListener("click",b,!0),()=>document.removeEventListener("click",b,!0)},[o]),P.jsx("span",{ref:i,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onFocus:g,onBlur:y,className:"contents",children:t})}const Nee="";async function Fi(e,t){const n=`${Nee}${e}`;j2()&&await Sl();const r=ro(),o=r?{Authorization:`Bearer ${r}`}:{},s=await fetch(n,{...t,headers:{...o,...t==null?void 0:t.headers}});if(!s.ok)throw new Error(`Analytics API error: ${s.status} ${s.statusText}`);return s.json()}async function S3(e=!1){return Fi(`/api/analytics/topology${e?"?rebuild=true":""}`)}async function jee(){return Fi("/api/analytics/disambiguation")}async function Oee(e=168){return Fi(`/api/analytics/last_hop_neighbors?hours=${e}`)}async function $ee(e=168){return Fi(`/api/analytics/neighbor_affinity?hours=${e}`)}async function Uee(e=168){return Fi(`/api/analytics/mobile_nodes?hours=${e}`)}async function zee(e=20){return Fi(`/api/analytics/path_health?limit=${e}`)}async function Vee(e=24){return Fi(`/api/analytics/tx_recommendations?hours=${e}`)}async function Wee(e=168){return Fi(`/api/analytics/sparklines?hours=${e}`)}async function Hee(e){return Fi(`/api/analytics/bucketed_stats?preset=${e}`)}const eb={topology:6e4,neighbors:3e4,bucketedStats:3e4};let uw=[];Io((e,t)=>({backendAvailable:null,checkingBackend:!1,topology:null,topologyLoading:!1,topologyError:null,topologyLastUpdated:0,disambiguationStats:null,disambiguationLoading:!1,lastHopNeighbors:null,neighborsLoading:!1,neighborAffinity:null,affinityLoading:!1,mobileNodes:null,mobileLoading:!1,pathHealth:null,pathHealthLoading:!1,txRecommendation:null,txRecommendationLoading:!1,sparklines:new Map,sparklinesLoading:!1,sparklineHours:168,bucketedStats:null,bucketedStatsPreset:"1h",bucketedStatsLoading:!1,checkBackendAvailability:async()=>{e({checkingBackend:!0});try{const r=await S3(),o=r.success!==!1&&!r.error;return e({backendAvailable:o,checkingBackend:!1}),o}catch{return e({backendAvailable:!1,checkingBackend:!1}),!1}},fetchTopology:async(n=!1)=>{e({topologyLoading:!0,topologyError:null});try{const r=await S3(n);if(r.success===!1){e({topologyError:r.error||"Failed to fetch topology",topologyLoading:!1});return}e({topology:r||r,topologyLoading:!1,topologyLastUpdated:Date.now()})}catch(r){e({topologyError:r instanceof Error?r.message:"Failed to fetch topology",topologyLoading:!1})}},fetchDisambiguationStats:async()=>{e({disambiguationLoading:!0});try{const n=await jee();n.success!==!1?e({disambiguationStats:n,disambiguationLoading:!1}):e({disambiguationLoading:!1})}catch{e({disambiguationLoading:!1})}},fetchLastHopNeighbors:async(n=168)=>{e({neighborsLoading:!0});try{const r=await Oee(n);r.success!==!1?e({lastHopNeighbors:r,neighborsLoading:!1}):e({neighborsLoading:!1})}catch{e({neighborsLoading:!1})}},fetchNeighborAffinity:async(n=168)=>{e({affinityLoading:!0});try{const r=await $ee(n);r.success!==!1?e({neighborAffinity:r,affinityLoading:!1}):e({affinityLoading:!1})}catch{e({affinityLoading:!1})}},fetchMobileNodes:async(n=168)=>{e({mobileLoading:!0});try{const r=await Uee(n);r.success!==!1?e({mobileNodes:r,mobileLoading:!1}):e({mobileLoading:!1})}catch{e({mobileLoading:!1})}},fetchPathHealth:async(n=20)=>{e({pathHealthLoading:!0});try{const r=await zee(n);r.success!==!1?e({pathHealth:r.paths??[],pathHealthLoading:!1}):e({pathHealthLoading:!1})}catch{e({pathHealthLoading:!1})}},fetchTxRecommendation:async(n=24)=>{e({txRecommendationLoading:!0});try{const r=await Vee(n);r.success!==!1?e({txRecommendation:r,txRecommendationLoading:!1}):e({txRecommendationLoading:!1})}catch{e({txRecommendationLoading:!1})}},fetchSparklines:async(n=168)=>{e({sparklinesLoading:!0,sparklineHours:n});try{const r=await Wee(n);if(r.success!==!1){const o=r,s=new Map;if(o.sparklines)for(const[i,l]of Object.entries(o.sparklines))s.set(i,l);e({sparklines:s,sparklinesLoading:!1})}else e({sparklinesLoading:!1})}catch{e({sparklinesLoading:!1})}},fetchBucketedStats:async n=>{e({bucketedStatsLoading:!0,bucketedStatsPreset:n});try{const r=await Hee(n);r.success!==!1?e({bucketedStats:r,bucketedStatsLoading:!1}):e({bucketedStatsLoading:!1})}catch{e({bucketedStatsLoading:!1})}},initialize:async()=>{if(await t().checkBackendAvailability()&&(await Promise.all([t().fetchTopology(),t().fetchDisambiguationStats(),t().fetchLastHopNeighbors(),t().fetchMobileNodes(),t().fetchPathHealth(),t().fetchSparklines(),t().fetchBucketedStats("1h")]),typeof window<"u")){const r=setInterval(()=>{t().backendAvailable&&t().fetchTopology()},eb.topology),o=setInterval(()=>{t().backendAvailable&&t().fetchLastHopNeighbors()},eb.neighbors),s=setInterval(()=>{t().backendAvailable&&t().fetchBucketedStats(t().bucketedStatsPreset)},eb.bucketedStats);uw=[r,o,s]}},refreshAll:async()=>{const{backendAvailable:n}=t();n&&await Promise.all([t().fetchTopology(!0),t().fetchDisambiguationStats(),t().fetchLastHopNeighbors(),t().fetchNeighborAffinity(),t().fetchMobileNodes(),t().fetchPathHealth(),t().fetchTxRecommendation(),t().fetchSparklines(),t().fetchBucketedStats(t().bucketedStatsPreset)])}}));function qee(){for(const e of uw)clearInterval(e);uw=[]}function du({withControls:e=!1}){return P.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[P.jsx(Bt,{className:"h-7 w-40 sm:w-52"}),e&&P.jsx(Bt,{className:"h-8 w-48 sm:w-56 radius-inner"})]})}function Cs({className:e,children:t}){return P.jsx("div",{className:`bg-surface/80 radius-card depth-raised h-full flex flex-col p-4 sm:p-5 ${e??""}`,children:t})}const Gee=[45,72,33,58,80,42,65,28,55,75,38,62];function vE(){return P.jsx("div",{className:"flex-1 flex items-end gap-1",children:Gee.map((e,t)=>P.jsx(Bt,{className:"flex-1",style:{height:`${e}%`}},t))})}function Kee(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading dashboard","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-hero-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-36"})]}),P.jsx(vE,{})]})})}),P.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3].map(e=>P.jsx("div",{className:"col-span-6 lg:col-span-4",children:P.jsxs(Cs,{children:[P.jsx(Bt,{className:"h-4 w-24 mb-3"}),P.jsx(Bt,{className:"h-8 w-16"})]})},e))}),P.jsx("div",{className:"bento-row-widget grid-12 bento-gap",children:[1,2,3,4].map(e=>P.jsx("div",{className:"col-span-6 sm:col-span-4 md:col-span-3",children:P.jsxs(Cs,{children:[P.jsx(Bt,{className:"h-3 w-20 mb-2"}),P.jsx(Bt,{className:"h-6 w-12"})]})},e))})]})]})}function Ec(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading list","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{className:"!py-3",children:P.jsxs("div",{className:"flex gap-3",children:[P.jsx(Bt,{className:"h-8 w-28 radius-inner"}),P.jsx(Bt,{className:"h-8 w-28 radius-inner"}),P.jsx(Bt,{className:"h-8 w-28 radius-inner hidden sm:block"})]})})})}),P.jsx("div",{className:"bento-row-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{children:P.jsx("div",{className:"space-y-4",children:Array.from({length:8}).map((e,t)=>P.jsxs("div",{className:"flex items-center gap-4",children:[P.jsx(Bt,{className:"w-10 h-10 radius-inner shrink-0"}),P.jsxs("div",{className:"flex-1 space-y-2",children:[P.jsx(Bt,{className:"h-4 w-48"}),P.jsx(Bt,{className:"h-3 w-32"})]}),P.jsx(Bt,{className:"w-16 h-4 hidden sm:block"})]},t))})})})})]})]})}function Yee(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading map","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsx("div",{className:"bento-section",children:P.jsx("div",{className:"grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{className:"!min-h-[60vh]",children:P.jsx(Bt,{className:"flex-1 w-full radius-inset"})})})})})]})}function _3(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading charts","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-hero-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-32"})]}),P.jsx(vE,{})]})})}),P.jsx("div",{className:"bento-row-panel grid-12 bento-gap",children:[1,2].map(e=>P.jsx("div",{className:"col-span-12 md:col-span-6",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-28"})]}),P.jsx(Bt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function Qee(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading system","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-hero grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-36"})]}),P.jsx(vE,{})]})})}),P.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3,4].map(e=>P.jsx("div",{className:"col-span-12 sm:col-span-6",children:P.jsxs(Cs,{children:[P.jsx(Bt,{className:"h-4 w-28 mb-3"}),P.jsx(Bt,{className:"h-6 w-20 mb-2"}),P.jsx(Bt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function D3(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading settings","aria-busy":"true",children:[P.jsx(du,{}),P.jsx("div",{className:"bento-section",children:P.jsx("div",{className:"bento-row-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{children:P.jsx("div",{className:"space-y-6",children:[.6,.8,.5,.7,.4].map((e,t)=>P.jsxs("div",{className:"space-y-2",children:[P.jsx(Bt,{className:"h-3 w-24"}),P.jsx(Bt,{className:"h-10 radius-inner",style:{width:`${e*100}%`}})]},t))})})})})})]})}const Xee=1024;function Po({children:e,fallback:t}){const[n,r]=D.useState(!1);return D.useEffect(()=>{let o=!1;const s=window.innerWidth{s?setTimeout(()=>{o||D.startTransition(()=>r(!0))},LW):requestAnimationFrame(()=>{o||D.startTransition(()=>r(!0))})}),()=>{o=!0}},[]),n?P.jsx(D.Suspense,{fallback:t,children:e}):P.jsx(P.Fragment,{children:t})}function Jee(e){e();const t=_l.getState().initialize(),n=Ks.getState().initialize(),r=kQ.getState().initialize();fS();const o=setInterval(()=>{fS()},3e4),s=mH();return()=>{t(),r(),n==null||n(),s(),clearInterval(o),gT(),qee()}}const Zee=D.lazy(()=>fr(()=>import("./Login-CO56EEwr.js"),__vite__mapDeps([0,1]))),ete=D.lazy(()=>fr(()=>import("./Dashboard-B3SyL0YD.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]))),tte=D.lazy(()=>fr(()=>import("./Packets-CNQvqRHc.js"),__vite__mapDeps([37,7,10,38,17,9,11,4,12,13,14,15,16,18,19,20,21,22,23,24,25,26,6,27,28,29,30,39,40,41,42,3]))),nte=D.lazy(()=>fr(()=>import("./Contacts-DyjGy2DF.js").then(e=>e.C),__vite__mapDeps([43,30,7,44,3,45,38,17,28,16,4,13,14,46,47,19,40,48,20,12,18,49,23,50,51,42,52]))),rte=D.lazy(()=>fr(()=>import("./Statistics-Bw6LiBHK.js"),__vite__mapDeps([53,21,4,54,28,16,17,3,20,5,6,46,47,19,40,22,31,23,39,7,18,41,42,30,36,55,49,52]))),ote=D.lazy(()=>fr(()=>import("./MeshGraph-8GIpDJZb.js").then(e=>e.M),__vite__mapDeps([56,57,4,12,19,25,20,8,48,21,42,58,55,16,49]))),ste=D.lazy(()=>fr(()=>import("./System-Bt641EGB.js"),__vite__mapDeps([59,3,19,15,49,23,60,61,36]))),ite=D.lazy(()=>fr(()=>import("./Logs-BreOeqGn.js"),__vite__mapDeps([62,3,63]))),ate=D.lazy(()=>fr(()=>import("./Terminal-Bhn7RvtT.js"),__vite__mapDeps([64,44,65,1,3,66,67,58,42,16,68]))),lte=D.lazy(()=>fr(()=>import("./Configuration-tKO62oR_.js"),__vite__mapDeps([69,65,51,19,33,3,20,67,50,36,70,71,72,24,60,16]))),cte=D.lazy(()=>fr(()=>import("./RoomServer-DuVH7Mva.js"),__vite__mapDeps([73,3,36,7,45,38,17,71,50,66,67,51,19,34,13,74,72]))),ute=D.lazy(()=>fr(()=>import("./PacketObservatory-CoKryHKi.js"),__vite__mapDeps([75,30,7,11]))),fte=D.lazy(()=>fr(()=>import("./Sessions-Q_JqsA8g.js"),__vite__mapDeps([76,51,19,20,3,60,36,18,27,70,50]))),dte=D.lazy(()=>fr(()=>import("./Mqtt-BaDp61mH.js"),__vite__mapDeps([77,3,45,38,17,55,71,10,29,42,16,22,41,63,50,35,61,36,74,78,19])));function hte({children:e}){const t=qs(),n=Tm();return D.useEffect(()=>(cH(n),()=>uH()),[n]),I2()?P.jsx(P.Fragment,{children:e}):P.jsx(i7,{to:"/login",state:{from:t},replace:!0})}class pte extends D.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){var t;return this.state.hasError?P.jsxs("div",{className:"surface-base rounded-2xl p-8 text-center",children:[P.jsx("p",{className:"type-subheading text-sys-red mb-2",children:"Page failed to render"}),P.jsx("p",{className:"type-body text-fg-muted mb-4",children:((t=this.state.error)==null?void 0:t.message)||"Unknown error"}),P.jsx("button",{onClick:()=>this.setState({hasError:!1}),className:"px-4 py-2 bg-sys-blue/20 text-sys-blue rounded-lg hover:bg-sys-blue/30 transition-colors",children:"Try Again"})]}):this.props.children}}function mte(){const e=dT(),t=I2();return D.useEffect(()=>{if(t)return Jee(e)},[e,t]),P.jsxs(Iee,{children:[P.jsx(Ree,{}),P.jsxs(Fx,{children:[P.jsx(Lr,{path:"/login",element:P.jsx(D.Suspense,{fallback:P.jsx("div",{className:"min-h-screen bg-body"}),children:P.jsx(Zee,{})})}),P.jsx(Lr,{path:"/*",element:P.jsx(hte,{children:P.jsx(NW,{sidebar:P.jsx(Pee,{}),navbar:P.jsx(Mee,{}),children:P.jsx("div",{className:"px-1 sm:px-4 lg:px-4 pt-5 pb-4 sm:pb-6 lg:pb-8 max-w-7xl mx-auto",children:P.jsx(pte,{children:P.jsxs(Fx,{children:[P.jsx(Lr,{path:"/",element:P.jsx(Po,{fallback:P.jsx(Kee,{}),children:P.jsx(ete,{})})}),P.jsx(Lr,{path:"/packets",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(tte,{})})}),P.jsx(Lr,{path:"/contacts",element:P.jsx(Po,{fallback:P.jsx(Yee,{}),children:P.jsx(nte,{})})}),P.jsx(Lr,{path:"/statistics",element:P.jsx(Po,{fallback:P.jsx(_3,{}),children:P.jsx(rte,{})})}),P.jsx(Lr,{path:"/meshgraph",element:P.jsx(Po,{fallback:P.jsx(_3,{}),children:P.jsx(ote,{})})}),P.jsx(Lr,{path:"/system",element:P.jsx(Po,{fallback:P.jsx(Qee,{}),children:P.jsx(ste,{})})}),P.jsx(Lr,{path:"/logs",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(ite,{})})}),P.jsx(Lr,{path:"/terminal",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(ate,{})})}),P.jsx(Lr,{path:"/room-server",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(cte,{})})}),P.jsx(Lr,{path:"/configuration",element:P.jsx(Po,{fallback:P.jsx(D3,{}),children:P.jsx(lte,{})})}),P.jsx(Lr,{path:"/raw",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(ute,{})})}),P.jsx(Lr,{path:"/sessions",element:P.jsx(Po,{fallback:P.jsx(D3,{}),children:P.jsx(fte,{})})}),P.jsx(Lr,{path:"/mqtt",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(dte,{})})})]})})})})})})]})]})}const gte=console.warn;console.warn=(...e)=>{const t=e[0];typeof t=="string"&&t.includes("Unable to load glyph range")||gte.apply(console,e)};m9.createRoot(document.getElementById("root")).render(P.jsx(D.StrictMode,{children:P.jsx($R,{children:P.jsx(F7,{children:P.jsx(mte,{})})})}));export{qne as $,au as A,i0 as B,Qte as C,t2 as D,Sj as E,sH as F,cT as G,AY as H,e8 as I,DY as J,CY as K,Nj as L,Xj as M,Hte as N,CT as O,WY as P,$Y as Q,rO as R,EO as S,Gte as T,yre as U,pT as V,Dl as W,Uq as X,$q as Y,ht as Z,fr as _,Ute as a,od as a$,yQ as a0,Yne as a1,xQ as a2,Gne as a3,Kne as a4,Hne as a5,DX as a6,qY as a7,Or as a8,Nre as a9,rI as aA,rs as aB,xD as aC,iI as aD,CI as aE,LD as aF,Fn as aG,nd as aH,Ow as aI,oo as aJ,kD as aK,Da as aL,Ww as aM,ws as aN,Xc as aO,ya as aP,zw as aQ,pD as aR,ed as aS,Zf as aT,vo as aU,xl as aV,qn as aW,Vs as aX,td as aY,FD as aZ,Vw as a_,Bt as aa,Vte as ab,yO as ac,jr as ad,gK as ae,hK as af,pK as ag,e1 as ah,yK as ai,lre as aj,QY as ak,RS as al,Ite as am,jte as an,Db as ao,kY as ap,rQ as aq,tE as ar,wm as as,cO as at,Ft as au,TD as av,bL as aw,cD as ax,no as ay,Fl as az,x0 as b,Fte as b$,PD as b0,Jr as b1,pI as b2,BI as b3,hI as b4,BD as b5,it as b6,KI as b7,Bl as b8,Gs as b9,zne as bA,tT as bB,One as bC,Lte as bD,Bne as bE,Pne as bF,dV as bG,q2 as bH,ure as bI,X2 as bJ,Fne as bK,sO as bL,sQ as bM,Vne as bN,f5 as bO,Tre as bP,fre as bQ,Dq as bR,sne as bS,rne as bT,pne as bU,dK as bV,Bte as bW,mre as bX,yo as bY,dne as bZ,mne as b_,Pk as ba,nu as bb,tD as bc,eD as bd,kI as be,gD as bf,MD as bg,aD as bh,zc as bi,AO as bj,tj as bk,Ste as bl,_te as bm,Uj as bn,f6 as bo,CU as bp,yU as bq,n2 as br,r2 as bs,Tte as bt,Gf as bu,nK as bv,dre as bw,Zte as bx,Jte as by,a6 as bz,He as c,Yj as c$,Gj as c0,xO as c1,vm as c2,UY as c3,tne as c4,nne as c5,ane as c6,lne as c7,Jne as c8,iQ as c9,tN as cA,Lc as cB,sf as cC,kb as cD,mi as cE,Of as cF,Vc as cG,kl as cH,RD as cI,bD as cJ,dD as cK,Ate as cL,qI as cM,UD as cN,ZI as cO,Ok as cP,js as cQ,bI as cR,SD as cS,Ire as cT,pq as cU,one as cV,FQ as cW,t8 as cX,Nne as cY,ff as cZ,Une as c_,rj as ca,nj as cb,gQ as cc,YX as cd,Cq as ce,Pre as cf,Dte as cg,bre as ch,_O as ci,vte as cj,Dre as ck,wre as cl,Ere as cm,Fre as cn,kK as co,fne as cp,hne as cq,Mj as cr,qte as cs,vK as ct,CK as cu,Lne as cv,$te as cw,AD as cx,X_ as cy,$w as cz,Yt as d,pre as d$,ene as d0,yne as d1,gne as d2,vne as d3,bne as d4,cne as d5,ine as d6,Qne as d7,Re as d8,TO as d9,qq as dA,Sne as dB,Kq as dC,Gq as dD,fK as dE,Rt as dF,Qq as dG,tG as dH,iG as dI,yq as dJ,Nte as dK,SW as dL,AW as dM,JD as dN,am as dO,Zw as dP,gq as dQ,hH as dR,_l as dS,Lt as dT,j_ as dU,ww as dV,Ep as dW,nQ as dX,aO as dY,mO as dZ,hre as d_,Zj as da,tO as db,cre as dc,Jm as dd,Kte as de,Bre as df,Dj as dg,bte as dh,jK as di,$K as dj,zK as dk,UK as dl,zQ as dm,zq as dn,SY as dp,_Y as dq,MY as dr,RY as ds,eE as dt,Fj as du,zte as dv,_K as dw,oE as dx,gm as dy,Y2 as dz,Io as e,xre as e$,Yte as e0,ru as e1,Ote as e2,Ks as e3,Tne as e4,ere as e5,tre as e6,ire as e7,are as e8,nre as e9,Xne as eA,fn as eB,uT as eC,tK as eD,JH as eE,XG as eF,aK as eG,uK as eH,$ne as eI,Ine as eJ,_ne as eK,Dne as eL,Es as eM,fee as eN,Lre as eO,Mre as eP,Rre as eQ,xte as eR,sD as eS,kte as eT,Lh as eU,IL as eV,bx as eW,J4 as eX,_re as eY,vre as eZ,Pt as e_,rre as ea,ore as eb,sre as ec,UH as ed,zH as ee,KH as ef,VH as eg,hQ as eh,NH as ei,jH as ej,OH as ek,jne as el,Wne as em,qW as en,GW as eo,KW as ep,Qr as eq,og as er,sg as es,Z2 as et,KG as eu,ud as ev,hq as ew,Ene as ex,Cne as ey,xne as ez,I8 as f,kre as f0,Cre as f1,wne as f2,fd as f3,nE as f4,Sre as f5,YK as f6,_m as f7,Zne as f8,PQ as f9,Q6 as fA,um as fB,Pte as fC,Rte as fD,IO as fE,Rz as fF,a9 as fG,Mne as fH,Rne as fI,yT as fJ,kne as fa,HY as fb,vG as fc,ad as fd,NO as fe,GU as ff,cr as fg,gV as fh,P2 as fi,Hc as fj,MU as fk,jn as fl,s2 as fm,Nr as fn,k$ as fo,h$ as fp,x$ as fq,V6 as fr,Ei as fs,Uf as ft,i4 as fu,OU as fv,cz as fw,rz as fx,WU as fy,Bz as fz,o8 as g,kq as h,I2 as i,P as j,Are as k,Xte as l,to as m,gre as n,Sa as o,On as p,EK as q,D as r,dH as s,rE as t,Tm as u,Wte as v,zW as w,hj as x,une as y,Ane as z}; + `,style:{left:o.x,top:o.y,visibility:t.visible?"visible":"hidden"},children:t.content}),document.body)]})}function Nre({content:e,children:t,delay:n=150}){const{show:r,hide:o,updatePosition:s}=Lee(),i=D.useRef(null),l=D.useRef(null),c=D.useRef(!1),f=()=>{l.current&&(clearTimeout(l.current),l.current=null)},d=D.useCallback(b=>{f(),l.current=setTimeout(()=>{c.current=!0,r(e,b.clientX,b.clientY)},n)},[r,e,n]),h=D.useCallback(b=>{c.current&&s(b.clientX,b.clientY)},[s]),p=D.useCallback(()=>{f(),c.current=!1,o()},[o]),g=D.useCallback(()=>{if(f(),!i.current)return;const b=i.current.getBoundingClientRect();l.current=setTimeout(()=>{c.current=!0,r(e,b.left+b.width/2,b.top)},n)},[r,e,n]),y=D.useCallback(()=>{f(),c.current=!1,o()},[o]);return D.useEffect(()=>()=>{f(),c.current&&(c.current=!1,o())},[o]),D.useEffect(()=>{const b=()=>{c.current&&(f(),c.current=!1,o())};return document.addEventListener("click",b,!0),()=>document.removeEventListener("click",b,!0)},[o]),P.jsx("span",{ref:i,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onFocus:g,onBlur:y,className:"contents",children:t})}const Nee="";async function Fi(e,t){const n=`${Nee}${e}`;j2()&&await Sl();const r=ro(),o=r?{Authorization:`Bearer ${r}`}:{},s=await fetch(n,{...t,headers:{...o,...t==null?void 0:t.headers}});if(!s.ok)throw new Error(`Analytics API error: ${s.status} ${s.statusText}`);return s.json()}async function S3(e=!1){return Fi(`/api/analytics/topology${e?"?rebuild=true":""}`)}async function jee(){return Fi("/api/analytics/disambiguation")}async function Oee(e=168){return Fi(`/api/analytics/last_hop_neighbors?hours=${e}`)}async function $ee(e=168){return Fi(`/api/analytics/neighbor_affinity?hours=${e}`)}async function Uee(e=168){return Fi(`/api/analytics/mobile_nodes?hours=${e}`)}async function zee(e=20){return Fi(`/api/analytics/path_health?limit=${e}`)}async function Vee(e=24){return Fi(`/api/analytics/tx_recommendations?hours=${e}`)}async function Wee(e=168){return Fi(`/api/analytics/sparklines?hours=${e}`)}async function Hee(e){return Fi(`/api/analytics/bucketed_stats?preset=${e}`)}const eb={topology:6e4,neighbors:3e4,bucketedStats:3e4};let uw=[];Io((e,t)=>({backendAvailable:null,checkingBackend:!1,topology:null,topologyLoading:!1,topologyError:null,topologyLastUpdated:0,disambiguationStats:null,disambiguationLoading:!1,lastHopNeighbors:null,neighborsLoading:!1,neighborAffinity:null,affinityLoading:!1,mobileNodes:null,mobileLoading:!1,pathHealth:null,pathHealthLoading:!1,txRecommendation:null,txRecommendationLoading:!1,sparklines:new Map,sparklinesLoading:!1,sparklineHours:168,bucketedStats:null,bucketedStatsPreset:"1h",bucketedStatsLoading:!1,checkBackendAvailability:async()=>{e({checkingBackend:!0});try{const r=await S3(),o=r.success!==!1&&!r.error;return e({backendAvailable:o,checkingBackend:!1}),o}catch{return e({backendAvailable:!1,checkingBackend:!1}),!1}},fetchTopology:async(n=!1)=>{e({topologyLoading:!0,topologyError:null});try{const r=await S3(n);if(r.success===!1){e({topologyError:r.error||"Failed to fetch topology",topologyLoading:!1});return}e({topology:r||r,topologyLoading:!1,topologyLastUpdated:Date.now()})}catch(r){e({topologyError:r instanceof Error?r.message:"Failed to fetch topology",topologyLoading:!1})}},fetchDisambiguationStats:async()=>{e({disambiguationLoading:!0});try{const n=await jee();n.success!==!1?e({disambiguationStats:n,disambiguationLoading:!1}):e({disambiguationLoading:!1})}catch{e({disambiguationLoading:!1})}},fetchLastHopNeighbors:async(n=168)=>{e({neighborsLoading:!0});try{const r=await Oee(n);r.success!==!1?e({lastHopNeighbors:r,neighborsLoading:!1}):e({neighborsLoading:!1})}catch{e({neighborsLoading:!1})}},fetchNeighborAffinity:async(n=168)=>{e({affinityLoading:!0});try{const r=await $ee(n);r.success!==!1?e({neighborAffinity:r,affinityLoading:!1}):e({affinityLoading:!1})}catch{e({affinityLoading:!1})}},fetchMobileNodes:async(n=168)=>{e({mobileLoading:!0});try{const r=await Uee(n);r.success!==!1?e({mobileNodes:r,mobileLoading:!1}):e({mobileLoading:!1})}catch{e({mobileLoading:!1})}},fetchPathHealth:async(n=20)=>{e({pathHealthLoading:!0});try{const r=await zee(n);r.success!==!1?e({pathHealth:r.paths??[],pathHealthLoading:!1}):e({pathHealthLoading:!1})}catch{e({pathHealthLoading:!1})}},fetchTxRecommendation:async(n=24)=>{e({txRecommendationLoading:!0});try{const r=await Vee(n);r.success!==!1?e({txRecommendation:r,txRecommendationLoading:!1}):e({txRecommendationLoading:!1})}catch{e({txRecommendationLoading:!1})}},fetchSparklines:async(n=168)=>{e({sparklinesLoading:!0,sparklineHours:n});try{const r=await Wee(n);if(r.success!==!1){const o=r,s=new Map;if(o.sparklines)for(const[i,l]of Object.entries(o.sparklines))s.set(i,l);e({sparklines:s,sparklinesLoading:!1})}else e({sparklinesLoading:!1})}catch{e({sparklinesLoading:!1})}},fetchBucketedStats:async n=>{e({bucketedStatsLoading:!0,bucketedStatsPreset:n});try{const r=await Hee(n);r.success!==!1?e({bucketedStats:r,bucketedStatsLoading:!1}):e({bucketedStatsLoading:!1})}catch{e({bucketedStatsLoading:!1})}},initialize:async()=>{if(await t().checkBackendAvailability()&&(await Promise.all([t().fetchTopology(),t().fetchDisambiguationStats(),t().fetchLastHopNeighbors(),t().fetchMobileNodes(),t().fetchPathHealth(),t().fetchSparklines(),t().fetchBucketedStats("1h")]),typeof window<"u")){const r=setInterval(()=>{t().backendAvailable&&t().fetchTopology()},eb.topology),o=setInterval(()=>{t().backendAvailable&&t().fetchLastHopNeighbors()},eb.neighbors),s=setInterval(()=>{t().backendAvailable&&t().fetchBucketedStats(t().bucketedStatsPreset)},eb.bucketedStats);uw=[r,o,s]}},refreshAll:async()=>{const{backendAvailable:n}=t();n&&await Promise.all([t().fetchTopology(!0),t().fetchDisambiguationStats(),t().fetchLastHopNeighbors(),t().fetchNeighborAffinity(),t().fetchMobileNodes(),t().fetchPathHealth(),t().fetchTxRecommendation(),t().fetchSparklines(),t().fetchBucketedStats(t().bucketedStatsPreset)])}}));function qee(){for(const e of uw)clearInterval(e);uw=[]}function du({withControls:e=!1}){return P.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[P.jsx(Bt,{className:"h-7 w-40 sm:w-52"}),e&&P.jsx(Bt,{className:"h-8 w-48 sm:w-56 radius-inner"})]})}function Cs({className:e,children:t}){return P.jsx("div",{className:`bg-surface/80 radius-card depth-raised h-full flex flex-col p-4 sm:p-5 ${e??""}`,children:t})}const Gee=[45,72,33,58,80,42,65,28,55,75,38,62];function vE(){return P.jsx("div",{className:"flex-1 flex items-end gap-1",children:Gee.map((e,t)=>P.jsx(Bt,{className:"flex-1",style:{height:`${e}%`}},t))})}function Kee(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading dashboard","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-hero-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-36"})]}),P.jsx(vE,{})]})})}),P.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3].map(e=>P.jsx("div",{className:"col-span-6 lg:col-span-4",children:P.jsxs(Cs,{children:[P.jsx(Bt,{className:"h-4 w-24 mb-3"}),P.jsx(Bt,{className:"h-8 w-16"})]})},e))}),P.jsx("div",{className:"bento-row-widget grid-12 bento-gap",children:[1,2,3,4].map(e=>P.jsx("div",{className:"col-span-6 sm:col-span-4 md:col-span-3",children:P.jsxs(Cs,{children:[P.jsx(Bt,{className:"h-3 w-20 mb-2"}),P.jsx(Bt,{className:"h-6 w-12"})]})},e))})]})]})}function Ec(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading list","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{className:"!py-3",children:P.jsxs("div",{className:"flex gap-3",children:[P.jsx(Bt,{className:"h-8 w-28 radius-inner"}),P.jsx(Bt,{className:"h-8 w-28 radius-inner"}),P.jsx(Bt,{className:"h-8 w-28 radius-inner hidden sm:block"})]})})})}),P.jsx("div",{className:"bento-row-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{children:P.jsx("div",{className:"space-y-4",children:Array.from({length:8}).map((e,t)=>P.jsxs("div",{className:"flex items-center gap-4",children:[P.jsx(Bt,{className:"w-10 h-10 radius-inner shrink-0"}),P.jsxs("div",{className:"flex-1 space-y-2",children:[P.jsx(Bt,{className:"h-4 w-48"}),P.jsx(Bt,{className:"h-3 w-32"})]}),P.jsx(Bt,{className:"w-16 h-4 hidden sm:block"})]},t))})})})})]})]})}function Yee(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading map","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsx("div",{className:"bento-section",children:P.jsx("div",{className:"grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{className:"!min-h-[60vh]",children:P.jsx(Bt,{className:"flex-1 w-full radius-inset"})})})})})]})}function _3(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading charts","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-hero-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-32"})]}),P.jsx(vE,{})]})})}),P.jsx("div",{className:"bento-row-panel grid-12 bento-gap",children:[1,2].map(e=>P.jsx("div",{className:"col-span-12 md:col-span-6",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-28"})]}),P.jsx(Bt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function Qee(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading system","aria-busy":"true",children:[P.jsx(du,{withControls:!0}),P.jsxs("div",{className:"bento-section",children:[P.jsx("div",{className:"bento-row-hero grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsxs(Cs,{children:[P.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[P.jsx(Bt,{className:"w-5 h-5"}),P.jsx(Bt,{className:"h-4 w-36"})]}),P.jsx(vE,{})]})})}),P.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3,4].map(e=>P.jsx("div",{className:"col-span-12 sm:col-span-6",children:P.jsxs(Cs,{children:[P.jsx(Bt,{className:"h-4 w-28 mb-3"}),P.jsx(Bt,{className:"h-6 w-20 mb-2"}),P.jsx(Bt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function D3(){return P.jsxs("div",{className:"section-gap","aria-label":"Loading settings","aria-busy":"true",children:[P.jsx(du,{}),P.jsx("div",{className:"bento-section",children:P.jsx("div",{className:"bento-row-auto grid-12",children:P.jsx("div",{className:"col-span-full",children:P.jsx(Cs,{children:P.jsx("div",{className:"space-y-6",children:[.6,.8,.5,.7,.4].map((e,t)=>P.jsxs("div",{className:"space-y-2",children:[P.jsx(Bt,{className:"h-3 w-24"}),P.jsx(Bt,{className:"h-10 radius-inner",style:{width:`${e*100}%`}})]},t))})})})})})]})}const Xee=1024;function Po({children:e,fallback:t}){const[n,r]=D.useState(!1);return D.useEffect(()=>{let o=!1;const s=window.innerWidth{s?setTimeout(()=>{o||D.startTransition(()=>r(!0))},LW):requestAnimationFrame(()=>{o||D.startTransition(()=>r(!0))})}),()=>{o=!0}},[]),n?P.jsx(D.Suspense,{fallback:t,children:e}):P.jsx(P.Fragment,{children:t})}function Jee(e){e();const t=_l.getState().initialize(),n=Ks.getState().initialize(),r=kQ.getState().initialize();fS();const o=setInterval(()=>{fS()},3e4),s=mH();return()=>{t(),r(),n==null||n(),s(),clearInterval(o),gT(),qee()}}const Zee=D.lazy(()=>fr(()=>import("./Login-EFNGv6qi.js"),__vite__mapDeps([0,1]))),ete=D.lazy(()=>fr(()=>import("./Dashboard-6pffDPFe.js"),__vite__mapDeps([2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]))),tte=D.lazy(()=>fr(()=>import("./Packets-D9oGi0fh.js"),__vite__mapDeps([37,7,10,38,17,9,11,4,12,13,14,15,16,18,19,20,21,22,23,24,25,26,6,27,28,29,30,39,40,41,42,3]))),nte=D.lazy(()=>fr(()=>import("./Contacts-2Yx_cmAj.js").then(e=>e.C),__vite__mapDeps([43,30,7,44,3,45,38,17,28,16,4,13,14,46,47,19,40,48,20,12,18,49,23,50,51,42,52]))),rte=D.lazy(()=>fr(()=>import("./Statistics-Dzy8J7Q2.js"),__vite__mapDeps([53,21,4,54,28,16,17,3,20,5,6,46,47,19,40,22,31,23,39,7,18,41,42,30,36,55,49,52]))),ote=D.lazy(()=>fr(()=>import("./MeshGraph-V9pZlvEq.js").then(e=>e.M),__vite__mapDeps([56,57,4,12,19,25,20,8,48,21,42,58,55,16,49]))),ste=D.lazy(()=>fr(()=>import("./System-CNYv76nU.js"),__vite__mapDeps([59,3,19,15,49,23,60,61,36]))),ite=D.lazy(()=>fr(()=>import("./Logs-BT5P96Jv.js"),__vite__mapDeps([62,3,63]))),ate=D.lazy(()=>fr(()=>import("./Terminal-xFWzIyff.js"),__vite__mapDeps([64,44,65,1,3,66,67,58,42,16,68]))),lte=D.lazy(()=>fr(()=>import("./Configuration-DaPSiY3g.js"),__vite__mapDeps([69,65,51,19,33,3,20,67,50,36,70,71,72,24,60,16]))),cte=D.lazy(()=>fr(()=>import("./RoomServer-BWTs1Hn2.js"),__vite__mapDeps([73,3,36,7,45,38,17,71,50,66,67,51,19,34,13,74,72]))),ute=D.lazy(()=>fr(()=>import("./PacketObservatory-CGzUdg1y.js"),__vite__mapDeps([75,30,7,11]))),fte=D.lazy(()=>fr(()=>import("./Sessions-DpqaKj0P.js"),__vite__mapDeps([76,51,19,20,3,60,36,18,27,70,50]))),dte=D.lazy(()=>fr(()=>import("./Mqtt-DrmwIl2T.js"),__vite__mapDeps([77,3,45,38,17,55,71,10,29,42,16,22,41,63,50,35,61,36,74,78,19])));function hte({children:e}){const t=qs(),n=Tm();return D.useEffect(()=>(cH(n),()=>uH()),[n]),I2()?P.jsx(P.Fragment,{children:e}):P.jsx(i7,{to:"/login",state:{from:t},replace:!0})}class pte extends D.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){var t;return this.state.hasError?P.jsxs("div",{className:"surface-base rounded-2xl p-8 text-center",children:[P.jsx("p",{className:"type-subheading text-sys-red mb-2",children:"Page failed to render"}),P.jsx("p",{className:"type-body text-fg-muted mb-4",children:((t=this.state.error)==null?void 0:t.message)||"Unknown error"}),P.jsx("button",{onClick:()=>this.setState({hasError:!1}),className:"px-4 py-2 bg-sys-blue/20 text-sys-blue rounded-lg hover:bg-sys-blue/30 transition-colors",children:"Try Again"})]}):this.props.children}}function mte(){const e=dT(),t=I2();return D.useEffect(()=>{if(t)return Jee(e)},[e,t]),P.jsxs(Iee,{children:[P.jsx(Ree,{}),P.jsxs(Fx,{children:[P.jsx(Lr,{path:"/login",element:P.jsx(D.Suspense,{fallback:P.jsx("div",{className:"min-h-screen bg-body"}),children:P.jsx(Zee,{})})}),P.jsx(Lr,{path:"/*",element:P.jsx(hte,{children:P.jsx(NW,{sidebar:P.jsx(Pee,{}),navbar:P.jsx(Mee,{}),children:P.jsx("div",{className:"px-1 sm:px-4 lg:px-4 pt-5 pb-4 sm:pb-6 lg:pb-8 max-w-7xl mx-auto",children:P.jsx(pte,{children:P.jsxs(Fx,{children:[P.jsx(Lr,{path:"/",element:P.jsx(Po,{fallback:P.jsx(Kee,{}),children:P.jsx(ete,{})})}),P.jsx(Lr,{path:"/packets",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(tte,{})})}),P.jsx(Lr,{path:"/contacts",element:P.jsx(Po,{fallback:P.jsx(Yee,{}),children:P.jsx(nte,{})})}),P.jsx(Lr,{path:"/statistics",element:P.jsx(Po,{fallback:P.jsx(_3,{}),children:P.jsx(rte,{})})}),P.jsx(Lr,{path:"/meshgraph",element:P.jsx(Po,{fallback:P.jsx(_3,{}),children:P.jsx(ote,{})})}),P.jsx(Lr,{path:"/system",element:P.jsx(Po,{fallback:P.jsx(Qee,{}),children:P.jsx(ste,{})})}),P.jsx(Lr,{path:"/logs",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(ite,{})})}),P.jsx(Lr,{path:"/terminal",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(ate,{})})}),P.jsx(Lr,{path:"/room-server",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(cte,{})})}),P.jsx(Lr,{path:"/configuration",element:P.jsx(Po,{fallback:P.jsx(D3,{}),children:P.jsx(lte,{})})}),P.jsx(Lr,{path:"/raw",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(ute,{})})}),P.jsx(Lr,{path:"/sessions",element:P.jsx(Po,{fallback:P.jsx(D3,{}),children:P.jsx(fte,{})})}),P.jsx(Lr,{path:"/mqtt",element:P.jsx(Po,{fallback:P.jsx(Ec,{}),children:P.jsx(dte,{})})})]})})})})})})]})]})}const gte=console.warn;console.warn=(...e)=>{const t=e[0];typeof t=="string"&&t.includes("Unable to load glyph range")||gte.apply(console,e)};m9.createRoot(document.getElementById("root")).render(P.jsx(D.StrictMode,{children:P.jsx($R,{children:P.jsx(F7,{children:P.jsx(mte,{})})})}));export{qne as $,au as A,i0 as B,Qte as C,t2 as D,Sj as E,sH as F,cT as G,AY as H,e8 as I,DY as J,CY as K,Nj as L,Xj as M,Hte as N,CT as O,WY as P,$Y as Q,rO as R,EO as S,Gte as T,yre as U,pT as V,Dl as W,Uq as X,$q as Y,ht as Z,fr as _,Ute as a,od as a$,yQ as a0,Yne as a1,xQ as a2,Gne as a3,Kne as a4,Hne as a5,DX as a6,qY as a7,Or as a8,Nre as a9,rI as aA,rs as aB,xD as aC,iI as aD,CI as aE,LD as aF,Fn as aG,nd as aH,Ow as aI,oo as aJ,kD as aK,Da as aL,Ww as aM,ws as aN,Xc as aO,ya as aP,zw as aQ,pD as aR,ed as aS,Zf as aT,vo as aU,xl as aV,qn as aW,Vs as aX,td as aY,FD as aZ,Vw as a_,Bt as aa,Vte as ab,yO as ac,jr as ad,gK as ae,hK as af,pK as ag,e1 as ah,yK as ai,lre as aj,QY as ak,RS as al,Ite as am,jte as an,Db as ao,kY as ap,rQ as aq,tE as ar,wm as as,cO as at,Ft as au,TD as av,bL as aw,cD as ax,no as ay,Fl as az,x0 as b,Fte as b$,PD as b0,Jr as b1,pI as b2,BI as b3,hI as b4,BD as b5,it as b6,KI as b7,Bl as b8,Gs as b9,zne as bA,tT as bB,One as bC,Lte as bD,Bne as bE,Pne as bF,dV as bG,q2 as bH,ure as bI,X2 as bJ,Fne as bK,sO as bL,sQ as bM,Vne as bN,f5 as bO,Tre as bP,fre as bQ,Dq as bR,sne as bS,rne as bT,pne as bU,dK as bV,Bte as bW,mre as bX,yo as bY,dne as bZ,mne as b_,Pk as ba,nu as bb,tD as bc,eD as bd,kI as be,gD as bf,MD as bg,aD as bh,zc as bi,AO as bj,tj as bk,Ste as bl,_te as bm,Uj as bn,f6 as bo,CU as bp,yU as bq,n2 as br,r2 as bs,Tte as bt,Gf as bu,nK as bv,dre as bw,Zte as bx,Jte as by,a6 as bz,He as c,Yj as c$,Gj as c0,xO as c1,vm as c2,UY as c3,tne as c4,nne as c5,ane as c6,lne as c7,Jne as c8,iQ as c9,tN as cA,Lc as cB,sf as cC,kb as cD,mi as cE,Of as cF,Vc as cG,kl as cH,RD as cI,bD as cJ,dD as cK,Ate as cL,qI as cM,UD as cN,ZI as cO,Ok as cP,js as cQ,bI as cR,SD as cS,Ire as cT,pq as cU,one as cV,FQ as cW,t8 as cX,Nne as cY,ff as cZ,Une as c_,rj as ca,nj as cb,gQ as cc,YX as cd,Cq as ce,Pre as cf,Dte as cg,bre as ch,_O as ci,vte as cj,Dre as ck,wre as cl,Ere as cm,Fre as cn,kK as co,fne as cp,hne as cq,Mj as cr,qte as cs,vK as ct,CK as cu,Lne as cv,$te as cw,AD as cx,X_ as cy,$w as cz,Yt as d,pre as d$,ene as d0,yne as d1,gne as d2,vne as d3,bne as d4,cne as d5,ine as d6,Qne as d7,Re as d8,TO as d9,qq as dA,Sne as dB,Kq as dC,Gq as dD,fK as dE,Rt as dF,Qq as dG,tG as dH,iG as dI,yq as dJ,Nte as dK,SW as dL,AW as dM,JD as dN,am as dO,Zw as dP,gq as dQ,hH as dR,_l as dS,Lt as dT,j_ as dU,ww as dV,Ep as dW,nQ as dX,aO as dY,mO as dZ,hre as d_,Zj as da,tO as db,cre as dc,Jm as dd,Kte as de,Bre as df,Dj as dg,bte as dh,jK as di,$K as dj,zK as dk,UK as dl,zQ as dm,zq as dn,SY as dp,_Y as dq,MY as dr,RY as ds,eE as dt,Fj as du,zte as dv,_K as dw,oE as dx,gm as dy,Y2 as dz,Io as e,xre as e$,Yte as e0,ru as e1,Ote as e2,Ks as e3,Tne as e4,ere as e5,tre as e6,ire as e7,are as e8,nre as e9,Xne as eA,fn as eB,uT as eC,tK as eD,JH as eE,XG as eF,aK as eG,uK as eH,$ne as eI,Ine as eJ,_ne as eK,Dne as eL,Es as eM,fee as eN,Lre as eO,Mre as eP,Rre as eQ,xte as eR,sD as eS,kte as eT,Lh as eU,IL as eV,bx as eW,J4 as eX,_re as eY,vre as eZ,Pt as e_,rre as ea,ore as eb,sre as ec,UH as ed,zH as ee,KH as ef,VH as eg,hQ as eh,NH as ei,jH as ej,OH as ek,jne as el,Wne as em,qW as en,GW as eo,KW as ep,Qr as eq,og as er,sg as es,Z2 as et,KG as eu,ud as ev,hq as ew,Ene as ex,Cne as ey,xne as ez,I8 as f,kre as f0,Cre as f1,wne as f2,fd as f3,nE as f4,Sre as f5,YK as f6,_m as f7,Zne as f8,PQ as f9,Q6 as fA,um as fB,Pte as fC,Rte as fD,IO as fE,Rz as fF,a9 as fG,Mne as fH,Rne as fI,yT as fJ,kne as fa,HY as fb,vG as fc,ad as fd,NO as fe,GU as ff,cr as fg,gV as fh,P2 as fi,Hc as fj,MU as fk,jn as fl,s2 as fm,Nr as fn,k$ as fo,h$ as fp,x$ as fq,V6 as fr,Ei as fs,Uf as ft,i4 as fu,OU as fv,cz as fw,rz as fx,WU as fy,Bz as fz,o8 as g,kq as h,I2 as i,P as j,Are as k,Xte as l,to as m,gre as n,Sa as o,On as p,EK as q,D as r,dH as s,rE as t,Tm as u,Wte as v,zW as w,hj as x,une as y,Ane as z}; diff --git a/frontend/dist/assets/index-CPifxb0-.js b/frontend/dist/assets/index-WiXmWhPS.js similarity index 99% rename from frontend/dist/assets/index-CPifxb0-.js rename to frontend/dist/assets/index-WiXmWhPS.js index c849eb84..b24708ca 100644 --- a/frontend/dist/assets/index-CPifxb0-.js +++ b/frontend/dist/assets/index-WiXmWhPS.js @@ -1 +1 @@ -import{fe as ve,ff as Ae,fg as we,fh as Ee,r as l,fi as B,br as oe,j as S,fj as je,fk as Ie,fl as De,fm as Me,fn as le,fo as ke,fp as Re,fq as $e,fr as Ce,fs as Ve,ft as Ne,fu as Te,fv as We,fw as Le,fx as Pe,fy as _,fz as Oe,fA as Be,fB as Fe,m as k,fC as Ge,fD as ue,A as ce,bG as Ke,fE as ze,fF as _e}from"./index-CvSa8h-C.js";const He=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function fe(t,e){return ve(t)?t[He(0,t.length,e)]:t}class Xe{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;ii.attachTimeline(e));return()=>{n.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ne(this.animations,"duration")}get iterationDuration(){return ne(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ne(t,e){let n=0;for(let i=0;in&&(n=r)}return n}class Ye extends Xe{then(e,n){return this.finished.finally(e).then(()=>{})}}function qe(t,e){return t in e}class Je extends Ae{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(qe(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return we()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function Ue({children:t,isValidProp:e,...n}){e&&Ee(e),n={...l.useContext(B),...n},n.isStatic=oe(()=>n.isStatic);const i=l.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return S.jsx(B.Provider,{value:i,children:t})}function Qe(t){const e=oe(()=>je(t)),{isStatic:n}=l.useContext(B);if(n){const[,i]=l.useState(t);l.useEffect(()=>e.on("change",i),[])}return e}function q(t){return typeof t=="object"&&!Array.isArray(t)}function de(t,e,n,i){return t==null?[]:typeof t=="string"&&q(e)?Ie(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(r=>r!=null):[t]}function Ze(t,e,n){return t*(e+1)}function ie(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function et(t,e,n){for(let i=0;ie&&r.at{const v=at(A),{delay:C=0,times:E=ke(v),type:W=e.type||"keyframes",repeat:N,repeatType:X,repeatDelay:$t=0,...be}=j;let{ease:V=e.ease||"easeOut",duration:R}=j;const J=typeof C=="function"?C(M,$):C,U=v.length,Q=Ce(W)?W:r==null?void 0:r[W||"keyframes"];if(U<=2&&Q){let L=100;if(U===2&&ut(v)){const P=v[1]-v[0];L=Math.abs(P)}const F={...e,...be};R!==void 0&&(F.duration=Ve(R));const G=Re(F,L,Q);V=G.ease,R=G.duration}R??(R=y);const Z=p+J;E.length===1&&E[0]===0&&(E[1]=1);const ee=E.length-v.length;if(ee>0&&$e(E,ee),v.length===1&&v.unshift(null),N){R=Ze(R,N);const L=[...v],F=[...E];V=Array.isArray(V)?[...V]:[V];const G=[...V];for(let P=0;P{for(const c in x){const f=x[c];f.sort(it);const s=[],a=[],w=[];for(let M=0;Mtypeof t=="number",ut=t=>t.every(lt);function ct(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Te(t)&&!We(t)?new Le(e):new Pe(e);n.mount(t),_.set(t,n)}function ft(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Je(e);n.mount(t),_.set(t,n)}function dt(t,e){return le(t)||typeof t=="number"||typeof t=="string"&&!q(e)}function pe(t,e,n,i){const r=[];if(dt(t,e))r.push(Oe(t,q(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return r;const y=de(t,e,i),u=y.length;for(let g=0;g{i.push(...pe(g,y,u))}),i}function mt(t){return Array.isArray(t)&&t.some(Array.isArray)}function yt(t){function e(n,i,r){let y=[],u;if(mt(n))y=pt(n,i,t);else{const{onComplete:o,...h}=r||{};typeof o=="function"&&(u=o),y=pe(n,i,h,t)}const g=new Ye(y);return u&&g.finished.then(u),g}return e}const me=yt(),I="var(--mask-height, 0.15em)",Y="var(--mask-width, 0.5em)",T=`calc(${Y} / var(--invert-x, 1))`,K="#000 0, transparent 71%",ht=`linear-gradient(to right, transparent 0, #000 ${T}, #000 calc(100% - ${T}), transparent),linear-gradient(to bottom, transparent 0, #000 ${I}, #000 calc(100% - ${I}), transparent 100%),radial-gradient(at bottom right, ${K}),radial-gradient(at bottom left, ${K}), radial-gradient(at top left, ${K}), radial-gradient(at top right, ${K})`,gt=`100% calc(100% - ${I} * 2),calc(100% - ${T} * 2) 100%,${T} ${I},${T} ${I},${T} ${I},${T} ${I}`;Ge({"--invert-x":{correct:(t,{treeScale:e,projectionDelta:n})=>n.x.scale*e.x}});function xt({children:t,layoutDependency:e}){return S.jsx(k.span,{layout:!0,layoutDependency:e,"aria-hidden":!0,style:{display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${Y})`,padding:`calc(${I}/2) ${Y}`,position:"relative",zIndex:-1,overflow:"clip",WebkitMaskImage:ht,WebkitMaskSize:gt,WebkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",WebkitMaskRepeat:"no-repeat"},children:t})}function ye(){const t=l.useRef(!0);return l.useEffect(()=>{t.current=!1},[]),t.current}function H(t){const{width:e,fontSize:n}=getComputedStyle(t);return`${parseFloat(e)/parseFloat(n)}em`}const he=new WeakMap,St=l.forwardRef(function({value:e,initialValue:n=e,...i},r){const{transition:y}=l.useContext(B),u=l.useRef(n).current,g=ye(),o=l.useRef(null),h=l.useRef(null);l.useImperativeHandle(r,()=>h.current,[]);const b=l.useRef(new Array(10)),p=ue(),m=p?e:0;l.useLayoutEffect(()=>{!o.current||!b.current[u]||(o.current.style.width=H(b.current[u]))},[]);const x=l.useRef(n);l.useLayoutEffect(()=>{var A;if(!o.current||m===x.current)return;const s=o.current.getBoundingClientRect(),a=(A=h.current)==null?void 0:A.getBoundingClientRect(),w=s.height*(m-x.current)+(s.top-(a?a.top||0:s.top));return me(o.current,{y:[w,0]},y),()=>{x.current=m}},[m]);const[d,c]=l.useState();l.useEffect(()=>{if(g&&u===m||!b.current[m])return;const s=H(b.current[m]);h.current&&he.set(h.current,s),c(s)},[m]);const f=s=>S.jsx("span",{style:{display:"inline-block",padding:`calc(${I}/2) 0`},ref:a=>void(b.current[s]=a),children:s},s);return S.jsx(k.span,{...i,ref:h,layout:"position","data-state":p?void 0:"exiting",style:{display:"inline-flex",justifyContent:"center",width:d},children:S.jsxs("span",{ref:o,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"},children:[m!==0&&S.jsx("span",{style:{...ae,bottom:"100%",left:0},children:new Array(m).fill(null).map((s,a)=>f(a))}),f(m),m!==9&&S.jsx("span",{style:{...ae,top:"100%",left:0},children:new Array(9-m).fill(null).map((s,a)=>f(m+a+1))})]})})}),ae={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"},ge=l.createContext({justify:"left"}),bt=l.forwardRef(function({partKey:e,type:n,children:i,layoutDependency:r,...y},u){const g=ue(),{justify:o}=l.useContext(ge);return S.jsx(k.span,{...y,"data-state":g?void 0:"exiting",style:{display:"inline-flex",justifyContent:o,padding:`calc(${I}/2) 0`,position:"relative"},layout:"position",layoutDependency:r,ref:u,children:S.jsx(ce,{mode:"popLayout",anchorX:o,initial:!1,children:S.jsx(k.span,{layout:o==="right"?"position":!1,layoutDependency:r,initial:{opacity:0},animate:{opacity:[null,1]},exit:{opacity:[null,0]},style:{display:"inline-block",whiteSpace:"pre"},children:i},i)})})}),z=l.forwardRef(function({parts:e,justify:n="left",mode:i,style:r,name:y,layoutDependency:u,...g},o){const h=l.useRef(null);l.useImperativeHandle(o,()=>h.current,[]);const b=l.useMemo(()=>({justify:n}),[n]),p=l.useRef(null),m=ye(),[x,d]=l.useState();return l.useEffect(()=>{if(!p.current)return;if(m){h.current&&(h.current.style.width=H(p.current));return}const c=Array.from(p.current.children).map(f=>{if(!(f instanceof HTMLElement))return;if(f.dataset.state==="exiting"){const w=f.nextSibling;return f.remove(),()=>{p.current&&p.current.insertBefore(f,w)}}const s=he.get(f);if(!s)return;const a=f.style.width;return f.style.width=s,()=>{f.style.width=a}});d(H(p.current));for(let f=c.length-1;f>=0;f--){const s=c[f];s&&s()}},[e.map(c=>c.value).join("")]),S.jsx(ge.Provider,{value:b,children:S.jsx(k.span,{layoutDependency:u,...g,ref:h,className:`number-section-${y}`,style:{...r,display:"inline-flex",justifyContent:n,width:x},children:S.jsxs("span",{ref:p,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"},children:["​",S.jsx(ce,{mode:i,anchorX:n,initial:!1,children:e.map(c=>c.type==="integer"||c.type==="fraction"?S.jsx(St,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:c.value,initialValue:m?void 0:0,layoutDependency:u},c.key):S.jsx(bt,{type:c.type,partKey:c.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},layoutDependency:u,children:c.value},c.type==="literal"?`${c.key}:${c.value}`:c.key))})]})})})}),vt=(t,{locales:e,format:n},i,r)=>{const u=new Intl.NumberFormat(e,n).formatToParts(Number(t));i&&u.unshift({type:"prefix",value:i}),r&&u.push({type:"suffix",value:r});const g=[],o=[],h=[],b=[],p={},m=s=>`${s}:${p[s]=(p[s]??-1)+1}`;let x="",d=!1,c=!1;for(const s of u){x+=s.value;const a=s.type==="minusSign"||s.type==="plusSign"?"sign":s.type;switch(a){case"integer":d=!0,o.push(...s.value.split("").map(w=>({type:a,value:parseInt(w)})));break;case"group":o.push({type:a,value:s.value});break;case"decimal":c=!0,h.push({type:a,value:s.value,key:m(a)});break;case"fraction":h.push(...s.value.split("").map(w=>({type:a,value:parseInt(w),key:m(a)})));break;default:(d||c?b:g).push({type:a,value:s.value,key:m(a)})}}const f=[];for(let s=o.length-1;s>=0;s--)f.unshift({...o[s],key:m(o[s].type)});return{pre:g,integer:f,fraction:h,post:b,formatted:x}},At={opacity:{duration:1,ease:ze},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},Vt=l.forwardRef(function({children:e,locales:n,format:i,transition:r,style:y,suffix:u,prefix:g,...o},h){const b=l.useMemo(()=>vt(e,{locales:n,format:i},g,u),[e,n,i]),{pre:p,integer:m,fraction:x,post:d,formatted:c}=b,f=l.useContext(B).transition;r=r??f??At;const{layoutDependency:s}=o,a=l.useMemo(()=>{if(s!==void 0)return{layoutDependency:s,value:e}},[s,e]);return S.jsx(Ke,{children:S.jsx(Ue,{transition:r,children:S.jsx(k.div,{...o,ref:h,layout:!0,layoutDependency:a,style:{lineHeight:1,...y,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"},children:S.jsxs(k.div,{layout:!0,layoutDependency:a,"aria-label":c,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1},children:[S.jsx(z,{style:{padding:`calc(${I}/2) 0`},layoutDependency:a,"aria-hidden":!0,justify:"right",mode:"popLayout",parts:p,name:"pre"}),S.jsxs(xt,{layoutDependency:a,children:[S.jsx(z,{layoutDependency:a,justify:"right",parts:m,name:"integer"}),S.jsx(z,{layout:"position",layoutDependency:a,parts:x,name:"fraction"})]}),S.jsx(z,{style:{padding:`calc(${I}/2) 0`},"aria-hidden":!0,layout:"position",layoutDependency:a,mode:"popLayout",parts:d,name:"post"})]})})})})});k.create(l.Fragment);function xe(t,e){return t.length>e.length||t.length>0&&!e.startsWith(t)}function Se(t,e,n){return t+(e-t)*n}function wt(t,e,n,i,r){if(xe(e,t))return n*r;if(i==="natural")return Et(t,e,n);if(typeof i=="number"&&i>0){const y=n*(i/100);return n+Se(-y,y,Math.random())}return n}function Et(t,e,n){const i=e.length,r=t[i],y=t[i-1];if(!r)return n;const g=t.slice(0,i).lastIndexOf(" "),o=i-g-1,h=g+1,p=t.slice(i).indexOf(" "),x=(p===-1?t.length:i+p)-h;let d=1;if(y&&/[.!?]/.test(y)&&r===" "&&(d*=3),x<=3?d*=.7:(o===0&&r!==" "&&(d*=1.5),o===x-1&&(d*=1.4)),o>0&&o3){const a=Math.min(o/x,.4);d*=1-a}jt.has(r)&&(d*=1.5),It.has(r)&&(d*=1.5),/\d/.test(r)&&(d*=1.3),x>8&&(d*=1.3),r!==r.toLowerCase()&&(d*=1.25);const c=200;if(i>c){const a=Math.min((i-c)/1e3,.3);d*=1+a}const f=Se(-.25,.25,Math.random());d*=1+f;const s=n*d;return Math.max(n*.2,s)}const jt=new Set([".",",","!","?",":",";","'",'"',"-","(",")"]),It=new Set(["!","@","#","$","%","^","&","*","(",")","_","+","{","}","|",":",'"',"<",">","?"]);function Dt(t,e){let n=e-1;for(;n>=0&&/\s/.test(t[n]);)n--;for(;n>=0&&!/\s/.test(t[n]);)n--;return Math.max(0,n+1)}function Mt(t,e){const n=Math.min(t.length,e.length);let i=0;for(let r=0;r{var E;(E=j.current)==null||E.call(j),j.current=null},C=()=>{D.current=me(M.current,{opacity:[1,1,0,0]},{duration:g,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"})};return l.useEffect(()=>{x==="all"&&e!==w.current&&A.set(""),w.current=e},[e,x]),l.useEffect(()=>{var N;if(!h){C(),v();return}(N=D.current)==null||N.cancel();const E=()=>{const X=kt(A.get(),e,x,d);A.set(X),X!==e?W():(C(),o==null||o())},W=()=>{j.current=_e(E,wt(e,A.get(),$,r,c))};return j.current||W(),v},[h,o,e,$,r,c,d]),S.jsxs(a,{ref:s,...f,"aria-label":b||e,children:[S.jsx(k.span,{className:p,style:m,children:A}),S.jsx(k.span,{ref:M,className:y,style:{display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...u}})]})});export{Vt as A}; +import{fe as ve,ff as Ae,fg as we,fh as Ee,r as l,fi as B,br as oe,j as S,fj as je,fk as Ie,fl as De,fm as Me,fn as le,fo as ke,fp as Re,fq as $e,fr as Ce,fs as Ve,ft as Ne,fu as Te,fv as We,fw as Le,fx as Pe,fy as _,fz as Oe,fA as Be,fB as Fe,m as k,fC as Ge,fD as ue,A as ce,bG as Ke,fE as ze,fF as _e}from"./index-WhzslczH.js";const He=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function fe(t,e){return ve(t)?t[He(0,t.length,e)]:t}class Xe{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let i=0;ii.attachTimeline(e));return()=>{n.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ne(this.animations,"duration")}get iterationDuration(){return ne(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ne(t,e){let n=0;for(let i=0;in&&(n=r)}return n}class Ye extends Xe{then(e,n){return this.finished.finally(e).then(()=>{})}}function qe(t,e){return t in e}class Je extends Ae{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(qe(n,e)){const i=e[n];if(typeof i=="string"||typeof i=="number")return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,n){delete n.output[e]}measureInstanceViewportBox(){return we()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function Ue({children:t,isValidProp:e,...n}){e&&Ee(e),n={...l.useContext(B),...n},n.isStatic=oe(()=>n.isStatic);const i=l.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return S.jsx(B.Provider,{value:i,children:t})}function Qe(t){const e=oe(()=>je(t)),{isStatic:n}=l.useContext(B);if(n){const[,i]=l.useState(t);l.useEffect(()=>e.on("change",i),[])}return e}function q(t){return typeof t=="object"&&!Array.isArray(t)}function de(t,e,n,i){return t==null?[]:typeof t=="string"&&q(e)?Ie(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(r=>r!=null):[t]}function Ze(t,e,n){return t*(e+1)}function ie(t,e,n,i){return typeof e=="number"?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):e==="<"?n:e.startsWith("<")?Math.max(0,n+parseFloat(e.slice(1))):i.get(e)??t}function et(t,e,n){for(let i=0;ie&&r.at{const v=at(A),{delay:C=0,times:E=ke(v),type:W=e.type||"keyframes",repeat:N,repeatType:X,repeatDelay:$t=0,...be}=j;let{ease:V=e.ease||"easeOut",duration:R}=j;const J=typeof C=="function"?C(M,$):C,U=v.length,Q=Ce(W)?W:r==null?void 0:r[W||"keyframes"];if(U<=2&&Q){let L=100;if(U===2&&ut(v)){const P=v[1]-v[0];L=Math.abs(P)}const F={...e,...be};R!==void 0&&(F.duration=Ve(R));const G=Re(F,L,Q);V=G.ease,R=G.duration}R??(R=y);const Z=p+J;E.length===1&&E[0]===0&&(E[1]=1);const ee=E.length-v.length;if(ee>0&&$e(E,ee),v.length===1&&v.unshift(null),N){R=Ze(R,N);const L=[...v],F=[...E];V=Array.isArray(V)?[...V]:[V];const G=[...V];for(let P=0;P{for(const c in x){const f=x[c];f.sort(it);const s=[],a=[],w=[];for(let M=0;Mtypeof t=="number",ut=t=>t.every(lt);function ct(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=Te(t)&&!We(t)?new Le(e):new Pe(e);n.mount(t),_.set(t,n)}function ft(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Je(e);n.mount(t),_.set(t,n)}function dt(t,e){return le(t)||typeof t=="number"||typeof t=="string"&&!q(e)}function pe(t,e,n,i){const r=[];if(dt(t,e))r.push(Oe(t,q(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return r;const y=de(t,e,i),u=y.length;for(let g=0;g{i.push(...pe(g,y,u))}),i}function mt(t){return Array.isArray(t)&&t.some(Array.isArray)}function yt(t){function e(n,i,r){let y=[],u;if(mt(n))y=pt(n,i,t);else{const{onComplete:o,...h}=r||{};typeof o=="function"&&(u=o),y=pe(n,i,h,t)}const g=new Ye(y);return u&&g.finished.then(u),g}return e}const me=yt(),I="var(--mask-height, 0.15em)",Y="var(--mask-width, 0.5em)",T=`calc(${Y} / var(--invert-x, 1))`,K="#000 0, transparent 71%",ht=`linear-gradient(to right, transparent 0, #000 ${T}, #000 calc(100% - ${T}), transparent),linear-gradient(to bottom, transparent 0, #000 ${I}, #000 calc(100% - ${I}), transparent 100%),radial-gradient(at bottom right, ${K}),radial-gradient(at bottom left, ${K}), radial-gradient(at top left, ${K}), radial-gradient(at top right, ${K})`,gt=`100% calc(100% - ${I} * 2),calc(100% - ${T} * 2) 100%,${T} ${I},${T} ${I},${T} ${I},${T} ${I}`;Ge({"--invert-x":{correct:(t,{treeScale:e,projectionDelta:n})=>n.x.scale*e.x}});function xt({children:t,layoutDependency:e}){return S.jsx(k.span,{layout:!0,layoutDependency:e,"aria-hidden":!0,style:{display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${Y})`,padding:`calc(${I}/2) ${Y}`,position:"relative",zIndex:-1,overflow:"clip",WebkitMaskImage:ht,WebkitMaskSize:gt,WebkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",WebkitMaskRepeat:"no-repeat"},children:t})}function ye(){const t=l.useRef(!0);return l.useEffect(()=>{t.current=!1},[]),t.current}function H(t){const{width:e,fontSize:n}=getComputedStyle(t);return`${parseFloat(e)/parseFloat(n)}em`}const he=new WeakMap,St=l.forwardRef(function({value:e,initialValue:n=e,...i},r){const{transition:y}=l.useContext(B),u=l.useRef(n).current,g=ye(),o=l.useRef(null),h=l.useRef(null);l.useImperativeHandle(r,()=>h.current,[]);const b=l.useRef(new Array(10)),p=ue(),m=p?e:0;l.useLayoutEffect(()=>{!o.current||!b.current[u]||(o.current.style.width=H(b.current[u]))},[]);const x=l.useRef(n);l.useLayoutEffect(()=>{var A;if(!o.current||m===x.current)return;const s=o.current.getBoundingClientRect(),a=(A=h.current)==null?void 0:A.getBoundingClientRect(),w=s.height*(m-x.current)+(s.top-(a?a.top||0:s.top));return me(o.current,{y:[w,0]},y),()=>{x.current=m}},[m]);const[d,c]=l.useState();l.useEffect(()=>{if(g&&u===m||!b.current[m])return;const s=H(b.current[m]);h.current&&he.set(h.current,s),c(s)},[m]);const f=s=>S.jsx("span",{style:{display:"inline-block",padding:`calc(${I}/2) 0`},ref:a=>void(b.current[s]=a),children:s},s);return S.jsx(k.span,{...i,ref:h,layout:"position","data-state":p?void 0:"exiting",style:{display:"inline-flex",justifyContent:"center",width:d},children:S.jsxs("span",{ref:o,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"},children:[m!==0&&S.jsx("span",{style:{...ae,bottom:"100%",left:0},children:new Array(m).fill(null).map((s,a)=>f(a))}),f(m),m!==9&&S.jsx("span",{style:{...ae,top:"100%",left:0},children:new Array(9-m).fill(null).map((s,a)=>f(m+a+1))})]})})}),ae={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"},ge=l.createContext({justify:"left"}),bt=l.forwardRef(function({partKey:e,type:n,children:i,layoutDependency:r,...y},u){const g=ue(),{justify:o}=l.useContext(ge);return S.jsx(k.span,{...y,"data-state":g?void 0:"exiting",style:{display:"inline-flex",justifyContent:o,padding:`calc(${I}/2) 0`,position:"relative"},layout:"position",layoutDependency:r,ref:u,children:S.jsx(ce,{mode:"popLayout",anchorX:o,initial:!1,children:S.jsx(k.span,{layout:o==="right"?"position":!1,layoutDependency:r,initial:{opacity:0},animate:{opacity:[null,1]},exit:{opacity:[null,0]},style:{display:"inline-block",whiteSpace:"pre"},children:i},i)})})}),z=l.forwardRef(function({parts:e,justify:n="left",mode:i,style:r,name:y,layoutDependency:u,...g},o){const h=l.useRef(null);l.useImperativeHandle(o,()=>h.current,[]);const b=l.useMemo(()=>({justify:n}),[n]),p=l.useRef(null),m=ye(),[x,d]=l.useState();return l.useEffect(()=>{if(!p.current)return;if(m){h.current&&(h.current.style.width=H(p.current));return}const c=Array.from(p.current.children).map(f=>{if(!(f instanceof HTMLElement))return;if(f.dataset.state==="exiting"){const w=f.nextSibling;return f.remove(),()=>{p.current&&p.current.insertBefore(f,w)}}const s=he.get(f);if(!s)return;const a=f.style.width;return f.style.width=s,()=>{f.style.width=a}});d(H(p.current));for(let f=c.length-1;f>=0;f--){const s=c[f];s&&s()}},[e.map(c=>c.value).join("")]),S.jsx(ge.Provider,{value:b,children:S.jsx(k.span,{layoutDependency:u,...g,ref:h,className:`number-section-${y}`,style:{...r,display:"inline-flex",justifyContent:n,width:x},children:S.jsxs("span",{ref:p,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"},children:["​",S.jsx(ce,{mode:i,anchorX:n,initial:!1,children:e.map(c=>c.type==="integer"||c.type==="fraction"?S.jsx(St,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:c.value,initialValue:m?void 0:0,layoutDependency:u},c.key):S.jsx(bt,{type:c.type,partKey:c.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},layoutDependency:u,children:c.value},c.type==="literal"?`${c.key}:${c.value}`:c.key))})]})})})}),vt=(t,{locales:e,format:n},i,r)=>{const u=new Intl.NumberFormat(e,n).formatToParts(Number(t));i&&u.unshift({type:"prefix",value:i}),r&&u.push({type:"suffix",value:r});const g=[],o=[],h=[],b=[],p={},m=s=>`${s}:${p[s]=(p[s]??-1)+1}`;let x="",d=!1,c=!1;for(const s of u){x+=s.value;const a=s.type==="minusSign"||s.type==="plusSign"?"sign":s.type;switch(a){case"integer":d=!0,o.push(...s.value.split("").map(w=>({type:a,value:parseInt(w)})));break;case"group":o.push({type:a,value:s.value});break;case"decimal":c=!0,h.push({type:a,value:s.value,key:m(a)});break;case"fraction":h.push(...s.value.split("").map(w=>({type:a,value:parseInt(w),key:m(a)})));break;default:(d||c?b:g).push({type:a,value:s.value,key:m(a)})}}const f=[];for(let s=o.length-1;s>=0;s--)f.unshift({...o[s],key:m(o[s].type)});return{pre:g,integer:f,fraction:h,post:b,formatted:x}},At={opacity:{duration:1,ease:ze},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},Vt=l.forwardRef(function({children:e,locales:n,format:i,transition:r,style:y,suffix:u,prefix:g,...o},h){const b=l.useMemo(()=>vt(e,{locales:n,format:i},g,u),[e,n,i]),{pre:p,integer:m,fraction:x,post:d,formatted:c}=b,f=l.useContext(B).transition;r=r??f??At;const{layoutDependency:s}=o,a=l.useMemo(()=>{if(s!==void 0)return{layoutDependency:s,value:e}},[s,e]);return S.jsx(Ke,{children:S.jsx(Ue,{transition:r,children:S.jsx(k.div,{...o,ref:h,layout:!0,layoutDependency:a,style:{lineHeight:1,...y,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"},children:S.jsxs(k.div,{layout:!0,layoutDependency:a,"aria-label":c,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1},children:[S.jsx(z,{style:{padding:`calc(${I}/2) 0`},layoutDependency:a,"aria-hidden":!0,justify:"right",mode:"popLayout",parts:p,name:"pre"}),S.jsxs(xt,{layoutDependency:a,children:[S.jsx(z,{layoutDependency:a,justify:"right",parts:m,name:"integer"}),S.jsx(z,{layout:"position",layoutDependency:a,parts:x,name:"fraction"})]}),S.jsx(z,{style:{padding:`calc(${I}/2) 0`},"aria-hidden":!0,layout:"position",layoutDependency:a,mode:"popLayout",parts:d,name:"post"})]})})})})});k.create(l.Fragment);function xe(t,e){return t.length>e.length||t.length>0&&!e.startsWith(t)}function Se(t,e,n){return t+(e-t)*n}function wt(t,e,n,i,r){if(xe(e,t))return n*r;if(i==="natural")return Et(t,e,n);if(typeof i=="number"&&i>0){const y=n*(i/100);return n+Se(-y,y,Math.random())}return n}function Et(t,e,n){const i=e.length,r=t[i],y=t[i-1];if(!r)return n;const g=t.slice(0,i).lastIndexOf(" "),o=i-g-1,h=g+1,p=t.slice(i).indexOf(" "),x=(p===-1?t.length:i+p)-h;let d=1;if(y&&/[.!?]/.test(y)&&r===" "&&(d*=3),x<=3?d*=.7:(o===0&&r!==" "&&(d*=1.5),o===x-1&&(d*=1.4)),o>0&&o3){const a=Math.min(o/x,.4);d*=1-a}jt.has(r)&&(d*=1.5),It.has(r)&&(d*=1.5),/\d/.test(r)&&(d*=1.3),x>8&&(d*=1.3),r!==r.toLowerCase()&&(d*=1.25);const c=200;if(i>c){const a=Math.min((i-c)/1e3,.3);d*=1+a}const f=Se(-.25,.25,Math.random());d*=1+f;const s=n*d;return Math.max(n*.2,s)}const jt=new Set([".",",","!","?",":",";","'",'"',"-","(",")"]),It=new Set(["!","@","#","$","%","^","&","*","(",")","_","+","{","}","|",":",'"',"<",">","?"]);function Dt(t,e){let n=e-1;for(;n>=0&&/\s/.test(t[n]);)n--;for(;n>=0&&!/\s/.test(t[n]);)n--;return Math.max(0,n+1)}function Mt(t,e){const n=Math.min(t.length,e.length);let i=0;for(let r=0;r{var E;(E=j.current)==null||E.call(j),j.current=null},C=()=>{D.current=me(M.current,{opacity:[1,1,0,0]},{duration:g,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"})};return l.useEffect(()=>{x==="all"&&e!==w.current&&A.set(""),w.current=e},[e,x]),l.useEffect(()=>{var N;if(!h){C(),v();return}(N=D.current)==null||N.cancel();const E=()=>{const X=kt(A.get(),e,x,d);A.set(X),X!==e?W():(C(),o==null||o())},W=()=>{j.current=_e(E,wt(e,A.get(),$,r,c))};return j.current||W(),v},[h,o,e,$,r,c,d]),S.jsxs(a,{ref:s,...f,"aria-label":b||e,children:[S.jsx(k.span,{className:p,style:m,children:A}),S.jsx(k.span,{ref:M,className:y,style:{display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...u}})]})});export{Vt as A}; diff --git a/frontend/dist/assets/key-round-CYJwakCI.js b/frontend/dist/assets/key-round-m5pQJFxH.js similarity index 91% rename from frontend/dist/assets/key-round-CYJwakCI.js rename to frontend/dist/assets/key-round-m5pQJFxH.js index b968a0f9..ffdd5f7b 100644 --- a/frontend/dist/assets/key-round-CYJwakCI.js +++ b/frontend/dist/assets/key-round-m5pQJFxH.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/layers-Cnw2L-3K.js b/frontend/dist/assets/layers-rhF42Hfn.js similarity index 92% rename from frontend/dist/assets/layers-Cnw2L-3K.js rename to frontend/dist/assets/layers-rhF42Hfn.js index 2e2d06bd..61eab7fd 100644 --- a/frontend/dist/assets/layers-Cnw2L-3K.js +++ b/frontend/dist/assets/layers-rhF42Hfn.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-CvSa8h-C.js";/** +import{d as a}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/link-scoring-DaKaf0kz.js b/frontend/dist/assets/link-scoring-DGx3Bvuc.js similarity index 94% rename from frontend/dist/assets/link-scoring-DaKaf0kz.js rename to frontend/dist/assets/link-scoring-DGx3Bvuc.js index 17a33977..ec125513 100644 --- a/frontend/dist/assets/link-scoring-DaKaf0kz.js +++ b/frontend/dist/assets/link-scoring-DGx3Bvuc.js @@ -1 +1 @@ -import{a8 as L,cb as w,d8 as x}from"./index-CvSa8h-C.js";function R(n){if(Array.isArray(n))return n;if(typeof n=="string"&&n.startsWith("["))try{const a=JSON.parse(n);return Array.isArray(a)?a:[]}catch{return[]}return[]}function A(n,a,S){const i=new Map;for(const t of a){const r=L(t);i.has(r)||i.set(r,t)}const f=new Map,u=new Map;for(const t of n){const r=t.route??t.route_type;if(!w(r))continue;const c=R(t.original_path);if(c.length===0)continue;const o=c.map(e=>e.toUpperCase());if(!t.transmitted&&o.length>=2){const e=o[o.length-2];if(e){const s=i.get(e);s&&u.set(s,(u.get(s)??0)+1)}}if(o.includes(S))for(const e of o){if(e===S)continue;const s=i.get(e);s&&f.set(s,(f.get(s)??0)+1)}}let h=0,p=0;for(const t of a)h=Math.max(h,f.get(t)??0),p=Math.max(p,u.get(t)??0);const M=new Map;let d=0,g=0,m=0;for(const t of a){const r=f.get(t)??0,c=u.get(t)??0,o=h>0?Math.round(r/h*100):0,l=p>0?Math.round(c/p*100):0,e=o+l;M.set(t,{hash:t,listenerCount:r,loudCount:c,listenerScore:o,loudScore:l,blendedScore:e}),d=Math.max(d,o),g=Math.max(g,l),m=Math.max(m,e)}return{scores:M,maxListenerScore:d,maxLoudScore:g,maxBlendedScore:m}}const C={YELLOW:x.amber,GREEN:x.green,RED:x.red,GRAY:"#505050"};export{C as L,A as c}; +import{a8 as L,cb as w,d8 as x}from"./index-WhzslczH.js";function R(n){if(Array.isArray(n))return n;if(typeof n=="string"&&n.startsWith("["))try{const a=JSON.parse(n);return Array.isArray(a)?a:[]}catch{return[]}return[]}function A(n,a,S){const i=new Map;for(const t of a){const r=L(t);i.has(r)||i.set(r,t)}const f=new Map,u=new Map;for(const t of n){const r=t.route??t.route_type;if(!w(r))continue;const c=R(t.original_path);if(c.length===0)continue;const o=c.map(e=>e.toUpperCase());if(!t.transmitted&&o.length>=2){const e=o[o.length-2];if(e){const s=i.get(e);s&&u.set(s,(u.get(s)??0)+1)}}if(o.includes(S))for(const e of o){if(e===S)continue;const s=i.get(e);s&&f.set(s,(f.get(s)??0)+1)}}let h=0,p=0;for(const t of a)h=Math.max(h,f.get(t)??0),p=Math.max(p,u.get(t)??0);const M=new Map;let d=0,g=0,m=0;for(const t of a){const r=f.get(t)??0,c=u.get(t)??0,o=h>0?Math.round(r/h*100):0,l=p>0?Math.round(c/p*100):0,e=o+l;M.set(t,{hash:t,listenerCount:r,loudCount:c,listenerScore:o,loudScore:l,blendedScore:e}),d=Math.max(d,o),g=Math.max(g,l),m=Math.max(m,e)}return{scores:M,maxListenerScore:d,maxLoudScore:g,maxBlendedScore:m}}const C={YELLOW:x.amber,GREEN:x.green,RED:x.red,GRAY:"#505050"};export{C as L,A as c}; diff --git a/frontend/dist/assets/listbox-Xbs80tag.js b/frontend/dist/assets/listbox-B9_kY-R5.js similarity index 99% rename from frontend/dist/assets/listbox-Xbs80tag.js rename to frontend/dist/assets/listbox-B9_kY-R5.js index 9e29d0fa..47c58cf7 100644 --- a/frontend/dist/assets/listbox-Xbs80tag.js +++ b/frontend/dist/assets/listbox-B9_kY-R5.js @@ -1 +1 @@ -import{aX as $e,r as p,au as T,aA as Ne,eR as de,aB as K,aC as Ie,aD as _e,aE as je,aF as Ve,aG as W,aH as Be,aI as ze,aJ as Y,aK as R,aN as O,eS as Qe,aQ as Ue,aR as He,aS as Ke,aT as qe,aY as Ge,aU as q,aV as Ee,aZ as We,aW as Z,b6 as F,a_ as me,a$ as Ye,b0 as Ze,b1 as se,b2 as Je,b3 as Xe,b4 as et,aL as tt,aw as nt,aO as pe,eT as ot,cE as xe,b5 as st,b7 as at,b8 as it,ay as fe,b9 as rt,bb as lt,bc as ut,bd as ct,be as dt,bf as pt,bg as ft,bh as vt,bi as he,cR as bt,cS as mt,j as I,c as H,ao as xt,A as ht,m as gt,cw as Ot,D as St}from"./index-CvSa8h-C.js";import{p as yt,a as ne,c as x,f as ee,b as $t,L as It,S as te,s as Et,u as Rt,e as wt,h as Lt}from"./element-movement-CM_Y2Bj0.js";import{F as Pt,b as Dt,y as Ft,R as kt,T as Tt,w as Ct,A as Mt}from"./map-pin-BCwmmHGs.js";let ge=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Oe(e){var s,t;let n=(s=e.innerText)!=null?s:"",o=e.cloneNode(!0);if(!$e(o))return n;let a=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),a=!0;let r=a?(t=o.innerText)!=null?t:"":n;return ge.test(r)&&(r=r.replace(ge,"")),r}function At(e){let s=e.getAttribute("aria-label");if(typeof s=="string")return s.trim();let t=e.getAttribute("aria-labelledby");if(t){let n=t.split(" ").map(o=>{let a=document.getElementById(o);if(a){let r=a.getAttribute("aria-label");return typeof r=="string"?r.trim():Oe(a).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return Oe(e).trim()}function Nt(e){let s=p.useRef(""),t=p.useRef("");return T(()=>{let n=e.current;if(!n)return"";let o=n.innerText;if(s.current===o)return t.current;let a=At(n).trim().toLowerCase();return s.current=o,t.current=a,a})}var _t=Object.defineProperty,jt=(e,s,t)=>s in e?_t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,Se=(e,s,t)=>(jt(e,typeof s!="symbol"?s+"":s,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),B=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(B||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(oe||{}),Re=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(Re||{});function ye(e,s=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=je(s(e.options.slice()),a=>a.dataRef.current.domRef.current),o=t?n.indexOf(t):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let Vt={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let s=e.buttonElement?ne.Tracked($t(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:x.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:s}},0(e,s){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(a=>n(a.dataRef.current.value));return o!==-1&&(t=o),{...e,frozenValue:!1,pendingFocus:s.focus,listboxState:0,activeOptionIndex:t,__demoMode:!1,buttonPositionState:ne.Idle}},2(e,s){var t,n,o,a,r;if(e.dataRef.current.disabled||e.listboxState===1)return e;let u={...e,searchQuery:"",activationTrigger:(t=s.trigger)!=null?t:1,__demoMode:!1};if(s.focus===x.Nothing)return{...u,activeOptionIndex:null};if(s.focus===x.Specific)return{...u,activeOptionIndex:e.options.findIndex(b=>b.id===s.id)};if(s.focus===x.Previous){let b=e.activeOptionIndex;if(b!==null){let g=e.options[b].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled});if(d!==null){let i=e.options[d].dataRef.current.domRef;if(((n=g.current)==null?void 0:n.previousElementSibling)===i.current||((o=i.current)==null?void 0:o.previousElementSibling)===null)return{...u,activeOptionIndex:d}}}}else if(s.focus===x.Next){let b=e.activeOptionIndex;if(b!==null){let g=e.options[b].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled});if(d!==null){let i=e.options[d].dataRef.current.domRef;if(((a=g.current)==null?void 0:a.nextElementSibling)===i.current||((r=i.current)==null?void 0:r.nextElementSibling)===null)return{...u,activeOptionIndex:d}}}}let m=ye(e),c=ee(s,{resolveItems:()=>m.options,resolveActiveIndex:()=>m.activeOptionIndex,resolveId:b=>b.id,resolveDisabled:b=>b.dataRef.current.disabled});return{...u,...m,activeOptionIndex:c}},3:(e,s)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.searchQuery!==""?0:1,n=e.searchQuery+s.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+t).concat(e.options.slice(0,e.activeOptionIndex+t)):e.options).find(r=>{var u;return!r.dataRef.current.disabled&&((u=r.dataRef.current.textValue)==null?void 0:u.startsWith(n))}),a=o?e.options.indexOf(o):-1;return a===-1||a===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:a,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,s)=>{let t=e.options.concat(s.options),n=e.activeOptionIndex;if(e.pendingFocus.focus!==x.Nothing&&(n=ee(e.pendingFocus,{resolveItems:()=>t,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let a=t.findIndex(r=>o==null?void 0:o(r.dataRef.current.value));a!==-1&&(n=a)}}return{...e,options:t,activeOptionIndex:n,pendingFocus:{focus:x.Nothing},pendingShouldSort:!0}},7:(e,s)=>{let t=e.options,n=[],o=new Set(s.options);for(let[a,r]of t.entries())if(o.has(r.id)&&(n.push(a),o.delete(r.id),o.size===0))break;if(n.length>0){t=t.slice();for(let a of n.reverse())t.splice(a,1)}return{...e,options:t,activationTrigger:1}},8:(e,s)=>e.buttonElement===s.element?e:{...e,buttonElement:s.element},9:(e,s)=>e.optionsElement===s.element?e:{...e,optionsElement:s.element},10:e=>e.pendingShouldSort?{...e,...ye(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:ne.Moved}}};class ve extends Ne{constructor(s){super(s),Se(this,"actions",{onChange:t=>{let{onChange:n,compare:o,mode:a,value:r}=this.state.dataRef.current;return K(a,{0:()=>n==null?void 0:n(t),1:()=>{let u=r.slice(),m=u.findIndex(c=>o(c,t));return m===-1?u.push(t):u.splice(m,1),n==null?void 0:n(u)}})},registerOption:de(()=>{let t=[],n=new Set;return[(o,a)=>{n.has(a)||(n.add(a),t.push({id:o,dataRef:a}))},()=>(n.clear(),this.send({type:6,options:t.splice(0)}))]}),unregisterOption:de(()=>{let t=[];return[n=>t.push(n),()=>{this.send({type:7,options:t.splice(0)})}]}),goToOption:de(()=>{let t=null;return[(n,o)=>{t={type:2,...n,trigger:o}},()=>t&&this.send(t)]}),closeListbox:()=>{this.send({type:1})},openListbox:t=>{this.send({type:0,focus:t})},selectActiveOption:()=>{var t;if(this.state.activeOptionIndex!==null){let{dataRef:n}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(n.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(t=this.state.buttonElement)==null||t.focus({preventScroll:!0}))},selectOption:t=>{this.send({type:5,value:t})},search:t=>{this.send({type:3,value:t})},clearSearch:()=>{this.send({type:4})},setButtonElement:t=>{this.send({type:8,element:t})},setOptionsElement:t=>{this.send({type:9,element:t})}}),Se(this,"selectors",{activeDescendantId(t){var n;let o=t.activeOptionIndex,a=t.options;return o===null||(n=a[o])==null?void 0:n.id},isActive(t,n){var o;let a=t.activeOptionIndex,r=t.options;return a!==null?((o=r[a])==null?void 0:o.id)===n:!1},hasFrozenValue(t){return t.frozenValue},shouldScrollIntoView(t,n){return t.__demoMode||t.listboxState!==0||t.activationTrigger===0?!1:this.isActive(t,n)},didButtonMove(t){return t.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let t=this.state.id,n=Ie.get(null);this.disposables.add(n.on(_e.Push,o=>{!n.selectors.isTop(o,t)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>n.actions.push(t)),this.on(1,()=>n.actions.pop(t))}this.disposables.group(t=>{this.on(1,n=>{n.buttonElement&&(t.dispose(),t.add(yt(n.buttonElement,n.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(t,n)=>{var o;this.actions.onChange(n.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:s,__demoMode:t=!1}){return new ve({id:s,dataRef:{current:{}},listboxState:t?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:x.Nothing},frozenValue:!1,__demoMode:t,buttonPositionState:ne.Idle})}reduce(s,t){return K(t.type,Vt,s,t)}}const we=p.createContext(null);function be(e){let s=p.useContext(we);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}return s}function Le({id:e,__demoMode:s=!1}){let t=p.useMemo(()=>ve.new({id:e,__demoMode:s}),[]);return Ve(()=>t.dispose()),t}let ae=p.createContext(null);ae.displayName="ListboxDataContext";function J(e){let s=p.useContext(ae);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,J),t}return s}let Bt=p.Fragment;function zt(e,s){let t=p.useId(),n=lt(),{value:o,defaultValue:a,form:r,name:u,onChange:m,by:c,invalid:b=!1,disabled:g=n||!1,horizontal:d=!1,multiple:i=!1,__demoMode:h=!1,...P}=e;const w=d?"horizontal":"vertical";let _=Y(s),k=ut(a),[y=i?[]:void 0,L]=ct(o,m,k),$=Le({id:t,__demoMode:h}),j=p.useRef({static:!1,hold:!1}),z=p.useRef(new Map),C=Lt(c),Q=p.useCallback(E=>K(f.mode,{[B.Multi]:()=>y.some(G=>C(G,E)),[B.Single]:()=>C(y,E)}),[y]),f=q({value:y,disabled:g,invalid:b,mode:i?B.Multi:B.Single,orientation:w,onChange:L,compare:C,isSelected:Q,optionsPropsRef:j,listRef:z});fe(()=>{$.state.dataRef.current=f},[f]);let D=R($,E=>E.listboxState),M=Ie.get(null),U=R(M,p.useCallback(E=>M.selectors.isTop(E,t),[M,t])),[A,v]=R($,E=>[E.buttonElement,E.optionsElement]);dt(U,[A,v],(E,G)=>{$.send({type:Re.CloseListbox}),bt(G,mt.Loose)||(E.preventDefault(),A==null||A.focus())});let N=q({open:D===S.Open,disabled:g,invalid:b,value:y}),[ie,re]=pt({inherit:!0}),X={ref:_},le=p.useCallback(()=>{if(k!==void 0)return L==null?void 0:L(k)},[L,k]),ue=Z();return F.createElement(re,{value:ie,props:{htmlFor:A==null?void 0:A.id},slot:{open:D===S.Open,disabled:g}},F.createElement(Mt,null,F.createElement(we.Provider,{value:$},F.createElement(ae.Provider,{value:f},F.createElement(ft,{value:K(D,{[S.Open]:se.Open,[S.Closed]:se.Closed})},u!=null&&y!=null&&F.createElement(vt,{disabled:g,data:{[u]:y},form:r,onReset:le}),ue({ourProps:X,theirProps:P,slot:N,defaultTag:Bt,name:"Listbox"}))))))}let Qt="button";function Ut(e,s){let t=p.useId(),n=ze(),o=J("Listbox.Button"),a=be("Listbox.Button"),{id:r=n||`headlessui-listbox-button-${t}`,disabled:u=o.disabled||!1,autoFocus:m=!1,...c}=e,b=Y(s,Pt(),a.actions.setButtonElement),g=Dt(),[d,i,h]=R(a,v=>[v.listboxState,v.buttonElement,v.optionsElement]),P=d===S.Open;It(P,{trigger:i,action:p.useCallback(v=>{if(i!=null&&i.contains(v.target))return te.Ignore;let N=v.target.closest('[role="option"]:not([data-disabled])');return $e(N)?te.Select(N):h!=null&&h.contains(v.target)?te.Ignore:te.Close},[i,h]),close:a.actions.closeListbox,select:a.actions.selectActiveOption});let w=T(v=>{switch(v.key){case O.Enter:Qe(v.currentTarget);break;case O.Space:case O.ArrowDown:v.preventDefault(),a.actions.openListbox({focus:o.value?x.Nothing:x.First});break;case O.ArrowUp:v.preventDefault(),a.actions.openListbox({focus:o.value?x.Nothing:x.Last});break}}),_=T(v=>{switch(v.key){case O.Space:v.preventDefault();break}}),k=Et(v=>{var N;a.state.listboxState===S.Open?(pe.flushSync(()=>a.actions.closeListbox()),(N=a.state.buttonElement)==null||N.focus({preventScroll:!0})):(v.preventDefault(),a.actions.openListbox({focus:x.Nothing}))}),y=T(v=>v.preventDefault()),L=Ue([r]),$=He(),{isFocusVisible:j,focusProps:z}=Ke({autoFocus:m}),{isHovered:C,hoverProps:Q}=qe({isDisabled:u}),{pressed:f,pressProps:D}=Ge({disabled:u}),M=q({open:d===S.Open,active:f||d===S.Open,disabled:u,invalid:o.invalid,value:o.value,hover:C,focus:j,autofocus:m}),U=R(a,v=>v.listboxState===S.Open),A=Ee(g(),{ref:b,id:r,type:We(e,i),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":U,"aria-labelledby":L,"aria-describedby":$,disabled:u||void 0,autoFocus:m,onKeyDown:w,onKeyUp:_,onKeyPress:y},k,z,Q,D);return Z()({ourProps:A,theirProps:c,slot:M,defaultTag:Qt,name:"Listbox.Button"})}let Pe=p.createContext(!1),Ht="div",Kt=he.RenderStrategy|he.Static;function qt(e,s){let t=p.useId(),{id:n=`headlessui-listbox-options-${t}`,anchor:o,portal:a=!1,modal:r=!0,transition:u=!1,...m}=e,c=Ft(o),[b,g]=p.useState(null);c&&(a=!0);let d=J("Listbox.Options"),i=be("Listbox.Options"),[h,P,w,_]=R(i,l=>[l.listboxState,l.buttonElement,l.optionsElement,l.__demoMode]),k=me(P),y=me(w),L=Ye(),[$,j]=Ze(u,b,L!==null?(L&se.Open)===se.Open:h===S.Open);Je($,P,i.actions.closeListbox);let z=_?!1:r&&h===S.Open;Xe(z,y);let C=_?!1:r&&h===S.Open;et(C,{allowed:p.useCallback(()=>[P,w],[P,w])});let Q=R(i,i.selectors.didButtonMove)?!1:$,f=R(i,i.selectors.hasFrozenValue)&&!e.static,D=Rt(f,d.value),M=p.useCallback(l=>d.compare(D,l),[d.compare,D]),U=R(i,l=>{var V;if(c==null||!((V=c==null?void 0:c.to)!=null&&V.includes("selection")))return null;let ce=l.options.findIndex(Ae=>M(Ae.dataRef.current.value));return ce===-1&&(ce=0),ce}),A=(()=>{if(c==null)return;if(U===null)return{...c,inner:void 0};let l=Array.from(d.listRef.current.values());return{...c,inner:{listRef:{current:l},index:U}}})(),[v,N]=kt(A),ie=Tt(),re=Y(s,c?v:null,i.actions.setOptionsElement,g),X=tt();p.useEffect(()=>{let l=w;l&&h===S.Open&&(nt(l)||l==null||l.focus({preventScroll:!0}))},[h,w]);let le=T(l=>{var V;switch(X.dispose(),l.key){case O.Space:if(i.state.searchQuery!=="")return l.preventDefault(),l.stopPropagation(),i.actions.search(l.key);case O.Enter:l.preventDefault(),l.stopPropagation(),i.actions.selectActiveOption();break;case K(d.orientation,{vertical:O.ArrowDown,horizontal:O.ArrowRight}):return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.Next});case K(d.orientation,{vertical:O.ArrowUp,horizontal:O.ArrowLeft}):return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.Previous});case O.Home:case O.PageUp:return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.First});case O.End:case O.PageDown:return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.Last});case O.Escape:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>i.actions.closeListbox()),(V=i.state.buttonElement)==null||V.focus({preventScroll:!0});return;case O.Tab:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>i.actions.closeListbox()),ot(i.state.buttonElement,l.shiftKey?xe.Previous:xe.Next);break;default:l.key.length===1&&(i.actions.search(l.key),X.setTimeout(()=>i.actions.clearSearch(),350));break}}),ue=R(i,l=>{var V;return(V=l.buttonElement)==null?void 0:V.id}),E=q({open:h===S.Open}),G=Ee(c?ie():{},{id:n,ref:re,"aria-activedescendant":R(i,i.selectors.activeDescendantId),"aria-multiselectable":d.mode===B.Multi?!0:void 0,"aria-labelledby":ue,"aria-orientation":d.orientation,onKeyDown:le,role:"listbox",tabIndex:h===S.Open?0:void 0,style:{...m.style,...N,"--button-width":Ct($,P,!0).width},...st(j)}),Ce=Z(),Me=p.useMemo(()=>d.mode===B.Multi?d:{...d,isSelected:M},[d,M]);return F.createElement(at,{enabled:a?e.static||$:!1,ownerDocument:k},F.createElement(ae.Provider,{value:Me},Ce({ourProps:G,theirProps:m,slot:E,defaultTag:Ht,features:Kt,visible:Q,name:"Listbox.Options"})))}let Gt="div";function Wt(e,s){let t=p.useId(),{id:n=`headlessui-listbox-option-${t}`,disabled:o=!1,value:a,...r}=e,u=p.useContext(Pe)===!0,m=J("Listbox.Option"),c=be("Listbox.Option"),b=R(c,f=>c.selectors.isActive(f,n)),g=m.isSelected(a),d=p.useRef(null),i=Nt(d),h=it({disabled:o,value:a,domRef:d,get textValue(){return i()}}),P=Y(s,d,f=>{f?m.listRef.current.set(n,f):m.listRef.current.delete(n)}),w=R(c,f=>c.selectors.shouldScrollIntoView(f,n));fe(()=>{if(w)return rt().requestAnimationFrame(()=>{var f,D;(D=(f=d.current)==null?void 0:f.scrollIntoView)==null||D.call(f,{block:"nearest"})})},[w,d]),fe(()=>{if(!u)return c.actions.registerOption(n,h),()=>c.actions.unregisterOption(n)},[h,n,u]);let _=T(f=>{if(o)return f.preventDefault();c.actions.selectOption(a)}),k=T(()=>{if(o)return c.actions.goToOption({focus:x.Nothing});c.actions.goToOption({focus:x.Specific,id:n})}),y=wt(),L=T(f=>y.update(f)),$=T(f=>{y.wasMoved(f)&&(o||b&&c.state.activationTrigger===oe.Pointer||c.actions.goToOption({focus:x.Specific,id:n},oe.Pointer))}),j=T(f=>{y.wasMoved(f)&&(o||b&&c.state.activationTrigger===oe.Pointer&&c.actions.goToOption({focus:x.Nothing}))}),z=q({active:b,focus:b,selected:g,disabled:o,selectedOption:g&&u}),C=u?{}:{id:n,ref:P,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:_,onFocus:k,onPointerEnter:L,onMouseEnter:L,onPointerMove:$,onMouseMove:$,onPointerLeave:j,onMouseLeave:j},Q=Z();return!g&&u?null:Q({ourProps:C,theirProps:r,slot:z,defaultTag:Gt,name:"Listbox.Option"})}let Yt=p.Fragment;function Zt(e,s){let{options:t,placeholder:n,...o}=e,a={ref:Y(s)},r=J("ListboxSelectedOption"),u=q({}),m=r.value===void 0||r.value===null||r.mode===B.Multi&&Array.isArray(r.value)&&r.value.length===0,c=Z();return F.createElement(Pe.Provider,{value:!0},c({ourProps:a,theirProps:{...o,children:F.createElement(F.Fragment,null,n&&m?n:t)},slot:u,defaultTag:Yt,name:"ListboxSelectedOption"}))}let Jt=W(zt),De=W(Ut),Xt=Be,Fe=W(qt),ke=W(Wt),Te=W(Zt),en=Object.assign(Jt,{Button:De,Label:Xt,Options:Fe,Option:ke,SelectedOption:Te});function sn({value:e,onChange:s,className:t,placeholder:n,disabled:o,"aria-label":a,children:r}){return I.jsx(en,{value:e,onChange:s,disabled:o,children:({open:u})=>I.jsxs("div",{className:H("relative",t),children:[I.jsxs(De,{"aria-label":a,className:H(["relative flex w-full items-center justify-between gap-2","radius-inner px-3 py-2","text-left text-sm text-fg-primary","bg-input-bg border border-input-border","ring-focus-inset","hover:border-edge-strong","disabled:opacity-40 disabled:pointer-events-none disabled:cursor-not-allowed","transition-colors"]),children:[I.jsx(Te,{as:"span",options:r,placeholder:n&&I.jsx("span",{className:"text-fg-muted",children:n}),className:"block truncate"}),I.jsx(xt,{className:H("w-4 h-4 text-fg-muted transition-transform duration-200",u&&"rotate-180")})]}),I.jsx(ht,{children:u&&I.jsx(gt.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:Ot.dropdown,className:"absolute z-50 mt-1",children:I.jsx(Fe,{static:!0,anchor:"bottom start",className:H(["w-[var(--button-width)] min-w-[180px]","max-h-60 overflow-y-auto overscroll-contain scroll-py-1","radius-inset p-1","surface-elevated","focus:outline-none"]),children:r})})})]})})}function an({value:e,disabled:s,className:t,children:n}){return I.jsx(ke,{as:p.Fragment,value:e,disabled:s,children:({selected:o,focus:a})=>I.jsxs("div",{className:H("flex items-center gap-2 px-3 py-2 radius-control cursor-default","text-sm",a&&"bg-sys-blue text-white",!a&&"text-fg-primary",o&&!a&&"text-sys-blue",s&&"opacity-50 cursor-not-allowed",t),children:[I.jsx("span",{className:"w-4 flex-shrink-0",children:o&&I.jsx(St,{className:"w-4 h-4"})}),I.jsx("span",{className:"truncate",children:n})]})})}function rn({className:e,...s}){return I.jsx("span",{...s,className:H("truncate",e)})}export{sn as L,an as a,rn as b}; +import{aX as $e,r as p,au as T,aA as Ne,eR as de,aB as K,aC as Ie,aD as _e,aE as je,aF as Ve,aG as W,aH as Be,aI as ze,aJ as Y,aK as R,aN as O,eS as Qe,aQ as Ue,aR as He,aS as Ke,aT as qe,aY as Ge,aU as q,aV as Ee,aZ as We,aW as Z,b6 as F,a_ as me,a$ as Ye,b0 as Ze,b1 as se,b2 as Je,b3 as Xe,b4 as et,aL as tt,aw as nt,aO as pe,eT as ot,cE as xe,b5 as st,b7 as at,b8 as it,ay as fe,b9 as rt,bb as lt,bc as ut,bd as ct,be as dt,bf as pt,bg as ft,bh as vt,bi as he,cR as bt,cS as mt,j as I,c as H,ao as xt,A as ht,m as gt,cw as Ot,D as St}from"./index-WhzslczH.js";import{p as yt,a as ne,c as x,f as ee,b as $t,L as It,S as te,s as Et,u as Rt,e as wt,h as Lt}from"./element-movement-CSsBUmDY.js";import{F as Pt,b as Dt,y as Ft,R as kt,T as Tt,w as Ct,A as Mt}from"./map-pin-BXCqDxIA.js";let ge=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Oe(e){var s,t;let n=(s=e.innerText)!=null?s:"",o=e.cloneNode(!0);if(!$e(o))return n;let a=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),a=!0;let r=a?(t=o.innerText)!=null?t:"":n;return ge.test(r)&&(r=r.replace(ge,"")),r}function At(e){let s=e.getAttribute("aria-label");if(typeof s=="string")return s.trim();let t=e.getAttribute("aria-labelledby");if(t){let n=t.split(" ").map(o=>{let a=document.getElementById(o);if(a){let r=a.getAttribute("aria-label");return typeof r=="string"?r.trim():Oe(a).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return Oe(e).trim()}function Nt(e){let s=p.useRef(""),t=p.useRef("");return T(()=>{let n=e.current;if(!n)return"";let o=n.innerText;if(s.current===o)return t.current;let a=At(n).trim().toLowerCase();return s.current=o,t.current=a,a})}var _t=Object.defineProperty,jt=(e,s,t)=>s in e?_t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,Se=(e,s,t)=>(jt(e,typeof s!="symbol"?s+"":s,t),t),S=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(S||{}),B=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(B||{}),oe=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(oe||{}),Re=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.SelectOption=5]="SelectOption",e[e.RegisterOptions=6]="RegisterOptions",e[e.UnregisterOptions=7]="UnregisterOptions",e[e.SetButtonElement=8]="SetButtonElement",e[e.SetOptionsElement=9]="SetOptionsElement",e[e.SortOptions=10]="SortOptions",e[e.MarkButtonAsMoved=11]="MarkButtonAsMoved",e))(Re||{});function ye(e,s=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=je(s(e.options.slice()),a=>a.dataRef.current.domRef.current),o=t?n.indexOf(t):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let Vt={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let s=e.buttonElement?ne.Tracked($t(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:x.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:s}},0(e,s){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,o=e.options.findIndex(a=>n(a.dataRef.current.value));return o!==-1&&(t=o),{...e,frozenValue:!1,pendingFocus:s.focus,listboxState:0,activeOptionIndex:t,__demoMode:!1,buttonPositionState:ne.Idle}},2(e,s){var t,n,o,a,r;if(e.dataRef.current.disabled||e.listboxState===1)return e;let u={...e,searchQuery:"",activationTrigger:(t=s.trigger)!=null?t:1,__demoMode:!1};if(s.focus===x.Nothing)return{...u,activeOptionIndex:null};if(s.focus===x.Specific)return{...u,activeOptionIndex:e.options.findIndex(b=>b.id===s.id)};if(s.focus===x.Previous){let b=e.activeOptionIndex;if(b!==null){let g=e.options[b].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled});if(d!==null){let i=e.options[d].dataRef.current.domRef;if(((n=g.current)==null?void 0:n.previousElementSibling)===i.current||((o=i.current)==null?void 0:o.previousElementSibling)===null)return{...u,activeOptionIndex:d}}}}else if(s.focus===x.Next){let b=e.activeOptionIndex;if(b!==null){let g=e.options[b].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled});if(d!==null){let i=e.options[d].dataRef.current.domRef;if(((a=g.current)==null?void 0:a.nextElementSibling)===i.current||((r=i.current)==null?void 0:r.nextElementSibling)===null)return{...u,activeOptionIndex:d}}}}let m=ye(e),c=ee(s,{resolveItems:()=>m.options,resolveActiveIndex:()=>m.activeOptionIndex,resolveId:b=>b.id,resolveDisabled:b=>b.dataRef.current.disabled});return{...u,...m,activeOptionIndex:c}},3:(e,s)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.searchQuery!==""?0:1,n=e.searchQuery+s.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+t).concat(e.options.slice(0,e.activeOptionIndex+t)):e.options).find(r=>{var u;return!r.dataRef.current.disabled&&((u=r.dataRef.current.textValue)==null?void 0:u.startsWith(n))}),a=o?e.options.indexOf(o):-1;return a===-1||a===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:a,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,s)=>{let t=e.options.concat(s.options),n=e.activeOptionIndex;if(e.pendingFocus.focus!==x.Nothing&&(n=ee(e.pendingFocus,{resolveItems:()=>t,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let a=t.findIndex(r=>o==null?void 0:o(r.dataRef.current.value));a!==-1&&(n=a)}}return{...e,options:t,activeOptionIndex:n,pendingFocus:{focus:x.Nothing},pendingShouldSort:!0}},7:(e,s)=>{let t=e.options,n=[],o=new Set(s.options);for(let[a,r]of t.entries())if(o.has(r.id)&&(n.push(a),o.delete(r.id),o.size===0))break;if(n.length>0){t=t.slice();for(let a of n.reverse())t.splice(a,1)}return{...e,options:t,activationTrigger:1}},8:(e,s)=>e.buttonElement===s.element?e:{...e,buttonElement:s.element},9:(e,s)=>e.optionsElement===s.element?e:{...e,optionsElement:s.element},10:e=>e.pendingShouldSort?{...e,...ye(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:ne.Moved}}};class ve extends Ne{constructor(s){super(s),Se(this,"actions",{onChange:t=>{let{onChange:n,compare:o,mode:a,value:r}=this.state.dataRef.current;return K(a,{0:()=>n==null?void 0:n(t),1:()=>{let u=r.slice(),m=u.findIndex(c=>o(c,t));return m===-1?u.push(t):u.splice(m,1),n==null?void 0:n(u)}})},registerOption:de(()=>{let t=[],n=new Set;return[(o,a)=>{n.has(a)||(n.add(a),t.push({id:o,dataRef:a}))},()=>(n.clear(),this.send({type:6,options:t.splice(0)}))]}),unregisterOption:de(()=>{let t=[];return[n=>t.push(n),()=>{this.send({type:7,options:t.splice(0)})}]}),goToOption:de(()=>{let t=null;return[(n,o)=>{t={type:2,...n,trigger:o}},()=>t&&this.send(t)]}),closeListbox:()=>{this.send({type:1})},openListbox:t=>{this.send({type:0,focus:t})},selectActiveOption:()=>{var t;if(this.state.activeOptionIndex!==null){let{dataRef:n}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(n.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(t=this.state.buttonElement)==null||t.focus({preventScroll:!0}))},selectOption:t=>{this.send({type:5,value:t})},search:t=>{this.send({type:3,value:t})},clearSearch:()=>{this.send({type:4})},setButtonElement:t=>{this.send({type:8,element:t})},setOptionsElement:t=>{this.send({type:9,element:t})}}),Se(this,"selectors",{activeDescendantId(t){var n;let o=t.activeOptionIndex,a=t.options;return o===null||(n=a[o])==null?void 0:n.id},isActive(t,n){var o;let a=t.activeOptionIndex,r=t.options;return a!==null?((o=r[a])==null?void 0:o.id)===n:!1},hasFrozenValue(t){return t.frozenValue},shouldScrollIntoView(t,n){return t.__demoMode||t.listboxState!==0||t.activationTrigger===0?!1:this.isActive(t,n)},didButtonMove(t){return t.buttonPositionState.kind==="Moved"}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let t=this.state.id,n=Ie.get(null);this.disposables.add(n.on(_e.Push,o=>{!n.selectors.isTop(o,t)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>n.actions.push(t)),this.on(1,()=>n.actions.pop(t))}this.disposables.group(t=>{this.on(1,n=>{n.buttonElement&&(t.dispose(),t.add(yt(n.buttonElement,n.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(t,n)=>{var o;this.actions.onChange(n.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(o=this.state.buttonElement)==null||o.focus({preventScroll:!0}))})}static new({id:s,__demoMode:t=!1}){return new ve({id:s,dataRef:{current:{}},listboxState:t?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:x.Nothing},frozenValue:!1,__demoMode:t,buttonPositionState:ne.Idle})}reduce(s,t){return K(t.type,Vt,s,t)}}const we=p.createContext(null);function be(e){let s=p.useContext(we);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Le),t}return s}function Le({id:e,__demoMode:s=!1}){let t=p.useMemo(()=>ve.new({id:e,__demoMode:s}),[]);return Ve(()=>t.dispose()),t}let ae=p.createContext(null);ae.displayName="ListboxDataContext";function J(e){let s=p.useContext(ae);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,J),t}return s}let Bt=p.Fragment;function zt(e,s){let t=p.useId(),n=lt(),{value:o,defaultValue:a,form:r,name:u,onChange:m,by:c,invalid:b=!1,disabled:g=n||!1,horizontal:d=!1,multiple:i=!1,__demoMode:h=!1,...P}=e;const w=d?"horizontal":"vertical";let _=Y(s),k=ut(a),[y=i?[]:void 0,L]=ct(o,m,k),$=Le({id:t,__demoMode:h}),j=p.useRef({static:!1,hold:!1}),z=p.useRef(new Map),C=Lt(c),Q=p.useCallback(E=>K(f.mode,{[B.Multi]:()=>y.some(G=>C(G,E)),[B.Single]:()=>C(y,E)}),[y]),f=q({value:y,disabled:g,invalid:b,mode:i?B.Multi:B.Single,orientation:w,onChange:L,compare:C,isSelected:Q,optionsPropsRef:j,listRef:z});fe(()=>{$.state.dataRef.current=f},[f]);let D=R($,E=>E.listboxState),M=Ie.get(null),U=R(M,p.useCallback(E=>M.selectors.isTop(E,t),[M,t])),[A,v]=R($,E=>[E.buttonElement,E.optionsElement]);dt(U,[A,v],(E,G)=>{$.send({type:Re.CloseListbox}),bt(G,mt.Loose)||(E.preventDefault(),A==null||A.focus())});let N=q({open:D===S.Open,disabled:g,invalid:b,value:y}),[ie,re]=pt({inherit:!0}),X={ref:_},le=p.useCallback(()=>{if(k!==void 0)return L==null?void 0:L(k)},[L,k]),ue=Z();return F.createElement(re,{value:ie,props:{htmlFor:A==null?void 0:A.id},slot:{open:D===S.Open,disabled:g}},F.createElement(Mt,null,F.createElement(we.Provider,{value:$},F.createElement(ae.Provider,{value:f},F.createElement(ft,{value:K(D,{[S.Open]:se.Open,[S.Closed]:se.Closed})},u!=null&&y!=null&&F.createElement(vt,{disabled:g,data:{[u]:y},form:r,onReset:le}),ue({ourProps:X,theirProps:P,slot:N,defaultTag:Bt,name:"Listbox"}))))))}let Qt="button";function Ut(e,s){let t=p.useId(),n=ze(),o=J("Listbox.Button"),a=be("Listbox.Button"),{id:r=n||`headlessui-listbox-button-${t}`,disabled:u=o.disabled||!1,autoFocus:m=!1,...c}=e,b=Y(s,Pt(),a.actions.setButtonElement),g=Dt(),[d,i,h]=R(a,v=>[v.listboxState,v.buttonElement,v.optionsElement]),P=d===S.Open;It(P,{trigger:i,action:p.useCallback(v=>{if(i!=null&&i.contains(v.target))return te.Ignore;let N=v.target.closest('[role="option"]:not([data-disabled])');return $e(N)?te.Select(N):h!=null&&h.contains(v.target)?te.Ignore:te.Close},[i,h]),close:a.actions.closeListbox,select:a.actions.selectActiveOption});let w=T(v=>{switch(v.key){case O.Enter:Qe(v.currentTarget);break;case O.Space:case O.ArrowDown:v.preventDefault(),a.actions.openListbox({focus:o.value?x.Nothing:x.First});break;case O.ArrowUp:v.preventDefault(),a.actions.openListbox({focus:o.value?x.Nothing:x.Last});break}}),_=T(v=>{switch(v.key){case O.Space:v.preventDefault();break}}),k=Et(v=>{var N;a.state.listboxState===S.Open?(pe.flushSync(()=>a.actions.closeListbox()),(N=a.state.buttonElement)==null||N.focus({preventScroll:!0})):(v.preventDefault(),a.actions.openListbox({focus:x.Nothing}))}),y=T(v=>v.preventDefault()),L=Ue([r]),$=He(),{isFocusVisible:j,focusProps:z}=Ke({autoFocus:m}),{isHovered:C,hoverProps:Q}=qe({isDisabled:u}),{pressed:f,pressProps:D}=Ge({disabled:u}),M=q({open:d===S.Open,active:f||d===S.Open,disabled:u,invalid:o.invalid,value:o.value,hover:C,focus:j,autofocus:m}),U=R(a,v=>v.listboxState===S.Open),A=Ee(g(),{ref:b,id:r,type:We(e,i),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":U,"aria-labelledby":L,"aria-describedby":$,disabled:u||void 0,autoFocus:m,onKeyDown:w,onKeyUp:_,onKeyPress:y},k,z,Q,D);return Z()({ourProps:A,theirProps:c,slot:M,defaultTag:Qt,name:"Listbox.Button"})}let Pe=p.createContext(!1),Ht="div",Kt=he.RenderStrategy|he.Static;function qt(e,s){let t=p.useId(),{id:n=`headlessui-listbox-options-${t}`,anchor:o,portal:a=!1,modal:r=!0,transition:u=!1,...m}=e,c=Ft(o),[b,g]=p.useState(null);c&&(a=!0);let d=J("Listbox.Options"),i=be("Listbox.Options"),[h,P,w,_]=R(i,l=>[l.listboxState,l.buttonElement,l.optionsElement,l.__demoMode]),k=me(P),y=me(w),L=Ye(),[$,j]=Ze(u,b,L!==null?(L&se.Open)===se.Open:h===S.Open);Je($,P,i.actions.closeListbox);let z=_?!1:r&&h===S.Open;Xe(z,y);let C=_?!1:r&&h===S.Open;et(C,{allowed:p.useCallback(()=>[P,w],[P,w])});let Q=R(i,i.selectors.didButtonMove)?!1:$,f=R(i,i.selectors.hasFrozenValue)&&!e.static,D=Rt(f,d.value),M=p.useCallback(l=>d.compare(D,l),[d.compare,D]),U=R(i,l=>{var V;if(c==null||!((V=c==null?void 0:c.to)!=null&&V.includes("selection")))return null;let ce=l.options.findIndex(Ae=>M(Ae.dataRef.current.value));return ce===-1&&(ce=0),ce}),A=(()=>{if(c==null)return;if(U===null)return{...c,inner:void 0};let l=Array.from(d.listRef.current.values());return{...c,inner:{listRef:{current:l},index:U}}})(),[v,N]=kt(A),ie=Tt(),re=Y(s,c?v:null,i.actions.setOptionsElement,g),X=tt();p.useEffect(()=>{let l=w;l&&h===S.Open&&(nt(l)||l==null||l.focus({preventScroll:!0}))},[h,w]);let le=T(l=>{var V;switch(X.dispose(),l.key){case O.Space:if(i.state.searchQuery!=="")return l.preventDefault(),l.stopPropagation(),i.actions.search(l.key);case O.Enter:l.preventDefault(),l.stopPropagation(),i.actions.selectActiveOption();break;case K(d.orientation,{vertical:O.ArrowDown,horizontal:O.ArrowRight}):return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.Next});case K(d.orientation,{vertical:O.ArrowUp,horizontal:O.ArrowLeft}):return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.Previous});case O.Home:case O.PageUp:return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.First});case O.End:case O.PageDown:return l.preventDefault(),l.stopPropagation(),i.actions.goToOption({focus:x.Last});case O.Escape:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>i.actions.closeListbox()),(V=i.state.buttonElement)==null||V.focus({preventScroll:!0});return;case O.Tab:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>i.actions.closeListbox()),ot(i.state.buttonElement,l.shiftKey?xe.Previous:xe.Next);break;default:l.key.length===1&&(i.actions.search(l.key),X.setTimeout(()=>i.actions.clearSearch(),350));break}}),ue=R(i,l=>{var V;return(V=l.buttonElement)==null?void 0:V.id}),E=q({open:h===S.Open}),G=Ee(c?ie():{},{id:n,ref:re,"aria-activedescendant":R(i,i.selectors.activeDescendantId),"aria-multiselectable":d.mode===B.Multi?!0:void 0,"aria-labelledby":ue,"aria-orientation":d.orientation,onKeyDown:le,role:"listbox",tabIndex:h===S.Open?0:void 0,style:{...m.style,...N,"--button-width":Ct($,P,!0).width},...st(j)}),Ce=Z(),Me=p.useMemo(()=>d.mode===B.Multi?d:{...d,isSelected:M},[d,M]);return F.createElement(at,{enabled:a?e.static||$:!1,ownerDocument:k},F.createElement(ae.Provider,{value:Me},Ce({ourProps:G,theirProps:m,slot:E,defaultTag:Ht,features:Kt,visible:Q,name:"Listbox.Options"})))}let Gt="div";function Wt(e,s){let t=p.useId(),{id:n=`headlessui-listbox-option-${t}`,disabled:o=!1,value:a,...r}=e,u=p.useContext(Pe)===!0,m=J("Listbox.Option"),c=be("Listbox.Option"),b=R(c,f=>c.selectors.isActive(f,n)),g=m.isSelected(a),d=p.useRef(null),i=Nt(d),h=it({disabled:o,value:a,domRef:d,get textValue(){return i()}}),P=Y(s,d,f=>{f?m.listRef.current.set(n,f):m.listRef.current.delete(n)}),w=R(c,f=>c.selectors.shouldScrollIntoView(f,n));fe(()=>{if(w)return rt().requestAnimationFrame(()=>{var f,D;(D=(f=d.current)==null?void 0:f.scrollIntoView)==null||D.call(f,{block:"nearest"})})},[w,d]),fe(()=>{if(!u)return c.actions.registerOption(n,h),()=>c.actions.unregisterOption(n)},[h,n,u]);let _=T(f=>{if(o)return f.preventDefault();c.actions.selectOption(a)}),k=T(()=>{if(o)return c.actions.goToOption({focus:x.Nothing});c.actions.goToOption({focus:x.Specific,id:n})}),y=wt(),L=T(f=>y.update(f)),$=T(f=>{y.wasMoved(f)&&(o||b&&c.state.activationTrigger===oe.Pointer||c.actions.goToOption({focus:x.Specific,id:n},oe.Pointer))}),j=T(f=>{y.wasMoved(f)&&(o||b&&c.state.activationTrigger===oe.Pointer&&c.actions.goToOption({focus:x.Nothing}))}),z=q({active:b,focus:b,selected:g,disabled:o,selectedOption:g&&u}),C=u?{}:{id:n,ref:P,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:_,onFocus:k,onPointerEnter:L,onMouseEnter:L,onPointerMove:$,onMouseMove:$,onPointerLeave:j,onMouseLeave:j},Q=Z();return!g&&u?null:Q({ourProps:C,theirProps:r,slot:z,defaultTag:Gt,name:"Listbox.Option"})}let Yt=p.Fragment;function Zt(e,s){let{options:t,placeholder:n,...o}=e,a={ref:Y(s)},r=J("ListboxSelectedOption"),u=q({}),m=r.value===void 0||r.value===null||r.mode===B.Multi&&Array.isArray(r.value)&&r.value.length===0,c=Z();return F.createElement(Pe.Provider,{value:!0},c({ourProps:a,theirProps:{...o,children:F.createElement(F.Fragment,null,n&&m?n:t)},slot:u,defaultTag:Yt,name:"ListboxSelectedOption"}))}let Jt=W(zt),De=W(Ut),Xt=Be,Fe=W(qt),ke=W(Wt),Te=W(Zt),en=Object.assign(Jt,{Button:De,Label:Xt,Options:Fe,Option:ke,SelectedOption:Te});function sn({value:e,onChange:s,className:t,placeholder:n,disabled:o,"aria-label":a,children:r}){return I.jsx(en,{value:e,onChange:s,disabled:o,children:({open:u})=>I.jsxs("div",{className:H("relative",t),children:[I.jsxs(De,{"aria-label":a,className:H(["relative flex w-full items-center justify-between gap-2","radius-inner px-3 py-2","text-left text-sm text-fg-primary","bg-input-bg border border-input-border","ring-focus-inset","hover:border-edge-strong","disabled:opacity-40 disabled:pointer-events-none disabled:cursor-not-allowed","transition-colors"]),children:[I.jsx(Te,{as:"span",options:r,placeholder:n&&I.jsx("span",{className:"text-fg-muted",children:n}),className:"block truncate"}),I.jsx(xt,{className:H("w-4 h-4 text-fg-muted transition-transform duration-200",u&&"rotate-180")})]}),I.jsx(ht,{children:u&&I.jsx(gt.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:Ot.dropdown,className:"absolute z-50 mt-1",children:I.jsx(Fe,{static:!0,anchor:"bottom start",className:H(["w-[var(--button-width)] min-w-[180px]","max-h-60 overflow-y-auto overscroll-contain scroll-py-1","radius-inset p-1","surface-elevated","focus:outline-none"]),children:r})})})]})})}function an({value:e,disabled:s,className:t,children:n}){return I.jsx(ke,{as:p.Fragment,value:e,disabled:s,children:({selected:o,focus:a})=>I.jsxs("div",{className:H("flex items-center gap-2 px-3 py-2 radius-control cursor-default","text-sm",a&&"bg-sys-blue text-white",!a&&"text-fg-primary",o&&!a&&"text-sys-blue",s&&"opacity-50 cursor-not-allowed",t),children:[I.jsx("span",{className:"w-4 flex-shrink-0",children:o&&I.jsx(St,{className:"w-4 h-4"})}),I.jsx("span",{className:"truncate",children:n})]})})}function rn({className:e,...s}){return I.jsx("span",{...s,className:H("truncate",e)})}export{sn as L,an as a,rn as b}; diff --git a/frontend/dist/assets/map-pin-BCwmmHGs.js b/frontend/dist/assets/map-pin-BXCqDxIA.js similarity index 99% rename from frontend/dist/assets/map-pin-BCwmmHGs.js rename to frontend/dist/assets/map-pin-BXCqDxIA.js index ba7bb9eb..8620ef05 100644 --- a/frontend/dist/assets/map-pin-BCwmmHGs.js +++ b/frontend/dist/assets/map-pin-BXCqDxIA.js @@ -1,4 +1,4 @@ -import{r as g,ay as ot,b9 as de,aO as ct,eW as me,aX as ge,au as Kt,aL as he,d as pe}from"./index-CvSa8h-C.js";function Dt(t){if(t===null)return{width:0,height:0};let{width:e,height:n}=t.getBoundingClientRect();return{width:e,height:n}}function Vn(t,e,n=!1){let[o,r]=g.useState(()=>Dt(e));return ot(()=>{if(!e||!t)return;let i=de();return i.requestAnimationFrame(function s(){i.requestAnimationFrame(s),r(l=>{let c=Dt(e);return c.width===l.width&&c.height===l.height?l:c})}),()=>{i.dispose()}},[e,t]),n?{width:`${o.width}px`,height:`${o.height}px`}:o}function dt(){return typeof window<"u"}function Q(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function z(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return dt()?t instanceof Node||t instanceof B(t).Node:!1}function k(t){return dt()?t instanceof Element||t instanceof B(t).Element:!1}function _(t){return dt()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Lt(t){return!dt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const we=new Set(["inline","contents"]);function rt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=W(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!we.has(r)}const xe=new Set(["table","td","th"]);function ye(t){return xe.has(Q(t))}const ve=[":popover-open",":modal"];function mt(t){return ve.some(e=>{try{return t.matches(e)}catch{return!1}})}const be=["transform","translate","scale","rotate","perspective"],Re=["transform","translate","scale","rotate","perspective","filter"],Ce=["paint","layout","strict","content"];function Et(t){const e=Ot(),n=k(t)?W(t):t;return be.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Re.some(o=>(n.willChange||"").includes(o))||Ce.some(o=>(n.contain||"").includes(o))}function Se(t){let e=q(t);for(;_(e)&&!J(e);){if(Et(e))return e;if(mt(e))return null;e=q(e)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ae=new Set(["html","body","#document"]);function J(t){return Ae.has(Q(t))}function W(t){return B(t).getComputedStyle(t)}function gt(t){return k(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(Q(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||z(t);return Lt(e)?e.host:e}function Jt(t){const e=q(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&rt(e)?e:Jt(e)}function et(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=B(r);if(i){const l=Ct(s);return e.concat(s,s.visualViewport||[],rt(r)?r:[],l&&n?et(l):[])}return e.concat(r,et(r,[],n))}function Ct(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ee(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:o}=e;return n+"/"+o}).join(" "):navigator.userAgent}const U=Math.min,D=Math.max,nt=Math.round,st=Math.floor,V=t=>({x:t,y:t}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Te={start:"end",end:"start"};function Ht(t,e,n){return D(t,U(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function it(t){return t.split("-")[1]}function Qt(t){return t==="x"?"y":"x"}function Zt(t){return t==="y"?"height":"width"}const Me=new Set(["top","bottom"]);function Y(t){return Me.has(X(t))?"y":"x"}function te(t){return Qt(Y(t))}function Fe(t,e,n){n===void 0&&(n=!1);const o=it(t),r=te(t),i=Zt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=ft(s)),[s,ft(s)]}function Pe(t){const e=ft(t);return[St(t),e,St(e)]}function St(t){return t.replace(/start|end/g,e=>Te[e])}const kt=["left","right"],$t=["right","left"],De=["top","bottom"],Le=["bottom","top"];function He(t,e,n){switch(t){case"top":case"bottom":return n?e?$t:kt:e?kt:$t;case"left":case"right":return e?De:Le;default:return[]}}function ke(t,e,n,o){const r=it(t);let i=He(X(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(St)))),i}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Oe[e])}function $e(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ie(t){return typeof t!="number"?$e(t):{top:t,right:t,bottom:t,left:t}}function at(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function It(t,e,n){let{reference:o,floating:r}=t;const i=Y(e),s=te(e),l=Zt(s),c=X(e),f=i==="y",a=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,h=o[l]/2-r[l]/2;let u;switch(c){case"top":u={x:a,y:o.y-r.height};break;case"bottom":u={x:a,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:m};break;case"left":u={x:o.x-r.width,y:m};break;default:u={x:o.x,y:o.y}}switch(it(e)){case"start":u[s]-=h*(n&&f?-1:1);break;case"end":u[s]+=h*(n&&f?-1:1);break}return u}const Be=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:a,y:m}=It(f,o,c),h=o,u={},d=0;for(let p=0;pM<=0)){var O,$;const M=(((O=i.flip)==null?void 0:O.index)||0)+1,j=A[M];if(j&&(!(m==="alignment"?v!==Y(j):!1)||T.every(C=>Y(C.placement)===v?C.overflows[0]>0:!0)))return{data:{index:M,overflows:T},reset:{placement:j}};let F=($=T.filter(I=>I.overflows[0]<=0).sort((I,C)=>I.overflows[1]-C.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(u){case"bestFit":{var P;const I=(P=T.filter(C=>{if(S){const E=Y(C.placement);return E===v||E==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(E=>E>0).reduce((E,H)=>E+H,0)]).sort((C,E)=>C[1]-E[1])[0])==null?void 0:P[0];I&&(F=I);break}case"initialPlacement":F=l;break}if(r!==F)return{reset:{placement:F}}}return{}}}},We=new Set(["left","top"]);async function Ve(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),l=it(n),c=Y(n)==="y",f=We.has(s)?-1:1,a=i&&c?-1:1,m=Z(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:d}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),c?{x:u*a,y:h*f}:{x:h*f,y:u*a}}const _e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:l}=e,c=await Ve(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},ze=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x:y,y:v}=w;return{x:y,y:v}}},...c}=Z(t,e),f={x:n,y:o},a=await ht(e,c),m=Y(X(r)),h=Qt(m);let u=f[h],d=f[m];if(i){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=u+a[w],x=u-a[y];u=Ht(v,u,x)}if(s){const w=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=d+a[w],x=d-a[y];d=Ht(v,d,x)}const p=l.fn({...e,[h]:u,[m]:d});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:i,[m]:s}}}}}},je=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:l}=e,{apply:c=()=>{},...f}=Z(t,e),a=await ht(e,f),m=X(r),h=it(r),u=Y(r)==="y",{width:d,height:p}=i.floating;let w,y;m==="top"||m==="bottom"?(w=m,y=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(y=m,w=h==="end"?"top":"bottom");const v=p-a.top-a.bottom,x=d-a.left-a.right,b=U(p-a[w],v),R=U(d-a[y],x),S=!e.middlewareData.shift;let A=b,L=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(A=v),S&&!h){const T=D(a.left,0),O=D(a.right,0),$=D(a.top,0),P=D(a.bottom,0);u?L=d-2*(T!==0||O!==0?T+O:D(a.left,a.right)):A=p-2*($!==0||P!==0?$+P:D(a.top,a.bottom))}await c({...e,availableWidth:L,availableHeight:A});const N=await s.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function ee(t){const e=W(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=_(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,l=nt(n)!==i||nt(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Tt(t){return k(t)?t:t.contextElement}function G(t){const e=Tt(t);if(!_(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ee(e);let s=(i?nt(n.width):n.width)/o,l=(i?nt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ye=V(0);function ne(t){const e=B(t);return!Ot()||!e.visualViewport?Ye:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function K(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=Tt(t);let s=V(1);e&&(o?k(o)&&(s=G(o)):s=G(t));const l=qe(i,n,o)?ne(i):V(0);let c=(r.left+l.x)/s.x,f=(r.top+l.y)/s.y,a=r.width/s.x,m=r.height/s.y;if(i){const h=B(i),u=o&&k(o)?B(o):o;let d=h,p=Ct(d);for(;p&&o&&u!==d;){const w=G(p),y=p.getBoundingClientRect(),v=W(p),x=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*w.x,b=y.top+(p.clientTop+parseFloat(v.paddingTop))*w.y;c*=w.x,f*=w.y,a*=w.x,m*=w.y,c+=x,f+=b,d=B(p),p=Ct(d)}}return at({width:a,height:m,x:c,y:f})}function pt(t,e){const n=gt(t).scrollLeft;return e?e.left+n:K(z(t)).left+n}function oe(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-pt(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Xe(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=z(o),l=e?mt(e.floating):!1;if(o===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},f=V(1);const a=V(0),m=_(o);if((m||!m&&!i)&&((Q(o)!=="body"||rt(s))&&(c=gt(o)),_(o))){const u=K(o);f=G(o),a.x=u.x+o.clientLeft,a.y=u.y+o.clientTop}const h=s&&!m&&!i?oe(s,c):V(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+a.x+h.x,y:n.y*f.y-c.scrollTop*f.y+a.y+h.y}}function Ue(t){return Array.from(t.getClientRects())}function Ke(t){const e=z(t),n=gt(t),o=t.ownerDocument.body,r=D(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=D(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+pt(t);const l=-n.scrollTop;return W(o).direction==="rtl"&&(s+=D(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:l}}const Bt=25;function Ge(t,e){const n=B(t),o=z(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,c=0;if(r){i=r.width,s=r.height;const a=Ot();(!a||a&&e==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const f=pt(o);if(f<=0){const a=o.ownerDocument,m=a.body,h=getComputedStyle(m),u=a.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,d=Math.abs(o.clientWidth-m.clientWidth-u);d<=Bt&&(i-=d)}else f<=Bt&&(i+=f);return{width:i,height:s,x:l,y:c}}const Je=new Set(["absolute","fixed"]);function Qe(t,e){const n=K(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?G(t):V(1),s=t.clientWidth*i.x,l=t.clientHeight*i.y,c=r*i.x,f=o*i.y;return{width:s,height:l,x:c,y:f}}function Nt(t,e,n){let o;if(e==="viewport")o=Ge(t,n);else if(e==="document")o=Ke(z(t));else if(k(e))o=Qe(e,n);else{const r=ne(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return at(o)}function re(t,e){const n=q(t);return n===e||!k(n)||J(n)?!1:W(n).position==="fixed"||re(n,e)}function Ze(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(l=>k(l)&&Q(l)!=="body"),r=null;const i=W(t).position==="fixed";let s=i?q(t):t;for(;k(s)&&!J(s);){const l=W(s),c=Et(s);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&Je.has(r.position)||rt(s)&&!c&&re(t,s))?o=o.filter(a=>a!==s):r=l,s=q(s)}return e.set(t,o),o}function tn(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?mt(e)?[]:Ze(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((f,a)=>{const m=Nt(e,a,r);return f.top=D(m.top,f.top),f.right=U(m.right,f.right),f.bottom=U(m.bottom,f.bottom),f.left=D(m.left,f.left),f},Nt(e,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function en(t){const{width:e,height:n}=ee(t);return{width:e,height:n}}function nn(t,e,n){const o=_(e),r=z(e),i=n==="fixed",s=K(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=V(0);function f(){c.x=pt(r)}if(o||!o&&!i)if((Q(e)!=="body"||rt(r))&&(l=gt(e)),o){const u=K(e,!0,i,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else r&&f();i&&!o&&r&&f();const a=r&&!o&&!i?oe(r,l):V(0),m=s.left+l.scrollLeft-c.x-a.x,h=s.top+l.scrollTop-c.y-a.y;return{x:m,y:h,width:s.width,height:s.height}}function xt(t){return W(t).position==="static"}function Wt(t,e){if(!_(t)||W(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return z(t)===n&&(n=n.ownerDocument.body),n}function ie(t,e){const n=B(t);if(mt(t))return n;if(!_(t)){let r=q(t);for(;r&&!J(r);){if(k(r)&&!xt(r))return r;r=q(r)}return n}let o=Wt(t,e);for(;o&&ye(o)&&xt(o);)o=Wt(o,e);return o&&J(o)&&xt(o)&&!Et(o)?n:o||Se(t)||n}const on=async function(t){const e=this.getOffsetParent||ie,n=this.getDimensions,o=await n(t.floating);return{reference:nn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rn(t){return W(t).direction==="rtl"}const sn={convertOffsetParentRelativeRectToViewportRelativeRect:Xe,getDocumentElement:z,getClippingRect:tn,getOffsetParent:ie,getElementRects:on,getClientRects:Ue,getDimensions:en,getScale:G,isElement:k,isRTL:rn};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ln(t,e){let n=null,o;const r=z(t);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const f=t.getBoundingClientRect(),{left:a,top:m,width:h,height:u}=f;if(l||e(),!h||!u)return;const d=st(m),p=st(r.clientWidth-(a+h)),w=st(r.clientHeight-(m+u)),y=st(a),x={rootMargin:-d+"px "+-p+"px "+-w+"px "+-y+"px",threshold:D(0,U(1,c))||1};let b=!0;function R(S){const A=S[0].intersectionRatio;if(A!==c){if(!b)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!se(f,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(R,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,x)}n.observe(t)}return s(!0),i}function cn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,f=Tt(t),a=r||i?[...f?et(f):[],...et(e)]:[];a.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const m=f&&l?ln(f,n):null;let h=-1,u=null;s&&(u=new ResizeObserver(y=>{let[v]=y;v&&v.target===f&&u&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=u)==null||x.observe(e)})),n()}),f&&!c&&u.observe(f),u.observe(e));let d,p=c?K(t):null;c&&w();function w(){const y=K(t);p&&!se(p,y)&&n(),p=y,d=requestAnimationFrame(w)}return n(),()=>{var y;a.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),m==null||m(),(y=u)==null||y.disconnect(),u=null,c&&cancelAnimationFrame(d)}}const yt=ht,fn=_e,an=ze,un=Ne,dn=je,mn=(t,e,n)=>{const o=new Map,r={platform:sn,...n},i={...r.platform,_c:o};return Be(t,e,{...r,platform:i})};var gn=typeof document<"u",hn=function(){},lt=gn?g.useLayoutEffect:hn;function ut(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ut(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&t.$$typeof)&&!ut(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function le(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=le(t);return Math.round(e*n)/n}function vt(t){const e=g.useRef(t);return lt(()=>{e.current=t}),e}function pn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:f}=t,[a,m]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,u]=g.useState(o);ut(h,o)||u(o);const[d,p]=g.useState(null),[w,y]=g.useState(null),v=g.useCallback(C=>{C!==S.current&&(S.current=C,p(C))},[]),x=g.useCallback(C=>{C!==A.current&&(A.current=C,y(C))},[]),b=i||d,R=s||w,S=g.useRef(null),A=g.useRef(null),L=g.useRef(a),N=c!=null,T=vt(c),O=vt(r),$=vt(f),P=g.useCallback(()=>{if(!S.current||!A.current)return;const C={placement:e,strategy:n,middleware:h};O.current&&(C.platform=O.current),mn(S.current,A.current,C).then(E=>{const H={...E,isPositioned:$.current!==!1};M.current&&!ut(L.current,H)&&(L.current=H,ct.flushSync(()=>{m(H)}))})},[h,e,n,O,$]);lt(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,m(C=>({...C,isPositioned:!1})))},[f]);const M=g.useRef(!1);lt(()=>(M.current=!0,()=>{M.current=!1}),[]),lt(()=>{if(b&&(S.current=b),R&&(A.current=R),b&&R){if(T.current)return T.current(b,R,P);P()}},[b,R,P,T,N]);const j=g.useMemo(()=>({reference:S,floating:A,setReference:v,setFloating:x}),[v,x]),F=g.useMemo(()=>({reference:b,floating:R}),[b,R]),I=g.useMemo(()=>{const C={position:n,left:0,top:0};if(!F.floating)return C;const E=Vt(F.floating,a.x),H=Vt(F.floating,a.y);return l?{...C,transform:"translate("+E+"px, "+H+"px)",...le(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:H}},[n,l,F.floating,a.x,a.y]);return g.useMemo(()=>({...a,update:P,refs:j,elements:F,floatingStyles:I}),[a,P,j,F,I])}const ce=(t,e)=>({...fn(t),options:[t,e]}),wn=(t,e)=>({...an(t),options:[t,e]}),xn=(t,e)=>({...un(t),options:[t,e]}),yn=(t,e)=>({...dn(t),options:[t,e]}),fe={...me},vn=fe.useInsertionEffect,bn=vn||(t=>t());function ae(t){const e=g.useRef(()=>{});return bn(()=>{e.current=t}),g.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r"floating-ui-"+Math.random().toString(36).slice(2,6)+Rn++;function Cn(){const[t,e]=g.useState(()=>_t?zt():void 0);return At(()=>{t==null&&e(zt())},[]),g.useEffect(()=>{_t=!0},[]),t}const Sn=fe.useId,An=Sn||Cn;function En(){const t=new Map;return{emit(e,n){var o;(o=t.get(e))==null||o.forEach(r=>r(n))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var o;t.set(e,((o=t.get(e))==null?void 0:o.filter(r=>r!==n))||[])}}}const On=g.createContext(null),Tn=g.createContext(null),Mn=()=>{var t;return((t=g.useContext(On))==null?void 0:t.id)||null},Fn=()=>g.useContext(Tn),Pn="data-floating-ui-focusable";function Dn(t){const{open:e=!1,onOpenChange:n,elements:o}=t,r=An(),i=g.useRef({}),[s]=g.useState(()=>En()),l=Mn()!=null,[c,f]=g.useState(o.reference),a=ae((u,d,p)=>{i.current.openEvent=u?d:void 0,s.emit("openchange",{open:u,event:d,reason:p,nested:l}),n==null||n(u,d,p)}),m=g.useMemo(()=>({setPositionReference:f}),[]),h=g.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return g.useMemo(()=>({dataRef:i,open:e,onOpenChange:a,elements:h,events:s,floatingId:r,refs:m}),[e,a,h,s,r,m])}function Ln(t){t===void 0&&(t={});const{nodeId:e}=t,n=Dn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||n,r=o.elements,[i,s]=g.useState(null),[l,c]=g.useState(null),a=(r==null?void 0:r.domReference)||i,m=g.useRef(null),h=Fn();At(()=>{a&&(m.current=a)},[a]);const u=pn({...t,elements:{...r,...l&&{reference:l}}}),d=g.useCallback(x=>{const b=k(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(b),u.refs.setReference(b)},[u.refs]),p=g.useCallback(x=>{(k(x)||x===null)&&(m.current=x,s(x)),(k(u.refs.reference.current)||u.refs.reference.current===null||x!==null&&!k(x))&&u.refs.setReference(x)},[u.refs]),w=g.useMemo(()=>({...u.refs,setReference:p,setPositionReference:d,domReference:m}),[u.refs,p,d]),y=g.useMemo(()=>({...u.elements,domReference:a}),[u.elements,a]),v=g.useMemo(()=>({...u,...o,refs:w,elements:y,nodeId:e}),[u,w,y,e,o]);return At(()=>{o.dataRef.current.floatingContext=v;const x=h==null?void 0:h.nodesRef.current.find(b=>b.id===e);x&&(x.context=v)}),g.useMemo(()=>({...u,context:v,refs:w,elements:y}),[u,w,y,v])}const jt="active",Yt="selected";function bt(t,e,n){const o=new Map,r=n==="item";let i=t;if(r&&t){const{[jt]:s,[Yt]:l,...c}=t;i=c}return{...n==="floating"&&{tabIndex:-1,[Pn]:""},...i,...e.map(s=>{const l=s?s[n]:null;return typeof l=="function"?t?l(t):null:l}).concat(t).reduce((s,l)=>(l&&Object.entries(l).forEach(c=>{let[f,a]=c;if(!(r&&[jt,Yt].includes(f)))if(f.indexOf("on")===0){if(o.has(f)||o.set(f,[]),typeof a=="function"){var m;(m=o.get(f))==null||m.push(a),s[f]=function(){for(var h,u=arguments.length,d=new Array(u),p=0;pw(...d)).find(w=>w!==void 0)}}}else s[f]=a}),s),{})}}function Hn(t){t===void 0&&(t=[]);const e=t.map(l=>l==null?void 0:l.reference),n=t.map(l=>l==null?void 0:l.floating),o=t.map(l=>l==null?void 0:l.item),r=g.useCallback(l=>bt(l,t,"reference"),e),i=g.useCallback(l=>bt(l,t,"floating"),n),s=g.useCallback(l=>bt(l,t,"item"),o);return g.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}function qt(t,e){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:e}}}}const kn=t=>({name:"inner",options:t,async fn(e){const{listRef:n,overflowRef:o,onFallbackChange:r,offset:i=0,index:s=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:f,...a}=Z(t,e),{rects:m,elements:{floating:h}}=e,u=n.current[s],d=(f==null?void 0:f.current)||h,p=h.clientTop||d.clientTop,w=h.clientTop!==0,y=d.clientTop!==0,v=h===d;if(!u)return{};const x={...e,...await ce(-u.offsetTop-h.clientTop-m.reference.height/2-u.offsetHeight/2-i).fn(e)},b=await yt(qt(x,d.scrollHeight+p+h.clientTop),a),R=await yt(x,{...a,elementContext:"reference"}),S=D(0,b.top),A=x.y+S,T=(d.scrollHeight>d.clientHeight?O=>O:nt)(D(0,d.scrollHeight+(w&&v||y?p*2:0)-S-D(0,b.bottom)));if(d.style.maxHeight=T+"px",d.scrollTop=S,r){const O=d.offsetHeight=-c||R.bottom>=-c;ct.flushSync(()=>r(O))}return o&&(o.current=await yt(qt({...x,y:A},d.offsetHeight+p+h.clientTop),a)),{y:A}}});function $n(t,e){const{open:n,elements:o}=t,{enabled:r=!0,overflowRef:i,scrollRef:s,onChange:l}=e,c=ae(l),f=g.useRef(!1),a=g.useRef(null),m=g.useRef(null);g.useEffect(()=>{if(!r)return;function u(p){if(p.ctrlKey||!d||i.current==null)return;const w=p.deltaY,y=i.current.top>=-.5,v=i.current.bottom>=-.5,x=d.scrollHeight-d.clientHeight,b=w<0?-1:1,R=w<0?"max":"min";d.scrollHeight<=d.clientHeight||(!y&&w>0||!v&&w<0?(p.preventDefault(),ct.flushSync(()=>{c(S=>S+Math[R](w,x*b))})):/firefox/i.test(Ee())&&(d.scrollTop+=w))}const d=(s==null?void 0:s.current)||o.floating;if(n&&d)return d.addEventListener("wheel",u),requestAnimationFrame(()=>{a.current=d.scrollTop,i.current!=null&&(m.current={...i.current})}),()=>{a.current=null,m.current=null,d.removeEventListener("wheel",u)}},[r,n,o.floating,i,s,c]);const h=g.useMemo(()=>({onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const u=(s==null?void 0:s.current)||o.floating;if(!(!i.current||!u||!f.current)){if(a.current!==null){const d=u.scrollTop-a.current;(i.current.bottom<-.5&&d<-1||i.current.top<-.5&&d>1)&&ct.flushSync(()=>c(p=>p+d))}requestAnimationFrame(()=>{a.current=u.scrollTop})}}}),[o.floating,c,i,s]);return g.useMemo(()=>r?{floating:h}:{},[r,h])}let tt=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});tt.displayName="FloatingContext";let Mt=g.createContext(null);Mt.displayName="PlacementContext";function _n(t){return g.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function zn(){return g.useContext(tt).setReference}function jn(){return g.useContext(tt).getReferenceProps}function Yn(){let{getFloatingProps:t,slot:e}=g.useContext(tt);return g.useCallback((...n)=>Object.assign({},t(...n),{"data-anchor":e.anchor}),[t,e])}function qn(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=g.useContext(Mt),n=g.useMemo(()=>t,[JSON.stringify(t,(r,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);ot(()=>{e==null||e(n??null)},[e,n]);let o=g.useContext(tt);return g.useMemo(()=>[o.setFloating,t?o.styles:{}],[o.setFloating,t,o.styles])}let Xt=4;function Xn({children:t,enabled:e=!0}){let[n,o]=g.useState(null),[r,i]=g.useState(0),s=g.useRef(null),[l,c]=g.useState(null);In(l);let f=e&&n!==null&&l!==null,{to:a="bottom",gap:m=0,offset:h=0,padding:u=0,inner:d}=Bn(n,l),[p,w="center"]=a.split(" ");ot(()=>{f&&i(0)},[f]);let{refs:y,floatingStyles:v,context:x}=Ln({open:f,placement:p==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${p}`:`${p}-${w}`,strategy:"absolute",transform:!1,middleware:[ce({mainAxis:p==="selection"?0:m,crossAxis:h}),wn({padding:u}),p!=="selection"&&xn({padding:u}),p==="selection"&&d?kn({...d,padding:u,overflowRef:s,offset:r,minItemsVisible:Xt,referenceOverflowThreshold:u,onFallbackChange(O){var $,P;if(!O)return;let M=x.elements.floating;if(!M)return;let j=parseFloat(getComputedStyle(M).scrollPaddingBottom)||0,F=Math.min(Xt,M.childElementCount),I=0,C=0;for(let E of(P=($=x.elements.floating)==null?void 0:$.childNodes)!=null?P:[])if(ge(E)){let H=E.offsetTop,Ft=H+E.clientHeight+j,wt=M.scrollTop,Pt=wt+M.clientHeight;if(H>=wt&&Ft<=Pt)F--;else{C=Math.max(0,Math.min(Ft,Pt)-Math.max(H,wt)),I=E.clientHeight;break}}F>=1&&i(E=>{let H=I*F-C+j;return E>=H?E:H})}}):null,yn({padding:u,apply({availableWidth:O,availableHeight:$,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${O}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${$}px)`})}})].filter(Boolean),whileElementsMounted:cn}),[b=p,R=w]=x.placement.split("-");p==="selection"&&(b="selection");let S=g.useMemo(()=>({anchor:[b,R].filter(Boolean).join(" ")}),[b,R]),A=$n(x,{overflowRef:s,onChange:i}),{getReferenceProps:L,getFloatingProps:N}=Hn([A]),T=Kt(O=>{c(O),y.setFloating(O)});return g.createElement(Mt.Provider,{value:o},g.createElement(tt.Provider,{value:{setFloating:T,setReference:y.setReference,styles:v,getReferenceProps:L,getFloatingProps:N,slot:S}},t))}function In(t){ot(()=>{if(!t)return;let e=new MutationObserver(()=>{let n=window.getComputedStyle(t).maxHeight,o=parseFloat(n);if(isNaN(o))return;let r=parseInt(n);isNaN(r)||o!==r&&(t.style.maxHeight=`${Math.ceil(o)}px`)});return e.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{e.disconnect()}},[t])}function Bn(t,e){var n,o,r;let i=Rt((n=t==null?void 0:t.gap)!=null?n:"var(--anchor-gap, 0)",e),s=Rt((o=t==null?void 0:t.offset)!=null?o:"var(--anchor-offset, 0)",e),l=Rt((r=t==null?void 0:t.padding)!=null?r:"var(--anchor-padding, 0)",e);return{...t,gap:i,offset:s,padding:l}}function Rt(t,e,n=void 0){let o=he(),r=Kt((c,f)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!f)return[n,null];let a=Ut(c,f);return[a,m=>{let h=ue(c);{let u=h.map(d=>window.getComputedStyle(f).getPropertyValue(d));o.requestAnimationFrame(function d(){o.nextFrame(d);let p=!1;for(let[y,v]of h.entries()){let x=window.getComputedStyle(f).getPropertyValue(v);if(u[y]!==x){u[y]=x,p=!0;break}}if(!p)return;let w=Ut(c,f);a!==w&&(m(w),a=w)})}return o.dispose}]}return[n,null]}),i=g.useMemo(()=>r(t,e)[0],[t,e]),[s=i,l]=g.useState();return ot(()=>{let[c,f]=r(t,e);if(l(c),!!f)return f(l)},[t,e]),s}function ue(t){let e=/var\((.*)\)/.exec(t);if(e){let n=e[1].indexOf(",");if(n===-1)return[e[1]];let o=e[1].slice(0,n).trim(),r=e[1].slice(n+1).trim();return r?[o,...ue(r)]:[o]}return[]}function Ut(t,e){let n=document.createElement("div");e.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",t,"important");let o=parseFloat(window.getComputedStyle(n).marginTop)||0;return e.removeChild(n),o}/** +import{r as g,ay as ot,b9 as de,aO as ct,eW as me,aX as ge,au as Kt,aL as he,d as pe}from"./index-WhzslczH.js";function Dt(t){if(t===null)return{width:0,height:0};let{width:e,height:n}=t.getBoundingClientRect();return{width:e,height:n}}function Vn(t,e,n=!1){let[o,r]=g.useState(()=>Dt(e));return ot(()=>{if(!e||!t)return;let i=de();return i.requestAnimationFrame(function s(){i.requestAnimationFrame(s),r(l=>{let c=Dt(e);return c.width===l.width&&c.height===l.height?l:c})}),()=>{i.dispose()}},[e,t]),n?{width:`${o.width}px`,height:`${o.height}px`}:o}function dt(){return typeof window<"u"}function Q(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function z(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return dt()?t instanceof Node||t instanceof B(t).Node:!1}function k(t){return dt()?t instanceof Element||t instanceof B(t).Element:!1}function _(t){return dt()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Lt(t){return!dt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const we=new Set(["inline","contents"]);function rt(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=W(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!we.has(r)}const xe=new Set(["table","td","th"]);function ye(t){return xe.has(Q(t))}const ve=[":popover-open",":modal"];function mt(t){return ve.some(e=>{try{return t.matches(e)}catch{return!1}})}const be=["transform","translate","scale","rotate","perspective"],Re=["transform","translate","scale","rotate","perspective","filter"],Ce=["paint","layout","strict","content"];function Et(t){const e=Ot(),n=k(t)?W(t):t;return be.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Re.some(o=>(n.willChange||"").includes(o))||Ce.some(o=>(n.contain||"").includes(o))}function Se(t){let e=q(t);for(;_(e)&&!J(e);){if(Et(e))return e;if(mt(e))return null;e=q(e)}return null}function Ot(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ae=new Set(["html","body","#document"]);function J(t){return Ae.has(Q(t))}function W(t){return B(t).getComputedStyle(t)}function gt(t){return k(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function q(t){if(Q(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||z(t);return Lt(e)?e.host:e}function Jt(t){const e=q(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&rt(e)?e:Jt(e)}function et(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=Jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=B(r);if(i){const l=Ct(s);return e.concat(s,s.visualViewport||[],rt(r)?r:[],l&&n?et(l):[])}return e.concat(r,et(r,[],n))}function Ct(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ee(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:o}=e;return n+"/"+o}).join(" "):navigator.userAgent}const U=Math.min,D=Math.max,nt=Math.round,st=Math.floor,V=t=>({x:t,y:t}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Te={start:"end",end:"start"};function Ht(t,e,n){return D(t,U(e,n))}function Z(t,e){return typeof t=="function"?t(e):t}function X(t){return t.split("-")[0]}function it(t){return t.split("-")[1]}function Qt(t){return t==="x"?"y":"x"}function Zt(t){return t==="y"?"height":"width"}const Me=new Set(["top","bottom"]);function Y(t){return Me.has(X(t))?"y":"x"}function te(t){return Qt(Y(t))}function Fe(t,e,n){n===void 0&&(n=!1);const o=it(t),r=te(t),i=Zt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=ft(s)),[s,ft(s)]}function Pe(t){const e=ft(t);return[St(t),e,St(e)]}function St(t){return t.replace(/start|end/g,e=>Te[e])}const kt=["left","right"],$t=["right","left"],De=["top","bottom"],Le=["bottom","top"];function He(t,e,n){switch(t){case"top":case"bottom":return n?e?$t:kt:e?kt:$t;case"left":case"right":return e?De:Le;default:return[]}}function ke(t,e,n,o){const r=it(t);let i=He(X(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(St)))),i}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Oe[e])}function $e(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ie(t){return typeof t!="number"?$e(t):{top:t,right:t,bottom:t,left:t}}function at(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function It(t,e,n){let{reference:o,floating:r}=t;const i=Y(e),s=te(e),l=Zt(s),c=X(e),f=i==="y",a=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,h=o[l]/2-r[l]/2;let u;switch(c){case"top":u={x:a,y:o.y-r.height};break;case"bottom":u={x:a,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:m};break;case"left":u={x:o.x-r.width,y:m};break;default:u={x:o.x,y:o.y}}switch(it(e)){case"start":u[s]-=h*(n&&f?-1:1);break;case"end":u[s]+=h*(n&&f?-1:1);break}return u}const Be=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let f=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:a,y:m}=It(f,o,c),h=o,u={},d=0;for(let p=0;pM<=0)){var O,$;const M=(((O=i.flip)==null?void 0:O.index)||0)+1,j=A[M];if(j&&(!(m==="alignment"?v!==Y(j):!1)||T.every(C=>Y(C.placement)===v?C.overflows[0]>0:!0)))return{data:{index:M,overflows:T},reset:{placement:j}};let F=($=T.filter(I=>I.overflows[0]<=0).sort((I,C)=>I.overflows[1]-C.overflows[1])[0])==null?void 0:$.placement;if(!F)switch(u){case"bestFit":{var P;const I=(P=T.filter(C=>{if(S){const E=Y(C.placement);return E===v||E==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(E=>E>0).reduce((E,H)=>E+H,0)]).sort((C,E)=>C[1]-E[1])[0])==null?void 0:P[0];I&&(F=I);break}case"initialPlacement":F=l;break}if(r!==F)return{reset:{placement:F}}}return{}}}},We=new Set(["left","top"]);async function Ve(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=X(n),l=it(n),c=Y(n)==="y",f=We.has(s)?-1:1,a=i&&c?-1:1,m=Z(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:d}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof d=="number"&&(u=l==="end"?d*-1:d),c?{x:u*a,y:h*f}:{x:h*f,y:u*a}}const _e=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:l}=e,c=await Ve(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},ze=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:w=>{let{x:y,y:v}=w;return{x:y,y:v}}},...c}=Z(t,e),f={x:n,y:o},a=await ht(e,c),m=Y(X(r)),h=Qt(m);let u=f[h],d=f[m];if(i){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",v=u+a[w],x=u-a[y];u=Ht(v,u,x)}if(s){const w=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=d+a[w],x=d-a[y];d=Ht(v,d,x)}const p=l.fn({...e,[h]:u,[m]:d});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[h]:i,[m]:s}}}}}},je=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:r,rects:i,platform:s,elements:l}=e,{apply:c=()=>{},...f}=Z(t,e),a=await ht(e,f),m=X(r),h=it(r),u=Y(r)==="y",{width:d,height:p}=i.floating;let w,y;m==="top"||m==="bottom"?(w=m,y=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(y=m,w=h==="end"?"top":"bottom");const v=p-a.top-a.bottom,x=d-a.left-a.right,b=U(p-a[w],v),R=U(d-a[y],x),S=!e.middlewareData.shift;let A=b,L=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(L=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(A=v),S&&!h){const T=D(a.left,0),O=D(a.right,0),$=D(a.top,0),P=D(a.bottom,0);u?L=d-2*(T!==0||O!==0?T+O:D(a.left,a.right)):A=p-2*($!==0||P!==0?$+P:D(a.top,a.bottom))}await c({...e,availableWidth:L,availableHeight:A});const N=await s.getDimensions(l.floating);return d!==N.width||p!==N.height?{reset:{rects:!0}}:{}}}};function ee(t){const e=W(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=_(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,l=nt(n)!==i||nt(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function Tt(t){return k(t)?t:t.contextElement}function G(t){const e=Tt(t);if(!_(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=ee(e);let s=(i?nt(n.width):n.width)/o,l=(i?nt(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Ye=V(0);function ne(t){const e=B(t);return!Ot()||!e.visualViewport?Ye:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function K(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=Tt(t);let s=V(1);e&&(o?k(o)&&(s=G(o)):s=G(t));const l=qe(i,n,o)?ne(i):V(0);let c=(r.left+l.x)/s.x,f=(r.top+l.y)/s.y,a=r.width/s.x,m=r.height/s.y;if(i){const h=B(i),u=o&&k(o)?B(o):o;let d=h,p=Ct(d);for(;p&&o&&u!==d;){const w=G(p),y=p.getBoundingClientRect(),v=W(p),x=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*w.x,b=y.top+(p.clientTop+parseFloat(v.paddingTop))*w.y;c*=w.x,f*=w.y,a*=w.x,m*=w.y,c+=x,f+=b,d=B(p),p=Ct(d)}}return at({width:a,height:m,x:c,y:f})}function pt(t,e){const n=gt(t).scrollLeft;return e?e.left+n:K(z(t)).left+n}function oe(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-pt(t,n),r=n.top+e.scrollTop;return{x:o,y:r}}function Xe(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=z(o),l=e?mt(e.floating):!1;if(o===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},f=V(1);const a=V(0),m=_(o);if((m||!m&&!i)&&((Q(o)!=="body"||rt(s))&&(c=gt(o)),_(o))){const u=K(o);f=G(o),a.x=u.x+o.clientLeft,a.y=u.y+o.clientTop}const h=s&&!m&&!i?oe(s,c):V(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+a.x+h.x,y:n.y*f.y-c.scrollTop*f.y+a.y+h.y}}function Ue(t){return Array.from(t.getClientRects())}function Ke(t){const e=z(t),n=gt(t),o=t.ownerDocument.body,r=D(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=D(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+pt(t);const l=-n.scrollTop;return W(o).direction==="rtl"&&(s+=D(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:l}}const Bt=25;function Ge(t,e){const n=B(t),o=z(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,l=0,c=0;if(r){i=r.width,s=r.height;const a=Ot();(!a||a&&e==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const f=pt(o);if(f<=0){const a=o.ownerDocument,m=a.body,h=getComputedStyle(m),u=a.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,d=Math.abs(o.clientWidth-m.clientWidth-u);d<=Bt&&(i-=d)}else f<=Bt&&(i+=f);return{width:i,height:s,x:l,y:c}}const Je=new Set(["absolute","fixed"]);function Qe(t,e){const n=K(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=_(t)?G(t):V(1),s=t.clientWidth*i.x,l=t.clientHeight*i.y,c=r*i.x,f=o*i.y;return{width:s,height:l,x:c,y:f}}function Nt(t,e,n){let o;if(e==="viewport")o=Ge(t,n);else if(e==="document")o=Ke(z(t));else if(k(e))o=Qe(e,n);else{const r=ne(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return at(o)}function re(t,e){const n=q(t);return n===e||!k(n)||J(n)?!1:W(n).position==="fixed"||re(n,e)}function Ze(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(l=>k(l)&&Q(l)!=="body"),r=null;const i=W(t).position==="fixed";let s=i?q(t):t;for(;k(s)&&!J(s);){const l=W(s),c=Et(s);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&Je.has(r.position)||rt(s)&&!c&&re(t,s))?o=o.filter(a=>a!==s):r=l,s=q(s)}return e.set(t,o),o}function tn(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?mt(e)?[]:Ze(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((f,a)=>{const m=Nt(e,a,r);return f.top=D(m.top,f.top),f.right=U(m.right,f.right),f.bottom=U(m.bottom,f.bottom),f.left=D(m.left,f.left),f},Nt(e,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function en(t){const{width:e,height:n}=ee(t);return{width:e,height:n}}function nn(t,e,n){const o=_(e),r=z(e),i=n==="fixed",s=K(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=V(0);function f(){c.x=pt(r)}if(o||!o&&!i)if((Q(e)!=="body"||rt(r))&&(l=gt(e)),o){const u=K(e,!0,i,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else r&&f();i&&!o&&r&&f();const a=r&&!o&&!i?oe(r,l):V(0),m=s.left+l.scrollLeft-c.x-a.x,h=s.top+l.scrollTop-c.y-a.y;return{x:m,y:h,width:s.width,height:s.height}}function xt(t){return W(t).position==="static"}function Wt(t,e){if(!_(t)||W(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return z(t)===n&&(n=n.ownerDocument.body),n}function ie(t,e){const n=B(t);if(mt(t))return n;if(!_(t)){let r=q(t);for(;r&&!J(r);){if(k(r)&&!xt(r))return r;r=q(r)}return n}let o=Wt(t,e);for(;o&&ye(o)&&xt(o);)o=Wt(o,e);return o&&J(o)&&xt(o)&&!Et(o)?n:o||Se(t)||n}const on=async function(t){const e=this.getOffsetParent||ie,n=this.getDimensions,o=await n(t.floating);return{reference:nn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function rn(t){return W(t).direction==="rtl"}const sn={convertOffsetParentRelativeRectToViewportRelativeRect:Xe,getDocumentElement:z,getClippingRect:tn,getOffsetParent:ie,getElementRects:on,getClientRects:Ue,getDimensions:en,getScale:G,isElement:k,isRTL:rn};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ln(t,e){let n=null,o;const r=z(t);function i(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const f=t.getBoundingClientRect(),{left:a,top:m,width:h,height:u}=f;if(l||e(),!h||!u)return;const d=st(m),p=st(r.clientWidth-(a+h)),w=st(r.clientHeight-(m+u)),y=st(a),x={rootMargin:-d+"px "+-p+"px "+-w+"px "+-y+"px",threshold:D(0,U(1,c))||1};let b=!0;function R(S){const A=S[0].intersectionRatio;if(A!==c){if(!b)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!se(f,t.getBoundingClientRect())&&s(),b=!1}try{n=new IntersectionObserver(R,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(R,x)}n.observe(t)}return s(!0),i}function cn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,f=Tt(t),a=r||i?[...f?et(f):[],...et(e)]:[];a.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const m=f&&l?ln(f,n):null;let h=-1,u=null;s&&(u=new ResizeObserver(y=>{let[v]=y;v&&v.target===f&&u&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=u)==null||x.observe(e)})),n()}),f&&!c&&u.observe(f),u.observe(e));let d,p=c?K(t):null;c&&w();function w(){const y=K(t);p&&!se(p,y)&&n(),p=y,d=requestAnimationFrame(w)}return n(),()=>{var y;a.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),m==null||m(),(y=u)==null||y.disconnect(),u=null,c&&cancelAnimationFrame(d)}}const yt=ht,fn=_e,an=ze,un=Ne,dn=je,mn=(t,e,n)=>{const o=new Map,r={platform:sn,...n},i={...r.platform,_c:o};return Be(t,e,{...r,platform:i})};var gn=typeof document<"u",hn=function(){},lt=gn?g.useLayoutEffect:hn;function ut(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!ut(t[o],e[o]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&t.$$typeof)&&!ut(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function le(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=le(t);return Math.round(e*n)/n}function vt(t){const e=g.useRef(t);return lt(()=>{e.current=t}),e}function pn(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:f}=t,[a,m]=g.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,u]=g.useState(o);ut(h,o)||u(o);const[d,p]=g.useState(null),[w,y]=g.useState(null),v=g.useCallback(C=>{C!==S.current&&(S.current=C,p(C))},[]),x=g.useCallback(C=>{C!==A.current&&(A.current=C,y(C))},[]),b=i||d,R=s||w,S=g.useRef(null),A=g.useRef(null),L=g.useRef(a),N=c!=null,T=vt(c),O=vt(r),$=vt(f),P=g.useCallback(()=>{if(!S.current||!A.current)return;const C={placement:e,strategy:n,middleware:h};O.current&&(C.platform=O.current),mn(S.current,A.current,C).then(E=>{const H={...E,isPositioned:$.current!==!1};M.current&&!ut(L.current,H)&&(L.current=H,ct.flushSync(()=>{m(H)}))})},[h,e,n,O,$]);lt(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,m(C=>({...C,isPositioned:!1})))},[f]);const M=g.useRef(!1);lt(()=>(M.current=!0,()=>{M.current=!1}),[]),lt(()=>{if(b&&(S.current=b),R&&(A.current=R),b&&R){if(T.current)return T.current(b,R,P);P()}},[b,R,P,T,N]);const j=g.useMemo(()=>({reference:S,floating:A,setReference:v,setFloating:x}),[v,x]),F=g.useMemo(()=>({reference:b,floating:R}),[b,R]),I=g.useMemo(()=>{const C={position:n,left:0,top:0};if(!F.floating)return C;const E=Vt(F.floating,a.x),H=Vt(F.floating,a.y);return l?{...C,transform:"translate("+E+"px, "+H+"px)",...le(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:H}},[n,l,F.floating,a.x,a.y]);return g.useMemo(()=>({...a,update:P,refs:j,elements:F,floatingStyles:I}),[a,P,j,F,I])}const ce=(t,e)=>({...fn(t),options:[t,e]}),wn=(t,e)=>({...an(t),options:[t,e]}),xn=(t,e)=>({...un(t),options:[t,e]}),yn=(t,e)=>({...dn(t),options:[t,e]}),fe={...me},vn=fe.useInsertionEffect,bn=vn||(t=>t());function ae(t){const e=g.useRef(()=>{});return bn(()=>{e.current=t}),g.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r"floating-ui-"+Math.random().toString(36).slice(2,6)+Rn++;function Cn(){const[t,e]=g.useState(()=>_t?zt():void 0);return At(()=>{t==null&&e(zt())},[]),g.useEffect(()=>{_t=!0},[]),t}const Sn=fe.useId,An=Sn||Cn;function En(){const t=new Map;return{emit(e,n){var o;(o=t.get(e))==null||o.forEach(r=>r(n))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var o;t.set(e,((o=t.get(e))==null?void 0:o.filter(r=>r!==n))||[])}}}const On=g.createContext(null),Tn=g.createContext(null),Mn=()=>{var t;return((t=g.useContext(On))==null?void 0:t.id)||null},Fn=()=>g.useContext(Tn),Pn="data-floating-ui-focusable";function Dn(t){const{open:e=!1,onOpenChange:n,elements:o}=t,r=An(),i=g.useRef({}),[s]=g.useState(()=>En()),l=Mn()!=null,[c,f]=g.useState(o.reference),a=ae((u,d,p)=>{i.current.openEvent=u?d:void 0,s.emit("openchange",{open:u,event:d,reason:p,nested:l}),n==null||n(u,d,p)}),m=g.useMemo(()=>({setPositionReference:f}),[]),h=g.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return g.useMemo(()=>({dataRef:i,open:e,onOpenChange:a,elements:h,events:s,floatingId:r,refs:m}),[e,a,h,s,r,m])}function Ln(t){t===void 0&&(t={});const{nodeId:e}=t,n=Dn({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||n,r=o.elements,[i,s]=g.useState(null),[l,c]=g.useState(null),a=(r==null?void 0:r.domReference)||i,m=g.useRef(null),h=Fn();At(()=>{a&&(m.current=a)},[a]);const u=pn({...t,elements:{...r,...l&&{reference:l}}}),d=g.useCallback(x=>{const b=k(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(b),u.refs.setReference(b)},[u.refs]),p=g.useCallback(x=>{(k(x)||x===null)&&(m.current=x,s(x)),(k(u.refs.reference.current)||u.refs.reference.current===null||x!==null&&!k(x))&&u.refs.setReference(x)},[u.refs]),w=g.useMemo(()=>({...u.refs,setReference:p,setPositionReference:d,domReference:m}),[u.refs,p,d]),y=g.useMemo(()=>({...u.elements,domReference:a}),[u.elements,a]),v=g.useMemo(()=>({...u,...o,refs:w,elements:y,nodeId:e}),[u,w,y,e,o]);return At(()=>{o.dataRef.current.floatingContext=v;const x=h==null?void 0:h.nodesRef.current.find(b=>b.id===e);x&&(x.context=v)}),g.useMemo(()=>({...u,context:v,refs:w,elements:y}),[u,w,y,v])}const jt="active",Yt="selected";function bt(t,e,n){const o=new Map,r=n==="item";let i=t;if(r&&t){const{[jt]:s,[Yt]:l,...c}=t;i=c}return{...n==="floating"&&{tabIndex:-1,[Pn]:""},...i,...e.map(s=>{const l=s?s[n]:null;return typeof l=="function"?t?l(t):null:l}).concat(t).reduce((s,l)=>(l&&Object.entries(l).forEach(c=>{let[f,a]=c;if(!(r&&[jt,Yt].includes(f)))if(f.indexOf("on")===0){if(o.has(f)||o.set(f,[]),typeof a=="function"){var m;(m=o.get(f))==null||m.push(a),s[f]=function(){for(var h,u=arguments.length,d=new Array(u),p=0;pw(...d)).find(w=>w!==void 0)}}}else s[f]=a}),s),{})}}function Hn(t){t===void 0&&(t=[]);const e=t.map(l=>l==null?void 0:l.reference),n=t.map(l=>l==null?void 0:l.floating),o=t.map(l=>l==null?void 0:l.item),r=g.useCallback(l=>bt(l,t,"reference"),e),i=g.useCallback(l=>bt(l,t,"floating"),n),s=g.useCallback(l=>bt(l,t,"item"),o);return g.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}function qt(t,e){return{...t,rects:{...t.rects,floating:{...t.rects.floating,height:e}}}}const kn=t=>({name:"inner",options:t,async fn(e){const{listRef:n,overflowRef:o,onFallbackChange:r,offset:i=0,index:s=0,minItemsVisible:l=4,referenceOverflowThreshold:c=0,scrollRef:f,...a}=Z(t,e),{rects:m,elements:{floating:h}}=e,u=n.current[s],d=(f==null?void 0:f.current)||h,p=h.clientTop||d.clientTop,w=h.clientTop!==0,y=d.clientTop!==0,v=h===d;if(!u)return{};const x={...e,...await ce(-u.offsetTop-h.clientTop-m.reference.height/2-u.offsetHeight/2-i).fn(e)},b=await yt(qt(x,d.scrollHeight+p+h.clientTop),a),R=await yt(x,{...a,elementContext:"reference"}),S=D(0,b.top),A=x.y+S,T=(d.scrollHeight>d.clientHeight?O=>O:nt)(D(0,d.scrollHeight+(w&&v||y?p*2:0)-S-D(0,b.bottom)));if(d.style.maxHeight=T+"px",d.scrollTop=S,r){const O=d.offsetHeight=-c||R.bottom>=-c;ct.flushSync(()=>r(O))}return o&&(o.current=await yt(qt({...x,y:A},d.offsetHeight+p+h.clientTop),a)),{y:A}}});function $n(t,e){const{open:n,elements:o}=t,{enabled:r=!0,overflowRef:i,scrollRef:s,onChange:l}=e,c=ae(l),f=g.useRef(!1),a=g.useRef(null),m=g.useRef(null);g.useEffect(()=>{if(!r)return;function u(p){if(p.ctrlKey||!d||i.current==null)return;const w=p.deltaY,y=i.current.top>=-.5,v=i.current.bottom>=-.5,x=d.scrollHeight-d.clientHeight,b=w<0?-1:1,R=w<0?"max":"min";d.scrollHeight<=d.clientHeight||(!y&&w>0||!v&&w<0?(p.preventDefault(),ct.flushSync(()=>{c(S=>S+Math[R](w,x*b))})):/firefox/i.test(Ee())&&(d.scrollTop+=w))}const d=(s==null?void 0:s.current)||o.floating;if(n&&d)return d.addEventListener("wheel",u),requestAnimationFrame(()=>{a.current=d.scrollTop,i.current!=null&&(m.current={...i.current})}),()=>{a.current=null,m.current=null,d.removeEventListener("wheel",u)}},[r,n,o.floating,i,s,c]);const h=g.useMemo(()=>({onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const u=(s==null?void 0:s.current)||o.floating;if(!(!i.current||!u||!f.current)){if(a.current!==null){const d=u.scrollTop-a.current;(i.current.bottom<-.5&&d<-1||i.current.top<-.5&&d>1)&&ct.flushSync(()=>c(p=>p+d))}requestAnimationFrame(()=>{a.current=u.scrollTop})}}}),[o.floating,c,i,s]);return g.useMemo(()=>r?{floating:h}:{},[r,h])}let tt=g.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});tt.displayName="FloatingContext";let Mt=g.createContext(null);Mt.displayName="PlacementContext";function _n(t){return g.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function zn(){return g.useContext(tt).setReference}function jn(){return g.useContext(tt).getReferenceProps}function Yn(){let{getFloatingProps:t,slot:e}=g.useContext(tt);return g.useCallback((...n)=>Object.assign({},t(...n),{"data-anchor":e.anchor}),[t,e])}function qn(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=g.useContext(Mt),n=g.useMemo(()=>t,[JSON.stringify(t,(r,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);ot(()=>{e==null||e(n??null)},[e,n]);let o=g.useContext(tt);return g.useMemo(()=>[o.setFloating,t?o.styles:{}],[o.setFloating,t,o.styles])}let Xt=4;function Xn({children:t,enabled:e=!0}){let[n,o]=g.useState(null),[r,i]=g.useState(0),s=g.useRef(null),[l,c]=g.useState(null);In(l);let f=e&&n!==null&&l!==null,{to:a="bottom",gap:m=0,offset:h=0,padding:u=0,inner:d}=Bn(n,l),[p,w="center"]=a.split(" ");ot(()=>{f&&i(0)},[f]);let{refs:y,floatingStyles:v,context:x}=Ln({open:f,placement:p==="selection"?w==="center"?"bottom":`bottom-${w}`:w==="center"?`${p}`:`${p}-${w}`,strategy:"absolute",transform:!1,middleware:[ce({mainAxis:p==="selection"?0:m,crossAxis:h}),wn({padding:u}),p!=="selection"&&xn({padding:u}),p==="selection"&&d?kn({...d,padding:u,overflowRef:s,offset:r,minItemsVisible:Xt,referenceOverflowThreshold:u,onFallbackChange(O){var $,P;if(!O)return;let M=x.elements.floating;if(!M)return;let j=parseFloat(getComputedStyle(M).scrollPaddingBottom)||0,F=Math.min(Xt,M.childElementCount),I=0,C=0;for(let E of(P=($=x.elements.floating)==null?void 0:$.childNodes)!=null?P:[])if(ge(E)){let H=E.offsetTop,Ft=H+E.clientHeight+j,wt=M.scrollTop,Pt=wt+M.clientHeight;if(H>=wt&&Ft<=Pt)F--;else{C=Math.max(0,Math.min(Ft,Pt)-Math.max(H,wt)),I=E.clientHeight;break}}F>=1&&i(E=>{let H=I*F-C+j;return E>=H?E:H})}}):null,yn({padding:u,apply({availableWidth:O,availableHeight:$,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${O}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${$}px)`})}})].filter(Boolean),whileElementsMounted:cn}),[b=p,R=w]=x.placement.split("-");p==="selection"&&(b="selection");let S=g.useMemo(()=>({anchor:[b,R].filter(Boolean).join(" ")}),[b,R]),A=$n(x,{overflowRef:s,onChange:i}),{getReferenceProps:L,getFloatingProps:N}=Hn([A]),T=Kt(O=>{c(O),y.setFloating(O)});return g.createElement(Mt.Provider,{value:o},g.createElement(tt.Provider,{value:{setFloating:T,setReference:y.setReference,styles:v,getReferenceProps:L,getFloatingProps:N,slot:S}},t))}function In(t){ot(()=>{if(!t)return;let e=new MutationObserver(()=>{let n=window.getComputedStyle(t).maxHeight,o=parseFloat(n);if(isNaN(o))return;let r=parseInt(n);isNaN(r)||o!==r&&(t.style.maxHeight=`${Math.ceil(o)}px`)});return e.observe(t,{attributes:!0,attributeFilter:["style"]}),()=>{e.disconnect()}},[t])}function Bn(t,e){var n,o,r;let i=Rt((n=t==null?void 0:t.gap)!=null?n:"var(--anchor-gap, 0)",e),s=Rt((o=t==null?void 0:t.offset)!=null?o:"var(--anchor-offset, 0)",e),l=Rt((r=t==null?void 0:t.padding)!=null?r:"var(--anchor-padding, 0)",e);return{...t,gap:i,offset:s,padding:l}}function Rt(t,e,n=void 0){let o=he(),r=Kt((c,f)=>{if(c==null)return[n,null];if(typeof c=="number")return[c,null];if(typeof c=="string"){if(!f)return[n,null];let a=Ut(c,f);return[a,m=>{let h=ue(c);{let u=h.map(d=>window.getComputedStyle(f).getPropertyValue(d));o.requestAnimationFrame(function d(){o.nextFrame(d);let p=!1;for(let[y,v]of h.entries()){let x=window.getComputedStyle(f).getPropertyValue(v);if(u[y]!==x){u[y]=x,p=!0;break}}if(!p)return;let w=Ut(c,f);a!==w&&(m(w),a=w)})}return o.dispose}]}return[n,null]}),i=g.useMemo(()=>r(t,e)[0],[t,e]),[s=i,l]=g.useState();return ot(()=>{let[c,f]=r(t,e);if(l(c),!!f)return f(l)},[t,e]),s}function ue(t){let e=/var\((.*)\)/.exec(t);if(e){let n=e[1].indexOf(",");if(n===-1)return[e[1]];let o=e[1].slice(0,n).trim(),r=e[1].slice(n+1).trim();return r?[o,...ue(r)]:[o]}return[]}function Ut(t,e){let n=document.createElement("div");e.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",t,"important");let o=parseFloat(window.getComputedStyle(n).marginTop)||0;return e.removeChild(n),o}/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/maplibre-gl-CFrumWyy.js b/frontend/dist/assets/maplibre-gl-7drIhCrs.js similarity index 99% rename from frontend/dist/assets/maplibre-gl-CFrumWyy.js rename to frontend/dist/assets/maplibre-gl-7drIhCrs.js index 7176e409..7676b4bb 100644 --- a/frontend/dist/assets/maplibre-gl-CFrumWyy.js +++ b/frontend/dist/assets/maplibre-gl-7drIhCrs.js @@ -1,4 +1,4 @@ -var zg=Object.defineProperty;var kg=(br,wr,Ui)=>wr in br?zg(br,wr,{enumerable:!0,configurable:!0,writable:!0,value:Ui}):br[wr]=Ui;var Ge=(br,wr,Ui)=>kg(br,typeof wr!="symbol"?wr+"":wr,Ui);import{fG as Rg}from"./index-CvSa8h-C.js";function Lg(br,wr){for(var Ui=0;UiKi[en]})}}}return Object.freeze(Object.defineProperty(br,Symbol.toStringTag,{value:"Module"}))}var wu={exports:{}};/** +var zg=Object.defineProperty;var kg=(br,wr,Ui)=>wr in br?zg(br,wr,{enumerable:!0,configurable:!0,writable:!0,value:Ui}):br[wr]=Ui;var Ge=(br,wr,Ui)=>kg(br,typeof wr!="symbol"?wr+"":wr,Ui);import{fG as Rg}from"./index-WhzslczH.js";function Lg(br,wr){for(var Ui=0;UiKi[en]})}}}return Object.freeze(Object.defineProperty(br,Symbol.toStringTag,{value:"Module"}))}var wu={exports:{}};/** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.15.0/LICENSE.txt */var Fg=wu.exports,sf;function Bg(){return sf||(sf=1,(function(br,wr){(function(Ui,Ki){br.exports=Ki()})(Fg,(function(){var Ui={},Ki={};function en(z,h,Ee){if(Ki[z]=Ee,z==="index"){var Fr="var sharedModule = {}; ("+Ki.shared+")(sharedModule); ("+Ki.worker+")(sharedModule);",Ri={};return Ki.shared(Ri),Ki.index(Ui,Ri),typeof window<"u"&&Ui.setWorkerUrl(window.URL.createObjectURL(new Blob([Fr],{type:"text/javascript"}))),Ui}}en("shared",["exports"],(function(z){function h(r,e,i,s){return new(i||(i=Promise))((function(o,c){function u(y){try{g(s.next(y))}catch(v){c(v)}}function f(y){try{g(s.throw(y))}catch(v){c(v)}}function g(y){var v;y.done?o(y.value):(v=y.value,v instanceof i?v:new i((function(w){w(v)}))).then(u,f)}g((s=s.apply(r,e||[])).next())}))}function Ee(r,e){this.x=r,this.y=e}function Fr(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Ri,zn;typeof SuppressedError=="function"&&SuppressedError,Ee.prototype={clone(){return new Ee(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,e){return this.clone()._rotateAround(r,e)},matMult(r){return this.clone()._matMult(r)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){const e=r.x-this.x,i=r.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult(r){const e=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=e,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){const r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){const e=Math.cos(r),i=Math.sin(r),s=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=s,this},_rotateAround(r,e){const i=Math.cos(r),s=Math.sin(r),o=e.y+s*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-s*(this.y-e.y),this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Ee},Ee.convert=function(r){if(r instanceof Ee)return r;if(Array.isArray(r))return new Ee(+r[0],+r[1]);if(r.x!==void 0&&r.y!==void 0)return new Ee(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};var vs=(function(){if(zn)return Ri;function r(e,i,s,o){this.cx=3*e,this.bx=3*(s-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(o-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=s,this.p2y=o}return zn=1,Ri=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var s=e,o=0;o<8;o++){var c=this.sampleCurveX(s)-e;if(Math.abs(c)c?f=s:g=s,s=.5*(g-f)+f;return s},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Ri})(),oi=Fr(vs);let Tr,tt;function pe(){return Tr==null&&(Tr=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Tr}function kn(){if(tt==null&&(tt=!1,pe())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let s=0;s<25;s++){const o=4*s;e.fillStyle=`rgb(${o},${o+1},${o+2})`,e.fillRect(s%5,Math.floor(s/5),1,1)}const i=e.getImageData(0,0,5,5).data;for(let s=0;s<100;s++)if(s%4!=3&&i[s]!==s){tt=!0;break}}}return tt||!1}var Ct=1e-6,Tt=typeof Float32Array<"u"?Float32Array:Array;function Rn(){var r=new Tt(9);return Tt!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function Ln(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function bs(){var r=new Tt(3);return Tt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function Mi(r){var e=r[0],i=r[1],s=r[2];return Math.sqrt(e*e+i*i+s*s)}function Fn(r,e,i){var s=new Tt(3);return s[0]=r,s[1]=e,s[2]=i,s}function Br(r,e,i){return r[0]=e[0]+i[0],r[1]=e[1]+i[1],r[2]=e[2]+i[2],r}function Sr(r,e,i){return r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function tn(r,e,i){var s=e[0],o=e[1],c=e[2],u=i[0],f=i[1],g=i[2];return r[0]=o*g-c*f,r[1]=c*u-s*g,r[2]=s*f-o*u,r}var pr,fr=Mi;function ws(r,e,i){var s=e[0],o=e[1],c=e[2],u=e[3];return r[0]=i[0]*s+i[4]*o+i[8]*c+i[12]*u,r[1]=i[1]*s+i[5]*o+i[9]*c+i[13]*u,r[2]=i[2]*s+i[6]*o+i[10]*c+i[14]*u,r[3]=i[3]*s+i[7]*o+i[11]*c+i[15]*u,r}function rn(){var r=new Tt(4);return Tt!=Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r[3]=1,r}function wa(r,e,i,s){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"zyx",c=Math.PI/360;e*=c,s*=c,i*=c;var u=Math.sin(e),f=Math.cos(e),g=Math.sin(i),y=Math.cos(i),v=Math.sin(s),w=Math.cos(s);switch(o){case"xyz":r[0]=u*y*w+f*g*v,r[1]=f*g*w-u*y*v,r[2]=f*y*v+u*g*w,r[3]=f*y*w-u*g*v;break;case"xzy":r[0]=u*y*w-f*g*v,r[1]=f*g*w-u*y*v,r[2]=f*y*v+u*g*w,r[3]=f*y*w+u*g*v;break;case"yxz":r[0]=u*y*w+f*g*v,r[1]=f*g*w-u*y*v,r[2]=f*y*v-u*g*w,r[3]=f*y*w+u*g*v;break;case"yzx":r[0]=u*y*w+f*g*v,r[1]=f*g*w+u*y*v,r[2]=f*y*v-u*g*w,r[3]=f*y*w-u*g*v;break;case"zxy":r[0]=u*y*w-f*g*v,r[1]=f*g*w+u*y*v,r[2]=f*y*v+u*g*w,r[3]=f*y*w-u*g*v;break;case"zyx":r[0]=u*y*w-f*g*v,r[1]=f*g*w+u*y*v,r[2]=f*y*v-u*g*w,r[3]=f*y*w+u*g*v;break;default:throw new Error("Unknown angle order "+o)}return r}function Li(){var r=new Tt(2);return Tt!=Float32Array&&(r[0]=0,r[1]=0),r}function nn(r,e){var i=new Tt(2);return i[0]=r,i[1]=e,i}bs(),pr=new Tt(4),Tt!=Float32Array&&(pr[0]=0,pr[1]=0,pr[2]=0,pr[3]=0),bs(),Fn(1,0,0),Fn(0,1,0),rn(),rn(),Rn(),Li();const st=8192;function Bn(r,e,i){return e*(st/(r.tileSize*Math.pow(2,i-r.tileID.overscaledZ)))}function Pr(r,e){return(r%e+e)%e}function On(r,e,i){return r*(1-i)+e*i}function Ts(r){if(r<=0)return 0;if(r>=1)return 1;const e=r*r,i=e*r;return 4*(r<.5?i:3*(r-e)+i-.75)}function sn(r,e,i,s){const o=new oi(r,e,i,s);return c=>o.solve(c)}const di=sn(.25,.1,.25,1);function Ji(r,e,i){return Math.min(i,Math.max(e,r))}function Ir(r,e,i){const s=i-e,o=((r-e)%s+s)%s+e;return o===e?i:o}function yi(r,...e){for(const i of e)for(const s in i)r[s]=i[s];return r}let an=1;function Qi(r,e,i){const s={};for(const o in r)s[o]=e.call(this,r[o],o,r);return s}function Ss(r,e,i){const s={};for(const o in r)e.call(this,r[o],o,r)&&(s[o]=r[o]);return s}function er(r){return Array.isArray(r)?r.map(er):typeof r=="object"&&r?Qi(r,er):r}const Ps={};function Qt(r){Ps[r]||(typeof console<"u"&&console.warn(r),Ps[r]=!0)}function Gi(r,e,i){return(i.y-r.y)*(e.x-r.x)>(e.y-r.y)*(i.x-r.x)}function mr(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let kt=null;function Or(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}const on="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Vn(r,e,i,s,o){return h(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const c=new VideoFrame(r,{timestamp:0});try{const u=c==null?void 0:c.format;if(!u||!u.startsWith("BGR")&&!u.startsWith("RGB"))throw new Error(`Unrecognized format ${u}`);const f=u.startsWith("BGR"),g=new Uint8ClampedArray(s*o*4);if(yield c.copyTo(g,(function(y,v,w,S,P){const E=4*Math.max(-v,0),C=(Math.max(0,w)-w)*S*4+E,D=4*S,F=Math.max(0,v),q=Math.max(0,w);return{rect:{x:F,y:q,width:Math.min(y.width,v+S)-F,height:Math.min(y.height,w+P)-q},layout:[{offset:C,stride:D}]}})(r,e,i,s,o)),f)for(let y=0;y{r.removeEventListener(e,i,s)}}}function Nn(r){return r*Math.PI/180}function Ei(r){return r/Math.PI*180}const re={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},R={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},k="AbortError";class O extends Error{constructor(e=k){super(e instanceof Error?e.message:e),this.name=k,e instanceof Error&&e.stack&&(this.stack=e.stack)}}function K(r){return r.name===k}const Q={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function se(r){return Q.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}const ie="global-dispatcher";class ee extends Error{constructor(e,i,s,o){super(`AJAXError: ${i} (${e}): ${s}`),this.status=e,this.statusText=i,this.url=s,this.body=o}}const he=()=>mr(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,be=function(r,e){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){const s=se(r.url);if(s)return s(r,e);if(mr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:ie},e)}if(!(/^file:/.test(i=r.url)||/^file:/.test(he())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return(function(s,o){return h(this,void 0,void 0,(function*(){const c=new Request(s.url,{method:s.method||"GET",body:s.body,credentials:s.credentials,headers:s.headers,cache:s.cache,referrer:he(),signal:o.signal});let u,f;s.type!=="json"||c.headers.has("Accept")||c.headers.set("Accept","application/json");try{u=yield fetch(c)}catch(y){throw K(y)?y:new ee(0,y.message,s.url,new Blob)}if(!u.ok){const y=yield u.blob();throw new ee(u.status,u.statusText,s.url,y)}f=s.type==="arrayBuffer"||s.type==="image"?u.arrayBuffer():s.type==="json"?u.json():u.text();const g=yield f;return o.signal.throwIfAborted(),{data:g,cacheControl:u.headers.get("Cache-Control"),expires:u.headers.get("Expires")}}))})(r,e);if(mr(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:ie},e)}var i;return(function(s,o){return new Promise(((c,u)=>{var f;const g=new XMLHttpRequest;g.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(g.responseType="arraybuffer");for(const y in s.headers)g.setRequestHeader(y,s.headers[y]);s.type==="json"&&(g.responseType="text",!((f=s.headers)===null||f===void 0)&&f.Accept||g.setRequestHeader("Accept","application/json")),g.withCredentials=s.credentials==="include",g.onerror=()=>{u(new Error(g.statusText))},g.onload=()=>{if(!o.signal.aborted)if((g.status>=200&&g.status<300||g.status===0)&&g.response!==null){let y=g.response;if(s.type==="json")try{y=JSON.parse(g.response)}catch(v){return void u(v)}c({data:y,cacheControl:g.getResponseHeader("Cache-Control"),expires:g.getResponseHeader("Expires")})}else{const y=new Blob([g.response],{type:g.getResponseHeader("Content-Type")});u(new ee(g.status,g.statusText,s.url,y))}},o.signal.addEventListener("abort",(()=>{g.abort(),u(new O(o.signal.reason))})),g.send(s.body)}))})(r,e)};function _e(r){if(!r||r.indexOf("://")<=0||r.indexOf("data:image/")===0||r.indexOf("blob:")===0)return!0;const e=new URL(r),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function De(r,e,i){i[r]&&i[r].indexOf(e)!==-1||(i[r]=i[r]||[],i[r].push(e))}function Le(r,e,i){if(i&&i[r]){const s=i[r].indexOf(e);s!==-1&&i[r].splice(s,1)}}class je{constructor(e,i={}){yi(this,i),this.type=e}}class ct extends je{constructor(e,i={}){super("error",yi({error:e},i))}}class it{on(e,i){return this._listeners=this._listeners||{},De(e,i,this._listeners),{unsubscribe:()=>{this.off(e,i)}}}off(e,i){return Le(e,i,this._listeners),Le(e,i,this._oneTimeListeners),this}once(e,i){return i?(this._oneTimeListeners=this._oneTimeListeners||{},De(e,i,this._oneTimeListeners),this):new Promise((s=>this.once(e,s)))}fire(e,i){typeof e=="string"&&(e=new je(e,i||{}));const s=e.type;if(this.listens(s)){e.target=this;const o=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const f of o)f.call(this,e);const c=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const f of c)Le(s,f,this._oneTimeListeners),f.call(this,e);const u=this._eventedParent;u&&(yi(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),u.fire(e))}else e instanceof ct&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,i){return this._eventedParent=e,this._eventedParentData=i,this}}var oe={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"expression_name",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const ht=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function li(r,e){const i={};for(const s in r)s!=="ref"&&(i[s]=r[s]);return ht.forEach((s=>{s in e&&(i[s]=e[s])})),i}function Ne(r,e){if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let i=0;i`:r.itemType.kind==="value"?"array":`array<${e}>`}return r.kind}const Ia=[qi,Ce,$e,We,Fi,Sa,Cs,Mr,bi(qe),Pa,As,Un,Gn,Ds];function qn(r,e){if(e.kind==="error")return null;if(r.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!qn(r.itemType,e.itemType))&&(typeof r.N!="number"||r.N===e.N))return null}else{if(r.kind===e.kind)return null;if(r.kind==="value"){for(const i of Ia)if(!qn(i,e))return null}}return`Expected ${lt(r)} but found ${lt(e)} instead.`}function zs(r,e){return e.some((i=>i.kind===r.kind))}function ln(r,e){return e.some((i=>i==="null"?r===null:i==="array"?Array.isArray(r):i==="object"?r&&!Array.isArray(r)&&typeof r=="object":i===typeof r))}function ir(r,e){return r.kind==="array"&&e.kind==="array"?r.itemType.kind===e.itemType.kind&&typeof r.N=="number":r.kind===e.kind}const Wl=.96422,cn=.82521,Ma=4/29,Lt=6/29,Hl=3*Lt*Lt,Xl=Lt*Lt*Lt,ks=Math.PI/180,Yl=180/Math.PI;function Kl(r){return(r%=360)<0&&(r+=360),r}function Jl([r,e,i,s]){let o,c;const u=zo((.2225045*(r=Ea(r))+.7168786*(e=Ea(e))+.0606169*(i=Ea(i)))/1);r===e&&e===i?o=c=u:(o=zo((.4360747*r+.3850649*e+.1430804*i)/Wl),c=zo((.0139322*r+.0971045*e+.7141733*i)/cn));const f=116*u-16;return[f<0?0:f,500*(o-u),200*(u-c),s]}function Ea(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function zo(r){return r>Xl?Math.pow(r,1/3):r/Hl+Ma}function ko([r,e,i,s]){let o=(r+16)/116,c=isNaN(e)?o:o+e/500,u=isNaN(i)?o:o-i/200;return o=1*Lo(o),c=Wl*Lo(c),u=cn*Lo(u),[Ro(3.1338561*c-1.6168667*o-.4906146*u),Ro(-.9787684*c+1.9161415*o+.033454*u),Ro(.0719453*c-.2289914*o+1.4052427*u),s]}function Ro(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function Lo(r){return r>Lt?r*r*r:Hl*(r-Ma)}const Tu=Object.hasOwn||function(r,e){return Object.prototype.hasOwnProperty.call(r,e)};function Rs(r,e){return Tu(r,e)?r[e]:void 0}function Ca(r){return parseInt(r.padEnd(2,r),16)/255}function Ql(r,e){return Zn(e?r/100:r,0,1)}function Zn(r,e,i){return Math.min(Math.max(e,r),i)}function Fo(r){return!r.some(Number.isNaN)}const Ls={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function jr(r,e,i){return r+i*(e-r)}function $n(r,e,i){return r.map(((s,o)=>jr(s,e[o],i)))}class He{constructor(e,i,s,o=1,c=!0){this.r=e,this.g=i,this.b=s,this.a=o,c||(this.r*=o,this.g*=o,this.b*=o,o||this.overwriteGetter("rgb",[e,i,s,o]))}static parse(e){if(e instanceof He)return e;if(typeof e!="string")return;const i=(function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const o=Rs(Ls,s);if(o){const[u,f,g]=o;return[u/255,f/255,g/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const u=s.length<6?1:2;let f=1;return[Ca(s.slice(f,f+=u)),Ca(s.slice(f,f+=u)),Ca(s.slice(f,f+=u)),Ca(s.slice(f,f+u)||"ff")]}if(s.startsWith("rgb")){const u=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(u){const[f,g,y,v,w,S,P,E,C,D,F,q]=u,B=[v||" ",P||" ",D].join("");if(B===" "||B===" /"||B===",,"||B===",,,"){const V=[y,S,C].join(""),$=V==="%%%"?100:V===""?255:0;if($){const X=[Zn(+g/$,0,1),Zn(+w/$,0,1),Zn(+E/$,0,1),F?Ql(+F,q):1];if(Fo(X))return X}}return}}const c=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(c){const[u,f,g,y,v,w,S,P,E]=c,C=[g||" ",v||" ",S].join("");if(C===" "||C===" /"||C===",,"||C===",,,"){const D=[+f,Zn(+y,0,100),Zn(+w,0,100),P?Ql(+P,E):1];if(Fo(D))return(function([F,q,B,V]){function $(X){const ne=(X+F/30)%12,ge=q*Math.min(B,1-B);return B-ge*Math.max(-1,Math.min(ne-3,9-ne,1))}return F=Kl(F),q/=100,B/=100,[$(0),$(8),$(4),V]})(D)}}})(e);return i?new He(...i,!1):void 0}get rgb(){const{r:e,g:i,b:s,a:o}=this,c=o||1/0;return this.overwriteGetter("rgb",[e/c,i/c,s/c,o])}get hcl(){return this.overwriteGetter("hcl",(function(e){const[i,s,o,c]=Jl(e),u=Math.sqrt(s*s+o*o);return[Math.round(1e4*u)?Kl(Math.atan2(o,s)*Yl):NaN,u,i,c]})(this.rgb))}get lab(){return this.overwriteGetter("lab",Jl(this.rgb))}overwriteGetter(e,i){return Object.defineProperty(this,e,{value:i}),i}toString(){const[e,i,s,o]=this.rgb;return`rgba(${[e,i,s].map((c=>Math.round(255*c))).join(",")},${o})`}static interpolate(e,i,s,o="rgb"){switch(o){case"rgb":{const[c,u,f,g]=$n(e.rgb,i.rgb,s);return new He(c,u,f,g,!1)}case"hcl":{const[c,u,f,g]=e.hcl,[y,v,w,S]=i.hcl;let P,E;if(isNaN(c)||isNaN(y))isNaN(c)?isNaN(y)?P=NaN:(P=y,f!==1&&f!==0||(E=v)):(P=c,w!==1&&w!==0||(E=u));else{let B=y-c;y>c&&B>180?B-=360:y180&&(B+=360),P=c+s*B}const[C,D,F,q]=(function([B,V,$,X]){return B=isNaN(B)?0:B*ks,ko([$,Math.cos(B)*V,Math.sin(B)*V,X])})([P,E??jr(u,v,s),jr(f,w,s),jr(g,S,s)]);return new He(C,D,F,q,!1)}case"lab":{const[c,u,f,g]=ko($n(e.lab,i.lab,s));return new He(c,u,f,g,!1)}}}}He.black=new He(0,0,0,1),He.white=new He(1,1,1,1),He.transparent=new He(0,0,0,0),He.red=new He(1,0,0,1);class Bo{constructor(e,i,s){this.sensitivity=e?i?"variant":"case":i?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,i){return this.collator.compare(e,i)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const Su=["bottom","center","top"];class Oo{constructor(e,i,s,o,c,u){this.text=e,this.image=i,this.scale=s,this.fontStack=o,this.textColor=c,this.verticalAlign=u}}class Ci{constructor(e){this.sections=e}static fromString(e){return new Ci([new Oo(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some((e=>e.text.length!==0||e.image&&e.image.name.length!==0))}static factory(e){return e instanceof Ci?e:Ci.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map((e=>e.text)).join("")}}class pi{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof pi)return e;if(typeof e=="number")return new pi([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const i of e)if(typeof i!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new pi(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,s){return new pi($n(e.values,i.values,s))}}class At{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof At)return e;if(typeof e=="number")return new At([e]);if(Array.isArray(e)){for(const i of e)if(typeof i!="number")return;return new At(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,i,s){return new At($n(e.values,i.values,s))}}class Ve{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Ve)return e;if(typeof e=="string"){const s=He.parse(e);return s?new Ve([s]):void 0}if(!Array.isArray(e))return;const i=[];for(const s of e){if(typeof s!="string")return;const o=He.parse(s);if(!o)return;i.push(o)}return new Ve(i)}toString(){return JSON.stringify(this.values)}static interpolate(e,i,s,o="rgb"){const c=[];if(e.values.length!=i.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${i.values.length}), cannot interpolate.`);for(let u=0;u=0&&r<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof i=="number"&&i>=0&&i<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[r,e,i,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[r,e,i,s]:[r,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ur(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof Ti||r instanceof He||r instanceof Bo||r instanceof Ci||r instanceof pi||r instanceof At||r instanceof Ve||r instanceof wi||r instanceof Bi)return!0;if(Array.isArray(r)){for(const e of r)if(!Ur(e))return!1;return!0}if(typeof r=="object"){for(const e in r)if(!Ur(r[e]))return!1;return!0}return!1}function jt(r){if(r===null)return qi;if(typeof r=="string")return $e;if(typeof r=="boolean")return We;if(typeof r=="number")return Ce;if(r instanceof He)return Fi;if(r instanceof Ti)return Sa;if(r instanceof Bo)return Es;if(r instanceof Ci)return Cs;if(r instanceof pi)return Pa;if(r instanceof At)return As;if(r instanceof Ve)return Un;if(r instanceof wi)return Ds;if(r instanceof Bi)return Gn;if(Array.isArray(r)){const e=r.length;let i;for(const s of r){const o=jt(s);if(i){if(i===o)continue;i=qe;break}i=o}return bi(i||qe,e)}return Mr}function un(r){const e=typeof r;return r===null?"":e==="string"||e==="number"||e==="boolean"?String(r):r instanceof He||r instanceof Ti||r instanceof Ci||r instanceof pi||r instanceof At||r instanceof Ve||r instanceof wi||r instanceof Bi?r.toString():JSON.stringify(r)}class gr{constructor(e,i){this.type=e,this.value=i}static parse(e,i){if(e.length!==2)return i.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ur(e[1]))return i.error("invalid value");const s=e[1];let o=jt(s);const c=i.expectedType;return o.kind!=="array"||o.N!==0||!c||c.kind!=="array"||typeof c.N=="number"&&c.N!==0||(o=c),new gr(o,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Aa={string:$e,number:Ce,boolean:We,object:Mr};class Ai{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let s,o=1;const c=e[0];if(c==="array"){let f,g;if(e.length>2){const y=e[1];if(typeof y!="string"||!(y in Aa)||y==="object")return i.error('The item type argument of "array" must be one of string, number, boolean',1);f=Aa[y],o++}else f=qe;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return i.error('The length argument to "array" must be a positive integer literal',2);g=e[2],o++}s=bi(f,g)}else{if(!Aa[c])throw new Error(`Types doesn't contain name = ${c}`);s=Aa[c]}const u=[];for(;oe.outputDefined()))}}const hn={"to-boolean":We,"to-color":Fi,"to-number":Ce,"to-string":$e};class Er{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const s=e[0];if(!hn[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return i.error("Expected one argument.");const o=hn[s],c=[];for(let u=1;u4?`Invalid rgba value ${JSON.stringify(i)}: expected an array containing either three or four numeric values.`:Wn(i[0],i[1],i[2],i[3]),!s))return new He(i[0]/255,i[1]/255,i[2]/255,i[3])}throw new pt(s||`Could not parse color from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"padding":{let i;for(const s of this.args){i=s.evaluate(e);const o=pi.parse(i);if(o)return o}throw new pt(`Could not parse padding from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"numberArray":{let i;for(const s of this.args){i=s.evaluate(e);const o=At.parse(i);if(o)return o}throw new pt(`Could not parse numberArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"colorArray":{let i;for(const s of this.args){i=s.evaluate(e);const o=Ve.parse(i);if(o)return o}throw new pt(`Could not parse colorArray from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"variableAnchorOffsetCollection":{let i;for(const s of this.args){i=s.evaluate(e);const o=wi.parse(i);if(o)return o}throw new pt(`Could not parse variableAnchorOffsetCollection from value '${typeof i=="string"?i:JSON.stringify(i)}'`)}case"number":{let i=null;for(const s of this.args){if(i=s.evaluate(e),i===null)return 0;const o=Number(i);if(!isNaN(o))return o}throw new pt(`Could not convert ${JSON.stringify(i)} to number.`)}case"formatted":return Ci.fromString(un(this.args[0].evaluate(e)));case"resolvedImage":return Bi.fromString(un(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return un(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const ec=["Unknown","Point","LineString","Polygon"];class Vo{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?ec[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let i=this._parseColorCache.get(e);return i||(i=He.parse(e),this._parseColorCache.set(e,i)),i}}class dn{constructor(e,i,s=[],o,c=new Ta,u=[]){this.registry=e,this.path=s,this.key=s.map((f=>`[${f}]`)).join(""),this.scope=c,this.errors=u,this.expectedType=o,this._isConstant=i}parse(e,i,s,o,c={}){return i?this.concat(i,s,o)._parse(e,c):this._parse(e,c)}_parse(e,i){function s(o,c,u){return u==="assert"?new Ai(c,[o]):u==="coerce"?new Er(c,[o]):o}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const o=e[0];if(typeof o!="string")return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const c=this.registry[o];if(c){let u=c.parse(e,this);if(!u)return null;if(this.expectedType){const f=this.expectedType,g=u.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||g.kind!=="value"){if(f.kind==="projectionDefinition"&&["string","array"].includes(g.kind)||["color","formatted","resolvedImage"].includes(f.kind)&&["value","string"].includes(g.kind)||["padding","numberArray"].includes(f.kind)&&["value","number","array"].includes(g.kind)||f.kind==="colorArray"&&["value","string","array"].includes(g.kind)||f.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(g.kind))u=s(u,f,i.typeAnnotation||"coerce");else if(this.checkSubtype(f,g))return null}else u=s(u,f,i.typeAnnotation||"assert")}if(!(u instanceof gr)&&u.type.kind!=="resolvedImage"&&this._isConstant(u)){const f=new Vo;try{u=new gr(u.type,u.evaluate(f))}catch(g){return this.error(g.message),null}}return u}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,i,s){const o=typeof e=="number"?this.path.concat(e):this.path,c=s?this.scope.concat(s):this.scope;return new dn(this.registry,this._isConstant,o,i||null,c,this.errors)}error(e,...i){const s=`${this.key}${i.map((o=>`[${o}]`)).join("")}`;this.errors.push(new vi(s,e))}checkSubtype(e,i){const s=qn(e,i);return s&&this.error(s),s}}class ft{constructor(e,i){this.type=i.type,this.bindings=[].concat(e),this.result=i}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const i of this.bindings)e(i[1]);e(this.result)}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let c=1;c=s.length)throw new pt(`Array index out of bounds: ${i} > ${s.length-1}.`);if(i!==Math.floor(i))throw new pt(`Array index must be an integer, but found ${i} instead.`);return s[i]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Ze{constructor(e,i){this.type=We,this.needle=e,this.haystack=i}static parse(e,i){if(e.length!==3)return i.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=i.parse(e[1],1,qe),o=i.parse(e[2],2,qe);return s&&o?zs(s.type,[We,$e,Ce,qi,qe])?new Ze(s,o):i.error(`Expected first argument to be of type boolean, string, number or null, but found ${lt(s.type)} instead`):null}evaluate(e){const i=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!ln(i,["boolean","string","number","null"]))throw new pt(`Expected first argument to be of type boolean, string, number or null, but found ${lt(jt(i))} instead.`);if(!ln(s,["string","array"]))throw new pt(`Expected second argument to be of type array or string, but found ${lt(jt(s))} instead.`);return s.indexOf(i)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Xn{constructor(e,i,s){this.type=Ce,this.needle=e,this.haystack=i,this.fromIndex=s}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const s=i.parse(e[1],1,qe),o=i.parse(e[2],2,qe);if(!s||!o)return null;if(!zs(s.type,[We,$e,Ce,qi,qe]))return i.error(`Expected first argument to be of type boolean, string, number or null, but found ${lt(s.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Ce);return c?new Xn(s,o,c):null}return new Xn(s,o)}evaluate(e){const i=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!ln(i,["boolean","string","number","null"]))throw new pt(`Expected first argument to be of type boolean, string, number or null, but found ${lt(jt(i))} instead.`);let o;if(this.fromIndex&&(o=this.fromIndex.evaluate(e)),ln(s,["string"])){const c=s.indexOf(i,o);return c===-1?-1:[...s.slice(0,c)].length}if(ln(s,["array"]))return s.indexOf(i,o);throw new pt(`Expected second argument to be of type array or string, but found ${lt(jt(s))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Qe{constructor(e,i,s,o,c,u){this.inputType=e,this.type=i,this.input=s,this.cases=o,this.outputs=c,this.otherwise=u}static parse(e,i){if(e.length<5)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return i.error("Expected an even number of arguments.");let s,o;i.expectedType&&i.expectedType.kind!=="value"&&(o=i.expectedType);const c={},u=[];for(let y=2;yNumber.MAX_SAFE_INTEGER)return S.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof E=="number"&&Math.floor(E)!==E)return S.error("Numeric branch labels must be integer values.");if(s){if(S.checkSubtype(s,jt(E)))return null}else s=jt(E);if(c[String(E)]!==void 0)return S.error("Branch labels must be unique.");c[String(E)]=u.length}const P=i.parse(w,y,o);if(!P)return null;o=o||P.type,u.push(P)}const f=i.parse(e[1],1,qe);if(!f)return null;const g=i.parse(e[e.length-1],e.length-1,o);return g?f.type.kind!=="value"&&i.concat(1).checkSubtype(s,f.type)?null:new Qe(s,o,f,c,u,g):null}evaluate(e){const i=this.input.evaluate(e);return(jt(i)===this.inputType&&this.outputs[this.cases[i]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class Fs{constructor(e,i,s){this.type=e,this.branches=i,this.otherwise=s}static parse(e,i){if(e.length<4)return i.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return i.error("Expected an odd number of arguments.");let s;i.expectedType&&i.expectedType.kind!=="value"&&(s=i.expectedType);const o=[];for(let u=1;ui.outputDefined()))&&this.otherwise.outputDefined()}}class Zi{constructor(e,i,s,o){this.type=e,this.input=i,this.beginIndex=s,this.endIndex=o}static parse(e,i){if(e.length<=2||e.length>=5)return i.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const s=i.parse(e[1],1,qe),o=i.parse(e[2],2,Ce);if(!s||!o)return null;if(!zs(s.type,[bi(qe),$e,qe]))return i.error(`Expected first argument to be of type array or string, but found ${lt(s.type)} instead`);if(e.length===4){const c=i.parse(e[3],3,Ce);return c?new Zi(s.type,s,o,c):null}return new Zi(s.type,s,o)}evaluate(e){const i=this.input.evaluate(e),s=this.beginIndex.evaluate(e);let o;if(this.endIndex&&(o=this.endIndex.evaluate(e)),ln(i,["string"]))return[...i].slice(s,o).join("");if(ln(i,["array"]))return i.slice(s,o);throw new pt(`Expected first argument to be of type array or string, but found ${lt(jt(i))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Yn(r,e){const i=r.length-1;let s,o,c=0,u=i,f=0;for(;c<=u;)if(f=Math.floor((c+u)/2),s=r[f],o=r[f+1],s<=e){if(f===i||ee))throw new pt("Input is not a number.");u=f-1}return 0}class Gr{constructor(e,i,s){this.type=e,this.input=i,this.labels=[],this.outputs=[];for(const[o,c]of s)this.labels.push(o),this.outputs.push(c)}static parse(e,i){if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");const s=i.parse(e[1],1,Ce);if(!s)return null;const o=[];let c=null;i.expectedType&&i.expectedType.kind!=="value"&&(c=i.expectedType);for(let u=1;u=f)return i.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',y);const w=i.parse(g,v,c);if(!w)return null;c=c||w.type,o.push([f,w])}return new Gr(c,s,o)}evaluate(e){const i=this.labels,s=this.outputs;if(i.length===1)return s[0].evaluate(e);const o=this.input.evaluate(e);if(o<=i[0])return s[0].evaluate(e);const c=i.length;return o>=i[c-1]?s[c-1].evaluate(e):s[Yn(i,o)].evaluate(e)}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function tc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Bs,jo,Pu=(function(){if(jo)return Bs;function r(e,i,s,o){this.cx=3*e,this.bx=3*(s-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*i,this.by=3*(o-i)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=i,this.p2x=s,this.p2y=o}return jo=1,Bs=r,r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,i){if(i===void 0&&(i=1e-6),e<0)return 0;if(e>1)return 1;for(var s=e,o=0;o<8;o++){var c=this.sampleCurveX(s)-e;if(Math.abs(c)c?f=s:g=s,s=.5*(g-f)+f;return s},solve:function(e,i){return this.sampleCurveY(this.solveCurveX(e,i))}},Bs})(),ic=tc(Pu);class Si{constructor(e,i,s,o,c){this.type=e,this.operator=i,this.interpolation=s,this.input=o,this.labels=[],this.outputs=[];for(const[u,f]of c)this.labels.push(u),this.outputs.push(f)}static interpolationFactor(e,i,s,o){let c=0;if(e.name==="exponential")c=_r(i,e.base,s,o);else if(e.name==="linear")c=_r(i,1,s,o);else if(e.name==="cubic-bezier"){const u=e.controlPoints;c=new ic(u[0],u[1],u[2],u[3]).solve(_r(i,1,s,o))}return c}static parse(e,i){let[s,o,c,...u]=e;if(!Array.isArray(o)||o.length===0)return i.error("Expected an interpolation type expression.",1);if(o[0]==="linear")o={name:"linear"};else if(o[0]==="exponential"){const y=o[1];if(typeof y!="number")return i.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:y}}else{if(o[0]!=="cubic-bezier")return i.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const y=o.slice(1);if(y.length!==4||y.some((v=>typeof v!="number"||v<0||v>1)))return i.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:y}}}if(e.length-1<4)return i.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return i.error("Expected an even number of arguments.");if(c=i.parse(c,2,Ce),!c)return null;const f=[];let g=null;s!=="interpolate-hcl"&&s!=="interpolate-lab"||i.expectedType==Un?i.expectedType&&i.expectedType.kind!=="value"&&(g=i.expectedType):g=Fi;for(let y=0;y=v)return i.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',S);const E=i.parse(w,P,g);if(!E)return null;g=g||E.type,f.push([v,E])}return ir(g,Ce)||ir(g,Sa)||ir(g,Fi)||ir(g,Pa)||ir(g,As)||ir(g,Un)||ir(g,Ds)||ir(g,bi(Ce))?new Si(g,s,o,c,f):i.error(`Type ${lt(g)} is not interpolatable.`)}evaluate(e){const i=this.labels,s=this.outputs;if(i.length===1)return s[0].evaluate(e);const o=this.input.evaluate(e);if(o<=i[0])return s[0].evaluate(e);const c=i.length;if(o>=i[c-1])return s[c-1].evaluate(e);const u=Yn(i,o),f=Si.interpolationFactor(this.interpolation,o,i[u],i[u+1]),g=s[u].evaluate(e),y=s[u+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return jr(g,y,f);case"color":return He.interpolate(g,y,f);case"padding":return pi.interpolate(g,y,f);case"colorArray":return Ve.interpolate(g,y,f);case"numberArray":return At.interpolate(g,y,f);case"variableAnchorOffsetCollection":return wi.interpolate(g,y,f);case"array":return $n(g,y,f);case"projectionDefinition":return Ti.interpolate(g,y,f)}case"interpolate-hcl":switch(this.type.kind){case"color":return He.interpolate(g,y,f,"hcl");case"colorArray":return Ve.interpolate(g,y,f,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return He.interpolate(g,y,f,"lab");case"colorArray":return Ve.interpolate(g,y,f,"lab")}}}eachChild(e){e(this.input);for(const i of this.outputs)e(i)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function _r(r,e,i,s){const o=s-i,c=r-i;return o===0?0:e===1?c/o:(Math.pow(e,c)-1)/(Math.pow(e,o)-1)}const St={color:He.interpolate,number:jr,padding:pi.interpolate,numberArray:At.interpolate,colorArray:Ve.interpolate,variableAnchorOffsetCollection:wi.interpolate,array:$n};class pn{constructor(e,i){this.type=e,this.args=i}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");let s=null;const o=i.expectedType;o&&o.kind!=="value"&&(s=o);const c=[];for(const f of e.slice(1)){const g=i.parse(f,1+c.length,s,void 0,{typeAnnotation:"omit"});if(!g)return null;s=s||g.type,c.push(g)}if(!s)throw new Error("No output type");const u=o&&c.some((f=>qn(o,f.type)));return new pn(u?qe:s,c)}evaluate(e){let i,s=null,o=0;for(const c of this.args)if(o++,s=c.evaluate(e),s&&s instanceof Bi&&!s.available&&(i||(i=s.name),s=null,o===this.args.length&&(s=i)),s!==null)break;return s}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function No(r,e){return r==="=="||r==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function Os(r,e,i,s){return s.compare(e,i)===0}function Ft(r,e,i){const s=r!=="=="&&r!=="!=";return class af{constructor(c,u,f){this.type=We,this.lhs=c,this.rhs=u,this.collator=f,this.hasUntypedArgument=c.type.kind==="value"||u.type.kind==="value"}static parse(c,u){if(c.length!==3&&c.length!==4)return u.error("Expected two or three arguments.");const f=c[0];let g=u.parse(c[1],1,qe);if(!g)return null;if(!No(f,g.type))return u.concat(1).error(`"${f}" comparisons are not supported for type '${lt(g.type)}'.`);let y=u.parse(c[2],2,qe);if(!y)return null;if(!No(f,y.type))return u.concat(2).error(`"${f}" comparisons are not supported for type '${lt(y.type)}'.`);if(g.type.kind!==y.type.kind&&g.type.kind!=="value"&&y.type.kind!=="value")return u.error(`Cannot compare types '${lt(g.type)}' and '${lt(y.type)}'.`);s&&(g.type.kind==="value"&&y.type.kind!=="value"?g=new Ai(y.type,[g]):g.type.kind!=="value"&&y.type.kind==="value"&&(y=new Ai(g.type,[y])));let v=null;if(c.length===4){if(g.type.kind!=="string"&&y.type.kind!=="string"&&g.type.kind!=="value"&&y.type.kind!=="value")return u.error("Cannot use collator to compare non-string types.");if(v=u.parse(c[3],3,Es),!v)return null}return new af(g,y,v)}evaluate(c){const u=this.lhs.evaluate(c),f=this.rhs.evaluate(c);if(s&&this.hasUntypedArgument){const g=jt(u),y=jt(f);if(g.kind!==y.kind||g.kind!=="string"&&g.kind!=="number")throw new pt(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${g.kind}, ${y.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const g=jt(u),y=jt(f);if(g.kind!=="string"||y.kind!=="string")return e(c,u,f)}return this.collator?i(c,u,f,this.collator.evaluate(c)):e(c,u,f)}eachChild(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)}outputDefined(){return!0}}}const rc=Ft("==",(function(r,e,i){return e===i}),Os),Uo=Ft("!=",(function(r,e,i){return e!==i}),(function(r,e,i,s){return!Os(0,e,i,s)})),nc=Ft("<",(function(r,e,i){return e",(function(r,e,i){return e>i}),(function(r,e,i,s){return s.compare(e,i)>0})),Kn=Ft("<=",(function(r,e,i){return e<=i}),(function(r,e,i,s){return s.compare(e,i)<=0})),Da=Ft(">=",(function(r,e,i){return e>=i}),(function(r,e,i,s){return s.compare(e,i)>=0}));class Jn{constructor(e,i,s){this.type=Es,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=i}static parse(e,i){if(e.length!==2)return i.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return i.error("Collator options argument must be an object.");const o=i.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,We);if(!o)return null;const c=i.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,We);if(!c)return null;let u=null;return s.locale&&(u=i.parse(s.locale,1,$e),!u)?null:new Jn(o,c,u)}evaluate(e){return new Bo(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Go{constructor(e,i,s,o,c){this.type=$e,this.number=e,this.locale=i,this.currency=s,this.minFractionDigits=o,this.maxFractionDigits=c}static parse(e,i){if(e.length!==3)return i.error("Expected two arguments.");const s=i.parse(e[1],1,Ce);if(!s)return null;const o=e[2];if(typeof o!="object"||Array.isArray(o))return i.error("NumberFormat options argument must be an object.");let c=null;if(o.locale&&(c=i.parse(o.locale,1,$e),!c))return null;let u=null;if(o.currency&&(u=i.parse(o.currency,1,$e),!u))return null;let f=null;if(o["min-fraction-digits"]&&(f=i.parse(o["min-fraction-digits"],1,Ce),!f))return null;let g=null;return o["max-fraction-digits"]&&(g=i.parse(o["max-fraction-digits"],1,Ce),!g)?null:new Go(s,c,u,f,g)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Vs{constructor(e){this.type=Cs,this.sections=e}static parse(e,i){if(e.length<2)return i.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return i.error("First argument must be an image or text section.");const o=[];let c=!1;for(let u=1;u<=e.length-1;++u){const f=e[u];if(c&&typeof f=="object"&&!Array.isArray(f)){c=!1;let g=null;if(f["font-scale"]&&(g=i.parse(f["font-scale"],1,Ce),!g))return null;let y=null;if(f["text-font"]&&(y=i.parse(f["text-font"],1,bi($e)),!y))return null;let v=null;if(f["text-color"]&&(v=i.parse(f["text-color"],1,Fi),!v))return null;let w=null;if(f["vertical-align"]){if(typeof f["vertical-align"]=="string"&&!Su.includes(f["vertical-align"]))return i.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${f["vertical-align"]}' instead.`);if(w=i.parse(f["vertical-align"],1,$e),!w)return null}const S=o[o.length-1];S.scale=g,S.font=y,S.textColor=v,S.verticalAlign=w}else{const g=i.parse(e[u],1,qe);if(!g)return null;const y=g.type.kind;if(y!=="string"&&y!=="value"&&y!=="null"&&y!=="resolvedImage")return i.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");c=!0,o.push({content:g,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Vs(o)}evaluate(e){return new Ci(this.sections.map((i=>{const s=i.content.evaluate(e);return jt(s)===Gn?new Oo("",s,null,null,null,i.verticalAlign?i.verticalAlign.evaluate(e):null):new Oo(un(s),null,i.scale?i.scale.evaluate(e):null,i.font?i.font.evaluate(e).join(","):null,i.textColor?i.textColor.evaluate(e):null,i.verticalAlign?i.verticalAlign.evaluate(e):null)})))}eachChild(e){for(const i of this.sections)e(i.content),i.scale&&e(i.scale),i.font&&e(i.font),i.textColor&&e(i.textColor),i.verticalAlign&&e(i.verticalAlign)}outputDefined(){return!1}}class Qn{constructor(e){this.type=Gn,this.input=e}static parse(e,i){if(e.length!==2)return i.error("Expected two arguments.");const s=i.parse(e[1],1,$e);return s?new Qn(s):i.error("No image name provided.")}evaluate(e){const i=this.input.evaluate(e),s=Bi.fromString(i);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(i)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class es{constructor(e){this.type=Ce,this.input=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=i.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?i.error(`Expected argument of type string or array, but found ${lt(s.type)} instead.`):new es(s):null}evaluate(e){const i=this.input.evaluate(e);if(typeof i=="string")return[...i].length;if(Array.isArray(i))return i.length;throw new pt(`Expected value to be of type string or array, but found ${lt(jt(i))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Ht=8192;function sc(r,e){const i=(180+r[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,o=Math.pow(2,e.z);return[Math.round(i*o*Ht),Math.round(s*o*Ht)]}function ts(r,e){const i=Math.pow(2,e.z);return[(o=(r[0]/Ht+e.x)/i,360*o-180),(s=(r[1]/Ht+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*s)*Math.PI/180))-90)];var s,o}function js(r,e){r[0]=Math.min(r[0],e[0]),r[1]=Math.min(r[1],e[1]),r[2]=Math.max(r[2],e[0]),r[3]=Math.max(r[3],e[1])}function fn(r,e){return!(r[0]<=e[0]||r[2]>=e[2]||r[1]<=e[1]||r[3]>=e[3])}function Mu(r,e,i){const s=r[0]-e[0],o=r[1]-e[1],c=r[0]-i[0],u=r[1]-i[1];return s*u-c*o==0&&s*c<=0&&o*u<=0}function za(r,e,i,s){return(o=[s[0]-i[0],s[1]-i[1]])[0]*(c=[e[0]-r[0],e[1]-r[1]])[1]-o[1]*c[0]!=0&&!(!qo(r,e,i,s)||!qo(i,s,r,e));var o,c}function Eu(r,e,i){for(const s of i)for(let o=0;o(o=r)[1]!=(u=f[g+1])[1]>o[1]&&o[0]<(u[0]-c[0])*(o[1]-c[1])/(u[1]-c[1])+c[0]&&(s=!s)}var o,c,u;return s}function ka(r,e){for(const i of e)if(is(r,i))return!0;return!1}function ac(r,e){for(const i of r)if(!is(i,e))return!1;for(let i=0;i0&&f<0||u<0&&f>0}function Zo(r,e,i){const s=[];for(let o=0;oi[2]){const o=.5*s;let c=r[0]-i[0]>o?-s:i[0]-r[0]>o?s:0;c===0&&(c=r[0]-i[2]>o?-s:i[2]-r[0]>o?s:0),r[0]+=c}js(e,r)}function cc(r,e,i,s){const o=Math.pow(2,s.z)*Ht,c=[s.x*Ht,s.y*Ht],u=[];for(const f of r)for(const g of f){const y=[g.x+c[0],g.y+c[1]];lc(y,e,i,o),u.push(y)}return u}function uc(r,e,i,s){const o=Math.pow(2,s.z)*Ht,c=[s.x*Ht,s.y*Ht],u=[];for(const g of r){const y=[];for(const v of g){const w=[v.x+c[0],v.y+c[1]];js(e,w),y.push(w)}u.push(y)}if(e[2]-e[0]<=o/2){(f=e)[0]=f[1]=1/0,f[2]=f[3]=-1/0;for(const g of u)for(const y of g)lc(y,e,i,o)}var f;return u}class mn{constructor(e,i){this.type=We,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ur(e[1])){const s=e[1];if(s.type==="FeatureCollection"){const o=[];for(const c of s.features){const{type:u,coordinates:f}=c.geometry;u==="Polygon"&&o.push(f),u==="MultiPolygon"&&o.push(...f)}if(o.length)return new mn(s,{type:"MultiPolygon",coordinates:o})}else if(s.type==="Feature"){const o=s.geometry.type;if(o==="Polygon"||o==="MultiPolygon")return new mn(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new mn(s,s)}return i.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,s){const o=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(s.type==="Polygon"){const f=Zo(s.coordinates,c,u),g=cc(i.geometry(),o,c,u);if(!fn(o,c))return!1;for(const y of g)if(!is(y,f))return!1}if(s.type==="MultiPolygon"){const f=$o(s.coordinates,c,u),g=cc(i.geometry(),o,c,u);if(!fn(o,c))return!1;for(const y of g)if(!ka(y,f))return!1}return!0})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,s){const o=[1/0,1/0,-1/0,-1/0],c=[1/0,1/0,-1/0,-1/0],u=i.canonicalID();if(s.type==="Polygon"){const f=Zo(s.coordinates,c,u),g=uc(i.geometry(),o,c,u);if(!fn(o,c))return!1;for(const y of g)if(!ac(y,f))return!1}if(s.type==="MultiPolygon"){const f=$o(s.coordinates,c,u),g=uc(i.geometry(),o,c,u);if(!fn(o,c))return!1;for(const y of g)if(!oc(y,f))return!1}return!0})(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let hc=class{constructor(r=[],e=(i,s)=>is?1:0){if(this.data=r,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:e,compare:i}=this,s=e[r];for(;r>0;){const o=r-1>>1,c=e[o];if(i(s,c)>=0)break;e[r]=c,r=o}e[r]=s}_down(r){const{data:e,compare:i}=this,s=this.length>>1,o=e[r];for(;r=0)break;e[r]=e[c],r=c}e[r]=o}};function Wo(r,e,i=0,s=r.length-1,o=dc){for(;s>i;){if(s-i>600){const g=s-i+1,y=e-i+1,v=Math.log(g),w=.5*Math.exp(2*v/3),S=.5*Math.sqrt(v*w*(g-w)/g)*(y-g/2<0?-1:1);Wo(r,e,Math.max(i,Math.floor(e-y*w/g+S)),Math.min(s,Math.floor(e+(g-y)*w/g+S)),o)}const c=r[e];let u=i,f=s;for(rs(r,i,e),o(r[s],c)>0&&rs(r,i,s);u0;)f--}o(r[i],c)===0?rs(r,i,f):(f++,rs(r,f,s)),f<=e&&(i=f+1),e<=f&&(s=f-1)}}function rs(r,e,i){const s=r[e];r[e]=r[i],r[i]=s}function dc(r,e){return re?1:0}function Ra(r,e){if(r.length<=1)return[r];const i=[];let s,o;for(const c of r){const u=Au(c);u!==0&&(c.area=Math.abs(u),o===void 0&&(o=u<0),o===u<0?(s&&i.push(s),s=[c]):s.push(c))}if(s&&i.push(s),e>1)for(let c=0;c1?(y=e[g+1][0],v=e[g+1][1]):P>0&&(y+=w/this.kx*P,v+=S/this.ky*P)),w=this.wrap(i[0]-y)*this.kx,S=(i[1]-v)*this.ky;const E=w*w+S*S;E180;)e-=360;return e}}function mc(r,e){return e[0]-r[0]}function La(r){return r[1]-r[0]+1}function rr(r,e){return r[1]>=r[0]&&r[1]r[1])return[null,null];const i=La(r);if(e){if(i===2)return[r,null];const o=Math.floor(i/2);return[[r[0],r[0]+o],[r[0]+o,r[1]]]}if(i===1)return[r,null];const s=Math.floor(i/2)-1;return[[r[0],r[0]+s],[r[0]+s+1,r[1]]]}function Xo(r,e){if(!rr(e,r.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let s=e[0];s<=e[1];++s)js(i,r[s]);return i}function Yo(r){const e=[1/0,1/0,-1/0,-1/0];for(const i of r)for(const s of i)js(e,s);return e}function Ko(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function Ba(r,e,i){if(!Ko(r)||!Ko(e))return NaN;let s=0,o=0;return r[2]e[2]&&(s=r[0]-e[2]),r[1]>e[3]&&(o=r[1]-e[3]),r[3]=s)return s;if(fn(o,c)){if(_c(r,e))return 0}else if(_c(e,r))return 0;let u=1/0;for(const f of r)for(let g=0,y=f.length,v=y-1;g0;){const g=u.pop();if(g[0]>=c)continue;const y=g[1],v=e?50:100;if(La(y)<=v){if(!rr(y,r.length))return NaN;if(e){const w=ku(r,y,i,s);if(isNaN(w)||w===0)return w;c=Math.min(c,w)}else for(let w=y[0];w<=y[1];++w){const S=zu(r[w],i,s);if(c=Math.min(c,S),c===0)return 0}}else{const w=Fa(y,e);rt(u,c,s,r,f,w[0]),rt(u,c,s,r,f,w[1])}}return c}function ja(r,e,i,s,o,c=1/0){let u=Math.min(c,o.distance(r[0],i[0]));if(u===0)return u;const f=new hc([[0,[0,r.length-1],[0,i.length-1]]],mc);for(;f.length>0;){const g=f.pop();if(g[0]>=u)continue;const y=g[1],v=g[2],w=e?50:100,S=s?50:100;if(La(y)<=w&&La(v)<=S){if(!rr(y,r.length)&&rr(v,i.length))return NaN;let P;if(e&&s)P=Du(r,y,i,v,o),u=Math.min(u,P);else if(e&&!s){const E=r.slice(y[0],y[1]+1);for(let C=v[0];C<=v[1];++C)if(P=gn(i[C],E,o),u=Math.min(u,P),u===0)return u}else if(!e&&s){const E=i.slice(v[0],v[1]+1);for(let C=y[0];C<=y[1];++C)if(P=gn(r[C],E,o),u=Math.min(u,P),u===0)return u}else P=gc(r,y,i,v,o),u=Math.min(u,P)}else{const P=Fa(y,e),E=Fa(v,s);Oa(f,u,o,r,i,P[0],E[0]),Oa(f,u,o,r,i,P[0],E[1]),Oa(f,u,o,r,i,P[1],E[0]),Oa(f,u,o,r,i,P[1],E[1])}}return u}function Qo(r){return r.type==="MultiPolygon"?r.coordinates.map((e=>({type:"Polygon",coordinates:e}))):r.type==="MultiLineString"?r.coordinates.map((e=>({type:"LineString",coordinates:e}))):r.type==="MultiPoint"?r.coordinates.map((e=>({type:"Point",coordinates:e}))):[r]}class _n{constructor(e,i){this.type=Ce,this.geojson=e,this.geometries=i}static parse(e,i){if(e.length!==2)return i.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ur(e[1])){const s=e[1];if(s.type==="FeatureCollection")return new _n(s,s.features.map((o=>Qo(o.geometry))).flat());if(s.type==="Feature")return new _n(s,Qo(s.geometry));if("type"in s&&"coordinates"in s)return new _n(s,Qo(s))}return i.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return(function(i,s){const o=i.geometry(),c=o.flat().map((g=>ts([g.x,g.y],i.canonical)));if(o.length===0)return NaN;const u=new Ho(c[0][1]);let f=1/0;for(const g of s){switch(g.type){case"Point":f=Math.min(f,ja(c,!1,[g.coordinates],!1,u,f));break;case"LineString":f=Math.min(f,ja(c,!1,g.coordinates,!0,u,f));break;case"Polygon":f=Math.min(f,Va(c,!1,g.coordinates,u,f))}if(f===0)return f}return f})(e,this.geometries);if(e.geometryType()==="LineString")return(function(i,s){const o=i.geometry(),c=o.flat().map((g=>ts([g.x,g.y],i.canonical)));if(o.length===0)return NaN;const u=new Ho(c[0][1]);let f=1/0;for(const g of s){switch(g.type){case"Point":f=Math.min(f,ja(c,!0,[g.coordinates],!1,u,f));break;case"LineString":f=Math.min(f,ja(c,!0,g.coordinates,!0,u,f));break;case"Polygon":f=Math.min(f,Va(c,!0,g.coordinates,u,f))}if(f===0)return f}return f})(e,this.geometries);if(e.geometryType()==="Polygon")return(function(i,s){const o=i.geometry();if(o.length===0||o[0].length===0)return NaN;const c=Ra(o,0).map((g=>g.map((y=>y.map((v=>ts([v.x,v.y],i.canonical))))))),u=new Ho(c[0][0][0][1]);let f=1/0;for(const g of s)for(const y of c){switch(g.type){case"Point":f=Math.min(f,Va([g.coordinates],!1,y,u,f));break;case"LineString":f=Math.min(f,Va(g.coordinates,!0,y,u,f));break;case"Polygon":f=Math.min(f,Ru(y,g.coordinates,u,f))}if(f===0)return f}return f})(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Us{constructor(e){this.type=qe,this.key=e}static parse(e,i){if(e.length!==2)return i.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=e[1];return s==null?i.error("Global state property must be defined."):typeof s!="string"?i.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Us(s)}evaluate(e){var i;const s=(i=e.globals)===null||i===void 0?void 0:i.globalState;return s&&Object.keys(s).length!==0?Rs(s,this.key):null}eachChild(){}outputDefined(){return!1}}const ns={"==":rc,"!=":Uo,">":Iu,"<":nc,">=":Da,"<=":Kn,array:Ai,at:Je,boolean:Ai,case:Fs,coalesce:pn,collator:Jn,format:Vs,image:Qn,in:Ze,"index-of":Xn,interpolate:Si,"interpolate-hcl":Si,"interpolate-lab":Si,length:es,let:ft,literal:gr,match:Qe,number:Ai,"number-format":Go,object:Ai,slice:Zi,step:Gr,string:Ai,"to-boolean":Er,"to-color":Er,"to-number":Er,"to-string":Er,var:Hn,within:mn,distance:_n,"global-state":Us};class $i{constructor(e,i,s,o){this.name=e,this.type=i,this._evaluate=s,this.args=o}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,i){const s=e[0],o=$i.definitions[s];if(!o)return i.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const c=Array.isArray(o)?o[0]:o.type,u=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,f=u.filter((([y])=>!Array.isArray(y)||y.length===e.length-1));let g=null;for(const[y,v]of f){g=new dn(i.registry,Na,i.path,null,i.scope);const w=[];let S=!1;for(let P=1;P{return S=w,Array.isArray(S)?`(${S.map(lt).join(", ")})`:`(${lt(S.type)}...)`;var S})).join(" | "),v=[];for(let w=1;w{i=e?i&&Na(s):i&&s instanceof gr})),!!i&&Ua(r)&&Ga(r,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Ua(r){if(r instanceof $i&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof mn||r instanceof _n)return!1;let e=!0;return r.eachChild((i=>{e&&!Ua(i)&&(e=!1)})),e}function Gs(r){if(r instanceof $i&&r.name==="feature-state")return!1;let e=!0;return r.eachChild((i=>{e&&!Gs(i)&&(e=!1)})),e}function Ga(r,e){if(r instanceof $i&&e.indexOf(r.name)>=0)return!1;let i=!0;return r.eachChild((s=>{i&&!Ga(s,e)&&(i=!1)})),i}function vc(r){return{result:"success",value:r}}function ss(r){return{result:"error",value:r}}function as(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function bc(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function tl(r){return!!r.expression&&r.expression.interpolated}function Xe(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function qa(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&jt(r)===Mr}function Lu(r){return r}function wc(r,e){const i=r.stops&&typeof r.stops[0][0]=="object",s=i||!(i||r.property!==void 0),o=r.type||(tl(e)?"exponential":"interval"),c=(function(v){switch(v.type){case"color":return He.parse;case"padding":return pi.parse;case"numberArray":return At.parse;case"colorArray":return Ve.parse;default:return null}})(e);if(c&&((r=xi({},r)).stops&&(r.stops=r.stops.map((v=>[v[0],c(v[1])]))),r.default=c(r.default?r.default:e.default)),r.colorSpace&&(u=r.colorSpace)!=="rgb"&&u!=="hcl"&&u!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var u;const f=(function(v){switch(v){case"exponential":return Tc;case"interval":return Bu;case"categorical":return Fu;case"identity":return Ou;default:throw new Error(`Unknown function type "${v}"`)}})(o);let g,y;if(o==="categorical"){g=Object.create(null);for(const v of r.stops)g[v[0]]=v[1];y=typeof r.stops[0][0]}if(i){const v={},w=[];for(let E=0;EE[0])),evaluate:({zoom:E},C)=>Tc({stops:S,base:r.base},e,E).evaluate(E,C)}}if(s){const v=o==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:v,interpolationFactor:Si.interpolationFactor.bind(void 0,v),zoomStops:r.stops.map((w=>w[0])),evaluate:({zoom:w})=>f(r,e,w,g,y)}}return{kind:"source",evaluate(v,w){const S=w&&w.properties?w.properties[r.property]:void 0;return S===void 0?qs(r.default,e.default):f(r,e,S,g,y)}}}function qs(r,e,i){return r!==void 0?r:e!==void 0?e:i!==void 0?i:void 0}function Fu(r,e,i,s,o){return qs(typeof i===o?s[i]:void 0,r.default,e.default)}function Bu(r,e,i){if(Xe(i)!=="number")return qs(r.default,e.default);const s=r.stops.length;if(s===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[s-1][0])return r.stops[s-1][1];const o=Yn(r.stops.map((c=>c[0])),i);return r.stops[o][1]}function Tc(r,e,i){const s=r.base!==void 0?r.base:1;if(Xe(i)!=="number")return qs(r.default,e.default);const o=r.stops.length;if(o===1||i<=r.stops[0][0])return r.stops[0][1];if(i>=r.stops[o-1][0])return r.stops[o-1][1];const c=Yn(r.stops.map((v=>v[0])),i),u=(function(v,w,S,P){const E=P-S,C=v-S;return E===0?0:w===1?C/E:(Math.pow(w,C)-1)/(Math.pow(w,E)-1)})(i,s,r.stops[c][0],r.stops[c+1][0]),f=r.stops[c][1],g=r.stops[c+1][1],y=St[e.type]||Lu;return typeof f.evaluate=="function"?{evaluate(...v){const w=f.evaluate.apply(void 0,v),S=g.evaluate.apply(void 0,v);if(w!==void 0&&S!==void 0)return y(w,S,u,r.colorSpace)}}:y(f,g,u,r.colorSpace)}function Ou(r,e,i){switch(e.type){case"color":i=He.parse(i);break;case"formatted":i=Ci.fromString(i.toString());break;case"resolvedImage":i=Bi.fromString(i.toString());break;case"padding":i=pi.parse(i);break;case"colorArray":i=Ve.parse(i);break;case"numberArray":i=At.parse(i);break;default:Xe(i)===e.type||e.type==="enum"&&e.values[i]||(i=void 0)}return qs(i,r.default,e.default)}$i.register(ns,{error:[{kind:"error"},[$e],(r,[e])=>{throw new pt(e.evaluate(r))}],typeof:[$e,[qe],(r,[e])=>lt(jt(e.evaluate(r)))],"to-rgba":[bi(Ce,4),[Fi],(r,[e])=>{const[i,s,o,c]=e.evaluate(r).rgb;return[255*i,255*s,255*o,c]}],rgb:[Fi,[Ce,Ce,Ce],yc],rgba:[Fi,[Ce,Ce,Ce,Ce],yc],has:{type:We,overloads:[[[$e],(r,[e])=>xc(e.evaluate(r),r.properties())],[[$e,Mr],(r,[e,i])=>xc(e.evaluate(r),i.evaluate(r))]]},get:{type:qe,overloads:[[[$e],(r,[e])=>el(e.evaluate(r),r.properties())],[[$e,Mr],(r,[e,i])=>el(e.evaluate(r),i.evaluate(r))]]},"feature-state":[qe,[$e],(r,[e])=>el(e.evaluate(r),r.featureState||{})],properties:[Mr,[],r=>r.properties()],"geometry-type":[$e,[],r=>r.geometryType()],id:[qe,[],r=>r.id()],zoom:[Ce,[],r=>r.globals.zoom],"heatmap-density":[Ce,[],r=>r.globals.heatmapDensity||0],elevation:[Ce,[],r=>r.globals.elevation||0],"line-progress":[Ce,[],r=>r.globals.lineProgress||0],accumulated:[qe,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Ce,yn(Ce),(r,e)=>{let i=0;for(const s of e)i+=s.evaluate(r);return i}],"*":[Ce,yn(Ce),(r,e)=>{let i=1;for(const s of e)i*=s.evaluate(r);return i}],"-":{type:Ce,overloads:[[[Ce,Ce],(r,[e,i])=>e.evaluate(r)-i.evaluate(r)],[[Ce],(r,[e])=>-e.evaluate(r)]]},"/":[Ce,[Ce,Ce],(r,[e,i])=>e.evaluate(r)/i.evaluate(r)],"%":[Ce,[Ce,Ce],(r,[e,i])=>e.evaluate(r)%i.evaluate(r)],ln2:[Ce,[],()=>Math.LN2],pi:[Ce,[],()=>Math.PI],e:[Ce,[],()=>Math.E],"^":[Ce,[Ce,Ce],(r,[e,i])=>Math.pow(e.evaluate(r),i.evaluate(r))],sqrt:[Ce,[Ce],(r,[e])=>Math.sqrt(e.evaluate(r))],log10:[Ce,[Ce],(r,[e])=>Math.log(e.evaluate(r))/Math.LN10],ln:[Ce,[Ce],(r,[e])=>Math.log(e.evaluate(r))],log2:[Ce,[Ce],(r,[e])=>Math.log(e.evaluate(r))/Math.LN2],sin:[Ce,[Ce],(r,[e])=>Math.sin(e.evaluate(r))],cos:[Ce,[Ce],(r,[e])=>Math.cos(e.evaluate(r))],tan:[Ce,[Ce],(r,[e])=>Math.tan(e.evaluate(r))],asin:[Ce,[Ce],(r,[e])=>Math.asin(e.evaluate(r))],acos:[Ce,[Ce],(r,[e])=>Math.acos(e.evaluate(r))],atan:[Ce,[Ce],(r,[e])=>Math.atan(e.evaluate(r))],min:[Ce,yn(Ce),(r,e)=>Math.min(...e.map((i=>i.evaluate(r))))],max:[Ce,yn(Ce),(r,e)=>Math.max(...e.map((i=>i.evaluate(r))))],abs:[Ce,[Ce],(r,[e])=>Math.abs(e.evaluate(r))],round:[Ce,[Ce],(r,[e])=>{const i=e.evaluate(r);return i<0?-Math.round(-i):Math.round(i)}],floor:[Ce,[Ce],(r,[e])=>Math.floor(e.evaluate(r))],ceil:[Ce,[Ce],(r,[e])=>Math.ceil(e.evaluate(r))],"filter-==":[We,[$e,qe],(r,[e,i])=>r.properties()[e.value]===i.value],"filter-id-==":[We,[qe],(r,[e])=>r.id()===e.value],"filter-type-==":[We,[$e],(r,[e])=>r.geometryType()===e.value],"filter-<":[We,[$e,qe],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s{const i=r.id(),s=e.value;return typeof i==typeof s&&i":[We,[$e,qe],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s>o}],"filter-id->":[We,[qe],(r,[e])=>{const i=r.id(),s=e.value;return typeof i==typeof s&&i>s}],"filter-<=":[We,[$e,qe],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s<=o}],"filter-id-<=":[We,[qe],(r,[e])=>{const i=r.id(),s=e.value;return typeof i==typeof s&&i<=s}],"filter->=":[We,[$e,qe],(r,[e,i])=>{const s=r.properties()[e.value],o=i.value;return typeof s==typeof o&&s>=o}],"filter-id->=":[We,[qe],(r,[e])=>{const i=r.id(),s=e.value;return typeof i==typeof s&&i>=s}],"filter-has":[We,[qe],(r,[e])=>e.value in r.properties()],"filter-has-id":[We,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[We,[bi($e)],(r,[e])=>e.value.indexOf(r.geometryType())>=0],"filter-id-in":[We,[bi(qe)],(r,[e])=>e.value.indexOf(r.id())>=0],"filter-in-small":[We,[$e,bi(qe)],(r,[e,i])=>i.value.indexOf(r.properties()[e.value])>=0],"filter-in-large":[We,[$e,bi(qe)],(r,[e,i])=>(function(s,o,c,u){for(;c<=u;){const f=c+u>>1;if(o[f]===s)return!0;o[f]>s?u=f-1:c=f+1}return!1})(r.properties()[e.value],i.value,0,i.value.length-1)],all:{type:We,overloads:[[[We,We],(r,[e,i])=>e.evaluate(r)&&i.evaluate(r)],[yn(We),(r,e)=>{for(const i of e)if(!i.evaluate(r))return!1;return!0}]]},any:{type:We,overloads:[[[We,We],(r,[e,i])=>e.evaluate(r)||i.evaluate(r)],[yn(We),(r,e)=>{for(const i of e)if(i.evaluate(r))return!0;return!1}]]},"!":[We,[We],(r,[e])=>!e.evaluate(r)],"is-supported-script":[We,[$e],(r,[e])=>{const i=r.globals&&r.globals.isSupportedScript;return!i||i(e.evaluate(r))}],upcase:[$e,[$e],(r,[e])=>e.evaluate(r).toUpperCase()],downcase:[$e,[$e],(r,[e])=>e.evaluate(r).toLowerCase()],concat:[$e,yn(qe),(r,e)=>e.map((i=>un(i.evaluate(r)))).join("")],"resolved-locale":[$e,[Es],(r,[e])=>e.evaluate(r).resolvedLocale()]});class il{constructor(e,i,s){this.expression=e,this._warningHistory={},this._evaluator=new Vo,this._defaultValue=i?(function(o){if(o.type==="color"&&qa(o.default))return new He(0,0,0,0);switch(o.type){case"color":return He.parse(o.default)||null;case"padding":return pi.parse(o.default)||null;case"numberArray":return At.parse(o.default)||null;case"colorArray":return Ve.parse(o.default)||null;case"variableAnchorOffsetCollection":return wi.parse(o.default)||null;case"projectionDefinition":return Ti.parse(o.default)||null;default:return o.default===void 0?null:o.default}})(i):null,this._enumValues=i&&i.type==="enum"?i.values:null,this._globalState=s}evaluateWithoutErrorHandling(e,i,s,o,c,u){return this._globalState&&(e=xn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i,this._evaluator.featureState=s,this._evaluator.canonical=o,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u,this.expression.evaluate(this._evaluator)}evaluate(e,i,s,o,c,u){this._globalState&&(e=xn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=i||null,this._evaluator.featureState=s||null,this._evaluator.canonical=o,this._evaluator.availableImages=c||null,this._evaluator.formattedSection=u||null;try{const f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new pt(`Expected value to be one of ${Object.keys(this._enumValues).map((g=>JSON.stringify(g))).join(", ")}, but found ${JSON.stringify(f)} instead.`);return f}catch(f){return this._warningHistory[f.message]||(this._warningHistory[f.message]=!0,typeof console<"u"&&console.warn(f.message)),this._defaultValue}}}function os(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in ns}function Zs(r,e,i){const s=new dn(ns,Na,[],e?(function(c){const u={color:Fi,string:$e,number:Ce,enum:$e,boolean:We,formatted:Cs,padding:Pa,numberArray:As,colorArray:Un,projectionDefinition:Sa,resolvedImage:Gn,variableAnchorOffsetCollection:Ds};return c.type==="array"?bi(u[c.value]||qe,c.length):u[c.type]})(e):void 0),o=s.parse(r,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return o?vc(new il(o,e,i)):ss(s.errors)}class Za{constructor(e,i,s){this.kind=e,this._styleExpression=i,this.isStateDependent=e!=="constant"&&!Gs(i.expression),this.globalStateRefs=qr(i.expression),this._globalState=s}evaluateWithoutErrorHandling(e,i,s,o,c,u){return this._globalState&&(e=xn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,s,o,c,u)}evaluate(e,i,s,o,c,u){return this._globalState&&(e=xn(e,this._globalState)),this._styleExpression.evaluate(e,i,s,o,c,u)}}class rl{constructor(e,i,s,o,c){this.kind=e,this.zoomStops=s,this._styleExpression=i,this.isStateDependent=e!=="camera"&&!Gs(i.expression),this.globalStateRefs=qr(i.expression),this.interpolationType=o,this._globalState=c}evaluateWithoutErrorHandling(e,i,s,o,c,u){return this._globalState&&(e=xn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,i,s,o,c,u)}evaluate(e,i,s,o,c,u){return this._globalState&&(e=xn(e,this._globalState)),this._styleExpression.evaluate(e,i,s,o,c,u)}interpolationFactor(e,i,s){return this.interpolationType?Si.interpolationFactor(this.interpolationType,e,i,s):0}}function nl(r,e,i){const s=Zs(r,e,i);if(s.result==="error")return s;const o=s.value.expression,c=Ua(o);if(!c&&!as(e))return ss([new vi("","data expressions not supported")]);const u=Ga(o,["zoom"]);if(!u&&!bc(e))return ss([new vi("","zoom expressions not supported")]);const f=Wa(o);return f||u?f instanceof vi?ss([f]):f instanceof Si&&!tl(e)?ss([new vi("",'"interpolate" expressions cannot be used with this property')]):vc(f?new rl(c?"camera":"composite",s.value,f.labels,f instanceof Si?f.interpolation:void 0,i):new Za(c?"constant":"source",s.value,i)):ss([new vi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class $a{constructor(e,i){this._parameters=e,this._specification=i,xi(this,wc(this._parameters,this._specification))}static deserialize(e){return new $a(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Wa(r){let e=null;if(r instanceof ft)e=Wa(r.result);else if(r instanceof pn){for(const i of r.args)if(e=Wa(i),e)break}else(r instanceof Gr||r instanceof Si)&&r.input instanceof $i&&r.input.name==="zoom"&&(e=r);return e instanceof vi||r.eachChild((i=>{const s=Wa(i);s instanceof vi?e=s:!e&&s?e=new vi("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new vi("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function qr(r,e=new Set){return r instanceof Us&&e.add(r.key),r.eachChild((i=>{qr(i,e)})),e}function xn(r,e){const{zoom:i,heatmapDensity:s,elevation:o,lineProgress:c,isSupportedScript:u,accumulated:f}=r??{};return{zoom:i,heatmapDensity:s,elevation:o,lineProgress:c,isSupportedScript:u,accumulated:f,globalState:e}}function sl(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const e of r.slice(1))if(!sl(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Vu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function $s(r,e){if(r==null)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};sl(r)||(r=Ws(r));const i=Zs(r,Vu,e);if(i.result==="error")throw new Error(i.value.map((s=>`${s.key}: ${s.message}`)).join(", "));return{filter:(s,o,c)=>i.value.evaluate(s,o,{},c),needGeometry:Sc(r),getGlobalStateRefs:()=>qr(i.value.expression)}}function ju(r,e){return re?1:0}function Sc(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let e=1;e"||e==="<="||e===">="?Ha(r[1],r[2],e):e==="any"?(i=r.slice(1),["any"].concat(i.map(Ws))):e==="all"?["all"].concat(r.slice(1).map(Ws)):e==="none"?["all"].concat(r.slice(1).map(Ws).map(Hs)):e==="in"?Pc(r[1],r.slice(2)):e==="!in"?Hs(Pc(r[1],r.slice(2))):e==="has"?Ic(r[1]):e!=="!has"||Hs(Ic(r[1]));var i}function Ha(r,e,i){switch(r){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,r,e]}}function Pc(r,e){if(e.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((i=>typeof i!=typeof e[0]))?["filter-in-large",r,["literal",e.sort(ju)]]:["filter-in-small",r,["literal",e]]}}function Ic(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Hs(r){return["!",r]}function Xa(r){const e=typeof r;if(e==="number"||e==="boolean"||e==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let o="[";for(const c of r)o+=`${Xa(c)},`;return`${o}]`}const i=Object.keys(r).sort();let s="{";for(let o=0;os.maximum?[new we(e,i,`${i} is greater than the maximum value ${s.maximum}`)]:[]}function Ka(r){const e=r.valueSpec,i=Nt(r.value.type);let s,o,c,u={};const f=i!=="categorical"&&r.value.property===void 0,g=!f,y=Xe(r.value.stops)==="array"&&Xe(r.value.stops[0])==="array"&&Xe(r.value.stops[0][0])==="object",v=Oi({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function(P){if(i==="identity")return[new we(P.key,P.value,'identity function may not have a "stops" property')];let E=[];const C=P.value;return E=E.concat(Ya({key:P.key,value:C,valueSpec:P.valueSpec,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec,arrayElementValidator:w})),Xe(C)==="array"&&C.length===0&&E.push(new we(P.key,C,"array must have at least one stop")),E},default:function(P){return P.validateSpec({key:P.key,value:P.value,valueSpec:e,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec})}}});return i==="identity"&&f&&v.push(new we(r.key,r.value,'missing required property "property"')),i==="identity"||r.value.stops||v.push(new we(r.key,r.value,'missing required property "stops"')),i==="exponential"&&r.valueSpec.expression&&!tl(r.valueSpec)&&v.push(new we(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(g&&!as(r.valueSpec)?v.push(new we(r.key,r.value,"property functions not supported")):f&&!bc(r.valueSpec)&&v.push(new we(r.key,r.value,"zoom functions not supported"))),i!=="categorical"&&!y||r.value.property!==void 0||v.push(new we(r.key,r.value,'"property" property is required')),v;function w(P){let E=[];const C=P.value,D=P.key;if(Xe(C)!=="array")return[new we(D,C,`array expected, ${Xe(C)} found`)];if(C.length!==2)return[new we(D,C,`array length 2 expected, length ${C.length} found`)];if(y){if(Xe(C[0])!=="object")return[new we(D,C,`object expected, ${Xe(C[0])} found`)];if(C[0].zoom===void 0)return[new we(D,C,"object stop key must have zoom")];if(C[0].value===void 0)return[new we(D,C,"object stop key must have value")];if(c&&c>Nt(C[0].zoom))return[new we(D,C[0].zoom,"stop zoom values must appear in ascending order")];Nt(C[0].zoom)!==c&&(c=Nt(C[0].zoom),o=void 0,u={}),E=E.concat(Oi({key:`${D}[0]`,value:C[0],valueSpec:{zoom:{}},validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec,objectElementValidators:{zoom:Xs,value:S}}))}else E=E.concat(S({key:`${D}[0]`,value:C[0],validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec},C));return os(vn(C[1]))?E.concat([new we(`${D}[1]`,C[1],"expressions are not allowed in function stops.")]):E.concat(P.validateSpec({key:`${D}[1]`,value:C[1],valueSpec:e,validateSpec:P.validateSpec,style:P.style,styleSpec:P.styleSpec}))}function S(P,E){const C=Xe(P.value),D=Nt(P.value),F=P.value!==null?P.value:E;if(s){if(C!==s)return[new we(P.key,F,`${C} stop domain type must match previous stop domain type ${s}`)]}else s=C;if(C!=="number"&&C!=="string"&&C!=="boolean")return[new we(P.key,F,"stop domain value must be a number, string, or boolean")];if(C!=="number"&&i!=="categorical"){let q=`number expected, ${C} found`;return as(e)&&i===void 0&&(q+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new we(P.key,F,q)]}return i!=="categorical"||C!=="number"||isFinite(D)&&Math.floor(D)===D?i!=="categorical"&&C==="number"&&o!==void 0&&Dnew we(`${r.key}${s.key}`,r.value,s.message)));const i=e.value.expression||e.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!i.outputDefined())return[new we(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!Gs(i))return[new we(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!Gs(i))return[new we(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!Ga(i,["zoom","feature-state"]))return[new we(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!Ua(i))return[new we(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ys(r){const e=r.key,i=r.value,s=Xe(i);return s!=="string"?[new we(e,i,`color expected, ${s} found`)]:He.parse(String(i))?[]:[new we(e,i,`color expected, "${i}" found`)]}function bn(r){const e=r.key,i=r.value,s=r.valueSpec,o=[];return Array.isArray(s.values)?s.values.indexOf(Nt(i))===-1&&o.push(new we(e,i,`expected one of [${s.values.join(", ")}], ${JSON.stringify(i)} found`)):Object.keys(s.values).indexOf(Nt(i))===-1&&o.push(new we(e,i,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(i)} found`)),o}function ls(r){return sl(vn(r.value))?Zr(xi({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Cc(r)}function Cc(r){const e=r.value,i=r.key;if(Xe(e)!=="array")return[new we(i,e,`array expected, ${Xe(e)} found`)];const s=r.styleSpec;let o,c=[];if(e.length<1)return[new we(i,e,"filter array must have at least 1 element")];switch(c=c.concat(bn({key:`${i}[0]`,value:e[0],valueSpec:s.filter_operator,style:r.style,styleSpec:r.styleSpec})),Nt(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&Nt(e[1])==="$type"&&c.push(new we(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&c.push(new we(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(o=Xe(e[1]),o!=="string"&&c.push(new we(`${i}[1]`,e[1],`string expected, ${o} found`)));for(let u=2;uc.node_name&&c.node_name.toLowerCase()===r);if(n&&n.pubkey)return`0x${n.pubkey.substring(0,2)}`}catch{continue}return null}function p(e){return e.rtt_ms>500||e.rssi<-120?"Poor":e.rtt_ms>250||e.rssi<-100?"Fair":e.rtt_ms>100||e.rssi<-80?"Good":"Excellent"}async function m(e,r=10){if(r<1||r>60)return{success:!1,error:"Timeout must be 1-60 seconds"};let o;const s=e.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(s)o=`0x${s[2].padStart(2,"0")}`;else{const n=await f(e);if(!n)return{success:!1,error:`Node '${e}' not found`};o=n}const t=await d(o,r);if(!t.success||!t.data)return{success:!1,error:t.error||"Ping failed"};const a=p(t.data);return{success:!0,data:{...t.data,quality:a}}}export{m as a,d as p}; +import{dT as i}from"./index-WhzslczH.js";async function d(e,r=10){return i("/api/ping_neighbor",{method:"POST",body:JSON.stringify({target_id:e,timeout:r})})}const u=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];async function f(e){const r=e.toLowerCase();for(const o of u)try{const s=await i(`/api/adverts_by_contact_type?contact_type=${encodeURIComponent(o)}&hours=168`),t=s.success&&s.data?s.data:s,n=(Array.isArray(t)?t:[]).find(c=>c.node_name&&c.node_name.toLowerCase()===r);if(n&&n.pubkey)return`0x${n.pubkey.substring(0,2)}`}catch{continue}return null}function p(e){return e.rtt_ms>500||e.rssi<-120?"Poor":e.rtt_ms>250||e.rssi<-100?"Fair":e.rtt_ms>100||e.rssi<-80?"Good":"Excellent"}async function m(e,r=10){if(r<1||r>60)return{success:!1,error:"Timeout must be 1-60 seconds"};let o;const s=e.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(s)o=`0x${s[2].padStart(2,"0")}`;else{const n=await f(e);if(!n)return{success:!1,error:`Node '${e}' not found`};o=n}const t=await d(o,r);if(!t.success||!t.data)return{success:!1,error:t.error||"Ping failed"};const a=p(t.data);return{success:!0,data:{...t.data,quality:a}}}export{m as a,d as p}; diff --git a/frontend/dist/assets/plus-CNNHSjgp.js b/frontend/dist/assets/plus-Q9JrSYS-.js similarity index 86% rename from frontend/dist/assets/plus-CNNHSjgp.js rename to frontend/dist/assets/plus-Q9JrSYS-.js index 65d4226d..a9556785 100644 --- a/frontend/dist/assets/plus-CNNHSjgp.js +++ b/frontend/dist/assets/plus-Q9JrSYS-.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/primitives-BahnzDua.js b/frontend/dist/assets/primitives-Bq_jqX-t.js similarity index 99% rename from frontend/dist/assets/primitives-BahnzDua.js rename to frontend/dist/assets/primitives-Bq_jqX-t.js index 54523028..a5c06c08 100644 --- a/frontend/dist/assets/primitives-BahnzDua.js +++ b/frontend/dist/assets/primitives-Bq_jqX-t.js @@ -1 +1 @@ -import{bu as D,dE as O,by as k,bx as B,bJ as g,eD as N,eE as S,ah as p,eF as z,eG as A,eH as E,j as o,r as j,en as V,eo as M,ep as L}from"./index-CvSa8h-C.js";function U(e){const s=e&3,n=e>>2&15,t=e>>6&3;return[{bits:"0-1",field:"Route Type",value:k(s),binary:(s&3).toString(2).padStart(2,"0")},{bits:"2-5",field:"Payload Type",value:B(n),binary:(n&15).toString(2).padStart(4,"0")},{bits:"6-7",field:"Version",value:t.toString(),binary:(t&3).toString(2).padStart(2,"0")}]}function J(e){if(!e||e.length<4)return null;const s=D.fromHex(e);if(!s.success||!s.packet)return null;const n=s.packet,t=U(n.header),a=e.slice(0,2);let r=2,l="";n.hasTransportCodes()&&(l=e.slice(2,10),r=10);const c=e.slice(r,r+2),y=r+2,x=y+n.pathLen*2,m=e.slice(y,x),d=e.slice(x),h=O(n),i=Math.floor(r/2),u=Math.floor(y/2);return{packet:n,headerHex:a,headerFields:t,transportCodesHex:l,pathLengthHex:c,pathDataHex:m,payloadHex:d,pathLenByteOffset:i,pathByteOffset:u,payloadStartByte:Math.floor(x/2),decoded:h}}function X(e){if(!e||e.length<8)return null;const s=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),t=parseInt(e.slice(4,6),16),a=parseInt(e.slice(6,8),16);return isNaN(s)||isNaN(n)||isNaN(t)||isNaN(a)?null:((s|n<<8|t<<16|a<<24)>>>0).toString(16).toUpperCase().padStart(8,"0")}function F(e){return e>=10?"excellent":e>=5?"good":e>=0?"fair":e>=-5?"poor":"critical"}function H(e){if(e._traceSnrPath!=null&&e._traceSnrPath.length>0)return e._traceSnrPath;if(e.raw_packet){const s=e.payload_type??e.type,n=S(e.raw_packet,s);if(n&&n.length>0)return n}return[]}function K(e){if(!e.payload)return null;try{const s=g(e.payload),n=H(e),t=N(s,n);return t?{packet:e,decoded:t,timestamp:e.timestamp??0,hopCount:t.snrValues.length,rssi:e.rssi,snr:e.snr}:null}catch{return null}}function Z(e){const s=new Map;for(const n of e){const t=K(n);if(!t)continue;const a=t.decoded.traceTag,r=s.get(a)||[];r.push(t),s.set(a,r)}for(const[n,t]of s)t.sort((a,r)=>a.timestamp-r.timestamp),s.set(n,t);return s}function ee(e,s){if(s.length===0)return{traceTag:e,traceTagValue:0,targetPath:[],targetHopCount:0,observations:[],observationCount:0,firstSeen:0,lastSeen:0,duration:0,isComplete:!1,maxHopsObserved:0,progressPercent:0,bestObservation:null,hopStats:[],linkQuality:null};const n=[...s].sort((i,u)=>i.timestamp-u.timestamp),t=n.reduce((i,u)=>u.hopCount>i.hopCount?u:i,n[0]),a=n[0].timestamp,r=n[n.length-1].timestamp,l=t.decoded.pathHashes,c=l.length,y=t.hopCount,x=t.decoded.isComplete,m=[],d=t.decoded.snrValues;for(let i=0;i0){const i=Math.min(...d),u=Math.max(...d),P=d.reduce(($,R)=>$+R,0)/d.length,w=d.indexOf(i),_=d.indexOf(u);h={minSnr:i,maxSnr:u,avgSnr:P,weakestLinkPosition:w,strongestLinkPosition:_}}return{traceTag:e,traceTagValue:t.decoded.traceTagValue,targetPath:l,targetHopCount:c,observations:n,observationCount:n.length,firstSeen:a,lastSeen:r,duration:r-a,isComplete:x,maxHopsObserved:y,progressPercent:c>0?Math.round(y/c*100):0,bestObservation:t,hopStats:m,linkQuality:h,srcHash:t.packet.src_hash,dstHash:t.packet.dst_hash}}function W(e){const s=e.payload_type??e.type;if(s!==p.TRACE||!e.payload)return null;try{const n=g(e.payload);let t=[];if(e._traceSnrPath!=null&&e._traceSnrPath.length>0)t=e._traceSnrPath;else if(e.raw_packet){const a=S(e.raw_packet,s);a&&a.length>0&&(t=a)}return N(n,t)}catch{return null}}function q(e){if((e.payload_type??e.type)!==p.ADVERT||!e.payload)return null;try{const n=g(e.payload),t=z(n);if(!t)return null;const a=t.publicKey.slice(0,2).toUpperCase(),r={...t,prefix:a};let l=null;return t.latitude&&t.longitude&&(l={latitude:t.latitude,longitude:t.longitude,name:t.name||`Node ${a||"??"}`,prefix:a,publicKey:t.publicKey}),{data:r,sourceNode:l}}catch{return null}}function C(e){if(!e)return null;const s=e.trim(),n=/(-?\d+\.?\d*)\s*[,\s]\s*(-?\d+\.?\d*)/,t=s.match(n);if(!t)return null;const a=parseFloat(t[1]),r=parseFloat(t[2]);return isNaN(a)||isNaN(r)||a<-90||a>90||r<-180||r>180||a===0&&r===0?null:{lat:a,lon:r}}function Q(e){var n,t;if(!e.decrypted||!((n=e.channelName)!=null&&n.toLowerCase().includes("wardrive")))return null;const s=C(e.text);return s?{latitude:s.lat,longitude:s.lon,name:e.senderName||"Wardrive Ping",prefix:((t=e.senderName)==null?void 0:t.slice(0,2).toUpperCase())||"WD",nodeType:"wardrive"}:null}function te(e,s){const n=e.payload_type??e.type;if(n===p.TRACE){const t=W(e);if(t)return{kind:"trace",data:t,snrValues:t.snrValues}}if(n===p.ADVERT){const t=q(e);if(t)return{kind:"advert",data:t.data,sourceNode:t.sourceNode}}if(n===p.GRP_TXT&&s){const t=C(s.text),a=Q(s);return{kind:"grp_txt",decoded:s,wardriveCoords:t,wardriveSourceNode:a}}if(n===p.CONTROL){const t=I(e);if(t)return{kind:"control",data:t}}if(n===p.ANON_REQ){const t=G(e);if(t)return{kind:"anon_req",data:t}}return{kind:"generic"}}function I(e){if((e.payload_type??e.type)!==p.CONTROL||!e.payload)return null;try{const n=g(e.payload);return A(n)}catch{return null}}function G(e){if((e.payload_type??e.type)!==p.ANON_REQ||!e.payload)return null;try{const n=g(e.payload),t=E(n);if(!t)return null;const a=t.senderPublicKey.slice(0,2).toUpperCase();return{...t,prefix:a}}catch{return null}}const f={zinc:{stem:"bg-zinc-500/40",dot:"bg-zinc-400",row:"bg-zinc-500/8",text:"text-fg-muted/60",chip:"bg-zinc-500/20 text-fg-muted"},green:{stem:"bg-sys-green/50",dot:"bg-sys-green",row:"bg-sys-green/8",text:"text-sys-green",chip:"bg-sys-green/15 text-sys-green"},amber:{stem:"bg-sys-amber/50",dot:"bg-sys-amber",row:"bg-sys-amber/8",text:"text-sys-amber",chip:"bg-sys-amber/15 text-sys-amber"},red:{stem:"bg-sys-red/50",dot:"bg-sys-red",row:"bg-sys-red/8",text:"text-sys-red",chip:"bg-sys-red/15 text-sys-red"},blue:{stem:"bg-sys-blue/50",dot:"bg-sys-blue",row:"bg-sys-blue/8",text:"text-sys-blue",chip:"bg-sys-blue/15 text-sys-blue"},purple:{stem:"bg-sys-purple/50",dot:"bg-sys-purple",row:"bg-sys-purple/8",text:"text-sys-purple",chip:"bg-sys-purple/15 text-sys-purple"},teal:{stem:"bg-sys-teal/50",dot:"bg-sys-teal",row:"bg-sys-teal/8",text:"text-sys-teal",chip:"bg-sys-teal/15 text-sys-teal"},cyan:{stem:"bg-sys-cyan/50",dot:"bg-sys-cyan",row:"bg-sys-cyan/8",text:"text-sys-cyan",chip:"bg-sys-cyan/15 text-sys-cyan"},sky:{stem:"bg-sys-sky/50",dot:"bg-sys-sky",row:"bg-sys-sky/8",text:"text-sys-sky",chip:"bg-sys-sky/15 text-sys-sky"},pink:{stem:"bg-sys-pink/50",dot:"bg-sys-pink",row:"bg-sys-pink/8",text:"text-sys-pink",chip:"bg-sys-pink/15 text-sys-pink"},orange:{stem:"bg-sys-orange/50",dot:"bg-sys-orange",row:"bg-sys-orange/8",text:"text-sys-orange",chip:"bg-sys-orange/15 text-sys-orange"}};Object.fromEntries(Object.entries(f).map(([e,s])=>[e,s.text]));const T=j.createContext("");function se({prefix:e,children:s}){return o.jsx(T.Provider,{value:e,children:s})}function v(){return j.useContext(T)}function ne({children:e,color:s="zinc"}){var n;return o.jsx("span",{className:`inline-flex items-center px-1.5 py-px rounded-full text-[9px] font-mono font-medium leading-tight ${((n=f[s])==null?void 0:n.chip)??f.zinc.chip}`,children:e})}function re({fn:e,value:s,color:n="zinc"}){var r;const t=v(),a=t?`${t}(${e})`:e;return o.jsxs("span",{title:a,className:"inline-flex items-baseline gap-0 font-mono",children:[o.jsx("span",{className:"text-fg-muted/40",children:e}),o.jsx("span",{className:"text-fg-muted/20",children:"("}),s?o.jsx("span",{className:((r=f[n])==null?void 0:r.text)??f.zinc.text,children:s}):o.jsx("span",{className:"text-fg-muted/20",children:"·"}),o.jsx("span",{className:"text-fg-muted/20",children:")"})]})}function ae({label:e,children:s,mono:n=!0,padY:t=!1}){const a=v(),r=e.trim(),l=a?`${a}(${r})`:r;return o.jsxs("div",{className:`flex items-center gap-2 ${t?"py-1":"py-0.5"}`,children:[o.jsx("dt",{className:"text-fg-muted shrink-0 w-28 text-right",children:e}),o.jsx("dd",{title:l,className:n?"text-fg-primary break-all":"text-fg-primary",children:s})]})}function oe({value:e,className:s}){const n=typeof e=="number"?`0x${e.toString(16).toUpperCase().padStart(2,"0")}`:e.startsWith("0x")?e:`0x${e}`;return o.jsx("span",{className:s??"text-sys-blue",children:n})}function le({value:e}){const s=typeof e=="number"?e.toString(16).toUpperCase().padStart(2,"0"):e.replace(/^0x/i,"").toUpperCase();return o.jsxs("span",{className:"px-1 py-px rounded bg-zinc-500/15 text-fg-secondary font-mono text-[11px]",children:["0x",s]})}function ie({value:e}){return o.jsx("span",{className:"px-1 py-px rounded bg-zinc-500/10 text-fg-muted font-mono text-[10px]",children:e.toString(2).padStart(8,"0")})}function ce({raw:e,children:s}){return o.jsxs("span",{className:"inline-flex items-center gap-1.5 flex-wrap",children:[o.jsx("span",{className:"font-mono text-fg-muted",children:e}),o.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),s]})}const b={blue:"text-sys-blue",amber:"text-sys-amber",green:"text-sys-green",teal:"text-sys-teal",purple:"text-sys-purple"};function de({hops:e,hexPrefix:s,color:n="amber"}){if(e.length===0)return o.jsx("span",{className:"text-fg-muted italic",children:"∅ zero-hop"});const t=b[n]??b.amber;return o.jsxs("span",{className:"inline-flex items-center gap-1 flex-wrap",children:[s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"font-mono text-fg-muted text-[10px]",children:s}),o.jsx("span",{className:"text-fg-muted/40 text-[10px] mx-0.5",children:"→"})]}),e.map((a,r)=>o.jsxs("span",{className:"inline-flex items-center",children:[r>0&&o.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),o.jsx("span",{className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono text-[11px] ${t}`,children:a.toUpperCase()})]},r))]})}function ue({title:e}){return o.jsx("div",{className:"mt-2 pt-2 border-t border-edge-subtle",children:e&&o.jsx("p",{className:"text-sys-amber font-semibold mb-0.5",children:e})})}function pe(e){if(!e||e<=0)return"never";const s=Math.floor(Date.now()/1e3)-e;return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:`${Math.floor(s/86400)}d ago`}function ye(e){return e>0?"green":"zinc"}function xe({children:e,c:s}){return o.jsx("span",{className:s??"text-fg-muted",children:e})}function fe({tokens:e,label:s="emits"}){const n=e.filter(r=>r.value!=null&&r.value!=="");if(n.length===0)return null;const t=[];let a;for(let r=0;r{var x;if(r.type==="label")return o.jsx("span",{className:"text-[8px] text-fg-muted/40 uppercase tracking-wider font-mono",children:r.group},`g-${l}`);const c=r.token,y=c.raw?`${c.fn}(${c.raw} → ${c.value})`:`${c.fn}(${c.value})`;return o.jsx("span",{title:y,className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono cursor-default ${((x=f[c.color??"zinc"])==null?void 0:x.text)??f.zinc.text}`,children:c.value},r.idx)})})})]})})}export{f as A,ie as B,ne as C,le as H,ae as K,de as P,ce as R,se as S,re as T,W as a,ee as b,fe as c,te as d,X as e,ue as f,Z as g,oe as h,xe as i,pe as j,J as p,ye as s}; +import{bu as D,dE as O,by as k,bx as B,bJ as g,eD as N,eE as S,ah as p,eF as z,eG as A,eH as E,j as o,r as j,en as V,eo as M,ep as L}from"./index-WhzslczH.js";function U(e){const s=e&3,n=e>>2&15,t=e>>6&3;return[{bits:"0-1",field:"Route Type",value:k(s),binary:(s&3).toString(2).padStart(2,"0")},{bits:"2-5",field:"Payload Type",value:B(n),binary:(n&15).toString(2).padStart(4,"0")},{bits:"6-7",field:"Version",value:t.toString(),binary:(t&3).toString(2).padStart(2,"0")}]}function J(e){if(!e||e.length<4)return null;const s=D.fromHex(e);if(!s.success||!s.packet)return null;const n=s.packet,t=U(n.header),a=e.slice(0,2);let r=2,l="";n.hasTransportCodes()&&(l=e.slice(2,10),r=10);const c=e.slice(r,r+2),y=r+2,x=y+n.pathLen*2,m=e.slice(y,x),d=e.slice(x),h=O(n),i=Math.floor(r/2),u=Math.floor(y/2);return{packet:n,headerHex:a,headerFields:t,transportCodesHex:l,pathLengthHex:c,pathDataHex:m,payloadHex:d,pathLenByteOffset:i,pathByteOffset:u,payloadStartByte:Math.floor(x/2),decoded:h}}function X(e){if(!e||e.length<8)return null;const s=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),t=parseInt(e.slice(4,6),16),a=parseInt(e.slice(6,8),16);return isNaN(s)||isNaN(n)||isNaN(t)||isNaN(a)?null:((s|n<<8|t<<16|a<<24)>>>0).toString(16).toUpperCase().padStart(8,"0")}function F(e){return e>=10?"excellent":e>=5?"good":e>=0?"fair":e>=-5?"poor":"critical"}function H(e){if(e._traceSnrPath!=null&&e._traceSnrPath.length>0)return e._traceSnrPath;if(e.raw_packet){const s=e.payload_type??e.type,n=S(e.raw_packet,s);if(n&&n.length>0)return n}return[]}function K(e){if(!e.payload)return null;try{const s=g(e.payload),n=H(e),t=N(s,n);return t?{packet:e,decoded:t,timestamp:e.timestamp??0,hopCount:t.snrValues.length,rssi:e.rssi,snr:e.snr}:null}catch{return null}}function Z(e){const s=new Map;for(const n of e){const t=K(n);if(!t)continue;const a=t.decoded.traceTag,r=s.get(a)||[];r.push(t),s.set(a,r)}for(const[n,t]of s)t.sort((a,r)=>a.timestamp-r.timestamp),s.set(n,t);return s}function ee(e,s){if(s.length===0)return{traceTag:e,traceTagValue:0,targetPath:[],targetHopCount:0,observations:[],observationCount:0,firstSeen:0,lastSeen:0,duration:0,isComplete:!1,maxHopsObserved:0,progressPercent:0,bestObservation:null,hopStats:[],linkQuality:null};const n=[...s].sort((i,u)=>i.timestamp-u.timestamp),t=n.reduce((i,u)=>u.hopCount>i.hopCount?u:i,n[0]),a=n[0].timestamp,r=n[n.length-1].timestamp,l=t.decoded.pathHashes,c=l.length,y=t.hopCount,x=t.decoded.isComplete,m=[],d=t.decoded.snrValues;for(let i=0;i0){const i=Math.min(...d),u=Math.max(...d),P=d.reduce(($,R)=>$+R,0)/d.length,w=d.indexOf(i),_=d.indexOf(u);h={minSnr:i,maxSnr:u,avgSnr:P,weakestLinkPosition:w,strongestLinkPosition:_}}return{traceTag:e,traceTagValue:t.decoded.traceTagValue,targetPath:l,targetHopCount:c,observations:n,observationCount:n.length,firstSeen:a,lastSeen:r,duration:r-a,isComplete:x,maxHopsObserved:y,progressPercent:c>0?Math.round(y/c*100):0,bestObservation:t,hopStats:m,linkQuality:h,srcHash:t.packet.src_hash,dstHash:t.packet.dst_hash}}function W(e){const s=e.payload_type??e.type;if(s!==p.TRACE||!e.payload)return null;try{const n=g(e.payload);let t=[];if(e._traceSnrPath!=null&&e._traceSnrPath.length>0)t=e._traceSnrPath;else if(e.raw_packet){const a=S(e.raw_packet,s);a&&a.length>0&&(t=a)}return N(n,t)}catch{return null}}function q(e){if((e.payload_type??e.type)!==p.ADVERT||!e.payload)return null;try{const n=g(e.payload),t=z(n);if(!t)return null;const a=t.publicKey.slice(0,2).toUpperCase(),r={...t,prefix:a};let l=null;return t.latitude&&t.longitude&&(l={latitude:t.latitude,longitude:t.longitude,name:t.name||`Node ${a||"??"}`,prefix:a,publicKey:t.publicKey}),{data:r,sourceNode:l}}catch{return null}}function C(e){if(!e)return null;const s=e.trim(),n=/(-?\d+\.?\d*)\s*[,\s]\s*(-?\d+\.?\d*)/,t=s.match(n);if(!t)return null;const a=parseFloat(t[1]),r=parseFloat(t[2]);return isNaN(a)||isNaN(r)||a<-90||a>90||r<-180||r>180||a===0&&r===0?null:{lat:a,lon:r}}function Q(e){var n,t;if(!e.decrypted||!((n=e.channelName)!=null&&n.toLowerCase().includes("wardrive")))return null;const s=C(e.text);return s?{latitude:s.lat,longitude:s.lon,name:e.senderName||"Wardrive Ping",prefix:((t=e.senderName)==null?void 0:t.slice(0,2).toUpperCase())||"WD",nodeType:"wardrive"}:null}function te(e,s){const n=e.payload_type??e.type;if(n===p.TRACE){const t=W(e);if(t)return{kind:"trace",data:t,snrValues:t.snrValues}}if(n===p.ADVERT){const t=q(e);if(t)return{kind:"advert",data:t.data,sourceNode:t.sourceNode}}if(n===p.GRP_TXT&&s){const t=C(s.text),a=Q(s);return{kind:"grp_txt",decoded:s,wardriveCoords:t,wardriveSourceNode:a}}if(n===p.CONTROL){const t=I(e);if(t)return{kind:"control",data:t}}if(n===p.ANON_REQ){const t=G(e);if(t)return{kind:"anon_req",data:t}}return{kind:"generic"}}function I(e){if((e.payload_type??e.type)!==p.CONTROL||!e.payload)return null;try{const n=g(e.payload);return A(n)}catch{return null}}function G(e){if((e.payload_type??e.type)!==p.ANON_REQ||!e.payload)return null;try{const n=g(e.payload),t=E(n);if(!t)return null;const a=t.senderPublicKey.slice(0,2).toUpperCase();return{...t,prefix:a}}catch{return null}}const f={zinc:{stem:"bg-zinc-500/40",dot:"bg-zinc-400",row:"bg-zinc-500/8",text:"text-fg-muted/60",chip:"bg-zinc-500/20 text-fg-muted"},green:{stem:"bg-sys-green/50",dot:"bg-sys-green",row:"bg-sys-green/8",text:"text-sys-green",chip:"bg-sys-green/15 text-sys-green"},amber:{stem:"bg-sys-amber/50",dot:"bg-sys-amber",row:"bg-sys-amber/8",text:"text-sys-amber",chip:"bg-sys-amber/15 text-sys-amber"},red:{stem:"bg-sys-red/50",dot:"bg-sys-red",row:"bg-sys-red/8",text:"text-sys-red",chip:"bg-sys-red/15 text-sys-red"},blue:{stem:"bg-sys-blue/50",dot:"bg-sys-blue",row:"bg-sys-blue/8",text:"text-sys-blue",chip:"bg-sys-blue/15 text-sys-blue"},purple:{stem:"bg-sys-purple/50",dot:"bg-sys-purple",row:"bg-sys-purple/8",text:"text-sys-purple",chip:"bg-sys-purple/15 text-sys-purple"},teal:{stem:"bg-sys-teal/50",dot:"bg-sys-teal",row:"bg-sys-teal/8",text:"text-sys-teal",chip:"bg-sys-teal/15 text-sys-teal"},cyan:{stem:"bg-sys-cyan/50",dot:"bg-sys-cyan",row:"bg-sys-cyan/8",text:"text-sys-cyan",chip:"bg-sys-cyan/15 text-sys-cyan"},sky:{stem:"bg-sys-sky/50",dot:"bg-sys-sky",row:"bg-sys-sky/8",text:"text-sys-sky",chip:"bg-sys-sky/15 text-sys-sky"},pink:{stem:"bg-sys-pink/50",dot:"bg-sys-pink",row:"bg-sys-pink/8",text:"text-sys-pink",chip:"bg-sys-pink/15 text-sys-pink"},orange:{stem:"bg-sys-orange/50",dot:"bg-sys-orange",row:"bg-sys-orange/8",text:"text-sys-orange",chip:"bg-sys-orange/15 text-sys-orange"}};Object.fromEntries(Object.entries(f).map(([e,s])=>[e,s.text]));const T=j.createContext("");function se({prefix:e,children:s}){return o.jsx(T.Provider,{value:e,children:s})}function v(){return j.useContext(T)}function ne({children:e,color:s="zinc"}){var n;return o.jsx("span",{className:`inline-flex items-center px-1.5 py-px rounded-full text-[9px] font-mono font-medium leading-tight ${((n=f[s])==null?void 0:n.chip)??f.zinc.chip}`,children:e})}function re({fn:e,value:s,color:n="zinc"}){var r;const t=v(),a=t?`${t}(${e})`:e;return o.jsxs("span",{title:a,className:"inline-flex items-baseline gap-0 font-mono",children:[o.jsx("span",{className:"text-fg-muted/40",children:e}),o.jsx("span",{className:"text-fg-muted/20",children:"("}),s?o.jsx("span",{className:((r=f[n])==null?void 0:r.text)??f.zinc.text,children:s}):o.jsx("span",{className:"text-fg-muted/20",children:"·"}),o.jsx("span",{className:"text-fg-muted/20",children:")"})]})}function ae({label:e,children:s,mono:n=!0,padY:t=!1}){const a=v(),r=e.trim(),l=a?`${a}(${r})`:r;return o.jsxs("div",{className:`flex items-center gap-2 ${t?"py-1":"py-0.5"}`,children:[o.jsx("dt",{className:"text-fg-muted shrink-0 w-28 text-right",children:e}),o.jsx("dd",{title:l,className:n?"text-fg-primary break-all":"text-fg-primary",children:s})]})}function oe({value:e,className:s}){const n=typeof e=="number"?`0x${e.toString(16).toUpperCase().padStart(2,"0")}`:e.startsWith("0x")?e:`0x${e}`;return o.jsx("span",{className:s??"text-sys-blue",children:n})}function le({value:e}){const s=typeof e=="number"?e.toString(16).toUpperCase().padStart(2,"0"):e.replace(/^0x/i,"").toUpperCase();return o.jsxs("span",{className:"px-1 py-px rounded bg-zinc-500/15 text-fg-secondary font-mono text-[11px]",children:["0x",s]})}function ie({value:e}){return o.jsx("span",{className:"px-1 py-px rounded bg-zinc-500/10 text-fg-muted font-mono text-[10px]",children:e.toString(2).padStart(8,"0")})}function ce({raw:e,children:s}){return o.jsxs("span",{className:"inline-flex items-center gap-1.5 flex-wrap",children:[o.jsx("span",{className:"font-mono text-fg-muted",children:e}),o.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),s]})}const b={blue:"text-sys-blue",amber:"text-sys-amber",green:"text-sys-green",teal:"text-sys-teal",purple:"text-sys-purple"};function de({hops:e,hexPrefix:s,color:n="amber"}){if(e.length===0)return o.jsx("span",{className:"text-fg-muted italic",children:"∅ zero-hop"});const t=b[n]??b.amber;return o.jsxs("span",{className:"inline-flex items-center gap-1 flex-wrap",children:[s&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"font-mono text-fg-muted text-[10px]",children:s}),o.jsx("span",{className:"text-fg-muted/40 text-[10px] mx-0.5",children:"→"})]}),e.map((a,r)=>o.jsxs("span",{className:"inline-flex items-center",children:[r>0&&o.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),o.jsx("span",{className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono text-[11px] ${t}`,children:a.toUpperCase()})]},r))]})}function ue({title:e}){return o.jsx("div",{className:"mt-2 pt-2 border-t border-edge-subtle",children:e&&o.jsx("p",{className:"text-sys-amber font-semibold mb-0.5",children:e})})}function pe(e){if(!e||e<=0)return"never";const s=Math.floor(Date.now()/1e3)-e;return s<60?`${s}s ago`:s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:`${Math.floor(s/86400)}d ago`}function ye(e){return e>0?"green":"zinc"}function xe({children:e,c:s}){return o.jsx("span",{className:s??"text-fg-muted",children:e})}function fe({tokens:e,label:s="emits"}){const n=e.filter(r=>r.value!=null&&r.value!=="");if(n.length===0)return null;const t=[];let a;for(let r=0;r{var x;if(r.type==="label")return o.jsx("span",{className:"text-[8px] text-fg-muted/40 uppercase tracking-wider font-mono",children:r.group},`g-${l}`);const c=r.token,y=c.raw?`${c.fn}(${c.raw} → ${c.value})`:`${c.fn}(${c.value})`;return o.jsx("span",{title:y,className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono cursor-default ${((x=f[c.color??"zinc"])==null?void 0:x.text)??f.zinc.text}`,children:c.value},r.idx)})})})]})})}export{f as A,ie as B,ne as C,le as H,ae as K,de as P,ce as R,se as S,re as T,W as a,ee as b,fe as c,te as d,X as e,ue as f,Z as g,oe as h,xe as i,pe as j,J as p,ye as s}; diff --git a/frontend/dist/assets/refresh-cw-DQJSjSjI.js b/frontend/dist/assets/refresh-cw-BLqMXKuf.js similarity index 91% rename from frontend/dist/assets/refresh-cw-DQJSjSjI.js rename to frontend/dist/assets/refresh-cw-BLqMXKuf.js index bb0c0fe3..3ff34741 100644 --- a/frontend/dist/assets/refresh-cw-DQJSjSjI.js +++ b/frontend/dist/assets/refresh-cw-BLqMXKuf.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/search-BZtD4Hr8.js b/frontend/dist/assets/search-DttoJEPu.js similarity index 87% rename from frontend/dist/assets/search-BZtD4Hr8.js rename to frontend/dist/assets/search-DttoJEPu.js index e4e10498..8af38658 100644 --- a/frontend/dist/assets/search-BZtD4Hr8.js +++ b/frontend/dist/assets/search-DttoJEPu.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CvSa8h-C.js";/** +import{d as c}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/settings-2-CLi8XLBD.js b/frontend/dist/assets/settings-2-DdLL0vPm.js similarity index 89% rename from frontend/dist/assets/settings-2-CLi8XLBD.js rename to frontend/dist/assets/settings-2-DdLL0vPm.js index c8720761..afaa2e72 100644 --- a/frontend/dist/assets/settings-2-CLi8XLBD.js +++ b/frontend/dist/assets/settings-2-DdLL0vPm.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CvSa8h-C.js";/** +import{d as c}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/shield-DDEEZTF6.js b/frontend/dist/assets/shield-DWGSxaaG.js similarity index 90% rename from frontend/dist/assets/shield-DDEEZTF6.js rename to frontend/dist/assets/shield-DWGSxaaG.js index a6eafbf7..1636f034 100644 --- a/frontend/dist/assets/shield-DDEEZTF6.js +++ b/frontend/dist/assets/shield-DWGSxaaG.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/system-CteuZERM.js b/frontend/dist/assets/system-Dr_EmFwL.js similarity index 91% rename from frontend/dist/assets/system-CteuZERM.js rename to frontend/dist/assets/system-Dr_EmFwL.js index 19465bb6..5248e4eb 100644 --- a/frontend/dist/assets/system-CteuZERM.js +++ b/frontend/dist/assets/system-Dr_EmFwL.js @@ -1 +1 @@ -import{dT as t}from"./index-CvSa8h-C.js";async function a(){return t("/api/transport_keys")}async function e(o){return t("/api/transport_keys",{method:"POST",body:JSON.stringify(o)})}async function s(o,r){return t(`/api/transport_key/${o}`,{method:"PUT",body:JSON.stringify(r)})}async function c(o){return t(`/api/transport_key/${o}`,{method:"DELETE"})}async function i(){return t("/api/global_flood_policy")}async function y(o){return t("/api/global_flood_policy",{method:"POST",body:JSON.stringify({global_flood_allow:o})})}async function l(o){return t("/api/restart_service",{method:"POST",body:"{}",signal:o})}async function p(){return t("/api/check_pymc_console")}export{i as a,e as b,p as c,c as d,a as g,l as r,y as s,s as u}; +import{dT as t}from"./index-WhzslczH.js";async function a(){return t("/api/transport_keys")}async function e(o){return t("/api/transport_keys",{method:"POST",body:JSON.stringify(o)})}async function s(o,r){return t(`/api/transport_key/${o}`,{method:"PUT",body:JSON.stringify(r)})}async function c(o){return t(`/api/transport_key/${o}`,{method:"DELETE"})}async function i(){return t("/api/global_flood_policy")}async function y(o){return t("/api/global_flood_policy",{method:"POST",body:JSON.stringify({global_flood_allow:o})})}async function l(o){return t("/api/restart_service",{method:"POST",body:"{}",signal:o})}async function p(){return t("/api/check_pymc_console")}export{i as a,e as b,p as c,c as d,a as g,l as r,y as s,s as u}; diff --git a/frontend/dist/assets/target-M8AQjykJ.js b/frontend/dist/assets/target-PpDPv2u2.js similarity index 94% rename from frontend/dist/assets/target-M8AQjykJ.js rename to frontend/dist/assets/target-PpDPv2u2.js index 19bd79fd..61de2968 100644 --- a/frontend/dist/assets/target-M8AQjykJ.js +++ b/frontend/dist/assets/target-PpDPv2u2.js @@ -1,4 +1,4 @@ -import{d as c}from"./index-CvSa8h-C.js";/** +import{d as c}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/trash-2-DUG72tk9.js b/frontend/dist/assets/trash-2-dqn51YO_.js similarity index 91% rename from frontend/dist/assets/trash-2-DUG72tk9.js rename to frontend/dist/assets/trash-2-dqn51YO_.js index df380238..43fd8491 100644 --- a/frontend/dist/assets/trash-2-DUG72tk9.js +++ b/frontend/dist/assets/trash-2-dqn51YO_.js @@ -1,4 +1,4 @@ -import{d as a}from"./index-CvSa8h-C.js";/** +import{d as a}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/triangle-alert-C7tm61-l.js b/frontend/dist/assets/triangle-alert-BsvKjxO1.js similarity index 89% rename from frontend/dist/assets/triangle-alert-C7tm61-l.js rename to frontend/dist/assets/triangle-alert-BsvKjxO1.js index 4587bd11..00156a41 100644 --- a/frontend/dist/assets/triangle-alert-C7tm61-l.js +++ b/frontend/dist/assets/triangle-alert-BsvKjxO1.js @@ -1,4 +1,4 @@ -import{d as e}from"./index-CvSa8h-C.js";/** +import{d as e}from"./index-WhzslczH.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/useMapViewStore-1D-N8rLK.js b/frontend/dist/assets/useMapViewStore-7rwVBEII.js similarity index 97% rename from frontend/dist/assets/useMapViewStore-1D-N8rLK.js rename to frontend/dist/assets/useMapViewStore-7rwVBEII.js index 6aa7e63f..b4b4e2d2 100644 --- a/frontend/dist/assets/useMapViewStore-1D-N8rLK.js +++ b/frontend/dist/assets/useMapViewStore-7rwVBEII.js @@ -1,4 +1,4 @@ -import{d as L,r as y,j as T,cw as E,e as D}from"./index-CvSa8h-C.js";import{A as H}from"./index-CPifxb0-.js";/** +import{d as L,r as y,j as T,cw as E,e as D}from"./index-WhzslczH.js";import{A as H}from"./index-WiXmWhPS.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/usePipelineStore-pGK8Y5O7.js b/frontend/dist/assets/usePipelineStore-DZf0BPc-.js similarity index 97% rename from frontend/dist/assets/usePipelineStore-pGK8Y5O7.js rename to frontend/dist/assets/usePipelineStore-DZf0BPc-.js index 0d4e929d..2e3cd2c2 100644 --- a/frontend/dist/assets/usePipelineStore-pGK8Y5O7.js +++ b/frontend/dist/assets/usePipelineStore-DZf0BPc-.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CvSa8h-C.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); -import{bY as ne,e as re,ad as te,r as ce,eI as ie,a8 as K,eB as U,eJ as de,_ as W}from"./index-CvSa8h-C.js";import{c as le,m as j,i as E}from"./node-types-BJsOTMm_.js";function oe(e){if(!e||e.length<6)return null;const h=e,n=parseInt(h.slice(0,2),16);if(isNaN(n))return null;const a=n&3;let d=2;if((a===0||a===3)&&(d=10),d+2>h.length)return null;const t=parseInt(h.slice(d,d+2),16);if(isNaN(t)||(d+=2+t*2,d>=h.length))return null;const g=h.slice(d);return g.length>=38?g.slice(0,38):g}function q(e,h="name-only"){const n=e.decoded;if(!n||!n.decrypted)return null;if(n.macCorrupted)switch(h){case"strict":return null;case"name-only":return{senderName:n.senderName||null,channelName:n.channelName||null,channelHash:n.channelHash||null,text:null,corrupted:!0,decrypted:!0}}return{senderName:n.senderName||null,channelName:n.channelName||null,channelHash:n.channelHash||null,text:n.text||null,corrupted:!!n.macCorrupted,decrypted:!0}}function J(e,h){var d;const n=new Map,a=new Map;for(const t of e){const g=t.payload_type??t.type;if(g!==ne.GRP_TXT)continue;const _=h.get(t.packet_hash);if(!((d=_==null?void 0:_.decoded)!=null&&d.decrypted)||_.decoded.macCorrupted)continue;const i=t._payloadHexPrefix??oe(t.raw_packet);i&&!n.has(i)&&n.set(i,_);const y=t.payload_length??t.length??0,s=Math.floor((t.timestamp??0)/60),m=`${g}:${y}:${s}`;a.has(m)||a.set(m,_)}return{byPayload:n,byApprox:a}}function he(e,h,n,a="name-only"){const d=e.payload_type??e.type;if(d!==ne.GRP_TXT)return null;const t=h.get(e.packet_hash);if(t)return q(t,a);const g=e._payloadHexPrefix??oe(e.raw_packet),_=(g?n.byPayload.get(g):null)??n.byApprox.get(`${d}:${e.payload_length??e.length??0}:${Math.floor((e.timestamp??0)/60)}`);return _?q(_,a):null}function ue(e){return e.name||e.node_name||null}function M(e,h,n,a,d,t,g){return{hash:e,type:h,name:n,isRepeater:h==="repeater",isCompanion:h==="companion",confident:a,advertObservations:d,topologyNeighborCount:t,topologyAffinity:g}}const se=Object.freeze(M(null,"unknown",null,!1,0,0,0)),pe=5,fe={disambiguationEnabled:!0,recencyDecayHours:12,zeroHopDecayHours:72,confidenceThreshold:.6,macCorruptedPolicy:"name-only"};function ye(e){const h=new Map,n=new Map,a=new Map,d=new Map,t=new Map,g=new Map,_=new Map;for(const[s,m]of Object.entries(e)){const l=le(m).type;h.set(s,l);const f=(s.startsWith("0x")?s.slice(2):s).toLowerCase();n.set(f,s);const T=K(s),H=ue(m);let b=a.get(T);b||(b=[],a.set(T,b)),b.push({hash:s,name:H,type:l});const N=d.get(T)||{repeaters:0,others:0};if(l==="repeater"?N.repeaters++:N.others++,d.set(T,N),H){g.set(s,H);const P=H.toLowerCase(),I=_.get(P)??0,A=m.last_seen??0;(!t.has(P)||A>I)&&(t.set(P,s),_.set(P,A))}}const i=new Set,y=new Set;for(const[s,m]of d)m.repeaters>0&&m.others>0&&i.add(s),(m.repeaters>=2||m.others>=2)&&y.add(s);return{hashToType:h,pubKeyMap:n,prefixIndex:a,crossClassPrefixes:i,sameClassAmbiguous:y,nameToHash:t,hashToName:g}}function k(e,h,n,a){const d=new Map(h),t=new Map,g=new Map,_=new Map,i=new Map,y=new Map;for(const s of e){const m=s.timestamp??0;if(s._advertSender){const l=n.get(s._advertSender)??s._advertSender,f=y.get(l);(!f||m>f.lastSeen)&&y.set(l,{lastSeen:m,name:s._advertName??(f==null?void 0:f.name)??null,nodeType:s._advertNodeType!=null?j(s._advertNodeType):(f==null?void 0:f.nodeType)??E(s.type??s.payload_type),latitude:s._advertLatitude??(f==null?void 0:f.latitude),longitude:s._advertLongitude??(f==null?void 0:f.longitude)})}else if(s.src_hash&&s.src_hash.length>8){const l=s.src_hash,f=y.get(l);f?m>f.lastSeen&&(f.lastSeen=m):y.set(l,{lastSeen:m,name:null,nodeType:E(s.type??s.payload_type)})}if(s._advertNodeType==null&&!s._advertName)continue;const v=s._advertSender;if(s._advertNodeType!=null){let l;if(v&&(l=n.get(v)),!l&&s.src_hash&&d.has(s.src_hash)&&(l=s.src_hash),l){const f=d.get(l);if(!f||f==="unknown"){const T=j(s._advertNodeType);T!=="unknown"&&d.set(l,T)}}}if(s._advertName&&v){const l=n.get(v)??v,f=s.timestamp??0,T=s._advertName.toLowerCase();if(!a.has(T)){const b=_.get(T)??0;(!t.has(T)||f>b)&&(t.set(T,l),_.set(T,f))}const H=i.get(l)??0;(!g.has(l)||f>H)&&(g.set(l,s._advertName),i.set(l,f))}}for(const[s,m]of y){const v=d.get(s);v&&v!=="unknown"&&m.nodeType==="unknown"&&(m.nodeType=v)}return{extendedHashToType:d,advertNameToHash:t,advertHashToName:g,discoveredNodes:y}}function Z(e,h,n,a,d){var y;const t=new Map,g=new Map;if(h.size===0)return{decryptedNameToHash:t,decryptedHashToName:g};const{prefixIndex:_,nameToHash:i}=n;for(const s of e){if((s.type??s.payload_type)!==pe)continue;const v=h.get(s.packet_hash);if(!((y=v==null?void 0:v.decoded)!=null&&y.decrypted)||v.decoded.macCorrupted)continue;const l=v.decoded.senderName;if(!l)continue;const f=s.src_hash;if(!f)continue;const T=K(f);let H=d.get(T);if(!H){const N=_.get(T);(N==null?void 0:N.length)===1&&(H=N[0].hash)}if(!H&&f.length>4&&(H=f),!H)continue;const b=l.toLowerCase();!i.has(b)&&!a.has(b)&&t.set(b,H),g.has(H)||g.set(H,l)}return{decryptedNameToHash:t,decryptedHashToName:g}}function me(e,h,n,a,d,t,g,_,i,y,s){var $,z,F,B,R,w,S;const m=e.src_hash,v=_==null?void 0:_.get(e.packet_hash),l=(($=v==null?void 0:v.decoded)==null?void 0:$.senderName)??null,{nameToHash:f}=h;if(!m){const r=e.type??e.payload_type,o=E(r),u=e._advertName??null;if(l){const p=l.toLowerCase(),x=f.get(p)??a.get(p)??i.get(p);if(x){const C=n.get(x)??o;return M(x,C,l,!0)}return M(null,o!=="unknown"?o:"companion",l,!1)}if(e._advertSender){const{pubKeyMap:p,hashToName:x}=h,C=p.get(e._advertSender);if(C){const G=n.get(C)??o,ae=x.get(C)??d.get(C)??y.get(C)??null;return M(C,G,ae,!0)}const D=d.get(e._advertSender);if(D){const G=n.get(e._advertSender)??o;return M(e._advertSender,G,D,!0)}const Q=y.get(e._advertSender);if(Q){const G=n.get(e._advertSender)??o;return M(e._advertSender,G,Q,!0)}}if(o!=="unknown")return M(null,o,u,!1);if(e._advertNodeType!=null){const p=j(e._advertNodeType);if(p!=="unknown")return M(null,p,u,!1)}return u?M(null,"unknown",u,!1):se}const T=e.type??e.payload_type??-1,H=e._advertSender?`${m}\0${e._advertSender}`:`${m}\0${T}\0${l??""}`,b=s.get(H);if(b)return b;const N=K(m),{pubKeyMap:P,prefixIndex:I,crossClassPrefixes:A,sameClassAmbiguous:V}=h;let c;if(e._advertSender){const r=P.get(e._advertSender);if(r){const o=n.get(r)??"unknown",u=(z=I.get(N))==null?void 0:z.find(p=>p.hash===r);c=M(r,o,(u==null?void 0:u.name)??null,!0)}else if(e._advertNodeType!=null){const o=j(e._advertNodeType);o!=="unknown"&&(c=M(e._advertSender,o,e._advertName??null,!0))}else{const o=d.get(e._advertSender);if(o){const u=n.get(e._advertSender)??E(e.type??e.payload_type);c=M(e._advertSender,u,o,!0)}}}if(!c&&l){const r=I.get(N),o=r==null?void 0:r.find(u=>{var p;return((p=u.name)==null?void 0:p.toLowerCase())===l.toLowerCase()});if(o){const u=n.get(o.hash)??o.type;c=M(o.hash,u,o.name,!0)}else{const u=l.toLowerCase(),p=f.get(u)??a.get(u)??i.get(u);if(p){const x=n.get(p)??"unknown",C=(F=I.get(K(p)))==null?void 0:F.find(D=>D.hash===p);c=M(p,x,(C==null?void 0:C.name)??l,!0)}}}if(!c&&A.has(N)){const r=E(e.type??e.payload_type);if(r!=="unknown"){const o=(B=I.get(N))==null?void 0:B.find(u=>u.type===r);o&&(c=M(o.hash,r,o.name,!0))}if(!c&&e._advertNodeType!=null){const o=j(e._advertNodeType);if(o!=="unknown"){const u=(R=I.get(N))==null?void 0:R.find(p=>p.type===o);u&&(c=M(u.hash,o,u.name,!0))}}if(!c){const o=I.get(N),u=t.get(N),p=u?o==null?void 0:o.find(D=>D.hash===u):o==null?void 0:o[0],x=p?n.get(p.hash)??p.type:"unknown",C=!!u&&!!p&&p.hash===u;c=M((p==null?void 0:p.hash)??null,x,(p==null?void 0:p.name)??null,C)}}if(!c){const r=t.get(N);if(r){const o=n.get(r)??"unknown",u=(w=I.get(N))==null?void 0:w.find(p=>p.hash===r);c=M(r,o,(u==null?void 0:u.name)??null,!0)}}if(!c&&V.has(N)){const r=(S=I.get(N))==null?void 0:S[0];c=M((r==null?void 0:r.hash)??null,(r==null?void 0:r.type)??"unknown",(r==null?void 0:r.name)??null,!1)}if(!c){const r=I.get(N);if((r==null?void 0:r.length)===1){const o=r[0];c=M(o.hash,o.type,o.name,!0)}else c=M(null,E(T),null,!1)}const O=E(T);if(O!=="unknown"&&O!==c.type&&(c=M(c.hash,O,c.name,c.confident)),c.type==="unknown"&&e._advertNodeType!=null){const r=j(e._advertNodeType);r!=="unknown"&&(c=M(c.hash,r,c.name,c.confident))}if(c.hash){const r=g.get(N);if(r){const o=r.find(u=>u.hash===c.hash);if(o){let u=0;const p=e.original_path??e.forwarded_path;if(p&&Array.isArray(p)&&p.length>0&&o.totalForwarderObservations>0){const x=new Set;for(const C of p){const D=String(C).toUpperCase().slice(0,2);D.length>=2&&D!==N&&x.add(D)}if(x.size>0){let C=0;for(const D of x)o.forwarderPrefixes.has(D)&&C++;u=C/x.size}}c=M(c.hash,c.type,c.name,c.confident,o.advertCount,o.forwarderPrefixes.size,u)}}}if(c.name===null&&c.hash){const r=h.hashToName.get(c.hash)??d.get(c.hash)??y.get(c.hash)??null;r&&(c=M(c.hash,c.type,r,c.confident,c.advertObservations,c.topologyNeighborCount,c.topologyAffinity))}return s.set(H,c),c}const ge={hashToType:new Map,pubKeyMap:new Map,prefixIndex:new Map,crossClassPrefixes:new Set,sameClassAmbiguous:new Set,nameToHash:new Map,hashToName:new Map},_e={byPayload:new Map,byApprox:new Map},L=re((e,h)=>({config:fe,neighborContext:ge,extendedHashToType:new Map,advertNameToHash:new Map,advertHashToName:new Map,resolverMap:new Map,topologyProfiles:new Map,decryptedNameToHash:new Map,decryptedHashToName:new Map,srcHashResolverMap:new Map,discoveredNodes:new Map,contentInheritanceIndex:_e,_cache:new Map,_neighborFingerprint:"",_resolverFingerprint:"",_advertScanFingerprint:"",_decodedNameFingerprint:"",_inheritanceFingerprint:"",_decodedContentVersion:0,_lastProcessedQuantizedLen:0,resolveSource:n=>{const a=h();return a.config.disambiguationEnabled?me(n,a.neighborContext,a.extendedHashToType,a.advertNameToHash,a.advertHashToName,a.resolverMap,a.topologyProfiles,Y,a.decryptedNameToHash,a.decryptedHashToName,a._cache):se},getDecodedContent:n=>{const a=h(),d=te.getState().messages;return he(n,d,a.contentInheritanceIndex,a.config.macCorruptedPolicy)},setConfig:n=>{const a={...h().config,...n};e({config:a,_cache:new Map}),X==null||X()},recompute:(n,a,d)=>{const t=h(),{config:g}=t,_=`${Object.keys(a).length}`;let i=t.neighborContext;const y=_!==t._neighborFingerprint;y&&(i=ye(a));const s=n.length>1e5?500:n.length>1e4?200:50,m=Math.floor(n.length/s)*s,v=t._lastProcessedQuantizedLen??0,l=!y&&v>0&&m>v,f=l?v:0,T=`${_}:${m}`;let H=t.extendedHashToType,b=t.advertNameToHash,N=t.advertHashToName,P=t.discoveredNodes;if(T!==t._advertScanFingerprint||y)if(l&&T!==t._advertScanFingerprint&&!y){const w=n.slice(f),S=k(w,i.hashToType,i.pubKeyMap,i.nameToHash);H=new Map([...t.extendedHashToType,...S.extendedHashToType]),b=new Map([...t.advertNameToHash,...S.advertNameToHash]),N=new Map([...t.advertHashToName,...S.advertHashToName]),P=new Map([...t.discoveredNodes,...S.discoveredNodes])}else{const w=k(n,i.hashToType,i.pubKeyMap,i.nameToHash);H=w.extendedHashToType,b=w.advertNameToHash,N=w.advertHashToName,P=w.discoveredNodes}const I=`${Object.keys(a).length}:${m}:${i.crossClassPrefixes.size}:${g.recencyDecayHours}:${g.zeroHopDecayHours}`;let A=t.resolverMap,V=t.topologyProfiles;if(I!==t._resolverFingerprint){const w=ie(n,a,{recencyDecayHours:g.recencyDecayHours,zeroHopDecayHours:g.zeroHopDecayHours});A=w.resolver,V=w.topologyProfiles}const c=Math.floor(d.size/20)*20,O=`${m}:${c}:${I}`;let $=t.decryptedNameToHash,z=t.decryptedHashToName;if(O!==t._decodedNameFingerprint)if(l&&!y){const w=n.slice(f),S=Z(w,d,i,b,A);$=new Map([...t.decryptedNameToHash,...S.decryptedNameToHash]),z=new Map([...t.decryptedHashToName,...S.decryptedHashToName])}else{const w=Z(n,d,i,b,A);$=w.decryptedNameToHash,z=w.decryptedHashToName}{const w=[];for(const[S,r]of P)if(r.name===null){const o=i.hashToName.get(S)??N.get(S)??z.get(S)??null;o&&w.push([S,o])}if(w.length>0){P=new Map(P);for(const[S,r]of w){const o=P.get(S);P.set(S,{...o,name:r})}}}const F=new Map(A);for(const[w,S]of $){const r=K(S),o=i.prefixIndex.get(r);if(!o||o.length<=1)continue;const u=o.find(p=>{var x;return((x=p.name)==null?void 0:x.toLowerCase())===w});u&&F.get(r)!==u.hash&&F.set(r,u.hash)}for(const[w,S]of b){const r=K(S),o=i.prefixIndex.get(r);if(!o||o.length<=1)continue;const u=o.find(p=>{var x;return((x=p.name)==null?void 0:x.toLowerCase())===w});u&&F.get(r)!==u.hash&&F.set(r,u.hash)}const B=`${m}:${c}`;let R=t.contentInheritanceIndex;if(B!==t._inheritanceFingerprint)if(l&&!y){const w=n.slice(f),S=J(w,d),r=new Map([...S.byPayload,...t.contentInheritanceIndex.byPayload]),o=new Map([...S.byApprox,...t.contentInheritanceIndex.byApprox]);R={byPayload:r,byApprox:o}}else R=J(n,d);de(F),U.active&&U.emit("pipeline:disambig:recompute",{packets:n.length,neighbors:Object.keys(a).length,decoded:d.size,incremental:l}),e({neighborContext:i,extendedHashToType:H,advertNameToHash:b,advertHashToName:N,resolverMap:A,topologyProfiles:V,decryptedNameToHash:$,decryptedHashToName:z,srcHashResolverMap:F,discoveredNodes:P,contentInheritanceIndex:R,_cache:new Map,_neighborFingerprint:_,_resolverFingerprint:I,_advertScanFingerprint:T,_decodedNameFingerprint:O,_inheritanceFingerprint:B,_decodedContentVersion:t._decodedContentVersion+1,_lastProcessedQuantizedLen:m})}}));let Y=new Map,X=null;function ee(e,h){var d,t,g,_;if(!(h!=null&&h.public_key))return e;const n=h.public_key.toLowerCase(),a=n.startsWith("0x")?n.slice(2):n;for(const i of Object.keys(e))if((i.startsWith("0x")?i.slice(2):i).toLowerCase()===a)return e;return{...e,[h.public_key]:{name:h.node_name,node_name:h.node_name,contact_type:"Repeater",is_repeater:!0,last_seen:Date.now()/1e3,latitude:(t=(d=h.config)==null?void 0:d.repeater)==null?void 0:t.latitude,longitude:(_=(g=h.config)==null?void 0:g.repeater)==null?void 0:_.longitude,zero_hop:!0}}}if(typeof window<"u"){let e=function(){if(!n)return 150;const i=n.useStore.getState().packets.length;return i>1e5?1e3:i>1e4?500:150},h=function(){_&&clearTimeout(_),_=setTimeout(()=>{var l;if(_=null,!n||!a)return;const i=n.useStore.getState(),y=a.useDecodedMessagesStore.getState(),s=i.packets,m=ee(((l=i.stats)==null?void 0:l.neighbors)??{},i.stats),v=y.stableMessages;L.getState().recompute(s,m,v)},e())},n=null,a=null,d=[],t,g=new Map,_=null;X=h,setTimeout(()=>{W(()=>import("./index-CvSa8h-C.js").then(i=>i.fJ),__vite__mapDeps([0,1])).then(i=>{var m,v;n=i,i.useStore.subscribe(l=>{var H,b;const f=l.packets!==d,T=((H=l.stats)==null?void 0:H.neighbors)!==t;(f||T)&&(d=l.packets,t=(b=l.stats)==null?void 0:b.neighbors,h())});const y=i.useStore.getState();d=y.packets,t=(m=y.stats)==null?void 0:m.neighbors;const s=ee(((v=y.stats)==null?void 0:v.neighbors)??{},y.stats);(d.length>0||Object.keys(s).length>0)&&L.getState().recompute(d,s,new Map)}),W(()=>import("./index-CvSa8h-C.js").then(i=>i.fH),__vite__mapDeps([0,1])).then(i=>{a=i,Y=i.useDecodedMessagesStore.getState().messages,i.useDecodedMessagesStore.subscribe(y=>{y.messages!==Y&&(Y=y.messages),y.stableMessages!==g&&(g=y.stableMessages,h())})})},0)}const we=L;function Te(){return L(e=>e.resolveSource)}function He(){return L(e=>e.neighborContext)}function Se(){return L(e=>e.topologyProfiles)}function Me(){return L(e=>e.advertNameToHash)}function be(){const e=L(a=>a.getDecodedContent),h=L(a=>a._decodedContentVersion),n=te(a=>a._successCount);return ce.useCallback(a=>e(a),[e,h,n])}function xe(){return L(e=>e.config)}function Ce(){return L(e=>e.srcHashResolverMap)}function Pe(){return L(e=>e.discoveredNodes)}export{fe as DEFAULT_PIPELINE_CONFIG,Me as useAdvertNameToHash,Pe as useDiscoveredNodes,be as useGetDecodedContent,He as useNeighborContext,xe as usePipelineConfig,we as usePipelineStore,Te as useResolveSource,Ce as useSrcHashResolverMap,Se as useTopologyProfiles}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-WhzslczH.js","assets/index-1OCG5H5s.css"])))=>i.map(i=>d[i]); +import{bY as ne,e as re,ad as te,r as ce,eI as ie,a8 as K,eB as U,eJ as de,_ as W}from"./index-WhzslczH.js";import{c as le,m as j,i as E}from"./node-types-BuI9FfZZ.js";function oe(e){if(!e||e.length<6)return null;const h=e,n=parseInt(h.slice(0,2),16);if(isNaN(n))return null;const a=n&3;let d=2;if((a===0||a===3)&&(d=10),d+2>h.length)return null;const t=parseInt(h.slice(d,d+2),16);if(isNaN(t)||(d+=2+t*2,d>=h.length))return null;const g=h.slice(d);return g.length>=38?g.slice(0,38):g}function q(e,h="name-only"){const n=e.decoded;if(!n||!n.decrypted)return null;if(n.macCorrupted)switch(h){case"strict":return null;case"name-only":return{senderName:n.senderName||null,channelName:n.channelName||null,channelHash:n.channelHash||null,text:null,corrupted:!0,decrypted:!0}}return{senderName:n.senderName||null,channelName:n.channelName||null,channelHash:n.channelHash||null,text:n.text||null,corrupted:!!n.macCorrupted,decrypted:!0}}function J(e,h){var d;const n=new Map,a=new Map;for(const t of e){const g=t.payload_type??t.type;if(g!==ne.GRP_TXT)continue;const _=h.get(t.packet_hash);if(!((d=_==null?void 0:_.decoded)!=null&&d.decrypted)||_.decoded.macCorrupted)continue;const i=t._payloadHexPrefix??oe(t.raw_packet);i&&!n.has(i)&&n.set(i,_);const y=t.payload_length??t.length??0,s=Math.floor((t.timestamp??0)/60),m=`${g}:${y}:${s}`;a.has(m)||a.set(m,_)}return{byPayload:n,byApprox:a}}function he(e,h,n,a="name-only"){const d=e.payload_type??e.type;if(d!==ne.GRP_TXT)return null;const t=h.get(e.packet_hash);if(t)return q(t,a);const g=e._payloadHexPrefix??oe(e.raw_packet),_=(g?n.byPayload.get(g):null)??n.byApprox.get(`${d}:${e.payload_length??e.length??0}:${Math.floor((e.timestamp??0)/60)}`);return _?q(_,a):null}function ue(e){return e.name||e.node_name||null}function M(e,h,n,a,d,t,g){return{hash:e,type:h,name:n,isRepeater:h==="repeater",isCompanion:h==="companion",confident:a,advertObservations:d,topologyNeighborCount:t,topologyAffinity:g}}const se=Object.freeze(M(null,"unknown",null,!1,0,0,0)),pe=5,fe={disambiguationEnabled:!0,recencyDecayHours:12,zeroHopDecayHours:72,confidenceThreshold:.6,macCorruptedPolicy:"name-only"};function ye(e){const h=new Map,n=new Map,a=new Map,d=new Map,t=new Map,g=new Map,_=new Map;for(const[s,m]of Object.entries(e)){const l=le(m).type;h.set(s,l);const f=(s.startsWith("0x")?s.slice(2):s).toLowerCase();n.set(f,s);const T=K(s),H=ue(m);let b=a.get(T);b||(b=[],a.set(T,b)),b.push({hash:s,name:H,type:l});const N=d.get(T)||{repeaters:0,others:0};if(l==="repeater"?N.repeaters++:N.others++,d.set(T,N),H){g.set(s,H);const P=H.toLowerCase(),I=_.get(P)??0,A=m.last_seen??0;(!t.has(P)||A>I)&&(t.set(P,s),_.set(P,A))}}const i=new Set,y=new Set;for(const[s,m]of d)m.repeaters>0&&m.others>0&&i.add(s),(m.repeaters>=2||m.others>=2)&&y.add(s);return{hashToType:h,pubKeyMap:n,prefixIndex:a,crossClassPrefixes:i,sameClassAmbiguous:y,nameToHash:t,hashToName:g}}function k(e,h,n,a){const d=new Map(h),t=new Map,g=new Map,_=new Map,i=new Map,y=new Map;for(const s of e){const m=s.timestamp??0;if(s._advertSender){const l=n.get(s._advertSender)??s._advertSender,f=y.get(l);(!f||m>f.lastSeen)&&y.set(l,{lastSeen:m,name:s._advertName??(f==null?void 0:f.name)??null,nodeType:s._advertNodeType!=null?j(s._advertNodeType):(f==null?void 0:f.nodeType)??E(s.type??s.payload_type),latitude:s._advertLatitude??(f==null?void 0:f.latitude),longitude:s._advertLongitude??(f==null?void 0:f.longitude)})}else if(s.src_hash&&s.src_hash.length>8){const l=s.src_hash,f=y.get(l);f?m>f.lastSeen&&(f.lastSeen=m):y.set(l,{lastSeen:m,name:null,nodeType:E(s.type??s.payload_type)})}if(s._advertNodeType==null&&!s._advertName)continue;const v=s._advertSender;if(s._advertNodeType!=null){let l;if(v&&(l=n.get(v)),!l&&s.src_hash&&d.has(s.src_hash)&&(l=s.src_hash),l){const f=d.get(l);if(!f||f==="unknown"){const T=j(s._advertNodeType);T!=="unknown"&&d.set(l,T)}}}if(s._advertName&&v){const l=n.get(v)??v,f=s.timestamp??0,T=s._advertName.toLowerCase();if(!a.has(T)){const b=_.get(T)??0;(!t.has(T)||f>b)&&(t.set(T,l),_.set(T,f))}const H=i.get(l)??0;(!g.has(l)||f>H)&&(g.set(l,s._advertName),i.set(l,f))}}for(const[s,m]of y){const v=d.get(s);v&&v!=="unknown"&&m.nodeType==="unknown"&&(m.nodeType=v)}return{extendedHashToType:d,advertNameToHash:t,advertHashToName:g,discoveredNodes:y}}function Z(e,h,n,a,d){var y;const t=new Map,g=new Map;if(h.size===0)return{decryptedNameToHash:t,decryptedHashToName:g};const{prefixIndex:_,nameToHash:i}=n;for(const s of e){if((s.type??s.payload_type)!==pe)continue;const v=h.get(s.packet_hash);if(!((y=v==null?void 0:v.decoded)!=null&&y.decrypted)||v.decoded.macCorrupted)continue;const l=v.decoded.senderName;if(!l)continue;const f=s.src_hash;if(!f)continue;const T=K(f);let H=d.get(T);if(!H){const N=_.get(T);(N==null?void 0:N.length)===1&&(H=N[0].hash)}if(!H&&f.length>4&&(H=f),!H)continue;const b=l.toLowerCase();!i.has(b)&&!a.has(b)&&t.set(b,H),g.has(H)||g.set(H,l)}return{decryptedNameToHash:t,decryptedHashToName:g}}function me(e,h,n,a,d,t,g,_,i,y,s){var $,z,F,B,R,w,S;const m=e.src_hash,v=_==null?void 0:_.get(e.packet_hash),l=(($=v==null?void 0:v.decoded)==null?void 0:$.senderName)??null,{nameToHash:f}=h;if(!m){const r=e.type??e.payload_type,o=E(r),u=e._advertName??null;if(l){const p=l.toLowerCase(),x=f.get(p)??a.get(p)??i.get(p);if(x){const C=n.get(x)??o;return M(x,C,l,!0)}return M(null,o!=="unknown"?o:"companion",l,!1)}if(e._advertSender){const{pubKeyMap:p,hashToName:x}=h,C=p.get(e._advertSender);if(C){const G=n.get(C)??o,ae=x.get(C)??d.get(C)??y.get(C)??null;return M(C,G,ae,!0)}const D=d.get(e._advertSender);if(D){const G=n.get(e._advertSender)??o;return M(e._advertSender,G,D,!0)}const Q=y.get(e._advertSender);if(Q){const G=n.get(e._advertSender)??o;return M(e._advertSender,G,Q,!0)}}if(o!=="unknown")return M(null,o,u,!1);if(e._advertNodeType!=null){const p=j(e._advertNodeType);if(p!=="unknown")return M(null,p,u,!1)}return u?M(null,"unknown",u,!1):se}const T=e.type??e.payload_type??-1,H=e._advertSender?`${m}\0${e._advertSender}`:`${m}\0${T}\0${l??""}`,b=s.get(H);if(b)return b;const N=K(m),{pubKeyMap:P,prefixIndex:I,crossClassPrefixes:A,sameClassAmbiguous:V}=h;let c;if(e._advertSender){const r=P.get(e._advertSender);if(r){const o=n.get(r)??"unknown",u=(z=I.get(N))==null?void 0:z.find(p=>p.hash===r);c=M(r,o,(u==null?void 0:u.name)??null,!0)}else if(e._advertNodeType!=null){const o=j(e._advertNodeType);o!=="unknown"&&(c=M(e._advertSender,o,e._advertName??null,!0))}else{const o=d.get(e._advertSender);if(o){const u=n.get(e._advertSender)??E(e.type??e.payload_type);c=M(e._advertSender,u,o,!0)}}}if(!c&&l){const r=I.get(N),o=r==null?void 0:r.find(u=>{var p;return((p=u.name)==null?void 0:p.toLowerCase())===l.toLowerCase()});if(o){const u=n.get(o.hash)??o.type;c=M(o.hash,u,o.name,!0)}else{const u=l.toLowerCase(),p=f.get(u)??a.get(u)??i.get(u);if(p){const x=n.get(p)??"unknown",C=(F=I.get(K(p)))==null?void 0:F.find(D=>D.hash===p);c=M(p,x,(C==null?void 0:C.name)??l,!0)}}}if(!c&&A.has(N)){const r=E(e.type??e.payload_type);if(r!=="unknown"){const o=(B=I.get(N))==null?void 0:B.find(u=>u.type===r);o&&(c=M(o.hash,r,o.name,!0))}if(!c&&e._advertNodeType!=null){const o=j(e._advertNodeType);if(o!=="unknown"){const u=(R=I.get(N))==null?void 0:R.find(p=>p.type===o);u&&(c=M(u.hash,o,u.name,!0))}}if(!c){const o=I.get(N),u=t.get(N),p=u?o==null?void 0:o.find(D=>D.hash===u):o==null?void 0:o[0],x=p?n.get(p.hash)??p.type:"unknown",C=!!u&&!!p&&p.hash===u;c=M((p==null?void 0:p.hash)??null,x,(p==null?void 0:p.name)??null,C)}}if(!c){const r=t.get(N);if(r){const o=n.get(r)??"unknown",u=(w=I.get(N))==null?void 0:w.find(p=>p.hash===r);c=M(r,o,(u==null?void 0:u.name)??null,!0)}}if(!c&&V.has(N)){const r=(S=I.get(N))==null?void 0:S[0];c=M((r==null?void 0:r.hash)??null,(r==null?void 0:r.type)??"unknown",(r==null?void 0:r.name)??null,!1)}if(!c){const r=I.get(N);if((r==null?void 0:r.length)===1){const o=r[0];c=M(o.hash,o.type,o.name,!0)}else c=M(null,E(T),null,!1)}const O=E(T);if(O!=="unknown"&&O!==c.type&&(c=M(c.hash,O,c.name,c.confident)),c.type==="unknown"&&e._advertNodeType!=null){const r=j(e._advertNodeType);r!=="unknown"&&(c=M(c.hash,r,c.name,c.confident))}if(c.hash){const r=g.get(N);if(r){const o=r.find(u=>u.hash===c.hash);if(o){let u=0;const p=e.original_path??e.forwarded_path;if(p&&Array.isArray(p)&&p.length>0&&o.totalForwarderObservations>0){const x=new Set;for(const C of p){const D=String(C).toUpperCase().slice(0,2);D.length>=2&&D!==N&&x.add(D)}if(x.size>0){let C=0;for(const D of x)o.forwarderPrefixes.has(D)&&C++;u=C/x.size}}c=M(c.hash,c.type,c.name,c.confident,o.advertCount,o.forwarderPrefixes.size,u)}}}if(c.name===null&&c.hash){const r=h.hashToName.get(c.hash)??d.get(c.hash)??y.get(c.hash)??null;r&&(c=M(c.hash,c.type,r,c.confident,c.advertObservations,c.topologyNeighborCount,c.topologyAffinity))}return s.set(H,c),c}const ge={hashToType:new Map,pubKeyMap:new Map,prefixIndex:new Map,crossClassPrefixes:new Set,sameClassAmbiguous:new Set,nameToHash:new Map,hashToName:new Map},_e={byPayload:new Map,byApprox:new Map},L=re((e,h)=>({config:fe,neighborContext:ge,extendedHashToType:new Map,advertNameToHash:new Map,advertHashToName:new Map,resolverMap:new Map,topologyProfiles:new Map,decryptedNameToHash:new Map,decryptedHashToName:new Map,srcHashResolverMap:new Map,discoveredNodes:new Map,contentInheritanceIndex:_e,_cache:new Map,_neighborFingerprint:"",_resolverFingerprint:"",_advertScanFingerprint:"",_decodedNameFingerprint:"",_inheritanceFingerprint:"",_decodedContentVersion:0,_lastProcessedQuantizedLen:0,resolveSource:n=>{const a=h();return a.config.disambiguationEnabled?me(n,a.neighborContext,a.extendedHashToType,a.advertNameToHash,a.advertHashToName,a.resolverMap,a.topologyProfiles,Y,a.decryptedNameToHash,a.decryptedHashToName,a._cache):se},getDecodedContent:n=>{const a=h(),d=te.getState().messages;return he(n,d,a.contentInheritanceIndex,a.config.macCorruptedPolicy)},setConfig:n=>{const a={...h().config,...n};e({config:a,_cache:new Map}),X==null||X()},recompute:(n,a,d)=>{const t=h(),{config:g}=t,_=`${Object.keys(a).length}`;let i=t.neighborContext;const y=_!==t._neighborFingerprint;y&&(i=ye(a));const s=n.length>1e5?500:n.length>1e4?200:50,m=Math.floor(n.length/s)*s,v=t._lastProcessedQuantizedLen??0,l=!y&&v>0&&m>v,f=l?v:0,T=`${_}:${m}`;let H=t.extendedHashToType,b=t.advertNameToHash,N=t.advertHashToName,P=t.discoveredNodes;if(T!==t._advertScanFingerprint||y)if(l&&T!==t._advertScanFingerprint&&!y){const w=n.slice(f),S=k(w,i.hashToType,i.pubKeyMap,i.nameToHash);H=new Map([...t.extendedHashToType,...S.extendedHashToType]),b=new Map([...t.advertNameToHash,...S.advertNameToHash]),N=new Map([...t.advertHashToName,...S.advertHashToName]),P=new Map([...t.discoveredNodes,...S.discoveredNodes])}else{const w=k(n,i.hashToType,i.pubKeyMap,i.nameToHash);H=w.extendedHashToType,b=w.advertNameToHash,N=w.advertHashToName,P=w.discoveredNodes}const I=`${Object.keys(a).length}:${m}:${i.crossClassPrefixes.size}:${g.recencyDecayHours}:${g.zeroHopDecayHours}`;let A=t.resolverMap,V=t.topologyProfiles;if(I!==t._resolverFingerprint){const w=ie(n,a,{recencyDecayHours:g.recencyDecayHours,zeroHopDecayHours:g.zeroHopDecayHours});A=w.resolver,V=w.topologyProfiles}const c=Math.floor(d.size/20)*20,O=`${m}:${c}:${I}`;let $=t.decryptedNameToHash,z=t.decryptedHashToName;if(O!==t._decodedNameFingerprint)if(l&&!y){const w=n.slice(f),S=Z(w,d,i,b,A);$=new Map([...t.decryptedNameToHash,...S.decryptedNameToHash]),z=new Map([...t.decryptedHashToName,...S.decryptedHashToName])}else{const w=Z(n,d,i,b,A);$=w.decryptedNameToHash,z=w.decryptedHashToName}{const w=[];for(const[S,r]of P)if(r.name===null){const o=i.hashToName.get(S)??N.get(S)??z.get(S)??null;o&&w.push([S,o])}if(w.length>0){P=new Map(P);for(const[S,r]of w){const o=P.get(S);P.set(S,{...o,name:r})}}}const F=new Map(A);for(const[w,S]of $){const r=K(S),o=i.prefixIndex.get(r);if(!o||o.length<=1)continue;const u=o.find(p=>{var x;return((x=p.name)==null?void 0:x.toLowerCase())===w});u&&F.get(r)!==u.hash&&F.set(r,u.hash)}for(const[w,S]of b){const r=K(S),o=i.prefixIndex.get(r);if(!o||o.length<=1)continue;const u=o.find(p=>{var x;return((x=p.name)==null?void 0:x.toLowerCase())===w});u&&F.get(r)!==u.hash&&F.set(r,u.hash)}const B=`${m}:${c}`;let R=t.contentInheritanceIndex;if(B!==t._inheritanceFingerprint)if(l&&!y){const w=n.slice(f),S=J(w,d),r=new Map([...S.byPayload,...t.contentInheritanceIndex.byPayload]),o=new Map([...S.byApprox,...t.contentInheritanceIndex.byApprox]);R={byPayload:r,byApprox:o}}else R=J(n,d);de(F),U.active&&U.emit("pipeline:disambig:recompute",{packets:n.length,neighbors:Object.keys(a).length,decoded:d.size,incremental:l}),e({neighborContext:i,extendedHashToType:H,advertNameToHash:b,advertHashToName:N,resolverMap:A,topologyProfiles:V,decryptedNameToHash:$,decryptedHashToName:z,srcHashResolverMap:F,discoveredNodes:P,contentInheritanceIndex:R,_cache:new Map,_neighborFingerprint:_,_resolverFingerprint:I,_advertScanFingerprint:T,_decodedNameFingerprint:O,_inheritanceFingerprint:B,_decodedContentVersion:t._decodedContentVersion+1,_lastProcessedQuantizedLen:m})}}));let Y=new Map,X=null;function ee(e,h){var d,t,g,_;if(!(h!=null&&h.public_key))return e;const n=h.public_key.toLowerCase(),a=n.startsWith("0x")?n.slice(2):n;for(const i of Object.keys(e))if((i.startsWith("0x")?i.slice(2):i).toLowerCase()===a)return e;return{...e,[h.public_key]:{name:h.node_name,node_name:h.node_name,contact_type:"Repeater",is_repeater:!0,last_seen:Date.now()/1e3,latitude:(t=(d=h.config)==null?void 0:d.repeater)==null?void 0:t.latitude,longitude:(_=(g=h.config)==null?void 0:g.repeater)==null?void 0:_.longitude,zero_hop:!0}}}if(typeof window<"u"){let e=function(){if(!n)return 150;const i=n.useStore.getState().packets.length;return i>1e5?1e3:i>1e4?500:150},h=function(){_&&clearTimeout(_),_=setTimeout(()=>{var l;if(_=null,!n||!a)return;const i=n.useStore.getState(),y=a.useDecodedMessagesStore.getState(),s=i.packets,m=ee(((l=i.stats)==null?void 0:l.neighbors)??{},i.stats),v=y.stableMessages;L.getState().recompute(s,m,v)},e())},n=null,a=null,d=[],t,g=new Map,_=null;X=h,setTimeout(()=>{W(()=>import("./index-WhzslczH.js").then(i=>i.fJ),__vite__mapDeps([0,1])).then(i=>{var m,v;n=i,i.useStore.subscribe(l=>{var H,b;const f=l.packets!==d,T=((H=l.stats)==null?void 0:H.neighbors)!==t;(f||T)&&(d=l.packets,t=(b=l.stats)==null?void 0:b.neighbors,h())});const y=i.useStore.getState();d=y.packets,t=(m=y.stats)==null?void 0:m.neighbors;const s=ee(((v=y.stats)==null?void 0:v.neighbors)??{},y.stats);(d.length>0||Object.keys(s).length>0)&&L.getState().recompute(d,s,new Map)}),W(()=>import("./index-WhzslczH.js").then(i=>i.fH),__vite__mapDeps([0,1])).then(i=>{a=i,Y=i.useDecodedMessagesStore.getState().messages,i.useDecodedMessagesStore.subscribe(y=>{y.messages!==Y&&(Y=y.messages),y.stableMessages!==g&&(g=y.stableMessages,h())})})},0)}const we=L;function Te(){return L(e=>e.resolveSource)}function He(){return L(e=>e.neighborContext)}function Se(){return L(e=>e.topologyProfiles)}function Me(){return L(e=>e.advertNameToHash)}function be(){const e=L(a=>a.getDecodedContent),h=L(a=>a._decodedContentVersion),n=te(a=>a._successCount);return ce.useCallback(a=>e(a),[e,h,n])}function xe(){return L(e=>e.config)}function Ce(){return L(e=>e.srcHashResolverMap)}function Pe(){return L(e=>e.discoveredNodes)}export{fe as DEFAULT_PIPELINE_CONFIG,Me as useAdvertNameToHash,Pe as useDiscoveredNodes,be as useGetDecodedContent,He as useNeighborContext,xe as usePipelineConfig,we as usePipelineStore,Te as useResolveSource,Ce as useSrcHashResolverMap,Se as useTopologyProfiles}; diff --git a/frontend/dist/assets/webgl-device-QoBMYpnS-Br3jubF3.js b/frontend/dist/assets/webgl-device-QoBMYpnS-C8RX9Ou8.js similarity index 99% rename from frontend/dist/assets/webgl-device-QoBMYpnS-Br3jubF3.js rename to frontend/dist/assets/webgl-device-QoBMYpnS-C8RX9Ou8.js index 89899e24..cbe8830c 100644 --- a/frontend/dist/assets/webgl-device-QoBMYpnS-Br3jubF3.js +++ b/frontend/dist/assets/webgl-device-QoBMYpnS-C8RX9Ou8.js @@ -1,2 +1,2 @@ -import{N as ie,B as p,c as Ke,u as Ye,s as Je,o as Ze,$ as F,e as B,D as et,K as tt,l as rt,a as st,h as it,T as Se,j as nt,U as _e,J as at,r as ot,d as lt,b as S,f as ct,H as ut,I as ht}from"./MeshGraph-8GIpDJZb.js";import"./index-CvSa8h-C.js";import"./max-B4xU84un.js";import"./consumer-registry-BsBD_8RF.js";import"./badge-colors-MuK22b26.js";import"./triangle-alert-C7tm61-l.js";import"./database-bNR-4XQS.js";import"./DataBox-CwAsAwyY.js";import"./meshcore-tx-constants-DgpFTAmf.js";import"./target-M8AQjykJ.js";import"./layers-Cnw2L-3K.js";import"./search-BZtD4Hr8.js";import"./download-CNAyp-3r.js";import"./settings-2-CLi8XLBD.js";import"./chevron-right-1kmv-Vqa.js";import"./network-VirimdjG.js";var dt=Object.defineProperty,ft=(r,e,t)=>e in r?dt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,o=(r,e,t)=>ft(r,typeof e!="symbol"?e+"":e,t);function gt(r){return _e()?at()?"Electron":(ot.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}function pt(){let r,e;return{promise:new Promise((t,s)=>{r=t,e=s}),resolve:r,reject:e}}const Pe=class R{constructor(e){o(this,"id"),o(this,"props"),o(this,"canvas"),o(this,"htmlCanvas"),o(this,"offscreenCanvas"),o(this,"type"),o(this,"initialized"),o(this,"isInitialized",!1),o(this,"isVisible",!0),o(this,"cssWidth"),o(this,"cssHeight"),o(this,"devicePixelRatio"),o(this,"devicePixelWidth"),o(this,"devicePixelHeight"),o(this,"drawingBufferWidth"),o(this,"drawingBufferHeight"),o(this,"_initializedResolvers",pt()),o(this,"_resizeObserver"),o(this,"_intersectionObserver"),o(this,"_position"),o(this,"destroyed",!1);var t,s;if(this.props={...R.defaultProps,...e},e=this.props,this.initialized=this._initializedResolvers.promise,_e()?e.canvas?typeof e.canvas=="string"?this.canvas=bt(e.canvas):this.canvas=e.canvas:this.canvas=vt(e):this.canvas={width:e.width||1,height:e.height||1},R.isHTMLCanvas(this.canvas)?(this.id=e.id||this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):R.isOffscreenCanvas(this.canvas)?(this.id=e.id||"offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas):(this.id=e.id||"node-canvas-context",this.type="node"),this.cssWidth=((t=this.htmlCanvas)==null?void 0:t.clientWidth)||this.canvas.width,this.cssHeight=((s=this.htmlCanvas)==null?void 0:s.clientHeight)||this.canvas.height,this.devicePixelWidth=this.canvas.width,this.devicePixelHeight=this.canvas.height,this.drawingBufferWidth=this.canvas.width,this.drawingBufferHeight=this.canvas.height,this.devicePixelRatio=globalThis.devicePixelRatio||1,this._position=[0,0],R.isHTMLCanvas(this.canvas)){this._intersectionObserver=new IntersectionObserver(i=>this._handleIntersection(i)),this._intersectionObserver.observe(this.canvas),this._resizeObserver=new ResizeObserver(i=>this._handleResize(i));try{this._resizeObserver.observe(this.canvas,{box:"device-pixel-content-box"})}catch{this._resizeObserver.observe(this.canvas,{box:"content-box"})}setTimeout(()=>this._observeDevicePixelRatio(),0),this.props.trackPosition&&this._trackPosition()}}static isHTMLCanvas(e){return typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement}static isOffscreenCanvas(e){return typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}destroy(){this.destroyed=!0}setProps(e){return"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1,this._updateDrawingBufferSize()),this}getCSSSize(){return[this.cssWidth,this.cssHeight]}getPosition(){return this._position}getDevicePixelSize(){return[this.devicePixelWidth,this.devicePixelHeight]}getDrawingBufferSize(){return[this.drawingBufferWidth,this.drawingBufferHeight]}getMaxDrawingBufferSize(){const e=this.device.limits.maxTextureDimension2D;return[e,e]}setDrawingBufferSize(e,t){this.canvas.width=e,this.canvas.height=t,this.drawingBufferWidth=e,this.drawingBufferHeight=t}getDevicePixelRatio(){return typeof window<"u"&&window.devicePixelRatio||1}cssToDevicePixels(e,t=!0){const s=this.cssToDeviceRatio(),[i,n]=this.getDrawingBufferSize();return yt(e,s,i,n,t)}getPixelSize(){return this.getDevicePixelSize()}getAspect(){const[e,t]=this.getDevicePixelSize();return e/t}cssToDeviceRatio(){try{const[e]=this.getDrawingBufferSize(),[t]=this.getCSSSize();return t?e/t:1}catch{return 1}}resize(e){this.setDrawingBufferSize(e.width,e.height)}_setAutoCreatedCanvasId(e){var t;((t=this.htmlCanvas)==null?void 0:t.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}_handleIntersection(e){const t=e.find(i=>i.target===this.canvas);if(!t)return;const s=t.isIntersecting;this.isVisible!==s&&(this.isVisible=s,this.device.props.onVisibilityChange(this))}_handleResize(e){var t,s;const i=e.find(h=>h.target===this.canvas);if(!i)return;this.cssWidth=i.contentBoxSize[0].inlineSize,this.cssHeight=i.contentBoxSize[0].blockSize;const n=this.getDevicePixelSize(),a=((t=i.devicePixelContentBoxSize)==null?void 0:t[0].inlineSize)||i.contentBoxSize[0].inlineSize*devicePixelRatio,l=((s=i.devicePixelContentBoxSize)==null?void 0:s[0].blockSize)||i.contentBoxSize[0].blockSize*devicePixelRatio,[c,u]=this.getMaxDrawingBufferSize();this.devicePixelWidth=Math.max(1,Math.min(a,c)),this.devicePixelHeight=Math.max(1,Math.min(l,u)),this._updateDrawingBufferSize(),this.device.props.onResize(this,{oldPixelSize:n})}_updateDrawingBufferSize(){if(this.props.autoResize){if(typeof this.props.useDevicePixels=="number"){const e=this.props.useDevicePixels;this.setDrawingBufferSize(this.cssWidth*e,this.cssHeight*e)}else this.props.useDevicePixels?this.setDrawingBufferSize(this.devicePixelWidth,this.devicePixelHeight):this.setDrawingBufferSize(this.cssWidth,this.cssHeight);this._updateDevice()}this._initializedResolvers.resolve(),this.isInitialized=!0,this.updatePosition()}_observeDevicePixelRatio(){const e=this.devicePixelRatio;this.devicePixelRatio=window.devicePixelRatio,this.updatePosition(),this.device.props.onDevicePixelRatioChange(this,{oldRatio:e}),matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener("change",()=>this._observeDevicePixelRatio(),{once:!0})}_trackPosition(e=100){const t=setInterval(()=>{this.destroyed?clearInterval(t):this.updatePosition()},e)}updatePosition(){var e,t,s;const i=(e=this.htmlCanvas)==null?void 0:e.getBoundingClientRect();if(i){const n=[i.left,i.top];if(this._position??(this._position=n),n[0]!==this._position[0]||n[1]!==this._position[1]){const a=this._position;this._position=n,(s=(t=this.device.props).onPositionChange)==null||s.call(t,this,{oldPosition:a})}}}};o(Pe,"defaultProps",{id:void 0,canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb",trackPosition:!1});let Te=Pe;function mt(r){if(typeof r=="string"){const e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}return r||document.body}function bt(r){const e=document.getElementById(r);if(!Te.isHTMLCanvas(e))throw new Error("Object is not a canvas element");return e}function vt(r){const{width:e,height:t}=r,s=document.createElement("canvas");s.id=ht("lumagl-auto-created-canvas"),s.width=e||1,s.height=t||1,s.style.width=Number.isFinite(e)?`${e}px`:"100%",s.style.height=Number.isFinite(t)?`${t}px`:"100%",r!=null&&r.visible||(s.style.visibility="hidden");const i=mt((r==null?void 0:r.container)||null);return i.insertBefore(s,i.firstChild),s}function yt(r,e,t,s,i){const n=r,a=ne(n[0],e,t);let l=ae(n[1],e,s,i),c=ne(n[0]+1,e,t);const u=c===t-1?c:c-1;c=ae(n[1]+1,e,s,i);let h;return i?(c=c===0?c:c+1,h=l,l=c):h=c===s-1?c:c-1,{x:a,y:l,width:Math.max(u-a+1,1),height:Math.max(h-l+1,1)}}function ne(r,e,t){return Math.min(Math.round(r*e),t-1)}function ae(r,e,t,s){return s?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}const Ae=class Be extends S{constructor(e,t={}){super(e,t,Be.defaultProps),o(this,"width"),o(this,"height"),this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}clone(e){const t=this.colorAttachments.map(i=>i.texture.clone(e)),s=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(e);return this.device.createFramebuffer({...this.props,colorAttachments:t,depthStencilAttachment:s})}resize(e){let t=!e;if(e){const[s,i]=Array.isArray(e)?e:[e.width,e.height];t=t||i!==this.height||s!==this.width,this.width=s,this.height=i}t&&(p.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((t,s)=>{if(typeof t=="string"){const i=this.createColorTexture(t,s);return this.attachResource(i),i.view}return t instanceof B?t.view:t});const e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){const t=this.createDepthStencilTexture(e);this.attachResource(t),this.depthStencilAttachment=t.view}else e instanceof B?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e,t){return this.device.createTexture({id:`${this.id}-color-attachment-${t}`,usage:B.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(e){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:B.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}resizeAttachments(e,t){for(let s=0;se?r.enable(t):r.disable(t),oe=(r,e,t)=>r.hint(t,e),P=(r,e,t)=>r.pixelStorei(t,e),le=(r,e,t)=>{const s=t===36006?36009:36008;return r.bindFramebuffer(s,e)},M=(r,e,t)=>{const s={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[t];r.bindBuffer(s,e)};function H(r){return Array.isArray(r)||ArrayBuffer.isView(r)&&!(r instanceof DataView)}const At={3042:y,32773:(r,e)=>r.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(r,e)=>r.clearColor(...e),3107:(r,e)=>r.colorMask(...e),2884:y,2885:(r,e)=>r.cullFace(e),2929:y,2931:(r,e)=>r.clearDepth(e),2932:(r,e)=>r.depthFunc(e),2928:(r,e)=>r.depthRange(...e),2930:(r,e)=>r.depthMask(e),3024:y,35723:oe,35725:(r,e)=>r.useProgram(e),36007:(r,e)=>r.bindRenderbuffer(36161,e),36389:(r,e)=>{var t;return(t=r.bindTransformFeedback)==null?void 0:t.call(r,36386,e)},34229:(r,e)=>r.bindVertexArray(e),36006:le,36010:le,34964:M,36662:M,36663:M,35053:M,35055:M,2886:(r,e)=>r.frontFace(e),33170:oe,2849:(r,e)=>r.lineWidth(e),32823:y,32824:"polygonOffset",10752:"polygonOffset",35977:y,32926:y,32928:y,32938:"sampleCoverage",32939:"sampleCoverage",3089:y,3088:(r,e)=>r.scissor(...e),2960:y,2961:(r,e)=>r.clearStencil(e),2968:(r,e)=>r.stencilMaskSeparate(1028,e),36005:(r,e)=>r.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(r,e)=>r.viewport(...e),34383:y,10754:y,12288:y,12289:y,12290:y,12291:y,12292:y,12293:y,12294:y,12295:y,3333:P,3317:P,37440:P,37441:P,37443:P,3330:P,3332:P,3331:P,3314:P,32878:P,3316:P,3315:P,32877:P,framebuffer:(r,e)=>{const t=e&&"handle"in e?e.handle:e;return r.bindFramebuffer(36160,t)},blend:(r,e)=>e?r.enable(3042):r.disable(3042),blendColor:(r,e)=>r.blendColor(...e),blendEquation:(r,e)=>{const t=typeof e=="number"?[e,e]:e;r.blendEquationSeparate(...t)},blendFunc:(r,e)=>{const t=(e==null?void 0:e.length)===2?[...e,...e]:e;r.blendFuncSeparate(...t)},clearColor:(r,e)=>r.clearColor(...e),clearDepth:(r,e)=>r.clearDepth(e),clearStencil:(r,e)=>r.clearStencil(e),colorMask:(r,e)=>r.colorMask(...e),cull:(r,e)=>e?r.enable(2884):r.disable(2884),cullFace:(r,e)=>r.cullFace(e),depthTest:(r,e)=>e?r.enable(2929):r.disable(2929),depthFunc:(r,e)=>r.depthFunc(e),depthMask:(r,e)=>r.depthMask(e),depthRange:(r,e)=>r.depthRange(...e),dither:(r,e)=>e?r.enable(3024):r.disable(3024),derivativeHint:(r,e)=>{r.hint(35723,e)},frontFace:(r,e)=>r.frontFace(e),mipmapHint:(r,e)=>r.hint(33170,e),lineWidth:(r,e)=>r.lineWidth(e),polygonOffsetFill:(r,e)=>e?r.enable(32823):r.disable(32823),polygonOffset:(r,e)=>r.polygonOffset(...e),sampleCoverage:(r,e)=>r.sampleCoverage(e[0],e[1]||!1),scissorTest:(r,e)=>e?r.enable(3089):r.disable(3089),scissor:(r,e)=>r.scissor(...e),stencilTest:(r,e)=>e?r.enable(2960):r.disable(2960),stencilMask:(r,e)=>{e=H(e)?e:[e,e];const[t,s]=e;r.stencilMaskSeparate(1028,t),r.stencilMaskSeparate(1029,s)},stencilFunc:(r,e)=>{e=H(e)&&e.length===3?[...e,...e]:e;const[t,s,i,n,a,l]=e;r.stencilFuncSeparate(1028,t,s,i),r.stencilFuncSeparate(1029,n,a,l)},stencilOp:(r,e)=>{e=H(e)&&e.length===3?[...e,...e]:e;const[t,s,i,n,a,l]=e;r.stencilOpSeparate(1028,t,s,i),r.stencilOpSeparate(1029,n,a,l)},viewport:(r,e)=>r.viewport(...e)};function b(r,e,t){return e[r]!==void 0?e[r]:t[r]}const Bt={blendEquation:(r,e,t)=>r.blendEquationSeparate(b(32777,e,t),b(34877,e,t)),blendFunc:(r,e,t)=>r.blendFuncSeparate(b(32969,e,t),b(32968,e,t),b(32971,e,t),b(32970,e,t)),polygonOffset:(r,e,t)=>r.polygonOffset(b(32824,e,t),b(10752,e,t)),sampleCoverage:(r,e,t)=>r.sampleCoverage(b(32938,e,t),b(32939,e,t)),stencilFuncFront:(r,e,t)=>r.stencilFuncSeparate(1028,b(2962,e,t),b(2967,e,t),b(2963,e,t)),stencilFuncBack:(r,e,t)=>r.stencilFuncSeparate(1029,b(34816,e,t),b(36003,e,t),b(36004,e,t)),stencilOpFront:(r,e,t)=>r.stencilOpSeparate(1028,b(2964,e,t),b(2965,e,t),b(2966,e,t)),stencilOpBack:(r,e,t)=>r.stencilOpSeparate(1029,b(34817,e,t),b(34818,e,t),b(34819,e,t))},ce={enable:(r,e)=>r({[e]:!0}),disable:(r,e)=>r({[e]:!1}),pixelStorei:(r,e,t)=>r({[e]:t}),hint:(r,e,t)=>r({[e]:t}),useProgram:(r,e)=>r({35725:e}),bindRenderbuffer:(r,e,t)=>r({36007:t}),bindTransformFeedback:(r,e,t)=>r({36389:t}),bindVertexArray:(r,e)=>r({34229:e}),bindFramebuffer:(r,e,t)=>{switch(e){case 36160:return r({36006:t,36010:t});case 36009:return r({36006:t});case 36008:return r({36010:t});default:return null}},bindBuffer:(r,e,t)=>{const s={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return s?r({[s]:t}):{valueChanged:!0}},blendColor:(r,e,t,s,i)=>r({32773:new Float32Array([e,t,s,i])}),blendEquation:(r,e)=>r({32777:e,34877:e}),blendEquationSeparate:(r,e,t)=>r({32777:e,34877:t}),blendFunc:(r,e,t)=>r({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(r,e,t,s,i)=>r({32969:e,32968:t,32971:s,32970:i}),clearColor:(r,e,t,s,i)=>r({3106:new Float32Array([e,t,s,i])}),clearDepth:(r,e)=>r({2931:e}),clearStencil:(r,e)=>r({2961:e}),colorMask:(r,e,t,s,i)=>r({3107:[e,t,s,i]}),cullFace:(r,e)=>r({2885:e}),depthFunc:(r,e)=>r({2932:e}),depthRange:(r,e,t)=>r({2928:new Float32Array([e,t])}),depthMask:(r,e)=>r({2930:e}),frontFace:(r,e)=>r({2886:e}),lineWidth:(r,e)=>r({2849:e}),polygonOffset:(r,e,t)=>r({32824:e,10752:t}),sampleCoverage:(r,e,t)=>r({32938:e,32939:t}),scissor:(r,e,t,s,i)=>r({3088:new Int32Array([e,t,s,i])}),stencilMask:(r,e)=>r({2968:e,36005:e}),stencilMaskSeparate:(r,e,t)=>r({[e===1028?2968:36005]:t}),stencilFunc:(r,e,t,s)=>r({2962:e,2967:t,2963:s,34816:e,36003:t,36004:s}),stencilFuncSeparate:(r,e,t,s,i)=>r({[e===1028?2962:34816]:t,[e===1028?2967:36003]:s,[e===1028?2963:36004]:i}),stencilOp:(r,e,t,s)=>r({2964:e,2965:t,2966:s,34817:e,34818:t,34819:s}),stencilOpSeparate:(r,e,t,s,i)=>r({[e===1028?2964:34817]:t,[e===1028?2965:34818]:s,[e===1028?2966:34819]:i}),viewport:(r,e,t,s,i)=>r({2978:[e,t,s,i]})},T=(r,e)=>r.isEnabled(e),ue={3042:T,2884:T,2929:T,3024:T,32823:T,32926:T,32928:T,3089:T,2960:T,35977:T},Ft=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function O(r,e){if(Ct(e))return;const t={};for(const i in e){const n=Number(i),a=At[i];a&&(typeof a=="string"?t[a]=!0:a(r,e[i],n))}const s=r.state&&r.state.cache;if(s)for(const i in t){const n=Bt[i];n(r,e,s)}}function Ie(r,e=J){if(typeof e=="number"){const i=e,n=ue[i];return n?n(r,i):r.getParameter(i)}const t=Array.isArray(e)?e:Object.keys(e),s={};for(const i of t){const n=ue[i];s[i]=n?n(r,Number(i)):r.getParameter(Number(i))}return s}function Lt(r){O(r,J)}function Ct(r){for(const e in r)return!1;return!0}function kt(r,e){if(r===e)return!0;if(he(r)&&he(e)&&r.length===e.length){for(let t=0;t{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}static get(e){return e.state}push(e={}){this.stateStack.push({})}pop(){const e=this.stateStack[this.stateStack.length-1];O(this.gl,e),this.stateStack.pop()}trackState(e,t){if(this.cache=t!=null&&t.copyState?Ie(e):Object.assign({},J),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0,this.gl.state=this,Dt(e);for(const s in ce){const i=ce[s];Et(e,s,i)}de(e,"getParameter"),de(e,"isEnabled")}_updateCache(e){let t=!1,s;const i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const n in e){const a=e[n],l=this.cache[n];kt(a,l)||(t=!0,s=l,i&&!(n in i)&&(i[n]=l),this.cache[n]=a)}return{valueChanged:t,oldValue:s}}}function de(r,e){const t=r[e].bind(r);r[e]=function(s){if(s===void 0||Ft.has(s))return t(s);const i=L.get(r);return s in i.cache||(i.cache[s]=t(s)),i.enable?i.cache[s]:t(s)},Object.defineProperty(r[e],"name",{value:`${e}-from-cache`,configurable:!1})}function Et(r,e,t){if(!r[e])return;const s=r[e].bind(r);r[e]=function(...i){const n=L.get(r),{valueChanged:a,oldValue:l}=t(n._updateCache,...i);return a&&s(...i),l},Object.defineProperty(r[e],"name",{value:`${e}-to-cache`,configurable:!1})}function Dt(r){const e=r.useProgram.bind(r);r.useProgram=function(t){const s=L.get(r);s.program!==t&&(e(t),s.program=t)}}function Wt(r,e,t){let s="";const i={preserveDrawingBuffer:!0,...t};let n=null;if(n||(n=r.getContext("webgl2",i)),i.failIfMajorPerformanceCaveat&&(s||(s="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow.")),!n&&!t.failIfMajorPerformanceCaveat&&(i.failIfMajorPerformanceCaveat=!1,n=r.getContext("webgl2",i),n.luma||(n.luma={}),n.luma.softwareRenderer=!0),n||(n=r.getContext("webgl",{}),n&&(n=null,s||(s="Your browser only supports WebGL1"))),!n)throw s||(s="Your browser does not support WebGL"),new Error(`Failed to create WebGL context: ${s}`);const{onContextLost:a,onContextRestored:l}=e;return r.addEventListener("webglcontextlost",c=>a(c),!1),r.addEventListener("webglcontextrestored",c=>l(c),!1),n.luma||(n.luma={}),n}function W(r,e,t){return t[e]===void 0&&(t[e]=r.getExtension(e)||null),t[e]}function Ot(r,e){const t=r.getParameter(7936),s=r.getParameter(7937);W(r,"WEBGL_debug_renderer_info",e);const i=e.WEBGL_debug_renderer_info,n=r.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),a=r.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),l=n||t,c=a||s,u=r.getParameter(7938),h=Ge(l,c),f=Mt(l,c),d=Rt(l,c);return{type:"webgl",gpu:h,gpuType:d,gpuBackend:f,vendor:l,renderer:c,version:u,shadingLanguage:"glsl",shadingLanguageVersion:300}}function Ge(r,e){return/NVIDIA/i.exec(r)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(r)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(r)||/Apple/i.exec(e)?"apple":/AMD/i.exec(r)||/AMD/i.exec(e)||/ATI/i.exec(r)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(r)||/SwiftShader/i.exec(e)?"software":"unknown"}function Mt(r,e){return/Metal/i.exec(r)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(r)||/ANGLE/i.exec(e)?"opengl":"unknown"}function Rt(r,e){if(/SwiftShader/i.exec(r)||/SwiftShader/i.exec(e))return"cpu";switch(Ge(r,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function ze(r){switch(r){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(r))}const $="WEBGL_compressed_texture_s3tc",I="WEBGL_compressed_texture_s3tc_srgb",k="EXT_texture_compression_rgtc",E="EXT_texture_compression_bptc",$t="WEBGL_compressed_texture_etc",It="WEBGL_compressed_texture_astc",Gt="WEBGL_compressed_texture_etc1",zt="WEBGL_compressed_texture_pvrtc",Vt="WEBGL_compressed_texture_atc",fe="EXT_texture_norm16",ge="EXT_render_snorm",Ut="EXT_color_buffer_float",Z={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat-renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[ge],"norm16-renderable-webgl":[fe],"snorm16-renderable-webgl":[fe,ge],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[$,I,k,E],"texture-compression-bc5-webgl":[k],"texture-compression-bc7-webgl":[E],"texture-compression-etc2":[$t],"texture-compression-astc":[It],"texture-compression-etc1-webgl":[Gt],"texture-compression-pvrtc-webgl":[zt],"texture-compression-atc-webgl":[Vt]};function Nt(r){return r in Z}function Ht(r,e,t){return(Z[e]||[]).every(s=>W(r,s,t))}const ee={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},r16unorm:{gl:33322,rb:!0},r16snorm:{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},rg16unorm:{gl:33324},rg16snorm:{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},rgb10a2uint:{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},rgba16unorm:{gl:32859,rb:!0},rgba16snorm:{gl:36763},"rgb32float-webgl":{gl:34837,x:Ut,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:$},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:I},"bc1-rgba-unorm":{gl:33777,x:$},"bc1-rgba-unorm-srgb":{gl:35916,x:I},"bc2-rgba-unorm":{gl:33778,x:$},"bc2-rgba-unorm-srgb":{gl:35918,x:I},"bc3-rgba-unorm":{gl:33779,x:$},"bc3-rgba-unorm-srgb":{gl:35919,x:I},"bc4-r-unorm":{gl:36283,x:k},"bc4-r-snorm":{gl:36284,x:k},"bc5-rg-unorm":{gl:36285,x:k},"bc5-rg-snorm":{gl:36286,x:k},"bc6h-rgb-ufloat":{gl:36495,x:E},"bc6h-rgb-float":{gl:36494,x:E},"bc7-rgba-unorm":{gl:36492,x:E},"bc7-rgba-unorm-srgb":{gl:36493,x:E},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function jt(r,e,t){let s=e.create;const i=ee[e.format];return(i==null?void 0:i.gl)===void 0&&(s=!1),i!=null&&i.x&&(s=s&&!!W(r,i.x,t)),{format:e.format,create:s&&e.create,render:s&&e.render,filter:s&&e.filter,blend:s&&e.blend,store:s&&e.store}}function Ve(r){var e;const t=ee[r],s=Xt(r),i=Se.getInfo(r);return i.compressed&&(t.dataFormat=s),{internalFormat:s,format:(t==null?void 0:t.dataFormat)||qt(i.channels,i.integer,i.normalized,s),type:i.dataType?ze(i.dataType):((e=t==null?void 0:t.types)==null?void 0:e[0])||5121,compressed:i.compressed||!1}}function Qt(r){switch(Se.getInfo(r).attachment){case"depth":return 36096;case"stencil":return 36128;case"depth-stencil":return 33306;default:throw new Error(`Not a depth stencil format: ${r}`)}}function qt(r,e,t,s){if(s===6408||s===6407)return s;switch(r){case"r":return e&&!t?36244:6403;case"rg":return e&&!t?33320:33319;case"rgb":return e&&!t?36248:6407;case"rgba":return e&&!t?36249:6408;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}function Xt(r){const e=ee[r],t=e==null?void 0:e.gl;if(t===void 0)throw new Error(`Unsupported texture format ${r}`);return t}const pe={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class Kt extends Ze{constructor(e,t,s){super([],s),o(this,"gl"),o(this,"extensions"),o(this,"testedFeatures",new Set),this.gl=e,this.extensions=t,W(e,"EXT_color_buffer_float",t)}*[Symbol.iterator](){const e=this.getFeatures();for(const t of e)this.has(t)&&(yield t);return[]}has(e){var t;return(t=this.disabledFeatures)!=null&&t[e]?!1:(this.testedFeatures.has(e)||(this.testedFeatures.add(e),Nt(e)&&Ht(this.gl,e,this.extensions)&&this.features.add(e),this.getWebGLFeature(e)&&this.features.add(e)),this.features.has(e))}initializeFeatures(){const e=this.getFeatures().filter(t=>t!=="polygon-mode-webgl");for(const t of e)this.has(t)}getFeatures(){return[...Object.keys(pe),...Object.keys(Z)]}getWebGLFeature(e){const t=pe[e];return typeof t=="string"?!!W(this.gl,t,this.extensions):!!t}}class Yt extends Je{constructor(e){super(),o(this,"gl"),o(this,"limits",{}),this.gl=e}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderVariables(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(e){return this.limits[e]===void 0&&(this.limits[e]=this.gl.getParameter(e)),this.limits[e]||0}}class G extends Fe{constructor(e,t){super(e,t),o(this,"device"),o(this,"gl"),o(this,"handle"),o(this,"colorAttachments",[]),o(this,"depthStencilAttachment",null);const s=t.handle===null;this.device=e,this.gl=e.gl,this.handle=this.props.handle||s?this.props.handle:this.gl.createFramebuffer(),s||(e._setWebGLDebugMetadata(this.handle,this,{spector:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){const e=this.gl.bindFramebuffer(36160,this.handle);for(let t=0;t(this._getCompilationStatus(),this.compilationStatus))}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const e=this.device.gl.getShaderInfoLog(this.handle);return e?ir(e):[]}getTranslatedSource(){const e=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return(e==null?void 0:e.getTranslatedShaderSource(this.handle))||null}async _compile(e){e=e.startsWith("#version ")?e:`#version 300 es +import{N as ie,B as p,c as Ke,u as Ye,s as Je,o as Ze,$ as F,e as B,D as et,K as tt,l as rt,a as st,h as it,T as Se,j as nt,U as _e,J as at,r as ot,d as lt,b as S,f as ct,H as ut,I as ht}from"./MeshGraph-V9pZlvEq.js";import"./index-WhzslczH.js";import"./max-Ch6kRxV_.js";import"./consumer-registry-DcpFyHd4.js";import"./badge-colors-BgV-I1O5.js";import"./triangle-alert-BsvKjxO1.js";import"./database-Hkah1WM3.js";import"./DataBox-ABvJ7hn1.js";import"./meshcore-tx-constants-DgpFTAmf.js";import"./target-PpDPv2u2.js";import"./layers-rhF42Hfn.js";import"./search-DttoJEPu.js";import"./download-7lpHRyVo.js";import"./settings-2-DdLL0vPm.js";import"./chevron-right-Ewog5LA3.js";import"./network-BXTFbhix.js";var dt=Object.defineProperty,ft=(r,e,t)=>e in r?dt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,o=(r,e,t)=>ft(r,typeof e!="symbol"?e+"":e,t);function gt(r){return _e()?at()?"Electron":(ot.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}function pt(){let r,e;return{promise:new Promise((t,s)=>{r=t,e=s}),resolve:r,reject:e}}const Pe=class R{constructor(e){o(this,"id"),o(this,"props"),o(this,"canvas"),o(this,"htmlCanvas"),o(this,"offscreenCanvas"),o(this,"type"),o(this,"initialized"),o(this,"isInitialized",!1),o(this,"isVisible",!0),o(this,"cssWidth"),o(this,"cssHeight"),o(this,"devicePixelRatio"),o(this,"devicePixelWidth"),o(this,"devicePixelHeight"),o(this,"drawingBufferWidth"),o(this,"drawingBufferHeight"),o(this,"_initializedResolvers",pt()),o(this,"_resizeObserver"),o(this,"_intersectionObserver"),o(this,"_position"),o(this,"destroyed",!1);var t,s;if(this.props={...R.defaultProps,...e},e=this.props,this.initialized=this._initializedResolvers.promise,_e()?e.canvas?typeof e.canvas=="string"?this.canvas=bt(e.canvas):this.canvas=e.canvas:this.canvas=vt(e):this.canvas={width:e.width||1,height:e.height||1},R.isHTMLCanvas(this.canvas)?(this.id=e.id||this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):R.isOffscreenCanvas(this.canvas)?(this.id=e.id||"offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas):(this.id=e.id||"node-canvas-context",this.type="node"),this.cssWidth=((t=this.htmlCanvas)==null?void 0:t.clientWidth)||this.canvas.width,this.cssHeight=((s=this.htmlCanvas)==null?void 0:s.clientHeight)||this.canvas.height,this.devicePixelWidth=this.canvas.width,this.devicePixelHeight=this.canvas.height,this.drawingBufferWidth=this.canvas.width,this.drawingBufferHeight=this.canvas.height,this.devicePixelRatio=globalThis.devicePixelRatio||1,this._position=[0,0],R.isHTMLCanvas(this.canvas)){this._intersectionObserver=new IntersectionObserver(i=>this._handleIntersection(i)),this._intersectionObserver.observe(this.canvas),this._resizeObserver=new ResizeObserver(i=>this._handleResize(i));try{this._resizeObserver.observe(this.canvas,{box:"device-pixel-content-box"})}catch{this._resizeObserver.observe(this.canvas,{box:"content-box"})}setTimeout(()=>this._observeDevicePixelRatio(),0),this.props.trackPosition&&this._trackPosition()}}static isHTMLCanvas(e){return typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement}static isOffscreenCanvas(e){return typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}destroy(){this.destroyed=!0}setProps(e){return"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1,this._updateDrawingBufferSize()),this}getCSSSize(){return[this.cssWidth,this.cssHeight]}getPosition(){return this._position}getDevicePixelSize(){return[this.devicePixelWidth,this.devicePixelHeight]}getDrawingBufferSize(){return[this.drawingBufferWidth,this.drawingBufferHeight]}getMaxDrawingBufferSize(){const e=this.device.limits.maxTextureDimension2D;return[e,e]}setDrawingBufferSize(e,t){this.canvas.width=e,this.canvas.height=t,this.drawingBufferWidth=e,this.drawingBufferHeight=t}getDevicePixelRatio(){return typeof window<"u"&&window.devicePixelRatio||1}cssToDevicePixels(e,t=!0){const s=this.cssToDeviceRatio(),[i,n]=this.getDrawingBufferSize();return yt(e,s,i,n,t)}getPixelSize(){return this.getDevicePixelSize()}getAspect(){const[e,t]=this.getDevicePixelSize();return e/t}cssToDeviceRatio(){try{const[e]=this.getDrawingBufferSize(),[t]=this.getCSSSize();return t?e/t:1}catch{return 1}}resize(e){this.setDrawingBufferSize(e.width,e.height)}_setAutoCreatedCanvasId(e){var t;((t=this.htmlCanvas)==null?void 0:t.id)==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}_handleIntersection(e){const t=e.find(i=>i.target===this.canvas);if(!t)return;const s=t.isIntersecting;this.isVisible!==s&&(this.isVisible=s,this.device.props.onVisibilityChange(this))}_handleResize(e){var t,s;const i=e.find(h=>h.target===this.canvas);if(!i)return;this.cssWidth=i.contentBoxSize[0].inlineSize,this.cssHeight=i.contentBoxSize[0].blockSize;const n=this.getDevicePixelSize(),a=((t=i.devicePixelContentBoxSize)==null?void 0:t[0].inlineSize)||i.contentBoxSize[0].inlineSize*devicePixelRatio,l=((s=i.devicePixelContentBoxSize)==null?void 0:s[0].blockSize)||i.contentBoxSize[0].blockSize*devicePixelRatio,[c,u]=this.getMaxDrawingBufferSize();this.devicePixelWidth=Math.max(1,Math.min(a,c)),this.devicePixelHeight=Math.max(1,Math.min(l,u)),this._updateDrawingBufferSize(),this.device.props.onResize(this,{oldPixelSize:n})}_updateDrawingBufferSize(){if(this.props.autoResize){if(typeof this.props.useDevicePixels=="number"){const e=this.props.useDevicePixels;this.setDrawingBufferSize(this.cssWidth*e,this.cssHeight*e)}else this.props.useDevicePixels?this.setDrawingBufferSize(this.devicePixelWidth,this.devicePixelHeight):this.setDrawingBufferSize(this.cssWidth,this.cssHeight);this._updateDevice()}this._initializedResolvers.resolve(),this.isInitialized=!0,this.updatePosition()}_observeDevicePixelRatio(){const e=this.devicePixelRatio;this.devicePixelRatio=window.devicePixelRatio,this.updatePosition(),this.device.props.onDevicePixelRatioChange(this,{oldRatio:e}),matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener("change",()=>this._observeDevicePixelRatio(),{once:!0})}_trackPosition(e=100){const t=setInterval(()=>{this.destroyed?clearInterval(t):this.updatePosition()},e)}updatePosition(){var e,t,s;const i=(e=this.htmlCanvas)==null?void 0:e.getBoundingClientRect();if(i){const n=[i.left,i.top];if(this._position??(this._position=n),n[0]!==this._position[0]||n[1]!==this._position[1]){const a=this._position;this._position=n,(s=(t=this.device.props).onPositionChange)==null||s.call(t,this,{oldPosition:a})}}}};o(Pe,"defaultProps",{id:void 0,canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb",trackPosition:!1});let Te=Pe;function mt(r){if(typeof r=="string"){const e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}return r||document.body}function bt(r){const e=document.getElementById(r);if(!Te.isHTMLCanvas(e))throw new Error("Object is not a canvas element");return e}function vt(r){const{width:e,height:t}=r,s=document.createElement("canvas");s.id=ht("lumagl-auto-created-canvas"),s.width=e||1,s.height=t||1,s.style.width=Number.isFinite(e)?`${e}px`:"100%",s.style.height=Number.isFinite(t)?`${t}px`:"100%",r!=null&&r.visible||(s.style.visibility="hidden");const i=mt((r==null?void 0:r.container)||null);return i.insertBefore(s,i.firstChild),s}function yt(r,e,t,s,i){const n=r,a=ne(n[0],e,t);let l=ae(n[1],e,s,i),c=ne(n[0]+1,e,t);const u=c===t-1?c:c-1;c=ae(n[1]+1,e,s,i);let h;return i?(c=c===0?c:c+1,h=l,l=c):h=c===s-1?c:c-1,{x:a,y:l,width:Math.max(u-a+1,1),height:Math.max(h-l+1,1)}}function ne(r,e,t){return Math.min(Math.round(r*e),t-1)}function ae(r,e,t,s){return s?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}const Ae=class Be extends S{constructor(e,t={}){super(e,t,Be.defaultProps),o(this,"width"),o(this,"height"),this.width=this.props.width,this.height=this.props.height}get[Symbol.toStringTag](){return"Framebuffer"}clone(e){const t=this.colorAttachments.map(i=>i.texture.clone(e)),s=this.depthStencilAttachment&&this.depthStencilAttachment.texture.clone(e);return this.device.createFramebuffer({...this.props,colorAttachments:t,depthStencilAttachment:s})}resize(e){let t=!e;if(e){const[s,i]=Array.isArray(e)?e:[e.width,e.height];t=t||i!==this.height||s!==this.width,this.width=s,this.height=i}t&&(p.log(2,`Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)(),this.resizeAttachments(this.width,this.height))}autoCreateAttachmentTextures(){if(this.props.colorAttachments.length===0&&!this.props.depthStencilAttachment)throw new Error("Framebuffer has noattachments");this.colorAttachments=this.props.colorAttachments.map((t,s)=>{if(typeof t=="string"){const i=this.createColorTexture(t,s);return this.attachResource(i),i.view}return t instanceof B?t.view:t});const e=this.props.depthStencilAttachment;if(e)if(typeof e=="string"){const t=this.createDepthStencilTexture(e);this.attachResource(t),this.depthStencilAttachment=t.view}else e instanceof B?this.depthStencilAttachment=e.view:this.depthStencilAttachment=e}createColorTexture(e,t){return this.device.createTexture({id:`${this.id}-color-attachment-${t}`,usage:B.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height,sampler:{magFilter:"linear",minFilter:"linear"}})}createDepthStencilTexture(e){return this.device.createTexture({id:`${this.id}-depth-stencil-attachment`,usage:B.RENDER_ATTACHMENT,format:e,width:this.width,height:this.height})}resizeAttachments(e,t){for(let s=0;se?r.enable(t):r.disable(t),oe=(r,e,t)=>r.hint(t,e),P=(r,e,t)=>r.pixelStorei(t,e),le=(r,e,t)=>{const s=t===36006?36009:36008;return r.bindFramebuffer(s,e)},M=(r,e,t)=>{const s={34964:34962,36662:36662,36663:36663,35053:35051,35055:35052}[t];r.bindBuffer(s,e)};function H(r){return Array.isArray(r)||ArrayBuffer.isView(r)&&!(r instanceof DataView)}const At={3042:y,32773:(r,e)=>r.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(r,e)=>r.clearColor(...e),3107:(r,e)=>r.colorMask(...e),2884:y,2885:(r,e)=>r.cullFace(e),2929:y,2931:(r,e)=>r.clearDepth(e),2932:(r,e)=>r.depthFunc(e),2928:(r,e)=>r.depthRange(...e),2930:(r,e)=>r.depthMask(e),3024:y,35723:oe,35725:(r,e)=>r.useProgram(e),36007:(r,e)=>r.bindRenderbuffer(36161,e),36389:(r,e)=>{var t;return(t=r.bindTransformFeedback)==null?void 0:t.call(r,36386,e)},34229:(r,e)=>r.bindVertexArray(e),36006:le,36010:le,34964:M,36662:M,36663:M,35053:M,35055:M,2886:(r,e)=>r.frontFace(e),33170:oe,2849:(r,e)=>r.lineWidth(e),32823:y,32824:"polygonOffset",10752:"polygonOffset",35977:y,32926:y,32928:y,32938:"sampleCoverage",32939:"sampleCoverage",3089:y,3088:(r,e)=>r.scissor(...e),2960:y,2961:(r,e)=>r.clearStencil(e),2968:(r,e)=>r.stencilMaskSeparate(1028,e),36005:(r,e)=>r.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(r,e)=>r.viewport(...e),34383:y,10754:y,12288:y,12289:y,12290:y,12291:y,12292:y,12293:y,12294:y,12295:y,3333:P,3317:P,37440:P,37441:P,37443:P,3330:P,3332:P,3331:P,3314:P,32878:P,3316:P,3315:P,32877:P,framebuffer:(r,e)=>{const t=e&&"handle"in e?e.handle:e;return r.bindFramebuffer(36160,t)},blend:(r,e)=>e?r.enable(3042):r.disable(3042),blendColor:(r,e)=>r.blendColor(...e),blendEquation:(r,e)=>{const t=typeof e=="number"?[e,e]:e;r.blendEquationSeparate(...t)},blendFunc:(r,e)=>{const t=(e==null?void 0:e.length)===2?[...e,...e]:e;r.blendFuncSeparate(...t)},clearColor:(r,e)=>r.clearColor(...e),clearDepth:(r,e)=>r.clearDepth(e),clearStencil:(r,e)=>r.clearStencil(e),colorMask:(r,e)=>r.colorMask(...e),cull:(r,e)=>e?r.enable(2884):r.disable(2884),cullFace:(r,e)=>r.cullFace(e),depthTest:(r,e)=>e?r.enable(2929):r.disable(2929),depthFunc:(r,e)=>r.depthFunc(e),depthMask:(r,e)=>r.depthMask(e),depthRange:(r,e)=>r.depthRange(...e),dither:(r,e)=>e?r.enable(3024):r.disable(3024),derivativeHint:(r,e)=>{r.hint(35723,e)},frontFace:(r,e)=>r.frontFace(e),mipmapHint:(r,e)=>r.hint(33170,e),lineWidth:(r,e)=>r.lineWidth(e),polygonOffsetFill:(r,e)=>e?r.enable(32823):r.disable(32823),polygonOffset:(r,e)=>r.polygonOffset(...e),sampleCoverage:(r,e)=>r.sampleCoverage(e[0],e[1]||!1),scissorTest:(r,e)=>e?r.enable(3089):r.disable(3089),scissor:(r,e)=>r.scissor(...e),stencilTest:(r,e)=>e?r.enable(2960):r.disable(2960),stencilMask:(r,e)=>{e=H(e)?e:[e,e];const[t,s]=e;r.stencilMaskSeparate(1028,t),r.stencilMaskSeparate(1029,s)},stencilFunc:(r,e)=>{e=H(e)&&e.length===3?[...e,...e]:e;const[t,s,i,n,a,l]=e;r.stencilFuncSeparate(1028,t,s,i),r.stencilFuncSeparate(1029,n,a,l)},stencilOp:(r,e)=>{e=H(e)&&e.length===3?[...e,...e]:e;const[t,s,i,n,a,l]=e;r.stencilOpSeparate(1028,t,s,i),r.stencilOpSeparate(1029,n,a,l)},viewport:(r,e)=>r.viewport(...e)};function b(r,e,t){return e[r]!==void 0?e[r]:t[r]}const Bt={blendEquation:(r,e,t)=>r.blendEquationSeparate(b(32777,e,t),b(34877,e,t)),blendFunc:(r,e,t)=>r.blendFuncSeparate(b(32969,e,t),b(32968,e,t),b(32971,e,t),b(32970,e,t)),polygonOffset:(r,e,t)=>r.polygonOffset(b(32824,e,t),b(10752,e,t)),sampleCoverage:(r,e,t)=>r.sampleCoverage(b(32938,e,t),b(32939,e,t)),stencilFuncFront:(r,e,t)=>r.stencilFuncSeparate(1028,b(2962,e,t),b(2967,e,t),b(2963,e,t)),stencilFuncBack:(r,e,t)=>r.stencilFuncSeparate(1029,b(34816,e,t),b(36003,e,t),b(36004,e,t)),stencilOpFront:(r,e,t)=>r.stencilOpSeparate(1028,b(2964,e,t),b(2965,e,t),b(2966,e,t)),stencilOpBack:(r,e,t)=>r.stencilOpSeparate(1029,b(34817,e,t),b(34818,e,t),b(34819,e,t))},ce={enable:(r,e)=>r({[e]:!0}),disable:(r,e)=>r({[e]:!1}),pixelStorei:(r,e,t)=>r({[e]:t}),hint:(r,e,t)=>r({[e]:t}),useProgram:(r,e)=>r({35725:e}),bindRenderbuffer:(r,e,t)=>r({36007:t}),bindTransformFeedback:(r,e,t)=>r({36389:t}),bindVertexArray:(r,e)=>r({34229:e}),bindFramebuffer:(r,e,t)=>{switch(e){case 36160:return r({36006:t,36010:t});case 36009:return r({36006:t});case 36008:return r({36010:t});default:return null}},bindBuffer:(r,e,t)=>{const s={34962:[34964],36662:[36662],36663:[36663],35051:[35053],35052:[35055]}[e];return s?r({[s]:t}):{valueChanged:!0}},blendColor:(r,e,t,s,i)=>r({32773:new Float32Array([e,t,s,i])}),blendEquation:(r,e)=>r({32777:e,34877:e}),blendEquationSeparate:(r,e,t)=>r({32777:e,34877:t}),blendFunc:(r,e,t)=>r({32969:e,32968:t,32971:e,32970:t}),blendFuncSeparate:(r,e,t,s,i)=>r({32969:e,32968:t,32971:s,32970:i}),clearColor:(r,e,t,s,i)=>r({3106:new Float32Array([e,t,s,i])}),clearDepth:(r,e)=>r({2931:e}),clearStencil:(r,e)=>r({2961:e}),colorMask:(r,e,t,s,i)=>r({3107:[e,t,s,i]}),cullFace:(r,e)=>r({2885:e}),depthFunc:(r,e)=>r({2932:e}),depthRange:(r,e,t)=>r({2928:new Float32Array([e,t])}),depthMask:(r,e)=>r({2930:e}),frontFace:(r,e)=>r({2886:e}),lineWidth:(r,e)=>r({2849:e}),polygonOffset:(r,e,t)=>r({32824:e,10752:t}),sampleCoverage:(r,e,t)=>r({32938:e,32939:t}),scissor:(r,e,t,s,i)=>r({3088:new Int32Array([e,t,s,i])}),stencilMask:(r,e)=>r({2968:e,36005:e}),stencilMaskSeparate:(r,e,t)=>r({[e===1028?2968:36005]:t}),stencilFunc:(r,e,t,s)=>r({2962:e,2967:t,2963:s,34816:e,36003:t,36004:s}),stencilFuncSeparate:(r,e,t,s,i)=>r({[e===1028?2962:34816]:t,[e===1028?2967:36003]:s,[e===1028?2963:36004]:i}),stencilOp:(r,e,t,s)=>r({2964:e,2965:t,2966:s,34817:e,34818:t,34819:s}),stencilOpSeparate:(r,e,t,s,i)=>r({[e===1028?2964:34817]:t,[e===1028?2965:34818]:s,[e===1028?2966:34819]:i}),viewport:(r,e,t,s,i)=>r({2978:[e,t,s,i]})},T=(r,e)=>r.isEnabled(e),ue={3042:T,2884:T,2929:T,3024:T,32823:T,32926:T,32928:T,3089:T,2960:T,35977:T},Ft=new Set([34016,36388,36387,35983,35368,34965,35739,35738,3074,34853,34854,34855,34856,34857,34858,34859,34860,34861,34862,34863,34864,34865,34866,34867,34868,35097,32873,35869,32874,34068]);function O(r,e){if(Ct(e))return;const t={};for(const i in e){const n=Number(i),a=At[i];a&&(typeof a=="string"?t[a]=!0:a(r,e[i],n))}const s=r.state&&r.state.cache;if(s)for(const i in t){const n=Bt[i];n(r,e,s)}}function Ie(r,e=J){if(typeof e=="number"){const i=e,n=ue[i];return n?n(r,i):r.getParameter(i)}const t=Array.isArray(e)?e:Object.keys(e),s={};for(const i of t){const n=ue[i];s[i]=n?n(r,Number(i)):r.getParameter(Number(i))}return s}function Lt(r){O(r,J)}function Ct(r){for(const e in r)return!1;return!0}function kt(r,e){if(r===e)return!0;if(he(r)&&he(e)&&r.length===e.length){for(let t=0;t{}),this._updateCache=this._updateCache.bind(this),Object.seal(this)}static get(e){return e.state}push(e={}){this.stateStack.push({})}pop(){const e=this.stateStack[this.stateStack.length-1];O(this.gl,e),this.stateStack.pop()}trackState(e,t){if(this.cache=t!=null&&t.copyState?Ie(e):Object.assign({},J),this.initialized)throw new Error("WebGLStateTracker");this.initialized=!0,this.gl.state=this,Dt(e);for(const s in ce){const i=ce[s];Et(e,s,i)}de(e,"getParameter"),de(e,"isEnabled")}_updateCache(e){let t=!1,s;const i=this.stateStack.length>0?this.stateStack[this.stateStack.length-1]:null;for(const n in e){const a=e[n],l=this.cache[n];kt(a,l)||(t=!0,s=l,i&&!(n in i)&&(i[n]=l),this.cache[n]=a)}return{valueChanged:t,oldValue:s}}}function de(r,e){const t=r[e].bind(r);r[e]=function(s){if(s===void 0||Ft.has(s))return t(s);const i=L.get(r);return s in i.cache||(i.cache[s]=t(s)),i.enable?i.cache[s]:t(s)},Object.defineProperty(r[e],"name",{value:`${e}-from-cache`,configurable:!1})}function Et(r,e,t){if(!r[e])return;const s=r[e].bind(r);r[e]=function(...i){const n=L.get(r),{valueChanged:a,oldValue:l}=t(n._updateCache,...i);return a&&s(...i),l},Object.defineProperty(r[e],"name",{value:`${e}-to-cache`,configurable:!1})}function Dt(r){const e=r.useProgram.bind(r);r.useProgram=function(t){const s=L.get(r);s.program!==t&&(e(t),s.program=t)}}function Wt(r,e,t){let s="";const i={preserveDrawingBuffer:!0,...t};let n=null;if(n||(n=r.getContext("webgl2",i)),i.failIfMajorPerformanceCaveat&&(s||(s="Only software GPU is available. Set `failIfMajorPerformanceCaveat: false` to allow.")),!n&&!t.failIfMajorPerformanceCaveat&&(i.failIfMajorPerformanceCaveat=!1,n=r.getContext("webgl2",i),n.luma||(n.luma={}),n.luma.softwareRenderer=!0),n||(n=r.getContext("webgl",{}),n&&(n=null,s||(s="Your browser only supports WebGL1"))),!n)throw s||(s="Your browser does not support WebGL"),new Error(`Failed to create WebGL context: ${s}`);const{onContextLost:a,onContextRestored:l}=e;return r.addEventListener("webglcontextlost",c=>a(c),!1),r.addEventListener("webglcontextrestored",c=>l(c),!1),n.luma||(n.luma={}),n}function W(r,e,t){return t[e]===void 0&&(t[e]=r.getExtension(e)||null),t[e]}function Ot(r,e){const t=r.getParameter(7936),s=r.getParameter(7937);W(r,"WEBGL_debug_renderer_info",e);const i=e.WEBGL_debug_renderer_info,n=r.getParameter(i?i.UNMASKED_VENDOR_WEBGL:7936),a=r.getParameter(i?i.UNMASKED_RENDERER_WEBGL:7937),l=n||t,c=a||s,u=r.getParameter(7938),h=Ge(l,c),f=Mt(l,c),d=Rt(l,c);return{type:"webgl",gpu:h,gpuType:d,gpuBackend:f,vendor:l,renderer:c,version:u,shadingLanguage:"glsl",shadingLanguageVersion:300}}function Ge(r,e){return/NVIDIA/i.exec(r)||/NVIDIA/i.exec(e)?"nvidia":/INTEL/i.exec(r)||/INTEL/i.exec(e)?"intel":/Apple/i.exec(r)||/Apple/i.exec(e)?"apple":/AMD/i.exec(r)||/AMD/i.exec(e)||/ATI/i.exec(r)||/ATI/i.exec(e)?"amd":/SwiftShader/i.exec(r)||/SwiftShader/i.exec(e)?"software":"unknown"}function Mt(r,e){return/Metal/i.exec(r)||/Metal/i.exec(e)?"metal":/ANGLE/i.exec(r)||/ANGLE/i.exec(e)?"opengl":"unknown"}function Rt(r,e){if(/SwiftShader/i.exec(r)||/SwiftShader/i.exec(e))return"cpu";switch(Ge(r,e)){case"intel":return"integrated";case"software":return"cpu";case"unknown":return"unknown";default:return"discrete"}}function ze(r){switch(r){case"uint8":return 5121;case"sint8":return 5120;case"unorm8":return 5121;case"snorm8":return 5120;case"uint16":return 5123;case"sint16":return 5122;case"unorm16":return 5123;case"snorm16":return 5122;case"uint32":return 5125;case"sint32":return 5124;case"float16":return 5131;case"float32":return 5126}throw new Error(String(r))}const $="WEBGL_compressed_texture_s3tc",I="WEBGL_compressed_texture_s3tc_srgb",k="EXT_texture_compression_rgtc",E="EXT_texture_compression_bptc",$t="WEBGL_compressed_texture_etc",It="WEBGL_compressed_texture_astc",Gt="WEBGL_compressed_texture_etc1",zt="WEBGL_compressed_texture_pvrtc",Vt="WEBGL_compressed_texture_atc",fe="EXT_texture_norm16",ge="EXT_render_snorm",Ut="EXT_color_buffer_float",Z={"float32-renderable-webgl":["EXT_color_buffer_float"],"float16-renderable-webgl":["EXT_color_buffer_half_float"],"rgb9e5ufloat-renderable-webgl":["WEBGL_render_shared_exponent"],"snorm8-renderable-webgl":[ge],"norm16-renderable-webgl":[fe],"snorm16-renderable-webgl":[fe,ge],"float32-filterable":["OES_texture_float_linear"],"float16-filterable-webgl":["OES_texture_half_float_linear"],"texture-filterable-anisotropic-webgl":["EXT_texture_filter_anisotropic"],"texture-blend-float-webgl":["EXT_float_blend"],"texture-compression-bc":[$,I,k,E],"texture-compression-bc5-webgl":[k],"texture-compression-bc7-webgl":[E],"texture-compression-etc2":[$t],"texture-compression-astc":[It],"texture-compression-etc1-webgl":[Gt],"texture-compression-pvrtc-webgl":[zt],"texture-compression-atc-webgl":[Vt]};function Nt(r){return r in Z}function Ht(r,e,t){return(Z[e]||[]).every(s=>W(r,s,t))}const ee={r8unorm:{gl:33321,rb:!0},r8snorm:{gl:36756},r8uint:{gl:33330,rb:!0},r8sint:{gl:33329,rb:!0},rg8unorm:{gl:33323,rb:!0},rg8snorm:{gl:36757},rg8uint:{gl:33336,rb:!0},rg8sint:{gl:33335,rb:!0},r16uint:{gl:33332,rb:!0},r16sint:{gl:33331,rb:!0},r16float:{gl:33325,rb:!0},r16unorm:{gl:33322,rb:!0},r16snorm:{gl:36760},"rgba4unorm-webgl":{gl:32854,rb:!0},"rgb565unorm-webgl":{gl:36194,rb:!0},"rgb5a1unorm-webgl":{gl:32855,rb:!0},"rgb8unorm-webgl":{gl:32849},"rgb8snorm-webgl":{gl:36758},rgba8unorm:{gl:32856},"rgba8unorm-srgb":{gl:35907},rgba8snorm:{gl:36759},rgba8uint:{gl:36220},rgba8sint:{gl:36238},bgra8unorm:{},"bgra8unorm-srgb":{},rg16uint:{gl:33338},rg16sint:{gl:33337},rg16float:{gl:33327,rb:!0},rg16unorm:{gl:33324},rg16snorm:{gl:36761},r32uint:{gl:33334,rb:!0},r32sint:{gl:33333,rb:!0},r32float:{gl:33326},rgb9e5ufloat:{gl:35901},rg11b10ufloat:{gl:35898,rb:!0},rgb10a2unorm:{gl:32857,rb:!0},rgb10a2uint:{gl:36975,rb:!0},"rgb16unorm-webgl":{gl:32852},"rgb16snorm-webgl":{gl:36762},rg32uint:{gl:33340,rb:!0},rg32sint:{gl:33339,rb:!0},rg32float:{gl:33328,rb:!0},rgba16uint:{gl:36214,rb:!0},rgba16sint:{gl:36232,rb:!0},rgba16float:{gl:34842},rgba16unorm:{gl:32859,rb:!0},rgba16snorm:{gl:36763},"rgb32float-webgl":{gl:34837,x:Ut,dataFormat:6407,types:[5126]},rgba32uint:{gl:36208,rb:!0},rgba32sint:{gl:36226,rb:!0},rgba32float:{gl:34836,rb:!0},stencil8:{gl:36168,rb:!0},depth16unorm:{gl:33189,dataFormat:6402,types:[5123],rb:!0},depth24plus:{gl:33190,dataFormat:6402,types:[5125]},depth32float:{gl:36012,dataFormat:6402,types:[5126],rb:!0},"depth24plus-stencil8":{gl:35056,rb:!0,depthTexture:!0,dataFormat:34041,types:[34042]},"depth32float-stencil8":{gl:36013,dataFormat:34041,types:[36269],rb:!0},"bc1-rgb-unorm-webgl":{gl:33776,x:$},"bc1-rgb-unorm-srgb-webgl":{gl:35916,x:I},"bc1-rgba-unorm":{gl:33777,x:$},"bc1-rgba-unorm-srgb":{gl:35916,x:I},"bc2-rgba-unorm":{gl:33778,x:$},"bc2-rgba-unorm-srgb":{gl:35918,x:I},"bc3-rgba-unorm":{gl:33779,x:$},"bc3-rgba-unorm-srgb":{gl:35919,x:I},"bc4-r-unorm":{gl:36283,x:k},"bc4-r-snorm":{gl:36284,x:k},"bc5-rg-unorm":{gl:36285,x:k},"bc5-rg-snorm":{gl:36286,x:k},"bc6h-rgb-ufloat":{gl:36495,x:E},"bc6h-rgb-float":{gl:36494,x:E},"bc7-rgba-unorm":{gl:36492,x:E},"bc7-rgba-unorm-srgb":{gl:36493,x:E},"etc2-rgb8unorm":{gl:37492},"etc2-rgb8unorm-srgb":{gl:37494},"etc2-rgb8a1unorm":{gl:37496},"etc2-rgb8a1unorm-srgb":{gl:37497},"etc2-rgba8unorm":{gl:37493},"etc2-rgba8unorm-srgb":{gl:37495},"eac-r11unorm":{gl:37488},"eac-r11snorm":{gl:37489},"eac-rg11unorm":{gl:37490},"eac-rg11snorm":{gl:37491},"astc-4x4-unorm":{gl:37808},"astc-4x4-unorm-srgb":{gl:37840},"astc-5x4-unorm":{gl:37809},"astc-5x4-unorm-srgb":{gl:37841},"astc-5x5-unorm":{gl:37810},"astc-5x5-unorm-srgb":{gl:37842},"astc-6x5-unorm":{gl:37811},"astc-6x5-unorm-srgb":{gl:37843},"astc-6x6-unorm":{gl:37812},"astc-6x6-unorm-srgb":{gl:37844},"astc-8x5-unorm":{gl:37813},"astc-8x5-unorm-srgb":{gl:37845},"astc-8x6-unorm":{gl:37814},"astc-8x6-unorm-srgb":{gl:37846},"astc-8x8-unorm":{gl:37815},"astc-8x8-unorm-srgb":{gl:37847},"astc-10x5-unorm":{gl:37819},"astc-10x5-unorm-srgb":{gl:37851},"astc-10x6-unorm":{gl:37817},"astc-10x6-unorm-srgb":{gl:37849},"astc-10x8-unorm":{gl:37818},"astc-10x8-unorm-srgb":{gl:37850},"astc-10x10-unorm":{gl:37819},"astc-10x10-unorm-srgb":{gl:37851},"astc-12x10-unorm":{gl:37820},"astc-12x10-unorm-srgb":{gl:37852},"astc-12x12-unorm":{gl:37821},"astc-12x12-unorm-srgb":{gl:37853},"pvrtc-rgb4unorm-webgl":{gl:35840},"pvrtc-rgba4unorm-webgl":{gl:35842},"pvrtc-rbg2unorm-webgl":{gl:35841},"pvrtc-rgba2unorm-webgl":{gl:35843},"etc1-rbg-unorm-webgl":{gl:36196},"atc-rgb-unorm-webgl":{gl:35986},"atc-rgba-unorm-webgl":{gl:35986},"atc-rgbai-unorm-webgl":{gl:34798}};function jt(r,e,t){let s=e.create;const i=ee[e.format];return(i==null?void 0:i.gl)===void 0&&(s=!1),i!=null&&i.x&&(s=s&&!!W(r,i.x,t)),{format:e.format,create:s&&e.create,render:s&&e.render,filter:s&&e.filter,blend:s&&e.blend,store:s&&e.store}}function Ve(r){var e;const t=ee[r],s=Xt(r),i=Se.getInfo(r);return i.compressed&&(t.dataFormat=s),{internalFormat:s,format:(t==null?void 0:t.dataFormat)||qt(i.channels,i.integer,i.normalized,s),type:i.dataType?ze(i.dataType):((e=t==null?void 0:t.types)==null?void 0:e[0])||5121,compressed:i.compressed||!1}}function Qt(r){switch(Se.getInfo(r).attachment){case"depth":return 36096;case"stencil":return 36128;case"depth-stencil":return 33306;default:throw new Error(`Not a depth stencil format: ${r}`)}}function qt(r,e,t,s){if(s===6408||s===6407)return s;switch(r){case"r":return e&&!t?36244:6403;case"rg":return e&&!t?33320:33319;case"rgb":return e&&!t?36248:6407;case"rgba":return e&&!t?36249:6408;case"bgra":throw new Error("bgra pixels not supported by WebGL");default:return 6408}}function Xt(r){const e=ee[r],t=e==null?void 0:e.gl;if(t===void 0)throw new Error(`Unsupported texture format ${r}`);return t}const pe={"depth-clip-control":"EXT_depth_clamp","timer-query-webgl":"EXT_disjoint_timer_query_webgl2","compilation-status-async-webgl":"KHR_parallel_shader_compile","polygon-mode-webgl":"WEBGL_polygon_mode","provoking-vertex-webgl":"WEBGL_provoking_vertex","shader-clip-cull-distance-webgl":"WEBGL_clip_cull_distance","shader-noperspective-interpolation-webgl":"NV_shader_noperspective_interpolation","shader-conservative-depth-webgl":"EXT_conservative_depth"};class Kt extends Ze{constructor(e,t,s){super([],s),o(this,"gl"),o(this,"extensions"),o(this,"testedFeatures",new Set),this.gl=e,this.extensions=t,W(e,"EXT_color_buffer_float",t)}*[Symbol.iterator](){const e=this.getFeatures();for(const t of e)this.has(t)&&(yield t);return[]}has(e){var t;return(t=this.disabledFeatures)!=null&&t[e]?!1:(this.testedFeatures.has(e)||(this.testedFeatures.add(e),Nt(e)&&Ht(this.gl,e,this.extensions)&&this.features.add(e),this.getWebGLFeature(e)&&this.features.add(e)),this.features.has(e))}initializeFeatures(){const e=this.getFeatures().filter(t=>t!=="polygon-mode-webgl");for(const t of e)this.has(t)}getFeatures(){return[...Object.keys(pe),...Object.keys(Z)]}getWebGLFeature(e){const t=pe[e];return typeof t=="string"?!!W(this.gl,t,this.extensions):!!t}}class Yt extends Je{constructor(e){super(),o(this,"gl"),o(this,"limits",{}),this.gl=e}get maxTextureDimension1D(){return 0}get maxTextureDimension2D(){return this.getParameter(3379)}get maxTextureDimension3D(){return this.getParameter(32883)}get maxTextureArrayLayers(){return this.getParameter(35071)}get maxBindGroups(){return 0}get maxDynamicUniformBuffersPerPipelineLayout(){return 0}get maxDynamicStorageBuffersPerPipelineLayout(){return 0}get maxSampledTexturesPerShaderStage(){return this.getParameter(35660)}get maxSamplersPerShaderStage(){return this.getParameter(35661)}get maxStorageBuffersPerShaderStage(){return 0}get maxStorageTexturesPerShaderStage(){return 0}get maxUniformBuffersPerShaderStage(){return this.getParameter(35375)}get maxUniformBufferBindingSize(){return this.getParameter(35376)}get maxStorageBufferBindingSize(){return 0}get minUniformBufferOffsetAlignment(){return this.getParameter(35380)}get minStorageBufferOffsetAlignment(){return 0}get maxVertexBuffers(){return 16}get maxVertexAttributes(){return this.getParameter(34921)}get maxVertexBufferArrayStride(){return 2048}get maxInterStageShaderVariables(){return this.getParameter(35659)}get maxComputeWorkgroupStorageSize(){return 0}get maxComputeInvocationsPerWorkgroup(){return 0}get maxComputeWorkgroupSizeX(){return 0}get maxComputeWorkgroupSizeY(){return 0}get maxComputeWorkgroupSizeZ(){return 0}get maxComputeWorkgroupsPerDimension(){return 0}getParameter(e){return this.limits[e]===void 0&&(this.limits[e]=this.gl.getParameter(e)),this.limits[e]||0}}class G extends Fe{constructor(e,t){super(e,t),o(this,"device"),o(this,"gl"),o(this,"handle"),o(this,"colorAttachments",[]),o(this,"depthStencilAttachment",null);const s=t.handle===null;this.device=e,this.gl=e.gl,this.handle=this.props.handle||s?this.props.handle:this.gl.createFramebuffer(),s||(e._setWebGLDebugMetadata(this.handle,this,{spector:this.props}),this.autoCreateAttachmentTextures(),this.updateAttachments())}destroy(){super.destroy(),!this.destroyed&&this.handle!==null&&this.gl.deleteFramebuffer(this.handle)}updateAttachments(){const e=this.gl.bindFramebuffer(36160,this.handle);for(let t=0;t(this._getCompilationStatus(),this.compilationStatus))}async getCompilationInfo(){return await this._waitForCompilationComplete(),this.getCompilationInfoSync()}getCompilationInfoSync(){const e=this.device.gl.getShaderInfoLog(this.handle);return e?ir(e):[]}getTranslatedSource(){const e=this.device.getExtension("WEBGL_debug_shaders").WEBGL_debug_shaders;return(e==null?void 0:e.getTranslatedShaderSource(this.handle))||null}async _compile(e){e=e.startsWith("#version ")?e:`#version 300 es ${e}`;const{gl:t}=this.device;if(t.shaderSource(this.handle,e),t.compileShader(this.handle),!this.device.props.debug){this.compilationStatus="pending";return}if(!this.device.features.has("compilation-status-async-webgl")){if(this._getCompilationStatus(),this.debugShader(),this.compilationStatus==="error")throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);return}p.once(1,"Shader compilation is asynchronous")(),await this._waitForCompilationComplete(),p.info(2,`Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)(),this._getCompilationStatus(),this.debugShader()}async _waitForCompilationComplete(){const e=async s=>await new Promise(i=>setTimeout(i,s));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}const{gl:t}=this.device;for(;;){if(t.getShaderParameter(this.handle,37297))return;await e(10)}}_getCompilationStatus(){this.compilationStatus=this.device.gl.getShaderParameter(this.handle,35713)?"success":"error"}}function ar(r,e,t,s){if(ur(e))return s(r);const i=r;i.pushState();try{return or(r,e),O(i.gl,t),s(r)}finally{i.popState()}}function or(r,e){const t=r,{gl:s}=t;if(e.cullMode)switch(e.cullMode){case"none":s.disable(2884);break;case"front":s.enable(2884),s.cullFace(1028);break;case"back":s.enable(2884),s.cullFace(1029);break}if(e.frontFace&&s.frontFace(C("frontFace",e.frontFace,{ccw:2305,cw:2304})),e.unclippedDepth&&r.features.has("depth-clip-control")&&s.enable(34383),e.depthBias!==void 0&&(s.enable(32823),s.polygonOffset(e.depthBias,e.depthBiasSlopeScale||0)),e.provokingVertex&&r.features.has("provoking-vertex-webgl")){const i=t.getExtension("WEBGL_provoking_vertex").WEBGL_provoking_vertex,n=C("provokingVertex",e.provokingVertex,{first:36429,last:36430});i==null||i.provokingVertexWEBGL(n)}if((e.polygonMode||e.polygonOffsetLine)&&r.features.has("polygon-mode-webgl")){if(e.polygonMode){const i=t.getExtension("WEBGL_polygon_mode").WEBGL_polygon_mode,n=C("polygonMode",e.polygonMode,{fill:6914,line:6913});i==null||i.polygonModeWEBGL(1028,n),i==null||i.polygonModeWEBGL(1029,n)}e.polygonOffsetLine&&s.enable(10754)}if(r.features.has("shader-clip-cull-distance-webgl")&&(e.clipDistance0&&s.enable(12288),e.clipDistance1&&s.enable(12289),e.clipDistance2&&s.enable(12290),e.clipDistance3&&s.enable(12291),e.clipDistance4&&s.enable(12292),e.clipDistance5&&s.enable(12293),e.clipDistance6&&s.enable(12294),e.clipDistance7&&s.enable(12295)),e.depthWriteEnabled!==void 0&&s.depthMask(cr("depthWriteEnabled",e.depthWriteEnabled)),e.depthCompare&&(e.depthCompare!=="always"?s.enable(2929):s.disable(2929),s.depthFunc(K("depthCompare",e.depthCompare))),e.stencilWriteMask){const i=e.stencilWriteMask;s.stencilMaskSeparate(1028,i),s.stencilMaskSeparate(1029,i)}if(e.stencilReadMask&&p.warn("stencilReadMask not supported under WebGL"),e.stencilCompare){const i=e.stencilReadMask||4294967295,n=K("depthCompare",e.stencilCompare);e.stencilCompare!=="always"?s.enable(2960):s.disable(2960),s.stencilFuncSeparate(1028,n,0,i),s.stencilFuncSeparate(1029,n,0,i)}if(e.stencilPassOperation&&e.stencilFailOperation&&e.stencilDepthFailOperation){const i=Q("stencilPassOperation",e.stencilPassOperation),n=Q("stencilFailOperation",e.stencilFailOperation),a=Q("stencilDepthFailOperation",e.stencilDepthFailOperation);s.stencilOpSeparate(1028,n,a,i),s.stencilOpSeparate(1029,n,a,i)}switch(e.blend){case!0:s.enable(3042);break;case!1:s.disable(3042);break}if(e.blendColorOperation||e.blendAlphaOperation){const i=be("blendColorOperation",e.blendColorOperation||"add"),n=be("blendAlphaOperation",e.blendAlphaOperation||"add");s.blendEquationSeparate(i,n);const a=N("blendColorSrcFactor",e.blendColorSrcFactor||"one"),l=N("blendColorDstFactor",e.blendColorDstFactor||"zero"),c=N("blendAlphaSrcFactor",e.blendAlphaSrcFactor||"one"),u=N("blendAlphaDstFactor",e.blendAlphaDstFactor||"zero");s.blendFuncSeparate(a,l,c,u)}}function K(r,e){return C(r,e,{never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519})}function Q(r,e){return C(r,e,{keep:7680,zero:0,replace:7681,invert:5386,"increment-clamp":7682,"decrement-clamp":7683,"increment-wrap":34055,"decrement-wrap":34056})}function be(r,e){return C(r,e,{add:32774,subtract:32778,"reverse-subtract":32779,min:32775,max:32776})}function N(r,e,t="color"){return C(r,e,{one:1,zero:0,src:768,"one-minus-src":769,dst:774,"one-minus-dst":775,"src-alpha":770,"one-minus-src-alpha":771,"dst-alpha":772,"one-minus-dst-alpha":773,"src-alpha-saturated":776,constant:t==="color"?32769:32771,"one-minus-constant":t==="color"?32770:32772,src1:768,"one-minus-src1":769,"src1-alpha":770,"one-minus-src1-alpha":771})}function lr(r,e){return`Illegal parameter ${e} for ${r}`}function C(r,e,t){if(!(e in t))throw new Error(lr(r,e));return t[e]}function cr(r,e){return e}function ur(r){let e=!0;for(const t in r){e=!1;break}return e}function Ue(r){const e={};return r.addressModeU&&(e[10242]=q(r.addressModeU)),r.addressModeV&&(e[10243]=q(r.addressModeV)),r.addressModeW&&(e[32882]=q(r.addressModeW)),r.magFilter&&(e[10240]=Y(r.magFilter)),(r.minFilter||r.mipmapFilter)&&(e[10241]=hr(r.minFilter||"linear",r.mipmapFilter)),r.lodMinClamp!==void 0&&(e[33082]=r.lodMinClamp),r.lodMaxClamp!==void 0&&(e[33083]=r.lodMaxClamp),r.type==="comparison-sampler"&&(e[34892]=34894),r.compare&&(e[34893]=K("compare",r.compare)),r.maxAnisotropy&&(e[34046]=r.maxAnisotropy),e}function q(r){switch(r){case"clamp-to-edge":return 33071;case"repeat":return 10497;case"mirror-repeat":return 33648}}function Y(r){switch(r){case"nearest":return 9728;case"linear":return 9729}}function hr(r,e="none"){if(!e)return Y(r);switch(e){case"none":return Y(r);case"nearest":switch(r){case"nearest":return 9984;case"linear":return 9985}break;case"linear":switch(r){case"nearest":return 9986;case"linear":return 9987}}}class dr extends et{constructor(e,t){super(e,t),o(this,"device"),o(this,"handle"),o(this,"parameters"),this.device=e,this.parameters=Ue(t),this.handle=t.handle||this.device.gl.createSampler(),this._setSamplerParameters(this.parameters)}destroy(){this.handle&&(this.device.gl.deleteSampler(this.handle),this.handle=void 0)}toString(){return`Sampler(${this.id},${JSON.stringify(this.props)})`}_setSamplerParameters(e){for(const[t,s]of Object.entries(e)){const i=Number(t);switch(i){case 33082:case 33083:this.device.gl.samplerParameterf(this.handle,i,s);break;default:this.device.gl.samplerParameteri(this.handle,i,s);break}}}}function U(r,e,t){if(fr(e))return t(r);const{nocatch:s=!0}=e,i=L.get(r);i.push(),O(r,e);let n;if(s)n=t(r),i.pop();else try{n=t(r)}finally{i.pop()}return n}function fr(r){for(const e in r)return!1;return!0}class D extends nt{constructor(e,t){super(e,{...B.defaultProps,...t}),o(this,"device"),o(this,"gl"),o(this,"handle"),o(this,"texture"),this.device=e,this.gl=this.device.gl,this.handle=null,this.texture=t.texture}}class V extends B{constructor(e,t){super(e,t),o(this,"device"),o(this,"gl"),o(this,"handle"),o(this,"sampler"),o(this,"view"),o(this,"glTarget"),o(this,"glFormat"),o(this,"glType"),o(this,"glInternalFormat"),o(this,"compressed"),o(this,"_textureUnit",0),this.device=e,this.gl=this.device.gl;const s=Ve(this.props.format);this.glTarget=gr(this.props.dimension),this.glInternalFormat=s.internalFormat,this.glFormat=s.format,this.glType=s.type,this.compressed=s.compressed,this.handle=this.props.handle||this.gl.createTexture(),this.device._setWebGLDebugMetadata(this.handle,this,{spector:this.props}),this.gl.bindTexture(this.glTarget,this.handle);const{dimension:i,width:n,height:a,depth:l,mipLevels:c,glTarget:u,glInternalFormat:h}=this;switch(i){case"2d":case"cube":this.gl.texStorage2D(u,c,h,n,a);break;case"2d-array":case"3d":this.gl.texStorage3D(u,c,h,n,a,l);break;default:throw new Error(i)}this.gl.bindTexture(this.glTarget,null),this._initializeData(t.data),this.setSampler(this.props.sampler),this.view=new D(this.device,{...this.props,texture:this}),Object.seal(this)}destroy(){this.handle&&(this.gl.deleteTexture(this.handle),this.removeStats(),this.trackDeallocatedMemory("Texture"),this.destroyed=!0)}createView(e){return new D(this.device,{...e,texture:this})}setSampler(e={}){super.setSampler(e);const t=Ue(this.sampler.props);this._setSamplerParameters(t)}copyImageData(e){const t=this._normalizeCopyImageDataOptions(e),s=t.data,{width:i,height:n,depth:a}=this,{mipLevel:l=0,byteOffset:c=0,x:u=0,y:h=0,z:f=0}=t,{glFormat:d,glType:g,compressed:m}=this,v=ve(this.glTarget,this.dimension,f);let x;if(!this.compressed){const{bytesPerPixel:_}=this.device.getTextureFormatInfo(this.format);if(_){if(t.bytesPerRow%_!==0)throw new Error(`bytesPerRow (${t.bytesPerRow}) must be a multiple of bytesPerPixel (${_}) for ${this.format}`);x=t.bytesPerRow/_}}const w=this.compressed?{}:{...x!==void 0?{3314:x}:{},32878:t.rowsPerImage};this.gl.bindTexture(v,this.handle),U(this.gl,w,()=>{switch(this.dimension){case"2d":case"cube":m?this.gl.compressedTexSubImage2D(v,l,u,h,i,n,d,s,c):this.gl.texSubImage2D(v,l,u,h,i,n,d,g,s,c);break;case"2d-array":case"3d":m?this.gl.compressedTexSubImage3D(v,l,u,h,f,i,n,a,d,s,c):this.gl.texSubImage3D(v,l,u,h,f,i,n,a,d,g,s,c);break;default:}}),this.gl.bindTexture(v,null)}copyExternalImage(e){const t=this._normalizeCopyExternalImageOptions(e);if(t.sourceX||t.sourceY)throw new Error("WebGL does not support sourceX/sourceY)");const{glFormat:s,glType:i}=this,{image:n,depth:a,mipLevel:l,x:c,y:u,z:h,width:f,height:d}=t,g=ve(this.glTarget,this.dimension,a),m=t.flipY?{37440:!0}:{};return this.gl.bindTexture(this.glTarget,this.handle),U(this.gl,m,()=>{switch(this.dimension){case"2d":case"cube":this.gl.texSubImage2D(g,l,c,u,f,d,s,i,n);break;case"2d-array":case"3d":this.gl.texSubImage3D(g,l,c,u,h,f,d,a,s,i,n);break;default:}}),this.gl.bindTexture(this.glTarget,null),{width:t.width,height:t.height}}generateMipmapsWebGL(e){if(!(!(this.device.isTextureFormatRenderable(this.props.format)&&this.device.isTextureFormatFilterable(this.props.format))&&(p.warn(`${this} is not renderable or filterable, may not be able to generate mipmaps`)(),!(e!=null&&e.force))))try{this.gl.bindTexture(this.glTarget,this.handle),this.gl.generateMipmap(this.glTarget)}catch(t){p.warn(`Error generating mipmap for ${this}: ${t.message}`)()}finally{this.gl.bindTexture(this.glTarget,null)}}_setSamplerParameters(e){p.log(2,`${this.id} sampler parameters`,this.device.getGLKeys(e))(),this.gl.bindTexture(this.glTarget,this.handle);for(const[t,s]of Object.entries(e)){const i=Number(t),n=s;switch(i){case 33082:case 33083:this.gl.texParameterf(this.glTarget,i,n);break;case 10240:case 10241:this.gl.texParameteri(this.glTarget,i,n);break;case 10242:case 10243:case 32882:this.gl.texParameteri(this.glTarget,i,n);break;case 34046:this.device.features.has("texture-filterable-anisotropic-webgl")&&this.gl.texParameteri(this.glTarget,i,n);break;case 34892:case 34893:this.gl.texParameteri(this.glTarget,i,n);break}}this.gl.bindTexture(this.glTarget,null)}_getActiveUnit(){return this.gl.getParameter(34016)-33984}_bind(e){const{gl:t}=this;return e!==void 0&&(this._textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.glTarget,this.handle),e}_unbind(e){const{gl:t}=this;return e!==void 0&&(this._textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.glTarget,null),e}}function gr(r){switch(r){case"1d":break;case"2d":return 3553;case"3d":return 32879;case"cube":return 34067;case"2d-array":return 35866}throw new Error(r)}function ve(r,e,t){return e==="cube"?34069+t:r}function pr(r){return yr[r]}function te(r){return vr[r]}function mr(r){return!!Ne[r]}function br(r){return Ne[r]}const vr={5126:"f32",35664:"vec2",35665:"vec3",35666:"vec4",5124:"i32",35667:"vec2",35668:"vec3",35669:"vec4",5125:"u32",36294:"vec2",36295:"vec3",36296:"vec4",35670:"f32",35671:"vec2",35672:"vec3",35673:"vec4",35674:"mat2x2",35685:"mat2x3",35686:"mat2x4",35687:"mat3x2",35675:"mat3x3",35688:"mat3x4",35689:"mat4x2",35690:"mat4x3",35676:"mat4x4"},Ne={35678:{viewDimension:"2d",sampleType:"float"},35680:{viewDimension:"cube",sampleType:"float"},35679:{viewDimension:"3d",sampleType:"float"},35682:{viewDimension:"3d",sampleType:"depth"},36289:{viewDimension:"2d-array",sampleType:"float"},36292:{viewDimension:"2d-array",sampleType:"depth"},36293:{viewDimension:"cube",sampleType:"float"},36298:{viewDimension:"2d",sampleType:"sint"},36299:{viewDimension:"3d",sampleType:"sint"},36300:{viewDimension:"cube",sampleType:"sint"},36303:{viewDimension:"2d-array",sampleType:"uint"},36306:{viewDimension:"2d",sampleType:"uint"},36307:{viewDimension:"3d",sampleType:"uint"},36308:{viewDimension:"cube",sampleType:"uint"},36311:{viewDimension:"2d-array",sampleType:"uint"}},yr={uint8:5121,sint8:5120,unorm8:5121,snorm8:5120,uint16:5123,sint16:5122,unorm16:5123,snorm16:5122,uint32:5125,sint32:5124,float16:5131,float32:5126};function xr(r,e){const t={attributes:[],bindings:[]};t.attributes=wr(r,e);const s=Pr(r,e);for(const l of s){const c=l.uniforms.map(u=>({name:u.name,format:u.format,byteOffset:u.byteOffset,byteStride:u.byteStride,arrayLength:u.arrayLength}));t.bindings.push({type:"uniform",name:l.name,group:0,location:l.location,visibility:(l.vertex?1:0)&(l.fragment?2:0),minBindingSize:l.byteLength,uniforms:c})}const i=_r(r,e);let n=0;for(const l of i)if(mr(l.type)){const{viewDimension:c,sampleType:u}=br(l.type);t.bindings.push({type:"texture",name:l.name,group:0,location:n,viewDimension:c,sampleType:u}),l.textureUnit=n,n+=1}i.length&&(t.uniforms=i);const a=Sr(r,e);return a!=null&&a.length&&(t.varyings=a),t}function wr(r,e){const t=[],s=r.getProgramParameter(e,35721);for(let i=0;i=0){const u=te(l),h=/instance/i.test(a)?"instance":"vertex";t.push({name:a,location:c,stepMode:h,type:u})}}return t.sort((i,n)=>i.location-n.location),t}function Sr(r,e){const t=[],s=r.getProgramParameter(e,35971);for(let i=0;ii.location-n.location),t}function _r(r,e){const t=[],s=r.getProgramParameter(e,35718);for(let i=0;i1)for(let g=0;gr.getActiveUniformBlockParameter(e,n,a),s=[],i=r.getProgramParameter(e,35382);for(let n=0;nn.location-a.location),s}function Tr(r){if(r[r.length-1]!=="]")return{name:r,length:1,isArray:!1};const e=/([^[]*)(\[[0-9]+\])?/.exec(r);if(!e||e.length<2)throw new Error(`Failed to parse GLSL uniform name ${r}`);return{name:e[1],length:e[2]?1:0,isArray:!!e[2]}}function Ar(r,e,t,s){const i=r;let n=s;n===!0&&(n=1),n===!1&&(n=0);const a=typeof n=="number"?[n]:n;switch(t){case 35678:case 35680:case 35679:case 35682:case 36289:case 36292:case 36293:case 36298:case 36299:case 36300:case 36303:case 36306:case 36307:case 36308:case 36311:if(typeof s!="number")throw new Error("samplers must be set to integers");return r.uniform1i(e,s);case 5126:return r.uniform1fv(e,a);case 35664:return r.uniform2fv(e,a);case 35665:return r.uniform3fv(e,a);case 35666:return r.uniform4fv(e,a);case 5124:return r.uniform1iv(e,a);case 35667:return r.uniform2iv(e,a);case 35668:return r.uniform3iv(e,a);case 35669:return r.uniform4iv(e,a);case 35670:return r.uniform1iv(e,a);case 35671:return r.uniform2iv(e,a);case 35672:return r.uniform3iv(e,a);case 35673:return r.uniform4iv(e,a);case 5125:return i.uniform1uiv(e,a,1);case 36294:return i.uniform2uiv(e,a,2);case 36295:return i.uniform3uiv(e,a,3);case 36296:return i.uniform4uiv(e,a,4);case 35674:return r.uniformMatrix2fv(e,!1,a);case 35675:return r.uniformMatrix3fv(e,!1,a);case 35676:return r.uniformMatrix4fv(e,!1,a);case 35685:return i.uniformMatrix2x3fv(e,!1,a);case 35686:return i.uniformMatrix2x4fv(e,!1,a);case 35687:return i.uniformMatrix3x2fv(e,!1,a);case 35688:return i.uniformMatrix3x4fv(e,!1,a);case 35689:return i.uniformMatrix4x2fv(e,!1,a);case 35690:return i.uniformMatrix4x3fv(e,!1,a)}throw new Error("Illegal uniform")}function Br(r){switch(r){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 3;case"triangle-list":return 4;case"triangle-strip":return 5;default:throw new Error(r)}}function Fr(r){switch(r){case"point-list":return 0;case"line-list":return 1;case"line-strip":return 1;case"triangle-list":return 4;case"triangle-strip":return 4;default:throw new Error(r)}}const ye=4;class Lr extends st{constructor(e,t){super(e,t),o(this,"device"),o(this,"handle"),o(this,"vs"),o(this,"fs"),o(this,"introspectedLayout"),o(this,"uniforms",{}),o(this,"bindings",{}),o(this,"varyings",null),o(this,"_uniformCount",0),o(this,"_uniformSetters",{}),this.device=e,this.handle=this.props.handle||this.device.gl.createProgram(),this.device._setWebGLDebugMetadata(this.handle,this,{spector:{id:this.props.id}}),this.vs=t.vs,this.fs=t.fs;const{varyings:s,bufferMode:i=35981}=t;s&&s.length>0&&(this.varyings=s,this.device.gl.transformFeedbackVaryings(this.handle,s,i)),this._linkShaders(),p.time(3,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.introspectedLayout=xr(this.device.gl,this.handle),p.timeEnd(3,`RenderPipeline ${this.id} - shaderLayout introspection`)(),this.shaderLayout=t.shaderLayout?Cr(this.introspectedLayout,t.shaderLayout):this.introspectedLayout}get[Symbol.toStringTag](){return"WEBGLRenderPipeline"}destroy(){this.handle&&(this.device.gl.useProgram(null),this.device.gl.deleteProgram(this.handle),this.destroyed=!0,this.handle.destroyed=!0,this.handle=null)}setBindings(e,t){for(const[s,i]of Object.entries(e)){const n=this.shaderLayout.bindings.find(a=>a.name===s)||this.shaderLayout.bindings.find(a=>a.name===`${s}Uniforms`);if(!n){const a=this.shaderLayout.bindings.map(l=>`"${l.name}"`).join(", ");t!=null&&t.disableWarnings||p.warn(`No binding "${s}" in render pipeline "${this.id}", expected one of ${a}`,i)();continue}switch(i||p.warn(`Unsetting binding "${s}" in render pipeline "${this.id}"`)(),n.type){case"uniform":if(!(i instanceof z)&&!(i.buffer instanceof z))throw new Error("buffer value");break;case"texture":if(!(i instanceof D||i instanceof V||i instanceof G))throw new Error(`${this} Bad texture binding for ${s}`);break;case"sampler":p.warn(`Ignoring sampler ${s}`)();break;default:throw new Error(n.type)}this.bindings[s]=i}}draw(e){var t;const{renderPass:s,parameters:i=this.props.parameters,topology:n=this.props.topology,vertexArray:a,vertexCount:l,instanceCount:c,isInstanced:u=!1,firstVertex:h=0,transformFeedback:f}=e,d=Br(n),g=!!a.indexBuffer,m=(t=a.indexBuffer)==null?void 0:t.glIndexType;if(this.linkStatus!=="success")return p.info(2,`RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)(),!1;if(!this._areTexturesRenderable())return p.info(2,`RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)(),!1;this.device.gl.useProgram(this.handle),a.bindBeforeRender(s),f&&f.begin(this.props.topology),this._applyBindings(),this._applyUniforms();const v=s;return ar(this.device,i,v.glParameters,()=>{g&&u?this.device.gl.drawElementsInstanced(d,l||0,m,h,c||0):g?this.device.gl.drawElements(d,l||0,m,h):u?this.device.gl.drawArraysInstanced(d,h,l||0,c||0):this.device.gl.drawArrays(d,h,l||0),f&&f.end()}),a.unbindAfterRender(s),!0}async _linkShaders(){const{gl:e}=this.device;if(e.attachShader(this.handle,this.vs.handle),e.attachShader(this.handle,this.fs.handle),p.time(ye,`linkProgram for ${this.id}`)(),e.linkProgram(this.handle),p.timeEnd(ye,`linkProgram for ${this.id}`)(),p.level,!this.device.features.has("compilation-status-async-webgl")){const s=this._getLinkStatus();this._reportLinkStatus(s);return}p.once(1,"RenderPipeline linking is asynchronous")(),await this._waitForLinkComplete(),p.info(2,`RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();const t=this._getLinkStatus();this._reportLinkStatus(t)}async _reportLinkStatus(e){var t;switch(e){case"success":return;default:const s=e==="link-error"?"Link error":"Validation error";switch(this.vs.compilationStatus){case"error":throw this.vs.debugShader(),new Error(`${this} ${s} during compilation of ${this.vs}`);case"pending":await this.vs.asyncCompilationStatus,this.vs.debugShader();break}switch((t=this.fs)==null?void 0:t.compilationStatus){case"error":throw this.fs.debugShader(),new Error(`${this} ${s} during compilation of ${this.fs}`);case"pending":await this.fs.asyncCompilationStatus,this.fs.debugShader();break}const i=this.device.gl.getProgramInfoLog(this.handle);this.device.reportError(new Error(`${s} during ${e}: ${i}`),this)(),this.device.debug()}}_getLinkStatus(){const{gl:e}=this.device;return e.getProgramParameter(this.handle,35714)?(e.validateProgram(this.handle),e.getProgramParameter(this.handle,35715)?(this.linkStatus="success","success"):(this.linkStatus="error","validation-error")):(this.linkStatus="error","link-error")}async _waitForLinkComplete(){const e=async s=>await new Promise(i=>setTimeout(i,s));if(!this.device.features.has("compilation-status-async-webgl")){await e(10);return}const{gl:t}=this.device;for(;;){if(t.getProgramParameter(this.handle,37297))return;await e(10)}}_areTexturesRenderable(){let e=!0;for(const t of this.shaderLayout.bindings)!this.bindings[t.name]&&!this.bindings[t.name.replace(/Uniforms$/,"")]&&(p.warn(`Binding ${t.name} not found in ${this.id}`)(),e=!1);return e}_applyBindings(){if(this.linkStatus!=="success")return;const{gl:e}=this.device;e.useProgram(this.handle);let t=0,s=0;for(const i of this.shaderLayout.bindings){const n=this.bindings[i.name]||this.bindings[i.name.replace(/Uniforms$/,"")];if(!n)throw new Error(`No value for binding ${i.name} in ${this.id}`);switch(i.type){case"uniform":const{name:a}=i,l=e.getUniformBlockIndex(this.handle,a);if(l===4294967295)throw new Error(`Invalid uniform block name ${a}`);e.uniformBlockBinding(this.handle,s,l),n instanceof z?e.bindBufferBase(35345,s,n.handle):e.bindBufferRange(35345,s,n.buffer.handle,n.offset||0,n.size||n.buffer.byteLength-n.offset),s+=1;break;case"texture":if(!(n instanceof D||n instanceof V||n instanceof G))throw new Error("texture");let c;if(n instanceof D)c=n.texture;else if(n instanceof V)c=n;else if(n instanceof G&&n.colorAttachments[0]instanceof D)p.warn("Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead")(),c=n.colorAttachments[0].texture;else throw new Error("No texture");e.activeTexture(33984+t),e.bindTexture(c.glTarget,c.handle),t+=1;break;case"sampler":break;case"storage":case"read-only-storage":throw new Error(`binding type '${i.type}' not supported in WebGL`)}}}_applyUniforms(){for(const e of this.shaderLayout.uniforms||[]){const{name:t,location:s,type:i,textureUnit:n}=e,a=this.uniforms[t]??n;a!==void 0&&Ar(this.device.gl,s,i,a)}}}function Cr(r,e){const t={...r,attributes:r.attributes.map(s=>({...s}))};for(const s of(e==null?void 0:e.attributes)||[]){const i=t.attributes.find(n=>n.name===s.name);i?(i.type=s.type||i.type,i.stepMode=s.stepMode||i.stepMode):p.warn(`shader layout attribute ${s.name} not present in shader`)}return t}class kr extends St{constructor(e){super(e,{}),o(this,"device"),o(this,"handle",null),o(this,"commands",[]),this.device=e}_executeCommands(e=this.commands){for(const t of e)switch(t.name){case"copy-buffer-to-buffer":Er(this.device,t.options);break;case"copy-buffer-to-texture":Dr(this.device,t.options);break;case"copy-texture-to-buffer":Wr(this.device,t.options);break;case"copy-texture-to-texture":Or(this.device,t.options);break;default:throw new Error(t.name)}}}function Er(r,e){const t=e.sourceBuffer,s=e.destinationBuffer;r.gl.bindBuffer(36662,t.handle),r.gl.bindBuffer(36663,s.handle),r.gl.copyBufferSubData(36662,36663,e.sourceOffset??0,e.destinationOffset??0,e.size),r.gl.bindBuffer(36662,null),r.gl.bindBuffer(36663,null)}function Dr(r,e){throw new Error("Not implemented")}function Wr(r,e){const{sourceTexture:t,mipLevel:s=0,aspect:i="all",width:n=e.sourceTexture.width,height:a=e.sourceTexture.height,depthOrArrayLayers:l=0,origin:c=[0,0],destinationBuffer:u,byteOffset:h=0,bytesPerRow:f,rowsPerImage:d}=e;if(i!=="all")throw new Error("aspect not supported in WebGL");if(s!==0||l!==0||f||d)throw new Error("not implemented");const{framebuffer:g,destroyFramebuffer:m}=He(t);let v;try{const x=u,w=n||g.width,_=a||g.height,se=Ve(g.colorAttachments[0].texture.props.format),qe=se.format,Xe=se.type;r.gl.bindBuffer(35051,x.handle),v=r.gl.bindFramebuffer(36160,g.handle),r.gl.readPixels(c[0],c[1],w,_,qe,Xe,h)}finally{r.gl.bindBuffer(35051,null),v!==void 0&&r.gl.bindFramebuffer(36160,v),m&&g.destroy()}}function Or(r,e){const{sourceTexture:t,destinationMipLevel:s=0,origin:i=[0,0],destinationOrigin:n=[0,0],destinationTexture:a}=e;let{width:l=e.destinationTexture.width,height:c=e.destinationTexture.height}=e;const{framebuffer:u,destroyFramebuffer:h}=He(t),[f,d]=i,[g,m,v]=n,x=r.gl.bindFramebuffer(36160,u.handle);let w,_;if(a instanceof V)w=a,l=Number.isFinite(l)?l:w.width,c=Number.isFinite(c)?c:w.height,w._bind(0),_=w.glTarget;else throw new Error("invalid destination");switch(_){case 3553:case 34067:r.gl.copyTexSubImage2D(_,s,g,m,f,d,l,c);break;case 35866:case 32879:r.gl.copyTexSubImage3D(_,s,g,m,v,f,d,l,c);break}w&&w._unbind(),r.gl.bindFramebuffer(36160,x),h&&u.destroy()}function He(r){if(r instanceof B){const{width:e,height:t,id:s}=r;return{framebuffer:r.device.createFramebuffer({id:`framebuffer-for-${s}`,width:e,height:t,colorAttachments:[r]}),destroyFramebuffer:!0}}return{framebuffer:r,destroyFramebuffer:!1}}const Mr=[1,2,4,8];class Rr extends xt{constructor(e,t){var s;super(e,t),o(this,"device"),o(this,"handle",null),o(this,"glParameters",{}),this.device=e;let i;if(!((s=t==null?void 0:t.parameters)!=null&&s.viewport))if(t!=null&&t.framebuffer){const{width:a,height:l}=t.framebuffer;i=[0,0,a,l]}else{const[a,l]=e.getDefaultCanvasContext().getDrawingBufferSize();i=[0,0,a,l]}this.device.pushState(),this.setParameters({viewport:i,...this.props.parameters});const n=this.props.framebuffer;if(this.props.framebuffer&&n!=null&&n.handle){const a=this.props.framebuffer.colorAttachments.map((l,c)=>36064+c);this.device.gl.drawBuffers(a)}else this.device.gl.drawBuffers([1029]);this.clear()}end(){this.device.popState()}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}setParameters(e={}){const t={...this.glParameters};t.framebuffer=this.props.framebuffer||null,this.props.depthReadOnly&&(t.depthMask=!this.props.depthReadOnly),t.stencilMask=this.props.stencilReadOnly?0:1,t[35977]=this.props.discard,e.viewport&&(e.viewport.length>=6?(t.viewport=e.viewport.slice(0,4),t.depthRange=[e.viewport[4],e.viewport[5]]):t.viewport=e.viewport),e.scissorRect&&(t.scissorTest=!0,t.scissor=e.scissorRect),e.blendConstant&&(t.blendColor=e.blendConstant),e.stencilReference&&(console.warn("RenderPassParameters.stencilReference not yet implemented in WebGL"),t[2967]=e.stencilReference),"colorMask"in e&&(t.colorMask=Mr.map(s=>!!(s&e.colorMask))),this.glParameters=t,O(this.device.gl,t)}beginOcclusionQuery(e){const t=this.props.occlusionQuerySet;t==null||t.beginOcclusionQuery()}endOcclusionQuery(){const e=this.props.occlusionQuerySet;e==null||e.endOcclusionQuery()}clear(){const e={...this.glParameters};let t=0;this.props.clearColors&&this.props.clearColors.forEach((s,i)=>{s&&this.clearColorBuffer(i,s)}),this.props.clearColor!==!1&&this.props.clearColors===void 0&&(t|=16384,e.clearColor=this.props.clearColor),this.props.clearDepth!==!1&&(t|=256,e.clearDepth=this.props.clearDepth),this.props.clearStencil!==!1&&(t|=1024,e.clearStencil=this.props.clearStencil),t!==0&&U(this.device.gl,e,()=>{this.device.gl.clear(t)})}clearColorBuffer(e=0,t=[0,0,0,0]){U(this.device.gl,{framebuffer:this.props.framebuffer},()=>{switch(t.constructor){case Int8Array:case Int16Array:case Int32Array:this.device.gl.clearBufferiv(6144,e,t);break;case Uint8Array:case Uint8ClampedArray:case Uint16Array:case Uint32Array:this.device.gl.clearBufferuiv(6144,e,t);break;case Float32Array:this.device.gl.clearBufferfv(6144,e,t);break;default:throw new Error("clearColorBuffer: color must be typed array")}})}}class xe extends wt{constructor(e,t){super(e,t),o(this,"device"),o(this,"handle",null),o(this,"commandBuffer"),this.device=e,this.commandBuffer=new kr(e)}destroy(){}finish(){return this.commandBuffer}beginRenderPass(e){return new Rr(this.device,e)}beginComputePass(e){throw new Error("ComputePass not supported in WebGL")}copyBufferToBuffer(e){this.commandBuffer.commands.push({name:"copy-buffer-to-buffer",options:e})}copyBufferToTexture(e){this.commandBuffer.commands.push({name:"copy-buffer-to-texture",options:e})}copyTextureToBuffer(e){this.commandBuffer.commands.push({name:"copy-texture-to-buffer",options:e})}copyTextureToTexture(e){this.commandBuffer.commands.push({name:"copy-texture-to-texture",options:e})}pushDebugGroup(e){}popDebugGroup(){}insertDebugMarker(e){}resolveQuerySet(e,t,s){}}function $r(r){const{target:e,source:t,start:s=0,count:i=1}=r,n=t.length,a=i*n;let l=0;for(let c=s;l{for(const t in e)this.setBuffer(t,e[t])})}setBuffer(e,t){const s=this._getVaryingIndex(e),{buffer:i,byteLength:n,byteOffset:a}=this._getBufferRange(t);if(s<0){this.unusedBuffers[e]=i,p.warn(`${this.id} unusedBuffers varying buffer ${e}`)();return}this.buffers[s]={buffer:i,byteLength:n,byteOffset:a},this.bindOnUse||this._bindBuffer(s,i,a,n)}getBuffer(e){if(we(e))return this.buffers[e]||null;const t=this._getVaryingIndex(e);return t>=0?this.buffers[t]:null}bind(e=this.handle){if(typeof e!="function")return this.gl.bindTransformFeedback(36386,e),this;let t;return this._bound?t=e():(this.gl.bindTransformFeedback(36386,this.handle),this._bound=!0,t=e(),this._bound=!1,this.gl.bindTransformFeedback(36386,null)),t}unbind(){this.bind(null)}_getBufferRange(e){if(e instanceof z)return{buffer:e,byteOffset:0,byteLength:e.byteLength};const{buffer:t,byteOffset:s=0,byteLength:i=e.buffer.byteLength}=e;return{buffer:t,byteOffset:s,byteLength:i}}_getVaryingIndex(e){if(we(e))return Number(e);for(const t of this.layout.varyings||[])if(e===t.name)return t.location;return-1}_bindBuffers(){for(const e in this.buffers){const{buffer:t,byteLength:s,byteOffset:i}=this._getBufferRange(this.buffers[e]);this._bindBuffer(Number(e),t,i,s)}}_unbindBuffers(){for(const e in this.buffers)this.gl.bindBufferBase(35982,Number(e),null)}_bindBuffer(e,t,s=0,i){const n=t&&t.handle;!n||i===void 0?this.gl.bindBufferBase(35982,e,n):this.gl.bindBufferRange(35982,e,n,s,i)}}function we(r){return typeof r=="number"?Number.isInteger(r):/^\d+$/.test(r)}class Vr extends Tt{constructor(e,t){if(super(e,t),o(this,"device"),o(this,"handle"),o(this,"target",null),o(this,"_queryPending",!1),o(this,"_pollingPromise",null),this.device=e,t.count>1)throw new Error("WebGL QuerySet can only have one value");const s=this.device.gl.createQuery();if(!s)throw new Error("WebGL query not supported");this.handle=s,Object.seal(this)}get[Symbol.toStringTag](){return"Query"}destroy(){this.device.gl.deleteQuery(this.handle)}beginTimestampQuery(){return this._begin(35007)}endTimestampQuery(){this._end()}beginOcclusionQuery(e){return this._begin(e!=null&&e.conservative?36202:35887)}endOcclusionQuery(){this._end()}beginTransformFeedbackQuery(){return this._begin(35976)}endTransformFeedbackQuery(){this._end()}async resolveQuery(){return[await this.pollQuery()]}_begin(e){this._queryPending||(this.target=e,this.device.gl.beginQuery(this.target,this.handle))}_end(){this._queryPending||this.target&&(this.device.gl.endQuery(this.target),this.target=null,this._queryPending=!0)}isResultAvailable(){if(!this._queryPending)return!1;const e=this.device.gl.getQueryParameter(this.handle,34919);return e&&(this._queryPending=!1),e}isTimerDisjoint(){return this.device.gl.getParameter(36795)}getResult(){return this.device.gl.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}pollQuery(e=Number.POSITIVE_INFINITY){if(this._pollingPromise)return this._pollingPromise;let t=0;return this._pollingPromise=new Promise((s,i)=>{const n=()=>{this.isResultAvailable()?(s(this.getResult()),this._pollingPromise=null):t++>e?(i("Timed out"),this._pollingPromise=null):requestAnimationFrame(n)};requestAnimationFrame(n)}),this._pollingPromise}}function je(r){switch(r){case 6406:case 33326:case 6403:case 36244:return 1;case 33339:case 33340:case 33328:case 33320:case 33319:return 2;case 6407:case 36248:case 34837:return 3;case 6408:case 36249:case 34836:return 4;default:return 0}}function Ur(r){switch(r){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return 0}}function Nr(r){return Hr[r]}const Hr={5124:"sint32",5125:"uint32",5122:"sint16",5123:"uint16",5120:"sint8",5121:"uint8",5126:"float32",5131:"float16",33635:"uint16",32819:"uint16",32820:"uint16",33640:"uint32",35899:"uint32",35902:"uint32",34042:"uint32",36269:"uint32"};function jr(r,e){var t;const{sourceX:s=0,sourceY:i=0,sourceAttachment:n=0}=e||{};let{target:a=null,sourceWidth:l,sourceHeight:c,sourceDepth:u,sourceFormat:h,sourceType:f}=e||{};const{framebuffer:d,deleteFramebuffer:g}=Qe(r),{gl:m,handle:v}=d;l||(l=d.width),c||(c=d.height);const x=(t=d.colorAttachments[n])==null?void 0:t.texture;if(!x)throw new Error(`Invalid framebuffer attachment ${n}`);u=(x==null?void 0:x.depth)||1,h||(h=(x==null?void 0:x.glFormat)||6408),f||(f=(x==null?void 0:x.glType)||5121),a=Xr(a,f,h,l,c);const w=it(a);f=f||pr(w);const _=m.bindFramebuffer(36160,v);return m.readBuffer(36064+n),m.readPixels(s,i,l,c,h,f,a),m.readBuffer(36064),m.bindFramebuffer(36160,_||null),g&&d.destroy(),a}function Qr(r,e){const{target:t,sourceX:s=0,sourceY:i=0,sourceFormat:n=6408,targetByteOffset:a=0}=e||{};let{sourceWidth:l,sourceHeight:c,sourceType:u}=e||{};const{framebuffer:h,deleteFramebuffer:f}=Qe(r);l=l||h.width,c=c||h.height;const d=h;u=u||5121;let g=t;if(!g){const v=je(n),x=Ur(u),w=a+l*c*v*x;g=d.device.createBuffer({byteLength:w})}const m=r.device.createCommandEncoder();return m.copyTextureToBuffer({sourceTexture:r,width:l,height:c,origin:[s,i],destinationBuffer:g,byteOffset:a}),m.destroy(),f&&h.destroy(),g}function Qe(r){return r instanceof Fe?{framebuffer:r,deleteFramebuffer:!1}:{framebuffer:qr(r),deleteFramebuffer:!0}}function qr(r,e){const{device:t,width:s,height:i,id:n}=r;return t.createFramebuffer({...e,id:`framebuffer-for-${n}`,width:s,height:i,colorAttachments:[r]})}function Xr(r,e,t,s,i,n){if(r)return r;e||(e=5121);const a=Nr(e),l=lt(a),c=je(t);return new l(s*i*c)}class ms extends ie{constructor(e){var t,s;super({...e,id:e.id||tr("webgl-device")}),o(this,"type","webgl"),o(this,"handle"),o(this,"features"),o(this,"limits"),o(this,"info"),o(this,"canvasContext"),o(this,"preferredColorFormat","rgba8unorm"),o(this,"preferredDepthFormat","depth24plus"),o(this,"commandEncoder"),o(this,"lost"),o(this,"_resolveContextLost"),o(this,"gl"),o(this,"_constants"),o(this,"_extensions",{}),o(this,"_polyfilled",!1),o(this,"spectorJS");const i=ie._getCanvasContextProps(e);if(!i)throw new Error("WebGLDevice requires props.createCanvasContext to be set");let n=(s=(t=i.canvas)==null?void 0:t.gl)==null?void 0:s.device;if(n)throw new Error(`WebGL context already attached to device ${n.id}`);this.canvasContext=new er(this,i),this.lost=new Promise(h=>{this._resolveContextLost=h});const a={...e.webgl};i.alphaMode==="premultiplied"&&(a.premultipliedAlpha=!0),e.powerPreference!==void 0&&(a.powerPreference=e.powerPreference);const l=this.props._handle||Wt(this.canvasContext.canvas,{onContextLost:h=>{var f;return(f=this._resolveContextLost)==null?void 0:f.call(this,{reason:"destroyed",message:"Entered sleep mode, or too many apps or browser tabs are using the GPU."})},onContextRestored:h=>console.log("WebGL context restored")},a);if(!l)throw new Error("WebGL context creation failed");if(n=l.device,n){if(e._reuseDevices)return p.log(1,`Not creating a new Device, instead returning a reference to Device ${n.id} already attached to WebGL context`,n)(),n._reused=!0,n;throw new Error(`WebGL context already attached to device ${n.id}`)}this.handle=l,this.gl=l,this.spectorJS=Ke({...this.props,gl:this.handle}),this.gl.device=this,this.gl._version=2,this.info=Ot(this.gl,this._extensions),this.limits=new Yt(this.gl),this.features=new Kt(this.gl,this._extensions,this.props._disabledFeatures),this.props._initializeFeatures&&this.features.initializeFeatures(),new L(this.gl,{log:(...h)=>p.log(1,...h)()}).trackState(this.gl,{copyState:!1});const c=e.debugWebGL||e.debug,u=e.debugWebGL;c&&(this.gl=Ye(this.gl,{debugWebGL:c,traceWebGL:u}),p.warn("WebGL debug mode activated. Performance reduced.")(),e.debugWebGL&&(p.level=Math.max(p.level,1))),this.commandEncoder=new xe(this,{id:`${this}-command-encoder`})}get[Symbol.toStringTag](){return"WebGLDevice"}toString(){return`${this[Symbol.toStringTag]}(${this.id})`}isVertexFormatSupported(e){switch(e){case"unorm8x4-bgra":return!1;default:return!0}}destroy(){!this.props._reuseDevices&&!this._reused&&delete this.gl.device}get isLost(){return this.gl.isContextLost()}getTextureByteAlignment(){return 4}createCanvasContext(e){throw new Error("WebGL only supports a single canvas")}createBuffer(e){const t=this._normalizeBufferProps(e);return new z(this,t)}createTexture(e){return new V(this,e)}createExternalTexture(e){throw new Error("createExternalTexture() not implemented")}createSampler(e){return new dr(this,e)}createShader(e){return new nr(this,e)}createFramebuffer(e){return new G(this,e)}createVertexArray(e){return new re(this,e)}createTransformFeedback(e){return new zr(this,e)}createQuerySet(e){return new Vr(this,e)}createRenderPipeline(e){return new Lr(this,e)}createComputePipeline(e){throw new Error("ComputePipeline not supported in WebGL")}createCommandEncoder(e={}){return new xe(this,e)}submit(e){e||(e=this.commandEncoder.finish(),this.commandEncoder.destroy(),this.commandEncoder=this.createCommandEncoder({id:`${this.id}-default-encoder`})),e._executeCommands()}readPixelsToArrayWebGL(e,t){return jr(e,t)}readPixelsToBufferWebGL(e,t){return Qr(e,t)}setParametersWebGL(e){O(this.gl,e)}getParametersWebGL(e){return Ie(this.gl,e)}withParametersWebGL(e,t){return U(this.gl,e,t)}resetWebGL(){p.warn("WebGLDevice.resetWebGL is deprecated, use only for debugging")(),Lt(this.gl)}_getDeviceSpecificTextureFormatCapabilities(e){return jt(this.gl,e,this._extensions)}loseDevice(){var e;let t=!1;const s=this.getExtension("WEBGL_lose_context").WEBGL_lose_context;return s&&(t=!0,s.loseContext()),(e=this._resolveContextLost)==null||e.call(this,{reason:"destroyed",message:"Application triggered context loss"}),t}pushState(){L.get(this.gl).push()}popState(){L.get(this.gl).pop()}getGLKey(e,t){const s=Number(e);for(const i in this.gl)if(this.gl[i]===s)return`GL.${i}`;return t!=null&&t.emptyIfUnknown?"":String(e)}getGLKeys(e){const t={emptyIfUnknown:!0};return Object.entries(e).reduce((s,[i,n])=>(s[`${i}:${this.getGLKey(i,t)}`]=`${n}:${this.getGLKey(n,t)}`,s),{})}setConstantAttributeWebGL(e,t){const s=this.limits.maxVertexAttributes;this._constants=this._constants||new Array(s).fill(null);const i=this._constants[e];switch(i&&Zr(i,t)&&p.info(1,`setConstantAttributeWebGL(${e}) could have been skipped, value unchanged`)(),this._constants[e]=t,t.constructor){case Float32Array:Kr(this,e,t);break;case Int32Array:Yr(this,e,t);break;case Uint32Array:Jr(this,e,t);break;default:throw new Error("constant")}}getExtension(e){return W(this.gl,e,this._extensions),this._extensions}_setWebGLDebugMetadata(e,t,s){e.luma=t;const i={props:s.spector,id:s.spector.id};e.__SPECTOR_Metadata=i}}function Kr(r,e,t){switch(t.length){case 1:r.gl.vertexAttrib1fv(e,t);break;case 2:r.gl.vertexAttrib2fv(e,t);break;case 3:r.gl.vertexAttrib3fv(e,t);break;case 4:r.gl.vertexAttrib4fv(e,t);break}}function Yr(r,e,t){r.gl.vertexAttribI4iv(e,t)}function Jr(r,e,t){r.gl.vertexAttribI4uiv(e,t)}function Zr(r,e){if(!r||!e||r.length!==e.length||r.constructor!==e.constructor)return!1;for(let t=0;t - + diff --git a/frontend/package.json b/frontend/package.json index 2b0ce0c2..7cb285f3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "pymc_console", - "version": "0.9.303", + "version": "0.9.304", "description": "Vite + React Dashboard for pyMC_Repeater", "private": true, "type": "module",