From 728a2ad130c355475a6cd85a4471362a1dd8972b Mon Sep 17 00:00:00 2001 From: GitHub Actions Bot Date: Sat, 25 Jul 2026 00:09:57 +0000 Subject: [PATCH] Release v0.9.342 Automated sync from private repository. Built with obfuscation enabled. --- frontend/dist/VERSION | 2 +- ...terPanel-BpsoGf4o.js => AnalyzerFilterPanel-O22f461t.js} | 2 +- ...reDialog-BAQ5UEr_.js => AutoConfigureDialog-I0jHfgv3.js} | 2 +- ...{BackupRestore-CM11c75S.js => BackupRestore-D2lKmevY.js} | 2 +- .../{BasemapLayer-VyMOdkaO.js => BasemapLayer-U4r1eipM.js} | 4 ++-- ...ADCalibration-DOpFISap.js => CADCalibration-DeM92vih.js} | 2 +- .../{ChatBubble-Cn1oh8mi.js => ChatBubble-BXwtJZuf.js} | 2 +- ...Modal-Y5-HwcN-.js => CollisionExplorerModal-brcQ7JMt.js} | 2 +- .../assets/{Companion-B40Pf-xY.js => Companion-Dku9E7ui.js} | 6 +++--- ...nionEchoMap-UK4pMkKr.js => CompanionEchoMap-Dx-5FVVv.js} | 2 +- ...nionPathMap-ChNL_sj-.js => CompanionPathMap-Cld9nrKm.js} | 2 +- ...{Configuration-DfbJ8nZk.js => Configuration-aUhduX2Z.js} | 2 +- .../{ConfirmModal-CNagQaWr.js => ConfirmModal-CB8xdBeW.js} | 2 +- .../assets/{Contacts-COjtGvyY.js => Contacts-DiQfIa8j.js} | 6 +++--- ...MapLibre-DuT85Ji5.js => ContactsMapMapLibre-BcJVpNZZ.js} | 2 +- .../assets/{Dashboard-Dt57NbQx.js => Dashboard-1WPD5yy7.js} | 6 +++--- .../assets/{DataValue-B6B0O-xC.js => DataValue-Cy2BSezA.js} | 2 +- ...anagement-BQJZp4p1.js => DatabaseManagement-DhltIlKH.js} | 2 +- ...PSDiagnostics-Cye-Trgs.js => GPSDiagnostics-CYzRkIGF.js} | 2 +- frontend/dist/assets/{Grid-B0tNiHTX.js => Grid-DYtN9_Hv.js} | 2 +- .../{KeycapButton-BDWyVW37.js => KeycapButton-BJZjnt_-.js} | 2 +- ...ightSparkline-g9bCtOHr.js => LightSparkline-B-EJJe6x.js} | 2 +- .../dist/assets/{Login-BqiBbXZ3.js => Login-B9-_of-X.js} | 2 +- frontend/dist/assets/{Logs-DJM49UnJ.js => Logs-D0FIyBRm.js} | 2 +- .../{MemoryDebug-hHFx3BHO.js => MemoryDebug-SZdlepUQ.js} | 2 +- .../assets/{MeshGraph-C36tfydu.js => MeshGraph-wRRLz_lr.js} | 6 +++--- frontend/dist/assets/{Mqtt-CkgupwWU.js => Mqtt-m3-rjLC-.js} | 2 +- ...{MqttModeBadge-OPtXzakb.js => MqttModeBadge-2hTXq31i.js} | 2 +- .../assets/{Observer-CWD4jATj.js => Observer-VP_bsWv3.js} | 2 +- .../{PacketList-ODK5IJ9o.js => PacketList-CyBre3jR.js} | 6 +++--- ...bservatory-Cf7m4kGK.js => PacketObservatory-B6q6lK8q.js} | 6 +++--- .../assets/{Packets-Cs9Zwu9d.js => Packets-DfuElOK2.js} | 2 +- .../{PageLayout-CgrNSpBT.js => PageLayout-B2kQpvXM.js} | 2 +- ...hMapMapLibre-DNpNVjSn.js => PathMapMapLibre-7vuAz1d6.js} | 2 +- .../{PolicyEngine-Bt5hUbRJ.js => PolicyEngine-CFwki3sb.js} | 2 +- ...{RadioHardware-DhH_OAdl.js => RadioHardware-D1iA7IMw.js} | 2 +- ...relation-Bjlu541K.js => RfHealthCorrelation-DoZNDUke.js} | 2 +- .../{RoomServer-DrChSCH0.js => RoomServer-D9PWmBB1.js} | 2 +- .../assets/{Sensors-insTPzAw.js => Sensors-qNNEac7h.js} | 2 +- .../assets/{Sessions-6Pz1fhab.js => Sessions-CZL0vFpY.js} | 2 +- .../dist/assets/{Setup-_swGk22g.js => Setup-Bzvgo-0b.js} | 2 +- ...nalIndicator-BN0oxyDe.js => SignalIndicator-CKCIivNj.js} | 2 +- .../{Statistics-DJlDW6-R.js => Statistics-D1pZrkmX.js} | 2 +- .../dist/assets/{System-D3XTlAJj.js => System-C5DE1LLo.js} | 2 +- .../assets/{Terminal-B7Zl0oMf.js => Terminal-C_XnInql.js} | 4 ++-- frontend/dist/assets/{Test-CYQzPSaa.js => Test-Dr6o2qpf.js} | 2 +- ...angeStepper-BGzUi9Jn.js => TimeRangeStepper-JPYSHI2J.js} | 2 +- .../{WorkspaceNav-ClxMgBhr.js => WorkspaceNav-BZrtCI1_.js} | 2 +- .../assets/{activity-BAV-4Rxi.js => activity-02b04F6Q.js} | 2 +- .../assets/{antenna-CpeQ5t_a.js => antenna-BUervkWx.js} | 2 +- .../{arrow-down-COuxy1kb.js => arrow-down-npn6XFzD.js} | 2 +- .../{arrow-right-C5Fuejc9.js => arrow-right-DDhVPQqL.js} | 2 +- .../assets/{arrow-up-BmXPNI2T.js => arrow-up-C1m6otp9.js} | 2 +- .../dist/assets/{backup-K6eA_iA5.js => backup-Zafc7Byp.js} | 2 +- frontend/dist/assets/{car-DRknVB1N.js => car-B1uDaAVL.js} | 2 +- .../{chat-utils-rMBLw-SJ.js => chat-utils-D8ZwjCT3.js} | 2 +- .../{check-check-CV8IAFCF.js => check-check-D7HV9aAg.js} | 2 +- .../{chevron-up-51iePx4b.js => chevron-up-CFeeYtPO.js} | 2 +- .../{circle-alert-D6qb8WSp.js => circle-alert-8MQex_uC.js} | 2 +- ...on-mark-BPKfem7i.js => circle-question-mark-EfmCIEVS.js} | 2 +- .../{circle-stop-DEeBh2xe.js => circle-stop-0gJGQm_q.js} | 2 +- .../dist/assets/{clock-DB7tKCHV.js => clock-DKukpMjT.js} | 2 +- .../assets/{compass-Dolk-EbB.js => compass-CPwUyboh.js} | 2 +- ...r-registry-Bsx-B9R6.js => consumer-registry-K46Bg-WH.js} | 2 +- .../assets/{database-BeT3SO6w.js => database-D8ZiJ_7E.js} | 2 +- .../dist/assets/{easing-rWsWG9jZ.js => easing-BV_uJNeb.js} | 2 +- ...nt-movement-SAlxPSM7.js => element-movement-rOMuf_3T.js} | 2 +- frontend/dist/assets/{eye-DQ-O4VIh.js => eye-Dc2SU7n8.js} | 2 +- .../assets/{fieldset-DJGo6TXB.js => fieldset-BJg_kfe0.js} | 2 +- .../assets/{floating-BAAXcOzg.js => floating-B9JazpOE.js} | 2 +- .../dist/assets/{frozen-TmAR4LIW.js => frozen-C1Yg1x_W.js} | 2 +- .../dist/assets/{funnel-CmniI8cB.js => funnel-0W7-MqFe.js} | 2 +- .../{git-branch-BIN5tJ3h.js => git-branch-BfTP80e2.js} | 2 +- frontend/dist/assets/{hash-Cs4BXjcy.js => hash-Ccz7W0IK.js} | 2 +- .../dist/assets/{index-R7zviCWb.js => index-Bfbz8_Ci.js} | 2 +- .../dist/assets/{index-CAHLMlrb.js => index-CdntfUUz.js} | 6 +++--- .../dist/assets/{index-1IIqkHes.js => index-tm_sy7-t.js} | 2 +- .../assets/{key-round-CZ_hGBwN.js => key-round-Cn-7B-WZ.js} | 2 +- .../dist/assets/{layer-DnHLn7Jx.js => layer-BRKnZ2f8.js} | 2 +- .../dist/assets/{layers-CU7un-PT.js => layers-80mLD98M.js} | 2 +- .../{link-scoring-CFJjEb_I.js => link-scoring-CnR8SbVy.js} | 2 +- .../assets/{listbox-DoXudQ3L.js => listbox-LgRZMHBN.js} | 2 +- .../{maintenance-C2rIkwgy.js => maintenance-DDkOUzHo.js} | 2 +- .../assets/{map-pin-CNePTCsc.js => map-pin-ADTzwr8W.js} | 2 +- .../{map-pin-off-Dtf3D6QW.js => map-pin-off-DdXFAKLD.js} | 2 +- .../{maplibre-gl-BkYzjH9W.js => maplibre-gl-ECl9hv9h.js} | 2 +- frontend/dist/assets/{max-D9Y_Gk4E.js => max-DUHCwm37.js} | 2 +- ...essage-square-B56EP67q.js => message-square-B7BGKpkr.js} | 2 +- ...are-text-BDbAHWCI.js => message-square-text-CaBiKUOL.js} | 2 +- ...martphone-DMj7GqcL.js => monitor-smartphone-X03XrJWF.js} | 2 +- .../assets/{network-DsulLblE.js => network-TeIBnbEp.js} | 2 +- .../{node-types-CcH5BFf0.js => node-types-rkAZo2WA.js} | 2 +- ...ayload-detail-CniY19rz.js => payload-detail-D7dyXv-d.js} | 2 +- .../dist/assets/{pencil--wb87xjW.js => pencil-DwKQKROy.js} | 2 +- frontend/dist/assets/{ping-Chyw2B4c.js => ping-D6oK6s8c.js} | 2 +- frontend/dist/assets/{plus-Be4DsW2a.js => plus-BHawoJ76.js} | 2 +- .../{primitives-B7bSO4E3.js => primitives-Bl26dfm-.js} | 2 +- .../{radio-group-DyBWNwhI.js => radio-group-CSvEyiPf.js} | 2 +- .../dist/assets/{repeat-Dv_JF6au.js => repeat-CYHoMir3.js} | 2 +- .../{rotate-ccw-Cav5SApM.js => rotate-ccw-DyxXzFWc.js} | 2 +- .../assets/{rotate-cw-D7GjgDF3.js => rotate-cw-CKh-yYEC.js} | 2 +- .../dist/assets/{route-B8rlrav9.js => route-CeOQcqdX.js} | 2 +- .../assets/{satellite-DvRQ8hgk.js => satellite-DwUbYQYY.js} | 2 +- frontend/dist/assets/{save-HCcOmjKD.js => save-B0-dg8jU.js} | 2 +- .../dist/assets/{search-C1Hut7GR.js => search-D8B8LMYr.js} | 2 +- ...{setting-field-YD-YARg4.js => setting-field-BzKIre35.js} | 2 +- .../{settings-2-DgwT7JNL.js => settings-2-iRV0UHU5.js} | 2 +- .../dist/assets/{setup-DRFHoJbp.js => setup-CORoXz0f.js} | 2 +- .../assets/{share-2-DIHBn1T5.js => share-2-ceQyHw_t.js} | 2 +- .../dist/assets/{shield-CxlpbCLH.js => shield-CNxoSMJk.js} | 2 +- .../{shield-check-DX3QVGvb.js => shield-check-D7YYO1tX.js} | 2 +- .../assets/{sparkles-GhffQ44V.js => sparkles-CIoeyoky.js} | 2 +- .../dist/assets/{system-CNkSqdfb.js => system-MCOv6vDg.js} | 2 +- .../dist/assets/{target-CAfnTnyS.js => target-D6g_GBrY.js} | 2 +- .../{thermometer-_L_juB2l.js => thermometer-qsOxlDrM.js} | 2 +- .../dist/assets/{timer-DIDXOFnU.js => timer-nBNC7t-g.js} | 2 +- .../assets/{transport--H030bEh.js => transport-DmJP2zwT.js} | 2 +- .../assets/{trash-2-ChI2Sf6Z.js => trash-2-Ym16rcs6.js} | 2 +- .../dist/assets/{upload-N2aZrMEC.js => upload-D2RzW6Z5.js} | 2 +- ...comparator-JYMD8MzS.js => use-by-comparator-Dgy5yCaL.js} | 2 +- ...se-text-value-B1ySk7If.js => use-text-value-DFkKaUWL.js} | 2 +- ...-tree-walker-DIk49Ly7.js => use-tree-walker-DwujlxlX.js} | 2 +- ...MapViewStore-Dq-l5Xvs.js => useMapViewStore-Ciaw6Y-k.js} | 2 +- ...pelineStore-3uhIJZso.js => usePipelineStore-B9TPEPcv.js} | 6 +++--- ...{useReplayTick-Cnehmp7d.js => useReplayTick-C7ZhPZyZ.js} | 2 +- .../assets/{variants-DqP1b_He.js => variants-Bez4f_xY.js} | 2 +- ...{wand-sparkles-C18LiNtQ.js => wand-sparkles-By2ieoA5.js} | 2 +- .../dist/assets/{waves-BgBEByoN.js => waves-C19BgMIP.js} | 2 +- ...BMYpnS-Ch-WmeRM.js => webgl-device-QoBMYpnS-DeOuNIG2.js} | 2 +- frontend/dist/assets/{wifi-veufKfwm.js => wifi-6W1pAdZl.js} | 2 +- .../assets/{wifi-off-D3oO89G-.js => wifi-off-BkS_iqlS.js} | 2 +- .../dist/assets/{wrench-laBkieDS.js => wrench-BDb_Mrbt.js} | 2 +- frontend/dist/assets/{zap-BraNZRWh.js => zap-BZEYLUfp.js} | 2 +- frontend/dist/index.html | 2 +- frontend/package.json | 2 +- 135 files changed, 153 insertions(+), 153 deletions(-) rename frontend/dist/assets/{AnalyzerFilterPanel-BpsoGf4o.js => AnalyzerFilterPanel-O22f461t.js} (97%) rename frontend/dist/assets/{AutoConfigureDialog-BAQ5UEr_.js => AutoConfigureDialog-I0jHfgv3.js} (98%) rename frontend/dist/assets/{BackupRestore-CM11c75S.js => BackupRestore-D2lKmevY.js} (95%) rename frontend/dist/assets/{BasemapLayer-VyMOdkaO.js => BasemapLayer-U4r1eipM.js} (98%) rename frontend/dist/assets/{CADCalibration-DOpFISap.js => CADCalibration-DeM92vih.js} (96%) rename frontend/dist/assets/{ChatBubble-Cn1oh8mi.js => ChatBubble-BXwtJZuf.js} (97%) rename frontend/dist/assets/{CollisionExplorerModal-Y5-HwcN-.js => CollisionExplorerModal-brcQ7JMt.js} (96%) rename frontend/dist/assets/{Companion-B40Pf-xY.js => Companion-Dku9E7ui.js} (98%) rename frontend/dist/assets/{CompanionEchoMap-UK4pMkKr.js => CompanionEchoMap-Dx-5FVVv.js} (94%) rename frontend/dist/assets/{CompanionPathMap-ChNL_sj-.js => CompanionPathMap-Cld9nrKm.js} (96%) rename frontend/dist/assets/{Configuration-DfbJ8nZk.js => Configuration-aUhduX2Z.js} (98%) rename frontend/dist/assets/{ConfirmModal-CNagQaWr.js => ConfirmModal-CB8xdBeW.js} (91%) rename frontend/dist/assets/{Contacts-COjtGvyY.js => Contacts-DiQfIa8j.js} (90%) rename frontend/dist/assets/{ContactsMapMapLibre-DuT85Ji5.js => ContactsMapMapLibre-BcJVpNZZ.js} (99%) rename frontend/dist/assets/{Dashboard-Dt57NbQx.js => Dashboard-1WPD5yy7.js} (97%) rename frontend/dist/assets/{DataValue-B6B0O-xC.js => DataValue-Cy2BSezA.js} (91%) rename frontend/dist/assets/{DatabaseManagement-BQJZp4p1.js => DatabaseManagement-DhltIlKH.js} (93%) rename frontend/dist/assets/{GPSDiagnostics-Cye-Trgs.js => GPSDiagnostics-CYzRkIGF.js} (99%) rename frontend/dist/assets/{Grid-B0tNiHTX.js => Grid-DYtN9_Hv.js} (95%) rename frontend/dist/assets/{KeycapButton-BDWyVW37.js => KeycapButton-BJZjnt_-.js} (98%) rename frontend/dist/assets/{LightSparkline-g9bCtOHr.js => LightSparkline-B-EJJe6x.js} (96%) rename frontend/dist/assets/{Login-BqiBbXZ3.js => Login-B9-_of-X.js} (99%) rename frontend/dist/assets/{Logs-DJM49UnJ.js => Logs-D0FIyBRm.js} (97%) rename frontend/dist/assets/{MemoryDebug-hHFx3BHO.js => MemoryDebug-SZdlepUQ.js} (97%) rename frontend/dist/assets/{MeshGraph-C36tfydu.js => MeshGraph-wRRLz_lr.js} (99%) rename frontend/dist/assets/{Mqtt-CkgupwWU.js => Mqtt-m3-rjLC-.js} (98%) rename frontend/dist/assets/{MqttModeBadge-OPtXzakb.js => MqttModeBadge-2hTXq31i.js} (92%) rename frontend/dist/assets/{Observer-CWD4jATj.js => Observer-VP_bsWv3.js} (96%) rename frontend/dist/assets/{PacketList-ODK5IJ9o.js => PacketList-CyBre3jR.js} (98%) rename frontend/dist/assets/{PacketObservatory-Cf7m4kGK.js => PacketObservatory-B6q6lK8q.js} (99%) rename frontend/dist/assets/{Packets-Cs9Zwu9d.js => Packets-DfuElOK2.js} (95%) rename frontend/dist/assets/{PageLayout-CgrNSpBT.js => PageLayout-B2kQpvXM.js} (95%) rename frontend/dist/assets/{PathMapMapLibre-DNpNVjSn.js => PathMapMapLibre-7vuAz1d6.js} (96%) rename frontend/dist/assets/{PolicyEngine-Bt5hUbRJ.js => PolicyEngine-CFwki3sb.js} (97%) rename frontend/dist/assets/{RadioHardware-DhH_OAdl.js => RadioHardware-D1iA7IMw.js} (96%) rename frontend/dist/assets/{RfHealthCorrelation-Bjlu541K.js => RfHealthCorrelation-DoZNDUke.js} (95%) rename frontend/dist/assets/{RoomServer-DrChSCH0.js => RoomServer-D9PWmBB1.js} (96%) rename frontend/dist/assets/{Sensors-insTPzAw.js => Sensors-qNNEac7h.js} (97%) rename frontend/dist/assets/{Sessions-6Pz1fhab.js => Sessions-CZL0vFpY.js} (96%) rename frontend/dist/assets/{Setup-_swGk22g.js => Setup-Bzvgo-0b.js} (94%) rename frontend/dist/assets/{SignalIndicator-BN0oxyDe.js => SignalIndicator-CKCIivNj.js} (99%) rename frontend/dist/assets/{Statistics-DJlDW6-R.js => Statistics-D1pZrkmX.js} (98%) rename frontend/dist/assets/{System-D3XTlAJj.js => System-C5DE1LLo.js} (98%) rename frontend/dist/assets/{Terminal-B7Zl0oMf.js => Terminal-C_XnInql.js} (99%) rename frontend/dist/assets/{Test-CYQzPSaa.js => Test-Dr6o2qpf.js} (99%) rename frontend/dist/assets/{TimeRangeStepper-BGzUi9Jn.js => TimeRangeStepper-JPYSHI2J.js} (98%) rename frontend/dist/assets/{WorkspaceNav-ClxMgBhr.js => WorkspaceNav-BZrtCI1_.js} (99%) rename frontend/dist/assets/{activity-BAV-4Rxi.js => activity-02b04F6Q.js} (89%) rename frontend/dist/assets/{antenna-CpeQ5t_a.js => antenna-BUervkWx.js} (91%) rename frontend/dist/assets/{arrow-down-COuxy1kb.js => arrow-down-npn6XFzD.js} (86%) rename frontend/dist/assets/{arrow-right-C5Fuejc9.js => arrow-right-DDhVPQqL.js} (86%) rename frontend/dist/assets/{arrow-up-BmXPNI2T.js => arrow-up-C1m6otp9.js} (86%) rename frontend/dist/assets/{backup-K6eA_iA5.js => backup-Zafc7Byp.js} (79%) rename frontend/dist/assets/{car-DRknVB1N.js => car-B1uDaAVL.js} (92%) rename frontend/dist/assets/{chat-utils-rMBLw-SJ.js => chat-utils-D8ZwjCT3.js} (97%) rename frontend/dist/assets/{check-check-CV8IAFCF.js => check-check-D7HV9aAg.js} (88%) rename frontend/dist/assets/{chevron-up-51iePx4b.js => chevron-up-CFeeYtPO.js} (99%) rename frontend/dist/assets/{circle-alert-D6qb8WSp.js => circle-alert-8MQex_uC.js} (90%) rename frontend/dist/assets/{circle-question-mark-BPKfem7i.js => circle-question-mark-EfmCIEVS.js} (89%) rename frontend/dist/assets/{circle-stop-DEeBh2xe.js => circle-stop-0gJGQm_q.js} (94%) rename frontend/dist/assets/{clock-DB7tKCHV.js => clock-DKukpMjT.js} (87%) rename frontend/dist/assets/{compass-Dolk-EbB.js => compass-CPwUyboh.js} (89%) rename frontend/dist/assets/{consumer-registry-Bsx-B9R6.js => consumer-registry-K46Bg-WH.js} (92%) rename frontend/dist/assets/{database-BeT3SO6w.js => database-D8ZiJ_7E.js} (90%) rename frontend/dist/assets/{easing-rWsWG9jZ.js => easing-BV_uJNeb.js} (57%) rename frontend/dist/assets/{element-movement-SAlxPSM7.js => element-movement-rOMuf_3T.js} (97%) rename frontend/dist/assets/{eye-DQ-O4VIh.js => eye-Dc2SU7n8.js} (89%) rename frontend/dist/assets/{fieldset-DJGo6TXB.js => fieldset-BJg_kfe0.js} (80%) rename frontend/dist/assets/{floating-BAAXcOzg.js => floating-B9JazpOE.js} (99%) rename frontend/dist/assets/{frozen-TmAR4LIW.js => frozen-C1Yg1x_W.js} (78%) rename frontend/dist/assets/{funnel-CmniI8cB.js => funnel-0W7-MqFe.js} (90%) rename frontend/dist/assets/{git-branch-BIN5tJ3h.js => git-branch-BfTP80e2.js} (90%) rename frontend/dist/assets/{hash-Cs4BXjcy.js => hash-Ccz7W0IK.js} (91%) rename frontend/dist/assets/{index-R7zviCWb.js => index-Bfbz8_Ci.js} (98%) rename frontend/dist/assets/{index-CAHLMlrb.js => index-CdntfUUz.js} (99%) rename frontend/dist/assets/{index-1IIqkHes.js => index-tm_sy7-t.js} (98%) rename frontend/dist/assets/{key-round-CZ_hGBwN.js => key-round-Cn-7B-WZ.js} (92%) rename frontend/dist/assets/{layer-DnHLn7Jx.js => layer-BRKnZ2f8.js} (95%) rename frontend/dist/assets/{layers-CU7un-PT.js => layers-80mLD98M.js} (92%) rename frontend/dist/assets/{link-scoring-CFJjEb_I.js => link-scoring-CnR8SbVy.js} (94%) rename frontend/dist/assets/{listbox-DoXudQ3L.js => listbox-LgRZMHBN.js} (97%) rename frontend/dist/assets/{maintenance-C2rIkwgy.js => maintenance-DDkOUzHo.js} (90%) rename frontend/dist/assets/{map-pin-CNePTCsc.js => map-pin-ADTzwr8W.js} (89%) rename frontend/dist/assets/{map-pin-off-Dtf3D6QW.js => map-pin-off-DdXFAKLD.js} (93%) rename frontend/dist/assets/{maplibre-gl-BkYzjH9W.js => maplibre-gl-ECl9hv9h.js} (99%) rename frontend/dist/assets/{max-D9Y_Gk4E.js => max-DUHCwm37.js} (99%) rename frontend/dist/assets/{message-square-B56EP67q.js => message-square-B7BGKpkr.js} (90%) rename frontend/dist/assets/{message-square-text-BDbAHWCI.js => message-square-text-CaBiKUOL.js} (92%) rename frontend/dist/assets/{monitor-smartphone-DMj7GqcL.js => monitor-smartphone-X03XrJWF.js} (92%) rename frontend/dist/assets/{network-DsulLblE.js => network-TeIBnbEp.js} (92%) rename frontend/dist/assets/{node-types-CcH5BFf0.js => node-types-rkAZo2WA.js} (95%) rename frontend/dist/assets/{payload-detail-CniY19rz.js => payload-detail-D7dyXv-d.js} (97%) rename frontend/dist/assets/{pencil--wb87xjW.js => pencil-DwKQKROy.js} (90%) rename frontend/dist/assets/{ping-Chyw2B4c.js => ping-D6oK6s8c.js} (95%) rename frontend/dist/assets/{plus-Be4DsW2a.js => plus-BHawoJ76.js} (87%) rename frontend/dist/assets/{primitives-B7bSO4E3.js => primitives-Bl26dfm-.js} (99%) rename frontend/dist/assets/{radio-group-DyBWNwhI.js => radio-group-CSvEyiPf.js} (98%) rename frontend/dist/assets/{repeat-Dv_JF6au.js => repeat-CYHoMir3.js} (91%) rename frontend/dist/assets/{rotate-ccw-Cav5SApM.js => rotate-ccw-DyxXzFWc.js} (89%) rename frontend/dist/assets/{rotate-cw-D7GjgDF3.js => rotate-cw-CKh-yYEC.js} (88%) rename frontend/dist/assets/{route-B8rlrav9.js => route-CeOQcqdX.js} (94%) rename frontend/dist/assets/{satellite-DvRQ8hgk.js => satellite-DwUbYQYY.js} (94%) rename frontend/dist/assets/{save-HCcOmjKD.js => save-B0-dg8jU.js} (91%) rename frontend/dist/assets/{search-C1Hut7GR.js => search-D8B8LMYr.js} (87%) rename frontend/dist/assets/{setting-field-YD-YARg4.js => setting-field-BzKIre35.js} (98%) rename frontend/dist/assets/{settings-2-DgwT7JNL.js => settings-2-iRV0UHU5.js} (89%) rename frontend/dist/assets/{setup-DRFHoJbp.js => setup-CORoXz0f.js} (88%) rename frontend/dist/assets/{share-2-DIHBn1T5.js => share-2-ceQyHw_t.js} (91%) rename frontend/dist/assets/{shield-CxlpbCLH.js => shield-CNxoSMJk.js} (91%) rename frontend/dist/assets/{shield-check-DX3QVGvb.js => shield-check-D7YYO1tX.js} (92%) rename frontend/dist/assets/{sparkles-GhffQ44V.js => sparkles-CIoeyoky.js} (93%) rename frontend/dist/assets/{system-CNkSqdfb.js => system-MCOv6vDg.js} (69%) rename frontend/dist/assets/{target-CAfnTnyS.js => target-D6g_GBrY.js} (88%) rename frontend/dist/assets/{thermometer-_L_juB2l.js => thermometer-qsOxlDrM.js} (88%) rename frontend/dist/assets/{timer-DIDXOFnU.js => timer-nBNC7t-g.js} (90%) rename frontend/dist/assets/{transport--H030bEh.js => transport-DmJP2zwT.js} (92%) rename frontend/dist/assets/{trash-2-ChI2Sf6Z.js => trash-2-Ym16rcs6.js} (91%) rename frontend/dist/assets/{upload-N2aZrMEC.js => upload-D2RzW6Z5.js} (89%) rename frontend/dist/assets/{use-by-comparator-JYMD8MzS.js => use-by-comparator-Dgy5yCaL.js} (80%) rename frontend/dist/assets/{use-text-value-B1ySk7If.js => use-text-value-DFkKaUWL.js} (93%) rename frontend/dist/assets/{use-tree-walker-DIk49Ly7.js => use-tree-walker-DwujlxlX.js} (84%) rename frontend/dist/assets/{useMapViewStore-Dq-l5Xvs.js => useMapViewStore-Ciaw6Y-k.js} (97%) rename frontend/dist/assets/{usePipelineStore-3uhIJZso.js => usePipelineStore-B9TPEPcv.js} (98%) rename frontend/dist/assets/{useReplayTick-Cnehmp7d.js => useReplayTick-C7ZhPZyZ.js} (97%) rename frontend/dist/assets/{variants-DqP1b_He.js => variants-Bez4f_xY.js} (95%) rename frontend/dist/assets/{wand-sparkles-C18LiNtQ.js => wand-sparkles-By2ieoA5.js} (93%) rename frontend/dist/assets/{waves-BgBEByoN.js => waves-C19BgMIP.js} (92%) rename frontend/dist/assets/{webgl-device-QoBMYpnS-Ch-WmeRM.js => webgl-device-QoBMYpnS-DeOuNIG2.js} (99%) rename frontend/dist/assets/{wifi-veufKfwm.js => wifi-6W1pAdZl.js} (91%) rename frontend/dist/assets/{wifi-off-D3oO89G-.js => wifi-off-BkS_iqlS.js} (93%) rename frontend/dist/assets/{wrench-laBkieDS.js => wrench-BDb_Mrbt.js} (90%) rename frontend/dist/assets/{zap-BraNZRWh.js => zap-BZEYLUfp.js} (89%) diff --git a/frontend/dist/VERSION b/frontend/dist/VERSION index 4f695a7b..476f51d7 100644 --- a/frontend/dist/VERSION +++ b/frontend/dist/VERSION @@ -1 +1 @@ -0.9.341 +0.9.342 diff --git a/frontend/dist/assets/AnalyzerFilterPanel-BpsoGf4o.js b/frontend/dist/assets/AnalyzerFilterPanel-O22f461t.js similarity index 97% rename from frontend/dist/assets/AnalyzerFilterPanel-BpsoGf4o.js rename to frontend/dist/assets/AnalyzerFilterPanel-O22f461t.js index 6fb067e6..90cbb182 100644 --- a/frontend/dist/assets/AnalyzerFilterPanel-BpsoGf4o.js +++ b/frontend/dist/assets/AnalyzerFilterPanel-O22f461t.js @@ -1,4 +1,4 @@ -import{e as q,d3 as G,at as Q,R as V,cy as Y,z as J,r as i,j as n,bO as X,B as Z,N as W,cL as ee}from"./index-CAHLMlrb.js";import{c as te}from"./node-types-CcH5BFf0.js";import{M as se}from"./monitor-smartphone-DMj7GqcL.js";import{C as ne}from"./circle-question-mark-BPKfem7i.js";import{F as oe}from"./funnel-CmniI8cB.js";import{S as re}from"./search-C1Hut7GR.js";/** +import{e as q,d3 as G,at as Q,R as V,cy as Y,z as J,r as i,j as n,bO as X,B as Z,N as W,cL as ee}from"./index-CdntfUUz.js";import{c as te}from"./node-types-rkAZo2WA.js";import{M as se}from"./monitor-smartphone-X03XrJWF.js";import{C as ne}from"./circle-question-mark-EfmCIEVS.js";import{F as oe}from"./funnel-0W7-MqFe.js";import{S as re}from"./search-D8B8LMYr.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/AutoConfigureDialog-BAQ5UEr_.js b/frontend/dist/assets/AutoConfigureDialog-I0jHfgv3.js similarity index 98% rename from frontend/dist/assets/AutoConfigureDialog-BAQ5UEr_.js rename to frontend/dist/assets/AutoConfigureDialog-I0jHfgv3.js index 4b62116d..bbd571ca 100644 --- a/frontend/dist/assets/AutoConfigureDialog-BAQ5UEr_.js +++ b/frontend/dist/assets/AutoConfigureDialog-I0jHfgv3.js @@ -1 +1 @@ -import{r as y,eq as K,j as e,f as X,R as Z,c8 as M,cy as J,dy as U,eJ as ee,aB as ae,aL as se,aC as te,a9 as V,b_ as ne,B as S,c as N,aE as le}from"./index-CAHLMlrb.js";import{C as ie}from"./PageLayout-CgrNSpBT.js";import{M as G}from"./monitor-smartphone-DMj7GqcL.js";import{W as re}from"./wand-sparkles-C18LiNtQ.js";import{A as oe}from"./arrow-right-C5Fuejc9.js";const ce={0:"1-byte",1:"2-byte",2:"3-byte"};function de(s){return ce[s]??`${s+1}-byte`}function ge({nodeName:s,publicKey:a,pathHashMode:o,compact:i=!1}){const[l,m]=y.useState(null),[c,h]=y.useState(null);y.useEffect(()=>{let n=!1;return(async()=>{try{const u=await K();if(n)return;if(u.success&&u.data){const _=u.data;m(Array.isArray(_.configured)?_.configured:[]),h(Array.isArray(_.configured_companions)?_.configured_companions:[])}}catch{}})(),()=>{n=!0}},[]);const f=n=>{var u;return((u=n.settings)==null?void 0:u.node_name)||n.name};return e.jsxs(ie,{neomorphic:!0,compact:i,children:[e.jsx(X,{icon:e.jsx(Z,{}),title:"Node Information",className:i?"mb-2":void 0}),e.jsxs("div",{className:`grid grid-cols-1 sm:grid-cols-3 ${i?"gap-3 sm:gap-4":"gap-4 sm:gap-6"}`,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Repeater Name"}),e.jsx("div",{className:`mt-0.5 sm:mt-1 ${i?"space-y-1":"space-y-2"}`,children:e.jsxs("div",{children:[e.jsx("p",{className:"type-data text-fg-primary truncate font-mono",title:s,children:s}),a&&e.jsx("div",{className:"mt-1 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:a})})]})}),o!=null&&e.jsxs("div",{className:i?"mt-2":"mt-4",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Path Hash Size"}),e.jsx("p",{className:"type-data text-fg-primary mt-0.5 font-mono",children:de(o)})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Room Servers"}),e.jsx("div",{className:`mt-0.5 sm:mt-1 ${i?"space-y-1":"space-y-2"}`,children:l===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):l.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):l.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:f(n),children:f(n)})]}),(n.public_key||n.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:n.public_key||n.identity_key})})]},n.name))})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Companions"}),e.jsx("div",{className:`mt-0.5 sm:mt-1 ${i?"space-y-1":"space-y-2"}`,children:c===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):c.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(G,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):c.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(G,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:f(n),children:f(n)})]}),(n.public_key||n.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:n.public_key||n.identity_key})})]},n.name))})]})]})]})}const k=168,w={sparse:50,light:200,moderate:500,dense:1e3},me={sparse:{bucketCapacity:3,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:15,violationThreshold:2,basePenaltyMinutes:30,penaltyMultiplier:2,maxPenaltyHours:12,violationDecayHours:2,ewmaAlpha:.15,hysteresisMinutes:8},light:{bucketCapacity:2,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:20,violationThreshold:2,basePenaltyMinutes:60,penaltyMultiplier:3,maxPenaltyHours:24,violationDecayHours:2,ewmaAlpha:.12,hysteresisMinutes:6},moderate:{bucketCapacity:2,refillTokens:1,refillIntervalHours:2,minIntervalSeconds:30,violationThreshold:1,basePenaltyMinutes:120,penaltyMultiplier:4,maxPenaltyHours:48,violationDecayHours:4,ewmaAlpha:.1,hysteresisMinutes:5},dense:{bucketCapacity:1,refillTokens:1,refillIntervalHours:4,minIntervalSeconds:60,violationThreshold:1,basePenaltyMinutes:180,penaltyMultiplier:4,maxPenaltyHours:72,violationDecayHours:6,ewmaAlpha:.08,hysteresisMinutes:3},congested:{bucketCapacity:1,refillTokens:1,refillIntervalHours:8,minIntervalSeconds:120,violationThreshold:1,basePenaltyMinutes:360,penaltyMultiplier:4,maxPenaltyHours:168,violationDecayHours:12,ewmaAlpha:.03,hysteresisMinutes:2}};function pe(s){return sr.type===4))==null?void 0:u.count)??0,i=a.drop_reasons??[],l=((_=i.find(r=>r.reason==="advert rate limit exceeded"))==null?void 0:_.count)??0,m=i.filter(r=>r.reason.startsWith("advert penalty box")).reduce((r,d)=>r+d.count,0),c=((b=i.find(r=>r.reason==="Duplicate"))==null?void 0:b.count)??0;let h=0;try{const r=await U("/api/advert_rate_limit_stats");r.success&&r.data&&(h=r.data.tracked_pubkeys??Object.keys(r.data.bucket_states??{}).length)}catch{h=Math.max(1,Math.round(o/k/12))}const f=a.total_packets/k,n=o/k;return{hours:k,totalPackets:a.total_packets,transmittedPackets:a.transmitted_packets,droppedPackets:a.dropped_packets,packetsPerHour:f,advertsPerHour:n,advertPercent:a.total_packets>0?o/a.total_packets*100:0,advertCount:o,trackedSources:Math.max(1,h),advertsPerSourcePerHour:n/Math.max(1,h),rateLimitDrops:l,penaltyBoxDrops:m,duplicateDrops:c,meshDensity:pe(f)}}function ue(s){const a=me[s.meshDensity],o=s.packetsPerHour/60,i=Math.max(.01,B(o*.2)),l=Math.max(i+.01,B(o*.5)),m=Math.max(l+.01,B(o*.9));return{tokenBucket:{enabled:!0,bucket_capacity:a.bucketCapacity,refill_tokens:a.refillTokens,refill_interval_seconds:a.refillIntervalHours*3600,min_interval_seconds:a.minIntervalSeconds},penaltyBox:{enabled:!0,violation_threshold:a.violationThreshold,base_penalty_seconds:a.basePenaltyMinutes*60,penalty_multiplier:a.penaltyMultiplier,max_penalty_seconds:a.maxPenaltyHours*3600,violation_decay_seconds:a.violationDecayHours*3600},adaptive:{enabled:!0,ewma_alpha:a.ewmaAlpha,hysteresis_seconds:a.hysteresisMinutes*60,thresholds:{quiet_max:i,normal_max:l,busy_max:m}}}}async function ye(s){const a=await xe(),o=ue(a);return{analysis:a,recommended:o,current:{tokenBucket:s.tokenBucket??null,penaltyBox:s.penaltyBox??null,adaptive:s.adaptive??null}}}function B(s){return Math.round(s*100)/100}function g(s){if(s<60)return`${s}s`;if(s<3600)return`${Math.floor(s/60)}m`;const a=s/3600;return a===Math.floor(a)?`${a}h`:`${a.toFixed(1)}h`}function A(s){return s.toLocaleString(void 0,{maximumFractionDigits:1})}const he={sparse:"Sparse",light:"Light",moderate:"Moderate",dense:"Dense",congested:"Congested"},fe={sparse:"text-sys-green",light:"text-sys-cyan",moderate:"text-sys-blue",dense:"text-sys-amber",congested:"text-sys-red"},Ne={rate_limit_enabled:!1,bucket_capacity:10,refill_tokens:5,refill_interval_seconds:3600,min_interval_seconds:0,penalty_enabled:!1,violation_threshold:5,base_penalty_seconds:1800,penalty_multiplier:2,max_penalty_seconds:86400,violation_decay_seconds:21600,adaptive_enabled:!1,ewma_alpha:.1,hysteresis_seconds:300,quiet_max:2,normal_max:6,busy_max:10},Se=["rate_limit_enabled","bucket_capacity","refill_tokens","refill_interval_seconds","min_interval_seconds","penalty_enabled","violation_threshold","base_penalty_seconds","penalty_multiplier","max_penalty_seconds","violation_decay_seconds","adaptive_enabled","ewma_alpha","hysteresis_seconds","quiet_max","normal_max","busy_max"];function C({title:s,enabled:a,defaultOpen:o=!1,children:i}){const[l,m]=y.useState(o);return e.jsxs("div",{className:"bg-subtle-fill radius-inner overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>m(!l),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-subtle-fill-hover transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:s}),e.jsx("span",{className:N("type-data-xs px-1.5 py-0.5 rounded-full font-medium uppercase tracking-wide",a?"bg-sys-green/15 text-sys-green":"bg-sys-red/15 text-sys-red"),children:a?"On":"Off"})]}),e.jsx(le,{className:N("w-4 h-4 text-fg-muted transition-transform",l&&"rotate-180")})]}),l&&e.jsx("div",{className:"px-4 pb-4 pt-1 space-y-1",children:i})]})}function x({label:s,current:a,recommended:o,format:i=l=>String(l)}){const l=a!=null?i(a):"—",m=i(o),c=a!=null&&l!==m;return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-1",children:[e.jsx("span",{className:"type-body-sm text-fg-muted flex-1 min-w-0 truncate",children:s}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("span",{className:N("data-box data-box-compact",c?"text-fg-muted line-through opacity-60":"text-fg-secondary"),children:l}),c&&e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{className:"data-box data-box-compact text-sys-blue font-medium",children:m})]})]})]})}function we({open:s,onClose:a,currentConfig:o,onApplied:i}){var D,H,P,T,I,R,L,E,$,z,F,O,q,Y;const[l,m]=y.useState("idle"),[c,h]=y.useState(null),[f,n]=y.useState(null),u=y.useCallback(async()=>{m("analyzing"),n(null);try{const t=await ye(o);h(t),m("ready")}catch(t){n(t instanceof Error?t.message:"Analysis failed"),m("error")}},[o]),_=y.useCallback(async()=>{if(!c)return;m("applying"),n(null);const{tokenBucket:t,penaltyBox:v,adaptive:j}=c.recommended,Q={rate_limit_enabled:t.enabled,bucket_capacity:t.bucket_capacity,refill_tokens:t.refill_tokens,refill_interval_seconds:t.refill_interval_seconds,min_interval_seconds:t.min_interval_seconds,penalty_enabled:v.enabled,violation_threshold:v.violation_threshold,base_penalty_seconds:v.base_penalty_seconds,penalty_multiplier:v.penalty_multiplier,max_penalty_seconds:v.max_penalty_seconds,violation_decay_seconds:v.violation_decay_seconds,adaptive_enabled:j.enabled,ewma_alpha:j.ewma_alpha,hysteresis_seconds:j.hysteresis_seconds,quiet_max:j.thresholds.quiet_max,normal_max:j.thresholds.normal_max,busy_max:j.thresholds.busy_max};try{const W=await ee(Q);W.success?(m("applied"),i==null||i()):(n(W.error||"Failed to apply settings"),m("error"))}catch{n("Failed to apply settings"),m("error")}},[c,i]),b=y.useCallback(()=>{a(),setTimeout(()=>{m("idle"),h(null),n(null)},300)},[a]);s&&l==="idle"&&u();const r=c==null?void 0:c.analysis,d=c==null?void 0:c.recommended,p=c==null?void 0:c.current;return e.jsxs(ae,{open:s,onClose:b,size:"lg",children:[e.jsx(se,{icon:e.jsx(re,{size:20}),title:"Auto-Configure",onClose:b}),e.jsxs(te,{className:"flex flex-col gap-5 max-h-[70vh] overflow-y-auto",children:[l==="analyzing"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12",children:[e.jsx(V,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Analyzing 7 days of mesh traffic…"})]}),l==="error"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8",children:[e.jsx(ne,{className:"w-6 h-6 text-sys-amber"}),e.jsx("p",{className:"type-body-sm text-fg-secondary",children:f}),e.jsx(S,{plain:!0,onClick:u,className:"text-sys-blue",children:"Retry"})]}),(l==="ready"||l==="applying"||l==="applied")&&r&&d&&p&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("div",{className:"type-micro mb-3",children:"7-DAY ANALYSIS"}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Pkts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(r.packetsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Adverts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(r.advertsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Sources"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:r.trackedSources})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Density"}),e.jsx("div",{className:N("data-box data-box-fill data-box-left",fe[r.meshDensity]),children:he[r.meshDensity]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(C,{title:"Token Bucket of Shame",enabled:d.tokenBucket.enabled,defaultOpen:!0,children:[e.jsx(x,{label:"Bucket Capacity",current:(D=p.tokenBucket)==null?void 0:D.bucket_capacity,recommended:d.tokenBucket.bucket_capacity,format:t=>`${t} tokens`}),e.jsx(x,{label:"Refill Tokens",current:(H=p.tokenBucket)==null?void 0:H.refill_tokens,recommended:d.tokenBucket.refill_tokens,format:t=>`${t} tokens`}),e.jsx(x,{label:"Refill Interval",current:(P=p.tokenBucket)==null?void 0:P.refill_interval_seconds,recommended:d.tokenBucket.refill_interval_seconds,format:t=>g(t)}),e.jsx(x,{label:"Min Interval",current:(T=p.tokenBucket)==null?void 0:T.min_interval_seconds,recommended:d.tokenBucket.min_interval_seconds,format:t=>`${t}s`})]}),e.jsxs(C,{title:"Jail",enabled:d.penaltyBox.enabled,children:[e.jsx(x,{label:"Violation Threshold",current:(I=p.penaltyBox)==null?void 0:I.violation_threshold,recommended:d.penaltyBox.violation_threshold,format:t=>`${t} violations`}),e.jsx(x,{label:"Base Penalty",current:(R=p.penaltyBox)==null?void 0:R.base_penalty_seconds,recommended:d.penaltyBox.base_penalty_seconds,format:t=>g(t)}),e.jsx(x,{label:"Multiplier",current:(L=p.penaltyBox)==null?void 0:L.penalty_multiplier,recommended:d.penaltyBox.penalty_multiplier,format:t=>`${t}×`}),e.jsx(x,{label:"Max Penalty",current:(E=p.penaltyBox)==null?void 0:E.max_penalty_seconds,recommended:d.penaltyBox.max_penalty_seconds,format:t=>g(t)}),e.jsx(x,{label:"Violation Decay",current:($=p.penaltyBox)==null?void 0:$.violation_decay_seconds,recommended:d.penaltyBox.violation_decay_seconds,format:t=>g(t)})]}),e.jsxs(C,{title:"Adaptive Tiers",enabled:d.adaptive.enabled,children:[e.jsx(x,{label:"EWMA α",current:(z=p.adaptive)==null?void 0:z.ewma_alpha,recommended:d.adaptive.ewma_alpha}),e.jsx(x,{label:"Hysteresis",current:(F=p.adaptive)==null?void 0:F.hysteresis_seconds,recommended:d.adaptive.hysteresis_seconds,format:t=>g(t)}),e.jsx(x,{label:"Quiet Max",current:(O=p.adaptive)==null?void 0:O.thresholds.quiet_max,recommended:d.adaptive.thresholds.quiet_max,format:t=>`${t} pkts/min`}),e.jsx(x,{label:"Normal Max",current:(q=p.adaptive)==null?void 0:q.thresholds.normal_max,recommended:d.adaptive.thresholds.normal_max,format:t=>`${t} pkts/min`}),e.jsx(x,{label:"Busy Max",current:(Y=p.adaptive)==null?void 0:Y.thresholds.busy_max,recommended:d.adaptive.thresholds.busy_max,format:t=>`${t} pkts/min`})]})]}),e.jsxs("div",{className:N("flex justify-between gap-4 pt-1",l==="applied"?"items-center":"items-end"),children:[l==="applied"?e.jsx("span",{className:"type-body-sm text-zinc-500",children:"Settings applied"}):e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Analyzed"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[A(r.totalPackets)," packets"]})]}),e.jsx("div",{className:"flex items-center gap-2",children:l==="applied"?e.jsx(S,{color:"primary",onClick:b,children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(S,{plain:!0,onClick:b,children:"Cancel"}),e.jsx(S,{color:"primary",onClick:_,disabled:l==="applying",children:l==="applying"?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 animate-spin"}),"Applying…"]}):"Apply All"})]})})]})]})]})]})}export{we as A,ge as N,Ne as S,Se as a}; +import{r as y,eq as K,j as e,f as X,R as Z,c8 as M,cy as J,dy as U,eJ as ee,aB as ae,aL as se,aC as te,a9 as V,b_ as ne,B as S,c as N,aE as le}from"./index-CdntfUUz.js";import{C as ie}from"./PageLayout-B2kQpvXM.js";import{M as G}from"./monitor-smartphone-X03XrJWF.js";import{W as re}from"./wand-sparkles-By2ieoA5.js";import{A as oe}from"./arrow-right-DDhVPQqL.js";const ce={0:"1-byte",1:"2-byte",2:"3-byte"};function de(s){return ce[s]??`${s+1}-byte`}function ge({nodeName:s,publicKey:a,pathHashMode:o,compact:i=!1}){const[l,m]=y.useState(null),[c,h]=y.useState(null);y.useEffect(()=>{let n=!1;return(async()=>{try{const u=await K();if(n)return;if(u.success&&u.data){const _=u.data;m(Array.isArray(_.configured)?_.configured:[]),h(Array.isArray(_.configured_companions)?_.configured_companions:[])}}catch{}})(),()=>{n=!0}},[]);const f=n=>{var u;return((u=n.settings)==null?void 0:u.node_name)||n.name};return e.jsxs(ie,{neomorphic:!0,compact:i,children:[e.jsx(X,{icon:e.jsx(Z,{}),title:"Node Information",className:i?"mb-2":void 0}),e.jsxs("div",{className:`grid grid-cols-1 sm:grid-cols-3 ${i?"gap-3 sm:gap-4":"gap-4 sm:gap-6"}`,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Repeater Name"}),e.jsx("div",{className:`mt-0.5 sm:mt-1 ${i?"space-y-1":"space-y-2"}`,children:e.jsxs("div",{children:[e.jsx("p",{className:"type-data text-fg-primary truncate font-mono",title:s,children:s}),a&&e.jsx("div",{className:"mt-1 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:a})})]})}),o!=null&&e.jsxs("div",{className:i?"mt-2":"mt-4",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Path Hash Size"}),e.jsx("p",{className:"type-data text-fg-primary mt-0.5 font-mono",children:de(o)})]})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Room Servers"}),e.jsx("div",{className:`mt-0.5 sm:mt-1 ${i?"space-y-1":"space-y-2"}`,children:l===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):l.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):l.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:f(n),children:f(n)})]}),(n.public_key||n.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:n.public_key||n.identity_key})})]},n.name))})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-label text-fg-secondary",children:"Companions"}),e.jsx("div",{className:`mt-0.5 sm:mt-1 ${i?"space-y-1":"space-y-2"}`,children:c===null?e.jsx("span",{className:"type-data text-fg-muted",children:"—"}):c.length===0?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(G,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-muted",children:"None"})]}):c.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(G,{className:"w-3.5 h-3.5 text-sys-cyan flex-shrink-0"}),e.jsx("span",{className:"type-data text-fg-primary truncate",title:f(n),children:f(n)})]}),(n.public_key||n.identity_key)&&e.jsx("div",{className:"mt-1 pl-5 min-w-0",children:e.jsx(M,{copy:!0,truncate:"css",className:"w-full",size:"responsive",children:n.public_key||n.identity_key})})]},n.name))})]})]})]})}const k=168,w={sparse:50,light:200,moderate:500,dense:1e3},me={sparse:{bucketCapacity:3,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:15,violationThreshold:2,basePenaltyMinutes:30,penaltyMultiplier:2,maxPenaltyHours:12,violationDecayHours:2,ewmaAlpha:.15,hysteresisMinutes:8},light:{bucketCapacity:2,refillTokens:1,refillIntervalHours:1,minIntervalSeconds:20,violationThreshold:2,basePenaltyMinutes:60,penaltyMultiplier:3,maxPenaltyHours:24,violationDecayHours:2,ewmaAlpha:.12,hysteresisMinutes:6},moderate:{bucketCapacity:2,refillTokens:1,refillIntervalHours:2,minIntervalSeconds:30,violationThreshold:1,basePenaltyMinutes:120,penaltyMultiplier:4,maxPenaltyHours:48,violationDecayHours:4,ewmaAlpha:.1,hysteresisMinutes:5},dense:{bucketCapacity:1,refillTokens:1,refillIntervalHours:4,minIntervalSeconds:60,violationThreshold:1,basePenaltyMinutes:180,penaltyMultiplier:4,maxPenaltyHours:72,violationDecayHours:6,ewmaAlpha:.08,hysteresisMinutes:3},congested:{bucketCapacity:1,refillTokens:1,refillIntervalHours:8,minIntervalSeconds:120,violationThreshold:1,basePenaltyMinutes:360,penaltyMultiplier:4,maxPenaltyHours:168,violationDecayHours:12,ewmaAlpha:.03,hysteresisMinutes:2}};function pe(s){return sr.type===4))==null?void 0:u.count)??0,i=a.drop_reasons??[],l=((_=i.find(r=>r.reason==="advert rate limit exceeded"))==null?void 0:_.count)??0,m=i.filter(r=>r.reason.startsWith("advert penalty box")).reduce((r,d)=>r+d.count,0),c=((b=i.find(r=>r.reason==="Duplicate"))==null?void 0:b.count)??0;let h=0;try{const r=await U("/api/advert_rate_limit_stats");r.success&&r.data&&(h=r.data.tracked_pubkeys??Object.keys(r.data.bucket_states??{}).length)}catch{h=Math.max(1,Math.round(o/k/12))}const f=a.total_packets/k,n=o/k;return{hours:k,totalPackets:a.total_packets,transmittedPackets:a.transmitted_packets,droppedPackets:a.dropped_packets,packetsPerHour:f,advertsPerHour:n,advertPercent:a.total_packets>0?o/a.total_packets*100:0,advertCount:o,trackedSources:Math.max(1,h),advertsPerSourcePerHour:n/Math.max(1,h),rateLimitDrops:l,penaltyBoxDrops:m,duplicateDrops:c,meshDensity:pe(f)}}function ue(s){const a=me[s.meshDensity],o=s.packetsPerHour/60,i=Math.max(.01,B(o*.2)),l=Math.max(i+.01,B(o*.5)),m=Math.max(l+.01,B(o*.9));return{tokenBucket:{enabled:!0,bucket_capacity:a.bucketCapacity,refill_tokens:a.refillTokens,refill_interval_seconds:a.refillIntervalHours*3600,min_interval_seconds:a.minIntervalSeconds},penaltyBox:{enabled:!0,violation_threshold:a.violationThreshold,base_penalty_seconds:a.basePenaltyMinutes*60,penalty_multiplier:a.penaltyMultiplier,max_penalty_seconds:a.maxPenaltyHours*3600,violation_decay_seconds:a.violationDecayHours*3600},adaptive:{enabled:!0,ewma_alpha:a.ewmaAlpha,hysteresis_seconds:a.hysteresisMinutes*60,thresholds:{quiet_max:i,normal_max:l,busy_max:m}}}}async function ye(s){const a=await xe(),o=ue(a);return{analysis:a,recommended:o,current:{tokenBucket:s.tokenBucket??null,penaltyBox:s.penaltyBox??null,adaptive:s.adaptive??null}}}function B(s){return Math.round(s*100)/100}function g(s){if(s<60)return`${s}s`;if(s<3600)return`${Math.floor(s/60)}m`;const a=s/3600;return a===Math.floor(a)?`${a}h`:`${a.toFixed(1)}h`}function A(s){return s.toLocaleString(void 0,{maximumFractionDigits:1})}const he={sparse:"Sparse",light:"Light",moderate:"Moderate",dense:"Dense",congested:"Congested"},fe={sparse:"text-sys-green",light:"text-sys-cyan",moderate:"text-sys-blue",dense:"text-sys-amber",congested:"text-sys-red"},Ne={rate_limit_enabled:!1,bucket_capacity:10,refill_tokens:5,refill_interval_seconds:3600,min_interval_seconds:0,penalty_enabled:!1,violation_threshold:5,base_penalty_seconds:1800,penalty_multiplier:2,max_penalty_seconds:86400,violation_decay_seconds:21600,adaptive_enabled:!1,ewma_alpha:.1,hysteresis_seconds:300,quiet_max:2,normal_max:6,busy_max:10},Se=["rate_limit_enabled","bucket_capacity","refill_tokens","refill_interval_seconds","min_interval_seconds","penalty_enabled","violation_threshold","base_penalty_seconds","penalty_multiplier","max_penalty_seconds","violation_decay_seconds","adaptive_enabled","ewma_alpha","hysteresis_seconds","quiet_max","normal_max","busy_max"];function C({title:s,enabled:a,defaultOpen:o=!1,children:i}){const[l,m]=y.useState(o);return e.jsxs("div",{className:"bg-subtle-fill radius-inner overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>m(!l),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-subtle-fill-hover transition-colors",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"type-label text-fg-muted",children:s}),e.jsx("span",{className:N("type-data-xs px-1.5 py-0.5 rounded-full font-medium uppercase tracking-wide",a?"bg-sys-green/15 text-sys-green":"bg-sys-red/15 text-sys-red"),children:a?"On":"Off"})]}),e.jsx(le,{className:N("w-4 h-4 text-fg-muted transition-transform",l&&"rotate-180")})]}),l&&e.jsx("div",{className:"px-4 pb-4 pt-1 space-y-1",children:i})]})}function x({label:s,current:a,recommended:o,format:i=l=>String(l)}){const l=a!=null?i(a):"—",m=i(o),c=a!=null&&l!==m;return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-1",children:[e.jsx("span",{className:"type-body-sm text-fg-muted flex-1 min-w-0 truncate",children:s}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("span",{className:N("data-box data-box-compact",c?"text-fg-muted line-through opacity-60":"text-fg-secondary"),children:l}),c&&e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{className:"data-box data-box-compact text-sys-blue font-medium",children:m})]})]})]})}function we({open:s,onClose:a,currentConfig:o,onApplied:i}){var D,H,P,T,I,R,L,E,$,z,F,O,q,Y;const[l,m]=y.useState("idle"),[c,h]=y.useState(null),[f,n]=y.useState(null),u=y.useCallback(async()=>{m("analyzing"),n(null);try{const t=await ye(o);h(t),m("ready")}catch(t){n(t instanceof Error?t.message:"Analysis failed"),m("error")}},[o]),_=y.useCallback(async()=>{if(!c)return;m("applying"),n(null);const{tokenBucket:t,penaltyBox:v,adaptive:j}=c.recommended,Q={rate_limit_enabled:t.enabled,bucket_capacity:t.bucket_capacity,refill_tokens:t.refill_tokens,refill_interval_seconds:t.refill_interval_seconds,min_interval_seconds:t.min_interval_seconds,penalty_enabled:v.enabled,violation_threshold:v.violation_threshold,base_penalty_seconds:v.base_penalty_seconds,penalty_multiplier:v.penalty_multiplier,max_penalty_seconds:v.max_penalty_seconds,violation_decay_seconds:v.violation_decay_seconds,adaptive_enabled:j.enabled,ewma_alpha:j.ewma_alpha,hysteresis_seconds:j.hysteresis_seconds,quiet_max:j.thresholds.quiet_max,normal_max:j.thresholds.normal_max,busy_max:j.thresholds.busy_max};try{const W=await ee(Q);W.success?(m("applied"),i==null||i()):(n(W.error||"Failed to apply settings"),m("error"))}catch{n("Failed to apply settings"),m("error")}},[c,i]),b=y.useCallback(()=>{a(),setTimeout(()=>{m("idle"),h(null),n(null)},300)},[a]);s&&l==="idle"&&u();const r=c==null?void 0:c.analysis,d=c==null?void 0:c.recommended,p=c==null?void 0:c.current;return e.jsxs(ae,{open:s,onClose:b,size:"lg",children:[e.jsx(se,{icon:e.jsx(re,{size:20}),title:"Auto-Configure",onClose:b}),e.jsxs(te,{className:"flex flex-col gap-5 max-h-[70vh] overflow-y-auto",children:[l==="analyzing"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-12",children:[e.jsx(V,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Analyzing 7 days of mesh traffic…"})]}),l==="error"&&e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8",children:[e.jsx(ne,{className:"w-6 h-6 text-sys-amber"}),e.jsx("p",{className:"type-body-sm text-fg-secondary",children:f}),e.jsx(S,{plain:!0,onClick:u,className:"text-sys-blue",children:"Retry"})]}),(l==="ready"||l==="applying"||l==="applied")&&r&&d&&p&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("div",{className:"type-micro mb-3",children:"7-DAY ANALYSIS"}),e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Pkts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(r.packetsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Adverts/hr"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:A(r.advertsPerHour)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Sources"}),e.jsx("div",{className:"data-box data-box-fill data-box-left",children:r.trackedSources})]}),e.jsxs("div",{children:[e.jsx("div",{className:"data-box-label",children:"Density"}),e.jsx("div",{className:N("data-box data-box-fill data-box-left",fe[r.meshDensity]),children:he[r.meshDensity]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(C,{title:"Token Bucket of Shame",enabled:d.tokenBucket.enabled,defaultOpen:!0,children:[e.jsx(x,{label:"Bucket Capacity",current:(D=p.tokenBucket)==null?void 0:D.bucket_capacity,recommended:d.tokenBucket.bucket_capacity,format:t=>`${t} tokens`}),e.jsx(x,{label:"Refill Tokens",current:(H=p.tokenBucket)==null?void 0:H.refill_tokens,recommended:d.tokenBucket.refill_tokens,format:t=>`${t} tokens`}),e.jsx(x,{label:"Refill Interval",current:(P=p.tokenBucket)==null?void 0:P.refill_interval_seconds,recommended:d.tokenBucket.refill_interval_seconds,format:t=>g(t)}),e.jsx(x,{label:"Min Interval",current:(T=p.tokenBucket)==null?void 0:T.min_interval_seconds,recommended:d.tokenBucket.min_interval_seconds,format:t=>`${t}s`})]}),e.jsxs(C,{title:"Jail",enabled:d.penaltyBox.enabled,children:[e.jsx(x,{label:"Violation Threshold",current:(I=p.penaltyBox)==null?void 0:I.violation_threshold,recommended:d.penaltyBox.violation_threshold,format:t=>`${t} violations`}),e.jsx(x,{label:"Base Penalty",current:(R=p.penaltyBox)==null?void 0:R.base_penalty_seconds,recommended:d.penaltyBox.base_penalty_seconds,format:t=>g(t)}),e.jsx(x,{label:"Multiplier",current:(L=p.penaltyBox)==null?void 0:L.penalty_multiplier,recommended:d.penaltyBox.penalty_multiplier,format:t=>`${t}×`}),e.jsx(x,{label:"Max Penalty",current:(E=p.penaltyBox)==null?void 0:E.max_penalty_seconds,recommended:d.penaltyBox.max_penalty_seconds,format:t=>g(t)}),e.jsx(x,{label:"Violation Decay",current:($=p.penaltyBox)==null?void 0:$.violation_decay_seconds,recommended:d.penaltyBox.violation_decay_seconds,format:t=>g(t)})]}),e.jsxs(C,{title:"Adaptive Tiers",enabled:d.adaptive.enabled,children:[e.jsx(x,{label:"EWMA α",current:(z=p.adaptive)==null?void 0:z.ewma_alpha,recommended:d.adaptive.ewma_alpha}),e.jsx(x,{label:"Hysteresis",current:(F=p.adaptive)==null?void 0:F.hysteresis_seconds,recommended:d.adaptive.hysteresis_seconds,format:t=>g(t)}),e.jsx(x,{label:"Quiet Max",current:(O=p.adaptive)==null?void 0:O.thresholds.quiet_max,recommended:d.adaptive.thresholds.quiet_max,format:t=>`${t} pkts/min`}),e.jsx(x,{label:"Normal Max",current:(q=p.adaptive)==null?void 0:q.thresholds.normal_max,recommended:d.adaptive.thresholds.normal_max,format:t=>`${t} pkts/min`}),e.jsx(x,{label:"Busy Max",current:(Y=p.adaptive)==null?void 0:Y.thresholds.busy_max,recommended:d.adaptive.thresholds.busy_max,format:t=>`${t} pkts/min`})]})]}),e.jsxs("div",{className:N("flex justify-between gap-4 pt-1",l==="applied"?"items-center":"items-end"),children:[l==="applied"?e.jsx("span",{className:"type-body-sm text-zinc-500",children:"Settings applied"}):e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"data-box-label",children:"Analyzed"}),e.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[A(r.totalPackets)," packets"]})]}),e.jsx("div",{className:"flex items-center gap-2",children:l==="applied"?e.jsx(S,{color:"primary",onClick:b,children:"Done"}):e.jsxs(e.Fragment,{children:[e.jsx(S,{plain:!0,onClick:b,children:"Cancel"}),e.jsx(S,{color:"primary",onClick:_,disabled:l==="applying",children:l==="applying"?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"w-4 h-4 animate-spin"}),"Applying…"]}):"Apply All"})]})})]})]})]})]})}export{we as A,ge as N,Ne as S,Se as a}; diff --git a/frontend/dist/assets/BackupRestore-CM11c75S.js b/frontend/dist/assets/BackupRestore-D2lKmevY.js similarity index 95% rename from frontend/dist/assets/BackupRestore-CM11c75S.js rename to frontend/dist/assets/BackupRestore-D2lKmevY.js index 1c921a2d..5a780df8 100644 --- a/frontend/dist/assets/BackupRestore-CM11c75S.js +++ b/frontend/dist/assets/BackupRestore-D2lKmevY.js @@ -1 +1 @@ -import{r as p,j as e,aD as R,d9 as B,f as b,B as l}from"./index-CAHLMlrb.js";import{e as H,a as K,i as D}from"./backup-K6eA_iA5.js";import{P as $,a as q,B as Y,C as x}from"./PageLayout-CgrNSpBT.js";import{R as y,C as T}from"./Grid-B0tNiHTX.js";import{U as O}from"./upload-N2aZrMEC.js";import{K as M}from"./key-round-CZ_hGBwN.js";import"./WorkspaceNav-ClxMgBhr.js";function W(t,o){const f=new Blob([JSON.stringify(o,null,2)],{type:"application/json"}),c=URL.createObjectURL(f),n=document.createElement("a");n.href=c,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(c)}function z(t,o){const f=new Blob([o],{type:"text/plain"}),c=URL.createObjectURL(f),n=document.createElement("a");n.href=c,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(c)}function U(t){var o;return String(((o=t==null?void 0:t.meta)==null?void 0:o.exported_at)||new Date().toISOString()).replace(/[:.]/g,"-")}function se(){var E,I;const[t,o]=p.useState(null),[f,c]=p.useState(!1),[n,w]=p.useState(!1),[a,h]=p.useState(null),[_,j]=p.useState(!1),[N,m]=p.useState(null),[v,d]=p.useState(null),k=p.useRef(null),C=window.location.protocol==="http:",F=p.useMemo(()=>a?Object.keys(a.config).join(", "):"",[a]),J=((E=a==null?void 0:a.meta)==null?void 0:E.includes_secrets)===!0||((I=a==null?void 0:a.meta)==null?void 0:I.includes_secrets)==="true",S=async s=>{o(s?"full":"settings"),d(null),m(null);try{const r=await H(s);if(!r.success||!r.data)throw new Error(r.error||"Export failed");W(s?`openhop-repeater-full-backup-${U(r.data)}.json`:`openhop-repeater-settings-${U(r.data)}.json`,r.data),m(s?"Full backup exported. Store it securely.":"Settings export downloaded with secrets redacted."),c(!1)}catch(r){d(r instanceof Error?r.message:"Export failed")}finally{o(null)}},L=async()=>{o("identity"),d(null),m(null);try{const s=await K();if(!s.success||!s.data)throw new Error(s.error||"Identity export failed");z(`openhop-identity-${s.data.node_address||"key"}.hex`,s.data.identity_key_hex),m(`Identity key exported (${s.data.key_length_bytes} bytes). Store it securely.`),w(!1)}catch(s){d(s instanceof Error?s.message:"Identity export failed")}finally{o(null)}},P=s=>{var g;const r=(g=s.target.files)==null?void 0:g[0];if(!r)return;d(null),m(null),h(null),j(!1);const i=new FileReader;i.onload=()=>{try{const u=JSON.parse(String(i.result));u&&typeof u=="object"&&!Array.isArray(u)?u.config&&typeof u.config=="object"?h({config:u.config,meta:u.meta}):h({config:u}):d("Invalid file format — expected a JSON object.")}catch{d("Invalid JSON file.")}},i.readAsText(r)},A=async()=>{var s,r;if(a){o("import"),d(null),m(null);try{const i=await D(a.config);if(!i.success)throw new Error(i.error||"Import failed");const g=(s=i.data)!=null&&s.restart_required?" A service restart is required for some changes.":"";m(((r=i.data)==null?void 0:r.message)||`Configuration imported.${g}`),h(null),j(!1),k.current&&(k.current.value="")}catch(i){d(i instanceof Error?i.message:"Import failed")}finally{o(null)}}};return e.jsxs($,{children:[e.jsx(q,{title:"Backup / Restore",icon:e.jsx(R,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Export, import, and restore Repeater configuration with explicit secret warnings."})}),e.jsxs(Y,{ready:!0,children:[C&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"border border-sys-red/30",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(B,{className:"w-5 h-5 text-sys-red"}),e.jsx("p",{className:"type-body-sm text-sys-red",children:"This page is served over HTTP. Secret-bearing backups and identity keys are transmitted in plain text; only use this on a trusted local network."})]})})}),v&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-red",children:v})}),N&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-green",children:N})}),e.jsxs(y,{template:"standard",children:[e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(R,{}),title:"Export Settings"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads current configuration with passwords, JWT secrets, and identity keys redacted."}),e.jsx(l,{color:"primary",onClick:()=>S(!1),disabled:!!t,children:t==="settings"?"Exporting…":"Export Settings"})]})}),e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(B,{}),title:"Full Backup"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Includes passwords, JWT secrets, and identity keys. Store securely and never share."}),f?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting all secrets",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:()=>S(!0),disabled:!!t,children:t==="full"?"Exporting…":"Yes, Export Full Backup"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>c(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>c(!0),children:"Full Backup"})]})})]}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(O,{}),title:"Import Configuration"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Import a settings export or full backup. Restore requires confirmation and never auto-restarts the service."}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer bg-subtle-fill radius-card p-4 border border-edge-subtle",children:[e.jsx(O,{className:"w-5 h-5 text-sys-blue"}),e.jsx("span",{className:"type-body-sm text-fg-muted",children:"Choose JSON file…"}),e.jsx("input",{ref:k,type:"file",accept:".json,application/json",className:"hidden",onChange:P})]}),a&&e.jsxs("div",{className:"mt-4 bg-subtle-fill radius-card p-4",children:[e.jsx("p",{className:"type-body text-fg-primary",children:"Import preview"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mt-1",children:["Sections: ",e.jsx("span",{className:"type-code",children:F||"unknown"})]}),J&&e.jsx("p",{className:"type-body-sm text-sys-amber mt-2",children:"This full backup may overwrite passwords and identity keys."}),_?e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx(l,{color:"warning",onClick:A,disabled:!!t,children:t==="import"?"Importing…":"Yes, Import"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>j(!1),disabled:!!t,children:"Cancel"})]}):e.jsx(l,{className:"mt-3",color:"warning",outline:!0,onClick:()=>j(!0),children:"Review & Import"})]})]})}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(M,{}),title:"Export Identity Key"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads the repeater private identity key as hex. Anyone with this key can impersonate your node."}),n?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting the private key",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:L,disabled:!!t,children:t==="identity"?"Exporting…":"Yes, Export Key"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>w(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>w(!0),children:"Export Identity Key"})]})})]})]})}export{se as default}; +import{r as p,j as e,aD as R,d9 as B,f as b,B as l}from"./index-CdntfUUz.js";import{e as H,a as K,i as D}from"./backup-Zafc7Byp.js";import{P as $,a as q,B as Y,C as x}from"./PageLayout-B2kQpvXM.js";import{R as y,C as T}from"./Grid-DYtN9_Hv.js";import{U as O}from"./upload-D2RzW6Z5.js";import{K as M}from"./key-round-Cn-7B-WZ.js";import"./WorkspaceNav-BZrtCI1_.js";function W(t,o){const f=new Blob([JSON.stringify(o,null,2)],{type:"application/json"}),c=URL.createObjectURL(f),n=document.createElement("a");n.href=c,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(c)}function z(t,o){const f=new Blob([o],{type:"text/plain"}),c=URL.createObjectURL(f),n=document.createElement("a");n.href=c,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(c)}function U(t){var o;return String(((o=t==null?void 0:t.meta)==null?void 0:o.exported_at)||new Date().toISOString()).replace(/[:.]/g,"-")}function se(){var E,I;const[t,o]=p.useState(null),[f,c]=p.useState(!1),[n,w]=p.useState(!1),[a,h]=p.useState(null),[_,j]=p.useState(!1),[N,m]=p.useState(null),[v,d]=p.useState(null),k=p.useRef(null),C=window.location.protocol==="http:",F=p.useMemo(()=>a?Object.keys(a.config).join(", "):"",[a]),J=((E=a==null?void 0:a.meta)==null?void 0:E.includes_secrets)===!0||((I=a==null?void 0:a.meta)==null?void 0:I.includes_secrets)==="true",S=async s=>{o(s?"full":"settings"),d(null),m(null);try{const r=await H(s);if(!r.success||!r.data)throw new Error(r.error||"Export failed");W(s?`openhop-repeater-full-backup-${U(r.data)}.json`:`openhop-repeater-settings-${U(r.data)}.json`,r.data),m(s?"Full backup exported. Store it securely.":"Settings export downloaded with secrets redacted."),c(!1)}catch(r){d(r instanceof Error?r.message:"Export failed")}finally{o(null)}},L=async()=>{o("identity"),d(null),m(null);try{const s=await K();if(!s.success||!s.data)throw new Error(s.error||"Identity export failed");z(`openhop-identity-${s.data.node_address||"key"}.hex`,s.data.identity_key_hex),m(`Identity key exported (${s.data.key_length_bytes} bytes). Store it securely.`),w(!1)}catch(s){d(s instanceof Error?s.message:"Identity export failed")}finally{o(null)}},P=s=>{var g;const r=(g=s.target.files)==null?void 0:g[0];if(!r)return;d(null),m(null),h(null),j(!1);const i=new FileReader;i.onload=()=>{try{const u=JSON.parse(String(i.result));u&&typeof u=="object"&&!Array.isArray(u)?u.config&&typeof u.config=="object"?h({config:u.config,meta:u.meta}):h({config:u}):d("Invalid file format — expected a JSON object.")}catch{d("Invalid JSON file.")}},i.readAsText(r)},A=async()=>{var s,r;if(a){o("import"),d(null),m(null);try{const i=await D(a.config);if(!i.success)throw new Error(i.error||"Import failed");const g=(s=i.data)!=null&&s.restart_required?" A service restart is required for some changes.":"";m(((r=i.data)==null?void 0:r.message)||`Configuration imported.${g}`),h(null),j(!1),k.current&&(k.current.value="")}catch(i){d(i instanceof Error?i.message:"Import failed")}finally{o(null)}}};return e.jsxs($,{children:[e.jsx(q,{title:"Backup / Restore",icon:e.jsx(R,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Export, import, and restore Repeater configuration with explicit secret warnings."})}),e.jsxs(Y,{ready:!0,children:[C&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"border border-sys-red/30",children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(B,{className:"w-5 h-5 text-sys-red"}),e.jsx("p",{className:"type-body-sm text-sys-red",children:"This page is served over HTTP. Secret-bearing backups and identity keys are transmitted in plain text; only use this on a trusted local network."})]})})}),v&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-red",children:v})}),N&&e.jsx(y,{template:"auto",children:e.jsx(x,{neomorphic:!0,className:"text-sys-green",children:N})}),e.jsxs(y,{template:"standard",children:[e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(R,{}),title:"Export Settings"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads current configuration with passwords, JWT secrets, and identity keys redacted."}),e.jsx(l,{color:"primary",onClick:()=>S(!1),disabled:!!t,children:t==="settings"?"Exporting…":"Export Settings"})]})}),e.jsx(T,{span:"full",md:6,children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(B,{}),title:"Full Backup"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Includes passwords, JWT secrets, and identity keys. Store securely and never share."}),f?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting all secrets",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:()=>S(!0),disabled:!!t,children:t==="full"?"Exporting…":"Yes, Export Full Backup"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>c(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>c(!0),children:"Full Backup"})]})})]}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(O,{}),title:"Import Configuration"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Import a settings export or full backup. Restore requires confirmation and never auto-restarts the service."}),e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer bg-subtle-fill radius-card p-4 border border-edge-subtle",children:[e.jsx(O,{className:"w-5 h-5 text-sys-blue"}),e.jsx("span",{className:"type-body-sm text-fg-muted",children:"Choose JSON file…"}),e.jsx("input",{ref:k,type:"file",accept:".json,application/json",className:"hidden",onChange:P})]}),a&&e.jsxs("div",{className:"mt-4 bg-subtle-fill radius-card p-4",children:[e.jsx("p",{className:"type-body text-fg-primary",children:"Import preview"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mt-1",children:["Sections: ",e.jsx("span",{className:"type-code",children:F||"unknown"})]}),J&&e.jsx("p",{className:"type-body-sm text-sys-amber mt-2",children:"This full backup may overwrite passwords and identity keys."}),_?e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx(l,{color:"warning",onClick:A,disabled:!!t,children:t==="import"?"Importing…":"Yes, Import"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>j(!1),disabled:!!t,children:"Cancel"})]}):e.jsx(l,{className:"mt-3",color:"warning",outline:!0,onClick:()=>j(!0),children:"Review & Import"})]})]})}),e.jsx(y,{template:"auto",children:e.jsxs(x,{neomorphic:!0,children:[e.jsx(b,{icon:e.jsx(M,{}),title:"Export Identity Key"}),e.jsx("p",{className:"type-body-sm text-fg-muted mb-4",children:"Downloads the repeater private identity key as hex. Anyone with this key can impersonate your node."}),n?e.jsxs("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:[e.jsxs("p",{className:"type-body-sm text-sys-red mb-3",children:["Confirm exporting the private key",C?" over HTTP":"","."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(l,{color:"danger",onClick:L,disabled:!!t,children:t==="identity"?"Exporting…":"Yes, Export Key"}),e.jsx(l,{color:"muted",outline:!0,onClick:()=>w(!1),disabled:!!t,children:"Cancel"})]})]}):e.jsx(l,{color:"danger",outline:!0,onClick:()=>w(!0),children:"Export Identity Key"})]})})]})]})}export{se as default}; diff --git a/frontend/dist/assets/BasemapLayer-VyMOdkaO.js b/frontend/dist/assets/BasemapLayer-U4r1eipM.js similarity index 98% rename from frontend/dist/assets/BasemapLayer-VyMOdkaO.js rename to frontend/dist/assets/BasemapLayer-U4r1eipM.js index e53fbebd..78d94d41 100644 --- a/frontend/dist/assets/BasemapLayer-VyMOdkaO.js +++ b/frontend/dist/assets/BasemapLayer-U4r1eipM.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CAHLMlrb.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); -import{r as a,_ as H,bb as D}from"./index-CAHLMlrb.js";const W=a.createContext(null);function B(){var s;const e=(s=a.useContext(W))==null?void 0:s.maps,n=a.useContext(x);return a.useMemo(()=>({...e,current:n==null?void 0:n.map}),[e,n])}function Z(e,n){const t=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(n)?n[0]:n?n.x:0,r=Array.isArray(n)?n[1]:n?n.y:0;return t===o&&s===r}function L(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=n[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const i of V)i in r&&(o[i]=r[i])}return o||s});return{...e,layers:t}}const O={version:8,sources:{},layers:[]},A={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"},N={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"},U={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"},q=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],G=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class w{constructor(n,t,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[U[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||I(this._map.transform);const r=this.props[N[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=I(o),T(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[A[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=n,this.props=t,this._initialize(s)}get map(){return this._map}setProps(n){const t=this.props;this.props=n;const s=this._updateSettings(n,t),o=this._updateSize(n),r=this._updateViewState(n);this._updateStyle(n,t),this._updateStyleComponents(n),this._updateHandlers(n,t),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(n,t){const s=w.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(t.className=r.className;r.childNodes.length>0;)t.appendChild(r.childNodes[0]);o._container=t;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(t)),s.setProps({...n,styleDiffing:!1}),o.resize();const{initialViewState:c}=n;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(n){const{props:t}=this,{mapStyle:s=O}=t,o={...t,...t.initialViewState,container:n,style:z(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}),t.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,t.gl)}const i=new this._MapClass(o);r.padding&&i.setPadding(r.padding),t.cursor&&(i.getCanvas().style.cursor=t.cursor),i.transformCameraUpdate=this._onCameraUpdate,i.on("style.load",()=>{var c;this._styleComponents={light:i.getLight(),sky:i.getSky(),projection:(c=i.getProjection)==null?void 0:c.call(i),terrain:i.getTerrain()},this._updateStyleComponents(this.props)}),i.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in A)i.on(c,this._onPointerEvent);for(const c in N)i.on(c,this._onCameraEvent);for(const c in U)i.on(c,this._onEvent);this._map=i}recycle(){const t=this.map.getContainer().querySelector("[mapboxgl-children]");t==null||t.remove(),w.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_updateSize(n){const{viewState:t}=n;if(t){const s=this._map;if(t.width!==s.transform.width||t.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(n){const t=this._map,s=t.transform;if(!t.isMoving()){const r=T(s,n);if(Object.keys(r).length>0)return this._internalUpdate=!0,t.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(n,t){const s=this._map;let o=!1;for(const r of q)if(r in n&&!L(n[r],t[r])){o=!0;const i=s[`set${r[0].toUpperCase()}${r.slice(1)}`];i==null||i.call(s,n[r])}return o}_updateStyle(n,t){if(n.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==t.mapStyle){const{mapStyle:s=O,styleDiffing:o=!0}=n,r={diff:o};"localIdeographFontFamily"in n&&(r.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(z(s),r)}}_updateStyleComponents({light:n,projection:t,sky:s,terrain:o}){var c,l;const r=this._map,i=this._styleComponents;r.style._loaded&&(n&&!L(n,i.light)&&(i.light=n,r.setLight(n)),t&&!L(t,i.projection)&&t!==((c=i.projection)==null?void 0:c.type)&&(i.projection=typeof t=="string"?{type:t}:t,(l=r.setProjection)==null||l.call(r,i.projection)),s&&!L(s,i.sky)&&(i.sky=s,r.setSky(s)),o!==void 0&&!L(o,i.terrain)&&(!o||r.getSource(o.source))&&(i.terrain=o,r.setTerrain(o)))}_updateHandlers(n,t){const s=this._map;for(const o of G){const r=n[o]??!0,i=t[o]??!0;L(r,i)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(n){const t=this._map,{interactiveLayerIds:s=[]}=this.props;try{return t.queryRenderedFeatures(n,{layers:s.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(n){var o;const{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){const r=n.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(n.point),l=c.length>0;!l&&i&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=c,l&&!i&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=r}else this._hoveredFeatures=null}}w.savedMaps=[];const $=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function J(e){if(!e)return null;const n=e.map,t={getMap:()=>n};for(const s of K(n))!(s in t)&&!$.includes(s)&&(t[s]=n[s].bind(n));return t}function K(e){const n=new Set;let t=e;for(;t;){for(const s of Object.getOwnPropertyNames(t))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&n.add(s);t=Object.getPrototypeOf(t)}return Array.from(n)}const Y=typeof document<"u"?a.useLayoutEffect:a.useEffect;function X(e,n){const{RTLTextPlugin:t,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=n;if(t&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:c=!0}=typeof t=="string"?{pluginUrl:t}:t;e.setRTLTextPlugin(i,l=>{l&&console.error(l)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const x=a.createContext(null);function Q(e,n){const t=a.useContext(W),[s,o]=a.useState(null),r=a.useRef(),{current:i}=a.useRef({mapLib:null,map:null});a.useEffect(()=>{const f=e.mapLib;let u=!0,d;return Promise.resolve(f||H(()=>import("./maplibre-gl-BkYzjH9W.js").then(h=>h.m),__vite__mapDeps([0,1]))).then(h=>{if(!u)return;if(!h)throw new Error("Invalid mapLib");const m="Map"in h?h:h.default;if(!m.Map)throw new Error("Invalid mapLib");X(m,e),e.reuseMaps&&(d=w.reuse(e,r.current)),d||(d=new w(m.Map,e,r.current)),i.map=J(d),i.mapLib=m,o(d),t==null||t.onMapMount(i.map,e.id)}).catch(h=>{const{onError:m}=e;m?m({type:"error",target:null,originalEvent:null,error:h}):console.error(h)}),()=>{u=!1,d&&(t==null||t.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Y(()=>{s&&s.setProps(e)}),a.useImperativeHandle(n,()=>i.map,[s]);const c=a.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),l={height:"100%"};return a.createElement("div",{id:e.id,ref:r,style:c},s&&a.createElement(x.Provider,{value:i},a.createElement("div",{"mapboxgl-children":"",style:l},e.children)))}const de=a.forwardRef(Q),ee=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function E(e,n){if(!e||!n)return;const t=e.style;for(const s in n){const o=n[s];Number.isFinite(o)&&!ee.test(s)?t[s]=`${o}px`:t[s]=o}}function j(e,n){if(e===n)return null;const t=F(e),s=F(n),o=[];for(const r of s)t.has(r)||o.push(r);for(const r of t)s.has(r)||o.push(r);return o.length===0?null:o}function F(e){return new Set(e?e.trim().split(/\s+/):[])}const me=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useRef({props:e}),r=a.useMemo(()=>{let b=!1;a.Children.forEach(e.children,p=>{p&&(b=!0)});const k={...e,element:b?document.createElement("div"):void 0},_=new s.Marker(k);return _.setLngLat([e.longitude,e.latitude]),_.getElement().addEventListener("click",p=>{var y,g;(g=(y=o.current.props).onClick)==null||g.call(y,{type:"click",target:_,originalEvent:p})}),_.on("dragstart",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragStart)==null||C.call(g,y)}),_.on("drag",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDrag)==null||C.call(g,y)}),_.on("dragend",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragEnd)==null||C.call(g,y)}),_},[]);a.useEffect(()=>(r.addTo(t.getMap()),()=>{r.remove()}),[]);const{longitude:i,latitude:c,offset:l,style:f,draggable:u=!1,popup:d=null,rotation:h=0,rotationAlignment:m="auto",pitchAlignment:v="auto"}=e;a.useEffect(()=>{E(r.getElement(),f)},[f]),a.useImperativeHandle(n,()=>r,[]);const S=o.current.props;(r.getLngLat().lng!==i||r.getLngLat().lat!==c)&&r.setLngLat([i,c]),l&&!Z(r.getOffset(),l)&&r.setOffset(l),r.isDraggable()!==u&&r.setDraggable(u),r.getRotation()!==h&&r.setRotation(h),r.getRotationAlignment()!==m&&r.setRotationAlignment(m),r.getPitchAlignment()!==v&&r.setPitchAlignment(v),r.getPopup()!==d&&r.setPopup(d);const R=j(S.className,e.className);if(R)for(const b of R)r.toggleClassName(b);return o.current.props=e,D.createPortal(e.children,r.getElement())})),he=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useMemo(()=>document.createElement("div"),[]),r=a.useRef({props:e}),i=a.useMemo(()=>{const c={...e},l=new s.Popup(c);return l.setLngLat([e.longitude,e.latitude]),l.once("open",f=>{var u,d;(d=(u=r.current.props).onOpen)==null||d.call(u,f)}),l},[]);if(a.useEffect(()=>{const c=l=>{var f,u;(u=(f=r.current.props).onClose)==null||u.call(f,l)};return i.on("close",c),i.setDOMContent(o).addTo(t.getMap()),()=>{i.off("close",c),i.isOpen()&&i.remove()}},[]),a.useEffect(()=>{E(i.getElement(),e.style)},[e.style]),a.useImperativeHandle(n,()=>i,[]),i.isOpen()){const c=r.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!L(c.offset,e.offset)&&i.setOffset(e.offset),(c.anchor!==e.anchor||c.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth));const l=j(c.className,e.className);if(l)for(const f of l)i.toggleClassName(f);r.current.props=e}return D.createPortal(e.children,o)}));function M(e,n,t,s){const o=a.useContext(x),r=a.useMemo(()=>e(o),[]);return a.useEffect(()=>{const i=n,c=null,l=typeof n=="function"?n:null,{map:f}=o;return f.hasControl(r)||(f.addControl(r,i==null?void 0:i.position),c&&c(o)),()=>{l&&l(o),f.hasControl(r)&&f.removeControl(r)}},[]),r}function te(e){const n=M(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(te);function ne(e){const n=M(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return a.useEffect(()=>{E(n._controlContainer,e.style)},[e.style]),null}a.memo(ne);function oe(e,n){const t=a.useRef({props:e}),s=M(({mapLib:o})=>{const r=new o.GeolocateControl(e),i=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||i()},r.on("geolocate",c=>{var l,f;(f=(l=t.current.props).onGeolocate)==null||f.call(l,c)}),r.on("error",c=>{var l,f;(f=(l=t.current.props).onError)==null||f.call(l,c)}),r.on("outofmaxbounds",c=>{var l,f;(f=(l=t.current.props).onOutOfMaxBounds)==null||f.call(l,c)}),r.on("trackuserlocationstart",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationStart)==null||f.call(l,c)}),r.on("trackuserlocationend",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationEnd)==null||f.call(l,c)}),r},{position:e.position});return t.current.props=e,a.useImperativeHandle(n,()=>s,[]),a.useEffect(()=>{E(s._container,e.style)},[e.style]),null}a.memo(a.forwardRef(oe));function re(e){const n=M(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(re);function se(e){const n=M(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),t=a.useRef(e),s=t.current;t.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&n.setUnit(e.unit),a.useEffect(()=>{E(n._container,o)},[o]),null}const ge=a.memo(se);function ie(e){const n=M(({mapLib:t})=>new t.TerrainControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ie);function ae(e){const n=M(({mapLib:t})=>new t.LogoControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ae);const ce={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},le={light:"basemap-light-",dark:"basemap-dark-"},P={};async function ue(e){if(P[e])return P[e];const t=await(await fetch(ce[e])).json();return P[e]=t,t}function ye({mode:e}){const{current:n}=B(),[t,s]=a.useState(null),o=a.useRef({light:!1,dark:!1}),r=a.useRef({light:[],dark:[]}),i=a.useRef(e);a.useEffect(()=>{i.current=e},[e]),a.useEffect(()=>{const u=()=>{var v;const m=(v=n==null?void 0:n.getMap)==null?void 0:v.call(n);m&&!t&&s(m)};u();const d=setInterval(u,50),h=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(h)}},[n,t]);const c=a.useCallback(async(u,d,h)=>{var k,_;if(o.current[d])return;const m=le[d],v=await ue(d),S=[];for(const[p,y]of Object.entries(v.sources||{})){const g=m+p;u.getSource(g)||u.addSource(g,y)}const b=(_=(((k=u.getStyle())==null?void 0:k.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:_.id;for(const p of v.layers||[]){const y=m+p.id;if(S.push(y),u.getLayer(y))continue;const g={...p,id:y};"source"in g&&typeof g.source=="string"&&(g.source=m+g.source),g.layout||(g.layout={}),g.layout.visibility=h?"visible":"none";try{u.addLayer(g,b)}catch(C){console.warn(`[BasemapLayer] Failed to add layer ${y}:`,C)}}r.current[d]=S,o.current[d]=!0},[]),l=a.useCallback((u,d,h)=>{const m=r.current[d],v=h?"visible":"none";for(const S of m)if(u.getLayer(S))try{u.setLayoutProperty(S,"visibility",v)}catch{}},[]),f=a.useCallback(u=>{var m;const h=(((m=u.getStyle())==null?void 0:m.layers)||[]).filter(v=>!v.id.startsWith("basemap-light-")&&!v.id.startsWith("basemap-dark-"));for(const v of h)try{u.moveLayer(v.id)}catch{}},[]);return a.useEffect(()=>{if(!t)return;const u=d=>{t.hasImage(d.id)||t.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return t.on("styleimagemissing",u),()=>{t.off("styleimagemissing",u)}},[t]),a.useEffect(()=>{if(!t)return;let u=!1;const d=async()=>{if(!u)try{const m=i.current;await Promise.all([c(t,"light",m==="light"),c(t,"dark",m==="dark")]),u||(l(t,"light",i.current==="light"),l(t,"dark",i.current==="dark"),f(t),t.resize())}catch(m){console.error("[BasemapLayer] Setup error:",m)}};t.isStyleLoaded()?d():(t.once("style.load",d),t.once("load",()=>{!u&&!o.current.light&&d()}));const h=()=>{u||setTimeout(()=>{!u&&o.current.light&&o.current.dark&&f(t)},100)};return t.on("styledata",h),()=>{u=!0,t.off("styledata",h)}},[t,c,f,l]),a.useEffect(()=>{t&&(!o.current.light||!o.current.dark||(l(t,"light",e==="light"),l(t,"dark",e==="dark"),t.resize(),t.triggerRepaint()))},[t,e,l]),null}export{ye as B,de as M,he as P,ge as S,me as a,x as b,L as d,B as u}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CdntfUUz.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); +import{r as a,_ as H,bb as D}from"./index-CdntfUUz.js";const W=a.createContext(null);function B(){var s;const e=(s=a.useContext(W))==null?void 0:s.maps,n=a.useContext(x);return a.useMemo(()=>({...e,current:n==null?void 0:n.map}),[e,n])}function Z(e,n){const t=Array.isArray(e)?e[0]:e?e.x:0,s=Array.isArray(e)?e[1]:e?e.y:0,o=Array.isArray(n)?n[0]:n?n.x:0,r=Array.isArray(n)?n[1]:n?n.y:0;return t===o&&s===r}function L(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let t=0;t{let o=null;"interactive"in s&&(o=Object.assign({},s),delete o.interactive);const r=n[s.ref];if(r){o=o||Object.assign({},s),delete o.ref;for(const i of V)i in r&&(o[i]=r[i])}return o||s});return{...e,layers:t}}const O={version:8,sources:{},layers:[]},A={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"},N={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"},U={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"},q=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],G=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class w{constructor(n,t,s){this._map=null,this._internalUpdate=!1,this._hoveredFeatures=null,this._propsedCameraUpdate=null,this._styleComponents={},this._onEvent=o=>{const r=this.props[U[o.type]];r?r(o):o.type==="error"&&console.error(o.error)},this._onCameraEvent=o=>{if(this._internalUpdate)return;o.viewState=this._propsedCameraUpdate||I(this._map.transform);const r=this.props[N[o.type]];r&&r(o)},this._onCameraUpdate=o=>this._internalUpdate?o:(this._propsedCameraUpdate=I(o),T(o,this.props)),this._onPointerEvent=o=>{(o.type==="mousemove"||o.type==="mouseout")&&this._updateHover(o);const r=this.props[A[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=n,this.props=t,this._initialize(s)}get map(){return this._map}setProps(n){const t=this.props;this.props=n;const s=this._updateSettings(n,t),o=this._updateSize(n),r=this._updateViewState(n);this._updateStyle(n,t),this._updateStyleComponents(n),this._updateHandlers(n,t),(s||o||r&&!this._map.isMoving())&&this.redraw()}static reuse(n,t){const s=w.savedMaps.pop();if(!s)return null;const o=s.map,r=o.getContainer();for(t.className=r.className;r.childNodes.length>0;)t.appendChild(r.childNodes[0]);o._container=t;const i=o._resizeObserver;i&&(i.disconnect(),i.observe(t)),s.setProps({...n,styleDiffing:!1}),o.resize();const{initialViewState:c}=n;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(n){const{props:t}=this,{mapStyle:s=O}=t,o={...t,...t.initialViewState,container:n,style:z(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}),t.gl){const c=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=c,t.gl)}const i=new this._MapClass(o);r.padding&&i.setPadding(r.padding),t.cursor&&(i.getCanvas().style.cursor=t.cursor),i.transformCameraUpdate=this._onCameraUpdate,i.on("style.load",()=>{var c;this._styleComponents={light:i.getLight(),sky:i.getSky(),projection:(c=i.getProjection)==null?void 0:c.call(i),terrain:i.getTerrain()},this._updateStyleComponents(this.props)}),i.on("sourcedata",()=>{this._updateStyleComponents(this.props)});for(const c in A)i.on(c,this._onPointerEvent);for(const c in N)i.on(c,this._onCameraEvent);for(const c in U)i.on(c,this._onEvent);this._map=i}recycle(){const t=this.map.getContainer().querySelector("[mapboxgl-children]");t==null||t.remove(),w.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_updateSize(n){const{viewState:t}=n;if(t){const s=this._map;if(t.width!==s.transform.width||t.height!==s.transform.height)return s.resize(),!0}return!1}_updateViewState(n){const t=this._map,s=t.transform;if(!t.isMoving()){const r=T(s,n);if(Object.keys(r).length>0)return this._internalUpdate=!0,t.jumpTo(r),this._internalUpdate=!1,!0}return!1}_updateSettings(n,t){const s=this._map;let o=!1;for(const r of q)if(r in n&&!L(n[r],t[r])){o=!0;const i=s[`set${r[0].toUpperCase()}${r.slice(1)}`];i==null||i.call(s,n[r])}return o}_updateStyle(n,t){if(n.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=n.cursor||""),n.mapStyle!==t.mapStyle){const{mapStyle:s=O,styleDiffing:o=!0}=n,r={diff:o};"localIdeographFontFamily"in n&&(r.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(z(s),r)}}_updateStyleComponents({light:n,projection:t,sky:s,terrain:o}){var c,l;const r=this._map,i=this._styleComponents;r.style._loaded&&(n&&!L(n,i.light)&&(i.light=n,r.setLight(n)),t&&!L(t,i.projection)&&t!==((c=i.projection)==null?void 0:c.type)&&(i.projection=typeof t=="string"?{type:t}:t,(l=r.setProjection)==null||l.call(r,i.projection)),s&&!L(s,i.sky)&&(i.sky=s,r.setSky(s)),o!==void 0&&!L(o,i.terrain)&&(!o||r.getSource(o.source))&&(i.terrain=o,r.setTerrain(o)))}_updateHandlers(n,t){const s=this._map;for(const o of G){const r=n[o]??!0,i=t[o]??!0;L(r,i)||(r?s[o].enable(r):s[o].disable())}}_queryRenderedFeatures(n){const t=this._map,{interactiveLayerIds:s=[]}=this.props;try{return t.queryRenderedFeatures(n,{layers:s.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(n){var o;const{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){const r=n.type,i=((o=this._hoveredFeatures)==null?void 0:o.length)>0,c=this._queryRenderedFeatures(n.point),l=c.length>0;!l&&i&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=c,l&&!i&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=r}else this._hoveredFeatures=null}}w.savedMaps=[];const $=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function J(e){if(!e)return null;const n=e.map,t={getMap:()=>n};for(const s of K(n))!(s in t)&&!$.includes(s)&&(t[s]=n[s].bind(n));return t}function K(e){const n=new Set;let t=e;for(;t;){for(const s of Object.getOwnPropertyNames(t))s[0]!=="_"&&typeof e[s]=="function"&&s!=="fire"&&s!=="setEventedParent"&&n.add(s);t=Object.getPrototypeOf(t)}return Array.from(n)}const Y=typeof document<"u"?a.useLayoutEffect:a.useEffect;function X(e,n){const{RTLTextPlugin:t,maxParallelImageRequests:s,workerCount:o,workerUrl:r}=n;if(t&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"){const{pluginUrl:i,lazy:c=!0}=typeof t=="string"?{pluginUrl:t}:t;e.setRTLTextPlugin(i,l=>{l&&console.error(l)},c)}s!==void 0&&e.setMaxParallelImageRequests(s),o!==void 0&&e.setWorkerCount(o),r!==void 0&&e.setWorkerUrl(r)}const x=a.createContext(null);function Q(e,n){const t=a.useContext(W),[s,o]=a.useState(null),r=a.useRef(),{current:i}=a.useRef({mapLib:null,map:null});a.useEffect(()=>{const f=e.mapLib;let u=!0,d;return Promise.resolve(f||H(()=>import("./maplibre-gl-ECl9hv9h.js").then(h=>h.m),__vite__mapDeps([0,1]))).then(h=>{if(!u)return;if(!h)throw new Error("Invalid mapLib");const m="Map"in h?h:h.default;if(!m.Map)throw new Error("Invalid mapLib");X(m,e),e.reuseMaps&&(d=w.reuse(e,r.current)),d||(d=new w(m.Map,e,r.current)),i.map=J(d),i.mapLib=m,o(d),t==null||t.onMapMount(i.map,e.id)}).catch(h=>{const{onError:m}=e;m?m({type:"error",target:null,originalEvent:null,error:h}):console.error(h)}),()=>{u=!1,d&&(t==null||t.onMapUnmount(e.id),e.reuseMaps?d.recycle():d.destroy())}},[]),Y(()=>{s&&s.setProps(e)}),a.useImperativeHandle(n,()=>i.map,[s]);const c=a.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),l={height:"100%"};return a.createElement("div",{id:e.id,ref:r,style:c},s&&a.createElement(x.Provider,{value:i},a.createElement("div",{"mapboxgl-children":"",style:l},e.children)))}const de=a.forwardRef(Q),ee=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function E(e,n){if(!e||!n)return;const t=e.style;for(const s in n){const o=n[s];Number.isFinite(o)&&!ee.test(s)?t[s]=`${o}px`:t[s]=o}}function j(e,n){if(e===n)return null;const t=F(e),s=F(n),o=[];for(const r of s)t.has(r)||o.push(r);for(const r of t)s.has(r)||o.push(r);return o.length===0?null:o}function F(e){return new Set(e?e.trim().split(/\s+/):[])}const me=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useRef({props:e}),r=a.useMemo(()=>{let b=!1;a.Children.forEach(e.children,p=>{p&&(b=!0)});const k={...e,element:b?document.createElement("div"):void 0},_=new s.Marker(k);return _.setLngLat([e.longitude,e.latitude]),_.getElement().addEventListener("click",p=>{var y,g;(g=(y=o.current.props).onClick)==null||g.call(y,{type:"click",target:_,originalEvent:p})}),_.on("dragstart",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragStart)==null||C.call(g,y)}),_.on("drag",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDrag)==null||C.call(g,y)}),_.on("dragend",p=>{var g,C;const y=p;y.lngLat=r.getLngLat(),(C=(g=o.current.props).onDragEnd)==null||C.call(g,y)}),_},[]);a.useEffect(()=>(r.addTo(t.getMap()),()=>{r.remove()}),[]);const{longitude:i,latitude:c,offset:l,style:f,draggable:u=!1,popup:d=null,rotation:h=0,rotationAlignment:m="auto",pitchAlignment:v="auto"}=e;a.useEffect(()=>{E(r.getElement(),f)},[f]),a.useImperativeHandle(n,()=>r,[]);const S=o.current.props;(r.getLngLat().lng!==i||r.getLngLat().lat!==c)&&r.setLngLat([i,c]),l&&!Z(r.getOffset(),l)&&r.setOffset(l),r.isDraggable()!==u&&r.setDraggable(u),r.getRotation()!==h&&r.setRotation(h),r.getRotationAlignment()!==m&&r.setRotationAlignment(m),r.getPitchAlignment()!==v&&r.setPitchAlignment(v),r.getPopup()!==d&&r.setPopup(d);const R=j(S.className,e.className);if(R)for(const b of R)r.toggleClassName(b);return o.current.props=e,D.createPortal(e.children,r.getElement())})),he=a.memo(a.forwardRef((e,n)=>{const{map:t,mapLib:s}=a.useContext(x),o=a.useMemo(()=>document.createElement("div"),[]),r=a.useRef({props:e}),i=a.useMemo(()=>{const c={...e},l=new s.Popup(c);return l.setLngLat([e.longitude,e.latitude]),l.once("open",f=>{var u,d;(d=(u=r.current.props).onOpen)==null||d.call(u,f)}),l},[]);if(a.useEffect(()=>{const c=l=>{var f,u;(u=(f=r.current.props).onClose)==null||u.call(f,l)};return i.on("close",c),i.setDOMContent(o).addTo(t.getMap()),()=>{i.off("close",c),i.isOpen()&&i.remove()}},[]),a.useEffect(()=>{E(i.getElement(),e.style)},[e.style]),a.useImperativeHandle(n,()=>i,[]),i.isOpen()){const c=r.current.props;(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!L(c.offset,e.offset)&&i.setOffset(e.offset),(c.anchor!==e.anchor||c.maxWidth!==e.maxWidth)&&(i.options.anchor=e.anchor,i.setMaxWidth(e.maxWidth));const l=j(c.className,e.className);if(l)for(const f of l)i.toggleClassName(f);r.current.props=e}return D.createPortal(e.children,o)}));function M(e,n,t,s){const o=a.useContext(x),r=a.useMemo(()=>e(o),[]);return a.useEffect(()=>{const i=n,c=null,l=typeof n=="function"?n:null,{map:f}=o;return f.hasControl(r)||(f.addControl(r,i==null?void 0:i.position),c&&c(o)),()=>{l&&l(o),f.hasControl(r)&&f.removeControl(r)}},[]),r}function te(e){const n=M(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(te);function ne(e){const n=M(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return a.useEffect(()=>{E(n._controlContainer,e.style)},[e.style]),null}a.memo(ne);function oe(e,n){const t=a.useRef({props:e}),s=M(({mapLib:o})=>{const r=new o.GeolocateControl(e),i=r._setupUI;return r._setupUI=()=>{r._container.hasChildNodes()||i()},r.on("geolocate",c=>{var l,f;(f=(l=t.current.props).onGeolocate)==null||f.call(l,c)}),r.on("error",c=>{var l,f;(f=(l=t.current.props).onError)==null||f.call(l,c)}),r.on("outofmaxbounds",c=>{var l,f;(f=(l=t.current.props).onOutOfMaxBounds)==null||f.call(l,c)}),r.on("trackuserlocationstart",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationStart)==null||f.call(l,c)}),r.on("trackuserlocationend",c=>{var l,f;(f=(l=t.current.props).onTrackUserLocationEnd)==null||f.call(l,c)}),r},{position:e.position});return t.current.props=e,a.useImperativeHandle(n,()=>s,[]),a.useEffect(()=>{E(s._container,e.style)},[e.style]),null}a.memo(a.forwardRef(oe));function re(e){const n=M(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(re);function se(e){const n=M(({mapLib:r})=>new r.ScaleControl(e),{position:e.position}),t=a.useRef(e),s=t.current;t.current=e;const{style:o}=e;return e.maxWidth!==void 0&&e.maxWidth!==s.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==s.unit&&n.setUnit(e.unit),a.useEffect(()=>{E(n._container,o)},[o]),null}const ge=a.memo(se);function ie(e){const n=M(({mapLib:t})=>new t.TerrainControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ie);function ae(e){const n=M(({mapLib:t})=>new t.LogoControl(e),{position:e.position});return a.useEffect(()=>{E(n._container,e.style)},[e.style]),null}a.memo(ae);const ce={light:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",dark:"https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json"},le={light:"basemap-light-",dark:"basemap-dark-"},P={};async function ue(e){if(P[e])return P[e];const t=await(await fetch(ce[e])).json();return P[e]=t,t}function ye({mode:e}){const{current:n}=B(),[t,s]=a.useState(null),o=a.useRef({light:!1,dark:!1}),r=a.useRef({light:[],dark:[]}),i=a.useRef(e);a.useEffect(()=>{i.current=e},[e]),a.useEffect(()=>{const u=()=>{var v;const m=(v=n==null?void 0:n.getMap)==null?void 0:v.call(n);m&&!t&&s(m)};u();const d=setInterval(u,50),h=setTimeout(()=>clearInterval(d),5e3);return()=>{clearInterval(d),clearTimeout(h)}},[n,t]);const c=a.useCallback(async(u,d,h)=>{var k,_;if(o.current[d])return;const m=le[d],v=await ue(d),S=[];for(const[p,y]of Object.entries(v.sources||{})){const g=m+p;u.getSource(g)||u.addSource(g,y)}const b=(_=(((k=u.getStyle())==null?void 0:k.layers)||[]).find(p=>!p.id.startsWith("basemap-light-")&&!p.id.startsWith("basemap-dark-")))==null?void 0:_.id;for(const p of v.layers||[]){const y=m+p.id;if(S.push(y),u.getLayer(y))continue;const g={...p,id:y};"source"in g&&typeof g.source=="string"&&(g.source=m+g.source),g.layout||(g.layout={}),g.layout.visibility=h?"visible":"none";try{u.addLayer(g,b)}catch(C){console.warn(`[BasemapLayer] Failed to add layer ${y}:`,C)}}r.current[d]=S,o.current[d]=!0},[]),l=a.useCallback((u,d,h)=>{const m=r.current[d],v=h?"visible":"none";for(const S of m)if(u.getLayer(S))try{u.setLayoutProperty(S,"visibility",v)}catch{}},[]),f=a.useCallback(u=>{var m;const h=(((m=u.getStyle())==null?void 0:m.layers)||[]).filter(v=>!v.id.startsWith("basemap-light-")&&!v.id.startsWith("basemap-dark-"));for(const v of h)try{u.moveLayer(v.id)}catch{}},[]);return a.useEffect(()=>{if(!t)return;const u=d=>{t.hasImage(d.id)||t.addImage(d.id,{width:1,height:1,data:new Uint8Array([0,0,0,0])})};return t.on("styleimagemissing",u),()=>{t.off("styleimagemissing",u)}},[t]),a.useEffect(()=>{if(!t)return;let u=!1;const d=async()=>{if(!u)try{const m=i.current;await Promise.all([c(t,"light",m==="light"),c(t,"dark",m==="dark")]),u||(l(t,"light",i.current==="light"),l(t,"dark",i.current==="dark"),f(t),t.resize())}catch(m){console.error("[BasemapLayer] Setup error:",m)}};t.isStyleLoaded()?d():(t.once("style.load",d),t.once("load",()=>{!u&&!o.current.light&&d()}));const h=()=>{u||setTimeout(()=>{!u&&o.current.light&&o.current.dark&&f(t)},100)};return t.on("styledata",h),()=>{u=!0,t.off("styledata",h)}},[t,c,f,l]),a.useEffect(()=>{t&&(!o.current.light||!o.current.dark||(l(t,"light",e==="light"),l(t,"dark",e==="dark"),t.resize(),t.triggerRepaint()))},[t,e,l]),null}export{ye as B,de as M,he as P,ge as S,me as a,x as b,L as d,B as u}; diff --git a/frontend/dist/assets/CADCalibration-DOpFISap.js b/frontend/dist/assets/CADCalibration-DeM92vih.js similarity index 96% rename from frontend/dist/assets/CADCalibration-DOpFISap.js rename to frontend/dist/assets/CADCalibration-DeM92vih.js index 4411fedf..e8ed168d 100644 --- a/frontend/dist/assets/CADCalibration-DOpFISap.js +++ b/frontend/dist/assets/CADCalibration-DeM92vih.js @@ -1,4 +1,4 @@ -import{e as G,dy as S,dz as J,dA as V,r as c,j as e,B as b,dG as W,aD as X,f as C,R as K}from"./index-CAHLMlrb.js";import{P as Q,a as Y,B as Z,C as u}from"./PageLayout-CgrNSpBT.js";import{C as I}from"./ConfirmModal-CNagQaWr.js";import{r as ee}from"./system-CNkSqdfb.js";import{A as te}from"./activity-BAV-4Rxi.js";import{R as _,C as D}from"./Grid-B0tNiHTX.js";import{S as se}from"./save-HCcOmjKD.js";import{S as ae}from"./sparkles-GhffQ44V.js";import{T as $}from"./target-CAfnTnyS.js";import{T as re}from"./timer-DIDXOFnU.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as G,dy as S,dz as J,dA as V,r as c,j as e,B as b,dG as W,aD as X,f as C,R as K}from"./index-CdntfUUz.js";import{P as Q,a as Y,B as Z,C as u}from"./PageLayout-B2kQpvXM.js";import{C as I}from"./ConfirmModal-CB8xdBeW.js";import{r as ee}from"./system-MCOv6vDg.js";import{A as te}from"./activity-02b04F6Q.js";import{R as _,C as D}from"./Grid-DYtN9_Hv.js";import{S as se}from"./save-B0-dg8jU.js";import{S as ae}from"./sparkles-CIoeyoky.js";import{T as $}from"./target-D6g_GBrY.js";import{T as re}from"./timer-nBNC7t-g.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ChatBubble-Cn1oh8mi.js b/frontend/dist/assets/ChatBubble-BXwtJZuf.js similarity index 97% rename from frontend/dist/assets/ChatBubble-Cn1oh8mi.js rename to frontend/dist/assets/ChatBubble-BXwtJZuf.js index 7be2a022..810dc382 100644 --- a/frontend/dist/assets/ChatBubble-Cn1oh8mi.js +++ b/frontend/dist/assets/ChatBubble-BXwtJZuf.js @@ -1 +1 @@ -import{r as M,j as e,c as s,z as W}from"./index-CAHLMlrb.js";import{e as E,g as S,a as V,c as F,f as b,b as y}from"./chat-utils-rMBLw-SJ.js";const v=["","text-[42px]","text-[36px]","text-[30px]"],z=M.memo(function({senderName:x,text:n,timestamp:d,nameAccessory:N,bubbleAccessory:c,className:o,isOutgoing:w,status:t,onRetry:m,onRetryAsFlood:h,retryAttempt:p,maxRetries:l,signed:k,echoCount:r,bubbleVariant:I="accent",onMentionClick:f}){const u=W(),{emoji:j,cleanName:g}=E(x),C=S(g),B=V(x),a=F(n);return w?e.jsxs("div",{className:s("group flex flex-col items-end w-full p-2",o),children:[e.jsxs("div",{className:"flex items-end gap-1.5 max-w-[80%]",children:[c,a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5","rounded-2xl rounded-br-md",t==="failed"?"bg-sys-red depth-raised-soft":"bg-sys-blue depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-white leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:b(n,{isOutgoing:!0,onMentionClick:f})})})]}),e.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-0.5 mr-1",children:[r!=null&&r>0&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-sys-green tabular-nums font-medium",children:[e.jsxs("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M17 1l4 4-4 4"}),e.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),e.jsx("path",{d:"M7 23l-4-4 4-4"}),e.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]}),r]}),t==="confirmed"&&e.jsxs("svg",{className:"w-3 h-3 text-sys-green",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("polyline",{points:"3 12 8 17 14 6"}),e.jsx("polyline",{points:"10 12 15 17 21 6"})]}),t==="sent"&&e.jsx("svg",{className:"w-3 h-3 text-fg-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),t==="pending"&&e.jsx("svg",{className:"w-3 h-3 text-chat-timestamp animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),t==="retrying"&&e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3 text-sys-amber animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),p!=null&&l!=null&&e.jsxs("span",{className:"text-[10px] text-sys-amber font-medium tabular-nums",children:["Retry ",p,"/",l]})]}),t==="unconfirmed"&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-sys-amber flex-shrink-0"}),t==="failed"&&e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"w-3 h-3 text-sys-red",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),l!=null&&l>0&&e.jsxs("span",{className:"text-[10px] text-sys-red/70",children:["after ",l," ",l===1?"retry":"retries"]}),m&&e.jsx("button",{onClick:m,className:"text-[10px] font-medium text-sys-red hover:text-sys-red/80 underline underline-offset-2 transition-colors",children:"Retry"}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] text-fg-muted/50",children:"·"}),e.jsx("button",{onClick:h,className:"text-[10px] font-medium text-sys-amber hover:text-sys-amber/80 underline underline-offset-2 transition-colors",children:"Flood"})]})]}),e.jsx("span",{className:"text-[10px] text-chat-timestamp tabular-nums",children:y(d,u)})]})]}):e.jsxs("div",{className:s("group flex items-start gap-4 w-full p-2",o),children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:s("clay-avatar w-9 h-9",j?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":C},children:j||B}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:y(d,u)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:g}),k&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]}),N]}),e.jsxs("div",{className:"flex items-end gap-1.5",children:[a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5 max-w-full","rounded-2xl rounded-tl-md","bg-chat-incoming depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:b(n,{onMentionClick:f})})}),c]})]})]})});function T({text:i}){return e.jsx("div",{className:"flex justify-center my-1",children:e.jsx("span",{className:s("px-3 py-1 rounded-full","bg-subtle-fill text-[11px] text-fg-muted/80 font-medium","ring-1 ring-edge-subtle"),children:i})})}export{z as C,T as S}; +import{r as M,j as e,c as s,z as W}from"./index-CdntfUUz.js";import{e as E,g as S,a as V,c as F,f as b,b as y}from"./chat-utils-D8ZwjCT3.js";const v=["","text-[42px]","text-[36px]","text-[30px]"],z=M.memo(function({senderName:x,text:n,timestamp:d,nameAccessory:N,bubbleAccessory:c,className:o,isOutgoing:w,status:t,onRetry:m,onRetryAsFlood:h,retryAttempt:p,maxRetries:l,signed:k,echoCount:r,bubbleVariant:I="accent",onMentionClick:f}){const u=W(),{emoji:j,cleanName:g}=E(x),C=S(g),B=V(x),a=F(n);return w?e.jsxs("div",{className:s("group flex flex-col items-end w-full p-2",o),children:[e.jsxs("div",{className:"flex items-end gap-1.5 max-w-[80%]",children:[c,a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5","rounded-2xl rounded-br-md",t==="failed"?"bg-sys-red depth-raised-soft":"bg-sys-blue depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-white leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:b(n,{isOutgoing:!0,onMentionClick:f})})})]}),e.jsxs("div",{className:"flex items-center justify-end gap-1.5 mt-0.5 mr-1",children:[r!=null&&r>0&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] text-sys-green tabular-nums font-medium",children:[e.jsxs("svg",{className:"w-2.5 h-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("path",{d:"M17 1l4 4-4 4"}),e.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),e.jsx("path",{d:"M7 23l-4-4 4-4"}),e.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]}),r]}),t==="confirmed"&&e.jsxs("svg",{className:"w-3 h-3 text-sys-green",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[e.jsx("polyline",{points:"3 12 8 17 14 6"}),e.jsx("polyline",{points:"10 12 15 17 21 6"})]}),t==="sent"&&e.jsx("svg",{className:"w-3 h-3 text-fg-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),t==="pending"&&e.jsx("svg",{className:"w-3 h-3 text-chat-timestamp animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),t==="retrying"&&e.jsxs(e.Fragment,{children:[e.jsx("svg",{className:"w-3 h-3 text-sys-amber animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),p!=null&&l!=null&&e.jsxs("span",{className:"text-[10px] text-sys-amber font-medium tabular-nums",children:["Retry ",p,"/",l]})]}),t==="unconfirmed"&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-sys-amber flex-shrink-0"}),t==="failed"&&e.jsxs(e.Fragment,{children:[e.jsxs("svg",{className:"w-3 h-3 text-sys-red",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),l!=null&&l>0&&e.jsxs("span",{className:"text-[10px] text-sys-red/70",children:["after ",l," ",l===1?"retry":"retries"]}),m&&e.jsx("button",{onClick:m,className:"text-[10px] font-medium text-sys-red hover:text-sys-red/80 underline underline-offset-2 transition-colors",children:"Retry"}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-[10px] text-fg-muted/50",children:"·"}),e.jsx("button",{onClick:h,className:"text-[10px] font-medium text-sys-amber hover:text-sys-amber/80 underline underline-offset-2 transition-colors",children:"Flood"})]})]}),e.jsx("span",{className:"text-[10px] text-chat-timestamp tabular-nums",children:y(d,u)})]})]}):e.jsxs("div",{className:s("group flex items-start gap-4 w-full p-2",o),children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:s("clay-avatar w-9 h-9",j?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":C},children:j||B}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:y(d,u)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:g}),k&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]}),N]}),e.jsxs("div",{className:"flex items-end gap-1.5",children:[a>0?e.jsx("p",{className:s("leading-none",v[a]),children:n.trim()}):e.jsx("div",{className:s("inline-block px-3.5 py-2.5 max-w-full","rounded-2xl rounded-tl-md","bg-chat-incoming depth-raised-soft"),children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:b(n,{onMentionClick:f})})}),c]})]})]})});function T({text:i}){return e.jsx("div",{className:"flex justify-center my-1",children:e.jsx("span",{className:s("px-3 py-1 rounded-full","bg-subtle-fill text-[11px] text-fg-muted/80 font-medium","ring-1 ring-edge-subtle"),children:i})})}export{z as C,T as S}; diff --git a/frontend/dist/assets/CollisionExplorerModal-Y5-HwcN-.js b/frontend/dist/assets/CollisionExplorerModal-brcQ7JMt.js similarity index 96% rename from frontend/dist/assets/CollisionExplorerModal-Y5-HwcN-.js rename to frontend/dist/assets/CollisionExplorerModal-brcQ7JMt.js index 38fd066c..5f2389c4 100644 --- a/frontend/dist/assets/CollisionExplorerModal-Y5-HwcN-.js +++ b/frontend/dist/assets/CollisionExplorerModal-brcQ7JMt.js @@ -1 +1 @@ -import{r as c,ad as L,cm as S,ag as H,j as e,aB as k,b_ as R,aC as B,d4 as E,c3 as T,c as N,at as P,a2 as M,aa as _,a7 as D,a8 as z,cy as I}from"./index-CAHLMlrb.js";import{M as W,B as F,a as q}from"./BasemapLayer-VyMOdkaO.js";import{S as A,L as U}from"./layer-DnHLn7Jx.js";import{M as Y}from"./map-pin-CNePTCsc.js";import{S as $}from"./share-2-DIHBn1T5.js";import{M as G}from"./monitor-smartphone-DMj7GqcL.js";const J={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"};function w({node:o,isHovered:v,onHover:f}){const[g,p]=c.useState(!1),b=c.useCallback(async d=>{d.stopPropagation(),await _(o.hash),p(!0),setTimeout(()=>p(!1),2e3)},[o.hash]),h=o.contactType.toLowerCase(),m=h.includes("room")||h.includes("server"),l=h==="companion"||h==="client";let n=$,r="text-sys-blue";return m?(n=I,r="text-signal-fair"):l?(n=G,r="text-fg-muted"):o.isNeighbor&&(r="text-sys-green"),e.jsxs("div",{className:N("flex items-center gap-3 px-3 py-2.5 radius-inner transition-base cursor-pointer",v?"bg-sys-blue/10":"hover:bg-subtle-fill"),onMouseEnter:()=>f(o.hash),onMouseLeave:()=>f(null),children:[e.jsx(n,{className:N("w-4 h-4 flex-shrink-0",r)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"type-label text-fg-primary truncate",children:o.name}),o.isNeighbor&&e.jsx(M,{color:"green",compact:!0,children:"NBR"}),o.isRepeater&&e.jsx(M,{color:"zinc",compact:!0,children:"RPT"}),o.isHub&&e.jsx(M,{color:"indigo",compact:!0,children:"HUB"})]}),e.jsxs("button",{onClick:b,className:N("mt-1 inline-flex items-center gap-1 type-data-xs px-1.5 py-0.5 rounded","border transition-all cursor-pointer",g?"border-sys-green/50 bg-sys-green/10 text-sys-green":"border-edge-subtle bg-subtle/50 text-fg-muted hover:border-edge-strong"),title:`Copy: ${o.hash}`,children:[o.hash.slice(0,12),"…",g?e.jsx(D,{className:"w-2.5 h-2.5"}):e.jsx(z,{className:"w-2.5 h-2.5 opacity-50"})]})]})]})}function C({nodes:o,hoveredHash:v,onHover:f}){const g=E(),p=c.useRef(null),b=T(),[h,m]=c.useState(!1),l=c.useMemo(()=>o.filter(a=>a.latitude!=null&&a.longitude!=null&&(a.latitude!==0||a.longitude!==0)),[o]),n=c.useMemo(()=>{if(l.length===0)return null;let a=1/0,s=-1/0,t=1/0,i=-1/0;for(const x of l)a=Math.min(a,x.longitude),s=Math.max(s,x.longitude),t=Math.min(t,x.latitude),i=Math.max(i,x.latitude);const u=.01;if(i-tn?{longitude:(n[0][0]+n[1][0])/2,latitude:(n[0][1]+n[1][1])/2}:{longitude:0,latitude:0},[n]),d=c.useMemo(()=>{if(l.length<2)return null;const a=[];for(let s=0;s{var s;const a=(s=p.current)==null?void 0:s.getMap();if(!a||!n){m(!0);return}a.fitBounds(n,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:13,duration:0}),setTimeout(()=>m(!0),50)},[n]),y=b&&h;return l.length===0?e.jsx("div",{className:"h-full flex items-center justify-center bg-subtle/30 radius-inner",children:e.jsxs("div",{className:"text-center text-fg-secondary p-4",children:[e.jsx(Y,{className:"w-8 h-8 mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No location data available"})]})}):e.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden bg-elevated",children:[e.jsx("div",{className:N("absolute inset-0 flex items-center justify-center z-10","transition-opacity duration-200 pointer-events-none",y?"opacity-0":"opacity-100 bg-elevated"),children:e.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),e.jsx("div",{className:N("h-full w-full transition-opacity duration-200",y?"opacity-100":"opacity-0"),children:e.jsxs(W,{ref:p,initialViewState:{longitude:r.longitude,latitude:r.latitude,zoom:10},style:{height:"100%",width:"100%"},mapStyle:J,attributionControl:!1,onLoad:j,children:[e.jsx(F,{mode:g}),d&&e.jsx(A,{id:"collision-edges",type:"geojson",data:d,children:e.jsx(U,{id:"collision-edges-line",type:"line",paint:{"line-color":"#3B3F4A","line-width":2,"line-opacity":.8},layout:{"line-cap":"round","line-join":"round"}})}),l.map(a=>{const s=a.hash===v,t=P(a.hash);return e.jsx(q,{longitude:a.longitude,latitude:a.latitude,anchor:"center",children:e.jsx("div",{className:"cursor-pointer transition-all duration-150",onMouseEnter:()=>f(a.hash),onMouseLeave:()=>f(null),style:{pointerEvents:"auto"},children:e.jsxs(M,{color:"amber",filled:!0,className:"type-data-xs shadow-lg",children:[t,s&&e.jsx("span",{className:"ml-1 opacity-75 font-sans",children:a.name})]})})},a.hash)})]})})]})}function Q({isOpen:o,prefix:v,candidateHashes:f,onClose:g}){const p=L(),b=S(),h=H(),[m,l]=c.useState(null),n=c.useMemo(()=>new Set(h.map(s=>s.hash)),[h]),r=(p==null?void 0:p.neighbors)??{},d=c.useMemo(()=>{const s=t=>{if(r[t])return r[t];if(!t.startsWith("0x")&&r["0x"+t])return r["0x"+t];if(t.startsWith("0x")&&r[t.slice(2)])return r[t.slice(2)]};return f.map(t=>{var u;const i=s(t);return{hash:t,name:(i==null?void 0:i.node_name)||(i==null?void 0:i.name)||`Unknown (${t.slice(0,8)}…)`,contactType:(i==null?void 0:i.contact_type)||"",isRepeater:(i==null?void 0:i.is_repeater)||((u=i==null?void 0:i.contact_type)==null?void 0:u.toLowerCase())==="repeater"||!1,isNeighbor:n.has(t)||n.has("0x"+t)||n.has(t.replace(/^0x/,"")),isHub:b.has(t),latitude:i==null?void 0:i.latitude,longitude:i==null?void 0:i.longitude}}).sort((t,i)=>t.isNeighbor!==i.isNeighbor?t.isNeighbor?-1:1:t.isHub!==i.isHub?t.isHub?-1:1:t.name.localeCompare(i.name))},[f,r,n,b]),j=c.useMemo(()=>d.some(s=>s.latitude!=null&&s.longitude!=null&&(s.latitude!==0||s.longitude!==0)),[d]),y=c.useCallback(s=>{l(s)},[]),a=j?"4xl":"lg";return o?e.jsxs(k,{open:o,onClose:g,size:a,motionPlus:!0,className:j?"sm:h-[500px] sm:max-h-[600px]":"",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-edge-subtle",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 radius-inner bg-signal-fair/10",children:e.jsx(R,{className:"w-5 h-5 text-signal-fair"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"type-micro",children:["Prefix Collision: ",e.jsx("span",{className:"font-mono text-sys-blue",children:v})]}),e.jsxs("p",{className:"text-xs text-fg-secondary",children:[d.length," nodes share this prefix"]})]})]}),e.jsx("button",{onClick:g,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:g,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.jsxs(B,{className:"p-0 overflow-hidden flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"sm:hidden flex-1 overflow-y-auto",children:[j&&e.jsx("div",{className:"h-64 p-2 border-b border-edge-subtle",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:y})}),e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:y},s.hash))})]}),j?e.jsxs("div",{className:"hidden sm:grid sm:grid-cols-[280px_minmax(400px,1fr)] flex-1 overflow-hidden sm:min-w-[700px]",children:[e.jsx("div",{className:"overflow-y-auto border-r border-edge-subtle",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:y},s.hash))})}),e.jsx("div",{className:"overflow-hidden p-2",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:y})})]}):e.jsx("div",{className:"hidden sm:block flex-1 overflow-y-auto",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:y},s.hash))})})]})]}):null}const se=c.memo(Q);export{se as C}; +import{r as c,ad as L,cm as S,ag as H,j as e,aB as k,b_ as R,aC as B,d4 as E,c3 as T,c as N,at as P,a2 as M,aa as _,a7 as D,a8 as z,cy as I}from"./index-CdntfUUz.js";import{M as W,B as F,a as q}from"./BasemapLayer-U4r1eipM.js";import{S as A,L as U}from"./layer-BRKnZ2f8.js";import{M as Y}from"./map-pin-ADTzwr8W.js";import{S as $}from"./share-2-ceQyHw_t.js";import{M as G}from"./monitor-smartphone-X03XrJWF.js";const J={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"};function w({node:o,isHovered:v,onHover:f}){const[g,p]=c.useState(!1),b=c.useCallback(async d=>{d.stopPropagation(),await _(o.hash),p(!0),setTimeout(()=>p(!1),2e3)},[o.hash]),h=o.contactType.toLowerCase(),m=h.includes("room")||h.includes("server"),l=h==="companion"||h==="client";let n=$,r="text-sys-blue";return m?(n=I,r="text-signal-fair"):l?(n=G,r="text-fg-muted"):o.isNeighbor&&(r="text-sys-green"),e.jsxs("div",{className:N("flex items-center gap-3 px-3 py-2.5 radius-inner transition-base cursor-pointer",v?"bg-sys-blue/10":"hover:bg-subtle-fill"),onMouseEnter:()=>f(o.hash),onMouseLeave:()=>f(null),children:[e.jsx(n,{className:N("w-4 h-4 flex-shrink-0",r)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"type-label text-fg-primary truncate",children:o.name}),o.isNeighbor&&e.jsx(M,{color:"green",compact:!0,children:"NBR"}),o.isRepeater&&e.jsx(M,{color:"zinc",compact:!0,children:"RPT"}),o.isHub&&e.jsx(M,{color:"indigo",compact:!0,children:"HUB"})]}),e.jsxs("button",{onClick:b,className:N("mt-1 inline-flex items-center gap-1 type-data-xs px-1.5 py-0.5 rounded","border transition-all cursor-pointer",g?"border-sys-green/50 bg-sys-green/10 text-sys-green":"border-edge-subtle bg-subtle/50 text-fg-muted hover:border-edge-strong"),title:`Copy: ${o.hash}`,children:[o.hash.slice(0,12),"…",g?e.jsx(D,{className:"w-2.5 h-2.5"}):e.jsx(z,{className:"w-2.5 h-2.5 opacity-50"})]})]})]})}function C({nodes:o,hoveredHash:v,onHover:f}){const g=E(),p=c.useRef(null),b=T(),[h,m]=c.useState(!1),l=c.useMemo(()=>o.filter(a=>a.latitude!=null&&a.longitude!=null&&(a.latitude!==0||a.longitude!==0)),[o]),n=c.useMemo(()=>{if(l.length===0)return null;let a=1/0,s=-1/0,t=1/0,i=-1/0;for(const x of l)a=Math.min(a,x.longitude),s=Math.max(s,x.longitude),t=Math.min(t,x.latitude),i=Math.max(i,x.latitude);const u=.01;if(i-tn?{longitude:(n[0][0]+n[1][0])/2,latitude:(n[0][1]+n[1][1])/2}:{longitude:0,latitude:0},[n]),d=c.useMemo(()=>{if(l.length<2)return null;const a=[];for(let s=0;s{var s;const a=(s=p.current)==null?void 0:s.getMap();if(!a||!n){m(!0);return}a.fitBounds(n,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:13,duration:0}),setTimeout(()=>m(!0),50)},[n]),y=b&&h;return l.length===0?e.jsx("div",{className:"h-full flex items-center justify-center bg-subtle/30 radius-inner",children:e.jsxs("div",{className:"text-center text-fg-secondary p-4",children:[e.jsx(Y,{className:"w-8 h-8 mx-auto mb-2 opacity-40"}),e.jsx("p",{className:"text-sm",children:"No location data available"})]})}):e.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden bg-elevated",children:[e.jsx("div",{className:N("absolute inset-0 flex items-center justify-center z-10","transition-opacity duration-200 pointer-events-none",y?"opacity-0":"opacity-100 bg-elevated"),children:e.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),e.jsx("div",{className:N("h-full w-full transition-opacity duration-200",y?"opacity-100":"opacity-0"),children:e.jsxs(W,{ref:p,initialViewState:{longitude:r.longitude,latitude:r.latitude,zoom:10},style:{height:"100%",width:"100%"},mapStyle:J,attributionControl:!1,onLoad:j,children:[e.jsx(F,{mode:g}),d&&e.jsx(A,{id:"collision-edges",type:"geojson",data:d,children:e.jsx(U,{id:"collision-edges-line",type:"line",paint:{"line-color":"#3B3F4A","line-width":2,"line-opacity":.8},layout:{"line-cap":"round","line-join":"round"}})}),l.map(a=>{const s=a.hash===v,t=P(a.hash);return e.jsx(q,{longitude:a.longitude,latitude:a.latitude,anchor:"center",children:e.jsx("div",{className:"cursor-pointer transition-all duration-150",onMouseEnter:()=>f(a.hash),onMouseLeave:()=>f(null),style:{pointerEvents:"auto"},children:e.jsxs(M,{color:"amber",filled:!0,className:"type-data-xs shadow-lg",children:[t,s&&e.jsx("span",{className:"ml-1 opacity-75 font-sans",children:a.name})]})})},a.hash)})]})})]})}function Q({isOpen:o,prefix:v,candidateHashes:f,onClose:g}){const p=L(),b=S(),h=H(),[m,l]=c.useState(null),n=c.useMemo(()=>new Set(h.map(s=>s.hash)),[h]),r=(p==null?void 0:p.neighbors)??{},d=c.useMemo(()=>{const s=t=>{if(r[t])return r[t];if(!t.startsWith("0x")&&r["0x"+t])return r["0x"+t];if(t.startsWith("0x")&&r[t.slice(2)])return r[t.slice(2)]};return f.map(t=>{var u;const i=s(t);return{hash:t,name:(i==null?void 0:i.node_name)||(i==null?void 0:i.name)||`Unknown (${t.slice(0,8)}…)`,contactType:(i==null?void 0:i.contact_type)||"",isRepeater:(i==null?void 0:i.is_repeater)||((u=i==null?void 0:i.contact_type)==null?void 0:u.toLowerCase())==="repeater"||!1,isNeighbor:n.has(t)||n.has("0x"+t)||n.has(t.replace(/^0x/,"")),isHub:b.has(t),latitude:i==null?void 0:i.latitude,longitude:i==null?void 0:i.longitude}}).sort((t,i)=>t.isNeighbor!==i.isNeighbor?t.isNeighbor?-1:1:t.isHub!==i.isHub?t.isHub?-1:1:t.name.localeCompare(i.name))},[f,r,n,b]),j=c.useMemo(()=>d.some(s=>s.latitude!=null&&s.longitude!=null&&(s.latitude!==0||s.longitude!==0)),[d]),y=c.useCallback(s=>{l(s)},[]),a=j?"4xl":"lg";return o?e.jsxs(k,{open:o,onClose:g,size:a,motionPlus:!0,className:j?"sm:h-[500px] sm:max-h-[600px]":"",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-edge-subtle",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"p-2 radius-inner bg-signal-fair/10",children:e.jsx(R,{className:"w-5 h-5 text-signal-fair"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"type-micro",children:["Prefix Collision: ",e.jsx("span",{className:"font-mono text-sys-blue",children:v})]}),e.jsxs("p",{className:"text-xs text-fg-secondary",children:[d.length," nodes share this prefix"]})]})]}),e.jsx("button",{onClick:g,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:g,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.jsxs(B,{className:"p-0 overflow-hidden flex-1 flex flex-col min-h-0",children:[e.jsxs("div",{className:"sm:hidden flex-1 overflow-y-auto",children:[j&&e.jsx("div",{className:"h-64 p-2 border-b border-edge-subtle",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:y})}),e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:y},s.hash))})]}),j?e.jsxs("div",{className:"hidden sm:grid sm:grid-cols-[280px_minmax(400px,1fr)] flex-1 overflow-hidden sm:min-w-[700px]",children:[e.jsx("div",{className:"overflow-y-auto border-r border-edge-subtle",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:y},s.hash))})}),e.jsx("div",{className:"overflow-hidden p-2",children:e.jsx(C,{nodes:d,hoveredHash:m,onHover:y})})]}):e.jsx("div",{className:"hidden sm:block flex-1 overflow-y-auto",children:e.jsx("div",{className:"p-2",children:d.map(s=>e.jsx(w,{node:s,isHovered:m===s.hash,onHover:y},s.hash))})})]})]}):null}const se=c.memo(Q);export{se as C}; diff --git a/frontend/dist/assets/Companion-B40Pf-xY.js b/frontend/dist/assets/Companion-Dku9E7ui.js similarity index 98% rename from frontend/dist/assets/Companion-B40Pf-xY.js rename to frontend/dist/assets/Companion-Dku9E7ui.js index 652a4302..9c8f3fe5 100644 --- a/frontend/dist/assets/Companion-B40Pf-xY.js +++ b/frontend/dist/assets/Companion-Dku9E7ui.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompanionPathMap-ChNL_sj-.js","assets/index-CAHLMlrb.js","assets/BasemapLayer-VyMOdkaO.js","assets/layer-DnHLn7Jx.js","assets/usePipelineStore-3uhIJZso.js","assets/node-types-CcH5BFf0.js","assets/useReplayTick-Cnehmp7d.js","assets/payload-detail-CniY19rz.js","assets/car-DRknVB1N.js","assets/map-pin-off-Dtf3D6QW.js","assets/monitor-smartphone-DMj7GqcL.js","assets/index-6Dqm8vG_.css","assets/BasemapLayer-B1CfjdFi.css","assets/CompanionEchoMap-UK4pMkKr.js"])))=>i.map(i=>d[i]); -import{aZ as Ra,fM as cs,a$ as Xs,b0 as Ea,a_ as Ys,b1 as Pa,r as l,b2 as Ta,b3 as Se,b6 as rt,aV as ie,ba as Z,b7 as pe,bk as Aa,bb as vt,bf as $a,bg as Fa,bl as Da,bh as lt,bi as Zs,bm as Oa,bj as _e,bn as ds,bo as La,bp as za,bq as st,br as Ba,bs as Ha,bt as Wa,aY as Ua,b8 as Ka,fO as qa,dh as us,fQ as en,bv as Ga,bw as ke,bx as Va,bE as Ja,dv as Qa,dw as Xa,bG as Ya,fR as Za,bu as Ye,bF as tn,bz as er,fS as tr,bI as ms,e as se,j as e,c as A,a7 as ge,fT as sr,w as nr,d2 as ne,cy as it,R as Be,bO as ot,fd as Ie,fe as Me,ff as Re,d as he,fU as ar,fV as rr,fW as te,m as ae,fX as lr,cY as He,aB as ve,aL as Ee,aD as We,aC as Ne,a9 as oe,b_ as Ue,eU as Pe,B as H,fY as sn,fZ as ct,ax as ir,$ as or,z as Ct,f_ as ps,aA as cr,aF as dr,_ as nn,ce as ur,a2 as $e,f$ as St,cL as mr,N as xs,g0 as pr,dQ as xr,g1 as _t,g2 as hr,g3 as fr,bK as Nt,g4 as gr,g5 as yr,g6 as br,dB as jr,dF as vr,eN as Nr,d9 as wr,a8 as It,eq as kr,g7 as Cr,g8 as Sr,g9 as an,ga as _r,ae as Ir,gb as Mr,gc as rn,fB as Rr,gd as Er,ge as Pr,I as me,C as hs,gf as ln,gg as Tr,gh as Ar,gi as $r,gj as Fr,gk as Dr,gl as Or,gm as Lr,gn as zr,go as Br,gp as Hr,ad as Wr,gq as Ur,gr as Kr,gs as qr,gt as Gr,gu as Vr,gv as Jr,gw as Qr,gx as Xr,gy as Yr,gz as Zr,gA as el,gB as tl,eP as sl}from"./index-CAHLMlrb.js";import{P as fs,a as gs,B as ys,C as bs}from"./PageLayout-CgrNSpBT.js";import{e as dt,g as ut,a as mt,f as nl,b as al}from"./chat-utils-rMBLw-SJ.js";import{c as js,S as rl,a as ll}from"./SignalIndicator-BN0oxyDe.js";import{b as il,F as ol,y as cl,R as dl,T as ul,w as ml,A as pl}from"./floating-BAAXcOzg.js";import{p as xl,a as Ze,c as J,f as Qe,b as hl,L as fl,S as Xe,s as gl,u as yl}from"./element-movement-SAlxPSM7.js";import{s as bl}from"./use-text-value-B1ySk7If.js";import{F as jl}from"./use-tree-walker-DIk49Ly7.js";import{a as et}from"./index-R7zviCWb.js";import{M as fe}from"./monitor-smartphone-DMj7GqcL.js";import{S as vs}from"./search-C1Hut7GR.js";import{S as vl}from"./share-2-DIHBn1T5.js";import{R as Ke,L as Nl}from"./route-B8rlrav9.js";import{R as on}from"./rotate-ccw-Cav5SApM.js";import{T as qe}from"./trash-2-ChI2Sf6Z.js";import{H as Fe}from"./hash-Cs4BXjcy.js";import{C as wl}from"./check-check-CV8IAFCF.js";import{P as Ge}from"./plus-Be4DsW2a.js";import{S as kl,C as Cl}from"./ChatBubble-Cn1oh8mi.js";import{p as Sl}from"./payload-detail-CniY19rz.js";import{A as _l}from"./arrow-down-COuxy1kb.js";import{C as Il}from"./WorkspaceNav-ClxMgBhr.js";import{C as cn}from"./circle-alert-D6qb8WSp.js";import{f as Ml,c as Rl,a as El,M as Pl}from"./variants-DqP1b_He.js";import{M as dn}from"./map-pin-CNePTCsc.js";import{C as un}from"./clock-DB7tKCHV.js";import{A as mn}from"./activity-BAV-4Rxi.js";import{T as pn}from"./thermometer-_L_juB2l.js";import{U as Mt}from"./upload-N2aZrMEC.js";import{S as Tl}from"./shield-check-DX3QVGvb.js";import{W as Ns}from"./wand-sparkles-C18LiNtQ.js";import{S as Al}from"./save-HCcOmjKD.js";import{C as $l}from"./compass-Dolk-EbB.js";import{G as ws}from"./git-branch-BIN5tJ3h.js";import{F as re,L as le,D as Ce}from"./fieldset-DJGo6TXB.js";import{C as xn}from"./ConfirmModal-CNagQaWr.js";import{K as hn}from"./key-round-CZ_hGBwN.js";import{F as fn,R as Fl}from"./radio-group-DyBWNwhI.js";import{P as Dl}from"./pencil--wb87xjW.js";import"./use-by-comparator-JYMD8MzS.js";var Ol=Object.defineProperty,Ll=(s,t,n)=>t in s?Ol(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n,ks=(s,t,n)=>(Ll(s,typeof t!="symbol"?t+"":t,n),n),ee=(s=>(s[s.Open=0]="Open",s[s.Closed=1]="Closed",s))(ee||{}),nt=(s=>(s[s.Pointer=0]="Pointer",s[s.Other=1]="Other",s))(nt||{}),U=(s=>(s[s.OpenMenu=0]="OpenMenu",s[s.CloseMenu=1]="CloseMenu",s[s.GoToItem=2]="GoToItem",s[s.Search=3]="Search",s[s.ClearSearch=4]="ClearSearch",s[s.RegisterItems=5]="RegisterItems",s[s.UnregisterItems=6]="UnregisterItems",s[s.SetButtonElement=7]="SetButtonElement",s[s.SetItemsElement=8]="SetItemsElement",s[s.SortItems=9]="SortItems",s[s.MarkButtonAsMoved=10]="MarkButtonAsMoved",s))(U||{});function Cs(s,t=n=>n){let n=s.activeItemIndex!==null?s.items[s.activeItemIndex]:null,a=Pa(t(s.items.slice()),i=>i.dataRef.current.domRef.current),r=n?a.indexOf(n):null;return r===-1&&(r=null),{items:a,activeItemIndex:r}}let zl={1(s){if(s.menuState===1)return s;let t=s.buttonElement?Ze.Tracked(hl(s.buttonElement)):s.buttonPositionState;return{...s,activeItemIndex:null,pendingFocus:{focus:J.Nothing},menuState:1,buttonPositionState:t}},0(s,t){return s.menuState===0?s:{...s,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:Ze.Idle}},2:(s,t)=>{var n,a,r,i,o;if(s.menuState===1)return s;let m={...s,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===J.Nothing)return{...m,activeItemIndex:null};if(t.focus===J.Specific)return{...m,activeItemIndex:s.items.findIndex(d=>d.id===t.id)};if(t.focus===J.Previous){let d=s.activeItemIndex;if(d!==null){let x=s.items[d].dataRef.current.domRef,g=Qe(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(g!==null){let h=s.items[g].dataRef.current.domRef;if(((a=x.current)==null?void 0:a.previousElementSibling)===h.current||((r=h.current)==null?void 0:r.previousElementSibling)===null)return{...m,activeItemIndex:g}}}}else if(t.focus===J.Next){let d=s.activeItemIndex;if(d!==null){let x=s.items[d].dataRef.current.domRef,g=Qe(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(g!==null){let h=s.items[g].dataRef.current.domRef;if(((i=x.current)==null?void 0:i.nextElementSibling)===h.current||((o=h.current)==null?void 0:o.nextElementSibling)===null)return{...m,activeItemIndex:g}}}}let c=Cs(s),f=Qe(t,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...m,...c,activeItemIndex:f}},3:(s,t)=>{let n=s.searchQuery!==""?0:1,a=s.searchQuery+t.value.toLowerCase(),r=(s.activeItemIndex!==null?s.items.slice(s.activeItemIndex+n).concat(s.items.slice(0,s.activeItemIndex+n)):s.items).find(o=>{var m;return((m=o.dataRef.current.textValue)==null?void 0:m.startsWith(a))&&!o.dataRef.current.disabled}),i=r?s.items.indexOf(r):-1;return i===-1||i===s.activeItemIndex?{...s,searchQuery:a}:{...s,searchQuery:a,activeItemIndex:i,activationTrigger:1}},4(s){return s.searchQuery===""?s:{...s,searchQuery:"",searchActiveItemIndex:null}},5:(s,t)=>{let n=s.items.concat(t.items.map(r=>r)),a=s.activeItemIndex;return s.pendingFocus.focus!==J.Nothing&&(a=Qe(s.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>s.activeItemIndex,resolveId:r=>r.id,resolveDisabled:r=>r.dataRef.current.disabled})),{...s,items:n,activeItemIndex:a,pendingFocus:{focus:J.Nothing},pendingShouldSort:!0}},6:(s,t)=>{let n=s.items,a=[],r=new Set(t.items);for(let[i,o]of n.entries())if(r.has(o.id)&&(a.push(i),r.delete(o.id),r.size===0))break;if(a.length>0){n=n.slice();for(let i of a.reverse())n.splice(i,1)}return{...s,items:n,activationTrigger:1}},7:(s,t)=>s.buttonElement===t.element?s:{...s,buttonElement:t.element},8:(s,t)=>s.itemsElement===t.element?s:{...s,itemsElement:t.element},9:s=>s.pendingShouldSort?{...s,...Cs(s),pendingShouldSort:!1}:s,10(s){return s.buttonPositionState.kind!=="Tracked"?s:{...s,buttonPositionState:Ze.Moved}}};class Rt extends Ra{constructor(t){super(t),ks(this,"actions",{registerItem:cs(()=>{let n=[],a=new Set;return[(r,i)=>{a.has(i)||(a.add(i),n.push({id:r,dataRef:i}))},()=>(a.clear(),this.send({type:5,items:n.splice(0)}))]}),unregisterItem:cs(()=>{let n=[];return[a=>n.push(a),()=>this.send({type:6,items:n.splice(0)})]})}),ks(this,"selectors",{activeDescendantId(n){var a;let r=n.activeItemIndex,i=n.items;return r===null||(a=i[r])==null?void 0:a.id},isActive(n,a){var r;let i=n.activeItemIndex,o=n.items;return i!==null?((r=o[i])==null?void 0:r.id)===a:!1},shouldScrollIntoView(n,a){return n.__demoMode||n.menuState!==0||n.activationTrigger===0?!1:this.isActive(n,a)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,a=Xs.get(null);this.disposables.add(a.on(Ea.Push,r=>{!a.selectors.isTop(r,n)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>a.actions.push(n)),this.on(1,()=>a.actions.pop(n))}this.disposables.group(n=>{this.on(1,a=>{a.buttonElement&&(n.dispose(),n.add(xl(a.buttonElement,a.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new Rt({id:t,__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:J.Nothing},buttonPositionState:Ze.Idle})}reduce(t,n){return Ys(n.type,zl,t,n)}}const gn=l.createContext(null);function Et(s){let t=l.useContext(gn);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,yn),n}return t}function yn({id:s,__demoMode:t=!1}){let n=l.useMemo(()=>Rt.new({id:s,__demoMode:t}),[]);return Ta(()=>n.dispose()),n}let Bl=l.Fragment;function Hl(s,t){let n=l.useId(),{__demoMode:a=!1,...r}=s,i=yn({id:n,__demoMode:a}),[o,m,c]=pe(i,S=>[S.menuState,S.itemsElement,S.buttonElement]),f=rt(t),d=Xs.get(null),x=pe(d,l.useCallback(S=>d.selectors.isTop(S,n),[d,n]));Ja(x,[c,m],(S,b)=>{var E;i.send({type:U.CloseMenu}),Qa(b,Xa.Loose)||(S.preventDefault(),(E=i.state.buttonElement)==null||E.focus())});let g=ie(()=>{i.send({type:U.CloseMenu})}),h=lt({open:o===ee.Open,close:g}),u={ref:f},v=_e();return ke.createElement(pl,null,ke.createElement(gn.Provider,{value:i},ke.createElement(Ya,{value:Ys(o,{[ee.Open]:st.Open,[ee.Closed]:st.Closed})},v({ourProps:u,theirProps:r,slot:h,defaultTag:Bl,name:"Menu"}))))}let Wl="button";function Ul(s,t){let n=Et("Menu.Button"),a=l.useId(),{id:r=`headlessui-menu-button-${a}`,disabled:i=!1,autoFocus:o=!1,...m}=s,c=l.useRef(null),f=il(),d=rt(t,c,ol(),ie(j=>n.send({type:U.SetButtonElement,element:j}))),x=ie(j=>{switch(j.key){case Z.Space:case Z.Enter:case Z.ArrowDown:j.preventDefault(),j.stopPropagation(),n.send({type:U.OpenMenu,focus:{focus:J.First}});break;case Z.ArrowUp:j.preventDefault(),j.stopPropagation(),n.send({type:U.OpenMenu,focus:{focus:J.Last}});break}}),g=ie(j=>{switch(j.key){case Z.Space:j.preventDefault();break}}),[h,u,v]=pe(n,j=>[j.menuState,j.buttonElement,j.itemsElement]),S=h===ee.Open;fl(S,{trigger:u,action:l.useCallback(j=>{if(u!=null&&u.contains(j.target))return Xe.Ignore;let C=j.target.closest('[role="menuitem"]:not([data-disabled])');return Aa(C)?Xe.Select(C):v!=null&&v.contains(j.target)?Xe.Ignore:Xe.Close},[u,v]),close:l.useCallback(()=>n.send({type:U.CloseMenu}),[]),select:l.useCallback(j=>j.click(),[])});let b=gl(j=>{var C;i||(h===ee.Open?(vt.flushSync(()=>n.send({type:U.CloseMenu})),(C=c.current)==null||C.focus({preventScroll:!0})):(j.preventDefault(),n.send({type:U.OpenMenu,focus:{focus:J.Nothing},trigger:nt.Pointer})))}),{isFocusVisible:E,focusProps:I}=$a({autoFocus:o}),{isHovered:_,hoverProps:y}=Fa({isDisabled:i}),{pressed:M,pressProps:$}=Da({disabled:i}),R=lt({open:h===ee.Open,active:M||h===ee.Open,disabled:i,hover:_,focus:E,autofocus:o}),p=Zs(f(),{ref:d,id:r,type:Oa(s,c.current),"aria-haspopup":"menu","aria-controls":v==null?void 0:v.id,"aria-expanded":h===ee.Open,disabled:i||void 0,autoFocus:o,onKeyDown:x,onKeyUp:g},b,I,y,$);return _e()({ourProps:p,theirProps:m,slot:R,defaultTag:Wl,name:"Menu.Button"})}let Kl="div",ql=ms.RenderStrategy|ms.Static;function Gl(s,t){let n=l.useId(),{id:a=`headlessui-menu-items-${n}`,anchor:r,portal:i=!1,modal:o=!0,transition:m=!1,...c}=s,f=cl(r),d=Et("Menu.Items"),[x,g]=dl(f),h=ul(),[u,v]=l.useState(null),S=rt(t,f?x:null,ie(L=>d.send({type:U.SetItemsElement,element:L})),v),[b,E]=pe(d,L=>[L.menuState,L.buttonElement]),I=ds(E),_=ds(u);f&&(i=!0);let y=La(),[M,$]=za(m,u,y!==null?(y&st.Open)===st.Open:b===ee.Open);Ba(M,E,()=>{d.send({type:U.CloseMenu})});let R=pe(d,L=>L.__demoMode),p=R?!1:o&&b===ee.Open;Ha(p,_);let j=R?!1:o&&b===ee.Open;Wa(j,{allowed:l.useCallback(()=>[E,u],[E,u])});let C=pe(d,d.selectors.didButtonMove)?!1:M;l.useEffect(()=>{let L=u;L&&b===ee.Open&&(Ua(L)||L.focus({preventScroll:!0}))},[b,u]),jl(b===ee.Open,{container:u,accept(L){return L.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:L.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(L){L.setAttribute("role","none")}});let k=Ka(),F=ie(L=>{var G,w,T;switch(k.dispose(),L.key){case Z.Space:if(d.state.searchQuery!=="")return L.preventDefault(),L.stopPropagation(),d.send({type:U.Search,value:L.key});case Z.Enter:if(L.preventDefault(),L.stopPropagation(),d.state.activeItemIndex!==null){let{dataRef:z}=d.state.items[d.state.activeItemIndex];(w=(G=z.current)==null?void 0:G.domRef.current)==null||w.click()}d.send({type:U.CloseMenu}),en(d.state.buttonElement);break;case Z.ArrowDown:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.Next});case Z.ArrowUp:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.Previous});case Z.Home:case Z.PageUp:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.First});case Z.End:case Z.PageDown:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.Last});case Z.Escape:L.preventDefault(),L.stopPropagation(),vt.flushSync(()=>d.send({type:U.CloseMenu})),(T=d.state.buttonElement)==null||T.focus({preventScroll:!0});break;case Z.Tab:L.preventDefault(),L.stopPropagation(),vt.flushSync(()=>d.send({type:U.CloseMenu})),qa(d.state.buttonElement,L.shiftKey?us.Previous:us.Next);break;default:L.key.length===1&&(d.send({type:U.Search,value:L.key}),k.setTimeout(()=>d.send({type:U.ClearSearch}),350));break}}),N=ie(L=>{switch(L.key){case Z.Space:L.preventDefault();break}}),D=lt({open:b===ee.Open}),q=Zs(f?h():{},{"aria-activedescendant":pe(d,d.selectors.activeDescendantId),"aria-labelledby":pe(d,L=>{var G;return(G=L.buttonElement)==null?void 0:G.id}),id:a,onKeyDown:F,onKeyUp:N,role:"menu",tabIndex:b===ee.Open?0:void 0,ref:S,style:{...c.style,...g,"--button-width":ml(M,E,!0).width},...Ga($)}),X=_e();return ke.createElement(Va,{enabled:i?s.static||M:!1,ownerDocument:I},X({ourProps:q,theirProps:c,slot:D,defaultTag:Kl,features:ql,visible:C,name:"Menu.Items"}))}let Vl=l.Fragment;function Jl(s,t){let n=l.useId(),{id:a=`headlessui-menu-item-${n}`,disabled:r=!1,...i}=s,o=Et("Menu.Item"),m=pe(o,C=>o.selectors.isActive(C,a)),c=l.useRef(null),f=rt(t,c),d=pe(o,C=>o.selectors.shouldScrollIntoView(C,a));Ye(()=>{if(d)return er().requestAnimationFrame(()=>{var C,k;(k=(C=c.current)==null?void 0:C.scrollIntoView)==null||k.call(C,{block:"nearest"})})},[d,c]);let x=bl(c),g=l.useRef({disabled:r,domRef:c,get textValue(){return x()}});Ye(()=>{g.current.disabled=r},[g,r]),Ye(()=>(o.actions.registerItem(a,g),()=>o.actions.unregisterItem(a)),[g,a]);let h=ie(()=>{o.send({type:U.CloseMenu})}),u=ie(C=>{if(r)return C.preventDefault();o.send({type:U.CloseMenu}),en(o.state.buttonElement)}),v=ie(()=>{if(r)return o.send({type:U.GoToItem,focus:J.Nothing});o.send({type:U.GoToItem,focus:J.Specific,id:a})}),S=yl(),b=ie(C=>S.update(C)),E=ie(C=>{S.wasMoved(C)&&(r||m||o.send({type:U.GoToItem,focus:J.Specific,id:a,trigger:nt.Pointer}))}),I=ie(C=>{S.wasMoved(C)&&(r||m&&o.state.activationTrigger===nt.Pointer&&o.send({type:U.GoToItem,focus:J.Nothing}))}),[_,y]=tn(),[M,$]=tr(),R=lt({active:m,focus:m,disabled:r,close:h}),p={id:a,ref:f,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-labelledby":_,"aria-describedby":M,disabled:void 0,onClick:u,onFocus:v,onPointerEnter:b,onMouseEnter:b,onPointerMove:E,onMouseMove:E,onPointerLeave:I,onMouseLeave:I},j=_e();return ke.createElement(y,null,ke.createElement($,null,j({ourProps:p,theirProps:i,slot:R,defaultTag:Vl,name:"Menu.Item"})))}let Ql="div";function Xl(s,t){let[n,a]=tn(),r=s,i={ref:t,"aria-labelledby":n,role:"group"},o=_e();return ke.createElement(a,null,o({ourProps:i,theirProps:r,slot:{},defaultTag:Ql,name:"Menu.Section"}))}let Yl="header";function Zl(s,t){let n=l.useId(),{id:a=`headlessui-menu-heading-${n}`,...r}=s,i=Za();Ye(()=>i.register(a),[a,i.register]);let o={id:a,ref:t,role:"presentation",...i.props};return _e()({ourProps:o,theirProps:r,slot:{},defaultTag:Yl,name:"Menu.Heading"})}let ei="div";function ti(s,t){let n=s,a={ref:t,role:"separator"};return _e()({ourProps:a,theirProps:n,slot:{},defaultTag:ei,name:"Menu.Separator"})}let si=Se(Hl),bn=Se(Ul),jn=Se(Gl),wt=Se(Jl),ni=Se(Xl),ai=Se(Zl),vn=Se(ti),ri=Object.assign(si,{Button:bn,Items:jn,Item:wt,Section:ni,Heading:ai,Separator:vn});/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CompanionPathMap-Cld9nrKm.js","assets/index-CdntfUUz.js","assets/BasemapLayer-U4r1eipM.js","assets/layer-BRKnZ2f8.js","assets/usePipelineStore-B9TPEPcv.js","assets/node-types-rkAZo2WA.js","assets/useReplayTick-C7ZhPZyZ.js","assets/payload-detail-D7dyXv-d.js","assets/car-B1uDaAVL.js","assets/map-pin-off-DdXFAKLD.js","assets/monitor-smartphone-X03XrJWF.js","assets/index-6Dqm8vG_.css","assets/BasemapLayer-B1CfjdFi.css","assets/CompanionEchoMap-Dx-5FVVv.js"])))=>i.map(i=>d[i]); +import{aZ as Ra,fM as cs,a$ as Xs,b0 as Ea,a_ as Ys,b1 as Pa,r as l,b2 as Ta,b3 as Se,b6 as rt,aV as ie,ba as Z,b7 as pe,bk as Aa,bb as vt,bf as $a,bg as Fa,bl as Da,bh as lt,bi as Zs,bm as Oa,bj as _e,bn as ds,bo as La,bp as za,bq as st,br as Ba,bs as Ha,bt as Wa,aY as Ua,b8 as Ka,fO as qa,dh as us,fQ as en,bv as Ga,bw as ke,bx as Va,bE as Ja,dv as Qa,dw as Xa,bG as Ya,fR as Za,bu as Ye,bF as tn,bz as er,fS as tr,bI as ms,e as se,j as e,c as A,a7 as ge,fT as sr,w as nr,d2 as ne,cy as it,R as Be,bO as ot,fd as Ie,fe as Me,ff as Re,d as he,fU as ar,fV as rr,fW as te,m as ae,fX as lr,cY as He,aB as ve,aL as Ee,aD as We,aC as Ne,a9 as oe,b_ as Ue,eU as Pe,B as H,fY as sn,fZ as ct,ax as ir,$ as or,z as Ct,f_ as ps,aA as cr,aF as dr,_ as nn,ce as ur,a2 as $e,f$ as St,cL as mr,N as xs,g0 as pr,dQ as xr,g1 as _t,g2 as hr,g3 as fr,bK as Nt,g4 as gr,g5 as yr,g6 as br,dB as jr,dF as vr,eN as Nr,d9 as wr,a8 as It,eq as kr,g7 as Cr,g8 as Sr,g9 as an,ga as _r,ae as Ir,gb as Mr,gc as rn,fB as Rr,gd as Er,ge as Pr,I as me,C as hs,gf as ln,gg as Tr,gh as Ar,gi as $r,gj as Fr,gk as Dr,gl as Or,gm as Lr,gn as zr,go as Br,gp as Hr,ad as Wr,gq as Ur,gr as Kr,gs as qr,gt as Gr,gu as Vr,gv as Jr,gw as Qr,gx as Xr,gy as Yr,gz as Zr,gA as el,gB as tl,eP as sl}from"./index-CdntfUUz.js";import{P as fs,a as gs,B as ys,C as bs}from"./PageLayout-B2kQpvXM.js";import{e as dt,g as ut,a as mt,f as nl,b as al}from"./chat-utils-D8ZwjCT3.js";import{c as js,S as rl,a as ll}from"./SignalIndicator-CKCIivNj.js";import{b as il,F as ol,y as cl,R as dl,T as ul,w as ml,A as pl}from"./floating-B9JazpOE.js";import{p as xl,a as Ze,c as J,f as Qe,b as hl,L as fl,S as Xe,s as gl,u as yl}from"./element-movement-rOMuf_3T.js";import{s as bl}from"./use-text-value-DFkKaUWL.js";import{F as jl}from"./use-tree-walker-DwujlxlX.js";import{a as et}from"./index-Bfbz8_Ci.js";import{M as fe}from"./monitor-smartphone-X03XrJWF.js";import{S as vs}from"./search-D8B8LMYr.js";import{S as vl}from"./share-2-ceQyHw_t.js";import{R as Ke,L as Nl}from"./route-CeOQcqdX.js";import{R as on}from"./rotate-ccw-DyxXzFWc.js";import{T as qe}from"./trash-2-Ym16rcs6.js";import{H as Fe}from"./hash-Ccz7W0IK.js";import{C as wl}from"./check-check-D7HV9aAg.js";import{P as Ge}from"./plus-BHawoJ76.js";import{S as kl,C as Cl}from"./ChatBubble-BXwtJZuf.js";import{p as Sl}from"./payload-detail-D7dyXv-d.js";import{A as _l}from"./arrow-down-npn6XFzD.js";import{C as Il}from"./WorkspaceNav-BZrtCI1_.js";import{C as cn}from"./circle-alert-8MQex_uC.js";import{f as Ml,c as Rl,a as El,M as Pl}from"./variants-Bez4f_xY.js";import{M as dn}from"./map-pin-ADTzwr8W.js";import{C as un}from"./clock-DKukpMjT.js";import{A as mn}from"./activity-02b04F6Q.js";import{T as pn}from"./thermometer-qsOxlDrM.js";import{U as Mt}from"./upload-D2RzW6Z5.js";import{S as Tl}from"./shield-check-D7YYO1tX.js";import{W as Ns}from"./wand-sparkles-By2ieoA5.js";import{S as Al}from"./save-B0-dg8jU.js";import{C as $l}from"./compass-CPwUyboh.js";import{G as ws}from"./git-branch-BfTP80e2.js";import{F as re,L as le,D as Ce}from"./fieldset-BJg_kfe0.js";import{C as xn}from"./ConfirmModal-CB8xdBeW.js";import{K as hn}from"./key-round-Cn-7B-WZ.js";import{F as fn,R as Fl}from"./radio-group-CSvEyiPf.js";import{P as Dl}from"./pencil-DwKQKROy.js";import"./use-by-comparator-Dgy5yCaL.js";var Ol=Object.defineProperty,Ll=(s,t,n)=>t in s?Ol(s,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[t]=n,ks=(s,t,n)=>(Ll(s,typeof t!="symbol"?t+"":t,n),n),ee=(s=>(s[s.Open=0]="Open",s[s.Closed=1]="Closed",s))(ee||{}),nt=(s=>(s[s.Pointer=0]="Pointer",s[s.Other=1]="Other",s))(nt||{}),U=(s=>(s[s.OpenMenu=0]="OpenMenu",s[s.CloseMenu=1]="CloseMenu",s[s.GoToItem=2]="GoToItem",s[s.Search=3]="Search",s[s.ClearSearch=4]="ClearSearch",s[s.RegisterItems=5]="RegisterItems",s[s.UnregisterItems=6]="UnregisterItems",s[s.SetButtonElement=7]="SetButtonElement",s[s.SetItemsElement=8]="SetItemsElement",s[s.SortItems=9]="SortItems",s[s.MarkButtonAsMoved=10]="MarkButtonAsMoved",s))(U||{});function Cs(s,t=n=>n){let n=s.activeItemIndex!==null?s.items[s.activeItemIndex]:null,a=Pa(t(s.items.slice()),i=>i.dataRef.current.domRef.current),r=n?a.indexOf(n):null;return r===-1&&(r=null),{items:a,activeItemIndex:r}}let zl={1(s){if(s.menuState===1)return s;let t=s.buttonElement?Ze.Tracked(hl(s.buttonElement)):s.buttonPositionState;return{...s,activeItemIndex:null,pendingFocus:{focus:J.Nothing},menuState:1,buttonPositionState:t}},0(s,t){return s.menuState===0?s:{...s,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:Ze.Idle}},2:(s,t)=>{var n,a,r,i,o;if(s.menuState===1)return s;let m={...s,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===J.Nothing)return{...m,activeItemIndex:null};if(t.focus===J.Specific)return{...m,activeItemIndex:s.items.findIndex(d=>d.id===t.id)};if(t.focus===J.Previous){let d=s.activeItemIndex;if(d!==null){let x=s.items[d].dataRef.current.domRef,g=Qe(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(g!==null){let h=s.items[g].dataRef.current.domRef;if(((a=x.current)==null?void 0:a.previousElementSibling)===h.current||((r=h.current)==null?void 0:r.previousElementSibling)===null)return{...m,activeItemIndex:g}}}}else if(t.focus===J.Next){let d=s.activeItemIndex;if(d!==null){let x=s.items[d].dataRef.current.domRef,g=Qe(t,{resolveItems:()=>s.items,resolveActiveIndex:()=>s.activeItemIndex,resolveId:h=>h.id,resolveDisabled:h=>h.dataRef.current.disabled});if(g!==null){let h=s.items[g].dataRef.current.domRef;if(((i=x.current)==null?void 0:i.nextElementSibling)===h.current||((o=h.current)==null?void 0:o.nextElementSibling)===null)return{...m,activeItemIndex:g}}}}let c=Cs(s),f=Qe(t,{resolveItems:()=>c.items,resolveActiveIndex:()=>c.activeItemIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...m,...c,activeItemIndex:f}},3:(s,t)=>{let n=s.searchQuery!==""?0:1,a=s.searchQuery+t.value.toLowerCase(),r=(s.activeItemIndex!==null?s.items.slice(s.activeItemIndex+n).concat(s.items.slice(0,s.activeItemIndex+n)):s.items).find(o=>{var m;return((m=o.dataRef.current.textValue)==null?void 0:m.startsWith(a))&&!o.dataRef.current.disabled}),i=r?s.items.indexOf(r):-1;return i===-1||i===s.activeItemIndex?{...s,searchQuery:a}:{...s,searchQuery:a,activeItemIndex:i,activationTrigger:1}},4(s){return s.searchQuery===""?s:{...s,searchQuery:"",searchActiveItemIndex:null}},5:(s,t)=>{let n=s.items.concat(t.items.map(r=>r)),a=s.activeItemIndex;return s.pendingFocus.focus!==J.Nothing&&(a=Qe(s.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>s.activeItemIndex,resolveId:r=>r.id,resolveDisabled:r=>r.dataRef.current.disabled})),{...s,items:n,activeItemIndex:a,pendingFocus:{focus:J.Nothing},pendingShouldSort:!0}},6:(s,t)=>{let n=s.items,a=[],r=new Set(t.items);for(let[i,o]of n.entries())if(r.has(o.id)&&(a.push(i),r.delete(o.id),r.size===0))break;if(a.length>0){n=n.slice();for(let i of a.reverse())n.splice(i,1)}return{...s,items:n,activationTrigger:1}},7:(s,t)=>s.buttonElement===t.element?s:{...s,buttonElement:t.element},8:(s,t)=>s.itemsElement===t.element?s:{...s,itemsElement:t.element},9:s=>s.pendingShouldSort?{...s,...Cs(s),pendingShouldSort:!1}:s,10(s){return s.buttonPositionState.kind!=="Tracked"?s:{...s,buttonPositionState:Ze.Moved}}};class Rt extends Ra{constructor(t){super(t),ks(this,"actions",{registerItem:cs(()=>{let n=[],a=new Set;return[(r,i)=>{a.has(i)||(a.add(i),n.push({id:r,dataRef:i}))},()=>(a.clear(),this.send({type:5,items:n.splice(0)}))]}),unregisterItem:cs(()=>{let n=[];return[a=>n.push(a),()=>this.send({type:6,items:n.splice(0)})]})}),ks(this,"selectors",{activeDescendantId(n){var a;let r=n.activeItemIndex,i=n.items;return r===null||(a=i[r])==null?void 0:a.id},isActive(n,a){var r;let i=n.activeItemIndex,o=n.items;return i!==null?((r=o[i])==null?void 0:r.id)===a:!1},shouldScrollIntoView(n,a){return n.__demoMode||n.menuState!==0||n.activationTrigger===0?!1:this.isActive(n,a)},didButtonMove(n){return n.buttonPositionState.kind==="Moved"}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,a=Xs.get(null);this.disposables.add(a.on(Ea.Push,r=>{!a.selectors.isTop(r,n)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>a.actions.push(n)),this.on(1,()=>a.actions.pop(n))}this.disposables.group(n=>{this.on(1,a=>{a.buttonElement&&(n.dispose(),n.add(xl(a.buttonElement,a.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new Rt({id:t,__demoMode:n,menuState:n?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:J.Nothing},buttonPositionState:Ze.Idle})}reduce(t,n){return Ys(n.type,zl,t,n)}}const gn=l.createContext(null);function Et(s){let t=l.useContext(gn);if(t===null){let n=new Error(`<${s} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,yn),n}return t}function yn({id:s,__demoMode:t=!1}){let n=l.useMemo(()=>Rt.new({id:s,__demoMode:t}),[]);return Ta(()=>n.dispose()),n}let Bl=l.Fragment;function Hl(s,t){let n=l.useId(),{__demoMode:a=!1,...r}=s,i=yn({id:n,__demoMode:a}),[o,m,c]=pe(i,S=>[S.menuState,S.itemsElement,S.buttonElement]),f=rt(t),d=Xs.get(null),x=pe(d,l.useCallback(S=>d.selectors.isTop(S,n),[d,n]));Ja(x,[c,m],(S,b)=>{var E;i.send({type:U.CloseMenu}),Qa(b,Xa.Loose)||(S.preventDefault(),(E=i.state.buttonElement)==null||E.focus())});let g=ie(()=>{i.send({type:U.CloseMenu})}),h=lt({open:o===ee.Open,close:g}),u={ref:f},v=_e();return ke.createElement(pl,null,ke.createElement(gn.Provider,{value:i},ke.createElement(Ya,{value:Ys(o,{[ee.Open]:st.Open,[ee.Closed]:st.Closed})},v({ourProps:u,theirProps:r,slot:h,defaultTag:Bl,name:"Menu"}))))}let Wl="button";function Ul(s,t){let n=Et("Menu.Button"),a=l.useId(),{id:r=`headlessui-menu-button-${a}`,disabled:i=!1,autoFocus:o=!1,...m}=s,c=l.useRef(null),f=il(),d=rt(t,c,ol(),ie(j=>n.send({type:U.SetButtonElement,element:j}))),x=ie(j=>{switch(j.key){case Z.Space:case Z.Enter:case Z.ArrowDown:j.preventDefault(),j.stopPropagation(),n.send({type:U.OpenMenu,focus:{focus:J.First}});break;case Z.ArrowUp:j.preventDefault(),j.stopPropagation(),n.send({type:U.OpenMenu,focus:{focus:J.Last}});break}}),g=ie(j=>{switch(j.key){case Z.Space:j.preventDefault();break}}),[h,u,v]=pe(n,j=>[j.menuState,j.buttonElement,j.itemsElement]),S=h===ee.Open;fl(S,{trigger:u,action:l.useCallback(j=>{if(u!=null&&u.contains(j.target))return Xe.Ignore;let C=j.target.closest('[role="menuitem"]:not([data-disabled])');return Aa(C)?Xe.Select(C):v!=null&&v.contains(j.target)?Xe.Ignore:Xe.Close},[u,v]),close:l.useCallback(()=>n.send({type:U.CloseMenu}),[]),select:l.useCallback(j=>j.click(),[])});let b=gl(j=>{var C;i||(h===ee.Open?(vt.flushSync(()=>n.send({type:U.CloseMenu})),(C=c.current)==null||C.focus({preventScroll:!0})):(j.preventDefault(),n.send({type:U.OpenMenu,focus:{focus:J.Nothing},trigger:nt.Pointer})))}),{isFocusVisible:E,focusProps:I}=$a({autoFocus:o}),{isHovered:_,hoverProps:y}=Fa({isDisabled:i}),{pressed:M,pressProps:$}=Da({disabled:i}),R=lt({open:h===ee.Open,active:M||h===ee.Open,disabled:i,hover:_,focus:E,autofocus:o}),p=Zs(f(),{ref:d,id:r,type:Oa(s,c.current),"aria-haspopup":"menu","aria-controls":v==null?void 0:v.id,"aria-expanded":h===ee.Open,disabled:i||void 0,autoFocus:o,onKeyDown:x,onKeyUp:g},b,I,y,$);return _e()({ourProps:p,theirProps:m,slot:R,defaultTag:Wl,name:"Menu.Button"})}let Kl="div",ql=ms.RenderStrategy|ms.Static;function Gl(s,t){let n=l.useId(),{id:a=`headlessui-menu-items-${n}`,anchor:r,portal:i=!1,modal:o=!0,transition:m=!1,...c}=s,f=cl(r),d=Et("Menu.Items"),[x,g]=dl(f),h=ul(),[u,v]=l.useState(null),S=rt(t,f?x:null,ie(L=>d.send({type:U.SetItemsElement,element:L})),v),[b,E]=pe(d,L=>[L.menuState,L.buttonElement]),I=ds(E),_=ds(u);f&&(i=!0);let y=La(),[M,$]=za(m,u,y!==null?(y&st.Open)===st.Open:b===ee.Open);Ba(M,E,()=>{d.send({type:U.CloseMenu})});let R=pe(d,L=>L.__demoMode),p=R?!1:o&&b===ee.Open;Ha(p,_);let j=R?!1:o&&b===ee.Open;Wa(j,{allowed:l.useCallback(()=>[E,u],[E,u])});let C=pe(d,d.selectors.didButtonMove)?!1:M;l.useEffect(()=>{let L=u;L&&b===ee.Open&&(Ua(L)||L.focus({preventScroll:!0}))},[b,u]),jl(b===ee.Open,{container:u,accept(L){return L.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:L.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(L){L.setAttribute("role","none")}});let k=Ka(),F=ie(L=>{var G,w,T;switch(k.dispose(),L.key){case Z.Space:if(d.state.searchQuery!=="")return L.preventDefault(),L.stopPropagation(),d.send({type:U.Search,value:L.key});case Z.Enter:if(L.preventDefault(),L.stopPropagation(),d.state.activeItemIndex!==null){let{dataRef:z}=d.state.items[d.state.activeItemIndex];(w=(G=z.current)==null?void 0:G.domRef.current)==null||w.click()}d.send({type:U.CloseMenu}),en(d.state.buttonElement);break;case Z.ArrowDown:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.Next});case Z.ArrowUp:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.Previous});case Z.Home:case Z.PageUp:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.First});case Z.End:case Z.PageDown:return L.preventDefault(),L.stopPropagation(),d.send({type:U.GoToItem,focus:J.Last});case Z.Escape:L.preventDefault(),L.stopPropagation(),vt.flushSync(()=>d.send({type:U.CloseMenu})),(T=d.state.buttonElement)==null||T.focus({preventScroll:!0});break;case Z.Tab:L.preventDefault(),L.stopPropagation(),vt.flushSync(()=>d.send({type:U.CloseMenu})),qa(d.state.buttonElement,L.shiftKey?us.Previous:us.Next);break;default:L.key.length===1&&(d.send({type:U.Search,value:L.key}),k.setTimeout(()=>d.send({type:U.ClearSearch}),350));break}}),N=ie(L=>{switch(L.key){case Z.Space:L.preventDefault();break}}),D=lt({open:b===ee.Open}),q=Zs(f?h():{},{"aria-activedescendant":pe(d,d.selectors.activeDescendantId),"aria-labelledby":pe(d,L=>{var G;return(G=L.buttonElement)==null?void 0:G.id}),id:a,onKeyDown:F,onKeyUp:N,role:"menu",tabIndex:b===ee.Open?0:void 0,ref:S,style:{...c.style,...g,"--button-width":ml(M,E,!0).width},...Ga($)}),X=_e();return ke.createElement(Va,{enabled:i?s.static||M:!1,ownerDocument:I},X({ourProps:q,theirProps:c,slot:D,defaultTag:Kl,features:ql,visible:C,name:"Menu.Items"}))}let Vl=l.Fragment;function Jl(s,t){let n=l.useId(),{id:a=`headlessui-menu-item-${n}`,disabled:r=!1,...i}=s,o=Et("Menu.Item"),m=pe(o,C=>o.selectors.isActive(C,a)),c=l.useRef(null),f=rt(t,c),d=pe(o,C=>o.selectors.shouldScrollIntoView(C,a));Ye(()=>{if(d)return er().requestAnimationFrame(()=>{var C,k;(k=(C=c.current)==null?void 0:C.scrollIntoView)==null||k.call(C,{block:"nearest"})})},[d,c]);let x=bl(c),g=l.useRef({disabled:r,domRef:c,get textValue(){return x()}});Ye(()=>{g.current.disabled=r},[g,r]),Ye(()=>(o.actions.registerItem(a,g),()=>o.actions.unregisterItem(a)),[g,a]);let h=ie(()=>{o.send({type:U.CloseMenu})}),u=ie(C=>{if(r)return C.preventDefault();o.send({type:U.CloseMenu}),en(o.state.buttonElement)}),v=ie(()=>{if(r)return o.send({type:U.GoToItem,focus:J.Nothing});o.send({type:U.GoToItem,focus:J.Specific,id:a})}),S=yl(),b=ie(C=>S.update(C)),E=ie(C=>{S.wasMoved(C)&&(r||m||o.send({type:U.GoToItem,focus:J.Specific,id:a,trigger:nt.Pointer}))}),I=ie(C=>{S.wasMoved(C)&&(r||m&&o.state.activationTrigger===nt.Pointer&&o.send({type:U.GoToItem,focus:J.Nothing}))}),[_,y]=tn(),[M,$]=tr(),R=lt({active:m,focus:m,disabled:r,close:h}),p={id:a,ref:f,role:"menuitem",tabIndex:r===!0?void 0:-1,"aria-disabled":r===!0?!0:void 0,"aria-labelledby":_,"aria-describedby":M,disabled:void 0,onClick:u,onFocus:v,onPointerEnter:b,onMouseEnter:b,onPointerMove:E,onMouseMove:E,onPointerLeave:I,onMouseLeave:I},j=_e();return ke.createElement(y,null,ke.createElement($,null,j({ourProps:p,theirProps:i,slot:R,defaultTag:Vl,name:"Menu.Item"})))}let Ql="div";function Xl(s,t){let[n,a]=tn(),r=s,i={ref:t,"aria-labelledby":n,role:"group"},o=_e();return ke.createElement(a,null,o({ourProps:i,theirProps:r,slot:{},defaultTag:Ql,name:"Menu.Section"}))}let Yl="header";function Zl(s,t){let n=l.useId(),{id:a=`headlessui-menu-heading-${n}`,...r}=s,i=Za();Ye(()=>i.register(a),[a,i.register]);let o={id:a,ref:t,role:"presentation",...i.props};return _e()({ourProps:o,theirProps:r,slot:{},defaultTag:Yl,name:"Menu.Heading"})}let ei="div";function ti(s,t){let n=s,a={ref:t,role:"separator"};return _e()({ourProps:a,theirProps:n,slot:{},defaultTag:ei,name:"Menu.Separator"})}let si=Se(Hl),bn=Se(Ul),jn=Se(Gl),wt=Se(Jl),ni=Se(Xl),ai=Se(Zl),vn=Se(ti),ri=Object.assign(si,{Button:bn,Items:jn,Item:wt,Section:ni,Heading:ai,Separator:vn});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -76,6 +76,6 @@ import{aZ as Ra,fM as cs,a$ as Xs,b0 as Ea,a_ as Ys,b1 as Pa,r as l,b2 as Ta,b3 `).map(a=>a.trim()).filter(Boolean);if(t.length<2)return null;const n=[];for(const a of t){const r=a.match(/^(\d{1,2}[AP]M):\s*/i);if(!r)continue;let i=a.slice(r[0].length),o="";for(const h of pt)if(i.includes(h)){o=h,i=i.replace(h,"").trim();break}if(!o)continue;let m;const c=i.match(/(\d+)%/);c&&(m=parseInt(c[1],10),i=i.replace(c[0],"").trim());const f=i.match(/(-?\d+)°/);if(!f)continue;const d=parseInt(f[1],10),x=i.indexOf(f[0]),g=x>0?i.slice(0,x).trim():"";n.push({hour:r[1].toUpperCase(),conditionEmoji:o,condition:g||"Unknown",temp:d,precipChance:m})}return n.length>=2?n:null}function Pn(s){const t=s.split(` `).map(a=>a.trim()).filter(Boolean);if(t.length===0)return null;const n=[];for(const a of t){const r=a.match(/^([0-9A-Fa-f]{2})\s*→\s*(.+)/);if(!r)continue;const i=r[1].toUpperCase(),o=r[2].trim();if(o==="?")n.push({hex:i,unknown:!0});else if(/^\d+\s*matches?$/i.test(o))n.push({hex:i,matchCount:parseInt(o,10)});else{let m,c=o;c.includes("🎯")?(m="high",c=c.replace("🎯","").trim()):c.includes("📍")?(m="medium",c=c.replace("📍","").trim()):c.includes("❓")&&(m="low",c=c.replace("❓","").trim()),n.push({hex:i,name:c,confidence:m})}}return n.length>=2?{hops:n}:null}const qi=new Set(["🟢","🟡","🟠","🔴","🟣","🟤"]);function Tn(s){let t="";for(const x of qi)if(s.includes(x)){t=x;break}if(!t)return null;const n=s.match(/(?:AQI:?\s*)?\b(\d{1,3})\b\s*\(?(Good|Moderate|USG|Unhealthy|Very Unhealthy|Hazardous)\)?/i)??s.match(new RegExp(`${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*(\\d{1,3})\\s*\\(?(\\w[\\w ]*?)\\)?(?:\\s|$)`));if(!n)return null;const a=parseInt(n[1],10),r=n[2].trim(),i=s.split(` `)[0],o=i.indexOf(t),m=o>2?i.slice(0,o).replace(/:$/,"").trim():void 0,c=[],f=/(PM2\.5|PM10|O3|NO2|CO|SO2):\s*([\d.]+)/gi;let d;for(;(d=f.exec(s))!==null;)c.push({name:d[1].toUpperCase(),value:parseFloat(d[2])});return{location:m,aqi:a,category:r,colorEmoji:t,pollutants:c}}function An(s){const t=/A[- ]?Index:?\s*\d/i.test(s)||/\bA:\s*\d/i.test(s),n=/K[- ]?Index:?\s*\d/i.test(s)||/\bK:\s*\d/i.test(s);if(!t&&!n)return null;const a=s.match(/A[- ]?Index:?\s*(\d+)/i)??s.match(/\bA:(\d+)/),r=s.match(/K[- ]?Index:?\s*(\d+)/i)??s.match(/\bK:(\d+)/),i=s.match(/Sun(?:spots)?:?\s*(\d+)/i),o=s.match(/(?:Solar\s*)?Flux:?\s*(\d+)/i),m=s.match(/X[- ]?[Rr]ay(?:\s*Flux)?:?\s*([A-Z]\d+\.?\d*)/i)??s.match(/Xray:([A-Z]\d+\.?\d*)/i),c=s.match(/(?:Signal\s*)?Noise:?\s*([A-Z]\d+)/i);return{aIndex:a?parseInt(a[1],10):void 0,kIndex:r?parseInt(r[1],10):void 0,sunspots:i?parseInt(i[1],10):void 0,solarFlux:o?parseInt(o[1],10):void 0,xrayFlux:m==null?void 0:m[1],signalNoise:c==null?void 0:c[1]}}function $n(s){const t=[],n=/([dn])(\d+m(?:-\d+m)?)=(Good|Fair|Poor|Excellent)/gi;let a;for(;(a=n.exec(s))!==null;)t.push({time:a[1].toLowerCase()==="d"?"day":"night",name:a[2],condition:a[3]});if(t.length>=2)return{bands:t};const r=/([DN]):\s*((?:\d+m(?:-\d+m)?(?:Good|Fair|Poor|Excellent)\s*)+)/gi;let i;for(;(i=r.exec(s))!==null;){const o=i[1].toUpperCase()==="D"?"day":"night",m=/(\d+m(?:-\d+m)?)(Good|Fair|Poor|Excellent)/gi;let c;for(;(c=m.exec(i[2]))!==null;)t.push({time:o,name:c[1],condition:c[2]})}return t.length>=2?{bands:t}:null}function Fn(s){var h,u;const t=/Sun\s*Rise:?/i.test(s),n=/Sun\s*Set:?|\bSet:/i.test(s);if(!/Daylight:/i.test(s)&&!(t&&n))return null;const r=s.match(/(?:Sun\s*)?Rise:?\s*(.+?)(?:\n|$)/i),i=s.match(/(?:Sun\s*)?Set:?\s*(.+?)(?:\n|$)/i),o=s.match(/Daylight:?\s*(\d+)h\s*(\d+)m/i),m=s.match(/Remaining:?\s*(\d+)h\s*(\d+)m/i),c=s.match(/Azimuth:?\s*([\d.]+)/i),f=s.match(/Altitude:?\s*(-?[\d.]+)/i),d=s.search(/Sun\s*Rise/i),x=s.search(/Sun\s*Set/i),g=x>=0&&(d<0||xa.trim()).filter(Boolean),n=[];for(const a of t){let r="";for(const c of Vi)if(a.startsWith(c)){r=c;break}if(!r)continue;const i=a.slice(r.length).trim(),o=i.match(/^(.+?)\s+(\d+)\s*[-–]\s*(.+?)\s+(\d+)\s*\((.+)\)$/);if(o){const c=o[5].trim(),f=/final/i.test(c),d=!f&&/\d/.test(c);n.push({sportEmoji:r,away:o[1].trim(),home:o[3].trim(),awayScore:parseInt(o[2],10),homeScore:parseInt(o[4],10),status:c,isLive:d,isFinal:f});continue}const m=i.match(/^(.+?)\s*[-–]\s*(.+?)\s*\((.+)\)$/);m&&n.push({sportEmoji:r,away:m[1].trim(),home:m[2].trim(),status:m[3].trim(),isLive:!1,isFinal:!1})}return n.length>=1?{games:n}:null}function Bn(s){var f,d,x,g;const t=[],n=/^(\d+)\.\s+(.+?):\s*(\d+)/gm;let a;for(;(a=n.exec(s))!==null;)t.push({rank:parseInt(a[1],10),name:a[2].trim(),value:parseInt(a[3],10)});if(t.length>=2){const h=s.match(/^(.+?)\n/i);return{type:"leaderboard",entries:t,title:(f=h==null?void 0:h[1])==null?void 0:f.replace(/📊\s*/,"").trim()}}const r=s.match(/Cmds?:\s*(\d+)/i),i=s.match(/Replies?:\s*(\d+)/i);if(!r&&!i)return null;const o=s.match(/Top\s*Cmd:\s*(.+?)\s*\(/i),m=s.match(/Top\s*User:\s*(.+?)\s*\(/i),c=s.match(/^(.+?)\n/i);return{type:"basic",commands:r?parseInt(r[1],10):void 0,replies:i?parseInt(i[1],10):void 0,topCommand:(d=o==null?void 0:o[1])==null?void 0:d.trim(),topUser:(x=m==null?void 0:m[1])==null?void 0:x.trim(),title:(g=c==null?void 0:c[1])==null?void 0:g.replace(/📊\s*/,"").trim()}}const Ji=new Set(["🐱","🐈","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🐾","👂","🐟","🧶","🥛"]);function Hn(s){if(!/\bcats?\b/i.test(s))return null;const t=s.slice(-4);for(const n of Ji)if(t.includes(n))return s;return null}const Qi=[{type:"dice",test:Cn},{type:"joke",test:Sn},{type:"dadjoke",test:_n},{type:"magic8",test:In},{type:"weather-alert",test:Mn},{type:"satpass",test:On},{type:"aurora",test:Ln},{type:"moon",test:Dn},{type:"sun",test:Fn},{type:"hfcond",test:$n},{type:"solar",test:An},{type:"aqi",test:Tn},{type:"sports",test:zn},{type:"stats",test:Bn},{type:"path",test:Pn},{type:"weather-multiday",test:Rn},{type:"weather-hourly",test:En},{type:"test",test:kn},{type:"weather",test:wn},{type:"catfact",test:Hn}];function Wn(s){for(const{type:t,test:n}of Qi)if(n(s)!=null)return t;return null}function Xi(s,t){switch(t){case"weather":return wn(s);case"weather-multiday":return Rn(s);case"weather-hourly":return En(s);case"weather-alert":return Mn(s);case"test":return kn(s);case"path":return Pn(s);case"aqi":return Tn(s);case"solar":return An(s);case"hfcond":return $n(s);case"sun":return Fn(s);case"moon":return Dn(s);case"satpass":return On(s);case"aurora":return Ln(s);case"dice":return Cn(s);case"joke":return Sn(s);case"dadjoke":return _n(s);case"magic8":return In(s);case"sports":return zn(s);case"stats":return Bn(s);case"catfact":return Hn(s);default:return null}}const Un=/[\u{1F916}\u{1F9BE}\u{1F9BF}]/u;function Yi(s,t,n){if(t==="bot")return!0;if(t==="not-bot")return!1;if(Un.test(s)||/bot\b/i.test(s))return!0;if(n&&n.length>0){let a=0;const r=n.slice(-5);for(const i of r)Wn(i)!=null&&a++;if(a>=Math.ceil(r.length*.6))return!0}return!1}function Kn(s){return Un.test(s)||/bot\b/i.test(s)}const qn="pymc_howl_bot_overrides";function Zi(){try{const s=localStorage.getItem(qn);if(!s)return new Map;const t=JSON.parse(s);return new Map(t)}catch{return new Map}}function Is(s){try{localStorage.setItem(qn,JSON.stringify([...s]))}catch{}}const Gn=nr(s=>({overrides:Zi(),setOverride:(t,n)=>s(a=>{const r=new Map(a.overrides);return r.set(t,n),Is(r),{overrides:r}}),clearOverride:t=>s(n=>{const a=new Map(n.overrides);return a.delete(t),Is(a),{overrides:a}})}));function Vn(s){return Gn(t=>t.overrides.get(s))}function eo(){return Gn(s=>s.setOverride)}const Jn="pymc_companion_contacts_micro",Qn="pymc_companion_favorites",yt=56;function Ms(){try{return localStorage.getItem(Jn)==="1"}catch{return!1}}function to(s){try{localStorage.setItem(Jn,s?"1":"0")}catch{}}function so(){try{const s=localStorage.getItem(Qn);return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}function no(s){try{localStorage.setItem(Qn,JSON.stringify([...s]))}catch{}}function ao({name:s,pubkey:t,advType:n,size:a="md",signal:r}){const i=(n??0)&15,o=a==="sm"?"w-5 h-5":"w-6 h-6",m=a==="sm"?"size-3":"size-3.5";if(i===2){const x=r&&r.rssi!==0,g=x?`RSSI: ${r.rssi} dBm · SNR: ${r.snr.toFixed(1)} dB`:void 0;return e.jsx("div",{className:A(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px]",x?"ring-transparent":"ring-sys-blue"),title:g,children:x?e.jsx(rl,{rssi:r.rssi,snr:r.snr,compact:!0,showValues:!1}):e.jsx(Be,{className:A(m,"text-sys-blue")})})}if(i===3)return e.jsx("div",{className:A(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px] ring-sys-pink"),children:e.jsx(it,{className:A(m,"text-sys-pink")})});if(!s)return e.jsx("div",{className:A(o,"relative rounded-full bg-sys-blue/12 flex items-center justify-center flex-shrink-0"),children:e.jsx("span",{className:"text-sys-blue font-mono text-[10px] font-bold",children:t.slice(0,4)})});const{emoji:c}=dt(s),f=ut(s),d=mt(s);return e.jsx("div",{className:A(o,"relative clay-avatar",c?"text-base":"text-white text-[11px] font-bold"),style:{"--avatar-color":f},children:c||d})}const Rs=[{key:"companion",label:"Companions",icon:fe,color:"text-sys-blue"},{key:"room",label:"Room Servers",icon:it,color:"text-sys-pink"},{key:"repeater",label:"Repeaters",icon:Be,color:"text-sys-blue"}];function Xn(s){const t=(s.adv_type??0)&15;return t===3?"room":t===2?"repeater":"companion"}const ro=4e3,lo=5e3,io=2e3,oo=8,co=l.forwardRef(function({contact:t,isActive:n,unread:a,lastMsg:r,isFav:i,microContent:o,onSelect:m,onShowDetails:c,onShareContact:f,onResetPath:d,onRemoveContact:x,onPingContact:g,repeaterSignal:h,toggleFavorite:u},v){const S=ar(t.public_key),b=rr(t.public_key),E=Vn(t.public_key),I=eo(),_=E==="bot"||E==null&&Kn(t.name||""),[y,M]=l.useState(!1),[$,R]=l.useState(!1),p=l.useRef(null),[j,C]=l.useState("idle"),k=l.useRef(!1),F=l.useRef(null),[N,D]=l.useState({w:0,h:0});l.useEffect(()=>{let O=!1,W=null;return S?(k.current=!0,W="idle"):k.current&&(k.current=!1,W=te.getState().pingResults.get(t.public_key)!=null?"success":"failed"),W&&queueMicrotask(()=>{O||C(W)}),()=>{O=!0}},[S,t.public_key]),l.useEffect(()=>{if(j==="idle")return;const W=setTimeout(()=>C("idle"),j==="success"?lo:io);return()=>clearTimeout(W)},[j]);const q=(S||j!=="idle")&&!y;l.useEffect(()=>{if(!q)return;const O=F.current;if(!O)return;const W=()=>{const de=O.offsetWidth,we=O.offsetHeight;D(ye=>ye.w===de&&ye.h===we?ye:{w:de,h:we})};W();const V=new ResizeObserver(W);return V.observe(O),()=>V.disconnect()},[q]);const X=l.useCallback(()=>{M(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>M(!1),ro)},[]),L=l.useCallback(()=>{M(!1),p.current&&clearTimeout(p.current)},[]),G=l.useCallback(async()=>{x&&(p.current&&clearTimeout(p.current),R(!0),await x(t.public_key),R(!1),M(!1))},[x,t.public_key]),w=l.useMemo(()=>h&&h.rssi!==0?{rssi:h.rssi,snr:h.snr}:null,[h]),T=l.useCallback(O=>{F.current=O,typeof v=="function"?v(O):v&&(v.current=O)},[v]),z=y?"":j==="success"?"bg-sys-green/5":j==="failed"?"bg-sys-red/5":S?"bg-sys-blue/5":n?"bg-sys-blue":"hover:bg-elevated";return e.jsxs(ae.div,{ref:T,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ne.fade,className:A("group relative w-full flex items-center gap-2.5 px-2.5 py-[3px] radius-inner overflow-hidden","transition-[background-color,box-shadow] duration-150",z),children:[e.jsx(he,{children:q&&N.w>0&&(j!=="idle"?e.jsx(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{opacity:{duration:.15}},className:A("absolute inset-0 radius-inner ring-2 ring-inset pointer-events-none z-[2]",j==="success"?"ring-sys-green":"ring-sys-red")},`ping-${j}`):e.jsx(lr,{borderRadius:oo,width:N.w,height:N.h,color:"blue"},"ping-crawl"))}),e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:A("flex items-center gap-2.5",y&&!o&&"invisible pointer-events-none"),children:[e.jsxs("button",{onClick:()=>m({type:"contact",id:t.public_key}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ao,{name:t.name,pubkey:t.public_key,advType:t.adv_type,signal:w}),a>0&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-sys-red ring-2 ring-body"}),_&&!a&&e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex items-center justify-center w-3 h-3 rounded-full bg-sys-violet ring-[1.5px] ring-body",title:"HOWL Bot",children:e.jsx(Ss,{className:"w-2 h-2 text-white"})})]}),!o&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("span",{className:A("text-sm truncate flex-1",n?"text-white font-medium":i?"text-sys-amber font-bold":"text-fg-primary font-medium"),children:t.name||t.public_key.slice(0,12)+"…"})}),j==="success"&&b?e.jsxs("div",{className:"text-[11px] text-sys-green font-medium truncate tabular-nums",children:[b.snr_db.toFixed(1)," dB SNR · ",b.rtt_ms," ms · ",b.hop_count," ",b.hop_count===1?"hop":"hops"]}):j==="failed"?e.jsx("div",{className:"text-[11px] text-sys-red font-medium truncate",children:"No response"}):r?e.jsx("div",{className:A("text-[11px] truncate",n?"text-white/70":"text-fg-muted"),children:r.text}):null]})]}),!o&&e.jsx("div",{className:"relative flex-shrink-0 w-[18px] h-[18px] flex items-center justify-center",children:e.jsx(ri,{as:"div",className:"absolute inset-0",children:({open:O})=>e.jsxs(e.Fragment,{children:[e.jsx(bn,{className:A("absolute inset-0 flex items-center justify-center rounded transition-[opacity,background-color] duration-100","focus:outline-none",n?"hover:bg-white/15":"hover:bg-subtle-fill",O?"opacity-100":"opacity-0 group-hover:opacity-100"),"aria-label":"Contact options",children:e.jsx(hi,{className:A("h-3.5 w-3.5 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-blue")})}),e.jsxs(jn,{anchor:"right start",transition:!0,className:A("min-w-[10rem] max-w-[20rem]","radius-inset p-1 ml-1","surface-elevated","focus:outline-none z-50","transition-[opacity,transform]","data-[closed]:opacity-0 data-[closed]:scale-[0.98] data-[closed]:translate-x-[-4px]","data-[enter]:duration-150 data-[leave]:duration-100","data-[enter]:ease-out data-[leave]:ease-in"),children:[e.jsx(je,{icon:e.jsx(He,{className:"w-4 h-4"}),onClick:()=>{c==null||c({type:"contact",id:t.public_key})},children:"Details"}),f&&e.jsx(je,{icon:e.jsx(vl,{className:"w-4 h-4"}),onClick:()=>f(t.public_key),children:"Share"}),e.jsx(je,{icon:e.jsx(Ke,{className:"w-4 h-4"}),onClick:()=>m({type:"contact",id:t.public_key}),children:"Set Path"}),d&&e.jsx(je,{icon:e.jsx(on,{className:"w-4 h-4"}),onClick:()=>d(t.public_key),children:"Reset Path"}),g&&Xn(t)==="repeater"&&e.jsx(je,{icon:e.jsx(pi,{className:"w-4 h-4"}),onClick:()=>g(t.public_key),disabled:S,children:S?"Pinging…":"Ping"}),x&&e.jsx(je,{icon:e.jsx(qe,{className:"w-4 h-4"}),destructive:!0,onClick:X,children:"Remove Contact"}),e.jsx(Ri,{}),e.jsx(je,{icon:_?e.jsx(ci,{className:"w-4 h-4 text-fg-muted"}):e.jsx(Ss,{className:"w-4 h-4 text-sys-violet"}),onClick:()=>I(t.public_key,_?"not-bot":"bot"),children:_?"Not a Bot":"Mark as HOWL Bot"}),e.jsx(je,{icon:e.jsx(_i,{className:A("w-4 h-4 group-data-[focus]:text-white group-data-[focus]:fill-white",i?"text-sys-amber fill-sys-amber":"text-fg-muted")}),onClick:()=>u(t.public_key),children:i?"Unfavorite":"Favorite"})]})]})})})]}),!o&&e.jsx("div",{className:A("flex items-center gap-1.5 self-center",!y&&"invisible pointer-events-none"),children:$?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:L,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:G,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(qe,{className:"w-4 h-4 text-white"})})]})})]})]},t.public_key)}),Es={excellent:4,good:3,fair:2,weak:1,poor:0};function Ps(s,t){const n=t==null?void 0:t.get(s);return n&&n.rssi!==0?n.rssi:null}function uo(s,t,n,a){return[...s].sort((r,i)=>{const o=t.has(r.public_key)?0:1,m=t.has(i.public_key)?0:1;if(o!==m)return o-m;if(n){const c=n.get(r.public_key),f=c&&c.length>0?c[c.length-1].timestamp:0,d=n.get(i.public_key),x=d&&d.length>0?d[d.length-1].timestamp:0;if(f!==x)return x-f}if(a){const c=Ps(r.public_key,a),f=Ps(i.public_key,a);if(c!=null&&f==null)return-1;if(c==null&&f!=null)return 1;if(c!=null&&f!=null){const d=Es[js(c)]??0,x=Es[js(f)]??0;if(d!==x)return x-d}}return(r.name||"").localeCompare(i.name||"")})}const mo=l.memo(l.forwardRef(function({contacts:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onShowDetails:o,onShareContact:m,onResetPath:c,onRemoveContact:f,onPingContact:d,repeaterSignalMap:x,isLoading:g,splitPercent:h=50,onMicroChange:u,className:v},S){const[b,E]=l.useState(Ms),[I,_]=l.useState(Ms),[y,M]=l.useState(""),[$,R]=l.useState(!1),[p,j]=l.useState(so),C=l.useRef(null),k=l.useRef(null),F=l.useCallback(w=>{k.current=w,typeof S=="function"?S(w):S&&(S.current=w)},[S]),N=l.useCallback(()=>{E(w=>{const T=!w;to(T);const z=k.current;if(T&&_(!0),z){let O=0;const W=z.parentElement;if(T)O=(W==null?void 0:W.offsetWidth)??z.offsetWidth;else if(W){const de=W.style.width;W.style.width="var(--companion-side)",O=W.offsetWidth,W.style.width=de}const V=T?yt:Math.round(h/100*O);et(z,{width:`${V}px`},{...ne.layoutResize,onComplete(){z.style.width=T?`${yt}px`:`${h}%`,T||_(!1)}})}return u==null||u(T),T})},[h,u]),D=l.useCallback(w=>{j(T=>{const z=new Set(T);return z.has(w)?z.delete(w):z.add(w),no(z),z})},[]),q=$||y.length>0,X=l.useMemo(()=>{const w=new Set,T=t.filter(O=>w.has(O.public_key)?!1:(w.add(O.public_key),!0));if(!y.trim())return T;const z=y.toLowerCase();return T.filter(O=>{var W;return((W=O.name)==null?void 0:W.toLowerCase().includes(z))||O.public_key.toLowerCase().includes(z)})},[t,y]),L=l.useMemo(()=>{const w=new Map;for(const T of Rs)w.set(T.key,[]);for(const T of X)w.get(Xn(T)).push(T);return Rs.map(T=>({...T,items:uo(w.get(T.key),p,r,T.key==="repeater"?x:void 0)})).filter(T=>T.items.length>0)},[X,p,r,x]),G=(n==null?void 0:n.type)==="contact"?n.id:null;return e.jsxs("div",{ref:F,className:A("flex-shrink-0 overflow-hidden flex flex-col h-full",v),style:{width:b?yt:`${h}%`},children:[e.jsx("div",{className:A("flex items-center border-b border-edge-subtle flex-shrink-0",I?"justify-center p-2":"gap-2 px-3 py-2"),children:I?e.jsx("button",{onClick:N,className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Expand contacts",children:e.jsx(Ni,{className:"w-3.5 h-3.5 text-fg-muted"})}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Contacts"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>{q?(M(""),R(!1)):(R(!0),setTimeout(()=>{var w;return(w=C.current)==null?void 0:w.focus()},50))},className:A("p-1 rounded transition-colors flex-shrink-0",q?"bg-sys-blue/10 text-sys-blue":"hover:bg-subtle-fill text-fg-muted"),title:q?"Close search":"Search contacts",children:e.jsx(vs,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:N,className:"p-1 hover:bg-subtle-fill rounded transition-colors flex-shrink-0",title:"Collapse contacts",children:e.jsx(ji,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]})}),!I&&q&&e.jsxs("div",{className:"relative px-2.5 py-2 border-b border-edge-subtle/50 flex-shrink-0",children:[e.jsx(vs,{className:"absolute left-5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-muted pointer-events-none"}),e.jsx("input",{ref:C,type:"text",value:y,onChange:w=>M(w.target.value),onFocus:()=>R(!0),onBlur:()=>R(!1),placeholder:"Search contacts…",className:"w-full pl-8 pr-8 py-1.5 text-sm radius-inner bg-input-bg border border-input-border text-fg-primary placeholder:text-fg-muted/50 ring-focus-inset hover:border-edge-strong transition-colors",autoFocus:!0}),e.jsx("button",{onClick:()=>{M(""),R(!1)},className:"absolute right-5 top-1/2 -translate-y-1/2 p-0.5 hover:bg-subtle-fill rounded",children:e.jsx(ot,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),g&&e.jsx("div",{className:"flex items-center justify-center flex-1",children:e.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-sys-blue border-t-transparent"})}),!g&&e.jsxs("div",{className:A("flex-1 overflow-y-auto min-h-0",I?"px-0":"px-1.5"),style:{contain:"layout style paint"},children:[L.map(w=>{const T=w.icon;return e.jsxs(Ie,{defaultOpen:!0,className:"mb-1",children:[e.jsxs(Me,{className:A("px-2 py-1 flex items-center gap-1.5 w-full","text-left radius-inner hover:bg-subtle-fill-strong transition-colors"),children:[e.jsx(T,{className:A("w-3.5 h-3.5",w.color)}),!I&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:w.label}),e.jsx("span",{className:"type-data-xs text-fg-muted/50 ml-auto",children:w.items.length})]})]}),e.jsx(Re,{children:e.jsx(he,{initial:!1,mode:"popLayout",children:w.items.map(z=>e.jsx(co,{contact:z,isActive:G===z.public_key,unread:a.get(z.public_key)??0,lastMsg:(()=>{const O=r.get(z.public_key);return O&&O.length>0?O[O.length-1]:void 0})(),isFav:p.has(z.public_key),microContent:I,onSelect:i,onShowDetails:o,onShareContact:m,onResetPath:c,onRemoveContact:f,onPingContact:d,repeaterSignal:x==null?void 0:x.get(z.public_key),toggleFavorite:D},z.public_key))})})]},w.key)}),X.length===0&&e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-sm text-fg-muted",children:y?"No matches":"No contacts yet"})})]})]})}));function po({open:s,onClose:t}){const n=te(p=>p.discoverImportableChannels),a=te(p=>p.getEmptyChannelSlots),r=te(p=>p.importChannel),i=te(p=>p.refreshChannels),[o,m]=l.useState("discover"),[c,f]=l.useState([]),[d,x]=l.useState([]),[g,h]=l.useState(null),u=l.useRef(!1);l.useEffect(()=>{if(!s)return;m("discover"),f([]),x([]),h(null),u.current=!1;let p=!1;return(async()=>{try{const[j,C]=await Promise.all([n(),a()]);if(p)return;if(x(C),j.length===0){h("No channels found in repeater history. Decoded messages may still be loading."),m("select");return}C.length===0&&h("No empty channel slots on device. Delete a channel first to make room."),f(j.map(k=>({name:k.name,alreadyOnDevice:k.alreadyOnDevice,selected:!k.alreadyOnDevice,status:"pending"}))),m("select")}catch(j){p||(h(j instanceof Error?j.message:"Discovery failed"),m("select"))}})(),()=>{p=!0}},[s,n,a]);const v=l.useCallback(p=>{f(j=>j.map(C=>C.name===p&&!C.alreadyOnDevice?{...C,selected:!C.selected}:C))},[]),S=l.useCallback(()=>{f(p=>p.map(j=>j.alreadyOnDevice?j:{...j,selected:!0}))},[]),b=l.useCallback(()=>{f(p=>p.map(j=>j.alreadyOnDevice?j:{...j,selected:!1}))},[]),E=l.useMemo(()=>c.filter(p=>!p.alreadyOnDevice).length,[c]),I=l.useMemo(()=>c.filter(p=>p.selected&&!p.alreadyOnDevice).length,[c]),_=l.useMemo(()=>c.filter(p=>p.status==="done").length,[c]),y=l.useMemo(()=>c.filter(p=>p.status==="failed").length,[c]),M=l.useCallback(async()=>{m("import"),u.current=!1;const p=c.filter(C=>C.selected&&!C.alreadyOnDevice),j=[...d];for(const C of p){if(u.current)break;const k=j.shift();if(k===void 0){f(N=>N.map(D=>D.name===C.name&&D.status==="pending"?{...D,status:"failed"}:D));continue}f(N=>N.map(D=>D.name===C.name?{...D,status:"sending"}:D)),await new Promise(N=>setTimeout(N,150));const F=await r(C.name,k);f(N=>N.map(D=>D.name===C.name?{...D,status:F?"done":"failed"}:D)),F||j.unshift(k),u.current||await new Promise(N=>setTimeout(N,300))}await i(),m("complete")},[c,d,r,i]),$=l.useCallback(()=>{u.current=!0},[]),R=p=>{switch(p){case"pending":return e.jsx(Nn,{className:"w-3.5 h-3.5 text-fg-muted"});case"sending":return e.jsx(oe,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"});case"done":return e.jsx(ge,{className:"w-3.5 h-3.5 text-sys-green"});case"failed":return e.jsx(ot,{className:"w-3.5 h-3.5 text-sys-red"})}};return e.jsxs(ve,{open:s,onClose:o==="import"?()=>{}:t,size:"sm",children:[e.jsx(Ee,{icon:e.jsx(We,{className:"w-5 h-5"}),title:"Import Channels",onClose:o==="import"?void 0:t}),e.jsxs(Ne,{className:"!py-3 !px-0",children:[o==="discover"&&e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 px-6",children:[e.jsx(oe,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"text-sm text-fg-secondary",children:"Scanning repeater history…"}),e.jsx("p",{className:"text-[11px] text-fg-muted",children:"Waiting for decoded messages"})]}),o==="select"&&e.jsxs(e.Fragment,{children:[g&&e.jsxs("div",{className:"flex items-start gap-2 mx-4 mb-3 p-2.5 radius-inner bg-sys-amber/8 border border-sys-amber/20",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 text-sys-amber flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-fg-secondary",children:g})]}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsxs("span",{className:"text-[11px] text-fg-muted",children:[E," discoverable · ",d.length," slot",d.length!==1?"s":""," free"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:S,className:"text-[11px] text-sys-blue hover:underline",children:"All"}),e.jsx("span",{className:"text-fg-muted/40",children:"·"}),e.jsx("button",{onClick:b,className:"text-[11px] text-sys-blue hover:underline",children:"None"})]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:c.map(p=>e.jsxs("button",{onClick:()=>v(p.name),disabled:p.alreadyOnDevice,className:A("w-full flex items-center gap-3 px-4 py-2 transition-colors",p.alreadyOnDevice?"opacity-40 cursor-default":"hover:bg-subtle-fill"),children:[e.jsx("div",{className:A("w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 transition-colors",p.alreadyOnDevice?"border-fg-muted/30 bg-fg-muted/10":p.selected?"border-sys-blue bg-sys-blue":"border-edge-subtle"),children:(p.selected||p.alreadyOnDevice)&&e.jsx(ge,{className:"w-3 h-3 text-white"})}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Fe,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-primary truncate",children:p.name})]}),p.alreadyOnDevice&&e.jsx("span",{className:"text-[10px] text-fg-muted bg-subtle-fill px-1.5 py-0.5 rounded flex-shrink-0",children:"on device"})]},p.name))})]})]}),(o==="import"||o==="complete")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsx("span",{className:"text-[11px] text-fg-muted",children:o==="import"?"Importing channels…":"Import complete"}),e.jsxs("span",{className:"text-[11px] tabular-nums text-fg-secondary",children:[_+y," / ",c.filter(p=>p.selected&&!p.alreadyOnDevice).length]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:c.filter(p=>p.selected&&!p.alreadyOnDevice).map(p=>e.jsxs("div",{className:A("flex items-center gap-3 px-4 py-2",p.status==="sending"&&"bg-sys-blue/5",p.status==="done"&&"bg-sys-green/5",p.status==="failed"&&"bg-sys-red/5"),children:[e.jsx("div",{className:"w-5 h-5 flex items-center justify-center flex-shrink-0",children:R(p.status)}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Fe,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:A("text-sm truncate",p.status==="done"?"text-fg-primary":"text-fg-secondary"),children:p.name})]}),e.jsx("span",{className:A("text-[10px] flex-shrink-0",p.status==="sending"&&"text-sys-blue",p.status==="done"&&"text-sys-green",p.status==="failed"&&"text-sys-red",p.status==="pending"&&"text-fg-muted"),children:p.status==="sending"?"sending…":p.status==="done"?"added":p.status==="failed"?"failed":"waiting"})]},p.name))})]})]}),e.jsxs(Pe,{children:[o==="select"&&e.jsxs(e.Fragment,{children:[e.jsx(H,{plain:!0,onClick:t,children:"Cancel"}),e.jsxs(H,{color:"primary",onClick:M,disabled:I===0||d.length===0,children:[e.jsx(We,{className:"w-4 h-4"}),"Import ",I," ",I===1?"Channel":"Channels"]})]}),o==="import"&&e.jsx(H,{plain:!0,onClick:$,children:"Stop"}),o==="complete"&&e.jsxs(e.Fragment,{children:[y>0&&e.jsxs("span",{className:"text-xs text-sys-red flex items-center gap-1 mr-auto",children:[e.jsx(Ue,{className:"w-3.5 h-3.5"}),y," failed"]}),e.jsxs(H,{color:"primary",onClick:t,children:[e.jsx(wl,{className:"w-4 h-4"}),"Done — ",_," imported"]})]})]})]})}const xo=4e3;function ho(s){const t=s.frequency_hz/1e3,n=s.bandwidth_hz/1e3;return`${t} · SF${s.spreading_factor} · ${n}k`}const fo=l.forwardRef(function({channel:t,isActive:n,unread:a,lastMsg:r,isLoadingMessages:i,selfInfo:o,onSelect:m,onDeleteChannel:c},f){const[d,x]=l.useState(!1),[g,h]=l.useState(!1),u=l.useRef(null),v=l.useCallback(()=>{x(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>x(!1),xo)},[]),S=l.useCallback(()=>{x(!1),u.current&&clearTimeout(u.current)},[]),b=l.useCallback(async()=>{c&&(u.current&&clearTimeout(u.current),h(!0),await c(t.index),h(!1),x(!1))},[c,t.index]),E=t.name.toLowerCase()==="public",I=c&&!E;return e.jsx(ae.div,{ref:f,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ne.fade,className:A("group w-full flex items-center gap-2.5 px-2.5 py-1 radius-inner","transition-[background-color] duration-150",d?"":n?"bg-sys-blue":"hover:bg-subtle-fill-strong"),children:e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:A("flex items-center gap-2.5 min-w-0",d&&"invisible pointer-events-none"),children:[e.jsx("button",{onClick:()=>m({type:"channel",id:String(t.index)}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:A("text-sm flex-shrink-0",n?"text-white font-semibold":r?"text-fg-primary font-semibold":"text-fg-secondary font-normal"),children:t.name}),E&&o&&e.jsx("span",{className:A("text-[9px] font-medium px-1.5 py-px rounded-full whitespace-nowrap truncate",n?"text-white/80 bg-white/15":"text-fg-muted/70 bg-subtle-fill"),children:ho(o)})]}),r&&e.jsx("div",{className:A("text-[11px] truncate pl-2",n?"text-white/70":"text-fg-muted"),children:r.text})]})}),e.jsx("div",{className:"flex items-center flex-shrink-0",children:i?e.jsx("span",{className:"h-1.5 w-6 rounded-full bg-fg-muted/20 animate-pulse"}):I?e.jsxs("div",{className:"relative w-[18px] h-[18px] flex items-center justify-center",children:[a>0&&e.jsx("span",{className:"absolute inset-0 flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold leading-none group-hover:invisible transition-[visibility] duration-100",children:a>99?"99+":a}),e.jsx("button",{onClick:v,className:A("absolute inset-0 flex items-center justify-center rounded opacity-0 group-hover:opacity-100 transition-[opacity,background-color] duration-100",n?"hover:bg-white/15":"hover:bg-subtle-fill"),title:"Remove channel",children:e.jsx(qe,{className:A("w-3 h-3 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-red")})})]}):a>0?e.jsx("span",{className:"min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold flex items-center justify-center leading-none",children:a>99?"99+":a}):null})]}),e.jsx("div",{className:A("flex items-center gap-1.5 self-center",!d&&"invisible pointer-events-none"),children:g?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:S,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:b,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(qe,{className:"w-4 h-4 text-white"})})]})})]})})}),go=l.memo(l.forwardRef(function({channels:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onAddChannel:o,onDeleteChannel:m,className:c},f){const d=sn(),x=ct(),[g,h]=l.useState(!1),u=l.useMemo(()=>{const S=new Set,b=t.filter(E=>S.has(E.index)?!1:(S.add(E.index),!0));return b.sort((E,I)=>{const _=E.name.toLowerCase()==="public",y=I.name.toLowerCase()==="public";if(_&&!y)return-1;if(!_&&y)return 1;const M=r.get(`ch:${E.index}`),$=M&&M.length>0?M[M.length-1].timestamp:0,R=r.get(`ch:${I.index}`),p=R&&R.length>0?R[R.length-1].timestamp:0;return $!==p?p-$:E.name.localeCompare(I.name)}),b},[t,r]),v=(n==null?void 0:n.type)==="channel"?n.id:null;return e.jsxs("div",{ref:f,className:A("flex-1 min-w-0 overflow-hidden flex flex-col h-full",c),children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-edge-subtle flex-shrink-0 overflow-hidden whitespace-nowrap",children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Channels"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>h(!0),className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Import channels from repeater history",children:e.jsx(We,{className:"w-3.5 h-3.5 text-fg-muted"})}),o&&e.jsx("button",{onClick:o,className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Add channel",children:e.jsx(Ge,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]}),e.jsx(po,{open:g,onClose:()=>h(!1)}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-1.5 py-1",style:{contain:"layout style paint"},children:u.length===0?e.jsxs("div",{className:"px-1.5 py-4 space-y-2",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"No channels"}),o&&e.jsxs("button",{onClick:o,className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs font-medium text-sys-blue hover:bg-sys-blue/8 rounded transition-colors",children:[e.jsx(Ge,{className:"w-3.5 h-3.5"}),"Add Channel"]})]}):e.jsx(he,{initial:!1,mode:"popLayout",children:u.map(S=>e.jsx(fo,{channel:S,isActive:v===String(S.index),unread:a.get(`ch:${S.index}`)??0,lastMsg:(()=>{const b=r.get(`ch:${S.index}`);return b&&b.length>0?b[b.length-1]:void 0})(),isLoadingMessages:d,selfInfo:x,onSelect:i,onDeleteChannel:m},S.index))})})]})}));function yo(s,t){const n=new Map;for(const[a,r]of s){const i=r.decoded;if(!(i!=null&&i.decrypted)||i.senderName!==t)continue;const o=i.timestamp??r.timestamp,m=Math.floor(o/30),c=`${i.text}:${m}`;n.has(c)||n.set(c,a)}return n}function bo(s){const t=ct(),n=ir(),a=or(),r=t==null?void 0:t.node_name,i=l.useMemo(()=>r?yo(n,r):new Map,[n,r]);return l.useMemo(()=>{const o=new Map;if(!r||i.size===0)return o;const m=new Map;for(const d of s){if(!d.is_outgoing||!d.is_channel)continue;const x=Math.floor(d.timestamp/30);let g=!1;for(const h of[x-1,x,x+1]){const u=i.get(`${d.text}:${h}`);if(u){const v=m.get(u)??[];v.push(d.id),m.set(u,v),g=!0;break}}}if(m.size===0)return o;const c=new Set(m.keys()),f=new Map;for(const d of a)c.has(d.packet_hash)&&f.set(d.packet_hash,(f.get(d.packet_hash)??0)+1);for(const[d,x]of m){const g=f.get(d)??0,h=Math.max(0,g-1);for(const u of x)o.set(u,h)}return o},[s,r,i,a])}const Q=l.memo(function({children:t,className:n,bgClassName:a,hideBadge:r,compact:i}){return e.jsxs("div",{className:A("relative max-w-full animate-bot-widget-in","rounded-2xl rounded-tl-md overflow-hidden","ring-1 ring-inset ring-edge-subtle",a||"bg-chat-incoming",i?"px-3 py-2":"px-3.5 py-3",n),children:[!r&&e.jsx("span",{className:"absolute top-1.5 right-2 text-[9px] text-sys-indigo/50 select-none pointer-events-none",children:"🤖"}),t]})}),jo=new Set(["☀️","🌤","🌤️"]),vo=new Set(["⛅","⛅️"]),No=new Set(["☁️","🌫","🌫️"]),wo=new Set(["🌧","🌧️","🌦","🌦️","⛈","⛈️","🌩","🌩️"]),ko=new Set(["❄️","🌨","🌨️"]);function Co(s){return jo.has(s)?"bg-gradient-to-br from-[var(--sys-blue)]/20 to-[var(--sys-indigo)]/10":vo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-blue)]/15":No.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60":wo.has(s)?"bg-gradient-to-br from-[var(--zinc-900)]/80 to-[var(--zinc-700)]/60":ko.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-cyan)]/10":"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60"}function Le({label:s}){return e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-fg-primary/10 text-[10px] text-fg-primary/80 tabular-nums",children:s})}function So({period:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted min-w-[56px]",children:s.label}),e.jsx("span",{className:"text-sm",children:s.conditionEmoji}),e.jsx("span",{className:"text-fg-primary/70",children:s.condition}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[s.temp,s.unit]}),s.wind&&e.jsx("span",{className:"text-fg-muted tabular-nums",children:s.wind})]})}const _o=l.memo(function({data:t}){const n=t.periods[0],a=t.periods.slice(1),r=Co(n.conditionEmoji);return e.jsxs(Q,{bgClassName:r,children:[e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:n.label}),e.jsxs("div",{className:"flex items-start gap-1.5 mb-2",children:[e.jsx("span",{className:"text-2xl leading-none",children:n.conditionEmoji}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-light text-fg-primary tabular-nums leading-none",children:[n.temp,"°"]}),e.jsx("span",{className:"text-xs text-fg-muted",children:n.unit.replace("°","")})]}),e.jsx("div",{className:"text-xs text-fg-primary/70 mt-0.5",children:n.condition})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[n.wind&&e.jsx(Le,{label:`💨 ${n.wind}`}),n.humidity&&e.jsx(Le,{label:`💧 ${n.humidity}`}),n.dewPoint&&e.jsx(Le,{label:`💧 ${n.dewPoint}`}),n.visibility&&e.jsx(Le,{label:`👁️ ${n.visibility}`}),n.pressure&&e.jsx(Le,{label:`📊 ${n.pressure}`})]}),n.high!=null&&n.low!=null&&e.jsxs("div",{className:"flex items-center gap-2 text-[11px] mb-2",children:[e.jsxs("span",{className:"text-fg-muted tabular-nums",children:["L ",n.low,"°"]}),e.jsx("div",{className:"flex-1 h-1 rounded-full bg-fg-primary/15 relative",children:e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-fg-primary/35",style:{width:n.high!==n.low?`${Math.max(0,Math.min(100,(n.temp-n.low)/(n.high-n.low)*100))}%`:"50%"}})}),e.jsxs("span",{className:"text-fg-primary/70 tabular-nums font-medium",children:["H ",n.high,"°"]})]}),a.length>0&&e.jsx("div",{className:"border-t border-edge-subtle pt-1.5 mt-1 space-y-0.5",children:a.map((i,o)=>e.jsx(So,{period:i},o))})]})}),Io=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-1 flex-shrink-0 min-w-[52px]",children:[e.jsx("span",{className:"text-[11px] text-fg-muted font-medium",children:n.dayAbbrev}),e.jsx("span",{className:"text-lg leading-none",children:n.conditionEmoji}),e.jsx("span",{className:"text-[10px] text-fg-primary/70 text-center leading-tight",children:n.condition}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] tabular-nums",children:[n.high!=null&&e.jsxs("span",{className:"text-fg-primary font-medium",children:[n.high,"°"]}),n.low!=null&&e.jsxs("span",{className:"text-fg-muted",children:[n.low,"°"]})]})]},a))})})}),Mo=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-0.5 flex-shrink-0 min-w-[44px]",children:[e.jsx("span",{className:"text-[10px] text-fg-muted font-medium tabular-nums",children:n.hour}),e.jsx("span",{className:"text-base leading-none",children:n.conditionEmoji}),e.jsxs("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:[n.temp,"°"]}),n.precipChance!=null&&n.precipChance>0&&e.jsxs("span",{className:A("text-[9px] tabular-nums font-medium",n.precipChance>=50?"text-sys-blue":"text-sys-blue/60"),children:[n.precipChance,"%"]})]},a))})})});function Ro(s){if(!s)return"amber";const t=s.toUpperCase();return t.includes("EXTREME")||t.includes("TORNADO")||t.includes("HURRICANE")||t.includes("SEVERE")||t.includes("WARNING")?"red":"amber"}const Eo={red:"border-l-sys-red",amber:"border-l-sys-amber"},Po={red:"text-sys-red",amber:"text-sys-amber"},To=l.memo(function({data:t}){const n=Ro(t.severity);return e.jsx(Q,{compact:!0,hideBadge:!0,children:e.jsxs("div",{className:A("border-l-[3px] pl-2.5 -ml-0.5",Eo[n]),children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"text-sm leading-none",children:"⚠️"}),t.severity&&e.jsx("span",{className:A("text-[10px] font-bold uppercase tracking-wider",Po[n]),children:t.severity})]}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.headline}),t.body&&e.jsx("p",{className:"text-xs text-fg-muted mt-1 leading-relaxed whitespace-pre-wrap break-words",children:t.body})]})})}),Ao={high:"🎯",medium:"📍",low:"❓"};function $o({hop:s}){return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono text-[11px] text-sys-blue font-bold tabular-nums min-w-[20px]",children:s.hex}),e.jsx("span",{className:"text-fg-muted/40 text-xs",children:"→"}),s.unknown?e.jsx("span",{className:"text-xs text-fg-muted/50 italic",children:"unknown"}):s.matchCount!=null?e.jsxs("span",{className:"text-xs text-sys-amber",children:[s.matchCount," matches"]}):e.jsxs("span",{className:A("text-xs font-medium truncate max-w-[140px]",s.confidence==="low"?"text-fg-muted":"text-fg-primary"),children:[s.name,s.confidence&&e.jsx("span",{className:"ml-0.5 text-[10px]",children:Ao[s.confidence]})]})]})}const Fo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1.5 pr-6",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"🛤️ Path"}),e.jsxs("span",{className:"text-[10px] text-fg-muted/60 tabular-nums",children:[t.hops.length," hop",t.hops.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-1",children:t.hops.map((n,a)=>e.jsx($o,{hop:n},a))})]})});function Do(s){return s>=10?5:s>=6?4:s>=3?3:s>=0?2:s>=-5?1:0}function Oo(s){return s>=4?"bg-sys-green":s>=3?"bg-sys-amber":s>=2?"bg-sys-orange":"bg-sys-red"}function Lo({bars:s}){const t=Oo(s);return e.jsx("div",{className:"flex items-end gap-[2px] h-[20px]",children:[6,10,14,18,20].map((n,a)=>e.jsx("div",{className:A("w-[4px] rounded-sm transition-colors",a0?"+":"",t.snr.toFixed(1),e.jsx("span",{className:"text-[10px] text-fg-muted font-normal ml-0.5",children:"dB"})]}),t.rssi!=null&&e.jsxs("span",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.rssi," dBm"]})]})]}),(t.hops!=null||t.pathHops)&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-1.5",children:[t.hops!=null&&e.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-sys-blue/10 text-[10px] text-sys-blue font-semibold tabular-nums",children:[t.hops," hop",t.hops!==1?"s":""]}),t.pathHops&&t.pathHops.length>0&&e.jsx("div",{className:"flex items-center gap-0.5 text-[10px]",children:t.pathHops.map((a,r)=>e.jsxs("span",{className:"contents",children:[r>0&&e.jsx("span",{className:"text-fg-muted/40",children:"›"}),e.jsx("span",{className:"font-mono text-fg-muted",children:a})]},r))})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-[10px] text-fg-muted",children:[t.distance&&e.jsx("span",{className:"tabular-nums",children:t.distance}),t.receivedAt&&e.jsxs("span",{className:"tabular-nums",children:["@ ",t.receivedAt]}),t.elapsed&&e.jsx("span",{className:"tabular-nums",children:t.elapsed}),t.phrase&&e.jsxs("span",{className:"text-fg-muted/60 italic truncate max-w-[120px]",children:['"',t.phrase,'"']})]})]})});function Bo(s){return s<=50?{text:"text-sys-green",bg:"bg-sys-green/10"}:s<=100?{text:"text-sys-amber",bg:"bg-sys-amber/10"}:s<=150?{text:"text-sys-orange",bg:"bg-sys-orange/10"}:s<=200?{text:"text-sys-red",bg:"bg-sys-red/10"}:s<=300?{text:"text-sys-violet",bg:"bg-sys-violet/10"}:{text:"text-sys-red",bg:"bg-sys-red/10"}}const Ho=l.memo(function({data:t}){const{text:n,bg:a}=Bo(t.aqi);return e.jsxs(Q,{compact:!0,children:[t.location&&e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:t.location}),e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:A("flex items-center justify-center w-12 h-12 rounded-xl",a),children:e.jsx("span",{className:A("text-xl font-bold tabular-nums",n),children:t.aqi})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:t.colorEmoji}),e.jsx("span",{className:A("text-sm font-semibold",n),children:t.category})]}),e.jsx("span",{className:"text-[10px] text-fg-muted",children:"Air Quality Index"})]})]}),t.pollutants.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:t.pollutants.map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-fg-primary/5 text-[10px] tabular-nums",children:[e.jsx("span",{className:"text-fg-muted font-medium",children:r.name}),e.jsx("span",{className:"text-fg-primary",children:r.value})]},r.name))})]})});function Wo(s){return s<=3?"text-sys-green":s<=4?"text-sys-amber":s<=6?"text-sys-orange":"text-sys-red"}function Ae({label:s,value:t,className:n}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:s}),e.jsx("span",{className:A("text-sm font-semibold tabular-nums text-fg-primary",n),children:t})]})}const Uo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"☀️"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Solar Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-x-4 gap-y-2",children:[t.aIndex!=null&&e.jsx(Ae,{label:"A-Index",value:t.aIndex}),t.kIndex!=null&&e.jsx(Ae,{label:"K-Index",value:t.kIndex,className:Wo(t.kIndex)}),t.sunspots!=null&&e.jsx(Ae,{label:"Sunspots",value:t.sunspots}),t.xrayFlux!=null&&e.jsx(Ae,{label:"X-Ray",value:t.xrayFlux}),t.solarFlux!=null&&e.jsx(Ae,{label:"Flux",value:t.solarFlux}),t.signalNoise!=null&&e.jsx(Ae,{label:"Noise",value:t.signalNoise})]})]})});function Ko(s){const t=s.toLowerCase();return t==="excellent"||t==="good"?"text-sys-green bg-sys-green/10":t==="fair"?"text-sys-amber bg-sys-amber/10":"text-sys-red bg-sys-red/10"}function Ts({band:s}){return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-0.5",children:[e.jsx("span",{className:"text-[11px] text-fg-primary font-mono tabular-nums",children:s.name}),e.jsx("span",{className:A("text-[10px] font-semibold px-1.5 py-0.5 rounded",Ko(s.condition)),children:s.condition})]})}const qo=l.memo(function({data:t}){const n=t.bands.filter(r=>r.time==="day"),a=t.bands.filter(r=>r.time==="night");return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"📻"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"HF Band Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Day"}),n.map((r,i)=>e.jsx(Ts,{band:r},i))]}),a.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Night"}),a.map((r,i)=>e.jsx(Ts,{band:r},i))]})]})]})});function Go({progress:s}){if(s==null)return null;const t=Math.max(0,Math.min(1,s)),n=Math.PI*(1-t),a=50-40*Math.cos(n),r=45-40*Math.sin(n);return e.jsxs("svg",{viewBox:"0 0 100 50",className:"w-full h-8 mb-1","aria-hidden":"true",children:[e.jsx("line",{x1:"8",y1:"45",x2:"92",y2:"45",stroke:"var(--fg-muted)",strokeWidth:"0.5",opacity:"0.3"}),e.jsx("path",{d:"M 10 45 A 40 40 0 0 1 90 45",fill:"none",stroke:"var(--sys-amber)",strokeWidth:"1",opacity:"0.3",strokeDasharray:"3 2"}),e.jsx("circle",{cx:a,cy:r,r:"3.5",fill:"var(--sys-amber)"}),e.jsx("text",{x:"10",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↑"}),e.jsx("text",{x:"90",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↓"})]})}const Vo=l.memo(function({data:t}){let n=null;if(t.daylightHours!=null&&t.daylightMinutes!=null&&t.remainingHours!=null&&t.remainingMinutes!=null){const m=t.daylightHours*60+t.daylightMinutes,c=t.remainingHours*60+t.remainingMinutes;m>0&&(n=1-c/m)}const a=t.isEvening?t.setTime:t.riseTime,r=t.isEvening?t.riseTime:t.setTime,i=t.isEvening?"Sunset":"Sunrise",o=t.isEvening?"Sunrise":"Sunset";return e.jsxs(Q,{compact:!0,children:[e.jsx(Go,{progress:n}),e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:i}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:a??"—"})]}),e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:o}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:r??"—"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[t.daylightHours!=null&&e.jsxs("span",{className:"text-fg-muted",children:["Daylight: ",e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.daylightHours,"h ",t.daylightMinutes,"m"]})]}),t.remainingHours!=null&&e.jsxs("span",{className:"text-sys-amber",children:["Remaining: ",e.jsxs("span",{className:"font-medium tabular-nums",children:[t.remainingHours,"h ",t.remainingMinutes,"m"]})]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),Jo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("span",{className:"text-3xl leading-none",children:t.phaseEmoji}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-fg-primary font-medium",children:t.phaseName}),t.illumination!=null&&e.jsxs("div",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.illumination.toFixed(1),"% illuminated"]})]})]}),e.jsxs("div",{className:"flex gap-4 mb-1.5 text-[10px]",children:[t.riseTime&&e.jsxs("span",{className:"text-fg-muted",children:["Rise: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime})]}),t.setTime&&e.jsxs("span",{className:"text-fg-muted",children:["Set: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime})]})]}),(t.nextFullMoon||t.nextNewMoon)&&e.jsxs("div",{className:"flex gap-3 text-[10px] text-fg-muted",children:[t.nextFullMoon&&e.jsxs("span",{children:["🌕 ",t.nextFullMoon]}),t.nextNewMoon&&e.jsxs("span",{children:["🌑 ",t.nextNewMoon]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),Qo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"text-sm font-semibold text-fg-primary mb-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:"🛰"}),t.satName]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 text-[11px]",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Rise"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime}),e.jsx("div",{className:"text-fg-muted",children:t.startAz})]}),e.jsxs("div",{className:"flex flex-col items-center flex-1",children:[e.jsxs("div",{className:"text-[10px] font-semibold tabular-nums",style:{color:t.maxEl>=60?"var(--sys-green)":t.maxEl>=30?"var(--sys-amber)":"var(--sys-red)"},children:[t.maxEl,"° max"]}),e.jsx("div",{className:"w-full h-px my-0.5",style:{background:"var(--edge-subtle)"}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Set"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime}),e.jsx("div",{className:"text-fg-muted",children:t.endAz})]})]}),e.jsxs("div",{className:"text-[10px] text-fg-muted tabular-nums",children:["Duration: ",e.jsx("span",{className:"text-fg-primary font-medium",children:t.duration})]})]})});function Xo(s){return s<=1?"var(--sys-green)":s<=3?"var(--sys-lime)":s<=4?"var(--sys-amber)":s<=6?"var(--sys-orange)":"var(--sys-red)"}const Yo=l.memo(function({data:t}){const n=Xo(t.kpIndex);return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center text-lg font-bold",style:{background:n,color:"var(--zinc-950)"},children:t.kpIndex}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:t.status}),e.jsx("div",{className:"text-[10px] text-fg-muted",children:"Kp Index"})]})]}),t.probability!=null&&e.jsxs("div",{className:"mb-1.5",children:[e.jsxs("div",{className:"flex justify-between text-[10px] mb-0.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Probability"}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.probability,"%"]})]}),e.jsx("div",{className:"w-full h-1.5 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.min(t.probability,100)}%`,background:n}})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-fg-muted",children:[t.location&&e.jsx("span",{children:t.location}),t.timestamp&&e.jsx("span",{className:"tabular-nums",children:t.timestamp})]})]})}),Zo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-base leading-none",children:"🎲"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Dice Roll"})]}),e.jsx("div",{className:"space-y-1.5",children:t.rolls.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted font-mono w-8 shrink-0",children:n.count>1?`${n.count}${n.dieType}`:n.dieType}),n.results.length>1?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-primary tabular-nums",children:["[",n.results.join(", "),"]"]}),e.jsx("span",{className:"text-fg-muted",children:"="}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]}):e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]},a))}),t.grandTotal!=null&&t.rolls.length>1&&e.jsxs("div",{className:"mt-2 pt-1.5 flex items-center justify-between text-xs",style:{borderTop:"1px solid var(--edge-subtle)"},children:[e.jsx("span",{className:"text-fg-muted",children:"Total"}),e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:t.grandTotal})]})]})}),As=l.memo(function({data:t,isDadJoke:n}){const a=n?"🥸":"🎭";return e.jsx(Q,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:a}),e.jsx("div",{className:"min-w-0",children:t.isTwoPart?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.setup}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words mt-2 pt-2 italic",style:{borderTop:"1px solid var(--edge-subtle)"},children:t.delivery})]}):e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.text})})]})})}),ec=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsx("div",{className:"space-y-1.5",children:t.games.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:a>0?{borderTop:"1px solid var(--edge-subtle)",paddingTop:"6px"}:void 0,children:[e.jsx("span",{className:"text-sm leading-none shrink-0",children:n.sportEmoji}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.away}),n.awayScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.awayScore})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.home}),n.homeScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.homeScore})]})]}),e.jsxs("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded shrink-0 tabular-nums",style:{color:n.isLive?"var(--sys-green)":n.isFinal?"var(--fg-muted)":"var(--sys-blue)",background:n.isLive?"color-mix(in srgb, var(--sys-green) 12%, transparent)":n.isFinal?"color-mix(in srgb, var(--fg-muted) 10%, transparent)":"color-mix(in srgb, var(--sys-blue) 12%, transparent)"},children:[n.isLive&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full mr-1 align-middle",style:{background:"var(--sys-green)",animation:"pulse 2s ease-in-out infinite"}}),n.status]})]},a))})})}),tc=l.memo(function({data:t}){var n;return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-sm leading-none",children:"📊"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:t.title??"Bot Stats"})]}),t.type==="basic"?e.jsxs("div",{className:"space-y-1 text-[11px]",children:[t.commands!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Commands"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.commands})]}),t.replies!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Replies"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.replies})]}),t.topCommand&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top Cmd"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topCommand})]}),t.topUser&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top User"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topUser})]})]}):e.jsx("div",{className:"space-y-1",children:(n=t.entries)==null?void 0:n.map(a=>{const r=t.entries[0].value,i=r>0?a.value/r*100:0;return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsxs("span",{className:"text-fg-muted w-4 text-right tabular-nums shrink-0",children:[a.rank,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex justify-between mb-0.5",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:a.name}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums shrink-0 ml-2",children:a.value})]}),e.jsx("div",{className:"w-full h-1 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,background:"var(--sys-blue)"}})})]})]},a.rank)})})]})}),sc=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:"🐱"}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t})]})})});function nc({text:s}){return e.jsx(Q,{compact:!0,children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:nl(s)})})}const ac=l.memo(function({text:t,messageType:n}){const a=l.useMemo(()=>n?Xi(t,n):null,[t,n]);if(a)switch(n){case"weather":return e.jsx(_o,{data:a});case"weather-multiday":return e.jsx(Io,{data:a});case"weather-hourly":return e.jsx(Mo,{data:a});case"weather-alert":return e.jsx(To,{data:a});case"path":return e.jsx(Fo,{data:a});case"test":return e.jsx(zo,{data:a});case"aqi":return e.jsx(Ho,{data:a});case"solar":return e.jsx(Uo,{data:a});case"hfcond":return e.jsx(qo,{data:a});case"sun":return e.jsx(Vo,{data:a});case"moon":return e.jsx(Jo,{data:a});case"satpass":return e.jsx(Qo,{data:a});case"aurora":return e.jsx(Yo,{data:a});case"dice":return e.jsx(Zo,{data:a});case"joke":return e.jsx(As,{data:a});case"dadjoke":return e.jsx(As,{data:a,isDadJoke:!0});case"sports":return e.jsx(ec,{data:a});case"stats":return e.jsx(tc,{data:a});case"catfact":return e.jsx(sc,{data:a})}return e.jsx(nc,{text:t})}),rc=l.lazy(()=>nn(()=>import("./CompanionPathMap-ChNL_sj-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(s=>({default:s.CompanionPathMap}))),lc=l.lazy(()=>nn(()=>import("./CompanionEchoMap-UK4pMkKr.js"),__vite__mapDeps([13,1,2,3,4,5,9,10,11,12])).then(s=>({default:s.CompanionEchoMap}))),$s=e.jsx("div",{className:"rounded-lg bg-elevated flex items-center justify-center",style:{aspectRatio:"16 / 10"},children:e.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})});function ic(s,t,n){return dr(new Date(s*1e3),t,n)}function oc(s,t){return cr(new Date(s*1e3),t)}function cc(s){const t=new Map;for(const n of s)n.name&&t.set(n.public_key,n.name);return t}function dc(s){const t=new Map;for(const n of s)t.set(n.public_key,n);return t}function uc(s){if(!s)return[];const t=[];for(let n=0;n64?t&63:t}function pc(s,t){const n=t.find(a=>a.public_key.startsWith(s));return(n==null?void 0:n.name)||null}function Fs(s,t){return s.is_outgoing?"You":s.sender_name?s.sender_name:s.author_prefix?s.author_prefix.slice(0,8):t.get(s.sender_key)??s.sender_key.slice(0,8)}const xc=new Set(["🎭","🥸"]);function hc({senderName:s,timestamp:t,signed:n,preferences:a,children:r}){const{emoji:i,cleanName:o}=dt(s),m=ut(o),c=mt(s);return e.jsxs("div",{className:"group flex items-start gap-4 w-full p-2",children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:A("clay-avatar w-9 h-9",i?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":m},children:i||c}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:al(t,a)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:o}),n&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]})]}),e.jsx("div",{className:"flex items-end gap-1.5 min-w-0",children:r})]})]})}const fc=l.memo(function({msg:t,contact:n,contacts:a,selfInfo:r,echoCount:i,channelName:o,allMessages:m,children:c}){const[f,d]=l.useState(!1),[x,g]=l.useState(!1),[h,u]=l.useState(0),v=l.useRef(null),S=mc(t.path_len),b=!t.is_outgoing,E=b&&S!=null,I=t.is_outgoing&&t.is_channel&&(i??0)>0,_=(o==null?void 0:o.toLowerCase().includes("wardrive"))??!1,y=l.useMemo(()=>_&&b?Sl(t.text):null,[_,b,t.text]),M=E||I,$=l.useMemo(()=>{const N=[];if(t.path_hops&&t.path_hops.length>0)N.push({hops:t.path_hops.slice(0,64),snr:t.path_snr,rssi:t.path_rssi});else if(b&&(n!=null&&n.out_path)){const D=uc(n.out_path);D.length>0&&N.push({hops:D})}if(t.alternate_paths)for(const D of t.alternate_paths)N.push(D);return N},[t.path_hops,t.path_snr,t.path_rssi,t.alternate_paths,b,n]),R=h<$.length?h:0,p=$[R]??$[0],j=$.length>1,C=(p==null?void 0:p.snr)??t.msg_snr,k=()=>{g(!0),d(N=>!N)},F=l.useCallback(N=>{var D;N.propertyName==="grid-template-rows"&&(f?(D=v.current)==null||D.scrollIntoView({block:"nearest",behavior:"smooth"}):g(!1))},[f]);return e.jsxs("div",{ref:v,className:A("rounded-xl px-2 py-1 -mx-2 transition-colors duration-150",M&&"hover:bg-subtle-fill cursor-pointer"),onClick:()=>M&&k(),children:[c,M&&e.jsx("div",{className:"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.83,0,0.17,1)]",style:{gridTemplateRows:f?"1fr":"0fr"},onTransitionEnd:F,children:e.jsxs("div",{className:"overflow-hidden",children:[x&&E&&e.jsxs("div",{className:"mt-1.5 ml-13 space-y-1",children:[j&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap",onClick:N=>N.stopPropagation(),children:$.map((N,D)=>e.jsxs("button",{onClick:()=>u(D),className:A("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] transition-colors",D===R?"bg-sys-blue/15 text-sys-blue font-semibold":"bg-subtle-fill text-fg-muted hover:text-fg-secondary"),children:[e.jsx(Ke,{className:"w-2.5 h-2.5"}),N.hops.length||S,N.snr!=null&&e.jsxs("span",{className:"ml-0.5 opacity-70",children:[N.snr>0?"+":"",N.snr.toFixed(1)]})]},D))}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(Ke,{className:"w-3 h-3 text-fg-muted flex-shrink-0"}),S===0&&!p?e.jsx("span",{className:"text-[10px] text-fg-muted font-medium",children:"Direct"}):p&&p.hops.length>0?p.hops.map((N,D)=>{const q=pc(N,a);return e.jsxs("span",{className:"contents",children:[D>0&&e.jsx(Il,{className:"w-2.5 h-2.5 text-fg-muted/50 flex-shrink-0"}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded bg-subtle-fill text-[10px]",children:[e.jsx("span",{className:"font-mono text-fg-primary",children:N}),q&&e.jsxs("span",{className:"text-fg-muted",children:["(",q,")"]})]})]},D)}):e.jsxs("span",{className:"text-[10px] text-fg-muted font-medium",children:[S," hop",S>1?"s":""]}),C!=null&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-fg-muted ml-0.5",children:[e.jsx(ll,{className:"w-2.5 h-2.5"}),C>0?"+":"",C.toFixed(1),"dB"]}),(p==null?void 0:p.rssi)!=null&&e.jsxs("span",{className:"text-[10px] text-fg-muted",children:[p.rssi,"dBm"]})]}),p&&p.hops.length>=1&&e.jsx(l.Suspense,{fallback:$s,children:e.jsx(rc,{hops:p.hops,contacts:a,selfInfo:r,snr:C,wardriveCoords:y??void 0,wardriveSenderName:t.sender_name,channelMessages:_?m:void 0,messageTimestamp:t.timestamp})})]}),x&&I&&e.jsx("div",{className:"mt-1.5",children:e.jsx(l.Suspense,{fallback:$s,children:e.jsx(lc,{text:t.text,timestamp:t.timestamp,contacts:a})})})]})})]})}),gc=l.memo(function({messages:t,contacts:n,className:a,conversationKey:r,onRetry:i,onRetryAsFlood:o,onMentionClick:m,isLoading:c,historyLoading:f,historyExhausted:d,onLoadOlder:x,channelName:g,contactPubKey:h}){const u=Ct(),v=l.useRef(null),S=l.useRef(null),[b,E]=l.useState(!1),[I,_]=l.useState(()=>new Date),y=l.useRef(t.length),M=l.useRef(0);l.useEffect(()=>{const w=window.setInterval(()=>_(new Date),6e4);return()=>window.clearInterval(w)},[]);const $=l.useRef(r);l.useEffect(()=>{if(r!==$.current){$.current=r,y.current=t.length,M.current=0;const w=requestAnimationFrame(()=>{E(!1);const T=v.current;T&&(T.scrollTop=T.scrollHeight)});return()=>cancelAnimationFrame(w)}},[r,t.length]);const R=l.useMemo(()=>cc(n),[n]),p=l.useMemo(()=>dc(n),[n]),j=ct(),C=bo(t),k=Vn(h??""),F=h?p.get(h):void 0,N=l.useMemo(()=>{if(!F)return!1;const w=t.filter(T=>!T.is_outgoing).slice(-5).map(T=>T.text);return Yi(F.name,k,w)},[F,k,t]),{combinedTexts:D,skipIds:q}=l.useMemo(()=>{const w=new Map,T=new Set;for(let z=0;z3)continue;const V=[...O.text][0];if(!V||!xc.has(V)||[...W.text][0]!==V)continue;const de=W.text.slice(V.length).trimStart();w.set(O.id,O.text+` +`).map(a=>a.trim()).filter(Boolean),n=[];for(const a of t){let r="";for(const c of Vi)if(a.startsWith(c)){r=c;break}if(!r)continue;const i=a.slice(r.length).trim(),o=i.match(/^(.+?)\s+(\d+)\s*[-–]\s*(.+?)\s+(\d+)\s*\((.+)\)$/);if(o){const c=o[5].trim(),f=/final/i.test(c),d=!f&&/\d/.test(c);n.push({sportEmoji:r,away:o[1].trim(),home:o[3].trim(),awayScore:parseInt(o[2],10),homeScore:parseInt(o[4],10),status:c,isLive:d,isFinal:f});continue}const m=i.match(/^(.+?)\s*[-–]\s*(.+?)\s*\((.+)\)$/);m&&n.push({sportEmoji:r,away:m[1].trim(),home:m[2].trim(),status:m[3].trim(),isLive:!1,isFinal:!1})}return n.length>=1?{games:n}:null}function Bn(s){var f,d,x,g;const t=[],n=/^(\d+)\.\s+(.+?):\s*(\d+)/gm;let a;for(;(a=n.exec(s))!==null;)t.push({rank:parseInt(a[1],10),name:a[2].trim(),value:parseInt(a[3],10)});if(t.length>=2){const h=s.match(/^(.+?)\n/i);return{type:"leaderboard",entries:t,title:(f=h==null?void 0:h[1])==null?void 0:f.replace(/📊\s*/,"").trim()}}const r=s.match(/Cmds?:\s*(\d+)/i),i=s.match(/Replies?:\s*(\d+)/i);if(!r&&!i)return null;const o=s.match(/Top\s*Cmd:\s*(.+?)\s*\(/i),m=s.match(/Top\s*User:\s*(.+?)\s*\(/i),c=s.match(/^(.+?)\n/i);return{type:"basic",commands:r?parseInt(r[1],10):void 0,replies:i?parseInt(i[1],10):void 0,topCommand:(d=o==null?void 0:o[1])==null?void 0:d.trim(),topUser:(x=m==null?void 0:m[1])==null?void 0:x.trim(),title:(g=c==null?void 0:c[1])==null?void 0:g.replace(/📊\s*/,"").trim()}}const Ji=new Set(["🐱","🐈","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🐾","👂","🐟","🧶","🥛"]);function Hn(s){if(!/\bcats?\b/i.test(s))return null;const t=s.slice(-4);for(const n of Ji)if(t.includes(n))return s;return null}const Qi=[{type:"dice",test:Cn},{type:"joke",test:Sn},{type:"dadjoke",test:_n},{type:"magic8",test:In},{type:"weather-alert",test:Mn},{type:"satpass",test:On},{type:"aurora",test:Ln},{type:"moon",test:Dn},{type:"sun",test:Fn},{type:"hfcond",test:$n},{type:"solar",test:An},{type:"aqi",test:Tn},{type:"sports",test:zn},{type:"stats",test:Bn},{type:"path",test:Pn},{type:"weather-multiday",test:Rn},{type:"weather-hourly",test:En},{type:"test",test:kn},{type:"weather",test:wn},{type:"catfact",test:Hn}];function Wn(s){for(const{type:t,test:n}of Qi)if(n(s)!=null)return t;return null}function Xi(s,t){switch(t){case"weather":return wn(s);case"weather-multiday":return Rn(s);case"weather-hourly":return En(s);case"weather-alert":return Mn(s);case"test":return kn(s);case"path":return Pn(s);case"aqi":return Tn(s);case"solar":return An(s);case"hfcond":return $n(s);case"sun":return Fn(s);case"moon":return Dn(s);case"satpass":return On(s);case"aurora":return Ln(s);case"dice":return Cn(s);case"joke":return Sn(s);case"dadjoke":return _n(s);case"magic8":return In(s);case"sports":return zn(s);case"stats":return Bn(s);case"catfact":return Hn(s);default:return null}}const Un=/[\u{1F916}\u{1F9BE}\u{1F9BF}]/u;function Yi(s,t,n){if(t==="bot")return!0;if(t==="not-bot")return!1;if(Un.test(s)||/bot\b/i.test(s))return!0;if(n&&n.length>0){let a=0;const r=n.slice(-5);for(const i of r)Wn(i)!=null&&a++;if(a>=Math.ceil(r.length*.6))return!0}return!1}function Kn(s){return Un.test(s)||/bot\b/i.test(s)}const qn="pymc_howl_bot_overrides";function Zi(){try{const s=localStorage.getItem(qn);if(!s)return new Map;const t=JSON.parse(s);return new Map(t)}catch{return new Map}}function Is(s){try{localStorage.setItem(qn,JSON.stringify([...s]))}catch{}}const Gn=nr(s=>({overrides:Zi(),setOverride:(t,n)=>s(a=>{const r=new Map(a.overrides);return r.set(t,n),Is(r),{overrides:r}}),clearOverride:t=>s(n=>{const a=new Map(n.overrides);return a.delete(t),Is(a),{overrides:a}})}));function Vn(s){return Gn(t=>t.overrides.get(s))}function eo(){return Gn(s=>s.setOverride)}const Jn="pymc_companion_contacts_micro",Qn="pymc_companion_favorites",yt=56;function Ms(){try{return localStorage.getItem(Jn)==="1"}catch{return!1}}function to(s){try{localStorage.setItem(Jn,s?"1":"0")}catch{}}function so(){try{const s=localStorage.getItem(Qn);return s?new Set(JSON.parse(s)):new Set}catch{return new Set}}function no(s){try{localStorage.setItem(Qn,JSON.stringify([...s]))}catch{}}function ao({name:s,pubkey:t,advType:n,size:a="md",signal:r}){const i=(n??0)&15,o=a==="sm"?"w-5 h-5":"w-6 h-6",m=a==="sm"?"size-3":"size-3.5";if(i===2){const x=r&&r.rssi!==0,g=x?`RSSI: ${r.rssi} dBm · SNR: ${r.snr.toFixed(1)} dB`:void 0;return e.jsx("div",{className:A(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px]",x?"ring-transparent":"ring-sys-blue"),title:g,children:x?e.jsx(rl,{rssi:r.rssi,snr:r.snr,compact:!0,showValues:!1}):e.jsx(Be,{className:A(m,"text-sys-blue")})})}if(i===3)return e.jsx("div",{className:A(o,"relative rounded-full flex items-center justify-center flex-shrink-0 ring-[1.5px] ring-sys-pink"),children:e.jsx(it,{className:A(m,"text-sys-pink")})});if(!s)return e.jsx("div",{className:A(o,"relative rounded-full bg-sys-blue/12 flex items-center justify-center flex-shrink-0"),children:e.jsx("span",{className:"text-sys-blue font-mono text-[10px] font-bold",children:t.slice(0,4)})});const{emoji:c}=dt(s),f=ut(s),d=mt(s);return e.jsx("div",{className:A(o,"relative clay-avatar",c?"text-base":"text-white text-[11px] font-bold"),style:{"--avatar-color":f},children:c||d})}const Rs=[{key:"companion",label:"Companions",icon:fe,color:"text-sys-blue"},{key:"room",label:"Room Servers",icon:it,color:"text-sys-pink"},{key:"repeater",label:"Repeaters",icon:Be,color:"text-sys-blue"}];function Xn(s){const t=(s.adv_type??0)&15;return t===3?"room":t===2?"repeater":"companion"}const ro=4e3,lo=5e3,io=2e3,oo=8,co=l.forwardRef(function({contact:t,isActive:n,unread:a,lastMsg:r,isFav:i,microContent:o,onSelect:m,onShowDetails:c,onShareContact:f,onResetPath:d,onRemoveContact:x,onPingContact:g,repeaterSignal:h,toggleFavorite:u},v){const S=ar(t.public_key),b=rr(t.public_key),E=Vn(t.public_key),I=eo(),_=E==="bot"||E==null&&Kn(t.name||""),[y,M]=l.useState(!1),[$,R]=l.useState(!1),p=l.useRef(null),[j,C]=l.useState("idle"),k=l.useRef(!1),F=l.useRef(null),[N,D]=l.useState({w:0,h:0});l.useEffect(()=>{let O=!1,W=null;return S?(k.current=!0,W="idle"):k.current&&(k.current=!1,W=te.getState().pingResults.get(t.public_key)!=null?"success":"failed"),W&&queueMicrotask(()=>{O||C(W)}),()=>{O=!0}},[S,t.public_key]),l.useEffect(()=>{if(j==="idle")return;const W=setTimeout(()=>C("idle"),j==="success"?lo:io);return()=>clearTimeout(W)},[j]);const q=(S||j!=="idle")&&!y;l.useEffect(()=>{if(!q)return;const O=F.current;if(!O)return;const W=()=>{const de=O.offsetWidth,we=O.offsetHeight;D(ye=>ye.w===de&&ye.h===we?ye:{w:de,h:we})};W();const V=new ResizeObserver(W);return V.observe(O),()=>V.disconnect()},[q]);const X=l.useCallback(()=>{M(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>M(!1),ro)},[]),L=l.useCallback(()=>{M(!1),p.current&&clearTimeout(p.current)},[]),G=l.useCallback(async()=>{x&&(p.current&&clearTimeout(p.current),R(!0),await x(t.public_key),R(!1),M(!1))},[x,t.public_key]),w=l.useMemo(()=>h&&h.rssi!==0?{rssi:h.rssi,snr:h.snr}:null,[h]),T=l.useCallback(O=>{F.current=O,typeof v=="function"?v(O):v&&(v.current=O)},[v]),z=y?"":j==="success"?"bg-sys-green/5":j==="failed"?"bg-sys-red/5":S?"bg-sys-blue/5":n?"bg-sys-blue":"hover:bg-elevated";return e.jsxs(ae.div,{ref:T,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ne.fade,className:A("group relative w-full flex items-center gap-2.5 px-2.5 py-[3px] radius-inner overflow-hidden","transition-[background-color,box-shadow] duration-150",z),children:[e.jsx(he,{children:q&&N.w>0&&(j!=="idle"?e.jsx(ae.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{opacity:{duration:.15}},className:A("absolute inset-0 radius-inner ring-2 ring-inset pointer-events-none z-[2]",j==="success"?"ring-sys-green":"ring-sys-red")},`ping-${j}`):e.jsx(lr,{borderRadius:oo,width:N.w,height:N.h,color:"blue"},"ping-crawl"))}),e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:A("flex items-center gap-2.5",y&&!o&&"invisible pointer-events-none"),children:[e.jsxs("button",{onClick:()=>m({type:"contact",id:t.public_key}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ao,{name:t.name,pubkey:t.public_key,advType:t.adv_type,signal:w}),a>0&&e.jsx("span",{className:"absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full bg-sys-red ring-2 ring-body"}),_&&!a&&e.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 flex items-center justify-center w-3 h-3 rounded-full bg-sys-violet ring-[1.5px] ring-body",title:"HOWL Bot",children:e.jsx(Ss,{className:"w-2 h-2 text-white"})})]}),!o&&e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("span",{className:A("text-sm truncate flex-1",n?"text-white font-medium":i?"text-sys-amber font-bold":"text-fg-primary font-medium"),children:t.name||t.public_key.slice(0,12)+"…"})}),j==="success"&&b?e.jsxs("div",{className:"text-[11px] text-sys-green font-medium truncate tabular-nums",children:[b.snr_db.toFixed(1)," dB SNR · ",b.rtt_ms," ms · ",b.hop_count," ",b.hop_count===1?"hop":"hops"]}):j==="failed"?e.jsx("div",{className:"text-[11px] text-sys-red font-medium truncate",children:"No response"}):r?e.jsx("div",{className:A("text-[11px] truncate",n?"text-white/70":"text-fg-muted"),children:r.text}):null]})]}),!o&&e.jsx("div",{className:"relative flex-shrink-0 w-[18px] h-[18px] flex items-center justify-center",children:e.jsx(ri,{as:"div",className:"absolute inset-0",children:({open:O})=>e.jsxs(e.Fragment,{children:[e.jsx(bn,{className:A("absolute inset-0 flex items-center justify-center rounded transition-[opacity,background-color] duration-100","focus:outline-none",n?"hover:bg-white/15":"hover:bg-subtle-fill",O?"opacity-100":"opacity-0 group-hover:opacity-100"),"aria-label":"Contact options",children:e.jsx(hi,{className:A("h-3.5 w-3.5 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-blue")})}),e.jsxs(jn,{anchor:"right start",transition:!0,className:A("min-w-[10rem] max-w-[20rem]","radius-inset p-1 ml-1","surface-elevated","focus:outline-none z-50","transition-[opacity,transform]","data-[closed]:opacity-0 data-[closed]:scale-[0.98] data-[closed]:translate-x-[-4px]","data-[enter]:duration-150 data-[leave]:duration-100","data-[enter]:ease-out data-[leave]:ease-in"),children:[e.jsx(je,{icon:e.jsx(He,{className:"w-4 h-4"}),onClick:()=>{c==null||c({type:"contact",id:t.public_key})},children:"Details"}),f&&e.jsx(je,{icon:e.jsx(vl,{className:"w-4 h-4"}),onClick:()=>f(t.public_key),children:"Share"}),e.jsx(je,{icon:e.jsx(Ke,{className:"w-4 h-4"}),onClick:()=>m({type:"contact",id:t.public_key}),children:"Set Path"}),d&&e.jsx(je,{icon:e.jsx(on,{className:"w-4 h-4"}),onClick:()=>d(t.public_key),children:"Reset Path"}),g&&Xn(t)==="repeater"&&e.jsx(je,{icon:e.jsx(pi,{className:"w-4 h-4"}),onClick:()=>g(t.public_key),disabled:S,children:S?"Pinging…":"Ping"}),x&&e.jsx(je,{icon:e.jsx(qe,{className:"w-4 h-4"}),destructive:!0,onClick:X,children:"Remove Contact"}),e.jsx(Ri,{}),e.jsx(je,{icon:_?e.jsx(ci,{className:"w-4 h-4 text-fg-muted"}):e.jsx(Ss,{className:"w-4 h-4 text-sys-violet"}),onClick:()=>I(t.public_key,_?"not-bot":"bot"),children:_?"Not a Bot":"Mark as HOWL Bot"}),e.jsx(je,{icon:e.jsx(_i,{className:A("w-4 h-4 group-data-[focus]:text-white group-data-[focus]:fill-white",i?"text-sys-amber fill-sys-amber":"text-fg-muted")}),onClick:()=>u(t.public_key),children:i?"Unfavorite":"Favorite"})]})]})})})]}),!o&&e.jsx("div",{className:A("flex items-center gap-1.5 self-center",!y&&"invisible pointer-events-none"),children:$?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:L,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:G,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(qe,{className:"w-4 h-4 text-white"})})]})})]})]},t.public_key)}),Es={excellent:4,good:3,fair:2,weak:1,poor:0};function Ps(s,t){const n=t==null?void 0:t.get(s);return n&&n.rssi!==0?n.rssi:null}function uo(s,t,n,a){return[...s].sort((r,i)=>{const o=t.has(r.public_key)?0:1,m=t.has(i.public_key)?0:1;if(o!==m)return o-m;if(n){const c=n.get(r.public_key),f=c&&c.length>0?c[c.length-1].timestamp:0,d=n.get(i.public_key),x=d&&d.length>0?d[d.length-1].timestamp:0;if(f!==x)return x-f}if(a){const c=Ps(r.public_key,a),f=Ps(i.public_key,a);if(c!=null&&f==null)return-1;if(c==null&&f!=null)return 1;if(c!=null&&f!=null){const d=Es[js(c)]??0,x=Es[js(f)]??0;if(d!==x)return x-d}}return(r.name||"").localeCompare(i.name||"")})}const mo=l.memo(l.forwardRef(function({contacts:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onShowDetails:o,onShareContact:m,onResetPath:c,onRemoveContact:f,onPingContact:d,repeaterSignalMap:x,isLoading:g,splitPercent:h=50,onMicroChange:u,className:v},S){const[b,E]=l.useState(Ms),[I,_]=l.useState(Ms),[y,M]=l.useState(""),[$,R]=l.useState(!1),[p,j]=l.useState(so),C=l.useRef(null),k=l.useRef(null),F=l.useCallback(w=>{k.current=w,typeof S=="function"?S(w):S&&(S.current=w)},[S]),N=l.useCallback(()=>{E(w=>{const T=!w;to(T);const z=k.current;if(T&&_(!0),z){let O=0;const W=z.parentElement;if(T)O=(W==null?void 0:W.offsetWidth)??z.offsetWidth;else if(W){const de=W.style.width;W.style.width="var(--companion-side)",O=W.offsetWidth,W.style.width=de}const V=T?yt:Math.round(h/100*O);et(z,{width:`${V}px`},{...ne.layoutResize,onComplete(){z.style.width=T?`${yt}px`:`${h}%`,T||_(!1)}})}return u==null||u(T),T})},[h,u]),D=l.useCallback(w=>{j(T=>{const z=new Set(T);return z.has(w)?z.delete(w):z.add(w),no(z),z})},[]),q=$||y.length>0,X=l.useMemo(()=>{const w=new Set,T=t.filter(O=>w.has(O.public_key)?!1:(w.add(O.public_key),!0));if(!y.trim())return T;const z=y.toLowerCase();return T.filter(O=>{var W;return((W=O.name)==null?void 0:W.toLowerCase().includes(z))||O.public_key.toLowerCase().includes(z)})},[t,y]),L=l.useMemo(()=>{const w=new Map;for(const T of Rs)w.set(T.key,[]);for(const T of X)w.get(Xn(T)).push(T);return Rs.map(T=>({...T,items:uo(w.get(T.key),p,r,T.key==="repeater"?x:void 0)})).filter(T=>T.items.length>0)},[X,p,r,x]),G=(n==null?void 0:n.type)==="contact"?n.id:null;return e.jsxs("div",{ref:F,className:A("flex-shrink-0 overflow-hidden flex flex-col h-full",v),style:{width:b?yt:`${h}%`},children:[e.jsx("div",{className:A("flex items-center border-b border-edge-subtle flex-shrink-0",I?"justify-center p-2":"gap-2 px-3 py-2"),children:I?e.jsx("button",{onClick:N,className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Expand contacts",children:e.jsx(Ni,{className:"w-3.5 h-3.5 text-fg-muted"})}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Contacts"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>{q?(M(""),R(!1)):(R(!0),setTimeout(()=>{var w;return(w=C.current)==null?void 0:w.focus()},50))},className:A("p-1 rounded transition-colors flex-shrink-0",q?"bg-sys-blue/10 text-sys-blue":"hover:bg-subtle-fill text-fg-muted"),title:q?"Close search":"Search contacts",children:e.jsx(vs,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:N,className:"p-1 hover:bg-subtle-fill rounded transition-colors flex-shrink-0",title:"Collapse contacts",children:e.jsx(ji,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]})}),!I&&q&&e.jsxs("div",{className:"relative px-2.5 py-2 border-b border-edge-subtle/50 flex-shrink-0",children:[e.jsx(vs,{className:"absolute left-5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-fg-muted pointer-events-none"}),e.jsx("input",{ref:C,type:"text",value:y,onChange:w=>M(w.target.value),onFocus:()=>R(!0),onBlur:()=>R(!1),placeholder:"Search contacts…",className:"w-full pl-8 pr-8 py-1.5 text-sm radius-inner bg-input-bg border border-input-border text-fg-primary placeholder:text-fg-muted/50 ring-focus-inset hover:border-edge-strong transition-colors",autoFocus:!0}),e.jsx("button",{onClick:()=>{M(""),R(!1)},className:"absolute right-5 top-1/2 -translate-y-1/2 p-0.5 hover:bg-subtle-fill rounded",children:e.jsx(ot,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),g&&e.jsx("div",{className:"flex items-center justify-center flex-1",children:e.jsx("div",{className:"w-5 h-5 animate-spin rounded-full border-2 border-sys-blue border-t-transparent"})}),!g&&e.jsxs("div",{className:A("flex-1 overflow-y-auto min-h-0",I?"px-0":"px-1.5"),style:{contain:"layout style paint"},children:[L.map(w=>{const T=w.icon;return e.jsxs(Ie,{defaultOpen:!0,className:"mb-1",children:[e.jsxs(Me,{className:A("px-2 py-1 flex items-center gap-1.5 w-full","text-left radius-inner hover:bg-subtle-fill-strong transition-colors"),children:[e.jsx(T,{className:A("w-3.5 h-3.5",w.color)}),!I&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:w.label}),e.jsx("span",{className:"type-data-xs text-fg-muted/50 ml-auto",children:w.items.length})]})]}),e.jsx(Re,{children:e.jsx(he,{initial:!1,mode:"popLayout",children:w.items.map(z=>e.jsx(co,{contact:z,isActive:G===z.public_key,unread:a.get(z.public_key)??0,lastMsg:(()=>{const O=r.get(z.public_key);return O&&O.length>0?O[O.length-1]:void 0})(),isFav:p.has(z.public_key),microContent:I,onSelect:i,onShowDetails:o,onShareContact:m,onResetPath:c,onRemoveContact:f,onPingContact:d,repeaterSignal:x==null?void 0:x.get(z.public_key),toggleFavorite:D},z.public_key))})})]},w.key)}),X.length===0&&e.jsx("div",{className:"text-center py-8",children:e.jsx("p",{className:"text-sm text-fg-muted",children:y?"No matches":"No contacts yet"})})]})]})}));function po({open:s,onClose:t}){const n=te(p=>p.discoverImportableChannels),a=te(p=>p.getEmptyChannelSlots),r=te(p=>p.importChannel),i=te(p=>p.refreshChannels),[o,m]=l.useState("discover"),[c,f]=l.useState([]),[d,x]=l.useState([]),[g,h]=l.useState(null),u=l.useRef(!1);l.useEffect(()=>{if(!s)return;m("discover"),f([]),x([]),h(null),u.current=!1;let p=!1;return(async()=>{try{const[j,C]=await Promise.all([n(),a()]);if(p)return;if(x(C),j.length===0){h("No channels found in repeater history. Decoded messages may still be loading."),m("select");return}C.length===0&&h("No empty channel slots on device. Delete a channel first to make room."),f(j.map(k=>({name:k.name,alreadyOnDevice:k.alreadyOnDevice,selected:!k.alreadyOnDevice,status:"pending"}))),m("select")}catch(j){p||(h(j instanceof Error?j.message:"Discovery failed"),m("select"))}})(),()=>{p=!0}},[s,n,a]);const v=l.useCallback(p=>{f(j=>j.map(C=>C.name===p&&!C.alreadyOnDevice?{...C,selected:!C.selected}:C))},[]),S=l.useCallback(()=>{f(p=>p.map(j=>j.alreadyOnDevice?j:{...j,selected:!0}))},[]),b=l.useCallback(()=>{f(p=>p.map(j=>j.alreadyOnDevice?j:{...j,selected:!1}))},[]),E=l.useMemo(()=>c.filter(p=>!p.alreadyOnDevice).length,[c]),I=l.useMemo(()=>c.filter(p=>p.selected&&!p.alreadyOnDevice).length,[c]),_=l.useMemo(()=>c.filter(p=>p.status==="done").length,[c]),y=l.useMemo(()=>c.filter(p=>p.status==="failed").length,[c]),M=l.useCallback(async()=>{m("import"),u.current=!1;const p=c.filter(C=>C.selected&&!C.alreadyOnDevice),j=[...d];for(const C of p){if(u.current)break;const k=j.shift();if(k===void 0){f(N=>N.map(D=>D.name===C.name&&D.status==="pending"?{...D,status:"failed"}:D));continue}f(N=>N.map(D=>D.name===C.name?{...D,status:"sending"}:D)),await new Promise(N=>setTimeout(N,150));const F=await r(C.name,k);f(N=>N.map(D=>D.name===C.name?{...D,status:F?"done":"failed"}:D)),F||j.unshift(k),u.current||await new Promise(N=>setTimeout(N,300))}await i(),m("complete")},[c,d,r,i]),$=l.useCallback(()=>{u.current=!0},[]),R=p=>{switch(p){case"pending":return e.jsx(Nn,{className:"w-3.5 h-3.5 text-fg-muted"});case"sending":return e.jsx(oe,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"});case"done":return e.jsx(ge,{className:"w-3.5 h-3.5 text-sys-green"});case"failed":return e.jsx(ot,{className:"w-3.5 h-3.5 text-sys-red"})}};return e.jsxs(ve,{open:s,onClose:o==="import"?()=>{}:t,size:"sm",children:[e.jsx(Ee,{icon:e.jsx(We,{className:"w-5 h-5"}),title:"Import Channels",onClose:o==="import"?void 0:t}),e.jsxs(Ne,{className:"!py-3 !px-0",children:[o==="discover"&&e.jsxs("div",{className:"flex flex-col items-center gap-3 py-8 px-6",children:[e.jsx(oe,{className:"w-6 h-6 text-sys-blue animate-spin"}),e.jsx("p",{className:"text-sm text-fg-secondary",children:"Scanning repeater history…"}),e.jsx("p",{className:"text-[11px] text-fg-muted",children:"Waiting for decoded messages"})]}),o==="select"&&e.jsxs(e.Fragment,{children:[g&&e.jsxs("div",{className:"flex items-start gap-2 mx-4 mb-3 p-2.5 radius-inner bg-sys-amber/8 border border-sys-amber/20",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 text-sys-amber flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-xs text-fg-secondary",children:g})]}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsxs("span",{className:"text-[11px] text-fg-muted",children:[E," discoverable · ",d.length," slot",d.length!==1?"s":""," free"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:S,className:"text-[11px] text-sys-blue hover:underline",children:"All"}),e.jsx("span",{className:"text-fg-muted/40",children:"·"}),e.jsx("button",{onClick:b,className:"text-[11px] text-sys-blue hover:underline",children:"None"})]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:c.map(p=>e.jsxs("button",{onClick:()=>v(p.name),disabled:p.alreadyOnDevice,className:A("w-full flex items-center gap-3 px-4 py-2 transition-colors",p.alreadyOnDevice?"opacity-40 cursor-default":"hover:bg-subtle-fill"),children:[e.jsx("div",{className:A("w-4 h-4 rounded border flex items-center justify-center flex-shrink-0 transition-colors",p.alreadyOnDevice?"border-fg-muted/30 bg-fg-muted/10":p.selected?"border-sys-blue bg-sys-blue":"border-edge-subtle"),children:(p.selected||p.alreadyOnDevice)&&e.jsx(ge,{className:"w-3 h-3 text-white"})}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Fe,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-primary truncate",children:p.name})]}),p.alreadyOnDevice&&e.jsx("span",{className:"text-[10px] text-fg-muted bg-subtle-fill px-1.5 py-0.5 rounded flex-shrink-0",children:"on device"})]},p.name))})]})]}),(o==="import"||o==="complete")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between px-4 pb-2 border-b border-edge-subtle",children:[e.jsx("span",{className:"text-[11px] text-fg-muted",children:o==="import"?"Importing channels…":"Import complete"}),e.jsxs("span",{className:"text-[11px] tabular-nums text-fg-secondary",children:[_+y," / ",c.filter(p=>p.selected&&!p.alreadyOnDevice).length]})]}),e.jsx("div",{className:"max-h-[320px] overflow-y-auto",children:c.filter(p=>p.selected&&!p.alreadyOnDevice).map(p=>e.jsxs("div",{className:A("flex items-center gap-3 px-4 py-2",p.status==="sending"&&"bg-sys-blue/5",p.status==="done"&&"bg-sys-green/5",p.status==="failed"&&"bg-sys-red/5"),children:[e.jsx("div",{className:"w-5 h-5 flex items-center justify-center flex-shrink-0",children:R(p.status)}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(Fe,{className:"w-3.5 h-3.5 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:A("text-sm truncate",p.status==="done"?"text-fg-primary":"text-fg-secondary"),children:p.name})]}),e.jsx("span",{className:A("text-[10px] flex-shrink-0",p.status==="sending"&&"text-sys-blue",p.status==="done"&&"text-sys-green",p.status==="failed"&&"text-sys-red",p.status==="pending"&&"text-fg-muted"),children:p.status==="sending"?"sending…":p.status==="done"?"added":p.status==="failed"?"failed":"waiting"})]},p.name))})]})]}),e.jsxs(Pe,{children:[o==="select"&&e.jsxs(e.Fragment,{children:[e.jsx(H,{plain:!0,onClick:t,children:"Cancel"}),e.jsxs(H,{color:"primary",onClick:M,disabled:I===0||d.length===0,children:[e.jsx(We,{className:"w-4 h-4"}),"Import ",I," ",I===1?"Channel":"Channels"]})]}),o==="import"&&e.jsx(H,{plain:!0,onClick:$,children:"Stop"}),o==="complete"&&e.jsxs(e.Fragment,{children:[y>0&&e.jsxs("span",{className:"text-xs text-sys-red flex items-center gap-1 mr-auto",children:[e.jsx(Ue,{className:"w-3.5 h-3.5"}),y," failed"]}),e.jsxs(H,{color:"primary",onClick:t,children:[e.jsx(wl,{className:"w-4 h-4"}),"Done — ",_," imported"]})]})]})]})}const xo=4e3;function ho(s){const t=s.frequency_hz/1e3,n=s.bandwidth_hz/1e3;return`${t} · SF${s.spreading_factor} · ${n}k`}const fo=l.forwardRef(function({channel:t,isActive:n,unread:a,lastMsg:r,isLoadingMessages:i,selfInfo:o,onSelect:m,onDeleteChannel:c},f){const[d,x]=l.useState(!1),[g,h]=l.useState(!1),u=l.useRef(null),v=l.useCallback(()=>{x(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>x(!1),xo)},[]),S=l.useCallback(()=>{x(!1),u.current&&clearTimeout(u.current)},[]),b=l.useCallback(async()=>{c&&(u.current&&clearTimeout(u.current),h(!0),await c(t.index),h(!1),x(!1))},[c,t.index]),E=t.name.toLowerCase()==="public",I=c&&!E;return e.jsx(ae.div,{ref:f,layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ne.fade,className:A("group w-full flex items-center gap-2.5 px-2.5 py-1 radius-inner","transition-[background-color] duration-150",d?"":n?"bg-sys-blue":"hover:bg-subtle-fill-strong"),children:e.jsxs("div",{className:"grid flex-1 min-w-0 [&>*]:col-start-1 [&>*]:row-start-1",children:[e.jsxs("div",{className:A("flex items-center gap-2.5 min-w-0",d&&"invisible pointer-events-none"),children:[e.jsx("button",{onClick:()=>m({type:"channel",id:String(t.index)}),className:"flex items-center gap-2.5 flex-1 min-w-0 text-left",children:e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:A("text-sm flex-shrink-0",n?"text-white font-semibold":r?"text-fg-primary font-semibold":"text-fg-secondary font-normal"),children:t.name}),E&&o&&e.jsx("span",{className:A("text-[9px] font-medium px-1.5 py-px rounded-full whitespace-nowrap truncate",n?"text-white/80 bg-white/15":"text-fg-muted/70 bg-subtle-fill"),children:ho(o)})]}),r&&e.jsx("div",{className:A("text-[11px] truncate pl-2",n?"text-white/70":"text-fg-muted"),children:r.text})]})}),e.jsx("div",{className:"flex items-center flex-shrink-0",children:i?e.jsx("span",{className:"h-1.5 w-6 rounded-full bg-fg-muted/20 animate-pulse"}):I?e.jsxs("div",{className:"relative w-[18px] h-[18px] flex items-center justify-center",children:[a>0&&e.jsx("span",{className:"absolute inset-0 flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold leading-none group-hover:invisible transition-[visibility] duration-100",children:a>99?"99+":a}),e.jsx("button",{onClick:v,className:A("absolute inset-0 flex items-center justify-center rounded opacity-0 group-hover:opacity-100 transition-[opacity,background-color] duration-100",n?"hover:bg-white/15":"hover:bg-subtle-fill"),title:"Remove channel",children:e.jsx(qe,{className:A("w-3 h-3 transition-colors",n?"text-white/60 hover:text-white":"text-fg-muted hover:text-sys-red")})})]}):a>0?e.jsx("span",{className:"min-w-[18px] h-[18px] px-1 rounded-full bg-sys-red text-white text-[10px] font-bold flex items-center justify-center leading-none",children:a>99?"99+":a}):null})]}),e.jsx("div",{className:A("flex items-center gap-1.5 self-center",!d&&"invisible pointer-events-none"),children:g?e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"w-3.5 h-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:S,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-zinc-500/80 hover:bg-zinc-500 depth-stroke-raised transition-colors",children:e.jsx("span",{className:"text-[11px] font-semibold text-white",children:"Cancel"})}),e.jsx("button",{onClick:b,className:"flex-1 flex items-center justify-center py-1 radius-inner bg-sys-red/80 hover:bg-sys-red depth-stroke-raised transition-colors",children:e.jsx(qe,{className:"w-4 h-4 text-white"})})]})})]})})}),go=l.memo(l.forwardRef(function({channels:t,selectedConversation:n,unreadMap:a,messages:r,onSelect:i,onAddChannel:o,onDeleteChannel:m,className:c},f){const d=sn(),x=ct(),[g,h]=l.useState(!1),u=l.useMemo(()=>{const S=new Set,b=t.filter(E=>S.has(E.index)?!1:(S.add(E.index),!0));return b.sort((E,I)=>{const _=E.name.toLowerCase()==="public",y=I.name.toLowerCase()==="public";if(_&&!y)return-1;if(!_&&y)return 1;const M=r.get(`ch:${E.index}`),$=M&&M.length>0?M[M.length-1].timestamp:0,R=r.get(`ch:${I.index}`),p=R&&R.length>0?R[R.length-1].timestamp:0;return $!==p?p-$:E.name.localeCompare(I.name)}),b},[t,r]),v=(n==null?void 0:n.type)==="channel"?n.id:null;return e.jsxs("div",{ref:f,className:A("flex-1 min-w-0 overflow-hidden flex flex-col h-full",c),children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-edge-subtle flex-shrink-0 overflow-hidden whitespace-nowrap",children:[e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide flex-shrink-0",children:"Channels"}),e.jsxs("div",{className:"flex items-center gap-1 ml-auto flex-shrink-0",children:[e.jsx("button",{onClick:()=>h(!0),className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Import channels from repeater history",children:e.jsx(We,{className:"w-3.5 h-3.5 text-fg-muted"})}),o&&e.jsx("button",{onClick:o,className:"p-1 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Add channel",children:e.jsx(Ge,{className:"w-3.5 h-3.5 text-fg-muted"})})]})]}),e.jsx(po,{open:g,onClose:()=>h(!1)}),e.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-1.5 py-1",style:{contain:"layout style paint"},children:u.length===0?e.jsxs("div",{className:"px-1.5 py-4 space-y-2",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"No channels"}),o&&e.jsxs("button",{onClick:o,className:"inline-flex items-center gap-1.5 px-2 py-1.5 text-xs font-medium text-sys-blue hover:bg-sys-blue/8 rounded transition-colors",children:[e.jsx(Ge,{className:"w-3.5 h-3.5"}),"Add Channel"]})]}):e.jsx(he,{initial:!1,mode:"popLayout",children:u.map(S=>e.jsx(fo,{channel:S,isActive:v===String(S.index),unread:a.get(`ch:${S.index}`)??0,lastMsg:(()=>{const b=r.get(`ch:${S.index}`);return b&&b.length>0?b[b.length-1]:void 0})(),isLoadingMessages:d,selfInfo:x,onSelect:i,onDeleteChannel:m},S.index))})})]})}));function yo(s,t){const n=new Map;for(const[a,r]of s){const i=r.decoded;if(!(i!=null&&i.decrypted)||i.senderName!==t)continue;const o=i.timestamp??r.timestamp,m=Math.floor(o/30),c=`${i.text}:${m}`;n.has(c)||n.set(c,a)}return n}function bo(s){const t=ct(),n=ir(),a=or(),r=t==null?void 0:t.node_name,i=l.useMemo(()=>r?yo(n,r):new Map,[n,r]);return l.useMemo(()=>{const o=new Map;if(!r||i.size===0)return o;const m=new Map;for(const d of s){if(!d.is_outgoing||!d.is_channel)continue;const x=Math.floor(d.timestamp/30);let g=!1;for(const h of[x-1,x,x+1]){const u=i.get(`${d.text}:${h}`);if(u){const v=m.get(u)??[];v.push(d.id),m.set(u,v),g=!0;break}}}if(m.size===0)return o;const c=new Set(m.keys()),f=new Map;for(const d of a)c.has(d.packet_hash)&&f.set(d.packet_hash,(f.get(d.packet_hash)??0)+1);for(const[d,x]of m){const g=f.get(d)??0,h=Math.max(0,g-1);for(const u of x)o.set(u,h)}return o},[s,r,i,a])}const Q=l.memo(function({children:t,className:n,bgClassName:a,hideBadge:r,compact:i}){return e.jsxs("div",{className:A("relative max-w-full animate-bot-widget-in","rounded-2xl rounded-tl-md overflow-hidden","ring-1 ring-inset ring-edge-subtle",a||"bg-chat-incoming",i?"px-3 py-2":"px-3.5 py-3",n),children:[!r&&e.jsx("span",{className:"absolute top-1.5 right-2 text-[9px] text-sys-indigo/50 select-none pointer-events-none",children:"🤖"}),t]})}),jo=new Set(["☀️","🌤","🌤️"]),vo=new Set(["⛅","⛅️"]),No=new Set(["☁️","🌫","🌫️"]),wo=new Set(["🌧","🌧️","🌦","🌦️","⛈","⛈️","🌩","🌩️"]),ko=new Set(["❄️","🌨","🌨️"]);function Co(s){return jo.has(s)?"bg-gradient-to-br from-[var(--sys-blue)]/20 to-[var(--sys-indigo)]/10":vo.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-blue)]/15":No.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60":wo.has(s)?"bg-gradient-to-br from-[var(--zinc-900)]/80 to-[var(--zinc-700)]/60":ko.has(s)?"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--sys-cyan)]/10":"bg-gradient-to-br from-[var(--zinc-800)]/80 to-[var(--zinc-700)]/60"}function Le({label:s}){return e.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-fg-primary/10 text-[10px] text-fg-primary/80 tabular-nums",children:s})}function So({period:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted min-w-[56px]",children:s.label}),e.jsx("span",{className:"text-sm",children:s.conditionEmoji}),e.jsx("span",{className:"text-fg-primary/70",children:s.condition}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[s.temp,s.unit]}),s.wind&&e.jsx("span",{className:"text-fg-muted tabular-nums",children:s.wind})]})}const _o=l.memo(function({data:t}){const n=t.periods[0],a=t.periods.slice(1),r=Co(n.conditionEmoji);return e.jsxs(Q,{bgClassName:r,children:[e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:n.label}),e.jsxs("div",{className:"flex items-start gap-1.5 mb-2",children:[e.jsx("span",{className:"text-2xl leading-none",children:n.conditionEmoji}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1",children:[e.jsxs("span",{className:"text-3xl font-light text-fg-primary tabular-nums leading-none",children:[n.temp,"°"]}),e.jsx("span",{className:"text-xs text-fg-muted",children:n.unit.replace("°","")})]}),e.jsx("div",{className:"text-xs text-fg-primary/70 mt-0.5",children:n.condition})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[n.wind&&e.jsx(Le,{label:`💨 ${n.wind}`}),n.humidity&&e.jsx(Le,{label:`💧 ${n.humidity}`}),n.dewPoint&&e.jsx(Le,{label:`💧 ${n.dewPoint}`}),n.visibility&&e.jsx(Le,{label:`👁️ ${n.visibility}`}),n.pressure&&e.jsx(Le,{label:`📊 ${n.pressure}`})]}),n.high!=null&&n.low!=null&&e.jsxs("div",{className:"flex items-center gap-2 text-[11px] mb-2",children:[e.jsxs("span",{className:"text-fg-muted tabular-nums",children:["L ",n.low,"°"]}),e.jsx("div",{className:"flex-1 h-1 rounded-full bg-fg-primary/15 relative",children:e.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full bg-fg-primary/35",style:{width:n.high!==n.low?`${Math.max(0,Math.min(100,(n.temp-n.low)/(n.high-n.low)*100))}%`:"50%"}})}),e.jsxs("span",{className:"text-fg-primary/70 tabular-nums font-medium",children:["H ",n.high,"°"]})]}),a.length>0&&e.jsx("div",{className:"border-t border-edge-subtle pt-1.5 mt-1 space-y-0.5",children:a.map((i,o)=>e.jsx(So,{period:i},o))})]})}),Io=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-1 flex-shrink-0 min-w-[52px]",children:[e.jsx("span",{className:"text-[11px] text-fg-muted font-medium",children:n.dayAbbrev}),e.jsx("span",{className:"text-lg leading-none",children:n.conditionEmoji}),e.jsx("span",{className:"text-[10px] text-fg-primary/70 text-center leading-tight",children:n.condition}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] tabular-nums",children:[n.high!=null&&e.jsxs("span",{className:"text-fg-primary font-medium",children:[n.high,"°"]}),n.low!=null&&e.jsxs("span",{className:"text-fg-muted",children:[n.low,"°"]})]})]},a))})})}),Mo=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-0.5 -mx-1 px-1 scrollbar-none",children:t.map((n,a)=>e.jsxs("div",{className:"flex flex-col items-center gap-0.5 flex-shrink-0 min-w-[44px]",children:[e.jsx("span",{className:"text-[10px] text-fg-muted font-medium tabular-nums",children:n.hour}),e.jsx("span",{className:"text-base leading-none",children:n.conditionEmoji}),e.jsxs("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:[n.temp,"°"]}),n.precipChance!=null&&n.precipChance>0&&e.jsxs("span",{className:A("text-[9px] tabular-nums font-medium",n.precipChance>=50?"text-sys-blue":"text-sys-blue/60"),children:[n.precipChance,"%"]})]},a))})})});function Ro(s){if(!s)return"amber";const t=s.toUpperCase();return t.includes("EXTREME")||t.includes("TORNADO")||t.includes("HURRICANE")||t.includes("SEVERE")||t.includes("WARNING")?"red":"amber"}const Eo={red:"border-l-sys-red",amber:"border-l-sys-amber"},Po={red:"text-sys-red",amber:"text-sys-amber"},To=l.memo(function({data:t}){const n=Ro(t.severity);return e.jsx(Q,{compact:!0,hideBadge:!0,children:e.jsxs("div",{className:A("border-l-[3px] pl-2.5 -ml-0.5",Eo[n]),children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"text-sm leading-none",children:"⚠️"}),t.severity&&e.jsx("span",{className:A("text-[10px] font-bold uppercase tracking-wider",Po[n]),children:t.severity})]}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.headline}),t.body&&e.jsx("p",{className:"text-xs text-fg-muted mt-1 leading-relaxed whitespace-pre-wrap break-words",children:t.body})]})})}),Ao={high:"🎯",medium:"📍",low:"❓"};function $o({hop:s}){return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"font-mono text-[11px] text-sys-blue font-bold tabular-nums min-w-[20px]",children:s.hex}),e.jsx("span",{className:"text-fg-muted/40 text-xs",children:"→"}),s.unknown?e.jsx("span",{className:"text-xs text-fg-muted/50 italic",children:"unknown"}):s.matchCount!=null?e.jsxs("span",{className:"text-xs text-sys-amber",children:[s.matchCount," matches"]}):e.jsxs("span",{className:A("text-xs font-medium truncate max-w-[140px]",s.confidence==="low"?"text-fg-muted":"text-fg-primary"),children:[s.name,s.confidence&&e.jsx("span",{className:"ml-0.5 text-[10px]",children:Ao[s.confidence]})]})]})}const Fo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1.5 pr-6",children:[e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"🛤️ Path"}),e.jsxs("span",{className:"text-[10px] text-fg-muted/60 tabular-nums",children:[t.hops.length," hop",t.hops.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-1",children:t.hops.map((n,a)=>e.jsx($o,{hop:n},a))})]})});function Do(s){return s>=10?5:s>=6?4:s>=3?3:s>=0?2:s>=-5?1:0}function Oo(s){return s>=4?"bg-sys-green":s>=3?"bg-sys-amber":s>=2?"bg-sys-orange":"bg-sys-red"}function Lo({bars:s}){const t=Oo(s);return e.jsx("div",{className:"flex items-end gap-[2px] h-[20px]",children:[6,10,14,18,20].map((n,a)=>e.jsx("div",{className:A("w-[4px] rounded-sm transition-colors",a0?"+":"",t.snr.toFixed(1),e.jsx("span",{className:"text-[10px] text-fg-muted font-normal ml-0.5",children:"dB"})]}),t.rssi!=null&&e.jsxs("span",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.rssi," dBm"]})]})]}),(t.hops!=null||t.pathHops)&&e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-1.5",children:[t.hops!=null&&e.jsxs("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-sys-blue/10 text-[10px] text-sys-blue font-semibold tabular-nums",children:[t.hops," hop",t.hops!==1?"s":""]}),t.pathHops&&t.pathHops.length>0&&e.jsx("div",{className:"flex items-center gap-0.5 text-[10px]",children:t.pathHops.map((a,r)=>e.jsxs("span",{className:"contents",children:[r>0&&e.jsx("span",{className:"text-fg-muted/40",children:"›"}),e.jsx("span",{className:"font-mono text-fg-muted",children:a})]},r))})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-[10px] text-fg-muted",children:[t.distance&&e.jsx("span",{className:"tabular-nums",children:t.distance}),t.receivedAt&&e.jsxs("span",{className:"tabular-nums",children:["@ ",t.receivedAt]}),t.elapsed&&e.jsx("span",{className:"tabular-nums",children:t.elapsed}),t.phrase&&e.jsxs("span",{className:"text-fg-muted/60 italic truncate max-w-[120px]",children:['"',t.phrase,'"']})]})]})});function Bo(s){return s<=50?{text:"text-sys-green",bg:"bg-sys-green/10"}:s<=100?{text:"text-sys-amber",bg:"bg-sys-amber/10"}:s<=150?{text:"text-sys-orange",bg:"bg-sys-orange/10"}:s<=200?{text:"text-sys-red",bg:"bg-sys-red/10"}:s<=300?{text:"text-sys-violet",bg:"bg-sys-violet/10"}:{text:"text-sys-red",bg:"bg-sys-red/10"}}const Ho=l.memo(function({data:t}){const{text:n,bg:a}=Bo(t.aqi);return e.jsxs(Q,{compact:!0,children:[t.location&&e.jsx("div",{className:"text-[11px] text-fg-muted font-medium mb-1 pr-6",children:t.location}),e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("div",{className:A("flex items-center justify-center w-12 h-12 rounded-xl",a),children:e.jsx("span",{className:A("text-xl font-bold tabular-nums",n),children:t.aqi})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:t.colorEmoji}),e.jsx("span",{className:A("text-sm font-semibold",n),children:t.category})]}),e.jsx("span",{className:"text-[10px] text-fg-muted",children:"Air Quality Index"})]})]}),t.pollutants.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:t.pollutants.map(r=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-fg-primary/5 text-[10px] tabular-nums",children:[e.jsx("span",{className:"text-fg-muted font-medium",children:r.name}),e.jsx("span",{className:"text-fg-primary",children:r.value})]},r.name))})]})});function Wo(s){return s<=3?"text-sys-green":s<=4?"text-sys-amber":s<=6?"text-sys-orange":"text-sys-red"}function Ae({label:s,value:t,className:n}){return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:s}),e.jsx("span",{className:A("text-sm font-semibold tabular-nums text-fg-primary",n),children:t})]})}const Uo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"☀️"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Solar Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-x-4 gap-y-2",children:[t.aIndex!=null&&e.jsx(Ae,{label:"A-Index",value:t.aIndex}),t.kIndex!=null&&e.jsx(Ae,{label:"K-Index",value:t.kIndex,className:Wo(t.kIndex)}),t.sunspots!=null&&e.jsx(Ae,{label:"Sunspots",value:t.sunspots}),t.xrayFlux!=null&&e.jsx(Ae,{label:"X-Ray",value:t.xrayFlux}),t.solarFlux!=null&&e.jsx(Ae,{label:"Flux",value:t.solarFlux}),t.signalNoise!=null&&e.jsx(Ae,{label:"Noise",value:t.signalNoise})]})]})});function Ko(s){const t=s.toLowerCase();return t==="excellent"||t==="good"?"text-sys-green bg-sys-green/10":t==="fair"?"text-sys-amber bg-sys-amber/10":"text-sys-red bg-sys-red/10"}function Ts({band:s}){return e.jsxs("div",{className:"flex items-center justify-between gap-2 py-0.5",children:[e.jsx("span",{className:"text-[11px] text-fg-primary font-mono tabular-nums",children:s.name}),e.jsx("span",{className:A("text-[10px] font-semibold px-1.5 py-0.5 rounded",Ko(s.condition)),children:s.condition})]})}const qo=l.memo(function({data:t}){const n=t.bands.filter(r=>r.time==="day"),a=t.bands.filter(r=>r.time==="night");return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1 mb-2 pr-6",children:[e.jsx("span",{className:"text-sm leading-none",children:"📻"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"HF Band Conditions"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Day"}),n.map((r,i)=>e.jsx(Ts,{band:r},i))]}),a.length>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase tracking-wider",children:"Night"}),a.map((r,i)=>e.jsx(Ts,{band:r},i))]})]})]})});function Go({progress:s}){if(s==null)return null;const t=Math.max(0,Math.min(1,s)),n=Math.PI*(1-t),a=50-40*Math.cos(n),r=45-40*Math.sin(n);return e.jsxs("svg",{viewBox:"0 0 100 50",className:"w-full h-8 mb-1","aria-hidden":"true",children:[e.jsx("line",{x1:"8",y1:"45",x2:"92",y2:"45",stroke:"var(--fg-muted)",strokeWidth:"0.5",opacity:"0.3"}),e.jsx("path",{d:"M 10 45 A 40 40 0 0 1 90 45",fill:"none",stroke:"var(--sys-amber)",strokeWidth:"1",opacity:"0.3",strokeDasharray:"3 2"}),e.jsx("circle",{cx:a,cy:r,r:"3.5",fill:"var(--sys-amber)"}),e.jsx("text",{x:"10",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↑"}),e.jsx("text",{x:"90",y:"49",fontSize:"4.5",fill:"var(--fg-muted)",textAnchor:"middle",children:"↓"})]})}const Vo=l.memo(function({data:t}){let n=null;if(t.daylightHours!=null&&t.daylightMinutes!=null&&t.remainingHours!=null&&t.remainingMinutes!=null){const m=t.daylightHours*60+t.daylightMinutes,c=t.remainingHours*60+t.remainingMinutes;m>0&&(n=1-c/m)}const a=t.isEvening?t.setTime:t.riseTime,r=t.isEvening?t.riseTime:t.setTime,i=t.isEvening?"Sunset":"Sunrise",o=t.isEvening?"Sunrise":"Sunset";return e.jsxs(Q,{compact:!0,children:[e.jsx(Go,{progress:n}),e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:i}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:a??"—"})]}),e.jsxs("div",{className:"flex flex-col items-end",children:[e.jsx("span",{className:"text-[9px] text-fg-muted uppercase",children:o}),e.jsx("span",{className:"text-xs text-fg-primary font-medium tabular-nums",children:r??"—"})]})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px]",children:[t.daylightHours!=null&&e.jsxs("span",{className:"text-fg-muted",children:["Daylight: ",e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.daylightHours,"h ",t.daylightMinutes,"m"]})]}),t.remainingHours!=null&&e.jsxs("span",{className:"text-sys-amber",children:["Remaining: ",e.jsxs("span",{className:"font-medium tabular-nums",children:[t.remainingHours,"h ",t.remainingMinutes,"m"]})]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),Jo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-2",children:[e.jsx("span",{className:"text-3xl leading-none",children:t.phaseEmoji}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-fg-primary font-medium",children:t.phaseName}),t.illumination!=null&&e.jsxs("div",{className:"text-[11px] text-fg-muted tabular-nums",children:[t.illumination.toFixed(1),"% illuminated"]})]})]}),e.jsxs("div",{className:"flex gap-4 mb-1.5 text-[10px]",children:[t.riseTime&&e.jsxs("span",{className:"text-fg-muted",children:["Rise: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime})]}),t.setTime&&e.jsxs("span",{className:"text-fg-muted",children:["Set: ",e.jsx("span",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime})]})]}),(t.nextFullMoon||t.nextNewMoon)&&e.jsxs("div",{className:"flex gap-3 text-[10px] text-fg-muted",children:[t.nextFullMoon&&e.jsxs("span",{children:["🌕 ",t.nextFullMoon]}),t.nextNewMoon&&e.jsxs("span",{children:["🌑 ",t.nextNewMoon]})]}),(t.azimuth!=null||t.altitude!=null)&&e.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-fg-muted tabular-nums",children:[t.azimuth!=null&&e.jsxs("span",{children:["Az: ",t.azimuth.toFixed(1),"°"]}),t.altitude!=null&&e.jsxs("span",{children:["Alt: ",t.altitude.toFixed(1),"°"]})]})]})}),Qo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"text-sm font-semibold text-fg-primary mb-2 flex items-center gap-1.5",children:[e.jsx("span",{className:"text-base leading-none",children:"🛰"}),t.satName]}),e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 text-[11px]",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Rise"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.riseTime}),e.jsx("div",{className:"text-fg-muted",children:t.startAz})]}),e.jsxs("div",{className:"flex flex-col items-center flex-1",children:[e.jsxs("div",{className:"text-[10px] font-semibold tabular-nums",style:{color:t.maxEl>=60?"var(--sys-green)":t.maxEl>=30?"var(--sys-amber)":"var(--sys-red)"},children:[t.maxEl,"° max"]}),e.jsx("div",{className:"w-full h-px my-0.5",style:{background:"var(--edge-subtle)"}})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-fg-muted",children:"Set"}),e.jsx("div",{className:"text-fg-primary font-medium tabular-nums",children:t.setTime}),e.jsx("div",{className:"text-fg-muted",children:t.endAz})]})]}),e.jsxs("div",{className:"text-[10px] text-fg-muted tabular-nums",children:["Duration: ",e.jsx("span",{className:"text-fg-primary font-medium",children:t.duration})]})]})});function Xo(s){return s<=1?"var(--sys-green)":s<=3?"var(--sys-lime)":s<=4?"var(--sys-amber)":s<=6?"var(--sys-orange)":"var(--sys-red)"}const Yo=l.memo(function({data:t}){const n=Xo(t.kpIndex);return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center text-lg font-bold",style:{background:n,color:"var(--zinc-950)"},children:t.kpIndex}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-fg-primary",children:t.status}),e.jsx("div",{className:"text-[10px] text-fg-muted",children:"Kp Index"})]})]}),t.probability!=null&&e.jsxs("div",{className:"mb-1.5",children:[e.jsxs("div",{className:"flex justify-between text-[10px] mb-0.5",children:[e.jsx("span",{className:"text-fg-muted",children:"Probability"}),e.jsxs("span",{className:"text-fg-primary font-medium tabular-nums",children:[t.probability,"%"]})]}),e.jsx("div",{className:"w-full h-1.5 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${Math.min(t.probability,100)}%`,background:n}})})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-fg-muted",children:[t.location&&e.jsx("span",{children:t.location}),t.timestamp&&e.jsx("span",{className:"tabular-nums",children:t.timestamp})]})]})}),Zo=l.memo(function({data:t}){return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-base leading-none",children:"🎲"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:"Dice Roll"})]}),e.jsx("div",{className:"space-y-1.5",children:t.rolls.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsx("span",{className:"text-fg-muted font-mono w-8 shrink-0",children:n.count>1?`${n.count}${n.dieType}`:n.dieType}),n.results.length>1?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-fg-primary tabular-nums",children:["[",n.results.join(", "),"]"]}),e.jsx("span",{className:"text-fg-muted",children:"="}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]}):e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:n.total})]},a))}),t.grandTotal!=null&&t.rolls.length>1&&e.jsxs("div",{className:"mt-2 pt-1.5 flex items-center justify-between text-xs",style:{borderTop:"1px solid var(--edge-subtle)"},children:[e.jsx("span",{className:"text-fg-muted",children:"Total"}),e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:t.grandTotal})]})]})}),As=l.memo(function({data:t,isDadJoke:n}){const a=n?"🥸":"🎭";return e.jsx(Q,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:a}),e.jsx("div",{className:"min-w-0",children:t.isTwoPart?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.setup}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words mt-2 pt-2 italic",style:{borderTop:"1px solid var(--edge-subtle)"},children:t.delivery})]}):e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t.text})})]})})}),ec=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsx("div",{className:"space-y-1.5",children:t.games.map((n,a)=>e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",style:a>0?{borderTop:"1px solid var(--edge-subtle)",paddingTop:"6px"}:void 0,children:[e.jsx("span",{className:"text-sm leading-none shrink-0",children:n.sportEmoji}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.away}),n.awayScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.awayScore})]}),e.jsxs("div",{className:"flex items-baseline justify-between gap-1",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:n.home}),n.homeScore!=null&&e.jsx("span",{className:"text-fg-primary font-bold tabular-nums",children:n.homeScore})]})]}),e.jsxs("span",{className:"text-[9px] font-semibold px-1.5 py-0.5 rounded shrink-0 tabular-nums",style:{color:n.isLive?"var(--sys-green)":n.isFinal?"var(--fg-muted)":"var(--sys-blue)",background:n.isLive?"color-mix(in srgb, var(--sys-green) 12%, transparent)":n.isFinal?"color-mix(in srgb, var(--fg-muted) 10%, transparent)":"color-mix(in srgb, var(--sys-blue) 12%, transparent)"},children:[n.isLive&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full mr-1 align-middle",style:{background:"var(--sys-green)",animation:"pulse 2s ease-in-out infinite"}}),n.status]})]},a))})})}),tc=l.memo(function({data:t}){var n;return e.jsxs(Q,{compact:!0,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-sm leading-none",children:"📊"}),e.jsx("span",{className:"text-[11px] font-medium text-fg-muted",children:t.title??"Bot Stats"})]}),t.type==="basic"?e.jsxs("div",{className:"space-y-1 text-[11px]",children:[t.commands!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Commands"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.commands})]}),t.replies!=null&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Replies"}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums",children:t.replies})]}),t.topCommand&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top Cmd"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topCommand})]}),t.topUser&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-fg-muted",children:"Top User"}),e.jsx("span",{className:"text-fg-primary font-medium",children:t.topUser})]})]}):e.jsx("div",{className:"space-y-1",children:(n=t.entries)==null?void 0:n.map(a=>{const r=t.entries[0].value,i=r>0?a.value/r*100:0;return e.jsxs("div",{className:"flex items-center gap-2 text-[11px]",children:[e.jsxs("span",{className:"text-fg-muted w-4 text-right tabular-nums shrink-0",children:[a.rank,"."]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex justify-between mb-0.5",children:[e.jsx("span",{className:"text-fg-primary font-medium truncate",children:a.name}),e.jsx("span",{className:"text-fg-primary font-semibold tabular-nums shrink-0 ml-2",children:a.value})]}),e.jsx("div",{className:"w-full h-1 rounded-full",style:{background:"var(--edge-subtle)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${i}%`,background:"var(--sys-blue)"}})})]})]},a.rank)})})]})}),sc=l.memo(function({data:t}){return e.jsx(Q,{compact:!0,children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"text-lg leading-none shrink-0 mt-0.5",children:"🐱"}),e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed whitespace-pre-wrap break-words",children:t})]})})});function nc({text:s}){return e.jsx(Q,{compact:!0,children:e.jsx("p",{className:"text-sm text-fg-primary leading-relaxed tracking-wide whitespace-pre-wrap break-words",children:nl(s)})})}const ac=l.memo(function({text:t,messageType:n}){const a=l.useMemo(()=>n?Xi(t,n):null,[t,n]);if(a)switch(n){case"weather":return e.jsx(_o,{data:a});case"weather-multiday":return e.jsx(Io,{data:a});case"weather-hourly":return e.jsx(Mo,{data:a});case"weather-alert":return e.jsx(To,{data:a});case"path":return e.jsx(Fo,{data:a});case"test":return e.jsx(zo,{data:a});case"aqi":return e.jsx(Ho,{data:a});case"solar":return e.jsx(Uo,{data:a});case"hfcond":return e.jsx(qo,{data:a});case"sun":return e.jsx(Vo,{data:a});case"moon":return e.jsx(Jo,{data:a});case"satpass":return e.jsx(Qo,{data:a});case"aurora":return e.jsx(Yo,{data:a});case"dice":return e.jsx(Zo,{data:a});case"joke":return e.jsx(As,{data:a});case"dadjoke":return e.jsx(As,{data:a,isDadJoke:!0});case"sports":return e.jsx(ec,{data:a});case"stats":return e.jsx(tc,{data:a});case"catfact":return e.jsx(sc,{data:a})}return e.jsx(nc,{text:t})}),rc=l.lazy(()=>nn(()=>import("./CompanionPathMap-Cld9nrKm.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])).then(s=>({default:s.CompanionPathMap}))),lc=l.lazy(()=>nn(()=>import("./CompanionEchoMap-Dx-5FVVv.js"),__vite__mapDeps([13,1,2,3,4,5,9,10,11,12])).then(s=>({default:s.CompanionEchoMap}))),$s=e.jsx("div",{className:"rounded-lg bg-elevated flex items-center justify-center",style:{aspectRatio:"16 / 10"},children:e.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})});function ic(s,t,n){return dr(new Date(s*1e3),t,n)}function oc(s,t){return cr(new Date(s*1e3),t)}function cc(s){const t=new Map;for(const n of s)n.name&&t.set(n.public_key,n.name);return t}function dc(s){const t=new Map;for(const n of s)t.set(n.public_key,n);return t}function uc(s){if(!s)return[];const t=[];for(let n=0;n64?t&63:t}function pc(s,t){const n=t.find(a=>a.public_key.startsWith(s));return(n==null?void 0:n.name)||null}function Fs(s,t){return s.is_outgoing?"You":s.sender_name?s.sender_name:s.author_prefix?s.author_prefix.slice(0,8):t.get(s.sender_key)??s.sender_key.slice(0,8)}const xc=new Set(["🎭","🥸"]);function hc({senderName:s,timestamp:t,signed:n,preferences:a,children:r}){const{emoji:i,cleanName:o}=dt(s),m=ut(o),c=mt(s);return e.jsxs("div",{className:"group flex items-start gap-4 w-full p-2",children:[e.jsxs("div",{className:"flex-shrink-0 w-9 flex flex-col items-center gap-1",children:[e.jsx("div",{className:A("clay-avatar w-9 h-9",i?"text-lg":"text-white text-[13px] font-bold tracking-tight"),style:{"--avatar-color":m},children:i||c}),e.jsx("span",{className:"text-xs text-chat-timestamp tabular-nums h-4 leading-4",children:al(t,a)})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 -mt-[3px] mb-1",children:[e.jsx("span",{className:"text-[13px] font-normal text-chat-incoming-name truncate leading-tight tabular-nums",children:o}),n&&e.jsxs("svg",{className:"w-3.5 h-3.5 text-sys-green flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("title",{children:"Ed25519 signed message"}),e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"}),e.jsx("polyline",{points:"9 12 11 14 15 10"})]})]}),e.jsx("div",{className:"flex items-end gap-1.5 min-w-0",children:r})]})]})}const fc=l.memo(function({msg:t,contact:n,contacts:a,selfInfo:r,echoCount:i,channelName:o,allMessages:m,children:c}){const[f,d]=l.useState(!1),[x,g]=l.useState(!1),[h,u]=l.useState(0),v=l.useRef(null),S=mc(t.path_len),b=!t.is_outgoing,E=b&&S!=null,I=t.is_outgoing&&t.is_channel&&(i??0)>0,_=(o==null?void 0:o.toLowerCase().includes("wardrive"))??!1,y=l.useMemo(()=>_&&b?Sl(t.text):null,[_,b,t.text]),M=E||I,$=l.useMemo(()=>{const N=[];if(t.path_hops&&t.path_hops.length>0)N.push({hops:t.path_hops.slice(0,64),snr:t.path_snr,rssi:t.path_rssi});else if(b&&(n!=null&&n.out_path)){const D=uc(n.out_path);D.length>0&&N.push({hops:D})}if(t.alternate_paths)for(const D of t.alternate_paths)N.push(D);return N},[t.path_hops,t.path_snr,t.path_rssi,t.alternate_paths,b,n]),R=h<$.length?h:0,p=$[R]??$[0],j=$.length>1,C=(p==null?void 0:p.snr)??t.msg_snr,k=()=>{g(!0),d(N=>!N)},F=l.useCallback(N=>{var D;N.propertyName==="grid-template-rows"&&(f?(D=v.current)==null||D.scrollIntoView({block:"nearest",behavior:"smooth"}):g(!1))},[f]);return e.jsxs("div",{ref:v,className:A("rounded-xl px-2 py-1 -mx-2 transition-colors duration-150",M&&"hover:bg-subtle-fill cursor-pointer"),onClick:()=>M&&k(),children:[c,M&&e.jsx("div",{className:"grid transition-[grid-template-rows] duration-300 ease-[cubic-bezier(0.83,0,0.17,1)]",style:{gridTemplateRows:f?"1fr":"0fr"},onTransitionEnd:F,children:e.jsxs("div",{className:"overflow-hidden",children:[x&&E&&e.jsxs("div",{className:"mt-1.5 ml-13 space-y-1",children:[j&&e.jsx("div",{className:"flex items-center gap-1 flex-wrap",onClick:N=>N.stopPropagation(),children:$.map((N,D)=>e.jsxs("button",{onClick:()=>u(D),className:A("flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] transition-colors",D===R?"bg-sys-blue/15 text-sys-blue font-semibold":"bg-subtle-fill text-fg-muted hover:text-fg-secondary"),children:[e.jsx(Ke,{className:"w-2.5 h-2.5"}),N.hops.length||S,N.snr!=null&&e.jsxs("span",{className:"ml-0.5 opacity-70",children:[N.snr>0?"+":"",N.snr.toFixed(1)]})]},D))}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(Ke,{className:"w-3 h-3 text-fg-muted flex-shrink-0"}),S===0&&!p?e.jsx("span",{className:"text-[10px] text-fg-muted font-medium",children:"Direct"}):p&&p.hops.length>0?p.hops.map((N,D)=>{const q=pc(N,a);return e.jsxs("span",{className:"contents",children:[D>0&&e.jsx(Il,{className:"w-2.5 h-2.5 text-fg-muted/50 flex-shrink-0"}),e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded bg-subtle-fill text-[10px]",children:[e.jsx("span",{className:"font-mono text-fg-primary",children:N}),q&&e.jsxs("span",{className:"text-fg-muted",children:["(",q,")"]})]})]},D)}):e.jsxs("span",{className:"text-[10px] text-fg-muted font-medium",children:[S," hop",S>1?"s":""]}),C!=null&&e.jsxs("span",{className:"inline-flex items-center gap-0.5 text-[10px] text-fg-muted ml-0.5",children:[e.jsx(ll,{className:"w-2.5 h-2.5"}),C>0?"+":"",C.toFixed(1),"dB"]}),(p==null?void 0:p.rssi)!=null&&e.jsxs("span",{className:"text-[10px] text-fg-muted",children:[p.rssi,"dBm"]})]}),p&&p.hops.length>=1&&e.jsx(l.Suspense,{fallback:$s,children:e.jsx(rc,{hops:p.hops,contacts:a,selfInfo:r,snr:C,wardriveCoords:y??void 0,wardriveSenderName:t.sender_name,channelMessages:_?m:void 0,messageTimestamp:t.timestamp})})]}),x&&I&&e.jsx("div",{className:"mt-1.5",children:e.jsx(l.Suspense,{fallback:$s,children:e.jsx(lc,{text:t.text,timestamp:t.timestamp,contacts:a})})})]})})]})}),gc=l.memo(function({messages:t,contacts:n,className:a,conversationKey:r,onRetry:i,onRetryAsFlood:o,onMentionClick:m,isLoading:c,historyLoading:f,historyExhausted:d,onLoadOlder:x,channelName:g,contactPubKey:h}){const u=Ct(),v=l.useRef(null),S=l.useRef(null),[b,E]=l.useState(!1),[I,_]=l.useState(()=>new Date),y=l.useRef(t.length),M=l.useRef(0);l.useEffect(()=>{const w=window.setInterval(()=>_(new Date),6e4);return()=>window.clearInterval(w)},[]);const $=l.useRef(r);l.useEffect(()=>{if(r!==$.current){$.current=r,y.current=t.length,M.current=0;const w=requestAnimationFrame(()=>{E(!1);const T=v.current;T&&(T.scrollTop=T.scrollHeight)});return()=>cancelAnimationFrame(w)}},[r,t.length]);const R=l.useMemo(()=>cc(n),[n]),p=l.useMemo(()=>dc(n),[n]),j=ct(),C=bo(t),k=Vn(h??""),F=h?p.get(h):void 0,N=l.useMemo(()=>{if(!F)return!1;const w=t.filter(T=>!T.is_outgoing).slice(-5).map(T=>T.text);return Yi(F.name,k,w)},[F,k,t]),{combinedTexts:D,skipIds:q}=l.useMemo(()=>{const w=new Map,T=new Set;for(let z=0;z3)continue;const V=[...O.text][0];if(!V||!xc.has(V)||[...W.text][0]!==V)continue;const de=W.text.slice(V.length).trimStart();w.set(O.id,O.text+` `+de),T.add(W.id),z++}return{combinedTexts:w,skipIds:T}},[t]);l.useEffect(()=>{var T;const w=v.current;if(w){if(t.length>y.current&&M.current>0){const z=w.scrollHeight-M.current;if(z>0&&w.scrollTop<200){w.scrollTop+=z,y.current=t.length,M.current=0;return}}y.current=t.length,b||(T=S.current)==null||T.scrollIntoView({behavior:"smooth"})}},[t.length,b]);const X=l.useCallback(()=>{const w=v.current;if(!w)return;const T=w.scrollHeight-w.scrollTop-w.clientHeight;E(T>100),w.scrollTop<80&&x&&!f&&!d&&(M.current=w.scrollHeight,x())},[x,f,d]),L=l.useCallback(()=>{var w;(w=S.current)==null||w.scrollIntoView({behavior:"smooth"}),E(!1)},[]);let G="";return e.jsxs("div",{className:A("relative flex flex-col",a),children:[e.jsxs("div",{ref:v,onScroll:X,className:"flex-1 overflow-y-auto min-h-0 px-4 py-3",style:{contain:"layout style paint"},children:[f&&e.jsx("div",{className:"flex items-center justify-center py-3",children:e.jsx(oe,{className:"w-4 h-4 text-fg-muted animate-spin"})}),t.length===0?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("p",{className:"text-sm text-fg-muted",children:c?"Loading messages…":"No messages yet"})}):t.map(w=>{if(q.has(w.id))return null;const T=oc(w.timestamp,u),z=T!==G;G=T;const O=w.unconfirmed&&w.is_channel&&(C.get(w.id)??0)>0,W=w.is_outgoing?w.failed?"failed":w.confirmed||O?"confirmed":w.unconfirmed?"unconfirmed":(w.retryAttempt??0)>0?"retrying":w.sent?"sent":"pending":void 0,V=w.is_channel&&w.channel_idx!=null?`ch:${w.channel_idx}`:w.sender_key;return e.jsxs("div",{children:[z&&e.jsx(kl,{text:ic(w.timestamp,u,I)}),e.jsx(fc,{msg:w,contact:p.get(w.sender_key),contacts:n,selfInfo:j,echoCount:C.get(w.id),channelName:g,allMessages:g!=null&&g.toLowerCase().includes("wardrive")?t:void 0,children:(()=>{if(!w.is_outgoing){const de=Fs(w,R);if(w.is_channel?Kn(de):N){const ye=D.get(w.id)??w.text,xt=Wn(ye);return e.jsx(hc,{senderName:de,timestamp:w.timestamp,signed:w.txt_type===ps.SignedPlain,preferences:u,children:e.jsx(ac,{text:ye,messageType:xt})})}}return e.jsx(Cl,{senderName:Fs(w,R),text:w.text,timestamp:w.timestamp,isOutgoing:w.is_outgoing,status:W,onRetry:i&&w.failed?()=>i(V,w.id):void 0,onRetryAsFlood:o&&w.failed&&!w.is_channel?()=>o(V,w.id):void 0,retryAttempt:w.retryAttempt,maxRetries:w.maxRetries,echoCount:C.get(w.id),signed:!w.is_outgoing&&w.txt_type===ps.SignedPlain,bubbleVariant:"subtle",onMentionClick:m},`${w.id}-${u.timeFormat}-${u.timeZone}`)})()})]},w.id)}),e.jsx("div",{ref:S})]}),e.jsx("button",{onClick:L,className:A("absolute bottom-4 right-4 w-8 h-8 rounded-full bg-sys-blue flex items-center justify-center shadow-lg","hover:bg-sys-blue/90 transition-all duration-200",b?"opacity-100 translate-y-0":"opacity-0 translate-y-2 pointer-events-none"),children:e.jsx(_l,{className:"w-4 h-4 text-white"})})]})}),yc=6,bc=l.memo(function({onSend:t,disabled:n,placeholder:a="Type a message…",className:r,mentionNames:i=[]}){const[o,m]=l.useState(""),[c,f]=l.useState(!1),d=l.useRef(null),[x,g]=l.useState(null),[h,u]=l.useState(-1),[v,S]=l.useState(0),b=l.useMemo(()=>{if(x==null)return[];const R=x.toLowerCase();return i.filter(p=>p.toLowerCase().includes(R)).slice(0,yc)},[x,i]),E=b.length>0;l.useEffect(()=>{S(0)},[b]);const I=l.useCallback(()=>{g(null),u(-1),S(0)},[]),_=l.useCallback(R=>{var N;if(h<0)return;const p=o.slice(0,h),j=((N=d.current)==null?void 0:N.selectionStart)??o.length,C=o.slice(j),k=`@[${R}] `,F=p+k+C;m(F),I(),requestAnimationFrame(()=>{var q,X;const D=p.length+k.length;(q=d.current)==null||q.setSelectionRange(D,D),(X=d.current)==null||X.focus()})},[o,h,I]),y=l.useCallback(async()=>{var p;const R=o.trim();!R||c||n||(f(!0),I(),m(""),await t(R),f(!1),(p=d.current)==null||p.focus())},[o,c,n,t,I]),M=l.useCallback(R=>{const p=R.target.value;m(p);const j=R.target.selectionStart??p.length,C=p.slice(0,j),k=C.lastIndexOf("@");if(k>=0){const F=k>0?C[k-1]:" ";if(/\s/.test(F)||k===0){const N=C.slice(k+1);if(!N.includes(" ")&&!N.includes("[")){g(N),u(k);return}}}I()},[I]),$=l.useCallback(R=>{if(E){if(R.key==="ArrowDown"){R.preventDefault(),S(p=>(p+1)%b.length);return}if(R.key==="ArrowUp"){R.preventDefault(),S(p=>(p-1+b.length)%b.length);return}if(R.key==="Enter"||R.key==="Tab"){R.preventDefault(),_(b[v]);return}if(R.key==="Escape"){R.preventDefault(),I();return}}R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),y())},[y,E,b,v,_,I]);return e.jsxs("div",{className:A("relative flex items-center gap-2 p-3 border-t border-edge-subtle",r),children:[E&&e.jsx("div",{className:"absolute bottom-full left-3 right-3 mb-1 radius-inset surface-elevated depth-raised overflow-hidden z-50",children:b.map((R,p)=>{const j=ut(R),{emoji:C,cleanName:k}=dt(R),F=mt(R);return e.jsxs("button",{onMouseDown:N=>{N.preventDefault(),_(R)},className:A("w-full flex items-center gap-2.5 px-3 py-1.5 text-left transition-colors",p===v?"bg-sys-blue/10":"hover:bg-subtle-fill"),children:[e.jsx("div",{className:A("clay-avatar w-5 h-5",C?"text-xs":"text-white text-[9px] font-bold"),style:{"--avatar-color":j},children:C||F}),e.jsx("span",{className:"text-sm text-fg-primary truncate",children:k})]},R)})}),e.jsx("input",{ref:d,type:"text",value:o,onChange:M,onKeyDown:$,onBlur:()=>{setTimeout(I,150)},placeholder:a,disabled:n,className:"flex-1 min-w-0 w-full px-4 py-3 text-sm radius-inner bg-input-bg border border-input-border text-fg-primary placeholder:text-fg-muted/50 ring-focus-inset hover:border-edge-strong transition-colors"}),e.jsx("button",{onClick:y,disabled:!o.trim()||c||n,className:A("flex-shrink-0 w-10 h-10 rounded-full flex items-center justify-center transition-colors",o.trim()&&!n?"clay-send text-white":"bg-subtle-fill text-fg-muted cursor-not-allowed"),children:e.jsx(ur,{className:"w-4.5 h-4.5 -translate-x-[0.5px] translate-y-[0.5px]",strokeWidth:2.5})})]})}),Pt="pymc_companion_room_pwd_";function jc(s){try{return localStorage.getItem(`${Pt}${s}`)}catch{return null}}function vc(s,t){try{localStorage.setItem(`${Pt}${s}`,t)}catch{}}function Ds(s){try{localStorage.removeItem(`${Pt}${s}`)}catch{}}const Nc=l.memo(function({contact:t,loginStatus:n,onLogin:a,className:r}){const[i,o]=l.useState(""),[m,c]=l.useState(!0),[f,d]=l.useState(null),[x,g]=l.useState(!1),h=l.useRef(null),u=l.useRef(!0),v=t.public_key,S=l.useRef(v);S.current!==v&&(S.current=v,g(!1),d(null),o("")),l.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]),l.useEffect(()=>{if(x||n==="success")return;const _=jc(v);if(!_){g(!0);return}g(!0),(async()=>{const y=await a(v,_);u.current&&(y||(Ds(v),d("Saved password rejected — please re-enter.")))})()},[v,x,n,a]);const b=l.useCallback(async()=>{d(null);const _=await a(v,i);u.current&&(_?m&&i?vc(v,i):Ds(v):d("Login failed — check your password and try again."))},[v,i,m,a]),E=l.useCallback(_=>{_.key==="Enter"&&(_.preventDefault(),b())},[b]),I=n==="pending";return I&&!i?e.jsxs("div",{className:A("flex-1 flex flex-col items-center justify-center gap-3",r),children:[e.jsx(oe,{className:"w-6 h-6 text-sys-pink animate-spin"}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Connecting to ",t.name||"room server","…"]})]}):e.jsx(ae.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.2},className:A("flex-1 flex flex-col items-center justify-center px-6",r),children:e.jsxs("div",{className:"w-full max-w-xs space-y-5",children:[e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center ring-[1.5px] ring-sys-pink bg-sys-pink/8",children:e.jsx(it,{className:"size-7 text-sys-pink"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"type-body font-medium text-fg-primary",children:t.name||"Room Server"}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Enter the room password to join, or try logging in without one — some servers allow open access."})]})]}),(f||n==="failed")&&e.jsxs("div",{className:"flex items-start gap-2 p-2.5 rounded-lg bg-sys-red/8 border border-sys-red/15",children:[e.jsx(cn,{className:"w-3.5 h-3.5 text-sys-red flex-shrink-0 mt-0.5"}),e.jsx("p",{className:"text-[11px] text-sys-red leading-relaxed",children:f||"Login failed — check your password and try again."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("input",{ref:h,type:"password",value:i,onChange:_=>o(_.target.value),onKeyDown:E,placeholder:"Room password",disabled:I,autoFocus:!0,className:"w-full surface-input rounded-lg px-3 py-2.5 text-sm text-fg-primary placeholder:text-fg-muted/50 focus:outline-none focus:ring-1 focus:ring-sys-pink/40"}),e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[e.jsx("input",{type:"checkbox",checked:m,onChange:_=>c(_.target.checked),disabled:I,className:"surface-checkbox w-3.5 h-3.5 rounded accent-sys-pink"}),e.jsx("span",{className:"text-xs text-fg-muted",children:"Remember password"})]}),e.jsxs(H,{color:"pink",className:"w-full justify-center",disabled:I,onClick:b,children:[I?e.jsx(oe,{"data-slot":"icon",className:"animate-spin"}):e.jsx(kt,{"data-slot":"icon"}),I?"Connecting…":"Login"]})]}),e.jsx("p",{className:"text-[10px] text-fg-muted/60 text-center leading-relaxed",children:"The server determines your permissions based on the password. Admin and guest passwords grant different access levels."})]})})});function Os(s,t){return[s,t].sort().join("-")}function tt(s){return s.substring(0,2)}function wc(s){var n,a;const t=(a=(n=s.traceQuality)==null?void 0:n.composite)==null?void 0:a.mean;return t!=null&&t!==0?Math.max(.1,t+20):Math.max(.1,s.strength*20)}function kc(s,t,n,a){const{edgeMap:r}=n;if(r.size===0)return null;const i=new Map;for(const[,y]of r){const M=y.fromHash,$=y.toHash;i.has(M)||i.set(M,[]),i.has($)||i.set($,[]),i.get(M).push({neighbor:$,edge:y}),i.get($).push({neighbor:M,edge:y})}const o=new Set(i.keys()),m=Ls(s,o),c=Ls(t,o);if(!m||!c||m===c)return null;const f=new Map,d=new Map,x=new Set,g=[];for(f.set(m,0),d.set(m,null),g.push({node:m,cost:0});g.length>0;){g.sort(($,R)=>$.cost-R.cost);const y=g.shift();if(x.has(y.node))continue;if(x.add(y.node),y.node===c)break;const M=i.get(y.node)??[];for(const{neighbor:$,edge:R}of M){if(x.has($))continue;const p=wc(R),j=y.cost+1/p,C=f.get($)??1/0;j{var F,N;const $=tt(y),R=v.get($);let p=0;const j=h[M],C=Os(j,y),k=r.get(C);return(N=(F=k==null?void 0:k.traceQuality)==null?void 0:F.composite)!=null&&N.mean?p=k.traceQuality.composite.mean:(k==null?void 0:k.avgSnr)!=null&&(p=k.avgSnr),{hash:y,prefix:$,name:(R==null?void 0:R.name)||null,snr:p}});let E=0,I=0;for(let y=0;y0?E/I:0;return{hops:S.map(tt),confidence:_,via:b}}function Ls(s,t){if(t.has(s))return s;const n=tt(s);let a=null,r=0;for(const i of t)if(i.startsWith(n)||s.startsWith(i.substring(0,2))){let o=0;const m=Math.min(s.length,i.length);for(let c=0;cr&&(r=o,a=i)}return a}function zs(s){switch(s&15){case 1:return"Companion";case 2:return"Repeater";case 3:return"Room Server";default:return"Unknown"}}function Bs(s){switch(s&15){case 1:return"blue";case 2:return"green";case 3:return"indigo";default:return"zinc"}}function Cc(s){return(s&15)===2}const Hs=l.memo(function({contact:t,channel:n,contacts:a=[],selfPubKey:r,embedded:i=!1,onResetPath:o,onRequestStatus:m,onRequestTelemetry:c,onLoginToRepeater:f,onLogoutFromRepeater:d,onGetNeighbours:x,onTraceContactPath:g,onDiscoverPath:h,onExportContact:u,onSetContactPath:v,className:S}){const[b,E]=l.useState({}),I=Ct(),_=(t==null?void 0:t.public_key)??null,[y,M]=l.useState(_);if(_!==y&&(M(_),E({})),!t&&!n)return i?null:e.jsx("div",{className:A("flex items-center justify-center h-full",S),children:e.jsx("p",{className:"text-sm text-fg-muted",children:"Select a conversation"})});async function $(C,k){E(N=>({...N,[C]:"loading"}));const F=await k();E(N=>({...N,[C]:F?"done":"error"})),setTimeout(()=>E(N=>({...N,[C]:"idle"})),2e3)}const R=n?e.jsxs("div",{className:"space-y-4",children:[!i&&e.jsxs("div",{className:"flex flex-col items-center gap-2 pb-3 border-b border-edge-subtle",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-sys-indigo/15 flex items-center justify-center shadow-md",children:e.jsx(Fe,{className:"size-7 text-sys-indigo"})}),e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"type-body font-medium text-fg-primary",children:n.name}),e.jsxs($e,{color:"indigo",children:["Channel ",n.index]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted w-20",children:"Index"}),e.jsx("span",{className:"font-mono text-fg-primary",children:n.index})]}),e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted w-20",children:"Type"}),e.jsx("span",{className:"text-fg-primary",children:"Broadcast"})]})]}),e.jsx("div",{className:"pt-2 border-t border-edge-subtle",children:e.jsx("p",{className:"type-data-xs text-fg-muted/70",children:"Channel messages are broadcast-encrypted. Sender identity is not available due to MeshCore protocol limitations."})})]}):null,p=t?e.jsxs("div",{className:"space-y-4",children:[!i&&e.jsxs("div",{className:"flex flex-col items-center gap-2 pb-3 border-b border-edge-subtle",children:[e.jsx(Ec,{contact:t}),e.jsxs("div",{className:"text-center",children:[e.jsxs("h3",{className:"type-body font-medium text-fg-primary flex items-center justify-center gap-1",children:[t.name||"Unknown",e.jsx(Us,{pubkey:t.public_key})]}),e.jsx($e,{color:Bs(t.adv_type),children:zs(t.adv_type)})]})]}),i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{color:Bs(t.adv_type),children:zs(t.adv_type)}),e.jsx(Us,{pubkey:t.public_key})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted w-20",children:"Public Key"}),e.jsx("span",{className:"font-mono text-fg-primary break-all text-[10px]",children:t.public_key})]}),e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx(Ke,{className:"w-3.5 h-3.5 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted",children:"Path Length"}),e.jsx("span",{className:"text-fg-primary ml-auto",children:t.out_path_len>=0?(()=>{const C=St(t.out_path_len);return C.hopCount>0?`${C.hopCount} hop${C.hopCount===1?"":"s"} · ${C.hashSize}B`:"direct"})():"unknown"})]}),(t.gps_lat!==0||t.gps_lon!==0)&&e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx(dn,{className:"w-3.5 h-3.5 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted",children:"GPS"}),e.jsxs("span",{className:"text-fg-primary ml-auto font-mono text-[10px]",children:[t.gps_lat.toFixed(5),", ",t.gps_lon.toFixed(5)]})]}),(t.lastmod>0||t.last_advert_timestamp>0)&&e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx(un,{className:"w-3.5 h-3.5 text-fg-muted flex-shrink-0"}),e.jsx("span",{className:"text-fg-muted",children:"Last Heard"}),e.jsxs("span",{className:"text-fg-primary ml-auto",children:[mr(new Date((t.lastmod||t.last_advert_timestamp)*1e3),I,{month:"short",day:"numeric"})," ",xs(new Date((t.lastmod||t.last_advert_timestamp)*1e3),I)]})]}),t.last_advert_timestamp>0&&e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted",children:"Last Advert"}),e.jsx("span",{className:"text-fg-primary ml-auto",children:xs(new Date(t.last_advert_timestamp*1e3),I)})]})]}),e.jsx(Tc,{contact:t,contacts:a,selfPubKey:r,onSetContactPath:v,onDiscoverPath:h,actionState:b,setActionState:E,runAction:$}),e.jsxs("div",{className:"space-y-2 pt-2 border-t border-edge-subtle",children:[e.jsxs(H,{color:b.reset==="done"?"success":b.reset==="error"?"danger":"primary",outline:!0,className:"w-full justify-center",disabled:b.reset==="loading",onClick:()=>$("reset",()=>o(t.public_key)),children:[e.jsx(on,{"data-slot":"icon"}),b.reset==="loading"?"Resetting…":b.reset==="done"?"Reset!":"Reset Path"]}),e.jsxs(H,{color:b.status==="done"?"success":b.status==="error"?"danger":"primary",outline:!0,className:"w-full justify-center",disabled:b.status==="loading",onClick:()=>$("status",()=>m(t.public_key)),children:[e.jsx(mn,{"data-slot":"icon"}),b.status==="loading"?"Requesting…":"Request Status"]}),e.jsxs(H,{color:b.telemetry==="done"?"success":b.telemetry==="error"?"danger":"primary",outline:!0,className:"w-full justify-center",disabled:b.telemetry==="loading",onClick:()=>$("telemetry",()=>c(t.public_key)),children:[e.jsx(pn,{"data-slot":"icon"}),b.telemetry==="loading"?"Requesting…":"Request Telemetry"]})]}),u&&e.jsxs(H,{color:"primary",outline:!0,className:"w-full justify-center",onClick:()=>u(t.public_key),children:[e.jsx(Mt,{"data-slot":"icon"}),"Export Contact"]}),Cc(t.adv_type)&&e.jsxs(e.Fragment,{children:[e.jsx(Ac,{pubkey:t.public_key,onLogin:f,onLogout:d,actionState:b,runAction:$}),e.jsx($c,{pubkey:t.public_key,onGetNeighbours:x,actionState:b,runAction:$}),e.jsx(Fc,{pubkey:t.public_key,contact:t,onTrace:g,actionState:b,runAction:$})]}),e.jsx(Sc,{pubkey:t.public_key}),e.jsx(Rc,{pubkey:t.public_key})]}):null,j=R??p;return i?e.jsx("div",{className:S,children:j}):e.jsx("div",{className:A("flex flex-col h-full overflow-y-auto",S),children:e.jsx(he,{mode:"wait",children:n?e.jsx(ae.div,{variants:Ml,initial:"hidden",animate:"visible",exit:"exit",className:"p-4",children:R},`ch-${n.index}`):t?e.jsx(ae.div,{variants:Rl,initial:"hidden",animate:"visible",exit:"exit",className:"p-4",children:p},`contact-${t.public_key}`):null})})});function Ws(s){const t=Math.floor(s/86400),n=Math.floor(s%86400/3600),a=Math.floor(s%3600/60);return t>0?`${t}d ${n}h`:n>0?`${n}h ${a}m`:`${a}m`}function Sc({pubkey:s}){const t=yr(s);return t?e.jsxs(Ie,{defaultOpen:!0,className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Me,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(mn,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Status"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"space-y-1.5 py-1",children:[e.jsx(Y,{label:"Battery",value:`${(t.battMilliVolts/1e3).toFixed(2)}V`}),e.jsx(Y,{label:"Noise Floor",value:`${t.noiseFloor} dBm`}),e.jsx(Y,{label:"Last RSSI",value:`${t.lastRssi} dBm`}),e.jsx(Y,{label:"Last SNR",value:`${(t.lastSnr/4).toFixed(1)} dB`}),e.jsx(Y,{label:"Uptime",value:Ws(t.totalUpTimeSecs)}),e.jsx(Y,{label:"Air Time",value:Ws(t.totalAirTimeSecs)}),e.jsx(Y,{label:"TX Queue",value:String(t.currTxQueueLen)}),e.jsx(Y,{label:"Packets Rx",value:String(t.nPacketsRecv)}),e.jsx(Y,{label:"Packets Tx",value:String(t.nPacketsSent)}),e.jsx(Y,{label:"Flood Rx/Tx",value:`${t.nRecvFlood}/${t.nSentFlood}`}),e.jsx(Y,{label:"Direct Rx/Tx",value:`${t.nRecvDirect}/${t.nSentDirect}`}),e.jsx(Y,{label:"Dups (D/F)",value:`${t.nDirectDups}/${t.nFloodDups}`}),t.errEvents>0&&e.jsx(Y,{label:"Errors",value:String(t.errEvents)})]})})]}):null}function Y({label:s,value:t}){return e.jsxs("div",{className:"flex items-center justify-between type-data-xs",children:[e.jsx("span",{className:"text-fg-muted",children:s}),e.jsx("span",{className:"text-fg-primary font-mono text-[10px]",children:t})]})}function _c(s){switch(s){case 100:return"Generic";case 101:return"Luminosity";case 102:return"Presence";case 103:return"Temperature";case 104:return"Humidity";case 115:return"Pressure";case 116:return"Voltage";case 117:return"Current";case 120:return"Percentage";case 125:return"Concentration";case 128:return"Power";case 136:return"GPS";default:return`Type ${s}`}}function Ic(s){switch(s){case 104:return"%";case 116:return"V";case 117:return"A";case 120:return"%";case 125:return" ppm";case 128:return"W";default:return""}}function Mc(s,t,n){return s===103?vr(t,n,{minimumFractionDigits:2,maximumFractionDigits:2}):s===115?Nr(t,n):`${t.toFixed(s===116?2:0)}${Ic(s)}`}function Rc({pubkey:s}){const t=br(s),n=Ct();if(!t)return null;const a=Wi(t.lppSensorData);return a.length===0?null:e.jsxs(Ie,{defaultOpen:!0,className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Me,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(pn,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Telemetry"})]}),e.jsx(Re,{children:e.jsx("div",{className:"space-y-1.5 py-1",children:a.map((r,i)=>typeof r.value=="object"?e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Y,{label:`Ch${r.channel} GPS Lat`,value:r.value.latitude.toFixed(5)}),e.jsx(Y,{label:`Ch${r.channel} GPS Lon`,value:r.value.longitude.toFixed(5)}),e.jsx(Y,{label:`Ch${r.channel} GPS Alt`,value:jr(r.value.altitude,n)})]},i):e.jsx(Y,{label:`Ch${r.channel} ${_c(r.type)}`,value:typeof r.value=="number"?Mc(r.type,r.value,n):String(r.value)},i))})})]})}function Ec({contact:s}){const{emoji:t}=dt(s.name||""),n=ut(s.name||s.public_key),a=s.name?mt(s.name):s.public_key.slice(0,2).toUpperCase();return(s.adv_type&15)===2?e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center shadow-md ring-[1.5px] ring-sys-blue",children:e.jsx(Be,{className:"size-7 text-sys-blue"})}):(s.adv_type&15)===3?e.jsx("div",{className:"w-14 h-14 rounded-full flex items-center justify-center shadow-md ring-[1.5px] ring-sys-pink",children:e.jsx(it,{className:"size-7 text-sys-pink"})}):e.jsx("div",{className:A("w-14 h-14 clay-avatar",t?"text-2xl":"text-white text-lg font-bold"),style:{"--avatar-color":n},children:t||a})}function Us({pubkey:s}){return pr().get(s)!==!0?null:e.jsx("span",{title:"Ed25519 verified identity",children:e.jsx(Tl,{className:"w-4 h-4 text-sys-green flex-shrink-0"})})}const bt=64;function Pc(s,t=1){if(!s)return[];const n=[],a=t*2;for(let r=0;r=0?St(s.out_path_len):null,_=(I==null?void 0:I.hopCount)??0,y=_>0,M=Pc(s.out_path,I==null?void 0:I.hashSize),$=l.useCallback(async()=>{if(!a)return;const j=d.split(",").map(F=>F.trim()).filter(Boolean);if(j.length===0){h("Enter at least one hop");return}if(j.length>bt){h(`Max ${bt} hops`);return}if(!j.every(F=>/^[0-9a-fA-F]{1,2}$/.test(F))){h("Each hop must be 1-2 hex characters");return}h(null),o(F=>({...F,path:"loading"}));const k=await a(s.public_key,j);o(F=>({...F,path:k?"done":"error"})),k&&f(!1),setTimeout(()=>o(F=>({...F,path:"idle"})),2e3)},[a,d,s.public_key,o]),R=l.useCallback(()=>{if(!n){b("Self identity not available");return}const j=kc(n,s.public_key,E,t);j?(v(j),b(null)):(v(null),b("No route found in topology"))},[n,s.public_key,E,t]),p=l.useCallback(async()=>{if(!a||!u)return;o(C=>({...C,path:"loading"}));const j=await a(s.public_key,u.hops);o(C=>({...C,path:j?"done":"error"})),j&&(v(null),b(null)),setTimeout(()=>o(C=>({...C,path:"idle"})),2e3)},[a,u,s.public_key,o]);return e.jsxs(Ie,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Me,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(Ke,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Path"}),e.jsx("span",{className:"ml-auto text-[10px] text-fg-muted font-mono",children:y?`${_} hop${_>1?"s":""}`:"direct"})]}),e.jsx(Re,{children:e.jsxs("div",{className:"space-y-2 py-1",children:[M.length>0&&e.jsxs("div",{className:"flex items-center gap-1 flex-wrap",children:[e.jsx("span",{className:"text-fg-muted type-data-xs",children:"Route"}),M.map((j,C)=>e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill font-mono text-[10px] text-fg-primary",children:j},C))]}),u&&e.jsxs("div",{className:"space-y-1.5 p-2 rounded-md bg-sys-green/5 border border-sys-green/20",children:[e.jsxs("div",{className:"flex items-center gap-1 type-data-xs text-sys-green",children:[e.jsx(Ns,{className:"w-3 h-3"}),e.jsxs("span",{children:["Auto-route (",u.via.length," hop",u.via.length!==1?"s":"",", ",Math.round(u.confidence*100),"% confidence)"]})]}),e.jsx("div",{className:"flex items-center gap-1 flex-wrap",children:u.via.map((j,C)=>e.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1 py-0.5 rounded bg-subtle-fill text-[10px]",children:[e.jsx("span",{className:"font-mono text-fg-primary",children:j.prefix}),j.name&&e.jsxs("span",{className:"text-fg-muted",children:["(",j.name,")"]}),j.snr!==0&&e.jsx("span",{className:A("font-mono",at(j.snr)),children:j.snr.toFixed(1)})]},C))}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(H,{color:i.path==="done"?"success":"primary",outline:!0,className:"flex-1 justify-center text-xs",disabled:i.path==="loading",onClick:p,children:[e.jsx(ge,{"data-slot":"icon"}),i.path==="loading"?"Saving…":"Accept"]}),e.jsxs(H,{plain:!0,className:"text-xs",onClick:()=>{v(null),b(null)},children:[e.jsx(ot,{"data-slot":"icon"}),"Dismiss"]})]})]}),S&&!u&&e.jsx("p",{className:"text-[9px] text-sys-amber",children:S}),a&&!u&&e.jsx("div",{className:"flex items-center gap-2",children:c?e.jsxs("div",{className:"space-y-1.5 flex-1",children:[e.jsx("input",{type:"text",value:d,onChange:j=>{x(j.target.value),h(null)},placeholder:"e.g. a3, f7, 1b",className:"w-full surface-input rounded-md px-2 py-1 text-[10px] font-mono text-fg-primary placeholder:text-fg-muted/50"}),e.jsxs("p",{className:"text-[9px] text-fg-muted/60",children:["Comma-separated hex hop bytes (max ",bt,")"]}),g&&e.jsx("p",{className:"text-[9px] text-sys-red",children:g}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsxs(H,{color:i.path==="done"?"success":i.path==="error"?"danger":"primary",outline:!0,className:"flex-1 justify-center text-xs",disabled:i.path==="loading"||!d.trim(),onClick:$,children:[e.jsx(Al,{"data-slot":"icon"}),i.path==="loading"?"Saving…":"Save"]}),e.jsx(H,{plain:!0,className:"text-xs",onClick:()=>{f(!1),h(null)},children:"Cancel"})]})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>{f(!0),x(M.length>0?M.join(", "):""),h(null)},className:"text-[10px] text-sys-blue hover:text-sys-blue/80 transition-colors",children:"Edit path…"}),n&&E.edgeMap.size>0&&e.jsxs("button",{onClick:R,className:"inline-flex items-center gap-0.5 text-[10px] text-sys-indigo hover:text-sys-indigo/80 transition-colors",children:[e.jsx(Ns,{className:"w-3 h-3"}),"Auto-route"]}),r&&e.jsxs("button",{onClick:()=>m("discover",()=>r(s.public_key)),disabled:i.discover==="loading",className:A("inline-flex items-center gap-0.5 text-[10px] transition-colors disabled:opacity-50",i.discover==="error"?"text-sys-red":"text-sys-green hover:text-sys-green/80"),children:[e.jsx($l,{className:"w-3 h-3"}),i.discover==="loading"?"Discovering…":i.discover==="done"?"Discovered!":i.discover==="error"?"Failed":"Discover"]})]})})]})})]})}function Ac({pubkey:s,onLogin:t,onLogout:n,actionState:a,runAction:r}){const[i,o]=l.useState(""),m=_t(s);return t?e.jsxs(Ie,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Me,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(kt,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Login"}),m!=="idle"&&e.jsx($e,{color:m==="success"?"green":m==="failed"?"red":"amber",className:"ml-auto text-[9px]",children:m})]}),e.jsx(Re,{children:e.jsx("div",{className:"space-y-1.5 py-1",children:m==="success"&&n?e.jsxs(H,{color:a.logout==="done"?"success":a.logout==="error"?"danger":"primary",outline:!0,className:"w-full justify-center text-xs",disabled:a.logout==="loading",onClick:()=>r("logout",()=>n(s)),children:[e.jsx(hr,{"data-slot":"icon"}),a.logout==="loading"?"Disconnecting…":"Disconnect"]}):e.jsxs(e.Fragment,{children:[e.jsx("input",{type:"password",value:i,onChange:c=>o(c.target.value),placeholder:"Repeater password",className:"w-full surface-input rounded-md px-2 py-1 text-[10px] text-fg-primary placeholder:text-fg-muted/50"}),e.jsxs(H,{color:m==="failed"?"danger":"primary",outline:!0,className:"w-full justify-center text-xs",disabled:a.login==="loading"||!i.trim(),onClick:()=>r("login",()=>t(s,i)),children:[e.jsx(kt,{"data-slot":"icon"}),a.login==="loading"?"Logging in…":"Login"]})]})})})]}):null}function $c({pubkey:s,onGetNeighbours:t,actionState:n,runAction:a}){const r=fr(s),i=_t(s);return t?e.jsxs(Ie,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Me,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(Nt,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Neighbours"}),r&&e.jsx("span",{className:"ml-auto text-[10px] text-fg-muted",children:r.total})]}),e.jsx(Re,{children:e.jsxs("div",{className:"space-y-1.5 py-1",children:[e.jsxs(H,{color:"primary",outline:!0,className:"w-full justify-center text-xs",disabled:n.neighbours==="loading"||i!=="success",onClick:()=>a("neighbours",()=>t(s)),children:[e.jsx(Nt,{"data-slot":"icon"}),n.neighbours==="loading"?"Loading…":"Get Neighbours"]}),i!=="success"&&e.jsx("p",{className:"text-[9px] text-fg-muted/60",children:"Login required to query neighbours"}),r&&r.neighbours.length>0&&e.jsx("div",{className:"space-y-1",children:[...r.neighbours].sort((o,m)=>m.snr-o.snr).map((o,m)=>e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-primary font-mono text-[10px] w-16 truncate",children:o.name||o.prefixHex.slice(0,8)}),e.jsx("span",{className:"text-fg-muted text-[9px]",children:Oc(o.heardAgo)}),e.jsxs("div",{className:"flex-1 flex items-center gap-1 ml-auto",children:[e.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-subtle-fill overflow-hidden",children:e.jsx("div",{className:A("h-full rounded-full",Dc(o.snr)),style:{width:`${Math.min(100,Math.max(5,(o.snr+20)/35*100))}%`}})}),e.jsx("span",{className:A("font-mono text-[9px] w-8 text-right",at(o.snr)),children:o.snr.toFixed(1)})]})]},m))})]})})]}):null}function Fc({pubkey:s,contact:t,onTrace:n,actionState:a,runAction:r}){const i=gr(s);if(!n)return null;const o=t.out_path_len>=0&&St(t.out_path_len).hopCount>0;return e.jsxs(Ie,{className:"pt-2 border-t border-edge-subtle",children:[e.jsxs(Me,{className:"px-0 py-1 flex items-center gap-1.5 w-full text-left",children:[e.jsx(ws,{className:"w-3.5 h-3.5 text-sys-indigo"}),e.jsx("span",{className:"type-data-xs text-fg-muted uppercase tracking-wide",children:"Trace"}),i&&e.jsxs("span",{className:"ml-auto text-[10px] text-fg-muted",children:[i.hopCount," hops"]})]}),e.jsx(Re,{children:e.jsxs("div",{className:"space-y-1.5 py-1",children:[e.jsxs(H,{color:"primary",outline:!0,className:"w-full justify-center text-xs",disabled:a.trace==="loading"||!o,onClick:()=>r("trace",()=>n(s)),children:[e.jsx(ws,{"data-slot":"icon"}),a.trace==="loading"?"Tracing…":"Trace Path"]}),!o&&e.jsx("p",{className:"text-[9px] text-fg-muted/60",children:"Direct neighbour — no path to trace"}),i&&i.hops.length>0&&e.jsxs("div",{className:"space-y-1",children:[i.hops.map((m,c)=>e.jsxs("div",{className:"flex items-center gap-2 type-data-xs",children:[e.jsx("span",{className:"text-fg-muted text-[9px] w-3",children:c+1}),e.jsx("span",{className:"px-1 py-0.5 rounded bg-subtle-fill font-mono text-[10px] text-fg-primary",children:m.hash}),m.name&&e.jsx("span",{className:"text-fg-muted text-[10px] truncate",children:m.name}),e.jsxs("span",{className:A("font-mono text-[10px] ml-auto",at(m.snr)),children:[m.snr.toFixed(1)," dB"]})]},c)),e.jsxs("div",{className:"flex items-center justify-between type-data-xs pt-1 border-t border-edge-subtle",children:[e.jsx("span",{className:"text-fg-muted",children:"Last SNR"}),e.jsxs("span",{className:A("font-mono text-[10px]",at(i.lastSnr)),children:[i.lastSnr.toFixed(1)," dB"]})]})]})]})})]})}function at(s){return s>5?"text-sys-green":s>0?"text-sys-amber":"text-sys-red"}function Dc(s){return s>5?"bg-sys-green":s>0?"bg-sys-amber":"bg-sys-red"}function Oc(s){return s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`}const Ks=128,qs=/^[0-9a-fA-F]+$/;function Lc({open:s,onClose:t}){const n=te(N=>N.exportPrivateKey),a=te(N=>N.importPrivateKey),[r,i]=l.useState("export"),[o,m]=l.useState(null),[c,f]=l.useState(!1),[d,x]=l.useState(!1),[g,h]=l.useState(""),[u,v]=l.useState(!1),[S,b]=l.useState(!1),[E,I]=l.useState(!1),[_,y]=l.useState(!1),[M,$]=l.useState(null),[R,p]=l.useState(!1);s!==R&&(p(s),s&&(i("export"),m(null),f(!1),x(!1),h(""),v(!1),b(!1),I(!1),y(!1),$(null)));const j=l.useCallback(async()=>{f(!0),$(null),y(!1);try{const N=await n();N==="disabled"?y(!0):m(N.hex)}catch(N){$(N instanceof Error?N.message:"Export failed")}finally{f(!1)}},[n]),C=l.useCallback(async()=>{if(o)try{await navigator.clipboard.writeText(o),x(!0),setTimeout(()=>x(!1),2e3)}catch{$("Failed to copy to clipboard")}},[o]),k=g.length===Ks&&qs.test(g),F=l.useCallback(async()=>{b(!1),v(!0),$(null),y(!1);try{await a(g)==="disabled"?y(!0):I(!0)}catch(N){$(N instanceof Error?N.message:"Import failed")}finally{v(!1)}},[a,g]);return e.jsxs(e.Fragment,{children:[e.jsxs(ve,{open:s,onClose:t,size:"md",solid:!0,children:[e.jsx(Ee,{icon:e.jsx(hn,{className:"w-5 h-5"}),title:"Key Management",onClose:t}),e.jsxs(Ne,{children:[_&&e.jsxs("div",{className:"flex items-start gap-2.5 p-3 mb-4 rounded-lg bg-sys-amber/10 border border-sys-amber/20",children:[e.jsx(wr,{className:"w-4 h-4 text-sys-amber flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"type-body-sm font-medium text-sys-amber",children:"Key operations disabled"}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-0.5",children:"This device's firmware has disabled private key export/import. This is a security setting configured at build time and cannot be changed remotely."})]})]}),e.jsx("div",{className:"flex gap-1 mb-4 p-0.5 rounded-lg bg-subtle-fill",children:["export","import"].map(N=>e.jsxs("button",{onClick:()=>{i(N),$(null)},className:A("flex-1 flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-md text-sm font-medium transition-colors",r===N?"bg-surface text-fg-primary shadow-sm":"text-fg-muted hover:text-fg-secondary"),children:[N==="export"?e.jsx(We,{className:"w-3.5 h-3.5"}):e.jsx(Mt,{className:"w-3.5 h-3.5"}),N==="export"?"Export":"Import"]},N))}),r==="export"&&e.jsx("div",{className:"space-y-4",children:o?e.jsxs(re,{children:[e.jsx(le,{children:"Private Key (64 bytes)"}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"p-3 rounded-lg bg-subtle-fill border border-edge-subtle font-mono text-xs break-all select-all leading-relaxed",children:o}),e.jsx("button",{onClick:C,className:"absolute top-2 right-2 p-1.5 rounded-md hover:bg-subtle-fill-strong transition-colors",title:"Copy to clipboard",children:d?e.jsx(ge,{className:"w-3.5 h-3.5 text-sys-green"}):e.jsx(It,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),e.jsx(Ce,{children:e.jsxs("span",{className:"flex items-start gap-1.5 mt-1",children:[e.jsx(Ue,{className:"w-3 h-3 text-sys-amber flex-shrink-0 mt-0.5"}),"This key controls your mesh identity. Never share it."]})})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx("p",{className:"type-body-sm text-fg-muted mb-3",children:"Export your device's private key for backup. Keep it secret — anyone with this key can impersonate your mesh identity."}),e.jsx(H,{color:"primary",onClick:j,disabled:c||_,children:c?"Exporting…":"Export Private Key"})]})}),r==="import"&&e.jsx("div",{className:"space-y-4",children:E?e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-sys-green/10 mx-auto mb-3 flex items-center justify-center",children:e.jsx(ge,{className:"w-5 h-5 text-sys-green"})}),e.jsx("p",{className:"type-body-sm font-medium text-fg-primary",children:"Key imported successfully"}),e.jsx("p",{className:"type-data-xs text-fg-muted mt-1",children:"The device identity has been updated. You may need to reconnect."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(le,{children:"Private Key (128 hex characters)"}),e.jsx("textarea",{value:g,onChange:N=>h(N.target.value.replace(/\s/g,"")),placeholder:"Paste your 128-character hex private key here…",rows:3,className:"w-full p-3 rounded-lg bg-subtle-fill border border-edge-subtle font-mono text-xs resize-none focus:outline-none focus:ring-2 focus:ring-sys-blue/50 placeholder:text-fg-muted/40"}),e.jsxs(Ce,{children:[g.length>0&&!k&&e.jsx("span",{className:"text-sys-red",children:qs.test(g)?`${g.length}/${Ks} characters`:"Invalid characters — hex only (0-9, a-f)"}),g.length>0&&k&&e.jsx("span",{className:"text-sys-green",children:"Valid key format ✓"})]})]}),e.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-lg bg-sys-red/5 border border-sys-red/10",children:[e.jsx(Ue,{className:"w-4 h-4 text-sys-red flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"type-data-xs text-fg-muted",children:["Importing a key ",e.jsx("strong",{className:"text-fg-secondary",children:"permanently replaces"})," the device's current identity. All existing contacts will see you as a new node."]})]})]})}),M&&e.jsx("p",{className:"type-data-xs text-sys-red mt-3",children:M})]}),e.jsxs(Pe,{children:[e.jsx(H,{plain:!0,onClick:t,children:"Close"}),r==="import"&&!E&&e.jsx(H,{color:"danger",onClick:()=>b(!0),disabled:!k||u||_,children:u?"Importing…":"Import Key"})]})]}),e.jsx(xn,{isOpen:S,title:"Replace Device Identity?",message:"This will permanently replace the device's Ed25519 private key. The current identity cannot be recovered unless you have a backup. Continue?",confirmLabel:"Replace Key",cancelLabel:"Cancel",variant:"danger",onConfirm:F,onCancel:()=>b(!1)})]})}function Yn(s){return s.settings??{}}const Zn="pymc_companion_recent_regions",Tt=8;function ea(){try{const s=localStorage.getItem(Zn);return s?JSON.parse(s).slice(0,Tt):[]}catch{return[]}}function zc(s){try{localStorage.setItem(Zn,JSON.stringify(s.slice(0,Tt)))}catch{}}function Bc(s){const t=ea().filter(a=>a!==s);t.unshift(s);const n=t.slice(0,Tt);return zc(n),n}function Gs(s){return s.toLowerCase().replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function Hc({open:s,onClose:t,mode:n,identity:a,onSave:r}){const i=n==="edit"&&a,[o,m]=l.useState(""),[c,f]=l.useState(""),[d,x]=l.useState(""),[g,h]=l.useState(!1),[u,v]=l.useState(""),[S,b]=l.useState(5e3),[E,I]=l.useState("0.0.0.0"),[_,y]=l.useState(!1),[M,$]=l.useState(null),[R,p]=l.useState(""),j=`${s}-${(a==null?void 0:a.name)??""}-${n}`;if(j!==R)if(p(j),$(null),y(!1),h(!1),i){const k=Yn(a);m(a.name),f(""),x(a.identity_key??""),v(k.node_name??a.name),b(k.tcp_port??5e3),I(k.bind_address??"0.0.0.0")}else m(""),f(""),x(""),v(""),b(5e3),I("0.0.0.0");const C=l.useCallback(async()=>{var k,F;if(!i&&!o.trim()){$("Name is required");return}y(!0),$(null);try{if(i){const N={name:a.name,new_name:c.trim()||void 0,identity_key:d,type:"companion",settings:{node_name:u,tcp_port:S,bind_address:E}},D=await Er(N);if(!D.success&&!((k=D.data)!=null&&k.message))throw new Error(D.error||"Failed")}else{const N={name:o.trim(),identity_key:d,type:"companion",settings:{node_name:u||o.trim(),tcp_port:S??5e3,bind_address:E||"0.0.0.0"}},D=await Pr(N);if(!D.success&&!((F=D.data)!=null&&F.message))throw new Error(D.error||"Failed")}await r(),t()}catch(N){$(N instanceof Error?N.message:"Operation failed")}finally{y(!1)}},[i,a,o,c,d,u,S,E,r,t]);return e.jsxs(ve,{open:s,onClose:t,size:"md",solid:!0,children:[e.jsx(Ee,{icon:i?void 0:e.jsx(fe,{className:"w-5 h-5"}),title:i?"Edit Companion":"Add Companion",onClose:t}),e.jsx(Ne,{children:e.jsxs("div",{className:"space-y-5",children:[i&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{color:a.registered?"green":"red",children:a.registered?"Configured":"Not registered"}),a.hash&&e.jsx("span",{className:"type-data-xs text-fg-muted",children:a.hash})]}),i?e.jsxs(e.Fragment,{children:[e.jsxs(re,{children:[e.jsx(le,{children:"Current Name"}),e.jsx(me,{value:a.name,disabled:!0})]}),e.jsxs(re,{children:[e.jsxs(le,{children:["New Name ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(Optional)"})]}),e.jsx(me,{value:c,onChange:k=>f(k.target.value),placeholder:"Leave empty to keep current name"})]})]}):e.jsxs(re,{children:[e.jsx(le,{children:"Name"}),e.jsx(me,{value:o,onChange:k=>m(k.target.value),placeholder:"e.g., TestCompanion",autoFocus:!0})]}),e.jsxs(re,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(le,{children:["Identity Key ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(Optional)"})]}),e.jsx("button",{type:"button",onClick:()=>h(k=>!k),className:"type-data-xs text-fg-muted underline hover:text-fg-secondary",children:g?"Hide":"Show"})]}),g&&e.jsxs(e.Fragment,{children:[e.jsx(me,{value:d,onChange:k=>x(k.target.value),placeholder:i?"Leave empty to keep current key":"Leave empty to auto-generate",className:"font-mono"}),e.jsx(Ce,{children:"32 or 64 bytes hex."})]})]}),e.jsxs(re,{children:[e.jsx(le,{children:"Node Name"}),e.jsx(me,{value:u,onChange:k=>v(k.target.value),placeholder:"Display name"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(re,{children:[e.jsx(le,{children:"TCP Port"}),e.jsx(me,{type:"number",min:1,max:65535,value:S,onChange:k=>b(parseInt(k.target.value,10)||5e3)})]}),e.jsxs(re,{children:[e.jsx(le,{children:"Bind Address"}),e.jsx(me,{value:E,onChange:k=>I(k.target.value),placeholder:"0.0.0.0"})]})]}),M&&e.jsx("p",{className:"type-data-xs text-sys-red",children:M})]})}),e.jsxs(Pe,{children:[e.jsx(H,{plain:!0,onClick:t,children:"Cancel"}),e.jsx(H,{color:"primary",onClick:C,disabled:_,children:_?"Saving…":i?"Save":"Create"})]})]})}function Wc(){const s=Mr(),t=rn(),{setFloodScope:n,clearFloodScope:a}=te.getState(),[r,i]=l.useState(""),[o,m]=l.useState(!1),[c,f]=l.useState(ea),[d,x]=l.useState(null),g=l.useRef(null),h=r.trim()?Gs(r.trim()):"",u=l.useCallback(async b=>{const E=Gs(b);if(!E)return;m(!0),x(null),i(""),f(Bc(E)),await n(E)||x("Failed to set transport key on device"),m(!1)},[n]),v=l.useCallback(async()=>{m(!0),x(null),await a()||x("Failed to clear transport key on device"),m(!1)},[a]),S=l.useCallback(b=>{b.key==="Enter"&&h&&(b.preventDefault(),u(h))},[h,u]);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-lg bg-sys-blue/5 border border-sys-blue/10",children:[e.jsx(He,{className:"w-4 h-4 text-sys-blue flex-shrink-0 mt-0.5"}),e.jsxs("p",{className:"type-data-xs text-fg-muted",children:["A transport key filters which flood packets the companion device forwards. Set a region name to derive a SHA-256 transport key from ",e.jsx("code",{className:"text-fg-secondary",children:"#name"}),". Only one transport key can be active at a time."]})]}),e.jsx("div",{className:"bg-subtle-fill radius-inner p-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fn,{className:"w-4 h-4 text-fg-muted"}),e.jsx("span",{className:"type-body-sm text-fg-muted",children:"Active Transport Key"})]}),s?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-sys-green/10 text-sys-green type-data font-medium",children:[e.jsx(dn,{className:"w-3.5 h-3.5"}),"#",s]}),e.jsx("button",{onClick:v,disabled:o||!t,className:"p-1.5 rounded-lg hover:bg-sys-red/10 transition-colors disabled:opacity-50",title:"Clear transport key",children:o?e.jsx(oe,{className:"w-3.5 h-3.5 text-fg-muted animate-spin"}):e.jsx(ot,{className:"w-3.5 h-3.5 text-fg-muted hover:text-sys-red"})})]}):e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-subtle-fill-strong text-fg-muted type-data",children:[e.jsx(Rr,{className:"w-3.5 h-3.5"}),"Global (no filter)"]})]})}),e.jsxs("div",{children:[e.jsx("label",{className:"type-label text-fg-muted block mb-2",children:"Set Region"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg-muted/50 type-data",children:"#"}),e.jsx("input",{ref:g,type:"text",value:r,onChange:b=>i(b.target.value),onKeyDown:S,placeholder:"e.g., south-bay",disabled:!t,className:"w-full pl-7 pr-3 py-2 rounded-lg bg-subtle-fill border border-edge-subtle text-sm text-fg-primary placeholder:text-fg-muted/40 focus:outline-none focus:ring-2 focus:ring-sys-blue/50 disabled:opacity-50"})]}),e.jsxs(H,{color:"primary",onClick:()=>u(h),disabled:!h||o||!t,children:[o?e.jsx(oe,{"data-slot":"icon",className:"animate-spin"}):null,"Set"]})]}),h&&h!==r.trim().toLowerCase()&&e.jsxs("p",{className:"type-data-xs text-fg-muted mt-1",children:["Will set as ",e.jsxs("span",{className:"font-mono text-fg-secondary",children:["#",h]})]})]}),c.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(un,{className:"w-3.5 h-3.5 text-fg-muted/50"}),e.jsx("span",{className:"type-label text-fg-muted",children:"Recent Regions"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map(b=>e.jsx("button",{onClick:()=>u(b),disabled:o||!t,className:A("inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium transition-colors","disabled:opacity-50 disabled:cursor-not-allowed",b===s?"bg-sys-green/10 text-sys-green":"bg-subtle-fill hover:bg-subtle-fill-strong text-fg-secondary"),children:e.jsxs("span",{className:"font-mono",children:["#",b]})},b))})]}),!t&&e.jsx("p",{className:"type-data-xs text-sys-amber",children:"Companion device is not connected. Connect to a companion to manage transport keys."}),d&&e.jsx("p",{className:"type-data-xs text-sys-red",children:d})]})}function Vs({open:s,onClose:t,onRefresh:n}){const[a,r]=l.useState("companions"),[i,o]=l.useState(null),[m,c]=l.useState(!0),[f,d]=l.useState(!1),[x,g]=l.useState("create"),[h,u]=l.useState(null),[v,S]=l.useState(null),[b,E]=l.useState(!1),[I,_]=l.useState(!1),y=l.useRef(!0);l.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]);const[M,$]=l.useState(!1);s!==M&&($(s),s&&r("companions"));const R=l.useCallback(async()=>{c(!0);try{const T=await kr();y.current&&T.success&&T.data&&o(T.data)}catch{}finally{y.current&&c(!1)}},[]);l.useEffect(()=>{s&&R()},[s,R]);const p=(i==null?void 0:i.configured_companions)??[],j=l.useCallback(async()=>{await R(),n==null||n()},[R,n]),C=l.useCallback(async()=>{if(v){E(!0);try{await Cr(v.name,"companion"),await j()}catch{}finally{y.current&&(E(!1),S(null))}}},[v,j]),k=Sr(),F=an(),{setCompanionPaused:N}=te.getState(),[D,q]=l.useState({});l.useEffect(()=>{if(!(i!=null&&i.configured_companions))return;const T={};for(const z of i.configured_companions)T[z.name]=_r(z.name);q(T)},[i]);const X=l.useCallback(T=>T===F?k:D[T]??!1,[F,k,D]),[L,G]=l.useState(null),w=l.useCallback(async(T,z)=>{G(T);try{await N(T,!z),q(O=>({...O,[T]:!z}))}finally{y.current&&G(null)}},[N]);return e.jsxs(e.Fragment,{children:[e.jsxs(ve,{open:s,onClose:t,size:"md",solid:!0,children:[e.jsx(Ee,{icon:e.jsx(fe,{className:"w-5 h-5"}),title:"Companion Configuration",onClose:t}),e.jsxs(Ne,{children:[e.jsx("div",{className:"flex gap-1 mb-4 p-0.5 rounded-lg bg-subtle-fill",children:[["companions","Companions",fe],["transport","Transport Key",fn]].map(([T,z,O])=>e.jsxs("button",{onClick:()=>r(T),className:A("flex-1 flex items-center justify-center gap-1.5 py-1.5 px-3 rounded-md text-sm font-medium transition-colors",a===T?"bg-surface text-fg-primary shadow-sm":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(O,{className:"w-3.5 h-3.5"}),z]},T))}),a==="companions"&&e.jsx(e.Fragment,{children:m?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(oe,{className:"w-5 h-5 animate-spin text-sys-blue mr-2"}),e.jsx("span",{className:"text-sm text-fg-muted",children:"Loading…"})]}):p.length>0?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-sys-blue/10 bg-sys-blue/5 p-3",children:[e.jsx(He,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-sys-blue"}),e.jsx("p",{className:"type-data-xs text-fg-muted",children:"This switch only controls openHop Console's browser companion session. Turning it off releases the browser frame connection so external apps can connect; it does not stop the companion identity or companion service from working in the repeater."})]}),p.map(T=>{const z=Yn(T),O=X(T.name),W=L===T.name;return e.jsxs("div",{className:A("bg-subtle-fill radius-inner p-3 hover:bg-subtle-fill-strong transition-base",O&&"opacity-60"),children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:A("h-2 w-2 rounded-full flex-shrink-0",O?"bg-fg-muted":"bg-sys-blue")}),e.jsx("h3",{className:"type-body-sm text-fg-primary font-medium truncate flex-1",children:T.name}),e.jsx($e,{color:O?"zinc":"blue",children:O?"Browser off":"Browser on"}),e.jsx(H,{color:"primary",plain:!0,onClick:()=>{u(T),g("edit"),d(!0)},children:e.jsx(Dl,{"data-slot":"icon"})}),e.jsx(Ir,{enabled:!O,onChange:V=>w(T.name,V),size:"sm",disabled:W,status:W?"loading":"idle",tooltip:O?"Allow Console to connect in this browser":"Release Console browser connection for external apps",dangerOff:!0}),e.jsx(H,{color:"danger",plain:!0,onClick:()=>S(T),children:e.jsx(qe,{"data-slot":"icon"})})]}),e.jsxs("div",{className:"mt-1.5 type-data-xs text-fg-muted pl-5",children:[z.node_name||T.name," · Port ",z.tcp_port??5e3," · ",z.bind_address||"0.0.0.0"," · ",O?"external apps can connect":"external apps cannot use this companion while Browser on"]})]},T.name)})]}):e.jsxs("div",{className:"text-center py-8",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-subtle-fill mx-auto mb-3 flex items-center justify-center",children:e.jsx(fe,{className:"w-5 h-5 text-fg-muted/50"})}),e.jsx("p",{className:"text-sm text-fg-muted",children:"No companions configured"})]})}),a==="transport"&&e.jsx(Wc,{})]}),e.jsxs(Pe,{children:[a==="companions"&&e.jsx(H,{plain:!0,onClick:()=>_(!0),title:"Key Management",children:e.jsx(hn,{"data-slot":"icon"})}),e.jsx("div",{className:"flex-1"}),e.jsx(H,{plain:!0,onClick:t,children:"Close"}),a==="companions"&&e.jsxs(H,{color:"primary",onClick:()=>{u(null),g("create"),d(!0)},children:[e.jsx(Ge,{"data-slot":"icon"})," Add Companion"]})]})]}),e.jsx(Hc,{open:f,onClose:()=>d(!1),mode:x,identity:h,onSave:j}),e.jsx(xn,{isOpen:!!v,title:"Delete Companion",message:`Delete '${v==null?void 0:v.name}'? A service restart is required.`,confirmLabel:b?"Deleting…":"Delete",cancelLabel:"Cancel",variant:"danger",onConfirm:C,onCancel:()=>S(null)}),e.jsx(Lc,{open:I,onClose:()=>_(!1)})]})}const Uc=l.memo(function({companions:t,selected:n,onSelect:a}){return t.length<2?null:e.jsx("select",{value:n??"",onChange:r=>a(r.target.value),className:"px-2 py-1 text-sm bg-transparent border border-edge-subtle radius-inner text-fg-primary focus:outline-none focus:ring-1 focus:ring-sys-blue/40",children:t.map(r=>e.jsx("option",{value:r.companion_name,children:r.node_name||r.companion_name},r.companion_name))})}),ze=[{value:"Chat Node",label:"Companions"},{value:"Room Server",label:"Room Servers"},{value:"Repeater",label:"Repeaters"}],Kc=[{value:"all",label:"All time"},{value:"24h",label:"Last 24 hours"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"}];function qc(s){switch(s){case"24h":return 24;case"7d":return 168;case"30d":return 720;default:return}}function Gc({open:s,onClose:t,companionName:n,onImport:a}){const[r,i]=l.useState(()=>new Set(ze.map(_=>_.value))),[o,m]=l.useState("all"),[c,f]=l.useState(""),[d,x]=l.useState(!1),[g,h]=l.useState(null),[u,v]=l.useState(s);s!==u&&(v(s),s&&(i(new Set(ze.map(_=>_.value))),m("all"),f(""),x(!1),h(null)));const S=r.size===ze.length;function b(_){i(y=>{const M=new Set(y);return M.has(_)?M.delete(_):M.add(_),M})}function E(){i(S?new Set:new Set(ze.map(_=>_.value)))}const I=l.useCallback(async()=>{if(!(r.size===0||d)){x(!0),h(null);try{const _={types:[...r],hours:qc(o)},y=parseInt(c,10);y>0&&(_.limit=y);const M=await a(_);h(M)}finally{x(!1)}}},[r,o,c,d,a]);return e.jsxs(ve,{open:s,onClose:t,size:"sm",children:[e.jsx(Ee,{title:"Import repeater contacts",onClose:t}),e.jsx(Ne,{children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("p",{className:"text-sm text-fg-secondary",children:["Seed ",e.jsx("strong",{className:"text-fg-primary",children:n})," with contacts from the repeater's adverts. Results are ordered by most recent first."]}),e.jsxs(re,{children:[e.jsx(le,{children:"Contact types"}),e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsx(hs,{checked:S,indeterminate:r.size>0&&!S,onChange:E,label:"All types",size:"sm"}),e.jsx("div",{className:"ml-6 space-y-1.5",children:ze.map(_=>e.jsx(hs,{checked:r.has(_.value),onChange:()=>b(_.value),label:_.label,size:"sm"},_.value))})]})]}),e.jsx(Fl,{label:"Recency",value:o,onChange:m,options:Kc,orientation:"horizontal",size:"sm"}),e.jsxs(re,{children:[e.jsxs(le,{children:["Import at most ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(optional)"})]}),e.jsx(me,{type:"number",min:1,value:c,onChange:_=>f(_.target.value),placeholder:"No limit",className:"mt-1"}),e.jsx(Ce,{children:"Leave empty for no cap."})]}),g&&e.jsxs("p",{className:"text-sm text-sys-green font-medium",children:["Imported ",g.added," new contact",g.added!==1?"s":""," (",g.total," total)"]})]})}),e.jsxs(Pe,{children:[e.jsx(H,{plain:!0,onClick:t,children:"Cancel"}),e.jsx(H,{color:"primary",onClick:I,disabled:d||r.size===0,children:d?e.jsxs(e.Fragment,{children:[e.jsx(oe,{"data-slot":"icon",className:"animate-spin"}),"Importing…"]}):"Import"})]})]})}const Vc=["alameda","alpine","amador","butte","calaveras","colusa","contracosta","contra-costa","delnorte","del-norte","eldorado","el-dorado","fresno","glenn","humboldt","imperial","inyo","kern","kings","lake","lassen","losangeles","los-angeles","la-county","madera","marin","mariposa","mendocino","merced","modoc","mono","monterey","napa","nevada","orange","oc","placer","plumas","riverside","sacramento","sac","sanbenito","san-benito","sanbernardino","san-bernardino","sandiego","san-diego","sd","sanfrancisco","san-francisco","sf","sanjoaquin","san-joaquin","sanluisobispo","san-luis-obispo","slo","sanmateo","san-mateo","santabarbara","santa-barbara","sb","santaclara","santa-clara","santacruz","santa-cruz","shasta","sierra","siskiyou","solano","sonoma","stanislaus","sutter","tehama","trinity","tulare","tuolumne","ventura","yolo","yuba","losangeles","los-angeles","la","hollywood","westhollywood","west-hollywood","weho","beverlyhills","beverly-hills","santamonica","santa-monica","culvercity","culver-city","marinadelrey","marina-del-rey","venice","venicebeach","venice-beach","malibu","palisades","pacificpalisades","pacific-palisades","brentwood","westwood","westla","west-la","dtla","downtown","downtownla","downtown-la","koreatown","ktown","silverlake","silver-lake","losfeliz","los-feliz","echopark","echo-park","eastla","east-la","boyleheights","boyle-heights","highlandpark","highland-park","eaglerock","eagle-rock","pasadena","southpasadena","south-pasadena","glendale","burbank","tolucalake","toluca-lake","studiocity","studio-city","shermanoaks","sherman-oaks","encino","tarzana","reseda","vannuys","van-nuys","northhollywood","north-hollywood","noho","woodlandhills","woodland-hills","calabasas","topanga","agourahills","agoura-hills","thousandoaks","thousand-oaks","simivalley","simi-valley","simi","moorpark","camarillo","oxnard","porthueneme","port-hueneme","ventura","ojai","sfv","sfvalley","sf-valley","thevalley","the-valley","sanfernando","san-fernando","sanfernandovalley","san-fernando-valley","pacoima","sylmar","sunland","tujunga","sunlandtujunga","lakeviewterrace","lakeview-terrace","shadowhills","shadow-hills","chatsworth","northridge","granadahills","granada-hills","missionhills","mission-hills","panoramacity","panorama-city","arleta","sunvalley","sun-valley","santaclarita","santa-clarita","scv","valencia","newhall","saugus","canyoncountry","canyon-country","castaic","stevenson","stevensonranch","stevenson-ranch","acton","agua-dulce","aguadulce","palmdale","lancaster","antelopevalley","antelope-valley","av","avmesh","av-mesh","quartz-hill","quartzhill","littlerock","little-rock","pearblossom","pear-blossom","lakelosangeles","lake-los-angeles","highdesert","high-desert","hd","hdmesh","hd-mesh","victorville","hesperia","applevalley","apple-valley","barstow","adelanto","phelan","pinon-hills","pinonhills","wrightwood","bigbear","big-bear","lakeisabella","lake-isabella","inlandempire","inland-empire","ie","riverside","corona","moreno-valley","morenovalley","fontana","ontario","rancho","ranchocucamonga","rancho-cucamonga","upland","claremont","pomona","azusa","glendora","covina","westcovina","west-covina","diamondbar","diamond-bar","chino","chinohills","chino-hills","sanbernardinocity","rialto","colton","redlands","yuciapa","yucaipa","beaumont","banning","hemet","perris","menifee","temecula","murrieta","wildomar","lakeland","lakeelsinore","lake-elsinore","orangecounty","orange-county","oc","anaheim","fullerton","santaana","santa-ana","irvine","costamesa","costa-mesa","newportbeach","newport-beach","newport","huntingtonbeach","huntington-beach","hb","surfcity","surf-city","lagunabeach","laguna-beach","lagunaniguel","laguna-niguel","sanclemente","san-clemente","danapoint","dana-point","missionviejo","mission-viejo","lakeforest","lake-forest","rsm","ranchosantamargarita","rancho-santa-margarita","alisoviejo","aliso-viejo","tustin","orange","yorbalinda","yorba-linda","brea","lahabra","la-habra","placentia","buenapark","buena-park","cypress","losalamitojos","sealbeach","seal-beach","gardengrove","garden-grove","westminster","stanton","fountainvalley","sandiego","san-diego","sd","sdmesh","sd-mesh","lajolla","la-jolla","pacificbeach","pacific-beach","pb","missionbeach","mission-beach","oceanbeach","ocean-beach","ob","pointloma","point-loma","coronado","hillcrest","northpark","north-park","southpark","south-park","normalheights","normal-heights","cityheights","city-heights","lamesa","la-mesa","elcajon","el-cajon","santee","lakeside","poway","ramona","julian","alpine","escondido","sanmarcos","san-marcos","vista","oceanside","carlsbad","encinitas","delmar","del-mar","solanabeanch","solana-beach","chulavista","chula-vista","nationalcity","national-city","imperialbeach","imperial-beach","ib","southbay","south-bay","torrance","gardena","hawthorne","lawndale","redondo","redondobeach","hermosa","hermosabeach","manhattan","manhattanbeach","manhattan-beach","elsegundo","el-segundo","palosverdes","palos-verdes","pv","ranchopalosverdes","rancho-palos-verdes","sanpedro","san-pedro","wilmington","carson","compton","longbeach","long-beach","lb","signalhill","signal-hill","lakewood","cerritos","artesia","lamirada","la-mirada","norwalk","whittier","lahabra","la-habra-heights","downey","bellflower","paramount","southgate","south-gate","lynwood","bellgardens","bell-gardens","cudahy","huntingtonpark","maywood","vernon","commerce","montebello","picorivera","pico-rivera","montereypark","monterey-park","alhambra","sanmarinno","san-marino","arcadia","monrovia","duarte","azusa","irwindale","baldwinpark","baldwin-park","elmonbte","el-monte","southelmonte","south-el-monte","rosemead","temple-city","templecity","sangabriel","san-gabriel","santabarbara","santa-barbara","sb","goleta","carpinteria","montecito","islavista","isla-vista","iv","ucsb","slo","sanluisobispo","san-luis-obispo","morrobay","morro-bay","pismobeach","pismo-beach","pismo","shellbeach","shell-beach","arroyogrande","arroyo-grande","groverbeach","grover-beach","oceano","santamaria","santa-maria","lompoc","vandenberg","solvang","buellton","losalamos","los-alamos","atascadero","pasorobles","paso-robles","paso","cambria","cayucos","sansiemon","san-simeon","hearst","fresno","clovis","visalia","tulare","hanford","porterville","bakersfield","bako","delano","wasco","shafter","taft","tehachapi","stockton","tracy","manteca","lodi","modesto","turlock","merced","madera","chowchilla","losabnos","los-banos","sacramento","sac","sactown","westsacramento","west-sacramento","westsac","elkgrove","elk-grove","folsom","ranchocordova","rancho-cordova","roseville","rocklin","lincoln","citrus-heights","citrusheights","fair-oaks","fairoaks","carmichael","orangevale","davis","woodland","dixon","vacaville","fairfield","vallejo","bayarea","bay-area","sfbay","sf-bay","sanfrancisco","san-francisco","sf","sfmesh","sf-mesh","oakland","eastbay","east-bay","berkeley","emeryville","alameda","sanleandro","san-leandro","hayward","fremont","unioncity","union-city","newark","milpitas","sanjose","san-jose","sj","campbell","saratoga","losgartos","los-gatos","sunnyvale","santaclara","santa-clara","cupertino","mountainview","mountain-view","paloalto","palo-alto","menlopark","menlo-park","atherton","redwoodcity","redwood-city","sancarlos","san-carlos","belmont","sanmateo","san-mateo","fostercity","foster-city","burlingame","sanbruno","san-bruno","southsanfrancisco","ssf","dalycity","daly-city","pacifica","halfmoonbay","half-moon-bay","hmb","santacruz","santa-cruz","capitola","scottsvalley","scotts-valley","watsonville","aptos","soquel","concord","walnutcreek","walnut-creek","pleasant-hill","pleasanthill","martinez","antioch","pittsburg","brentwood","oakley","discovery-bay","livermore","pleasanton","dublin","sanramon","san-ramon","danville","richmond","sanpablo","san-pablo","pinole","hercules","napa","sonoma","petaluma","santarosa","santa-rosa","rohnertpark","novato","sanrafael","san-rafael","sausalito","tiburon","millvalley","mill-valley","redding","chico","oroville","paradise","reddingbluff","redbluff","red-bluff","shasta","mtshasta","mt-shasta","eureka","arcata","fortuna","mckibleyville","ukiah","fortbragg","fort-bragg","willits","yreka","weed","dunsmuir","tahoe","laketahoe","lake-tahoe","southlaketahoe","south-lake-tahoe","truckee","squaw","squawvalley","squaw-valley","northstar","mammoth","mammothlakes","mammoth-lakes","bishopca","bishop","placerville","tahoe-city","tahoecity","kings-beach","kingsbeach","incline","inclinevillage","incline-village","maricopa","pima","pinal","yavapai","yuma","mohave","coconino","cochise","navajo","apache","gila","santacruzaz","graham","lapaz","la-paz","greenlee","arizona","az","azmesh","az-mesh","phoenix","phx","phoenixmesh","phoenix-mesh","scottsdale","tempe","mesa","gilbert","chandler","glendale","peoria","surprize","avondale","goodyear","buckeye","litchfieldpark","litchfield-park","tolleson","laveen","paradisevalley","paradise-valley","pv","carefree","cavekreek","cave-creek","fountainhills","fountain-hills","rioverde","rio-verde","queencreek","queen-creek","santan","san-tan","santanvalley","ahwatukee","southmountain","south-mountain","anthem","newriver","new-river","apachejunction","apache-junction","aj","goldcanyon","gold-canyon","tucson","tucsomesh","tucson-mesh","orovalley","oro-valley","marana","catalina","catalinafoothills","saddlebrooke","casagrande","casa-grande","eloy","coolidge","florence","sierravista","sierra-vista","bisbee","tombstone","benson","douglas","nogales","tubac","greenvalley","green-valley","sahuarita","flagstaff","flag","flagmesh","sedona","cottonwood","clarkdale","prescott","prescottvalley","prescott-valley","dewey","chino-valley","chinovalley","williams","grandcanyon","grand-canyon","tusayan","page","marble-canyon","showlow","show-low","pinetop","pinetoplakeside","lakeside","snowflake","taylor","payson","pine","strawberry","camp-verde","campverde","winslow","holbrook","stjohns","springerville","eagar","yuma","yumamesh","fortuna-foothills","sanluisaz","san-luis","lakehavasu","lake-havasu","havasu","havasucity","lake-havasu-city","bullheadcity","bullhead-city","bullhead","laughlin","kingman","goldenkvalley","golden-valley","parker","quartzsite","wickenburg","lasvegas","las-vegas","vegas","vegasmesh","vegas-mesh","lv","henderson","boulder-city","bouldercity","northlasvegas","north-las-vegas","nlv","summerlin","enterprise","pahrump","mesquite","reno","sparks","carsoncity","carson-city","incline","bajacalifornia","baja-california","baja","bajamesh","tijuana","tj","mexicali","ensenada","tecate","rosarito","sanfelipe","san-felipe","sanluis","sanluisriocoalorado","brabant","flevoland","gelderland","noordbrabant","noordholland","zuid-holland","zuidholland","zeeland","twente","alkmaar","almere","amsterdam","amstelland","capelleaandenijssel","denhaag","dordrecht","drechtsteden","eindhoven","haarlem","hellevoetsluis","hilversum","katwijk","lelystad","maassluis","middelburg","rijnmond","rotterdam","tilburg","utrecht","vlissingen","voorburg","voorne-putten","walcheren","west-friesland","zaandam","zaanstreek-waterland","024-bot","afrithonbot","ai","amradio","analyser","angrynerds","bemesh","bot","buch","burgernet","chat","chatgpt","dares","dekroeg","dtis","emergency","english","evenvroegopstaan","fosdem","gezellig","gmr","gmrbot","goedemorgen","gyverbot","haagscourant","hackerspacenijmegen","hamradio","hamradionederland","hetweerinjegemeente","hsnl","jokes","kanalen","koffie","linux","meshcore","nerd","nl-alert","nl-prio","noodkanaal","nsagov","pi4hm","pi4utr","pingbot","sensemakers","sports","survival","test","testing","uitdagingen","valleibot","valleirug","vleesboek","wardrive","weer","swl","qso","qrz","cq","dx","sstv","aprs","winlink","aredn","hamnet","emcomm","emcommplanning","races","ares","auxcomm","simplex","repeater","uhf","vhf","2m","70cm","440"],Jc=new Set(Vc);function Qc(){return crypto.getRandomValues(new Uint8Array(16))}function Js(s){return Array.from(s).map(t=>t.toString(16).padStart(2,"0")).join("")}function jt(s){const t=s.replace(/\s/g,"");if(t.length!==32||!/^[0-9a-fA-F]+$/.test(t))return null;const n=new Uint8Array(16);for(let a=0;a<16;a++)n[a]=parseInt(t.slice(a*2,a*2+2),16);return n}async function Xc(s){const n=`#${ln(s)}`,a=new TextEncoder().encode(n);return(await Tr(a)).slice(0,16)}const Qs=[{key:"create-private",label:"Create Private",icon:Nl,desc:"Generate a new private channel with a random key"},{key:"join-private",label:"Join Private",icon:gi,desc:"Join an existing private channel using a shared key"},{key:"join-hashtag",label:"Join Hashtag",icon:Fe,desc:"Join a public hashtag channel (key derived from name)"}];function Yc({open:s,onClose:t,channels:n,onAddChannel:a}){var C;const[r,i]=l.useState("join-hashtag"),[o,m]=l.useState(""),[c,f]=l.useState(""),[d,x]=l.useState(null),[g,h]=l.useState(!1),[u,v]=l.useState(""),[S,b]=l.useState(!1),[E,I]=l.useState(s);s!==E&&(I(s),s&&(i("join-hashtag"),m(""),f(""),x(null),h(!1),v(""),b(!1)));const _=l.useMemo(()=>n.length===0?0:Math.max(...n.map(k=>k.index))+1,[n]),y=l.useMemo(()=>r!=="join-hashtag"?"":ln(o),[r,o]),M=l.useMemo(()=>{if(!o.trim())return null;const k=r==="join-hashtag"&&y?`#${y}`:o.trim();return n.find(F=>F.name===k)??null},[o,r,y,n]),$=l.useMemo(()=>r==="join-hashtag"&&y?Jc.has(y):!1,[r,y]),R=l.useMemo(()=>{if(!o.trim()||M)return!1;switch(r){case"create-private":return o.trim().length>0&&o.trim().length<=32;case"join-private":return o.trim().length>0&&jt(c)!==null;case"join-hashtag":return y.length>0;default:return!1}},[r,o,c,y,M]),p=l.useCallback(async()=>{d&&(await navigator.clipboard.writeText(Js(d)),b(!0),setTimeout(()=>b(!1),2e3))},[d]),j=l.useCallback(async()=>{if(!(!R||g)){h(!0),v("");try{let k,F;switch(r){case"create-private":{k=Qc(),F=o.trim();break}case"join-private":{const D=jt(c);if(!D){v("Invalid hex key (must be 32 hex chars = 16 bytes)");return}k=D,F=o.trim();break}case"join-hashtag":{k=await Xc(o),F=`#${y}`;break}default:return}if(await a(_,F,k)){if(r==="create-private"){x(k);return}t()}else v("Failed to add channel — device may be unreachable")}catch(k){v(k instanceof Error?k.message:"Unknown error")}finally{h(!1)}}},[R,g,r,o,c,y,_,a,t]);return e.jsxs(ve,{open:s,onClose:t,size:"sm",children:[e.jsx(Ee,{title:"Add Channel",onClose:t}),e.jsx(Ne,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex gap-1 p-0.5 radius-inner bg-zinc-950/5",children:Qs.map(k=>{const F=k.icon,N=r===k.key;return e.jsxs("button",{onClick:()=>{i(k.key),v(""),x(null)},className:A("flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs font-medium rounded transition-colors",N?"bg-surface text-fg-primary shadow-sm":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(F,{className:"w-3.5 h-3.5"}),k.label]},k.key)})}),e.jsx("p",{className:"text-xs text-fg-muted",children:(C=Qs.find(k=>k.key===r))==null?void 0:C.desc}),d&&r==="create-private"&&e.jsxs("div",{className:"p-3 radius-inner bg-sys-green/8 border border-sys-green/20 space-y-2",children:[e.jsx("p",{className:"text-xs text-sys-green font-medium",children:"Channel created! Share this key with others:"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"flex-1 text-[11px] font-mono text-fg-primary bg-zinc-950/10 px-2 py-1 rounded break-all",children:Js(d)}),e.jsx("button",{onClick:p,className:"p-1.5 rounded hover:bg-subtle-fill transition-colors flex-shrink-0",title:"Copy key",children:S?e.jsx(ge,{className:"w-3.5 h-3.5 text-sys-green"}):e.jsx(It,{className:"w-3.5 h-3.5 text-fg-muted"})})]}),e.jsx("p",{className:"text-[11px] text-fg-muted",children:"Save this key — it cannot be recovered later."})]}),e.jsxs(re,{children:[e.jsx(le,{children:r==="join-hashtag"?"Hashtag name":"Channel name"}),e.jsx(me,{type:"text",value:o,onChange:k=>m(k.target.value),placeholder:r==="join-hashtag"?"e.g. south-bay":"e.g. My Channel",maxLength:32,className:"mt-1",disabled:!!d}),r==="join-hashtag"&&y&&y!==o&&e.jsxs(Ce,{className:"mt-1",children:["Will be registered as ",e.jsxs("code",{className:"text-fg-primary font-mono text-[11px]",children:["#",y]})]}),r==="join-hashtag"&&$&&e.jsx(Ce,{className:"mt-1 text-sys-green",children:"Known region channel"})]}),M&&e.jsxs("div",{className:"flex items-start gap-2 p-2.5 radius-inner bg-sys-red/8 border border-sys-red/20",children:[e.jsx(Ue,{className:"w-3.5 h-3.5 text-sys-red flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-xs text-fg-secondary",children:["Channel ",e.jsx("strong",{className:"text-fg-primary",children:M.name})," already exists at slot ",M.index,". Remove it first to re-add."]})]}),r==="join-private"&&e.jsxs(re,{children:[e.jsxs(le,{children:["Channel key ",e.jsx("span",{className:"text-fg-muted font-normal",children:"(32 hex chars)"})]}),e.jsx(me,{type:"text",value:c,onChange:k=>f(k.target.value),placeholder:"e.g. a1b2c3d4e5f6...",maxLength:32,className:"mt-1 font-mono text-xs"}),c&&!jt(c)&&e.jsx(Ce,{className:"mt-1 text-sys-red",children:"Must be exactly 32 hex characters (16 bytes)"})]}),e.jsxs("p",{className:"text-[11px] text-fg-muted",children:["Will be assigned to channel slot ",e.jsx("strong",{className:"text-fg-primary",children:_})]}),u&&e.jsx("p",{className:"text-xs text-sys-red font-medium",children:u})]})}),e.jsxs(Pe,{children:[e.jsx(H,{plain:!0,onClick:t,children:d?"Done":"Cancel"}),!d&&e.jsx(H,{color:"primary",onClick:j,disabled:!R||g,children:g?e.jsxs(e.Fragment,{children:[e.jsx(oe,{className:"w-4 h-4 animate-spin"}),"Adding…"]}):r==="create-private"?"Create Channel":"Join Channel"})]})]})}const Zc=202,ed=/^[0-9a-fA-F]+$/;function td(s){const t=s.replace(/\s/g,"");return t.length>=Zc&&t.length%2===0&&ed.test(t)}const sd=l.memo(function({open:t,onClose:n,contacts:a,exportPubKey:r,onExport:i,onImport:o}){const[m,c]=l.useState(r?"export":"import"),[f,d]=l.useState(r??""),[x,g]=l.useState(""),[h,u]=l.useState(""),[v,S]=l.useState(!1),[b,E]=l.useState(!1),[I,_]=l.useState(!1),[y,M]=l.useState(null),[$,R]=l.useState(!1),p=l.useRef(null);l.useEffect(()=>{t&&(c(r?"export":"import"),d(r??""),g(""),u(""),S(!1),E(!1),_(!1),M(null),R(!1))},[t,r]);const j=l.useCallback(()=>{n()},[n]),C=l.useCallback(async()=>{if(!f)return;S(!0),M(null),g("");const N=await i(f);S(!1),N?g(N):M("Failed to export contact advert")},[f,i]),k=l.useCallback(async()=>{if(x)try{await navigator.clipboard.writeText(x),_(!0),setTimeout(()=>_(!1),2e3)}catch{M("Failed to copy to clipboard")}},[x]),F=l.useCallback(async()=>{const N=h.replace(/\s/g,"");if(!td(N)){M("Invalid hex — must be at least 202 hex characters (101 bytes)");return}E(!0),M(null);const D=await o(N);E(!1),D?(R(!0),u(""),setTimeout(()=>j(),1500)):M("Import failed — check the hex string and try again")},[h,o,j]);return e.jsxs(ve,{open:t,onClose:j,children:[e.jsx(Ar,{children:"Contact Import / Export"}),e.jsxs(Ne,{children:[e.jsxs("div",{className:"flex gap-1 p-0.5 rounded-lg bg-subtle-fill mb-4",children:[e.jsxs("button",{onClick:()=>{c("export"),M(null)},className:A("flex-1 flex items-center justify-center gap-1.5 py-1.5 rounded-md text-xs font-medium transition-colors",m==="export"?"bg-surface shadow-sm text-fg-primary":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(Mt,{className:"w-3.5 h-3.5"}),"Export"]}),e.jsxs("button",{onClick:()=>{c("import"),M(null)},className:A("flex-1 flex items-center justify-center gap-1.5 py-1.5 rounded-md text-xs font-medium transition-colors",m==="import"?"bg-surface shadow-sm text-fg-primary":"text-fg-muted hover:text-fg-secondary"),children:[e.jsx(We,{className:"w-3.5 h-3.5"}),"Import"]})]}),m==="export"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-fg-muted mb-1",children:"Select contact"}),e.jsxs("select",{value:f,onChange:N=>{d(N.target.value),g(""),M(null)},className:"w-full surface-input rounded-lg px-3 py-2 text-sm text-fg-primary",children:[e.jsx("option",{value:"",children:"Choose a contact…"}),a.map(N=>e.jsx("option",{value:N.public_key,children:N.name||N.public_key.slice(0,12)},N.public_key))]})]}),e.jsx(H,{color:"primary",outline:!0,className:"w-full justify-center",disabled:!f||v,onClick:C,children:v?"Exporting…":"Export Advert"}),x&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("textarea",{readOnly:!0,value:x,rows:4,className:"w-full surface-input rounded-lg px-3 py-2 text-[10px] font-mono text-fg-primary break-all resize-none"}),e.jsxs(H,{color:I?"success":"primary",outline:!0,className:"w-full justify-center",onClick:k,children:[I?e.jsx(ge,{"data-slot":"icon"}):e.jsx(It,{"data-slot":"icon"}),I?"Copied!":"Copy to Clipboard"]})]})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-fg-muted mb-1",children:"Paste advert hex string"}),e.jsx("textarea",{ref:p,value:h,onChange:N=>{u(N.target.value),M(null),R(!1)},placeholder:"Paste exported advert hex here…",rows:4,className:"w-full surface-input rounded-lg px-3 py-2 text-[10px] font-mono text-fg-primary break-all resize-none placeholder:text-fg-muted/50"}),e.jsx("p",{className:"text-[10px] text-fg-muted/70 mt-1",children:"Minimum 101 bytes (202 hex characters): 32B pubkey + 4B timestamp + 64B signature + appData"})]}),$&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-sys-green/10 text-sys-green text-xs font-medium",children:[e.jsx(ge,{className:"w-3.5 h-3.5"}),"Contact imported successfully"]}),e.jsx(H,{color:"primary",outline:!0,className:"w-full justify-center",disabled:!h.trim()||b,onClick:F,children:b?"Importing…":"Import Contact"})]}),y&&e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 mt-3 rounded-lg bg-sys-red/10 text-sys-red text-xs",children:[e.jsx(cn,{className:"w-3.5 h-3.5 flex-shrink-0"}),y]})]}),e.jsx(Pe,{children:e.jsx(H,{plain:!0,onClick:j,children:"Close"})})]})});function Wd(){var ns,as,rs,ls,is,os;const s=$r(),t=an(),n=Fr(),a=Dr(),r=Or(),i=Lr(),o=ct(),m=zr(),c=Br(),f=Hr(),d=sn(),x=Wr(),g=l.useMemo(()=>{if(r.length===0)return a;const P=new Set(a.map(B=>B.public_key));return[...a,...r.filter(B=>!P.has(B.public_key))]},[a,r]),h=l.useMemo(()=>{const P=new Map;if(!(x!=null&&x.neighbors))return P;const B=[];for(const[K,ce]of Object.entries(x.neighbors))ce.zero_hop&&ce.rssi!=null&&ce.snr!=null&&ce.rssi!==0&&B.push({hash:(K.startsWith("0x")?K.slice(2):K).toLowerCase(),rssi:ce.rssi,snr:ce.snr,advertCount:ce.advert_count??1});if(B.length===0)return P;for(const K of g){const ce=K.public_key.toLowerCase();for(const xe of B)if(ce===xe.hash||ce.startsWith(xe.hash)){P.set(K.public_key,{rssi:xe.rssi,snr:xe.snr,advertCount:xe.advertCount});break}}return P},[x==null?void 0:x.neighbors,g]),u=Ur(),v=Kr(),S=rn(),b=qr(),E=Gr(t),I=Vr(),_=Jr(),y=Qr(),M=Xr(),$=Yr(),[R,p]=Zr(),[j,C]=l.useState(!1),[k,F]=l.useState(!1),[N,D]=l.useState(!1),[q,X]=l.useState(!1),[L,G]=l.useState(null),[w,T]=l.useState(!1),[z,O]=l.useState(!1),[W,V]=l.useState(!0),de="pymc_companion_contacts_micro",we="pymc_companion_split",[ye,xt]=l.useState(()=>{try{return localStorage.getItem(de)==="1"}catch{return!1}}),At=25,$t=75,[ht,Ft]=l.useState(()=>{try{const P=Number(localStorage.getItem(we));return P>=At&&P<=$t?P:50}catch{return 50}}),Ve=l.useRef(null),De=l.useRef(null),Dt=l.useRef(null),Je=l.useRef(!1),Oe=l.useRef(ht);Oe.current=ht;const ta=l.useCallback(P=>{P.preventDefault(),P.target.setPointerCapture(P.pointerId),Je.current=!0},[]),sa=l.useCallback(P=>{if(!Je.current||!Ve.current)return;const B=Ve.current.getBoundingClientRect(),K=Math.round(Math.min($t,Math.max(At,(P.clientX-B.left)/B.width*100)));Oe.current=K,De.current&&(De.current.style.width=`${K}%`)},[]),Ot=l.useCallback(()=>{if(!Je.current)return;Je.current=!1;const P=Oe.current;Ft(P);try{localStorage.setItem(we,String(P))}catch{}},[]),na=l.useCallback(()=>{Oe.current=50,De.current&&et(De.current,{width:"50%"},ne.layoutResize),Ft(50);try{localStorage.setItem(we,String(50))}catch{}},[]),aa=l.useCallback(P=>{if(xt(P),typeof window<"u"&&window.innerWidth<768)return;const B=Ve.current,K=Dt.current;if(!B)return;const ce=B.getBoundingClientRect().width;B.style.width=P?"var(--companion-side-micro)":"var(--companion-side)";const xe=B.getBoundingClientRect().width;if(B.style.width=`${ce}px`,K){const _a=P?56:Oe.current/100*xe,Ia=K.offsetWidth,Ma=Math.max(0,xe-_a-12);K.style.flex="none",K.style.width=`${Ia}px`,et(K,{width:`${Ma}px`},{...ne.layoutResize,onComplete(){K.style.flex="",K.style.width=""}})}et(B,{width:`${xe}px`},{...ne.layoutResize,onComplete(){B.style.width=P?"var(--companion-side-micro)":"var(--companion-side)"}})},[]),{selectCompanion:ra,selectConversation:be,sendMessage:Lt,sendChannelMessage:zt,retryMessage:la,retryMessageAsFlood:ia,resetPath:ft,shareContact:oa,removeContact:ca,addChannel:da,requestStatus:Bt,requestTelemetry:Ht,loginToRepeater:gt,logoutFromRepeater:Wt,getNeighbours:Ut,traceContactPath:Kt,discoverPath:qt,pingContact:ua,markAsRead:Gt,fetchCompanions:Vt,seedFromRepeater:ma,exportContactAdvert:pa,importContactAdvert:xa,setContactPath:Jt,deleteChannel:ha,loadOlderMessages:fa}=te.getState(),ga=l.useCallback(P=>{be(P),window.innerWidth>=1280?T(!0):O(!0)},[be]),Qt=te(P=>P.messages),Xt=te(P=>P.unreadMap);l.useEffect(()=>{Gt()},[u,Gt]),l.useEffect(()=>{const P=R.get("dm");P&&g.length>0&&g.find(K=>K.public_key===P)&&(be({type:"contact",id:P}),p({},{replace:!0}))},[R,g,be,p]);const ya=l.useMemo(()=>{const P=new Set;for(const B of g)B.name&&P.add(B.name);for(const B of v)B.sender_name&&!B.is_outgoing&&P.add(B.sender_name);return[...P].sort((B,K)=>B.localeCompare(K))},[g,v]),Yt=l.useMemo(()=>{const P=new Map;for(const B of g)B.name&&P.set(B.name.toLowerCase(),B.public_key);for(const B of v)if(B.sender_name&&B.sender_key&&B.sender_key!=="unknown"&&!B.is_outgoing){const K=B.sender_name.toLowerCase();P.has(K)||P.set(K,B.sender_key)}return P},[g,v]),ba=l.useCallback(P=>{const B=Yt.get(P.toLowerCase());B&&(be({type:"contact",id:B}),T(!0))},[Yt,be]),ja=l.useCallback(async P=>u?u.type==="channel"?zt(Number(u.id),P):Lt(u.id,P):!1,[u,Lt,zt]),va=S&&!I,Zt=y!=null&&(y.adv_type&15)===3,es=_t(Zt?y.public_key:null),Na=Zt&&es!=="success",ts=el(),[ue,Te]=l.useState("idle"),wa=l.useCallback(async()=>{Te("flood-sending");const P=await te.getState().sendFloodAdvert();Te(P?"flood-done":"idle"),P&&setTimeout(()=>Te(B=>B==="flood-done"?"idle":B),2e3)},[]),ka=l.useCallback(async()=>{Te("zero-sending");const P=await te.getState().sendZeroHopAdvert();Te(P?"zero-done":"idle"),P&&setTimeout(()=>Te(B=>B==="zero-done"?"idle":B),2e3)},[]),Ca=e.jsxs("div",{className:"flex items-center gap-2",children:[S&&n&&e.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[e.jsxs("button",{onClick:wa,disabled:ue!=="idle"&&ue!=="zero-done",className:A("inline-flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3.5 py-1.5 sm:py-2 rounded-xl text-xs font-semibold transition-all duration-150","bg-surface depth-raised-soft hover:depth-raised active:depth-inset","disabled:opacity-50 disabled:cursor-not-allowed",ue==="flood-done"?"text-sys-green":"text-fg-secondary hover:text-fg-primary"),title:"A Flood Advert will announce your presence and broadcast your node ID and name anywhere a repeater will repeat it",children:[ue==="flood-sending"?e.jsx(oe,{className:"w-4 h-4 animate-spin"}):e.jsx(Ci,{className:"w-4 h-4"}),ue==="flood-done"?e.jsx("span",{children:"Sent!"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Flood Advert"}),e.jsx("span",{className:"sm:hidden",children:"Flood"})]})]}),e.jsxs("button",{onClick:ka,disabled:ue!=="idle"&&ue!=="flood-done",className:A("inline-flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3.5 py-1.5 sm:py-2 rounded-xl text-xs font-semibold transition-all duration-150","bg-surface depth-raised-soft hover:depth-raised active:depth-inset","disabled:opacity-50 disabled:cursor-not-allowed",ue==="zero-done"?"text-sys-green":"text-fg-secondary hover:text-fg-primary"),title:"A Local Advert, or “Zero Hop” advert will not be repeated by local repeaters, but will be heard by those within range",children:[ue==="zero-sending"?e.jsx(oe,{className:"w-4 h-4 animate-spin"}):e.jsx(Nn,{className:"w-4 h-4"}),ue==="zero-done"?e.jsx("span",{children:"Sent!"}):e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"hidden sm:inline",children:"Local Advert"}),e.jsx("span",{className:"sm:hidden",children:"Local"})]})]})]}),e.jsx("button",{onClick:()=>tl.getState().toggleFocusMode(),className:"hidden lg:flex p-1.5 hover:bg-subtle-fill rounded transition-colors",title:ts?"Collapse view":"Expand view",children:ts?e.jsx(El,{className:"w-4 h-4 text-fg-muted"}):e.jsx(Pl,{className:"w-4 h-4 text-fg-muted"})})]}),Sa=e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4 flex-shrink-0",children:[e.jsx(he,{children:f.length>0&&e.jsx(ae.div,{layout:!0,initial:{opacity:0,scale:.9,width:0},animate:{opacity:1,scale:1,width:"auto"},exit:{opacity:0,scale:.9,width:0},transition:ne.fade,className:"flex items-center gap-1 overflow-hidden",children:f.map(P=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-sys-green/10 text-[11px] text-sys-green font-medium whitespace-nowrap",children:[e.jsx(Be,{className:"w-2.5 h-2.5"}),P.name]},P.pubHex))},"advert-notifs")}),e.jsx(he,{children:b?e.jsxs(ae.span,{initial:{opacity:0,scale:.9,width:0},animate:{opacity:1,scale:1,width:"auto"},exit:{opacity:0,scale:.9,width:0},transition:ne.fade,className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-sys-blue/10 text-[11px] text-sys-blue font-medium whitespace-nowrap overflow-hidden",title:E!=null&&E.clientIp?`Another client (${E.clientIp}) is attached to this companion. Connecting would evict them.`:"Another client is attached to this companion. Connecting would evict them.",children:[e.jsx("span",{className:"relative flex h-1.5 w-1.5 flex-shrink-0",children:e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-sys-blue"})}),"Another client connected",e.jsx("button",{onClick:()=>te.getState().forceConnect(),className:"ml-1 px-1.5 py-0.5 rounded-full bg-sys-blue/20 hover:bg-sys-blue/30 transition-colors text-[10px] font-semibold",title:"Evict the other client and connect now",children:"Connect anyway"})]},"external-client"):S?null:e.jsxs(ae.span,{initial:{opacity:0,scale:.9,width:0},animate:{opacity:1,scale:1,width:"auto"},exit:{opacity:0,scale:.9,width:0},transition:ne.fade,className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-sys-amber/10 text-[11px] text-sys-amber font-medium whitespace-nowrap overflow-hidden",children:[e.jsxs("span",{className:"relative flex h-1.5 w-1.5 flex-shrink-0",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-sys-amber opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-sys-amber"})]}),"Reconnecting…"]},"disconnected")}),n&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>F(!0),disabled:m,className:"data-box flex items-center gap-1 cursor-pointer hover:bg-subtle-fill-strong transition-colors disabled:opacity-50",title:c>0?`${c} contacts seeded from repeater — click to refresh`:"Seed contacts from repeater adverts",children:[m?e.jsx(oe,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"}):e.jsx(Mi,{className:"w-3.5 h-3.5 text-sys-blue"}),c>0&&e.jsxs("span",{className:"text-sys-blue",children:["+",c]})]}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${g.length} contacts${c>0?` (${c} from repeater)`:""}`,children:[e.jsx(Nt,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:g.length})]}),e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:`${n.channels_count} channels`,children:[e.jsx(Fe,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:n.channels_count})]})]}),e.jsx(Uc,{companions:s,selected:t,onSelect:ra}),e.jsx(H,{plain:!0,onClick:()=>C(!0),title:"Companion configuration",children:e.jsx(sl,{"data-slot":"icon"})})]});if(s.length===0&&!I)return e.jsxs(fs,{children:[e.jsx(gs,{title:"Companion",icon:e.jsx(fe,{}),controls:e.jsxs(H,{color:"primary",outline:!0,onClick:()=>C(!0),children:[e.jsx(Ge,{"data-slot":"icon"}),"Add Companion"]})}),e.jsx(ys,{ready:!0,children:e.jsxs("div",{className:"text-center py-16",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-subtle-fill mx-auto mb-4 flex items-center justify-center",children:e.jsx(fe,{className:"w-7 h-7 text-fg-muted/50"})}),e.jsx("p",{className:"type-body text-fg-muted mb-1",children:"No companions configured"}),e.jsx("p",{className:"type-body-sm text-fg-muted/70 mb-4",children:"Add a companion to start messaging mesh contacts"}),e.jsxs(H,{color:"primary",outline:!0,onClick:()=>C(!0),children:[e.jsx(Ge,{"data-slot":"icon"}),"Add Companion"]})]})}),e.jsx(Vs,{open:j,onClose:()=>C(!1),onRefresh:Vt})]});const ss=u?u.type==="channel"?((ns=i.find(P=>String(P.index)===u.id))==null?void 0:ns.name)??"Channel":((as=g.find(P=>P.public_key===u.id))==null?void 0:as.name)??u.id.slice(0,8):null;return e.jsxs(fs,{children:[e.jsx(gs,{title:(o==null?void 0:o.node_name)||"Companion",icon:e.jsx(fe,{}),leading:Ca,controls:Sa}),e.jsx(ys,{children:e.jsxs("div",{className:"companion-layout flex gap-4",style:{height:"calc(100vh - 11rem)",minHeight:400},children:[e.jsxs("div",{ref:Ve,"data-micro":ye?"true":void 0,className:A("companion-side-card flex-shrink-0 flex h-full overflow-hidden radius-inner bg-surface/80 backdrop-blur-lg depth-raised",W?"flex":"hidden md:flex"),children:[e.jsx(mo,{ref:De,contacts:g,selectedConversation:u,unreadMap:Xt,messages:Qt,onSelect:P=>{be(P),window.innerWidth<768&&V(!1)},onShowDetails:ga,onShareContact:oa,onResetPath:ft,onRemoveContact:ca,onPingContact:ua,repeaterSignalMap:h,isLoading:I,splitPercent:ht,onMicroChange:aa}),e.jsx("div",{className:"group/divider flex-shrink-0 self-stretch flex items-center justify-center w-3 cursor-col-resize select-none touch-none",onPointerDown:ta,onPointerMove:sa,onPointerUp:Ot,onPointerCancel:Ot,onDoubleClick:na,children:e.jsx("div",{className:"w-px h-full my-2 bg-edge-subtle/50 group-hover/divider:bg-sys-blue/50 group-active/divider:bg-sys-blue transition-colors"})}),e.jsx(go,{ref:Dt,channels:i,selectedConversation:u,unreadMap:Xt,messages:Qt,onSelect:P=>{be(P),window.innerWidth<768&&V(!1)},onAddChannel:()=>D(!0),onDeleteChannel:ha})]}),e.jsxs(bs,{noPadding:!0,radius:"sm",className:A("flex-1 flex-col min-w-0 overflow-hidden relative",W?"hidden md:flex":"flex"),children:[e.jsx(he,{children:_&&e.jsxs(ae.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:ne.fade,className:"flex items-center justify-center gap-2 px-3 py-1.5 bg-sys-red/10 border-b border-sys-red/20",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-sys-red flex-shrink-0"}),e.jsx("span",{className:"text-[11px] text-sys-red font-medium truncate",children:_})]},"error-banner")}),!W&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-edge-subtle md:hidden",children:[e.jsx("button",{onClick:()=>V(!0),className:"p-1 hover:bg-subtle-fill rounded transition-colors",children:e.jsx(ii,{className:"w-4 h-4 text-fg-secondary"})}),e.jsx("span",{className:"text-sm text-fg-primary font-medium truncate flex-1",children:ss}),u&&e.jsx("button",{onClick:()=>O(!0),className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:"Details",children:e.jsx(He,{className:"w-4 h-4 text-fg-muted"})})]}),e.jsxs("div",{className:"hidden md:flex items-center justify-between px-3 py-1.5 border-b border-edge-subtle",children:[e.jsx("span",{className:"text-sm text-fg-primary font-medium truncate",children:ss??"Select a conversation"}),e.jsx(he,{children:u&&e.jsx(ae.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ne.fade,onClick:()=>{window.innerWidth>=1280?T(P=>!P):O(!0)},className:"p-1 hover:bg-subtle-fill rounded transition-colors",title:w?"Hide detail panel":"Show details",children:w&&window.innerWidth>=1280?e.jsx(_s,{className:"w-4 h-4 text-fg-muted"}):e.jsx(He,{className:"w-4 h-4 text-fg-muted"})},"ctx-toggle")})]}),Na&&y?e.jsx(Nc,{contact:y,loginStatus:es,onLogin:gt}):e.jsxs(e.Fragment,{children:[e.jsx(gc,{messages:v,contacts:g,className:"flex-1 min-h-0",conversationKey:u?u.type==="channel"?`ch:${u.id}`:u.id:void 0,onRetry:la,onRetryAsFlood:ia,onMentionClick:ba,isLoading:d,historyLoading:M,historyExhausted:u?$.get(u.type==="channel"?`ch:${u.id}`:u.id)??!1:!0,onLoadOlder:u?()=>fa(u.type==="channel"?`ch:${u.id}`:u.id):void 0,channelName:(u==null?void 0:u.type)==="channel"?(rs=i.find(P=>String(P.index)===u.id))==null?void 0:rs.name:void 0,contactPubKey:(u==null?void 0:u.type)==="contact"?u.id:void 0}),u&&e.jsx(bc,{onSend:ja,disabled:!va,mentionNames:ya,placeholder:u.type==="channel"?`Message ${((ls=i.find(P=>String(P.index)===u.id))==null?void 0:ls.name)??"channel"}`:`Message ${((is=g.find(P=>P.public_key===u.id))==null?void 0:is.name)??"contact"}`})]})]}),e.jsx(ae.div,{initial:!1,animate:{width:w&&u?"var(--companion-context)":"0px",opacity:w&&u?1:0},transition:ne.layoutResize,className:"hidden xl:block flex-shrink-0 overflow-hidden",style:{pointerEvents:w&&u?"auto":"none"},children:u&&e.jsxs(bs,{neomorphic:!0,noPadding:!0,radius:"sm",className:"h-full relative",children:[e.jsx(he,{children:w&&e.jsx(ae.button,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:ne.fade,onClick:()=>T(!1),className:"absolute top-2 left-2 z-10 p-1 hover:bg-subtle-fill rounded-lg transition-colors",title:"Hide detail panel",children:e.jsx(_s,{className:"w-4 h-4 text-fg-muted"})},"ctx-close")}),e.jsx(Hs,{contact:u.type==="contact"?y:null,channel:u.type==="channel"?i.find(P=>String(P.index)===u.id)??null:null,contacts:g,selfPubKey:(o==null?void 0:o.public_key)??null,onResetPath:ft,onRequestStatus:Bt,onRequestTelemetry:Ht,onLoginToRepeater:gt,onLogoutFromRepeater:Wt,onGetNeighbours:Ut,onTraceContactPath:Kt,onDiscoverPath:qt,onExportContact:P=>{G(P),X(!0)},onSetContactPath:Jt})]})})]})}),e.jsx(Vs,{open:j,onClose:()=>C(!1),onRefresh:Vt}),e.jsx(Gc,{open:k,onClose:()=>F(!1),companionName:t??"companion",onImport:ma}),e.jsx(sd,{open:q,onClose:()=>{X(!1),G(null)},contacts:g,exportPubKey:L,onExport:pa,onImport:xa}),e.jsx(Yc,{open:N,onClose:()=>D(!1),channels:i,onAddChannel:da}),e.jsxs(ve,{open:z,onClose:()=>O(!1),size:"md",children:[e.jsx(Ee,{icon:(u==null?void 0:u.type)==="channel"?e.jsx(Fe,{className:"w-5 h-5"}):y&&(y.adv_type&15)===2?e.jsx(Be,{className:"w-5 h-5"}):e.jsx(fe,{className:"w-5 h-5"}),title:(u==null?void 0:u.type)==="channel"?((os=i.find(P=>String(P.index)===u.id))==null?void 0:os.name)??"Channel":(y==null?void 0:y.name)||"Contact Details",onClose:()=>O(!1)}),e.jsx(Ne,{className:"max-h-[70vh] overflow-y-auto",children:e.jsx(Hs,{embedded:!0,contact:(u==null?void 0:u.type)==="contact"?y:null,channel:(u==null?void 0:u.type)==="channel"?i.find(P=>String(P.index)===u.id)??null:null,contacts:g,selfPubKey:(o==null?void 0:o.public_key)??null,onResetPath:ft,onRequestStatus:Bt,onRequestTelemetry:Ht,onLoginToRepeater:gt,onLogoutFromRepeater:Wt,onGetNeighbours:Ut,onTraceContactPath:Kt,onDiscoverPath:qt,onExportContact:P=>{G(P),X(!0)},onSetContactPath:Jt})})]})]})}export{Wd as default}; diff --git a/frontend/dist/assets/CompanionEchoMap-UK4pMkKr.js b/frontend/dist/assets/CompanionEchoMap-Dx-5FVVv.js similarity index 94% rename from frontend/dist/assets/CompanionEchoMap-UK4pMkKr.js rename to frontend/dist/assets/CompanionEchoMap-Dx-5FVVv.js index 70f316a9..5a31a7bb 100644 --- a/frontend/dist/assets/CompanionEchoMap-UK4pMkKr.js +++ b/frontend/dist/assets/CompanionEchoMap-Dx-5FVVv.js @@ -1 +1 @@ -import{r as i,d4 as I,ad as K,$ as O,fZ as T,ax as D,cI as J,gj as q,Z as Q,Y as X,j as a,c as W,a2 as k}from"./index-CAHLMlrb.js";import{M as ee,B as te,a as R}from"./BasemapLayer-VyMOdkaO.js";import{S as ne,L as se}from"./layer-DnHLn7Jx.js";import{useSrcHashResolverMap as ae,useDiscoveredNodes as oe}from"./usePipelineStore-3uhIJZso.js";import{M as re}from"./map-pin-off-Dtf3D6QW.js";import{M as le}from"./monitor-smartphone-DMj7GqcL.js";import"./node-types-CcH5BFf0.js";const ie={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},A=X.amber,U=Q[400],Z=i.memo(function({prefix:c,name:o,isLocal:f,color:n}){const[r,u]=i.useState(!1);return a.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{pointerEvents:"auto"},children:a.jsxs(k,{color:n,filled:!0,className:W("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",r&&"relative z-50"),children:[f&&a.jsx(le,{className:"w-2.5 h-2.5 mr-0.5"}),c&&a.jsx("span",{className:"font-mono",children:c}),r&&o&&a.jsx("span",{className:c?"ml-0.5 opacity-75":"",children:o})]})})});function N(p,c){return p==null||c==null?!1:p!==0||c!==0}function ce(p,c,o){var u;const f=p.toUpperCase(),n=c.find(l=>l.public_key.toUpperCase().startsWith(f));if(n&&N(n.gps_lat,n.gps_lon))return{name:n.name||null,lat:n.gps_lat,lng:n.gps_lon,hasGps:!0};if(o.neighbors){const l=Object.entries(o.neighbors).find(([t])=>t.toUpperCase().startsWith(f));if(l){const[,t]=l;if(N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}const r=o.srcHashMap.get(f);if(r){const l=o.discoveredNodes.get(r);if(l&&N(l.latitude,l.longitude))return{name:l.name||null,lat:l.latitude,lng:l.longitude,hasGps:!0};if(o.neighbors){const t=o.neighbors[r];if(t&&N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}return{name:(n==null?void 0:n.name)||(r?((u=o.discoveredNodes.get(r))==null?void 0:u.name)??null:null),lat:0,lng:0,hasGps:!1}}function ue(p,c,o,f){const n=Math.floor(c/30);for(const r of[n-1,n,n+1])for(const[u,l]of o){const t=l.decoded;if(!(t!=null&&t.decrypted)||t.senderName!==f)continue;const v=t.timestamp??l.timestamp;if(Math.floor(v/30)===r&&t.text===p)return u}return null}function de(p,c){const o=new Set,f=[];for(const n of c){if(n.packet_hash!==p||n.packet_origin==="tx_local")continue;const r=n.original_path??n.forwarded_path;if(!r||r.length===0)continue;const u=r[r.length-1].toUpperCase();o.has(u)||(o.add(u),f.push({prefix:u,snr:n.snr}))}return f}function Me({text:p,timestamp:c,contacts:o,className:f}){const n=i.useRef(null),r=I(),u=K(),l=O(),[t,v]=i.useState(!1),m=T(),C=D(),z=u==null?void 0:u.neighbors,E=ae(),B=oe(),y=J(),h=q(),w=(m==null?void 0:m.node_name)??(h==null?void 0:h.node_name)??null,F=i.useMemo(()=>({neighbors:z,srcHashMap:E,discoveredNodes:B}),[z,E,B]),d=i.useMemo(()=>{const e=(m==null?void 0:m.node_name)||(h==null?void 0:h.node_name)||(h==null?void 0:h.companion_name)||"Me";return m&&N(m.latitude,m.longitude)?{prefix:m.public_key.slice(0,2).toUpperCase(),name:e,lat:m.latitude,lng:m.longitude}:y&&N(y.latitude,y.longitude)?{prefix:"",name:e,lat:y.latitude,lng:y.longitude}:null},[m,h,y]),L=i.useMemo(()=>w?ue(p,c,C,w):null,[p,c,C,w]),G=i.useMemo(()=>L?de(L,l):[],[L,l]),j=i.useMemo(()=>G.map(e=>{const s=ce(e.prefix,o,F);return{prefix:e.prefix,snr:e.snr,...s}}),[G,o,F]),M=i.useMemo(()=>j.filter(e=>e.hasGps),[j]),P=i.useMemo(()=>j.filter(e=>!e.hasGps),[j]),_=i.useMemo(()=>{if(!d||M.length===0)return[];const e=[d.lng,d.lat];return M.map(s=>{const g=[s.lng,s.lat];return{from:e,to:g,midpoint:[(e[0]+g[0])/2,(e[1]+g[1])/2]}})},[d,M]),Y=i.useMemo(()=>_.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[_]),$=i.useMemo(()=>{if(typeof document>"u")return{amber:A,zinc:U};const e=getComputedStyle(document.documentElement),s=e.getPropertyValue("--sys-amber").trim(),g=e.getPropertyValue("--zinc-400").trim();return{amber:s.startsWith("#")?s:A,zinc:g.startsWith("#")?g:U}},[]),x=i.useMemo(()=>{if(!d||M.length===0)return null;let e=d.lat,s=d.lat,g=d.lng,S=d.lng;for(const b of M)b.lats&&(s=b.lat),b.lngS&&(S=b.lng);return[[g,e],[S,s]]},[d,M]),V=i.useCallback(()=>{var s;const e=(s=n.current)==null?void 0:s.getMap();e&&x&&e.fitBounds(x,{padding:{top:40,bottom:44,left:56,right:56},maxZoom:14,duration:0}),v(!0)},[x]);if(!x||!d)return null;const H=[(x[0][0]+x[1][0])/2,(x[0][1]+x[1][1])/2];return a.jsxs("div",{className:W("relative rounded-lg overflow-hidden",f),style:{aspectRatio:"16 / 10"},children:[!t&&a.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:a.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),a.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:t?1:0},children:a.jsxs(ee,{ref:n,initialViewState:{longitude:H[0],latitude:H[1],zoom:10},onLoad:V,style:{height:"100%",width:"100%"},mapStyle:ie,attributionControl:!1,interactive:!1,children:[a.jsx(te,{mode:r}),_.map((e,s)=>a.jsx(ne,{id:`cecho-${s}`,type:"geojson",data:Y[s],lineMetrics:!0,children:a.jsx(se,{id:`cecho-line-${s}`,type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,$.amber,1,$.zinc]},layout:{"line-cap":"round","line-join":"round"}})},`cecho-${s}`)),a.jsx(R,{longitude:d.lng,latitude:d.lat,anchor:"center",children:a.jsx(Z,{prefix:d.prefix,name:d.name,isLocal:!0,color:"amber"})}),M.map((e,s)=>a.jsx(R,{longitude:e.lng,latitude:e.lat,anchor:"center",children:a.jsx(Z,{prefix:e.prefix,name:e.name,isLocal:!1,color:"zinc"})},`cecho-node-${e.prefix}-${s}`))]})}),P.length>0&&a.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:P.map((e,s)=>a.jsxs(k,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[a.jsx(re,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&a.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cecho-unmap-${e.prefix}-${s}`))}),a.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:a.jsxs(k,{color:"green",className:"type-data-xs shadow-sm",children:[j.length," echo",j.length!==1?"es":""]})})]})}export{Me as CompanionEchoMap}; +import{r as i,d4 as I,ad as K,$ as O,fZ as T,ax as D,cI as J,gj as q,Z as Q,Y as X,j as a,c as W,a2 as k}from"./index-CdntfUUz.js";import{M as ee,B as te,a as R}from"./BasemapLayer-U4r1eipM.js";import{S as ne,L as se}from"./layer-BRKnZ2f8.js";import{useSrcHashResolverMap as ae,useDiscoveredNodes as oe}from"./usePipelineStore-B9TPEPcv.js";import{M as re}from"./map-pin-off-DdXFAKLD.js";import{M as le}from"./monitor-smartphone-X03XrJWF.js";import"./node-types-rkAZo2WA.js";const ie={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},A=X.amber,U=Q[400],Z=i.memo(function({prefix:c,name:o,isLocal:f,color:n}){const[r,u]=i.useState(!1);return a.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),style:{pointerEvents:"auto"},children:a.jsxs(k,{color:n,filled:!0,className:W("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",r&&"relative z-50"),children:[f&&a.jsx(le,{className:"w-2.5 h-2.5 mr-0.5"}),c&&a.jsx("span",{className:"font-mono",children:c}),r&&o&&a.jsx("span",{className:c?"ml-0.5 opacity-75":"",children:o})]})})});function N(p,c){return p==null||c==null?!1:p!==0||c!==0}function ce(p,c,o){var u;const f=p.toUpperCase(),n=c.find(l=>l.public_key.toUpperCase().startsWith(f));if(n&&N(n.gps_lat,n.gps_lon))return{name:n.name||null,lat:n.gps_lat,lng:n.gps_lon,hasGps:!0};if(o.neighbors){const l=Object.entries(o.neighbors).find(([t])=>t.toUpperCase().startsWith(f));if(l){const[,t]=l;if(N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}const r=o.srcHashMap.get(f);if(r){const l=o.discoveredNodes.get(r);if(l&&N(l.latitude,l.longitude))return{name:l.name||null,lat:l.latitude,lng:l.longitude,hasGps:!0};if(o.neighbors){const t=o.neighbors[r];if(t&&N(t.latitude,t.longitude))return{name:t.node_name||t.name||null,lat:t.latitude,lng:t.longitude,hasGps:!0}}}return{name:(n==null?void 0:n.name)||(r?((u=o.discoveredNodes.get(r))==null?void 0:u.name)??null:null),lat:0,lng:0,hasGps:!1}}function ue(p,c,o,f){const n=Math.floor(c/30);for(const r of[n-1,n,n+1])for(const[u,l]of o){const t=l.decoded;if(!(t!=null&&t.decrypted)||t.senderName!==f)continue;const v=t.timestamp??l.timestamp;if(Math.floor(v/30)===r&&t.text===p)return u}return null}function de(p,c){const o=new Set,f=[];for(const n of c){if(n.packet_hash!==p||n.packet_origin==="tx_local")continue;const r=n.original_path??n.forwarded_path;if(!r||r.length===0)continue;const u=r[r.length-1].toUpperCase();o.has(u)||(o.add(u),f.push({prefix:u,snr:n.snr}))}return f}function Me({text:p,timestamp:c,contacts:o,className:f}){const n=i.useRef(null),r=I(),u=K(),l=O(),[t,v]=i.useState(!1),m=T(),C=D(),z=u==null?void 0:u.neighbors,E=ae(),B=oe(),y=J(),h=q(),w=(m==null?void 0:m.node_name)??(h==null?void 0:h.node_name)??null,F=i.useMemo(()=>({neighbors:z,srcHashMap:E,discoveredNodes:B}),[z,E,B]),d=i.useMemo(()=>{const e=(m==null?void 0:m.node_name)||(h==null?void 0:h.node_name)||(h==null?void 0:h.companion_name)||"Me";return m&&N(m.latitude,m.longitude)?{prefix:m.public_key.slice(0,2).toUpperCase(),name:e,lat:m.latitude,lng:m.longitude}:y&&N(y.latitude,y.longitude)?{prefix:"",name:e,lat:y.latitude,lng:y.longitude}:null},[m,h,y]),L=i.useMemo(()=>w?ue(p,c,C,w):null,[p,c,C,w]),G=i.useMemo(()=>L?de(L,l):[],[L,l]),j=i.useMemo(()=>G.map(e=>{const s=ce(e.prefix,o,F);return{prefix:e.prefix,snr:e.snr,...s}}),[G,o,F]),M=i.useMemo(()=>j.filter(e=>e.hasGps),[j]),P=i.useMemo(()=>j.filter(e=>!e.hasGps),[j]),_=i.useMemo(()=>{if(!d||M.length===0)return[];const e=[d.lng,d.lat];return M.map(s=>{const g=[s.lng,s.lat];return{from:e,to:g,midpoint:[(e[0]+g[0])/2,(e[1]+g[1])/2]}})},[d,M]),Y=i.useMemo(()=>_.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[_]),$=i.useMemo(()=>{if(typeof document>"u")return{amber:A,zinc:U};const e=getComputedStyle(document.documentElement),s=e.getPropertyValue("--sys-amber").trim(),g=e.getPropertyValue("--zinc-400").trim();return{amber:s.startsWith("#")?s:A,zinc:g.startsWith("#")?g:U}},[]),x=i.useMemo(()=>{if(!d||M.length===0)return null;let e=d.lat,s=d.lat,g=d.lng,S=d.lng;for(const b of M)b.lats&&(s=b.lat),b.lngS&&(S=b.lng);return[[g,e],[S,s]]},[d,M]),V=i.useCallback(()=>{var s;const e=(s=n.current)==null?void 0:s.getMap();e&&x&&e.fitBounds(x,{padding:{top:40,bottom:44,left:56,right:56},maxZoom:14,duration:0}),v(!0)},[x]);if(!x||!d)return null;const H=[(x[0][0]+x[1][0])/2,(x[0][1]+x[1][1])/2];return a.jsxs("div",{className:W("relative rounded-lg overflow-hidden",f),style:{aspectRatio:"16 / 10"},children:[!t&&a.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:a.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),a.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:t?1:0},children:a.jsxs(ee,{ref:n,initialViewState:{longitude:H[0],latitude:H[1],zoom:10},onLoad:V,style:{height:"100%",width:"100%"},mapStyle:ie,attributionControl:!1,interactive:!1,children:[a.jsx(te,{mode:r}),_.map((e,s)=>a.jsx(ne,{id:`cecho-${s}`,type:"geojson",data:Y[s],lineMetrics:!0,children:a.jsx(se,{id:`cecho-line-${s}`,type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,$.amber,1,$.zinc]},layout:{"line-cap":"round","line-join":"round"}})},`cecho-${s}`)),a.jsx(R,{longitude:d.lng,latitude:d.lat,anchor:"center",children:a.jsx(Z,{prefix:d.prefix,name:d.name,isLocal:!0,color:"amber"})}),M.map((e,s)=>a.jsx(R,{longitude:e.lng,latitude:e.lat,anchor:"center",children:a.jsx(Z,{prefix:e.prefix,name:e.name,isLocal:!1,color:"zinc"})},`cecho-node-${e.prefix}-${s}`))]})}),P.length>0&&a.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:P.map((e,s)=>a.jsxs(k,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[a.jsx(re,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&a.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cecho-unmap-${e.prefix}-${s}`))}),a.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:a.jsxs(k,{color:"green",className:"type-data-xs shadow-sm",children:[j.length," echo",j.length!==1?"es":""]})})]})}export{Me as CompanionEchoMap}; diff --git a/frontend/dist/assets/CompanionPathMap-ChNL_sj-.js b/frontend/dist/assets/CompanionPathMap-Cld9nrKm.js similarity index 96% rename from frontend/dist/assets/CompanionPathMap-ChNL_sj-.js rename to frontend/dist/assets/CompanionPathMap-Cld9nrKm.js index fca358d7..ba8b787f 100644 --- a/frontend/dist/assets/CompanionPathMap-ChNL_sj-.js +++ b/frontend/dist/assets/CompanionPathMap-Cld9nrKm.js @@ -1 +1 @@ -import{r as a,d4 as Le,ad as Re,cI as Ce,gj as ke,Z as me,Y as U,j as t,c as J,bO as Ee,dY as Pe,dG as Fe,a2 as V}from"./index-CAHLMlrb.js";import{M as Ge,B as _e,a as B}from"./BasemapLayer-VyMOdkaO.js";import{S as _,L as H}from"./layer-DnHLn7Jx.js";import{useSrcHashResolverMap as He,useDiscoveredNodes as Oe}from"./usePipelineStore-3uhIJZso.js";import{g as Ae,u as ze,l as Be,a as We,m as $e,c as Ie,j as Ye,k as De,p as Ke,r as Te,e as E,R as Je}from"./useReplayTick-Cnehmp7d.js";import{C as ue}from"./car-DRknVB1N.js";import{M as Ve}from"./map-pin-off-Dtf3D6QW.js";import{M as Ue}from"./monitor-smartphone-DMj7GqcL.js";import"./node-types-CcH5BFf0.js";import"./payload-detail-CniY19rz.js";const Ze={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},Xe=me[500],de=U.orange,pe=U.green,W=U.blue,T={type:"FeatureCollection",features:[]},qe=a.memo(function({prefix:s,name:r,isLocal:p,color:f}){const[c,h]=a.useState(!1);return t.jsx("div",{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{pointerEvents:"auto"},children:t.jsxs(V,{color:f,filled:!0,className:J("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",c&&"relative z-50"),children:[p&&t.jsx(Ue,{className:"w-2.5 h-2.5 mr-0.5"}),s&&t.jsx("span",{className:"font-mono",children:s}),c&&r&&t.jsx("span",{className:s?"ml-0.5 opacity-75":"",children:r})]})})});function R(l,s){return Number.isFinite(s)&&Number.isFinite(l)&&s>=-90&&s<=90&&l>=-180&&l<=180}function P(l,s){return l==null||s==null?!1:R(s,l)&&(l!==0||s!==0)}function Qe(l,s,r){var f;const p=[];for(const c of l){const h=c.toUpperCase(),d=s.find(m=>m.public_key.toUpperCase().startsWith(h));if(d&&P(d.gps_lat,d.gps_lon)){p.push({prefix:c,name:d.name||null,lat:d.gps_lat,lng:d.gps_lon,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const m=Object.entries(r.neighbors).find(([i])=>i.toUpperCase().startsWith(h));if(m){const[,i]=m;if(P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}const N=r.srcHashMap.get(h);if(N){const m=r.discoveredNodes.get(N);if(m&&P(m.latitude,m.longitude)){p.push({prefix:c,name:m.name||null,lat:m.latitude,lng:m.longitude,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const i=r.neighbors[N];if(i&&P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}p.push({prefix:c,name:(d==null?void 0:d.name)||(N?((f=r.discoveredNodes.get(N))==null?void 0:f.name)??null:null),lat:0,lng:0,isLocal:!1,hasGps:!1})}return p}function et(l,s,r,p){const f=(s==null?void 0:s.node_name)||p||(r==null?void 0:r.name)||"Me";if(s&&P(s.latitude,s.longitude)){const c=s.public_key.slice(0,2).toUpperCase();return[...l,{prefix:c,name:f,lat:s.latitude,lng:s.longitude,isLocal:!0,hasGps:!0}]}return r&&P(r.latitude,r.longitude)?[...l,{prefix:"",name:f,lat:r.latitude,lng:r.longitude,isLocal:!0,hasGps:!0}]:l}function dt({hops:l,contacts:s,selfInfo:r,snr:p,wardriveCoords:f,wardriveSenderName:c,channelMessages:h,messageTimestamp:d,className:N}){const m=a.useRef(null),i=Le(),$=Re(),[Z,ge]=a.useState(!1),X=$==null?void 0:$.neighbors,q=He(),Q=Oe(),ee=Ce(),C=ke(),te=a.useMemo(()=>({neighbors:X,srcHashMap:q,discoveredNodes:Q}),[X,q,Q]),F=a.useMemo(()=>{if(!(h!=null&&h.length)||!c||!d)return[];const e=Ae(h),n=d-86400;return e.filter(o=>o.senderName===c&&o.timestampS>=n&&o.timestampS<=d)},[h,c,d]),I=F.length>=2,G=a.useMemo(()=>`${c??"x"}-${d??0}`,[c,d]),fe=ze(),he=Be(),ne=We(),v=$e(),ye=Ie(),y=Ye();De();const g=fe&&he===G,Y=g&&y.length>0?Math.round(Math.max(0,Math.min(y.length-1,v))):-1,se=a.useMemo(()=>{var e;return Y>=0?((e=y[Y])==null?void 0:e.pathHops)??l:l},[Y,y,l]),oe=(C==null?void 0:C.node_name)??(C==null?void 0:C.companion_name)??null,j=a.useMemo(()=>{const e=Qe(se,s,te);return et(e,r,ee,oe)},[se,s,te,r,ee,oe]),x=a.useMemo(()=>j.filter(e=>e.hasGps),[j]),ae=a.useMemo(()=>j.filter(e=>!e.hasGps),[j]),b=a.useMemo(()=>f&&R(f.lon,f.lat)?f:null,[f]),O=a.useMemo(()=>{const e=[];if(x.length<2)return e;const n=[];for(let o=0;oO.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[O]),re=a.useMemo(()=>{if(typeof document>"u")return Xe;const e=getComputedStyle(document.documentElement).getPropertyValue("--zinc-400").trim();return e.startsWith("#")?e:me[400]},[]),A=a.useMemo(()=>{if(!b||x.length===0)return null;const e=[b.lon,b.lat],n=x[0];return{from:e,to:[n.lng,n.lat]}},[b,x]),le=a.useMemo(()=>A?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[A.from,A.to]}}]}:null,[A]),ie=a.useMemo(()=>{if(typeof document>"u")return{orange:de,green:pe};const e=getComputedStyle(document.documentElement),n=e.getPropertyValue("--sys-orange").trim(),o=e.getPropertyValue("--sys-green").trim();return{orange:n.startsWith("#")?n:de,green:o.startsWith("#")?o:pe}},[]),k=a.useMemo(()=>{if(!g)return null;const e=Ke(y,v);return e&&R(e.lon,e.lat)?e:null},[g,y,v]),be=a.useMemo(()=>{if(!g)return T;const e=Te(y,v).filter(([n,o])=>R(n,o));return e.length<2?T:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}]}},[g,y,v]),je=a.useMemo(()=>!g||y.length===0?T:{type:"FeatureCollection",features:y.filter(e=>R(e.lon,e.lat)).map((e,n)=>({type:"Feature",properties:{index:n},geometry:{type:"Point",coordinates:[e.lon,e.lat]}}))},[g,y]);a.useEffect(()=>()=>{const e=E.getState();e.ownerKey===G&&e.stopRewind()},[G]);const we=y.length,z=Math.max(0,we-1),Ne=z>0?v/z:1,ve=Math.round(z-v),w=a.useMemo(()=>{const e=[];for(const u of x)R(u.lng,u.lat)&&e.push([u.lng,u.lat]);b&&e.push([b.lon,b.lat]);for(const u of F)R(u.lon,u.lat)&&e.push([u.lon,u.lat]);if(e.length<2)return null;let n=1/0,o=-1/0,S=1/0,M=-1/0;for(const[u,L]of e)Lo&&(o=L),uM&&(M=u);return[[S,n],[M,o]]},[x,b,F]),Se=a.useCallback(()=>{E.getState().stopRewind()},[]),Me=a.useCallback(()=>{var e;try{const n=(e=m.current)==null?void 0:e.getMap();n&&w&&n.fitBounds(w,{padding:{top:40,bottom:I?52:44,left:56,right:56},maxZoom:14,duration:0})}catch(n){console.warn("[CompanionPathMap] Failed to fit wardrive/path bounds:",n)}finally{ge(!0)}I&&E.getState().startRewind(F,G)},[w,I,F,G]);if(!w)return null;const ce=[(w[0][0]+w[1][0])/2,(w[0][1]+w[1][1])/2];return t.jsxs("div",{className:J("relative rounded-lg overflow-hidden",N),style:{aspectRatio:"16 / 10"},children:[!Z&&t.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:t.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:Z?1:0},children:t.jsxs(Ge,{ref:m,initialViewState:{longitude:ce[0],latitude:ce[1],zoom:10},onLoad:Me,style:{height:"100%",width:"100%"},mapStyle:Ze,attributionControl:!1,interactive:g,children:[t.jsx(_e,{mode:i}),le&&!g&&t.jsx(_,{id:"cwd-edge",type:"geojson",data:le,lineMetrics:!0,children:t.jsx(H,{id:"cwd-edge-line",type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,ie.orange,1,ie.green]},layout:{"line-cap":"round","line-join":"round"}})}),b&&!g&&t.jsx(B,{longitude:b.lon,latitude:b.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center",style:{pointerEvents:"auto"},children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(ue,{className:"w-4 h-4",strokeWidth:2.5})})})}),O.map((e,n)=>t.jsx(_,{id:`cedge-${n}`,type:"geojson",data:xe[n],children:t.jsx(H,{id:`cedge-line-${n}`,type:"line",paint:{"line-color":re,"line-width":2,"line-opacity":.85},layout:{"line-cap":"round","line-join":"round"}})},`cedge-${n}`)),O.map((e,n)=>t.jsx(B,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx("span",{className:"w-4.5 h-4.5 rounded-full flex items-center justify-center font-mono font-extrabold tabular-nums shadow-md pointer-events-none",style:{backgroundColor:re,color:"#fff",fontSize:"10px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:e.hopNumber})},`chop-${n}`)),x.map((e,n)=>{const o=n===0,S=n===x.length-1,M=e.isLocal?"amber":o?"green":S?"amber":"zinc";return t.jsx(B,{longitude:e.lng,latitude:e.lat,anchor:"center",children:t.jsx(qe,{prefix:e.prefix,name:e.name,isLocal:e.isLocal,color:M})},`cnode-${e.prefix}-${n}`)}),g&&t.jsxs(t.Fragment,{children:[t.jsx(_,{id:"replay-dots",type:"geojson",data:je,children:t.jsx(H,{id:"replay-dots-circle",type:"circle",paint:{"circle-radius":3,"circle-color":W,"circle-opacity":.35,"circle-stroke-width":1,"circle-stroke-color":W,"circle-stroke-opacity":.15}})}),t.jsx(_,{id:"replay-trail",type:"geojson",data:be,children:t.jsx(H,{id:"replay-trail-line",type:"line",paint:{"line-color":W,"line-width":3,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"}})}),k&&x.length>0&&t.jsx(_,{id:"replay-path-link",type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[[k.lon,k.lat],[x[0].lng,x[0].lat]]}}]},children:t.jsx(H,{id:"replay-path-link-line",type:"line",paint:{"line-color":W,"line-width":1.5,"line-opacity":.5,"line-dasharray":[3,2]},layout:{"line-cap":"round"}})}),k&&t.jsx(B,{longitude:k.lon,latitude:k.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(ue,{className:"w-4 h-4",strokeWidth:2.5})})})]})]})}),g&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 right-1.5 z-10",onClick:e=>e.stopPropagation(),children:t.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 rounded-md bg-body/90 backdrop-blur-sm border border-edge-subtle shadow-lg",children:[t.jsx("button",{onClick:Se,className:"p-0.5 rounded text-fg-muted hover:text-fg-primary transition-colors shrink-0",title:"Stop rewind",children:t.jsx(Ee,{className:"w-3 h-3"})}),t.jsx("button",{onClick:()=>E.getState().togglePlay(),className:"p-1 rounded-full bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 transition-colors shrink-0",title:ne?"Pause":"Rewind",children:ne?t.jsx(Pe,{className:"w-3 h-3"}):t.jsx(Fe,{className:"w-3 h-3"})}),t.jsx("input",{type:"range",min:0,max:100,step:.1,value:Ne*100,onChange:e=>{const n=parseFloat(e.target.value)/100;E.getState().seek(n)},className:"flex-1 min-w-0 h-1 appearance-none bg-edge-subtle rounded-full cursor-pointer accent-sys-blue"}),t.jsxs("span",{className:"text-[9px] tabular-nums text-fg-muted whitespace-nowrap shrink-0",children:[ve,"/",z," pkts"]}),t.jsx("div",{className:"flex items-center gap-px shrink-0",children:Je.map(e=>t.jsxs("button",{onClick:()=>E.getState().setSpeed(e),className:J("px-1 py-0.5 rounded text-[9px] font-medium transition-colors",e===ye?"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary"),children:[e,"×"]},e))})]})}),!g&&ae.length>0&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:ae.map((e,n)=>t.jsxs(V,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[t.jsx(Ve,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&t.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cunmap-${e.prefix}-${n}`))}),!g&&p!=null&&t.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:t.jsxs(V,{color:"zinc",className:"type-data-xs shadow-sm",children:[p>0?"+":"",p.toFixed(1)," dB"]})})]})}export{dt as CompanionPathMap}; +import{r as a,d4 as Le,ad as Re,cI as Ce,gj as ke,Z as me,Y as U,j as t,c as J,bO as Ee,dY as Pe,dG as Fe,a2 as V}from"./index-CdntfUUz.js";import{M as Ge,B as _e,a as B}from"./BasemapLayer-U4r1eipM.js";import{S as _,L as H}from"./layer-BRKnZ2f8.js";import{useSrcHashResolverMap as He,useDiscoveredNodes as Oe}from"./usePipelineStore-B9TPEPcv.js";import{g as Ae,u as ze,l as Be,a as We,m as $e,c as Ie,j as Ye,k as De,p as Ke,r as Te,e as E,R as Je}from"./useReplayTick-C7ZhPZyZ.js";import{C as ue}from"./car-B1uDaAVL.js";import{M as Ve}from"./map-pin-off-DdXFAKLD.js";import{M as Ue}from"./monitor-smartphone-X03XrJWF.js";import"./node-types-rkAZo2WA.js";import"./payload-detail-D7dyXv-d.js";const Ze={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},Xe=me[500],de=U.orange,pe=U.green,W=U.blue,T={type:"FeatureCollection",features:[]},qe=a.memo(function({prefix:s,name:r,isLocal:p,color:f}){const[c,h]=a.useState(!1);return t.jsx("div",{onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{pointerEvents:"auto"},children:t.jsxs(V,{color:f,filled:!0,className:J("type-data-xs shadow-lg border border-current/30 transition-all duration-150 cursor-default",c&&"relative z-50"),children:[p&&t.jsx(Ue,{className:"w-2.5 h-2.5 mr-0.5"}),s&&t.jsx("span",{className:"font-mono",children:s}),c&&r&&t.jsx("span",{className:s?"ml-0.5 opacity-75":"",children:r})]})})});function R(l,s){return Number.isFinite(s)&&Number.isFinite(l)&&s>=-90&&s<=90&&l>=-180&&l<=180}function P(l,s){return l==null||s==null?!1:R(s,l)&&(l!==0||s!==0)}function Qe(l,s,r){var f;const p=[];for(const c of l){const h=c.toUpperCase(),d=s.find(m=>m.public_key.toUpperCase().startsWith(h));if(d&&P(d.gps_lat,d.gps_lon)){p.push({prefix:c,name:d.name||null,lat:d.gps_lat,lng:d.gps_lon,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const m=Object.entries(r.neighbors).find(([i])=>i.toUpperCase().startsWith(h));if(m){const[,i]=m;if(P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}const N=r.srcHashMap.get(h);if(N){const m=r.discoveredNodes.get(N);if(m&&P(m.latitude,m.longitude)){p.push({prefix:c,name:m.name||null,lat:m.latitude,lng:m.longitude,isLocal:!1,hasGps:!0});continue}if(r.neighbors){const i=r.neighbors[N];if(i&&P(i.latitude,i.longitude)){p.push({prefix:c,name:i.node_name||i.name||null,lat:i.latitude,lng:i.longitude,isLocal:!1,hasGps:!0});continue}}}p.push({prefix:c,name:(d==null?void 0:d.name)||(N?((f=r.discoveredNodes.get(N))==null?void 0:f.name)??null:null),lat:0,lng:0,isLocal:!1,hasGps:!1})}return p}function et(l,s,r,p){const f=(s==null?void 0:s.node_name)||p||(r==null?void 0:r.name)||"Me";if(s&&P(s.latitude,s.longitude)){const c=s.public_key.slice(0,2).toUpperCase();return[...l,{prefix:c,name:f,lat:s.latitude,lng:s.longitude,isLocal:!0,hasGps:!0}]}return r&&P(r.latitude,r.longitude)?[...l,{prefix:"",name:f,lat:r.latitude,lng:r.longitude,isLocal:!0,hasGps:!0}]:l}function dt({hops:l,contacts:s,selfInfo:r,snr:p,wardriveCoords:f,wardriveSenderName:c,channelMessages:h,messageTimestamp:d,className:N}){const m=a.useRef(null),i=Le(),$=Re(),[Z,ge]=a.useState(!1),X=$==null?void 0:$.neighbors,q=He(),Q=Oe(),ee=Ce(),C=ke(),te=a.useMemo(()=>({neighbors:X,srcHashMap:q,discoveredNodes:Q}),[X,q,Q]),F=a.useMemo(()=>{if(!(h!=null&&h.length)||!c||!d)return[];const e=Ae(h),n=d-86400;return e.filter(o=>o.senderName===c&&o.timestampS>=n&&o.timestampS<=d)},[h,c,d]),I=F.length>=2,G=a.useMemo(()=>`${c??"x"}-${d??0}`,[c,d]),fe=ze(),he=Be(),ne=We(),v=$e(),ye=Ie(),y=Ye();De();const g=fe&&he===G,Y=g&&y.length>0?Math.round(Math.max(0,Math.min(y.length-1,v))):-1,se=a.useMemo(()=>{var e;return Y>=0?((e=y[Y])==null?void 0:e.pathHops)??l:l},[Y,y,l]),oe=(C==null?void 0:C.node_name)??(C==null?void 0:C.companion_name)??null,j=a.useMemo(()=>{const e=Qe(se,s,te);return et(e,r,ee,oe)},[se,s,te,r,ee,oe]),x=a.useMemo(()=>j.filter(e=>e.hasGps),[j]),ae=a.useMemo(()=>j.filter(e=>!e.hasGps),[j]),b=a.useMemo(()=>f&&R(f.lon,f.lat)?f:null,[f]),O=a.useMemo(()=>{const e=[];if(x.length<2)return e;const n=[];for(let o=0;oO.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[O]),re=a.useMemo(()=>{if(typeof document>"u")return Xe;const e=getComputedStyle(document.documentElement).getPropertyValue("--zinc-400").trim();return e.startsWith("#")?e:me[400]},[]),A=a.useMemo(()=>{if(!b||x.length===0)return null;const e=[b.lon,b.lat],n=x[0];return{from:e,to:[n.lng,n.lat]}},[b,x]),le=a.useMemo(()=>A?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[A.from,A.to]}}]}:null,[A]),ie=a.useMemo(()=>{if(typeof document>"u")return{orange:de,green:pe};const e=getComputedStyle(document.documentElement),n=e.getPropertyValue("--sys-orange").trim(),o=e.getPropertyValue("--sys-green").trim();return{orange:n.startsWith("#")?n:de,green:o.startsWith("#")?o:pe}},[]),k=a.useMemo(()=>{if(!g)return null;const e=Ke(y,v);return e&&R(e.lon,e.lat)?e:null},[g,y,v]),be=a.useMemo(()=>{if(!g)return T;const e=Te(y,v).filter(([n,o])=>R(n,o));return e.length<2?T:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:e}}]}},[g,y,v]),je=a.useMemo(()=>!g||y.length===0?T:{type:"FeatureCollection",features:y.filter(e=>R(e.lon,e.lat)).map((e,n)=>({type:"Feature",properties:{index:n},geometry:{type:"Point",coordinates:[e.lon,e.lat]}}))},[g,y]);a.useEffect(()=>()=>{const e=E.getState();e.ownerKey===G&&e.stopRewind()},[G]);const we=y.length,z=Math.max(0,we-1),Ne=z>0?v/z:1,ve=Math.round(z-v),w=a.useMemo(()=>{const e=[];for(const u of x)R(u.lng,u.lat)&&e.push([u.lng,u.lat]);b&&e.push([b.lon,b.lat]);for(const u of F)R(u.lon,u.lat)&&e.push([u.lon,u.lat]);if(e.length<2)return null;let n=1/0,o=-1/0,S=1/0,M=-1/0;for(const[u,L]of e)Lo&&(o=L),uM&&(M=u);return[[S,n],[M,o]]},[x,b,F]),Se=a.useCallback(()=>{E.getState().stopRewind()},[]),Me=a.useCallback(()=>{var e;try{const n=(e=m.current)==null?void 0:e.getMap();n&&w&&n.fitBounds(w,{padding:{top:40,bottom:I?52:44,left:56,right:56},maxZoom:14,duration:0})}catch(n){console.warn("[CompanionPathMap] Failed to fit wardrive/path bounds:",n)}finally{ge(!0)}I&&E.getState().startRewind(F,G)},[w,I,F,G]);if(!w)return null;const ce=[(w[0][0]+w[1][0])/2,(w[0][1]+w[1][1])/2];return t.jsxs("div",{className:J("relative rounded-lg overflow-hidden",N),style:{aspectRatio:"16 / 10"},children:[!Z&&t.jsx("div",{className:"absolute inset-0 bg-subtle-fill flex items-center justify-center pointer-events-none z-10",children:t.jsx("div",{className:"w-4 h-4 border-2 border-fg-muted/30 border-t-fg-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-200",style:{opacity:Z?1:0},children:t.jsxs(Ge,{ref:m,initialViewState:{longitude:ce[0],latitude:ce[1],zoom:10},onLoad:Me,style:{height:"100%",width:"100%"},mapStyle:Ze,attributionControl:!1,interactive:g,children:[t.jsx(_e,{mode:i}),le&&!g&&t.jsx(_,{id:"cwd-edge",type:"geojson",data:le,lineMetrics:!0,children:t.jsx(H,{id:"cwd-edge-line",type:"line",paint:{"line-width":2,"line-gradient":["interpolate",["linear"],["line-progress"],0,ie.orange,1,ie.green]},layout:{"line-cap":"round","line-join":"round"}})}),b&&!g&&t.jsx(B,{longitude:b.lon,latitude:b.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center",style:{pointerEvents:"auto"},children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(ue,{className:"w-4 h-4",strokeWidth:2.5})})})}),O.map((e,n)=>t.jsx(_,{id:`cedge-${n}`,type:"geojson",data:xe[n],children:t.jsx(H,{id:`cedge-line-${n}`,type:"line",paint:{"line-color":re,"line-width":2,"line-opacity":.85},layout:{"line-cap":"round","line-join":"round"}})},`cedge-${n}`)),O.map((e,n)=>t.jsx(B,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx("span",{className:"w-4.5 h-4.5 rounded-full flex items-center justify-center font-mono font-extrabold tabular-nums shadow-md pointer-events-none",style:{backgroundColor:re,color:"#fff",fontSize:"10px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:e.hopNumber})},`chop-${n}`)),x.map((e,n)=>{const o=n===0,S=n===x.length-1,M=e.isLocal?"amber":o?"green":S?"amber":"zinc";return t.jsx(B,{longitude:e.lng,latitude:e.lat,anchor:"center",children:t.jsx(qe,{prefix:e.prefix,name:e.name,isLocal:e.isLocal,color:M})},`cnode-${e.prefix}-${n}`)}),g&&t.jsxs(t.Fragment,{children:[t.jsx(_,{id:"replay-dots",type:"geojson",data:je,children:t.jsx(H,{id:"replay-dots-circle",type:"circle",paint:{"circle-radius":3,"circle-color":W,"circle-opacity":.35,"circle-stroke-width":1,"circle-stroke-color":W,"circle-stroke-opacity":.15}})}),t.jsx(_,{id:"replay-trail",type:"geojson",data:be,children:t.jsx(H,{id:"replay-trail-line",type:"line",paint:{"line-color":W,"line-width":3,"line-opacity":.7},layout:{"line-cap":"round","line-join":"round"}})}),k&&x.length>0&&t.jsx(_,{id:"replay-path-link",type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[[k.lon,k.lat],[x[0].lng,x[0].lat]]}}]},children:t.jsx(H,{id:"replay-path-link-line",type:"line",paint:{"line-color":W,"line-width":1.5,"line-opacity":.5,"line-dasharray":[3,2]},layout:{"line-cap":"round"}})}),k&&t.jsx(B,{longitude:k.lon,latitude:k.lat,anchor:"center",children:t.jsx("div",{className:"flex items-center justify-center w-7 h-7 rounded-full bg-sys-orange text-white shadow-lg border-2 border-sys-orange/50",children:t.jsx(ue,{className:"w-4 h-4",strokeWidth:2.5})})})]})]})}),g&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 right-1.5 z-10",onClick:e=>e.stopPropagation(),children:t.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 rounded-md bg-body/90 backdrop-blur-sm border border-edge-subtle shadow-lg",children:[t.jsx("button",{onClick:Se,className:"p-0.5 rounded text-fg-muted hover:text-fg-primary transition-colors shrink-0",title:"Stop rewind",children:t.jsx(Ee,{className:"w-3 h-3"})}),t.jsx("button",{onClick:()=>E.getState().togglePlay(),className:"p-1 rounded-full bg-sys-blue/20 text-sys-blue hover:bg-sys-blue/30 transition-colors shrink-0",title:ne?"Pause":"Rewind",children:ne?t.jsx(Pe,{className:"w-3 h-3"}):t.jsx(Fe,{className:"w-3 h-3"})}),t.jsx("input",{type:"range",min:0,max:100,step:.1,value:Ne*100,onChange:e=>{const n=parseFloat(e.target.value)/100;E.getState().seek(n)},className:"flex-1 min-w-0 h-1 appearance-none bg-edge-subtle rounded-full cursor-pointer accent-sys-blue"}),t.jsxs("span",{className:"text-[9px] tabular-nums text-fg-muted whitespace-nowrap shrink-0",children:[ve,"/",z," pkts"]}),t.jsx("div",{className:"flex items-center gap-px shrink-0",children:Je.map(e=>t.jsxs("button",{onClick:()=>E.getState().setSpeed(e),className:J("px-1 py-0.5 rounded text-[9px] font-medium transition-colors",e===ye?"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary"),children:[e,"×"]},e))})]})}),!g&&ae.length>0&&t.jsx("div",{className:"absolute bottom-1.5 left-1.5 z-10 flex items-center gap-1 flex-wrap max-w-[60%]",children:ae.map((e,n)=>t.jsxs(V,{color:"zinc",className:"type-data-xs shadow-sm opacity-70",children:[t.jsx(Ve,{className:"w-2 h-2 mr-0.5"}),e.prefix,e.name&&t.jsx("span",{className:"ml-0.5 opacity-60",children:e.name})]},`cunmap-${e.prefix}-${n}`))}),!g&&p!=null&&t.jsx("div",{className:"absolute bottom-1.5 right-1.5 z-10",children:t.jsxs(V,{color:"zinc",className:"type-data-xs shadow-sm",children:[p>0?"+":"",p.toFixed(1)," dB"]})})]})}export{dt as CompanionPathMap}; diff --git a/frontend/dist/assets/Configuration-DfbJ8nZk.js b/frontend/dist/assets/Configuration-aUhduX2Z.js similarity index 98% rename from frontend/dist/assets/Configuration-DfbJ8nZk.js rename to frontend/dist/assets/Configuration-aUhduX2Z.js index bd1ba2f5..a9adf512 100644 --- a/frontend/dist/assets/Configuration-DfbJ8nZk.js +++ b/frontend/dist/assets/Configuration-aUhduX2Z.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{e as xe,dy as Ve,dz as Dt,dA as Mt,r as a,eF as fs,eG as cs,j as e,c as N,_ as Me,ae as pe,H as At,S as It,eH as Lt,f as B,bO as Ke,a9 as X,a7 as _e,cY as ke,cB as ps,eI as Ot,B as E,a2 as ds,eJ as Gs,aE as nt,b_ as Oe,a4 as lt,eK as zt,ad as Kt,z as xs,aD as Js,c8 as Vt,cb as us,cL as rt,dD as ot,eL as Z,eM as Ae,cz as Ht,dB as $t,dE as Ut,dF as Bt,eN as qt,N as Ws,eO as Gt,cA as Jt,eP as Xs,eQ as Wt,eR as Xt,eS as Yt,R as Zt,eT as me,I as Qt,a8 as ea,aa as sa}from"./index-CAHLMlrb.js";import{g as ta,a as aa,s as na,c as la,u as ra,d as oa}from"./transport--H030bEh.js";import{c as ia,r as ca}from"./system-CNkSqdfb.js";import{C as da}from"./ConfirmModal-CNagQaWr.js";import{S as ua,A as ma,a as fa,N as pa}from"./AutoConfigureDialog-BAQ5UEr_.js";import{S as k,a as Ie}from"./setting-field-YD-YARg4.js";import{i as xa,g as ha,s as ya,a as ga,k as ba}from"./keycap-sfx-ByZp-njj.js";import{C as q,P as ja,a as va,B as Na}from"./PageLayout-CgrNSpBT.js";import{T as it}from"./trash-2-ChI2Sf6Z.js";import{P as wa}from"./pencil--wb87xjW.js";import{R as ct}from"./rotate-ccw-Cav5SApM.js";import{W as _a}from"./wand-sparkles-C18LiNtQ.js";import{S as ka}from"./shield-CxlpbCLH.js";import{R as Sa}from"./repeat-Dv_JF6au.js";import{G as Ca}from"./git-branch-BIN5tJ3h.js";import{C as Ta}from"./clock-DB7tKCHV.js";import{C as dt}from"./WorkspaceNav-ClxMgBhr.js";import{R as ms,F as Ys}from"./radio-group-DyBWNwhI.js";import{R as W,C as se}from"./Grid-B0tNiHTX.js";import{A as Fa}from"./antenna-CpeQ5t_a.js";import{P as Zs}from"./plus-Be4DsW2a.js";import{K as as}from"./key-round-CZ_hGBwN.js";import"./monitor-smartphone-DMj7GqcL.js";import"./arrow-right-C5Fuejc9.js";import"./use-by-comparator-JYMD8MzS.js";/** +import{e as xe,dy as Ve,dz as Dt,dA as Mt,r as a,eF as fs,eG as cs,j as e,c as N,_ as Me,ae as pe,H as At,S as It,eH as Lt,f as B,bO as Ke,a9 as X,a7 as _e,cY as ke,cB as ps,eI as Ot,B as E,a2 as ds,eJ as Gs,aE as nt,b_ as Oe,a4 as lt,eK as zt,ad as Kt,z as xs,aD as Js,c8 as Vt,cb as us,cL as rt,dD as ot,eL as Z,eM as Ae,cz as Ht,dB as $t,dE as Ut,dF as Bt,eN as qt,N as Ws,eO as Gt,cA as Jt,eP as Xs,eQ as Wt,eR as Xt,eS as Yt,R as Zt,eT as me,I as Qt,a8 as ea,aa as sa}from"./index-CdntfUUz.js";import{g as ta,a as aa,s as na,c as la,u as ra,d as oa}from"./transport-DmJP2zwT.js";import{c as ia,r as ca}from"./system-MCOv6vDg.js";import{C as da}from"./ConfirmModal-CB8xdBeW.js";import{S as ua,A as ma,a as fa,N as pa}from"./AutoConfigureDialog-I0jHfgv3.js";import{S as k,a as Ie}from"./setting-field-BzKIre35.js";import{i as xa,g as ha,s as ya,a as ga,k as ba}from"./keycap-sfx-ByZp-njj.js";import{C as q,P as ja,a as va,B as Na}from"./PageLayout-B2kQpvXM.js";import{T as it}from"./trash-2-Ym16rcs6.js";import{P as wa}from"./pencil-DwKQKROy.js";import{R as ct}from"./rotate-ccw-DyxXzFWc.js";import{W as _a}from"./wand-sparkles-By2ieoA5.js";import{S as ka}from"./shield-CNxoSMJk.js";import{R as Sa}from"./repeat-CYHoMir3.js";import{G as Ca}from"./git-branch-BfTP80e2.js";import{C as Ta}from"./clock-DKukpMjT.js";import{C as dt}from"./WorkspaceNav-BZrtCI1_.js";import{R as ms,F as Ys}from"./radio-group-CSvEyiPf.js";import{R as W,C as se}from"./Grid-DYtN9_Hv.js";import{A as Fa}from"./antenna-BUervkWx.js";import{P as Zs}from"./plus-BHawoJ76.js";import{K as as}from"./key-round-Cn-7B-WZ.js";import"./monitor-smartphone-X03XrJWF.js";import"./arrow-right-DDhVPQqL.js";import"./use-by-comparator-Dgy5yCaL.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ConfirmModal-CNagQaWr.js b/frontend/dist/assets/ConfirmModal-CB8xdBeW.js similarity index 91% rename from frontend/dist/assets/ConfirmModal-CNagQaWr.js rename to frontend/dist/assets/ConfirmModal-CB8xdBeW.js index a7f11dbe..ce58c7b6 100644 --- a/frontend/dist/assets/ConfirmModal-CNagQaWr.js +++ b/frontend/dist/assets/ConfirmModal-CB8xdBeW.js @@ -1 +1 @@ -import{r as d,j as s,aB as x,aL as m,b_ as g,c as C,aC as f,eU as j,B as o}from"./index-CAHLMlrb.js";const u={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},p={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:a="default",onConfirm:c,onCancel:e}){return s.jsxs(x,{open:n,onClose:e,size:"sm",children:[s.jsx(m,{icon:s.jsx(g,{className:C("w-5 h-5",u[a])}),title:r,onClose:e}),s.jsx(f,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(j,{children:[s.jsx(o,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(o,{color:p[a],onClick:c,className:"flex-1",children:t})]})]})}const y=d.memo(N);export{y as C}; +import{r as d,j as s,aB as x,aL as m,b_ as g,c as C,aC as f,eU as j,B as o}from"./index-CdntfUUz.js";const u={danger:"text-sys-red",warning:"text-sys-indigo",default:"text-sys-blue"},p={danger:"danger",warning:"warning",default:"primary"};function N({isOpen:n,title:r="Confirm",message:l,confirmLabel:t="Confirm",cancelLabel:i="Cancel",variant:a="default",onConfirm:c,onCancel:e}){return s.jsxs(x,{open:n,onClose:e,size:"sm",children:[s.jsx(m,{icon:s.jsx(g,{className:C("w-5 h-5",u[a])}),title:r,onClose:e}),s.jsx(f,{children:s.jsx("p",{className:"text-sm text-fg-secondary",children:l})}),s.jsxs(j,{children:[s.jsx(o,{color:"muted",onClick:e,className:"flex-1",children:i}),s.jsx(o,{color:p[a],onClick:c,className:"flex-1",children:t})]})]})}const y=d.memo(N);export{y as C}; diff --git a/frontend/dist/assets/Contacts-COjtGvyY.js b/frontend/dist/assets/Contacts-DiQfIa8j.js similarity index 90% rename from frontend/dist/assets/Contacts-COjtGvyY.js rename to frontend/dist/assets/Contacts-DiQfIa8j.js index 279860f7..0024609b 100644 --- a/frontend/dist/assets/Contacts-COjtGvyY.js +++ b/frontend/dist/assets/Contacts-DiQfIa8j.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-DuT85Ji5.js","assets/index-CAHLMlrb.js","assets/BasemapLayer-VyMOdkaO.js","assets/consumer-registry-Bsx-B9R6.js","assets/link-scoring-CFJjEb_I.js","assets/ConfirmModal-CNagQaWr.js","assets/variants-DqP1b_He.js","assets/git-branch-BIN5tJ3h.js","assets/database-BeT3SO6w.js","assets/useMapViewStore-Dq-l5Xvs.js","assets/index-1IIqkHes.js","assets/index-R7zviCWb.js","assets/eye-DQ-O4VIh.js","assets/max-D9Y_Gk4E.js","assets/funnel-CmniI8cB.js","assets/plus-Be4DsW2a.js","assets/compass-Dolk-EbB.js","assets/zap-BraNZRWh.js","assets/trash-2-ChI2Sf6Z.js","assets/wifi-off-D3oO89G-.js","assets/wifi-veufKfwm.js","assets/circle-alert-D6qb8WSp.js","assets/clock-DB7tKCHV.js","assets/WorkspaceNav-ClxMgBhr.js","assets/useReplayTick-Cnehmp7d.js","assets/payload-detail-CniY19rz.js","assets/LightSparkline-g9bCtOHr.js","assets/badge-colors-Dl76Mz8m.js","assets/map-pin-CNePTCsc.js","assets/wrench-laBkieDS.js","assets/layer-DnHLn7Jx.js","assets/node-types-CcH5BFf0.js","assets/easing-rWsWG9jZ.js","assets/usePipelineStore-3uhIJZso.js","assets/ping-Chyw2B4c.js","assets/PageLayout-CgrNSpBT.js","assets/listbox-DoXudQ3L.js","assets/use-by-comparator-JYMD8MzS.js","assets/floating-BAAXcOzg.js","assets/element-movement-SAlxPSM7.js","assets/use-text-value-B1ySk7If.js","assets/frozen-TmAR4LIW.js","assets/TimeRangeStepper-BGzUi9Jn.js","assets/MqttModeBadge-OPtXzakb.js","assets/chat-utils-rMBLw-SJ.js","assets/SignalIndicator-BN0oxyDe.js","assets/CollisionExplorerModal-Y5-HwcN-.js","assets/share-2-DIHBn1T5.js","assets/monitor-smartphone-DMj7GqcL.js","assets/circle-question-mark-BPKfem7i.js","assets/map-pin-off-Dtf3D6QW.js","assets/activity-BAV-4Rxi.js","assets/target-CAfnTnyS.js","assets/search-C1Hut7GR.js","assets/index-6Dqm8vG_.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); -import{e as pe,aw as ls,j as e,r as n,_ as ds,cv as Oe,cw as Ie,at as W,a7 as Me,z as ms,cx as xs,cy as ue,R as xe,c8 as us,cz as ps,ay as ze,cA as hs,a9 as Be,cB as fs,ah as gs,cC as js,cD as bs,cE as ys,ag as Ns,cF as vs,cG as ws,ai as Cs,az as ks,aj as ve,cH as Ms,cI as Ss,bL as Ps,bK as se,a5 as _s,I as Rs,bO as Ls,c as ke}from"./index-CAHLMlrb.js";import{useDiscoveredNodes as Ts}from"./usePipelineStore-3uhIJZso.js";import{h as we,p as $s}from"./ping-Chyw2B4c.js";import{c as Se}from"./node-types-CcH5BFf0.js";import{P as Fs,a as Ds,B as Es}from"./PageLayout-CgrNSpBT.js";import{L as Hs,a as me}from"./listbox-DoXudQ3L.js";import{T as De}from"./TimeRangeStepper-BGzUi9Jn.js";import{M as Os}from"./MqttModeBadge-OPtXzakb.js";import{u as Is,e as zs,f as Bs,r as As}from"./consumer-registry-Bsx-B9R6.js";import{e as Vs,g as qs,a as Us}from"./chat-utils-rMBLw-SJ.js";import{b as Ws}from"./SignalIndicator-BN0oxyDe.js";import{C as Gs}from"./CollisionExplorerModal-Y5-HwcN-.js";import{E as Qs}from"./eye-DQ-O4VIh.js";import{S as Ks}from"./share-2-DIHBn1T5.js";import{C as Ae}from"./circle-question-mark-BPKfem7i.js";import{M as Xs}from"./map-pin-off-Dtf3D6QW.js";import{A as Ve}from"./activity-BAV-4Rxi.js";import{T as Zs}from"./target-CAfnTnyS.js";import{T as Js}from"./trash-2-ChI2Sf6Z.js";import{C as Ys}from"./ConfirmModal-CNagQaWr.js";import{M as Ee}from"./monitor-smartphone-DMj7GqcL.js";import{M as et}from"./map-pin-CNePTCsc.js";import{S as st}from"./search-C1Hut7GR.js";import{C as tt}from"./clock-DB7tKCHV.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ContactsMapMapLibre-BcJVpNZZ.js","assets/index-CdntfUUz.js","assets/BasemapLayer-U4r1eipM.js","assets/consumer-registry-K46Bg-WH.js","assets/link-scoring-CnR8SbVy.js","assets/ConfirmModal-CB8xdBeW.js","assets/variants-Bez4f_xY.js","assets/git-branch-BfTP80e2.js","assets/database-D8ZiJ_7E.js","assets/useMapViewStore-Ciaw6Y-k.js","assets/index-tm_sy7-t.js","assets/index-Bfbz8_Ci.js","assets/eye-Dc2SU7n8.js","assets/max-DUHCwm37.js","assets/funnel-0W7-MqFe.js","assets/plus-BHawoJ76.js","assets/compass-CPwUyboh.js","assets/zap-BZEYLUfp.js","assets/trash-2-Ym16rcs6.js","assets/wifi-off-BkS_iqlS.js","assets/wifi-6W1pAdZl.js","assets/circle-alert-8MQex_uC.js","assets/clock-DKukpMjT.js","assets/WorkspaceNav-BZrtCI1_.js","assets/useReplayTick-C7ZhPZyZ.js","assets/payload-detail-D7dyXv-d.js","assets/LightSparkline-B-EJJe6x.js","assets/badge-colors-Dl76Mz8m.js","assets/map-pin-ADTzwr8W.js","assets/wrench-BDb_Mrbt.js","assets/layer-BRKnZ2f8.js","assets/node-types-rkAZo2WA.js","assets/easing-BV_uJNeb.js","assets/usePipelineStore-B9TPEPcv.js","assets/ping-D6oK6s8c.js","assets/PageLayout-B2kQpvXM.js","assets/listbox-LgRZMHBN.js","assets/use-by-comparator-Dgy5yCaL.js","assets/floating-B9JazpOE.js","assets/element-movement-rOMuf_3T.js","assets/use-text-value-DFkKaUWL.js","assets/frozen-C1Yg1x_W.js","assets/TimeRangeStepper-JPYSHI2J.js","assets/MqttModeBadge-2hTXq31i.js","assets/chat-utils-D8ZwjCT3.js","assets/SignalIndicator-CKCIivNj.js","assets/CollisionExplorerModal-brcQ7JMt.js","assets/share-2-ceQyHw_t.js","assets/monitor-smartphone-X03XrJWF.js","assets/circle-question-mark-EfmCIEVS.js","assets/map-pin-off-DdXFAKLD.js","assets/activity-02b04F6Q.js","assets/target-D6g_GBrY.js","assets/search-D8B8LMYr.js","assets/index-6Dqm8vG_.css","assets/BasemapLayer-B1CfjdFi.css","assets/ContactsMapMapLibre-BwWOEply.css"])))=>i.map(i=>d[i]); +import{e as pe,aw as ls,j as e,r as n,_ as ds,cv as Oe,cw as Ie,at as W,a7 as Me,z as ms,cx as xs,cy as ue,R as xe,c8 as us,cz as ps,ay as ze,cA as hs,a9 as Be,cB as fs,ah as gs,cC as js,cD as bs,cE as ys,ag as Ns,cF as vs,cG as ws,ai as Cs,az as ks,aj as ve,cH as Ms,cI as Ss,bL as Ps,bK as se,a5 as _s,I as Rs,bO as Ls,c as ke}from"./index-CdntfUUz.js";import{useDiscoveredNodes as Ts}from"./usePipelineStore-B9TPEPcv.js";import{h as we,p as $s}from"./ping-D6oK6s8c.js";import{c as Se}from"./node-types-rkAZo2WA.js";import{P as Fs,a as Ds,B as Es}from"./PageLayout-B2kQpvXM.js";import{L as Hs,a as me}from"./listbox-LgRZMHBN.js";import{T as De}from"./TimeRangeStepper-JPYSHI2J.js";import{M as Os}from"./MqttModeBadge-2hTXq31i.js";import{u as Is,e as zs,f as Bs,r as As}from"./consumer-registry-K46Bg-WH.js";import{e as Vs,g as qs,a as Us}from"./chat-utils-D8ZwjCT3.js";import{b as Ws}from"./SignalIndicator-CKCIivNj.js";import{C as Gs}from"./CollisionExplorerModal-brcQ7JMt.js";import{E as Qs}from"./eye-Dc2SU7n8.js";import{S as Ks}from"./share-2-ceQyHw_t.js";import{C as Ae}from"./circle-question-mark-EfmCIEVS.js";import{M as Xs}from"./map-pin-off-DdXFAKLD.js";import{A as Ve}from"./activity-02b04F6Q.js";import{T as Zs}from"./target-D6g_GBrY.js";import{T as Js}from"./trash-2-Ym16rcs6.js";import{C as Ys}from"./ConfirmModal-CB8xdBeW.js";import{M as Ee}from"./monitor-smartphone-X03XrJWF.js";import{M as et}from"./map-pin-ADTzwr8W.js";import{S as st}from"./search-D8B8LMYr.js";import{C as tt}from"./clock-DKukpMjT.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -19,5 +19,5 @@ import{e as pe,aw as ls,j as e,r as n,_ as ds,cv as Oe,cw as Ie,at as W,a7 as Me * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lt=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],qe=pe("ruler",lt);class dt extends n.Component{constructor(o){super(o),this.state={hasError:!1}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}render(){var o;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:((o=this.state.error)==null?void 0:o.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 mt=n.lazy(()=>ds(()=>import("./ContactsMapMapLibre-DuT85Ji5.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,44,45,46,47,48,49,50,51,52,53,54,55,56]))),He=()=>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 xt({neighbors:d,localNode:o,localHash:m,onRemoveNode:h,selectedNodeHash:N,onNodeSelected:v,highlightedEdgeKey:l,highlightedGhost:P}){return ls()===!1?e.jsx(He,{}):e.jsx(dt,{children:e.jsx(n.Suspense,{fallback:e.jsx(He,{}),children:e.jsx(mt,{neighbors:d,localNode:o,localHash:m,onRemoveNode:h,selectedNodeHash:N,onNodeSelected:v,highlightedEdgeKey:l,highlightedGhost:P})})})}function ut({hash:d,className:o="",size:m="sm",collisionInfo:h,isViterbiResolved:N}){const v=Oe(),l=Ie(),[P,C]=n.useState(!1),_=n.useMemo(()=>W(d),[d]),u=n.useMemo(()=>h!==void 0?h:_?v.find(D=>D.prefix===_)??null:null,[_,v,h]),k=N??(l.totalPaths>0&&l.avgPathConfidence>=.7),B=n.useCallback(D=>{D.preventDefault(),D.stopPropagation(),C(!0)},[]),H=n.useCallback(()=>{C(!1)},[]);if(!u)return null;const O=m==="sm"?"w-3.5 h-3.5":"w-4 h-4",A=k?"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",G=k?`Prefix conflict resolved by Viterbi HMM (${(l.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${u.candidateCount} nodes share prefix "${_}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:B,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${A} ${o}`,title:G,"aria-label":`View prefix conflict for ${_}${k?" (Viterbi resolved)":""}`,children:k?e.jsxs("span",{className:"relative",children:[e.jsx(Qs,{className:O}),e.jsx(Me,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(ot,{className:O})}),P&&e.jsx(Gs,{isOpen:!0,prefix:u.prefix,candidateHashes:u.candidateHashes,onClose:H})]})}const pt=n.memo(ut),Ue=[{target:"Contacts",fn:"name",minStage:1,when:zs},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Bs}];As(Ue);function ht({hash:d,contact:o,isHub:m,isNeighbor:h,distance:N,centrality:v,neighborSignal:l,collisionInfo:P,isViterbiResolved:C,pingingHash:_,pingResult:u,pingError:k,isMobile:B,metaSummary:H,metaTooltip:O,onRowClick:A,onPing:G,onRemove:D}){Is(Ue);const T=ms(),V=o.latitude&&o.longitude&&o.latitude!==0&&o.longitude!==0,j=o.node_name||o.name||"Unknown",te=o.last_seen?new Date(o.last_seen*1e3):null,E=h&&l,ae=Se(o),{isRepeater:w,isCompanion:Q,isRoomServer:R,isClient:K,label:b}=ae,ne=h?`${b} — Direct RF contact (zero-hop neighbor)`:`${b} — Flood routing (multi-hop via mesh)`,re=n.useCallback(()=>A(d),[A,d]);return e.jsxs("div",{className:`contacts-grid-row ${m?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${V?"cursor-pointer":""}`,onClick:re,children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[E&&(l==null?void 0:l.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${xs(l.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:ne,children:(()=>{if(R&&w)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(ue,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(Ks,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(R)return e.jsx(ue,{className:"w-5 h-5 text-sys-pink"});if(w)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(xe,{className:"w-3.5 h-3.5 text-sys-blue"})});if((Q||K)&&j!=="Unknown"){const{emoji:$,cleanName:he}=Vs(j);return e.jsx("div",{className:"w-6 h-6 clay-avatar",style:{"--avatar-color":qs(he)},children:$?e.jsx("span",{className:"text-sm leading-none",children:$}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:Us(j)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(Ae,{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:j,children:j}),h&&e.jsx("span",{className:"contact-tag contact-tag--nbr",children:"NBR"}),m&&e.jsx("span",{className:"contact-tag contact-tag--hub",children:"HUB"}),w&&e.jsx("span",{className:"contact-tag contact-tag--rpt",children:"RPT"}),R&&e.jsx("span",{className:"contact-tag contact-tag--room",children:"ROOM"}),Q&&e.jsx("span",{className:"contact-tag contact-tag--comp",children:"COMP"}),K&&e.jsx("span",{className:"contact-tag contact-tag--client",children:"CLIENT"}),B&&e.jsx("span",{className:"contact-tag contact-tag--mobile",children:"MOB"}),!V&&e.jsx(Xs,{className:"w-3 h-3 flex-shrink-0 text-fg-muted/50"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(us,{copy:!0,size:"compact",truncate:[8,6],children:d}),e.jsx(pt,{hash:d,collisionInfo:P,isViterbiResolved:C}),H&&e.jsx("span",{className:"contact-meta",title:O,children:H})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[E&&(l==null?void 0:l.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ws,{rssi:l.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(l.avgRssi)})]}),E&&(l==null?void 0:l.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[l.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:N!=null&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:ps(N,T,{compact:!0})})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:v>0&&e.jsxs(e.Fragment,{children:[e.jsx(Ve,{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",title:te?`Last seen: ${hs(te,T,!1)}`:void 0,children:o.last_seen?ze(o.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[h&&e.jsx(e.Fragment,{children:u?e.jsxs("div",{className:`flex items-center gap-1 ${we(u)?"text-sys-green":"text-fg-muted"}`,title:`RTT: ${u.rtt_ms.toFixed(0)}ms${we(u)?` · SNR: ${u.snr_db.toFixed(1)}dB · RSSI: ${u.rssi}dBm`:""}`,children:[e.jsx(Me,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs hidden sm:inline",children:we(u)?`${u.snr_db.toFixed(1)}dB`:`${(u.rtt_ms/1e3).toFixed(1)}s`})]}):k?e.jsxs("span",{className:"text-sys-red text-xs font-medium",title:k,children:[e.jsx("span",{className:"hidden sm:inline",children:k}),e.jsx("span",{className:"sm:hidden",children:"✗"})]}):e.jsx("button",{onClick:$=>G(d,$),disabled:_!==null,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:_===d?e.jsx(Be,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Zs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:$=>{$.stopPropagation(),D(d,j)},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(Js,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const ft=n.memo(ht),gt=6371e3,jt=[{field:"lastHeard",icon:tt,label:"Recent"},{field:"distance",icon:qe,label:"Distance"},{field:"centrality",icon:Ve,label:"Centrality"}];function bt(d){switch(d){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function yt(d){const o=Se(d);return bt(o.type)}function Ce(d,o){const{color:m="primary",border:h=!1}=o??{};return ke("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",d?m==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",h&&(d?m==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function Nt(d,o,m,h){const N=(m-d)*Math.PI/180,v=(h-o)*Math.PI/180,l=Math.sin(N/2)*Math.sin(N/2)+Math.cos(d*Math.PI/180)*Math.cos(m*Math.PI/180)*Math.sin(v/2)*Math.sin(v/2),P=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return gt*P}function vt({view:d="combined",title:o="Contacts"}){var $e,Fe;const{stats:m}=fs(),h=gs(),N=js(),v=bs(),l=ys(),P=Ns(),C=vs(),_=ws(),u=Cs(),k=ks(),B=ve[u],H=Oe(),O=Ie(),A=Ms(),G=O.totalPaths>0&&O.avgPathConfidence>=.7,D=n.useMemo(()=>{const s=new Map;for(const a of H)s.set(a.prefix,a);return s},[H]),[T,V]=n.useState(null),[j,te]=n.useState("lastHeard"),[E,ae]=n.useState("desc"),[w,Q]=n.useState(""),[R,K]=n.useState(!1),[b,ne]=n.useState(new Set),[re,$]=n.useState(!1),[he,Pe]=n.useState(null),[fe,_e]=n.useState(null),[We,ge]=n.useState(new Map),[Ge,X]=n.useState(new Map),[M,Qe]=n.useState(25),[q,oe]=n.useState(25),je=n.useRef(null),Z=n.useMemo(()=>(m==null?void 0:m.neighbors)??{},[m==null?void 0:m.neighbors]),be=Ts(),ce=n.useMemo(()=>{if(be.size===0)return Z;const s=new Set;for(const t of Object.keys(Z))s.add((t.startsWith("0x")?t.slice(2):t).toLowerCase());let a=null;for(const[t,r]of be){const c=(t.startsWith("0x")?t.slice(2):t).toLowerCase();s.has(c)||(a||(a={...Z}),a[t]={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 a??Z},[Z,be]),I=n.useMemo(()=>{const a=Date.now()/1e3-B.minutes*60;return Object.fromEntries(Object.entries(ce).filter(([t,r])=>h.has(t)?!1:(r.last_seen??0)>=a))},[ce,h,B.minutes]),L=Ss(),z=m==null?void 0:m.local_hash,Ke=n.useMemo(()=>{const s=new Map;if(!z||C.size===0)return s;for(const[a,t]of C)if(a.endsWith(`→${z}`)&&t.hops.length>1){const r=a.split("→")[0],c=t.hops[t.hops.length-1];s.set(r,c)}return s},[C,z]),Xe=n.useMemo(()=>{const s=new Map;if(!z||C.size===0)return s;const a=new Map;for(const[t,r]of Object.entries(ce)){const c=(t.startsWith("0x")?t.slice(2):t).toLowerCase();a.set(c,r)}for(const[t,r]of C){if(!t.endsWith(`→${z}`)||r.hops.length===0)continue;const c=t.split("→")[0],i=r.hops[0];let f=null;for(const[g,y]of a)if(g.startsWith(i.toLowerCase())){f=y.node_name??y.name??null;break}s.set(c,{prefix:i,name:f,hopCount:r.hopCount})}return s},[C,z,ce]),ie=n.useMemo(()=>{const s=new Map;if(!(L!=null&&L.latitude)||!(L!=null&&L.longitude))return s;for(const[a,t]of Object.entries(I))t.latitude&&t.longitude&&t.latitude!==0&&t.longitude!==0?s.set(a,Nt(L.latitude,L.longitude,t.latitude,t.longitude)):s.set(a,null);return s},[I,L]),{neighborHashSet:le,neighborSignalMap:Ze}=n.useMemo(()=>{const s=new Set,a=new Map;for(const t of P)s.add(t.hash),a.set(t.hash,{avgRssi:t.avgRssi,avgSnr:t.avgSnr});return{neighborHashSet:s,neighborSignalMap:a}},[P]),Re=n.useMemo(()=>{const s=w.toLowerCase().trim(),a=s==="neighbor"||s==="neighbors",t=R||a,r=b.size>0;return Object.fromEntries(Object.entries(I).filter(([c,i])=>{if(r){const y=yt(i);if(!b.has(y))return!1}if(t&&!le.has(c))return!1;if(a||!s)return!0;const f=(i.node_name||i.name||"").toLowerCase(),g=W(c).toLowerCase();return f.includes(s)||g.includes(s)||c.toLowerCase().includes(s)}))},[I,w,R,le,b]),p=n.useMemo(()=>{const s=Object.entries(Re),a=w.toLowerCase().trim(),t=/^[0-9a-f]{2}(?:[0-9a-f]{2}){0,2}$/i.test(a);return s.sort(([r,c],[i,f])=>{if(t){const y=W(r).toLowerCase(),F=W(i).toLowerCase(),S=y===a,U=F===a;if(S&&!U)return-1;if(U&&!S)return 1}let g=0;switch(j){case"lastHeard":g=(c.last_seen||0)-(f.last_seen||0);break;case"distance":{const y=ie.get(r)??null,F=ie.get(i)??null;y===null&&F===null?g=0:y===null?g=1:F===null?g=-1:g=y-F;break}case"centrality":{const y=l.get(r)||0,F=l.get(i)||0;g=y-F;break}}return E==="desc"?-g:g})},[Re,j,E,ie,l,w]),x=n.useMemo(()=>{let s=0,a=0,t=0,r=0,c=0;for(const[,i]of p){const f=Se(i),g=i.latitude&&i.longitude&&i.latitude!==0&&i.longitude!==0;switch(f.type){case"room_server":t++;break;case"repeater":a++;break;case"companion":s++;break;case"unknown":c++;break}g&&r++}return{companions:s,repeaters:a,roomServers:t,total:p.length,withLocation:r,unknown:c}},[p]),Je=n.useMemo(()=>new Set(v),[v]),Le=n.useMemo(()=>M===0?p:p.slice(0,q),[p,q,M]);n.useEffect(()=>{oe(M||p.length)},[j,E,w,R,b,M,p.length]),n.useEffect(()=>{const s=a=>{a.target.closest("[data-dropdown]")||$(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),n.useEffect(()=>{if(M===0)return;const s=new IntersectionObserver(a=>{a[0].isIntersecting&&qMath.min(t+M,p.length))},{threshold:.1,rootMargin:"100px"});return je.current&&s.observe(je.current),()=>s.disconnect()},[M,q,p.length]);const Ye=n.useCallback(s=>{Qe(s),oe(s||p.length)},[p.length]),es=n.useCallback(s=>{j===s?ae(a=>a==="desc"?"asc":"desc"):(te(s),ae("desc"))},[j]),ss=n.useCallback(s=>{const a=I[s];a!=null&&a.latitude&&(a!=null&&a.longitude)&&a.latitude!==0&&a.longitude!==0&&Pe(s)},[I]),ts=n.useCallback(()=>{Pe(null)},[]),as=n.useCallback((s,a)=>{V({hash:s,name:a})},[]),Te=Ps((Fe=($e=m==null?void 0:m.config)==null?void 0:$e.mesh)==null?void 0:Fe.path_hash_mode),ns=n.useCallback(async(s,a)=>{if(a.stopPropagation(),!fe){_e(s),ge(t=>{const r=new Map(t);return r.delete(s),r}),X(t=>{const r=new Map(t);return r.delete(s),r});try{const r=`0x${W(s,Te)}`,c=await $s(r,30);c.success&&c.data?(ge(i=>new Map(i).set(s,c.data)),setTimeout(()=>{ge(i=>{const f=new Map(i);return f.delete(s),f})},1e4)):(X(i=>new Map(i).set(s,c.error||"Ping failed")),setTimeout(()=>{X(i=>{const f=new Map(i);return f.delete(s),f})},5e3))}catch(t){const r=t instanceof Error?t.message:"Ping failed";X(c=>new Map(c).set(s,r)),setTimeout(()=>{X(c=>{const i=new Map(c);return i.delete(s),i})},5e3)}finally{_e(null)}}},[fe,Te]);return e.jsxs(Fs,{children:[e.jsx(Ds,{title:o,icon:e.jsx(se,{}),subtitle:e.jsx(Os,{}),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:`${x.total} discovered node${x.total!==1?"s":""} on the mesh network`,children:[e.jsx(se,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:x.total})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Types:"}),x.repeaters>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Repeaters",children:[e.jsx(xe,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{children:x.repeaters})]}),x.companions>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Companions",children:[e.jsx(Ee,{className:"w-3.5 h-3.5 text-fg-muted"}),e.jsx("span",{children:x.companions})]}),x.roomServers>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Room Servers",children:[e.jsx(ue,{className:"w-3.5 h-3.5 text-sys-pink"}),e.jsx("span",{children:x.roomServers})]}),x.withLocation>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"With GPS location",children:[e.jsx(et,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{children:x.withLocation})]}),x.unknown>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Unknown type",children:[e.jsx(Ae,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{children:x.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(se,{className:"w-3 h-3 text-fg-secondary"}),e.jsx("span",{children:x.total})]}),x.repeaters>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(xe,{className:"w-3 h-3 text-sys-blue"}),e.jsx("span",{children:x.repeaters})]}),x.companions>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{children:x.companions})]}),x.roomServers>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(ue,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:x.roomServers})]}),e.jsx(De,{ranges:ve,selectedIndex:u,onSelect:k,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(De,{ranges:ve,selectedIndex:u,onSelect:k})})]})}),e.jsxs(Es,{children:[d!=="list"&&e.jsx(xt,{neighbors:I,localNode:L??void 0,localHash:z,onRemoveNode:N,selectedNodeHash:he,onNodeSelected:ts}),d!=="map"&&e.jsxs(_s,{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(se,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(Rs,{type:"search",size:"sm",value:w,onChange:s=>Q(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(st,{className:"w-3.5 h-3.5"}),trailingIcon:w?e.jsx("button",{onClick:()=>{Q(""),(w.toLowerCase().trim()==="neighbor"||w.toLowerCase().trim()==="neighbors")&&K(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(Ls,{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:()=>$(!re),className:Ce(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(it,{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})]}),re&&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:a})=>e.jsxs("button",{onClick:()=>{ne(t=>{const r=new Set(t);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:ke("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(Me,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:a})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>ne(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"})]})]})]}),le.size>0&&e.jsxs("button",{onClick:()=>K(!R),className:Ce(R,{color:"success",border:!0}),title:R?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(xe,{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:[jt.map(({field:s,icon:a,label:t})=>e.jsxs("button",{onClick:()=>es(s),className:Ce(j===s),title:`Sort by ${t.toLowerCase()}`,children:[e.jsx(a,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:t}),j===s&&e.jsx(nt,{className:ke("w-3 h-3",E==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Hs,{value:M,onChange:Ye,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(me,{value:25,children:"25"}),e.jsx(me,{value:50,children:"50"}),e.jsx(me,{value:100,children:"100"}),e.jsx(me,{value:0,children:"All"})]})]})]}),p.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",style:{contain:"layout paint"},children:Le.map(([s,a])=>{const t=W(s),r=Je.has(s),c=le.has(s),i=ie.get(s)??null,f=l.get(s)||0,g=c?Ze.get(s):void 0,y=t?D.get(t)??null:null,F=_.has(s),S=c?null:Xe.get(s)??null,U=Ke.get(s)??null,ye=A.get(s);let J=null;if(ye&&ye.length>0){const de=ye.reduce((cs,is)=>cs+is.count,0);de>0&&(J=de/24)}const Ne=a.first_seen?ze(a.first_seen).replace(/ ago$/i,""):null,Y=[],ee=[];if(S){const de=S.name??S.prefix;Y.push(`→${de} +${S.hopCount}`),ee.push(`Gateway: ${S.name??S.prefix} (${S.hopCount} hop${S.hopCount!==1?"s":""})`)}U&&(Y.push(`↙${U}`),ee.push(`Last forwarder: ${U}`)),J!==null&&(Y.push(`${J<1?"<1":Math.round(J)}/hr`),ee.push(`Packet rate: ${J.toFixed(1)}/hr`)),Ne&&(Y.push(Ne),ee.push(`First seen: ${Ne} ago`));const rs=Y.join(" · "),os=ee.join(` + */const lt=[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]],qe=pe("ruler",lt);class dt extends n.Component{constructor(o){super(o),this.state={hasError:!1}}static getDerivedStateFromError(o){return{hasError:!0,error:o}}render(){var o;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:((o=this.state.error)==null?void 0:o.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 mt=n.lazy(()=>ds(()=>import("./ContactsMapMapLibre-BcJVpNZZ.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,44,45,46,47,48,49,50,51,52,53,54,55,56]))),He=()=>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 xt({neighbors:d,localNode:o,localHash:m,onRemoveNode:h,selectedNodeHash:N,onNodeSelected:v,highlightedEdgeKey:l,highlightedGhost:P}){return ls()===!1?e.jsx(He,{}):e.jsx(dt,{children:e.jsx(n.Suspense,{fallback:e.jsx(He,{}),children:e.jsx(mt,{neighbors:d,localNode:o,localHash:m,onRemoveNode:h,selectedNodeHash:N,onNodeSelected:v,highlightedEdgeKey:l,highlightedGhost:P})})})}function ut({hash:d,className:o="",size:m="sm",collisionInfo:h,isViterbiResolved:N}){const v=Oe(),l=Ie(),[P,C]=n.useState(!1),_=n.useMemo(()=>W(d),[d]),u=n.useMemo(()=>h!==void 0?h:_?v.find(D=>D.prefix===_)??null:null,[_,v,h]),k=N??(l.totalPaths>0&&l.avgPathConfidence>=.7),B=n.useCallback(D=>{D.preventDefault(),D.stopPropagation(),C(!0)},[]),H=n.useCallback(()=>{C(!1)},[]);if(!u)return null;const O=m==="sm"?"w-3.5 h-3.5":"w-4 h-4",A=k?"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",G=k?`Prefix conflict resolved by Viterbi HMM (${(l.avgPathConfidence*100).toFixed(0)}% confidence)`:`Prefix conflict: ${u.candidateCount} nodes share prefix "${_}"`;return e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:B,className:`inline-flex items-center justify-center p-0.5 rounded focus:outline-none focus:ring-2 transition-colors cursor-pointer touch-manipulation ${A} ${o}`,title:G,"aria-label":`View prefix conflict for ${_}${k?" (Viterbi resolved)":""}`,children:k?e.jsxs("span",{className:"relative",children:[e.jsx(Qs,{className:O}),e.jsx(Me,{className:"absolute -bottom-0.5 -right-0.5 w-2 h-2 text-sys-green"})]}):e.jsx(ot,{className:O})}),P&&e.jsx(Gs,{isOpen:!0,prefix:u.prefix,candidateHashes:u.candidateHashes,onClose:H})]})}const pt=n.memo(ut),Ue=[{target:"Contacts",fn:"name",minStage:1,when:zs},{target:"Contacts",fn:"traceLinks.directed",minStage:2,when:Bs}];As(Ue);function ht({hash:d,contact:o,isHub:m,isNeighbor:h,distance:N,centrality:v,neighborSignal:l,collisionInfo:P,isViterbiResolved:C,pingingHash:_,pingResult:u,pingError:k,isMobile:B,metaSummary:H,metaTooltip:O,onRowClick:A,onPing:G,onRemove:D}){Is(Ue);const T=ms(),V=o.latitude&&o.longitude&&o.latitude!==0&&o.longitude!==0,j=o.node_name||o.name||"Unknown",te=o.last_seen?new Date(o.last_seen*1e3):null,E=h&&l,ae=Se(o),{isRepeater:w,isCompanion:Q,isRoomServer:R,isClient:K,label:b}=ae,ne=h?`${b} — Direct RF contact (zero-hop neighbor)`:`${b} — Flood routing (multi-hop via mesh)`,re=n.useCallback(()=>A(d),[A,d]);return e.jsxs("div",{className:`contacts-grid-row ${m?"bg-sys-amber/5 border-l-2 border-l-sys-amber":""} ${V?"cursor-pointer":""}`,onClick:re,children:[e.jsxs("div",{className:"contacts-col-node flex items-center gap-2 min-w-0",children:[E&&(l==null?void 0:l.avgSnr)!==null?e.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 self-center ${xs(l.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:ne,children:(()=>{if(R&&w)return e.jsxs("div",{className:"relative w-5 h-5",children:[e.jsx(ue,{className:"w-5 h-5 absolute inset-0 text-sys-pink"}),e.jsx(Ks,{className:"w-2.5 h-2.5 absolute -bottom-0.5 -right-0.5 text-sys-teal"})]});if(R)return e.jsx(ue,{className:"w-5 h-5 text-sys-pink"});if(w)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(xe,{className:"w-3.5 h-3.5 text-sys-blue"})});if((Q||K)&&j!=="Unknown"){const{emoji:$,cleanName:he}=Vs(j);return e.jsx("div",{className:"w-6 h-6 clay-avatar",style:{"--avatar-color":qs(he)},children:$?e.jsx("span",{className:"text-sm leading-none",children:$}):e.jsx("span",{className:"text-white text-[9px] font-bold tracking-tighter",children:Us(j)})})}return e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center bg-zinc-500/20",children:e.jsx(Ae,{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:j,children:j}),h&&e.jsx("span",{className:"contact-tag contact-tag--nbr",children:"NBR"}),m&&e.jsx("span",{className:"contact-tag contact-tag--hub",children:"HUB"}),w&&e.jsx("span",{className:"contact-tag contact-tag--rpt",children:"RPT"}),R&&e.jsx("span",{className:"contact-tag contact-tag--room",children:"ROOM"}),Q&&e.jsx("span",{className:"contact-tag contact-tag--comp",children:"COMP"}),K&&e.jsx("span",{className:"contact-tag contact-tag--client",children:"CLIENT"}),B&&e.jsx("span",{className:"contact-tag contact-tag--mobile",children:"MOB"}),!V&&e.jsx(Xs,{className:"w-3 h-3 flex-shrink-0 text-fg-muted/50"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx(us,{copy:!0,size:"compact",truncate:[8,6],children:d}),e.jsx(pt,{hash:d,collisionInfo:P,isViterbiResolved:C}),H&&e.jsx("span",{className:"contact-meta",title:O,children:H})]})]})]}),e.jsxs("div",{className:"contacts-col-signal flex items-center justify-end gap-2",children:[E&&(l==null?void 0:l.avgRssi)!==null&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ws,{rssi:l.avgRssi,className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs text-fg-muted",children:Math.round(l.avgRssi)})]}),E&&(l==null?void 0:l.avgSnr)!==null&&e.jsxs("span",{className:"type-data-xs text-fg-muted",children:[l.avgSnr.toFixed(1)," dB"]})]}),e.jsx("div",{className:"contacts-col-distance flex items-center justify-end gap-1 text-fg-muted",children:N!=null&&e.jsxs(e.Fragment,{children:[e.jsx(qe,{className:"w-3 h-3"}),e.jsx("span",{className:"type-data-xs",children:ps(N,T,{compact:!0})})]})}),e.jsx("div",{className:"contacts-col-centrality flex items-center justify-end gap-1",children:v>0&&e.jsxs(e.Fragment,{children:[e.jsx(Ve,{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",title:te?`Last seen: ${hs(te,T,!1)}`:void 0,children:o.last_seen?ze(o.last_seen):"—"})}),e.jsxs("div",{className:"contacts-col-actions flex items-center justify-end gap-1",children:[h&&e.jsx(e.Fragment,{children:u?e.jsxs("div",{className:`flex items-center gap-1 ${we(u)?"text-sys-green":"text-fg-muted"}`,title:`RTT: ${u.rtt_ms.toFixed(0)}ms${we(u)?` · SNR: ${u.snr_db.toFixed(1)}dB · RSSI: ${u.rssi}dBm`:""}`,children:[e.jsx(Me,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"type-data-xs hidden sm:inline",children:we(u)?`${u.snr_db.toFixed(1)}dB`:`${(u.rtt_ms/1e3).toFixed(1)}s`})]}):k?e.jsxs("span",{className:"text-sys-red text-xs font-medium",title:k,children:[e.jsx("span",{className:"hidden sm:inline",children:k}),e.jsx("span",{className:"sm:hidden",children:"✗"})]}):e.jsx("button",{onClick:$=>G(d,$),disabled:_!==null,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:_===d?e.jsx(Be,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4 animate-spin"}):e.jsx(Zs,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})}),e.jsx("button",{onClick:$=>{$.stopPropagation(),D(d,j)},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(Js,{className:"w-3.5 h-3.5 sm:w-4 sm:h-4"})})]})]})}const ft=n.memo(ht),gt=6371e3,jt=[{field:"lastHeard",icon:tt,label:"Recent"},{field:"distance",icon:qe,label:"Distance"},{field:"centrality",icon:Ve,label:"Centrality"}];function bt(d){switch(d){case"room_server":return"room";case"repeater":return"repeater";case"companion":return"companion";case"unknown":return"companion"}}function yt(d){const o=Se(d);return bt(o.type)}function Ce(d,o){const{color:m="primary",border:h=!1}=o??{};return ke("flex items-center gap-1.5 px-2 py-1.5 text-sm radius-inner transition-base",d?m==="success"?"bg-sys-green/20 text-sys-green":"bg-sys-blue/20 text-sys-blue":"text-fg-muted hover:text-fg-secondary hover-bg",h&&(d?m==="success"?"border border-sys-green/30":"border border-sys-blue/30":"border border-transparent"))}function Nt(d,o,m,h){const N=(m-d)*Math.PI/180,v=(h-o)*Math.PI/180,l=Math.sin(N/2)*Math.sin(N/2)+Math.cos(d*Math.PI/180)*Math.cos(m*Math.PI/180)*Math.sin(v/2)*Math.sin(v/2),P=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l));return gt*P}function vt({view:d="combined",title:o="Contacts"}){var $e,Fe;const{stats:m}=fs(),h=gs(),N=js(),v=bs(),l=ys(),P=Ns(),C=vs(),_=ws(),u=Cs(),k=ks(),B=ve[u],H=Oe(),O=Ie(),A=Ms(),G=O.totalPaths>0&&O.avgPathConfidence>=.7,D=n.useMemo(()=>{const s=new Map;for(const a of H)s.set(a.prefix,a);return s},[H]),[T,V]=n.useState(null),[j,te]=n.useState("lastHeard"),[E,ae]=n.useState("desc"),[w,Q]=n.useState(""),[R,K]=n.useState(!1),[b,ne]=n.useState(new Set),[re,$]=n.useState(!1),[he,Pe]=n.useState(null),[fe,_e]=n.useState(null),[We,ge]=n.useState(new Map),[Ge,X]=n.useState(new Map),[M,Qe]=n.useState(25),[q,oe]=n.useState(25),je=n.useRef(null),Z=n.useMemo(()=>(m==null?void 0:m.neighbors)??{},[m==null?void 0:m.neighbors]),be=Ts(),ce=n.useMemo(()=>{if(be.size===0)return Z;const s=new Set;for(const t of Object.keys(Z))s.add((t.startsWith("0x")?t.slice(2):t).toLowerCase());let a=null;for(const[t,r]of be){const c=(t.startsWith("0x")?t.slice(2):t).toLowerCase();s.has(c)||(a||(a={...Z}),a[t]={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 a??Z},[Z,be]),I=n.useMemo(()=>{const a=Date.now()/1e3-B.minutes*60;return Object.fromEntries(Object.entries(ce).filter(([t,r])=>h.has(t)?!1:(r.last_seen??0)>=a))},[ce,h,B.minutes]),L=Ss(),z=m==null?void 0:m.local_hash,Ke=n.useMemo(()=>{const s=new Map;if(!z||C.size===0)return s;for(const[a,t]of C)if(a.endsWith(`→${z}`)&&t.hops.length>1){const r=a.split("→")[0],c=t.hops[t.hops.length-1];s.set(r,c)}return s},[C,z]),Xe=n.useMemo(()=>{const s=new Map;if(!z||C.size===0)return s;const a=new Map;for(const[t,r]of Object.entries(ce)){const c=(t.startsWith("0x")?t.slice(2):t).toLowerCase();a.set(c,r)}for(const[t,r]of C){if(!t.endsWith(`→${z}`)||r.hops.length===0)continue;const c=t.split("→")[0],i=r.hops[0];let f=null;for(const[g,y]of a)if(g.startsWith(i.toLowerCase())){f=y.node_name??y.name??null;break}s.set(c,{prefix:i,name:f,hopCount:r.hopCount})}return s},[C,z,ce]),ie=n.useMemo(()=>{const s=new Map;if(!(L!=null&&L.latitude)||!(L!=null&&L.longitude))return s;for(const[a,t]of Object.entries(I))t.latitude&&t.longitude&&t.latitude!==0&&t.longitude!==0?s.set(a,Nt(L.latitude,L.longitude,t.latitude,t.longitude)):s.set(a,null);return s},[I,L]),{neighborHashSet:le,neighborSignalMap:Ze}=n.useMemo(()=>{const s=new Set,a=new Map;for(const t of P)s.add(t.hash),a.set(t.hash,{avgRssi:t.avgRssi,avgSnr:t.avgSnr});return{neighborHashSet:s,neighborSignalMap:a}},[P]),Re=n.useMemo(()=>{const s=w.toLowerCase().trim(),a=s==="neighbor"||s==="neighbors",t=R||a,r=b.size>0;return Object.fromEntries(Object.entries(I).filter(([c,i])=>{if(r){const y=yt(i);if(!b.has(y))return!1}if(t&&!le.has(c))return!1;if(a||!s)return!0;const f=(i.node_name||i.name||"").toLowerCase(),g=W(c).toLowerCase();return f.includes(s)||g.includes(s)||c.toLowerCase().includes(s)}))},[I,w,R,le,b]),p=n.useMemo(()=>{const s=Object.entries(Re),a=w.toLowerCase().trim(),t=/^[0-9a-f]{2}(?:[0-9a-f]{2}){0,2}$/i.test(a);return s.sort(([r,c],[i,f])=>{if(t){const y=W(r).toLowerCase(),F=W(i).toLowerCase(),S=y===a,U=F===a;if(S&&!U)return-1;if(U&&!S)return 1}let g=0;switch(j){case"lastHeard":g=(c.last_seen||0)-(f.last_seen||0);break;case"distance":{const y=ie.get(r)??null,F=ie.get(i)??null;y===null&&F===null?g=0:y===null?g=1:F===null?g=-1:g=y-F;break}case"centrality":{const y=l.get(r)||0,F=l.get(i)||0;g=y-F;break}}return E==="desc"?-g:g})},[Re,j,E,ie,l,w]),x=n.useMemo(()=>{let s=0,a=0,t=0,r=0,c=0;for(const[,i]of p){const f=Se(i),g=i.latitude&&i.longitude&&i.latitude!==0&&i.longitude!==0;switch(f.type){case"room_server":t++;break;case"repeater":a++;break;case"companion":s++;break;case"unknown":c++;break}g&&r++}return{companions:s,repeaters:a,roomServers:t,total:p.length,withLocation:r,unknown:c}},[p]),Je=n.useMemo(()=>new Set(v),[v]),Le=n.useMemo(()=>M===0?p:p.slice(0,q),[p,q,M]);n.useEffect(()=>{oe(M||p.length)},[j,E,w,R,b,M,p.length]),n.useEffect(()=>{const s=a=>{a.target.closest("[data-dropdown]")||$(!1)};return document.addEventListener("click",s),()=>document.removeEventListener("click",s)},[]),n.useEffect(()=>{if(M===0)return;const s=new IntersectionObserver(a=>{a[0].isIntersecting&&qMath.min(t+M,p.length))},{threshold:.1,rootMargin:"100px"});return je.current&&s.observe(je.current),()=>s.disconnect()},[M,q,p.length]);const Ye=n.useCallback(s=>{Qe(s),oe(s||p.length)},[p.length]),es=n.useCallback(s=>{j===s?ae(a=>a==="desc"?"asc":"desc"):(te(s),ae("desc"))},[j]),ss=n.useCallback(s=>{const a=I[s];a!=null&&a.latitude&&(a!=null&&a.longitude)&&a.latitude!==0&&a.longitude!==0&&Pe(s)},[I]),ts=n.useCallback(()=>{Pe(null)},[]),as=n.useCallback((s,a)=>{V({hash:s,name:a})},[]),Te=Ps((Fe=($e=m==null?void 0:m.config)==null?void 0:$e.mesh)==null?void 0:Fe.path_hash_mode),ns=n.useCallback(async(s,a)=>{if(a.stopPropagation(),!fe){_e(s),ge(t=>{const r=new Map(t);return r.delete(s),r}),X(t=>{const r=new Map(t);return r.delete(s),r});try{const r=`0x${W(s,Te)}`,c=await $s(r,30);c.success&&c.data?(ge(i=>new Map(i).set(s,c.data)),setTimeout(()=>{ge(i=>{const f=new Map(i);return f.delete(s),f})},1e4)):(X(i=>new Map(i).set(s,c.error||"Ping failed")),setTimeout(()=>{X(i=>{const f=new Map(i);return f.delete(s),f})},5e3))}catch(t){const r=t instanceof Error?t.message:"Ping failed";X(c=>new Map(c).set(s,r)),setTimeout(()=>{X(c=>{const i=new Map(c);return i.delete(s),i})},5e3)}finally{_e(null)}}},[fe,Te]);return e.jsxs(Fs,{children:[e.jsx(Ds,{title:o,icon:e.jsx(se,{}),subtitle:e.jsx(Os,{}),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:`${x.total} discovered node${x.total!==1?"s":""} on the mesh network`,children:[e.jsx(se,{className:"w-3.5 h-3.5 text-fg-secondary"}),e.jsx("span",{children:x.total})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Types:"}),x.repeaters>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Repeaters",children:[e.jsx(xe,{className:"w-3.5 h-3.5 text-sys-blue"}),e.jsx("span",{children:x.repeaters})]}),x.companions>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Companions",children:[e.jsx(Ee,{className:"w-3.5 h-3.5 text-fg-muted"}),e.jsx("span",{children:x.companions})]}),x.roomServers>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Room Servers",children:[e.jsx(ue,{className:"w-3.5 h-3.5 text-sys-pink"}),e.jsx("span",{children:x.roomServers})]}),x.withLocation>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"With GPS location",children:[e.jsx(et,{className:"w-3.5 h-3.5 text-sys-green"}),e.jsx("span",{children:x.withLocation})]}),x.unknown>0&&e.jsxs("span",{className:"data-box flex items-center gap-1.5 cursor-default",title:"Unknown type",children:[e.jsx(Ae,{className:"w-3.5 h-3.5 text-sys-amber"}),e.jsx("span",{children:x.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(se,{className:"w-3 h-3 text-fg-secondary"}),e.jsx("span",{children:x.total})]}),x.repeaters>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(xe,{className:"w-3 h-3 text-sys-blue"}),e.jsx("span",{children:x.repeaters})]}),x.companions>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(Ee,{className:"w-3 h-3 text-fg-muted"}),e.jsx("span",{children:x.companions})]}),x.roomServers>0&&e.jsxs("span",{className:"data-box !px-1.5 !py-0.5 !text-[10px] flex items-center gap-1",children:[e.jsx(ue,{className:"w-3 h-3 text-sys-pink"}),e.jsx("span",{children:x.roomServers})]}),e.jsx(De,{ranges:ve,selectedIndex:u,onSelect:k,size:"sm"})]}),e.jsx("div",{className:"hidden sm:block",children:e.jsx(De,{ranges:ve,selectedIndex:u,onSelect:k})})]})}),e.jsxs(Es,{children:[d!=="list"&&e.jsx(xt,{neighbors:I,localNode:L??void 0,localHash:z,onRemoveNode:N,selectedNodeHash:he,onNodeSelected:ts}),d!=="map"&&e.jsxs(_s,{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(se,{})}),e.jsx("span",{className:"type-micro flex-shrink-0 mr-auto hidden sm:block",children:"Discovered Contacts"}),e.jsx(Rs,{type:"search",size:"sm",value:w,onChange:s=>Q(s.target.value),placeholder:"Search...",leadingIcon:e.jsx(st,{className:"w-3.5 h-3.5"}),trailingIcon:w?e.jsx("button",{onClick:()=>{Q(""),(w.toLowerCase().trim()==="neighbor"||w.toLowerCase().trim()==="neighbors")&&K(!1)},className:"text-fg-muted hover:text-fg-secondary",children:e.jsx(Ls,{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:()=>$(!re),className:Ce(b.size>0,{border:!0}),title:"Filter by contact type",children:[e.jsx(it,{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})]}),re&&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:a})=>e.jsxs("button",{onClick:()=>{ne(t=>{const r=new Set(t);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:ke("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(Me,{className:"w-3 h-3"})}),e.jsx("span",{className:b.has(s)?"text-fg-primary":"text-fg-secondary",children:a})]},s)),b.size>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-edge-subtle my-1"}),e.jsx("button",{onClick:()=>ne(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"})]})]})]}),le.size>0&&e.jsxs("button",{onClick:()=>K(!R),className:Ce(R,{color:"success",border:!0}),title:R?"Show all contacts":"Show only MeshCore neighbors (direct RF contact)",children:[e.jsx(xe,{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:[jt.map(({field:s,icon:a,label:t})=>e.jsxs("button",{onClick:()=>es(s),className:Ce(j===s),title:`Sort by ${t.toLowerCase()}`,children:[e.jsx(a,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden xl:inline",children:t}),j===s&&e.jsx(nt,{className:ke("w-3 h-3",E==="asc"&&"rotate-180")})]},s)),e.jsx("div",{className:"h-4 w-px bg-border-subtle"}),e.jsxs(Hs,{value:M,onChange:Ye,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(me,{value:25,children:"25"}),e.jsx(me,{value:50,children:"50"}),e.jsx(me,{value:100,children:"100"}),e.jsx(me,{value:0,children:"All"})]})]})]}),p.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",style:{contain:"layout paint"},children:Le.map(([s,a])=>{const t=W(s),r=Je.has(s),c=le.has(s),i=ie.get(s)??null,f=l.get(s)||0,g=c?Ze.get(s):void 0,y=t?D.get(t)??null:null,F=_.has(s),S=c?null:Xe.get(s)??null,U=Ke.get(s)??null,ye=A.get(s);let J=null;if(ye&&ye.length>0){const de=ye.reduce((cs,is)=>cs+is.count,0);de>0&&(J=de/24)}const Ne=a.first_seen?ze(a.first_seen).replace(/ ago$/i,""):null,Y=[],ee=[];if(S){const de=S.name??S.prefix;Y.push(`→${de} +${S.hopCount}`),ee.push(`Gateway: ${S.name??S.prefix} (${S.hopCount} hop${S.hopCount!==1?"s":""})`)}U&&(Y.push(`↙${U}`),ee.push(`Last forwarder: ${U}`)),J!==null&&(Y.push(`${J<1?"<1":Math.round(J)}/hr`),ee.push(`Packet rate: ${J.toFixed(1)}/hr`)),Ne&&(Y.push(Ne),ee.push(`First seen: ${Ne} ago`));const rs=Y.join(" · "),os=ee.join(` `);return e.jsx(ft,{hash:s,contact:a,isHub:r,isNeighbor:c,distance:i,centrality:f,neighborSignal:g,collisionInfo:y,isViterbiResolved:G,pingingHash:fe,pingResult:We.get(s),pingError:Ge.get(s),isMobile:F,metaSummary:rs,metaTooltip:os,onRowClick:ss,onPing:ns,onRemove:as},s)})}),M>0&&q0&&qoe(s=>Math.min(s+M,p.length)),className:"text-sys-blue hover:text-sys-blue/80 transition-base",children:"Load more"})]})]}):e.jsxs("div",{className:"roster-empty",children:[e.jsx(se,{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(Ys,{isOpen:!!T,title:"Remove Contact",message:`Remove ${(T==null?void 0:T.name)||"this contact"} from the contacts list? The node will reappear if it advertises again.`,confirmLabel:"Remove",cancelLabel:"Cancel",variant:"danger",onConfirm:()=>{T&&N(T.hash),V(null)},onCancel:()=>V(null)})]})}const Gt=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"}));export{Gt as C,pt as P,qe as R}; diff --git a/frontend/dist/assets/ContactsMapMapLibre-DuT85Ji5.js b/frontend/dist/assets/ContactsMapMapLibre-BcJVpNZZ.js similarity index 99% rename from frontend/dist/assets/ContactsMapMapLibre-DuT85Ji5.js rename to frontend/dist/assets/ContactsMapMapLibre-BcJVpNZZ.js index cc8d72e0..8870bb26 100644 --- a/frontend/dist/assets/ContactsMapMapLibre-DuT85Ji5.js +++ b/frontend/dist/assets/ContactsMapMapLibre-BcJVpNZZ.js @@ -1,4 +1,4 @@ -import{e as nn,as as ka,r as R,hl as Ca,cB as Ea,dH as Sa,dI as Ma,j as m,aB as So,dJ as Ba,aC as Mo,m as tr,a7 as Yn,aD as Bo,c as Cn,a9 as J0,Y as cr,Z as vn,hm as X0,hn as Do,ho as Da,co as _a,cw as ja,cy as Ta,dD as _o,au as jo,aE as To,d as Dr,b as En,B as Qt,cr as gs,H as Vs,S as Ws,dP as Ro,w as Io,d4 as Lo,R as No,bO as Sn,hp as Ra,z as Kn,N as Ia,cz as Fo,bK as vi,hq as Po,$ as La,ad as Na,dX as Fa,hr as Pa,ay as Qo,cq as bi,bS as Qa,a8 as As,aa as es,ct as Oa,bb as za,fc as Oo,hs as Ha,ht as Ga,dY as Ua,dG as Va,hu as Wa,hv as Ya,aT as zo,a2 as wt,cL as Ho,cA as Ka,gN as Za,hw as $a,hx as qa,hy as Go,gW as Ja,at as _r,bY as Uo,dO as Xa,hz as Vo,hA as Wo,cf as Au,hj as eu,ci as tu,dM as Yo,dQ as ru,ag as nu,hB as su,fo as iu,hC as ys,gm as ou,fW as lu,dC as au}from"./index-CAHLMlrb.js";import{u as Gr,M as uu,S as cu,B as fu}from"./BasemapLayer-VyMOdkaO.js";import{u as Ko,r as Zo,e as ki,f as Ci,g as hu}from"./consumer-registry-Bsx-B9R6.js";import{L as W0,c as du}from"./link-scoring-CFJjEb_I.js";import{C as mu}from"./ConfirmModal-CNagQaWr.js";import{s as pu,a as gu,M as yu}from"./variants-DqP1b_He.js";import{G as Ds}from"./git-branch-BIN5tJ3h.js";import{D as xu}from"./database-BeT3SO6w.js";import{H as wu,A as x0,D as Ei,u as mn}from"./useMapViewStore-Dq-l5Xvs.js";import{E as $o}from"./eye-DQ-O4VIh.js";import{b as vu,e as bu,a as qo,m as Si,W as ku,E as Cu,u as Eu,G as Su,g as Mu,d as Bu,f as Du}from"./max-D9Y_Gk4E.js";import{F as _u}from"./funnel-CmniI8cB.js";import{P as ju}from"./plus-Be4DsW2a.js";import{C as Tu}from"./compass-Dolk-EbB.js";import{Z as Ru}from"./zap-BraNZRWh.js";import{T as Iu}from"./trash-2-ChI2Sf6Z.js";import{W as Lu}from"./wifi-off-D3oO89G-.js";import{W as Nu}from"./wifi-veufKfwm.js";import{C as Fu}from"./circle-alert-D6qb8WSp.js";import{C as Jo}from"./clock-DB7tKCHV.js";import{C as Pu}from"./WorkspaceNav-ClxMgBhr.js";import{u as Ys,a as Xo,b as Al,c as Qu,d as Ou,e as Ks,f as Mi,R as zu,g as Hu,h as el,t as Gu,i as Uu,j as Vu,k as Wu}from"./useReplayTick-Cnehmp7d.js";import{L as Yu}from"./LightSparkline-g9bCtOHr.js";import{P as tl,R as Ku}from"./Contacts-COjtGvyY.js";import{H as Z0,C as fr,N as Zu,a as $u}from"./badge-colors-Dl76Mz8m.js";import{M as qu}from"./map-pin-CNePTCsc.js";import{W as Ju}from"./wrench-laBkieDS.js";import{S as Hr,L as er}from"./layer-DnHLn7Jx.js";import{c as Bi}from"./node-types-CcH5BFf0.js";import{a as rl,b as _s,c as Xu}from"./easing-rWsWG9jZ.js";import"./index-1IIqkHes.js";import"./index-R7zviCWb.js";import"./payload-detail-CniY19rz.js";import"./usePipelineStore-3uhIJZso.js";import"./ping-Chyw2B4c.js";import"./PageLayout-CgrNSpBT.js";import"./listbox-DoXudQ3L.js";import"./use-by-comparator-JYMD8MzS.js";import"./floating-BAAXcOzg.js";import"./element-movement-SAlxPSM7.js";import"./use-text-value-B1ySk7If.js";import"./frozen-TmAR4LIW.js";import"./TimeRangeStepper-BGzUi9Jn.js";import"./MqttModeBadge-OPtXzakb.js";import"./chat-utils-rMBLw-SJ.js";import"./SignalIndicator-BN0oxyDe.js";import"./CollisionExplorerModal-Y5-HwcN-.js";import"./share-2-DIHBn1T5.js";import"./monitor-smartphone-DMj7GqcL.js";import"./circle-question-mark-BPKfem7i.js";import"./map-pin-off-Dtf3D6QW.js";import"./activity-BAV-4Rxi.js";import"./target-CAfnTnyS.js";import"./search-C1Hut7GR.js";/** +import{e as nn,as as ka,r as R,hl as Ca,cB as Ea,dH as Sa,dI as Ma,j as m,aB as So,dJ as Ba,aC as Mo,m as tr,a7 as Yn,aD as Bo,c as Cn,a9 as J0,Y as cr,Z as vn,hm as X0,hn as Do,ho as Da,co as _a,cw as ja,cy as Ta,dD as _o,au as jo,aE as To,d as Dr,b as En,B as Qt,cr as gs,H as Vs,S as Ws,dP as Ro,w as Io,d4 as Lo,R as No,bO as Sn,hp as Ra,z as Kn,N as Ia,cz as Fo,bK as vi,hq as Po,$ as La,ad as Na,dX as Fa,hr as Pa,ay as Qo,cq as bi,bS as Qa,a8 as As,aa as es,ct as Oa,bb as za,fc as Oo,hs as Ha,ht as Ga,dY as Ua,dG as Va,hu as Wa,hv as Ya,aT as zo,a2 as wt,cL as Ho,cA as Ka,gN as Za,hw as $a,hx as qa,hy as Go,gW as Ja,at as _r,bY as Uo,dO as Xa,hz as Vo,hA as Wo,cf as Au,hj as eu,ci as tu,dM as Yo,dQ as ru,ag as nu,hB as su,fo as iu,hC as ys,gm as ou,fW as lu,dC as au}from"./index-CdntfUUz.js";import{u as Gr,M as uu,S as cu,B as fu}from"./BasemapLayer-U4r1eipM.js";import{u as Ko,r as Zo,e as ki,f as Ci,g as hu}from"./consumer-registry-K46Bg-WH.js";import{L as W0,c as du}from"./link-scoring-CnR8SbVy.js";import{C as mu}from"./ConfirmModal-CB8xdBeW.js";import{s as pu,a as gu,M as yu}from"./variants-Bez4f_xY.js";import{G as Ds}from"./git-branch-BfTP80e2.js";import{D as xu}from"./database-D8ZiJ_7E.js";import{H as wu,A as x0,D as Ei,u as mn}from"./useMapViewStore-Ciaw6Y-k.js";import{E as $o}from"./eye-Dc2SU7n8.js";import{b as vu,e as bu,a as qo,m as Si,W as ku,E as Cu,u as Eu,G as Su,g as Mu,d as Bu,f as Du}from"./max-DUHCwm37.js";import{F as _u}from"./funnel-0W7-MqFe.js";import{P as ju}from"./plus-BHawoJ76.js";import{C as Tu}from"./compass-CPwUyboh.js";import{Z as Ru}from"./zap-BZEYLUfp.js";import{T as Iu}from"./trash-2-Ym16rcs6.js";import{W as Lu}from"./wifi-off-BkS_iqlS.js";import{W as Nu}from"./wifi-6W1pAdZl.js";import{C as Fu}from"./circle-alert-8MQex_uC.js";import{C as Jo}from"./clock-DKukpMjT.js";import{C as Pu}from"./WorkspaceNav-BZrtCI1_.js";import{u as Ys,a as Xo,b as Al,c as Qu,d as Ou,e as Ks,f as Mi,R as zu,g as Hu,h as el,t as Gu,i as Uu,j as Vu,k as Wu}from"./useReplayTick-C7ZhPZyZ.js";import{L as Yu}from"./LightSparkline-B-EJJe6x.js";import{P as tl,R as Ku}from"./Contacts-DiQfIa8j.js";import{H as Z0,C as fr,N as Zu,a as $u}from"./badge-colors-Dl76Mz8m.js";import{M as qu}from"./map-pin-ADTzwr8W.js";import{W as Ju}from"./wrench-BDb_Mrbt.js";import{S as Hr,L as er}from"./layer-BRKnZ2f8.js";import{c as Bi}from"./node-types-rkAZo2WA.js";import{a as rl,b as _s,c as Xu}from"./easing-BV_uJNeb.js";import"./index-tm_sy7-t.js";import"./index-Bfbz8_Ci.js";import"./payload-detail-D7dyXv-d.js";import"./usePipelineStore-B9TPEPcv.js";import"./ping-D6oK6s8c.js";import"./PageLayout-B2kQpvXM.js";import"./listbox-LgRZMHBN.js";import"./use-by-comparator-Dgy5yCaL.js";import"./floating-B9JazpOE.js";import"./element-movement-rOMuf_3T.js";import"./use-text-value-DFkKaUWL.js";import"./frozen-C1Yg1x_W.js";import"./TimeRangeStepper-JPYSHI2J.js";import"./MqttModeBadge-2hTXq31i.js";import"./chat-utils-D8ZwjCT3.js";import"./SignalIndicator-CKCIivNj.js";import"./CollisionExplorerModal-brcQ7JMt.js";import"./share-2-ceQyHw_t.js";import"./monitor-smartphone-X03XrJWF.js";import"./circle-question-mark-EfmCIEVS.js";import"./map-pin-off-DdXFAKLD.js";import"./activity-02b04F6Q.js";import"./target-D6g_GBrY.js";import"./search-D8B8LMYr.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Dashboard-Dt57NbQx.js b/frontend/dist/assets/Dashboard-1WPD5yy7.js similarity index 97% rename from frontend/dist/assets/Dashboard-Dt57NbQx.js rename to frontend/dist/assets/Dashboard-1WPD5yy7.js index b1dfbbdb..51d41e69 100644 --- a/frontend/dist/assets/Dashboard-Dt57NbQx.js +++ b/frontend/dist/assets/Dashboard-1WPD5yy7.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CAHLMlrb.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); -import{e as ee,k as gs,n as Bt,o as Rt,J as ys,p as bs,q as js,t as He,v as ws,r as u,M as Ns,w as vs,_ as nt,x as at,y as Dt,z as we,D as At,E as Ms,F as te,G as ks,j as t,d as et,m as Pe,S as Pt,H as Lt,U as Cs,K as Ts,L as $t,N as Ee,P as Ae,Q as Ss,T as _s,V as Q,W as Bs,X as Rs,Y as K,$ as Ie,a0 as Ft,a1 as Et,a2 as ne,a3 as Ds,a4 as As,a5 as je,a6 as Ps,a7 as ot,a8 as Ls,a9 as $s,aa as Fs,ab as Es,ac as Is,ad as le,f as It,ae as Ht,af as Hs,B as Le,R as zt,ag as Ot,ah as zs,ai as Ne,aj as ae,ak as Gt,al as Wt,am as Os,an as Gs,ao as Ws,ap as qs,aq as Us,ar as ze,u as qt,as as Xs,at as rt,au as fe,av as ke,aw as Ut,ax as Vs,c as J,ay as Ys,az as Xt,aA as Ks,aB as Vt,aC as Yt,aD as Js,aE as Zs,aF as Qs,aG as ve,aH as en,aI as tn,aJ as sn,aK as tt,aL as nn,aM as Kt,aN as Jt,aO as an,aP as on,Z as it,aQ as Zt,aR as rn,aS as ln,aT as cn,aU as lt}from"./index-CAHLMlrb.js";import{C as ct,P as dn,a as un,B as mn}from"./PageLayout-CgrNSpBT.js";import{u as he,r as pe,h as fn,a as hn,b as pn,i as xn}from"./consumer-registry-Bsx-B9R6.js";import{A as ie,D as Je,S as gn}from"./DataValue-B6B0O-xC.js";import{c as yn}from"./node-types-CcH5BFf0.js";import{b as Qt,c as ye,a as bn,d as jn,F as Ce}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as wn,u as Ze,P as Nn,T as vn,C as es}from"./PacketList-ODK5IJ9o.js";import{useGetDecodedContent as Mn,useResolveSource as kn}from"./usePipelineStore-3uhIJZso.js";import{A as dt}from"./arrow-right-C5Fuejc9.js";import{T as ts}from"./TimeRangeStepper-BGzUi9Jn.js";import{L as ss}from"./LightSparkline-g9bCtOHr.js";import{c as Cn}from"./link-scoring-CFJjEb_I.js";import{T as Tn}from"./timer-DIDXOFnU.js";import{Z as Sn}from"./zap-BraNZRWh.js";import{A as _n,N as Bn}from"./AutoConfigureDialog-BAQ5UEr_.js";import{g as Rn,e as Oe,a as Dn,f as An}from"./chat-utils-rMBLw-SJ.js";import{C as Pn}from"./ChatBubble-Cn1oh8mi.js";import{M as ns}from"./message-square-text-BDbAHWCI.js";import{C as ut}from"./WorkspaceNav-ClxMgBhr.js";import{H as Ln}from"./hash-Cs4BXjcy.js";import{M as $n}from"./message-square-B56EP67q.js";import{M as Fn}from"./MqttModeBadge-OPtXzakb.js";import{S as En}from"./shield-check-DX3QVGvb.js";import{W as In}from"./wand-sparkles-C18LiNtQ.js";import{u as me}from"./index-1IIqkHes.js";import{H as Hn}from"./useMapViewStore-Dq-l5Xvs.js";import{R as mt}from"./Grid-B0tNiHTX.js";import"./chevron-up-51iePx4b.js";import"./primitives-B7bSO4E3.js";import"./badge-colors-Dl76Mz8m.js";import"./SignalIndicator-BN0oxyDe.js";import"./arrow-up-BmXPNI2T.js";import"./arrow-down-COuxy1kb.js";import"./payload-detail-CniY19rz.js";import"./map-pin-CNePTCsc.js";import"./circle-question-mark-BPKfem7i.js";import"./layers-CU7un-PT.js";import"./clock-DB7tKCHV.js";import"./route-B8rlrav9.js";import"./activity-BAV-4Rxi.js";import"./database-BeT3SO6w.js";import"./shield-CxlpbCLH.js";import"./floating-BAAXcOzg.js";import"./monitor-smartphone-DMj7GqcL.js";import"./index-R7zviCWb.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CdntfUUz.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); +import{e as ee,k as gs,n as Bt,o as Rt,J as ys,p as bs,q as js,t as He,v as ws,r as u,M as Ns,w as vs,_ as nt,x as at,y as Dt,z as we,D as At,E as Ms,F as te,G as ks,j as t,d as et,m as Pe,S as Pt,H as Lt,U as Cs,K as Ts,L as $t,N as Ee,P as Ae,Q as Ss,T as _s,V as Q,W as Bs,X as Rs,Y as K,$ as Ie,a0 as Ft,a1 as Et,a2 as ne,a3 as Ds,a4 as As,a5 as je,a6 as Ps,a7 as ot,a8 as Ls,a9 as $s,aa as Fs,ab as Es,ac as Is,ad as le,f as It,ae as Ht,af as Hs,B as Le,R as zt,ag as Ot,ah as zs,ai as Ne,aj as ae,ak as Gt,al as Wt,am as Os,an as Gs,ao as Ws,ap as qs,aq as Us,ar as ze,u as qt,as as Xs,at as rt,au as fe,av as ke,aw as Ut,ax as Vs,c as J,ay as Ys,az as Xt,aA as Ks,aB as Vt,aC as Yt,aD as Js,aE as Zs,aF as Qs,aG as ve,aH as en,aI as tn,aJ as sn,aK as tt,aL as nn,aM as Kt,aN as Jt,aO as an,aP as on,Z as it,aQ as Zt,aR as rn,aS as ln,aT as cn,aU as lt}from"./index-CdntfUUz.js";import{C as ct,P as dn,a as un,B as mn}from"./PageLayout-B2kQpvXM.js";import{u as he,r as pe,h as fn,a as hn,b as pn,i as xn}from"./consumer-registry-K46Bg-WH.js";import{A as ie,D as Je,S as gn}from"./DataValue-Cy2BSezA.js";import{c as yn}from"./node-types-rkAZo2WA.js";import{b as Qt,c as ye,a as bn,d as jn,F as Ce}from"./meshcore-tx-constants-DgpFTAmf.js";import{S as wn,u as Ze,P as Nn,T as vn,C as es}from"./PacketList-CyBre3jR.js";import{useGetDecodedContent as Mn,useResolveSource as kn}from"./usePipelineStore-B9TPEPcv.js";import{A as dt}from"./arrow-right-DDhVPQqL.js";import{T as ts}from"./TimeRangeStepper-JPYSHI2J.js";import{L as ss}from"./LightSparkline-B-EJJe6x.js";import{c as Cn}from"./link-scoring-CnR8SbVy.js";import{T as Tn}from"./timer-nBNC7t-g.js";import{Z as Sn}from"./zap-BZEYLUfp.js";import{A as _n,N as Bn}from"./AutoConfigureDialog-I0jHfgv3.js";import{g as Rn,e as Oe,a as Dn,f as An}from"./chat-utils-D8ZwjCT3.js";import{C as Pn}from"./ChatBubble-BXwtJZuf.js";import{M as ns}from"./message-square-text-CaBiKUOL.js";import{C as ut}from"./WorkspaceNav-BZrtCI1_.js";import{H as Ln}from"./hash-Ccz7W0IK.js";import{M as $n}from"./message-square-B7BGKpkr.js";import{M as Fn}from"./MqttModeBadge-2hTXq31i.js";import{S as En}from"./shield-check-D7YYO1tX.js";import{W as In}from"./wand-sparkles-By2ieoA5.js";import{u as me}from"./index-tm_sy7-t.js";import{H as Hn}from"./useMapViewStore-Ciaw6Y-k.js";import{R as mt}from"./Grid-DYtN9_Hv.js";import"./chevron-up-CFeeYtPO.js";import"./primitives-Bl26dfm-.js";import"./badge-colors-Dl76Mz8m.js";import"./SignalIndicator-CKCIivNj.js";import"./arrow-up-C1m6otp9.js";import"./arrow-down-npn6XFzD.js";import"./payload-detail-D7dyXv-d.js";import"./map-pin-ADTzwr8W.js";import"./circle-question-mark-EfmCIEVS.js";import"./layers-80mLD98M.js";import"./clock-DKukpMjT.js";import"./route-CeOQcqdX.js";import"./activity-02b04F6Q.js";import"./database-D8ZiJ_7E.js";import"./shield-CNxoSMJk.js";import"./floating-B9JazpOE.js";import"./monitor-smartphone-X03XrJWF.js";import"./index-Bfbz8_Ci.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -49,7 +49,7 @@ import{e as ee,k as gs,n as Bt,o as Rt,J as ys,p as bs,q as js,t as He,v as ws,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ta=[["circle",{cx:"7",cy:"7",r:"5",key:"x29byf"}],["circle",{cx:"17",cy:"17",r:"5",key:"1op1d2"}],["path",{d:"M12 17h10",key:"ls21zv"}],["path",{d:"m3.46 10.54 7.08-7.08",key:"1rehiu"}]],sa=ee("tablets",ta);function na(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],l=e[3+o],c=gs(r,a,l);return n?c(s):c}function aa(e,n,o={}){const s=e.get();let r=null,a=s,l;const c=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,m=()=>{r&&(r.stop(),r=null)},d=()=>{m();const f=xt(e.get()),b=xt(a);f!==b&&(r=new ys({keyframes:[f,b],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:l}))};if(e.attach((f,b)=>{a=f,l=i=>b(pt(i,c)),Bt.postRender(()=>{var i;d(),(i=e.events.animationStart)==null||i.notify(),r==null||r.then(()=>{var g;(g=e.events.animationComplete)==null||g.notify()})})},m),Rt(n)){const f=n.on("change",i=>e.set(pt(i,c))),b=e.on("destroy",f);return()=>{f(),b()}}return m}function pt(e,n){return n?e+n:e}function xt(e){return typeof e=="number"?e:parseFloat(e)}function rs(e,n){const o=me(n()),s=()=>o.set(n());return s(),bs(()=>{const r=()=>Bt.preRender(s,!1,!0),a=e.map(l=>l.on("change",r));return()=>{a.forEach(l=>l()),js(s)}}),o}function oa(e){He.current=[],e();const n=rs(He.current,e);return He.current=void 0,n}function ra(e,n,o,s){if(typeof e=="function")return oa(e);const a=na(n,o,s);return Array.isArray(e)?gt(e,a):gt([e],([l])=>a(l))}function gt(e,n){const o=ws(()=>[]);return rs(e,()=>{o.length=0;const s=e.length;for(let r=0;rRt(e)?e.get():e;if(o)return ra(s);const r=me(s());return u.useInsertionEffect(()=>aa(r,e,n),[r,JSON.stringify(n)]),r}function Te(e,n={}){return ia(e,{type:"spring",...n})}const re=vs(()=>({result:null,isComputing:!1})),la=500,ca=300;let de=null,Se=null;function da(e){var o;const n=(o=e==null?void 0:e.config)==null?void 0:o.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 ua(){if(de)return de;if(typeof window>"u")return null;try{de=new Worker(new URL("/assets/dashboard-bucketing.worker-BwrZMAuc.js",import.meta.url),{type:"module"}),de.onmessage=e=>{if(e.data.type==="error"){console.error("[DashboardBucketing] Worker error:",e.data.error),re.setState({isComputing:!1});return}re.setState({result:e.data.payload,isComputing:!1})},de.onerror=e=>{console.error("[DashboardBucketing] Worker error:",e),re.setState({isComputing:!1})}}catch(e){console.error("[DashboardBucketing] Failed to init worker:",e)}return de}function ma(e,n,o,s){const r=ua();if(!r)return;const a=e.length,l=new Float64Array(a),c=new Float64Array(a),m=new Uint16Array(a),d=new Uint8Array(a),f=new Uint8Array(a),b=new Uint8Array(a),i=new Uint8Array(a),g=new Float32Array(a),y=new Float32Array(a),h=new Uint32Array(a),j=new Map;let _=0;for(let C=0;CparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function fa(e,n,o){const s={...e,received:[...e.received],unique_received:[...e.unique_received],transmitted:[...e.transmitted],forwarded:[...e.forwarded],dropped:[...e.dropped],receivedBytesBuckets:e.receivedBytesBuckets.map(f=>({...f,bytesByType:{...f.bytesByType},countByType:{...f.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(f=>({...f,bytesByType:{...f.bytesByType},countByType:{...f.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(f=>({...f,bytesByType:{...f.bytesByType},countByType:{...f.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:l,bucket_count:c}=e,m=new Set;for(const f of n){const b=f.timestamp??0;if(ba)continue;const i=Math.floor((b-r)/l);if(i<0||i>=c)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=Dt(f,o),y=f.length??f.payload_length??0,h=f.type??f.payload_type??0,j=f.packet_origin;j==="tx_local"?(s.transmitted[i].count++,s.transmitted[i].airtime_ms+=g):j==="tx_forward"||f.transmitted?(s.forwarded[i].count++,s.forwarded[i].airtime_ms+=g,s.forwardedBytesBuckets[i].bytesByType[h]=(s.forwardedBytesBuckets[i].bytesByType[h]??0)+y,s.forwardedBytesBuckets[i].totalBytes+=y,s.forwardedBytesBuckets[i].countByType[h]=(s.forwardedBytesBuckets[i].countByType[h]??0)+1,s.forwardedBytesBuckets[i].totalCount++,s.forwardedTotalByType[h]=(s.forwardedTotalByType[h]??0)+y,s.totalForwardedCount++):f.drop_reason&&(s.dropped[i].count++,s.dropped[i].airtime_ms+=g,s.droppedBytesBuckets[i].bytesByType[h]=(s.droppedBytesBuckets[i].bytesByType[h]??0)+y,s.droppedBytesBuckets[i].totalBytes+=y,s.droppedBytesBuckets[i].countByType[h]=(s.droppedBytesBuckets[i].countByType[h]??0)+1,s.droppedBytesBuckets[i].totalCount++,s.droppedTotalByType[h]=(s.droppedTotalByType[h]??0)+y,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[h]=(s.receivedBytesBuckets[i].bytesByType[h]??0)+y,s.receivedBytesBuckets[i].totalBytes+=y,s.receivedBytesBuckets[i].countByType[h]=(s.receivedBytesBuckets[i].countByType[h]??0)+1,s.receivedBytesBuckets[i].totalCount++,s.receivedTotalByType[h]=(s.receivedTotalByType[h]??0)+y,s.receivedCountByType[h]=(s.receivedCountByType[h]??0)+1,s.totalReceivedBytes+=y)}const d=s.time_range_minutes/60;return s.kbPerHour=d>0?Math.round(s.totalReceivedBytes/1024/d):0,s.forwardedRatePerHour=d>0?Math.round(s.totalForwardedCount/d):0,s.droppedRatePerHour=d>0?Math.round(s.totalDroppedCount/d):0,s.receivedActiveTypes=Ge(s.receivedTotalByType),s.forwardedActiveTypes=Ge(s.forwardedTotalByType),s.droppedActiveTypes=Ge(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([nt(()=>import("./index-CAHLMlrb.js").then(e=>e.hG),__vite__mapDeps([0,1])),nt(()=>import("./index-CAHLMlrb.js").then(e=>e.hE),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(l=>{const c=l.packets.length,m=l.globalTimeRangeIndex,d=da(l.stats);if(c===s&&m===r&&d===a)return;const f=s,b=r,i=a;if(s=c,r=m,a=d,c===0)return;const g=o[m]??o[4],y=g.minutes,h=g.buckets,j=l.stats,_=at(j),k=c-f,C=m!==b,S=d!==i,R=re.getState().result;if(!C&&!S&&k>0&&k{Se=null;const x=e.useStore.getState();if(x.packets.length===0||!x.stats)return;const D=o[x.globalTimeRangeIndex]??o[4],N=at(x.stats);ma(x.packets,D.minutes,D.buckets,N)},ca)})});const ha=()=>re(e=>e.result),is=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:fn}];pe(is);function pa(e,n){const o=$t(new Date(e*1e3),n);return o>=6&&o<18}function yt(e,n){return Ee(new Date(e*1e3),n)}const xe=32,We=20,xa=[.25,.5,.75,1];function ga({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){he(is);const r=we(),a=At(),[l,c]=u.useState(null),[m,d]=u.useState(null),[f,b]=u.useState(null),[i,g]=u.useState(null),[y,h]=u.useState(null),j=u.useCallback((N,p,M)=>{d(N),c(p),g(M)},[]),_=e.length>0&&n.length>0,k=l?pa(l.start,r):null,C=l?yt(l.start,r):"",S=y!==null&&k!==null&&y!==k;k!==y&&h(k);const R=u.useMemo(()=>Ms(e),[e]),w=s==="count"?te:ks,x=u.useMemo(()=>R===0?[]:xa.map(N=>({pct:N,label:w(Math.round(R*N)),pos:(1-N)*100})),[R,w]),D=u.useMemo(()=>{if(e.length===0)return[];const N=e.length,p=Math.max(1,Math.floor(N/6)),M=[];for(let T=0;Tt.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${M}%`,transform:N===1?"none":"translateY(-50%)",right:0},children:p},N))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:We},children:_&&t.jsx(Cs,{buckets:e,activeTypes:n,gridColor:a.grid,axisTickColor:a.axisTick,onHover:j,highlightedType:f,highlightedBucketIndex:m,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:xe,height:We},"aria-hidden":"true",children:D.map((N,p)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${N.pos}%`,transform:p===0?"none":p===D.length-1?"translateX(-100%)":"translateX(-50%)"},children:N.label},p))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:_&&t.jsx(Ts,{activeTypes:n,totalByType:o,hoveredByType:(l==null?void 0:l.bytesByType)??null,highlightedType:f,onTypeHover:b,formatMode:s})})]})}const bt={top:8,right:8,bottom:28,left:48},jt={top:0,right:0,bottom:0,left:0};let _e=null,wt=0;const ya=1e3;function ba(){const e=performance.now();return _e&&e-wth&&(h=T),F>j&&(j=F)}h===0&&j===0?(h=1,j=1):h===0?h=1:j===0&&(j=1);const _=h*1.05,k=j*1.05,C=_+k;let S=_/C;S=Math.max($e,Math.min(1-$e,S));const R=c-f,w=S*R,x=(1-S)*R,D=a+w,N=a+w+f,p=a+w+f/2;for(let M=0;M0)for(const E of s){const v=P[E]??0;if(v===0)continue;const L=v/_*w,A=F-L;e.fillStyle=Ae(E),e.fillRect(T,A,i,L),F=A}let $=N;const B=o[M].countByType;if(y[M]>0){const E=B[Q]??0;if(E>0){const v=E/k*x;e.fillStyle=Ae(Q),e.fillRect(T,$,i,v),$+=v}for(const v of s){if(v===Q)continue;const L=B[v]??0;if(L===0)continue;const A=L/k*x;e.fillStyle=Ae(v),e.fillRect(T,$,i,A),$+=A}}}return{baselineY:p,fwdHalf:w,drpHalf:x,fwdCeil:_,drpCeil:k,gapPx:f}}function wa(e,n,o,s,r,a,l,c,m,d,f,b=!1){if(n.length===0)return;const{baselineY:i,fwdHalf:g,drpHalf:y,fwdCeil:h,drpCeil:j,gapPx:_}=m,k=ba(),C=i-Math.ceil(_/2),S=i+Math.floor(_/2);e.save(),e.strokeStyle=l,e.lineWidth=1*d,e.setLineDash([]);const R=[.5,1];for(const w of R){const x=Math.round(C-w*g)+.5;e.beginPath(),e.moveTo(o,x),e.lineTo(o+r,x),e.stroke();const D=Math.round(S+w*y)+.5;e.beginPath(),e.moveTo(o,D),e.lineTo(o+r,D),e.stroke()}if(e.restore(),e.clearRect(o,i-Math.ceil(_/2),r,_),!b){e.save(),e.font=`bold ${10*d}px ${k}`,e.textAlign="left";const w=4*d,x=2*d;for(const D of R){const N=Math.round(h*D),p=Math.round(j*D),M=D===1,T=C-D*g,F=S+D*y;N>0&&(e.fillStyle=K.green,e.globalAlpha=.7,M?(e.textBaseline="top",e.fillText(te(N),w,T+x)):(e.textBaseline="middle",e.fillText(te(N),w,T))),p>0&&(e.fillStyle=K.red,e.globalAlpha=.7,M?(e.textBaseline="bottom",e.fillText(te(p),w,F-x)):(e.textBaseline="middle",e.fillText(te(p),w,F)))}e.globalAlpha=1,e.restore()}if(!b){e.save(),e.font=`${12*d}px ${k}`,e.fillStyle=c,e.textBaseline="top",e.textAlign="center";const w=8*d,x=n.length,D=Math.max(1,Math.floor(x/6)),N=r/x;for(let p=0;p{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const l=s===Q?"CRC":Ss[s]??`TYPE_${s}`;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"shrink-0 w-3 h-3 rounded-xs",style:{backgroundColor:Ae(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:l}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",te(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",te(a)]})]})]},s)})})}function va(e,n,o){const s=e.length;let r=0,a=0;for(let f=0;fr&&(r=b),i>a&&(a=i)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const l=r*1.05,c=a*1.05,m=l+c;let d=l/m;return d=Math.max($e,Math.min(1-$e,d)),{fwdMax:Math.round(l),drpMax:Math.round(c),fwdFrac:d}}function Ma({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:l=!1}){const c=we(),m=u.useRef(null),d=u.useRef(null),f=u.useRef(e),b=u.useRef(n),i=u.useRef(o),g=u.useRef(l),y=u.useRef(c);f.current=e,b.current=n,i.current=o,g.current=l,y.current=c;const h=l?jt:bt,j=typeof document<"u"&&document.documentElement.dataset.mode!=="light",_=r||(j?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),k=a||(j?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),C=u.useRef({gridColor:_,axisTickColor:k});C.current={gridColor:_,axisTickColor:k};const S=e.length,R=u.useMemo(()=>{const D=e.map(p=>p.start),N=e.map(()=>1);return[D,N]},[S]),w=u.useCallback(D=>{if(!m.current||e.length===0)return;const N=m.current.getBoundingClientRect(),p=D.clientX-N.left,M=l?jt:bt,T=M.left,F=N.width-M.left-M.right,$=(p-T)/F;if($<0||$>1){s==null||s(null,null,null);return}const B=Math.min(e.length-1,Math.max(0,Math.floor($*e.length)));s==null||s(B,e[B],$)},[e,s]),x=u.useCallback(()=>{s==null||s(null,null,null)},[s]);return u.useEffect(()=>{if(!m.current||S===0)return;const D=m.current;let N=null;const p=_s(()=>{const M=D.getBoundingClientRect(),T=Math.floor(M.width)||400,F=Math.floor(M.height)||200,P={width:T,height:F,padding:[h.top,h.right,h.bottom,h.left],cursor:{show:!1},scales:{x:{time:!1},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],legend:{show:!1},hooks:{draw:[B=>{const E=B.ctx,{left:v,top:L,width:A,height:I}=B.bbox,O=window.devicePixelRatio||1,H=C.current,z=f.current;z.length>=2&&Rs(E,z[0].start,z[z.length-1].end,v,L,A,I,K.blue,.08,y.current);const X=ja(E,f.current,b.current,i.current,v,L,A,I);wa(E,f.current,v,L,A,I,H.gridColor,H.axisTickColor,X,O,y.current,g.current)}]}},$=new Bs(P,R,D);d.current=$,N=new ResizeObserver(()=>{const B=D.getBoundingClientRect();B.width>0&&B.height>0&&d.current&&d.current.setSize({width:Math.floor(B.width),height:Math.floor(B.height)})}),N.observe(D)});return()=>{var M;p(),N==null||N.disconnect(),(M=d.current)==null||M.destroy(),d.current=null}},[S]),u.useEffect(()=>{d.current&&d.current.redraw()},[e,n,o,c.dateFormat,c.timeFormat,c.timeZone,c.locale]),e.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted",children:"No data available"}):t.jsx("div",{ref:m,className:"w-full h-full",onMouseMove:w,onMouseLeave:x})}const ka=u.memo(Ma),ls=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];pe(ls);function Ca(e,n){const o=$t(new Date(e*1e3),n);return o>=6&&o<18}function Nt(e,n){return Ee(new Date(e*1e3),n)}const ge=32,qe=20,Ta=[.5,1];function Sa({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:l,crcHistory:c,receivedCount:m,forwardedTotalByType:d,droppedTotalByType:f,startTime:b,bucketDurationSeconds:i,bucketCount:g,timeRangeMinutes:y}){he(ls);const h=we(),j=At(),_=Ie(),[k,C]=u.useState(null),[S,R]=u.useState(null),[w,x]=u.useState(null),D=u.useCallback((G,W,Y)=>{C(W),R(Y)},[]),N=Math.max(1,y/60),p=u.useMemo(()=>Ft(_,N),[_,N]),M=u.useMemo(()=>p?Et(p):0,[p]),T=Math.round(M*10)/10,F=Math.round((p==null?void 0:p.avgBackoffMs)??0),{fwdMirror:P,drpMirror:$,allTypes:B,fwdTotals:E,drpTotals:v}=u.useMemo(()=>{const G=e.map(U=>({start:U.start,end:U.end,countByType:{...U.countByType}})),W=new Array(g).fill(0);for(const U of c){let Z=Math.floor((U.timestamp-b)/i);Z<0&&(Z=0),!(Z>=g)&&W[Z]++}const Y=n.map((U,Z)=>({start:U.start,end:U.end,countByType:{...U.countByType,...W[Z]>0?{[Q]:W[Z]}:{}}})),V=new Set([...o,...s]);l>0&&V.add(Q);const se={...d},oe={...f};l>0&&(oe[Q]=l);const Me=[...V].sort((U,Z)=>{const xs=(se[U]??0)+(oe[U]??0);return(se[Z]??0)+(oe[Z]??0)-xs});return{fwdMirror:G,drpMirror:Y,allTypes:Me,fwdTotals:se,drpTotals:oe}},[e,n,o,s,c,l,b,i,g,d,f]),L=B.length>0&&P.length>0,A=k?Ca(k.start,h):null,I=k?Nt(k.start,h):"",O=w!==null&&A!==null&&w!==A;A!==w&&x(A);const H=u.useMemo(()=>L?va(P,$,B):null,[L,P,$,B]),z=u.useMemo(()=>{if(!H)return[];const{fwdMax:G,drpMax:W,fwdFrac:Y}=H,V=[];for(const se of Ta){const oe=Math.round(G*se);if(oe>0){const U=(1-se)*Y*100;V.push({label:te(oe),pos:U,color:"green"})}const Me=Math.round(W*se);if(Me>0){const U=(Y+se*(1-Y))*100;V.push({label:te(Me),pos:U,color:"red"})}}return V},[H]),X=u.useMemo(()=>{if(P.length===0)return[];const G=P.length,W=Math.max(1,Math.floor(G/6)),Y=[];for(let V=0;Vt.jsx("span",{className:`type-data-xs text-right pr-1.5 ${Y==="green"?"text-sys-green/70":"text-sys-red/70"}`,style:{position:"absolute",top:`${W}%`,transform:W<=1?"none":W>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:G},V))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:ge,right:0,top:0,bottom:qe},children:[L&&H&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${H.fwdFrac*100}%`,background:"var(--sys-blue)",opacity:.1}}),L&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{top:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ht,{className:"w-3 h-3 text-sys-green"}),t.jsx("span",{children:"FWD"})]}),t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{bottom:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ft,{className:"w-3 h-3 text-sys-red"}),t.jsx("span",{children:"DROP"})]})]}),t.jsx("div",{className:`absolute inset-0 flex items-center transition-opacity duration-300 ${L?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":L,children:t.jsx("div",{className:"w-full flex items-center gap-1",children:t.jsx("div",{className:"flex-1 flex items-end gap-1 h-1/2",children:[45,72,33,58,80,42,65,28,55,75,38,62].map((G,W)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${G}%`}},`u${W}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${L?"opacity-100":"opacity-0"}`,children:L&&t.jsx(ka,{forwardedBuckets:P,droppedBuckets:$,allTypes:B,gridColor:j.grid,axisTickColor:j.axisTick,onHover:D,externalAxes:!0})}),L&&H&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${H.fwdFrac*100}%`,background:"var(--sys-red)",opacity:.1}})]}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:ge,height:qe},"aria-hidden":"true",children:X.map((G,W)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${G.pos}%`,transform:W===0?"none":W===X.length-1?"translateX(-100%)":"translateX(-50%)"},children:G.label},W))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:L&&t.jsx(Na,{allTypes:B,forwardedTotalByType:E,droppedTotalByType:v})})]})}const _a=2,Ba=1;function Ra(e,n,o){const s=m=>(m==null?void 0:m.reduce((d,f)=>d+f.count,0))??0,r=s(n),a=s(o),l=r||(e==null?void 0:e.rx_count)||1,c=a||(e==null?void 0:e.dropped_count)||0;return l>0?c/(l+c)*100:0}function Da(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,l)=>a+l.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,l=n.length*o*1e3;return a/l*100}if(e){const r=(e.uptime_seconds||1)*1e3;return(e.total_airtime_ms||e.airtime_used_ms||0)/r*100}return 0}function vt(e,n,o){return bn(Math.max(n,Math.min(o,e)))}function Aa(e,n,o,s,r){let a=Qt(e);n>20?a+=Ce*2:n>12&&(a+=Ce),o>8&&(a+=Ce);const l=vt(a,0,_a);let c=jn(e);o>8&&(c+=Ce);const m=vt(c,0,Ba),d=ye(l),f=ye(m),b=s!==null?ye(s):null;let i="stable";return b!==null&&(d>b?i="increase":d{if(d!=="applying"){f("applying");try{const G=await As({tx_delay_factor:z,direct_tx_delay_factor:X});G!=null&&G.success?(f("success"),setTimeout(()=>f("idle"),2e3)):(f("error"),setTimeout(()=>f("idle"),2500))}catch{f("error"),setTimeout(()=>f("idle"),2500)}}},[d]);if(!l)return t.jsx(je,{children:t.jsx(Ps,{})});const g=10080*60,h=Math.floor(Date.now()/1e3)-g,j=Object.values((e==null?void 0:e.neighbors)??{}).filter(z=>z.zero_hop&&z.last_seen>=h&&yn(z).isRepeater).length,_=b.filter(z=>z.status==="active"||z.lastSeen>=h).length,k=Math.max(j,_),C=Ra(e,n,o),S=Da(e,s,r),R=((I=(A=e==null?void 0:e.config)==null?void 0:A.delays)==null?void 0:I.tx_delay_factor)??null,w=((H=(O=e==null?void 0:e.config)==null?void 0:O.delays)==null?void 0:H.direct_tx_delay_factor)??null,x=Aa(k,C,S,R),D=k!==1,N=Qt(k),p=[`${k} repeater${D?"s":""} heard in the last 7 days (base ×${N.toFixed(1)}).`];x.floodFactor===N&&C<=12&&S<=8?p.push("No modifiers applied — network looks healthy."):(C>20?p.push(`High duplicate rate (${C.toFixed(1)}%) suggests frequent collisions — window widened.`):C>12&&p.push(`Elevated duplicate rate (${C.toFixed(1)}%) — window widened one step.`),S>8&&p.push(`Channel is busy (${S.toFixed(1)}% TX util) — extra spacing added.`));const M=[`Direct uses one forwarder — ×${x.directFactor.toFixed(1)} backoff for channel contention.`];S>8&&M.push("Busy channel — small extra backoff.");const T=[`Flood ×${x.floodFactor.toFixed(1)} (${x.floodSlots} slot${x.floodSlots!==1?"s":""})`,...p,"",`Direct ×${x.directFactor.toFixed(1)}`,...M,"","Click to copy CLI commands"].join(` + */const ta=[["circle",{cx:"7",cy:"7",r:"5",key:"x29byf"}],["circle",{cx:"17",cy:"17",r:"5",key:"1op1d2"}],["path",{d:"M12 17h10",key:"ls21zv"}],["path",{d:"m3.46 10.54 7.08-7.08",key:"1rehiu"}]],sa=ee("tablets",ta);function na(...e){const n=!Array.isArray(e[0]),o=n?0:-1,s=e[0+o],r=e[1+o],a=e[2+o],l=e[3+o],c=gs(r,a,l);return n?c(s):c}function aa(e,n,o={}){const s=e.get();let r=null,a=s,l;const c=typeof s=="string"?s.replace(/[\d.-]/g,""):void 0,m=()=>{r&&(r.stop(),r=null)},d=()=>{m();const f=xt(e.get()),b=xt(a);f!==b&&(r=new ys({keyframes:[f,b],velocity:e.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...o,onUpdate:l}))};if(e.attach((f,b)=>{a=f,l=i=>b(pt(i,c)),Bt.postRender(()=>{var i;d(),(i=e.events.animationStart)==null||i.notify(),r==null||r.then(()=>{var g;(g=e.events.animationComplete)==null||g.notify()})})},m),Rt(n)){const f=n.on("change",i=>e.set(pt(i,c))),b=e.on("destroy",f);return()=>{f(),b()}}return m}function pt(e,n){return n?e+n:e}function xt(e){return typeof e=="number"?e:parseFloat(e)}function rs(e,n){const o=me(n()),s=()=>o.set(n());return s(),bs(()=>{const r=()=>Bt.preRender(s,!1,!0),a=e.map(l=>l.on("change",r));return()=>{a.forEach(l=>l()),js(s)}}),o}function oa(e){He.current=[],e();const n=rs(He.current,e);return He.current=void 0,n}function ra(e,n,o,s){if(typeof e=="function")return oa(e);const a=na(n,o,s);return Array.isArray(e)?gt(e,a):gt([e],([l])=>a(l))}function gt(e,n){const o=ws(()=>[]);return rs(e,()=>{o.length=0;const s=e.length;for(let r=0;rRt(e)?e.get():e;if(o)return ra(s);const r=me(s());return u.useInsertionEffect(()=>aa(r,e,n),[r,JSON.stringify(n)]),r}function Te(e,n={}){return ia(e,{type:"spring",...n})}const re=vs(()=>({result:null,isComputing:!1})),la=500,ca=300;let de=null,Se=null;function da(e){var o;const n=(o=e==null?void 0:e.config)==null?void 0:o.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 ua(){if(de)return de;if(typeof window>"u")return null;try{de=new Worker(new URL("/assets/dashboard-bucketing.worker-BwrZMAuc.js",import.meta.url),{type:"module"}),de.onmessage=e=>{if(e.data.type==="error"){console.error("[DashboardBucketing] Worker error:",e.data.error),re.setState({isComputing:!1});return}re.setState({result:e.data.payload,isComputing:!1})},de.onerror=e=>{console.error("[DashboardBucketing] Worker error:",e),re.setState({isComputing:!1})}}catch(e){console.error("[DashboardBucketing] Failed to init worker:",e)}return de}function ma(e,n,o,s){const r=ua();if(!r)return;const a=e.length,l=new Float64Array(a),c=new Float64Array(a),m=new Uint16Array(a),d=new Uint8Array(a),f=new Uint8Array(a),b=new Uint8Array(a),i=new Uint8Array(a),g=new Float32Array(a),y=new Float32Array(a),h=new Uint32Array(a),j=new Map;let _=0;for(let C=0;CparseInt(n,10)).filter(n=>e[n]>0).sort((n,o)=>e[o]-e[n])}function fa(e,n,o){const s={...e,received:[...e.received],unique_received:[...e.unique_received],transmitted:[...e.transmitted],forwarded:[...e.forwarded],dropped:[...e.dropped],receivedBytesBuckets:e.receivedBytesBuckets.map(f=>({...f,bytesByType:{...f.bytesByType},countByType:{...f.countByType}})),forwardedBytesBuckets:e.forwardedBytesBuckets.map(f=>({...f,bytesByType:{...f.bytesByType},countByType:{...f.countByType}})),droppedBytesBuckets:e.droppedBytesBuckets.map(f=>({...f,bytesByType:{...f.bytesByType},countByType:{...f.countByType}})),receivedTotalByType:{...e.receivedTotalByType},receivedCountByType:{...e.receivedCountByType},forwardedTotalByType:{...e.forwardedTotalByType},droppedTotalByType:{...e.droppedTotalByType}},{start_time:r,end_time:a,bucket_duration_seconds:l,bucket_count:c}=e,m=new Set;for(const f of n){const b=f.timestamp??0;if(ba)continue;const i=Math.floor((b-r)/l);if(i<0||i>=c)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=Dt(f,o),y=f.length??f.payload_length??0,h=f.type??f.payload_type??0,j=f.packet_origin;j==="tx_local"?(s.transmitted[i].count++,s.transmitted[i].airtime_ms+=g):j==="tx_forward"||f.transmitted?(s.forwarded[i].count++,s.forwarded[i].airtime_ms+=g,s.forwardedBytesBuckets[i].bytesByType[h]=(s.forwardedBytesBuckets[i].bytesByType[h]??0)+y,s.forwardedBytesBuckets[i].totalBytes+=y,s.forwardedBytesBuckets[i].countByType[h]=(s.forwardedBytesBuckets[i].countByType[h]??0)+1,s.forwardedBytesBuckets[i].totalCount++,s.forwardedTotalByType[h]=(s.forwardedTotalByType[h]??0)+y,s.totalForwardedCount++):f.drop_reason&&(s.dropped[i].count++,s.dropped[i].airtime_ms+=g,s.droppedBytesBuckets[i].bytesByType[h]=(s.droppedBytesBuckets[i].bytesByType[h]??0)+y,s.droppedBytesBuckets[i].totalBytes+=y,s.droppedBytesBuckets[i].countByType[h]=(s.droppedBytesBuckets[i].countByType[h]??0)+1,s.droppedBytesBuckets[i].totalCount++,s.droppedTotalByType[h]=(s.droppedTotalByType[h]??0)+y,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[h]=(s.receivedBytesBuckets[i].bytesByType[h]??0)+y,s.receivedBytesBuckets[i].totalBytes+=y,s.receivedBytesBuckets[i].countByType[h]=(s.receivedBytesBuckets[i].countByType[h]??0)+1,s.receivedBytesBuckets[i].totalCount++,s.receivedTotalByType[h]=(s.receivedTotalByType[h]??0)+y,s.receivedCountByType[h]=(s.receivedCountByType[h]??0)+1,s.totalReceivedBytes+=y)}const d=s.time_range_minutes/60;return s.kbPerHour=d>0?Math.round(s.totalReceivedBytes/1024/d):0,s.forwardedRatePerHour=d>0?Math.round(s.totalForwardedCount/d):0,s.droppedRatePerHour=d>0?Math.round(s.totalDroppedCount/d):0,s.receivedActiveTypes=Ge(s.receivedTotalByType),s.forwardedActiveTypes=Ge(s.forwardedTotalByType),s.droppedActiveTypes=Ge(s.droppedTotalByType),s}typeof window<"u"&&Promise.all([nt(()=>import("./index-CdntfUUz.js").then(e=>e.hG),__vite__mapDeps([0,1])),nt(()=>import("./index-CdntfUUz.js").then(e=>e.hE),__vite__mapDeps([0,1]))]).then(([e,n])=>{const{DASHBOARD_TIME_RANGES:o}=n;let s=0,r=-1,a="";e.useStore.subscribe(l=>{const c=l.packets.length,m=l.globalTimeRangeIndex,d=da(l.stats);if(c===s&&m===r&&d===a)return;const f=s,b=r,i=a;if(s=c,r=m,a=d,c===0)return;const g=o[m]??o[4],y=g.minutes,h=g.buckets,j=l.stats,_=at(j),k=c-f,C=m!==b,S=d!==i,R=re.getState().result;if(!C&&!S&&k>0&&k{Se=null;const x=e.useStore.getState();if(x.packets.length===0||!x.stats)return;const D=o[x.globalTimeRangeIndex]??o[4],N=at(x.stats);ma(x.packets,D.minutes,D.buckets,N)},ca)})});const ha=()=>re(e=>e.result),is=[{target:"ReceivedChart",fn:"type",minStage:1},{target:"ReceivedChart",fn:"airtime",minStage:1,when:fn}];pe(is);function pa(e,n){const o=$t(new Date(e*1e3),n);return o>=6&&o<18}function yt(e,n){return Ee(new Date(e*1e3),n)}const xe=32,We=20,xa=[.25,.5,.75,1];function ga({buckets:e,activeTypes:n,totalByType:o,mode:s="bytes"}){he(is);const r=we(),a=At(),[l,c]=u.useState(null),[m,d]=u.useState(null),[f,b]=u.useState(null),[i,g]=u.useState(null),[y,h]=u.useState(null),j=u.useCallback((N,p,M)=>{d(N),c(p),g(M)},[]),_=e.length>0&&n.length>0,k=l?pa(l.start,r):null,C=l?yt(l.start,r):"",S=y!==null&&k!==null&&y!==k;k!==y&&h(k);const R=u.useMemo(()=>Ms(e),[e]),w=s==="count"?te:ks,x=u.useMemo(()=>R===0?[]:xa.map(N=>({pct:N,label:w(Math.round(R*N)),pos:(1-N)*100})),[R,w]),D=u.useMemo(()=>{if(e.length===0)return[];const N=e.length,p=Math.max(1,Math.floor(N/6)),M=[];for(let T=0;Tt.jsx("span",{className:"type-data-xs text-fg-secondary text-right pr-1.5",style:{position:"absolute",top:`${M}%`,transform:N===1?"none":"translateY(-50%)",right:0},children:p},N))}),t.jsx("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:xe,right:0,top:0,bottom:We},children:_&&t.jsx(Cs,{buckets:e,activeTypes:n,gridColor:a.grid,axisTickColor:a.axisTick,onHover:j,highlightedType:f,highlightedBucketIndex:m,yAxisFormat:s,externalAxes:!0})}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:xe,height:We},"aria-hidden":"true",children:D.map((N,p)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${N.pos}%`,transform:p===0?"none":p===D.length-1?"translateX(-100%)":"translateX(-50%)"},children:N.label},p))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:_&&t.jsx(Ts,{activeTypes:n,totalByType:o,hoveredByType:(l==null?void 0:l.bytesByType)??null,highlightedType:f,onTypeHover:b,formatMode:s})})]})}const bt={top:8,right:8,bottom:28,left:48},jt={top:0,right:0,bottom:0,left:0};let _e=null,wt=0;const ya=1e3;function ba(){const e=performance.now();return _e&&e-wth&&(h=T),F>j&&(j=F)}h===0&&j===0?(h=1,j=1):h===0?h=1:j===0&&(j=1);const _=h*1.05,k=j*1.05,C=_+k;let S=_/C;S=Math.max($e,Math.min(1-$e,S));const R=c-f,w=S*R,x=(1-S)*R,D=a+w,N=a+w+f,p=a+w+f/2;for(let M=0;M0)for(const E of s){const v=P[E]??0;if(v===0)continue;const L=v/_*w,A=F-L;e.fillStyle=Ae(E),e.fillRect(T,A,i,L),F=A}let $=N;const B=o[M].countByType;if(y[M]>0){const E=B[Q]??0;if(E>0){const v=E/k*x;e.fillStyle=Ae(Q),e.fillRect(T,$,i,v),$+=v}for(const v of s){if(v===Q)continue;const L=B[v]??0;if(L===0)continue;const A=L/k*x;e.fillStyle=Ae(v),e.fillRect(T,$,i,A),$+=A}}}return{baselineY:p,fwdHalf:w,drpHalf:x,fwdCeil:_,drpCeil:k,gapPx:f}}function wa(e,n,o,s,r,a,l,c,m,d,f,b=!1){if(n.length===0)return;const{baselineY:i,fwdHalf:g,drpHalf:y,fwdCeil:h,drpCeil:j,gapPx:_}=m,k=ba(),C=i-Math.ceil(_/2),S=i+Math.floor(_/2);e.save(),e.strokeStyle=l,e.lineWidth=1*d,e.setLineDash([]);const R=[.5,1];for(const w of R){const x=Math.round(C-w*g)+.5;e.beginPath(),e.moveTo(o,x),e.lineTo(o+r,x),e.stroke();const D=Math.round(S+w*y)+.5;e.beginPath(),e.moveTo(o,D),e.lineTo(o+r,D),e.stroke()}if(e.restore(),e.clearRect(o,i-Math.ceil(_/2),r,_),!b){e.save(),e.font=`bold ${10*d}px ${k}`,e.textAlign="left";const w=4*d,x=2*d;for(const D of R){const N=Math.round(h*D),p=Math.round(j*D),M=D===1,T=C-D*g,F=S+D*y;N>0&&(e.fillStyle=K.green,e.globalAlpha=.7,M?(e.textBaseline="top",e.fillText(te(N),w,T+x)):(e.textBaseline="middle",e.fillText(te(N),w,T))),p>0&&(e.fillStyle=K.red,e.globalAlpha=.7,M?(e.textBaseline="bottom",e.fillText(te(p),w,F-x)):(e.textBaseline="middle",e.fillText(te(p),w,F)))}e.globalAlpha=1,e.restore()}if(!b){e.save(),e.font=`${12*d}px ${k}`,e.fillStyle=c,e.textBaseline="top",e.textAlign="center";const w=8*d,x=n.length,D=Math.max(1,Math.floor(x/6)),N=r/x;for(let p=0;p{const r=n[s]??0,a=o[s]??0;if(r===0&&a===0)return null;const l=s===Q?"CRC":Ss[s]??`TYPE_${s}`;return t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("div",{className:"shrink-0 w-3 h-3 rounded-xs",style:{backgroundColor:Ae(s)}}),t.jsx("span",{className:"text-fg-secondary whitespace-nowrap",children:l}),t.jsxs("span",{className:"tabular-nums",children:[t.jsxs("span",{className:"text-sys-green",children:["▲",te(r)]})," ",t.jsxs("span",{className:"text-sys-red",children:["▼",te(a)]})]})]},s)})})}function va(e,n,o){const s=e.length;let r=0,a=0;for(let f=0;fr&&(r=b),i>a&&(a=i)}r===0&&a===0?(r=1,a=1):r===0?r=1:a===0&&(a=1);const l=r*1.05,c=a*1.05,m=l+c;let d=l/m;return d=Math.max($e,Math.min(1-$e,d)),{fwdMax:Math.round(l),drpMax:Math.round(c),fwdFrac:d}}function Ma({forwardedBuckets:e,droppedBuckets:n,allTypes:o,onHover:s,gridColor:r,axisTickColor:a,externalAxes:l=!1}){const c=we(),m=u.useRef(null),d=u.useRef(null),f=u.useRef(e),b=u.useRef(n),i=u.useRef(o),g=u.useRef(l),y=u.useRef(c);f.current=e,b.current=n,i.current=o,g.current=l,y.current=c;const h=l?jt:bt,j=typeof document<"u"&&document.documentElement.dataset.mode!=="light",_=r||(j?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.1)"),k=a||(j?"rgba(255,255,255,0.6)":"rgba(0,0,0,0.6)"),C=u.useRef({gridColor:_,axisTickColor:k});C.current={gridColor:_,axisTickColor:k};const S=e.length,R=u.useMemo(()=>{const D=e.map(p=>p.start),N=e.map(()=>1);return[D,N]},[S]),w=u.useCallback(D=>{if(!m.current||e.length===0)return;const N=m.current.getBoundingClientRect(),p=D.clientX-N.left,M=l?jt:bt,T=M.left,F=N.width-M.left-M.right,$=(p-T)/F;if($<0||$>1){s==null||s(null,null,null);return}const B=Math.min(e.length-1,Math.max(0,Math.floor($*e.length)));s==null||s(B,e[B],$)},[e,s]),x=u.useCallback(()=>{s==null||s(null,null,null)},[s]);return u.useEffect(()=>{if(!m.current||S===0)return;const D=m.current;let N=null;const p=_s(()=>{const M=D.getBoundingClientRect(),T=Math.floor(M.width)||400,F=Math.floor(M.height)||200,P={width:T,height:F,padding:[h.top,h.right,h.bottom,h.left],cursor:{show:!1},scales:{x:{time:!1},y:{range:[0,1]}},axes:[{show:!1},{show:!1}],series:[{},{show:!1}],legend:{show:!1},hooks:{draw:[B=>{const E=B.ctx,{left:v,top:L,width:A,height:I}=B.bbox,O=window.devicePixelRatio||1,H=C.current,z=f.current;z.length>=2&&Rs(E,z[0].start,z[z.length-1].end,v,L,A,I,K.blue,.08,y.current);const X=ja(E,f.current,b.current,i.current,v,L,A,I);wa(E,f.current,v,L,A,I,H.gridColor,H.axisTickColor,X,O,y.current,g.current)}]}},$=new Bs(P,R,D);d.current=$,N=new ResizeObserver(()=>{const B=D.getBoundingClientRect();B.width>0&&B.height>0&&d.current&&d.current.setSize({width:Math.floor(B.width),height:Math.floor(B.height)})}),N.observe(D)});return()=>{var M;p(),N==null||N.disconnect(),(M=d.current)==null||M.destroy(),d.current=null}},[S]),u.useEffect(()=>{d.current&&d.current.redraw()},[e,n,o,c.dateFormat,c.timeFormat,c.timeZone,c.locale]),e.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted",children:"No data available"}):t.jsx("div",{ref:m,className:"w-full h-full",onMouseMove:w,onMouseLeave:x})}const ka=u.memo(Ma),ls=[{target:"RepeaterAnalyticsCard",fn:"type",minStage:1}];pe(ls);function Ca(e,n){const o=$t(new Date(e*1e3),n);return o>=6&&o<18}function Nt(e,n){return Ee(new Date(e*1e3),n)}const ge=32,qe=20,Ta=[.5,1];function Sa({forwardedBuckets:e,droppedBuckets:n,forwardedActiveTypes:o,droppedActiveTypes:s,forwardedCount:r,droppedCount:a,crcCount:l,crcHistory:c,receivedCount:m,forwardedTotalByType:d,droppedTotalByType:f,startTime:b,bucketDurationSeconds:i,bucketCount:g,timeRangeMinutes:y}){he(ls);const h=we(),j=At(),_=Ie(),[k,C]=u.useState(null),[S,R]=u.useState(null),[w,x]=u.useState(null),D=u.useCallback((G,W,Y)=>{C(W),R(Y)},[]),N=Math.max(1,y/60),p=u.useMemo(()=>Ft(_,N),[_,N]),M=u.useMemo(()=>p?Et(p):0,[p]),T=Math.round(M*10)/10,F=Math.round((p==null?void 0:p.avgBackoffMs)??0),{fwdMirror:P,drpMirror:$,allTypes:B,fwdTotals:E,drpTotals:v}=u.useMemo(()=>{const G=e.map(U=>({start:U.start,end:U.end,countByType:{...U.countByType}})),W=new Array(g).fill(0);for(const U of c){let Z=Math.floor((U.timestamp-b)/i);Z<0&&(Z=0),!(Z>=g)&&W[Z]++}const Y=n.map((U,Z)=>({start:U.start,end:U.end,countByType:{...U.countByType,...W[Z]>0?{[Q]:W[Z]}:{}}})),V=new Set([...o,...s]);l>0&&V.add(Q);const se={...d},oe={...f};l>0&&(oe[Q]=l);const Me=[...V].sort((U,Z)=>{const xs=(se[U]??0)+(oe[U]??0);return(se[Z]??0)+(oe[Z]??0)-xs});return{fwdMirror:G,drpMirror:Y,allTypes:Me,fwdTotals:se,drpTotals:oe}},[e,n,o,s,c,l,b,i,g,d,f]),L=B.length>0&&P.length>0,A=k?Ca(k.start,h):null,I=k?Nt(k.start,h):"",O=w!==null&&A!==null&&w!==A;A!==w&&x(A);const H=u.useMemo(()=>L?va(P,$,B):null,[L,P,$,B]),z=u.useMemo(()=>{if(!H)return[];const{fwdMax:G,drpMax:W,fwdFrac:Y}=H,V=[];for(const se of Ta){const oe=Math.round(G*se);if(oe>0){const U=(1-se)*Y*100;V.push({label:te(oe),pos:U,color:"green"})}const Me=Math.round(W*se);if(Me>0){const U=(Y+se*(1-Y))*100;V.push({label:te(Me),pos:U,color:"red"})}}return V},[H]),X=u.useMemo(()=>{if(P.length===0)return[];const G=P.length,W=Math.max(1,Math.floor(G/6)),Y=[];for(let V=0;Vt.jsx("span",{className:`type-data-xs text-right pr-1.5 ${Y==="green"?"text-sys-green/70":"text-sys-red/70"}`,style:{position:"absolute",top:`${W}%`,transform:W<=1?"none":W>=99?"translateY(-100%)":"translateY(-50%)",right:0},children:G},V))}),t.jsxs("div",{className:"absolute overflow-hidden radius-inner depth-stroke-inset bg-chart-inner",style:{left:ge,right:0,top:0,bottom:qe},children:[L&&H&&t.jsx("div",{className:"absolute inset-x-0 top-0 pointer-events-none",style:{height:`${H.fwdFrac*100}%`,background:"var(--sys-blue)",opacity:.1}}),L&&t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{top:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ht,{className:"w-3 h-3 text-sys-green"}),t.jsx("span",{children:"FWD"})]}),t.jsxs("span",{className:"data-box data-box-compact flex items-center gap-1 absolute z-10 pointer-events-none",style:{bottom:8,left:8,background:"var(--surface)",borderColor:"var(--edge-subtle)"},children:[t.jsx(ft,{className:"w-3 h-3 text-sys-red"}),t.jsx("span",{children:"DROP"})]})]}),t.jsx("div",{className:`absolute inset-0 flex items-center transition-opacity duration-300 ${L?"opacity-0 pointer-events-none":"opacity-100"}`,"aria-hidden":L,children:t.jsx("div",{className:"w-full flex items-center gap-1",children:t.jsx("div",{className:"flex-1 flex items-end gap-1 h-1/2",children:[45,72,33,58,80,42,65,28,55,75,38,62].map((G,W)=>t.jsx("div",{className:"flex-1 bg-subtle-fill rounded-sm animate-pulse",style:{height:`${G}%`}},`u${W}`))})})}),t.jsx("div",{className:`h-full transition-opacity duration-300 ${L?"opacity-100":"opacity-0"}`,children:L&&t.jsx(ka,{forwardedBuckets:P,droppedBuckets:$,allTypes:B,gridColor:j.grid,axisTickColor:j.axisTick,onHover:D,externalAxes:!0})}),L&&H&&t.jsx("div",{className:"absolute inset-x-0 bottom-0 pointer-events-none",style:{top:`${H.fwdFrac*100}%`,background:"var(--sys-red)",opacity:.1}})]}),t.jsx("div",{className:"absolute left-0 right-0 bottom-0 pointer-events-none",style:{left:ge,height:qe},"aria-hidden":"true",children:X.map((G,W)=>t.jsx("span",{className:"type-data-xs text-fg-secondary absolute top-1",style:{left:`${G.pos}%`,transform:W===0?"none":W===X.length-1?"translateX(-100%)":"translateX(-50%)"},children:G.label},W))})]}),t.jsx("div",{className:"pt-2 px-1 pb-2 shrink-0",children:L&&t.jsx(Na,{allTypes:B,forwardedTotalByType:E,droppedTotalByType:v})})]})}const _a=2,Ba=1;function Ra(e,n,o){const s=m=>(m==null?void 0:m.reduce((d,f)=>d+f.count,0))??0,r=s(n),a=s(o),l=r||(e==null?void 0:e.rx_count)||1,c=a||(e==null?void 0:e.dropped_count)||0;return l>0?c/(l+c)*100:0}function Da(e,n,o){const s=r=>(r==null?void 0:r.reduce((a,l)=>a+l.count,0))??0;if(n!=null&&n.length&&o){const a=s(n)*100,l=n.length*o*1e3;return a/l*100}if(e){const r=(e.uptime_seconds||1)*1e3;return(e.total_airtime_ms||e.airtime_used_ms||0)/r*100}return 0}function vt(e,n,o){return bn(Math.max(n,Math.min(o,e)))}function Aa(e,n,o,s,r){let a=Qt(e);n>20?a+=Ce*2:n>12&&(a+=Ce),o>8&&(a+=Ce);const l=vt(a,0,_a);let c=jn(e);o>8&&(c+=Ce);const m=vt(c,0,Ba),d=ye(l),f=ye(m),b=s!==null?ye(s):null;let i="stable";return b!==null&&(d>b?i="increase":d{if(d!=="applying"){f("applying");try{const G=await As({tx_delay_factor:z,direct_tx_delay_factor:X});G!=null&&G.success?(f("success"),setTimeout(()=>f("idle"),2e3)):(f("error"),setTimeout(()=>f("idle"),2500))}catch{f("error"),setTimeout(()=>f("idle"),2500)}}},[d]);if(!l)return t.jsx(je,{children:t.jsx(Ps,{})});const g=10080*60,h=Math.floor(Date.now()/1e3)-g,j=Object.values((e==null?void 0:e.neighbors)??{}).filter(z=>z.zero_hop&&z.last_seen>=h&&yn(z).isRepeater).length,_=b.filter(z=>z.status==="active"||z.lastSeen>=h).length,k=Math.max(j,_),C=Ra(e,n,o),S=Da(e,s,r),R=((I=(A=e==null?void 0:e.config)==null?void 0:A.delays)==null?void 0:I.tx_delay_factor)??null,w=((H=(O=e==null?void 0:e.config)==null?void 0:O.delays)==null?void 0:H.direct_tx_delay_factor)??null,x=Aa(k,C,S,R),D=k!==1,N=Qt(k),p=[`${k} repeater${D?"s":""} heard in the last 7 days (base ×${N.toFixed(1)}).`];x.floodFactor===N&&C<=12&&S<=8?p.push("No modifiers applied — network looks healthy."):(C>20?p.push(`High duplicate rate (${C.toFixed(1)}%) suggests frequent collisions — window widened.`):C>12&&p.push(`Elevated duplicate rate (${C.toFixed(1)}%) — window widened one step.`),S>8&&p.push(`Channel is busy (${S.toFixed(1)}% TX util) — extra spacing added.`));const M=[`Direct uses one forwarder — ×${x.directFactor.toFixed(1)} backoff for channel contention.`];S>8&&M.push("Busy channel — small extra backoff.");const T=[`Flood ×${x.floodFactor.toFixed(1)} (${x.floodSlots} slot${x.floodSlots!==1?"s":""})`,...p,"",`Direct ×${x.directFactor.toFixed(1)}`,...M,"","Click to copy CLI commands"].join(` `),F=R!==null?ye(R):null,P=w!==null?ye(w):null,$=F!==null&&x.floodSlots!==F,B=P!==null&&x.directSlots!==P,E=$||B,v=async()=>{const z=`set txdelay ${x.floodFactor.toFixed(1)} set direct.txdelay ${x.directFactor.toFixed(1)}`;await Fs(z),m(!0),setTimeout(()=>m(!1),1500)},L=()=>i(x.floodFactor,x.directFactor);return t.jsxs(je,{children:[t.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2 mb-2 sm:mb-3 flex-wrap",children:[t.jsx(wn,{className:"w-4 h-4 text-icon-card-title flex-shrink-0"}),t.jsx("span",{className:"type-micro",children:"DELAY DOCTOR"}),a&&t.jsx(ne,{color:"zinc",className:"hidden sm:inline-flex",children:a})]}),t.jsxs("button",{onClick:v,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:T,children:[t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("span",{className:"type-data-xl text-fg-primary",children:t.jsxs(Je,{children:["×",x.floodFactor.toFixed(1)]})}),t.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Flood"})]}),t.jsxs("div",{className:"flex-1 flex flex-col",children:[t.jsx("span",{className:"type-data-xl text-sys-blue",children:t.jsxs(Je,{children:["×",x.directFactor.toFixed(1)]})}),t.jsx("span",{className:"type-micro text-fg-muted mt-0.5 sm:mt-1",children:"Direct"})]}),t.jsx("div",{className:"flex items-center self-center opacity-0 group-hover:opacity-100 transition-opacity",children:c?t.jsx(ot,{className:"w-4 h-4 text-sys-green"}):t.jsx(Ls,{className:"w-4 h-4 text-fg-muted"})})]}),t.jsx("div",{className:"flex-1 py-2",children:t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"Dupe"}),t.jsxs("div",{className:`data-box data-box-fill data-box-left ${x.duplicateRate>8?"text-status-warning":""}`,children:[x.duplicateRate.toFixed(1),"%"]})]}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"data-box-label",children:"TX Util"}),t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:[x.txUtilization.toFixed(2),"%"]})]})]})}),t.jsx("div",{className:"pt-2 mt-auto",children:t.jsxs("div",{className:"flex items-end justify-between gap-2",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"data-box-label",children:"Current"}),t.jsx("div",{className:"flex gap-2",children:R!==null?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("div",{className:"data-box data-box-fill data-box-left",children:["×",R.toFixed(2)]})}),t.jsx("div",{className:"flex-1 min-w-0",children:t.jsxs("div",{className:"data-box data-box-fill data-box-left",style:{color:"var(--sys-blue)"},children:["×",(w==null?void 0:w.toFixed(2))??"—"]})})]}):t.jsx("span",{className:"text-sm text-fg-muted",children:"No config"})})]}),E&&t.jsxs("button",{onClick:L,disabled:d==="applying"||d==="success",className:`flex items-center gap-1.5 px-2.5 py-1.5 radius-inner type-micro font-medium transition-base ${d==="success"?"bg-sys-green/15 text-sys-green":d==="error"?"bg-sys-red/15 text-sys-red":d==="applying"?"bg-subtle-fill text-fg-muted":"bg-sys-blue/10 text-sys-blue hover:bg-sys-blue/20"}`,title:`Apply ×${x.floodFactor.toFixed(1)} flood, ×${x.directFactor.toFixed(1)} direct`,children:[d==="success"?"Rx'd":d==="error"?"Failed":"Apply",d==="applying"?t.jsx($s,{className:"w-3.5 h-3.5 animate-spin"}):d==="success"?t.jsx(ot,{className:"w-3.5 h-3.5"}):t.jsxs("span",{className:"relative inline-flex items-end w-6 h-3.5",children:[t.jsx(Jn,{className:"w-3.5 h-3.5 absolute left-0 bottom-0"}),t.jsx(sa,{className:"w-3 h-3 absolute right-0 bottom-0"})]})]})]})})]})}const cs=[{target:"RecentPackets",fn:"rssi",minStage:1},{target:"RecentPackets",fn:"snr",minStage:1}];pe(cs);const La=25;function $a(){he(cs);const e=Ie(),n=Es(),o=Is(),s=le(),r=Mn(),a=Ze(g=>g.requestChannel),[l,c]=u.useState(!0),m=u.useCallback(g=>c(g),[]),d=u.useMemo(()=>[...e.length<=100?e:e.slice(-100)].sort((y,h)=>(h.timestamp??0)-(y.timestamp??0)),[e]),f=s==null?void 0:s.local_hash,b=s==null?void 0:s.neighbors,i=kn();return t.jsxs(je,{noPadding:!0,className:"!overflow-visible",children:[t.jsx(It,{listHeader:!0,icon:t.jsx(zt,{}),title:"Recent Packets",actions:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(Ht,{enabled:l,onChange:m,label:"Hide Dupes",size:"sm"}),o&&t.jsx(Hs,{showLabel:!0}),t.jsxs(Le,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(dt,{"data-slot":"icon"})]})]})}),t.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-1",children:t.jsx(Nn,{packets:d,allPackets:e,localHash:f,neighbors:b,resolveSource:i,getDecodedContent:r,onChannelClick:a,loading:n,maxPackets:La,showPagination:!1,flashNewest:!0,hideDupes:l,emptyMessage:"No packets received",footerAction:t.jsxs(Le,{color:"primary",outline:!0,href:"/packets",children:["View all",t.jsx(dt,{"data-slot":"icon"})]})})})]})}const Fa={stable:"M5 12h14",up:"M5 15l7-7 7 7",down:"M19 9l-7 7-7-7"};function Ea({trend:e}){return t.jsx("span",{className:`mini-widget-trend ${e}`,children:t.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:Fa[e]})})})}function Ia(){return t.jsx("div",{className:"mini-widget-loading",children:t.jsx("div",{className:"mini-widget-loading-spinner"})})}function Ha({message:e}){return t.jsx("div",{className:"mini-widget-error",children:t.jsx("span",{title:e,children:"No data"})})}function ce({title:e,icon:n,value:o,unit:s,valueSize:r="md",status:a,subtitle:l,subtitleValue:c,trend:m,headerRight:d,children:f,isLoading:b=!1,error:i,className:g="",onClick:y,isLoaded:h}){const j=["mini-widget-value",r==="lg"&&"mini-widget-value-lg",r==="sm"&&"mini-widget-value-sm"].filter(Boolean).join(" "),_=["mini-widget",g].filter(Boolean).join(" ");return t.jsxs(je,{noPadding:!0,className:_,onClick:y,isLoaded:h,children:[t.jsxs("div",{className:"mini-widget-header",children:[n,t.jsx("span",{className:"mini-widget-title",children:e}),a&&a!=="unknown"&&t.jsx("div",{className:`mini-widget-status-dot ${a}`}),m&&t.jsx(Ea,{trend:m}),d&&t.jsx("span",{className:"ml-auto flex items-center",children:d})]}),b?t.jsx(Ia,{}):i?t.jsx(Ha,{message:i}):t.jsxs("div",{className:"mini-widget-content",children:[(o!==void 0||l||c)&&t.jsxs("div",{className:"mini-widget-value-row",children:[o!==void 0&&t.jsxs("div",{className:j,children:[typeof o=="number"?t.jsx(ie,{value:o,className:"font-mono tabular-nums",priority:"medium",format:Number.isInteger(o)?void 0:{minimumFractionDigits:1,maximumFractionDigits:1}}):t.jsx(Je,{children:o}),s&&t.jsx("span",{className:"mini-widget-unit",children:s})]}),(l||c)&&t.jsxs("span",{className:"mini-widget-badge-group",children:[l&&!c&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:l}),l&&c&&t.jsx("span",{className:"mini-widget-subtitle truncate",children:l}),c&&t.jsx("span",{className:"data-box mini-widget-subtitle-box",children:c})]})]}),f]})]})}const za={DELTA_CRITICAL:10,SLOPE_CRITICAL:4,JITTER_CRITICAL:6,DELTA_WARNING:5,SLOPE_WARNING:2,JITTER_WARNING:4},ds={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 Qe(e,n){if(e.length===0)return null;const o=[...e].sort((l,c)=>l-c),s=n/100*(o.length-1),r=Math.floor(s),a=Math.ceil(s);return r===a?o[r]:o[r]+(o[a]-o[r])*(s-r)}function Mt(e){return Qe(e,50)}function Oa(e){if(e.length<2)return 0;const n=e.reduce((r,a)=>r+a,0)/e.length,s=e.map(r=>Math.pow(r-n,2)).reduce((r,a)=>r+a,0)/e.length;return Math.sqrt(s)}function Ga(e){if(e.length<2)return 0;const n=e.length;let o=0,s=0,r=0,a=0;const l=e[0].timestamp;for(const m of e){const d=(m.timestamp-l)/3600,f=m.value;o+=d,s+=f,r+=d*f,a+=d*d}const c=n*a-o*o;return Math.abs(c)<1e-4?0:(n*r-o*s)/c}function Wa(e,n,o){const s=za;return e>=s.DELTA_CRITICAL?[2,`Noise floor ${e.toFixed(1)} dB above baseline`]:n>=s.SLOPE_CRITICAL?[2,`Noise floor rising ${n.toFixed(1)} dB/hour`]:o>=s.JITTER_CRITICAL?[2,`Noise floor unstable (±${o.toFixed(1)} dB)`]:e>=s.DELTA_WARNING?[1,`Noise floor ${e.toFixed(1)} dB above baseline`]:n>=s.SLOPE_WARNING?[1,`Noise floor rising ${n.toFixed(1)} dB/hour`]:o>=s.JITTER_WARNING?[1,`Noise floor variable (±${o.toFixed(1)} dB)`]:[0,null]}function qa(e){if(e.length===0)return{...ds,computedAt:Math.floor(Date.now()/1e3)};const n=Math.floor(Date.now()/1e3),o=e.filter(j=>Number.isFinite(j)),s=e.length>0?[e[e.length-1]]:[],r=e.slice(-4).filter(j=>Number.isFinite(j)),a=Mt(o),l=Qe(o,10),c=Qe(o,90),m=Mt(s),d=m!==null&&l!==null?m-l:0,f=r.map((j,_)=>({timestamp:n-(r.length-1-_)*3600,value:j})),b=Ga(f),i=Oa(r),g=o.length>=12,[y,h]=g?Wa(d,b,i):[0,null];return{baselineMedian:a,baselineP10:l,baselineP90:c,currentMedian:m,currentSampleCount:s.length,delta:d,slope:b,jitter:i,penalty:y,penaltyReason:h,computedAt:n,isReliable:g}}const Ua={lbtStats:null,noiseFloor:null,sparklineNoiseFloor:[],noiseFloorWindowHistory:[],linkQuality:null,channelHealth:null,nfTrend:ds,radioConfig:null,trends:null,stats:null,recentPackets:[],quickNeighbors:[],isLoading:!0,error:null,refresh:async()=>{}},us=u.createContext(Ua);function Xa({children:e}){var P;const n=le(),o=Ie(),s=Ot(),r=zs(),a=Ne(),l=ae[a],c=Math.max(1,l.minutes/60),m=n===null,[d,f]=u.useState(null),b=u.useCallback(async()=>{try{const $=await Gt(Math.ceil(c));if($.success&&$.data){f($.data.history);return}const B=await Wt(Math.ceil(c));B.success&&B.data&&B.data.count>0&&f(null)}catch{}},[c]);u.useEffect(()=>{b();const $=setInterval(b,6e4);return()=>clearInterval($)},[b]);const i=u.useMemo(()=>Ft(o,c,d),[o,c,d]),g=(n==null?void 0:n.noise_floor_dbm)??null,y=u.useMemo(()=>Os(g)?g:null,[g]),h=u.useMemo(()=>{var B;const $=(B=n==null?void 0:n.config)==null?void 0:B.radio;return $?{sf:$.spreading_factor??7,bwHz:$.bandwidth??125e3}:null},[(P=n==null?void 0:n.config)==null?void 0:P.radio]),j=Gs(c),_=Ws(c),k=n==null?void 0:n.neighbors,C=u.useMemo(()=>Object.fromEntries(Object.entries(k??{}).filter(([B])=>!r.has(B))),[k,r]),S=u.useMemo(()=>s.filter($=>!r.has($.hash)),[s,r]),R=u.useMemo(()=>qa(j),[j]),w=u.useMemo(()=>qs(S,C,h),[S,C,h]),x=u.useMemo(()=>Us(i,y,w),[i,y,w]),[D,N]=u.useState({noiseFloor:null,networkScore:null,channelHealth:null}),p=u.useRef(0);u.useEffect(()=>{const $=()=>{const E=Date.now();E-p.current>3e4&&(p.current=E,N({noiseFloor:y,networkScore:(w==null?void 0:w.networkScore)??null,channelHealth:(x==null?void 0:x.score)??null}))};$();const B=setInterval($,5e3);return()=>clearInterval(B)},[y,w==null?void 0:w.networkScore,x==null?void 0:x.score]);const M=u.useMemo(()=>({noiseFloor:{current:y,previous:D.noiseFloor,trend:y!==null?ze(y,D.noiseFloor,2,!0):"stable"},networkScore:{current:(w==null?void 0:w.networkScore)??0,previous:D.networkScore,trend:ze((w==null?void 0:w.networkScore)??0,D.networkScore,3,!1)},channelHealth:{current:(x==null?void 0:x.score)??0,previous:D.channelHealth,trend:ze((x==null?void 0:x.score)??0,D.channelHealth,3,!1)}}),[y,w==null?void 0:w.networkScore,x==null?void 0:x.score,D]),F={lbtStats:i,noiseFloor:y,sparklineNoiseFloor:j,noiseFloorWindowHistory:_,linkQuality:w,channelHealth:x,nfTrend:R,radioConfig:h,trends:M,stats:n,recentPackets:o,quickNeighbors:s,isLoading:m,error:null,refresh:async()=>{}};return t.jsx(us.Provider,{value:F,children:e})}function st(){const e=u.useContext(us);if(e===void 0)throw new Error("useLBTData must be used within an LBTDataProvider");return e}function Va(e){return e<100?"excellent":e<250?"good":e<500?"fair":e<1e3?"congested":"critical"}function Ya(e){return e===0?"No backoffs":"Retries"}function Ka(e,n){return e===0?void 0:`${n.toFixed(0)}%`}function Ja(){const{lbtStats:e,isLoading:n,error:o}=st(),s=qt(),r=(e==null?void 0:e.avgBackoffMs)??0,a=(e==null?void 0:e.retryRate)??0,l=e?Va(r):"unknown",c=e==null?void 0:e.sparklineBackoff,m=u.useMemo(()=>!c||c.length<2?[]:c.map((d,f)=>({timestamp:Date.now()-(c.length-1-f)*36e5,count:d})),[c]);return t.jsx(ce,{title:"LBT Backoff",icon:t.jsx(Tn,{className:"mini-widget-icon"}),value:Math.round(r),unit:"ms",status:l,subtitle:e?Ya(r):void 0,subtitleValue:e?Ka(r,a):void 0,isLoading:n,error:o,onClick:()=>s("/packets"),children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(ss,{data:m,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}const ms=[{target:"LinkLeaders",fn:"path",minStage:1,when:hn},{target:"LinkLeaders",fn:"src_hash",minStage:1,when:pn}];pe(ms);function Za(){he(ms);const e=qt(),n=Ot(),o=Ie(),s=le(),r=Ne(),l=ae[r].minutes*60,c=Xs(),m=u.useMemo(()=>{if(c===0)return o;const x=c-l;return o.filter(D=>D.timestamp>=x)},[o,l,c]),d=s===null,f=s!=null&&s.local_hash?rt(s.local_hash):"",b=(s==null?void 0:s.neighbors)??{},{neighborHashes:i,neighborNames:g}=u.useMemo(()=>{const x=new Set,D=new Map;for(const N of n){x.add(N.hash);const p=b[N.hash],M=(p==null?void 0:p.name)||(p==null?void 0:p.node_name)||N.prefix;D.set(N.hash,M)}return{neighborHashes:x,neighborNames:D}},[n,b]),y=u.useMemo(()=>{if(i.size===0||m.length===0||!f)return{champion:null,listener:null,loudest:null};const{scores:x}=Cn(m,i,f),D=[];for(const[T,F]of x)F.blendedScore!==0&&D.push({...F,name:g.get(T)??rt(T)});let N=null,p=null,M=null;for(const T of D)(!N||T.blendedScore>N.blendedScore)&&(N=T),(!p||T.listenerScore>p.listenerScore)&&(p=T),(!M||T.loudScore>M.loudScore)&&(M=T);return{champion:N,listener:p,loudest:M}},[m,i,f,g]),h=x=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["🏆 Champion: ",x.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Blended Score: ",x.blendedScore,t.jsx("span",{className:"text-fg-muted/60 ml-1",children:"(Listener + Loud)"})]}),t.jsxs("div",{className:"border-t border-edge-subtle pt-1 mt-1 space-y-0.5",children:[t.jsxs("div",{children:["Listener: ",x.listenerScore,"/100 (",x.listenerCount," shared paths)"]}),t.jsxs("div",{children:["Loud: ",x.loudScore,"/100 (",x.loudCount," packets relayed)"]})]})]}),j=x=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["👂 Best Listener: ",x.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",x.listenerScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[x.listenerCount," packets where they heard your transmissions"]})})]}),_=x=>t.jsxs("div",{className:"max-w-[220px]",children:[t.jsxs("div",{className:"font-semibold mb-1",children:["📢 Loudest: ",x.name]}),t.jsxs("div",{className:"text-fg-muted mb-1",children:["Score: ",x.loudScore,"/100"]}),t.jsx("div",{className:"border-t border-edge-subtle pt-1 mt-1",children:t.jsxs("div",{children:[x.loudCount," packets they relayed directly to you"]})})]}),{champion:k,listener:C,loudest:S}=y,w=k||C||S?t.jsxs("div",{className:"flex flex-col gap-0 sm:gap-0.5",children:[k&&t.jsx(fe,{content:h(k),children:t.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:[t.jsx(vn,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-map-neighbor-color flex-shrink-0"}),t.jsx("span",{className:"font-semibold text-map-neighbor-color font-mono truncate flex-1 min-w-0",children:k.name}),t.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:k.blendedScore})]})}),C&&t.jsx(fe,{content:j(C),children:t.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:[t.jsx(as,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),t.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:C.name}),t.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})]})}),S&&t.jsx(fe,{content:_(S),children:t.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:[t.jsx(Yn,{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 text-fg-muted flex-shrink-0"}),t.jsx("span",{className:"text-fg-muted font-mono truncate flex-1 min-w-0",children:S.name}),t.jsx("span",{className:"text-fg-muted pl-1 sm:pl-2 tabular-nums flex-shrink-0 w-7 sm:w-9 text-right",children:S.loudScore})]})})]}):n.length===0?t.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No direct neighbors"}):t.jsx("div",{className:"flex items-center justify-center text-xs sm:text-sm text-fg-muted mt-auto",children:"No routing data yet"});return t.jsx(ce,{title:"Link Leaders",icon:t.jsx(Qn,{className:"mini-widget-icon"}),isLoading:d,onClick:()=>e("/contacts"),children:w})}function Qa(e){return e<15?"excellent":e<30?"good":e<45?"fair":e<60?"congested":"critical"}function eo(e){return e<15?"Clear channel":e<30?"Light traffic":e<45?"Moderate traffic":e<60?"Heavy traffic":e<75?"Congested":"Severe congestion"}function to(){const{lbtStats:e,isLoading:n,error:o}=st(),s=e?Et(e):0,r=e?Qa(s):"unknown",a=(e==null?void 0:e.maxBackoffMs)??0,l=e?a>200?"Peak":eo(s):void 0,c=e&&a>200?`${Math.round(a)}ms`:void 0,m=e==null?void 0:e.sparklineCollisionRisk,d=u.useMemo(()=>!m||m.length<2?[]:m.map((b,i)=>({timestamp:Date.now()-(m.length-1-i)*36e5,count:b})),[m]),f=Math.round(s*10)/10;return t.jsx(ce,{title:"Collision Risk",icon:t.jsx(Sn,{className:"mini-widget-icon"}),value:f,unit:"%",status:r,subtitle:l,subtitleValue:c,isLoading:n,error:o,children:t.jsx("div",{className:"mini-widget-sparkline w-full",children:t.jsx(ss,{data:d,width:9999,height:24,invertScale:!0,isLoading:n,className:"w-full"})})})}function so(e){return e<30?"excellent":e<50?"good":e<70?"fair":e<90?"congested":"critical"}function no(e){return e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}function ao(){var h,j;const[e,n]=u.useState(!1),[o]=u.useState(0),{stats:s,lbtStats:r,isLoading:a}=st(),l=((j=(h=s==null?void 0:s.config)==null?void 0:h.duty_cycle)==null?void 0:j.enforcement_enabled)??!1,c=u.useMemo(()=>{if(!s)return null;if(!l){const R=s.airtime_used_ms??0,w=s.max_airtime_ms??1,x=w>0?R/w*100:0;return{usedMs:R,maxMs:w,remainingMs:Math.max(0,w-R),utilizationPercent:x}}const _=s.airtime_used_ms??0,k=s.max_airtime_ms??1,C=s.airtime_remaining_ms??0,S=s.utilization_percent??(k>0?_/k*100:0);return{usedMs:_,maxMs:k,remainingMs:C,utilizationPercent:S}},[s,l]),m=u.useMemo(()=>{if(!r||r.totalPacketsWithLBT===0)return 100;const _=r.totalPacketsWithLBT-r.packetsWithRetries,k=r.totalPacketsWithLBT;return _/k*100},[r]),d=(c==null?void 0:c.utilizationPercent)??0,f=so(d),b=(c==null?void 0:c.remainingMs)??0,i=m<95?"1st Try":"Remaining",g=m<95?`${m.toFixed(0)}%`:no(b),y=c?t.jsx("div",{className:"mini-widget-progress mt-auto",children:t.jsx("div",{className:`mini-widget-progress-bar ${f}`,style:{width:`${Math.min(d,100)}%`}})}):null;return t.jsx(ce,{title:"Duty Cycle",icon:t.jsx(zt,{className:"mini-widget-icon"}),value:d.toFixed(1),unit:"%",status:f,subtitle:i,subtitleValue:g,isLoading:a,children:y})}function oo(){return t.jsxs("div",{className:"mini-widget",children:[t.jsxs("div",{className:"mini-widget-header",children:[t.jsx(ke,{className:"w-4 h-4"}),t.jsx(ke,{className:"h-3 w-16"})]}),t.jsx(ke,{className:"h-7 w-12 mt-2"}),t.jsx(ke,{className:"h-3 w-20 mt-2"})]})}function ro(){return t.jsx("div",{className:"widget-row",children:Array.from({length:5}).map((e,n)=>t.jsx(oo,{},n))})}const fs=[{target:"MeshHealth",fn:"type",minStage:1}];pe(fs);function io({className:e="",isLoaded:n,leading:o}){he(fs);const s=Ut(),r=n??s??!0;return t.jsxs("div",{className:`mesh-health-container relative ${e}`,children:[t.jsxs("div",{className:"mesh-health-header",children:[t.jsx(gn,{className:"w-4 h-4 text-sys-blue"}),t.jsx("span",{className:"type-label text-fg-muted",children:"MESH HEALTH"})]}),r?t.jsx(Xa,{children:t.jsxs("div",{className:"widget-row",children:[o&&t.jsx("div",{className:"widget-leading",children:o}),t.jsx(Ja,{}),t.jsx(to,{}),t.jsx(ao,{}),t.jsx(Za,{})]})}):t.jsx(ro,{})]})}const hs=[{target:"PublicChannel",fn:"decrypt",minStage:2,when:xn}];pe(hs);function lo(e,n,o){return Qs(new Date(e*1e3),n,o)}function co(e,n,o){return`${e||""}|${n}|${o}`}function uo(e,n){const o=e.message,s=n.message;return o.timestamp===s.timestamp&&o.text===s.text&&o.senderName===s.senderName&&o.channelHash===s.channelHash&&o.channelName===s.channelName&&e.isChannelSelected===n.isChannelSelected&&e.onChannelClick===n.onChannelClick}const mo=u.memo(function({message:n,onChannelClick:o,isChannelSelected:s}){const r=n.channelName||n.channelHash.slice(0,6);return t.jsx("div",{style:{transform:"translateZ(0)",willChange:"transform"},children:t.jsx(Pn,{senderName:n.senderName||"Unknown",text:n.text,timestamp:n.timestamp,bubbleVariant:"subtle",nameAccessory:t.jsx(es,{channelName:r,active:s,onClick:()=>o==null?void 0:o(n.channelHash)})})})},uo);function fo({open:e,onClose:n,messages:o,initialChannel:s}){const r=we(),a=u.useRef(null),l=u.useRef(!0),[c,m]=u.useState(()=>new Date),d=Ne(),f=Xt();u.useEffect(()=>{if(!e)return;m(new Date);const p=window.setInterval(()=>m(new Date),6e4);return()=>window.clearInterval(p)},[e]);const b=u.useMemo(()=>{const p=Date.now()/1e3,M=ae[d].minutes,T=p-M*60;return[...o].filter(F=>F.timestamp>=T).sort((F,P)=>F.timestamp-P.timestamp)},[o,d]),i=u.useCallback(()=>{const p=a.current;p&&(l.current=p.scrollTop>=-50)},[]),g=u.useMemo(()=>{const p=new Map;for(const M of b){const T=M.channelHash,F=p.get(T);F?F.count++:p.set(T,{name:M.channelName||M.channelHash.slice(0,6),hash:M.channelHash,count:1})}return Array.from(p.values()).sort((M,T)=>T.count-M.count)},[b]),y=g.length,[h,j]=u.useState(null),[_,k]=u.useState(!1);u.useEffect(()=>{e&&s&&j(s)},[e,s]);const C=u.useMemo(()=>h?b.filter(p=>p.channelHash===h):b,[b,h]),S=u.useMemo(()=>{const p=[];let M="";for(const T of C){const F=new Date(T.timestamp*1e3),P=Ks(F,r);P!==M&&(p.push({type:"date",date:lo(T.timestamp,r,c),dayKey:P}),M=P),p.push({type:"message",message:T})}return p},[c,C,r]);u.useLayoutEffect(()=>{const p=a.current;p&&l.current&&(p.scrollTop=0)},[C.length]);const R=u.useCallback(()=>{if(C.length===0)return;const p=[...C].sort((E,v)=>E.timestamp-v.timestamp),M=g.find(E=>E.hash===h),T=(M==null?void 0:M.name)??"All_Channels";let F=`Chat Export - ${T} diff --git a/frontend/dist/assets/DataValue-B6B0O-xC.js b/frontend/dist/assets/DataValue-Cy2BSezA.js similarity index 91% rename from frontend/dist/assets/DataValue-B6B0O-xC.js rename to frontend/dist/assets/DataValue-Cy2BSezA.js index b9a31db2..260ef87e 100644 --- a/frontend/dist/assets/DataValue-B6B0O-xC.js +++ b/frontend/dist/assets/DataValue-Cy2BSezA.js @@ -1,4 +1,4 @@ -import{e as A,r as a,d1 as x,j as i,d2 as N}from"./index-CAHLMlrb.js";import{A as g}from"./index-1IIqkHes.js";/** +import{e as A,r as a,d1 as x,j as i,d2 as N}from"./index-CdntfUUz.js";import{A as g}from"./index-tm_sy7-t.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/DatabaseManagement-BQJZp4p1.js b/frontend/dist/assets/DatabaseManagement-DhltIlKH.js similarity index 93% rename from frontend/dist/assets/DatabaseManagement-BQJZp4p1.js rename to frontend/dist/assets/DatabaseManagement-DhltIlKH.js index ce27d8a2..b8b5e1ca 100644 --- a/frontend/dist/assets/DatabaseManagement-BQJZp4p1.js +++ b/frontend/dist/assets/DatabaseManagement-DhltIlKH.js @@ -1 +1 @@ -import{z,r,j as e,f as h,B as b,dD as _,d9 as M,cA as G}from"./index-CAHLMlrb.js";import{b as U,v as V,p as v}from"./maintenance-C2rIkwgy.js";import{P as F,a as $,B as H,C as o}from"./PageLayout-CgrNSpBT.js";import{D as j}from"./database-BeT3SO6w.js";import{R as f,C as N}from"./Grid-B0tNiHTX.js";import{W as I}from"./wrench-laBkieDS.js";import{T as W}from"./trash-2-ChI2Sf6Z.js";import"./WorkspaceNav-ClxMgBhr.js";function R(a){if(typeof a!="number"||!Number.isFinite(a))return"—";const t=["B","KB","MB","GB"];let l=a,i=0;for(;l>=1024&&i2e9?a:a*1e3;return G(new Date(l),t)}function K({name:a}){return e.jsx("div",{className:"min-w-0",children:e.jsx("span",{className:"inline-flex max-w-full rounded-full border border-edge-subtle bg-surface/70 px-2.5 py-1 type-data-xs font-semibold text-fg-primary",children:e.jsx("span",{className:"truncate",children:a})})})}function se(){const a=z(),[t,l]=r.useState(null),[i,P]=r.useState(!0),[g,d]=r.useState(null),[p,y]=r.useState(new Set),[w,S]=r.useState(""),[C,u]=r.useState(null),[D,n]=r.useState(null),E=r.useMemo(()=>(t==null?void 0:t.tables)??[],[t]),m=r.useCallback(async()=>{P(!0),n(null);try{const s=await U();if(!s.success)throw new Error(s.error||"Database stats endpoint is unavailable");l(s.data??{})}catch(s){l(null),n(s instanceof Error?s.message:"Failed to load database stats")}finally{P(!1)}},[]);r.useEffect(()=>{m()},[m]);const T=s=>{y(x=>{const c=new Set(x);return c.has(s)?c.delete(s):c.add(s),c})},B=async()=>{d("vacuum"),n(null),u(null);try{const s=await V();if(!s.success)throw new Error(s.error||"Vacuum failed");u("Database vacuum completed."),await m()}catch(s){n(s instanceof Error?s.message:"Vacuum failed")}finally{d(null)}},L=async()=>{if(p.size!==0){d("purge-selected"),n(null),u(null);try{const s=await v(Array.from(p));if(!s.success)throw new Error(s.error||"Purge failed");u(`Purged ${p.size} selected table(s).`),y(new Set),await m()}catch(s){n(s instanceof Error?s.message:"Purge failed")}finally{d(null)}}},k=async()=>{if(w==="PURGE ALL"){d("purge-all"),n(null),u(null);try{const s=await v("all");if(!s.success)throw new Error(s.error||"Purge all failed");u("Purged all purgeable database tables."),S(""),y(new Set),await m()}catch(s){n(s instanceof Error?s.message:"Purge all failed")}finally{d(null)}}};return e.jsxs(F,{children:[e.jsx($,{title:"Database Management",icon:e.jsx(j,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Inspect database size and run guarded maintenance operations."})}),e.jsxs(H,{ready:!i,children:[D&&e.jsx(f,{template:"auto",children:e.jsx(o,{neomorphic:!0,className:"text-sys-red",children:D})}),C&&e.jsx(f,{template:"auto",children:e.jsx(o,{neomorphic:!0,className:"text-sys-green",children:C})}),e.jsxs(f,{template:"standard",children:[e.jsx(N,{span:"full",md:4,children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(j,{}),title:"Main DB"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.database_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(j,{}),title:"RRD Store"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.rrd_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(I,{}),title:"Actions"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{color:"primary",outline:!0,onClick:m,disabled:i,children:[e.jsx(_,{"data-slot":"icon"}),"Refresh"]}),e.jsx(b,{color:"warning",outline:!0,onClick:B,disabled:!!g,children:g==="vacuum"?"Running…":"Vacuum"})]})]})})]}),e.jsx(f,{template:"auto",children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(j,{}),title:"Tables"}),E.length===0?e.jsx("p",{className:"type-body-sm text-fg-muted",children:"No table statistics reported by this backend."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-edge-subtle bg-surface/30",children:e.jsxs("table",{className:"w-full min-w-[760px] table-fixed type-body-sm",children:[e.jsx("thead",{className:"bg-subtle-fill text-fg-muted",children:e.jsxs("tr",{className:"border-b border-edge-subtle",children:[e.jsx("th",{className:"w-20 px-3 py-3 text-center type-label",children:"Purge"}),e.jsx("th",{className:"w-[34%] px-3 py-3 text-left type-label",children:"Table"}),e.jsx("th",{className:"w-28 px-3 py-3 text-right type-label",children:"Rows"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Oldest"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Newest"})]})}),e.jsx("tbody",{className:"divide-y divide-edge-subtle",children:E.map(s=>{var x,c;return e.jsxs("tr",{className:"align-middle transition-colors hover:bg-subtle-fill/60",children:[e.jsx("td",{className:"px-3 py-3 text-center",children:e.jsx("input",{type:"checkbox",checked:p.has(s.name),onChange:()=>T(s.name)})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(K,{name:s.name})}),e.jsx("td",{className:"px-3 py-3 text-right type-data tabular-nums text-fg-primary",children:((c=(x=s.row_count)==null?void 0:x.toLocaleString)==null?void 0:c.call(x))??"—"}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.oldest_timestamp,a)}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.newest_timestamp,a)})]},s.name)})})]})}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:e.jsxs(b,{color:"danger",outline:!0,onClick:L,disabled:p.size===0||!!g,children:[e.jsx(W,{"data-slot":"icon"}),"Purge Selected"]})})]})}),e.jsx(f,{template:"auto",children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(M,{}),title:"Purge All"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mb-3",children:["Irreversible. Type ",e.jsx("span",{className:"type-code text-sys-red",children:"PURGE ALL"})," to enable the button."]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx("input",{className:"surface-input radius-inner px-3 py-2 flex-1",value:w,onChange:s=>S(s.target.value),placeholder:"PURGE ALL"}),e.jsx(b,{color:"danger",onClick:k,disabled:w!=="PURGE ALL"||!!g,children:"Purge All"})]})]})})]})]})}export{se as default}; +import{z,r,j as e,f as h,B as b,dD as _,d9 as M,cA as G}from"./index-CdntfUUz.js";import{b as U,v as V,p as v}from"./maintenance-DDkOUzHo.js";import{P as F,a as $,B as H,C as o}from"./PageLayout-B2kQpvXM.js";import{D as j}from"./database-D8ZiJ_7E.js";import{R as f,C as N}from"./Grid-DYtN9_Hv.js";import{W as I}from"./wrench-BDb_Mrbt.js";import{T as W}from"./trash-2-Ym16rcs6.js";import"./WorkspaceNav-BZrtCI1_.js";function R(a){if(typeof a!="number"||!Number.isFinite(a))return"—";const t=["B","KB","MB","GB"];let l=a,i=0;for(;l>=1024&&i2e9?a:a*1e3;return G(new Date(l),t)}function K({name:a}){return e.jsx("div",{className:"min-w-0",children:e.jsx("span",{className:"inline-flex max-w-full rounded-full border border-edge-subtle bg-surface/70 px-2.5 py-1 type-data-xs font-semibold text-fg-primary",children:e.jsx("span",{className:"truncate",children:a})})})}function se(){const a=z(),[t,l]=r.useState(null),[i,P]=r.useState(!0),[g,d]=r.useState(null),[p,y]=r.useState(new Set),[w,S]=r.useState(""),[C,u]=r.useState(null),[D,n]=r.useState(null),E=r.useMemo(()=>(t==null?void 0:t.tables)??[],[t]),m=r.useCallback(async()=>{P(!0),n(null);try{const s=await U();if(!s.success)throw new Error(s.error||"Database stats endpoint is unavailable");l(s.data??{})}catch(s){l(null),n(s instanceof Error?s.message:"Failed to load database stats")}finally{P(!1)}},[]);r.useEffect(()=>{m()},[m]);const T=s=>{y(x=>{const c=new Set(x);return c.has(s)?c.delete(s):c.add(s),c})},B=async()=>{d("vacuum"),n(null),u(null);try{const s=await V();if(!s.success)throw new Error(s.error||"Vacuum failed");u("Database vacuum completed."),await m()}catch(s){n(s instanceof Error?s.message:"Vacuum failed")}finally{d(null)}},L=async()=>{if(p.size!==0){d("purge-selected"),n(null),u(null);try{const s=await v(Array.from(p));if(!s.success)throw new Error(s.error||"Purge failed");u(`Purged ${p.size} selected table(s).`),y(new Set),await m()}catch(s){n(s instanceof Error?s.message:"Purge failed")}finally{d(null)}}},k=async()=>{if(w==="PURGE ALL"){d("purge-all"),n(null),u(null);try{const s=await v("all");if(!s.success)throw new Error(s.error||"Purge all failed");u("Purged all purgeable database tables."),S(""),y(new Set),await m()}catch(s){n(s instanceof Error?s.message:"Purge all failed")}finally{d(null)}}};return e.jsxs(F,{children:[e.jsx($,{title:"Database Management",icon:e.jsx(j,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Inspect database size and run guarded maintenance operations."})}),e.jsxs(H,{ready:!i,children:[D&&e.jsx(f,{template:"auto",children:e.jsx(o,{neomorphic:!0,className:"text-sys-red",children:D})}),C&&e.jsx(f,{template:"auto",children:e.jsx(o,{neomorphic:!0,className:"text-sys-green",children:C})}),e.jsxs(f,{template:"standard",children:[e.jsx(N,{span:"full",md:4,children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(j,{}),title:"Main DB"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.database_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(j,{}),title:"RRD Store"}),e.jsx("p",{className:"type-heading text-fg-primary",children:R(t==null?void 0:t.rrd_size_bytes)})]})}),e.jsx(N,{span:"full",md:4,children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(I,{}),title:"Actions"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{color:"primary",outline:!0,onClick:m,disabled:i,children:[e.jsx(_,{"data-slot":"icon"}),"Refresh"]}),e.jsx(b,{color:"warning",outline:!0,onClick:B,disabled:!!g,children:g==="vacuum"?"Running…":"Vacuum"})]})]})})]}),e.jsx(f,{template:"auto",children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(j,{}),title:"Tables"}),E.length===0?e.jsx("p",{className:"type-body-sm text-fg-muted",children:"No table statistics reported by this backend."}):e.jsx("div",{className:"overflow-x-auto rounded-xl border border-edge-subtle bg-surface/30",children:e.jsxs("table",{className:"w-full min-w-[760px] table-fixed type-body-sm",children:[e.jsx("thead",{className:"bg-subtle-fill text-fg-muted",children:e.jsxs("tr",{className:"border-b border-edge-subtle",children:[e.jsx("th",{className:"w-20 px-3 py-3 text-center type-label",children:"Purge"}),e.jsx("th",{className:"w-[34%] px-3 py-3 text-left type-label",children:"Table"}),e.jsx("th",{className:"w-28 px-3 py-3 text-right type-label",children:"Rows"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Oldest"}),e.jsx("th",{className:"px-3 py-3 text-left type-label",children:"Newest"})]})}),e.jsx("tbody",{className:"divide-y divide-edge-subtle",children:E.map(s=>{var x,c;return e.jsxs("tr",{className:"align-middle transition-colors hover:bg-subtle-fill/60",children:[e.jsx("td",{className:"px-3 py-3 text-center",children:e.jsx("input",{type:"checkbox",checked:p.has(s.name),onChange:()=>T(s.name)})}),e.jsx("td",{className:"px-3 py-3",children:e.jsx(K,{name:s.name})}),e.jsx("td",{className:"px-3 py-3 text-right type-data tabular-nums text-fg-primary",children:((c=(x=s.row_count)==null?void 0:x.toLocaleString)==null?void 0:c.call(x))??"—"}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.oldest_timestamp,a)}),e.jsx("td",{className:"px-3 py-3 type-data-xs tabular-nums text-fg-muted whitespace-nowrap",children:A(s.newest_timestamp,a)})]},s.name)})})]})}),e.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:e.jsxs(b,{color:"danger",outline:!0,onClick:L,disabled:p.size===0||!!g,children:[e.jsx(W,{"data-slot":"icon"}),"Purge Selected"]})})]})}),e.jsx(f,{template:"auto",children:e.jsxs(o,{neomorphic:!0,children:[e.jsx(h,{icon:e.jsx(M,{}),title:"Purge All"}),e.jsxs("p",{className:"type-body-sm text-fg-muted mb-3",children:["Irreversible. Type ",e.jsx("span",{className:"type-code text-sys-red",children:"PURGE ALL"})," to enable the button."]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx("input",{className:"surface-input radius-inner px-3 py-2 flex-1",value:w,onChange:s=>S(s.target.value),placeholder:"PURGE ALL"}),e.jsx(b,{color:"danger",onClick:k,disabled:w!=="PURGE ALL"||!!g,children:"Purge All"})]})]})})]})]})}export{se as default}; diff --git a/frontend/dist/assets/GPSDiagnostics-Cye-Trgs.js b/frontend/dist/assets/GPSDiagnostics-CYzRkIGF.js similarity index 99% rename from frontend/dist/assets/GPSDiagnostics-Cye-Trgs.js rename to frontend/dist/assets/GPSDiagnostics-CYzRkIGF.js index 4f06fde5..2685902f 100644 --- a/frontend/dist/assets/GPSDiagnostics-Cye-Trgs.js +++ b/frontend/dist/assets/GPSDiagnostics-CYzRkIGF.js @@ -1,4 +1,4 @@ -import{e as s2,dy as a2,dz as l2,dA as c2,z as O7,r as B,cA as u2,j as i,dB as p2,f as w1,d4 as y2,dC as f2}from"./index-CAHLMlrb.js";import{M as d2,B as g2,S as h2,a as m2}from"./BasemapLayer-VyMOdkaO.js";import{P as x2,a as v2,B as P2,C as t1}from"./PageLayout-CgrNSpBT.js";import{M as K1}from"./map-pin-CNePTCsc.js";import{R as V1,C as M1}from"./Grid-B0tNiHTX.js";import{S as S2}from"./satellite-DvRQ8hgk.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as s2,dy as a2,dz as l2,dA as c2,z as O7,r as B,cA as u2,j as i,dB as p2,f as w1,d4 as y2,dC as f2}from"./index-CdntfUUz.js";import{M as d2,B as g2,S as h2,a as m2}from"./BasemapLayer-U4r1eipM.js";import{P as x2,a as v2,B as P2,C as t1}from"./PageLayout-B2kQpvXM.js";import{M as K1}from"./map-pin-ADTzwr8W.js";import{R as V1,C as M1}from"./Grid-DYtN9_Hv.js";import{S as S2}from"./satellite-DwUbYQYY.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Grid-B0tNiHTX.js b/frontend/dist/assets/Grid-DYtN9_Hv.js similarity index 95% rename from frontend/dist/assets/Grid-B0tNiHTX.js rename to frontend/dist/assets/Grid-DYtN9_Hv.js index 491b58d1..16a94836 100644 --- a/frontend/dist/assets/Grid-B0tNiHTX.js +++ b/frontend/dist/assets/Grid-DYtN9_Hv.js @@ -1 +1 @@ -import{r as b,j as c,c as d}from"./index-CAHLMlrb.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-CdntfUUz.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-BDWyVW37.js b/frontend/dist/assets/KeycapButton-BJZjnt_-.js similarity index 98% rename from frontend/dist/assets/KeycapButton-BDWyVW37.js rename to frontend/dist/assets/KeycapButton-BJZjnt_-.js index 7f21a123..d93a4973 100644 --- a/frontend/dist/assets/KeycapButton-BDWyVW37.js +++ b/frontend/dist/assets/KeycapButton-BJZjnt_-.js @@ -1 +1 @@ -import{r as l,j as t,Z as O}from"./index-CAHLMlrb.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-CdntfUUz.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-g9bCtOHr.js b/frontend/dist/assets/LightSparkline-B-EJJe6x.js similarity index 96% rename from frontend/dist/assets/LightSparkline-g9bCtOHr.js rename to frontend/dist/assets/LightSparkline-B-EJJe6x.js index 0e3fc27f..8efe679f 100644 --- a/frontend/dist/assets/LightSparkline-g9bCtOHr.js +++ b/frontend/dist/assets/LightSparkline-B-EJJe6x.js @@ -1 +1 @@ -import{r as y,j as t}from"./index-CAHLMlrb.js";const m="var(--sys-cyan)",k="var(--sys-blue)",v="var(--sys-indigo)",I="var(--sparkline-critical)",g="var(--fg-muted)";function C(d,o,e,s=2){if(d.length<2)return"";const r=d.map(n=>n.count),u=Math.max(...r,1),p=Math.min(...r),l=u-p||1,j=o-s*2,a=e-s*2,i=r.map((n,c)=>({x:s+c/(r.length-1)*j,y:s+a-(n-p)/l*a}));let x=`M ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)}`;for(let n=1;nC(o,e,s),[o,e,s]),x=!r&&o.length>=2,n=r??(x?`url(#${a})`:g),c=l.includes("w-");return p&&o.length<2?t.jsx("div",{className:`flex items-center justify-center ${l}`,style:c?{height:s}:{width:e,height:s},children:t.jsx("div",{className:"rounded animate-pulse bg-subtle-fill-hover",style:c?{width:"100%",height:s-6}:{width:e-8,height:s-6}})}):o.length<2?t.jsx("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,className:l,"aria-hidden":"true",children:t.jsx("line",{x1:4,y1:s/2,x2:e-4,y2:s/2,stroke:I,strokeWidth:1.5,strokeDasharray:"3,2"})}):t.jsxs("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,preserveAspectRatio:"none",className:l,"aria-hidden":"true",style:{maxWidth:"100%"},children:[x&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,gradientUnits:"userSpaceOnUse",x1:0,y1:2,x2:0,y2:s-2,children:[t.jsx("stop",{offset:"0%",stopColor:u?v:m}),t.jsx("stop",{offset:"50%",stopColor:k}),t.jsx("stop",{offset:"100%",stopColor:u?m:v})]})}),t.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})});export{L}; +import{r as y,j as t}from"./index-CdntfUUz.js";const m="var(--sys-cyan)",k="var(--sys-blue)",v="var(--sys-indigo)",I="var(--sparkline-critical)",g="var(--fg-muted)";function C(d,o,e,s=2){if(d.length<2)return"";const r=d.map(n=>n.count),u=Math.max(...r,1),p=Math.min(...r),l=u-p||1,j=o-s*2,a=e-s*2,i=r.map((n,c)=>({x:s+c/(r.length-1)*j,y:s+a-(n-p)/l*a}));let x=`M ${i[0].x.toFixed(1)} ${i[0].y.toFixed(1)}`;for(let n=1;nC(o,e,s),[o,e,s]),x=!r&&o.length>=2,n=r??(x?`url(#${a})`:g),c=l.includes("w-");return p&&o.length<2?t.jsx("div",{className:`flex items-center justify-center ${l}`,style:c?{height:s}:{width:e,height:s},children:t.jsx("div",{className:"rounded animate-pulse bg-subtle-fill-hover",style:c?{width:"100%",height:s-6}:{width:e-8,height:s-6}})}):o.length<2?t.jsx("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,className:l,"aria-hidden":"true",children:t.jsx("line",{x1:4,y1:s/2,x2:e-4,y2:s/2,stroke:I,strokeWidth:1.5,strokeDasharray:"3,2"})}):t.jsxs("svg",{width:e,height:s,viewBox:`0 0 ${e} ${s}`,preserveAspectRatio:"none",className:l,"aria-hidden":"true",style:{maxWidth:"100%"},children:[x&&t.jsx("defs",{children:t.jsxs("linearGradient",{id:a,gradientUnits:"userSpaceOnUse",x1:0,y1:2,x2:0,y2:s-2,children:[t.jsx("stop",{offset:"0%",stopColor:u?v:m}),t.jsx("stop",{offset:"50%",stopColor:k}),t.jsx("stop",{offset:"100%",stopColor:u?m:v})]})}),t.jsx("path",{d:i,fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]})});export{L}; diff --git a/frontend/dist/assets/Login-BqiBbXZ3.js b/frontend/dist/assets/Login-B9-_of-X.js similarity index 99% rename from frontend/dist/assets/Login-BqiBbXZ3.js rename to frontend/dist/assets/Login-B9-_of-X.js index 1d2812fc..bcd42353 100644 --- a/frontend/dist/assets/Login-BqiBbXZ3.js +++ b/frontend/dist/assets/Login-B9-_of-X.js @@ -1 +1 @@ -import{r as s,j as e,u as _,g as Z,i as B,s as E,l as T,m as r,a as z,b as u,A,c as v,I as y,C as I,d as W,B as D,Z as F,O as H}from"./index-CAHLMlrb.js";function U({width:i,height:n,className:d="",fill:a="currentColor"}){return e.jsxs("svg",{viewBox:"0 0 134 15",width:i,height:n,className:d,role:"img","aria-label":"MeshCore",style:{fillRule:"evenodd",clipRule:"evenodd"},children:[e.jsx("path",{fill:a,d:"M3.277,0.053C2.829,0.053 2.401,0.41 2.321,0.851L0.013,13.623C-0.067,14.064 0.232,14.421 0.681,14.421L3.13,14.421C3.578,14.421 4.006,14.064 4.086,13.623L5.004,8.54L6.684,13.957C6.766,14.239 7.02,14.421 7.337,14.421L10.58,14.421C10.897,14.421 11.217,14.239 11.401,13.957L15.043,8.513L14.119,13.623C14.038,14.064 14.338,14.421 14.787,14.421L17.236,14.421C17.684,14.421 18.112,14.064 18.192,13.623L20.5,0.851C20.582,0.41 20.283,0.053 19.834,0.053L16.69,0.053C16.373,0.053 16.053,0.235 15.87,0.517L9.897,9.473C9.803,9.616 9.578,9.578 9.528,9.41L7.074,0.517C6.992,0.235 6.738,0.053 6.421,0.053L3.277,0.053Z"}),e.jsx("path",{fill:a,d:"M21.146,14.421C21.146,14.421 33.257,14.421 33.257,14.421C33.526,14.421 33.784,14.205 33.831,13.942L34.337,11.128C34.385,10.863 34.206,10.649 33.936,10.649L25.519,10.649C25.429,10.649 25.37,10.576 25.385,10.488L25.635,9.105C25.65,9.017 25.736,8.944 25.826,8.944L32.596,8.944C32.865,8.944 33.123,8.728 33.171,8.465L33.621,5.974C33.669,5.709 33.49,5.495 33.221,5.495L26.45,5.495C26.361,5.495 26.301,5.423 26.317,5.335L26.584,3.852C26.599,3.764 26.685,3.691 26.775,3.691L35.192,3.691C35.462,3.691 35.719,3.476 35.767,3.21L36.258,0.498C36.306,0.235 36.126,0.019 35.857,0.019L23.746,0.019C23.297,0.019 22.867,0.378 22.788,0.819L20.474,13.621C20.396,14.062 20.695,14.421 21.146,14.421Z"}),e.jsx("path",{fill:a,d:"M45.926,14.419L45.926,14.421L46.346,14.421C48.453,14.421 50.465,12.742 50.839,10.67L51.081,9.327C51.456,7.256 50.05,5.576 47.943,5.576L41.455,5.576C41.186,5.576 41.007,5.363 41.054,5.097L41.218,4.192C41.266,3.927 41.524,3.713 41.793,3.713L50.569,3.713C51.018,3.713 51.446,3.356 51.526,2.915L51.9,0.85C51.98,0.407 51.68,0.05 51.232,0.05L41.638,0.05C39.531,0.05 37.519,1.73 37.145,3.801L36.88,5.267C36.505,7.339 37.91,9.018 40.018,9.018L46.506,9.018C46.775,9.018 46.954,9.231 46.907,9.497L46.785,10.176C46.737,10.441 46.479,10.655 46.21,10.655L37.189,10.655C36.741,10.655 36.313,11.012 36.233,11.453L35.841,13.621C35.761,14.062 36.061,14.419 36.51,14.419L45.926,14.419Z"}),e.jsx("path",{fill:a,d:"M68.008,0.046C68.008,0.046 65.296,0.046 65.296,0.046C64.847,0.046 64.42,0.403 64.34,0.844L63.532,5.31C63.517,5.398 63.431,5.469 63.341,5.469L58.085,5.469C57.995,5.469 57.936,5.398 57.951,5.31L58.758,0.844C58.837,0.403 58.539,0.046 58.09,0.046L55.378,0.046C54.93,0.046 54.502,0.403 54.422,0.844L52.112,13.623C52.032,14.064 52.331,14.421 52.78,14.421L55.492,14.421C55.941,14.421 56.369,14.064 56.449,13.623L57.272,9.074C57.287,8.986 57.373,8.914 57.462,8.914L62.719,8.914C62.809,8.914 62.868,8.985 62.853,9.074L62.032,13.623C61.952,14.064 62.252,14.421 62.7,14.421L65.413,14.421C65.861,14.421 66.289,14.064 66.369,13.623L68.678,0.844C68.755,0.403 68.457,0.046 68.008,0.046Z"}),e.jsx("path",{fill:a,d:"M72.099,14.421C72.099,14.421 80.066,14.421 80.066,14.421C80.515,14.421 80.943,14.064 81.022,13.623L81.414,11.453C81.494,11.012 81.194,10.655 80.746,10.655L73.828,10.655C73.559,10.655 73.38,10.441 73.427,10.176L74.51,4.215C74.558,3.951 74.815,3.736 75.082,3.736L82,3.736C82.448,3.736 82.876,3.379 82.956,2.938L83.34,0.817C83.42,0.376 83.12,0.019 82.672,0.019L74.724,0.019C72.622,0.019 70.614,1.691 70.236,3.757L68.965,10.665C68.587,12.738 69.99,14.421 72.099,14.421Z"}),e.jsx("path",{fill:a,d:"M97.176,-0C97.176,0 88.882,0 88.882,0C86.775,0 84.763,1.68 84.389,3.751L83.139,10.67C82.765,12.741 84.169,14.421 86.277,14.421L94.571,14.421C96.678,14.421 98.69,12.741 99.064,10.67L100.314,3.751C100.689,1.68 99.284,-0 97.176,-0ZM94.798,10.178C94.75,10.443 94.492,10.657 94.223,10.657L87.978,10.657C87.709,10.657 87.529,10.443 87.577,10.178L88.659,4.192C88.707,3.927 88.964,3.713 89.234,3.713L95.477,3.713C95.747,3.713 95.926,3.927 95.878,4.192L94.798,10.178Z"}),e.jsx("path",{fill:a,d:"M101.284,14.421L103.995,14.421C104.443,14.421 104.871,14.065 104.951,13.624L105.43,10.97C105.446,10.882 105.531,10.81 105.621,10.81L108.902,10.806C109.064,10.806 109.2,10.886 109.267,11.018L110.813,14.035C110.992,14.392 111.319,14.434 112.303,14.419C112.88,14.426 113.756,14.382 115.169,14.382C115.623,14.382 115.902,13.907 115.678,13.51L113.989,10.569C113.945,10.491 113.993,10.386 114.086,10.34C115.39,9.707 116.423,8.477 116.681,7.055L117.27,3.785C117.646,1.713 116.242,0.033 114.134,0.033L103.884,0.033C103.436,0.033 103.008,0.39 102.928,0.831L100.616,13.623C100.536,14.064 100.836,14.421 101.284,14.421L101.284,14.421ZM106.73,3.791C106.745,3.703 106.831,3.631 106.921,3.631L112.225,3.631C112.626,3.631 112.891,3.949 112.821,4.343L112.431,6.494C112.359,6.885 111.979,7.204 111.58,7.204L106.276,7.204C106.186,7.204 106.127,7.133 106.142,7.043L106.73,3.791Z"}),e.jsx("path",{fill:a,d:"M118.277,14.421C118.277,14.421 130.388,14.421 130.388,14.421C130.657,14.421 130.915,14.205 130.963,13.942L131.468,11.128C131.516,10.863 131.337,10.649 131.068,10.649L122.65,10.649C122.56,10.649 122.501,10.576 122.516,10.488L122.766,9.105C122.781,9.017 122.867,8.944 122.957,8.944L129.728,8.944C129.997,8.944 130.254,8.728 130.302,8.465L130.753,5.974C130.801,5.709 130.621,5.495 130.352,5.495L123.581,5.495C123.492,5.495 123.432,5.423 123.448,5.335L123.715,3.852C123.73,3.764 123.816,3.691 123.906,3.691L132.324,3.691C132.593,3.691 132.851,3.476 132.898,3.21L133.389,0.498C133.437,0.235 133.257,0.019 132.988,0.019L120.877,0.019C120.428,0.019 119.999,0.378 119.919,0.819L117.605,13.621C117.527,14.062 117.827,14.421 118.277,14.421Z"})]})}const q=s.memo(U),O="/assets/WCM_Waves-RN-_ocPH.gif",l={container:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:z.normal,delayChildren:.1}}},item:{hidden:{opacity:0,y:12},visible:{opacity:1,y:0,transition:u.smooth}},footer:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{...u.gentle,delay:.4}}},error:{hidden:{opacity:0,height:0,marginTop:0},visible:{opacity:1,height:"auto",marginTop:24,transition:u.snappy},exit:{opacity:0,height:0,marginTop:0,transition:{duration:.15}}}},b=v("block type-badge text-fg-secondary"),K=s.memo(function({className:n}){return e.jsxs("svg",{className:v("animate-spin",n),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),p=s.memo(function({href:n,children:d}){return e.jsx(r.a,{href:n,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.98},className:"inline-flex items-center gap-1.5 opacity-60 hover:opacity-100 transition-opacity",children:d})}),f=()=>e.jsx("span",{className:"text-white/20 text-xs","aria-hidden":"true",children:"•"}),Y=s.memo(function(){return e.jsx("div",{className:"fixed inset-0 -z-10",style:{backgroundColor:F[950]},"aria-hidden":"true"})}),V=s.memo(function(){return e.jsxs(r.footer,{variants:l.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(p,{href:"https://github.com/openhop-dev/openhop_repeater",children:e.jsx("img",{src:H,alt:"openHop",className:"h-14"})}),e.jsx(f,{}),e.jsx(p,{href:"https://meshcore.io",children:e.jsx(q,{height:12,className:"text-white"})}),e.jsx(f,{}),e.jsxs(p,{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:O,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),X={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 J(){const i=_(),[n,d]=s.useState(""),[a,N]=s.useState(""),[C,w]=s.useState(Z),[L,g]=s.useState(!1),[o,h]=s.useState(null),[j]=s.useState(()=>{try{const t=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),t?X[t]??null:null}catch{return null}}),c=n.length>0&&a.length>0&&!L;s.useEffect(()=>{B()&&i("/",{replace:!0})},[i]);const m=s.useCallback(()=>h(null),[]),k=s.useCallback(t=>{d(t.target.value),o&&m()},[o,m]),M=s.useCallback(t=>{N(t.target.value),o&&m()},[o,m]),S=s.useCallback(t=>{w(t),E(t)},[]),R=s.useCallback(async t=>{if(t.preventDefault(),!c)return;g(!0),h(null);const x=await T(n,a,C);g(!1),x.success?window.location.href="/":h(x.error??"Login failed")},[c,n,a,C]),P=s.useCallback(t=>{t.key==="Enter"&&c&&t.target.tagName==="INPUT"&&(t.preventDefault(),t.currentTarget.requestSubmit())},[c]);return e.jsxs(e.Fragment,{children:[e.jsx(Y,{}),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(r.div,{variants:l.container,initial:"hidden",animate:"visible",className:"w-full max-w-sm space-y-10",children:[e.jsx(r.div,{variants:l.item,className:"flex justify-center",children:e.jsx(A,{})}),j&&!o&&e.jsx(r.div,{variants:l.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:j})}),e.jsxs(r.form,{variants:l.item,onSubmit:R,onKeyDown:P,method:"post",action:"/auth/login",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(y,{id:"username",name:"username",type:"text",value:n,onChange:k,required:!0,autoComplete:"username",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,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(y,{id:"password",name:"password",type:"password",value:a,onChange:M,required:!0,autoComplete:"current-password",className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(I,{checked:C,onChange:S,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(W,{mode:"wait",children:o&&e.jsx(r.div,{variants:l.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:o})},"error")}),e.jsx(r.div,{whileTap:c?{scale:.98}:void 0,children:e.jsx(D,{type:"submit",disabled:!c,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:L?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"size-4"}),"Signing in…"]}):"Sign in"})})]}),e.jsxs(r.p,{variants:l.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(V,{})]})}export{J as default}; +import{r as s,j as e,u as _,g as Z,i as B,s as E,l as T,m as r,a as z,b as u,A,c as v,I as y,C as I,d as W,B as D,Z as F,O as H}from"./index-CdntfUUz.js";function U({width:i,height:n,className:d="",fill:a="currentColor"}){return e.jsxs("svg",{viewBox:"0 0 134 15",width:i,height:n,className:d,role:"img","aria-label":"MeshCore",style:{fillRule:"evenodd",clipRule:"evenodd"},children:[e.jsx("path",{fill:a,d:"M3.277,0.053C2.829,0.053 2.401,0.41 2.321,0.851L0.013,13.623C-0.067,14.064 0.232,14.421 0.681,14.421L3.13,14.421C3.578,14.421 4.006,14.064 4.086,13.623L5.004,8.54L6.684,13.957C6.766,14.239 7.02,14.421 7.337,14.421L10.58,14.421C10.897,14.421 11.217,14.239 11.401,13.957L15.043,8.513L14.119,13.623C14.038,14.064 14.338,14.421 14.787,14.421L17.236,14.421C17.684,14.421 18.112,14.064 18.192,13.623L20.5,0.851C20.582,0.41 20.283,0.053 19.834,0.053L16.69,0.053C16.373,0.053 16.053,0.235 15.87,0.517L9.897,9.473C9.803,9.616 9.578,9.578 9.528,9.41L7.074,0.517C6.992,0.235 6.738,0.053 6.421,0.053L3.277,0.053Z"}),e.jsx("path",{fill:a,d:"M21.146,14.421C21.146,14.421 33.257,14.421 33.257,14.421C33.526,14.421 33.784,14.205 33.831,13.942L34.337,11.128C34.385,10.863 34.206,10.649 33.936,10.649L25.519,10.649C25.429,10.649 25.37,10.576 25.385,10.488L25.635,9.105C25.65,9.017 25.736,8.944 25.826,8.944L32.596,8.944C32.865,8.944 33.123,8.728 33.171,8.465L33.621,5.974C33.669,5.709 33.49,5.495 33.221,5.495L26.45,5.495C26.361,5.495 26.301,5.423 26.317,5.335L26.584,3.852C26.599,3.764 26.685,3.691 26.775,3.691L35.192,3.691C35.462,3.691 35.719,3.476 35.767,3.21L36.258,0.498C36.306,0.235 36.126,0.019 35.857,0.019L23.746,0.019C23.297,0.019 22.867,0.378 22.788,0.819L20.474,13.621C20.396,14.062 20.695,14.421 21.146,14.421Z"}),e.jsx("path",{fill:a,d:"M45.926,14.419L45.926,14.421L46.346,14.421C48.453,14.421 50.465,12.742 50.839,10.67L51.081,9.327C51.456,7.256 50.05,5.576 47.943,5.576L41.455,5.576C41.186,5.576 41.007,5.363 41.054,5.097L41.218,4.192C41.266,3.927 41.524,3.713 41.793,3.713L50.569,3.713C51.018,3.713 51.446,3.356 51.526,2.915L51.9,0.85C51.98,0.407 51.68,0.05 51.232,0.05L41.638,0.05C39.531,0.05 37.519,1.73 37.145,3.801L36.88,5.267C36.505,7.339 37.91,9.018 40.018,9.018L46.506,9.018C46.775,9.018 46.954,9.231 46.907,9.497L46.785,10.176C46.737,10.441 46.479,10.655 46.21,10.655L37.189,10.655C36.741,10.655 36.313,11.012 36.233,11.453L35.841,13.621C35.761,14.062 36.061,14.419 36.51,14.419L45.926,14.419Z"}),e.jsx("path",{fill:a,d:"M68.008,0.046C68.008,0.046 65.296,0.046 65.296,0.046C64.847,0.046 64.42,0.403 64.34,0.844L63.532,5.31C63.517,5.398 63.431,5.469 63.341,5.469L58.085,5.469C57.995,5.469 57.936,5.398 57.951,5.31L58.758,0.844C58.837,0.403 58.539,0.046 58.09,0.046L55.378,0.046C54.93,0.046 54.502,0.403 54.422,0.844L52.112,13.623C52.032,14.064 52.331,14.421 52.78,14.421L55.492,14.421C55.941,14.421 56.369,14.064 56.449,13.623L57.272,9.074C57.287,8.986 57.373,8.914 57.462,8.914L62.719,8.914C62.809,8.914 62.868,8.985 62.853,9.074L62.032,13.623C61.952,14.064 62.252,14.421 62.7,14.421L65.413,14.421C65.861,14.421 66.289,14.064 66.369,13.623L68.678,0.844C68.755,0.403 68.457,0.046 68.008,0.046Z"}),e.jsx("path",{fill:a,d:"M72.099,14.421C72.099,14.421 80.066,14.421 80.066,14.421C80.515,14.421 80.943,14.064 81.022,13.623L81.414,11.453C81.494,11.012 81.194,10.655 80.746,10.655L73.828,10.655C73.559,10.655 73.38,10.441 73.427,10.176L74.51,4.215C74.558,3.951 74.815,3.736 75.082,3.736L82,3.736C82.448,3.736 82.876,3.379 82.956,2.938L83.34,0.817C83.42,0.376 83.12,0.019 82.672,0.019L74.724,0.019C72.622,0.019 70.614,1.691 70.236,3.757L68.965,10.665C68.587,12.738 69.99,14.421 72.099,14.421Z"}),e.jsx("path",{fill:a,d:"M97.176,-0C97.176,0 88.882,0 88.882,0C86.775,0 84.763,1.68 84.389,3.751L83.139,10.67C82.765,12.741 84.169,14.421 86.277,14.421L94.571,14.421C96.678,14.421 98.69,12.741 99.064,10.67L100.314,3.751C100.689,1.68 99.284,-0 97.176,-0ZM94.798,10.178C94.75,10.443 94.492,10.657 94.223,10.657L87.978,10.657C87.709,10.657 87.529,10.443 87.577,10.178L88.659,4.192C88.707,3.927 88.964,3.713 89.234,3.713L95.477,3.713C95.747,3.713 95.926,3.927 95.878,4.192L94.798,10.178Z"}),e.jsx("path",{fill:a,d:"M101.284,14.421L103.995,14.421C104.443,14.421 104.871,14.065 104.951,13.624L105.43,10.97C105.446,10.882 105.531,10.81 105.621,10.81L108.902,10.806C109.064,10.806 109.2,10.886 109.267,11.018L110.813,14.035C110.992,14.392 111.319,14.434 112.303,14.419C112.88,14.426 113.756,14.382 115.169,14.382C115.623,14.382 115.902,13.907 115.678,13.51L113.989,10.569C113.945,10.491 113.993,10.386 114.086,10.34C115.39,9.707 116.423,8.477 116.681,7.055L117.27,3.785C117.646,1.713 116.242,0.033 114.134,0.033L103.884,0.033C103.436,0.033 103.008,0.39 102.928,0.831L100.616,13.623C100.536,14.064 100.836,14.421 101.284,14.421L101.284,14.421ZM106.73,3.791C106.745,3.703 106.831,3.631 106.921,3.631L112.225,3.631C112.626,3.631 112.891,3.949 112.821,4.343L112.431,6.494C112.359,6.885 111.979,7.204 111.58,7.204L106.276,7.204C106.186,7.204 106.127,7.133 106.142,7.043L106.73,3.791Z"}),e.jsx("path",{fill:a,d:"M118.277,14.421C118.277,14.421 130.388,14.421 130.388,14.421C130.657,14.421 130.915,14.205 130.963,13.942L131.468,11.128C131.516,10.863 131.337,10.649 131.068,10.649L122.65,10.649C122.56,10.649 122.501,10.576 122.516,10.488L122.766,9.105C122.781,9.017 122.867,8.944 122.957,8.944L129.728,8.944C129.997,8.944 130.254,8.728 130.302,8.465L130.753,5.974C130.801,5.709 130.621,5.495 130.352,5.495L123.581,5.495C123.492,5.495 123.432,5.423 123.448,5.335L123.715,3.852C123.73,3.764 123.816,3.691 123.906,3.691L132.324,3.691C132.593,3.691 132.851,3.476 132.898,3.21L133.389,0.498C133.437,0.235 133.257,0.019 132.988,0.019L120.877,0.019C120.428,0.019 119.999,0.378 119.919,0.819L117.605,13.621C117.527,14.062 117.827,14.421 118.277,14.421Z"})]})}const q=s.memo(U),O="/assets/WCM_Waves-RN-_ocPH.gif",l={container:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:z.normal,delayChildren:.1}}},item:{hidden:{opacity:0,y:12},visible:{opacity:1,y:0,transition:u.smooth}},footer:{hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{...u.gentle,delay:.4}}},error:{hidden:{opacity:0,height:0,marginTop:0},visible:{opacity:1,height:"auto",marginTop:24,transition:u.snappy},exit:{opacity:0,height:0,marginTop:0,transition:{duration:.15}}}},b=v("block type-badge text-fg-secondary"),K=s.memo(function({className:n}){return e.jsxs("svg",{className:v("animate-spin",n),viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),p=s.memo(function({href:n,children:d}){return e.jsx(r.a,{href:n,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.98},className:"inline-flex items-center gap-1.5 opacity-60 hover:opacity-100 transition-opacity",children:d})}),f=()=>e.jsx("span",{className:"text-white/20 text-xs","aria-hidden":"true",children:"•"}),Y=s.memo(function(){return e.jsx("div",{className:"fixed inset-0 -z-10",style:{backgroundColor:F[950]},"aria-hidden":"true"})}),V=s.memo(function(){return e.jsxs(r.footer,{variants:l.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(p,{href:"https://github.com/openhop-dev/openhop_repeater",children:e.jsx("img",{src:H,alt:"openHop",className:"h-14"})}),e.jsx(f,{}),e.jsx(p,{href:"https://meshcore.io",children:e.jsx(q,{height:12,className:"text-white"})}),e.jsx(f,{}),e.jsxs(p,{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:O,alt:"",className:"size-full object-cover"})}),e.jsx("span",{className:"font-mono text-sm font-semibold tracking-tight text-white",children:"WCM"})]})]})})]})}),X={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 J(){const i=_(),[n,d]=s.useState(""),[a,N]=s.useState(""),[C,w]=s.useState(Z),[L,g]=s.useState(!1),[o,h]=s.useState(null),[j]=s.useState(()=>{try{const t=sessionStorage.getItem("auth_redirect_reason");return sessionStorage.removeItem("auth_redirect_reason"),t?X[t]??null:null}catch{return null}}),c=n.length>0&&a.length>0&&!L;s.useEffect(()=>{B()&&i("/",{replace:!0})},[i]);const m=s.useCallback(()=>h(null),[]),k=s.useCallback(t=>{d(t.target.value),o&&m()},[o,m]),M=s.useCallback(t=>{N(t.target.value),o&&m()},[o,m]),S=s.useCallback(t=>{w(t),E(t)},[]),R=s.useCallback(async t=>{if(t.preventDefault(),!c)return;g(!0),h(null);const x=await T(n,a,C);g(!1),x.success?window.location.href="/":h(x.error??"Login failed")},[c,n,a,C]),P=s.useCallback(t=>{t.key==="Enter"&&c&&t.target.tagName==="INPUT"&&(t.preventDefault(),t.currentTarget.requestSubmit())},[c]);return e.jsxs(e.Fragment,{children:[e.jsx(Y,{}),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(r.div,{variants:l.container,initial:"hidden",animate:"visible",className:"w-full max-w-sm space-y-10",children:[e.jsx(r.div,{variants:l.item,className:"flex justify-center",children:e.jsx(A,{})}),j&&!o&&e.jsx(r.div,{variants:l.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:j})}),e.jsxs(r.form,{variants:l.item,onSubmit:R,onKeyDown:P,method:"post",action:"/auth/login",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(y,{id:"username",name:"username",type:"text",value:n,onChange:k,required:!0,autoComplete:"username",autoCapitalize:"off",autoCorrect:"off",spellCheck:!1,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(y,{id:"password",name:"password",type:"password",value:a,onChange:M,required:!0,autoComplete:"current-password",className:"font-mono text-sm font-semibold"})})]}),e.jsx("div",{className:"-mt-2",children:e.jsx(I,{checked:C,onChange:S,label:e.jsx("span",{className:"type-badge text-fg-secondary",children:"Remember me"}),size:"sm"})}),e.jsx(W,{mode:"wait",children:o&&e.jsx(r.div,{variants:l.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:o})},"error")}),e.jsx(r.div,{whileTap:c?{scale:.98}:void 0,children:e.jsx(D,{type:"submit",disabled:!c,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:L?e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"size-4"}),"Signing in…"]}):"Sign in"})})]}),e.jsxs(r.p,{variants:l.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(V,{})]})}export{J as default}; diff --git a/frontend/dist/assets/Logs-DJM49UnJ.js b/frontend/dist/assets/Logs-D0FIyBRm.js similarity index 97% rename from frontend/dist/assets/Logs-DJM49UnJ.js rename to frontend/dist/assets/Logs-D0FIyBRm.js index 28ef8bf8..5b64a522 100644 --- a/frontend/dist/assets/Logs-DJM49UnJ.js +++ b/frontend/dist/assets/Logs-D0FIyBRm.js @@ -1,4 +1,4 @@ -import{e as G,e9 as W,ea as H,ac as U,eb as V,ec as _,z as q,r,ed as J,j as e,a2 as K,B as d,dD as Q,N as B,c as y,f as X,ee as Y,ef as D,m as Z}from"./index-CAHLMlrb.js";import{P as ee,a as se,B as te,C as w}from"./PageLayout-CgrNSpBT.js";import{C as ae,a as le}from"./circle-stop-DEeBh2xe.js";import{R as C}from"./Grid-B0tNiHTX.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as G,e9 as W,ea as H,ac as U,eb as V,ec as _,z as q,r,ed as J,j as e,a2 as K,B as d,dD as Q,N as B,c as y,f as X,ee as Y,ef as D,m as Z}from"./index-CdntfUUz.js";import{P as ee,a as se,B as te,C as w}from"./PageLayout-B2kQpvXM.js";import{C as ae,a as le}from"./circle-stop-0gJGQm_q.js";import{R as C}from"./Grid-DYtN9_Hv.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MemoryDebug-hHFx3BHO.js b/frontend/dist/assets/MemoryDebug-SZdlepUQ.js similarity index 97% rename from frontend/dist/assets/MemoryDebug-hHFx3BHO.js rename to frontend/dist/assets/MemoryDebug-SZdlepUQ.js index b3725f02..5dd47cdd 100644 --- a/frontend/dist/assets/MemoryDebug-hHFx3BHO.js +++ b/frontend/dist/assets/MemoryDebug-SZdlepUQ.js @@ -1,4 +1,4 @@ -import{e as T,r as l,j as e,f as D,B as k,dD as E,cY as C,cb as $,b_ as v}from"./index-CAHLMlrb.js";import{c as F,r as R}from"./maintenance-C2rIkwgy.js";import{P as L,a as I,B as P,C as M}from"./PageLayout-CgrNSpBT.js";import{R as _}from"./Grid-B0tNiHTX.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as T,r as l,j as e,f as D,B as k,dD as E,cY as C,cb as $,b_ as v}from"./index-CdntfUUz.js";import{c as F,r as R}from"./maintenance-DDkOUzHo.js";import{P as L,a as I,B as P,C as M}from"./PageLayout-B2kQpvXM.js";import{R as _}from"./Grid-DYtN9_Hv.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MeshGraph-C36tfydu.js b/frontend/dist/assets/MeshGraph-wRRLz_lr.js similarity index 99% rename from frontend/dist/assets/MeshGraph-C36tfydu.js rename to frontend/dist/assets/MeshGraph-wRRLz_lr.js index 9022f814..6b63f90c 100644 --- a/frontend/dist/assets/MeshGraph-C36tfydu.js +++ b/frontend/dist/assets/MeshGraph-wRRLz_lr.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-Ch-WmeRM.js","assets/index-CAHLMlrb.js","assets/max-D9Y_Gk4E.js","assets/consumer-registry-Bsx-B9R6.js","assets/variants-DqP1b_He.js","assets/git-branch-BIN5tJ3h.js","assets/clock-DB7tKCHV.js","assets/database-BeT3SO6w.js","assets/badge-colors-Dl76Mz8m.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/WorkspaceNav-ClxMgBhr.js","assets/eye-DQ-O4VIh.js","assets/layers-CU7un-PT.js","assets/search-C1Hut7GR.js","assets/settings-2-DgwT7JNL.js","assets/rotate-ccw-Cav5SApM.js","assets/target-CAfnTnyS.js","assets/network-DsulLblE.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); -var dL=Object.defineProperty;var hL=(i,e,t)=>e in i?dL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var y=(i,e,t)=>hL(i,typeof e!="symbol"?e+"":e,t);import{e as rp,r as U,_ as g0,bw as cn,cB as gg,dH as fL,dI as pL,j as f,aB as mL,aC as _0,bO as Gl,c as oh,b_ as gL,dJ as _L,m as ga,a7 as ty,a9 as _g,dK as NS,dL as jh,dM as DS,at as hd,dN as yL,dO as bL,d as Jc,dP as vL,aS as xL,dQ as wL,dR as SL,dS as EL,dT as CL,dU as TL,dV as kL,dW as AL,ad as IL,cT as LL,z as MS,dX as RL,Y as We,Z as Xt,a2 as Oi,au as be,dY as PL,dG as NL,R as yg,d9 as fd,aD as y0,bZ as DL,cA as ML,aE as Pc,dZ as BL,b4 as OL,d_ as FL,d$ as zL,B as iy,c8 as UL,a8 as $L,aa as jL,e0 as HL,cz as VL}from"./index-CAHLMlrb.js";import{m as b0,t as bg,a as GL,b as WL,e as An,u as YL,G as qL,c as XL,W as v0,E as KL}from"./max-D9Y_Gk4E.js";import{u as ZL,r as QL,f as x0,g as JL,e as eR}from"./consumer-registry-Bsx-B9R6.js";import{s as tR,M as BS,a as w0,b as ny}from"./variants-DqP1b_He.js";import{G as Yp}from"./git-branch-BIN5tJ3h.js";import{C as iR}from"./clock-DB7tKCHV.js";import{D as nR}from"./database-BeT3SO6w.js";import{N as sR,a as rR}from"./badge-colors-Dl76Mz8m.js";import{e as oR,f as S0,g as aR}from"./meshcore-tx-constants-DgpFTAmf.js";import{W as lR,C as qp}from"./WorkspaceNav-ClxMgBhr.js";import{E as cR}from"./eye-DQ-O4VIh.js";import{L as E0}from"./layers-CU7un-PT.js";import{S as C0}from"./search-C1Hut7GR.js";import{S as T0}from"./settings-2-DgwT7JNL.js";import{R as k0}from"./rotate-ccw-Cav5SApM.js";import{T as uR}from"./target-CAfnTnyS.js";import{N as OS}from"./network-DsulLblE.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/webgl-device-QoBMYpnS-DeOuNIG2.js","assets/index-CdntfUUz.js","assets/max-DUHCwm37.js","assets/consumer-registry-K46Bg-WH.js","assets/variants-Bez4f_xY.js","assets/git-branch-BfTP80e2.js","assets/clock-DKukpMjT.js","assets/database-D8ZiJ_7E.js","assets/badge-colors-Dl76Mz8m.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/WorkspaceNav-BZrtCI1_.js","assets/eye-Dc2SU7n8.js","assets/layers-80mLD98M.js","assets/search-D8B8LMYr.js","assets/settings-2-iRV0UHU5.js","assets/rotate-ccw-DyxXzFWc.js","assets/target-D6g_GBrY.js","assets/network-TeIBnbEp.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); +var dL=Object.defineProperty;var hL=(i,e,t)=>e in i?dL(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var y=(i,e,t)=>hL(i,typeof e!="symbol"?e+"":e,t);import{e as rp,r as U,_ as g0,bw as cn,cB as gg,dH as fL,dI as pL,j as f,aB as mL,aC as _0,bO as Gl,c as oh,b_ as gL,dJ as _L,m as ga,a7 as ty,a9 as _g,dK as NS,dL as jh,dM as DS,at as hd,dN as yL,dO as bL,d as Jc,dP as vL,aS as xL,dQ as wL,dR as SL,dS as EL,dT as CL,dU as TL,dV as kL,dW as AL,ad as IL,cT as LL,z as MS,dX as RL,Y as We,Z as Xt,a2 as Oi,au as be,dY as PL,dG as NL,R as yg,d9 as fd,aD as y0,bZ as DL,cA as ML,aE as Pc,dZ as BL,b4 as OL,d_ as FL,d$ as zL,B as iy,c8 as UL,a8 as $L,aa as jL,e0 as HL,cz as VL}from"./index-CdntfUUz.js";import{m as b0,t as bg,a as GL,b as WL,e as An,u as YL,G as qL,c as XL,W as v0,E as KL}from"./max-DUHCwm37.js";import{u as ZL,r as QL,f as x0,g as JL,e as eR}from"./consumer-registry-K46Bg-WH.js";import{s as tR,M as BS,a as w0,b as ny}from"./variants-Bez4f_xY.js";import{G as Yp}from"./git-branch-BfTP80e2.js";import{C as iR}from"./clock-DKukpMjT.js";import{D as nR}from"./database-D8ZiJ_7E.js";import{N as sR,a as rR}from"./badge-colors-Dl76Mz8m.js";import{e as oR,f as S0,g as aR}from"./meshcore-tx-constants-DgpFTAmf.js";import{W as lR,C as qp}from"./WorkspaceNav-BZrtCI1_.js";import{E as cR}from"./eye-Dc2SU7n8.js";import{L as E0}from"./layers-80mLD98M.js";import{S as C0}from"./search-D8B8LMYr.js";import{S as T0}from"./settings-2-iRV0UHU5.js";import{R as k0}from"./rotate-ccw-DyxXzFWc.js";import{T as uR}from"./target-D6g_GBrY.js";import{N as OS}from"./network-TeIBnbEp.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -29,7 +29,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)}}};$(k2,"defaultProps",{..._n.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let XN=k2;function KN(i){return ZN(i.source)||i.id||my(`unnamed ${i.stage}-shader`)}function ZN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const I2=class L2 extends _n{constructor(e,t){super(e,t,L2.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"}};$(I2,"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=I2;const R2=class P2 extends _n{constructor(e,t){super(e,t,P2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(R2,"defaultProps",{..._n.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let ix=R2;function QN(i){return iD[i]}function JN(i){const[e,t]=tD[i],n=e==="i32"||e==="u32",s=e!=="u32",r=eD[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const eD={f32:4,f16:2,i32:4,u32:4},tD={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]},iD={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 N2(i,e){const t={};for(const n of i.attributes){const s=nD(i,e,n.name);s&&(t[n.name]=s)}return t}function zte(i,e,t=16){const n=N2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function nD(i,e,t){const n=sD(i,t),s=rD(e,t);if(!n)return null;const r=JN(n.type),o=SN(r),a=(s==null?void 0:s.vertexFormat)||o,l=_y(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 sD(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 rD(i,e){oD(i);let t=aD(i,e);return t||(t=lD(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function oD(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 aD(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 lD(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=_y(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 wd;function D2(i){return(!wd||wd.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){hD(this.uniforms[e],t)||(this.uniforms[e]=fD(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ai=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 dD(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new pD({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:pe.UNIFORM|pe.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:pe.UNIFORM|pe.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 Bo;(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"})(Bo||(Bo={}));const mD={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:{}},gD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),_D=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)}}),yD=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 bD(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&&vD(s),s}return this.originalGetContext(t,n)}}function vD(i){i.getExtension("EXT_color_buffer_float");const e={...mD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:gD(i),OES_vertex_array_object:_D(i),ANGLE_instanced_arrays:yD(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 M2(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 xD=1;let mi=null,nx=!1;const by={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function wD(i){if(!globalThis.SPECTOR)try{await M2(i.debugSpectorJSUrl||by.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function jte(i){var e;if(i={...by,...i},!i.debugSpectorJS)return null;if(!mi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(xD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;mi=new t,globalThis.luma&&(globalThis.luma.spector=mi)}if(!mi)return null;if(nx||(nx=!0,mi.spyCanvases(),mi==null||mi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),mi==null||mi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),mi==null||mi.getResultUI(),mi==null||mi.resultView.display(),mi==null||mi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;mi==null||mi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),mi==null||mi.stopCapture()})}return mi}const SD="https://unpkg.com/webgl-debug@2.0.1/index.js";function B2(i){return i.luma=i.luma||{},i.luma}async function ED(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await M2(SD))}function Hte(i,e={}){return e.debugWebGL||e.traceWebGL?TD(i,e):CD(i)}function CD(i){const e=B2(i);return e.realContext?e.realContext:i}function TD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=B2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Bo,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,kD.bind(null,e),AD.bind(null,e));for(const o in Bo)!(o in n)&&typeof Bo[o]=="number"&&(n[o]=Bo[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 sx(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 kD(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 AD(i,e,t){let n="";le.level>=1&&(n=sx(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||sx(e,t);debugger}}const Sd=1;class ID extends zN{constructor(){super(),$(this,"type","webgl"),Tg.defaultProps={...Tg.defaultProps,...by}}enforceWebGL2(e){bD(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 g0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-Ch-WmeRM.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!LD(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 g0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-Ch-WmeRM.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));le.groupCollapsed(Sd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(ED()),e.debugSpectorJS&&n.push(wD(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(Sd,o)(),le.table(Sd,r.info)(),r}finally{le.groupEnd(Sd)()}}}function LD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const RD=new ID,PD="#b3b3b3",ND=void 0,Ig=void 0,DD=1,MD=4,BD="#666666",OD=.1,FD=1,zD=1,O2="#222222",fe={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},UD=.7,$D=.95,jD=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:F2,setPrototypeOf:rx,isFrozen:HD,getPrototypeOf:VD,getOwnPropertyDescriptor:GD}=Object;let{freeze:hn,seal:xs,create:z2}=Object,{apply:Lg,construct:Rg}=typeof Reflect<"u"&&Reflect;hn||(hn=function(i){return i});xs||(xs=function(i){return i});Lg||(Lg=function(i,e,t){return i.apply(e,t)});Rg||(Rg=function(i,e){return new i(...e)});const Ed=fn(Array.prototype.forEach),WD=fn(Array.prototype.lastIndexOf),ox=fn(Array.prototype.pop),cc=fn(Array.prototype.push),YD=fn(Array.prototype.splice),hh=fn(String.prototype.toLowerCase),sm=fn(String.prototype.toString),ax=fn(String.prototype.match),uc=fn(String.prototype.replace),qD=fn(String.prototype.indexOf),XD=fn(String.prototype.trim),Fs=fn(Object.prototype.hasOwnProperty),sn=fn(RegExp.prototype.test),dc=KD(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;rx&&rx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(HD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function ZD(i){for(let e=0;e/gm),iM=xs(/\$\{[\w\W]*/gm),nM=xs(/^data-[\-\w.\u00B7-\uFFFF]+$/),sM=xs(/^aria-[\-\w]+$/),U2=xs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rM=xs(/^(?:\w+script|data):/i),oM=xs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$2=xs(/^html$/i),aM=xs(/^[a-z][.\w]*(-[.\w]+)+$/i);var hx=Object.freeze({__proto__:null,ARIA_ATTR:sM,ATTR_WHITESPACE:oM,CUSTOM_ELEMENT:aM,DATA_ATTR:nM,DOCTYPE_NAME:$2,ERB_EXPR:tM,IS_ALLOWED_URI:U2,IS_SCRIPT_OR_DATA:rM,MUSTACHE_EXPR:eM,TMPLIT_EXPR:iM});const fc={element:1,text:3,progressingInstruction:7,comment:8,document:9},lM=function(){return typeof window>"u"?null:window},cM=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}},fx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function j2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lM();const e=L=>j2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==fc.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,b=hc(m,"cloneNode"),g=hc(m,"remove"),_=hc(m,"nextSibling"),S=hc(m,"childNodes"),E=hc(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:ie}=n;let M=fx();e.isSupported=typeof F2=="function"&&typeof E=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ue,ERB_EXPR:ne,TMPLIT_EXPR:R,DATA_ATTR:Q,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:te}=hx;let{IS_ALLOWED_URI:se}=hx,J=null;const Se=it({},[...lx,...rm,...om,...am,...cx]);let xe=null;const Qe=it({},[...ux,...lm,...dx,...Cd]);let he=Object.seal(z2(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}})),gt=null,Ke=null,lt=!0,ae=!0,Ee=!1,Ve=!0,Y=!1,rt=!0,ke=!1,It=!1,Ot=!1,me=!1,Je=!1,Ci=!1,Qt=!0,wo=!1;const Mr="user-content-";let Nn=!0,Qn=!1,ji={},ci=null;const tn=it({},["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 Jn=null;const As=it({},["audio","video","img","source","image","track"]);let es=null;const er=it({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bn="http://www.w3.org/1998/Math/MathML",Dn="http://www.w3.org/2000/svg",hi="http://www.w3.org/1999/xhtml";let fi=hi,Ri=!1,Mn=null;const ts=it({},[bn,Dn,hi],sm);let Br=it({},["mi","mo","mn","ms","mtext"]),is=it({},["annotation-xml"]);const Bn=it({},["title","style","font","a","script"]);let tr=null;const Is=["application/xhtml+xml","text/html"],Pa="text/html";let si=null,Lt=null;const ns=t.createElement("form"),So=function(L){return L instanceof RegExp||L instanceof Function},Rt=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Lt&&Lt===L)){if((!L||typeof L!="object")&&(L={}),L=Gr(L),tr=Is.indexOf(L.PARSER_MEDIA_TYPE)===-1?Pa:L.PARSER_MEDIA_TYPE,si=tr==="application/xhtml+xml"?sm:hh,J=Fs(L,"ALLOWED_TAGS")?it({},L.ALLOWED_TAGS,si):Se,xe=Fs(L,"ALLOWED_ATTR")?it({},L.ALLOWED_ATTR,si):Qe,Mn=Fs(L,"ALLOWED_NAMESPACES")?it({},L.ALLOWED_NAMESPACES,sm):ts,es=Fs(L,"ADD_URI_SAFE_ATTR")?it(Gr(er),L.ADD_URI_SAFE_ATTR,si):er,Jn=Fs(L,"ADD_DATA_URI_TAGS")?it(Gr(As),L.ADD_DATA_URI_TAGS,si):As,ci=Fs(L,"FORBID_CONTENTS")?it({},L.FORBID_CONTENTS,si):tn,gt=Fs(L,"FORBID_TAGS")?it({},L.FORBID_TAGS,si):Gr({}),Ke=Fs(L,"FORBID_ATTR")?it({},L.FORBID_ATTR,si):Gr({}),ji=Fs(L,"USE_PROFILES")?L.USE_PROFILES:!1,lt=L.ALLOW_ARIA_ATTR!==!1,ae=L.ALLOW_DATA_ATTR!==!1,Ee=L.ALLOW_UNKNOWN_PROTOCOLS||!1,Ve=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=L.SAFE_FOR_TEMPLATES||!1,rt=L.SAFE_FOR_XML!==!1,ke=L.WHOLE_DOCUMENT||!1,me=L.RETURN_DOM||!1,Je=L.RETURN_DOM_FRAGMENT||!1,Ci=L.RETURN_TRUSTED_TYPE||!1,Ot=L.FORCE_BODY||!1,Qt=L.SANITIZE_DOM!==!1,wo=L.SANITIZE_NAMED_PROPS||!1,Nn=L.KEEP_CONTENT!==!1,Qn=L.IN_PLACE||!1,se=L.ALLOWED_URI_REGEXP||U2,fi=L.NAMESPACE||hi,Br=L.MATHML_TEXT_INTEGRATION_POINTS||Br,is=L.HTML_INTEGRATION_POINTS||is,he=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&So(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&So(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ae=!1),Je&&(me=!0),ji&&(J=it({},cx),xe=[],ji.html===!0&&(it(J,lx),it(xe,ux)),ji.svg===!0&&(it(J,rm),it(xe,lm),it(xe,Cd)),ji.svgFilters===!0&&(it(J,om),it(xe,lm),it(xe,Cd)),ji.mathMl===!0&&(it(J,am),it(xe,dx),it(xe,Cd))),L.ADD_TAGS&&(J===Se&&(J=Gr(J)),it(J,L.ADD_TAGS,si)),L.ADD_ATTR&&(xe===Qe&&(xe=Gr(xe)),it(xe,L.ADD_ATTR,si)),L.ADD_URI_SAFE_ATTR&&it(es,L.ADD_URI_SAFE_ATTR,si),L.FORBID_CONTENTS&&(ci===tn&&(ci=Gr(ci)),it(ci,L.FORBID_CONTENTS,si)),Nn&&(J["#text"]=!0),ke&&it(J,["html","head","body"]),J.table&&(it(J,["tbody"]),delete gt.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw dc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,A=x.createHTML("")}else x===void 0&&(x=cM(p,s)),x!==null&&typeof A=="string"&&(A=x.createHTML(""));hn&&hn(L),Lt=L}},Ls=it({},[...rm,...om,...QD]),Or=it({},[...am,...JD]),Eo=function(L){let V=E(L);(!V||!V.tagName)&&(V={namespaceURI:fi,tagName:"template"});const C=hh(L.tagName),G=hh(V.tagName);return Mn[L.namespaceURI]?L.namespaceURI===Dn?V.namespaceURI===hi?C==="svg":V.namespaceURI===bn?C==="svg"&&(G==="annotation-xml"||Br[G]):!!Ls[C]:L.namespaceURI===bn?V.namespaceURI===hi?C==="math":V.namespaceURI===Dn?C==="math"&&is[G]:!!Or[C]:L.namespaceURI===hi?V.namespaceURI===Dn&&!is[G]||V.namespaceURI===bn&&!Br[G]?!1:!Or[C]&&(Bn[C]||!Ls[C]):!!(tr==="application/xhtml+xml"&&Mn[L.namespaceURI]):!1},On=function(L){cc(e.removed,{element:L});try{E(L).removeChild(L)}catch{g(L)}},pi=function(L,V){try{cc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{cc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(L),L==="is")if(me||Je)try{On(V)}catch{}else try{V.setAttribute(L,"")}catch{}},Fn=function(L){let V=null,C=null;if(Ot)L=""+L;else{const Ce=ax(L,/^[\r\n\t ]+/);C=Ce&&Ce[0]}tr==="application/xhtml+xml"&&fi===hi&&(L=''+L+"");const G=x?x.createHTML(L):L;if(fi===hi)try{V=new h().parseFromString(G,tr)}catch{}if(!V||!V.documentElement){V=I.createDocument(fi,"template",null);try{V.documentElement.innerHTML=Ri?A:G}catch{}}const re=V.body||V.documentElement;return L&&C&&re.insertBefore(t.createTextNode(C),re.childNodes[0]||null),fi===hi?Z.call(V,ke?"html":"body")[0]:ke?V.documentElement:re},Fr=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)},ss=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")},ct=function(L){return typeof a=="function"&&L instanceof a};function nn(L,V,C){Ed(L,G=>{G.call(e,V,C,Lt)})}const tt=function(L){let V=null;if(nn(M.beforeSanitizeElements,L,null),ss(L))return On(L),!0;const C=si(L.nodeName);if(nn(M.uponSanitizeElement,L,{tagName:C,allowedTags:J}),rt&&L.hasChildNodes()&&!ct(L.firstElementChild)&&sn(/<[/\w!]/g,L.innerHTML)&&sn(/<[/\w!]/g,L.textContent)||L.nodeType===fc.progressingInstruction||rt&&L.nodeType===fc.comment&&sn(/<[/\w]/g,L.data))return On(L),!0;if(!J[C]||gt[C]){if(!gt[C]&&zr(C)&&(he.tagNameCheck instanceof RegExp&&sn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C)))return!1;if(Nn&&!ci[C]){const G=E(L)||L.parentNode,re=S(L)||L.childNodes;if(re&&G){const Ce=re.length;for(let xt=Ce-1;xt>=0;--xt){const ot=b(re[xt],!0);ot.__removalCount=(L.__removalCount||0)+1,G.insertBefore(ot,_(L))}}}return On(L),!0}return L instanceof l&&!Eo(L)||(C==="noscript"||C==="noembed"||C==="noframes")&&sn(/<\/no(script|embed|frames)/i,L.innerHTML)?(On(L),!0):(Y&&L.nodeType===fc.text&&(V=L.textContent,Ed([ue,ne,R],G=>{V=uc(V,G," ")}),L.textContent!==V&&(cc(e.removed,{element:L.cloneNode()}),L.textContent=V)),nn(M.afterSanitizeElements,L,null),!1)},ea=function(L,V,C){if(Qt&&(V==="id"||V==="name")&&(C in t||C in ns))return!1;if(!(ae&&!Ke[V]&&sn(Q,V))&&!(lt&&sn(F,V))){if(!xe[V]||Ke[V]){if(!(zr(L)&&(he.tagNameCheck instanceof RegExp&&sn(he.tagNameCheck,L)||he.tagNameCheck instanceof Function&&he.tagNameCheck(L))&&(he.attributeNameCheck instanceof RegExp&&sn(he.attributeNameCheck,V)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(V))||V==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&sn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C))))return!1}else if(!es[V]&&!sn(se,uc(C,ee,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&qD(C,"data:")===0&&Jn[L])&&!(Ee&&!sn(X,uc(C,ee,"")))&&C)return!1}return!0},zr=function(L){return L!=="annotation-xml"&&ax(L,te)},ir=function(L){nn(M.beforeSanitizeAttributes,L,null);const{attributes:V}=L;if(!V||ss(L))return;const C={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const re=V[G],{name:Ce,namespaceURI:xt,value:ot}=re,Tt=si(Ce),$t=ot;let Pt=Ce==="value"?$t:XD($t);if(C.attrName=Tt,C.attrValue=Pt,C.keepAttr=!0,C.forceKeepAttr=void 0,nn(M.uponSanitizeAttribute,L,C),Pt=C.attrValue,wo&&(Tt==="id"||Tt==="name")&&(pi(Ce,L),Pt=Mr+Pt),rt&&sn(/((--!?|])>)|<\/(style|title)/i,Pt)){pi(Ce,L);continue}if(C.forceKeepAttr)continue;if(!C.keepAttr){pi(Ce,L);continue}if(!Ve&&sn(/\/>/i,Pt)){pi(Ce,L);continue}Y&&Ed([ue,ne,R],Jt=>{Pt=uc(Pt,Jt," ")});const Pi=si(L.nodeName);if(!ea(Pi,Tt,Pt)){pi(Ce,L);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!xt)switch(p.getAttributeType(Pi,Tt)){case"TrustedHTML":{Pt=x.createHTML(Pt);break}case"TrustedScriptURL":{Pt=x.createScriptURL(Pt);break}}if(Pt!==$t)try{xt?L.setAttributeNS(xt,Ce,Pt):L.setAttribute(Ce,Pt),ss(L)?On(L):ox(e.removed)}catch{pi(Ce,L)}}nn(M.afterSanitizeAttributes,L,null)},rs=function L(V){let C=null;const G=Fr(V);for(nn(M.beforeSanitizeShadowDOM,V,null);C=G.nextNode();)nn(M.uponSanitizeShadowNode,C,null),tt(C),ir(C),C.content instanceof r&&L(C.content);nn(M.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(L){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,G=null,re=null,Ce=null;if(Ri=!L,Ri&&(L=""),typeof L!="string"&&!ct(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw dc("dirty is not a string, aborting")}else throw dc("toString is not a function");if(!e.isSupported)return L;if(It||Rt(V),e.removed=[],typeof L=="string"&&(Qn=!1),Qn){if(L.nodeName){const Tt=si(L.nodeName);if(!J[Tt]||gt[Tt])throw dc("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)C=Fn(""),G=C.ownerDocument.importNode(L,!0),G.nodeType===fc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?C=G:C.appendChild(G);else{if(!me&&!Y&&!ke&&L.indexOf("<")===-1)return x&&Ci?x.createHTML(L):L;if(C=Fn(L),!C)return me?null:Ci?A:""}C&&Ot&&On(C.firstChild);const xt=Fr(Qn?L:C);for(;re=xt.nextNode();)tt(re),ir(re),re.content instanceof r&&rs(re.content);if(Qn)return L;if(me){if(Je)for(Ce=H.call(C.ownerDocument);C.firstChild;)Ce.appendChild(C.firstChild);else Ce=C;return(xe.shadowroot||xe.shadowrootmode)&&(Ce=ie.call(n,Ce,!0)),Ce}let ot=ke?C.outerHTML:C.innerHTML;return ke&&J["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&sn($2,C.ownerDocument.doctype.name)&&(ot=" +`,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)}}};$(k2,"defaultProps",{..._n.defaultProps,language:"auto",stage:void 0,source:"",sourceMap:null,entryPoint:"main",debugShaders:void 0});let XN=k2;function KN(i){return ZN(i.source)||i.id||my(`unnamed ${i.stage}-shader`)}function ZN(i,e="unnamed"){const t=/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/.exec(i);return t?t[1]:e}const I2=class L2 extends _n{constructor(e,t){super(e,t,L2.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"}};$(I2,"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=I2;const R2=class P2 extends _n{constructor(e,t){super(e,t,P2.defaultProps),$(this,"hash",""),$(this,"shaderLayout"),this.shaderLayout=t.shaderLayout}get[Symbol.toStringTag](){return"ComputePipeline"}};$(R2,"defaultProps",{..._n.defaultProps,shader:void 0,entryPoint:void 0,constants:{},shaderLayout:void 0});let ix=R2;function QN(i){return iD[i]}function JN(i){const[e,t]=tD[i],n=e==="i32"||e==="u32",s=e!=="u32",r=eD[e]*t;return{primitiveType:e,components:t,byteLength:r,integer:n,signed:s}}const eD={f32:4,f16:2,i32:4,u32:4},tD={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]},iD={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 N2(i,e){const t={};for(const n of i.attributes){const s=nD(i,e,n.name);s&&(t[n.name]=s)}return t}function zte(i,e,t=16){const n=N2(i,e),s=new Array(t).fill(null);for(const r of Object.values(n))s[r.location]=r;return s}function nD(i,e,t){const n=sD(i,t),s=rD(e,t);if(!n)return null;const r=JN(n.type),o=SN(r),a=(s==null?void 0:s.vertexFormat)||o,l=_y(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 sD(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 rD(i,e){oD(i);let t=aD(i,e);return t||(t=lD(i,e),t)?t:(le.warn(`layout for attribute "${e}" not present in buffer layout`),null)}function oD(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 aD(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 lD(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=_y(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 wd;function D2(i){return(!wd||wd.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){hD(this.uniforms[e],t)||(this.uniforms[e]=fD(t),this.modifiedUniforms[e]=!0,this.modified=!0)}}let ai=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 dD(n.uniformTypes??{},n.uniformSizes??{});this.uniformBufferLayouts.set(s,r);const o=new pD({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:pe.UNIFORM|pe.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:pe.UNIFORM|pe.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 Bo;(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"})(Bo||(Bo={}));const mD={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:{}},gD=i=>({drawBuffersWEBGL(e){return i.drawBuffers(e)},COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067}),_D=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)}}),yD=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 bD(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&&vD(s),s}return this.originalGetContext(t,n)}}function vD(i){i.getExtension("EXT_color_buffer_float");const e={...mD,WEBGL_disjoint_timer_query:i.getExtension("EXT_disjoint_timer_query_webgl2"),WEBGL_draw_buffers:gD(i),OES_vertex_array_object:_D(i),ANGLE_instanced_arrays:yD(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 M2(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 xD=1;let mi=null,nx=!1;const by={debugSpectorJS:le.get("debug-spectorjs"),debugSpectorJSUrl:"https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js",gl:void 0};async function wD(i){if(!globalThis.SPECTOR)try{await M2(i.debugSpectorJSUrl||by.debugSpectorJSUrl)}catch(e){le.warn(String(e))}}function jte(i){var e;if(i={...by,...i},!i.debugSpectorJS)return null;if(!mi&&globalThis.SPECTOR&&!((e=globalThis.luma)!=null&&e.spector)){le.probe(xD,"SPECTOR found and initialized. Start with `luma.spector.displayUI()`")();const{Spector:t}=globalThis.SPECTOR;mi=new t,globalThis.luma&&(globalThis.luma.spector=mi)}if(!mi)return null;if(nx||(nx=!0,mi.spyCanvases(),mi==null||mi.onCaptureStarted.add(t=>le.info("Spector capture started:",t)()),mi==null||mi.onCapture.add(t=>{le.info("Spector capture complete:",t)(),mi==null||mi.getResultUI(),mi==null||mi.resultView.display(),mi==null||mi.resultView.addCapture(t)})),i.gl){const t=i.gl,n=t.device;mi==null||mi.startCapture(i.gl,500),t.device=n,new Promise(s=>setTimeout(s,2e3)).then(s=>{le.info("Spector capture stopped after 2 seconds")(),mi==null||mi.stopCapture()})}return mi}const SD="https://unpkg.com/webgl-debug@2.0.1/index.js";function B2(i){return i.luma=i.luma||{},i.luma}async function ED(){Vu()&&!globalThis.WebGLDebugUtils&&(globalThis.global=globalThis.global||globalThis,globalThis.global.module={},await M2(SD))}function Hte(i,e={}){return e.debugWebGL||e.traceWebGL?TD(i,e):CD(i)}function CD(i){const e=B2(i);return e.realContext?e.realContext:i}function TD(i,e){if(!globalThis.WebGLDebugUtils)return le.warn("webgl-debug not loaded")(),i;const t=B2(i);if(t.debugContext)return t.debugContext;globalThis.WebGLDebugUtils.init({...Bo,...i});const n=globalThis.WebGLDebugUtils.makeDebugContext(i,kD.bind(null,e),AD.bind(null,e));for(const o in Bo)!(o in n)&&typeof Bo[o]=="number"&&(n[o]=Bo[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 sx(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 kD(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 AD(i,e,t){let n="";le.level>=1&&(n=sx(e,t),i.traceWebGL&&le.log(1,n)());for(const s of t)if(s===void 0){n=n||sx(e,t);debugger}}const Sd=1;class ID extends zN{constructor(){super(),$(this,"type","webgl"),Tg.defaultProps={...Tg.defaultProps,...by}}enforceWebGL2(e){bD(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 g0(async()=>{const{WebGLDevice:r}=await import("./webgl-device-QoBMYpnS-DeOuNIG2.js");return{WebGLDevice:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));if(e instanceof n)return e;if((e==null?void 0:e.device)instanceof n)return e.device;if(!LD(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 g0(async()=>{const{WebGLDevice:n}=await import("./webgl-device-QoBMYpnS-DeOuNIG2.js");return{WebGLDevice:n}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));le.groupCollapsed(Sd,"WebGLDevice created")();try{const n=[];(e.debugWebGL||e.debug)&&n.push(ED()),e.debugSpectorJS&&n.push(wD(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(Sd,o)(),le.table(Sd,r.info)(),r}finally{le.groupEnd(Sd)()}}}function LD(i){return typeof WebGL2RenderingContext<"u"&&i instanceof WebGL2RenderingContext?!0:!!(i&&Number.isFinite(i._version))}const RD=new ID,PD="#b3b3b3",ND=void 0,Ig=void 0,DD=1,MD=4,BD="#666666",OD=.1,FD=1,zD=1,O2="#222222",fe={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},UD=.7,$D=.95,jD=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:F2,setPrototypeOf:rx,isFrozen:HD,getPrototypeOf:VD,getOwnPropertyDescriptor:GD}=Object;let{freeze:hn,seal:xs,create:z2}=Object,{apply:Lg,construct:Rg}=typeof Reflect<"u"&&Reflect;hn||(hn=function(i){return i});xs||(xs=function(i){return i});Lg||(Lg=function(i,e,t){return i.apply(e,t)});Rg||(Rg=function(i,e){return new i(...e)});const Ed=fn(Array.prototype.forEach),WD=fn(Array.prototype.lastIndexOf),ox=fn(Array.prototype.pop),cc=fn(Array.prototype.push),YD=fn(Array.prototype.splice),hh=fn(String.prototype.toLowerCase),sm=fn(String.prototype.toString),ax=fn(String.prototype.match),uc=fn(String.prototype.replace),qD=fn(String.prototype.indexOf),XD=fn(String.prototype.trim),Fs=fn(Object.prototype.hasOwnProperty),sn=fn(RegExp.prototype.test),dc=KD(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;rx&&rx(i,null);let n=e.length;for(;n--;){let s=e[n];if(typeof s=="string"){const r=t(s);r!==s&&(HD(e)||(e[n]=r),s=r)}i[s]=!0}return i}function ZD(i){for(let e=0;e/gm),iM=xs(/\$\{[\w\W]*/gm),nM=xs(/^data-[\-\w.\u00B7-\uFFFF]+$/),sM=xs(/^aria-[\-\w]+$/),U2=xs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rM=xs(/^(?:\w+script|data):/i),oM=xs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$2=xs(/^html$/i),aM=xs(/^[a-z][.\w]*(-[.\w]+)+$/i);var hx=Object.freeze({__proto__:null,ARIA_ATTR:sM,ATTR_WHITESPACE:oM,CUSTOM_ELEMENT:aM,DATA_ATTR:nM,DOCTYPE_NAME:$2,ERB_EXPR:tM,IS_ALLOWED_URI:U2,IS_SCRIPT_OR_DATA:rM,MUSTACHE_EXPR:eM,TMPLIT_EXPR:iM});const fc={element:1,text:3,progressingInstruction:7,comment:8,document:9},lM=function(){return typeof window>"u"?null:window},cM=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}},fx=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function j2(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:lM();const e=L=>j2(L);if(e.version="3.2.6",e.removed=[],!i||!i.document||i.document.nodeType!==fc.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,b=hc(m,"cloneNode"),g=hc(m,"remove"),_=hc(m,"nextSibling"),S=hc(m,"childNodes"),E=hc(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:ie}=n;let M=fx();e.isSupported=typeof F2=="function"&&typeof E=="function"&&I&&I.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ue,ERB_EXPR:ne,TMPLIT_EXPR:R,DATA_ATTR:Q,ARIA_ATTR:F,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:te}=hx;let{IS_ALLOWED_URI:se}=hx,J=null;const Se=it({},[...lx,...rm,...om,...am,...cx]);let xe=null;const Qe=it({},[...ux,...lm,...dx,...Cd]);let he=Object.seal(z2(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}})),gt=null,Ke=null,lt=!0,ae=!0,Ee=!1,Ve=!0,Y=!1,rt=!0,ke=!1,It=!1,Ot=!1,me=!1,Je=!1,Ci=!1,Qt=!0,wo=!1;const Mr="user-content-";let Nn=!0,Qn=!1,ji={},ci=null;const tn=it({},["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 Jn=null;const As=it({},["audio","video","img","source","image","track"]);let es=null;const er=it({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bn="http://www.w3.org/1998/Math/MathML",Dn="http://www.w3.org/2000/svg",hi="http://www.w3.org/1999/xhtml";let fi=hi,Ri=!1,Mn=null;const ts=it({},[bn,Dn,hi],sm);let Br=it({},["mi","mo","mn","ms","mtext"]),is=it({},["annotation-xml"]);const Bn=it({},["title","style","font","a","script"]);let tr=null;const Is=["application/xhtml+xml","text/html"],Pa="text/html";let si=null,Lt=null;const ns=t.createElement("form"),So=function(L){return L instanceof RegExp||L instanceof Function},Rt=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Lt&&Lt===L)){if((!L||typeof L!="object")&&(L={}),L=Gr(L),tr=Is.indexOf(L.PARSER_MEDIA_TYPE)===-1?Pa:L.PARSER_MEDIA_TYPE,si=tr==="application/xhtml+xml"?sm:hh,J=Fs(L,"ALLOWED_TAGS")?it({},L.ALLOWED_TAGS,si):Se,xe=Fs(L,"ALLOWED_ATTR")?it({},L.ALLOWED_ATTR,si):Qe,Mn=Fs(L,"ALLOWED_NAMESPACES")?it({},L.ALLOWED_NAMESPACES,sm):ts,es=Fs(L,"ADD_URI_SAFE_ATTR")?it(Gr(er),L.ADD_URI_SAFE_ATTR,si):er,Jn=Fs(L,"ADD_DATA_URI_TAGS")?it(Gr(As),L.ADD_DATA_URI_TAGS,si):As,ci=Fs(L,"FORBID_CONTENTS")?it({},L.FORBID_CONTENTS,si):tn,gt=Fs(L,"FORBID_TAGS")?it({},L.FORBID_TAGS,si):Gr({}),Ke=Fs(L,"FORBID_ATTR")?it({},L.FORBID_ATTR,si):Gr({}),ji=Fs(L,"USE_PROFILES")?L.USE_PROFILES:!1,lt=L.ALLOW_ARIA_ATTR!==!1,ae=L.ALLOW_DATA_ATTR!==!1,Ee=L.ALLOW_UNKNOWN_PROTOCOLS||!1,Ve=L.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Y=L.SAFE_FOR_TEMPLATES||!1,rt=L.SAFE_FOR_XML!==!1,ke=L.WHOLE_DOCUMENT||!1,me=L.RETURN_DOM||!1,Je=L.RETURN_DOM_FRAGMENT||!1,Ci=L.RETURN_TRUSTED_TYPE||!1,Ot=L.FORCE_BODY||!1,Qt=L.SANITIZE_DOM!==!1,wo=L.SANITIZE_NAMED_PROPS||!1,Nn=L.KEEP_CONTENT!==!1,Qn=L.IN_PLACE||!1,se=L.ALLOWED_URI_REGEXP||U2,fi=L.NAMESPACE||hi,Br=L.MATHML_TEXT_INTEGRATION_POINTS||Br,is=L.HTML_INTEGRATION_POINTS||is,he=L.CUSTOM_ELEMENT_HANDLING||{},L.CUSTOM_ELEMENT_HANDLING&&So(L.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=L.CUSTOM_ELEMENT_HANDLING.tagNameCheck),L.CUSTOM_ELEMENT_HANDLING&&So(L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=L.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),L.CUSTOM_ELEMENT_HANDLING&&typeof L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=L.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(ae=!1),Je&&(me=!0),ji&&(J=it({},cx),xe=[],ji.html===!0&&(it(J,lx),it(xe,ux)),ji.svg===!0&&(it(J,rm),it(xe,lm),it(xe,Cd)),ji.svgFilters===!0&&(it(J,om),it(xe,lm),it(xe,Cd)),ji.mathMl===!0&&(it(J,am),it(xe,dx),it(xe,Cd))),L.ADD_TAGS&&(J===Se&&(J=Gr(J)),it(J,L.ADD_TAGS,si)),L.ADD_ATTR&&(xe===Qe&&(xe=Gr(xe)),it(xe,L.ADD_ATTR,si)),L.ADD_URI_SAFE_ATTR&&it(es,L.ADD_URI_SAFE_ATTR,si),L.FORBID_CONTENTS&&(ci===tn&&(ci=Gr(ci)),it(ci,L.FORBID_CONTENTS,si)),Nn&&(J["#text"]=!0),ke&&it(J,["html","head","body"]),J.table&&(it(J,["tbody"]),delete gt.tbody),L.TRUSTED_TYPES_POLICY){if(typeof L.TRUSTED_TYPES_POLICY.createHTML!="function")throw dc('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof L.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dc('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=L.TRUSTED_TYPES_POLICY,A=x.createHTML("")}else x===void 0&&(x=cM(p,s)),x!==null&&typeof A=="string"&&(A=x.createHTML(""));hn&&hn(L),Lt=L}},Ls=it({},[...rm,...om,...QD]),Or=it({},[...am,...JD]),Eo=function(L){let V=E(L);(!V||!V.tagName)&&(V={namespaceURI:fi,tagName:"template"});const C=hh(L.tagName),G=hh(V.tagName);return Mn[L.namespaceURI]?L.namespaceURI===Dn?V.namespaceURI===hi?C==="svg":V.namespaceURI===bn?C==="svg"&&(G==="annotation-xml"||Br[G]):!!Ls[C]:L.namespaceURI===bn?V.namespaceURI===hi?C==="math":V.namespaceURI===Dn?C==="math"&&is[G]:!!Or[C]:L.namespaceURI===hi?V.namespaceURI===Dn&&!is[G]||V.namespaceURI===bn&&!Br[G]?!1:!Or[C]&&(Bn[C]||!Ls[C]):!!(tr==="application/xhtml+xml"&&Mn[L.namespaceURI]):!1},On=function(L){cc(e.removed,{element:L});try{E(L).removeChild(L)}catch{g(L)}},pi=function(L,V){try{cc(e.removed,{attribute:V.getAttributeNode(L),from:V})}catch{cc(e.removed,{attribute:null,from:V})}if(V.removeAttribute(L),L==="is")if(me||Je)try{On(V)}catch{}else try{V.setAttribute(L,"")}catch{}},Fn=function(L){let V=null,C=null;if(Ot)L=""+L;else{const Ce=ax(L,/^[\r\n\t ]+/);C=Ce&&Ce[0]}tr==="application/xhtml+xml"&&fi===hi&&(L=''+L+"");const G=x?x.createHTML(L):L;if(fi===hi)try{V=new h().parseFromString(G,tr)}catch{}if(!V||!V.documentElement){V=I.createDocument(fi,"template",null);try{V.documentElement.innerHTML=Ri?A:G}catch{}}const re=V.body||V.documentElement;return L&&C&&re.insertBefore(t.createTextNode(C),re.childNodes[0]||null),fi===hi?Z.call(V,ke?"html":"body")[0]:ke?V.documentElement:re},Fr=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)},ss=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")},ct=function(L){return typeof a=="function"&&L instanceof a};function nn(L,V,C){Ed(L,G=>{G.call(e,V,C,Lt)})}const tt=function(L){let V=null;if(nn(M.beforeSanitizeElements,L,null),ss(L))return On(L),!0;const C=si(L.nodeName);if(nn(M.uponSanitizeElement,L,{tagName:C,allowedTags:J}),rt&&L.hasChildNodes()&&!ct(L.firstElementChild)&&sn(/<[/\w!]/g,L.innerHTML)&&sn(/<[/\w!]/g,L.textContent)||L.nodeType===fc.progressingInstruction||rt&&L.nodeType===fc.comment&&sn(/<[/\w]/g,L.data))return On(L),!0;if(!J[C]||gt[C]){if(!gt[C]&&zr(C)&&(he.tagNameCheck instanceof RegExp&&sn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C)))return!1;if(Nn&&!ci[C]){const G=E(L)||L.parentNode,re=S(L)||L.childNodes;if(re&&G){const Ce=re.length;for(let xt=Ce-1;xt>=0;--xt){const ot=b(re[xt],!0);ot.__removalCount=(L.__removalCount||0)+1,G.insertBefore(ot,_(L))}}}return On(L),!0}return L instanceof l&&!Eo(L)||(C==="noscript"||C==="noembed"||C==="noframes")&&sn(/<\/no(script|embed|frames)/i,L.innerHTML)?(On(L),!0):(Y&&L.nodeType===fc.text&&(V=L.textContent,Ed([ue,ne,R],G=>{V=uc(V,G," ")}),L.textContent!==V&&(cc(e.removed,{element:L.cloneNode()}),L.textContent=V)),nn(M.afterSanitizeElements,L,null),!1)},ea=function(L,V,C){if(Qt&&(V==="id"||V==="name")&&(C in t||C in ns))return!1;if(!(ae&&!Ke[V]&&sn(Q,V))&&!(lt&&sn(F,V))){if(!xe[V]||Ke[V]){if(!(zr(L)&&(he.tagNameCheck instanceof RegExp&&sn(he.tagNameCheck,L)||he.tagNameCheck instanceof Function&&he.tagNameCheck(L))&&(he.attributeNameCheck instanceof RegExp&&sn(he.attributeNameCheck,V)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(V))||V==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&sn(he.tagNameCheck,C)||he.tagNameCheck instanceof Function&&he.tagNameCheck(C))))return!1}else if(!es[V]&&!sn(se,uc(C,ee,""))&&!((V==="src"||V==="xlink:href"||V==="href")&&L!=="script"&&qD(C,"data:")===0&&Jn[L])&&!(Ee&&!sn(X,uc(C,ee,"")))&&C)return!1}return!0},zr=function(L){return L!=="annotation-xml"&&ax(L,te)},ir=function(L){nn(M.beforeSanitizeAttributes,L,null);const{attributes:V}=L;if(!V||ss(L))return;const C={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe,forceKeepAttr:void 0};let G=V.length;for(;G--;){const re=V[G],{name:Ce,namespaceURI:xt,value:ot}=re,Tt=si(Ce),$t=ot;let Pt=Ce==="value"?$t:XD($t);if(C.attrName=Tt,C.attrValue=Pt,C.keepAttr=!0,C.forceKeepAttr=void 0,nn(M.uponSanitizeAttribute,L,C),Pt=C.attrValue,wo&&(Tt==="id"||Tt==="name")&&(pi(Ce,L),Pt=Mr+Pt),rt&&sn(/((--!?|])>)|<\/(style|title)/i,Pt)){pi(Ce,L);continue}if(C.forceKeepAttr)continue;if(!C.keepAttr){pi(Ce,L);continue}if(!Ve&&sn(/\/>/i,Pt)){pi(Ce,L);continue}Y&&Ed([ue,ne,R],Jt=>{Pt=uc(Pt,Jt," ")});const Pi=si(L.nodeName);if(!ea(Pi,Tt,Pt)){pi(Ce,L);continue}if(x&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!xt)switch(p.getAttributeType(Pi,Tt)){case"TrustedHTML":{Pt=x.createHTML(Pt);break}case"TrustedScriptURL":{Pt=x.createScriptURL(Pt);break}}if(Pt!==$t)try{xt?L.setAttributeNS(xt,Ce,Pt):L.setAttribute(Ce,Pt),ss(L)?On(L):ox(e.removed)}catch{pi(Ce,L)}}nn(M.afterSanitizeAttributes,L,null)},rs=function L(V){let C=null;const G=Fr(V);for(nn(M.beforeSanitizeShadowDOM,V,null);C=G.nextNode();)nn(M.uponSanitizeShadowNode,C,null),tt(C),ir(C),C.content instanceof r&&L(C.content);nn(M.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(L){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,G=null,re=null,Ce=null;if(Ri=!L,Ri&&(L=""),typeof L!="string"&&!ct(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw dc("dirty is not a string, aborting")}else throw dc("toString is not a function");if(!e.isSupported)return L;if(It||Rt(V),e.removed=[],typeof L=="string"&&(Qn=!1),Qn){if(L.nodeName){const Tt=si(L.nodeName);if(!J[Tt]||gt[Tt])throw dc("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof a)C=Fn(""),G=C.ownerDocument.importNode(L,!0),G.nodeType===fc.element&&G.nodeName==="BODY"||G.nodeName==="HTML"?C=G:C.appendChild(G);else{if(!me&&!Y&&!ke&&L.indexOf("<")===-1)return x&&Ci?x.createHTML(L):L;if(C=Fn(L),!C)return me?null:Ci?A:""}C&&Ot&&On(C.firstChild);const xt=Fr(Qn?L:C);for(;re=xt.nextNode();)tt(re),ir(re),re.content instanceof r&&rs(re.content);if(Qn)return L;if(me){if(Je)for(Ce=H.call(C.ownerDocument);C.firstChild;)Ce.appendChild(C.firstChild);else Ce=C;return(xe.shadowroot||xe.shadowrootmode)&&(Ce=ie.call(n,Ce,!0)),Ce}let ot=ke?C.outerHTML:C.innerHTML;return ke&&J["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&sn($2,C.ownerDocument.doctype.name)&&(ot=" `+ot),Y&&Ed([ue,ne,R],Tt=>{ot=uc(ot,Tt," ")}),x&&Ci?x.createHTML(ot):ot},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Rt(L),It=!0},e.clearConfig=function(){Lt=null,It=!1},e.isValidAttribute=function(L,V,C){Lt||Rt({});const G=si(L),re=si(V);return ea(G,re,C)},e.addHook=function(L,V){typeof V=="function"&&cc(M[L],V)},e.removeHook=function(L,V){if(V!==void 0){const C=WD(M[L],V);return C===-1?void 0:YD(M[L],C,1)[0]}return ox(M[L])},e.removeHooks=function(L){M[L]=[]},e.removeAllHooks=function(){M=fx()},e}var uM=j2();const dM=i=>typeof i=="function",H2=i=>Array.isArray(i),hM=i=>i instanceof Object,fM=i=>i instanceof Object?i.constructor.name!=="Function"&&i.constructor.name!=="Object":!1,px=i=>hM(i)&&!H2(i)&&!dM(i)&&!fM(i);function Oo(i){let e;if(H2(i))e=i;else{const t=jo(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 pM(i,e,t){return .2126*i+.7152*e+.0722*t}function Hn(i,e,t=0,n=0,s,r){return i.readPixelsToArrayWebGL(e,{sourceX:t,sourceY:n,sourceWidth:s,sourceHeight:r})}function mM(i,e,t){return Math.min(Math.max(i,e),t)}function cs(i){return i!=null&&!Number.isNaN(i)}function gM(i,e){return uM.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 _M{constructor(){this.enableSimulation=fe.enableSimulation,this.backgroundColor=O2,this.spaceSize=fe.spaceSize,this.pointColor=PD,this.pointDefaultColor=void 0,this.pointGreyoutOpacity=ND,this.pointGreyoutColor=Ig,this.pointSize=MD,this.pointDefaultSize=void 0,this.pointOpacity=DD,this.pointSizeScale=fe.pointSizeScale,this.hoveredPointCursor=fe.hoveredPointCursor,this.hoveredLinkCursor=fe.hoveredLinkCursor,this.renderHoveredPointRing=fe.renderHoveredPointRing,this.hoveredPointRingColor=fe.hoveredPointRingColor,this.focusedPointRingColor=fe.focusedPointRingColor,this.focusedPointIndex=fe.focusedPointIndex,this.linkColor=BD,this.linkDefaultColor=void 0,this.linkOpacity=FD,this.linkGreyoutOpacity=OD,this.linkWidth=zD,this.linkDefaultWidth=void 0,this.linkWidthScale=fe.linkWidthScale,this.hoveredLinkColor=fe.hoveredLinkColor,this.hoveredLinkWidthIncrease=fe.hoveredLinkWidthIncrease,this.renderLinks=fe.renderLinks,this.curvedLinks=fe.curvedLinks,this.curvedLinkSegments=fe.curvedLinkSegments,this.curvedLinkWeight=fe.curvedLinkWeight,this.curvedLinkControlPointDistance=fe.curvedLinkControlPointDistance,this.linkArrows=fe.linkArrows,this.linkDefaultArrows=void 0,this.linkArrowsSizeScale=fe.linkArrowsSizeScale,this.scaleLinksOnZoom=fe.scaleLinksOnZoom,this.linkVisibilityDistanceRange=fe.linkVisibilityDistanceRange,this.linkVisibilityMinTransparency=fe.linkVisibilityMinTransparency,this.simulationDecay=fe.simulation.decay,this.simulationGravity=fe.simulation.gravity,this.simulationCenter=fe.simulation.center,this.simulationRepulsion=fe.simulation.repulsion,this.simulationRepulsionTheta=fe.simulation.repulsionTheta,this.simulationLinkSpring=fe.simulation.linkSpring,this.simulationLinkDistance=fe.simulation.linkDistance,this.simulationLinkDistRandomVariationRange=fe.simulation.linkDistRandomVariationRange,this.simulationRepulsionFromMouse=fe.simulation.repulsionFromMouse,this.enableRightClickRepulsion=fe.enableRightClickRepulsion,this.simulationFriction=fe.simulation.friction,this.simulationCluster=fe.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=fe.showFPSMonitor,this.pixelRatio=fe.pixelRatio,this.scalePointsOnZoom=fe.scalePointsOnZoom,this.initialZoomLevel=void 0,this.enableZoom=fe.enableZoom,this.enableSimulationDuringZoom=fe.enableSimulationDuringZoom,this.enableDrag=fe.enableDrag,this.fitViewOnInit=fe.fitViewOnInit,this.fitViewDelay=fe.fitViewDelay,this.fitViewPadding=fe.fitViewPadding,this.fitViewDuration=fe.fitViewDuration,this.fitViewByPointsInRect=void 0,this.fitViewByPointIndices=void 0,this.randomSeed=void 0,this.pointSamplingDistance=fe.pointSamplingDistance,this.attribution=fe.attribution,this.rescalePositions=fe.rescalePositions}init(e){Object.keys(e).forEach(t=>{this.deepMergeConfig(this.getConfig(),e,t)})}deepMergeConfig(e,t,n){px(e[n])&&px(t[n])?Object.keys(t[n]).forEach(s=>{this.deepMergeConfig(e[n],t[n],s)}):e[n]=t[n]}getConfig(){return this}}function vy(i,e){if(!i)throw new Error(e||"shadertools: assertion failed.")}const cm={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 yM(i){const e={};for(const[t,n]of Object.entries(i))e[t]=bM(n);return e}function bM(i){let e=mx(i);if(e!=="object")return{value:i,...cm[e],type:e};if(typeof i=="object")return i?i.type!==void 0?{...i,...cm[i.type],type:i.type}:i.value===void 0?{type:"object",value:i}:(e=mx(i.value),{...i,...cm[e],type:e}):{type:"object",value:null};throw new Error("props")}function mx(i){return Array.isArray(i)||ArrayBuffer.isView(i)?"array":typeof i}const vM=`#ifdef MODULE_LOGDEPTH logdepth_adjustPosition(gl_Position); #endif diff --git a/frontend/dist/assets/Mqtt-CkgupwWU.js b/frontend/dist/assets/Mqtt-m3-rjLC-.js similarity index 98% rename from frontend/dist/assets/Mqtt-CkgupwWU.js rename to frontend/dist/assets/Mqtt-m3-rjLC-.js index a00479d4..3eab9702 100644 --- a/frontend/dist/assets/Mqtt-CkgupwWU.js +++ b/frontend/dist/assets/Mqtt-m3-rjLC-.js @@ -1,4 +1,4 @@ -import{e as we,fx as f,fy as ze,r as c,j as e,I as K,B as se,c as y,fd as Ve,fe as We,aE as be,ff as $e,ae as pe,a2 as O,a7 as re,bO as xe,fz as Se,d5 as ye,fA as Le,fB as me,bJ as Ye,fC as Ze,z as Pe,R as oe,f as Me,N as ke,h as Je,fD as D,fE as Xe,fF as qe,fG as Re,fH as _e,fI as Qe,fJ as et,a9 as Ae,fK as tt,fL as st,b_ as at}from"./index-CAHLMlrb.js";import{C as ee,P as nt,a as rt,B as lt}from"./PageLayout-CgrNSpBT.js";import{L as Te,a as fe}from"./listbox-DoXudQ3L.js";import{S as ot}from"./settings-2-DgwT7JNL.js";import{P as le}from"./plus-Be4DsW2a.js";import{M as it}from"./map-pin-CNePTCsc.js";import{C as ct}from"./check-check-CV8IAFCF.js";import{Z as ae}from"./zap-BraNZRWh.js";import{S as Be}from"./search-C1Hut7GR.js";import{C as de}from"./WorkspaceNav-ClxMgBhr.js";import{H as dt}from"./hash-Cs4BXjcy.js";import{u as ut,C as mt}from"./chevron-up-51iePx4b.js";import{F as ht}from"./funnel-CmniI8cB.js";import{a as pt,C as xt}from"./circle-stop-DEeBh2xe.js";import{T as ft}from"./trash-2-ChI2Sf6Z.js";import{M as gt}from"./message-square-B56EP67q.js";import{S as je}from"./satellite-DvRQ8hgk.js";import{R as ue,C as ge}from"./Grid-B0tNiHTX.js";import{W as Nt}from"./wifi-veufKfwm.js";import{W as bt}from"./wifi-off-D3oO89G-.js";import{D as Ne}from"./database-BeT3SO6w.js";import{C as St}from"./clock-DB7tKCHV.js";import{W as De}from"./waves-BgBEByoN.js";import"./use-by-comparator-JYMD8MzS.js";import"./floating-BAAXcOzg.js";import"./element-movement-SAlxPSM7.js";import"./use-text-value-B1ySk7If.js";import"./frozen-TmAR4LIW.js";/** +import{e as we,fx as f,fy as ze,r as c,j as e,I as K,B as se,c as y,fd as Ve,fe as We,aE as be,ff as $e,ae as pe,a2 as O,a7 as re,bO as xe,fz as Se,d5 as ye,fA as Le,fB as me,bJ as Ye,fC as Ze,z as Pe,R as oe,f as Me,N as ke,h as Je,fD as D,fE as Xe,fF as qe,fG as Re,fH as _e,fI as Qe,fJ as et,a9 as Ae,fK as tt,fL as st,b_ as at}from"./index-CdntfUUz.js";import{C as ee,P as nt,a as rt,B as lt}from"./PageLayout-B2kQpvXM.js";import{L as Te,a as fe}from"./listbox-LgRZMHBN.js";import{S as ot}from"./settings-2-iRV0UHU5.js";import{P as le}from"./plus-BHawoJ76.js";import{M as it}from"./map-pin-ADTzwr8W.js";import{C as ct}from"./check-check-D7HV9aAg.js";import{Z as ae}from"./zap-BZEYLUfp.js";import{S as Be}from"./search-D8B8LMYr.js";import{C as de}from"./WorkspaceNav-BZrtCI1_.js";import{H as dt}from"./hash-Ccz7W0IK.js";import{u as ut,C as mt}from"./chevron-up-CFeeYtPO.js";import{F as ht}from"./funnel-0W7-MqFe.js";import{a as pt,C as xt}from"./circle-stop-0gJGQm_q.js";import{T as ft}from"./trash-2-Ym16rcs6.js";import{M as gt}from"./message-square-B7BGKpkr.js";import{S as je}from"./satellite-DwUbYQYY.js";import{R as ue,C as ge}from"./Grid-DYtN9_Hv.js";import{W as Nt}from"./wifi-6W1pAdZl.js";import{W as bt}from"./wifi-off-BkS_iqlS.js";import{D as Ne}from"./database-D8ZiJ_7E.js";import{C as St}from"./clock-DKukpMjT.js";import{W as De}from"./waves-C19BgMIP.js";import"./use-by-comparator-Dgy5yCaL.js";import"./floating-B9JazpOE.js";import"./element-movement-rOMuf_3T.js";import"./use-text-value-DFkKaUWL.js";import"./frozen-C1Yg1x_W.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/MqttModeBadge-OPtXzakb.js b/frontend/dist/assets/MqttModeBadge-2hTXq31i.js similarity index 92% rename from frontend/dist/assets/MqttModeBadge-OPtXzakb.js rename to frontend/dist/assets/MqttModeBadge-2hTXq31i.js index 5d4b54d0..a6e79f31 100644 --- a/frontend/dist/assets/MqttModeBadge-OPtXzakb.js +++ b/frontend/dist/assets/MqttModeBadge-2hTXq31i.js @@ -1 +1 @@ -import{r as d,d5 as m,u as x,j as s,c as i,a2 as g,R as c}from"./index-CAHLMlrb.js";const j=d.memo(function({variant:r="inline",showChannel:l=!0,className:t}){const{active:u,iatas:e}=m(),a=x();if(!u)return null;const n=l&&e.length>0?e.length<=3?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`:null,o=n?`MQTT · ${n}`:"MQTT";return r==="pill"?s.jsx("span",{onClick:()=>a("/configuration/sources"),className:i("cursor-pointer",t),children:s.jsxs(g,{color:"cyan",children:[s.jsx(c,{className:"w-3 h-3 mr-1"}),o]})}):s.jsxs("span",{className:i("inline-flex items-center gap-1 text-sys-cyan type-data-xs cursor-pointer","hover:text-sys-cyan/80 transition-colors",t),onClick:()=>a("/configuration/sources"),title:"MQTT mode active — click to manage",children:[s.jsx(c,{className:"w-3 h-3"}),s.jsx("span",{className:"font-medium",children:o})]})});export{j as M}; +import{r as d,d5 as m,u as x,j as s,c as i,a2 as g,R as c}from"./index-CdntfUUz.js";const j=d.memo(function({variant:r="inline",showChannel:l=!0,className:t}){const{active:u,iatas:e}=m(),a=x();if(!u)return null;const n=l&&e.length>0?e.length<=3?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`:null,o=n?`MQTT · ${n}`:"MQTT";return r==="pill"?s.jsx("span",{onClick:()=>a("/configuration/sources"),className:i("cursor-pointer",t),children:s.jsxs(g,{color:"cyan",children:[s.jsx(c,{className:"w-3 h-3 mr-1"}),o]})}):s.jsxs("span",{className:i("inline-flex items-center gap-1 text-sys-cyan type-data-xs cursor-pointer","hover:text-sys-cyan/80 transition-colors",t),onClick:()=>a("/configuration/sources"),title:"MQTT mode active — click to manage",children:[s.jsx(c,{className:"w-3 h-3"}),s.jsx("span",{className:"font-medium",children:o})]})});export{j as M}; diff --git a/frontend/dist/assets/Observer-CWD4jATj.js b/frontend/dist/assets/Observer-VP_bsWv3.js similarity index 96% rename from frontend/dist/assets/Observer-CWD4jATj.js rename to frontend/dist/assets/Observer-VP_bsWv3.js index 94efda9b..ae6c5291 100644 --- a/frontend/dist/assets/Observer-CWD4jATj.js +++ b/frontend/dist/assets/Observer-VP_bsWv3.js @@ -1,4 +1,4 @@ -import{e as ae,ad as xe,r as i,j as e,B as h,f as R,a2 as x,dD as ne,cb as he,bJ as fe}from"./index-CAHLMlrb.js";import{P as je,a as ye,B as ge,C}from"./PageLayout-CgrNSpBT.js";import{g as we,a as _e,u as ve}from"./maintenance-C2rIkwgy.js";import{r as be}from"./system-CNkSqdfb.js";import{E as se}from"./eye-DQ-O4VIh.js";import{R as M,C as I}from"./Grid-B0tNiHTX.js";import{R as Ne}from"./rotate-cw-D7GjgDF3.js";import{S as Se}from"./save-HCcOmjKD.js";import{P as Ce}from"./plus-Be4DsW2a.js";import{T as Te}from"./trash-2-ChI2Sf6Z.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as ae,ad as xe,r as i,j as e,B as h,f as R,a2 as x,dD as ne,cb as he,bJ as fe}from"./index-CdntfUUz.js";import{P as je,a as ye,B as ge,C}from"./PageLayout-B2kQpvXM.js";import{g as we,a as _e,u as ve}from"./maintenance-DDkOUzHo.js";import{r as be}from"./system-MCOv6vDg.js";import{E as se}from"./eye-Dc2SU7n8.js";import{R as M,C as I}from"./Grid-DYtN9_Hv.js";import{R as Ne}from"./rotate-cw-CKh-yYEC.js";import{S as Se}from"./save-B0-dg8jU.js";import{P as Ce}from"./plus-BHawoJ76.js";import{T as Te}from"./trash-2-Ym16rcs6.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PacketList-ODK5IJ9o.js b/frontend/dist/assets/PacketList-CyBre3jR.js similarity index 98% rename from frontend/dist/assets/PacketList-ODK5IJ9o.js rename to frontend/dist/assets/PacketList-CyBre3jR.js index 087bb543..d05b6b7f 100644 --- a/frontend/dist/assets/PacketList-ODK5IJ9o.js +++ b/frontend/dist/assets/PacketList-CyBre3jR.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-DNpNVjSn.js","assets/index-CAHLMlrb.js","assets/BasemapLayer-VyMOdkaO.js","assets/layer-DnHLn7Jx.js","assets/car-DRknVB1N.js","assets/useMapViewStore-Dq-l5Xvs.js","assets/index-1IIqkHes.js","assets/index-R7zviCWb.js","assets/index-6Dqm8vG_.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); -import{e as He,bP as ys,bQ as Gt,v as js,p as bs,j as e,c as D,B as Oe,w as Ns,r as d,a8 as st,a2 as S,z as Ve,bR as Qt,bS as Wt,bT as vs,bU as ie,bV as ws,at as Re,bW as ks,bX as Cs,bY as _s,bZ as Ss,b_ as Xe,R as fe,b$ as ke,c0 as xt,_ as Ts,c1 as Ps,c2 as Ms,c3 as Bs,c4 as Rs,c5 as Ls,c6 as Hs,m as ue,c7 as de,aa as Ds,a7 as As,c8 as W,c9 as Fs,ca as Es,cb as zs,cc as _t,cd as Is,ce as $s,cf as Os,cg as Us,ch as Vs,ci as Gs,cj as mt,ck as Qs,cl as Ws,ad as Kt,cm as Ks,cn as qs,co as Xs,cp as Ys,aB as qt,aC as Xt,d as it,cq as Zs,cr as Js,aE as ea,cs as ta,ct as bt,cu as sa}from"./index-CAHLMlrb.js";import{C as aa,u as na}from"./chevron-up-51iePx4b.js";import{p as ra,e as Yt,g as la,b as ia}from"./primitives-B7bSO4E3.js";import{u as ca,r as oa,a as da,b as xa,c as ma,d as ua,i as ha}from"./consumer-registry-Bsx-B9R6.js";import{D as Ie,P as $e,g as pa,R as ut}from"./badge-colors-Dl76Mz8m.js";import{e as fa,g as ga,a as ya}from"./chat-utils-rMBLw-SJ.js";import{S as Ye,i as Ze,a as ja,g as St}from"./SignalIndicator-BN0oxyDe.js";import{A as ba}from"./arrow-up-BmXPNI2T.js";import{A as ge}from"./arrow-right-C5Fuejc9.js";import{A as Zt}from"./arrow-down-COuxy1kb.js";import{C as Je,a as Jt}from"./WorkspaceNav-ClxMgBhr.js";import{d as Na}from"./payload-detail-CniY19rz.js";import{M as et}from"./map-pin-CNePTCsc.js";import{C as va}from"./circle-question-mark-BPKfem7i.js";import{L as wa}from"./layers-CU7un-PT.js";import{H as es}from"./hash-Cs4BXjcy.js";import{C as he}from"./clock-DB7tKCHV.js";import{L as Nt,R as ka}from"./route-B8rlrav9.js";import{A as Ca}from"./activity-BAV-4Rxi.js";import{D as _a}from"./database-BeT3SO6w.js";import{H as Sa,D as ht,u as Ta}from"./useMapViewStore-Dq-l5Xvs.js";import{S as Te}from"./shield-CxlpbCLH.js";import{Z as Tt}from"./zap-BraNZRWh.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PathMapMapLibre-7vuAz1d6.js","assets/index-CdntfUUz.js","assets/BasemapLayer-U4r1eipM.js","assets/layer-BRKnZ2f8.js","assets/car-B1uDaAVL.js","assets/useMapViewStore-Ciaw6Y-k.js","assets/index-tm_sy7-t.js","assets/index-Bfbz8_Ci.js","assets/index-6Dqm8vG_.css","assets/BasemapLayer-B1CfjdFi.css"])))=>i.map(i=>d[i]); +import{e as He,bP as ys,bQ as Gt,v as js,p as bs,j as e,c as D,B as Oe,w as Ns,r as d,a8 as st,a2 as S,z as Ve,bR as Qt,bS as Wt,bT as vs,bU as ie,bV as ws,at as Re,bW as ks,bX as Cs,bY as _s,bZ as Ss,b_ as Xe,R as fe,b$ as ke,c0 as xt,_ as Ts,c1 as Ps,c2 as Ms,c3 as Bs,c4 as Rs,c5 as Ls,c6 as Hs,m as ue,c7 as de,aa as Ds,a7 as As,c8 as W,c9 as Fs,ca as Es,cb as zs,cc as _t,cd as Is,ce as $s,cf as Os,cg as Us,ch as Vs,ci as Gs,cj as mt,ck as Qs,cl as Ws,ad as Kt,cm as Ks,cn as qs,co as Xs,cp as Ys,aB as qt,aC as Xt,d as it,cq as Zs,cr as Js,aE as ea,cs as ta,ct as bt,cu as sa}from"./index-CdntfUUz.js";import{C as aa,u as na}from"./chevron-up-CFeeYtPO.js";import{p as ra,e as Yt,g as la,b as ia}from"./primitives-Bl26dfm-.js";import{u as ca,r as oa,a as da,b as xa,c as ma,d as ua,i as ha}from"./consumer-registry-K46Bg-WH.js";import{D as Ie,P as $e,g as pa,R as ut}from"./badge-colors-Dl76Mz8m.js";import{e as fa,g as ga,a as ya}from"./chat-utils-D8ZwjCT3.js";import{S as Ye,i as Ze,a as ja,g as St}from"./SignalIndicator-CKCIivNj.js";import{A as ba}from"./arrow-up-C1m6otp9.js";import{A as ge}from"./arrow-right-DDhVPQqL.js";import{A as Zt}from"./arrow-down-npn6XFzD.js";import{C as Je,a as Jt}from"./WorkspaceNav-BZrtCI1_.js";import{d as Na}from"./payload-detail-D7dyXv-d.js";import{M as et}from"./map-pin-ADTzwr8W.js";import{C as va}from"./circle-question-mark-EfmCIEVS.js";import{L as wa}from"./layers-80mLD98M.js";import{H as es}from"./hash-Ccz7W0IK.js";import{C as he}from"./clock-DKukpMjT.js";import{L as Nt,R as ka}from"./route-CeOQcqdX.js";import{A as Ca}from"./activity-02b04F6Q.js";import{D as _a}from"./database-D8ZiJ_7E.js";import{H as Sa,D as ht,u as Ta}from"./useMapViewStore-Ciaw6Y-k.js";import{S as Te}from"./shield-CNxoSMJk.js";import{Z as Tt}from"./zap-BZEYLUfp.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -29,7 +29,7 @@ import{e as He,bP as ys,bQ as Gt,v as js,p as bs,j as e,c as D,B as Oe,w as Ns,r * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fa=[["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"}]],Pe=He("user",Fa);function Ea(t){t.values.forEach(s=>s.stop())}function pt(t,s){[...s].reverse().forEach(n=>{const r=t.getVariant(n);r&&Gt(t,r),t.variantChildren&&t.variantChildren.forEach(i=>{pt(i,s)})})}function za(t,s){if(Array.isArray(s))return pt(t,s);if(typeof s=="string")return pt(t,[s]);Gt(t,s)}function Ia(){const t=new Set,s={subscribe(a){return t.add(a),()=>void t.delete(a)},start(a,n){const r=[];return t.forEach(i=>{r.push(ys(i,a,{transitionOverride:n}))}),Promise.all(r)},set(a){return t.forEach(n=>{za(n,a)})},stop(){t.forEach(a=>{Ea(a)})},mount(){return()=>{s.stop()}}};return s}function $a(){const t=js(Ia);return bs(t.mount,[]),t}function Oa({"aria-label":t="Page navigation",className:s,...a}){return e.jsx("nav",{"aria-label":t,...a,className:D("flex gap-x-2",s)})}function Ua({onClick:t,disabled:s=!1,className:a,children:n="Previous"}){return e.jsx("span",{className:D("grow basis-0",a),children:e.jsxs(Oe,{plain:!0,onClick:t,disabled:s,"aria-label":"Previous page",className:D("gap-1",s&&"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 Va({onClick:t,disabled:s=!1,className:a,children:n="Next"}){return e.jsx("span",{className:D("flex grow basis-0 justify-end",a),children:e.jsxs(Oe,{plain:!0,onClick:t,disabled:s,"aria-label":"Next page",className:D("gap-1",s&&"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 Ga({className:t,...s}){return e.jsx("span",{...s,className:D("hidden items-baseline gap-x-2 sm:flex",t)})}function Qa({page:t,current:s=!1,onClick:a,className:n,children:r}){return e.jsx(Oe,{plain:!s,outline:s,onClick:()=>a==null?void 0:a(t),"aria-label":`Page ${t}`,"aria-current":s?"page":void 0,className:D("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",s&&"before:bg-subtle-fill",n),children:r??t})}function Wa({className:t,...s}){return e.jsx("span",{"aria-hidden":"true",...s,className:D("w-[2.25rem] select-none text-center text-sm text-fg-muted",t),children:"…"})}function Ka(t,s,a=1){if(s<=7)return Array.from({length:s},(h,g)=>g+1);const n=Math.max(t-a,1),r=Math.min(t+a,s),i=n>2,l=rv+1),"gap",s]}if(i&&!l){const h=3+2*a;return[1,"gap",...Array.from({length:h},(f,v)=>s-h+v+1)]}return[1,"gap",...Array.from({length:r-n+1},(h,g)=>n+g),"gap",s]}const Jr=Ns(t=>({requestedHash:null,requestChannel:s=>t({requestedHash:s}),clearRequest:()=>t({requestedHash:null})}));function qa(t){if(t.length===0)return[];const s=[];let a=0;for(;a0?ws(n[0]):null;return Re(r,i??l??a)}function nn(t,s,a){if(s==="GRP_TXT"&&a){const n=a(t);if(n!=null&&n.decrypted)return{text:n.text,sender:n.senderName,channel:n.channelName,channelHash:n.channelHash,corrupted:n.corrupted}}if(s==="TXT_MSG"&&t.raw_packet)try{const n=ks.fromHex(t.raw_packet);if(n.success&&n.packet){const r=Cs(n.packet.payload);if(r&&!r.encrypted)return{text:r.text,sender:null,channel:null,channelHash:null,corrupted:!1}}}catch{}return{text:null,sender:null,channel:null,channelHash:null,corrupted:!1}}function rn(t,s,a){if(s.text)return s.text;if(s.corrupted)return"Message content unavailable";if(a)return"Local transmission";switch(t){case"REQ":return"Encrypted request";case"RESPONSE":return"Request response";case"TXT_MSG":return"Direct text message";case"ACK":return"Acknowledgement";case"ADVERT":return"Node advertisement";case"GRP_TXT":return s.channel?"Encrypted channel message":"Group text message";case"GRP_DATA":return s.channel?"Decoded group data":"Group datagram";case"ANON_REQ":return"Anonymous discovery request";case"PATH":return"Returned path";case"TRACE":return"Trace probe";case"MULTIPART":return"Multipart payload";case"CONTROL":return"Control packet";case"RAW_CUSTOM":return"Custom wire payload";default:return"Packet payload"}}function ln(t){return t==null||!Number.isFinite(t)?"—":Math.max(0,Date.now()/1e3-t)<5?"now":Ss(t)}function cn(t,s,a){if(a)return{compact:"Local",full:"Local transmission",mobile:"Local"};if(t.length===0)return{compact:"—",full:"No path recorded",mobile:"—"};const n=s?Re(s):null,r=t.map(g=>{const f=g.toUpperCase();return n&&_s(f,n)?"You":f}),i=r.join(" › "),l=r[r.length-1];if(r.length<=3)return{compact:i,full:i,mobile:r.length>1?`→ ${l}`:l};const c=r.indexOf("You");let h;return c===r.length-1?h=`${r[0]} › +${r.length-2} › You`:c>0?h=`${r[0]} › … › You › ${l}`:h=`${r[0]} › +${r.length-2} › ${l}`,{compact:h,full:i,mobile:`→ ${l}`}}function on({packet:t}){return t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ft("teal"),children:"HTTP"}):t._mqttSource&&!t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ft("purple"),children:"MQTT"}):null}function dn({packet:t,sourceName:s,chatAvatarName:a,isRepeater:n,showUnknownMessage:r}){if(a){const i=fa(a);return e.jsx("span",{className:"clay-avatar size-8",style:{"--avatar-color":ga(i.cleanName)},"aria-hidden":"true",children:i.emoji?e.jsx("span",{className:"text-base leading-none",children:i.emoji}):e.jsx("span",{className:"text-[10px] font-bold tracking-tighter text-white",children:ya(a)})})}return n&&s!=="Unknown source"?e.jsx("span",{className:"flex size-8 flex-shrink-0 items-center justify-center rounded-full ring-[1.5px] ring-sys-blue","aria-hidden":"true",children:e.jsx(fe,{className:"size-5 text-sys-blue"})}):r?e.jsx("span",{className:"flex size-8 flex-shrink-0 items-center justify-center rounded-full bg-zinc-500/20 ring-1 ring-edge-subtle","aria-hidden":"true",children:e.jsx(Ra,{className:"size-4 text-fg-muted"})}):e.jsx(en,{packet:t,variant:"avatar",size:"sm"})}function Lt({packet:t,sourceName:s,sourcePrefix:a,chatAvatarName:n,isRepeater:r,showUnknownMessage:i}){const l=a&&a!==s?a:null,c=s==="Unknown source";return e.jsxs("div",{className:D("flex min-w-0 items-center gap-1.5",c&&"opacity-65"),children:[e.jsx(dn,{packet:t,sourceName:s,chatAvatarName:n,isRepeater:r,showUnknownMessage:i}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-[13px] font-medium text-fg-primary",children:s}),l&&e.jsx("span",{className:"type-data-xs block truncate text-fg-muted",children:l})]})]})}function Ht({packet:t,payloadType:s,payloadColor:a,summary:n,decoded:r,isLocalTx:i,dupeCount:l,onChannelClick:c}){return e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ft(a),children:s}),r.channel&&e.jsx(tn,{channelName:r.channel,compact:!0,onClick:c&&r.channelHash?h=>{h.stopPropagation(),c(r.channelHash)}:void 0}),i&&e.jsx("span",{className:"type-data-xs flex-shrink-0 text-fg-muted",children:"LOCAL"}),e.jsx(on,{packet:t}),l&&l>1&&e.jsxs("span",{className:"type-data-xs flex flex-shrink-0 items-center gap-0.5 text-fg-muted",title:`${l} duplicate receptions collapsed`,children:[e.jsx(st,{className:"size-3","aria-hidden":"true"}),"×",l]}),r.corrupted&&e.jsxs("span",{className:"type-data-xs flex flex-shrink-0 items-center gap-0.5 text-sys-amber",title:"The message identity decoded, but payload integrity could not be verified",children:[e.jsx(Xe,{className:"size-3","aria-hidden":"true"}),"CORRUPT"]}),e.jsx("span",{className:D("min-w-0 truncate text-[12px] text-fg-secondary",r.text&&"italic"),children:n})]})}function xn({routeType:t,path:s}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-data-xs block truncate text-fg-muted",children:t}),e.jsx("span",{className:"type-data-xs block truncate text-fg-secondary",title:s.full,children:s.compact})]})}function mn({packet:t,isLocalTx:s,payloadSize:a}){return s?e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-data-xs block font-medium text-fg-secondary",children:"TX"}),e.jsxs("span",{className:"type-data-xs block truncate text-fg-muted",children:[a,"B"]})]}):e.jsxs("div",{className:"min-w-0",children:[e.jsx(Ye,{rssi:t.rssi,snr:t.snr,compact:!0,showValues:!0,validated:Ze(t)}),e.jsxs("span",{className:"type-data-xs block truncate text-fg-muted",children:[t.snr!=null?`${t.snr.toFixed(0)}dB · `:"",a,"B"]})]})}function un(t,s,a){if(!s)return;const n={backgroundColor:t,opacity:a?1:.42,width:a?3:2,left:0};return s==="first"?{...n,top:6,bottom:0,borderRadius:"9999px 9999px 0 0"}:s==="middle"?{...n,top:0,bottom:0}:s==="last"?{...n,top:0,bottom:6,borderRadius:"0 0 9999px 9999px"}:{...n,top:6,bottom:6,borderRadius:9999}}function ss({mobile:t,packet:s,onClick:a,localHash:n,pathHashSize:r=1,resolveSource:i,isFlashing:l=!1,isTraceHighlighted:c,onTraceHover:h,traceTag:g,onViewTraceReport:f,dupeGroupPosition:v,isDupeGroupHovered:N=!1,onDupeGroupHover:b,dupeCount:k,getDecodedContent:m,onChannelClick:L}){const C=Ve(),o=s.payload_type_name||Qt(s.payload_type??s.type),x=s.route_type_name||Wt(s.route_type??s.route),w=$e[o]??"zinc",M=s.packet_origin==="tx_local",u=o==="TRACE",P=k?!1:vs(s.is_duplicate),G=Rt(s.original_path),$=Rt(s.forwarded_path),X=$.length>0?$:G,{name:Y,hash:J,isRepeater:re}=sn(s,i),E=an(s,J,r,X),K=nn(s,o,m),U=K.sender||(re?null:Y),ee=U||Y||E||"Unknown source",V=!U&&!re&&o==="GRP_TXT"&&!K.text,te=rn(o,K,M),Q=cn(X,n,M),le=s.payload_length??s.length??0,q=ln(s.timestamp),T=s.timestamp!=null?ie(s.timestamp,C):"Time unavailable",y=ke[w]||ke.zinc,ce=d.useCallback(()=>{u&&g&&f?f(g):a(s)},[u,g,f,a,s]),B=d.useCallback(()=>{u&&g&&h&&h(g),v&&b&&s.packet_hash&&b(s.packet_hash)},[u,g,h,v,b,s.packet_hash]),ne=d.useCallback(()=>{h&&h(null),b&&b(null)},[h,b]),Z=D("group relative cursor-pointer","hover:bg-subtle-fill",P&&!N&&"opacity-40",l&&"flash-row",M&&"bg-sys-indigo/5",c&&"bg-sys-teal/10");return e.jsxs("div",{"data-packet-row":!0,onClick:ce,onMouseEnter:B,onMouseLeave:ne,className:Z,children:[v&&e.jsx("span",{className:"absolute transition-all",style:un(y,v,N),"aria-hidden":"true"}),t?e.jsxs("div",{className:"px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(Lt,{packet:s,sourceName:ee,sourcePrefix:E,chatAvatarName:U,isRepeater:re,showUnknownMessage:V})}),e.jsx("span",{className:"type-data-xs flex-shrink-0 text-fg-muted",title:T,children:q}),M?e.jsx("span",{className:"type-data-xs flex-shrink-0 font-medium text-fg-secondary",children:"TX"}):e.jsx(Ye,{rssi:s.rssi,snr:s.snr,compact:!0,showValues:!0,validated:Ze(s)}),e.jsx(Oe,{plain:!0,className:"!min-w-0 !p-1.5","aria-label":`Inspect packet from ${ee}`,onClick:O=>{O.stopPropagation(),ce()},children:e.jsx(Je,{"data-slot":"icon"})})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 pl-9",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(Ht,{packet:s,payloadType:o,payloadColor:w,summary:te,decoded:K,isLocalTx:M,dupeCount:k,onChannelClick:L})}),e.jsx("span",{className:"type-data-xs flex-shrink-0 text-fg-muted",title:Q.full,children:Q.mobile})]})]}):e.jsxs("div",{className:D(ts,"px-3 py-2.5"),children:[e.jsx(Lt,{packet:s,sourceName:ee,sourcePrefix:E,chatAvatarName:U,isRepeater:re,showUnknownMessage:V}),e.jsx(Ht,{packet:s,payloadType:o,payloadColor:w,summary:te,decoded:K,isLocalTx:M,dupeCount:k,onChannelClick:L}),e.jsx(xn,{routeType:x,path:Q}),e.jsx(mn,{packet:s,isLocalTx:M,payloadSize:le}),e.jsx("span",{className:"type-data-xs text-right text-fg-muted",title:T,children:q}),e.jsx(Oe,{plain:!0,className:"!min-w-0 !p-1.5","aria-label":`Inspect packet from ${ee}`,onClick:O=>{O.stopPropagation(),ce()},children:e.jsx(Je,{"data-slot":"icon"})})]})]})}function hn(t){return e.jsx(ss,{...t,mobile:!1})}function pn(t){return e.jsx(ss,{...t,mobile:!0})}const fn=d.memo(hn),gn=d.memo(pn);function yn(t,s,a,n,r=!1){const i=t.toUpperCase(),l=[],c=a&&xt(i,a);c&&l.push(a);for(const b of Object.keys(s))xt(i,b)&&l.push(b);if(r&&c&&a&&l.length===1)return{matches:l,probability:1,bestMatch:a};if(r&&c&&l.length>1){const b=l.filter(k=>k!==a);if(b.length===1)return{matches:l,probability:1,bestMatch:b[0]}}const h=l.length>0?1/l.length:0,g=[...l].sort();let f=null,v=-1;if(g.length===1)f=g[0];else if(g.length>1&&n){for(const b of g){const k=n.get(b),m=k?typeof k=="number"?k:k.combinedScore:0;m>v&&(v=m,f=b)}f||(f=g[0])}else g.length>0&&(f=g[0]);let N=h;if(l.length>1&&n&&v>0){let b=0;for(const k of l){const m=n.get(k);b+=m?typeof m=="number"?m:m.combinedScore:0}b>0&&(N=Math.min(.95,v/b))}return{matches:l,probability:N,bestMatch:f}}function jn(t,s,a,n){const i=(a-t)*Math.PI/180,l=(n-s)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t*Math.PI/180)*Math.cos(a*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}function bn(t){return t<100?1:t<500?.9:t<1e3?.7:t<5e3?.5:t<1e4?.3:.1}const Nn=d.lazy(()=>Ts(()=>import("./PathMapMapLibre-DNpNVjSn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])));function vn(t,s,a,n,r=!1,i,l,c){const h=Ps(s);let g;l&&(g=Ms(l,t,{position:c,isLastHop:r}).confidence);const{matches:f,probability:v}=yn(t,h,n,i,r),N=f.length,b=[],k=t.toUpperCase(),m=a&&a.latitude!==void 0&&a.longitude!==void 0&&(a.latitude!==0||a.longitude!==0);for(const C of f){if(n&&xt(k,n)&&C===n&&m&&a){b.push({hash:C,name:a.name||"Local Node",latitude:a.latitude,longitude:a.longitude,probability:r?1:v,isLocal:!0});continue}const o=h[C];o!=null&&o.latitude&&(o!=null&&o.longitude)&&!(o.latitude===0&&o.longitude===0)&&b.push({hash:C,name:o.node_name||o.name||"Unknown",latitude:o.latitude,longitude:o.longitude,probability:v,isLocal:!1,isDirectNeighbor:o.zero_hop===!0})}const L=b.length;if(L===1)b[0].probability=g??1;else if(L>1)if(g!==void 0&&g>0){const C=b[0];C.probability=g;const o=1-g,x=L-1;b.slice(1).forEach(w=>{w.probability=o/x})}else{let C=0;const o=b.map(x=>{if(x.isLocal)return{candidate:x,score:1};const w=i==null?void 0:i.get(x.hash);let M=.5;if(m&&a){const P=jn(a.latitude,a.longitude,x.latitude,x.longitude);M=bn(P)}let u;return w?u=M*.3+w.hopConsistencyScore*.3+w.frequencyScore*.4:(u=M,x.isDirectNeighbor&&(u=Math.max(u,.8))),C+=u,{candidate:x,score:u}});if(C>0)o.forEach(({candidate:x,score:w})=>{x.probability=Math.min(.95,w/C)});else{const x=1/L;b.forEach(w=>w.probability=x)}}return{candidates:b,totalMatches:N}}function wn(t,s,a,n,r,i){if(!t||t.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const l=t.length-1,c=t.map((f,v)=>{const N=v===l,b=t.length-v,{candidates:k,totalMatches:m}=vn(f,s,a,n,N,r,i,b),L=k.length>0?Math.max(...k.map(C=>C.probability)):0;return{prefix:f,candidates:k,confidence:L,totalMatches:m}}),h=c.reduce((f,v)=>v.confidence===0?0:f*v.confidence,1),g=c.some(f=>f.candidates.length>0);return{hops:c,overallConfidence:h,hasValidPath:g}}function kn(t){return`${(t*100).toFixed(0)}%`}function Cn(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 _n(t,s,a){let n;return s===0?n=a.muted:t>=1?n=a.success:t>=.5?n=a.secondary:t>=.25?n=a.poor:t>0?n=a.danger:n=a.muted,{color:n}}class Sn extends d.Component{constructor(s){super(s),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(Xe,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function tt({path:t,neighbors:s,localNode:a,localHash:n,srcHash:r,dstHash:i,neighborAffinity:l,prefixLookup:c,hubNodes:h,traceSnr:g,advertiserSource:f}){const[v,N]=d.useState(null),b=d.useMemo(()=>{if(!f)return null;const x=f.nodeType==="wardrive";return{prefix:f.prefix||"??",candidates:[{hash:f.publicKey||f.prefix||"source",name:f.name,latitude:f.latitude,longitude:f.longitude,probability:1,isLocal:!1,isWardrive:x}],confidence:1,totalMatches:1,isSource:!0}},[f]),k=d.useMemo(()=>{if(f||!r)return null;const x=Re(r),w=s[r];if((w==null?void 0:w.latitude)&&(w==null?void 0:w.longitude)&&!(w.latitude===0&&w.longitude===0))return{prefix:x,candidates:[{hash:r,name:w.node_name||w.name||"Source",latitude:w.latitude,longitude:w.longitude,probability:1,isLocal:!1,isDirectNeighbor:w.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const u=(w==null?void 0:w.node_name)||(w==null?void 0:w.name)||r.slice(0,8);return{prefix:x,candidates:[{hash:r,name:u,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[f,r,s]),m=d.useMemo(()=>{const x=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!x||x==="00"||x==="0000000000000000")&&a&&n){const $=Re(n),X=a.latitude!==0||a.longitude!==0;return{prefix:$,candidates:[{hash:n,name:a.name||"Local Node",latitude:X?a.latitude:0,longitude:X?a.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const M=Re(i);if(n&&i===n&&a){const $=a.latitude!==0||a.longitude!==0;return{prefix:M,candidates:[{hash:i,name:a.name||"Local Node",latitude:$?a.latitude:0,longitude:$?a.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const u=s[i];if((u==null?void 0:u.latitude)&&(u==null?void 0:u.longitude)&&!(u.latitude===0&&u.longitude===0))return{prefix:M,candidates:[{hash:i,name:u.node_name||u.name||"Destination",latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isDirectNeighbor:u.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const G=(u==null?void 0:u.node_name)||(u==null?void 0:u.name)||i.slice(0,8);return{prefix:M,candidates:[{hash:i,name:G,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,s,a,n]),L=d.useMemo(()=>wn(t,s,a,n,l,c),[t,s,a,n,l,c]),C=d.useMemo(()=>{const x=[];b?x.push(b):k&&x.push(k),x.push(...L.hops),m&&x.push(m);const w=x.reduce((u,P)=>P.confidence===0?0:u*P.confidence,1),M=x.some(u=>u.candidates.some(P=>P.latitude!==0||P.longitude!==0));return{hops:x,overallConfidence:w,hasValidPath:M}},[b,k,L,m]),o=d.useMemo(()=>{const x=getComputedStyle(document.documentElement);return{success:x.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:x.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:x.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:x.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:x.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return C.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:Cn(C.overallConfidence),children:kn(C.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(va,{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(Sn,{children:e.jsx(d.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(Nn,{resolvedPath:C,localNode:a,hubNodes:h,hoveredHopIndex:v,onHoverHop:N,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:C.hops.map((x,w)=>{var $,X,Y;const M=x.isSource===!0,u=x.isDestination===!0,P=v===w;let G;return M?G=`Source: ${(($=x.candidates[0])==null?void 0:$.name)||"Unknown"}`:u?G=`Destination: ${((X=x.candidates[0])==null?void 0:X.name)||"Unknown"}`:x.totalMatches===0?G="No matching nodes found":x.totalMatches===1?G=`Exact match: ${((Y=x.candidates[0])==null?void 0:Y.name)||"Unknown"}`:G=`${x.totalMatches} possible matches (${(x.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:D("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",P?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",M&&"border border-sys-green/30",u&&"border border-sys-blue/30"),title:G,onMouseEnter:()=>N(w),onMouseLeave:()=>N(null),children:[M&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),u&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:_n(x.confidence,x.totalMatches,o),children:x.prefix}),!M&&!u&&x.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",x.totalMatches]}),!M&&!u&&x.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},w)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(et,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const ct=16;function at(t){return t.match(/.{1,2}/g)||[]}function we(t){return t!==null&&t.startsWith("payload:")}const Le={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` + */const Fa=[["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"}]],Pe=He("user",Fa);function Ea(t){t.values.forEach(s=>s.stop())}function pt(t,s){[...s].reverse().forEach(n=>{const r=t.getVariant(n);r&&Gt(t,r),t.variantChildren&&t.variantChildren.forEach(i=>{pt(i,s)})})}function za(t,s){if(Array.isArray(s))return pt(t,s);if(typeof s=="string")return pt(t,[s]);Gt(t,s)}function Ia(){const t=new Set,s={subscribe(a){return t.add(a),()=>void t.delete(a)},start(a,n){const r=[];return t.forEach(i=>{r.push(ys(i,a,{transitionOverride:n}))}),Promise.all(r)},set(a){return t.forEach(n=>{za(n,a)})},stop(){t.forEach(a=>{Ea(a)})},mount(){return()=>{s.stop()}}};return s}function $a(){const t=js(Ia);return bs(t.mount,[]),t}function Oa({"aria-label":t="Page navigation",className:s,...a}){return e.jsx("nav",{"aria-label":t,...a,className:D("flex gap-x-2",s)})}function Ua({onClick:t,disabled:s=!1,className:a,children:n="Previous"}){return e.jsx("span",{className:D("grow basis-0",a),children:e.jsxs(Oe,{plain:!0,onClick:t,disabled:s,"aria-label":"Previous page",className:D("gap-1",s&&"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 Va({onClick:t,disabled:s=!1,className:a,children:n="Next"}){return e.jsx("span",{className:D("flex grow basis-0 justify-end",a),children:e.jsxs(Oe,{plain:!0,onClick:t,disabled:s,"aria-label":"Next page",className:D("gap-1",s&&"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 Ga({className:t,...s}){return e.jsx("span",{...s,className:D("hidden items-baseline gap-x-2 sm:flex",t)})}function Qa({page:t,current:s=!1,onClick:a,className:n,children:r}){return e.jsx(Oe,{plain:!s,outline:s,onClick:()=>a==null?void 0:a(t),"aria-label":`Page ${t}`,"aria-current":s?"page":void 0,className:D("min-w-[2.25rem] before:absolute before:-inset-px before:rounded-lg",s&&"before:bg-subtle-fill",n),children:r??t})}function Wa({className:t,...s}){return e.jsx("span",{"aria-hidden":"true",...s,className:D("w-[2.25rem] select-none text-center text-sm text-fg-muted",t),children:"…"})}function Ka(t,s,a=1){if(s<=7)return Array.from({length:s},(h,g)=>g+1);const n=Math.max(t-a,1),r=Math.min(t+a,s),i=n>2,l=rv+1),"gap",s]}if(i&&!l){const h=3+2*a;return[1,"gap",...Array.from({length:h},(f,v)=>s-h+v+1)]}return[1,"gap",...Array.from({length:r-n+1},(h,g)=>n+g),"gap",s]}const Jr=Ns(t=>({requestedHash:null,requestChannel:s=>t({requestedHash:s}),clearRequest:()=>t({requestedHash:null})}));function qa(t){if(t.length===0)return[];const s=[];let a=0;for(;a0?ws(n[0]):null;return Re(r,i??l??a)}function nn(t,s,a){if(s==="GRP_TXT"&&a){const n=a(t);if(n!=null&&n.decrypted)return{text:n.text,sender:n.senderName,channel:n.channelName,channelHash:n.channelHash,corrupted:n.corrupted}}if(s==="TXT_MSG"&&t.raw_packet)try{const n=ks.fromHex(t.raw_packet);if(n.success&&n.packet){const r=Cs(n.packet.payload);if(r&&!r.encrypted)return{text:r.text,sender:null,channel:null,channelHash:null,corrupted:!1}}}catch{}return{text:null,sender:null,channel:null,channelHash:null,corrupted:!1}}function rn(t,s,a){if(s.text)return s.text;if(s.corrupted)return"Message content unavailable";if(a)return"Local transmission";switch(t){case"REQ":return"Encrypted request";case"RESPONSE":return"Request response";case"TXT_MSG":return"Direct text message";case"ACK":return"Acknowledgement";case"ADVERT":return"Node advertisement";case"GRP_TXT":return s.channel?"Encrypted channel message":"Group text message";case"GRP_DATA":return s.channel?"Decoded group data":"Group datagram";case"ANON_REQ":return"Anonymous discovery request";case"PATH":return"Returned path";case"TRACE":return"Trace probe";case"MULTIPART":return"Multipart payload";case"CONTROL":return"Control packet";case"RAW_CUSTOM":return"Custom wire payload";default:return"Packet payload"}}function ln(t){return t==null||!Number.isFinite(t)?"—":Math.max(0,Date.now()/1e3-t)<5?"now":Ss(t)}function cn(t,s,a){if(a)return{compact:"Local",full:"Local transmission",mobile:"Local"};if(t.length===0)return{compact:"—",full:"No path recorded",mobile:"—"};const n=s?Re(s):null,r=t.map(g=>{const f=g.toUpperCase();return n&&_s(f,n)?"You":f}),i=r.join(" › "),l=r[r.length-1];if(r.length<=3)return{compact:i,full:i,mobile:r.length>1?`→ ${l}`:l};const c=r.indexOf("You");let h;return c===r.length-1?h=`${r[0]} › +${r.length-2} › You`:c>0?h=`${r[0]} › … › You › ${l}`:h=`${r[0]} › +${r.length-2} › ${l}`,{compact:h,full:i,mobile:`→ ${l}`}}function on({packet:t}){return t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ft("teal"),children:"HTTP"}):t._mqttSource&&!t._remoteSource?e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ft("purple"),children:"MQTT"}):null}function dn({packet:t,sourceName:s,chatAvatarName:a,isRepeater:n,showUnknownMessage:r}){if(a){const i=fa(a);return e.jsx("span",{className:"clay-avatar size-8",style:{"--avatar-color":ga(i.cleanName)},"aria-hidden":"true",children:i.emoji?e.jsx("span",{className:"text-base leading-none",children:i.emoji}):e.jsx("span",{className:"text-[10px] font-bold tracking-tighter text-white",children:ya(a)})})}return n&&s!=="Unknown source"?e.jsx("span",{className:"flex size-8 flex-shrink-0 items-center justify-center rounded-full ring-[1.5px] ring-sys-blue","aria-hidden":"true",children:e.jsx(fe,{className:"size-5 text-sys-blue"})}):r?e.jsx("span",{className:"flex size-8 flex-shrink-0 items-center justify-center rounded-full bg-zinc-500/20 ring-1 ring-edge-subtle","aria-hidden":"true",children:e.jsx(Ra,{className:"size-4 text-fg-muted"})}):e.jsx(en,{packet:t,variant:"avatar",size:"sm"})}function Lt({packet:t,sourceName:s,sourcePrefix:a,chatAvatarName:n,isRepeater:r,showUnknownMessage:i}){const l=a&&a!==s?a:null,c=s==="Unknown source";return e.jsxs("div",{className:D("flex min-w-0 items-center gap-1.5",c&&"opacity-65"),children:[e.jsx(dn,{packet:t,sourceName:s,chatAvatarName:n,isRepeater:r,showUnknownMessage:i}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-[13px] font-medium text-fg-primary",children:s}),l&&e.jsx("span",{className:"type-data-xs block truncate text-fg-muted",children:l})]})]})}function Ht({packet:t,payloadType:s,payloadColor:a,summary:n,decoded:r,isLocalTx:i,dupeCount:l,onChannelClick:c}){return e.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[e.jsx("span",{className:"data-box data-box-compact data-box-outlined flex-shrink-0",style:ft(a),children:s}),r.channel&&e.jsx(tn,{channelName:r.channel,compact:!0,onClick:c&&r.channelHash?h=>{h.stopPropagation(),c(r.channelHash)}:void 0}),i&&e.jsx("span",{className:"type-data-xs flex-shrink-0 text-fg-muted",children:"LOCAL"}),e.jsx(on,{packet:t}),l&&l>1&&e.jsxs("span",{className:"type-data-xs flex flex-shrink-0 items-center gap-0.5 text-fg-muted",title:`${l} duplicate receptions collapsed`,children:[e.jsx(st,{className:"size-3","aria-hidden":"true"}),"×",l]}),r.corrupted&&e.jsxs("span",{className:"type-data-xs flex flex-shrink-0 items-center gap-0.5 text-sys-amber",title:"The message identity decoded, but payload integrity could not be verified",children:[e.jsx(Xe,{className:"size-3","aria-hidden":"true"}),"CORRUPT"]}),e.jsx("span",{className:D("min-w-0 truncate text-[12px] text-fg-secondary",r.text&&"italic"),children:n})]})}function xn({routeType:t,path:s}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-data-xs block truncate text-fg-muted",children:t}),e.jsx("span",{className:"type-data-xs block truncate text-fg-secondary",title:s.full,children:s.compact})]})}function mn({packet:t,isLocalTx:s,payloadSize:a}){return s?e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"type-data-xs block font-medium text-fg-secondary",children:"TX"}),e.jsxs("span",{className:"type-data-xs block truncate text-fg-muted",children:[a,"B"]})]}):e.jsxs("div",{className:"min-w-0",children:[e.jsx(Ye,{rssi:t.rssi,snr:t.snr,compact:!0,showValues:!0,validated:Ze(t)}),e.jsxs("span",{className:"type-data-xs block truncate text-fg-muted",children:[t.snr!=null?`${t.snr.toFixed(0)}dB · `:"",a,"B"]})]})}function un(t,s,a){if(!s)return;const n={backgroundColor:t,opacity:a?1:.42,width:a?3:2,left:0};return s==="first"?{...n,top:6,bottom:0,borderRadius:"9999px 9999px 0 0"}:s==="middle"?{...n,top:0,bottom:0}:s==="last"?{...n,top:0,bottom:6,borderRadius:"0 0 9999px 9999px"}:{...n,top:6,bottom:6,borderRadius:9999}}function ss({mobile:t,packet:s,onClick:a,localHash:n,pathHashSize:r=1,resolveSource:i,isFlashing:l=!1,isTraceHighlighted:c,onTraceHover:h,traceTag:g,onViewTraceReport:f,dupeGroupPosition:v,isDupeGroupHovered:N=!1,onDupeGroupHover:b,dupeCount:k,getDecodedContent:m,onChannelClick:L}){const C=Ve(),o=s.payload_type_name||Qt(s.payload_type??s.type),x=s.route_type_name||Wt(s.route_type??s.route),w=$e[o]??"zinc",M=s.packet_origin==="tx_local",u=o==="TRACE",P=k?!1:vs(s.is_duplicate),G=Rt(s.original_path),$=Rt(s.forwarded_path),X=$.length>0?$:G,{name:Y,hash:J,isRepeater:re}=sn(s,i),E=an(s,J,r,X),K=nn(s,o,m),U=K.sender||(re?null:Y),ee=U||Y||E||"Unknown source",V=!U&&!re&&o==="GRP_TXT"&&!K.text,te=rn(o,K,M),Q=cn(X,n,M),le=s.payload_length??s.length??0,q=ln(s.timestamp),T=s.timestamp!=null?ie(s.timestamp,C):"Time unavailable",y=ke[w]||ke.zinc,ce=d.useCallback(()=>{u&&g&&f?f(g):a(s)},[u,g,f,a,s]),B=d.useCallback(()=>{u&&g&&h&&h(g),v&&b&&s.packet_hash&&b(s.packet_hash)},[u,g,h,v,b,s.packet_hash]),ne=d.useCallback(()=>{h&&h(null),b&&b(null)},[h,b]),Z=D("group relative cursor-pointer","hover:bg-subtle-fill",P&&!N&&"opacity-40",l&&"flash-row",M&&"bg-sys-indigo/5",c&&"bg-sys-teal/10");return e.jsxs("div",{"data-packet-row":!0,onClick:ce,onMouseEnter:B,onMouseLeave:ne,className:Z,children:[v&&e.jsx("span",{className:"absolute transition-all",style:un(y,v,N),"aria-hidden":"true"}),t?e.jsxs("div",{className:"px-3 py-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(Lt,{packet:s,sourceName:ee,sourcePrefix:E,chatAvatarName:U,isRepeater:re,showUnknownMessage:V})}),e.jsx("span",{className:"type-data-xs flex-shrink-0 text-fg-muted",title:T,children:q}),M?e.jsx("span",{className:"type-data-xs flex-shrink-0 font-medium text-fg-secondary",children:"TX"}):e.jsx(Ye,{rssi:s.rssi,snr:s.snr,compact:!0,showValues:!0,validated:Ze(s)}),e.jsx(Oe,{plain:!0,className:"!min-w-0 !p-1.5","aria-label":`Inspect packet from ${ee}`,onClick:O=>{O.stopPropagation(),ce()},children:e.jsx(Je,{"data-slot":"icon"})})]}),e.jsxs("div",{className:"mt-1 flex min-w-0 items-center gap-2 pl-9",children:[e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(Ht,{packet:s,payloadType:o,payloadColor:w,summary:te,decoded:K,isLocalTx:M,dupeCount:k,onChannelClick:L})}),e.jsx("span",{className:"type-data-xs flex-shrink-0 text-fg-muted",title:Q.full,children:Q.mobile})]})]}):e.jsxs("div",{className:D(ts,"px-3 py-2.5"),children:[e.jsx(Lt,{packet:s,sourceName:ee,sourcePrefix:E,chatAvatarName:U,isRepeater:re,showUnknownMessage:V}),e.jsx(Ht,{packet:s,payloadType:o,payloadColor:w,summary:te,decoded:K,isLocalTx:M,dupeCount:k,onChannelClick:L}),e.jsx(xn,{routeType:x,path:Q}),e.jsx(mn,{packet:s,isLocalTx:M,payloadSize:le}),e.jsx("span",{className:"type-data-xs text-right text-fg-muted",title:T,children:q}),e.jsx(Oe,{plain:!0,className:"!min-w-0 !p-1.5","aria-label":`Inspect packet from ${ee}`,onClick:O=>{O.stopPropagation(),ce()},children:e.jsx(Je,{"data-slot":"icon"})})]})]})}function hn(t){return e.jsx(ss,{...t,mobile:!1})}function pn(t){return e.jsx(ss,{...t,mobile:!0})}const fn=d.memo(hn),gn=d.memo(pn);function yn(t,s,a,n,r=!1){const i=t.toUpperCase(),l=[],c=a&&xt(i,a);c&&l.push(a);for(const b of Object.keys(s))xt(i,b)&&l.push(b);if(r&&c&&a&&l.length===1)return{matches:l,probability:1,bestMatch:a};if(r&&c&&l.length>1){const b=l.filter(k=>k!==a);if(b.length===1)return{matches:l,probability:1,bestMatch:b[0]}}const h=l.length>0?1/l.length:0,g=[...l].sort();let f=null,v=-1;if(g.length===1)f=g[0];else if(g.length>1&&n){for(const b of g){const k=n.get(b),m=k?typeof k=="number"?k:k.combinedScore:0;m>v&&(v=m,f=b)}f||(f=g[0])}else g.length>0&&(f=g[0]);let N=h;if(l.length>1&&n&&v>0){let b=0;for(const k of l){const m=n.get(k);b+=m?typeof m=="number"?m:m.combinedScore:0}b>0&&(N=Math.min(.95,v/b))}return{matches:l,probability:N,bestMatch:f}}function jn(t,s,a,n){const i=(a-t)*Math.PI/180,l=(n-s)*Math.PI/180,c=Math.sin(i/2)*Math.sin(i/2)+Math.cos(t*Math.PI/180)*Math.cos(a*Math.PI/180)*Math.sin(l/2)*Math.sin(l/2);return 6371e3*(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)))}function bn(t){return t<100?1:t<500?.9:t<1e3?.7:t<5e3?.5:t<1e4?.3:.1}const Nn=d.lazy(()=>Ts(()=>import("./PathMapMapLibre-7vuAz1d6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])));function vn(t,s,a,n,r=!1,i,l,c){const h=Ps(s);let g;l&&(g=Ms(l,t,{position:c,isLastHop:r}).confidence);const{matches:f,probability:v}=yn(t,h,n,i,r),N=f.length,b=[],k=t.toUpperCase(),m=a&&a.latitude!==void 0&&a.longitude!==void 0&&(a.latitude!==0||a.longitude!==0);for(const C of f){if(n&&xt(k,n)&&C===n&&m&&a){b.push({hash:C,name:a.name||"Local Node",latitude:a.latitude,longitude:a.longitude,probability:r?1:v,isLocal:!0});continue}const o=h[C];o!=null&&o.latitude&&(o!=null&&o.longitude)&&!(o.latitude===0&&o.longitude===0)&&b.push({hash:C,name:o.node_name||o.name||"Unknown",latitude:o.latitude,longitude:o.longitude,probability:v,isLocal:!1,isDirectNeighbor:o.zero_hop===!0})}const L=b.length;if(L===1)b[0].probability=g??1;else if(L>1)if(g!==void 0&&g>0){const C=b[0];C.probability=g;const o=1-g,x=L-1;b.slice(1).forEach(w=>{w.probability=o/x})}else{let C=0;const o=b.map(x=>{if(x.isLocal)return{candidate:x,score:1};const w=i==null?void 0:i.get(x.hash);let M=.5;if(m&&a){const P=jn(a.latitude,a.longitude,x.latitude,x.longitude);M=bn(P)}let u;return w?u=M*.3+w.hopConsistencyScore*.3+w.frequencyScore*.4:(u=M,x.isDirectNeighbor&&(u=Math.max(u,.8))),C+=u,{candidate:x,score:u}});if(C>0)o.forEach(({candidate:x,score:w})=>{x.probability=Math.min(.95,w/C)});else{const x=1/L;b.forEach(w=>w.probability=x)}}return{candidates:b,totalMatches:N}}function wn(t,s,a,n,r,i){if(!t||t.length===0)return{hops:[],overallConfidence:0,hasValidPath:!1};const l=t.length-1,c=t.map((f,v)=>{const N=v===l,b=t.length-v,{candidates:k,totalMatches:m}=vn(f,s,a,n,N,r,i,b),L=k.length>0?Math.max(...k.map(C=>C.probability)):0;return{prefix:f,candidates:k,confidence:L,totalMatches:m}}),h=c.reduce((f,v)=>v.confidence===0?0:f*v.confidence,1),g=c.some(f=>f.candidates.length>0);return{hops:c,overallConfidence:h,hasValidPath:g}}function kn(t){return`${(t*100).toFixed(0)}%`}function Cn(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 _n(t,s,a){let n;return s===0?n=a.muted:t>=1?n=a.success:t>=.5?n=a.secondary:t>=.25?n=a.poor:t>0?n=a.danger:n=a.muted,{color:n}}class Sn extends d.Component{constructor(s){super(s),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(Xe,{className:"w-4 h-4 mr-2"}),"Map failed to load"]}):this.props.children}}function tt({path:t,neighbors:s,localNode:a,localHash:n,srcHash:r,dstHash:i,neighborAffinity:l,prefixLookup:c,hubNodes:h,traceSnr:g,advertiserSource:f}){const[v,N]=d.useState(null),b=d.useMemo(()=>{if(!f)return null;const x=f.nodeType==="wardrive";return{prefix:f.prefix||"??",candidates:[{hash:f.publicKey||f.prefix||"source",name:f.name,latitude:f.latitude,longitude:f.longitude,probability:1,isLocal:!1,isWardrive:x}],confidence:1,totalMatches:1,isSource:!0}},[f]),k=d.useMemo(()=>{if(f||!r)return null;const x=Re(r),w=s[r];if((w==null?void 0:w.latitude)&&(w==null?void 0:w.longitude)&&!(w.latitude===0&&w.longitude===0))return{prefix:x,candidates:[{hash:r,name:w.node_name||w.name||"Source",latitude:w.latitude,longitude:w.longitude,probability:1,isLocal:!1,isDirectNeighbor:w.zero_hop===!0}],confidence:1,totalMatches:1,isSource:!0};const u=(w==null?void 0:w.node_name)||(w==null?void 0:w.name)||r.slice(0,8);return{prefix:x,candidates:[{hash:r,name:u,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isSource:!0}},[f,r,s]),m=d.useMemo(()=>{const x=i!=null&&i.startsWith("0x")?i.slice(2):i;if((!x||x==="00"||x==="0000000000000000")&&a&&n){const $=Re(n),X=a.latitude!==0||a.longitude!==0;return{prefix:$,candidates:[{hash:n,name:a.name||"Local Node",latitude:X?a.latitude:0,longitude:X?a.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}if(!i)return null;const M=Re(i);if(n&&i===n&&a){const $=a.latitude!==0||a.longitude!==0;return{prefix:M,candidates:[{hash:i,name:a.name||"Local Node",latitude:$?a.latitude:0,longitude:$?a.longitude:0,probability:1,isLocal:!0}],confidence:1,totalMatches:1,isDestination:!0}}const u=s[i];if((u==null?void 0:u.latitude)&&(u==null?void 0:u.longitude)&&!(u.latitude===0&&u.longitude===0))return{prefix:M,candidates:[{hash:i,name:u.node_name||u.name||"Destination",latitude:u.latitude,longitude:u.longitude,probability:1,isLocal:!1,isDirectNeighbor:u.zero_hop===!0}],confidence:1,totalMatches:1,isDestination:!0};const G=(u==null?void 0:u.node_name)||(u==null?void 0:u.name)||i.slice(0,8);return{prefix:M,candidates:[{hash:i,name:G,latitude:0,longitude:0,probability:1,isLocal:!1}],confidence:1,totalMatches:1,isDestination:!0}},[i,s,a,n]),L=d.useMemo(()=>wn(t,s,a,n,l,c),[t,s,a,n,l,c]),C=d.useMemo(()=>{const x=[];b?x.push(b):k&&x.push(k),x.push(...L.hops),m&&x.push(m);const w=x.reduce((u,P)=>P.confidence===0?0:u*P.confidence,1),M=x.some(u=>u.candidates.some(P=>P.latitude!==0||P.longitude!==0));return{hops:x,overallConfidence:w,hasValidPath:M}},[b,k,L,m]),o=d.useMemo(()=>{const x=getComputedStyle(document.documentElement);return{success:x.getPropertyValue("--sys-green").trim()||"#39D98A",secondary:x.getPropertyValue("--sys-indigo").trim()||"#F9D26F",poor:x.getPropertyValue("--signal-poor").trim()||"#FF8A5C",danger:x.getPropertyValue("--sys-red").trim()||"#FF5C7A",muted:x.getPropertyValue("--text-muted").trim()||"#767688"}},[]);return C.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:Cn(C.overallConfidence),children:kn(C.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(va,{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(Sn,{children:e.jsx(d.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(Nn,{resolvedPath:C,localNode:a,hubNodes:h,hoveredHopIndex:v,onHoverHop:N,traceSnr:g})})})}),e.jsx("div",{className:"flex flex-wrap items-center gap-1.5",children:C.hops.map((x,w)=>{var $,X,Y;const M=x.isSource===!0,u=x.isDestination===!0,P=v===w;let G;return M?G=`Source: ${(($=x.candidates[0])==null?void 0:$.name)||"Unknown"}`:u?G=`Destination: ${((X=x.candidates[0])==null?void 0:X.name)||"Unknown"}`:x.totalMatches===0?G="No matching nodes found":x.totalMatches===1?G=`Exact match: ${((Y=x.candidates[0])==null?void 0:Y.name)||"Unknown"}`:G=`${x.totalMatches} possible matches (${(x.confidence*100).toFixed(0)}% confidence)`,e.jsxs("div",{className:D("flex items-center gap-1 px-1.5 py-0.5 rounded type-data-xs cursor-pointer transition-all",P?"bg-sys-blue/20 ring-1 ring-sys-blue/50":"bg-elevated hover:bg-subtle",M&&"border border-sys-green/30",u&&"border border-sys-blue/30"),title:G,onMouseEnter:()=>N(w),onMouseLeave:()=>N(null),children:[M&&e.jsx("span",{className:"text-sys-green text-[8px] mr-0.5",children:"SRC"}),u&&e.jsx("span",{className:"text-sys-blue text-[8px] mr-0.5",children:"DST"}),e.jsx("span",{style:_n(x.confidence,x.totalMatches,o),children:x.prefix}),!M&&!u&&x.totalMatches>1&&e.jsxs("span",{className:"text-fg-muted",children:["×",x.totalMatches]}),!M&&!u&&x.totalMatches===0&&e.jsx("span",{className:"text-fg-muted",children:"?"})]},w)})})]}):e.jsxs("div",{className:"flex items-center justify-center text-fg-muted text-xs py-4",children:[e.jsx(et,{className:"w-3.5 h-3.5 mr-1.5 opacity-50"}),"No location data available for path nodes"]})}const ct=16;function at(t){return t.match(/.{1,2}/g)||[]}function we(t){return t!==null&&t.startsWith("payload:")}const Le={hexRestOpacity:15,cardRestBg:"color-mix(in srgb, var(--elevated) 60%, var(--body))",cardRestShadow:` var(--depth-stroke-tl), var(--depth-stroke-br) `,selectionBorderWidth:2},gt={type:"tween",duration:.25,ease:[.25,.1,.25,1]};function Tn(t,s){return t?`inset 0 0 0 ${Le.selectionBorderWidth}px ${ke[s]}`:Le.cardRestShadow}function Pn(t,s){return t?s:`color-mix(in srgb, ${s} ${Le.hexRestOpacity}%, transparent)`}function Mn({segments:t,selectedSegment:s,onSegmentClick:a}){const[n,r]=d.useState(null),[i,l]=d.useState(null),c=t.some(f=>f.id!==void 0)&&a,h=[];for(const f of t){const v=at(f.hex);for(const N of v)h.push({byte:N.toUpperCase(),color:f.color,id:f.id})}const g=[];for(let f=0;f{const N=f.length{const C=L===f.length-1,o=N&&C,x=ke[k],u=(m?n===m:i===k)||!!(m&&s===m);return e.jsx("span",{className:`w-[1.75rem] text-xs text-center py-0.5 font-mono select-text ${c?"cursor-pointer":""}`,style:{backgroundColor:Pn(u,x),color:u?"rgba(255,255,255,0.95)":x,transition:u?"none":"background-color 0.15s ease-out, color 0.15s ease-out",touchAction:"manipulation",...o?{borderRadius:"0 0.375rem 0.375rem 0"}:{}},onMouseEnter:()=>{m?r(m):l(k)},onMouseLeave:()=>{r(null),l(null)},onClick:()=>m&&(a==null?void 0:a(m)),onTouchStart:()=>{m?r(m):l(k)},onTouchEnd:()=>{r(null),l(null)},children:b},L)})},v)})})}function Bn({rawHex:t,hexSegments:s,selectedSegment:a,onSegmentClick:n}){const[r,i]=d.useState(!1),l=d.useCallback(async()=>{await Ds(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(Mn,{segments:s,selectedSegment:a,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(As,{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(st,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"Copy"})]})})]})}function Rn(t,s,a){const n=[];let r=0;const i=s.slice(0,64);n.push({id:"payload:publicKey",title:"Public Key",color:"pink",hex:i,startByte:r,endByte:r+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)"})]})}),r+=32;const l=s.slice(64,72);n.push({id:"payload:timestamp",title:"Timestamp",color:"orange",hex:l,startByte:r,endByte:r+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",copy:!0,children:l.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.timestamp," (",ie(t.timestamp,a),")"]})]})}),r+=4;const c=s.slice(72,200);n.push({id:"payload:signature",title:"Signature",color:"teal",hex:c,startByte:r,endByte:r+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)"})]})}),r+=64;const h=s.slice(200,202);if(n.push({id:"payload:flags",title:"Flags",color:"blue",hex:h,startByte:r,endByte:r,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(W,{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]})]})}),r+=1,t.latitude!==void 0){const g=s.slice(r*2,r*2+8);n.push({id:"payload:latitude",title:"Latitude",color:"green",hex:g,startByte:r,endByte:r+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",copy:!0,children:g.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.latitude.toFixed(6),"°"]})]})}),r+=4}if(t.longitude!==void 0){const g=s.slice(r*2,r*2+8);n.push({id:"payload:longitude",title:"Longitude",color:"indigo",hex:g,startByte:r,endByte:r+3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",copy:!0,children:g.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:[t.longitude.toFixed(6),"°"]})]})}),r+=4}if(t.name){const g=s.slice(r*2),f=g.length/2;n.push({id:"payload:name",title:"Name",color:"amber",hex:g,startByte:r,endByte:r+f-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",copy:!0,children:g.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-primary mt-1",children:['"',t.name,'"']})]})})}return n}function Ln(t,s){return[{id:"payload:crc",title:"CRC",color:"green",hex:s.slice(0,8),startByte:0,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(W,{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 Hn(t,s){const a=[];a.push({id:"payload:channelHash",title:"Channel Hash",color:"blue",hex:s.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(W,{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&&a.push({id:"payload:mac",title:"MAC",color:"indigo",hex:s.slice(2,6),startByte:1,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{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=s.slice(6);return n&&a.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"})]})}),a}function Dn(t,s){const a=[];a.push({id:"payload:channelHash",title:"Channel Hash",color:"blue",hex:s.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(W,{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&&a.push({id:"payload:mac",title:"MAC",color:"indigo",hex:s.slice(2,6),startByte:1,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{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=s.slice(6);return n&&a.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)"]})]})}),a}function An(t,s){const a=[],n=parseInt(s.slice(0,2),16),r=isNaN(n)?{hashSize:1,hopCount:t.pathLength}:Es(n),i=r.hopCount*r.hashSize;if(a.push({id:"payload:pathLength",title:"Path Length",color:"blue",hex:s.slice(0,2),startByte:0,endByte:0,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",children:r.hopCount}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[r.hopCount," hop",r.hopCount!==1?"s":"",r.hashSize>1&&` × ${r.hashSize}B hashes`]})]})}),t.path.length>0){const l=s.slice(2,2+i*2);a.push({id:"payload:path",title:"Path Hops",color:"amber",hex:l,startByte:1,endByte:i,decoded:e.jsx(e.Fragment,{children:e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:t.path.map((c,h)=>e.jsxs("span",{className:"flex items-center gap-1",children:[h>0&&e.jsx(ge,{className:"w-3 h-3 text-fg-muted"}),e.jsx(S,{color:"amber",className:"font-mono",children:c})]},h))})})})}if(t.extraType!=null){const l=1+i;a.push({id:"payload:extraType",title:"Extra Type",color:"indigo",hex:s.slice(l*2,l*2+2),startByte:l,endByte:l,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{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 l=1+i+1,c=s.slice(l*2);c&&a.push({id:"payload:extraData",title:"Extra Data",color:"indigo",hex:c,startByte:l,endByte:l+c.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:c.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[c.length/2," bytes"]})]})})}return a}function Fn(t,s){const a=[];a.push({id:"payload:crc",title:"Trace Tag",color:"blue",hex:s.slice(0,8),startByte:0,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(W,{size:"standard",copy:!0,children:["0x",t.traceTag]}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique trace request identifier"})]})}),a.push({id:"payload:mac",title:"Auth Code",color:"indigo",hex:s.slice(8,16),startByte:4,endByte:7,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",copy:!0,children:t.authCode}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Authentication/verification code"})]})});const n=1<<(t.flags&3);a.push({id:"payload:flags",title:"Flags",color:"amber",hex:s.slice(16,18),startByte:8,endByte:8,decoded:e.jsxs(e.Fragment,{children:[e.jsxs(W,{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 (1B hashes)":`Bits 0-1: ${n}B per hash • ${t.flags.toString(2).padStart(8,"0")}b`})]})});const r=s.slice(18);return r&&a.push({id:"payload:path",title:"Target Path",color:"indigo",hex:r,startByte:9,endByte:9+r.length/2-1,decoded:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:t.pathHashes.map((i,l)=>{const c=t.snrValues[l],h=c!==void 0?pa(c):"zinc";return e.jsxs("span",{className:"flex items-center gap-1",children:[l>0&&e.jsx(ge,{className:"w-3 h-3 text-fg-muted"}),e.jsx(S,{color:"indigo",className:"font-mono",children:i}),c!==void 0&&e.jsxs(S,{color:h,className:"font-mono",children:[c>=0?"+":"",Number.isInteger(c)?c:c.toFixed(1),"dB"]})]},l)})}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[t.pathHashes.length," target ",t.pathHashes.length===1?"hop":"hops",n>1&&` × ${n}B hashes`,t.snrValues.length>0&&` • ${t.snrValues.length} SNR ${t.snrValues.length===1?"value":"values"} collected`,t.isComplete&&" • ✓ Complete"]})]})}),a}function En(t,s){const a=[];a.push({id:"payload:msgId",title:"Message ID",color:"blue",hex:s.slice(0,4),startByte:0,endByte:1,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",copy:!0,children:t.messageId.toUpperCase()}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Unique message identifier"})]})}),a.push({id:"payload:partNum",title:"Part Number",color:"amber",hex:s.slice(4,6),startByte:2,endByte:2,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{size:"standard",copy:!0,children:t.partNumber}),e.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"0-indexed part number"})]})}),a.push({id:"payload:totalParts",title:"Total Parts",color:"orange",hex:s.slice(6,8),startByte:3,endByte:3,decoded:e.jsxs(e.Fragment,{children:[e.jsx(W,{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=s.slice(8);return n&&a.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"]})]})}),a}function zn(t,s,a){switch(t.type){case"advert":return Rn(t,s,a);case"ack":return Ln(t,s);case"grp_txt":return Hn(t,s);case"grp_data":return Dn(t,s);case"path":return An(t,s);case"trace":return Fn(t,s);case"multipart":return En(t,s);default:return[{id:"payload:ciphertext",title:"Raw Data",color:"zinc",hex:s,startByte:0,endByte:s.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:s.toUpperCase()}),e.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[s.length/2," bytes"]})]})}]}}function In(t){return t.map(s=>({id:s.id,hex:s.hex,color:s.color}))}function $n({bits:t,field:s,value:a,binary:n}){const r=()=>{if(s==="Payload Type"){const i=$e[a]||"zinc";return e.jsx(S,{color:i,children:a})}if(s==="Route Type"){const i=ut[a]||"zinc";return e.jsx(S,{color:i,children:a})}return e.jsx("span",{className:"text-sm text-fg-primary",children:a})};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:s}),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 Dt({id:t,title:s,color:a,hexBytes:n,startByte:r,endByte:i,isSelected:l,children:c}){const h=n?at(n):[];return e.jsxs(ue.div,{layout:"position",layoutId:t,transition:gt,className:"w-full min-w-0 overflow-hidden radius-inner p-4 sm:p-5 space-y-4",style:{backgroundColor:Le.cardRestBg,boxShadow:Tn(l,a)},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(S,{color:a,children:s}),h.length>0&&h.length<=16&&h.map((g,f)=>e.jsx(S,{color:a,className:"font-mono",children:g.toUpperCase()},f))]}),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:c})]})}function On({advert:t,timestamp:s,preferences:a}){const n=s?ie(s,a):ie(t.timestamp,a);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(fe,{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(et,{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(he,{className:"w-4 h-4 text-sys-indigo flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:n})]})]})]})})}function Un({decoded:t,timestamp:s,preferences:a}){const n=s?ie(s,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(_a,{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(es,{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(he,{className:"w-4 h-4 text-sys-teal flex-shrink-0"}),e.jsx("span",{className:"text-sm text-fg-secondary font-sans",children:n})]}),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(W,{size:"compact",copy:!0,className:"inline-block",children:e.jsx("span",{className:"break-all text-xs",children:t.decryptedHex.toUpperCase()})})})]})]})]})})}function Vn({decoded:t,timestamp:s,preferences:a,isLoading:n=!1,onDecrypted:r}){const i=s?ie(s,a):"Unknown",[l,c]=d.useState(""),[h,g]=d.useState(!1),[f,v]=d.useState(null),[N,b]=d.useState(!1),k=d.useCallback(async()=>{if(!(!l.trim()||!t.ciphertextHex||!t.macHex)){g(!0),v(null);try{const m=parseInt(t.channelHash,16),L=_t(t.macHex),C=_t(t.ciphertextHex),o=await Is(l.trim(),m,L,C);if(o.success){const x=o.result.plaintext,w=new TextDecoder("utf-8",{fatal:!1}).decode(x.slice(5)),M=w.indexOf(": "),u={...t,channelName:o.result.channelName,decrypted:!0,timestamp:x[0]|x[1]<<8|x[2]<<16|x[3]<<24,flags:x[4],senderName:M>0?w.slice(0,M):void 0,text:M>0?w.slice(M+2):w};r==null||r(u),c(""),b(!1)}else v(o.error)}catch(m){v(m instanceof Error?m.message:"Unknown error")}finally{g(!1)}}},[l,t,r]);return n?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-Cf7m4kGK.js b/frontend/dist/assets/PacketObservatory-B6q6lK8q.js similarity index 99% rename from frontend/dist/assets/PacketObservatory-Cf7m4kGK.js rename to frontend/dist/assets/PacketObservatory-B6q6lK8q.js index 0756a547..1388d484 100644 --- a/frontend/dist/assets/PacketObservatory-Cf7m4kGK.js +++ b/frontend/dist/assets/PacketObservatory-B6q6lK8q.js @@ -1,10 +1,10 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-3uhIJZso.js","assets/index-CAHLMlrb.js","assets/node-types-CcH5BFf0.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); -import{e as Re,ct as z,r as S,f3 as Ee,f4 as Oe,f5 as ze,f6 as Be,bS as Ie,f7 as Ge,f8 as qe,f9 as Ke,fa as Ue,bR as we,_ as pe,fb as Ve,fc as Ce,c2 as xe,j as e,fd as q,fe as K,ff as U,eE as he,fg as We,a2 as A,cd as Ye,cp as Se,cB as Ze,fh as Xe,fi as Qe,fj as Je,fk as et,fl as tt,z as st,fm as ee,fn as nt,fo as rt,fp as at,fq as me,cl as fe,N as lt,at as Te,bY as ot,w as ct,fr as it,$ as dt,ad as ut,fs as pt,Q as xt,bZ as ht}from"./index-CAHLMlrb.js";import{usePipelineStore as Z}from"./usePipelineStore-3uhIJZso.js";import{e as _e,p as mt,A as G,S as V,a as ne,c as O,K as i,H as R,B as ft,R as E,T as d,P as ae,d as gt,f as C,C as ke,s as te,h as bt}from"./primitives-B7bSO4E3.js";import{m as He,i as yt}from"./node-types-CcH5BFf0.js";import{a as jt}from"./payload-detail-CniY19rz.js";import{P as vt,a as Nt}from"./PageLayout-CgrNSpBT.js";import"./WorkspaceNav-ClxMgBhr.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/usePipelineStore-B9TPEPcv.js","assets/index-CdntfUUz.js","assets/node-types-rkAZo2WA.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); +import{e as Re,ct as z,r as S,f3 as Ee,f4 as Oe,f5 as ze,f6 as Be,bS as Ie,f7 as Ge,f8 as qe,f9 as Ke,fa as Ue,bR as we,_ as pe,fb as Ve,fc as Ce,c2 as xe,j as e,fd as q,fe as K,ff as U,eE as he,fg as We,a2 as A,cd as Ye,cp as Se,cB as Ze,fh as Xe,fi as Qe,fj as Je,fk as et,fl as tt,z as st,fm as ee,fn as nt,fo as rt,fp as at,fq as me,cl as fe,N as lt,at as Te,bY as ot,w as ct,fr as it,$ as dt,ad as ut,fs as pt,Q as xt,bZ as ht}from"./index-CdntfUUz.js";import{usePipelineStore as Z}from"./usePipelineStore-B9TPEPcv.js";import{e as _e,p as mt,A as G,S as V,a as ne,c as O,K as i,H as R,B as ft,R as E,T as d,P as ae,d as gt,f as C,C as ke,s as te,h as bt}from"./primitives-Bl26dfm-.js";import{m as He,i as yt}from"./node-types-rkAZo2WA.js";import{a as jt}from"./payload-detail-D7dyXv-d.js";import{P as vt,a as Nt}from"./PageLayout-B2kQpvXM.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wt=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],Ct=Re("binary",wt);function St(t){const s=t.type??t.payload_type,r=t.duplicates??[],o=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const m=[t.rssi,...r.map(f=>f.rssi).filter(f=>f!=null)],u=[t.snr,...r.map(f=>f.snr).filter(f=>f!=null)];m.length>1&&(n=[Math.min(...m),Math.max(...m)]),u.length>1&&(l=[Math.min(...u),Math.max(...u)])}const c=s===z.TRACE;return{isDuplicate:o,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:c}}function Tt(t,s,r){const o={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=_e(t.payload)),!a)return{...o,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,c=l(t),m=n.length>0?Math.min(...n.map(l)):c,u=t.payload?t.payload.slice(18):"",f=u.length>=2?u.slice(0,2).toUpperCase():null,p=[];if(p.push(`traceTag: ${a}`),p.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return p.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:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return p.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:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f};if(p.push(`this observation: path_len=${c}, min across siblings: ${m}`),f){if(p.push(`first hop in target path: ${f}`),c===0)return p.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),p.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:[...p,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:c,minPathLen:m,firstHopPrefix:f};const g=Object.entries(r).filter(([$])=>$.replace(/^0x/i,"").slice(0,2).toUpperCase()===f);if(g.length===1){const[$,_]=g[0],h=_.name||_.node_name||null;return p.push(`first hop ${f} → unique neighbor: ${h??$}`),p.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:f,inferredName:h,evidence:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f}}else g.length>1?p.push(`first hop ${f} matches ${g.length} neighbors (ambiguous)`):p.push(`first hop ${f} is not a known neighbor`)}return p.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f}}let re=null,ie=null;typeof window<"u"&&setTimeout(()=>{pe(()=>import("./usePipelineStore-3uhIJZso.js"),__vite__mapDeps([0,1,2,3])).then(t=>{re=t}),pe(()=>import("./index-CAHLMlrb.js").then(t=>t.hG),__vite__mapDeps([1,3])).then(t=>{ie=t})},0);const $e={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 _t(t,s){const r=t.type??t.payload_type,o=we(r),a=Ie(t.route),n=r===z.ADVERT,l=r===z.TRACE,c=r===z.PATH,m=r===z.GRP_TXT||r===z.GRP_DATA,u=Ge(t.snr,t.rssi),f=(u==null?void 0:u.finalGrade)??"critical",p=qe(t.route),v=Ke(t.route),N=Ue(t.route),g=t.route==null?"unknown":p?"flood":v?"direct":"unknown",$=N?`transport-${g}`:g,_=!!s.advertSender;let h="none";_?h="pubkey":m?h="encrypted":t.src_hash&&(h="prefix");const y=yt(r),x=s.advertNodeType!=null?He(s.advertNodeType):"unknown",w=y!=="unknown"?y:x,H=t.packet_origin??"rx",T=Math.floor(Date.now()/1e3)-t.timestamp,L=T<10?"live":T<300?"recent":T<3600?"warm":T<86400?"stale":"historic",M=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,F=M??0,D=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),b=St(t);return{pType:r,payloadTypeName:o,routeTypeName:a,isAdvert:n,isTrace:l,isPath:c,isGrp:m,signalClass:f,routeClass:$,isFlood:p,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:_,inferredType:y,advertType:x,effectiveType:w,origin:H,age:L,pathLen:M,pathAvail:P,pathHopCount:F,byteLen:D,dupeAnalysis:b}}function kt(t){var g,$,_,h,y,x;const s=jt(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:o}=s;if(r.length<2||!re||!ie)return null;const a=re.usePipelineStore.getState().srcHashResolverMap,n=re.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,c=ie.useStore.getState().stats,m=(c==null?void 0:c.neighbors)??{},u=c==null?void 0:c.local_hash,f=($=(g=c==null?void 0:c.config)==null?void 0:g.repeater)==null?void 0:$.latitude,p=(h=(_=c==null?void 0:c.config)==null?void 0:_.repeater)==null?void 0:h.longitude,v=Object.keys(m).length>0?Ve([],m,u,f,p):null,N=[];for(let w=0;w0?[r[w-1].toUpperCase()]:[]],P=ge(H,w,M,a,v),F=[H,...w+20?N:null}function ge(t,s,r,o,a){if(s===0){const l=o==null?void 0:o.get(t);if(l)return{hash:l,confidence:.8};if(a){const c=xe(a,t,{position:s,adjacentPrefixes:r});if(c.hash)return{hash:c.hash,confidence:c.confidence}}}else{if(a){const c=xe(a,t,{position:s,adjacentPrefixes:r});if(c.hash)return{hash:c.hash,confidence:c.confidence}}const l=o==null?void 0:o.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function Ht(t){var l;const s=t.raw_packet;if(!s||s.length<2)return null;const r=s.replace(/\s/g,""),o=Math.floor(r.length/2),a=((l=r.match(/.{1,2}/g))==null?void 0:l.join(" "))??"";let n="";for(let c=0;c=32&&m<=126?String.fromCharCode(m):"·"}return{hexBytes:a,utf8:n,byteCount:o}}function $t(t){const s=new Map;let r=0,o="";for(const a of t){if((a.type??a.payload_type)!==z.TRACE)continue;r++,o=a.packet_hash;const l=a._traceTag??(a.payload?_e(a.payload):null);if(!l)continue;let c=s.get(l);c||(c=[],s.set(l,c)),c.push(a)}return{index:s,fingerprint:`${r}:${o}`}}function Dt(t,s,r){const o=S.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=S.useMemo(()=>t?Ht(t):null,[t]),n=S.useMemo(()=>{if(!s||s.length<4)return o.current.parse=0,o.current.decode=0,null;const h=performance.now(),y=mt(s),x=performance.now()-h;return y?(o.current.parse=x,o.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}):(o.current.parse=x,o.current.decode=0,{protocolPacket:null,display:null,decoded:null,error:"Packet.fromHex() returned failure"})},[s]),l=S.useMemo(()=>{if(!t)return o.current.enrich=0,$e;const h=performance.now();if(t._advertSender!==void 0)return o.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,x=Ee(s,y),w=Oe(s,y),H=ze(s,t),T=Be(t);return o.current.enrich=performance.now()-h,{...x,channelHash:w,byteLength:H,...T,preComputed:!1}},[t,s]),c=S.useRef({fingerprint:"",index:new Map}),m=S.useMemo(()=>{const h=performance.now(),{index:y,fingerprint:x}=$t(r);return o.current.traceIndex=performance.now()-h,x===c.current.fingerprint?c.current.index:(c.current={fingerprint:x,index:y},y)},[r]),u=S.useMemo(()=>{const h=o.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,m]);if(!t)return null;const f=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",p=(n==null?void 0:n.protocolPacket)??null,v=p?p.payloadVersion:null,N=v===0,g=v===1,$=_t(t,l);let _=null;return $.isTrace&&(_=kt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:f,protocolPacket:p,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:g,enrichment:l,traceTagIndex:m,analysis:$,traceHopDetail:_,timing:u}}function le({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),o=(r==null?void 0:r.color)??"green",a=((n=G[o])==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,c)=>{const m=G[l.color??"green"]??G.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?m.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?m.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})]},c)}),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 Lt({tokens:t,nextFn:s}){var n;const r=t.find(l=>l.active),o=(r==null?void 0:r.color)??"green",a=((n=G[o])==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,c)=>{const m=G[l.color??"green"]??G.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?m.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?m.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??"",")"]})]},c)}),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 Mt={0:"border-l-sys-green",1:"border-l-sys-blue",2:"border-l-sys-teal",3:"border-l-sys-purple"};function oe({stage:t,name:s,fn:r,verdict:o,timeMs:a,skipped:n,skipReason:l,children:c}){const m=Mt[t]??"";return e.jsx(e.Fragment,{children:e.jsx(q,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${m}`,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&&!o&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),o&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:o})]}),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(U,{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"}):c})})]})})})}function Pt(t,s){return s?"manual":t._stripped?"bulk-tier":We.isConnected()?"ws-push":"rest-poll"}const At={connected:"green",degraded:"amber",offline:"red"};function Ft({packet:t,isSynthetic:s}){const r=he(f=>f.wsState),o=he(f=>f.health),a=Pt(t,s),l=!!t._stripped?"WARM":"HOT",c=[{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"}],m=[{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:o,group:"transport",color:At[o]}],u=s?"manual hex input":`${a} (${o})`;return e.jsx(oe,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:u,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(V,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(le,{options:c,nextFn:"ingest()"}),e.jsx(ne,{tokens:m})]})})})}function W({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 Rt={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 Et({rawHex:t,display:s,protocolPacket:r,parseError:o,parseTimeMs:a,payloadVersion:n,isV1:l,isV2:c}){return e.jsx("dl",{className:"space-y-0.5",children:s&&r&&t?e.jsxs(e.Fragment,{children:[e.jsx(O,{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(W,{start:0}),e.jsx(R,{value:t.slice(0,2)})," ",e.jsx(ft,{value:parseInt(t.slice(0,2),16)})]}),s.headerFields.map(m=>e.jsx(i,{label:` ${m.field}`,children:e.jsx(E,{raw:e.jsxs("span",{className:"text-[10px]",children:["bits[",m.bits,"] = ",m.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:m.value})})},m.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(A,{color:l?"green":c?"blue":"zinc",children:l?"v1":c?"v2":`v${n}`}),l&&e.jsx("span",{className:"text-fg-muted text-[10px]",children:"1-byte hashes, 2-byte MAC"}),c&&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(O,{title:"Wire Framing"}),e.jsx(i,{label:"transportCodes",children:s.transportCodesHex?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(W,{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(E,{raw:e.jsxs(e.Fragment,{children:[e.jsx(W,{start:s.pathLenByteOffset}),e.jsx(R,{value:s.pathLengthHex})]}),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(W,{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(W,{start:s.pathByteOffset,end:s.pathByteOffset+r.pathLen-1}),e.jsx(ae,{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(W,{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(O,{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:o??"No raw_packet (warm-tier)"})]})]})})}function Ot({decoded:t,packet:s}){if(!t)return e.jsxs(e.Fragment,{children:[e.jsx(O,{title:"B. Decode"}),e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:"No decoded payload"})]});const r=Rt[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(O,{title:"B. Decode — decodePayload()"}),e.jsx(V,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(O,{}),e.jsx(zt,{decoded:t,packet:s})]})})]})}function zt({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(E,{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(E,{raw:e.jsx(R,{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(E,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const o=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(R,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(ae,{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(O,{}),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 f,p,v,N,g;const l=((f=t.pathHashes[n])==null?void 0:f.toUpperCase())??"??",c=n===0?o??"SRC":((p=t.pathHashes[n-1])==null?void 0:p.toUpperCase())??"??",m=(g=(N=(v=Ze.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:g.spreading_factor,u=Ce(a,m);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:c}),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(A,{color:"green",children:u})]},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(ae,{hops:t.path.map(o=>o.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(E,{raw:e.jsx(R,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(E,{raw:e.jsx(R,{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(R,{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(R,{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(E,{raw:e.jsx(R,{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(A,{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(A,{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(E,{raw:e.jsx(R,{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(E,{raw:e.jsx(R,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(E,{raw:e.jsx(R,{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(E,{raw:e.jsx(R,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(E,{raw:e.jsx(R,{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(E,{raw:e.jsx(R,{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(gt,{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 Bt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,o=r===Xe||r===Qe,a=S.useMemo(()=>{if(!o||!t)return null;const x=t.payload;return x.length<4?null:{channelHash:x[0],mac:x.slice(1,3),ciphertext:x.slice(3)}},[t,o]),[n,l]=S.useState("pending"),[c,m]=S.useState([]),[u,f]=S.useState(0);S.useEffect(()=>{if(!a){l(null);return}let x=!1;return(async()=>{const H=performance.now(),T=await Je(a.channelHash,a.mac,a.ciphertext);x||(l(T),f(performance.now()-H));const L=await et(a.channelHash);x||m(L)})(),()=>{x=!0}},[a]);const[p,v]=S.useState(""),[N,g]=S.useState(null),[$,_]=S.useState(!1),h=S.useCallback(async()=>{if(!(!a||!p.trim())){_(!0);try{const x=await Ye(p.trim(),a.channelHash,a.mac,a.ciphertext);if(x.success){const w=new TextDecoder("utf-8",{fatal:!1}).decode(x.result.plaintext.slice(5));g({success:!0,text:w})}else g({success:!1,error:x.error})}catch(x){g({success:!1,error:String(x)})}finally{_(!1)}}},[a,p]),y=Se(s);return!o||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(O,{title:"C. Decrypt — tryDecryptGroupMessage()"}),u>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:u<1?`${(u*1e3).toFixed(0)}µs`:`${u.toFixed(2)}ms`})}),e.jsx(V,{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(x=>x.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:c.length>0?`${c.length} names`:"0",color:c.length>0?"teal":"zinc"})}),c.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:c.join(", ")})]}),e.jsx(O,{}),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(O,{}),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:p,onChange:x=>{v(x.target.value),g(null)},onKeyDown:x=>x.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:$||!p.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:$?"…":"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(O,{}),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 It(t){const{rawHex:s,display:r,protocolPacket:o,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:c,isV1:m,isV2:u,packetHash:f,packet:p}=t,v=!!s&&s.length>=4;return e.jsxs(q,{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(U,{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(Et,{rawHex:s,display:r,protocolPacket:o,parseError:n,parseTimeMs:l,payloadVersion:c,isV1:m,isV2:u}),e.jsx(Ot,{decoded:a,packet:p}),e.jsx(Bt,{protocolPacket:o,packetHash:f})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function be(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 Gt({packet:t,pipeline:s,rawHex:r,traceTagIndex:o,neighbors:a}){const{enrichment:n,timing:l,display:c,protocolPacket:m,decoded:u,parseError:f,payloadVersion:p,isV1:v,isV2:N,analysis:g}=s,_=(t.type??t.payload_type)===tt,h=g.dupeAnalysis,y=S.useRef(0),x=S.useMemo(()=>{if(!_)return null;const L=performance.now(),M=Tt(t,o,a);return y.current=performance.now()-L,M},[t,o,a,_]),w=l.enrich+y.current,H=[];g.byteLen&&H.push(`${g.byteLen}B`),H.push(g.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):g.pathHopCount>0&&H.push(`${g.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const T=H.join(" — ");return e.jsxs(oe,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:T,timeMs:w,children:[e.jsx(It,{rawHex:r,display:c,protocolPacket:m,decoded:u,parseError:f,parseTimeMs:l.parse,payloadVersion:p,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(O,{title:"Cache Enrichment"}),e.jsx(V,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(A,{color:"green",children:"PacketCache"}):e.jsx(A,{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(A,{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:He(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(O,{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 ${u?"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:u?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:be(u).map((L,M)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:L.fn,value:L.value,color:L.color})},M))}):e.jsx(C,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(O,{}),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(C,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(C,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),x&&e.jsxs(e.Fragment,{children:[e.jsx(O,{}),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:"}),x.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:x.inferredSrc,color:"purple"}),x.inferredName&&e.jsx(d,{fn:"name",value:x.inferredName,color:"purple"})]}):e.jsx(C,{children:"unresolvable"}),e.jsx(ke,{color:"purple",children:x.method}),e.jsxs(C,{children:["(",x.confidence,")"]}),e.jsxs(C,{children:["siblings=",x.siblingCount]})]})]}),(()=>{const L=g.pType!=null?`0x${g.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,M=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=be(u),F=g.signalClass==="excellent"||g.signalClass==="good"?"green":g.signalClass==="fair"?"amber":"red",D=g.senderTier==="pubkey"?"green":g.senderTier==="prefix"?"amber":g.senderTier==="encrypted"?"teal":"zinc",b=[{fn:"type",value:g.payloadTypeName,raw:L,group:"wire",color:"blue"},{fn:"route",value:g.routeTypeName,raw:M,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:g.byteLen?`${g.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:g.advertType!=="unknown"?g.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"},x!=null&&x.inferredSrc?{fn:"traceSrc",value:x.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:g.signalClass,group:"analysis",color:F},{fn:"_routeClass",value:g.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:g.senderTier,group:"analysis",color:D},{fn:"_origin",value:g.origin,group:"analysis",color:g.origin==="tx_local"?"green":g.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:g.pathAvail?`${g.pathHopCount} hops`:"none",group:"analysis",color:g.pathAvail?"green":"zinc"},{fn:"_age",value:g.age,group:"analysis",color:g.age==="live"||g.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(ne,{tokens:b})})()]})})]})}function ye(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 je(t){return`${Math.round(t*100)}%`}function ve(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function qt({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(V,{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(ae,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(ke,{color:ye(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(E,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:ye(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:ve(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:je(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:ve(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:je(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(ne,{label:"trace contributes",tokens:Kt(t)})]})}function Kt(t){const s=t.reduce((n,l)=>n+(l.fromHash?1:0)+(l.toHash?1:0),0),r=t.length*2,o=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"},...o>0?[{fn:"ghosts",value:String(o),group:"worker",color:"purple"}]:[],{fn:"avgSnr",value:`${a.toFixed(1)} dB`,group:"analysis",color:a>=5?"green":a>=0?"amber":"red"}]}function Ut(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 Vt(t,s){if(!t)return[];const r=t.decoded;if(!r)return[{fn:"decrypt.result",value:"failed",group:"crypto",color:"red"}];if(!r.decrypted)return[{fn:"decrypt.result",value:"no key match",group:"crypto",color:"zinc"}];const o=[];return r.channelName&&o.push({fn:"decrypt.channelName",value:r.channelName,group:"crypto",color:"teal"}),r.senderName&&o.push({fn:"decrypt.senderName",value:r.senderName,group:"crypto",color:"teal"}),r.text&&o.push({fn:"decrypt.text",value:r.text,group:"crypto",color:"teal"}),r.timestamp&&o.push({fn:"decrypt.timestamp",value:lt(new Date(r.timestamp*1e3),s,!0),group:"crypto",color:"teal"}),r.macCorrupted&&o.push({fn:"decrypt.macCorrupted",value:"true",group:"crypto",color:"amber"}),o}function Wt({packet:t,decrypted:s,pipeline:r}){var b;const o=st(),a=ee(k=>k.isComputing),n=ee(k=>k.lastUpdated),l=ee(k=>k.lastComputeTimeMs),c=ee(k=>k.topology.edges.length),m=ee(k=>k.topology.discoveredNodes.length),u=nt(),f=rt(),p=at(),v=me(k=>k.isComputing),N=me(k=>k.nodeCount),g=fe(k=>k.progress),$=fe(k=>k.initialDecodeComplete),_=t.type??t.payload_type,h=_===z.GRP_TXT||_===z.GRP_DATA,y=_===z.TRACE,x=_===z.PATH,w=h,H=[{label:"full",detail:"all GRP_TXT → decryption worker",active:w&&$,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:w&&!$,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!w,color:"zinc"}],T=Vt(s,o),L=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,M=a?"running":`${c}e ${m}g`,P=v?"running":`${N}n`,F=w?L?"decrypted":g.isDecoding?`${g.percent}%`:"pending":"N/A",D=`topo ${a?"○":"✓"} ${M} · spark ${v?"○":"✓"} ${P} · decrypt ${F}`;return e.jsx(oe,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:D,children:e.jsx(V,{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 ${a?"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:[c,"e ",m,"g"]}),(y||x)&&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 ${v?"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:[N,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${g.isDecoding?"bg-sys-amber animate-pulse":w?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:w?"text-sys-teal":"text-fg-muted",children:w?L?"decrypted":g.isDecoding?`${g.percent}%`:"pending":"N/A"})]})]}),e.jsxs(q,{defaultOpen:y||x,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(U,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:a?"running":"idle",color:a?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Ut(n),color:"zinc"}),l>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",l<1e3?`${l.toFixed(0)}ms`:`${(l/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(c),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(m),color:"purple"})]}),f&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(u.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(u.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(u.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${u.meanSnr.toFixed(1)} dB`,color:u.meanSnr>=5?"green":u.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${u.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(u.avgConfidence*100)}%`,color:"zinc"})]}),y&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(u.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(u.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(u.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(u.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(u.qualityCounts.critical),color:"red"})]}),p.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(p.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(p.confirmedLinks.length),color:"teal"})]})]}),y&&(r==null?void 0:r.traceHopDetail)&&e.jsx(qt,{hops:r.traceHopDetail})]})})]}),w&&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(le,{options:H,nextFn:"queueDecryption()"})}),e.jsx(i,{label:"result",children:e.jsx(d,{fn:"decrypt",value:L?"decrypted":s?"failed":"pending",color:L?"teal":s?"red":"zinc"})}),L&&e.jsx("div",{className:"mt-1 flex flex-wrap gap-x-1.5 gap-y-1",children:T.map((k,ce)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:k.fn,value:k.value,color:k.color})},ce))})]})}),(()=>{const k=[{fn:"topology.edges",value:String(c),group:"worker",color:"green"},{fn:"topology.ghostNodes",value:String(m),group:"worker",color:"purple"},{fn:"sparkline.nodes",value:`${N}`,group:"worker",color:"green"},...f?[{fn:"trace.directedLinks",value:String(u.totalDirectedLinks),group:"worker",color:"teal"},{fn:"trace.meanSnr",value:`${u.meanSnr.toFixed(1)} dB`,group:"worker",color:"teal"}]:[],...T];return e.jsx(ne,{tokens:k})})()]})})})}function Yt(t,s,r,o){var n;const a=t.src_hash?Te(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(o&&s.confident&&((n=s.name)==null?void 0:n.toLowerCase())===o.toLowerCase())return{tier:1.5,label:"decrypt.senderName → nameToHash",detail:`Decrypted sender name “${o}” 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 Zt(t,s){const r=t.original_path??t.forwarded_path,o=new Set;if(r&&Array.isArray(r))for(const a of r){const n=String(a).toUpperCase();n.length>=2&&!ot(n,s)&&o.add(n)}return o}function Xt(t,s,r,o,a,n,l){const c=Math.floor(Date.now()/1e3),m=new Map(r.map(u=>[u.hash,u]));return t.map(u=>{const f=s[u.hash],p=m.get(u.hash);let v=!0,N="";o!=="unknown"?u.type!=="unknown"&&u.type!==o?(v=!1,N=`${u.type} ≠ required ${o}`):u.type===o?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const g=!!(f!=null&&f.zero_hop),$=(f==null?void 0:f.last_seen)??0;let _=0;if(g&&$>0){const D=(c-$)/3600;_=50*Math.exp(-D/l)}let h=0;if($>0){const D=(c-$)/3600;h=Math.exp(-D/n)}const y=h*20,x=!!(f!=null&&f.latitude&&(f!=null&&f.longitude)&&(f.latitude!==0||f.longitude!==0)),w=x?5:0,H=(p==null?void 0:p.advertCount)??0,T=Math.min(H*2,30),L=(p==null?void 0:p.forwarderPrefixes.size)??0,M=Math.min(L*3,15);let P=0;if(p&&p.totalForwarderObservations>0&&a.size>0){let D=0;for(const b of a)p.forwarderPrefixes.has(b)&&D++;P=D/a.size}const F=_+y+w+T+M;return{hash:u.hash,name:u.name,type:u.type,roleCompatible:v,roleReason:N,zeroHop:g,zeroHopScore:_,lastSeen:$,recencyScore:h,recencyPoints:y,hasGps:x,gpsScore:w,advertCount:H,advertScore:T,topoWidth:L,topoScore:M,affinity:P,total:F}}).sort((u,f)=>f.total-u.total)}function Qt({packet:t,pipeline:s,resolved:r,resolveTimeMs:o,advertName:a,neighbors:n,decrypted:l}){var de,ue;const c=Z(j=>j.neighborContext),m=Z(j=>j.topologyProfiles),u=Z(j=>j.config),{analysis:f}=s,p=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Te(t.src_hash):"",N=v?c.prefixIndex.get(v)??[]:[],g=v?m.get(v)??[]:[],$=f.pType??-1,_=$>=0?$.toString(16).toUpperCase().padStart(2,"0"):"??",h=f.inferredType,y=f.advertType,x=f.effectiveType,w=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((de=l==null?void 0:l.decoded)==null?void 0:de.senderName)??null,T=Yt(t,p,c,H),L=S.useMemo(()=>Zt(t,v),[t,v]),M=f.pathLen,P=S.useMemo(()=>Xt(N,n,g,x,L,u.recencyDecayHours,u.zeroHopDecayHours),[N,n,g,x,L,u.recencyDecayHours,u.zeroHopDecayHours]),F=P.filter(j=>!j.roleCompatible),D=P.filter(j=>j.roleCompatible),b=t._advertSender?c.pubKeyMap.get(t._advertSender)??null:null,k=T.tier===1,ce=[{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:w?`0x${w}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:M!=null?M===0?"zero-hop":String(M):"",active:M!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!b,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!b,color:"zinc"}],Me=[{label:"payload",detail:`inferDeviceType(0x${_}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:w?`mapAdvertTypeCode(0x${w}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:x==="unknown",color:"zinc"}],Pe=p.name??((ue=p.hash)==null?void 0:ue.slice(0,12))??"?",Ae=p.confident?"confident":"ambiguous",Fe=`→ ${Pe} (${Ae}, Tier ${T.tier})`;return e.jsx(oe,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Fe,timeMs:o,children:e.jsx(V,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(Lt,{tokens:ce,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(C,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(le,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:b?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:b,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),p.name&&a===p.name&&e.jsx(C,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(A,{color:"green",children:"Tier 1"}),e.jsx(C,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(C,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(C,{children:"no _advertSender — skip to prefix resolution"})})})]}),k?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(C,{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(A,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(C,{children:j.name})]},j.hash)),N.length===0&&e.jsx(C,{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(C,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(le,{options:Me,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:x,color:x!=="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(C,{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(A,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(C,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),F.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[F.length," eliminated, ",D.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(C,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),D.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):D.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(C,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:D[0].hash}),D[0].name&&e.jsx(C,{c:"text-fg-muted ml-1",children:D[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(q,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[D.length," candidates scored…"]})}),e.jsx(U,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:D.map(j=>{const J=j.hash===p.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(C,{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(A,{color:J?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(C,{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(C,{children:"zero_hop:"})," ",e.jsx(C,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(A,{color:te(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"recency:"})," ",e.jsx(C,{c:"text-fg-primary",children:bt(j.lastSeen)})," ",e.jsxs(A,{color:te(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"gps:"})," ",e.jsx(C,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(A,{color:te(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"adverts:"})," ",e.jsx(C,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(A,{color:te(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"topo:"})," ",e.jsx(C,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(A,{color:te(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(C,{children:"score ≈"})," ",e.jsx(C,{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(C,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:p.hash?e.jsx(d,{fn:"resolved.hash",value:p.hash,color:"green"}):e.jsx(C,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:p.type,color:p.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:p.name?e.jsx(d,{fn:"resolved.name",value:p.name,color:p.confident?"green":"amber"}):e.jsx(C,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(C,{c:p.confident?"text-sys-green":"text-sys-red",children:String(p.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(A,{color:T.tier<=2?"green":T.tier===3?"amber":"red",children:T.tier}),e.jsx(C,{c:"text-fg-primary ml-1",children:T.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(C,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),p.confident?e.jsxs(C,{c:"text-sys-green",children:["→ resolved via ",T.label]}):e.jsx(C,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:p.hash??"null",group:"resolution",color:p.confident?"green":"zinc"},{fn:"resolved.type",value:p.type,group:"resolution",color:p.type!=="unknown"?p.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:p.name??"null",group:"resolution",color:p.confident?"green":p.name?"amber":"zinc"},{fn:"resolved.confident",value:String(p.confident),group:"resolution",color:p.confident?"green":"red"}];return e.jsx(ne,{tokens:j})})()]})})})}const Jt={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},es={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},ts={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},ss={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},ns={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},rs={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},as={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},ls={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},X=[Jt,es,ts,ss,ns,rs,as,ls],os=new Map(X.map(t=>[t.id,t])),cs=new Map;for(const t of X)for(const s of t.emits)cs.set(s.fn,t);const De=new Map;for(const t of X)for(const s of t.outputs)De.set(s,t);function is(){const t=new Map,s=new Map;for(const a of X)t.has(a.id)||t.set(a.id,0),s.has(a.id)||s.set(a.id,new Set);for(const a of X)for(const n of a.inputs){const l=De.get(n);if(l&&l.id!==a.id){const c=s.get(l.id);c.has(a.id)||(c.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 o=[];for(;r.length>0;){const a=r.shift(),n=os.get(a);n&&o.push(n);for(const l of s.get(a)??[]){const c=(t.get(l)??1)-1;t.set(l,c),c===0&&r.push(l)}}for(const a of X)o.includes(a)||o.push(a);return o}const ds={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function us({stage:t,isActive:s,onClick:r}){const o=t.observatoryStage!=null?ds[t.observatoryStage]??"text-fg-muted":"text-fg-muted/40";return e.jsxs("button",{type:"button",onClick:r,className:` + */const wt=[["rect",{x:"14",y:"14",width:"4",height:"6",rx:"2",key:"p02svl"}],["rect",{x:"6",y:"4",width:"4",height:"6",rx:"2",key:"xm4xkj"}],["path",{d:"M6 20h4",key:"1i6q5t"}],["path",{d:"M14 10h4",key:"ru81e7"}],["path",{d:"M6 14h2v6",key:"16z9wg"}],["path",{d:"M14 4h2v6",key:"1idq9u"}]],Ct=Re("binary",wt);function St(t){const s=t.type??t.payload_type,r=t.duplicates??[],o=t.is_duplicate,a=r.length;let n=null,l=null;if(a>0){const m=[t.rssi,...r.map(f=>f.rssi).filter(f=>f!=null)],u=[t.snr,...r.map(f=>f.snr).filter(f=>f!=null)];m.length>1&&(n=[Math.min(...m),Math.max(...m)]),u.length>1&&(l=[Math.min(...u),Math.max(...u)])}const c=s===z.TRACE;return{isDuplicate:o,dupeCount:a,rssiRange:n,snrRange:l,hashIncludesPathLen:c}}function Tt(t,s,r){const o={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=_e(t.payload)),!a)return{...o,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,c=l(t),m=n.length>0?Math.min(...n.map(l)):c,u=t.payload?t.payload.slice(18):"",f=u.length>=2?u.slice(0,2).toUpperCase():null,p=[];if(p.push(`traceTag: ${a}`),p.push(`siblings: ${n.length} observation${n.length!==1?"s":""}`),t.packet_origin==="tx_local")return p.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:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f};const v=n.find(N=>N.packet_origin==="tx_local");if(v)return p.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:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f};if(p.push(`this observation: path_len=${c}, min across siblings: ${m}`),f){if(p.push(`first hop in target path: ${f}`),c===0)return p.push("path_len = 0 → heard directly from initiator (no SNR appended yet)"),p.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:[...p,"initiator is within direct RF range (zero forwarding hops)"],thisPathLen:c,minPathLen:m,firstHopPrefix:f};const g=Object.entries(r).filter(([$])=>$.replace(/^0x/i,"").slice(0,2).toUpperCase()===f);if(g.length===1){const[$,_]=g[0],h=_.name||_.node_name||null;return p.push(`first hop ${f} → unique neighbor: ${h??$}`),p.push("initiator is whoever sent TO this first hop"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"first_hop_neighbor",confidence:"likely",inferredSrc:f,inferredName:h,evidence:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f}}else g.length>1?p.push(`first hop ${f} matches ${g.length} neighbors (ambiguous)`):p.push(`first hop ${f} is not a known neighbor`)}return p.push("insufficient data to identify initiator"),{traceTag:a,siblingCount:n.length,isLocallyOriginated:!1,method:"none",confidence:"none",inferredSrc:null,inferredName:null,evidence:p,thisPathLen:c,minPathLen:m,firstHopPrefix:f}}let re=null,ie=null;typeof window<"u"&&setTimeout(()=>{pe(()=>import("./usePipelineStore-B9TPEPcv.js"),__vite__mapDeps([0,1,2,3])).then(t=>{re=t}),pe(()=>import("./index-CdntfUUz.js").then(t=>t.hG),__vite__mapDeps([1,3])).then(t=>{ie=t})},0);const $e={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 _t(t,s){const r=t.type??t.payload_type,o=we(r),a=Ie(t.route),n=r===z.ADVERT,l=r===z.TRACE,c=r===z.PATH,m=r===z.GRP_TXT||r===z.GRP_DATA,u=Ge(t.snr,t.rssi),f=(u==null?void 0:u.finalGrade)??"critical",p=qe(t.route),v=Ke(t.route),N=Ue(t.route),g=t.route==null?"unknown":p?"flood":v?"direct":"unknown",$=N?`transport-${g}`:g,_=!!s.advertSender;let h="none";_?h="pubkey":m?h="encrypted":t.src_hash&&(h="prefix");const y=yt(r),x=s.advertNodeType!=null?He(s.advertNodeType):"unknown",w=y!=="unknown"?y:x,H=t.packet_origin??"rx",T=Math.floor(Date.now()/1e3)-t.timestamp,L=T<10?"live":T<300?"recent":T<3600?"warm":T<86400?"stale":"historic",M=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,F=M??0,D=s.byteLength??(t.raw_packet?Math.floor(t.raw_packet.length/2):0),b=St(t);return{pType:r,payloadTypeName:o,routeTypeName:a,isAdvert:n,isTrace:l,isPath:c,isGrp:m,signalClass:f,routeClass:$,isFlood:p,isDirect:v,hasTransport:N,senderTier:h,hasPubkey:_,inferredType:y,advertType:x,effectiveType:w,origin:H,age:L,pathLen:M,pathAvail:P,pathHopCount:F,byteLen:D,dupeAnalysis:b}}function kt(t){var g,$,_,h,y,x;const s=jt(t);if(!s||s.pathHashes.length===0)return null;const{pathHashes:r,snrValues:o}=s;if(r.length<2||!re||!ie)return null;const a=re.usePipelineStore.getState().srcHashResolverMap,n=re.usePipelineStore.getState().neighborContext,l=(n==null?void 0:n.hashToName)??new Map,c=ie.useStore.getState().stats,m=(c==null?void 0:c.neighbors)??{},u=c==null?void 0:c.local_hash,f=($=(g=c==null?void 0:c.config)==null?void 0:g.repeater)==null?void 0:$.latitude,p=(h=(_=c==null?void 0:c.config)==null?void 0:_.repeater)==null?void 0:h.longitude,v=Object.keys(m).length>0?Ve([],m,u,f,p):null,N=[];for(let w=0;w0?[r[w-1].toUpperCase()]:[]],P=ge(H,w,M,a,v),F=[H,...w+20?N:null}function ge(t,s,r,o,a){if(s===0){const l=o==null?void 0:o.get(t);if(l)return{hash:l,confidence:.8};if(a){const c=xe(a,t,{position:s,adjacentPrefixes:r});if(c.hash)return{hash:c.hash,confidence:c.confidence}}}else{if(a){const c=xe(a,t,{position:s,adjacentPrefixes:r});if(c.hash)return{hash:c.hash,confidence:c.confidence}}const l=o==null?void 0:o.get(t);if(l)return{hash:l,confidence:.6}}return{hash:null,confidence:0}}function Ht(t){var l;const s=t.raw_packet;if(!s||s.length<2)return null;const r=s.replace(/\s/g,""),o=Math.floor(r.length/2),a=((l=r.match(/.{1,2}/g))==null?void 0:l.join(" "))??"";let n="";for(let c=0;c=32&&m<=126?String.fromCharCode(m):"·"}return{hexBytes:a,utf8:n,byteCount:o}}function $t(t){const s=new Map;let r=0,o="";for(const a of t){if((a.type??a.payload_type)!==z.TRACE)continue;r++,o=a.packet_hash;const l=a._traceTag??(a.payload?_e(a.payload):null);if(!l)continue;let c=s.get(l);c||(c=[],s.set(l,c)),c.push(a)}return{index:s,fingerprint:`${r}:${o}`}}function Dt(t,s,r){const o=S.useRef({parse:0,decode:0,enrich:0,traceIndex:0,total:0}),a=S.useMemo(()=>t?Ht(t):null,[t]),n=S.useMemo(()=>{if(!s||s.length<4)return o.current.parse=0,o.current.decode=0,null;const h=performance.now(),y=mt(s),x=performance.now()-h;return y?(o.current.parse=x,o.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}):(o.current.parse=x,o.current.decode=0,{protocolPacket:null,display:null,decoded:null,error:"Packet.fromHex() returned failure"})},[s]),l=S.useMemo(()=>{if(!t)return o.current.enrich=0,$e;const h=performance.now();if(t._advertSender!==void 0)return o.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,x=Ee(s,y),w=Oe(s,y),H=ze(s,t),T=Be(t);return o.current.enrich=performance.now()-h,{...x,channelHash:w,byteLength:H,...T,preComputed:!1}},[t,s]),c=S.useRef({fingerprint:"",index:new Map}),m=S.useMemo(()=>{const h=performance.now(),{index:y,fingerprint:x}=$t(r);return o.current.traceIndex=performance.now()-h,x===c.current.fingerprint?c.current.index:(c.current={fingerprint:x,index:y},y)},[r]),u=S.useMemo(()=>{const h=o.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,m]);if(!t)return null;const f=s?n?n.error:"rawHex too short":"No raw_packet (warm-tier)",p=(n==null?void 0:n.protocolPacket)??null,v=p?p.payloadVersion:null,N=v===0,g=v===1,$=_t(t,l);let _=null;return $.isTrace&&(_=kt(t)),{wire:a,display:(n==null?void 0:n.display)??null,parseError:f,protocolPacket:p,decoded:(n==null?void 0:n.decoded)??null,payloadVersion:v,isV1:N,isV2:g,enrichment:l,traceTagIndex:m,analysis:$,traceHopDetail:_,timing:u}}function le({options:t,nextFn:s}){var n;const r=t.find(l=>l.active),o=(r==null?void 0:r.color)??"green",a=((n=G[o])==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,c)=>{const m=G[l.color??"green"]??G.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?m.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?m.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})]},c)}),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 Lt({tokens:t,nextFn:s}){var n;const r=t.find(l=>l.active),o=(r==null?void 0:r.color)??"green",a=((n=G[o])==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,c)=>{const m=G[l.color??"green"]??G.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?m.row:"opacity-25"}`,children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${l.active?m.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??"",")"]})]},c)}),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 Mt={0:"border-l-sys-green",1:"border-l-sys-blue",2:"border-l-sys-teal",3:"border-l-sys-purple"};function oe({stage:t,name:s,fn:r,verdict:o,timeMs:a,skipped:n,skipReason:l,children:c}){const m=Mt[t]??"";return e.jsx(e.Fragment,{children:e.jsx(q,{defaultOpen:!n,children:e.jsxs("div",{className:`surface-base rounded-lg border border-edge-subtle overflow-hidden border-l-2 ${m}`,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&&!o&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted truncate hidden sm:inline",children:r}),o&&e.jsx("span",{className:"font-mono text-[11px] text-fg-muted/70 truncate hidden sm:inline",children:o})]}),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(U,{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"}):c})})]})})})}function Pt(t,s){return s?"manual":t._stripped?"bulk-tier":We.isConnected()?"ws-push":"rest-poll"}const At={connected:"green",degraded:"amber",offline:"red"};function Ft({packet:t,isSynthetic:s}){const r=he(f=>f.wsState),o=he(f=>f.health),a=Pt(t,s),l=!!t._stripped?"WARM":"HOT",c=[{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"}],m=[{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:o,group:"transport",color:At[o]}],u=s?"manual hex input":`${a} (${o})`;return e.jsx(oe,{stage:0,name:"TRANSPORT",fn:"websocketService / useStore.startPolling",verdict:u,children:s?e.jsx("p",{className:"text-fg-muted italic",children:"Manual hex input — no transport context"}):e.jsx(V,{prefix:"transport",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx(le,{options:c,nextFn:"ingest()"}),e.jsx(ne,{tokens:m})]})})})}function W({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 Rt={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 Et({rawHex:t,display:s,protocolPacket:r,parseError:o,parseTimeMs:a,payloadVersion:n,isV1:l,isV2:c}){return e.jsx("dl",{className:"space-y-0.5",children:s&&r&&t?e.jsxs(e.Fragment,{children:[e.jsx(O,{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(W,{start:0}),e.jsx(R,{value:t.slice(0,2)})," ",e.jsx(ft,{value:parseInt(t.slice(0,2),16)})]}),s.headerFields.map(m=>e.jsx(i,{label:` ${m.field}`,children:e.jsx(E,{raw:e.jsxs("span",{className:"text-[10px]",children:["bits[",m.bits,"] = ",m.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:m.value})})},m.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(A,{color:l?"green":c?"blue":"zinc",children:l?"v1":c?"v2":`v${n}`}),l&&e.jsx("span",{className:"text-fg-muted text-[10px]",children:"1-byte hashes, 2-byte MAC"}),c&&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(O,{title:"Wire Framing"}),e.jsx(i,{label:"transportCodes",children:s.transportCodesHex?e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(W,{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(E,{raw:e.jsxs(e.Fragment,{children:[e.jsx(W,{start:s.pathLenByteOffset}),e.jsx(R,{value:s.pathLengthHex})]}),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx(W,{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(W,{start:s.pathByteOffset,end:s.pathByteOffset+r.pathLen-1}),e.jsx(ae,{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(W,{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(O,{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:o??"No raw_packet (warm-tier)"})]})]})})}function Ot({decoded:t,packet:s}){if(!t)return e.jsxs(e.Fragment,{children:[e.jsx(O,{title:"B. Decode"}),e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:"No decoded payload"})]});const r=Rt[t.type]??`decode${t.type}()`;return e.jsxs(e.Fragment,{children:[e.jsx(O,{title:"B. Decode — decodePayload()"}),e.jsx(V,{prefix:"decodePayload",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsx(i,{label:"dispatched",children:r}),e.jsx(O,{}),e.jsx(zt,{decoded:t,packet:s})]})})]})}function zt({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(E,{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(E,{raw:e.jsx(R,{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(E,{raw:e.jsx("span",{className:"text-[10px]",children:t.crc}),children:e.jsx(d,{fn:"crc",value:t.crc,color:"green"})})});case"trace":{const o=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(R,{value:t.flags})}),e.jsx(i,{label:"target path",children:t.pathHashes.length>0?e.jsx(ae,{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(O,{}),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 f,p,v,N,g;const l=((f=t.pathHashes[n])==null?void 0:f.toUpperCase())??"??",c=n===0?o??"SRC":((p=t.pathHashes[n-1])==null?void 0:p.toUpperCase())??"??",m=(g=(N=(v=Ze.getState().stats)==null?void 0:v.config)==null?void 0:N.radio)==null?void 0:g.spreading_factor,u=Ce(a,m);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:c}),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(A,{color:"green",children:u})]},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(ae,{hops:t.path.map(o=>o.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(E,{raw:e.jsx(R,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(E,{raw:e.jsx(R,{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(R,{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(R,{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(E,{raw:e.jsx(R,{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(A,{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(A,{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(E,{raw:e.jsx(R,{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(E,{raw:e.jsx(R,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(E,{raw:e.jsx(R,{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(E,{raw:e.jsx(R,{value:t.destHash}),children:e.jsx(d,{fn:"destHash",value:t.destHash,color:"green"})})}),e.jsx(i,{label:"srcHash",children:e.jsx(E,{raw:e.jsx(R,{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(E,{raw:e.jsx(R,{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(gt,{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 Bt({protocolPacket:t,packetHash:s}){const r=t==null?void 0:t.payloadType,o=r===Xe||r===Qe,a=S.useMemo(()=>{if(!o||!t)return null;const x=t.payload;return x.length<4?null:{channelHash:x[0],mac:x.slice(1,3),ciphertext:x.slice(3)}},[t,o]),[n,l]=S.useState("pending"),[c,m]=S.useState([]),[u,f]=S.useState(0);S.useEffect(()=>{if(!a){l(null);return}let x=!1;return(async()=>{const H=performance.now(),T=await Je(a.channelHash,a.mac,a.ciphertext);x||(l(T),f(performance.now()-H));const L=await et(a.channelHash);x||m(L)})(),()=>{x=!0}},[a]);const[p,v]=S.useState(""),[N,g]=S.useState(null),[$,_]=S.useState(!1),h=S.useCallback(async()=>{if(!(!a||!p.trim())){_(!0);try{const x=await Ye(p.trim(),a.channelHash,a.mac,a.ciphertext);if(x.success){const w=new TextDecoder("utf-8",{fatal:!1}).decode(x.result.plaintext.slice(5));g({success:!0,text:w})}else g({success:!1,error:x.error})}catch(x){g({success:!1,error:String(x)})}finally{_(!1)}}},[a,p]),y=Se(s);return!o||!a?null:e.jsxs(e.Fragment,{children:[e.jsx(O,{title:"C. Decrypt — tryDecryptGroupMessage()"}),u>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:u<1?`${(u*1e3).toFixed(0)}µs`:`${u.toFixed(2)}ms`})}),e.jsx(V,{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(x=>x.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:c.length>0?`${c.length} names`:"0",color:c.length>0?"teal":"zinc"})}),c.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:c.join(", ")})]}),e.jsx(O,{}),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(O,{}),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:p,onChange:x=>{v(x.target.value),g(null)},onKeyDown:x=>x.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:$||!p.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:$?"…":"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(O,{}),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 It(t){const{rawHex:s,display:r,protocolPacket:o,decoded:a,parseError:n,parseTimeMs:l,payloadVersion:c,isV1:m,isV2:u,packetHash:f,packet:p}=t,v=!!s&&s.length>=4;return e.jsxs(q,{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(U,{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(Et,{rawHex:s,display:r,protocolPacket:o,parseError:n,parseTimeMs:l,payloadVersion:c,isV1:m,isV2:u}),e.jsx(Ot,{decoded:a,packet:p}),e.jsx(Bt,{protocolPacket:o,packetHash:f})]}):e.jsx("p",{className:"text-fg-muted italic text-[10px]",children:n??"No raw_packet — wire inspection unavailable (warm-tier packet)"})]})})]})}function be(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 Gt({packet:t,pipeline:s,rawHex:r,traceTagIndex:o,neighbors:a}){const{enrichment:n,timing:l,display:c,protocolPacket:m,decoded:u,parseError:f,payloadVersion:p,isV1:v,isV2:N,analysis:g}=s,_=(t.type??t.payload_type)===tt,h=g.dupeAnalysis,y=S.useRef(0),x=S.useMemo(()=>{if(!_)return null;const L=performance.now(),M=Tt(t,o,a);return y.current=performance.now()-L,M},[t,o,a,_]),w=l.enrich+y.current,H=[];g.byteLen&&H.push(`${g.byteLen}B`),H.push(g.payloadTypeName),n.advertName&&H.push(`"${n.advertName}"`),n.isZeroHop?H.push("zero-hop"):g.pathHopCount>0&&H.push(`${g.pathHopCount}h`),H.push(`${t.rssi}dBm`),h.isDuplicate&&H.push("DUPE");const T=H.join(" — ");return e.jsxs(oe,{stage:1,name:"INGEST",fn:n.preComputed?"PacketCache.mergePackets()":"extractAdvertData() + extractHopData() + ...",verdict:T,timeMs:w,children:[e.jsx(It,{rawHex:r,display:c,protocolPacket:m,decoded:u,parseError:f,parseTimeMs:l.parse,payloadVersion:p,isV1:v,isV2:N,packetHash:t.packet_hash,packet:t}),e.jsx(O,{title:"Cache Enrichment"}),e.jsx(V,{prefix:"packetCache",children:e.jsxs("dl",{className:"space-y-0.5",children:[e.jsxs("div",{className:"mb-1.5",children:[n.preComputed?e.jsx(A,{color:"green",children:"PacketCache"}):e.jsx(A,{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(A,{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:He(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(O,{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 ${u?"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:u?e.jsx("div",{className:"flex flex-wrap gap-x-1.5 gap-y-1",children:be(u).map((L,M)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:L.fn,value:L.value,color:L.color})},M))}):e.jsx(C,{children:"no raw_packet — warm-tier packet, decode unavailable"})})]}),e.jsx(O,{}),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(C,{children:"none"}),h.dupeCount>0&&e.jsx(d,{fn:"dupeCount",value:`×${h.dupeCount}`,color:"purple"}),h.rssiRange&&e.jsxs(C,{c:"text-fg-primary",children:["Δ",Math.abs(h.rssiRange[1]-h.rssiRange[0]),"dB RSSI"]})]}),x&&e.jsxs(e.Fragment,{children:[e.jsx(O,{}),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:"}),x.inferredSrc?e.jsxs(e.Fragment,{children:[e.jsx(d,{fn:"inferredSrc",value:x.inferredSrc,color:"purple"}),x.inferredName&&e.jsx(d,{fn:"name",value:x.inferredName,color:"purple"})]}):e.jsx(C,{children:"unresolvable"}),e.jsx(ke,{color:"purple",children:x.method}),e.jsxs(C,{children:["(",x.confidence,")"]}),e.jsxs(C,{children:["siblings=",x.siblingCount]})]})]}),(()=>{const L=g.pType!=null?`0x${g.pType.toString(16).toUpperCase().padStart(2,"0")}`:void 0,M=t.route!=null?`0x${t.route.toString(16).toUpperCase().padStart(2,"0")}`:void 0,P=be(u),F=g.signalClass==="excellent"||g.signalClass==="good"?"green":g.signalClass==="fair"?"amber":"red",D=g.senderTier==="pubkey"?"green":g.senderTier==="prefix"?"amber":g.senderTier==="encrypted"?"teal":"zinc",b=[{fn:"type",value:g.payloadTypeName,raw:L,group:"wire",color:"blue"},{fn:"route",value:g.routeTypeName,raw:M,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:g.byteLen?`${g.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:g.advertType!=="unknown"?g.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"},x!=null&&x.inferredSrc?{fn:"traceSrc",value:x.inferredSrc,group:"analysis",color:"purple"}:{fn:"traceSrc"},{fn:"_signalClass",value:g.signalClass,group:"analysis",color:F},{fn:"_routeClass",value:g.routeClass,group:"analysis",color:"purple"},{fn:"_senderTier",value:g.senderTier,group:"analysis",color:D},{fn:"_origin",value:g.origin,group:"analysis",color:g.origin==="tx_local"?"green":g.origin==="tx_forward"?"amber":"purple"},{fn:"_pathAvail",value:g.pathAvail?`${g.pathHopCount} hops`:"none",group:"analysis",color:g.pathAvail?"green":"zinc"},{fn:"_age",value:g.age,group:"analysis",color:g.age==="live"||g.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(ne,{tokens:b})})()]})})]})}function ye(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 je(t){return`${Math.round(t*100)}%`}function ve(t,s,r){return t||(s?s.slice(0,12):`~${r}`)}function qt({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(V,{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(ae,{hops:[s.fromPrefix,s.toPrefix],color:"blue"}),e.jsx("span",{className:"ml-1.5",children:e.jsx(ke,{color:ye(s.quality),children:s.quality})})]}),e.jsx(i,{label:"snr",children:e.jsx(E,{raw:e.jsx("span",{className:"text-sys-blue",children:s.snrRaw}),children:e.jsx(d,{fn:"snr",value:`${s.snrRaw.toFixed(1)} dB`,color:ye(s.quality)})})}),e.jsxs(i,{label:"from",children:[e.jsx(d,{fn:"resolve",value:ve(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:je(s.fromConfidence),color:"zinc"})})]}),e.jsxs(i,{label:"to",children:[e.jsx(d,{fn:"resolve",value:ve(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:je(s.toConfidence),color:"zinc"})})]})]})},s.hopIndex))}),e.jsx(ne,{label:"trace contributes",tokens:Kt(t)})]})}function Kt(t){const s=t.reduce((n,l)=>n+(l.fromHash?1:0)+(l.toHash?1:0),0),r=t.length*2,o=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"},...o>0?[{fn:"ghosts",value:String(o),group:"worker",color:"purple"}]:[],{fn:"avgSnr",value:`${a.toFixed(1)} dB`,group:"analysis",color:a>=5?"green":a>=0?"amber":"red"}]}function Ut(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 Vt(t,s){if(!t)return[];const r=t.decoded;if(!r)return[{fn:"decrypt.result",value:"failed",group:"crypto",color:"red"}];if(!r.decrypted)return[{fn:"decrypt.result",value:"no key match",group:"crypto",color:"zinc"}];const o=[];return r.channelName&&o.push({fn:"decrypt.channelName",value:r.channelName,group:"crypto",color:"teal"}),r.senderName&&o.push({fn:"decrypt.senderName",value:r.senderName,group:"crypto",color:"teal"}),r.text&&o.push({fn:"decrypt.text",value:r.text,group:"crypto",color:"teal"}),r.timestamp&&o.push({fn:"decrypt.timestamp",value:lt(new Date(r.timestamp*1e3),s,!0),group:"crypto",color:"teal"}),r.macCorrupted&&o.push({fn:"decrypt.macCorrupted",value:"true",group:"crypto",color:"amber"}),o}function Wt({packet:t,decrypted:s,pipeline:r}){var b;const o=st(),a=ee(k=>k.isComputing),n=ee(k=>k.lastUpdated),l=ee(k=>k.lastComputeTimeMs),c=ee(k=>k.topology.edges.length),m=ee(k=>k.topology.discoveredNodes.length),u=nt(),f=rt(),p=at(),v=me(k=>k.isComputing),N=me(k=>k.nodeCount),g=fe(k=>k.progress),$=fe(k=>k.initialDecodeComplete),_=t.type??t.payload_type,h=_===z.GRP_TXT||_===z.GRP_DATA,y=_===z.TRACE,x=_===z.PATH,w=h,H=[{label:"full",detail:"all GRP_TXT → decryption worker",active:w&&$,color:"teal"},{label:"quick",detail:"100 most recent (initial load)",active:w&&!$,color:"amber"},{label:"skip",detail:"non-GRP or catchup path",active:!w,color:"zinc"}],T=Vt(s,o),L=((b=s==null?void 0:s.decoded)==null?void 0:b.decrypted)===!0,M=a?"running":`${c}e ${m}g`,P=v?"running":`${N}n`,F=w?L?"decrypted":g.isDecoding?`${g.percent}%`:"pending":"N/A",D=`topo ${a?"○":"✓"} ${M} · spark ${v?"○":"✓"} ${P} · decrypt ${F}`;return e.jsx(oe,{stage:2,name:"CASCADE",fn:"hydrateDownstream()",verdict:D,children:e.jsx(V,{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 ${a?"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:[c,"e ",m,"g"]}),(y||x)&&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 ${v?"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:[N,"n"]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${g.isDecoding?"bg-sys-amber animate-pulse":w?"bg-sys-teal":"bg-zinc-500/40"}`}),e.jsx("span",{className:"text-fg-primary",children:"decrypt"}),e.jsx("span",{className:w?"text-sys-teal":"text-fg-muted",children:w?L?"decrypted":g.isDecoding?`${g.percent}%`:"pending":"N/A"})]})]}),e.jsxs(q,{defaultOpen:y||x,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(U,{children:e.jsxs("div",{className:"ml-3 pb-2",children:[e.jsx(i,{label:"status",children:e.jsx(d,{fn:"isComputing",value:a?"running":"idle",color:a?"amber":"green"})}),e.jsxs(i,{label:"last",children:[e.jsx(d,{fn:"lastUpdated",value:Ut(n),color:"zinc"}),l>0&&e.jsxs("span",{className:"ml-2 text-fg-muted text-[10px]",children:["(",l<1e3?`${l.toFixed(0)}ms`:`${(l/1e3).toFixed(1)}s`,")"]})]}),e.jsxs(i,{label:"output",children:[e.jsx(d,{fn:"edges",value:String(c),color:"green"}),e.jsx(d,{fn:"ghostNodes",value:String(m),color:"purple"})]}),f&&e.jsxs(e.Fragment,{children:[e.jsxs(i,{label:"trace links",children:[e.jsx(d,{fn:"directed",value:String(u.totalDirectedLinks),color:"teal"}),e.jsx(d,{fn:"bidir",value:String(u.bidirectionalLinks),color:"teal"}),e.jsx(d,{fn:"traces",value:String(u.totalTraces),color:"zinc"})]}),e.jsxs(i,{label:"trace SNR",children:[e.jsx(d,{fn:"mean",value:`${u.meanSnr.toFixed(1)} dB`,color:u.meanSnr>=5?"green":u.meanSnr>=0?"amber":"red"}),e.jsx(d,{fn:"median",value:`${u.medianSnr.toFixed(1)} dB`,color:"zinc"}),e.jsx(d,{fn:"confidence",value:`${Math.round(u.avgConfidence*100)}%`,color:"zinc"})]}),y&&e.jsxs(i,{label:"quality",children:[e.jsx(d,{fn:"excellent",value:String(u.qualityCounts.excellent),color:"green"}),e.jsx(d,{fn:"good",value:String(u.qualityCounts.good),color:"green"}),e.jsx(d,{fn:"fair",value:String(u.qualityCounts.fair),color:"amber"}),e.jsx(d,{fn:"poor",value:String(u.qualityCounts.poor),color:"red"}),e.jsx(d,{fn:"critical",value:String(u.qualityCounts.critical),color:"red"})]}),p.confirmedResolutions.size>0&&e.jsxs(i,{label:"feedback",children:[e.jsx(d,{fn:"feedback.confirmed",value:String(p.confirmedResolutions.size),color:"teal"}),e.jsx(d,{fn:"feedback.links",value:String(p.confirmedLinks.length),color:"teal"})]})]}),y&&(r==null?void 0:r.traceHopDetail)&&e.jsx(qt,{hops:r.traceHopDetail})]})})]}),w&&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(le,{options:H,nextFn:"queueDecryption()"})}),e.jsx(i,{label:"result",children:e.jsx(d,{fn:"decrypt",value:L?"decrypted":s?"failed":"pending",color:L?"teal":s?"red":"zinc"})}),L&&e.jsx("div",{className:"mt-1 flex flex-wrap gap-x-1.5 gap-y-1",children:T.map((k,ce)=>e.jsx("span",{className:"inline-block border border-edge-subtle rounded px-1.5 py-0.5",children:e.jsx(d,{fn:k.fn,value:k.value,color:k.color})},ce))})]})}),(()=>{const k=[{fn:"topology.edges",value:String(c),group:"worker",color:"green"},{fn:"topology.ghostNodes",value:String(m),group:"worker",color:"purple"},{fn:"sparkline.nodes",value:`${N}`,group:"worker",color:"green"},...f?[{fn:"trace.directedLinks",value:String(u.totalDirectedLinks),group:"worker",color:"teal"},{fn:"trace.meanSnr",value:`${u.meanSnr.toFixed(1)} dB`,group:"worker",color:"teal"}]:[],...T];return e.jsx(ne,{tokens:k})})()]})})})}function Yt(t,s,r,o){var n;const a=t.src_hash?Te(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(o&&s.confident&&((n=s.name)==null?void 0:n.toLowerCase())===o.toLowerCase())return{tier:1.5,label:"decrypt.senderName → nameToHash",detail:`Decrypted sender name “${o}” 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 Zt(t,s){const r=t.original_path??t.forwarded_path,o=new Set;if(r&&Array.isArray(r))for(const a of r){const n=String(a).toUpperCase();n.length>=2&&!ot(n,s)&&o.add(n)}return o}function Xt(t,s,r,o,a,n,l){const c=Math.floor(Date.now()/1e3),m=new Map(r.map(u=>[u.hash,u]));return t.map(u=>{const f=s[u.hash],p=m.get(u.hash);let v=!0,N="";o!=="unknown"?u.type!=="unknown"&&u.type!==o?(v=!1,N=`${u.type} ≠ required ${o}`):u.type===o?N="type matches":N="type unknown — not ruled out":N="payload ambiguous — all types eligible";const g=!!(f!=null&&f.zero_hop),$=(f==null?void 0:f.last_seen)??0;let _=0;if(g&&$>0){const D=(c-$)/3600;_=50*Math.exp(-D/l)}let h=0;if($>0){const D=(c-$)/3600;h=Math.exp(-D/n)}const y=h*20,x=!!(f!=null&&f.latitude&&(f!=null&&f.longitude)&&(f.latitude!==0||f.longitude!==0)),w=x?5:0,H=(p==null?void 0:p.advertCount)??0,T=Math.min(H*2,30),L=(p==null?void 0:p.forwarderPrefixes.size)??0,M=Math.min(L*3,15);let P=0;if(p&&p.totalForwarderObservations>0&&a.size>0){let D=0;for(const b of a)p.forwarderPrefixes.has(b)&&D++;P=D/a.size}const F=_+y+w+T+M;return{hash:u.hash,name:u.name,type:u.type,roleCompatible:v,roleReason:N,zeroHop:g,zeroHopScore:_,lastSeen:$,recencyScore:h,recencyPoints:y,hasGps:x,gpsScore:w,advertCount:H,advertScore:T,topoWidth:L,topoScore:M,affinity:P,total:F}}).sort((u,f)=>f.total-u.total)}function Qt({packet:t,pipeline:s,resolved:r,resolveTimeMs:o,advertName:a,neighbors:n,decrypted:l}){var de,ue;const c=Z(j=>j.neighborContext),m=Z(j=>j.topologyProfiles),u=Z(j=>j.config),{analysis:f}=s,p=r??{hash:null,type:"unknown",name:null,confident:!1},v=t.src_hash?Te(t.src_hash):"",N=v?c.prefixIndex.get(v)??[]:[],g=v?m.get(v)??[]:[],$=f.pType??-1,_=$>=0?$.toString(16).toUpperCase().padStart(2,"0"):"??",h=f.inferredType,y=f.advertType,x=f.effectiveType,w=t._advertNodeType!=null?t._advertNodeType.toString(16).padStart(2,"0").toUpperCase():"",H=((de=l==null?void 0:l.decoded)==null?void 0:de.senderName)??null,T=Yt(t,p,c,H),L=S.useMemo(()=>Zt(t,v),[t,v]),M=f.pathLen,P=S.useMemo(()=>Xt(N,n,g,x,L,u.recencyDecayHours,u.zeroHopDecayHours),[N,n,g,x,L,u.recencyDecayHours,u.zeroHopDecayHours]),F=P.filter(j=>!j.roleCompatible),D=P.filter(j=>j.roleCompatible),b=t._advertSender?c.pubKeyMap.get(t._advertSender)??null:null,k=T.tier===1,ce=[{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:w?`0x${w}`:"",active:t._advertNodeType!=null,color:"blue"},{fn:"path_length",value:M!=null?M===0?"zero-hop":String(M):"",active:M!=null,color:"blue"},{fn:"decrypt.senderName",value:H??"",active:!!H,color:"teal"}],Le=[{label:"hit",detail:"pubKeyMap.get(_advertSender) → definitive",active:!!b,color:"green"},{label:"miss",detail:t._advertSender?"pubkey not in neighbor table":"no _advertSender",active:!b,color:"zinc"}],Me=[{label:"payload",detail:`inferDeviceType(0x${_}) → ${h}`,active:h!=="unknown",color:"amber"},{label:"flags",detail:w?`mapAdvertTypeCode(0x${w}) → ${y}`:"no _advertNodeType",active:h==="unknown"&&y!=="unknown",color:"green"},{label:"ambiguous",detail:"all types eligible",active:x==="unknown",color:"zinc"}],Pe=p.name??((ue=p.hash)==null?void 0:ue.slice(0,12))??"?",Ae=p.confident?"confident":"ambiguous",Fe=`→ ${Pe} (${Ae}, Tier ${T.tier})`;return e.jsx(oe,{stage:3,name:"RESOLVE",fn:"usePipelineStore.resolveSource()",verdict:Fe,timeMs:o,children:e.jsx(V,{prefix:"resolvePacketSource",children:e.jsxs("div",{className:"space-y-0",children:[e.jsx("div",{className:"pt-1 pb-1",children:e.jsx(Lt,{tokens:ce,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(C,{c:"text-sys-blue font-bold",children:"1"})," ","PUBKEY LOOKUP"]}),e.jsx(le,{options:Le,nextFn:"pubKeyMap.get()"}),e.jsx("div",{className:"ml-3 mt-1",children:b?e.jsxs(e.Fragment,{children:[e.jsx(i,{label:"resolved",children:e.jsx(d,{fn:"hash",value:b,color:"green"})}),a&&e.jsxs(i,{label:"name",children:[e.jsx(d,{fn:"name",value:a,color:"green"}),p.name&&a===p.name&&e.jsx(C,{c:"text-sys-green ml-1",children:"✓ neighbor match"})]}),e.jsxs(i,{label:"result",children:[e.jsx(A,{color:"green",children:"Tier 1"}),e.jsx(C,{c:"text-fg-primary ml-1",children:"definitive — scoring bypassed"})]})]}):t._advertSender?e.jsx(i,{label:"status",children:e.jsx(C,{c:"text-sys-amber",children:"✗ pubkey not in neighbor table"})}):e.jsx(i,{label:"status",children:e.jsx(C,{children:"no _advertSender — skip to prefix resolution"})})})]}),k?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(C,{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(A,{color:"zinc",children:j.type||"unknown"}),j.name&&e.jsx(C,{children:j.name})]},j.hash)),N.length===0&&e.jsx(C,{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(C,{c:"text-sys-blue font-bold",children:"3"})," ","TYPE INFERENCE"]}),e.jsx(le,{options:Me,nextFn:"effectiveType()"}),e.jsx("div",{className:"ml-3 mt-1",children:e.jsx(i,{label:"effective",children:e.jsx(d,{fn:"effectiveType",value:x,color:x!=="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(C,{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(A,{color:j.roleCompatible?"zinc":"red",children:j.type||"unknown"}),e.jsx(C,{c:j.roleCompatible?"text-fg-muted":"text-sys-red",children:j.roleReason})]},j.hash))}),F.length>0&&e.jsxs("p",{className:"text-[10px] text-fg-muted mt-1 ml-3",children:[F.length," eliminated, ",D.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(C,{c:"text-sys-blue font-bold",children:"5"})," ","CANDIDATE SCORING"]}),D.length===0?e.jsx("p",{className:"text-fg-muted italic ml-3",children:"No surviving candidates"}):D.length===1?e.jsxs("div",{className:"ml-3 text-[11px]",children:[e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(C,{c:"text-sys-green",children:"→"}),e.jsx("span",{className:"break-all text-[10px]",children:D[0].hash}),D[0].name&&e.jsx(C,{c:"text-fg-muted ml-1",children:D[0].name})]}),e.jsx("p",{className:"text-fg-muted ml-4",children:"single survivor — scoring not needed"})]}):e.jsxs(q,{children:[e.jsx(K,{className:"text-[10px] ml-3",children:e.jsxs("span",{className:"font-mono text-fg-muted/50",children:[D.length," candidates scored…"]})}),e.jsx(U,{children:e.jsx("div",{className:"space-y-2 ml-3 mt-1",children:D.map(j=>{const J=j.hash===p.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(C,{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(A,{color:J?"green":"zinc",children:j.type||"unknown"}),j.name&&e.jsx(C,{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(C,{children:"zero_hop:"})," ",e.jsx(C,{c:j.zeroHop?"text-sys-green":"text-fg-muted",children:j.zeroHop?"✓":"✗"})," ",e.jsxs(A,{color:te(j.zeroHopScore),children:["+",j.zeroHopScore]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"recency:"})," ",e.jsx(C,{c:"text-fg-primary",children:bt(j.lastSeen)})," ",e.jsxs(A,{color:te(j.recencyPoints),children:["+",j.recencyPoints.toFixed(1)]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"gps:"})," ",e.jsx(C,{c:j.hasGps?"text-sys-green":"text-fg-muted",children:j.hasGps?"✓":"✗"})," ",e.jsxs(A,{color:te(j.gpsScore),children:["+",j.gpsScore]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"adverts:"})," ",e.jsx(C,{c:"text-fg-primary",children:j.advertCount})," ",e.jsxs(A,{color:te(j.advertScore),children:["+",j.advertScore]})]}),e.jsxs("span",{children:[e.jsx(C,{children:"topo:"})," ",e.jsx(C,{c:"text-fg-primary",children:j.topoWidth})," ",e.jsxs(A,{color:te(j.topoScore),children:["+",j.topoScore]})]})]}),e.jsxs("div",{className:"ml-4 mt-0.5",children:[e.jsx(C,{children:"score ≈"})," ",e.jsx(C,{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(C,{c:"text-sys-green font-bold",children:"✓"})," ","RESOLUTION"]}),e.jsxs("div",{className:"ml-3",children:[e.jsx(i,{label:"hash",children:p.hash?e.jsx(d,{fn:"resolved.hash",value:p.hash,color:"green"}):e.jsx(C,{children:"null"})}),e.jsx(i,{label:"type",children:e.jsx(d,{fn:"resolved.type",value:p.type,color:p.confident?"green":"zinc"})}),e.jsx(i,{label:"name",children:p.name?e.jsx(d,{fn:"resolved.name",value:p.name,color:p.confident?"green":"amber"}):e.jsx(C,{children:"null"})}),e.jsx(i,{label:"confident",children:e.jsx(C,{c:p.confident?"text-sys-green":"text-sys-red",children:String(p.confident)})}),e.jsxs(i,{label:"tier",children:[e.jsx(A,{color:T.tier<=2?"green":T.tier===3?"amber":"red",children:T.tier}),e.jsx(C,{c:"text-fg-primary ml-1",children:T.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(C,{c:"text-sys-amber",children:"⚠ no src_hash"}),H&&e.jsx(d,{fn:"decrypt.senderName",value:H,color:"teal"}),p.confident?e.jsxs(C,{c:"text-sys-green",children:["→ resolved via ",T.label]}):e.jsx(C,{c:"text-sys-red",children:"ambiguous"})]})}),(()=>{const j=[{fn:"resolved.hash",value:p.hash??"null",group:"resolution",color:p.confident?"green":"zinc"},{fn:"resolved.type",value:p.type,group:"resolution",color:p.type!=="unknown"?p.confident?"green":"amber":"zinc"},{fn:"resolved.name",value:p.name??"null",group:"resolution",color:p.confident?"green":p.name?"amber":"zinc"},{fn:"resolved.confident",value:String(p.confident),group:"resolution",color:p.confident?"green":"red"}];return e.jsx(ne,{tokens:j})})()]})})})}const Jt={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},es={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},ts={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},ss={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},ns={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},rs={id:"sparkline",label:"Sparkline Computation",inputs:["packets","neighbors"],outputs:["sparklineData"],emits:[{fn:"sparklines",group:"worker",color:"blue"}],async:!1},as={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},ls={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},X=[Jt,es,ts,ss,ns,rs,as,ls],os=new Map(X.map(t=>[t.id,t])),cs=new Map;for(const t of X)for(const s of t.emits)cs.set(s.fn,t);const De=new Map;for(const t of X)for(const s of t.outputs)De.set(s,t);function is(){const t=new Map,s=new Map;for(const a of X)t.has(a.id)||t.set(a.id,0),s.has(a.id)||s.set(a.id,new Set);for(const a of X)for(const n of a.inputs){const l=De.get(n);if(l&&l.id!==a.id){const c=s.get(l.id);c.has(a.id)||(c.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 o=[];for(;r.length>0;){const a=r.shift(),n=os.get(a);n&&o.push(n);for(const l of s.get(a)??[]){const c=(t.get(l)??1)-1;t.set(l,c),c===0&&r.push(l)}}for(const a of X)o.includes(a)||o.push(a);return o}const ds={0:"text-sys-green",1:"text-sys-blue",2:"text-sys-teal",3:"text-sys-purple"};function us({stage:t,isActive:s,onClick:r}){const o=t.observatoryStage!=null?ds[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 ${o}`,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=G[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 ps({activeStageId:t,onStageClick:s}){const r=S.useMemo(()=>is(),[]),o=S.useMemo(()=>{const a=new Map;for(const l of r){const c=l.observatoryStage??"other";let m=a.get(c);m||(m=[],a.set(c,m)),m.push(l)}const n=[];for(const l of[0,1,2,3,"other"]){const c=a.get(l);c!=null&&c.length&&n.push({key:l,stages:c})}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:o.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(us,{stage:l,isActive:t===l.id,onClick:s?()=>s(l.id):void 0},l.id))]},String(a.key)))})]})}const Ne=200,B={status:"idle",lastDurationMs:null,lastTs:null,runCount:0};function xs(t,s,r){var o,a,n;switch(t.type){case"transport:ws:state":s.wsState=((o=t.data)==null?void 0:o.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],c=s.workers??r.workers,m=c[l]??{...B};s.workers={...c,[l]:{...m,status:"running",lastTs:t.ts}}}break;case"worker:topology:done":case"worker:sparkline:done":{const l=t.type.split(":")[1],c=s.workers??r.workers,m=c[l]??{...B},u=((a=t.data)==null?void 0:a.ms)??null;s.workers={...c,[l]:{...m,status:"done",lastDurationMs:u,lastTs:t.ts,runCount:m.runCount+1}}}break;case"worker:decryption:batch":{const l=s.workers??r.workers,c=l.decryption??{...B},m=((n=t.data)==null?void 0:n.ms)??null;s.workers={...l,decryption:{...c,status:"done",lastDurationMs:m,lastTs:t.ts,runCount:c.runCount+1}}}break;case"pipeline:disambig:recompute":s.disambigCount=(s.disambigCount??r.disambigCount)+1;break}}const se=ct(t=>({events:[],eventCount:0,wsState:"disconnected",wsPacketCount:0,wsStatsCount:0,restStatsCount:0,restPacketsCount:0,workers:{topology:{...B},sparkline:{...B},decryption:{...B}},wsMergeCount:0,lastHydrateTs:null,hydrateCount:0,disambigCount:0,lastDisambigMs:null,_pushBatch:s=>t(r=>{if(s.length===0)return r;let o=[...r.events,...s];o.length>Ne&&(o=o.slice(o.length-Ne));const a={events:o,eventCount:r.eventCount+s.length};for(const n of s)xs(n,a,r);return a}),clear:()=>t({events:[],eventCount:0,wsState:"disconnected",wsPacketCount:0,wsStatsCount:0,restStatsCount:0,restPacketsCount:0,workers:{topology:{...B},sparkline:{...B},decryption:{...B}},wsMergeCount:0,lastHydrateTs:null,hydrateCount:0,disambigCount:0,lastDisambigMs:null})}));let Y=null,I=[],Q=null;function hs(){if(Q=null,I.length===0)return;const t=I;I=[],se.getState()._pushBatch(t)}function ms(){Y||(I=[],Y=it.subscribe(t=>{I.push(t),Q===null&&(Q=requestAnimationFrame(hs))}))}function fs(){if(Y==null||Y(),Y=null,Q!==null&&(cancelAnimationFrame(Q),Q=null),I.length>0){const t=I;I=[],se.getState()._pushBatch(t)}}function gs(t){switch(t){case"active":return"●";case"skipped":return"○";case"inferred":return"◌"}}function bs(t){switch(t){case"active":return"text-sys-green";case"skipped":return"text-fg-muted/30";case"inferred":return"text-sys-amber"}}function ys(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 js(t,s,r,o,a){var u,f;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 p=s.age==="live"||s.age==="recent";n.push({label:"Flash",detail:p?"flashReceived++ → sidebar blink":"Not newest — no flash",status:p?"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 ${((u=t.src_hash)==null?void 0:u.slice(0,4))??"??"}`,status:"active",lane:"worker"});const c=s.isGrp;n.push({label:"Decryption Worker",detail:c?`GRP_TXT → queued for channel key search${o?" → decrypted ✓":""}`:`${s.payloadTypeName} — not encrypted, skipped`,status:c?"active":"skipped",lane:"worker"}),n.push({label:"Source Disambiguation",detail:r?`→ ${r.name??((f=r.hash)==null?void 0:f.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"}),c&&(o!=null&&o.decoded)&&n.push({label:"Decoded Content Policy",detail:`macCorrupted=${o.decoded.macCorrupted?"true":"false"} → cross-hash inheritance`,status:"active",lane:"pipeline"});const m=["Packets","Dashboard","Statistics"];return l&&m.push("Map","Graph"),s.isTrace&&m.push("Trace Detail"),n.push({label:"Page Hydration",detail:m.join(", "),status:"active",lane:"consumer"}),n}const vs=[],Ns=["transport","store","worker","pipeline","consumer"],ws={transport:"Transport",store:"Store",worker:"Workers",pipeline:"Pipeline",consumer:"Consumers"};function Cs(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 Ss(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 Ts=S.memo(function({event:s}){const r=`${(s.ts/1e3).toFixed(1)}s`,o=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 ${Ss(s.type)}`,children:Cs(s.type)}),e.jsx("span",{className:"text-fg-muted/60 truncate",children:o})]})});function _s({packet:t,pipeline:s,resolved:r,decrypted:o,isSynthetic:a,liveMode:n}){const[l,c]=S.useState(!1);S.useEffect(()=>{if(l)return ms(),()=>{fs()}},[l]);const m=s==null?void 0:s.analysis,u=S.useMemo(()=>!t||!m?null:js(t,m,r,o,a),[t,m,r,o,a]),f=S.useMemo(()=>{if(!u)return null;const h=new Map;for(const y of u){let x=h.get(y.lane);x||(x=[],h.set(y.lane,x)),x.push(y)}return h},[u]),p=se(h=>l?h.events:vs),v=se(h=>l?h.eventCount:0),N=se(h=>h.clear),g=S.useRef(null);S.useEffect(()=>{l&&g.current&&(g.current.scrollTop=g.current.scrollHeight)},[v,l]);const $=(u==null?void 0:u.filter(h=>h.status==="active").length)??0,_=(u==null?void 0:u.length)??0;return e.jsxs(q,{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:["— ",$,"/",_," stages active"]})]})}),e.jsx(U,{children:e.jsxs("div",{className:"surface-base rounded-lg border border-edge-subtle p-3 space-y-3",children:[t?f?e.jsx("div",{className:"space-y-2",children:Ns.map(h=>{const y=f.get(h);return y?e.jsxs("div",{children:[e.jsx("div",{className:`text-[8px] uppercase tracking-widest font-mono mb-0.5 ${ys(h)}`,children:ws[h]}),y.map((x,w)=>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 ${bs(x.status)}`,children:gs(x.status)}),e.jsx("span",{className:"text-fg-primary",children:x.label}),e.jsx("span",{className:"text-fg-muted/50 truncate",children:x.detail})]},w))]},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:()=>c(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:g,className:"max-h-32 overflow-y-auto space-y-px",children:p.length===0?e.jsx("div",{className:"text-[9px] text-fg-muted/30 font-mono py-1 text-center",children:"Waiting for events…"}):p.map((h,y)=>e.jsx(Ts,{event:h},`${h.ts}-${y}`))})]})})]})}function ks(t){const s=we(t.type??t.payload_type??-1).padEnd(7),r=t.packet_hash.slice(0,8),o=(t.src_hash??"—").replace(/^0x/i,"").slice(0,4).toUpperCase(),a=t._hopCount!=null?`${t._hopCount}h`:"",n=ht(t.timestamp);return`${r} ${s} ←${o} ${t.rssi}dBm ${a} ${n}`}function Fs(){const t=dt(),s=ut(),r=pt(),o=(s==null?void 0:s.neighbors)??{},a=Z(b=>b.resolveSource),n=Z(b=>b.config),l=Z(b=>b.setConfig),[c,m]=S.useState(-1),u=S.useMemo(()=>{let b=t;return c!==-1&&(b=t.filter(k=>(k.type??k.payload_type)===c)),b.slice(-50).reverse()},[t,c]),[f,p]=S.useState(""),[v,N]=S.useState(""),[g,$]=S.useState(!1),_=S.useRef(r);S.useEffect(()=>{const b=requestAnimationFrame(()=>{g&&r!==_.current&&u.length>0&&(p(u[0].packet_hash),N("")),_.current=r});return()=>cancelAnimationFrame(b)},[r,g,u]),S.useEffect(()=>{const b=requestAnimationFrame(()=>{!f&&u.length>0&&!v&&p(u[0].packet_hash)});return()=>cancelAnimationFrame(b)},[f,u,v]);const h=S.useMemo(()=>v.trim()?null:u.find(b=>b.packet_hash===f)??null,[f,u,v]),y=S.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]),x=h??y,w=!!v.trim(),H=v.trim().replace(/\s+/g,"")||(x==null?void 0:x.raw_packet),T=Dt(x,H,t),L=(T==null?void 0:T.enrichment)??$e,M=Se((x==null?void 0:x.packet_hash)??""),[P,F]=S.useState(0),D=S.useMemo(()=>x?a(x):null,[x,a]);return S.useEffect(()=>{const b=requestAnimationFrame(()=>{if(!x){F(0);return}const k=performance.now();a(x),F(performance.now()-k)});return()=>cancelAnimationFrame(b)},[x,a]),e.jsxs(vt,{className:"mx-auto max-w-[960px]",children:[e.jsx(Nt,{title:"Wire Inspector",icon:e.jsx(Ct,{}),subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Pipeline introspection — select a packet to trace its journey."})}),e.jsxs("div",{children:[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:c,onChange:b=>{m(Number(b.target.value)),p("")},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(xt).map(([b,k])=>e.jsxs("option",{value:Number(b),children:["0x",Number(b).toString(16).toUpperCase().padStart(2,"0")," ",k]},b))]}),e.jsxs("select",{value:f,onChange:b=>{p(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:[u.map((b,k)=>e.jsx("option",{value:b.packet_hash,children:ks(b)},`${b.packet_hash}-${k}`)),u.length===0&&e.jsxs("option",{value:"",children:["No packets",c!==-1?" matching filter":" loaded"]})]}),e.jsx("button",{onClick:()=>$(b=>!b),className:`px-2 py-1 rounded text-[11px] font-mono transition-colors shrink-0 ${g?"bg-sys-green/20 text-sys-green":"bg-zinc-500/20 text-fg-muted hover:text-fg-primary"}`,children:g?"● LIVE":"○ LIVE"})]}),e.jsxs(q,{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(U,{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(q,{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(U,{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(_s,{packet:x,pipeline:T,resolved:D,decrypted:M??null,isSynthetic:w,liveMode:g}),e.jsx(ps,{})]})]})})]}),x?e.jsxs("div",{className:"space-y-1",children:[e.jsx(Ft,{packet:x,isSynthetic:w}),e.jsx(Gt,{packet:x,pipeline:T,rawHex:H,traceTagIndex:(T==null?void 0:T.traceTagIndex)??new Map,neighbors:o}),e.jsx(Wt,{packet:x,decrypted:M??void 0,pipeline:T}),e.jsx(Qt,{packet:x,pipeline:T,resolved:D,decrypted:M??void 0,resolveTimeMs:P,neighbors:o,advertName:L.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{Fs as default}; diff --git a/frontend/dist/assets/Packets-Cs9Zwu9d.js b/frontend/dist/assets/Packets-DfuElOK2.js similarity index 95% rename from frontend/dist/assets/Packets-Cs9Zwu9d.js rename to frontend/dist/assets/Packets-DfuElOK2.js index 3ca42bc5..a7cf5f08 100644 --- a/frontend/dist/assets/Packets-Cs9Zwu9d.js +++ b/frontend/dist/assets/Packets-DfuElOK2.js @@ -1,4 +1,4 @@ -import{r as c,aV as _,aW as mt,aX as Re,aY as Je,aZ as bt,a_ as de,a$ as Qe,b0 as ft,b1 as vt,b2 as xt,b3 as he,b4 as gt,b5 as ht,b6 as we,b7 as q,b8 as yt,b9 as Me,ba as J,bb as ce,bc as Fe,bd as Pe,be as St,bf as Ze,bg as et,bh as ye,bi as Ie,bj as Se,bk as Ct,bl as Ot,bm as wt,bn as De,bo as Nt,bp as Et,bq as Oe,br as jt,bs as Pt,bt as It,bu as re,bv as kt,bw as X,bx as Tt,by as $t,bz as Rt,bA as Mt,bB as Ft,bC as Dt,bD as _t,bE as At,bF as Vt,bG as Lt,bH as zt,bI as _e,e as Bt,j as n,c as Z,aE as Ht,a7 as Ut,bJ as Gt,a8 as qt,bK as Kt,$ as Wt,ad as Yt,ah as Xt,bL as Jt,ai as Qt,az as Zt,aT as eo,aj as Ae,Q as Ve,bM as Le,bN as ze,B as Ee,f as Be,bO as He,ae as to}from"./index-CAHLMlrb.js";import{c as oo}from"./node-types-CcH5BFf0.js";import{u as so}from"./chevron-up-51iePx4b.js";import{u as no}from"./use-by-comparator-JYMD8MzS.js";import{F as ao,y as lo,R as io,T as ro,w as Ue,A as co}from"./floating-BAAXcOzg.js";import{c as G,p as uo,a as xe,f as Ge,b as po,L as mo,S as be,s as bo,g as fo,u as vo}from"./element-movement-SAlxPSM7.js";import{F as xo}from"./use-tree-walker-DIk49Ly7.js";import{u as qe,s as go}from"./frozen-TmAR4LIW.js";import{g as tt,u as ho,P as yo}from"./PacketList-ODK5IJ9o.js";import{useGetDecodedContent as So,useResolveSource as Co}from"./usePipelineStore-3uhIJZso.js";import{c as Oo,a as wo,D as No,b as Eo}from"./AnalyzerFilterPanel-BpsoGf4o.js";import{u as jo,r as Po}from"./consumer-registry-Bsx-B9R6.js";import{A as Io}from"./arrow-down-COuxy1kb.js";import{A as ko}from"./arrow-right-C5Fuejc9.js";import{P as To,a as $o,B as Ro,C as Ke}from"./PageLayout-CgrNSpBT.js";import{T as Mo}from"./TimeRangeStepper-BGzUi9Jn.js";import{M as Fo}from"./MqttModeBadge-OPtXzakb.js";import{F as We}from"./funnel-CmniI8cB.js";import{R as Do}from"./route-B8rlrav9.js";import{S as _o}from"./sparkles-GhffQ44V.js";import{S as Ao}from"./search-C1Hut7GR.js";import"./primitives-B7bSO4E3.js";import"./badge-colors-Dl76Mz8m.js";import"./chat-utils-rMBLw-SJ.js";import"./SignalIndicator-BN0oxyDe.js";import"./arrow-up-BmXPNI2T.js";import"./WorkspaceNav-ClxMgBhr.js";import"./payload-detail-CniY19rz.js";import"./map-pin-CNePTCsc.js";import"./circle-question-mark-BPKfem7i.js";import"./layers-CU7un-PT.js";import"./hash-Cs4BXjcy.js";import"./clock-DB7tKCHV.js";import"./activity-BAV-4Rxi.js";import"./database-BeT3SO6w.js";import"./useMapViewStore-Dq-l5Xvs.js";import"./index-1IIqkHes.js";import"./index-R7zviCWb.js";import"./shield-CxlpbCLH.js";import"./zap-BraNZRWh.js";import"./monitor-smartphone-DMj7GqcL.js";function ot(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return mt(e,"blur",t=>{let l=t.target;Re(l)&&(o.current={value:l.value,selectionStart:l.selectionStart,selectionEnd:l.selectionEnd})}),_(()=>{if(!Je(e)&&Re(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:l}=o.current;t!==null&&l!==null&&e.setSelectionRange(t,l)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}var Vo=Object.defineProperty,Lo=(e,o,t)=>o in e?Vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Ye=(e,o,t)=>(Lo(e,typeof o!="symbol"?o+"":o,t),t),y=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(y||{}),ee=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ee||{}),ne=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(ne||{}),st=(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))(st||{});function je(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,l=o(e.options.slice()),s=l.length>0&&l[0].dataRef.current.order!==null?l.sort((d,g)=>d.dataRef.current.order-g.dataRef.current.order):vt(l,d=>d.dataRef.current.domRef.current),i=t?s.indexOf(t):null;return i===-1&&(i=null),{options:s,activeOptionIndex:i}}let zo={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?xe.Tracked(po(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 l=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(l!==-1)return{...e,activeOptionIndex:l,comboboxState:0,__demoMode:!1,inputPositionState:xe.Idle}}return{...e,comboboxState:0,inputPositionState:xe.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,l,s,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((l=e.dataRef.current)!=null&&l.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:v,disabled:S}=e.virtual,w=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>v,resolveActiveIndex:()=>{var x,p;return(p=(x=e.activeOptionIndex)!=null?x:v.findIndex(E=>!S(E)))!=null?p:null},resolveDisabled:S,resolveId(){throw new Error("Function not implemented.")}}),C=(s=o.trigger)!=null?s:2;return e.activeOptionIndex===w&&e.activationTrigger===C?e:{...e,activeOptionIndex:w,activationTrigger:C,isTyping:!1,__demoMode:!1}}let d=je(e);if(d.activeOptionIndex===null){let v=d.options.findIndex(S=>!S.dataRef.current.disabled);v!==-1&&(d.activeOptionIndex=v)}let g=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>d.options,resolveActiveIndex:()=>d.activeOptionIndex,resolveId:v=>v.id,resolveDisabled:v=>v.dataRef.current.disabled}),u=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===g&&e.activationTrigger===u?e:{...e,...d,isTyping:!1,activeOptionIndex:g,activationTrigger:u,__demoMode:!1}},4:(e,o)=>{var t,l,s,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let d=o.payload,g=je(e,v=>(v.push(d),v));e.activeOptionIndex===null&&(s=(l=e.dataRef.current).isSelected)!=null&&s.call(l,o.payload.dataRef.current.value)&&(g.activeOptionIndex=g.options.indexOf(d));let u={...e,...g,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(u.activeOptionIndex=0),u},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(s=>s.id!==o.id)};let l=je(e,s=>{let i=s.findIndex(d=>d.id===o.id);return i!==-1&&s.splice(i,1),s});return{...e,...l,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,l;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 s=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?s=i:s=null}return{...e,activeOptionIndex:s,virtual:{options:o.options,disabled:(l=o.disabled)!=null?l:()=>!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:xe.Moved}}};class ke extends bt{constructor(o){super(o),Ye(this,"actions",{onChange:t=>{let{onChange:l,compare:s,mode:i,value:d}=this.state.dataRef.current;return de(i,{0:()=>l==null?void 0:l(t),1:()=>{let g=d.slice(),u=g.findIndex(v=>s(v,t));return u===-1?g.push(t):g.splice(u,1),l==null?void 0:l(g)}})},registerOption:(t,l)=>(this.send({type:4,payload:{id:t,dataRef:l}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(l.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,l)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:l})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,l;this.send({type:1}),this.send({type:6,value:!1}),(l=(t=this.state.dataRef.current).onClose)==null||l.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:l}=this.state.options[t];this.actions.onChange(l.current.value)}this.actions.goToOption({focus:G.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})}}),Ye(this,"selectors",{activeDescendantId:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(s=t.options.find(d=>!d.dataRef.current.disabled&&t.dataRef.current.compare(d.dataRef.current.value,t.virtual.options[i])))==null?void 0:s.id:(l=t.options[i])==null?void 0:l.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:s,disabled:i}=t.virtual,d=s.findIndex(g=>{var u;return!((u=i==null?void 0:i(g))!=null&&u)});if(d!==-1)return d}let l=t.options.findIndex(s=>!s.dataRef.current.disabled);if(l!==-1)return l}return t.activeOptionIndex},activeOption:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(s=(l=t.options[i])==null?void 0:l.dataRef.current.value)!=null?s:null},isActive:(t,l,s)=>{var i;let d=this.selectors.activeOptionIndex(t);return d===null?!1:t.virtual?d===t.dataRef.current.calculateIndex(l):((i=t.options[d])==null?void 0:i.id)===s},shouldScrollIntoView:(t,l,s)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,l,s)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,l=Qe.get(null);this.disposables.add(l.on(ft.Push,s=>{!l.selectors.isTop(s,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>l.actions.push(t)),this.on(1,()=>l.actions.pop(t))}this.disposables.group(t=>{this.on(1,l=>{l.inputElement&&(t.dispose(),t.add(uo(l.inputElement,l.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:l=!1}){var s;return new ke({id:o,dataRef:{current:{}},comboboxState:l?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(s=t.disabled)!=null?s:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:l,inputPositionState:xe.Idle})}reduce(o,t){return de(t.type,zo,o,t)}}const nt=c.createContext(null);function Ce(e){let o=c.useContext(nt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,at),t}return o}function at({id:e,virtual:o=null,__demoMode:t=!1}){let l=c.useMemo(()=>ke.new({id:e,virtual:o,__demoMode:t}),[]);return xt(()=>l.dispose()),l}let ge=c.createContext(null);ge.displayName="ComboboxDataContext";function ue(e){let o=c.useContext(ge);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ue),t}return o}let lt=c.createContext(null);function Bo(e){let o=Ce("VirtualProvider"),t=ue("VirtualProvider"),{options:l}=t.virtual,s=q(o,x=>x.optionsElement),[i,d]=c.useMemo(()=>{let x=s;if(!x)return[0,0];let p=window.getComputedStyle(x);return[parseFloat(p.paddingBlockStart||p.paddingTop),parseFloat(p.paddingBlockEnd||p.paddingBottom)]},[s]),g=so({enabled:l.length!==0,scrollPaddingStart:i,scrollPaddingEnd:d,count:l.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[u,v]=c.useState(0);re(()=>{v(x=>x+1)},[l]);let S=g.getVirtualItems(),w=q(o,x=>x.activationTrigger===ne.Pointer),C=q(o,o.selectors.activeOptionIndex);return S.length===0?null:X.createElement(lt.Provider,{value:g},X.createElement("div",{style:{position:"relative",width:"100%",height:`${g.getTotalSize()}px`},ref:x=>{x&&(w||C!==null&&l.length>C&&g.scrollToIndex(C))}},S.map(x=>{var p;return X.createElement(c.Fragment,{key:x.key},X.cloneElement((p=e.children)==null?void 0:p.call(e,{...e.slot,option:l[x.index]}),{key:`${u}-${x.key}`,"data-index":x.index,"aria-setsize":l.length,"aria-posinset":x.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${x.start}px)`,overflowAnchor:"none"}}))})))}let Ho=c.Fragment;function Uo(e,o){let t=c.useId(),l=Ft(),{value:s,defaultValue:i,onChange:d,form:g,name:u,by:v,invalid:S=!1,disabled:w=l||!1,onClose:C,__demoMode:x=!1,multiple:p=!1,immediate:E=!1,virtual:k=null,nullable:m,...A}=e,b=Dt(i),[j=p?[]:void 0,M]=_t(s,d,b),N=at({id:t,virtual:k,__demoMode:x}),V=c.useRef({static:!1,hold:!1}),$=no(v),F=_(I=>k?v===null?k.options.indexOf(I):k.options.findIndex(ae=>$(ae,I)):N.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),K=c.useCallback(I=>de(H.mode,{[ee.Multi]:()=>j.some(ae=>$(ae,I)),[ee.Single]:()=>$(j,I)}),[j]),W=q(N,I=>I.virtual),O=_(()=>C==null?void 0:C()),H=c.useMemo(()=>({__demoMode:x,immediate:E,optionsPropsRef:V,value:j,defaultValue:b,disabled:w,invalid:S,mode:p?ee.Multi:ee.Single,virtual:k?W:null,onChange:M,isSelected:K,calculateIndex:F,compare:$,onClose:O}),[x,E,V,j,b,w,S,p,k,W,M,K,F,$,O]);re(()=>{var I;k&&N.send({type:st.UpdateVirtualConfiguration,options:k.options,disabled:(I=k.disabled)!=null?I:null})},[k,k==null?void 0:k.options,k==null?void 0:k.disabled]),re(()=>{N.state.dataRef.current=H},[H]);let[L,P,z,le]=q(N,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),se=Qe.get(null),te=q(se,c.useCallback(I=>se.selectors.isTop(I,t),[se,t]));At(te,[P,z,le],()=>N.actions.closeCombobox());let Q=q(N,N.selectors.activeOptionIndex),ie=q(N,N.selectors.activeOption),f=ye({open:L===y.Open,disabled:w,invalid:S,activeIndex:Q,activeOption:ie,value:j}),[Y,R]=Vt(),B=o===null?{}:{ref:o},T=c.useCallback(()=>{if(b!==void 0)return M==null?void 0:M(b)},[M,b]),U=Se();return X.createElement(R,{value:Y,props:{htmlFor:z==null?void 0:z.id},slot:{open:L===y.Open,disabled:w}},X.createElement(co,null,X.createElement(ge.Provider,{value:H},X.createElement(nt.Provider,{value:N},X.createElement(Lt,{value:de(L,{[y.Open]:Oe.Open,[y.Closed]:Oe.Closed})},u!=null&&X.createElement(zt,{disabled:w,data:j!=null?{[u]:j}:{},form:g,onReset:T}),U({ourProps:B,theirProps:A,slot:f,defaultTag:Ho,name:"Combobox"}))))))}let Go="input";function qo(e,o){var t,l;let s=Ce("Combobox.Input"),i=ue("Combobox.Input"),d=c.useId(),g=ht(),{id:u=g||`headlessui-combobox-input-${d}`,onChange:v,displayValue:S,disabled:w=i.disabled||!1,autoFocus:C=!1,type:x="text",...p}=e,E=c.useRef(null),k=we(E,o,ao(),s.actions.setInputElement),[m,A]=q(s,f=>[f.comboboxState,f.isTyping]),b=yt(),j=_(()=>{s.actions.onChange(null),s.state.optionsElement&&(s.state.optionsElement.scrollTop=0),s.actions.goToOption({focus:G.Nothing})}),M=c.useMemo(()=>{var f;return typeof S=="function"&&i.value!==void 0?(f=S(i.value))!=null?f:"":typeof i.value=="string"?i.value:""},[i.value,S]);Me(([f,Y],[R,B])=>{if(s.state.isTyping)return;let T=E.current;T&&((B===y.Open&&Y===y.Closed||f!==R)&&(T.value=f),requestAnimationFrame(()=>{if(s.state.isTyping||!T||Je(T))return;let{selectionStart:U,selectionEnd:I}=T;Math.abs((I??0)-(U??0))===0&&U===0&&T.setSelectionRange(T.value.length,T.value.length)}))},[M,m,A]),Me(([f],[Y])=>{if(f===y.Open&&Y===y.Closed){if(s.state.isTyping)return;let R=E.current;if(!R)return;let B=R.value,{selectionStart:T,selectionEnd:U,selectionDirection:I}=R;R.value="",R.value=B,I!==null?R.setSelectionRange(T,U,I):R.setSelectionRange(T,U)}},[m]);let N=c.useRef(!1),V=_(()=>{N.current=!0}),$=_(()=>{b.nextFrame(()=>{N.current=!1})}),F=_(f=>{switch(s.actions.setIsTyping(!0),f.key){case J.Enter:if(s.state.comboboxState!==y.Open||N.current)return;if(f.preventDefault(),f.stopPropagation(),s.selectors.activeOptionIndex(s.state)===null){s.actions.closeCombobox();return}s.actions.selectActiveOption(),i.mode===ee.Single&&s.actions.closeCombobox();break;case J.ArrowDown:return f.preventDefault(),f.stopPropagation(),de(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Next}),[y.Closed]:()=>s.actions.openCombobox()});case J.ArrowUp:return f.preventDefault(),f.stopPropagation(),de(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Previous}),[y.Closed]:()=>{ce.flushSync(()=>s.actions.openCombobox()),i.value||s.actions.goToOption({focus:G.Last})}});case J.Home:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.PageUp:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.End:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.PageDown:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.Escape:return s.state.comboboxState!==y.Open?void 0:(f.preventDefault(),s.state.optionsElement&&!i.optionsPropsRef.current.static&&f.stopPropagation(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox());case J.Tab:if(s.actions.setIsTyping(!1),s.state.comboboxState!==y.Open)return;i.mode===ee.Single&&s.state.activationTrigger!==ne.Focus&&s.actions.selectActiveOption(),s.actions.closeCombobox();break}}),K=_(f=>{v==null||v(f),i.mode===ee.Single&&f.target.value===""&&j(),s.actions.openCombobox()}),W=_(f=>{var Y,R,B;let T=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);if(!((R=s.state.optionsElement)!=null&&R.contains(T))&&!((B=s.state.buttonElement)!=null&&B.contains(T))&&s.state.comboboxState===y.Open)return f.preventDefault(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox()}),O=_(f=>{var Y,R,B;let T=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);(R=s.state.buttonElement)!=null&&R.contains(T)||(B=s.state.optionsElement)!=null&&B.contains(T)||i.disabled||i.immediate&&s.state.comboboxState!==y.Open&&b.microTask(()=>{ce.flushSync(()=>s.actions.openCombobox()),s.actions.setActivationTrigger(ne.Focus)})}),H=Pe(),L=St(),{isFocused:P,focusProps:z}=Ze({autoFocus:C}),{isHovered:le,hoverProps:se}=et({isDisabled:w}),te=q(s,f=>f.optionsElement),Q=ye({open:m===y.Open,disabled:w,invalid:i.invalid,hover:le,focus:P,autofocus:C}),ie=Ie({ref:k,id:u,role:"combobox",type:x,"aria-controls":te==null?void 0:te.id,"aria-expanded":m===y.Open,"aria-activedescendant":q(s,s.selectors.activeDescendantId),"aria-labelledby":H,"aria-describedby":L,"aria-autocomplete":"list",defaultValue:(l=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?S==null?void 0:S(i.defaultValue):null)!=null?l:i.defaultValue,disabled:w||void 0,autoFocus:C,onCompositionStart:V,onCompositionEnd:$,onKeyDown:F,onChange:K,onFocus:O,onBlur:W},z,se);return Se()({ourProps:ie,theirProps:p,slot:Q,defaultTag:Go,name:"Combobox.Input"})}let Ko="button";function Wo(e,o){let t=Ce("Combobox.Button"),l=ue("Combobox.Button"),[s,i]=c.useState(null),d=we(o,i,t.actions.setButtonElement),g=c.useId(),{id:u=`headlessui-combobox-button-${g}`,disabled:v=l.disabled||!1,autoFocus:S=!1,...w}=e,[C,x,p]=q(t,O=>[O.comboboxState,O.inputElement,O.optionsElement]),E=ot(x),k=C===y.Open;mo(k,{trigger:s,action:c.useCallback(O=>{if(s!=null&&s.contains(O.target))return be.Ignore;if(x!=null&&x.contains(O.target))return be.Ignore;let H=O.target.closest('[role="option"]:not([data-disabled])');return Ct(H)?be.Select(H):p!=null&&p.contains(O.target)?be.Ignore:be.Close},[s,x,p]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let m=_(O=>{switch(O.key){case J.Space:case J.Enter:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&ce.flushSync(()=>t.actions.openCombobox()),E();return;case J.ArrowDown:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.First})),E();return;case J.ArrowUp:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.Last})),E();return;case J.Escape:if(t.state.comboboxState!==y.Open)return;O.preventDefault(),t.state.optionsElement&&!l.optionsPropsRef.current.static&&O.stopPropagation(),ce.flushSync(()=>t.actions.closeCombobox()),E();return;default:return}}),A=bo(()=>{t.state.comboboxState===y.Open?t.actions.closeCombobox():t.actions.openCombobox(),E()}),b=Pe([u]),{isFocusVisible:j,focusProps:M}=Ze({autoFocus:S}),{isHovered:N,hoverProps:V}=et({isDisabled:v}),{pressed:$,pressProps:F}=Ot({disabled:v}),K=ye({open:C===y.Open,active:$||C===y.Open,disabled:v,invalid:l.invalid,value:l.value,hover:N,focus:j}),W=Ie({ref:d,id:u,type:wt(e,s),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":p==null?void 0:p.id,"aria-expanded":C===y.Open,"aria-labelledby":b,disabled:v||void 0,autoFocus:S,onKeyDown:m},A,M,V,F);return Se()({ourProps:W,theirProps:w,slot:K,defaultTag:Ko,name:"Combobox.Button"})}let Yo="div",Xo=_e.RenderStrategy|_e.Static;function Jo(e,o){var t,l,s;let i=c.useId(),{id:d=`headlessui-combobox-options-${i}`,hold:g=!1,anchor:u,portal:v=!1,modal:S=!0,transition:w=!1,...C}=e,x=Ce("Combobox.Options"),p=ue("Combobox.Options"),E=lo(u);E&&(v=!0);let[k,m]=io(E),[A,b]=c.useState(null),j=ro(),M=we(o,E?k:null,x.actions.setOptionsElement,b),[N,V,$,F,K]=q(x,D=>[D.comboboxState,D.inputElement,D.buttonElement,D.optionsElement,D.activationTrigger]),W=De(V||$),O=De(F),H=Nt(),[L,P]=Et(w,A,H!==null?(H&Oe.Open)===Oe.Open:N===y.Open);jt(L,V,x.actions.closeCombobox);let z=p.__demoMode?!1:S&&N===y.Open;Pt(z,O);let le=p.__demoMode?!1:S&&N===y.Open;It(le,{allowed:c.useCallback(()=>[V,$,F],[V,$,F])});let se=q(x,x.selectors.didInputMove)?!1:L;re(()=>{var D;p.optionsPropsRef.current.static=(D=e.static)!=null?D:!1},[p.optionsPropsRef,e.static]),re(()=>{p.optionsPropsRef.current.hold=g},[p.optionsPropsRef,g]),xo(N===y.Open,{container:F,accept(D){return D.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:D.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(D){D.setAttribute("role","none")}});let te=Pe([$==null?void 0:$.id]),Q=ye({open:N===y.Open,option:void 0}),ie=_(()=>{x.actions.setActivationTrigger(ne.Pointer)}),f=_(D=>{D.preventDefault(),x.actions.setActivationTrigger(ne.Pointer)}),Y=Ie(E?j():{},{"aria-labelledby":te,role:"listbox","aria-multiselectable":p.mode===ee.Multi?!0:void 0,id:d,ref:M,style:{...C.style,...m,"--input-width":Ue(L,V,!0).width,"--button-width":Ue(L,$,!0).width},onWheel:K===ne.Pointer?void 0:ie,onMouseDown:f,...kt(P)}),R=L&&N===y.Closed&&!e.static,B=qe(R,(t=p.virtual)==null?void 0:t.options),T=qe(R,p.value),U=c.useCallback(D=>p.compare(T,D),[p.compare,T]),I=c.useMemo(()=>{if(!p.virtual)return p;if(B===void 0)throw new Error("Missing `options` in virtual mode");return B!==p.virtual.options?{...p,virtual:{...p.virtual,options:B}}:p},[p,B,(l=p.virtual)==null?void 0:l.options]);p.virtual&&Object.assign(C,{children:X.createElement(ge.Provider,{value:I},X.createElement(Bo,{slot:Q},C.children))});let ae=Se(),Ne=c.useMemo(()=>p.mode===ee.Multi?p:{...p,isSelected:U},[p,U]);return X.createElement(Tt,{enabled:v?e.static||L:!1,ownerDocument:W},X.createElement(ge.Provider,{value:Ne},ae({ourProps:Y,theirProps:{...C,children:X.createElement(go,{freeze:R},typeof C.children=="function"?(s=C.children)==null?void 0:s.call(C,Q):C.children)},slot:Q,defaultTag:Yo,features:Xo,visible:se,name:"Combobox.Options"})))}let Qo="div";function Zo(e,o){var t,l,s;let i=ue("Combobox.Option"),d=Ce("Combobox.Option"),g=c.useId(),{id:u=`headlessui-combobox-option-${g}`,value:v,disabled:S=(s=(l=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:l.call(t,v))!=null?s:!1,order:w=null,...C}=e,[x]=q(d,P=>[P.inputElement]),p=ot(x),E=q(d,c.useCallback(P=>d.selectors.isActive(P,v,u),[v,u])),k=i.isSelected(v),m=c.useRef(null),A=$t({disabled:S,value:v,domRef:m,order:w}),b=c.useContext(lt),j=we(o,m,b?b.measureElement:null),M=_(()=>{d.actions.setIsTyping(!1),d.actions.onChange(v)});re(()=>d.actions.registerOption(u,A),[A,u]);let N=q(d,c.useCallback(P=>d.selectors.shouldScrollIntoView(P,v,u),[v,u]));re(()=>{if(N)return Rt().requestAnimationFrame(()=>{var P,z;(z=(P=m.current)==null?void 0:P.scrollIntoView)==null||z.call(P,{block:"nearest"})})},[N,m]);let V=_(P=>{P.preventDefault(),P.button===fo.Left&&(S||(M(),Mt()||requestAnimationFrame(()=>p()),i.mode===ee.Single&&d.actions.closeCombobox()))}),$=_(()=>{if(S)return d.actions.goToOption({focus:G.Nothing});let P=i.calculateIndex(v);d.actions.goToOption({focus:G.Specific,idx:P})}),F=vo(),K=_(P=>F.update(P)),W=_(P=>{if(!F.wasMoved(P)||S||E&&d.state.activationTrigger===ne.Pointer)return;let z=i.calculateIndex(v);d.actions.goToOption({focus:G.Specific,idx:z},ne.Pointer)}),O=_(P=>{F.wasMoved(P)&&(S||E&&(i.optionsPropsRef.current.hold||d.state.activationTrigger===ne.Pointer&&d.actions.goToOption({focus:G.Nothing})))}),H=ye({active:E,focus:E,selected:k,disabled:S}),L={id:u,ref:j,role:"option",tabIndex:S===!0?void 0:-1,"aria-disabled":S===!0?!0:void 0,"aria-selected":k,disabled:void 0,onMouseDown:V,onFocus:$,onPointerEnter:K,onMouseEnter:K,onPointerMove:W,onMouseMove:W,onPointerLeave:O,onMouseLeave:O};return Se()({ourProps:L,theirProps:C,slot:H,defaultTag:Qo,name:"Combobox.Option"})}let es=he(Uo),it=he(Wo),rt=he(qo),ts=gt,ct=he(Jo),dt=he(Zo),os=Object.assign(es,{Input:rt,Button:it,Label:ts,Options:ct,Option:dt});/** +import{r as c,aV as _,aW as mt,aX as Re,aY as Je,aZ as bt,a_ as de,a$ as Qe,b0 as ft,b1 as vt,b2 as xt,b3 as he,b4 as gt,b5 as ht,b6 as we,b7 as q,b8 as yt,b9 as Me,ba as J,bb as ce,bc as Fe,bd as Pe,be as St,bf as Ze,bg as et,bh as ye,bi as Ie,bj as Se,bk as Ct,bl as Ot,bm as wt,bn as De,bo as Nt,bp as Et,bq as Oe,br as jt,bs as Pt,bt as It,bu as re,bv as kt,bw as X,bx as Tt,by as $t,bz as Rt,bA as Mt,bB as Ft,bC as Dt,bD as _t,bE as At,bF as Vt,bG as Lt,bH as zt,bI as _e,e as Bt,j as n,c as Z,aE as Ht,a7 as Ut,bJ as Gt,a8 as qt,bK as Kt,$ as Wt,ad as Yt,ah as Xt,bL as Jt,ai as Qt,az as Zt,aT as eo,aj as Ae,Q as Ve,bM as Le,bN as ze,B as Ee,f as Be,bO as He,ae as to}from"./index-CdntfUUz.js";import{c as oo}from"./node-types-rkAZo2WA.js";import{u as so}from"./chevron-up-CFeeYtPO.js";import{u as no}from"./use-by-comparator-Dgy5yCaL.js";import{F as ao,y as lo,R as io,T as ro,w as Ue,A as co}from"./floating-B9JazpOE.js";import{c as G,p as uo,a as xe,f as Ge,b as po,L as mo,S as be,s as bo,g as fo,u as vo}from"./element-movement-rOMuf_3T.js";import{F as xo}from"./use-tree-walker-DwujlxlX.js";import{u as qe,s as go}from"./frozen-C1Yg1x_W.js";import{g as tt,u as ho,P as yo}from"./PacketList-CyBre3jR.js";import{useGetDecodedContent as So,useResolveSource as Co}from"./usePipelineStore-B9TPEPcv.js";import{c as Oo,a as wo,D as No,b as Eo}from"./AnalyzerFilterPanel-O22f461t.js";import{u as jo,r as Po}from"./consumer-registry-K46Bg-WH.js";import{A as Io}from"./arrow-down-npn6XFzD.js";import{A as ko}from"./arrow-right-DDhVPQqL.js";import{P as To,a as $o,B as Ro,C as Ke}from"./PageLayout-B2kQpvXM.js";import{T as Mo}from"./TimeRangeStepper-JPYSHI2J.js";import{M as Fo}from"./MqttModeBadge-2hTXq31i.js";import{F as We}from"./funnel-0W7-MqFe.js";import{R as Do}from"./route-CeOQcqdX.js";import{S as _o}from"./sparkles-CIoeyoky.js";import{S as Ao}from"./search-D8B8LMYr.js";import"./primitives-Bl26dfm-.js";import"./badge-colors-Dl76Mz8m.js";import"./chat-utils-D8ZwjCT3.js";import"./SignalIndicator-CKCIivNj.js";import"./arrow-up-C1m6otp9.js";import"./WorkspaceNav-BZrtCI1_.js";import"./payload-detail-D7dyXv-d.js";import"./map-pin-ADTzwr8W.js";import"./circle-question-mark-EfmCIEVS.js";import"./layers-80mLD98M.js";import"./hash-Ccz7W0IK.js";import"./clock-DKukpMjT.js";import"./activity-02b04F6Q.js";import"./database-D8ZiJ_7E.js";import"./useMapViewStore-Ciaw6Y-k.js";import"./index-tm_sy7-t.js";import"./index-Bfbz8_Ci.js";import"./shield-CNxoSMJk.js";import"./zap-BZEYLUfp.js";import"./monitor-smartphone-X03XrJWF.js";function ot(e){let o=c.useRef({value:"",selectionStart:null,selectionEnd:null});return mt(e,"blur",t=>{let l=t.target;Re(l)&&(o.current={value:l.value,selectionStart:l.selectionStart,selectionEnd:l.selectionEnd})}),_(()=>{if(!Je(e)&&Re(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:l}=o.current;t!==null&&l!==null&&e.setSelectionRange(t,l)}o.current={value:"",selectionStart:null,selectionEnd:null}}})}var Vo=Object.defineProperty,Lo=(e,o,t)=>o in e?Vo(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,Ye=(e,o,t)=>(Lo(e,typeof o!="symbol"?o+"":o,t),t),y=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(y||{}),ee=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(ee||{}),ne=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(ne||{}),st=(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))(st||{});function je(e,o=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,l=o(e.options.slice()),s=l.length>0&&l[0].dataRef.current.order!==null?l.sort((d,g)=>d.dataRef.current.order-g.dataRef.current.order):vt(l,d=>d.dataRef.current.domRef.current),i=t?s.indexOf(t):null;return i===-1&&(i=null),{options:s,activeOptionIndex:i}}let zo={1(e){var o;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1)return e;let t=e.inputElement?xe.Tracked(po(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 l=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(l!==-1)return{...e,activeOptionIndex:l,comboboxState:0,__demoMode:!1,inputPositionState:xe.Idle}}return{...e,comboboxState:0,inputPositionState:xe.Idle,__demoMode:!1}},3(e,o){return e.isTyping===o.isTyping?e:{...e,isTyping:o.isTyping}},2(e,o){var t,l,s,i;if((t=e.dataRef.current)!=null&&t.disabled||e.optionsElement&&!((l=e.dataRef.current)!=null&&l.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:v,disabled:S}=e.virtual,w=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>v,resolveActiveIndex:()=>{var x,p;return(p=(x=e.activeOptionIndex)!=null?x:v.findIndex(E=>!S(E)))!=null?p:null},resolveDisabled:S,resolveId(){throw new Error("Function not implemented.")}}),C=(s=o.trigger)!=null?s:2;return e.activeOptionIndex===w&&e.activationTrigger===C?e:{...e,activeOptionIndex:w,activationTrigger:C,isTyping:!1,__demoMode:!1}}let d=je(e);if(d.activeOptionIndex===null){let v=d.options.findIndex(S=>!S.dataRef.current.disabled);v!==-1&&(d.activeOptionIndex=v)}let g=o.focus===G.Specific?o.idx:Ge(o,{resolveItems:()=>d.options,resolveActiveIndex:()=>d.activeOptionIndex,resolveId:v=>v.id,resolveDisabled:v=>v.dataRef.current.disabled}),u=(i=o.trigger)!=null?i:2;return e.activeOptionIndex===g&&e.activationTrigger===u?e:{...e,...d,isTyping:!1,activeOptionIndex:g,activationTrigger:u,__demoMode:!1}},4:(e,o)=>{var t,l,s,i;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,o.payload]};let d=o.payload,g=je(e,v=>(v.push(d),v));e.activeOptionIndex===null&&(s=(l=e.dataRef.current).isSelected)!=null&&s.call(l,o.payload.dataRef.current.value)&&(g.activeOptionIndex=g.options.indexOf(d));let u={...e,...g,activationTrigger:2};return(i=e.dataRef.current)!=null&&i.__demoMode&&e.dataRef.current.value===void 0&&(u.activeOptionIndex=0),u},5:(e,o)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(s=>s.id!==o.id)};let l=je(e,s=>{let i=s.findIndex(d=>d.id===o.id);return i!==-1&&s.splice(i,1),s});return{...e,...l,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,l;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 s=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?s=i:s=null}return{...e,activeOptionIndex:s,virtual:{options:o.options,disabled:(l=o.disabled)!=null?l:()=>!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:xe.Moved}}};class ke extends bt{constructor(o){super(o),Ye(this,"actions",{onChange:t=>{let{onChange:l,compare:s,mode:i,value:d}=this.state.dataRef.current;return de(i,{0:()=>l==null?void 0:l(t),1:()=>{let g=d.slice(),u=g.findIndex(v=>s(v,t));return u===-1?g.push(t):g.splice(u,1),l==null?void 0:l(g)}})},registerOption:(t,l)=>(this.send({type:4,payload:{id:t,dataRef:l}}),()=>{this.state.activeOptionIndex===this.state.dataRef.current.calculateIndex(l.current.value)&&this.send({type:6,value:!0}),this.send({type:5,id:t})}),goToOption:(t,l)=>(this.send({type:6,value:!1}),this.send({type:2,...t,trigger:l})),setIsTyping:t=>{this.send({type:3,isTyping:t})},closeCombobox:()=>{var t,l;this.send({type:1}),this.send({type:6,value:!1}),(l=(t=this.state.dataRef.current).onClose)==null||l.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:l}=this.state.options[t];this.actions.onChange(l.current.value)}this.actions.goToOption({focus:G.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})}}),Ye(this,"selectors",{activeDescendantId:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);if(i!==null)return t.virtual?(s=t.options.find(d=>!d.dataRef.current.disabled&&t.dataRef.current.compare(d.dataRef.current.value,t.virtual.options[i])))==null?void 0:s.id:(l=t.options[i])==null?void 0:l.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:s,disabled:i}=t.virtual,d=s.findIndex(g=>{var u;return!((u=i==null?void 0:i(g))!=null&&u)});if(d!==-1)return d}let l=t.options.findIndex(s=>!s.dataRef.current.disabled);if(l!==-1)return l}return t.activeOptionIndex},activeOption:t=>{var l,s;let i=this.selectors.activeOptionIndex(t);return i===null?null:t.virtual?t.virtual.options[i??0]:(s=(l=t.options[i])==null?void 0:l.dataRef.current.value)!=null?s:null},isActive:(t,l,s)=>{var i;let d=this.selectors.activeOptionIndex(t);return d===null?!1:t.virtual?d===t.dataRef.current.calculateIndex(l):((i=t.options[d])==null?void 0:i.id)===s},shouldScrollIntoView:(t,l,s)=>!(t.virtual||t.__demoMode||t.comboboxState!==0||t.activationTrigger===0||!this.selectors.isActive(t,l,s)),didInputMove(t){return t.inputPositionState.kind==="Moved"}});{let t=this.state.id,l=Qe.get(null);this.disposables.add(l.on(ft.Push,s=>{!l.selectors.isTop(s,t)&&this.state.comboboxState===0&&this.actions.closeCombobox()})),this.on(0,()=>l.actions.push(t)),this.on(1,()=>l.actions.pop(t))}this.disposables.group(t=>{this.on(1,l=>{l.inputElement&&(t.dispose(),t.add(uo(l.inputElement,l.inputPositionState,()=>{this.send({type:12})})))})})}static new({id:o,virtual:t=null,__demoMode:l=!1}){var s;return new ke({id:o,dataRef:{current:{}},comboboxState:l?0:1,isTyping:!1,options:[],virtual:t?{options:t.options,disabled:(s=t.disabled)!=null?s:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:l,inputPositionState:xe.Idle})}reduce(o,t){return de(t.type,zo,o,t)}}const nt=c.createContext(null);function Ce(e){let o=c.useContext(nt);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,at),t}return o}function at({id:e,virtual:o=null,__demoMode:t=!1}){let l=c.useMemo(()=>ke.new({id:e,virtual:o,__demoMode:t}),[]);return xt(()=>l.dispose()),l}let ge=c.createContext(null);ge.displayName="ComboboxDataContext";function ue(e){let o=c.useContext(ge);if(o===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,ue),t}return o}let lt=c.createContext(null);function Bo(e){let o=Ce("VirtualProvider"),t=ue("VirtualProvider"),{options:l}=t.virtual,s=q(o,x=>x.optionsElement),[i,d]=c.useMemo(()=>{let x=s;if(!x)return[0,0];let p=window.getComputedStyle(x);return[parseFloat(p.paddingBlockStart||p.paddingTop),parseFloat(p.paddingBlockEnd||p.paddingBottom)]},[s]),g=so({enabled:l.length!==0,scrollPaddingStart:i,scrollPaddingEnd:d,count:l.length,estimateSize(){return 40},getScrollElement(){return o.state.optionsElement},overscan:12}),[u,v]=c.useState(0);re(()=>{v(x=>x+1)},[l]);let S=g.getVirtualItems(),w=q(o,x=>x.activationTrigger===ne.Pointer),C=q(o,o.selectors.activeOptionIndex);return S.length===0?null:X.createElement(lt.Provider,{value:g},X.createElement("div",{style:{position:"relative",width:"100%",height:`${g.getTotalSize()}px`},ref:x=>{x&&(w||C!==null&&l.length>C&&g.scrollToIndex(C))}},S.map(x=>{var p;return X.createElement(c.Fragment,{key:x.key},X.cloneElement((p=e.children)==null?void 0:p.call(e,{...e.slot,option:l[x.index]}),{key:`${u}-${x.key}`,"data-index":x.index,"aria-setsize":l.length,"aria-posinset":x.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${x.start}px)`,overflowAnchor:"none"}}))})))}let Ho=c.Fragment;function Uo(e,o){let t=c.useId(),l=Ft(),{value:s,defaultValue:i,onChange:d,form:g,name:u,by:v,invalid:S=!1,disabled:w=l||!1,onClose:C,__demoMode:x=!1,multiple:p=!1,immediate:E=!1,virtual:k=null,nullable:m,...A}=e,b=Dt(i),[j=p?[]:void 0,M]=_t(s,d,b),N=at({id:t,virtual:k,__demoMode:x}),V=c.useRef({static:!1,hold:!1}),$=no(v),F=_(I=>k?v===null?k.options.indexOf(I):k.options.findIndex(ae=>$(ae,I)):N.state.options.findIndex(ae=>$(ae.dataRef.current.value,I))),K=c.useCallback(I=>de(H.mode,{[ee.Multi]:()=>j.some(ae=>$(ae,I)),[ee.Single]:()=>$(j,I)}),[j]),W=q(N,I=>I.virtual),O=_(()=>C==null?void 0:C()),H=c.useMemo(()=>({__demoMode:x,immediate:E,optionsPropsRef:V,value:j,defaultValue:b,disabled:w,invalid:S,mode:p?ee.Multi:ee.Single,virtual:k?W:null,onChange:M,isSelected:K,calculateIndex:F,compare:$,onClose:O}),[x,E,V,j,b,w,S,p,k,W,M,K,F,$,O]);re(()=>{var I;k&&N.send({type:st.UpdateVirtualConfiguration,options:k.options,disabled:(I=k.disabled)!=null?I:null})},[k,k==null?void 0:k.options,k==null?void 0:k.disabled]),re(()=>{N.state.dataRef.current=H},[H]);let[L,P,z,le]=q(N,I=>[I.comboboxState,I.buttonElement,I.inputElement,I.optionsElement]),se=Qe.get(null),te=q(se,c.useCallback(I=>se.selectors.isTop(I,t),[se,t]));At(te,[P,z,le],()=>N.actions.closeCombobox());let Q=q(N,N.selectors.activeOptionIndex),ie=q(N,N.selectors.activeOption),f=ye({open:L===y.Open,disabled:w,invalid:S,activeIndex:Q,activeOption:ie,value:j}),[Y,R]=Vt(),B=o===null?{}:{ref:o},T=c.useCallback(()=>{if(b!==void 0)return M==null?void 0:M(b)},[M,b]),U=Se();return X.createElement(R,{value:Y,props:{htmlFor:z==null?void 0:z.id},slot:{open:L===y.Open,disabled:w}},X.createElement(co,null,X.createElement(ge.Provider,{value:H},X.createElement(nt.Provider,{value:N},X.createElement(Lt,{value:de(L,{[y.Open]:Oe.Open,[y.Closed]:Oe.Closed})},u!=null&&X.createElement(zt,{disabled:w,data:j!=null?{[u]:j}:{},form:g,onReset:T}),U({ourProps:B,theirProps:A,slot:f,defaultTag:Ho,name:"Combobox"}))))))}let Go="input";function qo(e,o){var t,l;let s=Ce("Combobox.Input"),i=ue("Combobox.Input"),d=c.useId(),g=ht(),{id:u=g||`headlessui-combobox-input-${d}`,onChange:v,displayValue:S,disabled:w=i.disabled||!1,autoFocus:C=!1,type:x="text",...p}=e,E=c.useRef(null),k=we(E,o,ao(),s.actions.setInputElement),[m,A]=q(s,f=>[f.comboboxState,f.isTyping]),b=yt(),j=_(()=>{s.actions.onChange(null),s.state.optionsElement&&(s.state.optionsElement.scrollTop=0),s.actions.goToOption({focus:G.Nothing})}),M=c.useMemo(()=>{var f;return typeof S=="function"&&i.value!==void 0?(f=S(i.value))!=null?f:"":typeof i.value=="string"?i.value:""},[i.value,S]);Me(([f,Y],[R,B])=>{if(s.state.isTyping)return;let T=E.current;T&&((B===y.Open&&Y===y.Closed||f!==R)&&(T.value=f),requestAnimationFrame(()=>{if(s.state.isTyping||!T||Je(T))return;let{selectionStart:U,selectionEnd:I}=T;Math.abs((I??0)-(U??0))===0&&U===0&&T.setSelectionRange(T.value.length,T.value.length)}))},[M,m,A]),Me(([f],[Y])=>{if(f===y.Open&&Y===y.Closed){if(s.state.isTyping)return;let R=E.current;if(!R)return;let B=R.value,{selectionStart:T,selectionEnd:U,selectionDirection:I}=R;R.value="",R.value=B,I!==null?R.setSelectionRange(T,U,I):R.setSelectionRange(T,U)}},[m]);let N=c.useRef(!1),V=_(()=>{N.current=!0}),$=_(()=>{b.nextFrame(()=>{N.current=!1})}),F=_(f=>{switch(s.actions.setIsTyping(!0),f.key){case J.Enter:if(s.state.comboboxState!==y.Open||N.current)return;if(f.preventDefault(),f.stopPropagation(),s.selectors.activeOptionIndex(s.state)===null){s.actions.closeCombobox();return}s.actions.selectActiveOption(),i.mode===ee.Single&&s.actions.closeCombobox();break;case J.ArrowDown:return f.preventDefault(),f.stopPropagation(),de(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Next}),[y.Closed]:()=>s.actions.openCombobox()});case J.ArrowUp:return f.preventDefault(),f.stopPropagation(),de(s.state.comboboxState,{[y.Open]:()=>s.actions.goToOption({focus:G.Previous}),[y.Closed]:()=>{ce.flushSync(()=>s.actions.openCombobox()),i.value||s.actions.goToOption({focus:G.Last})}});case J.Home:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.PageUp:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.First});case J.End:if(s.state.comboboxState===y.Closed||f.shiftKey)break;return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.PageDown:return f.preventDefault(),f.stopPropagation(),s.actions.goToOption({focus:G.Last});case J.Escape:return s.state.comboboxState!==y.Open?void 0:(f.preventDefault(),s.state.optionsElement&&!i.optionsPropsRef.current.static&&f.stopPropagation(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox());case J.Tab:if(s.actions.setIsTyping(!1),s.state.comboboxState!==y.Open)return;i.mode===ee.Single&&s.state.activationTrigger!==ne.Focus&&s.actions.selectActiveOption(),s.actions.closeCombobox();break}}),K=_(f=>{v==null||v(f),i.mode===ee.Single&&f.target.value===""&&j(),s.actions.openCombobox()}),W=_(f=>{var Y,R,B;let T=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);if(!((R=s.state.optionsElement)!=null&&R.contains(T))&&!((B=s.state.buttonElement)!=null&&B.contains(T))&&s.state.comboboxState===y.Open)return f.preventDefault(),i.mode===ee.Single&&i.value===null&&j(),s.actions.closeCombobox()}),O=_(f=>{var Y,R,B;let T=(Y=f.relatedTarget)!=null?Y:Fe.find(U=>U!==f.currentTarget);(R=s.state.buttonElement)!=null&&R.contains(T)||(B=s.state.optionsElement)!=null&&B.contains(T)||i.disabled||i.immediate&&s.state.comboboxState!==y.Open&&b.microTask(()=>{ce.flushSync(()=>s.actions.openCombobox()),s.actions.setActivationTrigger(ne.Focus)})}),H=Pe(),L=St(),{isFocused:P,focusProps:z}=Ze({autoFocus:C}),{isHovered:le,hoverProps:se}=et({isDisabled:w}),te=q(s,f=>f.optionsElement),Q=ye({open:m===y.Open,disabled:w,invalid:i.invalid,hover:le,focus:P,autofocus:C}),ie=Ie({ref:k,id:u,role:"combobox",type:x,"aria-controls":te==null?void 0:te.id,"aria-expanded":m===y.Open,"aria-activedescendant":q(s,s.selectors.activeDescendantId),"aria-labelledby":H,"aria-describedby":L,"aria-autocomplete":"list",defaultValue:(l=(t=e.defaultValue)!=null?t:i.defaultValue!==void 0?S==null?void 0:S(i.defaultValue):null)!=null?l:i.defaultValue,disabled:w||void 0,autoFocus:C,onCompositionStart:V,onCompositionEnd:$,onKeyDown:F,onChange:K,onFocus:O,onBlur:W},z,se);return Se()({ourProps:ie,theirProps:p,slot:Q,defaultTag:Go,name:"Combobox.Input"})}let Ko="button";function Wo(e,o){let t=Ce("Combobox.Button"),l=ue("Combobox.Button"),[s,i]=c.useState(null),d=we(o,i,t.actions.setButtonElement),g=c.useId(),{id:u=`headlessui-combobox-button-${g}`,disabled:v=l.disabled||!1,autoFocus:S=!1,...w}=e,[C,x,p]=q(t,O=>[O.comboboxState,O.inputElement,O.optionsElement]),E=ot(x),k=C===y.Open;mo(k,{trigger:s,action:c.useCallback(O=>{if(s!=null&&s.contains(O.target))return be.Ignore;if(x!=null&&x.contains(O.target))return be.Ignore;let H=O.target.closest('[role="option"]:not([data-disabled])');return Ct(H)?be.Select(H):p!=null&&p.contains(O.target)?be.Ignore:be.Close},[s,x,p]),close:t.actions.closeCombobox,select:t.actions.selectActiveOption});let m=_(O=>{switch(O.key){case J.Space:case J.Enter:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&ce.flushSync(()=>t.actions.openCombobox()),E();return;case J.ArrowDown:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.First})),E();return;case J.ArrowUp:O.preventDefault(),O.stopPropagation(),t.state.comboboxState===y.Closed&&(ce.flushSync(()=>t.actions.openCombobox()),t.state.dataRef.current.value||t.actions.goToOption({focus:G.Last})),E();return;case J.Escape:if(t.state.comboboxState!==y.Open)return;O.preventDefault(),t.state.optionsElement&&!l.optionsPropsRef.current.static&&O.stopPropagation(),ce.flushSync(()=>t.actions.closeCombobox()),E();return;default:return}}),A=bo(()=>{t.state.comboboxState===y.Open?t.actions.closeCombobox():t.actions.openCombobox(),E()}),b=Pe([u]),{isFocusVisible:j,focusProps:M}=Ze({autoFocus:S}),{isHovered:N,hoverProps:V}=et({isDisabled:v}),{pressed:$,pressProps:F}=Ot({disabled:v}),K=ye({open:C===y.Open,active:$||C===y.Open,disabled:v,invalid:l.invalid,value:l.value,hover:N,focus:j}),W=Ie({ref:d,id:u,type:wt(e,s),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":p==null?void 0:p.id,"aria-expanded":C===y.Open,"aria-labelledby":b,disabled:v||void 0,autoFocus:S,onKeyDown:m},A,M,V,F);return Se()({ourProps:W,theirProps:w,slot:K,defaultTag:Ko,name:"Combobox.Button"})}let Yo="div",Xo=_e.RenderStrategy|_e.Static;function Jo(e,o){var t,l,s;let i=c.useId(),{id:d=`headlessui-combobox-options-${i}`,hold:g=!1,anchor:u,portal:v=!1,modal:S=!0,transition:w=!1,...C}=e,x=Ce("Combobox.Options"),p=ue("Combobox.Options"),E=lo(u);E&&(v=!0);let[k,m]=io(E),[A,b]=c.useState(null),j=ro(),M=we(o,E?k:null,x.actions.setOptionsElement,b),[N,V,$,F,K]=q(x,D=>[D.comboboxState,D.inputElement,D.buttonElement,D.optionsElement,D.activationTrigger]),W=De(V||$),O=De(F),H=Nt(),[L,P]=Et(w,A,H!==null?(H&Oe.Open)===Oe.Open:N===y.Open);jt(L,V,x.actions.closeCombobox);let z=p.__demoMode?!1:S&&N===y.Open;Pt(z,O);let le=p.__demoMode?!1:S&&N===y.Open;It(le,{allowed:c.useCallback(()=>[V,$,F],[V,$,F])});let se=q(x,x.selectors.didInputMove)?!1:L;re(()=>{var D;p.optionsPropsRef.current.static=(D=e.static)!=null?D:!1},[p.optionsPropsRef,e.static]),re(()=>{p.optionsPropsRef.current.hold=g},[p.optionsPropsRef,g]),xo(N===y.Open,{container:F,accept(D){return D.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:D.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(D){D.setAttribute("role","none")}});let te=Pe([$==null?void 0:$.id]),Q=ye({open:N===y.Open,option:void 0}),ie=_(()=>{x.actions.setActivationTrigger(ne.Pointer)}),f=_(D=>{D.preventDefault(),x.actions.setActivationTrigger(ne.Pointer)}),Y=Ie(E?j():{},{"aria-labelledby":te,role:"listbox","aria-multiselectable":p.mode===ee.Multi?!0:void 0,id:d,ref:M,style:{...C.style,...m,"--input-width":Ue(L,V,!0).width,"--button-width":Ue(L,$,!0).width},onWheel:K===ne.Pointer?void 0:ie,onMouseDown:f,...kt(P)}),R=L&&N===y.Closed&&!e.static,B=qe(R,(t=p.virtual)==null?void 0:t.options),T=qe(R,p.value),U=c.useCallback(D=>p.compare(T,D),[p.compare,T]),I=c.useMemo(()=>{if(!p.virtual)return p;if(B===void 0)throw new Error("Missing `options` in virtual mode");return B!==p.virtual.options?{...p,virtual:{...p.virtual,options:B}}:p},[p,B,(l=p.virtual)==null?void 0:l.options]);p.virtual&&Object.assign(C,{children:X.createElement(ge.Provider,{value:I},X.createElement(Bo,{slot:Q},C.children))});let ae=Se(),Ne=c.useMemo(()=>p.mode===ee.Multi?p:{...p,isSelected:U},[p,U]);return X.createElement(Tt,{enabled:v?e.static||L:!1,ownerDocument:W},X.createElement(ge.Provider,{value:Ne},ae({ourProps:Y,theirProps:{...C,children:X.createElement(go,{freeze:R},typeof C.children=="function"?(s=C.children)==null?void 0:s.call(C,Q):C.children)},slot:Q,defaultTag:Yo,features:Xo,visible:se,name:"Combobox.Options"})))}let Qo="div";function Zo(e,o){var t,l,s;let i=ue("Combobox.Option"),d=Ce("Combobox.Option"),g=c.useId(),{id:u=`headlessui-combobox-option-${g}`,value:v,disabled:S=(s=(l=(t=i.virtual)==null?void 0:t.disabled)==null?void 0:l.call(t,v))!=null?s:!1,order:w=null,...C}=e,[x]=q(d,P=>[P.inputElement]),p=ot(x),E=q(d,c.useCallback(P=>d.selectors.isActive(P,v,u),[v,u])),k=i.isSelected(v),m=c.useRef(null),A=$t({disabled:S,value:v,domRef:m,order:w}),b=c.useContext(lt),j=we(o,m,b?b.measureElement:null),M=_(()=>{d.actions.setIsTyping(!1),d.actions.onChange(v)});re(()=>d.actions.registerOption(u,A),[A,u]);let N=q(d,c.useCallback(P=>d.selectors.shouldScrollIntoView(P,v,u),[v,u]));re(()=>{if(N)return Rt().requestAnimationFrame(()=>{var P,z;(z=(P=m.current)==null?void 0:P.scrollIntoView)==null||z.call(P,{block:"nearest"})})},[N,m]);let V=_(P=>{P.preventDefault(),P.button===fo.Left&&(S||(M(),Mt()||requestAnimationFrame(()=>p()),i.mode===ee.Single&&d.actions.closeCombobox()))}),$=_(()=>{if(S)return d.actions.goToOption({focus:G.Nothing});let P=i.calculateIndex(v);d.actions.goToOption({focus:G.Specific,idx:P})}),F=vo(),K=_(P=>F.update(P)),W=_(P=>{if(!F.wasMoved(P)||S||E&&d.state.activationTrigger===ne.Pointer)return;let z=i.calculateIndex(v);d.actions.goToOption({focus:G.Specific,idx:z},ne.Pointer)}),O=_(P=>{F.wasMoved(P)&&(S||E&&(i.optionsPropsRef.current.hold||d.state.activationTrigger===ne.Pointer&&d.actions.goToOption({focus:G.Nothing})))}),H=ye({active:E,focus:E,selected:k,disabled:S}),L={id:u,ref:j,role:"option",tabIndex:S===!0?void 0:-1,"aria-disabled":S===!0?!0:void 0,"aria-selected":k,disabled:void 0,onMouseDown:V,onFocus:$,onPointerEnter:K,onMouseEnter:K,onPointerMove:W,onMouseMove:W,onPointerLeave:O,onMouseLeave:O};return Se()({ourProps:L,theirProps:C,slot:H,defaultTag:Qo,name:"Combobox.Option"})}let es=he(Uo),it=he(Wo),rt=he(qo),ts=gt,ct=he(Jo),dt=he(Zo),os=Object.assign(es,{Input:rt,Button:it,Label:ts,Options:ct,Option:dt});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/PageLayout-CgrNSpBT.js b/frontend/dist/assets/PageLayout-B2kQpvXM.js similarity index 95% rename from frontend/dist/assets/PageLayout-CgrNSpBT.js rename to frontend/dist/assets/PageLayout-B2kQpvXM.js index f1b6d4b8..42ee2ca0 100644 --- a/frontend/dist/assets/PageLayout-CgrNSpBT.js +++ b/frontend/dist/assets/PageLayout-B2kQpvXM.js @@ -1 +1 @@ -import{j as e,c as u,r as t,aS as C,gK as y,a5 as A}from"./index-CAHLMlrb.js";import{a as R,C as S,W as w}from"./WorkspaceNav-ClxMgBhr.js";function L({children:c,className:a}){return e.jsx("div",{className:u("section-gap",a),children:c})}function P({children:c,className:a,ready:i}){const o=C(),l=i??o,[m,r]=t.useState(!1);return t.useEffect(()=>{if(!l){const f=window.setTimeout(()=>r(!1),0);return()=>window.clearTimeout(f)}let d=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{d||t.startTransition(()=>r(!0))})}),()=>{d=!0}},[l]),e.jsx(y.Provider,{value:l&&m,children:e.jsx("div",{className:u("bento-section",a),children:c})})}function W({title:c,icon:a,controls:i,leading:o,subtitle:l,mobileInlineControls:m=!1}){const r=t.useRef(null),[d,f]=t.useState(!1),[p,g]=t.useState(!1),h=t.useCallback(()=>{const s=r.current;if(!s)return;const n=s.scrollWidth-s.clientWidth;f(s.scrollLeft>6),g(n-s.scrollLeft>6)},[]);t.useEffect(()=>{const s=r.current;if(!s)return;const n=requestAnimationFrame(h),x=new ResizeObserver(h);return x.observe(s),Array.from(s.children).forEach(N=>x.observe(N)),s.addEventListener("scroll",h,{passive:!0}),()=>{cancelAnimationFrame(n),x.disconnect(),s.removeEventListener("scroll",h)}},[i,o,h]);const v=s=>{const n=r.current;n&&n.scrollBy({left:s*Math.max(144,n.clientWidth*.7),behavior:"smooth"})},j=!!(o||i),b=d||p;return e.jsxs("header",{className:u("page-header",m&&"mobile-inline-controls"),children:[e.jsxs("div",{className:"page-header-primary",children:[e.jsxs("h1",{className:"page-header-title type-title text-fg-primary",children:[a&&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:a}),e.jsx("span",{className:"truncate",children:c})]}),j&&e.jsxs("div",{className:u("page-header-actions-shell",b&&"is-overflowing"),children:[e.jsx("button",{type:"button",className:"page-header-actions-scroll page-header-actions-scroll-left",onClick:()=>v(-1),disabled:!d,"aria-label":"Previous page controls",tabIndex:d?0:-1,children:e.jsx(R,{"aria-hidden":"true"})}),e.jsxs("div",{ref:r,className:"page-header-actions",children:[o&&e.jsx("div",{className:"page-header-leading",children:o}),i&&e.jsx("div",{className:"page-header-controls",children:i})]}),e.jsx("button",{type:"button",className:"page-header-actions-scroll page-header-actions-scroll-right",onClick:()=>v(1),disabled:!p,"aria-label":"More page controls",tabIndex:p?0:-1,children:e.jsx(S,{"aria-hidden":"true"})})]})]}),l&&e.jsx("div",{className:"page-header-subtitle",children:l}),e.jsx(w,{})]})}function z({size:c,...a}){return e.jsx(A,{...a})}export{P as B,z as C,L as P,W as a}; +import{j as e,c as u,r as t,aS as C,gK as y,a5 as A}from"./index-CdntfUUz.js";import{a as R,C as S,W as w}from"./WorkspaceNav-BZrtCI1_.js";function L({children:c,className:a}){return e.jsx("div",{className:u("section-gap",a),children:c})}function P({children:c,className:a,ready:i}){const o=C(),l=i??o,[m,r]=t.useState(!1);return t.useEffect(()=>{if(!l){const f=window.setTimeout(()=>r(!1),0);return()=>window.clearTimeout(f)}let d=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{d||t.startTransition(()=>r(!0))})}),()=>{d=!0}},[l]),e.jsx(y.Provider,{value:l&&m,children:e.jsx("div",{className:u("bento-section",a),children:c})})}function W({title:c,icon:a,controls:i,leading:o,subtitle:l,mobileInlineControls:m=!1}){const r=t.useRef(null),[d,f]=t.useState(!1),[p,g]=t.useState(!1),h=t.useCallback(()=>{const s=r.current;if(!s)return;const n=s.scrollWidth-s.clientWidth;f(s.scrollLeft>6),g(n-s.scrollLeft>6)},[]);t.useEffect(()=>{const s=r.current;if(!s)return;const n=requestAnimationFrame(h),x=new ResizeObserver(h);return x.observe(s),Array.from(s.children).forEach(N=>x.observe(N)),s.addEventListener("scroll",h,{passive:!0}),()=>{cancelAnimationFrame(n),x.disconnect(),s.removeEventListener("scroll",h)}},[i,o,h]);const v=s=>{const n=r.current;n&&n.scrollBy({left:s*Math.max(144,n.clientWidth*.7),behavior:"smooth"})},j=!!(o||i),b=d||p;return e.jsxs("header",{className:u("page-header",m&&"mobile-inline-controls"),children:[e.jsxs("div",{className:"page-header-primary",children:[e.jsxs("h1",{className:"page-header-title type-title text-fg-primary",children:[a&&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:a}),e.jsx("span",{className:"truncate",children:c})]}),j&&e.jsxs("div",{className:u("page-header-actions-shell",b&&"is-overflowing"),children:[e.jsx("button",{type:"button",className:"page-header-actions-scroll page-header-actions-scroll-left",onClick:()=>v(-1),disabled:!d,"aria-label":"Previous page controls",tabIndex:d?0:-1,children:e.jsx(R,{"aria-hidden":"true"})}),e.jsxs("div",{ref:r,className:"page-header-actions",children:[o&&e.jsx("div",{className:"page-header-leading",children:o}),i&&e.jsx("div",{className:"page-header-controls",children:i})]}),e.jsx("button",{type:"button",className:"page-header-actions-scroll page-header-actions-scroll-right",onClick:()=>v(1),disabled:!p,"aria-label":"More page controls",tabIndex:p?0:-1,children:e.jsx(S,{"aria-hidden":"true"})})]})]}),l&&e.jsx("div",{className:"page-header-subtitle",children:l}),e.jsx(w,{})]})}function z({size:c,...a}){return e.jsx(A,{...a})}export{P as B,z as C,L as P,W as a}; diff --git a/frontend/dist/assets/PathMapMapLibre-DNpNVjSn.js b/frontend/dist/assets/PathMapMapLibre-7vuAz1d6.js similarity index 96% rename from frontend/dist/assets/PathMapMapLibre-DNpNVjSn.js rename to frontend/dist/assets/PathMapMapLibre-7vuAz1d6.js index 5af5de77..806e558d 100644 --- a/frontend/dist/assets/PathMapMapLibre-DNpNVjSn.js +++ b/frontend/dist/assets/PathMapMapLibre-7vuAz1d6.js @@ -1 +1 @@ -import{r as a,d4 as ae,cf as ie,c3 as le,hj as de,Z as J,ci as ce,j as t,a2 as K,c as G,hk as ue}from"./index-CAHLMlrb.js";import{M as pe,B as me,a as _,P as fe}from"./BasemapLayer-VyMOdkaO.js";import{S as ge,L as he}from"./layer-DnHLn7Jx.js";import{C as xe}from"./car-DRknVB1N.js";import{H as ye}from"./useMapViewStore-Dq-l5Xvs.js";import"./index-1IIqkHes.js";import"./index-R7zviCWb.js";const be={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},x={nodeColor:"#4338CA",localColor:"#4F46E5",hubColor:"#6366F1",edgeColor:"#3B3F4A",ambiguousColor:"#F9D26F",highlightColor:"#B49DFF",sourceColor:"#39D98A",destinationColor:"#B49DFF"};function C(c,r){if(!c)return r;if(c.startsWith("#"))return c;const m=ue(c);return m?`#${m.r.toString(16).padStart(2,"0")}${m.g.toString(16).padStart(2,"0")}${m.b.toString(16).padStart(2,"0")}`:r}function z(){if(typeof document>"u")return x;const c=document.documentElement,r=getComputedStyle(c);return{nodeColor:C(r.getPropertyValue("--map-node-stroke").trim(),x.nodeColor),localColor:C(r.getPropertyValue("--map-local-color").trim(),x.localColor),hubColor:C(r.getPropertyValue("--map-hub-color").trim(),x.hubColor),edgeColor:C(r.getPropertyValue("--map-edge-rest").trim(),x.edgeColor),ambiguousColor:C(r.getPropertyValue("--sys-indigo").trim(),x.ambiguousColor),highlightColor:C(r.getPropertyValue("--sys-blue").trim(),x.highlightColor),sourceColor:C(r.getPropertyValue("--sys-green").trim(),x.sourceColor),destinationColor:C(r.getPropertyValue("--sys-blue").trim(),x.destinationColor)}}function Ce({prefix:c,isLocal:r,isSource:m,isDestination:W,isLastHop:y,isHighlighted:g,isWardrive:k,candidate:h,onHover:E,onLeave:N,onClick:S}){const[n,w]=a.useState(!1),P=a.useCallback(()=>{w(!0),E()},[E]),j=a.useCallback(()=>{w(!1),N()},[N]),D=()=>k?"orange":r?"amber":m?"green":y?"amber":W?"purple":"blue";return k?t.jsxs("div",{className:G("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded-full",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:[t.jsx("div",{className:G("flex items-center justify-center","w-7 h-7 rounded-full","bg-sys-orange text-white","shadow-lg border-2 border-sys-orange/50","transition-transform duration-150",n&&"scale-110"),children:t.jsx(xe,{className:"w-4 h-4",strokeWidth:2.5})}),n&&t.jsxs(K,{color:"orange",filled:!0,className:"ml-1 type-data-xs shadow-lg",children:[c,h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.name})]})]}):t.jsx("div",{className:G("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:t.jsxs(K,{color:D(),filled:!0,className:"type-data-xs shadow-lg border border-current/30",children:[r&&t.jsx(ye,{className:"w-2.5 h-2.5 mr-1"}),c,n&&h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.name})]})})}function je({hopNumber:c,snr:r,edgeColor:m}){return t.jsxs("div",{className:"flex flex-col items-center gap-0.5 pointer-events-none",children:[t.jsx("span",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center font-mono font-bold tabular-nums shadow-md",style:{backgroundColor:m||J[500],color:"#fff",fontSize:"8px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:c}),r!==void 0&&t.jsx(K,{color:"zinc",compact:!0,className:"!text-[9px] font-mono tabular-nums shadow-sm",children:r.toFixed(1)})]})}function Ee({resolvedPath:c,localNode:r,hubNodes:m=[],hoveredHopIndex:W,onHoverHop:y,traceSnr:g}){const k=g!==void 0&&g.length>0,h=a.useRef(null),E=ae(),N=ie(),S=a.useMemo(()=>new Set(m),[m]),[n,w]=a.useState(null),P=le(),[j,D]=a.useState(!1),[Z,U]=a.useState(0);a.useEffect(()=>{var f;const e=(f=h.current)==null?void 0:f.getMap();if(!e)return;const o=e.getCanvas();if(!o)return;const s=l=>{l.preventDefault(),console.warn("[PathMapMapLibre] WebGL context lost")},i=()=>{console.warn("[PathMapMapLibre] WebGL context restored, remounting..."),U(l=>l+1)};return o.addEventListener("webglcontextlost",s),o.addEventListener("webglcontextrestored",i),()=>{o.removeEventListener("webglcontextlost",s),o.removeEventListener("webglcontextrestored",i)}},[Z]);const{positions:v,markers:$,edges:I}=a.useMemo(()=>{const e=[],o=[],s=[],i=[],f=(p,R)=>p!==0||R!==0;let l=0,b=!1;return c.hops.forEach((p,R)=>{const Y=p.candidates.filter(d=>f(d.latitude,d.longitude));if(Y.length===0)return;const V=[...Y].sort((d,F)=>F.probability-d.probability),A=V[0],L=[A.longitude,A.latitude];if(i.push(L),i.length>=2){const d=i[i.length-2],F=i.length-2,M=g==null?void 0:g[F],T=L[0]-d[0],se=L[1]-d[1],ne=Math.atan2(T,se)*(180/Math.PI),re=z();let B;b?B="#F97316":M!==void 0?B=de()[ce(M,N)]||J[500]:B=re.edgeColor,s.push({from:d,to:L,snrFwd:M,midpoint:[(d[0]+L[0])/2,(d[1]+L[1])/2],bearing:ne,color:B,isFromWardrive:b})}const te=p.isSource===!0,oe=p.isDestination===!0;b=A.isWardrive===!0,V.forEach((d,F)=>{const M=[d.latitude,d.longitude];e.push(M);const T=F===0;o.push({position:M,prefix:p.prefix,confidence:p.confidence,candidateCount:V.length,hopIndex:R,candidate:d,isHub:S.has(d.hash),isPrimary:T,isSource:te,isDestination:oe,validIndex:l})}),l++}),{positions:e,markers:o,edges:s}},[c,S,g,N]),q=a.useMemo(()=>I.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[I]),u=a.useMemo(()=>{const e=$.filter(l=>l.isPrimary&&(l.confidence>=.5||l.isSource||l.isDestination));if(e.length===0)return null;let o=1/0,s=-1/0,i=1/0,f=-1/0;for(const l of e){const[b,p]=l.position;bs&&(s=b),pf&&(f=p)}return[[i,o],[f,s]]},[$]),O=a.useMemo(()=>{if(v.length===0)return r?[r.longitude,r.latitude]:[0,0];let e=0,o=0;for(const[s,i]of v)e+=s,o+=i;return[o/v.length,e/v.length]},[v,r]),H=a.useCallback(()=>{var o;const e=(o=h.current)==null?void 0:o.getMap();if(!e||!u){D(!0);return}e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:0}),setTimeout(()=>{D(!0)},50)},[u]),X=a.useMemo(()=>u?`${u[0][0].toFixed(5)},${u[0][1].toFixed(5)},${u[1][0].toFixed(5)},${u[1][1].toFixed(5)}`:"",[u]);a.useEffect(()=>{var o;if(!j)return;const e=(o=h.current)==null?void 0:o.getMap();!e||!u||e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:300})},[X,j,u]);const Q=P&&j,ee=a.useCallback(e=>{w({longitude:e.position[1],latitude:e.position[0],marker:e})},[]);return v.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted text-sm bg-elevated",children:"No mappable path data"}):t.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden depth-stroke-inset",children:[!Q&&t.jsx("div",{className:"absolute inset-0 bg-elevated flex items-center justify-center pointer-events-none",children:t.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-300 ease-out",style:{opacity:Q?1:0},children:t.jsxs(pe,{ref:h,initialViewState:{longitude:O[0],latitude:O[1],zoom:10},onLoad:H,style:{height:"100%",width:"100%"},mapStyle:be,attributionControl:!1,children:[t.jsx(me,{mode:E}),I.map((e,o)=>t.jsx(ge,{id:`edge-${o}`,type:"geojson",data:q[o],children:t.jsx(he,{id:`edge-line-${o}`,type:"line",paint:{"line-color":e.color,"line-width":4,"line-opacity":1},layout:{"line-cap":"round","line-join":"round"}})},`edge-${o}`)),I.map((e,o)=>t.jsx(_,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx(je,{hopNumber:o+1,snr:k?e.snrFwd:void 0,edgeColor:e.color})},`hop-${o}`)),(()=>{const e=$.filter(s=>s.isPrimary),o=e.length>1?e.length-2:-1;return e.map((s,i)=>{const f=W===s.hopIndex,l=i===o&&!s.candidate.isLocal&&!s.isDestination;return t.jsx(_,{longitude:s.position[1],latitude:s.position[0],anchor:"center",children:t.jsx(Ce,{prefix:s.prefix,isLocal:s.candidate.isLocal||!1,isSource:s.isSource,isDestination:s.isDestination,isLastHop:l,isHighlighted:f,isWardrive:s.candidate.isWardrive||!1,candidate:s.candidate,onHover:()=>y==null?void 0:y(s.hopIndex),onLeave:()=>y==null?void 0:y(null),onClick:()=>ee(s)})},`${s.hopIndex}-${s.candidate.hash}`)})})(),n&&t.jsx(fe,{longitude:n.longitude,latitude:n.latitude,anchor:"bottom",offset:[0,-12],closeOnClick:!1,onClose:()=>w(null),className:"maplibre-popup",children:t.jsxs("div",{className:"text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"font-semibold",children:n.marker.candidate.name}),(()=>{const e=z();return t.jsxs(t.Fragment,{children:[n.marker.isSource&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.sourceColor,color:"#000"},children:"SRC"}),n.marker.isDestination&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.destinationColor,color:"#000"},children:"DST"}),n.marker.isHub&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.hubColor,color:"#000"},children:"HUB"}),n.marker.candidate.isLocal&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.localColor,color:"#fff"},children:"LOCAL"}),n.marker.candidate.isWardrive&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:"#F97316",color:"#fff"},children:"WARDRIVE"})]})})()]}),t.jsxs("div",{className:"text-fg-muted type-data-xs",children:[n.marker.prefix," • ",n.marker.candidate.hash.slice(0,10),"..."]}),!n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{style:{color:z().ambiguousColor},children:["Alternative (",(n.marker.candidate.probability*100).toFixed(0),"%)"]}),n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{className:"text-fg-muted",children:[n.marker.candidateCount," candidates"]})]})})]},Z)})]})}export{Ee as default}; +import{r as a,d4 as ae,cf as ie,c3 as le,hj as de,Z as J,ci as ce,j as t,a2 as K,c as G,hk as ue}from"./index-CdntfUUz.js";import{M as pe,B as me,a as _,P as fe}from"./BasemapLayer-U4r1eipM.js";import{S as ge,L as he}from"./layer-BRKnZ2f8.js";import{C as xe}from"./car-B1uDaAVL.js";import{H as ye}from"./useMapViewStore-Ciaw6Y-k.js";import"./index-tm_sy7-t.js";import"./index-Bfbz8_Ci.js";const be={version:8,sources:{},layers:[],glyphs:"https://tiles.basemaps.cartocdn.com/fonts/{fontstack}/{range}.pbf"},x={nodeColor:"#4338CA",localColor:"#4F46E5",hubColor:"#6366F1",edgeColor:"#3B3F4A",ambiguousColor:"#F9D26F",highlightColor:"#B49DFF",sourceColor:"#39D98A",destinationColor:"#B49DFF"};function C(c,r){if(!c)return r;if(c.startsWith("#"))return c;const m=ue(c);return m?`#${m.r.toString(16).padStart(2,"0")}${m.g.toString(16).padStart(2,"0")}${m.b.toString(16).padStart(2,"0")}`:r}function z(){if(typeof document>"u")return x;const c=document.documentElement,r=getComputedStyle(c);return{nodeColor:C(r.getPropertyValue("--map-node-stroke").trim(),x.nodeColor),localColor:C(r.getPropertyValue("--map-local-color").trim(),x.localColor),hubColor:C(r.getPropertyValue("--map-hub-color").trim(),x.hubColor),edgeColor:C(r.getPropertyValue("--map-edge-rest").trim(),x.edgeColor),ambiguousColor:C(r.getPropertyValue("--sys-indigo").trim(),x.ambiguousColor),highlightColor:C(r.getPropertyValue("--sys-blue").trim(),x.highlightColor),sourceColor:C(r.getPropertyValue("--sys-green").trim(),x.sourceColor),destinationColor:C(r.getPropertyValue("--sys-blue").trim(),x.destinationColor)}}function Ce({prefix:c,isLocal:r,isSource:m,isDestination:W,isLastHop:y,isHighlighted:g,isWardrive:k,candidate:h,onHover:E,onLeave:N,onClick:S}){const[n,w]=a.useState(!1),P=a.useCallback(()=>{w(!0),E()},[E]),j=a.useCallback(()=>{w(!1),N()},[N]),D=()=>k?"orange":r?"amber":m?"green":y?"amber":W?"purple":"blue";return k?t.jsxs("div",{className:G("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded-full",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:[t.jsx("div",{className:G("flex items-center justify-center","w-7 h-7 rounded-full","bg-sys-orange text-white","shadow-lg border-2 border-sys-orange/50","transition-transform duration-150",n&&"scale-110"),children:t.jsx(xe,{className:"w-4 h-4",strokeWidth:2.5})}),n&&t.jsxs(K,{color:"orange",filled:!0,className:"ml-1 type-data-xs shadow-lg",children:[c,h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.name})]})]}):t.jsx("div",{className:G("flex items-center cursor-pointer","transition-all duration-150",g&&"ring-2 ring-sys-blue/50 rounded",n&&"relative z-50"),onMouseEnter:P,onMouseLeave:j,onClick:S,style:{pointerEvents:"auto"},children:t.jsxs(K,{color:D(),filled:!0,className:"type-data-xs shadow-lg border border-current/30",children:[r&&t.jsx(ye,{className:"w-2.5 h-2.5 mr-1"}),c,n&&h.name&&t.jsx("span",{className:"ml-1 opacity-75",children:h.name})]})})}function je({hopNumber:c,snr:r,edgeColor:m}){return t.jsxs("div",{className:"flex flex-col items-center gap-0.5 pointer-events-none",children:[t.jsx("span",{className:"w-3.5 h-3.5 rounded-full flex items-center justify-center font-mono font-bold tabular-nums shadow-md",style:{backgroundColor:m||J[500],color:"#fff",fontSize:"8px",lineHeight:1,textShadow:"0 1px 1px rgba(0,0,0,0.4)"},children:c}),r!==void 0&&t.jsx(K,{color:"zinc",compact:!0,className:"!text-[9px] font-mono tabular-nums shadow-sm",children:r.toFixed(1)})]})}function Ee({resolvedPath:c,localNode:r,hubNodes:m=[],hoveredHopIndex:W,onHoverHop:y,traceSnr:g}){const k=g!==void 0&&g.length>0,h=a.useRef(null),E=ae(),N=ie(),S=a.useMemo(()=>new Set(m),[m]),[n,w]=a.useState(null),P=le(),[j,D]=a.useState(!1),[Z,U]=a.useState(0);a.useEffect(()=>{var f;const e=(f=h.current)==null?void 0:f.getMap();if(!e)return;const o=e.getCanvas();if(!o)return;const s=l=>{l.preventDefault(),console.warn("[PathMapMapLibre] WebGL context lost")},i=()=>{console.warn("[PathMapMapLibre] WebGL context restored, remounting..."),U(l=>l+1)};return o.addEventListener("webglcontextlost",s),o.addEventListener("webglcontextrestored",i),()=>{o.removeEventListener("webglcontextlost",s),o.removeEventListener("webglcontextrestored",i)}},[Z]);const{positions:v,markers:$,edges:I}=a.useMemo(()=>{const e=[],o=[],s=[],i=[],f=(p,R)=>p!==0||R!==0;let l=0,b=!1;return c.hops.forEach((p,R)=>{const Y=p.candidates.filter(d=>f(d.latitude,d.longitude));if(Y.length===0)return;const V=[...Y].sort((d,F)=>F.probability-d.probability),A=V[0],L=[A.longitude,A.latitude];if(i.push(L),i.length>=2){const d=i[i.length-2],F=i.length-2,M=g==null?void 0:g[F],T=L[0]-d[0],se=L[1]-d[1],ne=Math.atan2(T,se)*(180/Math.PI),re=z();let B;b?B="#F97316":M!==void 0?B=de()[ce(M,N)]||J[500]:B=re.edgeColor,s.push({from:d,to:L,snrFwd:M,midpoint:[(d[0]+L[0])/2,(d[1]+L[1])/2],bearing:ne,color:B,isFromWardrive:b})}const te=p.isSource===!0,oe=p.isDestination===!0;b=A.isWardrive===!0,V.forEach((d,F)=>{const M=[d.latitude,d.longitude];e.push(M);const T=F===0;o.push({position:M,prefix:p.prefix,confidence:p.confidence,candidateCount:V.length,hopIndex:R,candidate:d,isHub:S.has(d.hash),isPrimary:T,isSource:te,isDestination:oe,validIndex:l})}),l++}),{positions:e,markers:o,edges:s}},[c,S,g,N]),q=a.useMemo(()=>I.map(e=>({type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:[e.from,e.to]}}]})),[I]),u=a.useMemo(()=>{const e=$.filter(l=>l.isPrimary&&(l.confidence>=.5||l.isSource||l.isDestination));if(e.length===0)return null;let o=1/0,s=-1/0,i=1/0,f=-1/0;for(const l of e){const[b,p]=l.position;bs&&(s=b),pf&&(f=p)}return[[i,o],[f,s]]},[$]),O=a.useMemo(()=>{if(v.length===0)return r?[r.longitude,r.latitude]:[0,0];let e=0,o=0;for(const[s,i]of v)e+=s,o+=i;return[o/v.length,e/v.length]},[v,r]),H=a.useCallback(()=>{var o;const e=(o=h.current)==null?void 0:o.getMap();if(!e||!u){D(!0);return}e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:0}),setTimeout(()=>{D(!0)},50)},[u]),X=a.useMemo(()=>u?`${u[0][0].toFixed(5)},${u[0][1].toFixed(5)},${u[1][0].toFixed(5)},${u[1][1].toFixed(5)}`:"",[u]);a.useEffect(()=>{var o;if(!j)return;const e=(o=h.current)==null?void 0:o.getMap();!e||!u||e.fitBounds(u,{padding:{top:50,bottom:50,left:50,right:50},maxZoom:15,duration:300})},[X,j,u]);const Q=P&&j,ee=a.useCallback(e=>{w({longitude:e.position[1],latitude:e.position[0],marker:e})},[]);return v.length===0?t.jsx("div",{className:"h-full flex items-center justify-center text-fg-muted text-sm bg-elevated",children:"No mappable path data"}):t.jsxs("div",{className:"h-full w-full relative radius-inner overflow-hidden depth-stroke-inset",children:[!Q&&t.jsx("div",{className:"absolute inset-0 bg-elevated flex items-center justify-center pointer-events-none",children:t.jsx("div",{className:"w-5 h-5 border-2 border-text-muted/30 border-t-text-muted rounded-full animate-spin"})}),t.jsx("div",{className:"h-full w-full transition-opacity duration-300 ease-out",style:{opacity:Q?1:0},children:t.jsxs(pe,{ref:h,initialViewState:{longitude:O[0],latitude:O[1],zoom:10},onLoad:H,style:{height:"100%",width:"100%"},mapStyle:be,attributionControl:!1,children:[t.jsx(me,{mode:E}),I.map((e,o)=>t.jsx(ge,{id:`edge-${o}`,type:"geojson",data:q[o],children:t.jsx(he,{id:`edge-line-${o}`,type:"line",paint:{"line-color":e.color,"line-width":4,"line-opacity":1},layout:{"line-cap":"round","line-join":"round"}})},`edge-${o}`)),I.map((e,o)=>t.jsx(_,{longitude:e.midpoint[0],latitude:e.midpoint[1],anchor:"center",children:t.jsx(je,{hopNumber:o+1,snr:k?e.snrFwd:void 0,edgeColor:e.color})},`hop-${o}`)),(()=>{const e=$.filter(s=>s.isPrimary),o=e.length>1?e.length-2:-1;return e.map((s,i)=>{const f=W===s.hopIndex,l=i===o&&!s.candidate.isLocal&&!s.isDestination;return t.jsx(_,{longitude:s.position[1],latitude:s.position[0],anchor:"center",children:t.jsx(Ce,{prefix:s.prefix,isLocal:s.candidate.isLocal||!1,isSource:s.isSource,isDestination:s.isDestination,isLastHop:l,isHighlighted:f,isWardrive:s.candidate.isWardrive||!1,candidate:s.candidate,onHover:()=>y==null?void 0:y(s.hopIndex),onLeave:()=>y==null?void 0:y(null),onClick:()=>ee(s)})},`${s.hopIndex}-${s.candidate.hash}`)})})(),n&&t.jsx(fe,{longitude:n.longitude,latitude:n.latitude,anchor:"bottom",offset:[0,-12],closeOnClick:!1,onClose:()=>w(null),className:"maplibre-popup",children:t.jsxs("div",{className:"text-xs",children:[t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"font-semibold",children:n.marker.candidate.name}),(()=>{const e=z();return t.jsxs(t.Fragment,{children:[n.marker.isSource&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.sourceColor,color:"#000"},children:"SRC"}),n.marker.isDestination&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.destinationColor,color:"#000"},children:"DST"}),n.marker.isHub&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.hubColor,color:"#000"},children:"HUB"}),n.marker.candidate.isLocal&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:e.localColor,color:"#fff"},children:"LOCAL"}),n.marker.candidate.isWardrive&&t.jsx("span",{className:"px-1 py-0.5 text-[8px] font-bold rounded",style:{backgroundColor:"#F97316",color:"#fff"},children:"WARDRIVE"})]})})()]}),t.jsxs("div",{className:"text-fg-muted type-data-xs",children:[n.marker.prefix," • ",n.marker.candidate.hash.slice(0,10),"..."]}),!n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{style:{color:z().ambiguousColor},children:["Alternative (",(n.marker.candidate.probability*100).toFixed(0),"%)"]}),n.marker.isPrimary&&n.marker.candidateCount>1&&t.jsxs("div",{className:"text-fg-muted",children:[n.marker.candidateCount," candidates"]})]})})]},Z)})]})}export{Ee as default}; diff --git a/frontend/dist/assets/PolicyEngine-Bt5hUbRJ.js b/frontend/dist/assets/PolicyEngine-CFwki3sb.js similarity index 97% rename from frontend/dist/assets/PolicyEngine-Bt5hUbRJ.js rename to frontend/dist/assets/PolicyEngine-CFwki3sb.js index 22c90e3a..096df130 100644 --- a/frontend/dist/assets/PolicyEngine-Bt5hUbRJ.js +++ b/frontend/dist/assets/PolicyEngine-CFwki3sb.js @@ -1,4 +1,4 @@ -import{e as oe,dy as Z,r as h,j as e,B as m,f as v,cY as ce,a9 as de,I as D}from"./index-CAHLMlrb.js";import{P as pe,a as he,B as me,C as y}from"./PageLayout-CgrNSpBT.js";import{L as w,a as j}from"./listbox-DoXudQ3L.js";import{S as Y}from"./shield-check-DX3QVGvb.js";import{R as k,C as P}from"./Grid-B0tNiHTX.js";import{P as $}from"./plus-Be4DsW2a.js";import{T as Q}from"./trash-2-ChI2Sf6Z.js";import"./WorkspaceNav-ClxMgBhr.js";import"./use-by-comparator-JYMD8MzS.js";import"./floating-BAAXcOzg.js";import"./element-movement-SAlxPSM7.js";import"./use-text-value-B1ySk7If.js";import"./frozen-TmAR4LIW.js";/** +import{e as oe,dy as Z,r as h,j as e,B as m,f as v,cY as ce,a9 as de,I as D}from"./index-CdntfUUz.js";import{P as pe,a as he,B as me,C as y}from"./PageLayout-B2kQpvXM.js";import{L as w,a as j}from"./listbox-LgRZMHBN.js";import{S as Y}from"./shield-check-D7YYO1tX.js";import{R as k,C as P}from"./Grid-DYtN9_Hv.js";import{P as $}from"./plus-BHawoJ76.js";import{T as Q}from"./trash-2-Ym16rcs6.js";import"./WorkspaceNav-BZrtCI1_.js";import"./use-by-comparator-Dgy5yCaL.js";import"./floating-B9JazpOE.js";import"./element-movement-rOMuf_3T.js";import"./use-text-value-DFkKaUWL.js";import"./frozen-C1Yg1x_W.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RadioHardware-DhH_OAdl.js b/frontend/dist/assets/RadioHardware-D1iA7IMw.js similarity index 96% rename from frontend/dist/assets/RadioHardware-DhH_OAdl.js rename to frontend/dist/assets/RadioHardware-D1iA7IMw.js index 5ec8b358..8b4f394d 100644 --- a/frontend/dist/assets/RadioHardware-DhH_OAdl.js +++ b/frontend/dist/assets/RadioHardware-D1iA7IMw.js @@ -1,4 +1,4 @@ -import{e as Ce,ad as Se,aJ as we,r as u,a4 as ke,j as e,R as Re,B as _,f as D,h as Te,a2 as de,eR as ce,eS as oe,bO as Ie,dD as Q}from"./index-CAHLMlrb.js";import{r as Ee}from"./system-CNkSqdfb.js";import{g as Be,b as Fe}from"./setup-DRFHoJbp.js";import{i as He}from"./backup-K6eA_iA5.js";import{P as qe,a as Le,B as Ue,C as F}from"./PageLayout-CgrNSpBT.js";import{S as W,a as J}from"./setting-field-YD-YARg4.js";import{R as Y,C as V}from"./Grid-B0tNiHTX.js";import{R as De}from"./rotate-cw-D7GjgDF3.js";import{S as pe}from"./settings-2-DgwT7JNL.js";import{S as Ve}from"./save-HCcOmjKD.js";import"./WorkspaceNav-ClxMgBhr.js";import"./wand-sparkles-C18LiNtQ.js";import"./pencil--wb87xjW.js";/** +import{e as Ce,ad as Se,aJ as we,r as u,a4 as ke,j as e,R as Re,B as _,f as D,h as Te,a2 as de,eR as ce,eS as oe,bO as Ie,dD as Q}from"./index-CdntfUUz.js";import{r as Ee}from"./system-MCOv6vDg.js";import{g as Be,b as Fe}from"./setup-CORoXz0f.js";import{i as He}from"./backup-Zafc7Byp.js";import{P as qe,a as Le,B as Ue,C as F}from"./PageLayout-B2kQpvXM.js";import{S as W,a as J}from"./setting-field-BzKIre35.js";import{R as Y,C as V}from"./Grid-DYtN9_Hv.js";import{R as De}from"./rotate-cw-CKh-yYEC.js";import{S as pe}from"./settings-2-iRV0UHU5.js";import{S as Ve}from"./save-B0-dg8jU.js";import"./WorkspaceNav-BZrtCI1_.js";import"./wand-sparkles-By2ieoA5.js";import"./pencil-DwKQKROy.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RfHealthCorrelation-Bjlu541K.js b/frontend/dist/assets/RfHealthCorrelation-DoZNDUke.js similarity index 95% rename from frontend/dist/assets/RfHealthCorrelation-Bjlu541K.js rename to frontend/dist/assets/RfHealthCorrelation-DoZNDUke.js index 683a7c36..a98d8bdc 100644 --- a/frontend/dist/assets/RfHealthCorrelation-Bjlu541K.js +++ b/frontend/dist/assets/RfHealthCorrelation-DoZNDUke.js @@ -1,4 +1,4 @@ -import{e as se,ad as ae,$ as le,r as j,aj as R,d6 as re,al as ne,ak as ie,d7 as ce,d8 as oe,j as e,f as O,R as de,d9 as ue,cb as me,bJ as pe}from"./index-CAHLMlrb.js";import{P as xe,a as he,B as ge,C as N}from"./PageLayout-CgrNSpBT.js";import{L as $}from"./LightSparkline-g9bCtOHr.js";import{T as fe}from"./TimeRangeStepper-BGzUi9Jn.js";import{R as V,C as X}from"./Grid-B0tNiHTX.js";import{D as ve}from"./database-BeT3SO6w.js";import"./WorkspaceNav-ClxMgBhr.js";import"./floating-BAAXcOzg.js";/** +import{e as se,ad as ae,$ as le,r as j,aj as R,d6 as re,al as ne,ak as ie,d7 as ce,d8 as oe,j as e,f as O,R as de,d9 as ue,cb as me,bJ as pe}from"./index-CdntfUUz.js";import{P as xe,a as he,B as ge,C as N}from"./PageLayout-B2kQpvXM.js";import{L as $}from"./LightSparkline-B-EJJe6x.js";import{T as fe}from"./TimeRangeStepper-JPYSHI2J.js";import{R as V,C as X}from"./Grid-DYtN9_Hv.js";import{D as ve}from"./database-D8ZiJ_7E.js";import"./WorkspaceNav-BZrtCI1_.js";import"./floating-B9JazpOE.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/RoomServer-DrChSCH0.js b/frontend/dist/assets/RoomServer-D9PWmBB1.js similarity index 96% rename from frontend/dist/assets/RoomServer-DrChSCH0.js rename to frontend/dist/assets/RoomServer-D9PWmBB1.js index 15c68858..3d8bb27f 100644 --- a/frontend/dist/assets/RoomServer-DrChSCH0.js +++ b/frontend/dist/assets/RoomServer-D9PWmBB1.js @@ -1,4 +1,4 @@ -import{e as I,r as o,j as e,cy as G,R as Ae,c as $,aB as $e,aL as Ke,aC as Fe,a2 as V,I as D,eU as Oe,B as k,ce as we,z as Ce,cq as Be,aE as ie,Y as ze,f as te,cA as qe,aa as Se,a7 as Y,a8 as He,eV as _e,eW as Ue,bK as Re,eX as Ve,eY as Ye,eZ as Ge,e_ as We,e$ as Ie,f0 as Xe,f1 as Ze,f2 as Je,ad as Qe,$ as es,eP as ss,cB as ce}from"./index-CAHLMlrb.js";import{C as q,P as de,a as me,B as ts}from"./PageLayout-CgrNSpBT.js";import{R as as,C as ue}from"./Grid-B0tNiHTX.js";import{c as ns,m as rs}from"./node-types-CcH5BFf0.js";import{R as ls}from"./repeat-Dv_JF6au.js";import{L as os,a as is,b as cs}from"./listbox-DoXudQ3L.js";import{P as ds}from"./plus-Be4DsW2a.js";import{F as E,L as A,D as ms}from"./fieldset-DJGo6TXB.js";import{M as Q}from"./map-pin-CNePTCsc.js";import{T as Me}from"./trash-2-ChI2Sf6Z.js";import{S as ee,K as W}from"./KeycapButton-BDWyVW37.js";import{C as xe}from"./ConfirmModal-CNagQaWr.js";import{S as us,C as xs}from"./ChatBubble-Cn1oh8mi.js";import{e as ps,g as hs,a as fs}from"./chat-utils-rMBLw-SJ.js";import{W as se}from"./wifi-veufKfwm.js";import{M as gs}from"./message-square-text-BDbAHWCI.js";import{K as js}from"./key-round-CZ_hGBwN.js";import"./WorkspaceNav-ClxMgBhr.js";import"./use-by-comparator-JYMD8MzS.js";import"./floating-BAAXcOzg.js";import"./element-movement-SAlxPSM7.js";import"./use-text-value-B1ySk7If.js";import"./frozen-TmAR4LIW.js";import"./keycap-sfx-ByZp-njj.js";/** +import{e as I,r as o,j as e,cy as G,R as Ae,c as $,aB as $e,aL as Ke,aC as Fe,a2 as V,I as D,eU as Oe,B as k,ce as we,z as Ce,cq as Be,aE as ie,Y as ze,f as te,cA as qe,aa as Se,a7 as Y,a8 as He,eV as _e,eW as Ue,bK as Re,eX as Ve,eY as Ye,eZ as Ge,e_ as We,e$ as Ie,f0 as Xe,f1 as Ze,f2 as Je,ad as Qe,$ as es,eP as ss,cB as ce}from"./index-CdntfUUz.js";import{C as q,P as de,a as me,B as ts}from"./PageLayout-B2kQpvXM.js";import{R as as,C as ue}from"./Grid-DYtN9_Hv.js";import{c as ns,m as rs}from"./node-types-rkAZo2WA.js";import{R as ls}from"./repeat-CYHoMir3.js";import{L as os,a as is,b as cs}from"./listbox-LgRZMHBN.js";import{P as ds}from"./plus-BHawoJ76.js";import{F as E,L as A,D as ms}from"./fieldset-BJg_kfe0.js";import{M as Q}from"./map-pin-ADTzwr8W.js";import{T as Me}from"./trash-2-Ym16rcs6.js";import{S as ee,K as W}from"./KeycapButton-BJZjnt_-.js";import{C as xe}from"./ConfirmModal-CB8xdBeW.js";import{S as us,C as xs}from"./ChatBubble-BXwtJZuf.js";import{e as ps,g as hs,a as fs}from"./chat-utils-D8ZwjCT3.js";import{W as se}from"./wifi-6W1pAdZl.js";import{M as gs}from"./message-square-text-CaBiKUOL.js";import{K as js}from"./key-round-Cn-7B-WZ.js";import"./WorkspaceNav-BZrtCI1_.js";import"./use-by-comparator-Dgy5yCaL.js";import"./floating-B9JazpOE.js";import"./element-movement-rOMuf_3T.js";import"./use-text-value-DFkKaUWL.js";import"./frozen-C1Yg1x_W.js";import"./keycap-sfx-ByZp-njj.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Sensors-insTPzAw.js b/frontend/dist/assets/Sensors-qNNEac7h.js similarity index 97% rename from frontend/dist/assets/Sensors-insTPzAw.js rename to frontend/dist/assets/Sensors-qNNEac7h.js index 96cb8cfb..0817790e 100644 --- a/frontend/dist/assets/Sensors-insTPzAw.js +++ b/frontend/dist/assets/Sensors-qNNEac7h.js @@ -1 +1 @@ -import{ad as R,cB as A,z as y,j as e,B,dD as M,aP as v,f as T,cA as S,dB as U,dE as D,dF as h}from"./index-CAHLMlrb.js";import{P as F,a as O,B as E,C as p}from"./PageLayout-CgrNSpBT.js";import{R as L,C as V}from"./Grid-B0tNiHTX.js";import"./WorkspaceNav-ClxMgBhr.js";function u(t){return t==null?"n/a":typeof t=="boolean"?t?"true":"false":typeof t=="number"?Number.isFinite(t)?String(t):"n/a":typeof t=="string"?t:Array.isArray(t)?t.map(u).join(", "):Object.entries(t).map(([n,s])=>`${n}: ${u(s)}`).join(" · ")}function $(t,n,s){if(n&&typeof n=="object"&&!Array.isArray(n)){Object.entries(n).forEach(([r,o])=>$(t?`${t}.${r}`:r,o,s));return}s.push([t,u(n)])}function x(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function G(t){return typeof t=="string"&&t.trim()?t:null}function w(t,n){return Object.prototype.hasOwnProperty.call(t,n)?t[n]:n.split(".").reduce((s,r)=>{if(!(!s||typeof s!="object"||Array.isArray(s)))return s[r]},t)}function i(t,n=1,s=""){const r=x(t);return r===null?"n/a":`${r.toLocaleString(void 0,{maximumFractionDigits:n})}${s}`}function m(t){const n=x(t);if(n===null)return"n/a";const s=["B","KB","MB","GB","TB"];let r=n,o=0;for(;r>=1024&&o0?`${s}d ${r}h ${o}m`:`${r}h ${o}m`}function z(t,n){const s=x(t);return s===null?"n/a":S(new Date(s*1e3),n)}function k(t,n){const s=G(t);if(!s)return"n/a";const r=new Date(s);return Number.isNaN(r.getTime())?s:S(r,n)}function g({label:t,value:n}){return e.jsxs("div",{className:"rounded-lg bg-subtle-fill px-3 py-2",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:t}),e.jsx("p",{className:"mt-0.5 text-sm font-semibold leading-tight text-fg-primary break-words",children:n})]})}function d({title:t,items:n}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"type-label text-fg-muted",children:t}),e.jsx("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-3",children:n.map(([s,r])=>e.jsx(g,{label:s,value:r},s))})]})}function K({data:t}){const n=y(),s=w(t,"temperatures"),r=(s&&typeof s=="object"&&!Array.isArray(s)?Object.entries(s):Object.entries(t).filter(([a])=>a.startsWith("temperatures.")).map(([a,c])=>[a.replace("temperatures.",""),c])).map(([a,c])=>[a,x(c)]).filter(a=>a[1]!==null);if(r.length===0)return null;const o=r.filter(([a])=>a.startsWith("nvme_")),l=r.filter(([a])=>a.startsWith("coretemp_")),f=r.find(([a])=>a.includes("pch")),j=a=>a.length?Math.max(...a.map(([,c])=>c)):null,C=a=>a.length?a.reduce((c,[,P])=>c+P,0)/a.length:null,b=j(o),N=j(l),_=C(l);return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"type-label text-fg-muted",children:"Temperatures"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-4",children:[e.jsx(g,{label:"NVMe max",value:b===null?"n/a":h(b,n)}),e.jsx(g,{label:"CPU max",value:N===null?"n/a":h(N,n)}),e.jsx(g,{label:"CPU average",value:_===null?"n/a":h(_,n)}),e.jsx(g,{label:"PCH",value:f?h(f[1],n):"n/a"})]}),e.jsxs("details",{className:"rounded-lg border border-edge-subtle bg-subtle-fill/50 px-3 py-2",children:[e.jsxs("summary",{className:"cursor-pointer type-data-xs text-fg-muted hover:text-fg-secondary",children:["Show all temperature sensors (",r.length,")"]}),e.jsx("div",{className:"mt-2 grid grid-cols-2 gap-1.5 md:grid-cols-3 xl:grid-cols-4",children:r.map(([a,c])=>e.jsxs("span",{className:"rounded-md bg-surface/70 px-2 py-1 type-data-xs text-fg-secondary",children:[a,": ",h(c,n)]},a))})]})]})}function q({data:t}){const n=y(),s=r=>w(t,r);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{title:"CPU",items:[["Usage",i(s("cpu.usage_percent"),1,"%")],["Cores",i(s("cpu.count"),0)],["Frequency",i(s("cpu.frequency"),0," MHz")],["Load avg",[s("cpu.load_avg.1min"),s("cpu.load_avg.5min"),s("cpu.load_avg.15min")].map(r=>i(r,2)).join(" / ")]]}),e.jsx(d,{title:"Memory",items:[["Usage",i(s("memory.usage_percent"),1,"%")],["Used",m(s("memory.used"))],["Available",m(s("memory.available"))],["Total",m(s("memory.total"))]]}),e.jsx(d,{title:"Disk",items:[["Usage",i(s("disk.usage_percent"),1,"%")],["Used",m(s("disk.used"))],["Free",m(s("disk.free"))],["Total",m(s("disk.total"))]]}),e.jsx(d,{title:"Network",items:[["Sent",m(s("network.bytes_sent"))],["Received",m(s("network.bytes_recv"))],["Packets sent",i(s("network.packets_sent"),0)],["Packets received",i(s("network.packets_recv"),0)]]}),e.jsx(d,{title:"System",items:[["Uptime",H(s("system.uptime"))],["Boot time",z(s("system.boot_time"),n)],["OS",u(s("system.os"))],["Kernel",u(s("system.kernel"))],["Architecture",u(s("system.arch"))]]}),e.jsx(K,{data:t})]})}function I({data:t}){const n=y(),s=x(t.altitude_m),r=x(t.speed_kmh);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{title:"Connection",items:[["Source",u(t.source)],["URL",u(t.url)]]}),e.jsx(d,{title:"GPS",items:[["Fix",t.fix_valid?"Valid":"No fix"],["Quality",i(t.fix_quality,0)],["Latitude",i(t.latitude,6)],["Longitude",i(t.longitude,6)],["Altitude",s===null?"n/a":U(s,n)],["Satellites",`${i(t.satellites_used,0)} used / ${i(t.satellites_in_view,0)} view`],["Time",k(t.datetime_utc,n)],["Motion",`${r===null?"n/a":D(r,n)} · ${i(t.course_degrees,0,"°")}`]]}),e.jsx(d,{title:"Power",items:[["Battery",`${i(t.battery_percent,0,"%")} · ${i(t.battery_voltage_v,2," V")}`],["Battery mV",i(t.battery_voltage_mv,0," mV")],["Solar charge rate",i(t.solar_charge_rate_percent_per_hour,2,"%/hr")]]})]})}function W({data:t}){const n=[];return Object.entries(t).forEach(([s,r])=>$(s,r,n)),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Raw payload · source names and units are preserved."}),e.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge-subtle",children:e.jsx("table",{className:"min-w-full text-sm",children:e.jsxs("tbody",{children:[n.map(([s,r])=>e.jsxs("tr",{className:"border-t first:border-t-0 border-edge-subtle",children:[e.jsx("td",{className:"p-2 text-fg-primary font-medium",children:s}),e.jsx("td",{className:"p-2 text-fg-muted break-all",children:r})]},s)),n.length===0&&e.jsx("tr",{children:e.jsx("td",{className:"p-3 text-fg-muted",children:"No fields in payload"})})]})})})]})}function Y({reading:t}){const n=t.data??{};return t.type==="hardware_stats"||t.name==="system-health"?e.jsx(q,{data:n}):t.type==="pymc_modem"?e.jsx(I,{data:n}):e.jsx(W,{data:n})}function ee(){const t=R(),n=A(l=>l.fetchStats),s=y(),r=t==null?void 0:t.sensors,o=(r==null?void 0:r.readings)??[];return e.jsxs(F,{children:[e.jsx(O,{title:"Sensor Readings",icon:e.jsx(v,{}),mobileInlineControls:!0,subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Generic Repeater sensor telemetry from the centralized stats store."}),controls:e.jsxs(B,{outline:!0,onClick:()=>n({force:!0}),className:"px-2 sm:px-3",children:[e.jsx(M,{"data-slot":"icon"}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]})}),e.jsxs(E,{ready:!0,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Enabled"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.enabled?"Yes":r?"No":"n/a"})]}),e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Running"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.running?"Yes":r?"No":"n/a"})]}),e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Configured / Loaded"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r?`${r.configured??0} / ${r.loaded??0}`:"n/a"})]}),e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Poll Interval"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:typeof(r==null?void 0:r.poll_interval_seconds)=="number"?`${r.poll_interval_seconds}s`:"n/a"})]})]}),!r&&e.jsxs(p,{children:[e.jsx("p",{className:"type-body text-fg-primary",children:"Sensor data is not available yet."}),e.jsx("p",{className:"type-body-sm text-fg-muted mt-1",children:"This backend may not expose stats.sensors, or the Repeater is still starting."})]}),r&&o.length===0&&e.jsx(p,{children:e.jsx("p",{className:"type-body text-fg-primary",children:"Sensors are configured but no readings are available yet."})}),e.jsx(L,{template:"auto",children:o.map((l,f)=>e.jsx(V,{span:"full",lg:6,children:e.jsxs(p,{neomorphic:!0,children:[e.jsx(T,{title:l.name||`Sensor ${f+1}`,icon:e.jsx(v,{})}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-sm text-fg-muted mb-4",children:[e.jsxs("span",{children:["Type: ",l.type||"unknown"]}),e.jsx("span",{className:l.ok?"text-sys-green":"text-sys-red",children:l.ok?"OK":"Error"}),e.jsx("span",{children:l.timestamp?k(l.timestamp,s):"no timestamp"})]}),l.error&&e.jsx("p",{className:"type-body-sm text-sys-red mb-3",children:l.error}),e.jsx(Y,{reading:l})]})},`${l.name??"sensor"}-${f}`))})]})]})}export{ee as default}; +import{ad as R,cB as A,z as y,j as e,B,dD as M,aP as v,f as T,cA as S,dB as U,dE as D,dF as h}from"./index-CdntfUUz.js";import{P as F,a as O,B as E,C as p}from"./PageLayout-B2kQpvXM.js";import{R as L,C as V}from"./Grid-DYtN9_Hv.js";import"./WorkspaceNav-BZrtCI1_.js";function u(t){return t==null?"n/a":typeof t=="boolean"?t?"true":"false":typeof t=="number"?Number.isFinite(t)?String(t):"n/a":typeof t=="string"?t:Array.isArray(t)?t.map(u).join(", "):Object.entries(t).map(([n,s])=>`${n}: ${u(s)}`).join(" · ")}function $(t,n,s){if(n&&typeof n=="object"&&!Array.isArray(n)){Object.entries(n).forEach(([r,o])=>$(t?`${t}.${r}`:r,o,s));return}s.push([t,u(n)])}function x(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function G(t){return typeof t=="string"&&t.trim()?t:null}function w(t,n){return Object.prototype.hasOwnProperty.call(t,n)?t[n]:n.split(".").reduce((s,r)=>{if(!(!s||typeof s!="object"||Array.isArray(s)))return s[r]},t)}function i(t,n=1,s=""){const r=x(t);return r===null?"n/a":`${r.toLocaleString(void 0,{maximumFractionDigits:n})}${s}`}function m(t){const n=x(t);if(n===null)return"n/a";const s=["B","KB","MB","GB","TB"];let r=n,o=0;for(;r>=1024&&o0?`${s}d ${r}h ${o}m`:`${r}h ${o}m`}function z(t,n){const s=x(t);return s===null?"n/a":S(new Date(s*1e3),n)}function k(t,n){const s=G(t);if(!s)return"n/a";const r=new Date(s);return Number.isNaN(r.getTime())?s:S(r,n)}function g({label:t,value:n}){return e.jsxs("div",{className:"rounded-lg bg-subtle-fill px-3 py-2",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:t}),e.jsx("p",{className:"mt-0.5 text-sm font-semibold leading-tight text-fg-primary break-words",children:n})]})}function d({title:t,items:n}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"type-label text-fg-muted",children:t}),e.jsx("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-3",children:n.map(([s,r])=>e.jsx(g,{label:s,value:r},s))})]})}function K({data:t}){const n=y(),s=w(t,"temperatures"),r=(s&&typeof s=="object"&&!Array.isArray(s)?Object.entries(s):Object.entries(t).filter(([a])=>a.startsWith("temperatures.")).map(([a,c])=>[a.replace("temperatures.",""),c])).map(([a,c])=>[a,x(c)]).filter(a=>a[1]!==null);if(r.length===0)return null;const o=r.filter(([a])=>a.startsWith("nvme_")),l=r.filter(([a])=>a.startsWith("coretemp_")),f=r.find(([a])=>a.includes("pch")),j=a=>a.length?Math.max(...a.map(([,c])=>c)):null,C=a=>a.length?a.reduce((c,[,P])=>c+P,0)/a.length:null,b=j(o),N=j(l),_=C(l);return e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"type-label text-fg-muted",children:"Temperatures"}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 xl:grid-cols-4",children:[e.jsx(g,{label:"NVMe max",value:b===null?"n/a":h(b,n)}),e.jsx(g,{label:"CPU max",value:N===null?"n/a":h(N,n)}),e.jsx(g,{label:"CPU average",value:_===null?"n/a":h(_,n)}),e.jsx(g,{label:"PCH",value:f?h(f[1],n):"n/a"})]}),e.jsxs("details",{className:"rounded-lg border border-edge-subtle bg-subtle-fill/50 px-3 py-2",children:[e.jsxs("summary",{className:"cursor-pointer type-data-xs text-fg-muted hover:text-fg-secondary",children:["Show all temperature sensors (",r.length,")"]}),e.jsx("div",{className:"mt-2 grid grid-cols-2 gap-1.5 md:grid-cols-3 xl:grid-cols-4",children:r.map(([a,c])=>e.jsxs("span",{className:"rounded-md bg-surface/70 px-2 py-1 type-data-xs text-fg-secondary",children:[a,": ",h(c,n)]},a))})]})]})}function q({data:t}){const n=y(),s=r=>w(t,r);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{title:"CPU",items:[["Usage",i(s("cpu.usage_percent"),1,"%")],["Cores",i(s("cpu.count"),0)],["Frequency",i(s("cpu.frequency"),0," MHz")],["Load avg",[s("cpu.load_avg.1min"),s("cpu.load_avg.5min"),s("cpu.load_avg.15min")].map(r=>i(r,2)).join(" / ")]]}),e.jsx(d,{title:"Memory",items:[["Usage",i(s("memory.usage_percent"),1,"%")],["Used",m(s("memory.used"))],["Available",m(s("memory.available"))],["Total",m(s("memory.total"))]]}),e.jsx(d,{title:"Disk",items:[["Usage",i(s("disk.usage_percent"),1,"%")],["Used",m(s("disk.used"))],["Free",m(s("disk.free"))],["Total",m(s("disk.total"))]]}),e.jsx(d,{title:"Network",items:[["Sent",m(s("network.bytes_sent"))],["Received",m(s("network.bytes_recv"))],["Packets sent",i(s("network.packets_sent"),0)],["Packets received",i(s("network.packets_recv"),0)]]}),e.jsx(d,{title:"System",items:[["Uptime",H(s("system.uptime"))],["Boot time",z(s("system.boot_time"),n)],["OS",u(s("system.os"))],["Kernel",u(s("system.kernel"))],["Architecture",u(s("system.arch"))]]}),e.jsx(K,{data:t})]})}function I({data:t}){const n=y(),s=x(t.altitude_m),r=x(t.speed_kmh);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(d,{title:"Connection",items:[["Source",u(t.source)],["URL",u(t.url)]]}),e.jsx(d,{title:"GPS",items:[["Fix",t.fix_valid?"Valid":"No fix"],["Quality",i(t.fix_quality,0)],["Latitude",i(t.latitude,6)],["Longitude",i(t.longitude,6)],["Altitude",s===null?"n/a":U(s,n)],["Satellites",`${i(t.satellites_used,0)} used / ${i(t.satellites_in_view,0)} view`],["Time",k(t.datetime_utc,n)],["Motion",`${r===null?"n/a":D(r,n)} · ${i(t.course_degrees,0,"°")}`]]}),e.jsx(d,{title:"Power",items:[["Battery",`${i(t.battery_percent,0,"%")} · ${i(t.battery_voltage_v,2," V")}`],["Battery mV",i(t.battery_voltage_mv,0," mV")],["Solar charge rate",i(t.solar_charge_rate_percent_per_hour,2,"%/hr")]]})]})}function W({data:t}){const n=[];return Object.entries(t).forEach(([s,r])=>$(s,r,n)),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Raw payload · source names and units are preserved."}),e.jsx("div",{className:"overflow-x-auto rounded-lg border border-edge-subtle",children:e.jsx("table",{className:"min-w-full text-sm",children:e.jsxs("tbody",{children:[n.map(([s,r])=>e.jsxs("tr",{className:"border-t first:border-t-0 border-edge-subtle",children:[e.jsx("td",{className:"p-2 text-fg-primary font-medium",children:s}),e.jsx("td",{className:"p-2 text-fg-muted break-all",children:r})]},s)),n.length===0&&e.jsx("tr",{children:e.jsx("td",{className:"p-3 text-fg-muted",children:"No fields in payload"})})]})})})]})}function Y({reading:t}){const n=t.data??{};return t.type==="hardware_stats"||t.name==="system-health"?e.jsx(q,{data:n}):t.type==="pymc_modem"?e.jsx(I,{data:n}):e.jsx(W,{data:n})}function ee(){const t=R(),n=A(l=>l.fetchStats),s=y(),r=t==null?void 0:t.sensors,o=(r==null?void 0:r.readings)??[];return e.jsxs(F,{children:[e.jsx(O,{title:"Sensor Readings",icon:e.jsx(v,{}),mobileInlineControls:!0,subtitle:e.jsx("p",{className:"type-body-sm text-fg-muted",children:"Generic Repeater sensor telemetry from the centralized stats store."}),controls:e.jsxs(B,{outline:!0,onClick:()=>n({force:!0}),className:"px-2 sm:px-3",children:[e.jsx(M,{"data-slot":"icon"}),e.jsx("span",{className:"hidden sm:inline",children:"Refresh"})]})}),e.jsxs(E,{ready:!0,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:[e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Enabled"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.enabled?"Yes":r?"No":"n/a"})]}),e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Running"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r!=null&&r.running?"Yes":r?"No":"n/a"})]}),e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Configured / Loaded"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:r?`${r.configured??0} / ${r.loaded??0}`:"n/a"})]}),e.jsxs(p,{compact:!0,className:"min-h-0 p-3",children:[e.jsx("p",{className:"type-data-xs text-fg-muted",children:"Poll Interval"}),e.jsx("p",{className:"mt-1 text-sm font-semibold leading-tight text-fg-primary",children:typeof(r==null?void 0:r.poll_interval_seconds)=="number"?`${r.poll_interval_seconds}s`:"n/a"})]})]}),!r&&e.jsxs(p,{children:[e.jsx("p",{className:"type-body text-fg-primary",children:"Sensor data is not available yet."}),e.jsx("p",{className:"type-body-sm text-fg-muted mt-1",children:"This backend may not expose stats.sensors, or the Repeater is still starting."})]}),r&&o.length===0&&e.jsx(p,{children:e.jsx("p",{className:"type-body text-fg-primary",children:"Sensors are configured but no readings are available yet."})}),e.jsx(L,{template:"auto",children:o.map((l,f)=>e.jsx(V,{span:"full",lg:6,children:e.jsxs(p,{neomorphic:!0,children:[e.jsx(T,{title:l.name||`Sensor ${f+1}`,icon:e.jsx(v,{})}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-sm text-fg-muted mb-4",children:[e.jsxs("span",{children:["Type: ",l.type||"unknown"]}),e.jsx("span",{className:l.ok?"text-sys-green":"text-sys-red",children:l.ok?"OK":"Error"}),e.jsx("span",{children:l.timestamp?k(l.timestamp,s):"no timestamp"})]}),l.error&&e.jsx("p",{className:"type-body-sm text-sys-red mb-3",children:l.error}),e.jsx(Y,{reading:l})]})},`${l.name??"sensor"}-${f}`))})]})]})}export{ee as default}; diff --git a/frontend/dist/assets/Sessions-6Pz1fhab.js b/frontend/dist/assets/Sessions-CZL0vFpY.js similarity index 96% rename from frontend/dist/assets/Sessions-6Pz1fhab.js rename to frontend/dist/assets/Sessions-CZL0vFpY.js index 6b504aa0..b6f220eb 100644 --- a/frontend/dist/assets/Sessions-6Pz1fhab.js +++ b/frontend/dist/assets/Sessions-CZL0vFpY.js @@ -1,4 +1,4 @@ -import{e as g,r as l,fv as O,fw as U,er as Z,j as e,B as j,a9 as M,a7 as J,dD as Q,bK as C,c as N,b_ as V,eW as W,cZ as Y,cy as X,c8 as ee,z as se,cA as ae}from"./index-CAHLMlrb.js";import{C as te}from"./ConfirmModal-CNagQaWr.js";import{P as le,a as ie,B as ne,C as B}from"./PageLayout-CgrNSpBT.js";import{R as T,C as y}from"./Grid-B0tNiHTX.js";import{S as D}from"./shield-check-DX3QVGvb.js";import{C as ce}from"./circle-question-mark-BPKfem7i.js";import{S as re}from"./shield-CxlpbCLH.js";import{M as de}from"./monitor-smartphone-DMj7GqcL.js";import{A as oe}from"./antenna-CpeQ5t_a.js";import{T as E}from"./trash-2-ChI2Sf6Z.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as g,r as l,fv as O,fw as U,er as Z,j as e,B as j,a9 as M,a7 as J,dD as Q,bK as C,c as N,b_ as V,eW as W,cZ as Y,cy as X,c8 as ee,z as se,cA as ae}from"./index-CdntfUUz.js";import{C as te}from"./ConfirmModal-CB8xdBeW.js";import{P as le,a as ie,B as ne,C as B}from"./PageLayout-B2kQpvXM.js";import{R as T,C as y}from"./Grid-DYtN9_Hv.js";import{S as D}from"./shield-check-D7YYO1tX.js";import{C as ce}from"./circle-question-mark-EfmCIEVS.js";import{S as re}from"./shield-CNxoSMJk.js";import{M as de}from"./monitor-smartphone-X03XrJWF.js";import{A as oe}from"./antenna-BUervkWx.js";import{T as E}from"./trash-2-Ym16rcs6.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Setup-_swGk22g.js b/frontend/dist/assets/Setup-Bzvgo-0b.js similarity index 94% rename from frontend/dist/assets/Setup-_swGk22g.js rename to frontend/dist/assets/Setup-Bzvgo-0b.js index a509ecf9..21c469e2 100644 --- a/frontend/dist/assets/Setup-_swGk22g.js +++ b/frontend/dist/assets/Setup-Bzvgo-0b.js @@ -1,4 +1,4 @@ -import{e as q,r as a,j as e,f as P,R as A,B as M,h as z}from"./index-CAHLMlrb.js";import{P as I,a as Z,B as D,C as o}from"./PageLayout-CgrNSpBT.js";import{n as O,g as G,a as J,b as K,s as Q}from"./setup-DRFHoJbp.js";import{W as V}from"./wrench-laBkieDS.js";import{R as f,C as m}from"./Grid-B0tNiHTX.js";import{S as X}from"./shield-check-DX3QVGvb.js";import{W as Y}from"./wifi-veufKfwm.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as q,r as a,j as e,f as P,R as A,B as M,h as z}from"./index-CdntfUUz.js";import{P as I,a as Z,B as D,C as o}from"./PageLayout-B2kQpvXM.js";import{n as O,g as G,a as J,b as K,s as Q}from"./setup-CORoXz0f.js";import{W as V}from"./wrench-BDb_Mrbt.js";import{R as f,C as m}from"./Grid-DYtN9_Hv.js";import{S as X}from"./shield-check-D7YYO1tX.js";import{W as Y}from"./wifi-6W1pAdZl.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/SignalIndicator-BN0oxyDe.js b/frontend/dist/assets/SignalIndicator-CKCIivNj.js similarity index 99% rename from frontend/dist/assets/SignalIndicator-BN0oxyDe.js rename to frontend/dist/assets/SignalIndicator-CKCIivNj.js index aece83e4..a7420893 100644 --- a/frontend/dist/assets/SignalIndicator-BN0oxyDe.js +++ b/frontend/dist/assets/SignalIndicator-CKCIivNj.js @@ -1,4 +1,4 @@ -import{e as i,r as m,c as l,j as r,gC as j,dO as _,el as k}from"./index-CAHLMlrb.js";/** +import{e as i,r as m,c as l,j as r,gC as j,dO as _,el as k}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Statistics-DJlDW6-R.js b/frontend/dist/assets/Statistics-D1pZrkmX.js similarity index 98% rename from frontend/dist/assets/Statistics-DJlDW6-R.js rename to frontend/dist/assets/Statistics-D1pZrkmX.js index 317075f5..f9dd2405 100644 --- a/frontend/dist/assets/Statistics-DJlDW6-R.js +++ b/frontend/dist/assets/Statistics-D1pZrkmX.js @@ -1,4 +1,4 @@ -var Ut=Object.defineProperty;var Gt=(t,s,n)=>s in t?Ut(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var Ce=(t,s,n)=>Gt(t,typeof s!="symbol"?s+"":s,n);import{e as $e,r as o,j as e,P as Ve,c as pt,Q as Lt,z as qe,cJ as Pt,cK as Xe,y as Oe,N as Ye,cL as dt,cM as Vt,a2 as He,cN as qt,ct as Ie,cO as Xt,D as Yt,cl as Zt,cP as Qt,cQ as Jt,cR as es,cS as ts,cT as ss,cf as ns,cz as Ze,cU as Qe,cV as as,ci as is,cW as rs,cX as ls,f as Pe,cY as os,b_ as gt,c8 as cs,ak as Ot,al as ms,cZ as us,bN as ds,ad as hs,ah as xs,ag as fs,$ as ps,aS as gs,aT as ys,ai as bs,az as vs,c_ as Je,ao as js,c$ as yt,R as Ns,d0 as ws}from"./index-CAHLMlrb.js";import{L as Fe}from"./layers-CU7un-PT.js";import{u as ht,h as ks,r as xt}from"./consumer-registry-Bsx-B9R6.js";import{e as Ss}from"./easing-rWsWG9jZ.js";import{C as et}from"./compass-Dolk-EbB.js";import{T as Ms}from"./TimeRangeStepper-BGzUi9Jn.js";import{C as je,P as Cs,a as As,B as _s}from"./PageLayout-CgrNSpBT.js";import{A as tt,D as Ke,S as Rs}from"./DataValue-B6B0O-xC.js";import{C as Ts}from"./CollisionExplorerModal-Y5-HwcN-.js";import{H as bt}from"./hash-Cs4BXjcy.js";import{L as We}from"./LightSparkline-g9bCtOHr.js";import{A as Es}from"./activity-BAV-4Rxi.js";import{c as Ds,a as Is,A as Ls}from"./AnalyzerFilterPanel-BpsoGf4o.js";import{useResolveSource as Ps}from"./usePipelineStore-3uhIJZso.js";import{M as Os}from"./MqttModeBadge-OPtXzakb.js";import{R as Ee,C as Be}from"./Grid-B0tNiHTX.js";import{S as Fs}from"./settings-2-DgwT7JNL.js";import{W as Bs}from"./waves-BgBEByoN.js";import{N as Hs}from"./network-DsulLblE.js";import"./WorkspaceNav-ClxMgBhr.js";import"./floating-BAAXcOzg.js";import"./index-1IIqkHes.js";import"./index-R7zviCWb.js";import"./BasemapLayer-VyMOdkaO.js";import"./layer-DnHLn7Jx.js";import"./map-pin-CNePTCsc.js";import"./share-2-DIHBn1T5.js";import"./monitor-smartphone-DMj7GqcL.js";import"./node-types-CcH5BFf0.js";import"./circle-question-mark-BPKfem7i.js";import"./funnel-CmniI8cB.js";import"./search-C1Hut7GR.js";/** +var Ut=Object.defineProperty;var Gt=(t,s,n)=>s in t?Ut(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n;var Ce=(t,s,n)=>Gt(t,typeof s!="symbol"?s+"":s,n);import{e as $e,r as o,j as e,P as Ve,c as pt,Q as Lt,z as qe,cJ as Pt,cK as Xe,y as Oe,N as Ye,cL as dt,cM as Vt,a2 as He,cN as qt,ct as Ie,cO as Xt,D as Yt,cl as Zt,cP as Qt,cQ as Jt,cR as es,cS as ts,cT as ss,cf as ns,cz as Ze,cU as Qe,cV as as,ci as is,cW as rs,cX as ls,f as Pe,cY as os,b_ as gt,c8 as cs,ak as Ot,al as ms,cZ as us,bN as ds,ad as hs,ah as xs,ag as fs,$ as ps,aS as gs,aT as ys,ai as bs,az as vs,c_ as Je,ao as js,c$ as yt,R as Ns,d0 as ws}from"./index-CdntfUUz.js";import{L as Fe}from"./layers-80mLD98M.js";import{u as ht,h as ks,r as xt}from"./consumer-registry-K46Bg-WH.js";import{e as Ss}from"./easing-BV_uJNeb.js";import{C as et}from"./compass-CPwUyboh.js";import{T as Ms}from"./TimeRangeStepper-JPYSHI2J.js";import{C as je,P as Cs,a as As,B as _s}from"./PageLayout-B2kQpvXM.js";import{A as tt,D as Ke,S as Rs}from"./DataValue-Cy2BSezA.js";import{C as Ts}from"./CollisionExplorerModal-brcQ7JMt.js";import{H as bt}from"./hash-Ccz7W0IK.js";import{L as We}from"./LightSparkline-B-EJJe6x.js";import{A as Es}from"./activity-02b04F6Q.js";import{c as Ds,a as Is,A as Ls}from"./AnalyzerFilterPanel-O22f461t.js";import{useResolveSource as Ps}from"./usePipelineStore-B9TPEPcv.js";import{M as Os}from"./MqttModeBadge-2hTXq31i.js";import{R as Ee,C as Be}from"./Grid-DYtN9_Hv.js";import{S as Fs}from"./settings-2-iRV0UHU5.js";import{W as Bs}from"./waves-C19BgMIP.js";import{N as Hs}from"./network-TeIBnbEp.js";import"./WorkspaceNav-BZrtCI1_.js";import"./floating-B9JazpOE.js";import"./index-tm_sy7-t.js";import"./index-Bfbz8_Ci.js";import"./BasemapLayer-U4r1eipM.js";import"./layer-BRKnZ2f8.js";import"./map-pin-ADTzwr8W.js";import"./share-2-ceQyHw_t.js";import"./monitor-smartphone-X03XrJWF.js";import"./node-types-rkAZo2WA.js";import"./circle-question-mark-EfmCIEVS.js";import"./funnel-0W7-MqFe.js";import"./search-D8B8LMYr.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/System-D3XTlAJj.js b/frontend/dist/assets/System-C5DE1LLo.js similarity index 98% rename from frontend/dist/assets/System-D3XTlAJj.js rename to frontend/dist/assets/System-C5DE1LLo.js index 8c1869eb..aa129af4 100644 --- a/frontend/dist/assets/System-D3XTlAJj.js +++ b/frontend/dist/assets/System-C5DE1LLo.js @@ -1,4 +1,4 @@ -import{e as se,aK as A,Y as B,r as l,z as Z,W as q,j as e,N as te,e1 as z,c as F,b_ as re,e2 as ne,f as E,e3 as ae,e4 as oe,e5 as le,e6 as ce,cJ as ie,B as de,dD as me,h as ue,e7 as xe,e8 as G}from"./index-CAHLMlrb.js";import{C as P,P as fe,a as he,B as pe}from"./PageLayout-CgrNSpBT.js";import{A as ge}from"./arrow-up-BmXPNI2T.js";import{N as ye}from"./network-DsulLblE.js";import{A as je}from"./arrow-down-COuxy1kb.js";import{T as we}from"./thermometer-_L_juB2l.js";import{A as L}from"./activity-BAV-4Rxi.js";import{R as H,C as D}from"./Grid-B0tNiHTX.js";import"./WorkspaceNav-ClxMgBhr.js";/** +import{e as se,aK as A,Y as B,r as l,z as Z,W as q,j as e,N as te,e1 as z,c as F,b_ as re,e2 as ne,f as E,e3 as ae,e4 as oe,e5 as le,e6 as ce,cJ as ie,B as de,dD as me,h as ue,e7 as xe,e8 as G}from"./index-CdntfUUz.js";import{C as P,P as fe,a as he,B as pe}from"./PageLayout-B2kQpvXM.js";import{A as ge}from"./arrow-up-C1m6otp9.js";import{N as ye}from"./network-TeIBnbEp.js";import{A as je}from"./arrow-down-npn6XFzD.js";import{T as we}from"./thermometer-qsOxlDrM.js";import{A as L}from"./activity-02b04F6Q.js";import{R as H,C as D}from"./Grid-DYtN9_Hv.js";import"./WorkspaceNav-BZrtCI1_.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/Terminal-B7Zl0oMf.js b/frontend/dist/assets/Terminal-C_XnInql.js similarity index 99% rename from frontend/dist/assets/Terminal-B7Zl0oMf.js rename to frontend/dist/assets/Terminal-C_XnInql.js index 308d385e..fe57e537 100644 --- a/frontend/dist/assets/Terminal-B7Zl0oMf.js +++ b/frontend/dist/assets/Terminal-C_XnInql.js @@ -1,4 +1,4 @@ -var qa=Object.defineProperty;var Va=(e,t,s)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var M=(e,t,s)=>Va(e,typeof t!="symbol"?t+"":t,s);import{e as Es,Z as is,Y as ge,eg as Ga,eh as rt,ei as si,ej as ci,dF as ws,ek as Ya,el as Eo,dL as Ro,dM as Xa,cz as us,a4 as Bo,em as Ja,en as Za,bL as Qa,w as Do,dK as el,bW as tl,eo as sl,cc as Lo,ep as ce,bM as il,Q as rl,ca as nl,cB as xt,eq as ol,er as al,es as ll,dA as hl,e8 as qr,N as Mo,et as Ss,eu as To,ev as $o,ew as Ao,j as m,aB as Po,aL as No,aD as Vr,aC as Io,B as cl,r as U,z as dl,d as gi,m as Ps,ex as Gr,ey as Yr,d2 as ul,ez as fl,c as ii,eA as _l,eB as pl,ad as ml,eC as gl,eD as vl,eE as Sl}from"./index-CAHLMlrb.js";import{a as yl,h as wl}from"./ping-Chyw2B4c.js";import{g as bl}from"./transport--H030bEh.js";import{r as Cl}from"./system-CNkSqdfb.js";import{P as xl,a as kl,B as El,C as Rl}from"./PageLayout-CgrNSpBT.js";import{K as Oo,S as Bl}from"./KeycapButton-BDWyVW37.js";import{S as Xr}from"./search-C1Hut7GR.js";import{C as Dl}from"./WorkspaceNav-ClxMgBhr.js";import"./keycap-sfx-ByZp-njj.js";/** +var qa=Object.defineProperty;var Va=(e,t,s)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var M=(e,t,s)=>Va(e,typeof t!="symbol"?t+"":t,s);import{e as Es,Z as is,Y as ge,eg as Ga,eh as rt,ei as si,ej as ci,dF as ws,ek as Ya,el as Eo,dL as Ro,dM as Xa,cz as us,a4 as Bo,em as Ja,en as Za,bL as Qa,w as Do,dK as el,bW as tl,eo as sl,cc as Lo,ep as ce,bM as il,Q as rl,ca as nl,cB as xt,eq as ol,er as al,es as ll,dA as hl,e8 as qr,N as Mo,et as Ss,eu as To,ev as $o,ew as Ao,j as m,aB as Po,aL as No,aD as Vr,aC as Io,B as cl,r as U,z as dl,d as gi,m as Ps,ex as Gr,ey as Yr,d2 as ul,ez as fl,c as ii,eA as _l,eB as pl,ad as ml,eC as gl,eD as vl,eE as Sl}from"./index-CdntfUUz.js";import{a as yl,h as wl}from"./ping-D6oK6s8c.js";import{g as bl}from"./transport-DmJP2zwT.js";import{r as Cl}from"./system-MCOv6vDg.js";import{P as xl,a as kl,B as El,C as Rl}from"./PageLayout-B2kQpvXM.js";import{K as Oo,S as Bl}from"./KeycapButton-BJZjnt_-.js";import{S as Xr}from"./search-D8B8LMYr.js";import{C as Dl}from"./WorkspaceNav-BZrtCI1_.js";import"./keycap-sfx-ByZp-njj.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. @@ -147,7 +147,7 @@ The web user needs polkit permissions to restart the service. See: /etc/polkit-1/localauthority/50-local.d/openhop-repeater.pkla`,"error");return}s.update(r,a.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"?(s.update(r,"Service is restarting (connection dropped).","success"),await this.waitForService(s)):s.update(r,`Error: ${o||"Restart failed"}`,"error")}}waitForService(s){return new Promise(i=>{const r=s.write("Waiting for service...","system");let n=0;const o=30;setTimeout(()=>{const a=setInterval(async()=>{n++,s.update(r,`Waiting for service... ${n}s`,"system");try{const h=new AbortController,l=setTimeout(()=>h.abort(),3e3);await fetch(`${hl}/api/stats`,{signal:h.signal}),clearTimeout(l),clearInterval(a),s.update(r,`Service connected. (${n+4}s)`,"success"),i();return}catch{}n>=o&&(clearInterval(a),s.update(r,`Service did not respond within ${o+4}s. Check manually.`,"warning"),i())},1e3)},4e3)})}}const Wt="\x1B[",Oe=`${Wt}0m`,za=`${Wt}32m`,Ur=`${Wt}33m`,jr=`${Wt}31m`,Nf=`${Wt}36m`,Dt=`${Wt}90m`,Ua=`${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 po(e){const t=Math.floor(e/86400),s=Math.floor(e%86400/3600),i=Math.floor(e%3600/60);return t>0?`${t}d ${s}h ${i}m`:s>0?`${s}h ${i}m`:`${i}m`}function If(e,t){const s=Math.max(0,Math.min(100,e)),i=Math.round(s/100*t),r=t-i,n=s>=90?jr:s>=70?Ur:za,o=`${n}${"█".repeat(i)}${Oe}${Dt}${"░".repeat(r)}${Oe}`,a=`${s.toFixed(1)}%`.padStart(6);return`[${o}] ${n}${a}${Oe}`}function Of(e,t){const s=ws(e,t);return e>=80?`${jr}${Ua}${s}${Oe}`:e>=60?`${Ur}${s}${Oe}`:`${za}${s}${Oe}`}const ks=2,mo=" ";function Jt(e,t){const s=" ".repeat(ks),i=t-ks,r=mo.length,n=[];let o="",a=0;for(const h of e){const l=Su(h);a===0?(o=h,a=l):a+r+l<=i?(o+=mo+h,a+=r+l):(n.push(s+o),o=h,a=l)}return a>0&&n.push(s+o),n}function Hf(e,t,s){var d,u;const i=e.node_name||"unknown",r=e.version?`v${e.version}`:"",n=(d=t.system)!=null&&d.uptime?po(t.system.uptime):"?",o=po(e.uptime_seconds||0),a=Math.max(3,s-ks*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=s>=60?l:h;return[` ${Nf}${Ua}${i}${Oe} ${Dt}${r}${Oe}`,` ${Dt}${"─".repeat(a)}${Oe}`,...Jt([b("Sys",y(n)),b("Svc",y(o)),b("Load",y(c))],s)]}function Ff(e,t,s){const r=ks+4+1+2+6,n=Math.max(6,Math.min(30,t-r)),o=r+n,a=t-o-2,h=[""],l=`${e.cpu.count} core${e.cpu.count>1?"s":""}`,c=`${Xt(e.memory.used)}/${Xt(e.memory.total)}`,d=`${Xt(e.disk.used)}/${Xt(e.disk.total)}`,u=(f,p,g)=>{const k=If(p,n),K=a>=g.length?` ${Pe(g)}`:"";return` ${w(f.padEnd(4))}${k}${K}`};h.push(u("CPU",e.cpu.usage_percent,l)),h.push(u("Mem",e.memory.usage_percent,c)),h.push(u("Dsk",e.disk.usage_percent,d));const _=Object.entries(e.temperatures||{});if(_.length>0){const f=_.map(([p,g])=>`${Pe(p+":")} ${Of(g,s)}`);h.push(...Jt(f,t))}return h}function Wf(e,t){var l,c;const s=e.neighbors||{},i=Object.keys(s).length,r=Object.values(s).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=["",` ${Dt}MESH${Oe}`];return h.push(...Jt([b("Mode",y(n)),b("Nbrs",`${y(String(r))}${Pe(`/${i}`)}`),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 zf(e,t){if(!e.network)return[];const s=["",` ${Dt}NET${Oe}`];return s.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))}${Pe("/")}${y(String(e.network.packets_recv))}`)],t)),s}function Uf(e,t,s){if(e.length===0)return[];const i=t>=50,r=t>=50?6:5,n=t>=50?6:5,o=i?7:0,a=ks+0,h=Math.max(4,t-a-o-r-n-4),l=3,c=t>=50?8:5,d=s!=null?Math.max(0,Math.min(c,s-l)):c;if(d<=0)return[];const u=["",` ${Dt}PROCS${Oe}`],_=(i?"PID".padEnd(o):"")+"CPU".padStart(r)+"MEM".padStart(n)+" NAME";u.push(` ${Pe(_)}`);for(const f of e.slice(0,d)){const p=i?Pe(String(f.pid).padEnd(o)):"",g=(t>=50?f.cpu_percent.toFixed(1):f.cpu_percent.toFixed(0)).padStart(r),k=(t>=50?f.memory_percent.toFixed(1):f.memory_percent.toFixed(0)).padStart(n),K=f.name.length>h?f.name.slice(0,h-1)+"…":f.name,H=f.cpu_percent>=50?jr:f.cpu_percent>=20?Ur:"",T=H?`${H}${g}${Oe}`:g;u.push(` ${p}${T}${Pe(k)} ${K}`)}return u}function jf(e){return Mo(new Date,e,!0)}function go(e,t,s,i,r){if(!e||!t)return` ${Dt}Waiting for data…${Oe}`;const n=ci(),o=Hf(e,t,i),a=Ff(t,i,n),h=Wf(e,i),l=zf(t,i),c=["",` ${Dt}${jf(n)} · Ctrl+C to exit${Oe}`],d=[...o,...a,...h,...l,...c],u=r?xr(d,i):0,_=r?Math.max(0,r-u):void 0,f=Uf(s,i,_),p=[...d.slice(0,-c.length),...f,...c];return r&&p.length>r&&(p.length=r),p.join(` `)}const Kf=3e3;class qf extends ie{constructor(){super(...arguments);M(this,"name","top");M(this,"description","Live system overview (Ctrl+C to exit)");M(this,"aliases",["htop"])}async execute({output:s,rawInput:i,cols:r,signal:n}){var l,c;if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("top"),` ${w("Live-updating system overview combining hardware")}`,` ${w("stats, mesh metrics, and running processes.")}`,` ${w("Refreshes every 3s. Press Ctrl+C to exit.")}`,"",B("top","start live display"),"",z("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")}`,"",z("Aliases"),` ${w("htop")}`].join(` `));return}let o=null,a=[],h=xt.getState().stats;try{const[d,u]=await Promise.all([si(),qr()]);d.success&&d.data&&(o=d.data),u.success&&u.data&&(a=u.data.processes.sort((_,f)=>f.cpu_percent-_.cpu_percent))}catch{}if(!n.aborted){(l=s.enterFullscreen)==null||l.call(s);try{const d=s.write(go(h,o,a,s.cols??r,s.rows));await new Promise(u=>{if(n.aborted){u();return}const _=async()=>{h=xt.getState().stats;try{const[p,g]=await Promise.all([si(),qr()]);p.success&&p.data&&(o=p.data),g.success&&g.data&&(a=g.data.processes.sort((k,K)=>K.cpu_percent-k.cpu_percent))}catch{}n.aborted||s.update(d,go(h,o,a,s.cols??r,s.rows))},f=setInterval(()=>{if(n.aborted){clearInterval(f),u();return}_()},Kf);n.addEventListener("abort",()=>{clearInterval(f),u()},{once:!0})})}finally{(c=s.exitFullscreen)==null||c.call(s)}}}}const vo=["DONT PANIC","C0FFEE","FEED C0DE","LOL","I CANNOT DO THAT"];function Kr(){return vo[Math.floor(Math.random()*vo.length)]}const Er=new EventTarget,Rr="shell-phrase";function ja(e){Er.dispatchEvent(new CustomEvent(Rr,{detail:e??Kr()}))}function Vf(e){const t=s=>e(s.detail);return Er.addEventListener(Rr,t),()=>Er.removeEventListener(Rr,t)}class Gf extends ie{constructor(){super(...arguments);M(this,"name","fortune");M(this,"description","Display a fortune on the header");M(this,"aliases",["lol"])}execute({output:s}){const i=Kr();ja(i),s.write(w(` ${i}`))}}const Br=new EventTarget,Dr="party-time";function Yf(){Br.dispatchEvent(new Event(Dr))}function Xf(e){return Br.addEventListener(Dr,e),()=>Br.removeEventListener(Dr,e)}class Jf extends ie{constructor(){super(...arguments);M(this,"name","partytime");M(this,"description","Party on, Garth!");M(this,"aliases",["party","excellent","waynesworld"])}execute({output:s}){Yf(),ja("PARTY 0N GARTH"),s.write(w(" SCHWING!"))}}class Zf extends ie{constructor(){super(...arguments);M(this,"name","ver");M(this,"description","Show version info");M(this,"aliases",["version"])}async execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("ver"),` ${w("Display openHop Repeater, core, and console version.")}`,` ${w('Equivalent to firmware serial CLI "ver" command.')}`,"",B("ver","show version"),"",z("Aliases"),` ${w("version")}`].join(` -`));return}const r=s.write("processing...","system");try{const n=await rt();s.update(r,[` ${b("openHop Repeater",y(`v${n.version||"?"}`))}`,` ${b("MeshCore",y(n.core_version||"?"))}`,` ${b("openHop Console",y("v0.9.341"))}`].join(` +`));return}const r=s.write("processing...","system");try{const n=await rt();s.update(r,[` ${b("openHop Repeater",y(`v${n.version||"?"}`))}`,` ${b("MeshCore",y(n.core_version||"?"))}`,` ${b("openHop Console",y("v0.9.342"))}`].join(` `),"value")}catch(n){s.update(r,`Error: ${n instanceof Error?n.message:"Command failed"}`,"error")}}}class Qf extends ie{constructor(){super(...arguments);M(this,"name","clock");M(this,"description","Show system UTC time")}execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("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.")}`,"",B("clock","show UTC time")].join(` `));return}const r=new Date;s.write([` ${b("UTC",y(r.toUTCString()))}`,` ${b("ISO",y(r.toISOString()))}`,` ${b("Unix",y(String(Math.floor(r.getTime()/1e3))))}`].join(` `),"value")}}class e_ extends ie{constructor(){super(...arguments);M(this,"name","stats-packets");M(this,"description","Packet counters")}async execute({output:s,rawInput:i}){if(this.argsAfterName(i).toLowerCase().trim()==="help"){s.write([z("stats-packets"),` ${w("Display packet counters: sent, received, forwarded, dropped.")}`,` ${w('Equivalent to firmware serial CLI "stats-packets" command.')}`,"",B("stats-packets","show packet counters")].join(` diff --git a/frontend/dist/assets/Test-CYQzPSaa.js b/frontend/dist/assets/Test-Dr6o2qpf.js similarity index 99% rename from frontend/dist/assets/Test-CYQzPSaa.js rename to frontend/dist/assets/Test-Dr6o2qpf.js index 817cf8a4..399446b5 100644 --- a/frontend/dist/assets/Test-CYQzPSaa.js +++ b/frontend/dist/assets/Test-Dr6o2qpf.js @@ -1,4 +1,4 @@ -import{e as Pe,z as ce,r as p,gH as Be,ak as Ve,al as He,j as e,f as Z,a2 as ve,dD as qe,d9 as We,c as ie,N as je,aE as Ye,cL as ze,$ as Oe,ad as Xe,gI as Ge,Y as L,ct as G,x as Je,cb as Qe,b_ as Ke,T as pe,Z as ee,gJ as Ue,W as ge}from"./index-CAHLMlrb.js";import{C as K,P as Ze,a as et,B as Le}from"./PageLayout-CgrNSpBT.js";import{useResolveSource as tt}from"./usePipelineStore-3uhIJZso.js";import{C as st}from"./WorkspaceNav-ClxMgBhr.js";import{R as se,C as ae}from"./Grid-B0tNiHTX.js";import"./node-types-CcH5BFf0.js";/** +import{e as Pe,z as ce,r as p,gH as Be,ak as Ve,al as He,j as e,f as Z,a2 as ve,dD as qe,d9 as We,c as ie,N as je,aE as Ye,cL as ze,$ as Oe,ad as Xe,gI as Ge,Y as L,ct as G,x as Je,cb as Qe,b_ as Ke,T as pe,Z as ee,gJ as Ue,W as ge}from"./index-CdntfUUz.js";import{C as K,P as Ze,a as et,B as Le}from"./PageLayout-B2kQpvXM.js";import{useResolveSource as tt}from"./usePipelineStore-B9TPEPcv.js";import{C as st}from"./WorkspaceNav-BZrtCI1_.js";import{R as se,C as ae}from"./Grid-DYtN9_Hv.js";import"./node-types-rkAZo2WA.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/TimeRangeStepper-BGzUi9Jn.js b/frontend/dist/assets/TimeRangeStepper-JPYSHI2J.js similarity index 98% rename from frontend/dist/assets/TimeRangeStepper-BGzUi9Jn.js rename to frontend/dist/assets/TimeRangeStepper-JPYSHI2J.js index da6e1e6c..fe089b18 100644 --- a/frontend/dist/assets/TimeRangeStepper-BGzUi9Jn.js +++ b/frontend/dist/assets/TimeRangeStepper-JPYSHI2J.js @@ -1 +1 @@ -import{aZ as Ge,bk as ve,da as Le,db as $e,a$ as Ve,a_ as Q,r as l,b2 as We,b3 as ee,b7 as z,b6 as U,aV as k,ba as W,dc as se,dd as Be,bf as He,bg as Ke,bl as Ye,bh as re,bm as Xe,bi as me,de as _e,df as H,dg as M,dh as A,di as he,dj as xe,bj as le,bw as g,dk as ye,dl as Pe,bn as Ce,bu as Ze,bo as Ee,bp as Fe,bq as J,br as qe,bs as Qe,bv as Oe,dm as ze,dn as Te,bx as Ue,dp as Je,dq as et,by as Ie,dr as tt,ds as nt,dt as at,aW as ot,du as st,bE as rt,dv as lt,dw as ut,dx as je,bG as it,bI as ce,j as I,c as V,d as ct,m as dt,d2 as pt}from"./index-CAHLMlrb.js";import{a as ft,C as bt}from"./WorkspaceNav-ClxMgBhr.js";import{F as vt,y as mt,R as ht,T as yt,w as Pt,A as $t}from"./floating-BAAXcOzg.js";var xt=Object.defineProperty,gt=(e,n,t)=>n in e?xt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n,t)=>(gt(e,typeof n!="symbol"?n+"":n,t),t),$=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))($||{}),St=(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))(St||{});let wt={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 ge extends Ge{constructor(n){super(n),ke(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let b=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;b==null||b.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})}),ke(this,"selectors",{isPortalled:t=>{var b;if(!t.button||!t.panel)return!1;let h=(b=Le(t.button))!=null?b:document;for(let x of h.querySelectorAll("body > *"))if(Number(x==null?void 0:x.contains(t.button))^Number(x==null?void 0:x.contains(t.panel)))return!0;let v=$e(h),r=v.indexOf(t.button),a=(r+v.length-1)%v.length,w=(r+1)%v.length,y=v[a],s=v[w];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,b=Ve.get(null);this.on(0,()=>b.actions.push(t)),this.on(1,()=>b.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new ge({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 Q(t.type,wt,n,t)}}const Ne=l.createContext(null);function de(e){let n=l.useContext(Ne);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function Ct({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>ge.new({id:e,__demoMode:n}),[]);return We(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function De(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function It(){return l.useContext(pe)}let kt="div";function Bt(e,n){var t;let b=l.useId(),{__demoMode:h=!1,...v}=e,r=Ct({id:b,__demoMode:h}),a=l.useRef(null),w=U(n,Je(u=>{a.current=u})),[y,s,x,S,B]=z(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),C=et((t=a.current)!=null?t:s),p=Ie(S),d=Ie(B),f=l.useMemo(()=>({buttonId:p,panelId:d,close:r.actions.close}),[p,d,r]),P=De(),i=P==null?void 0:P.registerPopover,_=k(()=>{var u,E;let O=se((u=a.current)!=null?u:s);return(E=P==null?void 0:P.isFocusWithinPopoverGroup())!=null?E:O&&((s==null?void 0:s.contains(O))||(x==null?void 0:x.contains(O)))});l.useEffect(()=>i==null?void 0:i(f),[i,f]);let[te,ne]=tt(),G=nt(s),D=at({mainTreeNode:G,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});ot(C,"focus",u=>{var E,O,j,Z,N,q;u.target!==window&&st(u.target)&&r.state.popoverState===$.Open&&(_()||r.state.button&&r.state.panel&&(D.contains(u.target)||(O=(E=r.state.beforePanelSentinel.current)==null?void 0:E.contains)!=null&&O.call(E,u.target)||(Z=(j=r.state.afterPanelSentinel.current)==null?void 0:j.contains)!=null&&Z.call(j,u.target)||(q=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&q.call(N,u.target)||r.actions.close()))},!0);let K=y===$.Open;rt(K,D.resolveContainers,(u,E)=>{r.actions.close(),lt(E,ut.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===$.Open,close:r.actions.refocusableClose}),oe=z(r,l.useCallback(u=>Q(u.popoverState,{[$.Open]:J.Open,[$.Closed]:J.Closed}),[])),Y={ref:w},X=le();return g.createElement(je,{node:G},g.createElement($t,null,g.createElement(pe.Provider,{value:null},g.createElement(Ne.Provider,{value:r},g.createElement(Te,{value:r.actions.refocusableClose},g.createElement(it,{value:oe},g.createElement(ne,null,X({ourProps:Y,theirProps:v,slot:ae,defaultTag:kt,name:"Popover"}))))))))}let _t="button";function Et(e,n){let t=l.useId(),{id:b=`headlessui-popover-button-${t}`,disabled:h=!1,autoFocus:v=!1,...r}=e,a=de("Popover.Button"),[w,y,s,x,S,B,C]=z(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),p=l.useRef(null),d=`headlessui-focus-sentinel-${l.useId()}`,f=De(),P=f==null?void 0:f.closeOthers,i=It()!==null;l.useEffect(()=>{if(!i)return a.actions.setButtonId(b),()=>a.actions.setButtonId(null)},[i,b,a]);let[_]=l.useState(()=>Symbol()),te=U(p,n,vt(),k(o=>{if(!i){if(o)a.state.buttons.current.push(_);else{let c=a.state.buttons.current.indexOf(_);c!==-1&&a.state.buttons.current.splice(c,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=U(p,n),G=k(o=>{var c,F,T;if(i){if(a.state.popoverState===$.Closed)return;switch(o.key){case W.Space:case W.Enter:o.preventDefault(),(F=(c=o.target).click)==null||F.call(c),a.actions.close(),(T=a.state.button)==null||T.focus();break}}else switch(o.key){case W.Space:case W.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close();break;case W.Escape:if(a.state.popoverState!==$.Open)return P==null?void 0:P(a.state.buttonId);if(!p.current)return;let R=se(p.current);if(R&&!p.current.contains(R))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),D=k(o=>{i||o.key===W.Space&&o.preventDefault()}),K=k(o=>{var c,F;Be(o.currentTarget)||h||(i?(a.actions.close(),(c=a.state.button)==null||c.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close(),(F=a.state.button)==null||F.focus()))}),ae=k(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Y}=He({autoFocus:v}),{isHovered:X,hoverProps:u}=Ke({isDisabled:h}),{pressed:E,pressProps:O}=Ye({disabled:h}),j=w===$.Open,Z=re({open:j,active:E||j,disabled:h,hover:X,focus:oe,autofocus:v}),N=Xe(e,s),q=i?me({ref:ne,type:N,onKeyDown:G,onClick:K,disabled:h||void 0,autoFocus:v},Y,u,O):me({ref:te,id:x,type:N,"aria-expanded":w===$.Open,"aria-controls":S?B:void 0,disabled:h||void 0,autoFocus:v,onKeyDown:G,onKeyUp:D,onClick:K,onMouseDown:ae},Y,u,O),ue=_e(),fe=k(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function c(){Q(ue.current,{[M.Forwards]:()=>H(o,A.First),[M.Backwards]:()=>H(o,A.Last)})===he.Error&&H($e(xe(a.state.button)).filter(F=>F.dataset.headlessuiFocusGuard!=="true"),Q(ue.current,{[M.Forwards]:A.Next,[M.Backwards]:A.Previous}),{relativeTo:a.state.button})}c()}),m=le();return g.createElement(g.Fragment,null,m({ourProps:q,theirProps:r,slot:Z,defaultTag:_t,name:"Popover.Button"}),j&&!i&&y&&g.createElement(ye,{id:d,ref:C,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Ft="div",Ot=ce.RenderStrategy|ce.Static;function Re(e,n){let t=l.useId(),{id:b=`headlessui-popover-backdrop-${t}`,transition:h=!1,...v}=e,r=de("Popover.Backdrop"),a=z(r,l.useCallback(f=>f.popoverState,[])),[w,y]=l.useState(null),s=U(n,y),x=Ee(),[S,B]=Fe(h,w,x!==null?(x&J.Open)===J.Open:a===$.Open),C=k(f=>{if(Be(f.currentTarget))return f.preventDefault();r.actions.close()}),p=re({open:a===$.Open}),d={ref:s,id:b,"aria-hidden":!0,onClick:C,...Oe(B)};return le()({ourProps:d,theirProps:v,slot:p,defaultTag:Ft,features:Ot,visible:S,name:"Popover.Backdrop"})}let Tt="div",jt=ce.RenderStrategy|ce.Static;function Nt(e,n){let t=l.useId(),{id:b=`headlessui-popover-panel-${t}`,focus:h=!1,anchor:v,portal:r=!1,modal:a=!1,transition:w=!1,...y}=e,s=de("Popover.Panel"),x=z(s,s.selectors.isPortalled),[S,B,C,p,d]=z(s,l.useCallback(m=>[m.popoverState,m.button,m.__demoMode,m.beforePanelSentinel,m.afterPanelSentinel],[])),f=`headlessui-focus-sentinel-before-${t}`,P=`headlessui-focus-sentinel-after-${t}`,i=l.useRef(null),_=mt(v),[te,ne]=ht(_),G=yt();_&&(r=!0);let[D,K]=l.useState(null),ae=U(i,n,_?te:null,s.actions.setPanel,K),oe=Ce(B),Y=Ce(i.current);Ze(()=>(s.actions.setPanelId(b),()=>s.actions.setPanelId(null)),[b,s]);let X=Ee(),[u,E]=Fe(w,D,X!==null?(X&J.Open)===J.Open:S===$.Open);qe(u,B,s.actions.close),Qe(C?!1:a&&u,Y);let O=k(m=>{var o;switch(m.key){case W.Escape:if(s.state.popoverState!==$.Open||!i.current)return;let c=se(i.current);if(c&&!i.current.contains(c))return;m.preventDefault(),m.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var m;e.static||S===$.Closed&&((m=e.unmount)==null||m)&&s.actions.setPanel(null)},[S,e.unmount,e.static,s]),l.useEffect(()=>{if(C||!h||S!==$.Open||!i.current)return;let m=se(i.current);i.current.contains(m)||H(i.current,A.First)},[C,h,i.current,S]);let j=re({open:S===$.Open,close:s.actions.refocusableClose}),Z=me(_?G():{},{ref:ae,id:b,onKeyDown:O,onBlur:h&&S===$.Open?m=>{var o,c,F,T,R;let L=m.relatedTarget;L&&i.current&&((o=i.current)!=null&&o.contains(L)||(s.actions.close(),((F=(c=p.current)==null?void 0:c.contains)!=null&&F.call(c,L)||(R=(T=d.current)==null?void 0:T.contains)!=null&&R.call(T,L))&&L.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":Pt(u,B,!0).width},...Oe(E)}),N=_e(),q=k(()=>{let m=i.current;if(!m)return;function o(){Q(N.current,{[M.Forwards]:()=>{var c;H(m,A.First)===he.Error&&((c=s.state.afterPanelSentinel.current)==null||c.focus())},[M.Backwards]:()=>{var c;(c=s.state.button)==null||c.focus({preventScroll:!0})}})}o()}),ue=k(()=>{let m=i.current;if(!m)return;function o(){Q(N.current,{[M.Forwards]:()=>{var c;if(!s.state.button)return;let F=(c=xe(s.state.button))!=null?c:document.body,T=$e(F),R=T.indexOf(s.state.button),L=T.slice(0,R+1),ie=[...T.slice(R+1),...L];for(let be of ie.slice())if(be.dataset.headlessuiFocusGuard==="true"||D!=null&&D.contains(be)){let we=ie.indexOf(be);we!==-1&&ie.splice(we,1)}H(ie,A.First,{sorted:!1})},[M.Backwards]:()=>{var c;H(m,A.Previous)===he.Error&&((c=s.state.button)==null||c.focus())}})}o()}),fe=le();return g.createElement(ze,null,g.createElement(pe.Provider,{value:b},g.createElement(Te,{value:s.actions.refocusableClose},g.createElement(Ue,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&x&&g.createElement(ye,{id:f,ref:p,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:q}),fe({ourProps:Z,theirProps:y,slot:j,defaultTag:Tt,features:jt,visible:u,name:"Popover.Panel"}),u&&x&&g.createElement(ye,{id:P,ref:d,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Dt="div";function Rt(e,n){let t=l.useRef(null),b=U(t,n),[h,v]=l.useState([]),r=k(p=>{v(d=>{let f=d.indexOf(p);if(f!==-1){let P=d.slice();return P.splice(f,1),P}return d})}),a=k(p=>(v(d=>[...d,p]),()=>r(p))),w=k(()=>{var p;let d=xe(t.current);if(!d)return!1;let f=se(t.current);return(p=t.current)!=null&&p.contains(f)?!0:h.some(P=>{var i,_;return((i=d.getElementById(P.buttonId.current))==null?void 0:i.contains(f))||((_=d.getElementById(P.panelId.current))==null?void 0:_.contains(f))})}),y=k(p=>{for(let d of h)d.buttonId.current!==p&&d.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:w,closeOthers:y}),[a,r,w,y]),x=re({}),S=e,B={ref:b},C=le();return g.createElement(je,null,g.createElement(Se.Provider,{value:s},C({ourProps:B,theirProps:S,slot:x,defaultTag:Dt,name:"Popover.Group"})))}let Mt=ee(Bt),Me=ee(Et),At=ee(Re),Gt=ee(Re),Ae=ee(Nt),Lt=ee(Rt),Vt=Object.assign(Mt,{Button:Me,Backdrop:Gt,Overlay:At,Panel:Ae,Group:Lt});function Wt({ranges:e,selectedIndex:n,onSelect:t,isPending:b,size:h="default"}){var B;const v=l.useRef(null),r=n>0,a=n{var f;const d=C==="left"?6:-6;(f=v.current)==null||f.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:`translateX(${d}px)`}],{duration:80,easing:"ease-out"}),setTimeout(()=>{var P;p(),(P=v.current)==null||P.animate([{opacity:0,transform:`translateX(${-d}px)`},{opacity:1,transform:"translateX(0)"}],{duration:80,easing:"ease-out"})},80)},x=()=>r&&s("left",()=>t(n-1)),S=()=>a&&s("right",()=>t(n+1));return I.jsx(Vt,{className:"relative inline-flex",children:({open:C,close:p})=>I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:V("inline-flex items-center rounded-full bg-surface/80 backdrop-blur-lg depth-raised",y?"gap-0.5 p-0.5":"gap-0.5 p-1",b&&"opacity-70"),children:[I.jsx("button",{type:"button",onClick:x,disabled:!r,"aria-label":"Previous",className:V("flex items-center justify-center rounded-full transition-all duration-100","text-fg-muted hover:text-fg-primary active:scale-90","disabled:opacity-25 disabled:pointer-events-none",y?"w-5 h-5":"w-6 h-6"),children:I.jsx(ft,{className:y?"w-3 h-3":"w-3.5 h-3.5"})}),I.jsx(Me,{className:V("rounded-full cursor-pointer transition-all","bg-surface shadow-[inset_0_0_0_1.5px_var(--sys-blue)]",y?"px-2.5 py-1":"px-3 py-1.5"),children:I.jsx("span",{ref:v,className:V("block font-semibold text-fg-primary tabular-nums select-none",y?"min-w-[1.5rem] text-[11px]":"min-w-[2rem] text-xs","text-center"),children:w})}),I.jsx("button",{type:"button",onClick:S,disabled:!a,"aria-label":"Next",className:V("flex items-center justify-center rounded-full transition-all duration-100","text-fg-muted hover:text-fg-primary active:scale-90","disabled:opacity-25 disabled:pointer-events-none",y?"w-5 h-5":"w-6 h-6"),children:I.jsx(bt,{className:y?"w-3 h-3":"w-3.5 h-3.5"})})]}),I.jsx(ct,{children:C&&I.jsx(Ae,{static:!0,anchor:"bottom",className:"z-50 mt-2",children:I.jsx(dt.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:pt.dropdown,className:V("surface-elevated radius-inset p-1","shadow-[var(--neo-outer)]"),children:I.jsx("div",{className:"grid grid-cols-4 gap-0.5",children:e.map((d,f)=>I.jsx("button",{type:"button",onClick:()=>{f!==n&&t(f),p()},className:V("px-2.5 py-1.5 radius-control text-xs font-medium transition-colors",f===n?"shadow-[inset_0_0_0_1.5px_var(--sys-blue)] text-fg-primary":"text-fg-secondary hover:bg-overlay-soft"),children:d.label},d.label))})})})})]})})}const Xt=l.memo(Wt);export{Xt as T}; +import{aZ as Ge,bk as ve,da as Le,db as $e,a$ as Ve,a_ as Q,r as l,b2 as We,b3 as ee,b7 as z,b6 as U,aV as k,ba as W,dc as se,dd as Be,bf as He,bg as Ke,bl as Ye,bh as re,bm as Xe,bi as me,de as _e,df as H,dg as M,dh as A,di as he,dj as xe,bj as le,bw as g,dk as ye,dl as Pe,bn as Ce,bu as Ze,bo as Ee,bp as Fe,bq as J,br as qe,bs as Qe,bv as Oe,dm as ze,dn as Te,bx as Ue,dp as Je,dq as et,by as Ie,dr as tt,ds as nt,dt as at,aW as ot,du as st,bE as rt,dv as lt,dw as ut,dx as je,bG as it,bI as ce,j as I,c as V,d as ct,m as dt,d2 as pt}from"./index-CdntfUUz.js";import{a as ft,C as bt}from"./WorkspaceNav-BZrtCI1_.js";import{F as vt,y as mt,R as ht,T as yt,w as Pt,A as $t}from"./floating-B9JazpOE.js";var xt=Object.defineProperty,gt=(e,n,t)=>n in e?xt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ke=(e,n,t)=>(gt(e,typeof n!="symbol"?n+"":n,t),t),$=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))($||{}),St=(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))(St||{});let wt={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 ge extends Ge{constructor(n){super(n),ke(this,"actions",{close:()=>this.send({type:1}),refocusableClose:t=>{this.actions.close();let b=t?ve(t)?t:"current"in t&&ve(t.current)?t.current:this.state.button:this.state.button;b==null||b.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})}),ke(this,"selectors",{isPortalled:t=>{var b;if(!t.button||!t.panel)return!1;let h=(b=Le(t.button))!=null?b:document;for(let x of h.querySelectorAll("body > *"))if(Number(x==null?void 0:x.contains(t.button))^Number(x==null?void 0:x.contains(t.panel)))return!0;let v=$e(h),r=v.indexOf(t.button),a=(r+v.length-1)%v.length,w=(r+1)%v.length,y=v[a],s=v[w];return!t.panel.contains(y)&&!t.panel.contains(s)}});{let t=this.state.id,b=Ve.get(null);this.on(0,()=>b.actions.push(t)),this.on(1,()=>b.actions.pop(t))}}static new({id:n,__demoMode:t=!1}){return new ge({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 Q(t.type,wt,n,t)}}const Ne=l.createContext(null);function de(e){let n=l.useContext(Ne);if(n===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,de),t}return n}function Ct({id:e,__demoMode:n=!1}){let t=l.useMemo(()=>ge.new({id:e,__demoMode:n}),[]);return We(()=>t.dispose()),t}let Se=l.createContext(null);Se.displayName="PopoverGroupContext";function De(){return l.useContext(Se)}let pe=l.createContext(null);pe.displayName="PopoverPanelContext";function It(){return l.useContext(pe)}let kt="div";function Bt(e,n){var t;let b=l.useId(),{__demoMode:h=!1,...v}=e,r=Ct({id:b,__demoMode:h}),a=l.useRef(null),w=U(n,Je(u=>{a.current=u})),[y,s,x,S,B]=z(r,l.useCallback(u=>[u.popoverState,u.button,u.panel,u.buttonId,u.panelId],[])),C=et((t=a.current)!=null?t:s),p=Ie(S),d=Ie(B),f=l.useMemo(()=>({buttonId:p,panelId:d,close:r.actions.close}),[p,d,r]),P=De(),i=P==null?void 0:P.registerPopover,_=k(()=>{var u,E;let O=se((u=a.current)!=null?u:s);return(E=P==null?void 0:P.isFocusWithinPopoverGroup())!=null?E:O&&((s==null?void 0:s.contains(O))||(x==null?void 0:x.contains(O)))});l.useEffect(()=>i==null?void 0:i(f),[i,f]);let[te,ne]=tt(),G=nt(s),D=at({mainTreeNode:G,portals:te,defaultContainers:[{get current(){return r.state.button}},{get current(){return r.state.panel}}]});ot(C,"focus",u=>{var E,O,j,Z,N,q;u.target!==window&&st(u.target)&&r.state.popoverState===$.Open&&(_()||r.state.button&&r.state.panel&&(D.contains(u.target)||(O=(E=r.state.beforePanelSentinel.current)==null?void 0:E.contains)!=null&&O.call(E,u.target)||(Z=(j=r.state.afterPanelSentinel.current)==null?void 0:j.contains)!=null&&Z.call(j,u.target)||(q=(N=r.state.afterButtonSentinel.current)==null?void 0:N.contains)!=null&&q.call(N,u.target)||r.actions.close()))},!0);let K=y===$.Open;rt(K,D.resolveContainers,(u,E)=>{r.actions.close(),lt(E,ut.Loose)||(u.preventDefault(),s==null||s.focus())});let ae=re({open:y===$.Open,close:r.actions.refocusableClose}),oe=z(r,l.useCallback(u=>Q(u.popoverState,{[$.Open]:J.Open,[$.Closed]:J.Closed}),[])),Y={ref:w},X=le();return g.createElement(je,{node:G},g.createElement($t,null,g.createElement(pe.Provider,{value:null},g.createElement(Ne.Provider,{value:r},g.createElement(Te,{value:r.actions.refocusableClose},g.createElement(it,{value:oe},g.createElement(ne,null,X({ourProps:Y,theirProps:v,slot:ae,defaultTag:kt,name:"Popover"}))))))))}let _t="button";function Et(e,n){let t=l.useId(),{id:b=`headlessui-popover-button-${t}`,disabled:h=!1,autoFocus:v=!1,...r}=e,a=de("Popover.Button"),[w,y,s,x,S,B,C]=z(a,l.useCallback(o=>[o.popoverState,a.selectors.isPortalled(o),o.button,o.buttonId,o.panel,o.panelId,o.afterButtonSentinel],[])),p=l.useRef(null),d=`headlessui-focus-sentinel-${l.useId()}`,f=De(),P=f==null?void 0:f.closeOthers,i=It()!==null;l.useEffect(()=>{if(!i)return a.actions.setButtonId(b),()=>a.actions.setButtonId(null)},[i,b,a]);let[_]=l.useState(()=>Symbol()),te=U(p,n,vt(),k(o=>{if(!i){if(o)a.state.buttons.current.push(_);else{let c=a.state.buttons.current.indexOf(_);c!==-1&&a.state.buttons.current.splice(c,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=U(p,n),G=k(o=>{var c,F,T;if(i){if(a.state.popoverState===$.Closed)return;switch(o.key){case W.Space:case W.Enter:o.preventDefault(),(F=(c=o.target).click)==null||F.call(c),a.actions.close(),(T=a.state.button)==null||T.focus();break}}else switch(o.key){case W.Space:case W.Enter:o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close();break;case W.Escape:if(a.state.popoverState!==$.Open)return P==null?void 0:P(a.state.buttonId);if(!p.current)return;let R=se(p.current);if(R&&!p.current.contains(R))return;o.preventDefault(),o.stopPropagation(),a.actions.close();break}}),D=k(o=>{i||o.key===W.Space&&o.preventDefault()}),K=k(o=>{var c,F;Be(o.currentTarget)||h||(i?(a.actions.close(),(c=a.state.button)==null||c.focus()):(o.preventDefault(),o.stopPropagation(),a.state.popoverState===$.Closed?(P==null||P(a.state.buttonId),a.actions.open()):a.actions.close(),(F=a.state.button)==null||F.focus()))}),ae=k(o=>{o.preventDefault(),o.stopPropagation()}),{isFocusVisible:oe,focusProps:Y}=He({autoFocus:v}),{isHovered:X,hoverProps:u}=Ke({isDisabled:h}),{pressed:E,pressProps:O}=Ye({disabled:h}),j=w===$.Open,Z=re({open:j,active:E||j,disabled:h,hover:X,focus:oe,autofocus:v}),N=Xe(e,s),q=i?me({ref:ne,type:N,onKeyDown:G,onClick:K,disabled:h||void 0,autoFocus:v},Y,u,O):me({ref:te,id:x,type:N,"aria-expanded":w===$.Open,"aria-controls":S?B:void 0,disabled:h||void 0,autoFocus:v,onKeyDown:G,onKeyUp:D,onClick:K,onMouseDown:ae},Y,u,O),ue=_e(),fe=k(()=>{if(!ve(a.state.panel))return;let o=a.state.panel;function c(){Q(ue.current,{[M.Forwards]:()=>H(o,A.First),[M.Backwards]:()=>H(o,A.Last)})===he.Error&&H($e(xe(a.state.button)).filter(F=>F.dataset.headlessuiFocusGuard!=="true"),Q(ue.current,{[M.Forwards]:A.Next,[M.Backwards]:A.Previous}),{relativeTo:a.state.button})}c()}),m=le();return g.createElement(g.Fragment,null,m({ourProps:q,theirProps:r,slot:Z,defaultTag:_t,name:"Popover.Button"}),j&&!i&&y&&g.createElement(ye,{id:d,ref:C,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:fe}))}let Ft="div",Ot=ce.RenderStrategy|ce.Static;function Re(e,n){let t=l.useId(),{id:b=`headlessui-popover-backdrop-${t}`,transition:h=!1,...v}=e,r=de("Popover.Backdrop"),a=z(r,l.useCallback(f=>f.popoverState,[])),[w,y]=l.useState(null),s=U(n,y),x=Ee(),[S,B]=Fe(h,w,x!==null?(x&J.Open)===J.Open:a===$.Open),C=k(f=>{if(Be(f.currentTarget))return f.preventDefault();r.actions.close()}),p=re({open:a===$.Open}),d={ref:s,id:b,"aria-hidden":!0,onClick:C,...Oe(B)};return le()({ourProps:d,theirProps:v,slot:p,defaultTag:Ft,features:Ot,visible:S,name:"Popover.Backdrop"})}let Tt="div",jt=ce.RenderStrategy|ce.Static;function Nt(e,n){let t=l.useId(),{id:b=`headlessui-popover-panel-${t}`,focus:h=!1,anchor:v,portal:r=!1,modal:a=!1,transition:w=!1,...y}=e,s=de("Popover.Panel"),x=z(s,s.selectors.isPortalled),[S,B,C,p,d]=z(s,l.useCallback(m=>[m.popoverState,m.button,m.__demoMode,m.beforePanelSentinel,m.afterPanelSentinel],[])),f=`headlessui-focus-sentinel-before-${t}`,P=`headlessui-focus-sentinel-after-${t}`,i=l.useRef(null),_=mt(v),[te,ne]=ht(_),G=yt();_&&(r=!0);let[D,K]=l.useState(null),ae=U(i,n,_?te:null,s.actions.setPanel,K),oe=Ce(B),Y=Ce(i.current);Ze(()=>(s.actions.setPanelId(b),()=>s.actions.setPanelId(null)),[b,s]);let X=Ee(),[u,E]=Fe(w,D,X!==null?(X&J.Open)===J.Open:S===$.Open);qe(u,B,s.actions.close),Qe(C?!1:a&&u,Y);let O=k(m=>{var o;switch(m.key){case W.Escape:if(s.state.popoverState!==$.Open||!i.current)return;let c=se(i.current);if(c&&!i.current.contains(c))return;m.preventDefault(),m.stopPropagation(),s.actions.close(),(o=s.state.button)==null||o.focus();break}});l.useEffect(()=>{var m;e.static||S===$.Closed&&((m=e.unmount)==null||m)&&s.actions.setPanel(null)},[S,e.unmount,e.static,s]),l.useEffect(()=>{if(C||!h||S!==$.Open||!i.current)return;let m=se(i.current);i.current.contains(m)||H(i.current,A.First)},[C,h,i.current,S]);let j=re({open:S===$.Open,close:s.actions.refocusableClose}),Z=me(_?G():{},{ref:ae,id:b,onKeyDown:O,onBlur:h&&S===$.Open?m=>{var o,c,F,T,R;let L=m.relatedTarget;L&&i.current&&((o=i.current)!=null&&o.contains(L)||(s.actions.close(),((F=(c=p.current)==null?void 0:c.contains)!=null&&F.call(c,L)||(R=(T=d.current)==null?void 0:T.contains)!=null&&R.call(T,L))&&L.focus({preventScroll:!0})))}:void 0,tabIndex:-1,style:{...y.style,...ne,"--button-width":Pt(u,B,!0).width},...Oe(E)}),N=_e(),q=k(()=>{let m=i.current;if(!m)return;function o(){Q(N.current,{[M.Forwards]:()=>{var c;H(m,A.First)===he.Error&&((c=s.state.afterPanelSentinel.current)==null||c.focus())},[M.Backwards]:()=>{var c;(c=s.state.button)==null||c.focus({preventScroll:!0})}})}o()}),ue=k(()=>{let m=i.current;if(!m)return;function o(){Q(N.current,{[M.Forwards]:()=>{var c;if(!s.state.button)return;let F=(c=xe(s.state.button))!=null?c:document.body,T=$e(F),R=T.indexOf(s.state.button),L=T.slice(0,R+1),ie=[...T.slice(R+1),...L];for(let be of ie.slice())if(be.dataset.headlessuiFocusGuard==="true"||D!=null&&D.contains(be)){let we=ie.indexOf(be);we!==-1&&ie.splice(we,1)}H(ie,A.First,{sorted:!1})},[M.Backwards]:()=>{var c;H(m,A.Previous)===he.Error&&((c=s.state.button)==null||c.focus())}})}o()}),fe=le();return g.createElement(ze,null,g.createElement(pe.Provider,{value:b},g.createElement(Te,{value:s.actions.refocusableClose},g.createElement(Ue,{enabled:r?e.static||u:!1,ownerDocument:oe},u&&x&&g.createElement(ye,{id:f,ref:p,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:q}),fe({ourProps:Z,theirProps:y,slot:j,defaultTag:Tt,features:jt,visible:u,name:"Popover.Panel"}),u&&x&&g.createElement(ye,{id:P,ref:d,features:Pe.Focusable,"data-headlessui-focus-guard":!0,as:"button",type:"button",onFocus:ue})))))}let Dt="div";function Rt(e,n){let t=l.useRef(null),b=U(t,n),[h,v]=l.useState([]),r=k(p=>{v(d=>{let f=d.indexOf(p);if(f!==-1){let P=d.slice();return P.splice(f,1),P}return d})}),a=k(p=>(v(d=>[...d,p]),()=>r(p))),w=k(()=>{var p;let d=xe(t.current);if(!d)return!1;let f=se(t.current);return(p=t.current)!=null&&p.contains(f)?!0:h.some(P=>{var i,_;return((i=d.getElementById(P.buttonId.current))==null?void 0:i.contains(f))||((_=d.getElementById(P.panelId.current))==null?void 0:_.contains(f))})}),y=k(p=>{for(let d of h)d.buttonId.current!==p&&d.close()}),s=l.useMemo(()=>({registerPopover:a,unregisterPopover:r,isFocusWithinPopoverGroup:w,closeOthers:y}),[a,r,w,y]),x=re({}),S=e,B={ref:b},C=le();return g.createElement(je,null,g.createElement(Se.Provider,{value:s},C({ourProps:B,theirProps:S,slot:x,defaultTag:Dt,name:"Popover.Group"})))}let Mt=ee(Bt),Me=ee(Et),At=ee(Re),Gt=ee(Re),Ae=ee(Nt),Lt=ee(Rt),Vt=Object.assign(Mt,{Button:Me,Backdrop:Gt,Overlay:At,Panel:Ae,Group:Lt});function Wt({ranges:e,selectedIndex:n,onSelect:t,isPending:b,size:h="default"}){var B;const v=l.useRef(null),r=n>0,a=n{var f;const d=C==="left"?6:-6;(f=v.current)==null||f.animate([{opacity:1,transform:"translateX(0)"},{opacity:0,transform:`translateX(${d}px)`}],{duration:80,easing:"ease-out"}),setTimeout(()=>{var P;p(),(P=v.current)==null||P.animate([{opacity:0,transform:`translateX(${-d}px)`},{opacity:1,transform:"translateX(0)"}],{duration:80,easing:"ease-out"})},80)},x=()=>r&&s("left",()=>t(n-1)),S=()=>a&&s("right",()=>t(n+1));return I.jsx(Vt,{className:"relative inline-flex",children:({open:C,close:p})=>I.jsxs(I.Fragment,{children:[I.jsxs("div",{className:V("inline-flex items-center rounded-full bg-surface/80 backdrop-blur-lg depth-raised",y?"gap-0.5 p-0.5":"gap-0.5 p-1",b&&"opacity-70"),children:[I.jsx("button",{type:"button",onClick:x,disabled:!r,"aria-label":"Previous",className:V("flex items-center justify-center rounded-full transition-all duration-100","text-fg-muted hover:text-fg-primary active:scale-90","disabled:opacity-25 disabled:pointer-events-none",y?"w-5 h-5":"w-6 h-6"),children:I.jsx(ft,{className:y?"w-3 h-3":"w-3.5 h-3.5"})}),I.jsx(Me,{className:V("rounded-full cursor-pointer transition-all","bg-surface shadow-[inset_0_0_0_1.5px_var(--sys-blue)]",y?"px-2.5 py-1":"px-3 py-1.5"),children:I.jsx("span",{ref:v,className:V("block font-semibold text-fg-primary tabular-nums select-none",y?"min-w-[1.5rem] text-[11px]":"min-w-[2rem] text-xs","text-center"),children:w})}),I.jsx("button",{type:"button",onClick:S,disabled:!a,"aria-label":"Next",className:V("flex items-center justify-center rounded-full transition-all duration-100","text-fg-muted hover:text-fg-primary active:scale-90","disabled:opacity-25 disabled:pointer-events-none",y?"w-5 h-5":"w-6 h-6"),children:I.jsx(bt,{className:y?"w-3 h-3":"w-3.5 h-3.5"})})]}),I.jsx(ct,{children:C&&I.jsx(Ae,{static:!0,anchor:"bottom",className:"z-50 mt-2",children:I.jsx(dt.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:pt.dropdown,className:V("surface-elevated radius-inset p-1","shadow-[var(--neo-outer)]"),children:I.jsx("div",{className:"grid grid-cols-4 gap-0.5",children:e.map((d,f)=>I.jsx("button",{type:"button",onClick:()=>{f!==n&&t(f),p()},className:V("px-2.5 py-1.5 radius-control text-xs font-medium transition-colors",f===n?"shadow-[inset_0_0_0_1.5px_var(--sys-blue)] text-fg-primary":"text-fg-secondary hover:bg-overlay-soft"),children:d.label},d.label))})})})})]})})}const Xt=l.memo(Wt);export{Xt as T}; diff --git a/frontend/dist/assets/WorkspaceNav-ClxMgBhr.js b/frontend/dist/assets/WorkspaceNav-BZrtCI1_.js similarity index 99% rename from frontend/dist/assets/WorkspaceNav-ClxMgBhr.js rename to frontend/dist/assets/WorkspaceNav-BZrtCI1_.js index dd1f2076..3c219726 100644 --- a/frontend/dist/assets/WorkspaceNav-ClxMgBhr.js +++ b/frontend/dist/assets/WorkspaceNav-BZrtCI1_.js @@ -1,4 +1,4 @@ -import{e as v,gL as k,r as l,j as o,c as f,gM as x}from"./index-CAHLMlrb.js";/** +import{e as v,gL as k,r as l,j as o,c as f,gM as x}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/activity-BAV-4Rxi.js b/frontend/dist/assets/activity-02b04F6Q.js similarity index 89% rename from frontend/dist/assets/activity-BAV-4Rxi.js rename to frontend/dist/assets/activity-02b04F6Q.js index bb02b8d5..b69e4339 100644 --- a/frontend/dist/assets/activity-BAV-4Rxi.js +++ b/frontend/dist/assets/activity-02b04F6Q.js @@ -1,4 +1,4 @@ -import{e as t}from"./index-CAHLMlrb.js";/** +import{e as t}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/antenna-CpeQ5t_a.js b/frontend/dist/assets/antenna-BUervkWx.js similarity index 91% rename from frontend/dist/assets/antenna-CpeQ5t_a.js rename to frontend/dist/assets/antenna-BUervkWx.js index 8b9b65ba..2b2fae55 100644 --- a/frontend/dist/assets/antenna-CpeQ5t_a.js +++ b/frontend/dist/assets/antenna-BUervkWx.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/arrow-down-COuxy1kb.js b/frontend/dist/assets/arrow-down-npn6XFzD.js similarity index 86% rename from frontend/dist/assets/arrow-down-COuxy1kb.js rename to frontend/dist/assets/arrow-down-npn6XFzD.js index 9553e7d5..83580203 100644 --- a/frontend/dist/assets/arrow-down-COuxy1kb.js +++ b/frontend/dist/assets/arrow-down-npn6XFzD.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-CAHLMlrb.js";/** +import{e as o}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/arrow-right-C5Fuejc9.js b/frontend/dist/assets/arrow-right-DDhVPQqL.js similarity index 86% rename from frontend/dist/assets/arrow-right-C5Fuejc9.js rename to frontend/dist/assets/arrow-right-DDhVPQqL.js index 51af6a00..e3013557 100644 --- a/frontend/dist/assets/arrow-right-C5Fuejc9.js +++ b/frontend/dist/assets/arrow-right-DDhVPQqL.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-CAHLMlrb.js";/** +import{e as o}from"./index-CdntfUUz.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-BmXPNI2T.js b/frontend/dist/assets/arrow-up-C1m6otp9.js similarity index 86% rename from frontend/dist/assets/arrow-up-BmXPNI2T.js rename to frontend/dist/assets/arrow-up-C1m6otp9.js index df4ee13f..c1a84b83 100644 --- a/frontend/dist/assets/arrow-up-BmXPNI2T.js +++ b/frontend/dist/assets/arrow-up-C1m6otp9.js @@ -1,4 +1,4 @@ -import{e as o}from"./index-CAHLMlrb.js";/** +import{e as o}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/backup-K6eA_iA5.js b/frontend/dist/assets/backup-Zafc7Byp.js similarity index 79% rename from frontend/dist/assets/backup-K6eA_iA5.js rename to frontend/dist/assets/backup-Zafc7Byp.js index 93fc58b5..84b4ddde 100644 --- a/frontend/dist/assets/backup-K6eA_iA5.js +++ b/frontend/dist/assets/backup-Zafc7Byp.js @@ -1 +1 @@ -import{dy as i}from"./index-CAHLMlrb.js";async function o(t=!1){return i(`/api/config_export${t?"?include_secrets=true":""}`)}async function r(t){return i("/api/config_import",{method:"POST",body:JSON.stringify({config:t})})}async function s(){return i("/api/identity_export")}export{s as a,o as e,r as i}; +import{dy as i}from"./index-CdntfUUz.js";async function o(t=!1){return i(`/api/config_export${t?"?include_secrets=true":""}`)}async function r(t){return i("/api/config_import",{method:"POST",body:JSON.stringify({config:t})})}async function s(){return i("/api/identity_export")}export{s as a,o as e,r as i}; diff --git a/frontend/dist/assets/car-DRknVB1N.js b/frontend/dist/assets/car-B1uDaAVL.js similarity index 92% rename from frontend/dist/assets/car-DRknVB1N.js rename to frontend/dist/assets/car-B1uDaAVL.js index 3b558746..95e8ec42 100644 --- a/frontend/dist/assets/car-DRknVB1N.js +++ b/frontend/dist/assets/car-B1uDaAVL.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.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-rMBLw-SJ.js b/frontend/dist/assets/chat-utils-D8ZwjCT3.js similarity index 97% rename from frontend/dist/assets/chat-utils-rMBLw-SJ.js rename to frontend/dist/assets/chat-utils-D8ZwjCT3.js index 98814f7a..fd292730 100644 --- a/frontend/dist/assets/chat-utils-rMBLw-SJ.js +++ b/frontend/dist/assets/chat-utils-D8ZwjCT3.js @@ -1 +1 @@ -import{r as g,Z as p,ej as d,Y as l,N as E}from"./index-CAHLMlrb.js";function x(n){const e=parseInt(n.slice(1,3),16)/255,t=parseInt(n.slice(3,5),16)/255,r=parseInt(n.slice(5,7),16)/255,o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(o===s)return[0,0,a];const i=o-s,u=a>.5?i/(2-o-s):i/(o+s);let c=0;return o===e?c=((t-r)/i+(t(c<0&&(c+=1),c>1&&(c-=1),c<1/6?i+(u-i)*6*c:c<1/2?u:c<2/3?i+(u-i)*(2/3-c)*6:i),o=t<.5?t*(1+e):t+e-t*e,s=2*t-o,a=i=>Math.round(i*255).toString(16).padStart(2,"0");return`#${a(r(s,o,n+1/3))}${a(r(s,o,n))}${a(r(s,o,n-1/3))}`}function S(n,e,t){let r=e[0]-n[0];return r>.5&&(r-=1),r<-.5&&(r+=1),[(n[0]+r*t+1)%1,n[1]+(e[1]-n[1])*t,n[2]+(e[2]-n[2])*t]}const j=[l.red,l.orange,l.amber,l.green,l.teal,l.cyan,l.blue,l.indigo,l.purple,l.pink],h=4,m=[];{const n=j.map(x);for(let e=0;e3||e.replace(f,"").replace(/[\u200D\uFE0F\s]/g,"").length>0?0:t.length}function y(n){const e=n.match(f);if(e&&e.length>0){const t=e[0],r=n.replace(f,"").trim();return{emoji:t,cleanName:r||n}}return{emoji:null,cleanName:n}}function T(n){const{cleanName:e}=y(n),t=e.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const o=Array.from(t[0])[0]||"",s=Array.from(t[1])[0]||"";return(o+s).toUpperCase()}return Array.from(e).slice(0,2).join("").toUpperCase()}function I(n,e=d()){return E(new Date(n*1e3),e)}function A(n,e){const t=/@\[([^\]]+)\]/g,r=[];let o=0,s;const a=e!=null&&e.isOutgoing?p[200]:l.blue,i=e==null?void 0:e.onMentionClick;for(;(s=t.exec(n))!==null;){s.index>o&&r.push(n.slice(o,s.index));const u=s[1];r.push(g.createElement(i?"button":"span",{key:s.index,className:i?"font-bold hover:underline underline-offset-2 cursor-pointer":"font-bold",style:{color:a},...i&&{type:"button",onClick:c=>{c.stopPropagation(),i(u)}}},u)),o=s.index+s[0].length}return o0?r:n}export{T as a,I as b,M as c,y as e,A as f,b as g}; +import{r as g,Z as p,ej as d,Y as l,N as E}from"./index-CdntfUUz.js";function x(n){const e=parseInt(n.slice(1,3),16)/255,t=parseInt(n.slice(3,5),16)/255,r=parseInt(n.slice(5,7),16)/255,o=Math.max(e,t,r),s=Math.min(e,t,r),a=(o+s)/2;if(o===s)return[0,0,a];const i=o-s,u=a>.5?i/(2-o-s):i/(o+s);let c=0;return o===e?c=((t-r)/i+(t(c<0&&(c+=1),c>1&&(c-=1),c<1/6?i+(u-i)*6*c:c<1/2?u:c<2/3?i+(u-i)*(2/3-c)*6:i),o=t<.5?t*(1+e):t+e-t*e,s=2*t-o,a=i=>Math.round(i*255).toString(16).padStart(2,"0");return`#${a(r(s,o,n+1/3))}${a(r(s,o,n))}${a(r(s,o,n-1/3))}`}function S(n,e,t){let r=e[0]-n[0];return r>.5&&(r-=1),r<-.5&&(r+=1),[(n[0]+r*t+1)%1,n[1]+(e[1]-n[1])*t,n[2]+(e[2]-n[2])*t]}const j=[l.red,l.orange,l.amber,l.green,l.teal,l.cyan,l.blue,l.indigo,l.purple,l.pink],h=4,m=[];{const n=j.map(x);for(let e=0;e3||e.replace(f,"").replace(/[\u200D\uFE0F\s]/g,"").length>0?0:t.length}function y(n){const e=n.match(f);if(e&&e.length>0){const t=e[0],r=n.replace(f,"").trim();return{emoji:t,cleanName:r||n}}return{emoji:null,cleanName:n}}function T(n){const{cleanName:e}=y(n),t=e.split(/[\s-_]+/).filter(Boolean);if(t.length>=2){const o=Array.from(t[0])[0]||"",s=Array.from(t[1])[0]||"";return(o+s).toUpperCase()}return Array.from(e).slice(0,2).join("").toUpperCase()}function I(n,e=d()){return E(new Date(n*1e3),e)}function A(n,e){const t=/@\[([^\]]+)\]/g,r=[];let o=0,s;const a=e!=null&&e.isOutgoing?p[200]:l.blue,i=e==null?void 0:e.onMentionClick;for(;(s=t.exec(n))!==null;){s.index>o&&r.push(n.slice(o,s.index));const u=s[1];r.push(g.createElement(i?"button":"span",{key:s.index,className:i?"font-bold hover:underline underline-offset-2 cursor-pointer":"font-bold",style:{color:a},...i&&{type:"button",onClick:c=>{c.stopPropagation(),i(u)}}},u)),o=s.index+s[0].length}return o0?r:n}export{T as a,I as b,M as c,y as e,A as f,b as g}; diff --git a/frontend/dist/assets/check-check-CV8IAFCF.js b/frontend/dist/assets/check-check-D7HV9aAg.js similarity index 88% rename from frontend/dist/assets/check-check-CV8IAFCF.js rename to frontend/dist/assets/check-check-D7HV9aAg.js index 33c8410d..9c7164e7 100644 --- a/frontend/dist/assets/check-check-CV8IAFCF.js +++ b/frontend/dist/assets/check-check-D7HV9aAg.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/chevron-up-51iePx4b.js b/frontend/dist/assets/chevron-up-CFeeYtPO.js similarity index 99% rename from frontend/dist/assets/chevron-up-51iePx4b.js rename to frontend/dist/assets/chevron-up-CFeeYtPO.js index 98ff2344..5e2eefd3 100644 --- a/frontend/dist/assets/chevron-up-51iePx4b.js +++ b/frontend/dist/assets/chevron-up-CFeeYtPO.js @@ -1,4 +1,4 @@ -import{r as x,bb as F,e as R}from"./index-CAHLMlrb.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,E=(g,w)=>{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,E=(g,w)=>{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,l)=>Math.abs(r-l)<1.01,T=(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}},k=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?()=>{}:T(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 B{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:k,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],y=v!==void 0?c[v]:void 0;b=y?y.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 E=h.get(m),g=typeof E=="number"?E:this.options.estimateSize(a),w=b+g;c[a]={index:a,start:b,size:g,end:w,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?H({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[A(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}_(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 A=(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 H({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=A(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"?x.useLayoutEffect:x.useEffect;function N({useFlushSync:r=!0,...l}){const e=x.useReducer(()=>({}),{})[1],s={...l,onChange:(n,o)=>{var i;r&&o?F.flushSync(e):e(),(i=l.onChange)==null||i.call(l,n,o)}},[t]=x.useState(()=>new B(s));return t.setOptions(s),I(()=>t._didMount(),[]),I(()=>t._willUpdate()),t}function q(r){return N({observeElementRect:D,observeElementOffset:L,scrollToFn:P,...r})}/** diff --git a/frontend/dist/assets/circle-alert-D6qb8WSp.js b/frontend/dist/assets/circle-alert-8MQex_uC.js similarity index 90% rename from frontend/dist/assets/circle-alert-D6qb8WSp.js rename to frontend/dist/assets/circle-alert-8MQex_uC.js index aba4d21c..2688647e 100644 --- a/frontend/dist/assets/circle-alert-D6qb8WSp.js +++ b/frontend/dist/assets/circle-alert-8MQex_uC.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.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-BPKfem7i.js b/frontend/dist/assets/circle-question-mark-EfmCIEVS.js similarity index 89% rename from frontend/dist/assets/circle-question-mark-BPKfem7i.js rename to frontend/dist/assets/circle-question-mark-EfmCIEVS.js index 105a858b..1454e706 100644 --- a/frontend/dist/assets/circle-question-mark-BPKfem7i.js +++ b/frontend/dist/assets/circle-question-mark-EfmCIEVS.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.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-DEeBh2xe.js b/frontend/dist/assets/circle-stop-0gJGQm_q.js similarity index 94% rename from frontend/dist/assets/circle-stop-DEeBh2xe.js rename to frontend/dist/assets/circle-stop-0gJGQm_q.js index 41e82d8c..5f4e2cc6 100644 --- a/frontend/dist/assets/circle-stop-DEeBh2xe.js +++ b/frontend/dist/assets/circle-stop-0gJGQm_q.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/clock-DB7tKCHV.js b/frontend/dist/assets/clock-DKukpMjT.js similarity index 87% rename from frontend/dist/assets/clock-DB7tKCHV.js rename to frontend/dist/assets/clock-DKukpMjT.js index 5c5c41a7..aae7e11a 100644 --- a/frontend/dist/assets/clock-DB7tKCHV.js +++ b/frontend/dist/assets/clock-DKukpMjT.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/compass-Dolk-EbB.js b/frontend/dist/assets/compass-CPwUyboh.js similarity index 89% rename from frontend/dist/assets/compass-Dolk-EbB.js rename to frontend/dist/assets/compass-CPwUyboh.js index 01270982..ede42978 100644 --- a/frontend/dist/assets/compass-Dolk-EbB.js +++ b/frontend/dist/assets/compass-CPwUyboh.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/consumer-registry-Bsx-B9R6.js b/frontend/dist/assets/consumer-registry-K46Bg-WH.js similarity index 92% rename from frontend/dist/assets/consumer-registry-Bsx-B9R6.js rename to frontend/dist/assets/consumer-registry-K46Bg-WH.js index 6f035c51..1a79ffbe 100644 --- a/frontend/dist/assets/consumer-registry-Bsx-B9R6.js +++ b/frontend/dist/assets/consumer-registry-K46Bg-WH.js @@ -1 +1 @@ -import{c7 as n,r as i}from"./index-CAHLMlrb.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{c7 as n,r as i}from"./index-CdntfUUz.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/database-BeT3SO6w.js b/frontend/dist/assets/database-D8ZiJ_7E.js similarity index 90% rename from frontend/dist/assets/database-BeT3SO6w.js rename to frontend/dist/assets/database-D8ZiJ_7E.js index da6a3830..b43298f3 100644 --- a/frontend/dist/assets/database-BeT3SO6w.js +++ b/frontend/dist/assets/database-D8ZiJ_7E.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/easing-rWsWG9jZ.js b/frontend/dist/assets/easing-BV_uJNeb.js similarity index 57% rename from frontend/dist/assets/easing-rWsWG9jZ.js rename to frontend/dist/assets/easing-BV_uJNeb.js index ee290716..4054f081 100644 --- a/frontend/dist/assets/easing-rWsWG9jZ.js +++ b/frontend/dist/assets/easing-BV_uJNeb.js @@ -1 +1 @@ -import{hi as s}from"./index-CAHLMlrb.js";const e=s(.65,0,.35,1),t=s(.33,1,.68,1),c=s(.33,.67,.67,1),u=s(.76,0,.24,1);export{t as a,e as b,c,u as e}; +import{hi as s}from"./index-CdntfUUz.js";const e=s(.65,0,.35,1),t=s(.33,1,.68,1),c=s(.33,.67,.67,1),u=s(.76,0,.24,1);export{t as a,e as b,c,u as e}; diff --git a/frontend/dist/assets/element-movement-SAlxPSM7.js b/frontend/dist/assets/element-movement-rOMuf_3T.js similarity index 97% rename from frontend/dist/assets/element-movement-SAlxPSM7.js rename to frontend/dist/assets/element-movement-rOMuf_3T.js index ca16a807..00a86f10 100644 --- a/frontend/dist/assets/element-movement-SAlxPSM7.js +++ b/frontend/dist/assets/element-movement-rOMuf_3T.js @@ -1 +1 @@ -import{r as c,aV as p,dd as v,gE as h,gF as m,du as x,bz as $}from"./index-CAHLMlrb.js";var w=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(w||{});function D(e){let n=c.useRef(null),t=p(u=>{n.current=u.pointerType,!v(u.currentTarget)&&u.pointerType==="mouse"&&u.button===w.Left&&(u.preventDefault(),e(u))}),s=p(u=>{n.current!=="mouse"&&(v(u.currentTarget)||e(u))});return{onPointerDown:t,onClick:s}}var R=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(R||{});const M={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,b=5;function C(e,{trigger:n,action:t,close:s,select:u}){let r=c.useRef(null),o=c.useRef(null),i=c.useRef(null);h(e&&n!==null,"pointerdown",l=>{m(l==null?void 0:l.target)&&n!=null&&n.contains(l.target)&&(o.current=l.x,i.current=l.y,r.current=l.timeStamp)}),h(e&&n!==null,"pointerup",l=>{var a,d;let f=r.current;if(f===null||(r.current=null,!x(l.target))||Math.abs(l.x-((a=o.current)!=null?a:l.x))I&&(u(g.target),s());break}case 2:{s();break}}},{capture:!0})}function k(e){return[e.screenX,e.screenY]}function E(){let e=c.useRef([-1,-1]);return{wasMoved(n){let t=k(n);return e.current[0]===t[0]&&e.current[1]===t[1]?!1:(e.current=t,!0)},update(n){e.current=k(n)}}}function L(e){throw new Error("Unexpected object: "+e)}var S=(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))(S||{});function N(e,n){let t=n.resolveItems();if(t.length<=0)return null;let s=n.resolveActiveIndex(),u=s??-1;switch(e.focus){case 0:{for(let r=0;r=0;--r)if(!n.resolveDisabled(t[r],r,t))return r;return s}case 2:{for(let r=u+1;r=0;--r)if(!n.resolveDisabled(t[r],r,t))return r;return s}case 4:{for(let r=0;r({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function T(e){let n=e.getBoundingClientRect();return`${n.x},${n.y}`}function F(e,n,t){let s=$();if(n.kind==="Tracked"){let u=function(){r!==T(e)&&(s.dispose(),t())},{position:r}=n,o=new ResizeObserver(u);o.observe(e),s.add(()=>o.disconnect()),s.addEventListener(window,"scroll",u,{passive:!0}),s.addEventListener(window,"resize",u)}return()=>s.dispose()}export{C as L,M as S,z as a,T as b,S as c,N as f,w as g,F as p,D as s,E as u}; +import{r as c,aV as p,dd as v,gE as h,gF as m,du as x,bz as $}from"./index-CdntfUUz.js";var w=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(w||{});function D(e){let n=c.useRef(null),t=p(u=>{n.current=u.pointerType,!v(u.currentTarget)&&u.pointerType==="mouse"&&u.button===w.Left&&(u.preventDefault(),e(u))}),s=p(u=>{n.current!=="mouse"&&(v(u.currentTarget)||e(u))});return{onPointerDown:t,onClick:s}}var R=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(R||{});const M={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},I=200,b=5;function C(e,{trigger:n,action:t,close:s,select:u}){let r=c.useRef(null),o=c.useRef(null),i=c.useRef(null);h(e&&n!==null,"pointerdown",l=>{m(l==null?void 0:l.target)&&n!=null&&n.contains(l.target)&&(o.current=l.x,i.current=l.y,r.current=l.timeStamp)}),h(e&&n!==null,"pointerup",l=>{var a,d;let f=r.current;if(f===null||(r.current=null,!x(l.target))||Math.abs(l.x-((a=o.current)!=null?a:l.x))I&&(u(g.target),s());break}case 2:{s();break}}},{capture:!0})}function k(e){return[e.screenX,e.screenY]}function E(){let e=c.useRef([-1,-1]);return{wasMoved(n){let t=k(n);return e.current[0]===t[0]&&e.current[1]===t[1]?!1:(e.current=t,!0)},update(n){e.current=k(n)}}}function L(e){throw new Error("Unexpected object: "+e)}var S=(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))(S||{});function N(e,n){let t=n.resolveItems();if(t.length<=0)return null;let s=n.resolveActiveIndex(),u=s??-1;switch(e.focus){case 0:{for(let r=0;r=0;--r)if(!n.resolveDisabled(t[r],r,t))return r;return s}case 2:{for(let r=u+1;r=0;--r)if(!n.resolveDisabled(t[r],r,t))return r;return s}case 4:{for(let r=0;r({kind:"Tracked",position:e}),Moved:{kind:"Moved"}};function T(e){let n=e.getBoundingClientRect();return`${n.x},${n.y}`}function F(e,n,t){let s=$();if(n.kind==="Tracked"){let u=function(){r!==T(e)&&(s.dispose(),t())},{position:r}=n,o=new ResizeObserver(u);o.observe(e),s.add(()=>o.disconnect()),s.addEventListener(window,"scroll",u,{passive:!0}),s.addEventListener(window,"resize",u)}return()=>s.dispose()}export{C as L,M as S,z as a,T as b,S as c,N as f,w as g,F as p,D as s,E as u}; diff --git a/frontend/dist/assets/eye-DQ-O4VIh.js b/frontend/dist/assets/eye-Dc2SU7n8.js similarity index 89% rename from frontend/dist/assets/eye-DQ-O4VIh.js rename to frontend/dist/assets/eye-Dc2SU7n8.js index b8c8928d..f24daebc 100644 --- a/frontend/dist/assets/eye-DQ-O4VIh.js +++ b/frontend/dist/assets/eye-Dc2SU7n8.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/fieldset-DJGo6TXB.js b/frontend/dist/assets/fieldset-BJg_kfe0.js similarity index 80% rename from frontend/dist/assets/fieldset-DJGo6TXB.js rename to frontend/dist/assets/fieldset-BJg_kfe0.js index e6d5314d..32fc744c 100644 --- a/frontend/dist/assets/fieldset-DJGo6TXB.js +++ b/frontend/dist/assets/fieldset-BJg_kfe0.js @@ -1 +1 @@ -import{j as a,dZ as l,c as i,b4 as n,gD as c}from"./index-CAHLMlrb.js";function x({disabled:e,className:s,children:t}){return a.jsx(l,{disabled:e,className:i("flex flex-col gap-2",s),children:t})}function m({required:e,className:s,children:t,...r}){return a.jsxs(n,{className:i("text-sm font-medium text-fg-primary select-none","data-[disabled]:opacity-50",r.title&&"cursor-help",s),...r,children:[t,e&&a.jsx("span",{className:"text-sys-red ml-0.5","aria-hidden":"true",children:"*"})]})}function o({className:e,children:s,...t}){return a.jsx(c,{className:i("text-sm text-fg-muted","data-[disabled]:opacity-50",e),...t,children:s})}export{o as D,x as F,m as L}; +import{j as a,dZ as l,c as i,b4 as n,gD as c}from"./index-CdntfUUz.js";function x({disabled:e,className:s,children:t}){return a.jsx(l,{disabled:e,className:i("flex flex-col gap-2",s),children:t})}function m({required:e,className:s,children:t,...r}){return a.jsxs(n,{className:i("text-sm font-medium text-fg-primary select-none","data-[disabled]:opacity-50",r.title&&"cursor-help",s),...r,children:[t,e&&a.jsx("span",{className:"text-sys-red ml-0.5","aria-hidden":"true",children:"*"})]})}function o({className:e,children:s,...t}){return a.jsx(c,{className:i("text-sm text-fg-muted","data-[disabled]:opacity-50",e),...t,children:s})}export{o as D,x as F,m as L}; diff --git a/frontend/dist/assets/floating-BAAXcOzg.js b/frontend/dist/assets/floating-B9JazpOE.js similarity index 99% rename from frontend/dist/assets/floating-BAAXcOzg.js rename to frontend/dist/assets/floating-B9JazpOE.js index 10521b10..3abe8a50 100644 --- a/frontend/dist/assets/floating-BAAXcOzg.js +++ b/frontend/dist/assets/floating-B9JazpOE.js @@ -1 +1 @@ -import{r as g,bu as ot,bz as de,bb as ct,gG as me,bk as ge,aV as Kt,b8 as he}from"./index-CAHLMlrb.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 Nn(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 $(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 pe=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)&&!pe.has(r)}const we=new Set(["table","td","th"]);function xe(t){return we.has(Q(t))}const ye=[":popover-open",":modal"];function mt(t){return ye.some(e=>{try{return t.matches(e)}catch{return!1}})}const ve=["transform","translate","scale","rotate","perspective"],be=["transform","translate","scale","rotate","perspective","filter"],Re=["paint","layout","strict","content"];function Et(t){const e=Ot(),n=$(t)?W(t):t;return ve.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)||be.some(o=>(n.willChange||"").includes(o))||Re.some(o=>(n.contain||"").includes(o))}function Ce(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 Se=new Set(["html","body","#document"]);function J(t){return Se.has(Q(t))}function W(t){return B(t).getComputedStyle(t)}function gt(t){return $(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 Ae(){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}),Ee={left:"right",right:"left",bottom:"top",top:"bottom"},Oe={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 Te=new Set(["top","bottom"]);function Y(t){return Te.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 Me(t){const e=ft(t);return[St(t),e,St(e)]}function St(t){return t.replace(/start|end/g,e=>Oe[e])}const $t=["left","right"],kt=["right","left"],Pe=["top","bottom"],De=["bottom","top"];function Le(t,e,n){switch(t){case"top":case"bottom":return n?e?kt:$t:e?$t:kt;case"left":case"right":return e?Pe:De;default:return[]}}function He(t,e,n,o){const r=it(t);let i=Le(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=>Ee[e])}function $e(t){return{top:0,right:0,bottom:0,left:0,...t}}function ke(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 Ie=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;pF<=0)){var O,k;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,j=A[F];if(j&&(!(m==="alignment"?v!==Y(j):!1)||T.every(C=>Y(C.placement)===v?C.overflows[0]>0:!0)))return{data:{index:F,overflows:T},reset:{placement:j}};let M=(k=T.filter(I=>I.overflows[0]<=0).sort((I,C)=>I.overflows[1]-C.overflows[1])[0])==null?void 0:k.placement;if(!M)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&&(M=I);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}},Ne=new Set(["left","top"]);async function We(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=Ne.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 Ve=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 We(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}}}}},_e=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}}}}}},ze=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),k=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*(k!==0||P!==0?k+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 $(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 je=V(0);function ne(t){const e=B(t);return!Ot()||!e.visualViewport?je:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ye(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?$(o)&&(s=G(o)):s=G(t));const l=Ye(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&&$(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 qe(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 Xe(t){return Array.from(t.getClientRects())}function Ue(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 Ke(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 Ge=new Set(["absolute","fixed"]);function Je(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=Ke(t,n);else if(e==="document")o=Ue(z(t));else if($(e))o=Je(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||!$(n)||J(n)?!1:W(n).position==="fixed"||re(n,e)}function Qe(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(l=>$(l)&&Q(l)!=="body"),r=null;const i=W(t).position==="fixed";let s=i?q(t):t;for(;$(s)&&!J(s);){const l=W(s),c=Et(s);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&Ge.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 Ze(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?mt(e)?[]:Qe(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 tn(t){const{width:e,height:n}=ee(t);return{width:e,height:n}}function en(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($(r)&&!xt(r))return r;r=q(r)}return n}let o=Wt(t,e);for(;o&&xe(o)&&xt(o);)o=Wt(o,e);return o&&J(o)&&xt(o)&&!Et(o)?n:o||Ce(t)||n}const nn=async function(t){const e=this.getOffsetParent||ie,n=this.getDimensions,o=await n(t.floating);return{reference:en(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function on(t){return W(t).direction==="rtl"}const rn={convertOffsetParentRelativeRectToViewportRelativeRect:qe,getDocumentElement:z,getClippingRect:Ze,getOffsetParent:ie,getElementRects:nn,getClientRects:Xe,getDimensions:tn,getScale:G,isElement:$,isRTL:on};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function sn(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 ln(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?sn(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,cn=Ve,fn=_e,an=Be,un=ze,dn=(t,e,n)=>{const o=new Map,r={platform:rn,...n},i={...r.platform,_c:o};return Ie(t,e,{...r,platform:i})};var mn=typeof document<"u",gn=function(){},lt=mn?g.useLayoutEffect:gn;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 hn(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),k=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),dn(S.current,A.current,C).then(E=>{const H={...E,isPositioned:k.current!==!1};F.current&&!ut(L.current,H)&&(L.current=H,ct.flushSync(()=>{m(H)}))})},[h,e,n,O,k]);lt(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,m(C=>({...C,isPositioned:!1})))},[f]);const F=g.useRef(!1);lt(()=>(F.current=!0,()=>{F.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]),M=g.useMemo(()=>({reference:b,floating:R}),[b,R]),I=g.useMemo(()=>{const C={position:n,left:0,top:0};if(!M.floating)return C;const E=Vt(M.floating,a.x),H=Vt(M.floating,a.y);return l?{...C,transform:"translate("+E+"px, "+H+"px)",...le(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:H}},[n,l,M.floating,a.x,a.y]);return g.useMemo(()=>({...a,update:P,refs:j,elements:M,floatingStyles:I}),[a,P,j,M,I])}const ce=(t,e)=>({...cn(t),options:[t,e]}),pn=(t,e)=>({...fn(t),options:[t,e]}),wn=(t,e)=>({...an(t),options:[t,e]}),xn=(t,e)=>({...un(t),options:[t,e]}),fe={...me},yn=fe.useInsertionEffect,vn=yn||(t=>t());function ae(t){const e=g.useRef(()=>{});return vn(()=>{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)+bn++;function Rn(){const[t,e]=g.useState(()=>_t?zt():void 0);return At(()=>{t==null&&e(zt())},[]),g.useEffect(()=>{_t=!0},[]),t}const Cn=fe.useId,Sn=Cn||Rn;function An(){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 En=g.createContext(null),On=g.createContext(null),Tn=()=>{var t;return((t=g.useContext(En))==null?void 0:t.id)||null},Fn=()=>g.useContext(On),Mn="data-floating-ui-focusable";function Pn(t){const{open:e=!1,onOpenChange:n,elements:o}=t,r=Sn(),i=g.useRef({}),[s]=g.useState(()=>An()),l=Tn()!=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 Dn(t){t===void 0&&(t={});const{nodeId:e}=t,n=Pn({...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=hn({...t,elements:{...r,...l&&{reference:l}}}),d=g.useCallback(x=>{const b=$(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(b),u.refs.setReference(b)},[u.refs]),p=g.useCallback(x=>{($(x)||x===null)&&(m.current=x,s(x)),($(u.refs.reference.current)||u.refs.reference.current===null||x!==null&&!$(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,[Mn]:""},...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 Ln(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 Hn=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(Ae())&&(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 Ft=g.createContext(null);Ft.displayName="PlacementContext";function Wn(t){return g.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function Vn(){return g.useContext(tt).setReference}function _n(){return g.useContext(tt).getReferenceProps}function zn(){let{getFloatingProps:t,slot:e}=g.useContext(tt);return g.useCallback((...n)=>Object.assign({},t(...n),{"data-anchor":e.anchor}),[t,e])}function jn(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=g.useContext(Ft),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 Yn({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);kn(l);let f=e&&n!==null&&l!==null,{to:a="bottom",gap:m=0,offset:h=0,padding:u=0,inner:d}=In(n,l),[p,w="center"]=a.split(" ");ot(()=>{f&&i(0)},[f]);let{refs:y,floatingStyles:v,context:x}=Dn({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}),pn({padding:u}),p!=="selection"&&wn({padding:u}),p==="selection"&&d?Hn({...d,padding:u,overflowRef:s,offset:r,minItemsVisible:Xt,referenceOverflowThreshold:u,onFallbackChange(O){var k,P;if(!O)return;let F=x.elements.floating;if(!F)return;let j=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,M=Math.min(Xt,F.childElementCount),I=0,C=0;for(let E of(P=(k=x.elements.floating)==null?void 0:k.childNodes)!=null?P:[])if(ge(E)){let H=E.offsetTop,Mt=H+E.clientHeight+j,wt=F.scrollTop,Pt=wt+F.clientHeight;if(H>=wt&&Mt<=Pt)M--;else{C=Math.max(0,Math.min(Mt,Pt)-Math.max(H,wt)),I=E.clientHeight;break}}M>=1&&i(E=>{let H=I*M-C+j;return E>=H?E:H})}}):null,xn({padding:u,apply({availableWidth:O,availableHeight:k,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${O}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${k}px)`})}})].filter(Boolean),whileElementsMounted:ln}),[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}=Ln([A]),T=Kt(O=>{c(O),y.setFloating(O)});return g.createElement(Ft.Provider,{value:o},g.createElement(tt.Provider,{value:{setFloating:T,setReference:y.setReference,styles:v,getReferenceProps:L,getFloatingProps:N,slot:S}},t))}function kn(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 In(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}export{Yn as A,Vn as F,jn as R,zn as T,_n as b,Nn as w,Wn as y}; +import{r as g,bu as ot,bz as de,bb as ct,gG as me,bk as ge,aV as Kt,b8 as he}from"./index-CdntfUUz.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 Nn(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 $(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 pe=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)&&!pe.has(r)}const we=new Set(["table","td","th"]);function xe(t){return we.has(Q(t))}const ye=[":popover-open",":modal"];function mt(t){return ye.some(e=>{try{return t.matches(e)}catch{return!1}})}const ve=["transform","translate","scale","rotate","perspective"],be=["transform","translate","scale","rotate","perspective","filter"],Re=["paint","layout","strict","content"];function Et(t){const e=Ot(),n=$(t)?W(t):t;return ve.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)||be.some(o=>(n.willChange||"").includes(o))||Re.some(o=>(n.contain||"").includes(o))}function Ce(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 Se=new Set(["html","body","#document"]);function J(t){return Se.has(Q(t))}function W(t){return B(t).getComputedStyle(t)}function gt(t){return $(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 Ae(){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}),Ee={left:"right",right:"left",bottom:"top",top:"bottom"},Oe={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 Te=new Set(["top","bottom"]);function Y(t){return Te.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 Me(t){const e=ft(t);return[St(t),e,St(e)]}function St(t){return t.replace(/start|end/g,e=>Oe[e])}const $t=["left","right"],kt=["right","left"],Pe=["top","bottom"],De=["bottom","top"];function Le(t,e,n){switch(t){case"top":case"bottom":return n?e?kt:$t:e?$t:kt;case"left":case"right":return e?Pe:De;default:return[]}}function He(t,e,n,o){const r=it(t);let i=Le(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=>Ee[e])}function $e(t){return{top:0,right:0,bottom:0,left:0,...t}}function ke(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 Ie=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;pF<=0)){var O,k;const F=(((O=i.flip)==null?void 0:O.index)||0)+1,j=A[F];if(j&&(!(m==="alignment"?v!==Y(j):!1)||T.every(C=>Y(C.placement)===v?C.overflows[0]>0:!0)))return{data:{index:F,overflows:T},reset:{placement:j}};let M=(k=T.filter(I=>I.overflows[0]<=0).sort((I,C)=>I.overflows[1]-C.overflows[1])[0])==null?void 0:k.placement;if(!M)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&&(M=I);break}case"initialPlacement":M=l;break}if(r!==M)return{reset:{placement:M}}}return{}}}},Ne=new Set(["left","top"]);async function We(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=Ne.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 Ve=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 We(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}}}}},_e=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}}}}}},ze=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),k=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*(k!==0||P!==0?k+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 $(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 je=V(0);function ne(t){const e=B(t);return!Ot()||!e.visualViewport?je:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ye(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?$(o)&&(s=G(o)):s=G(t));const l=Ye(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&&$(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 qe(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 Xe(t){return Array.from(t.getClientRects())}function Ue(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 Ke(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 Ge=new Set(["absolute","fixed"]);function Je(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=Ke(t,n);else if(e==="document")o=Ue(z(t));else if($(e))o=Je(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||!$(n)||J(n)?!1:W(n).position==="fixed"||re(n,e)}function Qe(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(l=>$(l)&&Q(l)!=="body"),r=null;const i=W(t).position==="fixed";let s=i?q(t):t;for(;$(s)&&!J(s);){const l=W(s),c=Et(s);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&Ge.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 Ze(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?mt(e)?[]:Qe(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 tn(t){const{width:e,height:n}=ee(t);return{width:e,height:n}}function en(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($(r)&&!xt(r))return r;r=q(r)}return n}let o=Wt(t,e);for(;o&&xe(o)&&xt(o);)o=Wt(o,e);return o&&J(o)&&xt(o)&&!Et(o)?n:o||Ce(t)||n}const nn=async function(t){const e=this.getOffsetParent||ie,n=this.getDimensions,o=await n(t.floating);return{reference:en(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function on(t){return W(t).direction==="rtl"}const rn={convertOffsetParentRelativeRectToViewportRelativeRect:qe,getDocumentElement:z,getClippingRect:Ze,getOffsetParent:ie,getElementRects:nn,getClientRects:Xe,getDimensions:tn,getScale:G,isElement:$,isRTL:on};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function sn(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 ln(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?sn(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,cn=Ve,fn=_e,an=Be,un=ze,dn=(t,e,n)=>{const o=new Map,r={platform:rn,...n},i={...r.platform,_c:o};return Ie(t,e,{...r,platform:i})};var mn=typeof document<"u",gn=function(){},lt=mn?g.useLayoutEffect:gn;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 hn(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),k=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),dn(S.current,A.current,C).then(E=>{const H={...E,isPositioned:k.current!==!1};F.current&&!ut(L.current,H)&&(L.current=H,ct.flushSync(()=>{m(H)}))})},[h,e,n,O,k]);lt(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,m(C=>({...C,isPositioned:!1})))},[f]);const F=g.useRef(!1);lt(()=>(F.current=!0,()=>{F.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]),M=g.useMemo(()=>({reference:b,floating:R}),[b,R]),I=g.useMemo(()=>{const C={position:n,left:0,top:0};if(!M.floating)return C;const E=Vt(M.floating,a.x),H=Vt(M.floating,a.y);return l?{...C,transform:"translate("+E+"px, "+H+"px)",...le(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:E,top:H}},[n,l,M.floating,a.x,a.y]);return g.useMemo(()=>({...a,update:P,refs:j,elements:M,floatingStyles:I}),[a,P,j,M,I])}const ce=(t,e)=>({...cn(t),options:[t,e]}),pn=(t,e)=>({...fn(t),options:[t,e]}),wn=(t,e)=>({...an(t),options:[t,e]}),xn=(t,e)=>({...un(t),options:[t,e]}),fe={...me},yn=fe.useInsertionEffect,vn=yn||(t=>t());function ae(t){const e=g.useRef(()=>{});return vn(()=>{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)+bn++;function Rn(){const[t,e]=g.useState(()=>_t?zt():void 0);return At(()=>{t==null&&e(zt())},[]),g.useEffect(()=>{_t=!0},[]),t}const Cn=fe.useId,Sn=Cn||Rn;function An(){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 En=g.createContext(null),On=g.createContext(null),Tn=()=>{var t;return((t=g.useContext(En))==null?void 0:t.id)||null},Fn=()=>g.useContext(On),Mn="data-floating-ui-focusable";function Pn(t){const{open:e=!1,onOpenChange:n,elements:o}=t,r=Sn(),i=g.useRef({}),[s]=g.useState(()=>An()),l=Tn()!=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 Dn(t){t===void 0&&(t={});const{nodeId:e}=t,n=Pn({...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=hn({...t,elements:{...r,...l&&{reference:l}}}),d=g.useCallback(x=>{const b=$(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(b),u.refs.setReference(b)},[u.refs]),p=g.useCallback(x=>{($(x)||x===null)&&(m.current=x,s(x)),($(u.refs.reference.current)||u.refs.reference.current===null||x!==null&&!$(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,[Mn]:""},...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 Ln(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 Hn=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(Ae())&&(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 Ft=g.createContext(null);Ft.displayName="PlacementContext";function Wn(t){return g.useMemo(()=>t?typeof t=="string"?{to:t}:t:null,[t])}function Vn(){return g.useContext(tt).setReference}function _n(){return g.useContext(tt).getReferenceProps}function zn(){let{getFloatingProps:t,slot:e}=g.useContext(tt);return g.useCallback((...n)=>Object.assign({},t(...n),{"data-anchor":e.anchor}),[t,e])}function jn(t=null){t===!1&&(t=null),typeof t=="string"&&(t={to:t});let e=g.useContext(Ft),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 Yn({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);kn(l);let f=e&&n!==null&&l!==null,{to:a="bottom",gap:m=0,offset:h=0,padding:u=0,inner:d}=In(n,l),[p,w="center"]=a.split(" ");ot(()=>{f&&i(0)},[f]);let{refs:y,floatingStyles:v,context:x}=Dn({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}),pn({padding:u}),p!=="selection"&&wn({padding:u}),p==="selection"&&d?Hn({...d,padding:u,overflowRef:s,offset:r,minItemsVisible:Xt,referenceOverflowThreshold:u,onFallbackChange(O){var k,P;if(!O)return;let F=x.elements.floating;if(!F)return;let j=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,M=Math.min(Xt,F.childElementCount),I=0,C=0;for(let E of(P=(k=x.elements.floating)==null?void 0:k.childNodes)!=null?P:[])if(ge(E)){let H=E.offsetTop,Mt=H+E.clientHeight+j,wt=F.scrollTop,Pt=wt+F.clientHeight;if(H>=wt&&Mt<=Pt)M--;else{C=Math.max(0,Math.min(Mt,Pt)-Math.max(H,wt)),I=E.clientHeight;break}}M>=1&&i(E=>{let H=I*M-C+j;return E>=H?E:H})}}):null,xn({padding:u,apply({availableWidth:O,availableHeight:k,elements:P}){Object.assign(P.floating.style,{overflow:"auto",maxWidth:`${O}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${k}px)`})}})].filter(Boolean),whileElementsMounted:ln}),[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}=Ln([A]),T=Kt(O=>{c(O),y.setFloating(O)});return g.createElement(Ft.Provider,{value:o},g.createElement(tt.Provider,{value:{setFloating:T,setReference:y.setReference,styles:v,getReferenceProps:L,getFloatingProps:N,slot:S}},t))}function kn(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 In(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}export{Yn as A,Vn as F,jn as R,zn as T,_n as b,Nn as w,Wn as y}; diff --git a/frontend/dist/assets/frozen-TmAR4LIW.js b/frontend/dist/assets/frozen-C1Yg1x_W.js similarity index 78% rename from frontend/dist/assets/frozen-TmAR4LIW.js rename to frontend/dist/assets/frozen-C1Yg1x_W.js index 3d142848..d6dce39b 100644 --- a/frontend/dist/assets/frozen-TmAR4LIW.js +++ b/frontend/dist/assets/frozen-C1Yg1x_W.js @@ -1 +1 @@ -import{bw as l,r as o}from"./index-CAHLMlrb.js";function a({children:t,freeze:e},n){let r=f(e,t);return o.isValidElement(r)?o.cloneElement(r,{ref:n}):l.createElement(l.Fragment,null,r)}const s=l.forwardRef(a);function f(t,e){let[n,r]=o.useState(e);return!t&&n!==e&&r(e),t?n:e}export{s,f as u}; +import{bw as l,r as o}from"./index-CdntfUUz.js";function a({children:t,freeze:e},n){let r=f(e,t);return o.isValidElement(r)?o.cloneElement(r,{ref:n}):l.createElement(l.Fragment,null,r)}const s=l.forwardRef(a);function f(t,e){let[n,r]=o.useState(e);return!t&&n!==e&&r(e),t?n:e}export{s,f as u}; diff --git a/frontend/dist/assets/funnel-CmniI8cB.js b/frontend/dist/assets/funnel-0W7-MqFe.js similarity index 90% rename from frontend/dist/assets/funnel-CmniI8cB.js rename to frontend/dist/assets/funnel-0W7-MqFe.js index 3d315305..ed32d9a7 100644 --- a/frontend/dist/assets/funnel-CmniI8cB.js +++ b/frontend/dist/assets/funnel-0W7-MqFe.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/git-branch-BIN5tJ3h.js b/frontend/dist/assets/git-branch-BfTP80e2.js similarity index 90% rename from frontend/dist/assets/git-branch-BIN5tJ3h.js rename to frontend/dist/assets/git-branch-BfTP80e2.js index cd5a345f..60bc6ba8 100644 --- a/frontend/dist/assets/git-branch-BIN5tJ3h.js +++ b/frontend/dist/assets/git-branch-BfTP80e2.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/hash-Cs4BXjcy.js b/frontend/dist/assets/hash-Ccz7W0IK.js similarity index 91% rename from frontend/dist/assets/hash-Cs4BXjcy.js rename to frontend/dist/assets/hash-Ccz7W0IK.js index 295c5047..9c8700bb 100644 --- a/frontend/dist/assets/hash-Cs4BXjcy.js +++ b/frontend/dist/assets/hash-Ccz7W0IK.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/index-R7zviCWb.js b/frontend/dist/assets/index-Bfbz8_Ci.js similarity index 98% rename from frontend/dist/assets/index-R7zviCWb.js rename to frontend/dist/assets/index-Bfbz8_Ci.js index a3d32ba2..403afad4 100644 --- a/frontend/dist/assets/index-R7zviCWb.js +++ b/frontend/dist/assets/index-Bfbz8_Ci.js @@ -1 +1 @@ -import{gX as tt,gY as et,gZ as nt,g_ as it,g$ as st,h0 as at,o as J,h1 as rt,h2 as ot,h3 as lt,h4 as ut,h5 as ct,h6 as ft,h7 as mt,h8 as ht,h9 as pt,ha as gt,hb as C,hc as dt,hd as yt,he as At}from"./index-CAHLMlrb.js";const St=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function Q(t,e){return tt(t)?t[St(0,t.length,e)]:t}class Et{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,s)=>{i&&i(),this.animations[s].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 X(this.animations,"duration")}get iterationDuration(){return X(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 X(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Vt extends Et{then(e,n){return this.finished.finally(e).then(()=>{})}}function vt(t,e){return t in e}class Dt extends et{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(vt(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 nt()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function j(t){return typeof t=="object"&&!Array.isArray(t)}function U(t,e,n,i){return t==null?[]:typeof t=="string"&&j(e)?it(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(s=>s!=null):[t]}function Tt(t,e,n){return t*(e+1)}function Y(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 bt(t,e,n){for(let i=0;ie&&s.at{const r=It(g),{delay:x=0,times:d=rt(r),type:L=e.type||"keyframes",repeat:K,repeatType:Pt,repeatDelay:Rt=0,...q}=b;let{ease:E=e.ease||"easeOut",duration:y}=b;const W=typeof x=="function"?x(v,O):x,_=r.length,P=ut(L)?L:s==null?void 0:s[L||"keyframes"];if(_<=2&&P){let w=100;if(_===2&&Nt(r)){const G=r[1]-r[0];w=Math.abs(G)}const N={...e,...q};y!==void 0&&(N.duration=ct(y));const B=ot(N,w,P);E=B.ease,y=B.duration}y??(y=o);const R=u+W;d.length===1&&d[0]===0&&(d[1]=1);const z=d.length-r.length;if(z>0&<(d,z),r.length===1&&r.unshift(null),K){y=Tt(y,K);const w=[...r],N=[...d];E=Array.isArray(E)?[...E]:[E];const B=[...E];for(let G=0;G{for(const V in D){const h=D[V];h.sort(xt);const c=[],f=[],T=[];for(let v=0;vtypeof t=="number",Nt=t=>t.every(Kt);function Bt(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=mt(t)&&!ht(t)?new pt(e):new gt(e);n.mount(t),C.set(t,n)}function Ct(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Dt(e);n.mount(t),C.set(t,n)}function Lt(t,e){return J(t)||typeof t=="number"||typeof t=="string"&&!j(e)}function k(t,e,n,i){const s=[];if(Lt(t,e))s.push(dt(t,j(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return s;const o=U(t,e,i),a=o.length;for(let l=0;l{i.push(...k(l,o,a))}),i}function Wt(t){return Array.isArray(t)&&t.some(Array.isArray)}function _t(t){function e(n,i,s){let o=[],a;if(Wt(n))o=jt(n,i,t);else{const{onComplete:p,...A}=s||{};typeof p=="function"&&(a=p),o=k(n,i,A,t)}const l=new Vt(o);return a&&l.finished.then(a),l}return e}const Ht=_t();export{Ht as a}; +import{gX as tt,gY as et,gZ as nt,g_ as it,g$ as st,h0 as at,o as J,h1 as rt,h2 as ot,h3 as lt,h4 as ut,h5 as ct,h6 as ft,h7 as mt,h8 as ht,h9 as pt,ha as gt,hb as C,hc as dt,hd as yt,he as At}from"./index-CdntfUUz.js";const St=(t,e,n)=>{const i=e-t;return((n-t)%i+i)%i+t};function Q(t,e){return tt(t)?t[St(0,t.length,e)]:t}class Et{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,s)=>{i&&i(),this.animations[s].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 X(this.animations,"duration")}get iterationDuration(){return X(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 X(t,e){let n=0;for(let i=0;in&&(n=s)}return n}class Vt extends Et{then(e,n){return this.finished.finally(e).then(()=>{})}}function vt(t,e){return t in e}class Dt extends et{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,n){if(vt(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 nt()}build(e,n){Object.assign(e.output,n)}renderInstance(e,{output:n}){Object.assign(e,n)}sortInstanceNodePosition(){return 0}}function j(t){return typeof t=="object"&&!Array.isArray(t)}function U(t,e,n,i){return t==null?[]:typeof t=="string"&&j(e)?it(t,n,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t.filter(s=>s!=null):[t]}function Tt(t,e,n){return t*(e+1)}function Y(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 bt(t,e,n){for(let i=0;ie&&s.at{const r=It(g),{delay:x=0,times:d=rt(r),type:L=e.type||"keyframes",repeat:K,repeatType:Pt,repeatDelay:Rt=0,...q}=b;let{ease:E=e.ease||"easeOut",duration:y}=b;const W=typeof x=="function"?x(v,O):x,_=r.length,P=ut(L)?L:s==null?void 0:s[L||"keyframes"];if(_<=2&&P){let w=100;if(_===2&&Nt(r)){const G=r[1]-r[0];w=Math.abs(G)}const N={...e,...q};y!==void 0&&(N.duration=ct(y));const B=ot(N,w,P);E=B.ease,y=B.duration}y??(y=o);const R=u+W;d.length===1&&d[0]===0&&(d[1]=1);const z=d.length-r.length;if(z>0&<(d,z),r.length===1&&r.unshift(null),K){y=Tt(y,K);const w=[...r],N=[...d];E=Array.isArray(E)?[...E]:[E];const B=[...E];for(let G=0;G{for(const V in D){const h=D[V];h.sort(xt);const c=[],f=[],T=[];for(let v=0;vtypeof t=="number",Nt=t=>t.every(Kt);function Bt(t){const e={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=mt(t)&&!ht(t)?new pt(e):new gt(e);n.mount(t),C.set(t,n)}function Ct(t){const e={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new Dt(e);n.mount(t),C.set(t,n)}function Lt(t,e){return J(t)||typeof t=="number"||typeof t=="string"&&!j(e)}function k(t,e,n,i){const s=[];if(Lt(t,e))s.push(dt(t,j(e)&&e.default||e,n&&(n.default||n)));else{if(t==null)return s;const o=U(t,e,i),a=o.length;for(let l=0;l{i.push(...k(l,o,a))}),i}function Wt(t){return Array.isArray(t)&&t.some(Array.isArray)}function _t(t){function e(n,i,s){let o=[],a;if(Wt(n))o=jt(n,i,t);else{const{onComplete:p,...A}=s||{};typeof p=="function"&&(a=p),o=k(n,i,A,t)}const l=new Vt(o);return a&&l.finished.then(a),l}return e}const Ht=_t();export{Ht as a}; diff --git a/frontend/dist/assets/index-CAHLMlrb.js b/frontend/dist/assets/index-CdntfUUz.js similarity index 99% rename from frontend/dist/assets/index-CAHLMlrb.js rename to frontend/dist/assets/index-CdntfUUz.js index 15e69dba..7a160e0b 100644 --- a/frontend/dist/assets/index-CAHLMlrb.js +++ b/frontend/dist/assets/index-CdntfUUz.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-_swGk22g.js","assets/PageLayout-CgrNSpBT.js","assets/WorkspaceNav-ClxMgBhr.js","assets/setup-DRFHoJbp.js","assets/wrench-laBkieDS.js","assets/Grid-B0tNiHTX.js","assets/shield-check-DX3QVGvb.js","assets/wifi-veufKfwm.js","assets/Dashboard-Dt57NbQx.js","assets/consumer-registry-Bsx-B9R6.js","assets/DataValue-B6B0O-xC.js","assets/index-1IIqkHes.js","assets/index-R7zviCWb.js","assets/node-types-CcH5BFf0.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-ODK5IJ9o.js","assets/chevron-up-51iePx4b.js","assets/primitives-B7bSO4E3.js","assets/badge-colors-Dl76Mz8m.js","assets/chat-utils-rMBLw-SJ.js","assets/SignalIndicator-BN0oxyDe.js","assets/arrow-up-BmXPNI2T.js","assets/arrow-right-C5Fuejc9.js","assets/arrow-down-COuxy1kb.js","assets/payload-detail-CniY19rz.js","assets/map-pin-CNePTCsc.js","assets/circle-question-mark-BPKfem7i.js","assets/layers-CU7un-PT.js","assets/hash-Cs4BXjcy.js","assets/clock-DB7tKCHV.js","assets/route-B8rlrav9.js","assets/activity-BAV-4Rxi.js","assets/database-BeT3SO6w.js","assets/useMapViewStore-Dq-l5Xvs.js","assets/shield-CxlpbCLH.js","assets/zap-BraNZRWh.js","assets/usePipelineStore-3uhIJZso.js","assets/TimeRangeStepper-BGzUi9Jn.js","assets/floating-BAAXcOzg.js","assets/LightSparkline-g9bCtOHr.js","assets/link-scoring-CFJjEb_I.js","assets/timer-DIDXOFnU.js","assets/AutoConfigureDialog-BAQ5UEr_.js","assets/monitor-smartphone-DMj7GqcL.js","assets/wand-sparkles-C18LiNtQ.js","assets/ChatBubble-Cn1oh8mi.js","assets/message-square-text-BDbAHWCI.js","assets/message-square-B56EP67q.js","assets/MqttModeBadge-OPtXzakb.js","assets/Packets-Cs9Zwu9d.js","assets/use-by-comparator-JYMD8MzS.js","assets/element-movement-SAlxPSM7.js","assets/use-tree-walker-DIk49Ly7.js","assets/frozen-TmAR4LIW.js","assets/AnalyzerFilterPanel-BpsoGf4o.js","assets/funnel-CmniI8cB.js","assets/search-C1Hut7GR.js","assets/sparkles-GhffQ44V.js","assets/Contacts-COjtGvyY.js","assets/ping-Chyw2B4c.js","assets/listbox-DoXudQ3L.js","assets/use-text-value-B1ySk7If.js","assets/CollisionExplorerModal-Y5-HwcN-.js","assets/BasemapLayer-VyMOdkaO.js","assets/layer-DnHLn7Jx.js","assets/share-2-DIHBn1T5.js","assets/eye-DQ-O4VIh.js","assets/map-pin-off-Dtf3D6QW.js","assets/target-CAfnTnyS.js","assets/trash-2-ChI2Sf6Z.js","assets/ConfirmModal-CNagQaWr.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-DJlDW6-R.js","assets/easing-rWsWG9jZ.js","assets/compass-Dolk-EbB.js","assets/settings-2-DgwT7JNL.js","assets/waves-BgBEByoN.js","assets/network-DsulLblE.js","assets/RfHealthCorrelation-Bjlu541K.js","assets/GPSDiagnostics-Cye-Trgs.js","assets/satellite-DvRQ8hgk.js","assets/Sensors-insTPzAw.js","assets/CADCalibration-DOpFISap.js","assets/system-CNkSqdfb.js","assets/save-HCcOmjKD.js","assets/MeshGraph-C36tfydu.js","assets/max-D9Y_Gk4E.js","assets/variants-DqP1b_He.js","assets/git-branch-BIN5tJ3h.js","assets/rotate-ccw-Cav5SApM.js","assets/System-D3XTlAJj.js","assets/thermometer-_L_juB2l.js","assets/Logs-DJM49UnJ.js","assets/circle-stop-DEeBh2xe.js","assets/Terminal-B7Zl0oMf.js","assets/transport--H030bEh.js","assets/KeycapButton-BDWyVW37.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-DfbJ8nZk.js","assets/setting-field-YD-YARg4.js","assets/pencil--wb87xjW.js","assets/repeat-Dv_JF6au.js","assets/radio-group-DyBWNwhI.js","assets/antenna-CpeQ5t_a.js","assets/plus-Be4DsW2a.js","assets/key-round-CZ_hGBwN.js","assets/RoomServer-DrChSCH0.js","assets/fieldset-DJGo6TXB.js","assets/PacketObservatory-Cf7m4kGK.js","assets/Sessions-6Pz1fhab.js","assets/Mqtt-CkgupwWU.js","assets/check-check-CV8IAFCF.js","assets/wifi-off-D3oO89G-.js","assets/Observer-CWD4jATj.js","assets/maintenance-C2rIkwgy.js","assets/rotate-cw-D7GjgDF3.js","assets/PolicyEngine-Bt5hUbRJ.js","assets/DatabaseManagement-BQJZp4p1.js","assets/MemoryDebug-hHFx3BHO.js","assets/BackupRestore-CM11c75S.js","assets/backup-K6eA_iA5.js","assets/upload-N2aZrMEC.js","assets/RadioHardware-DhH_OAdl.js","assets/Companion-B40Pf-xY.js","assets/circle-alert-D6qb8WSp.js","assets/Test-CYQzPSaa.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-Bzvgo-0b.js","assets/PageLayout-B2kQpvXM.js","assets/WorkspaceNav-BZrtCI1_.js","assets/setup-CORoXz0f.js","assets/wrench-BDb_Mrbt.js","assets/Grid-DYtN9_Hv.js","assets/shield-check-D7YYO1tX.js","assets/wifi-6W1pAdZl.js","assets/Dashboard-1WPD5yy7.js","assets/consumer-registry-K46Bg-WH.js","assets/DataValue-Cy2BSezA.js","assets/index-tm_sy7-t.js","assets/index-Bfbz8_Ci.js","assets/node-types-rkAZo2WA.js","assets/meshcore-tx-constants-DgpFTAmf.js","assets/PacketList-CyBre3jR.js","assets/chevron-up-CFeeYtPO.js","assets/primitives-Bl26dfm-.js","assets/badge-colors-Dl76Mz8m.js","assets/chat-utils-D8ZwjCT3.js","assets/SignalIndicator-CKCIivNj.js","assets/arrow-up-C1m6otp9.js","assets/arrow-right-DDhVPQqL.js","assets/arrow-down-npn6XFzD.js","assets/payload-detail-D7dyXv-d.js","assets/map-pin-ADTzwr8W.js","assets/circle-question-mark-EfmCIEVS.js","assets/layers-80mLD98M.js","assets/hash-Ccz7W0IK.js","assets/clock-DKukpMjT.js","assets/route-CeOQcqdX.js","assets/activity-02b04F6Q.js","assets/database-D8ZiJ_7E.js","assets/useMapViewStore-Ciaw6Y-k.js","assets/shield-CNxoSMJk.js","assets/zap-BZEYLUfp.js","assets/usePipelineStore-B9TPEPcv.js","assets/TimeRangeStepper-JPYSHI2J.js","assets/floating-B9JazpOE.js","assets/LightSparkline-B-EJJe6x.js","assets/link-scoring-CnR8SbVy.js","assets/timer-nBNC7t-g.js","assets/AutoConfigureDialog-I0jHfgv3.js","assets/monitor-smartphone-X03XrJWF.js","assets/wand-sparkles-By2ieoA5.js","assets/ChatBubble-BXwtJZuf.js","assets/message-square-text-CaBiKUOL.js","assets/message-square-B7BGKpkr.js","assets/MqttModeBadge-2hTXq31i.js","assets/Packets-DfuElOK2.js","assets/use-by-comparator-Dgy5yCaL.js","assets/element-movement-rOMuf_3T.js","assets/use-tree-walker-DwujlxlX.js","assets/frozen-C1Yg1x_W.js","assets/AnalyzerFilterPanel-O22f461t.js","assets/funnel-0W7-MqFe.js","assets/search-D8B8LMYr.js","assets/sparkles-CIoeyoky.js","assets/Contacts-DiQfIa8j.js","assets/ping-D6oK6s8c.js","assets/listbox-LgRZMHBN.js","assets/use-text-value-DFkKaUWL.js","assets/CollisionExplorerModal-brcQ7JMt.js","assets/BasemapLayer-U4r1eipM.js","assets/layer-BRKnZ2f8.js","assets/share-2-ceQyHw_t.js","assets/eye-Dc2SU7n8.js","assets/map-pin-off-DdXFAKLD.js","assets/target-D6g_GBrY.js","assets/trash-2-Ym16rcs6.js","assets/ConfirmModal-CB8xdBeW.js","assets/BasemapLayer-B1CfjdFi.css","assets/Statistics-D1pZrkmX.js","assets/easing-BV_uJNeb.js","assets/compass-CPwUyboh.js","assets/settings-2-iRV0UHU5.js","assets/waves-C19BgMIP.js","assets/network-TeIBnbEp.js","assets/RfHealthCorrelation-DoZNDUke.js","assets/GPSDiagnostics-CYzRkIGF.js","assets/satellite-DwUbYQYY.js","assets/Sensors-qNNEac7h.js","assets/CADCalibration-DeM92vih.js","assets/system-MCOv6vDg.js","assets/save-B0-dg8jU.js","assets/MeshGraph-wRRLz_lr.js","assets/max-DUHCwm37.js","assets/variants-Bez4f_xY.js","assets/git-branch-BfTP80e2.js","assets/rotate-ccw-DyxXzFWc.js","assets/System-C5DE1LLo.js","assets/thermometer-qsOxlDrM.js","assets/Logs-D0FIyBRm.js","assets/circle-stop-0gJGQm_q.js","assets/Terminal-C_XnInql.js","assets/transport-DmJP2zwT.js","assets/KeycapButton-BJZjnt_-.js","assets/keycap-sfx-ByZp-njj.js","assets/Terminal-6GBZ9nXN.css","assets/Configuration-aUhduX2Z.js","assets/setting-field-BzKIre35.js","assets/pencil-DwKQKROy.js","assets/repeat-CYHoMir3.js","assets/radio-group-CSvEyiPf.js","assets/antenna-BUervkWx.js","assets/plus-BHawoJ76.js","assets/key-round-Cn-7B-WZ.js","assets/RoomServer-D9PWmBB1.js","assets/fieldset-BJg_kfe0.js","assets/PacketObservatory-B6q6lK8q.js","assets/Sessions-CZL0vFpY.js","assets/Mqtt-m3-rjLC-.js","assets/check-check-D7HV9aAg.js","assets/wifi-off-BkS_iqlS.js","assets/Observer-VP_bsWv3.js","assets/maintenance-DDkOUzHo.js","assets/rotate-cw-CKh-yYEC.js","assets/PolicyEngine-CFwki3sb.js","assets/DatabaseManagement-DhltIlKH.js","assets/MemoryDebug-SZdlepUQ.js","assets/BackupRestore-D2lKmevY.js","assets/backup-Zafc7Byp.js","assets/upload-D2RzW6Z5.js","assets/RadioHardware-D1iA7IMw.js","assets/Companion-Dku9E7ui.js","assets/circle-alert-8MQex_uC.js","assets/Test-Dr6o2qpf.js"])))=>i.map(i=>d[i]); var G9=Object.defineProperty;var Ik=e=>{throw TypeError(e)};var K9=(e,t,n)=>t in e?G9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Be=(e,t,n)=>K9(e,typeof t!="symbol"?t+"":t,n),bb=(e,t,n)=>t.has(e)||Ik("Cannot "+n);var ye=(e,t,n)=>(bb(e,t,"read from private field"),n?n.call(e):t.get(e)),sn=(e,t,n)=>t.has(e)?Ik("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Pt=(e,t,n,r)=>(bb(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),wt=(e,t,n)=>(bb(e,t,"access private method"),n);var Wp=(e,t,n,r)=>({set _(s){Pt(e,t,s,n)},get _(){return ye(e,t,r)}});function Y9(e,t){for(var n=0;nr[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function X9(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vb={exports:{}},Md={},wb={exports:{}},Yt={};/** * @license React * react.production.min.js @@ -296,7 +296,7 @@ Please change the parent to {k.contains(A)&&k.removeChild(A)}},[t]),S.jsx(MG,{isPresent:t,childRef:i,sizeRef:a,children:_.cloneElement(e,{ref:f})})}const LG=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:a,anchorY:c,root:u})=>{const f=bE(NG),h=_.useId();let p=!0,g=_.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:s,onExitComplete:y=>{f.set(y,!0);for(const b of f.values())if(!b)return;r&&r()},register:y=>(f.set(y,!1),()=>f.delete(y))}),[n,f,r]);return o&&p&&(g={...g}),_.useMemo(()=>{f.forEach((y,b)=>f.set(b,!1))},[n]),_.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),i==="popLayout"&&(e=S.jsx(IG,{isPresent:n,anchorX:a,anchorY:c,root:u,children:e})),S.jsx(wh.Provider,{value:g,children:e})};function NG(){return new Map}function QF(e=!0){const t=_.useContext(wh);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=_.useId();_.useEffect(()=>{if(e)return s(o)},[e]);const i=_.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}function Gle(){return jG(_.useContext(wh))}function jG(e){return e===null?!0:e.isPresent}const im=e=>e.key||"";function v_(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const Ku=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[f,h]=QF(i),p=_.useMemo(()=>v_(e),[e]),g=i&&!f?[]:p.map(im),y=_.useRef(!0),b=_.useRef(p),w=bE(()=>new Map),x=_.useRef(new Set),[v,E]=_.useState(p),[A,k]=_.useState(p);vE(()=>{y.current=!1,b.current=p;for(let B=0;B{const P=im(B),I=i&&!f?!1:p===A||g.includes(P),H=()=>{if(x.current.has(P))return;if(x.current.add(P),w.has(P))w.set(P,!0);else return;let $=!0;w.forEach(W=>{W||($=!1)}),$&&(j==null||j(),k(b.current),i&&(h==null||h()),r&&r())};return S.jsx(LG,{isPresent:I,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:u,onExitComplete:I?void 0:H,anchorX:a,anchorY:c,children:B},P)})})},OG=_.createContext(null);function $G(){const e=_.useRef(!1);return vE(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function UG(){const e=$G(),[t,n]=_.useState(0),r=_.useCallback(()=>{e.current&&n(t+1)},[t]);return[_.useCallback(()=>Bn.postRender(r),[r]),t]}const JF=e=>e===!0,zG=e=>JF(e===!0)||e==="id",VG=({children:e,id:t,inherit:n=!0})=>{const r=_.useContext(Gf),s=_.useContext(OG),[o,i]=UG(),a=_.useRef(null),c=r.id||s;a.current===null&&(zG(n)&&c&&(t=t?c+"-"+t:c),a.current={id:t,group:JF(n)&&r.group||y_()});const u=_.useMemo(()=>({...a.current,forceRender:o}),[i]);return S.jsx(Gf.Provider,{value:u,children:e})},ZF=_.createContext({strict:!1}),w_={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 C_=!1;function HG(){if(C_)return;const e={};for(const t in w_)e[t]={isEnabled:n=>w_[t].some(r=>!!n[r])};_F(e),C_=!0}function eB(){return HG(),xq()}function WG(e){const t=eB();for(const n in e)t[n]={...t[n],...e[n]};_F(t)}const qG=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 Xg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||qG.has(e)}let tB=e=>!Xg(e);function GG(e){typeof e=="function"&&(tB=t=>t.startsWith("on")?!Xg(t):e(t))}try{GG(require("@emotion/is-prop-valid").default)}catch{}function KG(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(tB(s)||n===!0&&Xg(s)||!t&&!Xg(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Ny=_.createContext({});function YG(e,t){if(Ly(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qf(n)?n:void 0,animate:Qf(r)?r:void 0}}return e.inherit!==!1?t:{}}function XG(e){const{initial:t,animate:n}=YG(e,_.useContext(Ny));return _.useMemo(()=>({initial:t,animate:n}),[E_(t),E_(n)])}function E_(e){return Array.isArray(e)?e.join(" "):e}const XE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nB(e,t,n){for(const r in t)!ss(t[r])&&!MF(r,n)&&(e[r]=t[r])}function QG({transformTemplate:e},t){return _.useMemo(()=>{const n=XE();return GE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function JG(e,t){const n=e.style||{},r={};return nB(r,n,e),Object.assign(r,QG(e,t)),r}function ZG(e,t){const n={},r=JG(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 rB=()=>({...XE(),attrs:{}});function eK(e,t,n,r){const s=_.useMemo(()=>{const o=rB();return IF(o,t,NF(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};nB(o,e.style,e),s.style={...o,...s.style}}return s}const tK=["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 QE(e){return typeof e!="string"||e.includes("-")?!1:!!(tK.indexOf(e)>-1||/[A-Z]/u.test(e))}function nK(e,t,n,{latestValues:r},s,o=!1,i){const c=(i??QE(e)?eK:ZG)(t,r,s,e),u=KG(t,typeof e=="string",o),f=e!==_.Fragment?{...u,...c,ref:n}:{},{children:h}=t,p=_.useMemo(()=>ss(h)?h.get():h,[h]);return _.createElement(e,{...f,children:p})}function rK({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:sK(n,r,s,e),renderState:t()}}function sK(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Ym(o[p]);let{initial:i,animate:a}=e;const c=Ly(e),u=AF(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let f=n?n.initial===!1:!1;f=f||i===!1;const h=f?a:i;if(h&&typeof h!="boolean"&&!Iy(h)){const p=Array.isArray(h)?h:[h];for(let g=0;g(t,n)=>{const r=_.useContext(Ny),s=_.useContext(wh),o=()=>rK(e,t,r,s);return n?o():bE(o)},oK=sB({scrapeMotionValuesFromProps:KE,createRenderState:XE}),iK=sB({scrapeMotionValuesFromProps:jF,createRenderState:rB}),aK=Symbol.for("motionComponentSymbol");function lK(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const s=_.useRef(null);return _.useCallback(o=>{var a;o&&((a=e.onMount)==null||a.call(e,o)),t&&(o?t.mount(o):t.unmount());const i=r.current;if(typeof i=="function")if(o){const c=i(o);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o)},[t])}const oB=_.createContext({});function lf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function cK(e,t,n,r,s,o){var x,v;const{visualElement:i}=_.useContext(Ny),a=_.useContext(ZF),c=_.useContext(wh),u=_.useContext(YE).reducedMotion,f=_.useRef(null),h=_.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,isSVG:o}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,g=_.useContext(oB);p&&!p.projection&&s&&(p.type==="html"||p.type==="svg")&&uK(f.current,n,s,g);const y=_.useRef(!1);_.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const b=n[fF],w=_.useRef(!!b&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,b))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,b)));return vE(()=>{h.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),w.current&&p.animationState&&p.animationState.animateChanges())}),_.useEffect(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,b)}),w.current=!1),p.enteringChildren=void 0)}),p}function uK(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:iB(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||a&&lf(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u})}function iB(e){if(e)return e.options.allowProjection!==!1?e.projection:iB(e.parent)}function tv(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&WG(r);const o=n?n==="svg":QE(e),i=o?iK:oK;function a(u,f){let h;const p={..._.useContext(YE),...u,layoutId:dK(u)},{isStatic:g}=p,y=XG(u),b=i(u,g);if(!g&&F8){fK();const w=hK(p);h=w.MeasureLayout,y.visualElement=cK(e,b,p,s,w.ProjectionNode,o)}return S.jsxs(Ny.Provider,{value:y,children:[h&&y.visualElement?S.jsx(h,{visualElement:y.visualElement,...p}):null,nK(e,u,lK(b,y.visualElement,f),b,g,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=_.forwardRef(a);return c[aK]=e,c}function dK({layoutId:e}){const t=_.useContext(Gf).id;return t&&e!==void 0?t+"-"+e:e}function fK(e,t){_.useContext(ZF).strict}function hK(e){const t=eB(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function pK(e,t){if(typeof Proxy>"u")return tv;const n=new Map,r=(o,i)=>tv(o,i,e,t),s=(o,i)=>r(o,i);return new Proxy(s,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,tv(i,void 0,e,t)),n.get(i))})}const mK=(e,t)=>t.isSVG??QE(e)?new $q(t):new Mq(t,{allowProjection:e!==_.Fragment});class gK extends ol{constructor(t){super(t),t.animationState||(t.animationState=Wq(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Iy(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 yK=0;class bK extends ol{constructor(){super(...arguments),this.id=yK++}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 s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 vK={animation:{Feature:gK},exit:{Feature:bK}};function Sh(e){return{point:{x:e.pageX,y:e.pageY}}}const wK=e=>t=>VE(t)&&e(t,Sh(t));function Pf(e,t,n,r){return Zf(e,t,wK(n),r)}const aB=({current:e})=>e?e.ownerDocument.defaultView:null,x_=(e,t)=>Math.abs(e-t);function CK(e,t){const n=x_(e.x,t.x),r=x_(e.y,t.y);return Math.sqrt(n**2+r**2)}const S_=new Set(["auto","scroll"]);class lB{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:a}={}){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=rv(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=CK(g.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!b)return;const{point:w}=g,{timestamp:x}=Vr;this.history.push({...w,timestamp:x});const{onStart:v,onMove:E}=this.handlers;y||(v&&v(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,g)},this.handlePointerMove=(g,y)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=nv(y,this.transformPagePoint),Bn.update(this.updatePoint,!0)},this.handlePointerUp=(g,y)=>{this.end();const{onEnd:b,onSessionEnd:w,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=rv(g.type==="pointercancel"?this.lastMoveEventInfo:nv(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(g,v),w&&w(g,v)},!VE(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=s||window;const c=Sh(t),u=nv(c,this.transformPagePoint),{point:f}=u,{timestamp:h}=Vr;this.history=[{...f,timestamp:h}];const{onSessionStart:p}=n;p&&p(t,rv(u,this.history)),this.removeListeners=Ch(Pf(this.contextWindow,"pointermove",this.handlePointerMove),Pf(this.contextWindow,"pointerup",this.handlePointerUp),Pf(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(S_.has(r.overflowX)||S_.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,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),Bn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),el(this.updatePoint)}}function nv(e,t){return t?{point:t(e.point)}:e}function k_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rv({point:e},t){return{point:e,delta:k_(e,cB(t)),offset:k_(e,EK(t)),velocity:xK(t,.1)}}function EK(e){return e[0]}function cB(e){return e[e.length-1]}function xK(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=cB(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ki(t)));)n--;if(!r)return{x:0,y:0};const o=wo(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function SK(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Jn(n,e,r.max):Math.min(e,n)),e}function A_(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 kK(e,{top:t,left:n,bottom:r,right:s}){return{x:A_(e.x,n,s),y:A_(e.y,t,r)}}function __(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Kf(t.min,t.max-r,e.min):r>s&&(n=Kf(e.min,e.max-s,t.min)),gi(0,1,n)}function DK(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 Jw=.35;function TK(e=Jw){return e===!1?e=0:e===!0&&(e=Jw),{x:D_(e,"left","right"),y:D_(e,"top","bottom")}}function D_(e,t,n){return{min:T_(e,t),max:T_(e,n)}}function T_(e,t){return typeof e=="number"?e:e[t]||0}const FK=new WeakMap;class BK{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=Dr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=h=>{n?(this.stopAnimation(),this.snapToCursor(Sh(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=fq(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),bo(x=>{let v=this.getAxisMotionValue(x).get()||0;if(hi.test(v)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[x];A&&(v=bs(A)*(parseFloat(v)/100))}}this.originPoint[x]=v}),b&&Bn.postRender(()=>b(h,p)),qw(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:b,onDrag:w}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:x}=p;if(y&&this.currentDirection===null){this.currentDirection=RK(x),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),w&&w(h,p)},c=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>bo(h=>{var p;return this.getAnimationState(h)==="paused"&&((p=this.getAxisMotionValue(h).animation)==null?void 0:p.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new lB(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:aB(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:i}=s;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Bn.postRender(()=>a(r,s))}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:s}=this.getProps();if(!r||!am(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=SK(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&lf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kK(r.layoutBox,t):this.constraints=!1,this.elastic=TK(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&bo(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=DK(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:s}=this.visualElement;if(!s||!s.layout)return!1;const o=Dq(r,s.root,this.visualElement.getTransformPagePoint());let i=AK(s.layout.layoutBox,o);if(n){const a=n(kq(i));this.hasMutatedConstraints=!!a,a&&(i=TF(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=bo(f=>{if(!am(f,n,this.currentDirection))return;let h=c&&c[f]||{};i&&(h={min:0,max:0});const p=s?200:1e6,g=s?40:1e7,y={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(f,y)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return qw(this.visualElement,t),r.start(jE(t,r,0,n,this.visualElement,!1))}stopAnimation(){bo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){bo(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(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){bo(n=>{const{drag:r}=this.getProps();if(!am(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:i,max:a}=s.layout.layoutBox[n],c=o.get()||0;o.set(t[n]-Jn(i,a,.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 s={x:0,y:0};bo(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();s[i]=_K({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),bo(i=>{if(!am(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(Jn(c,u,s[i]))})}addListeners(){if(!this.visualElement.current)return;FK.set(this.visualElement,this);const t=this.visualElement.current,n=Pf(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=c.target,p=h!==t&&xF(h);u&&f&&!p&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();lf(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Bn.read(r);const i=Zf(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(bo(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].translate))}),this.visualElement.render())}));return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=Jw,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function am(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function RK(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class PK extends ol{constructor(t){super(t),this.removeGroupControls=Co,this.removeListeners=Co,this.controls=new BK(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Co}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 F_=e=>(t,n)=>{e&&Bn.postRender(()=>e(t,n))};class MK extends ol{constructor(){super(...arguments),this.removePointerDownListener=Co}onPointerDown(t){this.session=new lB(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:aB(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:F_(t),onStart:F_(n),onMove:r,onEnd:(o,i)=>{delete this.session,s&&Bn.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=Pf(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 sv=!1;class IK extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),sv&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Xm.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),sv=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||Bn.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zE.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;sv=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function uB(e){const[t,n]=QF(),r=_.useContext(Gf);return S.jsx(IK,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(oB),isPresent:t,safeToRemove:n})}const LK={pan:{Feature:MK},drag:{Feature:PK,ProjectionNode:XF,MeasureLayout:uB}};function B_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Bn.postRender(()=>o(t,Sh(t)))}class NK extends ol{mount(){const{current:t}=this.node;t&&(this.unmount=hq(t,(n,r)=>(B_(this.node,r,"Start"),s=>B_(this.node,s,"End"))))}unmount(){}}class jK extends ol{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=Ch(Zf(this.node.current,"focus",()=>this.onFocus()),Zf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function R_(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 s="onTap"+(n==="End"?"":n),o=r[s];o&&Bn.postRender(()=>o(t,Sh(t)))}class OK extends ol{mount(){const{current:t}=this.node;t&&(this.unmount=gq(t,(n,r)=>(R_(this.node,r,"Start"),(s,{success:o})=>R_(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Zw=new WeakMap,ov=new WeakMap,$K=e=>{const t=Zw.get(e.target);t&&t(e)},UK=e=>{e.forEach($K)};function zK({root:e,...t}){const n=e||document;ov.has(n)||ov.set(n,{});const r=ov.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(UK,{root:e,...t})),r[s]}function VK(e,t,n){const r=zK(t);return Zw.set(e,n),r.observe(e),()=>{Zw.delete(e),r.unobserve(e)}}const HK={some:0,all:1};class WK extends ol{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:HK[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=u?f:h;p&&p(c)};return VK(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(qK(t,n))&&this.startObserver()}unmount(){}}function qK({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const GK={inView:{Feature:WK},tap:{Feature:OK},focus:{Feature:jK},hover:{Feature:NK}},KK={layout:{ProjectionNode:XF,MeasureLayout:uB}},YK={...vK,...GK,...LK,...KK},Hr=pK(YK,mK);function XK(){!HE.current&&kF();const[e]=_.useState(qg.current);return e}const QK=350,JK={duration:.15,ease:[.4,0,.2,1]},ZK={type:"tween",duration:.25,ease:[.4,0,.2,1]},eY={type:"tween",duration:.3,ease:[.4,0,.2,1]},dB=_.createContext(!1);function Kle(){return _.useContext(dB)}const fB=_.createContext(void 0);function hB(){return _.useContext(fB)}const Oi={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)"},tY={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 pB({open:e,onClose:t,size:n="md",className:r,children:s,bottomSheet:o=!0,motionPlus:i=!1,basemapMode:a,solid:c=!1}){const u=a==="light",[f,h]=_.useState(!1),p=_.useRef(null);_.useEffect(()=>(p.current&&(clearTimeout(p.current),p.current=null),e?p.current=setTimeout(()=>{h(!0)},QK):queueMicrotask(()=>h(!1)),()=>{p.current&&(clearTimeout(p.current),p.current=null)}),[e]);const g=_.useCallback((x,v)=>{(v.offset.y>100||v.velocity.y>500)&&t()},[t]),y=i?eY:ZK,b=i?.98:.99,w=o?8:4;return S.jsx(Ku,{mode:"wait",children:e&&S.jsxs(h8,{static:!0,open:e,onClose:t,className:"relative z-[10010]",children:[S.jsx(Hr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:JK,className:"fixed inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":"true"}),S.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:S.jsx("div",{className:Ve("flex min-h-full justify-center",o?"items-end sm:items-center sm:p-4":"items-center p-4"),children:S.jsx(Hr.div,{drag:o?"y":!1,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.4},onDragEnd:g,initial:{opacity:0,scale:b,y:w},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.99,y:o?40:4},transition:y,style:{willChange:"transform, opacity"},className:Ve(o&&"w-full sm:w-auto"),children:S.jsx(cE,{className:Ve("relative w-full shadow-2xl flex flex-col",!a&&!c&&"bg-surface/80 backdrop-blur-xl",!a&&c&&"bg-surface",!a&&"ring-1 ring-inset ring-edge-subtle",tY[n],o?"radius-card overflow-hidden pb-safe":"radius-card overflow-hidden",r),style:a?{backgroundColor:u?Oi.bg:"var(--surface)",boxShadow:`inset 0 0 0 1px ${u?Oi.ring:"rgba(255, 255, 255, 0.1)"}`}:void 0,children:S.jsx(fB.Provider,{value:a,children:S.jsx(dB.Provider,{value:f,children:s})})})})})})]})})}function nY({className:e,...t}){const n=hB(),r=n==="light";return S.jsx(f8,{...t,className:Ve("text-base font-semibold sm:text-lg",!n&&"text-fg-primary",e),style:n?{color:r?Oi.text:"var(--fg-primary)"}:void 0})}function Qm({icon:e,title:t,onClose:n,className:r}){const s=hB(),o=s==="light";return S.jsxs("div",{className:Ve("flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b",!s&&"border-edge-subtle",r),style:s?{borderColor:o?Oi.border:"var(--edge-subtle)"}:void 0,children:[S.jsxs("div",{className:"flex items-center gap-3",children:[e&&S.jsx("div",{className:Ve(!s&&"text-icon-card-title"),style:s?{color:o?Oi.textSecondary:"var(--icon-card-title)"}:void 0,children:e}),S.jsx(nY,{children:t})]}),n&&S.jsxs(S.Fragment,{children:[S.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"}),S.jsx("button",{onClick:n,className:Ve("hidden sm:flex items-center justify-center p-2 radius-inner transition-colors",!s&&"text-fg-muted hover:text-fg-primary hover:bg-subtle"),style:s?{color:o?Oi.textMuted:"var(--fg-muted)"}:void 0,onMouseEnter:i=>{s&&(i.currentTarget.style.color=o?Oi.text:"var(--fg-primary)",i.currentTarget.style.backgroundColor=o?Oi.hoverBg:"var(--subtle)")},onMouseLeave:i=>{s&&(i.currentTarget.style.color=o?Oi.textMuted:"var(--fg-muted)",i.currentTarget.style.backgroundColor="transparent")},"aria-label":"Close",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})}function cf({className:e,...t}){return S.jsx("div",{...t,className:Ve("px-6 py-5",e)})}function e1({className:e,...t}){return S.jsx("div",{...t,className:Ve("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 Jm={snappy:{type:"spring",stiffness:500,damping:30},smooth:{type:"spring",stiffness:300,damping:30},gentle:{type:"spring",stiffness:200,damping:25}},rY={fast:.15,normal:.2,medium:.3},sY={easeOut:[0,0,.2,1],easeIn:[.4,0,1,1]},oY={dropdown:{type:"spring",stiffness:500,damping:30},fade:{duration:rY.fast,ease:sY.easeOut},layoutResize:{duration:.25,ease:[.25,1,.5,1]},numberTicker:{type:"spring",visualDuration:.4,bounce:.15,opacity:{duration:.15,ease:"linear"}},numberReveal:{type:"spring",visualDuration:.6,bounce:.25,opacity:{duration:.2,ease:"linear"}}},Yle={normal:.05};function iY({className:e,...t}){return S.jsx("nav",{...t,className:Ve(e,"flex h-full min-h-0 flex-col")})}function aY({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"flex flex-col border-b border-edge-subtle p-4","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function lY({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"flex flex-1 flex-col p-3","overflow-y-auto sidebar-scroll","[&>[data-slot=section]+[data-slot=section]]:mt-6")})}function cY({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"mt-auto flex flex-col","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function uY({className:e,...t}){const n=_.useId();return S.jsx(VG,{id:n,children:S.jsx("div",{...t,"data-slot":"section",className:Ve(e,"flex flex-col gap-0.5")})})}const dY=_.forwardRef(function(t,n){const{current:r,className:s,children:o,accentColor:i,...a}=t,c=!!i,u=Ve("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-fg-primary [&_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"),f=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 S.jsxs("span",{className:Ve(s,"relative"),children:[r&&S.jsx(Hr.span,{layout:"position",layoutId:"sidebar-current-indicator",className:Ve("absolute inset-y-1.5 -left-3 w-0.5 rounded-full",!c&&"bg-sys-blue sidebar-neo-indicator"),style:f,transition:Jm.snappy}),typeof a.href=="string"?S.jsxs(hy,{to:a.href,onClick:a.onClick,onMouseEnter:a.onMouseEnter,onMouseLeave:a.onMouseLeave,className:u,"data-current":r?"true":void 0,ref:n,children:[r&&S.jsx(Hr.span,{layout:"position",layoutId:"sidebar-current-highlight",className:Ve("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:Jm.snappy}),o]}):S.jsxs(Sy,{...a,className:Ve("cursor-default",u),"data-current":r?"true":void 0,ref:n,children:[r&&S.jsx(Hr.span,{layout:"position",layoutId:"sidebar-current-highlight",className:Ve("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:Jm.snappy}),o]})]})});function fY({className:e,...t}){return S.jsx("span",{...t,className:Ve(e,"truncate")})}function Zm({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 S.jsx("span",{...n,className:Ve("ml-auto flex items-center gap-1 px-1.5 py-0.5 rounded-full","text-xs font-medium",r[t],e)})}const mB="pymc_focus_mode";function hY(){try{return localStorage.getItem(mB)==="1"}catch{return!1}}function P_(e){try{localStorage.setItem(mB,e?"1":"0")}catch{}}const gB=Er()(e=>({focusMode:hY(),toggleFocusMode:()=>e(t=>{const n=!t.focusMode;return P_(n),{focusMode:n}}),setFocusMode:t=>{P_(t),e({focusMode:t})}})),pY=()=>gB(e=>e.focusMode),yB=_.createContext(null);function mY(){const e=_.useContext(yB);if(!e)throw new Error("useSidebar must be used within a SidebarLayout");return e}const bB={type:"spring",visualDuration:.35,bounce:.15},gY=bB.visualDuration*1e3;function yY({open:e,onClose:t,children:n}){return S.jsx(Ku,{children:e&&S.jsxs(h8,{static:!0,open:e,onClose:t,className:"lg:hidden relative z-[10002]",children:[S.jsx(Hr.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"}),S.jsx(Hr.div,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:bB,className:"fixed inset-y-0 left-0 w-72 max-w-[85vw] z-[10003]",children:S.jsx(cE,{className:"h-full",children:S.jsxs("div",{className:"flex h-full flex-col sidebar-panel",children:[S.jsx("div",{className:"absolute top-4 right-4 z-10",children:S.jsx(E$,{className:"p-2 rounded-lg text-fg-muted hover:text-fg-primary hover:bg-subtle-fill transition-colors","aria-label":"Close navigation",children:S.jsx(T8,{className:"w-5 h-5"})})}),n]})})})]})})}function bY({sidebar:e,navbar:t,children:n,className:r}){const[s,o]=_.useState(!1),i=pY(),a=XK(),c=Ls(),u=_.useRef(null);_.useEffect(()=>{i&&!c.pathname.startsWith("/messages/companion")&&gB.getState().setFocusMode(!1)},[c.pathname,i]),_.useEffect(()=>{var g;(g=u.current)==null||g.scrollTo({top:0,left:0,behavior:"auto"})},[c.pathname]);const f=()=>o(!0),h=()=>o(!1),p={isOpen:s,open:f,close:h,toggle:()=>o(g=>!g)};return S.jsx(yB.Provider,{value:p,children:S.jsxs("div",{className:"flex h-screen overflow-hidden bg-body",children:[S.jsx(Hr.aside,{className:"hidden lg:flex flex-col flex-shrink-0 h-full relative sidebar-panel overflow-hidden",animate:{width:i?0:256},transition:a?{duration:0}:Jm.smooth,children:S.jsx(Hr.div,{className:"flex flex-col h-full min-w-[256px]",animate:{opacity:i?0:1},transition:a?{duration:0}:oY.fade,children:e})}),S.jsx(yY,{open:s,onClose:h,children:e}),S.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[S.jsx("header",{className:"lg:hidden sticky top-0 z-[10001] h-14 mobile-header",children:S.jsxs("div",{className:"flex items-center h-full px-4",children:[S.jsx("button",{onClick:f,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:S.jsx(xV,{className:"w-5 h-5 text-fg-primary"})}),S.jsx("div",{className:"flex-1 min-w-0",children:t})]})}),S.jsx("main",{ref:u,className:Ve("flex-1 overflow-y-auto main-content",r),children:n})]})]})})}function vY({className:e,...t}){return S.jsx("nav",{...t,className:Ve(e,"flex flex-1 items-center gap-3")})}function M_({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"flex items-center gap-3")})}function wY({className:e,...t}){return S.jsx("div",{"aria-hidden":"true",...t,className:Ve(e,"flex-1")})}const CY=[45,72,33,58,80,42,65,28,55,75,38,62];function zt({className:e,style:t}){return S.jsx("div",{className:Ve("animate-pulse bg-subtle-fill radius-badge",e),style:t})}function EY(){return S.jsx("div",{className:"p-3 radius-inner border-card bg-subtle",children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(zt,{className:"w-14 h-6 rounded shrink-0"}),S.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[S.jsx(zt,{className:"h-4 w-full"}),S.jsx(zt,{className:"h-4 w-3/4"}),S.jsx(zt,{className:"h-3 w-32 mt-1"})]})]})})}function Xle({count:e=8}){return S.jsx("div",{className:"space-y-2",children:Array.from({length:e}).map((t,n)=>S.jsx(EY,{},n))})}function xY(){return S.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-24"})]}),S.jsx(zt,{className:"h-8 w-20"}),S.jsxs("div",{className:"flex-1 flex flex-col justify-end gap-2",children:[S.jsx(zt,{className:"h-3 w-full"}),S.jsx(zt,{className:"h-3 w-3/4"})]})]})}function SY(){return S.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-24"})]}),S.jsx("div",{className:"flex-1 flex items-end gap-1",children:CY.slice(0,8).map((e,t)=>S.jsx(zt,{className:"flex-1",style:{height:`${e}%`}},t))})]})}function kY({rows:e=5}){return S.jsxs("div",{className:"flex flex-col h-full","aria-hidden":"true",children:[S.jsx("div",{className:"pb-3 border-b border-edge-subtle",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-24"})]})}),S.jsx("div",{className:"flex-1 pt-3 flex flex-col gap-3",children:Array.from({length:e}).map((t,n)=>S.jsx(zt,{className:"h-6 w-full"},n))})]})}const vB=_.createContext(void 0);function Qle(){return _.useContext(vB)}const AY={sm:"radius-inner",md:"radius-inset",lg:"radius-card",xl:"radius-hero",full:"radius-pill",none:"radius-none"},Jle=_.forwardRef(function({children:t,elevated:n,compact:r,noPadding:s,radius:o="lg",glass:i=!0,stroke:a=!0,shadow:c,reflex:u=!1,glow:f=!1,neomorphic:h=!0,onClick:p,className:g,style:y,isLoaded:b,skeletonType:w="card",...x},v){const E=_.useContext(vB),[A,k]=_.useState(!1);_.useEffect(()=>{let $=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{$||k(!0)})}),()=>{$=!0}},[]);const R=b??E??A,j=c??n??!1,B=a,P={...y,...u?{"--surface-reflex":"1"}:{}},I=()=>{switch(w){case"chart":return S.jsx(SY,{});case"list":return S.jsx(kY,{});default:return S.jsx(xY,{})}},H=Ve(AY[o],i&&(n?"bg-surface/85 backdrop-blur-xl":"bg-surface/80 backdrop-blur-lg"),!i&&"bg-surface",h&&"depth-raised",B&&!h&&!f&&"ring-1 ring-inset ring-edge-subtle",f&&"ring-1 ring-inset ring-sys-blue/40",j&&(n?"shadow-xl":"shadow-lg"),u&&"surface-reflex","h-full flex flex-col relative",!s&&(r?"p-3 sm:p-4":"p-4 sm:p-5"),p&&"cursor-pointer",g);return R?S.jsx("div",{ref:v,"data-card-surface":!0,className:H,style:P,onClick:p,...x,children:t}):S.jsx("div",{ref:v,"data-card-surface":!0,className:H,style:P,...x,children:I()})});function Zle({title:e,icon:t,badge:n,badgeColor:r="teal",subtitle:s,actions:o,iconColor:i="text-icon-card-title",listHeader:a=!1,stackActionsOnMobile:c=!1,stackBreakpoint:u="sm",titleExtra:f,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=S.jsxs(S.Fragment,{children:[t&&S.jsx("span",{className:Ve("icon-md flex items-center justify-center",i),children:t}),S.jsx("span",{className:"type-micro",children:e}),n&&S.jsx(Pz,{color:r,children:n}),f]}),w=h?"button":"div",x=h?{onClick:h,type:"button"}:{};return c&&o?S.jsxs(w,{...x,className:Ve("flex flex-col gap-1 flex-shrink-0",a?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[S.jsxs("div",{className:y[u],children:[S.jsx("div",{className:"flex items-center gap-3",children:b}),S.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:o})]}),s&&S.jsx("p",{className:"type-label text-fg-muted ml-8",children:s})]}):S.jsxs(w,{...x,className:Ve("flex flex-col gap-1 flex-shrink-0",a?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[S.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-[32px]",children:[S.jsx("div",{className:"flex items-center gap-3",children:b}),o&&S.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:o})]}),s&&S.jsx("p",{className:"type-label text-fg-muted ml-8",children:s})]})}_.forwardRef(function({children:t,icon:n,className:r,...s},o){return S.jsxs("h3",{ref:o,className:Ve("flex items-center gap-2","text-base font-semibold text-fg-primary",r),...s,children:[n&&S.jsx("span",{className:"text-icon-card-title w-5 h-5 flex-shrink-0",children:n}),t]})});_.forwardRef(function({children:t,className:n,...r},s){return S.jsx("p",{ref:s,className:Ve("text-sm text-fg-muted",n),...r,children:t})});const ece=_.forwardRef(function({children:t,centered:n,className:r,...s},o){return S.jsx("div",{ref:o,className:Ve("flex-1 min-h-0",n&&"flex items-center justify-center",r),...s,children:t})});_.forwardRef(function({children:t,className:n,...r},s){return S.jsx("div",{ref:s,className:Ve("flex items-center justify-end gap-3","pt-4 mt-4","border-t border-edge-subtle",n),...r,children:t})});_.forwardRef(function({children:t,border:n,className:r,...s},o){return S.jsx("div",{ref:o,className:Ve(n&&"pt-4 mt-4 border-t border-edge-subtle",r),...s,children:t})});function _Y({defaultOpen:e=!1,className:t,children:n}){return S.jsx(m8,{defaultOpen:e,children:S.jsx("div",{className:Ve("flex flex-col",t),children:n})})}const DY=_.forwardRef(function({className:t,icon:n,children:r,...s},o){return S.jsx(zg,{ref:o,className:Ve("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),...s,children:({open:i})=>S.jsxs(S.Fragment,{children:[r,S.jsx("span",{className:Ve("transition-transform duration-200",i?"rotate-180":"rotate-0"),children:n||S.jsx(Rw,{className:"w-4 h-4"})})]})})});function TY({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 S.jsx(pE,{static:!0,children:({open:s})=>S.jsx(Ku,{initial:!1,children:s&&S.jsx(Hr.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:Ve("overflow-hidden",t),children:S.jsx("div",{className:Ve(e==="up"?"pb-2":"pt-2"),children:n})})})})}function FY({label:e,icon:t,defaultOpen:n=!0,direction:r="down",className:s,triggerStyle:o,dataId:i,children:a}){const c=i?{[`data-${i}-disclosure`]:!0}:{},u=S.jsxs("span",{className:"flex items-center gap-3",children:[t&&S.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),S.jsx("span",{className:"type-micro",children:e})]});return r==="up"?S.jsx(m8,{defaultOpen:n,children:({open:f})=>S.jsxs("div",{className:Ve("relative",s),children:[S.jsx(pE,{static:!0,className:"relative z-50",children:S.jsx(Ku,{initial:!1,mode:"wait",children:f&&S.jsxs(Hr.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",children:[S.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[S.jsxs("span",{className:"flex items-center gap-3",children:[t&&S.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),S.jsx("span",{className:"type-micro",children:e})]}),S.jsx(zg,{className:"p-1 rounded hover:bg-subtle-fill-strong transition-colors",children:S.jsx(Hr.span,{initial:{rotate:0},animate:{rotate:180},exit:{rotate:0},transition:{type:"spring",stiffness:400,damping:25},children:S.jsx(Rw,{className:"w-4 h-4"})})})]}),S.jsx("div",{className:"px-3 pb-3",children:a})]})})}),S.jsx(Hr.div,{animate:{opacity:f?.4:1,scale:f?.98:1},transition:{type:"spring",stiffness:500,damping:35},children:S.jsxs(zg,{...c,style:o,className:Ve("flex w-full items-center justify-between gap-3","px-3 py-2 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:[u,S.jsx(Hr.span,{animate:{rotate:f?180:0},transition:{type:"spring",stiffness:400,damping:25},children:S.jsx(Rw,{className:"w-4 h-4"})})]})})]})}):S.jsxs(_Y,{defaultOpen:n,className:s,children:[S.jsx(DY,{...c,children:u}),S.jsx(TY,{direction:"down",children:S.jsx("div",{className:"bg-subtle-fill radius-inset mx-1 mt-1",children:a})})]})}const lm=8;function BY(e,t,n){const r=window.scrollY,s=window.scrollX;switch(n){case"top":return{top:e.top+r-t.height-lm,left:e.left+s+(e.width-t.width)/2};case"bottom":return{top:e.bottom+r+lm,left:e.left+s+(e.width-t.width)/2};case"left":return{top:e.top+r+(e.height-t.height)/2,left:e.left+s-t.width-lm};case"right":return{top:e.top+r+(e.height-t.height)/2,left:e.right+s+lm}}}const RY=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 PY({placement:e}){const t=Ve("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 S.jsx("span",{className:t,style:{backgroundColor:"var(--tooltip-bg)"}})}function MY({content:e,children:t,placement:n="top",delay:r=200,arrow:s=!0,disabled:o=!1,className:i}){const[a,c]=_.useState(!1),[u,f]=_.useState({top:0,left:0}),[h,p]=_.useState(!1),g=_.useRef(null),y=_.useRef(null),b=_.useRef();_.useEffect(()=>{p(!0)},[]),_.useEffect(()=>{if(!a||!g.current||!y.current)return;const k=g.current.getBoundingClientRect(),R=y.current.getBoundingClientRect(),j=BY(k,R,n),B=window.innerWidth-R.width-8,P=window.innerHeight+window.scrollY-R.height-8;f({top:Math.max(8,Math.min(j.top,P)),left:Math.max(8,Math.min(j.left,B))})},[a,n]);const w=_.useCallback(()=>{o||(b.current=setTimeout(()=>{c(!0)},r))},[r,o]),x=_.useCallback(()=>{b.current&&clearTimeout(b.current),c(!1)},[]);if(_.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),!_.isValidElement(t))return t;const v=_.cloneElement(t,{ref:g,onMouseEnter:k=>{var R,j;w(),(j=(R=t.props).onMouseEnter)==null||j.call(R,k)},onMouseLeave:k=>{var R,j;x(),(j=(R=t.props).onMouseLeave)==null||j.call(R,k)},onFocus:k=>{var R,j;w(),(j=(R=t.props).onFocus)==null||j.call(R,k)},onBlur:k=>{var R,j;x(),(j=(R=t.props).onBlur)==null||j.call(R,k)}}),E=RY(n),A=S.jsx(Ku,{children:a&&S.jsxs(Hr.div,{ref:y,initial:"hidden",animate:"visible",exit:"hidden",variants:E,transition:{duration:.15,ease:"easeOut"},className:Ve("fixed z-[10020] px-2.5 py-1.5 text-xs font-medium","rounded-lg","pointer-events-none",i),style:{top:u.top,left:u.left,backgroundColor:"var(--tooltip-bg)",color:"var(--tooltip-fg)",border:"1px solid var(--tooltip-border)",boxShadow:"var(--tooltip-shadow)"},role:"tooltip",children:[e,s&&S.jsx(PY,{placement:n})]})});return S.jsxs(S.Fragment,{children:[v,h&&ju.createPortal(A,document.body)]})}const wB={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"}},tce=_.forwardRef(function({enabled:t,onChange:n,label:r,description:s,tooltip:o,size:i="md",color:a="muted",dangerOff:c=!1,disabled:u=!1,status:f="idle",name:h,className:p},g){const y=wB[i],b=f==="loading",w=a==="muted";return S.jsxs(Py,{disabled:u||b,className:Ve("flex items-center gap-3",p),children:[S.jsx(g8,{ref:g,checked:t,onChange:n,name:h,className:Ve(w?"toggle-switch-track":"group relative inline-flex shrink-0 items-center rounded-full border-2",y.track,!w&&(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:S.jsx("span",{className:Ve(w?"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:w&&S.jsx("span",{className:Ve("toggle-switch-dot",y.dot,c?Ve("opacity-100",!t&&"toggle-switch-dot-danger"):t?"opacity-100":"opacity-0")})})}),(r||s||o)&&S.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r&&S.jsx(yh,{className:Ve("text-sm font-medium cursor-pointer select-none",u?"text-fg-muted":"text-fg-primary"),children:r}),o&&S.jsx(MY,{content:o,placement:"top",children:S.jsx("span",{className:"text-fg-muted hover:text-fg-secondary cursor-help transition-colors",children:S.jsx(pV,{className:"w-3.5 h-3.5"})})}),s&&!o&&S.jsx(Hu,{className:"text-xs text-fg-muted",children:s})]}),f!=="idle"&&S.jsxs("div",{className:"flex items-center shrink-0",children:[f==="loading"&&S.jsx(D8,{className:Ve(y.icon,"text-fg-muted animate-spin")}),f==="success"&&S.jsx(My,{className:Ve(y.icon,"text-sys-green")}),f==="error"&&S.jsx(T8,{className:Ve(y.icon,"text-sys-red")})]})]})}),nce=_.forwardRef(function({enabled:t,onChange:n,size:r="md",disabled:s=!1,"aria-label":o,className:i},a){const c=wB[r];return S.jsx(g8,{ref:a,checked:t,onChange:n,disabled:s,"aria-label":o,className:Ve("toggle-switch-track",c.track,"disabled:opacity-50 disabled:cursor-not-allowed","ring-focus","transition-all duration-200",i),"data-size":r,children:S.jsx("span",{className:Ve("toggle-switch-thumb","transform rounded-full transition-transform duration-200",c.thumb,t?c.translate:"translate-x-[4px]"),children:S.jsx("span",{className:Ve("toggle-switch-dot",c.dot,t?"opacity-100":"opacity-0")})})})}),IY={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"}},CB=_.forwardRef(function({type:t="text",size:n="md",invalid:r=!1,leadingIcon:s,trailingIcon:o,leadingAddon:i,trailingAddon:a,className:c,disabled:u,...f},h){const p=IY[n],g=s||i,y=o||a;return i||a?S.jsxs("div",{className:Ve("flex",c),children:[i&&S.jsx("span",{className:Ve("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}),S.jsx("input",{ref:h,type:t,disabled:u,className:Ve("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",!u&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",i&&!a&&"rounded-r-lg",a&&!i&&"rounded-l-lg",!i&&!a&&"radius-inner"),...f}),a&&S.jsx("span",{className:Ve("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:a})]}):S.jsxs("div",{className:Ve("relative",c),children:[s&&S.jsx("div",{className:Ve("absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none","text-fg-muted"),children:S.jsx("span",{className:p.icon,children:s})}),S.jsx("input",{ref:h,type:t,disabled:u,className:Ve("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",!u&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors"),...f}),o&&S.jsx("div",{className:Ve("absolute inset-y-0 right-0 flex items-center pr-3","text-fg-muted"),children:S.jsx("span",{className:p.icon,children:o})})]})}),rce=_.forwardRef(function({label:t,description:n,errorMessage:r,required:s,invalid:o,className:i,...a},c){const u=o&&r;return S.jsxs(Py,{className:Ve("flex flex-col gap-1.5",i),children:[t&&S.jsxs(yh,{className:"text-sm font-medium text-fg-primary",children:[t,s&&S.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!u&&S.jsx(Hu,{className:"text-xs text-fg-muted -mt-0.5",children:n}),S.jsx(CB,{ref:c,invalid:o,...a}),u&&S.jsx("p",{className:"text-xs text-sys-red",children:r})]})});_.forwardRef(function({value:t,onChange:n,min:r,max:s,step:o=1,precision:i,...a},c){const u=h=>{const p=h.target.value;if(p===""||p==="-"){n(0);return}const g=parseFloat(p);if(!isNaN(g)){const y=r!==void 0&&s!==void 0?Math.min(Math.max(g,r),s):r!==void 0?Math.max(g,r):s!==void 0?Math.min(g,s):g;n(y)}},f=i!==void 0&&typeof t=="number"?t.toFixed(i):t;return S.jsx(CB,{ref:c,type:"number",value:f,onChange:u,min:r,max:s,step:o,...a})});const LY={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},NY=_.forwardRef(function({rows:t=3,resize:n="vertical",invalid:r=!1,disabled:s,className:o,...i},a){return S.jsx("textarea",{ref:a,rows:t,disabled:s,className:Ve("w-full radius-inner px-4 py-3 text-sm",LY[n],"bg-subtle",r?"border border-sys-red":"border-control","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!s&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",o),...i})});_.forwardRef(function({label:t,description:n,errorMessage:r,required:s,invalid:o,showCount:i,maxLength:a,value:c,className:u,...f},h){const p=o&&r,g=typeof c=="string"?c.length:0;return S.jsxs(Py,{className:Ve("flex flex-col gap-1.5",u),children:[t&&S.jsxs(yh,{className:"text-sm font-medium text-fg-primary",children:[t,s&&S.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!p&&S.jsx(Hu,{className:"text-xs text-fg-muted -mt-0.5",children:n}),S.jsx(NY,{ref:h,invalid:o,maxLength:a,value:c,...f}),S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p?S.jsx("p",{className:"text-xs text-sys-red flex-1",children:r}):S.jsx("span",{}),i&&a&&S.jsxs("span",{className:Ve("text-xs",g>a?"text-sys-red":"text-fg-muted"),children:[g,"/",a]})]})]})});const jY={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"}},sce=_.forwardRef(function({checked:t,onChange:n,indeterminate:r=!1,label:s,description:o,size:i="md",disabled:a=!1,name:c,value:u,className:f},h){const p=jY[i];return S.jsxs(Py,{disabled:a,className:Ve("flex items-start gap-3",f),children:[S.jsxs(v$,{ref:h,checked:t,onChange:n,name:c,value:u,className:Ve("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&&!a&&"hover:border-edge-strong","ring-focus","disabled:opacity-50 disabled:cursor-not-allowed"),children:[t&&!r&&S.jsx(My,{className:Ve(p.icon,"text-white stroke-[3]")}),r&&S.jsx(_V,{className:Ve(p.icon,"text-white stroke-[3]")})]}),(s||o)&&S.jsxs("div",{className:"flex-1 min-w-0 select-none",children:[s&&S.jsx(yh,{className:Ve("text-sm font-medium cursor-pointer",a?"text-fg-muted":"text-fg-primary"),children:s}),o&&S.jsx(Hu,{className:"text-xs text-fg-muted mt-0.5",children:o})]})]})});_.createContext({variant:"default",divider:"subtle",grid:!0});const t1="0.9.341",I_="'JetBrains Mono', monospace";function OY({height:e=16,responsive:t=!1,className:n=""}){const r="var(--sys-blue)",s="var(--fg-primary)";if(t)return S.jsxs("svg",{className:n,viewBox:"0 0 210 24",preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"openHop:Console",style:{display:"block",width:"80%",height:"auto"},children:[S.jsx("style",{children:` + `),()=>{k.contains(A)&&k.removeChild(A)}},[t]),S.jsx(MG,{isPresent:t,childRef:i,sizeRef:a,children:_.cloneElement(e,{ref:f})})}const LG=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:i,anchorX:a,anchorY:c,root:u})=>{const f=bE(NG),h=_.useId();let p=!0,g=_.useMemo(()=>(p=!1,{id:h,initial:t,isPresent:n,custom:s,onExitComplete:y=>{f.set(y,!0);for(const b of f.values())if(!b)return;r&&r()},register:y=>(f.set(y,!1),()=>f.delete(y))}),[n,f,r]);return o&&p&&(g={...g}),_.useMemo(()=>{f.forEach((y,b)=>f.set(b,!1))},[n]),_.useEffect(()=>{!n&&!f.size&&r&&r()},[n]),i==="popLayout"&&(e=S.jsx(IG,{isPresent:n,anchorX:a,anchorY:c,root:u,children:e})),S.jsx(wh.Provider,{value:g,children:e})};function NG(){return new Map}function QF(e=!0){const t=_.useContext(wh);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=_.useId();_.useEffect(()=>{if(e)return s(o)},[e]);const i=_.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}function Gle(){return jG(_.useContext(wh))}function jG(e){return e===null?!0:e.isPresent}const im=e=>e.key||"";function v_(e){const t=[];return _.Children.forEach(e,n=>{_.isValidElement(n)&&t.push(n)}),t}const Ku=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:i=!1,anchorX:a="left",anchorY:c="top",root:u})=>{const[f,h]=QF(i),p=_.useMemo(()=>v_(e),[e]),g=i&&!f?[]:p.map(im),y=_.useRef(!0),b=_.useRef(p),w=bE(()=>new Map),x=_.useRef(new Set),[v,E]=_.useState(p),[A,k]=_.useState(p);vE(()=>{y.current=!1,b.current=p;for(let B=0;B{const P=im(B),I=i&&!f?!1:p===A||g.includes(P),H=()=>{if(x.current.has(P))return;if(x.current.add(P),w.has(P))w.set(P,!0);else return;let $=!0;w.forEach(W=>{W||($=!1)}),$&&(j==null||j(),k(b.current),i&&(h==null||h()),r&&r())};return S.jsx(LG,{isPresent:I,initial:!y.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:o,root:u,onExitComplete:I?void 0:H,anchorX:a,anchorY:c,children:B},P)})})},OG=_.createContext(null);function $G(){const e=_.useRef(!1);return vE(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function UG(){const e=$G(),[t,n]=_.useState(0),r=_.useCallback(()=>{e.current&&n(t+1)},[t]);return[_.useCallback(()=>Bn.postRender(r),[r]),t]}const JF=e=>e===!0,zG=e=>JF(e===!0)||e==="id",VG=({children:e,id:t,inherit:n=!0})=>{const r=_.useContext(Gf),s=_.useContext(OG),[o,i]=UG(),a=_.useRef(null),c=r.id||s;a.current===null&&(zG(n)&&c&&(t=t?c+"-"+t:c),a.current={id:t,group:JF(n)&&r.group||y_()});const u=_.useMemo(()=>({...a.current,forceRender:o}),[i]);return S.jsx(Gf.Provider,{value:u,children:e})},ZF=_.createContext({strict:!1}),w_={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 C_=!1;function HG(){if(C_)return;const e={};for(const t in w_)e[t]={isEnabled:n=>w_[t].some(r=>!!n[r])};_F(e),C_=!0}function eB(){return HG(),xq()}function WG(e){const t=eB();for(const n in e)t[n]={...t[n],...e[n]};_F(t)}const qG=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 Xg(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||qG.has(e)}let tB=e=>!Xg(e);function GG(e){typeof e=="function"&&(tB=t=>t.startsWith("on")?!Xg(t):e(t))}try{GG(require("@emotion/is-prop-valid").default)}catch{}function KG(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(tB(s)||n===!0&&Xg(s)||!t&&!Xg(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Ny=_.createContext({});function YG(e,t){if(Ly(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Qf(n)?n:void 0,animate:Qf(r)?r:void 0}}return e.inherit!==!1?t:{}}function XG(e){const{initial:t,animate:n}=YG(e,_.useContext(Ny));return _.useMemo(()=>({initial:t,animate:n}),[E_(t),E_(n)])}function E_(e){return Array.isArray(e)?e.join(" "):e}const XE=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function nB(e,t,n){for(const r in t)!ss(t[r])&&!MF(r,n)&&(e[r]=t[r])}function QG({transformTemplate:e},t){return _.useMemo(()=>{const n=XE();return GE(n,t,e),Object.assign({},n.vars,n.style)},[t])}function JG(e,t){const n=e.style||{},r={};return nB(r,n,e),Object.assign(r,QG(e,t)),r}function ZG(e,t){const n={},r=JG(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 rB=()=>({...XE(),attrs:{}});function eK(e,t,n,r){const s=_.useMemo(()=>{const o=rB();return IF(o,t,NF(r),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};nB(o,e.style,e),s.style={...o,...s.style}}return s}const tK=["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 QE(e){return typeof e!="string"||e.includes("-")?!1:!!(tK.indexOf(e)>-1||/[A-Z]/u.test(e))}function nK(e,t,n,{latestValues:r},s,o=!1,i){const c=(i??QE(e)?eK:ZG)(t,r,s,e),u=KG(t,typeof e=="string",o),f=e!==_.Fragment?{...u,...c,ref:n}:{},{children:h}=t,p=_.useMemo(()=>ss(h)?h.get():h,[h]);return _.createElement(e,{...f,children:p})}function rK({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:sK(n,r,s,e),renderState:t()}}function sK(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Ym(o[p]);let{initial:i,animate:a}=e;const c=Ly(e),u=AF(e);t&&u&&!c&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let f=n?n.initial===!1:!1;f=f||i===!1;const h=f?a:i;if(h&&typeof h!="boolean"&&!Iy(h)){const p=Array.isArray(h)?h:[h];for(let g=0;g(t,n)=>{const r=_.useContext(Ny),s=_.useContext(wh),o=()=>rK(e,t,r,s);return n?o():bE(o)},oK=sB({scrapeMotionValuesFromProps:KE,createRenderState:XE}),iK=sB({scrapeMotionValuesFromProps:jF,createRenderState:rB}),aK=Symbol.for("motionComponentSymbol");function lK(e,t,n){const r=_.useRef(n);_.useInsertionEffect(()=>{r.current=n});const s=_.useRef(null);return _.useCallback(o=>{var a;o&&((a=e.onMount)==null||a.call(e,o)),t&&(o?t.mount(o):t.unmount());const i=r.current;if(typeof i=="function")if(o){const c=i(o);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):i(o);else i&&(i.current=o)},[t])}const oB=_.createContext({});function lf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function cK(e,t,n,r,s,o){var x,v;const{visualElement:i}=_.useContext(Ny),a=_.useContext(ZF),c=_.useContext(wh),u=_.useContext(YE).reducedMotion,f=_.useRef(null),h=_.useRef(!1);r=r||a.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:i,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,isSVG:o}),h.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));const p=f.current,g=_.useContext(oB);p&&!p.projection&&s&&(p.type==="html"||p.type==="svg")&&uK(f.current,n,s,g);const y=_.useRef(!1);_.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const b=n[fF],w=_.useRef(!!b&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,b))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,b)));return vE(()=>{h.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),w.current&&p.animationState&&p.animationState.animateChanges())}),_.useEffect(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var E;(E=window.MotionHandoffMarkAsComplete)==null||E.call(window,b)}),w.current=!1),p.enteringChildren=void 0)}),p}function uK(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:iB(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||a&&lf(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:c,layoutRoot:u})}function iB(e){if(e)return e.options.allowProjection!==!1?e.projection:iB(e.parent)}function tv(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&WG(r);const o=n?n==="svg":QE(e),i=o?iK:oK;function a(u,f){let h;const p={..._.useContext(YE),...u,layoutId:dK(u)},{isStatic:g}=p,y=XG(u),b=i(u,g);if(!g&&F8){fK();const w=hK(p);h=w.MeasureLayout,y.visualElement=cK(e,b,p,s,w.ProjectionNode,o)}return S.jsxs(Ny.Provider,{value:y,children:[h&&y.visualElement?S.jsx(h,{visualElement:y.visualElement,...p}):null,nK(e,u,lK(b,y.visualElement,f),b,g,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=_.forwardRef(a);return c[aK]=e,c}function dK({layoutId:e}){const t=_.useContext(Gf).id;return t&&e!==void 0?t+"-"+e:e}function fK(e,t){_.useContext(ZF).strict}function hK(e){const t=eB(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function pK(e,t){if(typeof Proxy>"u")return tv;const n=new Map,r=(o,i)=>tv(o,i,e,t),s=(o,i)=>r(o,i);return new Proxy(s,{get:(o,i)=>i==="create"?r:(n.has(i)||n.set(i,tv(i,void 0,e,t)),n.get(i))})}const mK=(e,t)=>t.isSVG??QE(e)?new $q(t):new Mq(t,{allowProjection:e!==_.Fragment});class gK extends ol{constructor(t){super(t),t.animationState||(t.animationState=Wq(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Iy(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 yK=0;class bK extends ol{constructor(){super(...arguments),this.id=yK++}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 s=this.node.animationState.setActive("exit",!t);n&&!t&&s.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 vK={animation:{Feature:gK},exit:{Feature:bK}};function Sh(e){return{point:{x:e.pageX,y:e.pageY}}}const wK=e=>t=>VE(t)&&e(t,Sh(t));function Pf(e,t,n,r){return Zf(e,t,wK(n),r)}const aB=({current:e})=>e?e.ownerDocument.defaultView:null,x_=(e,t)=>Math.abs(e-t);function CK(e,t){const n=x_(e.x,t.x),r=x_(e.y,t.y);return Math.sqrt(n**2+r**2)}const S_=new Set(["auto","scroll"]);class lB{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:o=!1,distanceThreshold:i=3,element:a}={}){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=rv(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,b=CK(g.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!b)return;const{point:w}=g,{timestamp:x}=Vr;this.history.push({...w,timestamp:x});const{onStart:v,onMove:E}=this.handlers;y||(v&&v(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),E&&E(this.lastMoveEvent,g)},this.handlePointerMove=(g,y)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=nv(y,this.transformPagePoint),Bn.update(this.updatePoint,!0)},this.handlePointerUp=(g,y)=>{this.end();const{onEnd:b,onSessionEnd:w,resumeAnimation:x}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=rv(g.type==="pointercancel"?this.lastMoveEventInfo:nv(y,this.transformPagePoint),this.history);this.startEvent&&b&&b(g,v),w&&w(g,v)},!VE(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=i,this.contextWindow=s||window;const c=Sh(t),u=nv(c,this.transformPagePoint),{point:f}=u,{timestamp:h}=Vr;this.history=[{...f,timestamp:h}];const{onSessionStart:p}=n;p&&p(t,rv(u,this.history)),this.removeListeners=Ch(Pf(this.contextWindow,"pointermove",this.handlePointerMove),Pf(this.contextWindow,"pointerup",this.handlePointerUp),Pf(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(S_.has(r.overflowX)||S_.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,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:s.x-n.x,y:s.y-n.y};o.x===0&&o.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,s),Bn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),el(this.updatePoint)}}function nv(e,t){return t?{point:t(e.point)}:e}function k_(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rv({point:e},t){return{point:e,delta:k_(e,cB(t)),offset:k_(e,EK(t)),velocity:xK(t,.1)}}function EK(e){return e[0]}function cB(e){return e[e.length-1]}function xK(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=cB(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ki(t)));)n--;if(!r)return{x:0,y:0};const o=wo(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function SK(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Jn(n,e,r.max):Math.min(e,n)),e}function A_(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 kK(e,{top:t,left:n,bottom:r,right:s}){return{x:A_(e.x,n,s),y:A_(e.y,t,r)}}function __(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Kf(t.min,t.max-r,e.min):r>s&&(n=Kf(e.min,e.max-s,t.min)),gi(0,1,n)}function DK(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 Jw=.35;function TK(e=Jw){return e===!1?e=0:e===!0&&(e=Jw),{x:D_(e,"left","right"),y:D_(e,"top","bottom")}}function D_(e,t,n){return{min:T_(e,t),max:T_(e,n)}}function T_(e,t){return typeof e=="number"?e:e[t]||0}const FK=new WeakMap;class BK{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=Dr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=h=>{n?(this.stopAnimation(),this.snapToCursor(Sh(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=fq(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),bo(x=>{let v=this.getAxisMotionValue(x).get()||0;if(hi.test(v)){const{projection:E}=this.visualElement;if(E&&E.layout){const A=E.layout.layoutBox[x];A&&(v=bs(A)*(parseFloat(v)/100))}}this.originPoint[x]=v}),b&&Bn.postRender(()=>b(h,p)),qw(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p;const{dragPropagation:g,dragDirectionLock:y,onDirectionLock:b,onDrag:w}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:x}=p;if(y&&this.currentDirection===null){this.currentDirection=RK(x),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",p.point,x),this.updateAxis("y",p.point,x),this.visualElement.render(),w&&w(h,p)},c=(h,p)=>{this.latestPointerEvent=h,this.latestPanInfo=p,this.stop(h,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>bo(h=>{var p;return this.getAnimationState(h)==="paused"&&((p=this.getAxisMotionValue(h).animation)==null?void 0:p.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new lB(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,distanceThreshold:r,contextWindow:aB(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!s||!r)return;const{velocity:i}=s;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&&Bn.postRender(()=>a(r,s))}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:s}=this.getProps();if(!r||!am(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=SK(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var o;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(o=this.visualElement.projection)==null?void 0:o.layout,s=this.constraints;t&&lf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=kK(r.layoutBox,t):this.constraints=!1,this.elastic=TK(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&bo(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=DK(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:s}=this.visualElement;if(!s||!s.layout)return!1;const o=Dq(r,s.root,this.visualElement.getTransformPagePoint());let i=AK(s.layout.layoutBox,o);if(n){const a=n(kq(i));this.hasMutatedConstraints=!!a,a&&(i=TF(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=bo(f=>{if(!am(f,n,this.currentDirection))return;let h=c&&c[f]||{};i&&(h={min:0,max:0});const p=s?200:1e6,g=s?40:1e7,y={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(f,y)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return qw(this.visualElement,t),r.start(jE(t,r,0,n,this.visualElement,!1))}stopAnimation(){bo(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){bo(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(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){bo(n=>{const{drag:r}=this.getProps();if(!am(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:i,max:a}=s.layout.layoutBox[n],c=o.get()||0;o.set(t[n]-Jn(i,a,.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 s={x:0,y:0};bo(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const c=a.get();s[i]=_K({min:c,max:c},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),bo(i=>{if(!am(i,t,null))return;const a=this.getAxisMotionValue(i),{min:c,max:u}=this.constraints[i];a.set(Jn(c,u,s[i]))})}addListeners(){if(!this.visualElement.current)return;FK.set(this.visualElement,this);const t=this.visualElement.current,n=Pf(t,"pointerdown",c=>{const{drag:u,dragListener:f=!0}=this.getProps(),h=c.target,p=h!==t&&xF(h);u&&f&&!p&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();lf(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Bn.read(r);const i=Zf(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(bo(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].translate))}),this.visualElement.render())}));return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=Jw,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function am(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function RK(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class PK extends ol{constructor(t){super(t),this.removeGroupControls=Co,this.removeListeners=Co,this.controls=new BK(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Co}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 F_=e=>(t,n)=>{e&&Bn.postRender(()=>e(t,n))};class MK extends ol{constructor(){super(...arguments),this.removePointerDownListener=Co}onPointerDown(t){this.session=new lB(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:aB(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:F_(t),onStart:F_(n),onMove:r,onEnd:(o,i)=>{delete this.session,s&&Bn.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=Pf(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 sv=!1;class IK extends _.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),sv&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Xm.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,{projection:i}=r;return i&&(i.isPresent=o,t.layoutDependency!==n&&i.setOptions({...i.options,layoutDependency:n}),sv=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==o?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||Bn.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),zE.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;sv=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function uB(e){const[t,n]=QF(),r=_.useContext(Gf);return S.jsx(IK,{...e,layoutGroup:r,switchLayoutGroup:_.useContext(oB),isPresent:t,safeToRemove:n})}const LK={pan:{Feature:MK},drag:{Feature:PK,ProjectionNode:XF,MeasureLayout:uB}};function B_(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&Bn.postRender(()=>o(t,Sh(t)))}class NK extends ol{mount(){const{current:t}=this.node;t&&(this.unmount=hq(t,(n,r)=>(B_(this.node,r,"Start"),s=>B_(this.node,s,"End"))))}unmount(){}}class jK extends ol{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=Ch(Zf(this.node.current,"focus",()=>this.onFocus()),Zf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function R_(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 s="onTap"+(n==="End"?"":n),o=r[s];o&&Bn.postRender(()=>o(t,Sh(t)))}class OK extends ol{mount(){const{current:t}=this.node;t&&(this.unmount=gq(t,(n,r)=>(R_(this.node,r,"Start"),(s,{success:o})=>R_(this.node,s,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Zw=new WeakMap,ov=new WeakMap,$K=e=>{const t=Zw.get(e.target);t&&t(e)},UK=e=>{e.forEach($K)};function zK({root:e,...t}){const n=e||document;ov.has(n)||ov.set(n,{});const r=ov.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(UK,{root:e,...t})),r[s]}function VK(e,t,n){const r=zK(t);return Zw.set(e,n),r.observe(e),()=>{Zw.delete(e),r.unobserve(e)}}const HK={some:0,all:1};class WK extends ol{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:HK[s]},a=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=u?f:h;p&&p(c)};return VK(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(qK(t,n))&&this.startObserver()}unmount(){}}function qK({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const GK={inView:{Feature:WK},tap:{Feature:OK},focus:{Feature:jK},hover:{Feature:NK}},KK={layout:{ProjectionNode:XF,MeasureLayout:uB}},YK={...vK,...GK,...LK,...KK},Hr=pK(YK,mK);function XK(){!HE.current&&kF();const[e]=_.useState(qg.current);return e}const QK=350,JK={duration:.15,ease:[.4,0,.2,1]},ZK={type:"tween",duration:.25,ease:[.4,0,.2,1]},eY={type:"tween",duration:.3,ease:[.4,0,.2,1]},dB=_.createContext(!1);function Kle(){return _.useContext(dB)}const fB=_.createContext(void 0);function hB(){return _.useContext(fB)}const Oi={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)"},tY={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 pB({open:e,onClose:t,size:n="md",className:r,children:s,bottomSheet:o=!0,motionPlus:i=!1,basemapMode:a,solid:c=!1}){const u=a==="light",[f,h]=_.useState(!1),p=_.useRef(null);_.useEffect(()=>(p.current&&(clearTimeout(p.current),p.current=null),e?p.current=setTimeout(()=>{h(!0)},QK):queueMicrotask(()=>h(!1)),()=>{p.current&&(clearTimeout(p.current),p.current=null)}),[e]);const g=_.useCallback((x,v)=>{(v.offset.y>100||v.velocity.y>500)&&t()},[t]),y=i?eY:ZK,b=i?.98:.99,w=o?8:4;return S.jsx(Ku,{mode:"wait",children:e&&S.jsxs(h8,{static:!0,open:e,onClose:t,className:"relative z-[10010]",children:[S.jsx(Hr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:JK,className:"fixed inset-0 bg-black/50 backdrop-blur-sm","aria-hidden":"true"}),S.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:S.jsx("div",{className:Ve("flex min-h-full justify-center",o?"items-end sm:items-center sm:p-4":"items-center p-4"),children:S.jsx(Hr.div,{drag:o?"y":!1,dragConstraints:{top:0,bottom:0},dragElastic:{top:0,bottom:.4},onDragEnd:g,initial:{opacity:0,scale:b,y:w},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.99,y:o?40:4},transition:y,style:{willChange:"transform, opacity"},className:Ve(o&&"w-full sm:w-auto"),children:S.jsx(cE,{className:Ve("relative w-full shadow-2xl flex flex-col",!a&&!c&&"bg-surface/80 backdrop-blur-xl",!a&&c&&"bg-surface",!a&&"ring-1 ring-inset ring-edge-subtle",tY[n],o?"radius-card overflow-hidden pb-safe":"radius-card overflow-hidden",r),style:a?{backgroundColor:u?Oi.bg:"var(--surface)",boxShadow:`inset 0 0 0 1px ${u?Oi.ring:"rgba(255, 255, 255, 0.1)"}`}:void 0,children:S.jsx(fB.Provider,{value:a,children:S.jsx(dB.Provider,{value:f,children:s})})})})})})]})})}function nY({className:e,...t}){const n=hB(),r=n==="light";return S.jsx(f8,{...t,className:Ve("text-base font-semibold sm:text-lg",!n&&"text-fg-primary",e),style:n?{color:r?Oi.text:"var(--fg-primary)"}:void 0})}function Qm({icon:e,title:t,onClose:n,className:r}){const s=hB(),o=s==="light";return S.jsxs("div",{className:Ve("flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b",!s&&"border-edge-subtle",r),style:s?{borderColor:o?Oi.border:"var(--edge-subtle)"}:void 0,children:[S.jsxs("div",{className:"flex items-center gap-3",children:[e&&S.jsx("div",{className:Ve(!s&&"text-icon-card-title"),style:s?{color:o?Oi.textSecondary:"var(--icon-card-title)"}:void 0,children:e}),S.jsx(nY,{children:t})]}),n&&S.jsxs(S.Fragment,{children:[S.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"}),S.jsx("button",{onClick:n,className:Ve("hidden sm:flex items-center justify-center p-2 radius-inner transition-colors",!s&&"text-fg-muted hover:text-fg-primary hover:bg-subtle"),style:s?{color:o?Oi.textMuted:"var(--fg-muted)"}:void 0,onMouseEnter:i=>{s&&(i.currentTarget.style.color=o?Oi.text:"var(--fg-primary)",i.currentTarget.style.backgroundColor=o?Oi.hoverBg:"var(--subtle)")},onMouseLeave:i=>{s&&(i.currentTarget.style.color=o?Oi.textMuted:"var(--fg-muted)",i.currentTarget.style.backgroundColor="transparent")},"aria-label":"Close",children:S.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:S.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})]})}function cf({className:e,...t}){return S.jsx("div",{...t,className:Ve("px-6 py-5",e)})}function e1({className:e,...t}){return S.jsx("div",{...t,className:Ve("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 Jm={snappy:{type:"spring",stiffness:500,damping:30},smooth:{type:"spring",stiffness:300,damping:30},gentle:{type:"spring",stiffness:200,damping:25}},rY={fast:.15,normal:.2,medium:.3},sY={easeOut:[0,0,.2,1],easeIn:[.4,0,1,1]},oY={dropdown:{type:"spring",stiffness:500,damping:30},fade:{duration:rY.fast,ease:sY.easeOut},layoutResize:{duration:.25,ease:[.25,1,.5,1]},numberTicker:{type:"spring",visualDuration:.4,bounce:.15,opacity:{duration:.15,ease:"linear"}},numberReveal:{type:"spring",visualDuration:.6,bounce:.25,opacity:{duration:.2,ease:"linear"}}},Yle={normal:.05};function iY({className:e,...t}){return S.jsx("nav",{...t,className:Ve(e,"flex h-full min-h-0 flex-col")})}function aY({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"flex flex-col border-b border-edge-subtle p-4","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function lY({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"flex flex-1 flex-col p-3","overflow-y-auto sidebar-scroll","[&>[data-slot=section]+[data-slot=section]]:mt-6")})}function cY({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"mt-auto flex flex-col","[&>[data-slot=section]+[data-slot=section]]:mt-2.5")})}function uY({className:e,...t}){const n=_.useId();return S.jsx(VG,{id:n,children:S.jsx("div",{...t,"data-slot":"section",className:Ve(e,"flex flex-col gap-0.5")})})}const dY=_.forwardRef(function(t,n){const{current:r,className:s,children:o,accentColor:i,...a}=t,c=!!i,u=Ve("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-fg-primary [&_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"),f=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 S.jsxs("span",{className:Ve(s,"relative"),children:[r&&S.jsx(Hr.span,{layout:"position",layoutId:"sidebar-current-indicator",className:Ve("absolute inset-y-1.5 -left-3 w-0.5 rounded-full",!c&&"bg-sys-blue sidebar-neo-indicator"),style:f,transition:Jm.snappy}),typeof a.href=="string"?S.jsxs(hy,{to:a.href,onClick:a.onClick,onMouseEnter:a.onMouseEnter,onMouseLeave:a.onMouseLeave,className:u,"data-current":r?"true":void 0,ref:n,children:[r&&S.jsx(Hr.span,{layout:"position",layoutId:"sidebar-current-highlight",className:Ve("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:Jm.snappy}),o]}):S.jsxs(Sy,{...a,className:Ve("cursor-default",u),"data-current":r?"true":void 0,ref:n,children:[r&&S.jsx(Hr.span,{layout:"position",layoutId:"sidebar-current-highlight",className:Ve("absolute inset-0 radius-inner z-[-1]",!c&&"sidebar-neo-highlight"),style:h,transition:Jm.snappy}),o]})]})});function fY({className:e,...t}){return S.jsx("span",{...t,className:Ve(e,"truncate")})}function Zm({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 S.jsx("span",{...n,className:Ve("ml-auto flex items-center gap-1 px-1.5 py-0.5 rounded-full","text-xs font-medium",r[t],e)})}const mB="pymc_focus_mode";function hY(){try{return localStorage.getItem(mB)==="1"}catch{return!1}}function P_(e){try{localStorage.setItem(mB,e?"1":"0")}catch{}}const gB=Er()(e=>({focusMode:hY(),toggleFocusMode:()=>e(t=>{const n=!t.focusMode;return P_(n),{focusMode:n}}),setFocusMode:t=>{P_(t),e({focusMode:t})}})),pY=()=>gB(e=>e.focusMode),yB=_.createContext(null);function mY(){const e=_.useContext(yB);if(!e)throw new Error("useSidebar must be used within a SidebarLayout");return e}const bB={type:"spring",visualDuration:.35,bounce:.15},gY=bB.visualDuration*1e3;function yY({open:e,onClose:t,children:n}){return S.jsx(Ku,{children:e&&S.jsxs(h8,{static:!0,open:e,onClose:t,className:"lg:hidden relative z-[10002]",children:[S.jsx(Hr.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"}),S.jsx(Hr.div,{initial:{x:"-100%"},animate:{x:0},exit:{x:"-100%"},transition:bB,className:"fixed inset-y-0 left-0 w-72 max-w-[85vw] z-[10003]",children:S.jsx(cE,{className:"h-full",children:S.jsxs("div",{className:"flex h-full flex-col sidebar-panel",children:[S.jsx("div",{className:"absolute top-4 right-4 z-10",children:S.jsx(E$,{className:"p-2 rounded-lg text-fg-muted hover:text-fg-primary hover:bg-subtle-fill transition-colors","aria-label":"Close navigation",children:S.jsx(T8,{className:"w-5 h-5"})})}),n]})})})]})})}function bY({sidebar:e,navbar:t,children:n,className:r}){const[s,o]=_.useState(!1),i=pY(),a=XK(),c=Ls(),u=_.useRef(null);_.useEffect(()=>{i&&!c.pathname.startsWith("/messages/companion")&&gB.getState().setFocusMode(!1)},[c.pathname,i]),_.useEffect(()=>{var g;(g=u.current)==null||g.scrollTo({top:0,left:0,behavior:"auto"})},[c.pathname]);const f=()=>o(!0),h=()=>o(!1),p={isOpen:s,open:f,close:h,toggle:()=>o(g=>!g)};return S.jsx(yB.Provider,{value:p,children:S.jsxs("div",{className:"flex h-screen overflow-hidden bg-body",children:[S.jsx(Hr.aside,{className:"hidden lg:flex flex-col flex-shrink-0 h-full relative sidebar-panel overflow-hidden",animate:{width:i?0:256},transition:a?{duration:0}:Jm.smooth,children:S.jsx(Hr.div,{className:"flex flex-col h-full min-w-[256px]",animate:{opacity:i?0:1},transition:a?{duration:0}:oY.fade,children:e})}),S.jsx(yY,{open:s,onClose:h,children:e}),S.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[S.jsx("header",{className:"lg:hidden sticky top-0 z-[10001] h-14 mobile-header",children:S.jsxs("div",{className:"flex items-center h-full px-4",children:[S.jsx("button",{onClick:f,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:S.jsx(xV,{className:"w-5 h-5 text-fg-primary"})}),S.jsx("div",{className:"flex-1 min-w-0",children:t})]})}),S.jsx("main",{ref:u,className:Ve("flex-1 overflow-y-auto main-content",r),children:n})]})]})})}function vY({className:e,...t}){return S.jsx("nav",{...t,className:Ve(e,"flex flex-1 items-center gap-3")})}function M_({className:e,...t}){return S.jsx("div",{...t,className:Ve(e,"flex items-center gap-3")})}function wY({className:e,...t}){return S.jsx("div",{"aria-hidden":"true",...t,className:Ve(e,"flex-1")})}const CY=[45,72,33,58,80,42,65,28,55,75,38,62];function zt({className:e,style:t}){return S.jsx("div",{className:Ve("animate-pulse bg-subtle-fill radius-badge",e),style:t})}function EY(){return S.jsx("div",{className:"p-3 radius-inner border-card bg-subtle",children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(zt,{className:"w-14 h-6 rounded shrink-0"}),S.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[S.jsx(zt,{className:"h-4 w-full"}),S.jsx(zt,{className:"h-4 w-3/4"}),S.jsx(zt,{className:"h-3 w-32 mt-1"})]})]})})}function Xle({count:e=8}){return S.jsx("div",{className:"space-y-2",children:Array.from({length:e}).map((t,n)=>S.jsx(EY,{},n))})}function xY(){return S.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-24"})]}),S.jsx(zt,{className:"h-8 w-20"}),S.jsxs("div",{className:"flex-1 flex flex-col justify-end gap-2",children:[S.jsx(zt,{className:"h-3 w-full"}),S.jsx(zt,{className:"h-3 w-3/4"})]})]})}function SY(){return S.jsxs("div",{className:"flex flex-col gap-3 h-full","aria-hidden":"true",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-24"})]}),S.jsx("div",{className:"flex-1 flex items-end gap-1",children:CY.slice(0,8).map((e,t)=>S.jsx(zt,{className:"flex-1",style:{height:`${e}%`}},t))})]})}function kY({rows:e=5}){return S.jsxs("div",{className:"flex flex-col h-full","aria-hidden":"true",children:[S.jsx("div",{className:"pb-3 border-b border-edge-subtle",children:S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-24"})]})}),S.jsx("div",{className:"flex-1 pt-3 flex flex-col gap-3",children:Array.from({length:e}).map((t,n)=>S.jsx(zt,{className:"h-6 w-full"},n))})]})}const vB=_.createContext(void 0);function Qle(){return _.useContext(vB)}const AY={sm:"radius-inner",md:"radius-inset",lg:"radius-card",xl:"radius-hero",full:"radius-pill",none:"radius-none"},Jle=_.forwardRef(function({children:t,elevated:n,compact:r,noPadding:s,radius:o="lg",glass:i=!0,stroke:a=!0,shadow:c,reflex:u=!1,glow:f=!1,neomorphic:h=!0,onClick:p,className:g,style:y,isLoaded:b,skeletonType:w="card",...x},v){const E=_.useContext(vB),[A,k]=_.useState(!1);_.useEffect(()=>{let $=!1;return requestAnimationFrame(()=>{requestAnimationFrame(()=>{$||k(!0)})}),()=>{$=!0}},[]);const R=b??E??A,j=c??n??!1,B=a,P={...y,...u?{"--surface-reflex":"1"}:{}},I=()=>{switch(w){case"chart":return S.jsx(SY,{});case"list":return S.jsx(kY,{});default:return S.jsx(xY,{})}},H=Ve(AY[o],i&&(n?"bg-surface/85 backdrop-blur-xl":"bg-surface/80 backdrop-blur-lg"),!i&&"bg-surface",h&&"depth-raised",B&&!h&&!f&&"ring-1 ring-inset ring-edge-subtle",f&&"ring-1 ring-inset ring-sys-blue/40",j&&(n?"shadow-xl":"shadow-lg"),u&&"surface-reflex","h-full flex flex-col relative",!s&&(r?"p-3 sm:p-4":"p-4 sm:p-5"),p&&"cursor-pointer",g);return R?S.jsx("div",{ref:v,"data-card-surface":!0,className:H,style:P,onClick:p,...x,children:t}):S.jsx("div",{ref:v,"data-card-surface":!0,className:H,style:P,...x,children:I()})});function Zle({title:e,icon:t,badge:n,badgeColor:r="teal",subtitle:s,actions:o,iconColor:i="text-icon-card-title",listHeader:a=!1,stackActionsOnMobile:c=!1,stackBreakpoint:u="sm",titleExtra:f,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=S.jsxs(S.Fragment,{children:[t&&S.jsx("span",{className:Ve("icon-md flex items-center justify-center",i),children:t}),S.jsx("span",{className:"type-micro",children:e}),n&&S.jsx(Pz,{color:r,children:n}),f]}),w=h?"button":"div",x=h?{onClick:h,type:"button"}:{};return c&&o?S.jsxs(w,{...x,className:Ve("flex flex-col gap-1 flex-shrink-0",a?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[S.jsxs("div",{className:y[u],children:[S.jsx("div",{className:"flex items-center gap-3",children:b}),S.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:o})]}),s&&S.jsx("p",{className:"type-label text-fg-muted ml-8",children:s})]}):S.jsxs(w,{...x,className:Ve("flex flex-col gap-1 flex-shrink-0",a?g:"mb-3",h&&"w-full text-left cursor-pointer",p),children:[S.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-[32px]",children:[S.jsx("div",{className:"flex items-center gap-3",children:b}),o&&S.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:o})]}),s&&S.jsx("p",{className:"type-label text-fg-muted ml-8",children:s})]})}_.forwardRef(function({children:t,icon:n,className:r,...s},o){return S.jsxs("h3",{ref:o,className:Ve("flex items-center gap-2","text-base font-semibold text-fg-primary",r),...s,children:[n&&S.jsx("span",{className:"text-icon-card-title w-5 h-5 flex-shrink-0",children:n}),t]})});_.forwardRef(function({children:t,className:n,...r},s){return S.jsx("p",{ref:s,className:Ve("text-sm text-fg-muted",n),...r,children:t})});const ece=_.forwardRef(function({children:t,centered:n,className:r,...s},o){return S.jsx("div",{ref:o,className:Ve("flex-1 min-h-0",n&&"flex items-center justify-center",r),...s,children:t})});_.forwardRef(function({children:t,className:n,...r},s){return S.jsx("div",{ref:s,className:Ve("flex items-center justify-end gap-3","pt-4 mt-4","border-t border-edge-subtle",n),...r,children:t})});_.forwardRef(function({children:t,border:n,className:r,...s},o){return S.jsx("div",{ref:o,className:Ve(n&&"pt-4 mt-4 border-t border-edge-subtle",r),...s,children:t})});function _Y({defaultOpen:e=!1,className:t,children:n}){return S.jsx(m8,{defaultOpen:e,children:S.jsx("div",{className:Ve("flex flex-col",t),children:n})})}const DY=_.forwardRef(function({className:t,icon:n,children:r,...s},o){return S.jsx(zg,{ref:o,className:Ve("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),...s,children:({open:i})=>S.jsxs(S.Fragment,{children:[r,S.jsx("span",{className:Ve("transition-transform duration-200",i?"rotate-180":"rotate-0"),children:n||S.jsx(Rw,{className:"w-4 h-4"})})]})})});function TY({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 S.jsx(pE,{static:!0,children:({open:s})=>S.jsx(Ku,{initial:!1,children:s&&S.jsx(Hr.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:Ve("overflow-hidden",t),children:S.jsx("div",{className:Ve(e==="up"?"pb-2":"pt-2"),children:n})})})})}function FY({label:e,icon:t,defaultOpen:n=!0,direction:r="down",className:s,triggerStyle:o,dataId:i,children:a}){const c=i?{[`data-${i}-disclosure`]:!0}:{},u=S.jsxs("span",{className:"flex items-center gap-3",children:[t&&S.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),S.jsx("span",{className:"type-micro",children:e})]});return r==="up"?S.jsx(m8,{defaultOpen:n,children:({open:f})=>S.jsxs("div",{className:Ve("relative",s),children:[S.jsx(pE,{static:!0,className:"relative z-50",children:S.jsx(Ku,{initial:!1,mode:"wait",children:f&&S.jsxs(Hr.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",children:[S.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[S.jsxs("span",{className:"flex items-center gap-3",children:[t&&S.jsx("span",{className:"icon-md flex items-center justify-center text-icon-card-title",children:t}),S.jsx("span",{className:"type-micro",children:e})]}),S.jsx(zg,{className:"p-1 rounded hover:bg-subtle-fill-strong transition-colors",children:S.jsx(Hr.span,{initial:{rotate:0},animate:{rotate:180},exit:{rotate:0},transition:{type:"spring",stiffness:400,damping:25},children:S.jsx(Rw,{className:"w-4 h-4"})})})]}),S.jsx("div",{className:"px-3 pb-3",children:a})]})})}),S.jsx(Hr.div,{animate:{opacity:f?.4:1,scale:f?.98:1},transition:{type:"spring",stiffness:500,damping:35},children:S.jsxs(zg,{...c,style:o,className:Ve("flex w-full items-center justify-between gap-3","px-3 py-2 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:[u,S.jsx(Hr.span,{animate:{rotate:f?180:0},transition:{type:"spring",stiffness:400,damping:25},children:S.jsx(Rw,{className:"w-4 h-4"})})]})})]})}):S.jsxs(_Y,{defaultOpen:n,className:s,children:[S.jsx(DY,{...c,children:u}),S.jsx(TY,{direction:"down",children:S.jsx("div",{className:"bg-subtle-fill radius-inset mx-1 mt-1",children:a})})]})}const lm=8;function BY(e,t,n){const r=window.scrollY,s=window.scrollX;switch(n){case"top":return{top:e.top+r-t.height-lm,left:e.left+s+(e.width-t.width)/2};case"bottom":return{top:e.bottom+r+lm,left:e.left+s+(e.width-t.width)/2};case"left":return{top:e.top+r+(e.height-t.height)/2,left:e.left+s-t.width-lm};case"right":return{top:e.top+r+(e.height-t.height)/2,left:e.right+s+lm}}}const RY=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 PY({placement:e}){const t=Ve("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 S.jsx("span",{className:t,style:{backgroundColor:"var(--tooltip-bg)"}})}function MY({content:e,children:t,placement:n="top",delay:r=200,arrow:s=!0,disabled:o=!1,className:i}){const[a,c]=_.useState(!1),[u,f]=_.useState({top:0,left:0}),[h,p]=_.useState(!1),g=_.useRef(null),y=_.useRef(null),b=_.useRef();_.useEffect(()=>{p(!0)},[]),_.useEffect(()=>{if(!a||!g.current||!y.current)return;const k=g.current.getBoundingClientRect(),R=y.current.getBoundingClientRect(),j=BY(k,R,n),B=window.innerWidth-R.width-8,P=window.innerHeight+window.scrollY-R.height-8;f({top:Math.max(8,Math.min(j.top,P)),left:Math.max(8,Math.min(j.left,B))})},[a,n]);const w=_.useCallback(()=>{o||(b.current=setTimeout(()=>{c(!0)},r))},[r,o]),x=_.useCallback(()=>{b.current&&clearTimeout(b.current),c(!1)},[]);if(_.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),!_.isValidElement(t))return t;const v=_.cloneElement(t,{ref:g,onMouseEnter:k=>{var R,j;w(),(j=(R=t.props).onMouseEnter)==null||j.call(R,k)},onMouseLeave:k=>{var R,j;x(),(j=(R=t.props).onMouseLeave)==null||j.call(R,k)},onFocus:k=>{var R,j;w(),(j=(R=t.props).onFocus)==null||j.call(R,k)},onBlur:k=>{var R,j;x(),(j=(R=t.props).onBlur)==null||j.call(R,k)}}),E=RY(n),A=S.jsx(Ku,{children:a&&S.jsxs(Hr.div,{ref:y,initial:"hidden",animate:"visible",exit:"hidden",variants:E,transition:{duration:.15,ease:"easeOut"},className:Ve("fixed z-[10020] px-2.5 py-1.5 text-xs font-medium","rounded-lg","pointer-events-none",i),style:{top:u.top,left:u.left,backgroundColor:"var(--tooltip-bg)",color:"var(--tooltip-fg)",border:"1px solid var(--tooltip-border)",boxShadow:"var(--tooltip-shadow)"},role:"tooltip",children:[e,s&&S.jsx(PY,{placement:n})]})});return S.jsxs(S.Fragment,{children:[v,h&&ju.createPortal(A,document.body)]})}const wB={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"}},tce=_.forwardRef(function({enabled:t,onChange:n,label:r,description:s,tooltip:o,size:i="md",color:a="muted",dangerOff:c=!1,disabled:u=!1,status:f="idle",name:h,className:p},g){const y=wB[i],b=f==="loading",w=a==="muted";return S.jsxs(Py,{disabled:u||b,className:Ve("flex items-center gap-3",p),children:[S.jsx(g8,{ref:g,checked:t,onChange:n,name:h,className:Ve(w?"toggle-switch-track":"group relative inline-flex shrink-0 items-center rounded-full border-2",y.track,!w&&(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:S.jsx("span",{className:Ve(w?"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:w&&S.jsx("span",{className:Ve("toggle-switch-dot",y.dot,c?Ve("opacity-100",!t&&"toggle-switch-dot-danger"):t?"opacity-100":"opacity-0")})})}),(r||s||o)&&S.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[r&&S.jsx(yh,{className:Ve("text-sm font-medium cursor-pointer select-none",u?"text-fg-muted":"text-fg-primary"),children:r}),o&&S.jsx(MY,{content:o,placement:"top",children:S.jsx("span",{className:"text-fg-muted hover:text-fg-secondary cursor-help transition-colors",children:S.jsx(pV,{className:"w-3.5 h-3.5"})})}),s&&!o&&S.jsx(Hu,{className:"text-xs text-fg-muted",children:s})]}),f!=="idle"&&S.jsxs("div",{className:"flex items-center shrink-0",children:[f==="loading"&&S.jsx(D8,{className:Ve(y.icon,"text-fg-muted animate-spin")}),f==="success"&&S.jsx(My,{className:Ve(y.icon,"text-sys-green")}),f==="error"&&S.jsx(T8,{className:Ve(y.icon,"text-sys-red")})]})]})}),nce=_.forwardRef(function({enabled:t,onChange:n,size:r="md",disabled:s=!1,"aria-label":o,className:i},a){const c=wB[r];return S.jsx(g8,{ref:a,checked:t,onChange:n,disabled:s,"aria-label":o,className:Ve("toggle-switch-track",c.track,"disabled:opacity-50 disabled:cursor-not-allowed","ring-focus","transition-all duration-200",i),"data-size":r,children:S.jsx("span",{className:Ve("toggle-switch-thumb","transform rounded-full transition-transform duration-200",c.thumb,t?c.translate:"translate-x-[4px]"),children:S.jsx("span",{className:Ve("toggle-switch-dot",c.dot,t?"opacity-100":"opacity-0")})})})}),IY={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"}},CB=_.forwardRef(function({type:t="text",size:n="md",invalid:r=!1,leadingIcon:s,trailingIcon:o,leadingAddon:i,trailingAddon:a,className:c,disabled:u,...f},h){const p=IY[n],g=s||i,y=o||a;return i||a?S.jsxs("div",{className:Ve("flex",c),children:[i&&S.jsx("span",{className:Ve("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}),S.jsx("input",{ref:h,type:t,disabled:u,className:Ve("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",!u&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",i&&!a&&"rounded-r-lg",a&&!i&&"rounded-l-lg",!i&&!a&&"radius-inner"),...f}),a&&S.jsx("span",{className:Ve("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:a})]}):S.jsxs("div",{className:Ve("relative",c),children:[s&&S.jsx("div",{className:Ve("absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none","text-fg-muted"),children:S.jsx("span",{className:p.icon,children:s})}),S.jsx("input",{ref:h,type:t,disabled:u,className:Ve("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",!u&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors"),...f}),o&&S.jsx("div",{className:Ve("absolute inset-y-0 right-0 flex items-center pr-3","text-fg-muted"),children:S.jsx("span",{className:p.icon,children:o})})]})}),rce=_.forwardRef(function({label:t,description:n,errorMessage:r,required:s,invalid:o,className:i,...a},c){const u=o&&r;return S.jsxs(Py,{className:Ve("flex flex-col gap-1.5",i),children:[t&&S.jsxs(yh,{className:"text-sm font-medium text-fg-primary",children:[t,s&&S.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!u&&S.jsx(Hu,{className:"text-xs text-fg-muted -mt-0.5",children:n}),S.jsx(CB,{ref:c,invalid:o,...a}),u&&S.jsx("p",{className:"text-xs text-sys-red",children:r})]})});_.forwardRef(function({value:t,onChange:n,min:r,max:s,step:o=1,precision:i,...a},c){const u=h=>{const p=h.target.value;if(p===""||p==="-"){n(0);return}const g=parseFloat(p);if(!isNaN(g)){const y=r!==void 0&&s!==void 0?Math.min(Math.max(g,r),s):r!==void 0?Math.max(g,r):s!==void 0?Math.min(g,s):g;n(y)}},f=i!==void 0&&typeof t=="number"?t.toFixed(i):t;return S.jsx(CB,{ref:c,type:"number",value:f,onChange:u,min:r,max:s,step:o,...a})});const LY={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},NY=_.forwardRef(function({rows:t=3,resize:n="vertical",invalid:r=!1,disabled:s,className:o,...i},a){return S.jsx("textarea",{ref:a,rows:t,disabled:s,className:Ve("w-full radius-inner px-4 py-3 text-sm",LY[n],"bg-subtle",r?"border border-sys-red":"border-control","text-fg-primary placeholder:text-fg-muted",r?"ring-focus-error":"ring-focus-inset",!s&&"hover:border-edge-strong","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors",o),...i})});_.forwardRef(function({label:t,description:n,errorMessage:r,required:s,invalid:o,showCount:i,maxLength:a,value:c,className:u,...f},h){const p=o&&r,g=typeof c=="string"?c.length:0;return S.jsxs(Py,{className:Ve("flex flex-col gap-1.5",u),children:[t&&S.jsxs(yh,{className:"text-sm font-medium text-fg-primary",children:[t,s&&S.jsx("span",{className:"text-sys-red ml-0.5",children:"*"})]}),n&&!p&&S.jsx(Hu,{className:"text-xs text-fg-muted -mt-0.5",children:n}),S.jsx(NY,{ref:h,invalid:o,maxLength:a,value:c,...f}),S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[p?S.jsx("p",{className:"text-xs text-sys-red flex-1",children:r}):S.jsx("span",{}),i&&a&&S.jsxs("span",{className:Ve("text-xs",g>a?"text-sys-red":"text-fg-muted"),children:[g,"/",a]})]})]})});const jY={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"}},sce=_.forwardRef(function({checked:t,onChange:n,indeterminate:r=!1,label:s,description:o,size:i="md",disabled:a=!1,name:c,value:u,className:f},h){const p=jY[i];return S.jsxs(Py,{disabled:a,className:Ve("flex items-start gap-3",f),children:[S.jsxs(v$,{ref:h,checked:t,onChange:n,name:c,value:u,className:Ve("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&&!a&&"hover:border-edge-strong","ring-focus","disabled:opacity-50 disabled:cursor-not-allowed"),children:[t&&!r&&S.jsx(My,{className:Ve(p.icon,"text-white stroke-[3]")}),r&&S.jsx(_V,{className:Ve(p.icon,"text-white stroke-[3]")})]}),(s||o)&&S.jsxs("div",{className:"flex-1 min-w-0 select-none",children:[s&&S.jsx(yh,{className:Ve("text-sm font-medium cursor-pointer",a?"text-fg-muted":"text-fg-primary"),children:s}),o&&S.jsx(Hu,{className:"text-xs text-fg-muted mt-0.5",children:o})]})]})});_.createContext({variant:"default",divider:"subtle",grid:!0});const t1="0.9.342",I_="'JetBrains Mono', monospace";function OY({height:e=16,responsive:t=!1,className:n=""}){const r="var(--sys-blue)",s="var(--fg-primary)";if(t)return S.jsxs("svg",{className:n,viewBox:"0 0 210 24",preserveAspectRatio:"xMidYMid meet",role:"img","aria-label":"openHop:Console",style:{display:"block",width:"80%",height:"auto"},children:[S.jsx("style",{children:` .logo-text { font-family: ${I_}; } @@ -333,4 +333,4 @@ safe-buffer/index.js: ${t.visible?"opacity-100":"opacity-0"} `,style:{left:s.x,top:s.y,visibility:t.visible?"visible":"hidden"},children:t.content}),document.body)]})}function _de({content:e,children:t,delay:n=150}){const{show:r,hide:s,updatePosition:o}=Oie(),i=_.useRef(null),a=_.useRef(null),c=_.useRef(!1),u=()=>{a.current&&(clearTimeout(a.current),a.current=null)},f=_.useCallback(b=>{u(),a.current=setTimeout(()=>{c.current=!0,r(e,b.clientX,b.clientY)},n)},[r,e,n]),h=_.useCallback(b=>{c.current&&o(b.clientX,b.clientY)},[o]),p=_.useCallback(()=>{u(),c.current=!1,s()},[s]),g=_.useCallback(()=>{if(u(),!i.current)return;const b=i.current.getBoundingClientRect();a.current=setTimeout(()=>{c.current=!0,r(e,b.left+b.width/2,b.top)},n)},[r,e,n]),y=_.useCallback(()=>{u(),c.current=!1,s()},[s]);return _.useEffect(()=>()=>{u(),c.current&&(c.current=!1,s())},[s]),_.useEffect(()=>{const b=()=>{c.current&&(u(),c.current=!1,s())};return document.addEventListener("click",b,!0),()=>document.removeEventListener("click",b,!0)},[s]),S.jsx("span",{ref:i,onMouseEnter:f,onMouseMove:h,onMouseLeave:p,onFocus:g,onBlur:y,className:"contents",children:t})}const E6=15e3,Uie=40,zie=60,Vie=.6,Hie=.4;function Wie(e){return e.payload_type??e.type}const ac=Er()((e,t)=>({liveStats:null,history:[],available:!0,initialized:!1,clientRate:0,serverEwma:0,_prevAllowed:null,_prevDropped:null,_prevPenaltyKeys:null,_advertRing:[],_wsUnsub:null,_intervalId:null,_refCount:0,startPolling:()=>{const n=t(),r=n._refCount+1;if(e({_refCount:r}),n._intervalId)return;const s=rs.onPacket(i=>{if(Wie(i)!==ps.ADVERT)return;const a=Date.now()/1e3,{_advertRing:c}=t(),u=c.filter(f=>a-f{t()._poll()},E6);e({_intervalId:o})},stopPolling:()=>{const n=t(),r=Math.max(0,n._refCount-1);e({_refCount:r}),r===0&&(n._intervalId&&(clearInterval(n._intervalId),e({_intervalId:null})),n._wsUnsub&&(n._wsUnsub(),e({_wsUnsub:null})))},_poll:async()=>{var n,r,s;try{const o=await dZ(),i=t();if(!o.success||!((r=(n=o.data)==null?void 0:n.adaptive)!=null&&r.current_tier)){i.available&&e({available:!1});return}const a=o.data,c=Date.now()/1e3,u=Object.keys(a.active_penalties??{});let f=null;const h=Object.entries(a.active_penalties??{}).map(([x,v])=>({pubkey:x,remaining:Math.round(v)})).sort((x,v)=>v.remaining-x.remaining),p=(a.recent_drops??[]).filter(x=>x.seconds_ago<=E6/1e3+5).map(x=>({pubkey:x.pubkey,name:x.name,reason:x.reason})),g=a.tracked_pubkeys??Object.keys(a.bucket_states??{}).length,y=new Set(i._prevPenaltyKeys??[]),b=u.filter(x=>!y.has(x)).map(x=>({pubkey:x,remaining:Math.round((a.active_penalties??{})[x])}));if(i._prevAllowed!==null&&i._prevDropped!==null){const x=Math.max(0,a.stats.adverts_allowed-i._prevAllowed),v=Math.max(0,a.stats.adverts_dropped-i._prevDropped);f={ts:c,allowedDelta:x,droppedDelta:v,newlyGuarded:b,penalties:h,drops:p,trackedCount:g}}const w=f?[...i.history,f].slice(-Uie):i.history;e({liveStats:a,history:w,available:!0,initialized:!0,serverEwma:((s=a.metrics)==null?void 0:s.adverts_per_min_ewma)??0,_prevAllowed:a.stats.adverts_allowed,_prevDropped:a.stats.adverts_dropped,_prevPenaltyKeys:u})}catch{t().available&&e({available:!1})}}})),Dde=()=>ac(e=>e.liveStats),Tde=()=>ac(e=>e.history),Fde=()=>ac(e=>e.available),Bde=()=>ac(e=>e.initialized),Rde=()=>ac(e=>{const t=e.serverEwma,n=e.clientRate;return t>0&&n>0?t*Vie+n*Hie:t||n}),qie="";async function ra(e,t){const n=`${qie}${e}`;sx()&&await oc();const r=Wr(),s=r?{Authorization:`Bearer ${r}`}:{},o=await fetch(n,{...t,headers:{...s,...t==null?void 0:t.headers}});if(!o.ok)throw new Error(`Analytics API error: ${o.status} ${o.statusText}`);return o.json()}async function x6(e=!1){return ra(`/api/analytics/topology${e?"?rebuild=true":""}`)}async function Gie(){return ra("/api/analytics/disambiguation")}async function Kie(e=168){return ra(`/api/analytics/last_hop_neighbors?hours=${e}`)}async function Yie(e=168){return ra(`/api/analytics/neighbor_affinity?hours=${e}`)}async function Xie(e=168){return ra(`/api/analytics/mobile_nodes?hours=${e}`)}async function Qie(e=20){return ra(`/api/analytics/path_health?limit=${e}`)}async function Jie(e=24){return ra(`/api/analytics/tx_recommendations?hours=${e}`)}async function Zie(e=168){return ra(`/api/analytics/sparklines?hours=${e}`)}async function eae(e){return ra(`/api/analytics/bucketed_stats?preset=${e}`)}const Gv={topology:6e4,neighbors:3e4,bucketedStats:3e4};let b2=[];Er((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 x6(),s=r.success!==!1&&!r.error;return e({backendAvailable:s,checkingBackend:!1}),s}catch{return e({backendAvailable:!1,checkingBackend:!1}),!1}},fetchTopology:async(n=!1)=>{e({topologyLoading:!0,topologyError:null});try{const r=await x6(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 Gie();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 Kie(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 Yie(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 Xie(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 Qie(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 Jie(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 Zie(n);if(r.success!==!1){const s=r,o=new Map;if(s.sparklines)for(const[i,a]of Object.entries(s.sparklines))o.set(i,a);e({sparklines:o,sparklinesLoading:!1})}else e({sparklinesLoading:!1})}catch{e({sparklinesLoading:!1})}},fetchBucketedStats:async n=>{e({bucketedStatsLoading:!0,bucketedStatsPreset:n});try{const r=await eae(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()},Gv.topology),s=setInterval(()=>{t().backendAvailable&&t().fetchLastHopNeighbors()},Gv.neighbors),o=setInterval(()=>{t().backendAvailable&&t().fetchBucketedStats(t().bucketedStatsPreset)},Gv.bucketedStats);b2=[r,s,o]}},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 tae(){for(const e of b2)clearInterval(e);b2=[]}const ZM="pymc-basemap-mode",S6="dark";function nae(){if(typeof window>"u")return S6;try{const e=localStorage.getItem(ZM);if(e==="light"||e==="dark")return e}catch{}return S6}function k6(e){if(!(typeof window>"u"))try{localStorage.setItem(ZM,e)}catch{}}const $x=Er(e=>({mode:nae(),toggle:()=>e(t=>{const n=t.mode==="light"?"dark":"light";return k6(n),{mode:n}}),setMode:t=>{k6(t),e({mode:t})}})),Pde=()=>$x(e=>e.mode),Mde=()=>$x(e=>e.toggle);function rae(){const e=bi(n=>n.blockedTierRequest),t=bi(n=>n.dismissBlockedTier);return e?S.jsxs(pB,{open:!0,onClose:t,size:"sm",children:[S.jsx(Qm,{icon:S.jsx(WV,{className:"w-5 h-5 text-sys-amber"}),title:"Time Range Limited",onClose:t}),S.jsx(cf,{children:S.jsxs("div",{className:"flex items-start gap-3",children:[S.jsx(fV,{className:"w-5 h-5 text-sys-indigo flex-shrink-0 mt-0.5"}),S.jsxs("div",{className:"text-sm text-fg-secondary space-y-2",children:[S.jsxs("p",{children:["An external database source is active. Remote sources are limited to ",S.jsx("strong",{className:"text-fg-primary",children:Nne})," of historical data."]}),S.jsxs("p",{children:["You selected ",S.jsx("strong",{className:"text-fg-primary",children:e}),", which exceeds this limit. Disconnect the remote source first to access longer local time ranges."]})]})]})}),S.jsx(e1,{children:S.jsx(Ql,{color:"muted",onClick:t,className:"flex-1",children:"Got it"})})]}):null}const sae=_.memo(rae),oae={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 A6({children:e,copyValue:t,copy:n=!1,size:r="standard",className:s,title:o,color:i,truncate:a}){const[c,u]=_.useState(!1),f=_.useRef(null),h=t??(typeof e=="string"?e:""),p=oae[r],g=(()=>{if(!a||a==="css"||typeof e!="string")return e;const x=e,[v,E]=a===!0?[6,4]:a;return x.length<=v+E+3?x:`${x.slice(0,v)}…${x.slice(-E)}`})(),y=_.useCallback(async x=>{if(!n)return;x.preventDefault(),x.stopPropagation(),f.current&&clearTimeout(f.current);const v=await wR(h);u(!0),f.current=setTimeout(()=>u(!1),2e3),v||console.warn("Copy may have failed for:",h.slice(0,16)+"...")},[n,h]),b=r==="compact"?"data-box-compact":r==="responsive"?"data-box-responsive":"",w=n?o||`Click to copy: ${h}`:o;return n?S.jsxs("button",{type:"button",onClick:y,className:Ve("data-box interactive group",b,"cursor-pointer select-none gap-1","hover-bg",i,a==="css"&&"max-w-full flex justify-between",s),title:w,"aria-label":`Copy ${h}`,children:[S.jsx("span",{className:Ve("transition-colors duration-200",c?"text-sys-green":"",a==="css"&&"truncate"),children:g}),S.jsx("span",{className:Ve("flex items-center justify-center flex-shrink-0",r==="compact"?"w-3 h-3":"w-3.5 h-3.5"),children:c?S.jsx(My,{className:Ve("text-sys-green",p)}):S.jsx(_8,{className:Ve("opacity-40 group-hover:opacity-70 transition-opacity duration-200",p)})})]}):S.jsx("span",{className:Ve("data-box",b,i,a==="css"&&"truncate block max-w-full",s),title:w,children:g})}const Ih="\x1B[",iae=`${Ih}0m`,gr=`${Ih}1m`,_6=`${Ih}2m`;function zo(e,t,n){return`${Ih}38;2;${e};${t};${n}m`}const D6=" . ˙',·∙⁺˚°:;~*+✧✩×✴░✦✶✳oO▒#%&xX▓@MW8B█████",T6="✦✶✳✧✴✩×";function aae(e,t=.08){const n=e+(Math.random()-.5)*t*2,r=Math.max(0,Math.min(.999,n));return D6[Math.floor(r*D6.length)]}function F6(){return T6[Math.floor(Math.random()*T6.length)]}const Mo=[[6,4,28],[14,10,60],[30,24,105],[50,45,160],[72,70,200],[91,91,214],[150,150,245]];function Kv(e){const n=Math.max(0,Math.min(1,e))*(Mo.length-1),r=Math.floor(n),s=Math.min(r+1,Mo.length-1),o=n-r;return zo(Math.round(Mo[r][0]+(Mo[s][0]-Mo[r][0])*o),Math.round(Mo[r][1]+(Mo[s][1]-Mo[r][1])*o),Math.round(Mo[r][2]+(Mo[s][2]-Mo[r][2])*o))}const Xd=zo(0,240,255),Yv=zo(255,50,180),Xv=zo(255,252,255),lae=zo(80,255,180),B6=zo(255,180,120),Qd=`${Ih}38;2;91;91;214m`;function cae(e){return 1-Math.pow(1-e,3)}function uae(e){return e*.3+e*e*e*.7}const Ide=80,ji=14,Pg=12,dae=1,fae=ji+Pg+dae;function hae(e){var a;const t=e.length,n=Math.max(...e.map(c=>c.length)),r=t/2,s=n/2,o=new Float32Array(t*n);let i=0;for(let c=0;ci&&(i=p)}return{dist:o,maxDist:i,cols:n,rows:t}}let v2=null,w2=null;function pae(){v2=null,w2=null}function R6(e,t){w2!==e&&(v2=hae(e),w2=e);const{dist:n,maxDist:r,cols:s,rows:o}=v2,i=t=ji&&t=ji+Pg,u=Math.min(1,t/ji),f=a?Math.min(1,(t-ji)/Math.max(1,Pg-1)):c?1:0,h=a||c?r*(1-uae(f)):cae(u)*r,p=h*.72,g=h*.45,y=i?-.6:.9,b=[],w=o/2,x=s/2,v=5,E=ji,A=19,k=t>=v&&t<=A,R=k?t<=E?(t-v)/(E-v):1-(t-E)/(A-E):0,j=Math.sin(t*3.4)*.28+Math.sin(t*5.9)*.24+Math.sin(t*9.7)*.18+Math.sin(t*14.3)*.12,B=Math.max(.12,.55+j*.55),P=Math.sin(t*.85),I=.5+.5*P,H=.5-.5*P,$=(.3+2.7*I)*Math.max(0,R)*B,W=(.5+3.5*H)*Math.max(0,R)*B;for(let X=0;X.2||W>.3)){const M=Math.abs(X-w),U=Math.abs(Q-x);if(M<$&&U.8?"█":Y||se>.6?"✦":se>.3?"✶":"✴",K=ae==="█"?Xv+gr:Y||ae==="✦"?(se>.5?Xv:Xd)+gr:(se>.65?Xd:Qd)+gr;K!==J&&(ie+=K,J=K),ie+=ae;continue}}if(V){ie+=" ",J="";continue}if(c){const M=Qd+gr;M!==J&&(ie+=M,J=M),ie+=z}else if(a&&L>h){const M=L-h;if(M.85){const K=(se-.85)/.15;ae=zo(Math.round(190+65*K),Math.round(210+42*K),255)+gr}else if(se>.6)if(Y<.1)ae=Xd+gr;else if(Y<.16)ae=Yv+gr;else{const K=(se-.6)/.25;ae=zo(Math.round(120+70*K),Math.round(150+60*K),255)+gr}else ae=Kv(.7+se*.3)+gr;ae!==J&&(ie+=ae,J=ae)}else if(Math.random()<.008){const se=B6;se!==J&&(ie+=se,J=se)}else Qd!==J&&(ie+=Qd,J=Qd);ie+=z}else if(L>h)ie+=" ",J="";else{const M=h-L,U=Math.exp(-M/(r*.22)),se=Math.max(0,1-M/(r*.55)),Y=U*.7+se*.3,ae=Math.max(0,1-Math.abs(L-p)/(r*.18)),K=Math.max(0,1-Math.abs(L-g)/(r*.22)),Z=Math.sin(Q*.3)*.8,oe=Math.sin(X*.4+Q*.15)*.5,re=Math.sin(L*3+t*y+Z)*.5+.5,fe=Math.sin(L*6.5+t*y*1.8+Z*.5+oe)*.5+.5,me=Math.sin(L*1.3-t*y*.35+Z*1.5+X*.08)*.5+.5,Le=re*re*.5+fe*.28+me*.22,Pe=t<2&&L.2)be<.35?Ie=Xv+gr:be<.55?Ie=Yv+gr:be<.7?Ie=Xd+gr:Ie=Kv(.95)+gr;else if(De>.8)if(be<.08)Ie=Yv+gr;else if(be<.14)Ie=Xd+gr;else{const Re=(De-.8)/.2;Ie=zo(Math.round(190+65*Re),Math.round(210+42*Re),255)+gr}else if(De>.55)if(be<.05)Ie=lae+gr;else{const Re=(De-.55)/.25;Ie=zo(Math.round(110+80*Re),Math.round(140+70*Re),Math.round(245+10*Re))+gr}else if(De>.32){const Re=(De-.32)/.23;Ie=zo(Math.round(91+19*Re),Math.round(91+49*Re),Math.round(214+31*Re))+(Re>.5?gr:"")}else xe<.12&&Le>.65&&be<.08?Ie=B6+_6:Ie=Kv(Me)+(xe>.4?gr:xe<.12?_6:"");if(Ie!==J&&(ie+=Ie,J=Ie),xe>.82&&Y>.7)ie+=F6();else if(xe>.7&&ae>.5&&Math.random()<.2)ie+=F6();else{const Re=.02+(1-xe)*.05;ie+=aae(xe,Re)}}}}b.push(ie+iae)}return b}const Yl=[[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," .:: .. "," *!!: .*** "," .::: .:.. "," "," "," "],[" "," "," "," "," "," "," ... . "," *:*. ::*. "," .. : . .. "," :. : . : "," : .. .. : "," ::**!!!!!*. "," :*!!!!@!!!: "," :***!!!!*!* "," .:::::::::: "," "," "," "],[" "," "," "," "," "," "," ... . "," *:*. ::*. "," .. : . .. "," :. : . : "," : .. .. : "," ::**!!!!!*. "," :*!!!!@!!!: "," :***!!!!*!* "," .:::::::::: "," "," "," "],[" "," "," "," "," "," "," .:. :: "," .*.*. ..*. "," :. : . : "," :..: .. : "," :... .. : "," ::**!!!!**. "," :*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::. "," "," "," "],[" "," "," "," "," "," "," ::. :*. "," .*.*. :.*: "," .. * : .: "," :..* .. : "," . .. .: : "," :***!!!!**. "," :*!!!!@!!!: "," :***!!!!*!* "," .:::*.::::. "," "," "," "],[" "," "," "," "," "," "," .:. ::. "," .*.*. :.*: "," :. * . .: "," :..* .. : "," . :. .: : "," ::**!!!!!*. "," :*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," .:. ::. "," .*.*. :.*: "," :. * . .: "," :..* .. : "," . :. .: : "," ::**!!!!!*. "," :*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," .:. :*: "," .:::. . .: "," . .: .. .. "," : .. .: .. "," ::**!!!!**. "," :*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:*:. .:!*. "," .*!* .. .: .:. "," .:**!!!!!*. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::::::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," ..::. .:*:. "," *!!:.. .. .*!: "," .:...**!!!!*. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," ..::. .:*:. "," *!!:.. .. .*!: "," .:...**!!!!*. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::. "," *!!:.. .: :!!* "," :*:..**!!!!*...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::. "," *!!:.. .: :!!* "," :*:..**!!!!:...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::: "," *!!:.. .: :!!* "," :*:..**!!!!:...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::: "," *!!:.. .: :!!* "," :*:..**!!!!:...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::. "," *!!:.. .. :!!* "," :*:..**!!!!*...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::::::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::. "," *!!:.. .. :!!* "," :*:..**!!!!:...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::. "," *!!:.. .: :!!* "," :*:..**!!!!:...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::. "," *!!:.. .: :!!* "," :*:..**!!!!:...:. "," .*!!!!@!!!: "," :***!!!!*!* "," .:::*:::::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .::. "," *!!:.. .: :!!* "," :*:..**!!!!:. .:. "," .*!!!!@@!!: "," :***!!!!*!* "," .:::*:::::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:**. .::. "," :!!* .: .. *!!. "," . .:**!!!!:..:: "," .*!!!!@!!!: "," :**!!!!*!!* "," .:.::.*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .*****. .:. "," ... .: .:!!* "," .:**!!!*..:*. "," .*!!!!@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .*****. .:. "," ... .: .:!!* "," .:**!!!*..:*. "," .*!!!!@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," .. "," :*!***. .:.. "," .: .:!!* "," .:**!!!:..:*. "," .*!!!!@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," .. "," :*!***. .:. "," .: .:!!* "," .:**!!!:..:*. "," .*!!!@@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," .. "," :*!***. .:. "," .: .:!!* "," .:**!!!:..:*. "," .*!!!@@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," .. "," :*!***. .:. "," .: .:!!* "," .:**!!!*..:*. "," .*!!!@@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," .. "," :*!*::. .:. "," .: .:!!* "," .:**!!!*..:*. "," .*!!!@@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," .. "," :*!***. .:. "," . .: .:!!* "," .:**!!!:..:*. "," .*!!!!@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," .. "," :*!***. .:. "," . .: .:!!* "," .:**!!!:..:*. "," .*!!!!@!!*: "," :**@!!!*@!* "," ..::::::::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:***. ::: "," ***. .: . :!!: "," ..***!!!:.. . "," .**!!!@!!!: "," :***!!!!*@*. "," .:::::*:::: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:: ....*!: "," *!!:. :: "," **:..**!!!!!*. "," .*!!@!@!!!: "," :*!**!!@*** "," .::::::*:.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:**. "," .. .:. . "," :!!*. :. . "," :!!: :*!!!!** "," .:!!@@!!!!: "," :*!!*!!@!** "," .::::*:::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:**. "," .. .:. . "," :!!*. :. . "," :!!: :*!!!!** "," .:!!@@!!!!: "," :*!!*!!@!** "," .::::*:::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:** "," .. :: "," .*!!. *... "," .*!!.:*!!!!*: "," .:*!@!!!!!. "," *!!!*!!!!** "," .::::*.::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..::** "," .. :: "," .*!!. .:... "," .*!!.:*!!!!*: "," .:*!@!!!!!. "," *!!!*!!!!** "," .::::::::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:** "," .. :: "," .*!!. .: . "," .*!!.:*!!!!*: "," .:*!@@!!!!. "," *!!!*!!!!** "," .::::*:*:.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:** "," .. :: "," .*!!. .: . "," .*!!.:*!!!!*: "," .:*!@@!!!!. "," *!!!*!!!!** "," .::::*:*:.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:** "," .. :. "," .*!!. .: . "," .*!!.:*!!!!*: "," .:*!@!!!!!. "," *!!!*!!@!** "," .::::*:::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:** "," .. :. "," .*!!. .: . "," .*!!.:*!!!!*: "," .:*!@@!!!!. "," *!!!*!!!!** "," .::::::::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:** "," .. :. "," .*!!. .: . "," .*!!.:*!!!!*: "," .:*!@!!!!!. "," *!!!*!!!!** "," .::::*:::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ..:** "," .. :. "," .*!!. .: . "," .*!!.:*!!!!*: "," .:*!@!!!!!. "," *!!!*!!!!** "," .::::*:::.. "," "," "," "],[" "," "," "," "," "," "," "," "," ... "," .. .:..*!. "," *!!*. :. "," *!!..:*!!!!:: "," .*!@@!@!!!. "," .*!!**!!@*** "," .::::::*:.. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," .*!!:. :. :!!: "," .*!* :***!!*:. ... "," :*!@@@@!!!. "," .*!!*!!!!*!: "," :::.*:*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!*: "," :**. :**!!!!:. .:. "," :*!!!@@!!!. "," .****!!!!*!* "," .::::.*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!*: "," :**. :**!!!!:. .:. "," :*!!!@@!!!. "," .****!!!!*!* "," .::::.*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**. :**!!!!:. .:. "," :*!!!@@!!!. "," .*!**!!!!*!* "," .::::.*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**. :**!!!!:. .:. "," :*!!!@@!!!. "," .*!!*!!!!*!* "," :::::.*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**. :**!!!!.. .:. "," :*!!!@@!!!. "," .*!!!!!!!!!* "," .:**:.***:. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**. :**!!!!.. .:. "," :*!!!@@!!!. "," .*!!!!!!!!!* "," .:**:.***:. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**. :**!!!!:. .:. "," :*!!!@@!!!. "," .*!**!!!!*!* "," ::::*:*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**. :**!!!!:. .:. "," :*!!!@@!!!. "," .*!**!!!!*!* "," ::::*:*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**..:**!!!!.. .:. "," :*!@!@@!!!. "," .*!**!!!!*!* "," :::::.*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .:. .::. "," :*!*.: .. :!!: "," :**..:**!!!!.. .:. "," :*!@!@@!!!. "," .*!**!!!!*!* "," :::::.*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .::. .:::. "," .*!*..: .: .:** "," ..:**!!!!*: "," :*!!!@@!!!. "," .*!**!!!!*!* "," ::::*:*:::. "," "," "," "],[" "," "," "," "," "," "," "," "," "," .**: :* "," . .:: ...:: "," .. .: .. .. "," . :.....:. . "," :*!!!!@@!* "," .::******: "," "," "," "],[" "," "," "," "," "," "," "," "," "," .**: :* "," . .:: ...:: "," .. .: .. .. "," . :.....:. . "," :*!!!!@@!* "," .::******: "," "," "," "],[" "," "," "," "," "," "," "," "," "," :**: .*!: "," . .:. . . "," .. :. .. .. "," .. :. .: .. "," .**!!!!**. "," .::******: "," "," "," "],[" "," "," "," "," "," "," "," "," . .. "," .*** ::*: "," . :. . : "," .. :. .. .. "," .. :. .. .. "," ..**!!!!*:. "," .::******: "," "," "," "],[" ::. ..::. "," .*!!.::.......:.:@@!. "," .*!!:.!!!@@@@@:.!@!! "," ... .!!!@@@@!*.... "," :**:!*!**!*. "," .*!!!!*!!!**. "," .**!!!*!!!**. "," :*!!@!@!!*: "," .:.::!*!:::*. "," :*:::::*:*!!!. "," .... ***: "," "," "," "," "," "," "," "],[" ::. ..::. "," .*!!.::.......:.:@@!. "," .*!!:.!!!@@@@@:.!@!! "," ... .!!!@@@@!*.... "," :**:!*!**!*. "," .*!!!!*!!!**. "," .**!!!*!!!**. "," :*!!@!@!!*: "," .:.::!*!:::*. "," :*:::::*:*!!!. "," .... ***: "," "," "," "," "," "," "," "],[" .*!!!@@@@!!*. "," .::::@!@*::* "," *!*::***:*!@!. "," :**::. .!!!!. "," ... "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" ::::!!!*:**. "," :@!*:*:*:*@@@: "," .*!!!* .!@@@* "," ... .... "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" .*@!!@@@!!@!. "," .*!!!@*@!!!!: "," .*!@@@!!!@!!: "," .*!@@@@@@@@!. "," :*!*@!@!*** "," .*:.:@!@*:!!!: "," *!*::*::.:@@@@: "," .****. .:**: "," "," "," "," "," "," "," "," "," "," "],[" .*@!!@@@!!@!. "," .*!!!@*@!!!!: "," .*!@@@!!!@!!: "," .*!@@@@@@@@!. "," :*!*@!@!*** "," .*:.:@!@*:!!!: "," *!*::*::.:@@@@: "," .****. .:**: "," "," "," "," "," "," "," "," "," "," "],[" "," :**. *!!. "," *..! *. *. "," : .: .. .: "," .. :. .. .. "," .. .. :. .. "," .::!!!@@@@!!::. "," *!!!@@@@@@!* "," :!!*!!!!!@!* "," *!!!@!!!!!!* "," **!@!!!!!!!: "," :!!@@@@@@!!: "," ::**!!@!***. "," *!*::!!@!:!@@: "," *!*::: :!@@!. "," .... :::. "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," :*!***:..........:::*!**.",":*: .:*!!@!!@@@!!!*:. .**"," .:**:*!**@!*!!!**@!****: "," :!@@!**!!!!*!!!!!!**!@!!:"," .:***::*!@!!!!**:.::::. "," :*:::. "],[" "," "," "," "," "," "," "," "," "," ... . "," :*@!::!!!!!**::!!* "," :!!@.:!!@@@@@@!.:@!* "," ***.*!!@@@@!*!.:@!: "," .***@!!!!!!: .. "," .*!!!!!!!!!: .. "," .*!!**!!@@!@!!!*!@@*. "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," ... . "," :*@!::!!!!!**::!!* "," :!!@.:!!@@@@@@!.:@!* "," ***.*!!@@@@!*!.:@!: "," .***@!!!!!!: .. "," .*!!!!!!!!!: .. "," .*!!**!!@@!@!!!*!@@*. "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. .:::. "," :!@!..!!!!!!*!: .!!* "," :*!: :!!@@@@@!!. *!! "," *!!@@@@!@!: "," .***@!!!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!@!!@!!!*!@@*. "," :!!@!***!@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .*!*::. .::**. "," .!!!...*!!!!!*!: :!!: "," *!!@@@@@@!. . "," .*!!@@@@!@!: "," .*!!@!!!*!!: "," .*!!!!!!!!!: . "," .*!!**!!@@@@!!!*!@@* "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .*!*:.. .::**. "," .!!*.. *!!!!!**: .!!: "," *!!@@@@@@!. "," .*!!@@@@!@!: "," .*!!!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!@!@@!!!*!@@* "," :!!@!***@!@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .*!*:.. .::**. "," .!!*.. *!!!!!**: .!!: "," *!!@@@@@@!. "," .*!!@@@@!@!: "," .*!!!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!@!@@!!!*!@@* "," :!!@!***@!@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .*!*::. .::**. "," .!!*.. *!!!!!**: .!!: "," *!!@@@@@@!. "," .*!!@@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!@!!@!!!*!@@* "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," :**::. .::*: "," .*!!: *!*!!!**: :!!. "," ... :!!@@@@@!!. :*. "," .*!!@@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: . "," .*!!***!!!!!!!!*!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. .:::. "," *!@*. *!*!!!**: .*!*. "," :**. :!!@@@@@!!. .**. "," .*!*!@@!!!!. "," .*!!!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!***!!!!!!!!*!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. .:::. "," *!@*. *!*!!!**: .*!*. "," :**. :!!@@@@@!!. .**. "," .*!*!@@!!!!. "," .*!!!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!***!!!!!!!!*!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. ..::. "," *!@*. *!*!!!**. .*!* "," :**. :!!@@@@@!!. .*!. "," .*!!@@@@@@!: "," .*!!!!!!!!!: "," .*!!!!!!!!!: .. "," .*!!***!!!!!!!**!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. ..::. "," *!@* *!*!!!**. .*!* "," :**. :!!@@@@@!!. .*!. "," .*!*!@@@!!!. "," .*!*!!!!*!!: "," .*!!!!!!!!!: . "," .*!!***!!!!!!!!*!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. ..::. "," *!@* *!*!!!**. .*!* "," :**. :!!@@@@@!!. :*!. "," .*!*!@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: . "," .*!!***!!!!!!!**!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. ..::. "," *!@* *!*!!!**. .*!* "," :**. :!!@@@@@!!. :*!. "," .*!*!@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: . "," .*!!***!!!!!!!**!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. .:::. "," *!@* *!*!!!**. .*!* "," :**. :!!@@@@@!!. :*!. "," .*!!@@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: . "," .*!!***!!!!!!!**!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:**:. .:::. "," *!@* *!*!!!**: .*!* "," :**. :!!@@@@@!!. :*!. "," .*!!!@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!***!!!!!!!**!@!* "," :!!!!***!!@!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. .:**. "," *!@* .*!*!!!**: .*!* "," :**. :!!@@@@@!!. :!!. "," .*!!@@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!!!!!!!!*!@@*. "," :!!!!***!!@@!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. .:**. "," *!@* .*!*!!!**: .*!* "," :**. :!!@@@@@!!. :!!. "," .*!!@@@@!@!: "," .***!!!!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!!!!!!!!*!@@*. "," :!!!!***!!@@!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. .:**. "," *!@* *!!!!!!*: .*@*. "," :**. *!@@@@@@@!. :!!. "," .*!!@@@@!@@: "," .*!!@!!!*!!: "," .*!!!!!!@@!* .. "," .*!!**!!@@@@@!!*!@@*. "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. .:**. "," *!@* *!!!!!!!. .*@*. "," :**. *!@@@@@@@!. :!!. "," .*@!@@@@!@@: "," .***!!!!*!!: "," .*!!!!!!@@!* .. "," .*!!**!!@@@@@!!*!@@*. "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. .:**. "," *!@* *!!!!!!!. .*@*. "," :**. *!@@@@@@@!. :!!. "," .*@!@@@@!@@: "," .***!!!!*!!: "," .*!!!!!!@@!* .. "," .*!!**!!@@@@@!!*!@@*. "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. .:**. "," *!@*. *!!!!!!!: .*@*. "," :**. *!@@@@@@@!. :!!. "," .*@!@@@@!@@: "," .***!!!!**!: "," .*!!!!!!@@!* .. "," .*!!**!!@@@@@!!*!@@*. "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***.. .:**. "," *!@* *!!!!!!!: .*@*. "," :**. *!@@@@@@@!. :!!. "," .*@!@@@@!@@: "," .***!!!!*!!: "," .*!!!!!!@@!* .. "," .*!!**!!@!!@!!!*!@@* "," :!!!!***!!!!!***!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. ..::. "," *!@* *!**!***. .*@*. "," :**. *!!@@@@!!*. :!!. "," .*!!!@!!!!!: "," .***!!*!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!!!!!!!!*!@@*. "," :!!@!***!!!!****!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .***:. ..::. "," *!@* *!**!***. .*@*. "," :**. *!!@@@@!!*. :!!. "," .*!!!@!!!!!: "," .***!!*!*!!: "," .*!!!!!!!!!: .. "," .*!!**!!!!!!!!!*!@@*. "," :!!@!***!!!!****!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," .:*:.. ..::. "," :*!* :!*!!!**: *!* "," :*:. :*!@@@@@!!. .**. "," *!*!@@@*!!: "," .***!!*!*!!: "," .**!***!!!*: . "," .*!*::**!!!!!**:*!!* "," :**!*:::!!!!*****!**. "," .... :::: ... "],[" "," "," "," "," "," "," "," "," "," :*!*::.. .:::**. "," .. .. *!**!***. . .:*. "," :!!!@@!!!!. "," .*!*!!!!*!!: "," .*!!!**!!!!: "," .*!!!***!!!: .. "," .*!!**!!!!!!!!!*!@@* "," :!!@!***@@@@!!**!!!*. "," .... :::: .... "],[" "," "," "," "," "," "," "," . ..*!",":!::.. ... ::"," ... .:: :: ... "," ..: :!!!!@@@@!:.. "," :@@@@@@@@@@! "," !@@@@@@@@!@@. "," :@@@@@!@@@@!. "," :*!!**!!!!* "," .*!!*:!!!!*!!!!*!!!: "," .*!@@***!@@@!!!!@@!* "," .... :*:: .... "],[" "," "," "," "," "," "," "," . ..*!",":!::.. ... ::"," ... .:: :: ... "," ..: :!!!!@@@@!:.. "," :@@@@@@@@@@! "," !@@@@@@@@!@@. "," :@@@@@!@@@@!. "," :*!!**!!!!* "," .*!!*:!!!!*!!!!*!!!: "," .*!@@***!@@@!!!!@@!* "," .... :*:: .... "],[" "," "," "," "," "," "," :*",".**. .::.!","::.:::. ::. .:."," .:. :*: .:: :: "," .::.*!!!!@@@@!*.. "," :@@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!!*!!!!* "," .*!!*:!!!!*!!!!*!!!: "," :*!@@***!@@@!!*!@@!* "," .... :*:: .... "],[" "," "," "," "," "," "," .*:",".::. .::.!",".*..::. ::. .: "," .:. .:: .:: :: "," .::.*!!!!@@@@@*.. "," :@@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!!*!!!!* "," .*!!*:!!!!*!!!!*!!!: "," :*!@@***!@@@!!*!@@!* "," .... :*:: .... "],[" "," "," "," "," "," "," .::",".::. ....!",".:..::. .:. .: "," .:. .*: .:: :: "," .::.*!!!!!@@@@*:. "," :!@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!**!!!!* "," .*!!*:*!!!*!!!!*!!!: "," .*!!!***!@@@!!*!@!!* "," ... :::: .... "],[" "," "," "," "," "," "," .::",".::. ....!",".:..::. .:. .: "," .:. .*: .:: :: "," .::.*!!!!!@@@@*:. "," :!@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!**!!!!* "," .*!!*:*!!!*!!!!*!!!: "," .*!!!***!@@@!!*!@!!* "," ... :::: .... "],[" "," "," "," "," "," "," .::",".::. .:..!",".*..::. ::. .: "," .:. .:: .:: :: "," .::.*!!!!@@@@@*:. "," :@@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!!*!!!!* "," .*!!*:!!!!*!!!!*!!!: "," .*!@@***!@@@!!!!@@!* "," .... :*:: .... "],[" "," "," "," "," "," "," .::"," ::. .:..!",".: .::. ::. .: "," ... .:: :: :: "," ....*!!!!!@@@!:.. "," :!@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@!!@@@@!. "," :*!!**!!!!* "," .*!!*:*!!!*!!!!*!!!: "," .*!!!***!@@@!!*!@!!* "," .... :::: .... "],[" "," "," "," "," "," "," .::",".::. .:..!",".: .::. ::. .. "," .:. .:: :: :: "," .:..*!!!!!@@!!:.. "," :!@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!**!!!!* "," .*!!*:*!!!*!!!!*!!!: "," .*!!!***!@@@!!*!@!!* "," ... :::: .... "],[" "," "," "," "," "," "," .::",".::. .:..!",".: .::. ::. .. "," .:. .:: :: :: "," .:..*!!!!!@@!!:.. "," :!@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!**!!!!* "," .*!!*:*!!!*!!!!*!!!: "," .*!!!***!@@@!!*!@!!* "," ... :::: .... "],[" "," "," "," "," "," "," .*:",".::. ....!",".: .::. ::. :: "," ... .:: .:: :: "," .:. *!!!!@@@@!::. "," :@@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@@!@@@@!. "," :*!!!*!!!!* "," .*!!*:!!!!*!!!!*!!!: "," :*!@@***!@@@!!!!@@!* "," .... :*:: .... "],[" "," "," "," "," "," "," .::",".::. ... !",".: .::. .. :: "," .:. .:: ..: :: "," ... *!!!!!@@!!:.. "," :!@@@@@@@@@! "," !@@@@@@@@@@@. "," :@@@@!!@@@@!. "," :*!!**!!!!* "," .*!!*:*!!!*!!!!*!!!: "," .*!!!***!@@@!!*!@!!* "," .... :::: .... "],[" "," "," "," "," "," "," "," "," "," "," "," "," :*!***:. ........:::*!!*.","*!*. ..!!!@@@@@@!@!*. :**"," .:**:*!**@@!@@!*!@@****: "," *!@@@*!!!!!:*!!!@!*!@@@!."," .:*!!*:*!@@@@@!!*:.:**:. "," .*****.. "],[" "," "," "," "," "," "," "," "," "," "," "," "," :*!***:. ........:::*!!*.","*!*. ..!!!@@@@@@!@!*. :**"," .:**:*!**@@!@@!*!@@****: "," *!@@@*!!!!!:*!!!@!*!@@@!."," .:*!!*:*!@@@@@!!*:.:**:. "," .*****.. "],[" "," "," "," "," "," "," "," "," "," "," "," "," .**!**: .........:**!*. ","*!*. .!!!@@@@@@!@!*. .*!*"," .:**:*!**@@!@@!*!@@****: "," *!@@@*!!!!!:*!!!@!*!@@@!."," .:*!!*:*!@@@@@!!*:.:**:. "," .*!***.. "],[" .*******!@!!: "," .!!*!@@@@@@*!@: "," :@*!*!@!@**!*@* "," *@**@@!*@@@*:@* "," :@*:@@@!@@@*.@* "," .!!.!@@@@@@:.@! "," :!!.!!@@@@@* !@. "," .**:**@*@!!* .*. "," :***:!!!* "," :*!!**!!* "," .*!!**!!: "," :*!!:*!!. "," *!!!:*!!. "," .*!!!:*!!: "," :*!!!:!!!! "," *!!!!:!@@@: "," *!!!: *!@@* "," .. . "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" :***!*!**:. "," **:.**:*::!!* "," ****:. .:!!!: "," .... .... "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" :***!*!**:. "," **:.**:*::!!* "," ****:. .:!!!: "," .... .... "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," .:. .*** "," *.:. . * "," . : . .: "," . : . : "," . .. . . "," .. :::*****.: "," .***!!!!!!!* "," :***!!!**!* "," :***!******. "," :*!!!*!!***. "," .**!!!!!!** "," .::*!**::: "," ::..:*:::*!* "," ....:. ..:. "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," ... .:: "," :.:. : .: "," . . . . "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," ... .:: "," :.:. : .: "," . . . . "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "],[" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "]],Qv=2,mae=fae-1,gae=Math.floor(ji*.7),yae=18,bae=Yl[0].length,e9=Math.max(...Yl[0].map(e=>e.length)),vae=Yl.length-1,wae=40,Cae=550,Eae=.994,xae=.08,Sae=.25,kae=8,t9=.008,P6=20,Aae=.6,_ae=.01,Jv=Aae+_ae,Zv=1.25,Dae=.35,M6=" . ˙·∙⁺˚°:;~*+✧✩×✴░✦✶✳oO▒#%&xX▓@MW8B█████",Tae={" ":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 Fae(e){let t="",n=0,r=!1,s="",o=!1,i=!1,a=!1;for(;n",r=!1),s="",o=!1,i=!1,a=!1;else if(u==="1")o=!0,a=!0;else if(u==="2")i=!0,a=!0;else if(u.startsWith("38;2;")){const f=u.split(";");s=`rgb(${f[2]},${f[3]},${f[4]})`,a=!0}}else{if(a){r&&(t+="");const u=[];s&&u.push(`color:${s}`),o&&u.push("font-weight:700"),i&&u.push("opacity:0.6"),u.length>0?(t+=``,r=!0):r=!1,a=!1}const c=e[n];c==="<"?t+="<":c===">"?t+=">":c==="&"?t+="&":t+=c,n++}return r&&(t+=""),t}function I6(e){let t="";for(let n=0;n0&&(t+=` `),t+=Fae(e[n]);return t}const Bae="rgb(91,91,214)",La=[[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 ew(e,t,n){return`rgb(${Math.round(e[0]+(t[0]-e[0])*n)},${Math.round(e[1]+(t[1]-e[1])*n)},${Math.round(e[2]+(t[2]-e[2])*n)})`}function Rae(e){const t=Math.max(0,Math.min(.999,e));return M6[Math.floor(t*M6.length)]}function Pae(e){return Tae[e]??.5}function Mae(e,t){const n=Math.abs(e);if(n<.3)return ew(La[0],La[2],n/.3);if(n<.6){const r=(n-.3)/.3;return ew(La[3],La[4],r)}else{const r=Math.sin(t*17.3)*.5+.5;return r<.4?ew(La[4],La[5],(n-.6)/.4):r<.6?`rgb(${La[6].join(",")})`:r<.7?`rgb(${La[7].join(",")})`:"rgb(255,252,255)"}}function L6(e,t){let n="";for(let r=0;r0&&(n+=` -`);const s=e[r]||"";for(let o=0;o0?Math.exp(-w*w/2):Math.exp(-w*w/12),v=y*Sae-h.radius*.4,E=Math.sin(v*Math.PI),A=x*h.strength;a+=x*E*h.strength,A>u&&(u=A,c=v+r*.1+o*.05)}if(a=Math.max(-1,Math.min(1,a)),Math.abs(a)${i}`;else{const p=Pae(i)+a*.5,g=Math.max(.02,Math.min(.98,p)),y=Rae(g),b=Mae(a,c);n+=`${y}`}}}return n}function Iae(){const e=_.useRef(null),t=_.useRef(null),n=_.useRef([]),r=_.useRef(0),[s,o]=_.useState("waiting"),[i,a]=_.useState(8),c=_.useRef({width:8*Jv,height:8*Zv});_.useEffect(()=>{const b=e.current;if(!b)return;const w=v=>{if(v<=0)return;const E=v*Dae/e9/Jv;c.current={width:E*Jv,height:E*Zv},a(E)};w(b.clientWidth);const x=new ResizeObserver(([v])=>w(v.contentRect.width));return x.observe(b),()=>x.disconnect()},[]),_.useEffect(()=>{if(s!=="waiting")return;const b=t.current;if(!b)return;b.innerHTML=L6(Yl[0],[]);const w=setTimeout(()=>o("popping"),Cae);return()=>clearTimeout(w)},[s]),_.useEffect(()=>{if(s!=="popping")return;const b=t.current;if(!b)return;let w=gae;b.innerHTML=I6(R6(Yl[Qv],w));const x=setInterval(()=>{if(w++,w>mae){clearInterval(x),o("playing");return}b.innerHTML=I6(R6(Yl[Qv],w))},yae);return()=>{clearInterval(x),pae()}},[s]),_.useEffect(()=>{if(s!=="playing")return;const b=t.current;if(!b)return;let w=!0,x=Qv+1,v=performance.now();const E=A=>{if(!w)return;if(A-v>=wae){if(v=A,x>=vae){w=!1,o("done");return}x++}const k=n.current;for(const R of k)R.radius+=xae,R.strength*=Eae;n.current=k.filter(R=>R.strength>t9),b.innerHTML=L6(Yl[x],n.current),r.current=requestAnimationFrame(E)};return r.current=requestAnimationFrame(E),()=>{w=!1,cancelAnimationFrame(r.current)}},[s]);const u=_.useRef(null),f=_.useCallback((b,w,x=1)=>{const v=t.current;if(!v||s!=="playing")return;const E=v.getBoundingClientRect(),A=b-E.left,k=w-E.top,R=A/c.current.width,j=k/c.current.height;n.current.length>=kae&&n.current.shift(),n.current.push({cx:R,cy:j,radius:0,strength:x}),u.current={x:b,y:w}},[s]),h=_.useCallback(b=>{const w=u.current;if(w){const x=b.clientX-w.x,v=b.clientY-w.y;if(Math.sqrt(x*x+v*v){f(b.clientX,b.clientY,1)},[f]),g=_.useCallback(b=>{u.current=null,f(b.clientX,b.clientY,.6)},[f]),y=_.useCallback(b=>{if(b.touches.length>0){const w=b.touches[0],x=u.current;if(x){const v=w.clientX-x.x,E=w.clientY-x.y;if(Math.sqrt(v*v+E*E){var I;(I=f.current)==null||I.scrollIntoView({behavior:"smooth"})},[r.length]),_.useEffect(()=>{e&&!n&&!s&&(c(),p(tw))},[e]),_.useEffect(()=>{if(s!=="success")return;p(tw);const I=setInterval(()=>{p(H=>H<=1?(clearInterval(I),u(),window.location.reload(),0):H-1)},1e3);return()=>clearInterval(I)},[s,u]);const g=_.useCallback(()=>{a()},[a]),y=_.useCallback(()=>{s==="error"?u():i()},[s,u,i]),b=nP(),w=n||s!==null,x=s!==null,v=I=>I.split("+")[0],E=I=>I!=null&&I.includes("+")?I.split("+")[1]:null,A=(t==null?void 0:t.current_version)??(b==null?void 0:b.version)??"?",k=v(A),R=(t==null?void 0:t.latest_version)??"?",j=v(R),B=E(A),P=E(R);return S.jsx(pB,{open:e,onClose:w?()=>{}:y,size:"lg",bottomSheet:!0,children:w?x?s==="success"?S.jsx(S.Fragment,{children:S.jsxs(cf,{className:"!py-6",children:[S.jsx("div",{className:"flex justify-center mb-4 overflow-hidden",children:S.jsx(Lae,{})}),S.jsxs("div",{className:"text-center space-y-2",children:[S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx(Kz,{className:"w-5 h-5 text-sys-green"}),S.jsx("h3",{className:"type-subheading text-fg-primary font-semibold",children:"Upgrade Complete"})]}),S.jsxs("p",{className:"type-data-xs text-fg-muted font-mono",children:["v",k," → v",j,(t==null?void 0:t.channel)&&t.channel!=="main"&&S.jsxs("span",{className:"text-sys-indigo ml-1",children:["(",t.channel,")"]})]}),S.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[S.jsx(NV,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"}),S.jsxs("span",{className:"type-data-xs text-fg-muted",children:["Reloading in ",h,"s..."]})]})]})]})}):S.jsxs(S.Fragment,{children:[S.jsx(Qm,{icon:S.jsx(Xz,{className:"w-5 h-5 text-sys-red"}),title:"Update Failed"}),S.jsxs(cf,{className:"!py-4",children:[S.jsxs("details",{className:"mb-3",children:[S.jsxs("summary",{className:"type-data-xs text-fg-muted cursor-pointer hover:text-fg-secondary transition-colors",children:["Install log (",r.length," lines)"]}),S.jsx("div",{className:Ve("bg-zinc-950 radius-inner p-3 font-mono text-xs leading-5 overflow-y-auto mt-2","border border-edge-subtle","max-h-[200px]"),children:r.map((I,H)=>S.jsx("div",{className:"text-zinc-300 whitespace-pre-wrap break-all",children:I},H))})]}),o&&S.jsx("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:S.jsx("p",{className:"text-sm text-sys-red",children:o})})]}),S.jsx(e1,{children:S.jsx(Ql,{color:"muted",onClick:y,children:"Close"})})]}):S.jsxs(S.Fragment,{children:[S.jsx(Qm,{icon:S.jsx(Vb,{className:"w-5 h-5"}),title:"Updating openHop Repeater"}),S.jsxs(cf,{className:"!py-4",children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(D8,{className:"w-4 h-4 text-sys-blue animate-spin"}),S.jsx("span",{className:"type-data-xs text-sys-blue font-medium",children:(t==null?void 0:t.state)==="restarting"?"Restarting service...":"Installing update..."})]}),S.jsxs("div",{className:Ve("bg-zinc-950 radius-inner p-3 font-mono text-xs leading-5 overflow-y-auto","border border-edge-subtle","min-h-[120px] max-h-[300px]"),children:[r.length===0&&S.jsx("span",{className:"text-zinc-500",children:"Waiting for output..."}),r.map((I,H)=>S.jsx("div",{className:"text-zinc-300 whitespace-pre-wrap break-all",children:I},H)),S.jsx("div",{ref:f})]})]})]}):S.jsxs(S.Fragment,{children:[S.jsx(Qm,{icon:S.jsx(Vb,{className:"w-5 h-5"}),title:"Update openHop Repeater",onClose:y}),S.jsxs(cf,{children:[S.jsxs("p",{className:"text-sm text-fg-secondary mb-4",children:["This will upgrade from"," ",S.jsxs("span",{className:"font-mono font-medium text-fg-primary",children:["v",k]}),B&&S.jsxs(S.Fragment,{children:[" ",S.jsx(A6,{size:"compact",copy:!0,copyValue:B,children:B})]})," → ",S.jsxs("span",{className:"font-mono font-medium text-sys-green",children:["v",j]}),P&&S.jsxs(S.Fragment,{children:[" ",S.jsx(A6,{size:"compact",copy:!0,copyValue:P,children:P})]}),(t==null?void 0:t.channel)&&t.channel!=="main"&&S.jsxs(S.Fragment,{children:[" on ",S.jsx("span",{className:"font-mono font-medium text-sys-indigo",children:t.channel})]}),". The service will restart automatically."]}),S.jsx("div",{className:"bg-sys-amber/10 border border-sys-amber/30 radius-inner p-3",children:S.jsxs("div",{className:"flex gap-2",children:[S.jsx(oH,{className:"w-4 h-4 text-sys-amber flex-shrink-0 mt-0.5"}),S.jsxs("p",{className:"text-sm text-fg-secondary",children:["The repeater will be ",S.jsx("strong",{className:"text-fg-primary",children:"offline for ~30 seconds"})," during the update. Active mesh traffic will resume once the service restarts."]})]})})]}),S.jsxs(e1,{children:[S.jsx(Ql,{color:"muted",onClick:y,children:"Cancel"}),S.jsxs(Ql,{color:"danger",onClick:g,children:[S.jsx(Vb,{"data-slot":"icon"}),"Update Now"]})]})]})})}function ed({withControls:e=!1}){return S.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[S.jsx(zt,{className:"h-7 w-40 sm:w-52"}),e&&S.jsx(zt,{className:"h-8 w-48 sm:w-56 radius-inner"})]})}function Wo({className:e,children:t}){return S.jsx("div",{className:`bg-surface/80 radius-card depth-raised h-full flex flex-col p-4 sm:p-5 ${e??""}`,children:t})}const jae=[45,72,33,58,80,42,65,28,55,75,38,62];function Ux(){return S.jsx("div",{className:"flex-1 flex items-end gap-1",children:jae.map((e,t)=>S.jsx(zt,{className:"flex-1",style:{height:`${e}%`}},t))})}function Oae(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading dashboard","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-hero-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-36"})]}),S.jsx(Ux,{})]})})}),S.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3].map(e=>S.jsx("div",{className:"col-span-6 lg:col-span-4",children:S.jsxs(Wo,{children:[S.jsx(zt,{className:"h-4 w-24 mb-3"}),S.jsx(zt,{className:"h-8 w-16"})]})},e))}),S.jsx("div",{className:"bento-row-widget grid-12 bento-gap",children:[1,2,3,4].map(e=>S.jsx("div",{className:"col-span-6 sm:col-span-4 md:col-span-3",children:S.jsxs(Wo,{children:[S.jsx(zt,{className:"h-3 w-20 mb-2"}),S.jsx(zt,{className:"h-6 w-12"})]})},e))})]})]})}function Jd(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading list","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{className:"!py-3",children:S.jsxs("div",{className:"flex gap-3",children:[S.jsx(zt,{className:"h-8 w-28 radius-inner"}),S.jsx(zt,{className:"h-8 w-28 radius-inner"}),S.jsx(zt,{className:"h-8 w-28 radius-inner hidden sm:block"})]})})})}),S.jsx("div",{className:"bento-row-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{children:S.jsx("div",{className:"space-y-4",children:Array.from({length:8}).map((e,t)=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx(zt,{className:"w-10 h-10 radius-inner shrink-0"}),S.jsxs("div",{className:"flex-1 space-y-2",children:[S.jsx(zt,{className:"h-4 w-48"}),S.jsx(zt,{className:"h-3 w-32"})]}),S.jsx(zt,{className:"w-16 h-4 hidden sm:block"})]},t))})})})})]})]})}function N6(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading map","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsx("div",{className:"bento-section",children:S.jsx("div",{className:"grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{className:"!min-h-[60vh]",children:S.jsx(zt,{className:"flex-1 w-full radius-inset"})})})})})]})}function Vm(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading charts","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-hero-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-32"})]}),S.jsx(Ux,{})]})})}),S.jsx("div",{className:"bento-row-panel grid-12 bento-gap",children:[1,2].map(e=>S.jsx("div",{className:"col-span-12 md:col-span-6",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-28"})]}),S.jsx(zt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function su(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading system","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-hero grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-36"})]}),S.jsx(Ux,{})]})})}),S.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3,4].map(e=>S.jsx("div",{className:"col-span-12 sm:col-span-6",children:S.jsxs(Wo,{children:[S.jsx(zt,{className:"h-4 w-28 mb-3"}),S.jsx(zt,{className:"h-6 w-20 mb-2"}),S.jsx(zt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function Na(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading settings","aria-busy":"true",children:[S.jsx(ed,{}),S.jsx("div",{className:"bento-section",children:S.jsx("div",{className:"bento-row-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{children:S.jsx("div",{className:"space-y-6",children:[.6,.8,.5,.7,.4].map((e,t)=>S.jsxs("div",{className:"space-y-2",children:[S.jsx(zt,{className:"h-3 w-24"}),S.jsx(zt,{className:"h-10 radius-inner",style:{width:`${e*100}%`}})]},t))})})})})})]})}const $ae=1024;function Fn({children:e,fallback:t}){const[n,r]=_.useState(!1);return _.useEffect(()=>{let s=!1;const o=window.innerWidth<$ae;return requestAnimationFrame(()=>{o?setTimeout(()=>{s||_.startTransition(()=>r(!0))},gY):requestAnimationFrame(()=>{s||_.startTransition(()=>r(!0))})}),()=>{s=!0}},[]),n?S.jsx(_.Suspense,{fallback:t,children:e}):S.jsx(S.Fragment,{children:t})}function Uae(e){e();const t=ic.getState().initialize(),n=wi.getState().initialize(),r=an.getState().initialize(),s=Ire.getState().initialize();ac.getState().startPolling();const o=mc.getState().initialize();t3();const i=setInterval(()=>{t3()},3e4),a=nQ();return()=>{t(),s(),n==null||n(),r==null||r(),ac.getState().stopPolling(),o(),a(),clearInterval(i),uP(),tae()}}const zae=_.lazy(()=>tn(()=>import("./Login-BqiBbXZ3.js"),[])),Vae=_.lazy(()=>tn(()=>import("./Setup-_swGk22g.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Hae=_.lazy(()=>tn(()=>import("./Dashboard-Dt57NbQx.js"),__vite__mapDeps([8,1,2,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,44,45,46,47,48,6,5]))),Wae=_.lazy(()=>tn(()=>import("./Packets-Cs9Zwu9d.js"),__vite__mapDeps([49,13,16,50,38,51,52,53,15,17,9,18,19,20,21,22,23,2,24,25,26,27,28,29,30,31,32,33,11,12,34,35,36,54,43,55,56,1,37,48,57]))),j6=_.lazy(()=>tn(()=>import("./Contacts-COjtGvyY.js").then(e=>e.C),__vite__mapDeps([58,36,13,59,1,2,60,50,38,51,61,53,37,48,9,19,20,62,63,64,25,65,43,66,26,67,31,68,69,70,56,29,71]))),qae=_.lazy(()=>tn(()=>import("./Statistics-DJlDW6-R.js"),__vite__mapDeps([72,27,9,73,74,37,2,38,1,10,11,12,62,63,64,25,65,43,28,39,31,54,13,26,55,56,36,48,5,75,76,77,71]))),Gae=_.lazy(()=>tn(()=>import("./RfHealthCorrelation-Bjlu541K.js"),__vite__mapDeps([78,1,2,39,37,38,5,32]))),Kae=_.lazy(()=>tn(()=>import("./GPSDiagnostics-Cye-Trgs.js"),__vite__mapDeps([79,63,1,2,25,5,80,71]))),Yae=_.lazy(()=>tn(()=>import("./Sensors-insTPzAw.js"),__vite__mapDeps([81,1,2,5]))),Xae=_.lazy(()=>tn(()=>import("./CADCalibration-DOpFISap.js"),__vite__mapDeps([82,1,2,70,83,31,5,84,57,68,41]))),Qae=_.lazy(()=>tn(()=>import("./MeshGraph-C36tfydu.js").then(e=>e.M),__vite__mapDeps([85,86,9,87,88,29,32,18,14,2,66,27,56,75,89,68,77]))),Jae=_.lazy(()=>tn(()=>import("./System-D3XTlAJj.js"),__vite__mapDeps([90,1,2,21,77,23,91,31,5]))),Zae=_.lazy(()=>tn(()=>import("./Logs-DJM49UnJ.js"),__vite__mapDeps([92,1,2,93,5]))),ele=_.lazy(()=>tn(()=>import("./Terminal-B7Zl0oMf.js"),__vite__mapDeps([94,59,95,83,1,2,96,97,56,98]))),tle=_.lazy(()=>tn(()=>import("./Configuration-DfbJ8nZk.js"),__vite__mapDeps([99,95,83,70,42,1,2,43,44,22,100,101,97,69,89,34,102,88,29,103,50,5,104,105,106]))),nle=_.lazy(()=>tn(()=>import("./RoomServer-DrChSCH0.js"),__vite__mapDeps([107,1,2,5,13,102,60,50,38,51,61,53,105,108,25,69,96,97,70,45,19,7,46,106]))),rle=_.lazy(()=>tn(()=>import("./PacketObservatory-Cf7m4kGK.js"),__vite__mapDeps([109,36,13,17,24,1,2]))),sle=_.lazy(()=>tn(()=>import("./Sessions-6Pz1fhab.js"),__vite__mapDeps([110,70,1,2,5,6,26,34,43,104,69]))),ole=_.lazy(()=>tn(()=>import("./Mqtt-CkgupwWU.js"),__vite__mapDeps([111,1,2,60,50,38,51,61,53,75,105,25,112,35,56,28,16,55,93,69,47,80,5,7,113,32,29,76]))),ile=_.lazy(()=>tn(()=>import("./Observer-CWD4jATj.js"),__vite__mapDeps([114,1,2,115,83,66,5,116,84,105,69]))),ale=_.lazy(()=>tn(()=>import("./PolicyEngine-Bt5hUbRJ.js"),__vite__mapDeps([117,1,2,60,50,38,51,61,53,6,5,105,69]))),lle=_.lazy(()=>tn(()=>import("./DatabaseManagement-BQJZp4p1.js"),__vite__mapDeps([118,115,1,2,32,5,4,69]))),cle=_.lazy(()=>tn(()=>import("./MemoryDebug-hHFx3BHO.js"),__vite__mapDeps([119,115,1,2,5]))),ule=_.lazy(()=>tn(()=>import("./BackupRestore-CM11c75S.js"),__vite__mapDeps([120,121,1,2,5,122,106]))),dle=_.lazy(()=>tn(()=>import("./RadioHardware-DhH_OAdl.js"),__vite__mapDeps([123,83,3,121,1,2,100,44,101,5,116,75,84]))),fle=_.lazy(()=>tn(()=>import("./Companion-B40Pf-xY.js"),__vite__mapDeps([124,1,2,19,20,38,51,61,52,12,43,56,65,30,89,69,28,112,105,45,24,23,125,87,25,29,31,91,122,6,44,84,74,88,108,70,106,103,50,101]))),hle=_.lazy(()=>tn(()=>import("./Test-CYQzPSaa.js"),__vite__mapDeps([126,1,2,36,13,5])));function ple({children:e}){const t=Ls(),n=oh();return _.useEffect(()=>(XX(n),()=>QX()),[n]),nx()?S.jsx(S.Fragment,{children:e}):S.jsx(A2,{to:"/login",state:{from:t},replace:!0})}function Jt({to:e}){const{search:t,hash:n}=Ls();return S.jsx(A2,{to:{pathname:e,search:t,hash:n},replace:!0})}class mle extends _.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){var t;return this.state.hasError?S.jsxs("div",{className:"surface-base rounded-2xl p-8 text-center",children:[S.jsx("p",{className:"type-subheading text-sys-red mb-2",children:"Page failed to render"}),S.jsx("p",{className:"type-body text-fg-muted mb-4",children:((t=this.state.error)==null?void 0:t.message)||"Unknown error"}),S.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 gle(){const e=iP(),t=nx(),{theme:n}=X2(),r=Ls();_.useEffect(()=>{if(t)return Uae(e)},[e,t]);const s=_.useRef(!0);return _.useEffect(()=>{if(s.current){s.current=!1;return}const o=ah(n.themeId);o&&$x.getState().setMode(o.meta.isDark?"dark":"light")},[n.themeId]),S.jsxs($ie,{children:[S.jsx(jie,{}),S.jsx(sae,{}),S.jsx(Nae,{}),S.jsxs(Qk,{children:[S.jsx(vt,{path:"/login",element:S.jsx(_.Suspense,{fallback:S.jsx("div",{className:"min-h-screen bg-body"}),children:S.jsx(zae,{})})}),S.jsx(vt,{path:"/setup",element:S.jsx(_.Suspense,{fallback:S.jsx("div",{className:"min-h-screen bg-body"}),children:S.jsx(Vae,{})})}),S.jsx(vt,{path:"/*",element:S.jsx(ple,{children:S.jsx(bY,{sidebar:S.jsx(Iie,{}),navbar:S.jsx(Nie,{}),children:S.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${r.pathname==="/"?" dashboard-shell":""}`,children:S.jsx(mle,{children:S.jsxs(Qk,{children:[S.jsx(vt,{path:"/",element:S.jsx(Fn,{fallback:S.jsx(Oae,{}),children:S.jsx(Hae,{})})}),S.jsx(vt,{path:"/packets",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(Wae,{})})}),S.jsx(vt,{path:"/packets/raw",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(rle,{})})}),S.jsx(vt,{path:"/map",element:S.jsx(Fn,{fallback:S.jsx(N6,{}),children:S.jsx(j6,{view:"map",title:"Map"})})}),S.jsx(vt,{path:"/map/topology",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(Qae,{})})}),S.jsx(vt,{path:"/map/gps",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(Kae,{})})}),S.jsx(vt,{path:"/contacts",element:S.jsx(Fn,{fallback:S.jsx(N6,{}),children:S.jsx(j6,{view:"list"})})}),S.jsx(vt,{path:"/neighbors",element:S.jsx(Jt,{to:"/contacts"})}),S.jsx(vt,{path:"/statistics",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(qae,{})})}),S.jsx(vt,{path:"/rf-health-correlation",element:S.jsx(Jt,{to:"/statistics/rf-health"})}),S.jsx(vt,{path:"/statistics/rf-health",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(Gae,{})})}),S.jsx(vt,{path:"/rf-health",element:S.jsx(Jt,{to:"/statistics/rf-health"})}),S.jsx(vt,{path:"/gps",element:S.jsx(Jt,{to:"/map/gps"})}),S.jsx(vt,{path:"/gps-diagnostics",element:S.jsx(Jt,{to:"/map/gps"})}),S.jsx(vt,{path:"/meshgraph",element:S.jsx(Jt,{to:"/map/topology"})}),S.jsx(vt,{path:"/messages",element:S.jsx(Jt,{to:"/messages/companion"})}),S.jsx(vt,{path:"/messages/companion",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(fle,{})})}),S.jsx(vt,{path:"/messages/rooms",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(nle,{})})}),S.jsx(vt,{path:"/room-server",element:S.jsx(Jt,{to:"/messages/rooms"})}),S.jsx(vt,{path:"/room-servers",element:S.jsx(Jt,{to:"/messages/rooms"})}),S.jsx(vt,{path:"/companion",element:S.jsx(Jt,{to:"/messages/companion"})}),S.jsx(vt,{path:"/companions",element:S.jsx(Jt,{to:"/messages/companion"})}),S.jsx(vt,{path:"/configuration",element:S.jsx(Jt,{to:"/configuration/repeater"})}),S.jsx(vt,{path:"/configuration/repeater",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(tle,{})})}),S.jsx(vt,{path:"/configuration/radio",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(dle,{})})}),S.jsx(vt,{path:"/configuration/radio/calibration",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(Xae,{})})}),S.jsx(vt,{path:"/configuration/policy",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(ale,{})})}),S.jsx(vt,{path:"/configuration/sources",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(ole,{})})}),S.jsx(vt,{path:"/configuration/observer",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(ile,{})})}),S.jsx(vt,{path:"/configuration/access",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(sle,{})})}),S.jsx(vt,{path:"/radio-hardware",element:S.jsx(Jt,{to:"/configuration/radio"})}),S.jsx(vt,{path:"/cad-calibration",element:S.jsx(Jt,{to:"/configuration/radio/calibration"})}),S.jsx(vt,{path:"/cad",element:S.jsx(Jt,{to:"/configuration/radio/calibration"})}),S.jsx(vt,{path:"/policy-engine",element:S.jsx(Jt,{to:"/configuration/policy"})}),S.jsx(vt,{path:"/policies",element:S.jsx(Jt,{to:"/configuration/policy"})}),S.jsx(vt,{path:"/mqtt",element:S.jsx(Jt,{to:"/configuration/sources"})}),S.jsx(vt,{path:"/observer",element:S.jsx(Jt,{to:"/configuration/observer"})}),S.jsx(vt,{path:"/observers",element:S.jsx(Jt,{to:"/configuration/observer"})}),S.jsx(vt,{path:"/mqtt-management",element:S.jsx(Jt,{to:"/configuration/observer"})}),S.jsx(vt,{path:"/sessions",element:S.jsx(Jt,{to:"/configuration/access"})}),S.jsx(vt,{path:"/system",element:S.jsx(Jt,{to:"/system/resources"})}),S.jsx(vt,{path:"/system/resources",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(Jae,{})})}),S.jsx(vt,{path:"/system/sensors",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(Yae,{})})}),S.jsx(vt,{path:"/system/logs",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(Zae,{})})}),S.jsx(vt,{path:"/system/storage",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(lle,{})})}),S.jsx(vt,{path:"/system/recovery",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(ule,{})})}),S.jsx(vt,{path:"/system/diagnostics",element:S.jsx(Jt,{to:"/system/memory"})}),S.jsx(vt,{path:"/system/memory",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(cle,{})})}),S.jsx(vt,{path:"/system/terminal",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(ele,{})})}),S.jsx(vt,{path:"/system-stats",element:S.jsx(Jt,{to:"/system/resources"})}),S.jsx(vt,{path:"/sensors",element:S.jsx(Jt,{to:"/system/sensors"})}),S.jsx(vt,{path:"/logs",element:S.jsx(Jt,{to:"/system/logs"})}),S.jsx(vt,{path:"/database",element:S.jsx(Jt,{to:"/system/storage"})}),S.jsx(vt,{path:"/database-management",element:S.jsx(Jt,{to:"/system/storage"})}),S.jsx(vt,{path:"/memory",element:S.jsx(Jt,{to:"/system/memory"})}),S.jsx(vt,{path:"/backup",element:S.jsx(Jt,{to:"/system/recovery"})}),S.jsx(vt,{path:"/backup-restore",element:S.jsx(Jt,{to:"/system/recovery"})}),S.jsx(vt,{path:"/terminal",element:S.jsx(Jt,{to:"/system/terminal"})}),S.jsx(vt,{path:"/raw",element:S.jsx(Jt,{to:"/packets/raw"})}),S.jsx(vt,{path:"/help",element:S.jsx(Jt,{to:"/"})}),S.jsx(vt,{path:"/test",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(hle,{})})}),S.jsx(vt,{path:"*",element:S.jsx(A2,{to:"/",replace:!0})})]})})})})})})]})]})}const yle=console.warn;console.warn=(...e)=>{const t=e[0];typeof t=="string"&&t.includes("Unable to load glyph range")||yle.apply(console,e)};s7.createRoot(document.getElementById("root")).render(S.jsx(_.StrictMode,{children:S.jsx(cO,{children:S.jsx(vI,{children:S.jsx(gle,{})})})}));export{rP as $,Lae as A,Ql as B,sce as C,hce as D,Fle as E,Y4 as F,K4 as G,TV as H,CB as I,IE as J,Ble as K,Sle as L,YE as M,bu as N,Lie as O,K2 as P,gj as Q,IV as R,tH as S,nl as T,Rle as U,du as V,Zn as W,fh as X,je as Y,gt as Z,tn as _,Yle as a,OT as a$,Jue as a0,Que as a1,Pz as a2,zce as a3,rue as a4,Jle as a5,xY as a6,My as a7,_8 as a8,D8 as a9,yw as aA,pB as aB,cf as aC,Vb as aD,Rw as aE,xle as aF,Dde as aG,Tde as aH,Oie as aI,tre as aJ,wle as aK,Qm as aL,Fde as aM,Bde as aN,Rde as aO,uV as aP,Hz as aQ,Kne as aR,_re as aS,kx as aT,GV as aU,Ut as aV,qT as aW,kT as aX,UO as aY,A$ as aZ,Eo as a_,wR as aa,Yne as ab,Jne as ac,nP as ad,tce as ae,YM as af,pre as ag,ure as ah,lP as ai,pi as aj,MJ as ak,PJ as al,Bte as am,ude as an,Mre as ao,Zue as ap,ede as aq,Xue as ar,gre as as,Cr as at,_de as au,zt as av,Qle as aw,Nee as ax,lue as ay,wre as az,Jm as b,S8 as b$,T$ as b0,H$ as b1,JT as b2,Vn as b3,yh as b4,eE as b5,ws as b6,$T as b7,sl as b8,oE as b9,s5 as bA,Vu as bB,yT as bC,gT as bD,q$ as bE,RT as bF,XT as bG,xT as bH,Tu as bI,Xz as bJ,aH as bK,Ace as bL,Cle as bM,Ele as bN,T8 as bO,eq as bP,YW as bQ,Bce as bR,Fce as bS,zle as bT,uue as bU,IB as bV,Mu as bW,vee as bX,o1 as bY,cue as bZ,oH as b_,Uo as ba,ju as bb,Ga as bc,rE as bd,FT as be,mh as bf,ph as bg,Ns as bh,rc as bi,ir as bj,mi as bk,gh as bl,GT as bm,sE as bn,vh as bo,YT as bp,gs as bq,N$ as br,Z$ as bs,L$ as bt,vs as bu,KT as bv,ct as bw,gU as bx,uc as by,qo as bz,Ve as c,mZ as c$,r3 as c0,RB as c1,mQ as c2,Kle as c3,yue as c4,bue as c5,VG as c6,Zg as c7,A6 as c8,ux as c9,Z4 as cA,sy as cB,dre as cC,Pce as cD,Mce as cE,Oce as cF,$ce as cG,Cde as cH,Fre as cI,VX as cJ,mJ as cK,jg as cL,wce as cM,Ule as cN,oce as cO,Ple as cP,gce as cQ,lce as cR,cce as cS,bce as cT,yZ as cU,ch as cV,Vce as cW,Wce as cX,pV as cY,ece as cZ,fZ as c_,Yu as ca,Kz as cb,gx as cc,gue as cd,UV as ce,Tre as cf,Tce as cg,X_ as ch,yce as ci,due as cj,CJ as ck,Fr as cl,Nce as cm,Ice as cn,qce as co,Pee as cp,fue as cq,Hle as cr,mue as cs,ps as ct,il as cu,Hce as cv,Gce as cw,Vle as cx,kV as cy,kle as cz,Ku as d,vce as d$,gX as d0,tde as d1,oY as d2,Dce as d3,Pde as d4,Ade as d5,SJ as d6,fx as d7,xJ as d8,WV as d9,pR as dA,Ale as dB,Mde as dC,NV as dD,_le as dE,Dle as dF,PV as dG,iJ as dH,Lce as dI,Bie as dJ,t1 as dK,Ece as dL,hf as dM,kce as dN,yj as dO,_V as dP,Rce as dQ,Yce as dR,Kce as dS,Qce as dT,Xce as dU,Uce as dV,jce as dW,dde as dX,BV as dY,Py as dZ,nce as d_,cc as da,UT as db,Z2 as dc,tE as dd,xU as de,Cu as df,of as dg,zi as dh,Dw as di,qf as dj,Fu as dk,sc as dl,QT as dm,MT as dn,DT as dp,$le as dq,pU as dr,s8 as ds,CU as dt,Vo as du,VT as dv,zT as dw,d5 as dx,jt as dy,Wr as dz,qt as e,pde as e$,iV as e0,pZ as e1,Ij as e2,sne as e3,ine as e4,lne as e5,ane as e6,CZ as e7,IJ as e8,Xne as e9,zg as eA,pE as eB,lJ as eC,eQ as eD,ic as eE,X2 as eF,B2 as eG,og as eH,dZ as eI,iue as eJ,mc as eK,nf as eL,uu as eM,Tle as eN,Are as eO,VV as eP,ZV as eQ,hue as eR,pue as eS,rce as eT,e1 as eU,wi as eV,oue as eW,fde as eX,hde as eY,bde as eZ,vde as e_,Qne as ea,rre as eb,sre as ec,px as ed,Xle as ee,wZ as ef,ZE as eg,ey as eh,hx as ei,uh as ej,jJ as ek,Fte as el,$J as em,OJ as en,Dee as eo,Ht as ep,zJ as eq,GJ as er,JJ as es,R6 as et,Ide as eu,pae as ev,fae as ew,sY as ex,rY as ey,m8 as ez,Zle as f,Vi as f$,mde as f0,gde as f1,yde as f2,MQ as f3,IQ as f4,UQ as f5,LQ as f6,_te as f7,FQ as f8,BQ as f9,xde as fA,fV as fB,Sde as fC,bi as fD,rde as fE,lde as fF,ode as fG,sde as fH,ide as fI,ade as fJ,eP as fK,cde as fL,Nle as fM,CT as fN,Ole as fO,MY as fP,jle as fQ,BT as fR,nE as fS,If as fT,Kue as fU,Yue as fV,an as fW,Fie as fX,Pue as fY,Aue as fZ,eh as f_,RQ as fa,xce as fb,ice as fc,_Y as fd,DY as fe,TY as ff,rs as fg,Th as fh,zy as fi,vx as fj,dee as fk,Fh as fl,hR as fm,Zce as fn,eue as fo,tue as fp,wde as fq,En as fr,sP as fs,bee as ft,WQ as fu,x3 as fv,sue as fw,Ho as fx,tie as fy,kde as fz,DB as g,Jn as g$,jue as g0,Wue as g1,vV as g2,que as g3,Gue as g4,Vue as g5,Hue as g6,WJ as g7,Tue as g8,wue as g9,pY as gA,gB,bj as gC,Hu as gD,rm as gE,o$ as gF,$k as gG,c1 as gH,lV as gI,GM as gJ,vB as gK,Ls as gL,hy as gM,zj as gN,Sce as gO,nde as gP,GG as gQ,Bu as gR,Wle as gS,Gle as gT,pH as gU,dG as gV,_ce as gW,mH as gX,Sq as gY,Dr as gZ,dq as g_,Tv as ga,Oue as gb,Due as gc,HJ as gd,VJ as ge,see as gf,th as gg,nY as gh,vue as gi,$ue as gj,Cue as gk,Eue as gl,kue as gm,xue as gn,Sue as go,Nue as gp,_ue as gq,Uue as gr,Fue as gs,Bue as gt,Rue as gu,Lue as gv,zue as gw,Mue as gx,Iue as gy,vle as gz,rV as h,CE as h0,nW as h1,WH as h2,tW as h3,aF as h4,Ki as h5,Kf as h6,SF as h7,yq as h8,$q as h9,nue as hA,mre as hB,Wte as hC,X9 as hD,aue as hE,$ee as hF,dP as hG,Mq as ha,Cq as hb,lG as hc,pF as hd,Wg as he,pee as hf,See as hg,_ee as hh,Eh as hi,mce as hj,ace as hk,Mt as hl,dce as hm,fce as hn,uce as ho,CV as hp,Jce as hq,kh as hr,ex as hs,rH as ht,Ede as hu,Hre as hv,$j as hw,pce as hx,yQ as hy,uy as hz,nx as i,S as j,eW as k,Cce as l,Hr as m,Bn as n,ss as o,vE as p,el as q,_ as r,ZX as s,B5 as t,oh as u,bE as v,Er as w,mR as x,yJ as y,dh as z}; +`);const s=e[r]||"";for(let o=0;o0?Math.exp(-w*w/2):Math.exp(-w*w/12),v=y*Sae-h.radius*.4,E=Math.sin(v*Math.PI),A=x*h.strength;a+=x*E*h.strength,A>u&&(u=A,c=v+r*.1+o*.05)}if(a=Math.max(-1,Math.min(1,a)),Math.abs(a)${i}`;else{const p=Pae(i)+a*.5,g=Math.max(.02,Math.min(.98,p)),y=Rae(g),b=Mae(a,c);n+=`${y}`}}}return n}function Iae(){const e=_.useRef(null),t=_.useRef(null),n=_.useRef([]),r=_.useRef(0),[s,o]=_.useState("waiting"),[i,a]=_.useState(8),c=_.useRef({width:8*Jv,height:8*Zv});_.useEffect(()=>{const b=e.current;if(!b)return;const w=v=>{if(v<=0)return;const E=v*Dae/e9/Jv;c.current={width:E*Jv,height:E*Zv},a(E)};w(b.clientWidth);const x=new ResizeObserver(([v])=>w(v.contentRect.width));return x.observe(b),()=>x.disconnect()},[]),_.useEffect(()=>{if(s!=="waiting")return;const b=t.current;if(!b)return;b.innerHTML=L6(Yl[0],[]);const w=setTimeout(()=>o("popping"),Cae);return()=>clearTimeout(w)},[s]),_.useEffect(()=>{if(s!=="popping")return;const b=t.current;if(!b)return;let w=gae;b.innerHTML=I6(R6(Yl[Qv],w));const x=setInterval(()=>{if(w++,w>mae){clearInterval(x),o("playing");return}b.innerHTML=I6(R6(Yl[Qv],w))},yae);return()=>{clearInterval(x),pae()}},[s]),_.useEffect(()=>{if(s!=="playing")return;const b=t.current;if(!b)return;let w=!0,x=Qv+1,v=performance.now();const E=A=>{if(!w)return;if(A-v>=wae){if(v=A,x>=vae){w=!1,o("done");return}x++}const k=n.current;for(const R of k)R.radius+=xae,R.strength*=Eae;n.current=k.filter(R=>R.strength>t9),b.innerHTML=L6(Yl[x],n.current),r.current=requestAnimationFrame(E)};return r.current=requestAnimationFrame(E),()=>{w=!1,cancelAnimationFrame(r.current)}},[s]);const u=_.useRef(null),f=_.useCallback((b,w,x=1)=>{const v=t.current;if(!v||s!=="playing")return;const E=v.getBoundingClientRect(),A=b-E.left,k=w-E.top,R=A/c.current.width,j=k/c.current.height;n.current.length>=kae&&n.current.shift(),n.current.push({cx:R,cy:j,radius:0,strength:x}),u.current={x:b,y:w}},[s]),h=_.useCallback(b=>{const w=u.current;if(w){const x=b.clientX-w.x,v=b.clientY-w.y;if(Math.sqrt(x*x+v*v){f(b.clientX,b.clientY,1)},[f]),g=_.useCallback(b=>{u.current=null,f(b.clientX,b.clientY,.6)},[f]),y=_.useCallback(b=>{if(b.touches.length>0){const w=b.touches[0],x=u.current;if(x){const v=w.clientX-x.x,E=w.clientY-x.y;if(Math.sqrt(v*v+E*E){var I;(I=f.current)==null||I.scrollIntoView({behavior:"smooth"})},[r.length]),_.useEffect(()=>{e&&!n&&!s&&(c(),p(tw))},[e]),_.useEffect(()=>{if(s!=="success")return;p(tw);const I=setInterval(()=>{p(H=>H<=1?(clearInterval(I),u(),window.location.reload(),0):H-1)},1e3);return()=>clearInterval(I)},[s,u]);const g=_.useCallback(()=>{a()},[a]),y=_.useCallback(()=>{s==="error"?u():i()},[s,u,i]),b=nP(),w=n||s!==null,x=s!==null,v=I=>I.split("+")[0],E=I=>I!=null&&I.includes("+")?I.split("+")[1]:null,A=(t==null?void 0:t.current_version)??(b==null?void 0:b.version)??"?",k=v(A),R=(t==null?void 0:t.latest_version)??"?",j=v(R),B=E(A),P=E(R);return S.jsx(pB,{open:e,onClose:w?()=>{}:y,size:"lg",bottomSheet:!0,children:w?x?s==="success"?S.jsx(S.Fragment,{children:S.jsxs(cf,{className:"!py-6",children:[S.jsx("div",{className:"flex justify-center mb-4 overflow-hidden",children:S.jsx(Lae,{})}),S.jsxs("div",{className:"text-center space-y-2",children:[S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx(Kz,{className:"w-5 h-5 text-sys-green"}),S.jsx("h3",{className:"type-subheading text-fg-primary font-semibold",children:"Upgrade Complete"})]}),S.jsxs("p",{className:"type-data-xs text-fg-muted font-mono",children:["v",k," → v",j,(t==null?void 0:t.channel)&&t.channel!=="main"&&S.jsxs("span",{className:"text-sys-indigo ml-1",children:["(",t.channel,")"]})]}),S.jsxs("div",{className:"flex items-center justify-center gap-2 mt-3",children:[S.jsx(NV,{className:"w-3.5 h-3.5 text-sys-blue animate-spin"}),S.jsxs("span",{className:"type-data-xs text-fg-muted",children:["Reloading in ",h,"s..."]})]})]})]})}):S.jsxs(S.Fragment,{children:[S.jsx(Qm,{icon:S.jsx(Xz,{className:"w-5 h-5 text-sys-red"}),title:"Update Failed"}),S.jsxs(cf,{className:"!py-4",children:[S.jsxs("details",{className:"mb-3",children:[S.jsxs("summary",{className:"type-data-xs text-fg-muted cursor-pointer hover:text-fg-secondary transition-colors",children:["Install log (",r.length," lines)"]}),S.jsx("div",{className:Ve("bg-zinc-950 radius-inner p-3 font-mono text-xs leading-5 overflow-y-auto mt-2","border border-edge-subtle","max-h-[200px]"),children:r.map((I,H)=>S.jsx("div",{className:"text-zinc-300 whitespace-pre-wrap break-all",children:I},H))})]}),o&&S.jsx("div",{className:"bg-sys-red/10 border border-sys-red/30 radius-inner p-3",children:S.jsx("p",{className:"text-sm text-sys-red",children:o})})]}),S.jsx(e1,{children:S.jsx(Ql,{color:"muted",onClick:y,children:"Close"})})]}):S.jsxs(S.Fragment,{children:[S.jsx(Qm,{icon:S.jsx(Vb,{className:"w-5 h-5"}),title:"Updating openHop Repeater"}),S.jsxs(cf,{className:"!py-4",children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(D8,{className:"w-4 h-4 text-sys-blue animate-spin"}),S.jsx("span",{className:"type-data-xs text-sys-blue font-medium",children:(t==null?void 0:t.state)==="restarting"?"Restarting service...":"Installing update..."})]}),S.jsxs("div",{className:Ve("bg-zinc-950 radius-inner p-3 font-mono text-xs leading-5 overflow-y-auto","border border-edge-subtle","min-h-[120px] max-h-[300px]"),children:[r.length===0&&S.jsx("span",{className:"text-zinc-500",children:"Waiting for output..."}),r.map((I,H)=>S.jsx("div",{className:"text-zinc-300 whitespace-pre-wrap break-all",children:I},H)),S.jsx("div",{ref:f})]})]})]}):S.jsxs(S.Fragment,{children:[S.jsx(Qm,{icon:S.jsx(Vb,{className:"w-5 h-5"}),title:"Update openHop Repeater",onClose:y}),S.jsxs(cf,{children:[S.jsxs("p",{className:"text-sm text-fg-secondary mb-4",children:["This will upgrade from"," ",S.jsxs("span",{className:"font-mono font-medium text-fg-primary",children:["v",k]}),B&&S.jsxs(S.Fragment,{children:[" ",S.jsx(A6,{size:"compact",copy:!0,copyValue:B,children:B})]})," → ",S.jsxs("span",{className:"font-mono font-medium text-sys-green",children:["v",j]}),P&&S.jsxs(S.Fragment,{children:[" ",S.jsx(A6,{size:"compact",copy:!0,copyValue:P,children:P})]}),(t==null?void 0:t.channel)&&t.channel!=="main"&&S.jsxs(S.Fragment,{children:[" on ",S.jsx("span",{className:"font-mono font-medium text-sys-indigo",children:t.channel})]}),". The service will restart automatically."]}),S.jsx("div",{className:"bg-sys-amber/10 border border-sys-amber/30 radius-inner p-3",children:S.jsxs("div",{className:"flex gap-2",children:[S.jsx(oH,{className:"w-4 h-4 text-sys-amber flex-shrink-0 mt-0.5"}),S.jsxs("p",{className:"text-sm text-fg-secondary",children:["The repeater will be ",S.jsx("strong",{className:"text-fg-primary",children:"offline for ~30 seconds"})," during the update. Active mesh traffic will resume once the service restarts."]})]})})]}),S.jsxs(e1,{children:[S.jsx(Ql,{color:"muted",onClick:y,children:"Cancel"}),S.jsxs(Ql,{color:"danger",onClick:g,children:[S.jsx(Vb,{"data-slot":"icon"}),"Update Now"]})]})]})})}function ed({withControls:e=!1}){return S.jsxs("div",{className:"flex items-center justify-between gap-3 min-h-9",children:[S.jsx(zt,{className:"h-7 w-40 sm:w-52"}),e&&S.jsx(zt,{className:"h-8 w-48 sm:w-56 radius-inner"})]})}function Wo({className:e,children:t}){return S.jsx("div",{className:`bg-surface/80 radius-card depth-raised h-full flex flex-col p-4 sm:p-5 ${e??""}`,children:t})}const jae=[45,72,33,58,80,42,65,28,55,75,38,62];function Ux(){return S.jsx("div",{className:"flex-1 flex items-end gap-1",children:jae.map((e,t)=>S.jsx(zt,{className:"flex-1",style:{height:`${e}%`}},t))})}function Oae(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading dashboard","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-hero-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-36"})]}),S.jsx(Ux,{})]})})}),S.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3].map(e=>S.jsx("div",{className:"col-span-6 lg:col-span-4",children:S.jsxs(Wo,{children:[S.jsx(zt,{className:"h-4 w-24 mb-3"}),S.jsx(zt,{className:"h-8 w-16"})]})},e))}),S.jsx("div",{className:"bento-row-widget grid-12 bento-gap",children:[1,2,3,4].map(e=>S.jsx("div",{className:"col-span-6 sm:col-span-4 md:col-span-3",children:S.jsxs(Wo,{children:[S.jsx(zt,{className:"h-3 w-20 mb-2"}),S.jsx(zt,{className:"h-6 w-12"})]})},e))})]})]})}function Jd(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading list","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{className:"!py-3",children:S.jsxs("div",{className:"flex gap-3",children:[S.jsx(zt,{className:"h-8 w-28 radius-inner"}),S.jsx(zt,{className:"h-8 w-28 radius-inner"}),S.jsx(zt,{className:"h-8 w-28 radius-inner hidden sm:block"})]})})})}),S.jsx("div",{className:"bento-row-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{children:S.jsx("div",{className:"space-y-4",children:Array.from({length:8}).map((e,t)=>S.jsxs("div",{className:"flex items-center gap-4",children:[S.jsx(zt,{className:"w-10 h-10 radius-inner shrink-0"}),S.jsxs("div",{className:"flex-1 space-y-2",children:[S.jsx(zt,{className:"h-4 w-48"}),S.jsx(zt,{className:"h-3 w-32"})]}),S.jsx(zt,{className:"w-16 h-4 hidden sm:block"})]},t))})})})})]})]})}function N6(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading map","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsx("div",{className:"bento-section",children:S.jsx("div",{className:"grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{className:"!min-h-[60vh]",children:S.jsx(zt,{className:"flex-1 w-full radius-inset"})})})})})]})}function Vm(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading charts","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-hero-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-32"})]}),S.jsx(Ux,{})]})})}),S.jsx("div",{className:"bento-row-panel grid-12 bento-gap",children:[1,2].map(e=>S.jsx("div",{className:"col-span-12 md:col-span-6",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-28"})]}),S.jsx(zt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function su(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading system","aria-busy":"true",children:[S.jsx(ed,{withControls:!0}),S.jsxs("div",{className:"bento-section",children:[S.jsx("div",{className:"bento-row-hero grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsxs(Wo,{children:[S.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[S.jsx(zt,{className:"w-5 h-5"}),S.jsx(zt,{className:"h-4 w-36"})]}),S.jsx(Ux,{})]})})}),S.jsx("div",{className:"bento-row-compact grid-12 bento-gap",children:[1,2,3,4].map(e=>S.jsx("div",{className:"col-span-12 sm:col-span-6",children:S.jsxs(Wo,{children:[S.jsx(zt,{className:"h-4 w-28 mb-3"}),S.jsx(zt,{className:"h-6 w-20 mb-2"}),S.jsx(zt,{className:"flex-1 w-full radius-inset"})]})},e))})]})]})}function Na(){return S.jsxs("div",{className:"section-gap","aria-label":"Loading settings","aria-busy":"true",children:[S.jsx(ed,{}),S.jsx("div",{className:"bento-section",children:S.jsx("div",{className:"bento-row-auto grid-12",children:S.jsx("div",{className:"col-span-full",children:S.jsx(Wo,{children:S.jsx("div",{className:"space-y-6",children:[.6,.8,.5,.7,.4].map((e,t)=>S.jsxs("div",{className:"space-y-2",children:[S.jsx(zt,{className:"h-3 w-24"}),S.jsx(zt,{className:"h-10 radius-inner",style:{width:`${e*100}%`}})]},t))})})})})})]})}const $ae=1024;function Fn({children:e,fallback:t}){const[n,r]=_.useState(!1);return _.useEffect(()=>{let s=!1;const o=window.innerWidth<$ae;return requestAnimationFrame(()=>{o?setTimeout(()=>{s||_.startTransition(()=>r(!0))},gY):requestAnimationFrame(()=>{s||_.startTransition(()=>r(!0))})}),()=>{s=!0}},[]),n?S.jsx(_.Suspense,{fallback:t,children:e}):S.jsx(S.Fragment,{children:t})}function Uae(e){e();const t=ic.getState().initialize(),n=wi.getState().initialize(),r=an.getState().initialize(),s=Ire.getState().initialize();ac.getState().startPolling();const o=mc.getState().initialize();t3();const i=setInterval(()=>{t3()},3e4),a=nQ();return()=>{t(),s(),n==null||n(),r==null||r(),ac.getState().stopPolling(),o(),a(),clearInterval(i),uP(),tae()}}const zae=_.lazy(()=>tn(()=>import("./Login-B9-_of-X.js"),[])),Vae=_.lazy(()=>tn(()=>import("./Setup-Bzvgo-0b.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Hae=_.lazy(()=>tn(()=>import("./Dashboard-1WPD5yy7.js"),__vite__mapDeps([8,1,2,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,44,45,46,47,48,6,5]))),Wae=_.lazy(()=>tn(()=>import("./Packets-DfuElOK2.js"),__vite__mapDeps([49,13,16,50,38,51,52,53,15,17,9,18,19,20,21,22,23,2,24,25,26,27,28,29,30,31,32,33,11,12,34,35,36,54,43,55,56,1,37,48,57]))),j6=_.lazy(()=>tn(()=>import("./Contacts-DiQfIa8j.js").then(e=>e.C),__vite__mapDeps([58,36,13,59,1,2,60,50,38,51,61,53,37,48,9,19,20,62,63,64,25,65,43,66,26,67,31,68,69,70,56,29,71]))),qae=_.lazy(()=>tn(()=>import("./Statistics-D1pZrkmX.js"),__vite__mapDeps([72,27,9,73,74,37,2,38,1,10,11,12,62,63,64,25,65,43,28,39,31,54,13,26,55,56,36,48,5,75,76,77,71]))),Gae=_.lazy(()=>tn(()=>import("./RfHealthCorrelation-DoZNDUke.js"),__vite__mapDeps([78,1,2,39,37,38,5,32]))),Kae=_.lazy(()=>tn(()=>import("./GPSDiagnostics-CYzRkIGF.js"),__vite__mapDeps([79,63,1,2,25,5,80,71]))),Yae=_.lazy(()=>tn(()=>import("./Sensors-qNNEac7h.js"),__vite__mapDeps([81,1,2,5]))),Xae=_.lazy(()=>tn(()=>import("./CADCalibration-DeM92vih.js"),__vite__mapDeps([82,1,2,70,83,31,5,84,57,68,41]))),Qae=_.lazy(()=>tn(()=>import("./MeshGraph-wRRLz_lr.js").then(e=>e.M),__vite__mapDeps([85,86,9,87,88,29,32,18,14,2,66,27,56,75,89,68,77]))),Jae=_.lazy(()=>tn(()=>import("./System-C5DE1LLo.js"),__vite__mapDeps([90,1,2,21,77,23,91,31,5]))),Zae=_.lazy(()=>tn(()=>import("./Logs-D0FIyBRm.js"),__vite__mapDeps([92,1,2,93,5]))),ele=_.lazy(()=>tn(()=>import("./Terminal-C_XnInql.js"),__vite__mapDeps([94,59,95,83,1,2,96,97,56,98]))),tle=_.lazy(()=>tn(()=>import("./Configuration-aUhduX2Z.js"),__vite__mapDeps([99,95,83,70,42,1,2,43,44,22,100,101,97,69,89,34,102,88,29,103,50,5,104,105,106]))),nle=_.lazy(()=>tn(()=>import("./RoomServer-D9PWmBB1.js"),__vite__mapDeps([107,1,2,5,13,102,60,50,38,51,61,53,105,108,25,69,96,97,70,45,19,7,46,106]))),rle=_.lazy(()=>tn(()=>import("./PacketObservatory-B6q6lK8q.js"),__vite__mapDeps([109,36,13,17,24,1,2]))),sle=_.lazy(()=>tn(()=>import("./Sessions-CZL0vFpY.js"),__vite__mapDeps([110,70,1,2,5,6,26,34,43,104,69]))),ole=_.lazy(()=>tn(()=>import("./Mqtt-m3-rjLC-.js"),__vite__mapDeps([111,1,2,60,50,38,51,61,53,75,105,25,112,35,56,28,16,55,93,69,47,80,5,7,113,32,29,76]))),ile=_.lazy(()=>tn(()=>import("./Observer-VP_bsWv3.js"),__vite__mapDeps([114,1,2,115,83,66,5,116,84,105,69]))),ale=_.lazy(()=>tn(()=>import("./PolicyEngine-CFwki3sb.js"),__vite__mapDeps([117,1,2,60,50,38,51,61,53,6,5,105,69]))),lle=_.lazy(()=>tn(()=>import("./DatabaseManagement-DhltIlKH.js"),__vite__mapDeps([118,115,1,2,32,5,4,69]))),cle=_.lazy(()=>tn(()=>import("./MemoryDebug-SZdlepUQ.js"),__vite__mapDeps([119,115,1,2,5]))),ule=_.lazy(()=>tn(()=>import("./BackupRestore-D2lKmevY.js"),__vite__mapDeps([120,121,1,2,5,122,106]))),dle=_.lazy(()=>tn(()=>import("./RadioHardware-D1iA7IMw.js"),__vite__mapDeps([123,83,3,121,1,2,100,44,101,5,116,75,84]))),fle=_.lazy(()=>tn(()=>import("./Companion-Dku9E7ui.js"),__vite__mapDeps([124,1,2,19,20,38,51,61,52,12,43,56,65,30,89,69,28,112,105,45,24,23,125,87,25,29,31,91,122,6,44,84,74,88,108,70,106,103,50,101]))),hle=_.lazy(()=>tn(()=>import("./Test-Dr6o2qpf.js"),__vite__mapDeps([126,1,2,36,13,5])));function ple({children:e}){const t=Ls(),n=oh();return _.useEffect(()=>(XX(n),()=>QX()),[n]),nx()?S.jsx(S.Fragment,{children:e}):S.jsx(A2,{to:"/login",state:{from:t},replace:!0})}function Jt({to:e}){const{search:t,hash:n}=Ls();return S.jsx(A2,{to:{pathname:e,search:t,hash:n},replace:!0})}class mle extends _.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}render(){var t;return this.state.hasError?S.jsxs("div",{className:"surface-base rounded-2xl p-8 text-center",children:[S.jsx("p",{className:"type-subheading text-sys-red mb-2",children:"Page failed to render"}),S.jsx("p",{className:"type-body text-fg-muted mb-4",children:((t=this.state.error)==null?void 0:t.message)||"Unknown error"}),S.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 gle(){const e=iP(),t=nx(),{theme:n}=X2(),r=Ls();_.useEffect(()=>{if(t)return Uae(e)},[e,t]);const s=_.useRef(!0);return _.useEffect(()=>{if(s.current){s.current=!1;return}const o=ah(n.themeId);o&&$x.getState().setMode(o.meta.isDark?"dark":"light")},[n.themeId]),S.jsxs($ie,{children:[S.jsx(jie,{}),S.jsx(sae,{}),S.jsx(Nae,{}),S.jsxs(Qk,{children:[S.jsx(vt,{path:"/login",element:S.jsx(_.Suspense,{fallback:S.jsx("div",{className:"min-h-screen bg-body"}),children:S.jsx(zae,{})})}),S.jsx(vt,{path:"/setup",element:S.jsx(_.Suspense,{fallback:S.jsx("div",{className:"min-h-screen bg-body"}),children:S.jsx(Vae,{})})}),S.jsx(vt,{path:"/*",element:S.jsx(ple,{children:S.jsx(bY,{sidebar:S.jsx(Iie,{}),navbar:S.jsx(Nie,{}),children:S.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${r.pathname==="/"?" dashboard-shell":""}`,children:S.jsx(mle,{children:S.jsxs(Qk,{children:[S.jsx(vt,{path:"/",element:S.jsx(Fn,{fallback:S.jsx(Oae,{}),children:S.jsx(Hae,{})})}),S.jsx(vt,{path:"/packets",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(Wae,{})})}),S.jsx(vt,{path:"/packets/raw",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(rle,{})})}),S.jsx(vt,{path:"/map",element:S.jsx(Fn,{fallback:S.jsx(N6,{}),children:S.jsx(j6,{view:"map",title:"Map"})})}),S.jsx(vt,{path:"/map/topology",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(Qae,{})})}),S.jsx(vt,{path:"/map/gps",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(Kae,{})})}),S.jsx(vt,{path:"/contacts",element:S.jsx(Fn,{fallback:S.jsx(N6,{}),children:S.jsx(j6,{view:"list"})})}),S.jsx(vt,{path:"/neighbors",element:S.jsx(Jt,{to:"/contacts"})}),S.jsx(vt,{path:"/statistics",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(qae,{})})}),S.jsx(vt,{path:"/rf-health-correlation",element:S.jsx(Jt,{to:"/statistics/rf-health"})}),S.jsx(vt,{path:"/statistics/rf-health",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(Gae,{})})}),S.jsx(vt,{path:"/rf-health",element:S.jsx(Jt,{to:"/statistics/rf-health"})}),S.jsx(vt,{path:"/gps",element:S.jsx(Jt,{to:"/map/gps"})}),S.jsx(vt,{path:"/gps-diagnostics",element:S.jsx(Jt,{to:"/map/gps"})}),S.jsx(vt,{path:"/meshgraph",element:S.jsx(Jt,{to:"/map/topology"})}),S.jsx(vt,{path:"/messages",element:S.jsx(Jt,{to:"/messages/companion"})}),S.jsx(vt,{path:"/messages/companion",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(fle,{})})}),S.jsx(vt,{path:"/messages/rooms",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(nle,{})})}),S.jsx(vt,{path:"/room-server",element:S.jsx(Jt,{to:"/messages/rooms"})}),S.jsx(vt,{path:"/room-servers",element:S.jsx(Jt,{to:"/messages/rooms"})}),S.jsx(vt,{path:"/companion",element:S.jsx(Jt,{to:"/messages/companion"})}),S.jsx(vt,{path:"/companions",element:S.jsx(Jt,{to:"/messages/companion"})}),S.jsx(vt,{path:"/configuration",element:S.jsx(Jt,{to:"/configuration/repeater"})}),S.jsx(vt,{path:"/configuration/repeater",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(tle,{})})}),S.jsx(vt,{path:"/configuration/radio",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(dle,{})})}),S.jsx(vt,{path:"/configuration/radio/calibration",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(Xae,{})})}),S.jsx(vt,{path:"/configuration/policy",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(ale,{})})}),S.jsx(vt,{path:"/configuration/sources",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(ole,{})})}),S.jsx(vt,{path:"/configuration/observer",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(ile,{})})}),S.jsx(vt,{path:"/configuration/access",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(sle,{})})}),S.jsx(vt,{path:"/radio-hardware",element:S.jsx(Jt,{to:"/configuration/radio"})}),S.jsx(vt,{path:"/cad-calibration",element:S.jsx(Jt,{to:"/configuration/radio/calibration"})}),S.jsx(vt,{path:"/cad",element:S.jsx(Jt,{to:"/configuration/radio/calibration"})}),S.jsx(vt,{path:"/policy-engine",element:S.jsx(Jt,{to:"/configuration/policy"})}),S.jsx(vt,{path:"/policies",element:S.jsx(Jt,{to:"/configuration/policy"})}),S.jsx(vt,{path:"/mqtt",element:S.jsx(Jt,{to:"/configuration/sources"})}),S.jsx(vt,{path:"/observer",element:S.jsx(Jt,{to:"/configuration/observer"})}),S.jsx(vt,{path:"/observers",element:S.jsx(Jt,{to:"/configuration/observer"})}),S.jsx(vt,{path:"/mqtt-management",element:S.jsx(Jt,{to:"/configuration/observer"})}),S.jsx(vt,{path:"/sessions",element:S.jsx(Jt,{to:"/configuration/access"})}),S.jsx(vt,{path:"/system",element:S.jsx(Jt,{to:"/system/resources"})}),S.jsx(vt,{path:"/system/resources",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(Jae,{})})}),S.jsx(vt,{path:"/system/sensors",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(Yae,{})})}),S.jsx(vt,{path:"/system/logs",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(Zae,{})})}),S.jsx(vt,{path:"/system/storage",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(lle,{})})}),S.jsx(vt,{path:"/system/recovery",element:S.jsx(Fn,{fallback:S.jsx(Na,{}),children:S.jsx(ule,{})})}),S.jsx(vt,{path:"/system/diagnostics",element:S.jsx(Jt,{to:"/system/memory"})}),S.jsx(vt,{path:"/system/memory",element:S.jsx(Fn,{fallback:S.jsx(su,{}),children:S.jsx(cle,{})})}),S.jsx(vt,{path:"/system/terminal",element:S.jsx(Fn,{fallback:S.jsx(Jd,{}),children:S.jsx(ele,{})})}),S.jsx(vt,{path:"/system-stats",element:S.jsx(Jt,{to:"/system/resources"})}),S.jsx(vt,{path:"/sensors",element:S.jsx(Jt,{to:"/system/sensors"})}),S.jsx(vt,{path:"/logs",element:S.jsx(Jt,{to:"/system/logs"})}),S.jsx(vt,{path:"/database",element:S.jsx(Jt,{to:"/system/storage"})}),S.jsx(vt,{path:"/database-management",element:S.jsx(Jt,{to:"/system/storage"})}),S.jsx(vt,{path:"/memory",element:S.jsx(Jt,{to:"/system/memory"})}),S.jsx(vt,{path:"/backup",element:S.jsx(Jt,{to:"/system/recovery"})}),S.jsx(vt,{path:"/backup-restore",element:S.jsx(Jt,{to:"/system/recovery"})}),S.jsx(vt,{path:"/terminal",element:S.jsx(Jt,{to:"/system/terminal"})}),S.jsx(vt,{path:"/raw",element:S.jsx(Jt,{to:"/packets/raw"})}),S.jsx(vt,{path:"/help",element:S.jsx(Jt,{to:"/"})}),S.jsx(vt,{path:"/test",element:S.jsx(Fn,{fallback:S.jsx(Vm,{}),children:S.jsx(hle,{})})}),S.jsx(vt,{path:"*",element:S.jsx(A2,{to:"/",replace:!0})})]})})})})})})]})]})}const yle=console.warn;console.warn=(...e)=>{const t=e[0];typeof t=="string"&&t.includes("Unable to load glyph range")||yle.apply(console,e)};s7.createRoot(document.getElementById("root")).render(S.jsx(_.StrictMode,{children:S.jsx(cO,{children:S.jsx(vI,{children:S.jsx(gle,{})})})}));export{rP as $,Lae as A,Ql as B,sce as C,hce as D,Fle as E,Y4 as F,K4 as G,TV as H,CB as I,IE as J,Ble as K,Sle as L,YE as M,bu as N,Lie as O,K2 as P,gj as Q,IV as R,tH as S,nl as T,Rle as U,du as V,Zn as W,fh as X,je as Y,gt as Z,tn as _,Yle as a,OT as a$,Jue as a0,Que as a1,Pz as a2,zce as a3,rue as a4,Jle as a5,xY as a6,My as a7,_8 as a8,D8 as a9,yw as aA,pB as aB,cf as aC,Vb as aD,Rw as aE,xle as aF,Dde as aG,Tde as aH,Oie as aI,tre as aJ,wle as aK,Qm as aL,Fde as aM,Bde as aN,Rde as aO,uV as aP,Hz as aQ,Kne as aR,_re as aS,kx as aT,GV as aU,Ut as aV,qT as aW,kT as aX,UO as aY,A$ as aZ,Eo as a_,wR as aa,Yne as ab,Jne as ac,nP as ad,tce as ae,YM as af,pre as ag,ure as ah,lP as ai,pi as aj,MJ as ak,PJ as al,Bte as am,ude as an,Mre as ao,Zue as ap,ede as aq,Xue as ar,gre as as,Cr as at,_de as au,zt as av,Qle as aw,Nee as ax,lue as ay,wre as az,Jm as b,S8 as b$,T$ as b0,H$ as b1,JT as b2,Vn as b3,yh as b4,eE as b5,ws as b6,$T as b7,sl as b8,oE as b9,s5 as bA,Vu as bB,yT as bC,gT as bD,q$ as bE,RT as bF,XT as bG,xT as bH,Tu as bI,Xz as bJ,aH as bK,Ace as bL,Cle as bM,Ele as bN,T8 as bO,eq as bP,YW as bQ,Bce as bR,Fce as bS,zle as bT,uue as bU,IB as bV,Mu as bW,vee as bX,o1 as bY,cue as bZ,oH as b_,Uo as ba,ju as bb,Ga as bc,rE as bd,FT as be,mh as bf,ph as bg,Ns as bh,rc as bi,ir as bj,mi as bk,gh as bl,GT as bm,sE as bn,vh as bo,YT as bp,gs as bq,N$ as br,Z$ as bs,L$ as bt,vs as bu,KT as bv,ct as bw,gU as bx,uc as by,qo as bz,Ve as c,mZ as c$,r3 as c0,RB as c1,mQ as c2,Kle as c3,yue as c4,bue as c5,VG as c6,Zg as c7,A6 as c8,ux as c9,Z4 as cA,sy as cB,dre as cC,Pce as cD,Mce as cE,Oce as cF,$ce as cG,Cde as cH,Fre as cI,VX as cJ,mJ as cK,jg as cL,wce as cM,Ule as cN,oce as cO,Ple as cP,gce as cQ,lce as cR,cce as cS,bce as cT,yZ as cU,ch as cV,Vce as cW,Wce as cX,pV as cY,ece as cZ,fZ as c_,Yu as ca,Kz as cb,gx as cc,gue as cd,UV as ce,Tre as cf,Tce as cg,X_ as ch,yce as ci,due as cj,CJ as ck,Fr as cl,Nce as cm,Ice as cn,qce as co,Pee as cp,fue as cq,Hle as cr,mue as cs,ps as ct,il as cu,Hce as cv,Gce as cw,Vle as cx,kV as cy,kle as cz,Ku as d,vce as d$,gX as d0,tde as d1,oY as d2,Dce as d3,Pde as d4,Ade as d5,SJ as d6,fx as d7,xJ as d8,WV as d9,pR as dA,Ale as dB,Mde as dC,NV as dD,_le as dE,Dle as dF,PV as dG,iJ as dH,Lce as dI,Bie as dJ,t1 as dK,Ece as dL,hf as dM,kce as dN,yj as dO,_V as dP,Rce as dQ,Yce as dR,Kce as dS,Qce as dT,Xce as dU,Uce as dV,jce as dW,dde as dX,BV as dY,Py as dZ,nce as d_,cc as da,UT as db,Z2 as dc,tE as dd,xU as de,Cu as df,of as dg,zi as dh,Dw as di,qf as dj,Fu as dk,sc as dl,QT as dm,MT as dn,DT as dp,$le as dq,pU as dr,s8 as ds,CU as dt,Vo as du,VT as dv,zT as dw,d5 as dx,jt as dy,Wr as dz,qt as e,pde as e$,iV as e0,pZ as e1,Ij as e2,sne as e3,ine as e4,lne as e5,ane as e6,CZ as e7,IJ as e8,Xne as e9,zg as eA,pE as eB,lJ as eC,eQ as eD,ic as eE,X2 as eF,B2 as eG,og as eH,dZ as eI,iue as eJ,mc as eK,nf as eL,uu as eM,Tle as eN,Are as eO,VV as eP,ZV as eQ,hue as eR,pue as eS,rce as eT,e1 as eU,wi as eV,oue as eW,fde as eX,hde as eY,bde as eZ,vde as e_,Qne as ea,rre as eb,sre as ec,px as ed,Xle as ee,wZ as ef,ZE as eg,ey as eh,hx as ei,uh as ej,jJ as ek,Fte as el,$J as em,OJ as en,Dee as eo,Ht as ep,zJ as eq,GJ as er,JJ as es,R6 as et,Ide as eu,pae as ev,fae as ew,sY as ex,rY as ey,m8 as ez,Zle as f,Vi as f$,mde as f0,gde as f1,yde as f2,MQ as f3,IQ as f4,UQ as f5,LQ as f6,_te as f7,FQ as f8,BQ as f9,xde as fA,fV as fB,Sde as fC,bi as fD,rde as fE,lde as fF,ode as fG,sde as fH,ide as fI,ade as fJ,eP as fK,cde as fL,Nle as fM,CT as fN,Ole as fO,MY as fP,jle as fQ,BT as fR,nE as fS,If as fT,Kue as fU,Yue as fV,an as fW,Fie as fX,Pue as fY,Aue as fZ,eh as f_,RQ as fa,xce as fb,ice as fc,_Y as fd,DY as fe,TY as ff,rs as fg,Th as fh,zy as fi,vx as fj,dee as fk,Fh as fl,hR as fm,Zce as fn,eue as fo,tue as fp,wde as fq,En as fr,sP as fs,bee as ft,WQ as fu,x3 as fv,sue as fw,Ho as fx,tie as fy,kde as fz,DB as g,Jn as g$,jue as g0,Wue as g1,vV as g2,que as g3,Gue as g4,Vue as g5,Hue as g6,WJ as g7,Tue as g8,wue as g9,pY as gA,gB,bj as gC,Hu as gD,rm as gE,o$ as gF,$k as gG,c1 as gH,lV as gI,GM as gJ,vB as gK,Ls as gL,hy as gM,zj as gN,Sce as gO,nde as gP,GG as gQ,Bu as gR,Wle as gS,Gle as gT,pH as gU,dG as gV,_ce as gW,mH as gX,Sq as gY,Dr as gZ,dq as g_,Tv as ga,Oue as gb,Due as gc,HJ as gd,VJ as ge,see as gf,th as gg,nY as gh,vue as gi,$ue as gj,Cue as gk,Eue as gl,kue as gm,xue as gn,Sue as go,Nue as gp,_ue as gq,Uue as gr,Fue as gs,Bue as gt,Rue as gu,Lue as gv,zue as gw,Mue as gx,Iue as gy,vle as gz,rV as h,CE as h0,nW as h1,WH as h2,tW as h3,aF as h4,Ki as h5,Kf as h6,SF as h7,yq as h8,$q as h9,nue as hA,mre as hB,Wte as hC,X9 as hD,aue as hE,$ee as hF,dP as hG,Mq as ha,Cq as hb,lG as hc,pF as hd,Wg as he,pee as hf,See as hg,_ee as hh,Eh as hi,mce as hj,ace as hk,Mt as hl,dce as hm,fce as hn,uce as ho,CV as hp,Jce as hq,kh as hr,ex as hs,rH as ht,Ede as hu,Hre as hv,$j as hw,pce as hx,yQ as hy,uy as hz,nx as i,S as j,eW as k,Cce as l,Hr as m,Bn as n,ss as o,vE as p,el as q,_ as r,ZX as s,B5 as t,oh as u,bE as v,Er as w,mR as x,yJ as y,dh as z}; diff --git a/frontend/dist/assets/index-1IIqkHes.js b/frontend/dist/assets/index-tm_sy7-t.js similarity index 98% rename from frontend/dist/assets/index-1IIqkHes.js rename to frontend/dist/assets/index-tm_sy7-t.js index beb7f57e..1be4ad53 100644 --- a/frontend/dist/assets/index-1IIqkHes.js +++ b/frontend/dist/assets/index-tm_sy7-t.js @@ -1 +1 @@ -import{gQ as J,r as i,M as R,v as H,j as u,gR as Q,m as k,gS as Z,gT as O,d as _,c6 as ee,gU as te,gV as ne}from"./index-CAHLMlrb.js";import{a as G}from"./index-R7zviCWb.js";function re({children:n,isValidProp:e,...t}){e&&J(e),t={...i.useContext(R),...t},t.isStatic=H(()=>t.isStatic);const s=i.useMemo(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion]);return u.jsx(R.Provider,{value:s,children:n})}function ie(n){const e=H(()=>Q(n)),{isStatic:t}=i.useContext(R);if(t){const[,s]=i.useState(n);i.useEffect(()=>e.on("change",s),[])}return e}const j="var(--mask-height, 0.15em)",E="var(--mask-width, 0.5em)",I=`calc(${E} / var(--invert-x, 1))`,M="#000 0, transparent 71%",se=`linear-gradient(to right, transparent 0, #000 ${I}, #000 calc(100% - ${I}), transparent),linear-gradient(to bottom, transparent 0, #000 ${j}, #000 calc(100% - ${j}), transparent 100%),radial-gradient(at bottom right, ${M}),radial-gradient(at bottom left, ${M}), radial-gradient(at top left, ${M}), radial-gradient(at top right, ${M})`,ae=`100% calc(100% - ${j} * 2),calc(100% - ${I} * 2) 100%,${I} ${j},${I} ${j},${I} ${j},${I} ${j}`;Z({"--invert-x":{correct:(n,{treeScale:e,projectionDelta:t})=>t.x.scale*e.x}});function oe({children:n,layoutDependency:e}){return u.jsx(k.span,{layout:!0,layoutDependency:e,"aria-hidden":!0,style:{display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${E})`,padding:`calc(${j}/2) ${E}`,position:"relative",zIndex:-1,overflow:"clip",WebkitMaskImage:se,WebkitMaskSize:ae,WebkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",WebkitMaskRepeat:"no-repeat"},children:n})}function K(){const n=i.useRef(!0);return i.useEffect(()=>{n.current=!1},[]),n.current}function N(n){const{width:e,fontSize:t}=getComputedStyle(n);return`${parseFloat(e)/parseFloat(t)}em`}const U=new WeakMap,ce=i.forwardRef(function({value:e,initialValue:t=e,...s},a){const{transition:x}=i.useContext(R),g=i.useRef(t).current,b=K(),c=i.useRef(null),y=i.useRef(null);i.useImperativeHandle(a,()=>y.current,[]);const w=i.useRef(new Array(10)),h=O(),f=h?e:0;i.useLayoutEffect(()=>{!c.current||!w.current[g]||(c.current.style.width=N(w.current[g]))},[]);const m=i.useRef(t);i.useLayoutEffect(()=>{var $;if(!c.current||f===m.current)return;const r=c.current.getBoundingClientRect(),o=($=y.current)==null?void 0:$.getBoundingClientRect(),v=r.height*(f-m.current)+(r.top-(o?o.top||0:r.top));return G(c.current,{y:[v,0]},x),()=>{m.current=f}},[f]);const[p,l]=i.useState();i.useEffect(()=>{if(b&&g===f||!w.current[f])return;const r=N(w.current[f]);y.current&&U.set(y.current,r),l(r)},[f]);const d=r=>u.jsx("span",{style:{display:"inline-block",padding:`calc(${j}/2) 0`},ref:o=>void(w.current[r]=o),children:r},r);return u.jsx(k.span,{...s,ref:y,layout:"position","data-state":h?void 0:"exiting",style:{display:"inline-flex",justifyContent:"center",width:p},children:u.jsxs("span",{ref:c,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"},children:[f!==0&&u.jsx("span",{style:{...F,bottom:"100%",left:0},children:new Array(f).fill(null).map((r,o)=>d(o))}),d(f),f!==9&&u.jsx("span",{style:{...F,top:"100%",left:0},children:new Array(9-f).fill(null).map((r,o)=>d(f+o+1))})]})})}),F={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"},X=i.createContext({justify:"left"}),le=i.forwardRef(function({partKey:e,type:t,children:s,layoutDependency:a,...x},g){const b=O(),{justify:c}=i.useContext(X);return u.jsx(k.span,{...x,"data-state":b?void 0:"exiting",style:{display:"inline-flex",justifyContent:c,padding:`calc(${j}/2) 0`,position:"relative"},layout:"position",layoutDependency:a,ref:g,children:u.jsx(_,{mode:"popLayout",anchorX:c,initial:!1,children:u.jsx(k.span,{layout:c==="right"?"position":!1,layoutDependency:a,initial:{opacity:0},animate:{opacity:[null,1]},exit:{opacity:[null,0]},style:{display:"inline-block",whiteSpace:"pre"},children:s},s)})})}),D=i.forwardRef(function({parts:e,justify:t="left",mode:s,style:a,name:x,layoutDependency:g,...b},c){const y=i.useRef(null);i.useImperativeHandle(c,()=>y.current,[]);const w=i.useMemo(()=>({justify:t}),[t]),h=i.useRef(null),f=K(),[m,p]=i.useState();return i.useEffect(()=>{if(!h.current)return;if(f){y.current&&(y.current.style.width=N(h.current));return}const l=Array.from(h.current.children).map(d=>{if(!(d instanceof HTMLElement))return;if(d.dataset.state==="exiting"){const v=d.nextSibling;return d.remove(),()=>{h.current&&h.current.insertBefore(d,v)}}const r=U.get(d);if(!r)return;const o=d.style.width;return d.style.width=r,()=>{d.style.width=o}});p(N(h.current));for(let d=l.length-1;d>=0;d--){const r=l[d];r&&r()}},[e.map(l=>l.value).join("")]),u.jsx(X.Provider,{value:w,children:u.jsx(k.span,{layoutDependency:g,...b,ref:y,className:`number-section-${x}`,style:{...a,display:"inline-flex",justifyContent:t,width:m},children:u.jsxs("span",{ref:h,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"},children:["​",u.jsx(_,{mode:s,anchorX:t,initial:!1,children:e.map(l=>l.type==="integer"||l.type==="fraction"?u.jsx(ce,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:l.value,initialValue:f?void 0:0,layoutDependency:g},l.key):u.jsx(le,{type:l.type,partKey:l.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},layoutDependency:g,children:l.value},l.type==="literal"?`${l.key}:${l.value}`:l.key))})]})})})}),ue=(n,{locales:e,format:t},s,a)=>{const g=new Intl.NumberFormat(e,t).formatToParts(Number(n));s&&g.unshift({type:"prefix",value:s}),a&&g.push({type:"suffix",value:a});const b=[],c=[],y=[],w=[],h={},f=r=>`${r}:${h[r]=(h[r]??-1)+1}`;let m="",p=!1,l=!1;for(const r of g){m+=r.value;const o=r.type==="minusSign"||r.type==="plusSign"?"sign":r.type;switch(o){case"integer":p=!0,c.push(...r.value.split("").map(v=>({type:o,value:parseInt(v)})));break;case"group":c.push({type:o,value:r.value});break;case"decimal":l=!0,y.push({type:o,value:r.value,key:f(o)});break;case"fraction":y.push(...r.value.split("").map(v=>({type:o,value:parseInt(v),key:f(o)})));break;default:(p||l?w:b).push({type:o,value:r.value,key:f(o)})}}const d=[];for(let r=c.length-1;r>=0;r--)d.unshift({...c[r],key:f(c[r].type)});return{pre:b,integer:d,fraction:y,post:w,formatted:m}},fe={opacity:{duration:1,ease:te},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},ve=i.forwardRef(function({children:e,locales:t,format:s,transition:a,style:x,suffix:g,prefix:b,...c},y){const w=i.useMemo(()=>ue(e,{locales:t,format:s},b,g),[e,t,s]),{pre:h,integer:f,fraction:m,post:p,formatted:l}=w,d=i.useContext(R).transition;a=a??d??fe;const{layoutDependency:r}=c,o=i.useMemo(()=>{if(r!==void 0)return{layoutDependency:r,value:e}},[r,e]);return u.jsx(ee,{children:u.jsx(re,{transition:a,children:u.jsx(k.div,{...c,ref:y,layout:!0,layoutDependency:o,style:{lineHeight:1,...x,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"},children:u.jsxs(k.div,{layout:!0,layoutDependency:o,"aria-label":l,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1},children:[u.jsx(D,{style:{padding:`calc(${j}/2) 0`},layoutDependency:o,"aria-hidden":!0,justify:"right",mode:"popLayout",parts:h,name:"pre"}),u.jsxs(oe,{layoutDependency:o,children:[u.jsx(D,{layoutDependency:o,justify:"right",parts:f,name:"integer"}),u.jsx(D,{layout:"position",layoutDependency:o,parts:m,name:"fraction"})]}),u.jsx(D,{style:{padding:`calc(${j}/2) 0`},"aria-hidden":!0,layout:"position",layoutDependency:o,mode:"popLayout",parts:p,name:"post"})]})})})})});k.create(i.Fragment);function Y(n,e){return n.length>e.length||n.length>0&&!e.startsWith(n)}function q(n,e,t){return n+(e-n)*t}function de(n,e,t,s,a){if(Y(e,n))return t*a;if(s==="natural")return pe(n,e,t);if(typeof s=="number"&&s>0){const x=t*(s/100);return t+q(-x,x,Math.random())}return t}function pe(n,e,t){const s=e.length,a=n[s],x=n[s-1];if(!a)return t;const b=n.slice(0,s).lastIndexOf(" "),c=s-b-1,y=b+1,h=n.slice(s).indexOf(" "),m=(h===-1?n.length:s+h)-y;let p=1;if(x&&/[.!?]/.test(x)&&a===" "&&(p*=3),m<=3?p*=.7:(c===0&&a!==" "&&(p*=1.5),c===m-1&&(p*=1.4)),c>0&&c3){const o=Math.min(c/m,.4);p*=1-o}ye.has(a)&&(p*=1.5),me.has(a)&&(p*=1.5),/\d/.test(a)&&(p*=1.3),m>8&&(p*=1.3),a!==a.toLowerCase()&&(p*=1.25);const l=200;if(s>l){const o=Math.min((s-l)/1e3,.3);p*=1+o}const d=q(-.25,.25,Math.random());p*=1+d;const r=t*p;return Math.max(t*.2,r)}const ye=new Set([".",",","!","?",":",";","'",'"',"-","(",")"]),me=new Set(["!","@","#","$","%","^","&","*","(",")","_","+","{","}","|",":",'"',"<",">","?"]);function he(n,e){let t=e-1;for(;t>=0&&/\s/.test(n[t]);)t--;for(;t>=0&&!/\s/.test(n[t]);)t--;return Math.max(0,t+1)}function ge(n,e){const t=Math.min(n.length,e.length);let s=0;for(let a=0;a{var C;(C=S.current)==null||C.call(S),S.current=null},T=()=>{P.current=G(W.current,{opacity:[1,1,0,0]},{duration:b,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"})};return i.useEffect(()=>{m==="all"&&e!==v.current&&$.set(""),v.current=e},[e,m]),i.useEffect(()=>{var V;if(!y){T(),L();return}(V=P.current)==null||V.cancel();const C=()=>{const z=xe($.get(),e,m,p);$.set(z),z!==e?B():(T(),c==null||c())},B=()=>{S.current=ne(C,de(e,$.get(),A,a,l))};return S.current||B(),L},[y,c,e,A,a,l,p]),u.jsxs(o,{ref:r,...d,"aria-label":w||e,children:[u.jsx(k.span,{className:h,style:f,children:$}),u.jsx(k.span,{ref:W,className:x,style:{display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...g}})]})});export{ve as A,ie as u}; +import{gQ as J,r as i,M as R,v as H,j as u,gR as Q,m as k,gS as Z,gT as O,d as _,c6 as ee,gU as te,gV as ne}from"./index-CdntfUUz.js";import{a as G}from"./index-Bfbz8_Ci.js";function re({children:n,isValidProp:e,...t}){e&&J(e),t={...i.useContext(R),...t},t.isStatic=H(()=>t.isStatic);const s=i.useMemo(()=>t,[JSON.stringify(t.transition),t.transformPagePoint,t.reducedMotion]);return u.jsx(R.Provider,{value:s,children:n})}function ie(n){const e=H(()=>Q(n)),{isStatic:t}=i.useContext(R);if(t){const[,s]=i.useState(n);i.useEffect(()=>e.on("change",s),[])}return e}const j="var(--mask-height, 0.15em)",E="var(--mask-width, 0.5em)",I=`calc(${E} / var(--invert-x, 1))`,M="#000 0, transparent 71%",se=`linear-gradient(to right, transparent 0, #000 ${I}, #000 calc(100% - ${I}), transparent),linear-gradient(to bottom, transparent 0, #000 ${j}, #000 calc(100% - ${j}), transparent 100%),radial-gradient(at bottom right, ${M}),radial-gradient(at bottom left, ${M}), radial-gradient(at top left, ${M}), radial-gradient(at top right, ${M})`,ae=`100% calc(100% - ${j} * 2),calc(100% - ${I} * 2) 100%,${I} ${j},${I} ${j},${I} ${j},${I} ${j}`;Z({"--invert-x":{correct:(n,{treeScale:e,projectionDelta:t})=>t.x.scale*e.x}});function oe({children:n,layoutDependency:e}){return u.jsx(k.span,{layout:!0,layoutDependency:e,"aria-hidden":!0,style:{display:"inline-flex","--invert-x":1,margin:`0 calc(-1*${E})`,padding:`calc(${j}/2) ${E}`,position:"relative",zIndex:-1,overflow:"clip",WebkitMaskImage:se,WebkitMaskSize:ae,WebkitMaskPosition:"center, center, top left, top right, bottom right, bottom left",WebkitMaskRepeat:"no-repeat"},children:n})}function K(){const n=i.useRef(!0);return i.useEffect(()=>{n.current=!1},[]),n.current}function N(n){const{width:e,fontSize:t}=getComputedStyle(n);return`${parseFloat(e)/parseFloat(t)}em`}const U=new WeakMap,ce=i.forwardRef(function({value:e,initialValue:t=e,...s},a){const{transition:x}=i.useContext(R),g=i.useRef(t).current,b=K(),c=i.useRef(null),y=i.useRef(null);i.useImperativeHandle(a,()=>y.current,[]);const w=i.useRef(new Array(10)),h=O(),f=h?e:0;i.useLayoutEffect(()=>{!c.current||!w.current[g]||(c.current.style.width=N(w.current[g]))},[]);const m=i.useRef(t);i.useLayoutEffect(()=>{var $;if(!c.current||f===m.current)return;const r=c.current.getBoundingClientRect(),o=($=y.current)==null?void 0:$.getBoundingClientRect(),v=r.height*(f-m.current)+(r.top-(o?o.top||0:r.top));return G(c.current,{y:[v,0]},x),()=>{m.current=f}},[f]);const[p,l]=i.useState();i.useEffect(()=>{if(b&&g===f||!w.current[f])return;const r=N(w.current[f]);y.current&&U.set(y.current,r),l(r)},[f]);const d=r=>u.jsx("span",{style:{display:"inline-block",padding:`calc(${j}/2) 0`},ref:o=>void(w.current[r]=o),children:r},r);return u.jsx(k.span,{...s,ref:y,layout:"position","data-state":h?void 0:"exiting",style:{display:"inline-flex",justifyContent:"center",width:p},children:u.jsxs("span",{ref:c,style:{display:"inline-flex",justifyContent:"center",flexDirection:"column",alignItems:"center",position:"relative"},children:[f!==0&&u.jsx("span",{style:{...F,bottom:"100%",left:0},children:new Array(f).fill(null).map((r,o)=>d(o))}),d(f),f!==9&&u.jsx("span",{style:{...F,top:"100%",left:0},children:new Array(9-f).fill(null).map((r,o)=>d(f+o+1))})]})})}),F={display:"flex",flexDirection:"column",alignItems:"center",position:"absolute",width:"100%"},X=i.createContext({justify:"left"}),le=i.forwardRef(function({partKey:e,type:t,children:s,layoutDependency:a,...x},g){const b=O(),{justify:c}=i.useContext(X);return u.jsx(k.span,{...x,"data-state":b?void 0:"exiting",style:{display:"inline-flex",justifyContent:c,padding:`calc(${j}/2) 0`,position:"relative"},layout:"position",layoutDependency:a,ref:g,children:u.jsx(_,{mode:"popLayout",anchorX:c,initial:!1,children:u.jsx(k.span,{layout:c==="right"?"position":!1,layoutDependency:a,initial:{opacity:0},animate:{opacity:[null,1]},exit:{opacity:[null,0]},style:{display:"inline-block",whiteSpace:"pre"},children:s},s)})})}),D=i.forwardRef(function({parts:e,justify:t="left",mode:s,style:a,name:x,layoutDependency:g,...b},c){const y=i.useRef(null);i.useImperativeHandle(c,()=>y.current,[]);const w=i.useMemo(()=>({justify:t}),[t]),h=i.useRef(null),f=K(),[m,p]=i.useState();return i.useEffect(()=>{if(!h.current)return;if(f){y.current&&(y.current.style.width=N(h.current));return}const l=Array.from(h.current.children).map(d=>{if(!(d instanceof HTMLElement))return;if(d.dataset.state==="exiting"){const v=d.nextSibling;return d.remove(),()=>{h.current&&h.current.insertBefore(d,v)}}const r=U.get(d);if(!r)return;const o=d.style.width;return d.style.width=r,()=>{d.style.width=o}});p(N(h.current));for(let d=l.length-1;d>=0;d--){const r=l[d];r&&r()}},[e.map(l=>l.value).join("")]),u.jsx(X.Provider,{value:w,children:u.jsx(k.span,{layoutDependency:g,...b,ref:y,className:`number-section-${x}`,style:{...a,display:"inline-flex",justifyContent:t,width:m},children:u.jsxs("span",{ref:h,style:{display:"inline-flex",justifyContent:"inherit",position:"relative"},children:["​",u.jsx(_,{mode:s,anchorX:t,initial:!1,children:e.map(l=>l.type==="integer"||l.type==="fraction"?u.jsx(ce,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},value:l.value,initialValue:f?void 0:0,layoutDependency:g},l.key):u.jsx(le,{type:l.type,partKey:l.key,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},layoutDependency:g,children:l.value},l.type==="literal"?`${l.key}:${l.value}`:l.key))})]})})})}),ue=(n,{locales:e,format:t},s,a)=>{const g=new Intl.NumberFormat(e,t).formatToParts(Number(n));s&&g.unshift({type:"prefix",value:s}),a&&g.push({type:"suffix",value:a});const b=[],c=[],y=[],w=[],h={},f=r=>`${r}:${h[r]=(h[r]??-1)+1}`;let m="",p=!1,l=!1;for(const r of g){m+=r.value;const o=r.type==="minusSign"||r.type==="plusSign"?"sign":r.type;switch(o){case"integer":p=!0,c.push(...r.value.split("").map(v=>({type:o,value:parseInt(v)})));break;case"group":c.push({type:o,value:r.value});break;case"decimal":l=!0,y.push({type:o,value:r.value,key:f(o)});break;case"fraction":y.push(...r.value.split("").map(v=>({type:o,value:parseInt(v),key:f(o)})));break;default:(p||l?w:b).push({type:o,value:r.value,key:f(o)})}}const d=[];for(let r=c.length-1;r>=0;r--)d.unshift({...c[r],key:f(c[r].type)});return{pre:b,integer:d,fraction:y,post:w,formatted:m}},fe={opacity:{duration:1,ease:te},layout:{type:"spring",duration:1,bounce:0},y:{type:"spring",duration:1,bounce:0}},ve=i.forwardRef(function({children:e,locales:t,format:s,transition:a,style:x,suffix:g,prefix:b,...c},y){const w=i.useMemo(()=>ue(e,{locales:t,format:s},b,g),[e,t,s]),{pre:h,integer:f,fraction:m,post:p,formatted:l}=w,d=i.useContext(R).transition;a=a??d??fe;const{layoutDependency:r}=c,o=i.useMemo(()=>{if(r!==void 0)return{layoutDependency:r,value:e}},[r,e]);return u.jsx(ee,{children:u.jsx(re,{transition:a,children:u.jsx(k.div,{...c,ref:y,layout:!0,layoutDependency:o,style:{lineHeight:1,...x,display:"inline-flex",isolation:"isolate",whiteSpace:"nowrap"},children:u.jsxs(k.div,{layout:!0,layoutDependency:o,"aria-label":l,style:{display:"inline-flex",direction:"ltr",isolation:"isolate",position:"relative",zIndex:-1},children:[u.jsx(D,{style:{padding:`calc(${j}/2) 0`},layoutDependency:o,"aria-hidden":!0,justify:"right",mode:"popLayout",parts:h,name:"pre"}),u.jsxs(oe,{layoutDependency:o,children:[u.jsx(D,{layoutDependency:o,justify:"right",parts:f,name:"integer"}),u.jsx(D,{layout:"position",layoutDependency:o,parts:m,name:"fraction"})]}),u.jsx(D,{style:{padding:`calc(${j}/2) 0`},"aria-hidden":!0,layout:"position",layoutDependency:o,mode:"popLayout",parts:p,name:"post"})]})})})})});k.create(i.Fragment);function Y(n,e){return n.length>e.length||n.length>0&&!e.startsWith(n)}function q(n,e,t){return n+(e-n)*t}function de(n,e,t,s,a){if(Y(e,n))return t*a;if(s==="natural")return pe(n,e,t);if(typeof s=="number"&&s>0){const x=t*(s/100);return t+q(-x,x,Math.random())}return t}function pe(n,e,t){const s=e.length,a=n[s],x=n[s-1];if(!a)return t;const b=n.slice(0,s).lastIndexOf(" "),c=s-b-1,y=b+1,h=n.slice(s).indexOf(" "),m=(h===-1?n.length:s+h)-y;let p=1;if(x&&/[.!?]/.test(x)&&a===" "&&(p*=3),m<=3?p*=.7:(c===0&&a!==" "&&(p*=1.5),c===m-1&&(p*=1.4)),c>0&&c3){const o=Math.min(c/m,.4);p*=1-o}ye.has(a)&&(p*=1.5),me.has(a)&&(p*=1.5),/\d/.test(a)&&(p*=1.3),m>8&&(p*=1.3),a!==a.toLowerCase()&&(p*=1.25);const l=200;if(s>l){const o=Math.min((s-l)/1e3,.3);p*=1+o}const d=q(-.25,.25,Math.random());p*=1+d;const r=t*p;return Math.max(t*.2,r)}const ye=new Set([".",",","!","?",":",";","'",'"',"-","(",")"]),me=new Set(["!","@","#","$","%","^","&","*","(",")","_","+","{","}","|",":",'"',"<",">","?"]);function he(n,e){let t=e-1;for(;t>=0&&/\s/.test(n[t]);)t--;for(;t>=0&&!/\s/.test(n[t]);)t--;return Math.max(0,t+1)}function ge(n,e){const t=Math.min(n.length,e.length);let s=0;for(let a=0;a{var C;(C=S.current)==null||C.call(S),S.current=null},T=()=>{P.current=G(W.current,{opacity:[1,1,0,0]},{duration:b,times:[0,.5,.5,1],ease:"linear",repeat:1/0,repeatType:"reverse"})};return i.useEffect(()=>{m==="all"&&e!==v.current&&$.set(""),v.current=e},[e,m]),i.useEffect(()=>{var V;if(!y){T(),L();return}(V=P.current)==null||V.cancel();const C=()=>{const z=xe($.get(),e,m,p);$.set(z),z!==e?B():(T(),c==null||c())},B=()=>{S.current=ne(C,de(e,$.get(),A,a,l))};return S.current||B(),L},[y,c,e,A,a,l,p]),u.jsxs(o,{ref:r,...d,"aria-label":w||e,children:[u.jsx(k.span,{className:h,style:f,children:$}),u.jsx(k.span,{ref:W,className:x,style:{display:"inline-block",width:"2px",height:"1em",backgroundColor:"currentColor",position:"relative",top:"0.1em",left:"0.2em",...g}})]})});export{ve as A,ie as u}; diff --git a/frontend/dist/assets/key-round-CZ_hGBwN.js b/frontend/dist/assets/key-round-Cn-7B-WZ.js similarity index 92% rename from frontend/dist/assets/key-round-CZ_hGBwN.js rename to frontend/dist/assets/key-round-Cn-7B-WZ.js index 696fcd75..3bf16496 100644 --- a/frontend/dist/assets/key-round-CZ_hGBwN.js +++ b/frontend/dist/assets/key-round-Cn-7B-WZ.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/layer-DnHLn7Jx.js b/frontend/dist/assets/layer-BRKnZ2f8.js similarity index 95% rename from frontend/dist/assets/layer-DnHLn7Jx.js rename to frontend/dist/assets/layer-BRKnZ2f8.js index 3ad36b98..eca86c87 100644 --- a/frontend/dist/assets/layer-DnHLn7Jx.js +++ b/frontend/dist/assets/layer-BRKnZ2f8.js @@ -1 +1 @@ -import{r as f}from"./index-CAHLMlrb.js";import{b as m,d as s}from"./BasemapLayer-VyMOdkaO.js";function g(t,e){if(!t)throw new Error(e)}let L=0;function S(t,e,a){if(t.style&&t.style._loaded){const n={...a};return delete n.id,delete n.children,t.addSource(e,n),t.getSource(e)}return null}function h(t,e,a){var i,c,d;g(e.id===a.id,"source id changed"),g(e.type===a.type,"source type changed");let n="",o=0;for(const y in e)y!=="children"&&y!=="id"&&!s(a[y],e[y])&&(n=y,o++);if(!o)return;const l=e.type;if(l==="geojson")t.setData(e.data);else if(l==="image")t.updateImage({url:e.url,coordinates:e.coordinates});else switch(n){case"coordinates":(i=t.setCoordinates)==null||i.call(t,e.coordinates);break;case"url":(c=t.setUrl)==null||c.call(t,e.url);break;case"tiles":(d=t.setTiles)==null||d.call(t,e.tiles);break;default:console.warn(`Unable to update prop: ${n}`)}}function E(t){const e=f.useContext(m).map.getMap(),a=f.useRef(t),[,n]=f.useState(0),o=f.useMemo(()=>t.id||`jsx-source-${L++}`,[]);f.useEffect(()=>{if(e){const i=()=>setTimeout(()=>n(c=>c+1),0);return e.on("styledata",i),i(),()=>{var c;if(e.off("styledata",i),e.style&&e.style._loaded&&e.getSource(o)){const d=(c=e.getStyle())==null?void 0:c.layers;if(d)for(const y of d)y.source===o&&e.removeLayer(y.id);e.removeSource(o)}}}},[e]);let l=e&&e.style&&e.getSource(o);return l?h(l,t,a.current):l=S(e,o,t),a.current=t,l&&f.Children.map(t.children,i=>i&&f.cloneElement(i,{source:o}))||null}function b(t,e,a,n){if(g(a.id===n.id,"layer id changed"),g(a.type===n.type,"layer type changed"),a.type==="custom"||n.type==="custom")return;const{layout:o={},paint:l={},filter:i,minzoom:c,maxzoom:d,beforeId:y}=a;if(y!==n.beforeId&&t.moveLayer(e,y),o!==n.layout){const u=n.layout||{};for(const r in o)s(o[r],u[r])||t.setLayoutProperty(e,r,o[r]);for(const r in u)o.hasOwnProperty(r)||t.setLayoutProperty(e,r,void 0)}if(l!==n.paint){const u=n.paint||{};for(const r in l)s(l[r],u[r])||t.setPaintProperty(e,r,l[r]);for(const r in u)l.hasOwnProperty(r)||t.setPaintProperty(e,r,void 0)}s(i,n.filter)||t.setFilter(e,i),(c!==n.minzoom||d!==n.maxzoom)&&t.setLayerZoomRange(e,c,d)}function x(t,e,a){if(t.style&&t.style._loaded&&(!("source"in a)||t.getSource(a.source))){const n={...a,id:e};delete n.beforeId,t.addLayer(n,a.beforeId)}}let k=0;function I(t){const e=f.useContext(m).map.getMap(),a=f.useRef(t),[,n]=f.useState(0),o=f.useMemo(()=>t.id||`jsx-layer-${k++}`,[]);if(f.useEffect(()=>{if(e){const i=()=>n(c=>c+1);return e.on("styledata",i),i(),()=>{e.off("styledata",i),e.style&&e.style._loaded&&e.getLayer(o)&&e.removeLayer(o)}}},[e]),e&&e.style&&e.getLayer(o))try{b(e,o,t,a.current)}catch(i){console.warn(i)}else x(e,o,t);return a.current=t,null}export{I as L,E as S}; +import{r as f}from"./index-CdntfUUz.js";import{b as m,d as s}from"./BasemapLayer-U4r1eipM.js";function g(t,e){if(!t)throw new Error(e)}let L=0;function S(t,e,a){if(t.style&&t.style._loaded){const n={...a};return delete n.id,delete n.children,t.addSource(e,n),t.getSource(e)}return null}function h(t,e,a){var i,c,d;g(e.id===a.id,"source id changed"),g(e.type===a.type,"source type changed");let n="",o=0;for(const y in e)y!=="children"&&y!=="id"&&!s(a[y],e[y])&&(n=y,o++);if(!o)return;const l=e.type;if(l==="geojson")t.setData(e.data);else if(l==="image")t.updateImage({url:e.url,coordinates:e.coordinates});else switch(n){case"coordinates":(i=t.setCoordinates)==null||i.call(t,e.coordinates);break;case"url":(c=t.setUrl)==null||c.call(t,e.url);break;case"tiles":(d=t.setTiles)==null||d.call(t,e.tiles);break;default:console.warn(`Unable to update prop: ${n}`)}}function E(t){const e=f.useContext(m).map.getMap(),a=f.useRef(t),[,n]=f.useState(0),o=f.useMemo(()=>t.id||`jsx-source-${L++}`,[]);f.useEffect(()=>{if(e){const i=()=>setTimeout(()=>n(c=>c+1),0);return e.on("styledata",i),i(),()=>{var c;if(e.off("styledata",i),e.style&&e.style._loaded&&e.getSource(o)){const d=(c=e.getStyle())==null?void 0:c.layers;if(d)for(const y of d)y.source===o&&e.removeLayer(y.id);e.removeSource(o)}}}},[e]);let l=e&&e.style&&e.getSource(o);return l?h(l,t,a.current):l=S(e,o,t),a.current=t,l&&f.Children.map(t.children,i=>i&&f.cloneElement(i,{source:o}))||null}function b(t,e,a,n){if(g(a.id===n.id,"layer id changed"),g(a.type===n.type,"layer type changed"),a.type==="custom"||n.type==="custom")return;const{layout:o={},paint:l={},filter:i,minzoom:c,maxzoom:d,beforeId:y}=a;if(y!==n.beforeId&&t.moveLayer(e,y),o!==n.layout){const u=n.layout||{};for(const r in o)s(o[r],u[r])||t.setLayoutProperty(e,r,o[r]);for(const r in u)o.hasOwnProperty(r)||t.setLayoutProperty(e,r,void 0)}if(l!==n.paint){const u=n.paint||{};for(const r in l)s(l[r],u[r])||t.setPaintProperty(e,r,l[r]);for(const r in u)l.hasOwnProperty(r)||t.setPaintProperty(e,r,void 0)}s(i,n.filter)||t.setFilter(e,i),(c!==n.minzoom||d!==n.maxzoom)&&t.setLayerZoomRange(e,c,d)}function x(t,e,a){if(t.style&&t.style._loaded&&(!("source"in a)||t.getSource(a.source))){const n={...a,id:e};delete n.beforeId,t.addLayer(n,a.beforeId)}}let k=0;function I(t){const e=f.useContext(m).map.getMap(),a=f.useRef(t),[,n]=f.useState(0),o=f.useMemo(()=>t.id||`jsx-layer-${k++}`,[]);if(f.useEffect(()=>{if(e){const i=()=>n(c=>c+1);return e.on("styledata",i),i(),()=>{e.off("styledata",i),e.style&&e.style._loaded&&e.getLayer(o)&&e.removeLayer(o)}}},[e]),e&&e.style&&e.getLayer(o))try{b(e,o,t,a.current)}catch(i){console.warn(i)}else x(e,o,t);return a.current=t,null}export{I as L,E as S}; diff --git a/frontend/dist/assets/layers-CU7un-PT.js b/frontend/dist/assets/layers-80mLD98M.js similarity index 92% rename from frontend/dist/assets/layers-CU7un-PT.js rename to frontend/dist/assets/layers-80mLD98M.js index 37b314bb..5876fbac 100644 --- a/frontend/dist/assets/layers-CU7un-PT.js +++ b/frontend/dist/assets/layers-80mLD98M.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.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-CFJjEb_I.js b/frontend/dist/assets/link-scoring-CnR8SbVy.js similarity index 94% rename from frontend/dist/assets/link-scoring-CFJjEb_I.js rename to frontend/dist/assets/link-scoring-CnR8SbVy.js index a091017d..8d004ef3 100644 --- a/frontend/dist/assets/link-scoring-CFJjEb_I.js +++ b/frontend/dist/assets/link-scoring-CnR8SbVy.js @@ -1 +1 @@ -import{gW as L,dO as y,bY as A,Y as g}from"./index-CAHLMlrb.js";function R(r){if(Array.isArray(r))return r;if(typeof r=="string"&&r.startsWith("["))try{const s=JSON.parse(r);return Array.isArray(s)?s:[]}catch{return[]}return[]}function C(r,s,x){const M=L(Array.from(s,t=>[t,t])),c=new Map,i=new Map;for(const t of r){const p=t.route??t.route_type;if(!y(p))continue;const a=R(t.original_path);if(a.length===0)continue;const o=a.map(e=>e.toUpperCase());if(!t.transmitted&&o.length>=2){const e=o[o.length-2];if(e){const n=M.get(e);n&&i.set(n,(i.get(n)??0)+1)}}if(o.some(e=>A(e,x)))for(const e of o){if(e===x)continue;const n=M.get(e);n&&c.set(n,(c.get(n)??0)+1)}}let u=0,f=0;for(const t of s)u=Math.max(u,c.get(t)??0),f=Math.max(f,i.get(t)??0);const S=new Map;let h=0,m=0,d=0;for(const t of s){const p=c.get(t)??0,a=i.get(t)??0,o=u>0?Math.round(p/u*100):0,l=f>0?Math.round(a/f*100):0,e=o+l;S.set(t,{hash:t,listenerCount:p,loudCount:a,listenerScore:o,loudScore:l,blendedScore:e}),h=Math.max(h,o),m=Math.max(m,l),d=Math.max(d,e)}return{scores:S,maxListenerScore:h,maxLoudScore:m,maxBlendedScore:d}}const O={YELLOW:g.amber,GREEN:g.green,RED:g.red,GRAY:"#505050"};export{O as L,C as c}; +import{gW as L,dO as y,bY as A,Y as g}from"./index-CdntfUUz.js";function R(r){if(Array.isArray(r))return r;if(typeof r=="string"&&r.startsWith("["))try{const s=JSON.parse(r);return Array.isArray(s)?s:[]}catch{return[]}return[]}function C(r,s,x){const M=L(Array.from(s,t=>[t,t])),c=new Map,i=new Map;for(const t of r){const p=t.route??t.route_type;if(!y(p))continue;const a=R(t.original_path);if(a.length===0)continue;const o=a.map(e=>e.toUpperCase());if(!t.transmitted&&o.length>=2){const e=o[o.length-2];if(e){const n=M.get(e);n&&i.set(n,(i.get(n)??0)+1)}}if(o.some(e=>A(e,x)))for(const e of o){if(e===x)continue;const n=M.get(e);n&&c.set(n,(c.get(n)??0)+1)}}let u=0,f=0;for(const t of s)u=Math.max(u,c.get(t)??0),f=Math.max(f,i.get(t)??0);const S=new Map;let h=0,m=0,d=0;for(const t of s){const p=c.get(t)??0,a=i.get(t)??0,o=u>0?Math.round(p/u*100):0,l=f>0?Math.round(a/f*100):0,e=o+l;S.set(t,{hash:t,listenerCount:p,loudCount:a,listenerScore:o,loudScore:l,blendedScore:e}),h=Math.max(h,o),m=Math.max(m,l),d=Math.max(d,e)}return{scores:S,maxListenerScore:h,maxLoudScore:m,maxBlendedScore:d}}const O={YELLOW:g.amber,GREEN:g.green,RED:g.red,GRAY:"#505050"};export{O as L,C as c}; diff --git a/frontend/dist/assets/listbox-DoXudQ3L.js b/frontend/dist/assets/listbox-LgRZMHBN.js similarity index 97% rename from frontend/dist/assets/listbox-DoXudQ3L.js rename to frontend/dist/assets/listbox-LgRZMHBN.js index 3bcac6ae..21372896 100644 --- a/frontend/dist/assets/listbox-DoXudQ3L.js +++ b/frontend/dist/assets/listbox-LgRZMHBN.js @@ -1 +1 @@ -import{aZ as De,fM as de,a_ as K,a$ as Se,b0 as Ne,b1 as Ae,r as f,b2 as Fe,b3 as W,b4 as _e,b5 as je,b6 as Y,b7 as w,bk as Ve,aV as F,ba as O,fN as Be,bd as ze,be as Qe,bf as Ue,bg as He,bl as Ke,bh as q,bi as $e,bm as qe,bj as Z,bw as M,bn as me,bo as Ge,bp as We,bq as se,br as Ye,bs as Ze,bt as Je,b8 as Xe,aY as et,bb as pe,fO as tt,dh as xe,bv as nt,bx as ot,by as st,bu as fe,bz as it,bB as at,bC as lt,bD as rt,bE as ut,dv as ct,dw as dt,bF as pt,bG as ft,bH as bt,bI as he,j as I,c as H,aE as vt,d as mt,m as xt,d2 as ht,a7 as gt}from"./index-CAHLMlrb.js";import{u as Ot}from"./use-by-comparator-JYMD8MzS.js";import{F as St,b as $t,y as yt,R as It,T as Et,w as wt,A as Rt}from"./floating-BAAXcOzg.js";import{p as Pt,a as ne,c as x,f as ee,b as Lt,L as kt,S as te,s as Mt,u as Ct}from"./element-movement-SAlxPSM7.js";import{s as Tt}from"./use-text-value-B1ySk7If.js";import{u as Dt}from"./frozen-TmAR4LIW.js";var Nt=Object.defineProperty,At=(e,s,t)=>s in e?Nt(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ge=(e,s,t)=>(At(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||{}),ye=(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))(ye||{});function Oe(e,s=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=Ae(s(e.options.slice()),i=>i.dataRef.current.domRef.current),o=t?n.indexOf(t):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let Ft={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let s=e.buttonElement?ne.Tracked(Lt(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(i=>n(i.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,i,u;if(e.dataRef.current.disabled||e.listboxState===1)return e;let r={...e,searchQuery:"",activationTrigger:(t=s.trigger)!=null?t:1,__demoMode:!1};if(s.focus===x.Nothing)return{...r,activeOptionIndex:null};if(s.focus===x.Specific)return{...r,activeOptionIndex:e.options.findIndex(v=>v.id===s.id)};if(s.focus===x.Previous){let v=e.activeOptionIndex;if(v!==null){let g=e.options[v].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});if(d!==null){let a=e.options[d].dataRef.current.domRef;if(((n=g.current)==null?void 0:n.previousElementSibling)===a.current||((o=a.current)==null?void 0:o.previousElementSibling)===null)return{...r,activeOptionIndex:d}}}}else if(s.focus===x.Next){let v=e.activeOptionIndex;if(v!==null){let g=e.options[v].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});if(d!==null){let a=e.options[d].dataRef.current.domRef;if(((i=g.current)==null?void 0:i.nextElementSibling)===a.current||((u=a.current)==null?void 0:u.nextElementSibling)===null)return{...r,activeOptionIndex:d}}}}let m=Oe(e),c=ee(s,{resolveItems:()=>m.options,resolveActiveIndex:()=>m.activeOptionIndex,resolveId:v=>v.id,resolveDisabled:v=>v.dataRef.current.disabled});return{...r,...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(u=>{var r;return!u.dataRef.current.disabled&&((r=u.dataRef.current.textValue)==null?void 0:r.startsWith(n))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:i,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 i=t.findIndex(u=>o==null?void 0:o(u.dataRef.current.value));i!==-1&&(n=i)}}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[i,u]of t.entries())if(o.has(u.id)&&(n.push(i),o.delete(u.id),o.size===0))break;if(n.length>0){t=t.slice();for(let i of n.reverse())t.splice(i,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,...Oe(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:ne.Moved}}};class be extends De{constructor(s){super(s),ge(this,"actions",{onChange:t=>{let{onChange:n,compare:o,mode:i,value:u}=this.state.dataRef.current;return K(i,{0:()=>n==null?void 0:n(t),1:()=>{let r=u.slice(),m=r.findIndex(c=>o(c,t));return m===-1?r.push(t):r.splice(m,1),n==null?void 0:n(r)}})},registerOption:de(()=>{let t=[],n=new Set;return[(o,i)=>{n.has(i)||(n.add(i),t.push({id:o,dataRef:i}))},()=>(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})}}),ge(this,"selectors",{activeDescendantId(t){var n;let o=t.activeOptionIndex,i=t.options;return o===null||(n=i[o])==null?void 0:n.id},isActive(t,n){var o;let i=t.activeOptionIndex,u=t.options;return i!==null?((o=u[i])==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=Se.get(null);this.disposables.add(n.on(Ne.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(Pt(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 be({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,Ft,s,t)}}const Ie=f.createContext(null);function ve(e){let s=f.useContext(Ie);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ee),t}return s}function Ee({id:e,__demoMode:s=!1}){let t=f.useMemo(()=>be.new({id:e,__demoMode:s}),[]);return Fe(()=>t.dispose()),t}let ie=f.createContext(null);ie.displayName="ListboxDataContext";function J(e){let s=f.useContext(ie);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,J),t}return s}let _t=f.Fragment;function jt(e,s){let t=f.useId(),n=at(),{value:o,defaultValue:i,form:u,name:r,onChange:m,by:c,invalid:v=!1,disabled:g=n||!1,horizontal:d=!1,multiple:a=!1,__demoMode:h=!1,...L}=e;const R=d?"horizontal":"vertical";let _=Y(s),C=lt(i),[$=a?[]:void 0,P]=rt(o,m,C),y=Ee({id:t,__demoMode:h}),j=f.useRef({static:!1,hold:!1}),z=f.useRef(new Map),T=Ot(c),Q=f.useCallback(E=>K(p.mode,{[B.Multi]:()=>$.some(G=>T(G,E)),[B.Single]:()=>T($,E)}),[$]),p=q({value:$,disabled:g,invalid:v,mode:a?B.Multi:B.Single,orientation:R,onChange:P,compare:T,isSelected:Q,optionsPropsRef:j,listRef:z});fe(()=>{y.state.dataRef.current=p},[p]);let k=w(y,E=>E.listboxState),D=Se.get(null),U=w(D,f.useCallback(E=>D.selectors.isTop(E,t),[D,t])),[N,b]=w(y,E=>[E.buttonElement,E.optionsElement]);ut(U,[N,b],(E,G)=>{y.send({type:ye.CloseListbox}),ct(G,dt.Loose)||(E.preventDefault(),N==null||N.focus())});let A=q({open:k===S.Open,disabled:g,invalid:v,value:$}),[ae,le]=pt({inherit:!0}),X={ref:_},re=f.useCallback(()=>{if(C!==void 0)return P==null?void 0:P(C)},[P,C]),ue=Z();return M.createElement(le,{value:ae,props:{htmlFor:N==null?void 0:N.id},slot:{open:k===S.Open,disabled:g}},M.createElement(Rt,null,M.createElement(Ie.Provider,{value:y},M.createElement(ie.Provider,{value:p},M.createElement(ft,{value:K(k,{[S.Open]:se.Open,[S.Closed]:se.Closed})},r!=null&&$!=null&&M.createElement(bt,{disabled:g,data:{[r]:$},form:u,onReset:re}),ue({ourProps:X,theirProps:L,slot:A,defaultTag:_t,name:"Listbox"}))))))}let Vt="button";function Bt(e,s){let t=f.useId(),n=je(),o=J("Listbox.Button"),i=ve("Listbox.Button"),{id:u=n||`headlessui-listbox-button-${t}`,disabled:r=o.disabled||!1,autoFocus:m=!1,...c}=e,v=Y(s,St(),i.actions.setButtonElement),g=$t(),[d,a,h]=w(i,b=>[b.listboxState,b.buttonElement,b.optionsElement]),L=d===S.Open;kt(L,{trigger:a,action:f.useCallback(b=>{if(a!=null&&a.contains(b.target))return te.Ignore;let A=b.target.closest('[role="option"]:not([data-disabled])');return Ve(A)?te.Select(A):h!=null&&h.contains(b.target)?te.Ignore:te.Close},[a,h]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let R=F(b=>{switch(b.key){case O.Enter:Be(b.currentTarget);break;case O.Space:case O.ArrowDown:b.preventDefault(),i.actions.openListbox({focus:o.value?x.Nothing:x.First});break;case O.ArrowUp:b.preventDefault(),i.actions.openListbox({focus:o.value?x.Nothing:x.Last});break}}),_=F(b=>{switch(b.key){case O.Space:b.preventDefault();break}}),C=Mt(b=>{var A;i.state.listboxState===S.Open?(pe.flushSync(()=>i.actions.closeListbox()),(A=i.state.buttonElement)==null||A.focus({preventScroll:!0})):(b.preventDefault(),i.actions.openListbox({focus:x.Nothing}))}),$=F(b=>b.preventDefault()),P=ze([u]),y=Qe(),{isFocusVisible:j,focusProps:z}=Ue({autoFocus:m}),{isHovered:T,hoverProps:Q}=He({isDisabled:r}),{pressed:p,pressProps:k}=Ke({disabled:r}),D=q({open:d===S.Open,active:p||d===S.Open,disabled:r,invalid:o.invalid,value:o.value,hover:T,focus:j,autofocus:m}),U=w(i,b=>b.listboxState===S.Open),N=$e(g(),{ref:v,id:u,type:qe(e,a),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":U,"aria-labelledby":P,"aria-describedby":y,disabled:r||void 0,autoFocus:m,onKeyDown:R,onKeyUp:_,onKeyPress:$},C,z,Q,k);return Z()({ourProps:N,theirProps:c,slot:D,defaultTag:Vt,name:"Listbox.Button"})}let we=f.createContext(!1),zt="div",Qt=he.RenderStrategy|he.Static;function Ut(e,s){let t=f.useId(),{id:n=`headlessui-listbox-options-${t}`,anchor:o,portal:i=!1,modal:u=!0,transition:r=!1,...m}=e,c=yt(o),[v,g]=f.useState(null);c&&(i=!0);let d=J("Listbox.Options"),a=ve("Listbox.Options"),[h,L,R,_]=w(a,l=>[l.listboxState,l.buttonElement,l.optionsElement,l.__demoMode]),C=me(L),$=me(R),P=Ge(),[y,j]=We(r,v,P!==null?(P&se.Open)===se.Open:h===S.Open);Ye(y,L,a.actions.closeListbox);let z=_?!1:u&&h===S.Open;Ze(z,$);let T=_?!1:u&&h===S.Open;Je(T,{allowed:f.useCallback(()=>[L,R],[L,R])});let Q=w(a,a.selectors.didButtonMove)?!1:y,p=w(a,a.selectors.hasFrozenValue)&&!e.static,k=Dt(p,d.value),D=f.useCallback(l=>d.compare(k,l),[d.compare,k]),U=w(a,l=>{var V;if(c==null||!((V=c==null?void 0:c.to)!=null&&V.includes("selection")))return null;let ce=l.options.findIndex(Te=>D(Te.dataRef.current.value));return ce===-1&&(ce=0),ce}),N=(()=>{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}}})(),[b,A]=It(N),ae=Et(),le=Y(s,c?b:null,a.actions.setOptionsElement,g),X=Xe();f.useEffect(()=>{let l=R;l&&h===S.Open&&(et(l)||l==null||l.focus({preventScroll:!0}))},[h,R]);let re=F(l=>{var V;switch(X.dispose(),l.key){case O.Space:if(a.state.searchQuery!=="")return l.preventDefault(),l.stopPropagation(),a.actions.search(l.key);case O.Enter:l.preventDefault(),l.stopPropagation(),a.actions.selectActiveOption();break;case K(d.orientation,{vertical:O.ArrowDown,horizontal:O.ArrowRight}):return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.Next});case K(d.orientation,{vertical:O.ArrowUp,horizontal:O.ArrowLeft}):return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.Previous});case O.Home:case O.PageUp:return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.First});case O.End:case O.PageDown:return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.Last});case O.Escape:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>a.actions.closeListbox()),(V=a.state.buttonElement)==null||V.focus({preventScroll:!0});return;case O.Tab:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>a.actions.closeListbox()),tt(a.state.buttonElement,l.shiftKey?xe.Previous:xe.Next);break;default:l.key.length===1&&(a.actions.search(l.key),X.setTimeout(()=>a.actions.clearSearch(),350));break}}),ue=w(a,l=>{var V;return(V=l.buttonElement)==null?void 0:V.id}),E=q({open:h===S.Open}),G=$e(c?ae():{},{id:n,ref:le,"aria-activedescendant":w(a,a.selectors.activeDescendantId),"aria-multiselectable":d.mode===B.Multi?!0:void 0,"aria-labelledby":ue,"aria-orientation":d.orientation,onKeyDown:re,role:"listbox",tabIndex:h===S.Open?0:void 0,style:{...m.style,...A,"--button-width":wt(y,L,!0).width},...nt(j)}),Me=Z(),Ce=f.useMemo(()=>d.mode===B.Multi?d:{...d,isSelected:D},[d,D]);return M.createElement(ot,{enabled:i?e.static||y:!1,ownerDocument:C},M.createElement(ie.Provider,{value:Ce},Me({ourProps:G,theirProps:m,slot:E,defaultTag:zt,features:Qt,visible:Q,name:"Listbox.Options"})))}let Ht="div";function Kt(e,s){let t=f.useId(),{id:n=`headlessui-listbox-option-${t}`,disabled:o=!1,value:i,...u}=e,r=f.useContext(we)===!0,m=J("Listbox.Option"),c=ve("Listbox.Option"),v=w(c,p=>c.selectors.isActive(p,n)),g=m.isSelected(i),d=f.useRef(null),a=Tt(d),h=st({disabled:o,value:i,domRef:d,get textValue(){return a()}}),L=Y(s,d,p=>{p?m.listRef.current.set(n,p):m.listRef.current.delete(n)}),R=w(c,p=>c.selectors.shouldScrollIntoView(p,n));fe(()=>{if(R)return it().requestAnimationFrame(()=>{var p,k;(k=(p=d.current)==null?void 0:p.scrollIntoView)==null||k.call(p,{block:"nearest"})})},[R,d]),fe(()=>{if(!r)return c.actions.registerOption(n,h),()=>c.actions.unregisterOption(n)},[h,n,r]);let _=F(p=>{if(o)return p.preventDefault();c.actions.selectOption(i)}),C=F(()=>{if(o)return c.actions.goToOption({focus:x.Nothing});c.actions.goToOption({focus:x.Specific,id:n})}),$=Ct(),P=F(p=>$.update(p)),y=F(p=>{$.wasMoved(p)&&(o||v&&c.state.activationTrigger===oe.Pointer||c.actions.goToOption({focus:x.Specific,id:n},oe.Pointer))}),j=F(p=>{$.wasMoved(p)&&(o||v&&c.state.activationTrigger===oe.Pointer&&c.actions.goToOption({focus:x.Nothing}))}),z=q({active:v,focus:v,selected:g,disabled:o,selectedOption:g&&r}),T=r?{}:{id:n,ref:L,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:_,onFocus:C,onPointerEnter:P,onMouseEnter:P,onPointerMove:y,onMouseMove:y,onPointerLeave:j,onMouseLeave:j},Q=Z();return!g&&r?null:Q({ourProps:T,theirProps:u,slot:z,defaultTag:Ht,name:"Listbox.Option"})}let qt=f.Fragment;function Gt(e,s){let{options:t,placeholder:n,...o}=e,i={ref:Y(s)},u=J("ListboxSelectedOption"),r=q({}),m=u.value===void 0||u.value===null||u.mode===B.Multi&&Array.isArray(u.value)&&u.value.length===0,c=Z();return M.createElement(we.Provider,{value:!0},c({ourProps:i,theirProps:{...o,children:M.createElement(M.Fragment,null,n&&m?n:t)},slot:r,defaultTag:qt,name:"ListboxSelectedOption"}))}let Wt=W(jt),Re=W(Bt),Yt=_e,Pe=W(Ut),Le=W(Kt),ke=W(Gt),Zt=Object.assign(Wt,{Button:Re,Label:Yt,Options:Pe,Option:Le,SelectedOption:ke});function sn({value:e,onChange:s,className:t,placeholder:n,disabled:o,"aria-label":i,children:u}){return I.jsx(Zt,{value:e,onChange:s,disabled:o,children:({open:r})=>I.jsxs("div",{className:H("relative",t),children:[I.jsxs(Re,{"aria-label":i,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(ke,{as:"span",options:u,placeholder:n&&I.jsx("span",{className:"text-fg-muted",children:n}),className:"block truncate"}),I.jsx(vt,{className:H("w-4 h-4 text-fg-muted transition-transform duration-200",r&&"rotate-180")})]}),I.jsx(mt,{children:r&&I.jsx(xt.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:ht.dropdown,className:"absolute z-50 mt-1",children:I.jsx(Pe,{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:u})})})]})})}function an({value:e,disabled:s,className:t,children:n}){return I.jsx(Le,{as:f.Fragment,value:e,disabled:s,children:({selected:o,focus:i})=>I.jsxs("div",{className:H("flex items-center gap-2 px-3 py-2 radius-control cursor-default","text-sm",i&&"bg-sys-blue text-white",!i&&"text-fg-primary",o&&!i&&"text-sys-blue",s&&"opacity-50 cursor-not-allowed",t),children:[I.jsx("span",{className:"w-4 flex-shrink-0",children:o&&I.jsx(gt,{className:"w-4 h-4"})}),I.jsx("span",{className:"truncate",children:n})]})})}function ln({className:e,...s}){return I.jsx("span",{...s,className:H("truncate",e)})}export{sn as L,an as a,ln as b}; +import{aZ as De,fM as de,a_ as K,a$ as Se,b0 as Ne,b1 as Ae,r as f,b2 as Fe,b3 as W,b4 as _e,b5 as je,b6 as Y,b7 as w,bk as Ve,aV as F,ba as O,fN as Be,bd as ze,be as Qe,bf as Ue,bg as He,bl as Ke,bh as q,bi as $e,bm as qe,bj as Z,bw as M,bn as me,bo as Ge,bp as We,bq as se,br as Ye,bs as Ze,bt as Je,b8 as Xe,aY as et,bb as pe,fO as tt,dh as xe,bv as nt,bx as ot,by as st,bu as fe,bz as it,bB as at,bC as lt,bD as rt,bE as ut,dv as ct,dw as dt,bF as pt,bG as ft,bH as bt,bI as he,j as I,c as H,aE as vt,d as mt,m as xt,d2 as ht,a7 as gt}from"./index-CdntfUUz.js";import{u as Ot}from"./use-by-comparator-Dgy5yCaL.js";import{F as St,b as $t,y as yt,R as It,T as Et,w as wt,A as Rt}from"./floating-B9JazpOE.js";import{p as Pt,a as ne,c as x,f as ee,b as Lt,L as kt,S as te,s as Mt,u as Ct}from"./element-movement-rOMuf_3T.js";import{s as Tt}from"./use-text-value-DFkKaUWL.js";import{u as Dt}from"./frozen-C1Yg1x_W.js";var Nt=Object.defineProperty,At=(e,s,t)=>s in e?Nt(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,ge=(e,s,t)=>(At(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||{}),ye=(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))(ye||{});function Oe(e,s=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=Ae(s(e.options.slice()),i=>i.dataRef.current.domRef.current),o=t?n.indexOf(t):null;return o===-1&&(o=null),{options:n,activeOptionIndex:o}}let Ft={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let s=e.buttonElement?ne.Tracked(Lt(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(i=>n(i.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,i,u;if(e.dataRef.current.disabled||e.listboxState===1)return e;let r={...e,searchQuery:"",activationTrigger:(t=s.trigger)!=null?t:1,__demoMode:!1};if(s.focus===x.Nothing)return{...r,activeOptionIndex:null};if(s.focus===x.Specific)return{...r,activeOptionIndex:e.options.findIndex(v=>v.id===s.id)};if(s.focus===x.Previous){let v=e.activeOptionIndex;if(v!==null){let g=e.options[v].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});if(d!==null){let a=e.options[d].dataRef.current.domRef;if(((n=g.current)==null?void 0:n.previousElementSibling)===a.current||((o=a.current)==null?void 0:o.previousElementSibling)===null)return{...r,activeOptionIndex:d}}}}else if(s.focus===x.Next){let v=e.activeOptionIndex;if(v!==null){let g=e.options[v].dataRef.current.domRef,d=ee(s,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});if(d!==null){let a=e.options[d].dataRef.current.domRef;if(((i=g.current)==null?void 0:i.nextElementSibling)===a.current||((u=a.current)==null?void 0:u.nextElementSibling)===null)return{...r,activeOptionIndex:d}}}}let m=Oe(e),c=ee(s,{resolveItems:()=>m.options,resolveActiveIndex:()=>m.activeOptionIndex,resolveId:v=>v.id,resolveDisabled:v=>v.dataRef.current.disabled});return{...r,...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(u=>{var r;return!u.dataRef.current.disabled&&((r=u.dataRef.current.textValue)==null?void 0:r.startsWith(n))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:i,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 i=t.findIndex(u=>o==null?void 0:o(u.dataRef.current.value));i!==-1&&(n=i)}}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[i,u]of t.entries())if(o.has(u.id)&&(n.push(i),o.delete(u.id),o.size===0))break;if(n.length>0){t=t.slice();for(let i of n.reverse())t.splice(i,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,...Oe(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind!=="Tracked"?e:{...e,buttonPositionState:ne.Moved}}};class be extends De{constructor(s){super(s),ge(this,"actions",{onChange:t=>{let{onChange:n,compare:o,mode:i,value:u}=this.state.dataRef.current;return K(i,{0:()=>n==null?void 0:n(t),1:()=>{let r=u.slice(),m=r.findIndex(c=>o(c,t));return m===-1?r.push(t):r.splice(m,1),n==null?void 0:n(r)}})},registerOption:de(()=>{let t=[],n=new Set;return[(o,i)=>{n.has(i)||(n.add(i),t.push({id:o,dataRef:i}))},()=>(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})}}),ge(this,"selectors",{activeDescendantId(t){var n;let o=t.activeOptionIndex,i=t.options;return o===null||(n=i[o])==null?void 0:n.id},isActive(t,n){var o;let i=t.activeOptionIndex,u=t.options;return i!==null?((o=u[i])==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=Se.get(null);this.disposables.add(n.on(Ne.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(Pt(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 be({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,Ft,s,t)}}const Ie=f.createContext(null);function ve(e){let s=f.useContext(Ie);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ee),t}return s}function Ee({id:e,__demoMode:s=!1}){let t=f.useMemo(()=>be.new({id:e,__demoMode:s}),[]);return Fe(()=>t.dispose()),t}let ie=f.createContext(null);ie.displayName="ListboxDataContext";function J(e){let s=f.useContext(ie);if(s===null){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,J),t}return s}let _t=f.Fragment;function jt(e,s){let t=f.useId(),n=at(),{value:o,defaultValue:i,form:u,name:r,onChange:m,by:c,invalid:v=!1,disabled:g=n||!1,horizontal:d=!1,multiple:a=!1,__demoMode:h=!1,...L}=e;const R=d?"horizontal":"vertical";let _=Y(s),C=lt(i),[$=a?[]:void 0,P]=rt(o,m,C),y=Ee({id:t,__demoMode:h}),j=f.useRef({static:!1,hold:!1}),z=f.useRef(new Map),T=Ot(c),Q=f.useCallback(E=>K(p.mode,{[B.Multi]:()=>$.some(G=>T(G,E)),[B.Single]:()=>T($,E)}),[$]),p=q({value:$,disabled:g,invalid:v,mode:a?B.Multi:B.Single,orientation:R,onChange:P,compare:T,isSelected:Q,optionsPropsRef:j,listRef:z});fe(()=>{y.state.dataRef.current=p},[p]);let k=w(y,E=>E.listboxState),D=Se.get(null),U=w(D,f.useCallback(E=>D.selectors.isTop(E,t),[D,t])),[N,b]=w(y,E=>[E.buttonElement,E.optionsElement]);ut(U,[N,b],(E,G)=>{y.send({type:ye.CloseListbox}),ct(G,dt.Loose)||(E.preventDefault(),N==null||N.focus())});let A=q({open:k===S.Open,disabled:g,invalid:v,value:$}),[ae,le]=pt({inherit:!0}),X={ref:_},re=f.useCallback(()=>{if(C!==void 0)return P==null?void 0:P(C)},[P,C]),ue=Z();return M.createElement(le,{value:ae,props:{htmlFor:N==null?void 0:N.id},slot:{open:k===S.Open,disabled:g}},M.createElement(Rt,null,M.createElement(Ie.Provider,{value:y},M.createElement(ie.Provider,{value:p},M.createElement(ft,{value:K(k,{[S.Open]:se.Open,[S.Closed]:se.Closed})},r!=null&&$!=null&&M.createElement(bt,{disabled:g,data:{[r]:$},form:u,onReset:re}),ue({ourProps:X,theirProps:L,slot:A,defaultTag:_t,name:"Listbox"}))))))}let Vt="button";function Bt(e,s){let t=f.useId(),n=je(),o=J("Listbox.Button"),i=ve("Listbox.Button"),{id:u=n||`headlessui-listbox-button-${t}`,disabled:r=o.disabled||!1,autoFocus:m=!1,...c}=e,v=Y(s,St(),i.actions.setButtonElement),g=$t(),[d,a,h]=w(i,b=>[b.listboxState,b.buttonElement,b.optionsElement]),L=d===S.Open;kt(L,{trigger:a,action:f.useCallback(b=>{if(a!=null&&a.contains(b.target))return te.Ignore;let A=b.target.closest('[role="option"]:not([data-disabled])');return Ve(A)?te.Select(A):h!=null&&h.contains(b.target)?te.Ignore:te.Close},[a,h]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let R=F(b=>{switch(b.key){case O.Enter:Be(b.currentTarget);break;case O.Space:case O.ArrowDown:b.preventDefault(),i.actions.openListbox({focus:o.value?x.Nothing:x.First});break;case O.ArrowUp:b.preventDefault(),i.actions.openListbox({focus:o.value?x.Nothing:x.Last});break}}),_=F(b=>{switch(b.key){case O.Space:b.preventDefault();break}}),C=Mt(b=>{var A;i.state.listboxState===S.Open?(pe.flushSync(()=>i.actions.closeListbox()),(A=i.state.buttonElement)==null||A.focus({preventScroll:!0})):(b.preventDefault(),i.actions.openListbox({focus:x.Nothing}))}),$=F(b=>b.preventDefault()),P=ze([u]),y=Qe(),{isFocusVisible:j,focusProps:z}=Ue({autoFocus:m}),{isHovered:T,hoverProps:Q}=He({isDisabled:r}),{pressed:p,pressProps:k}=Ke({disabled:r}),D=q({open:d===S.Open,active:p||d===S.Open,disabled:r,invalid:o.invalid,value:o.value,hover:T,focus:j,autofocus:m}),U=w(i,b=>b.listboxState===S.Open),N=$e(g(),{ref:v,id:u,type:qe(e,a),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":U,"aria-labelledby":P,"aria-describedby":y,disabled:r||void 0,autoFocus:m,onKeyDown:R,onKeyUp:_,onKeyPress:$},C,z,Q,k);return Z()({ourProps:N,theirProps:c,slot:D,defaultTag:Vt,name:"Listbox.Button"})}let we=f.createContext(!1),zt="div",Qt=he.RenderStrategy|he.Static;function Ut(e,s){let t=f.useId(),{id:n=`headlessui-listbox-options-${t}`,anchor:o,portal:i=!1,modal:u=!0,transition:r=!1,...m}=e,c=yt(o),[v,g]=f.useState(null);c&&(i=!0);let d=J("Listbox.Options"),a=ve("Listbox.Options"),[h,L,R,_]=w(a,l=>[l.listboxState,l.buttonElement,l.optionsElement,l.__demoMode]),C=me(L),$=me(R),P=Ge(),[y,j]=We(r,v,P!==null?(P&se.Open)===se.Open:h===S.Open);Ye(y,L,a.actions.closeListbox);let z=_?!1:u&&h===S.Open;Ze(z,$);let T=_?!1:u&&h===S.Open;Je(T,{allowed:f.useCallback(()=>[L,R],[L,R])});let Q=w(a,a.selectors.didButtonMove)?!1:y,p=w(a,a.selectors.hasFrozenValue)&&!e.static,k=Dt(p,d.value),D=f.useCallback(l=>d.compare(k,l),[d.compare,k]),U=w(a,l=>{var V;if(c==null||!((V=c==null?void 0:c.to)!=null&&V.includes("selection")))return null;let ce=l.options.findIndex(Te=>D(Te.dataRef.current.value));return ce===-1&&(ce=0),ce}),N=(()=>{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}}})(),[b,A]=It(N),ae=Et(),le=Y(s,c?b:null,a.actions.setOptionsElement,g),X=Xe();f.useEffect(()=>{let l=R;l&&h===S.Open&&(et(l)||l==null||l.focus({preventScroll:!0}))},[h,R]);let re=F(l=>{var V;switch(X.dispose(),l.key){case O.Space:if(a.state.searchQuery!=="")return l.preventDefault(),l.stopPropagation(),a.actions.search(l.key);case O.Enter:l.preventDefault(),l.stopPropagation(),a.actions.selectActiveOption();break;case K(d.orientation,{vertical:O.ArrowDown,horizontal:O.ArrowRight}):return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.Next});case K(d.orientation,{vertical:O.ArrowUp,horizontal:O.ArrowLeft}):return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.Previous});case O.Home:case O.PageUp:return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.First});case O.End:case O.PageDown:return l.preventDefault(),l.stopPropagation(),a.actions.goToOption({focus:x.Last});case O.Escape:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>a.actions.closeListbox()),(V=a.state.buttonElement)==null||V.focus({preventScroll:!0});return;case O.Tab:l.preventDefault(),l.stopPropagation(),pe.flushSync(()=>a.actions.closeListbox()),tt(a.state.buttonElement,l.shiftKey?xe.Previous:xe.Next);break;default:l.key.length===1&&(a.actions.search(l.key),X.setTimeout(()=>a.actions.clearSearch(),350));break}}),ue=w(a,l=>{var V;return(V=l.buttonElement)==null?void 0:V.id}),E=q({open:h===S.Open}),G=$e(c?ae():{},{id:n,ref:le,"aria-activedescendant":w(a,a.selectors.activeDescendantId),"aria-multiselectable":d.mode===B.Multi?!0:void 0,"aria-labelledby":ue,"aria-orientation":d.orientation,onKeyDown:re,role:"listbox",tabIndex:h===S.Open?0:void 0,style:{...m.style,...A,"--button-width":wt(y,L,!0).width},...nt(j)}),Me=Z(),Ce=f.useMemo(()=>d.mode===B.Multi?d:{...d,isSelected:D},[d,D]);return M.createElement(ot,{enabled:i?e.static||y:!1,ownerDocument:C},M.createElement(ie.Provider,{value:Ce},Me({ourProps:G,theirProps:m,slot:E,defaultTag:zt,features:Qt,visible:Q,name:"Listbox.Options"})))}let Ht="div";function Kt(e,s){let t=f.useId(),{id:n=`headlessui-listbox-option-${t}`,disabled:o=!1,value:i,...u}=e,r=f.useContext(we)===!0,m=J("Listbox.Option"),c=ve("Listbox.Option"),v=w(c,p=>c.selectors.isActive(p,n)),g=m.isSelected(i),d=f.useRef(null),a=Tt(d),h=st({disabled:o,value:i,domRef:d,get textValue(){return a()}}),L=Y(s,d,p=>{p?m.listRef.current.set(n,p):m.listRef.current.delete(n)}),R=w(c,p=>c.selectors.shouldScrollIntoView(p,n));fe(()=>{if(R)return it().requestAnimationFrame(()=>{var p,k;(k=(p=d.current)==null?void 0:p.scrollIntoView)==null||k.call(p,{block:"nearest"})})},[R,d]),fe(()=>{if(!r)return c.actions.registerOption(n,h),()=>c.actions.unregisterOption(n)},[h,n,r]);let _=F(p=>{if(o)return p.preventDefault();c.actions.selectOption(i)}),C=F(()=>{if(o)return c.actions.goToOption({focus:x.Nothing});c.actions.goToOption({focus:x.Specific,id:n})}),$=Ct(),P=F(p=>$.update(p)),y=F(p=>{$.wasMoved(p)&&(o||v&&c.state.activationTrigger===oe.Pointer||c.actions.goToOption({focus:x.Specific,id:n},oe.Pointer))}),j=F(p=>{$.wasMoved(p)&&(o||v&&c.state.activationTrigger===oe.Pointer&&c.actions.goToOption({focus:x.Nothing}))}),z=q({active:v,focus:v,selected:g,disabled:o,selectedOption:g&&r}),T=r?{}:{id:n,ref:L,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:_,onFocus:C,onPointerEnter:P,onMouseEnter:P,onPointerMove:y,onMouseMove:y,onPointerLeave:j,onMouseLeave:j},Q=Z();return!g&&r?null:Q({ourProps:T,theirProps:u,slot:z,defaultTag:Ht,name:"Listbox.Option"})}let qt=f.Fragment;function Gt(e,s){let{options:t,placeholder:n,...o}=e,i={ref:Y(s)},u=J("ListboxSelectedOption"),r=q({}),m=u.value===void 0||u.value===null||u.mode===B.Multi&&Array.isArray(u.value)&&u.value.length===0,c=Z();return M.createElement(we.Provider,{value:!0},c({ourProps:i,theirProps:{...o,children:M.createElement(M.Fragment,null,n&&m?n:t)},slot:r,defaultTag:qt,name:"ListboxSelectedOption"}))}let Wt=W(jt),Re=W(Bt),Yt=_e,Pe=W(Ut),Le=W(Kt),ke=W(Gt),Zt=Object.assign(Wt,{Button:Re,Label:Yt,Options:Pe,Option:Le,SelectedOption:ke});function sn({value:e,onChange:s,className:t,placeholder:n,disabled:o,"aria-label":i,children:u}){return I.jsx(Zt,{value:e,onChange:s,disabled:o,children:({open:r})=>I.jsxs("div",{className:H("relative",t),children:[I.jsxs(Re,{"aria-label":i,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(ke,{as:"span",options:u,placeholder:n&&I.jsx("span",{className:"text-fg-muted",children:n}),className:"block truncate"}),I.jsx(vt,{className:H("w-4 h-4 text-fg-muted transition-transform duration-200",r&&"rotate-180")})]}),I.jsx(mt,{children:r&&I.jsx(xt.div,{initial:{opacity:0,y:-4,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-4,scale:.98},transition:ht.dropdown,className:"absolute z-50 mt-1",children:I.jsx(Pe,{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:u})})})]})})}function an({value:e,disabled:s,className:t,children:n}){return I.jsx(Le,{as:f.Fragment,value:e,disabled:s,children:({selected:o,focus:i})=>I.jsxs("div",{className:H("flex items-center gap-2 px-3 py-2 radius-control cursor-default","text-sm",i&&"bg-sys-blue text-white",!i&&"text-fg-primary",o&&!i&&"text-sys-blue",s&&"opacity-50 cursor-not-allowed",t),children:[I.jsx("span",{className:"w-4 flex-shrink-0",children:o&&I.jsx(gt,{className:"w-4 h-4"})}),I.jsx("span",{className:"truncate",children:n})]})})}function ln({className:e,...s}){return I.jsx("span",{...s,className:H("truncate",e)})}export{sn as L,an as a,ln as b}; diff --git a/frontend/dist/assets/maintenance-C2rIkwgy.js b/frontend/dist/assets/maintenance-DDkOUzHo.js similarity index 90% rename from frontend/dist/assets/maintenance-C2rIkwgy.js rename to frontend/dist/assets/maintenance-DDkOUzHo.js index 11082a2d..2bd4a8ab 100644 --- a/frontend/dist/assets/maintenance-C2rIkwgy.js +++ b/frontend/dist/assets/maintenance-DDkOUzHo.js @@ -1 +1 @@ -import{dy as t}from"./index-CAHLMlrb.js";async function r(){return t("/api/db_stats")}async function a(n){return t("/api/db_purge",{method:"POST",body:JSON.stringify({tables:n})})}async function u(){return t("/api/db_vacuum",{method:"POST",body:"{}"})}async function s(){return t("/api/memory_debug")}async function o(n={}){return t("/api/memory_debug",{method:"POST",body:JSON.stringify(n)})}async function i(){return t("/api/mqtt_status")}async function c(){return t("/api/broker_presets")}async function y(n){return t("/api/update_mqtt_config",{method:"POST",body:JSON.stringify(n)})}export{i as a,r as b,s as c,c as g,a as p,o as r,y as u,u as v}; +import{dy as t}from"./index-CdntfUUz.js";async function r(){return t("/api/db_stats")}async function a(n){return t("/api/db_purge",{method:"POST",body:JSON.stringify({tables:n})})}async function u(){return t("/api/db_vacuum",{method:"POST",body:"{}"})}async function s(){return t("/api/memory_debug")}async function o(n={}){return t("/api/memory_debug",{method:"POST",body:JSON.stringify(n)})}async function i(){return t("/api/mqtt_status")}async function c(){return t("/api/broker_presets")}async function y(n){return t("/api/update_mqtt_config",{method:"POST",body:JSON.stringify(n)})}export{i as a,r as b,s as c,c as g,a as p,o as r,y as u,u as v}; diff --git a/frontend/dist/assets/map-pin-CNePTCsc.js b/frontend/dist/assets/map-pin-ADTzwr8W.js similarity index 89% rename from frontend/dist/assets/map-pin-CNePTCsc.js rename to frontend/dist/assets/map-pin-ADTzwr8W.js index fbe2567b..3d5bd67f 100644 --- a/frontend/dist/assets/map-pin-CNePTCsc.js +++ b/frontend/dist/assets/map-pin-ADTzwr8W.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/map-pin-off-Dtf3D6QW.js b/frontend/dist/assets/map-pin-off-DdXFAKLD.js similarity index 93% rename from frontend/dist/assets/map-pin-off-Dtf3D6QW.js rename to frontend/dist/assets/map-pin-off-DdXFAKLD.js index 9b33df3e..b6526b85 100644 --- a/frontend/dist/assets/map-pin-off-Dtf3D6QW.js +++ b/frontend/dist/assets/map-pin-off-DdXFAKLD.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/maplibre-gl-BkYzjH9W.js b/frontend/dist/assets/maplibre-gl-ECl9hv9h.js similarity index 99% rename from frontend/dist/assets/maplibre-gl-BkYzjH9W.js rename to frontend/dist/assets/maplibre-gl-ECl9hv9h.js index 12ecb6f1..5c304060 100644 --- a/frontend/dist/assets/maplibre-gl-BkYzjH9W.js +++ b/frontend/dist/assets/maplibre-gl-ECl9hv9h.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{hD as Rg}from"./index-CAHLMlrb.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{hD as Rg}from"./index-CdntfUUz.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;u0)n=e._traceSnrPath;else if(e.raw_packet){const r=s(e.raw_packet,a);r&&r.length>0&&(n=r)}return c(t,n)}catch{return null}}function N(e){if((e.payload_type??e.type)!==o.ADVERT||!e.payload)return null;try{const t=d(e.payload),n=y(t);if(!n)return null;const r=n.publicKey.slice(0,2).toUpperCase(),l={...n,prefix:r};let u=null;return n.latitude&&n.longitude&&(u={latitude:n.latitude,longitude:n.longitude,name:n.name||`Node ${r||"??"}`,prefix:r,publicKey:n.publicKey}),{data:l,sourceNode:u}}catch{return null}}function i(e){if(!e)return null;const a=e.trim(),t=/(-?\d+\.?\d*)\s*[,\s]\s*(-?\d+\.?\d*)/,n=a.match(t);if(!n)return null;const r=parseFloat(n[1]),l=parseFloat(n[2]);return isNaN(r)||isNaN(l)||r<-90||r>90||l<-180||l>180||r===0&&l===0?null:{lat:r,lon:l}}function T(e){var t,n;if(!e.decrypted||!((t=e.channelName)!=null&&t.toLowerCase().includes("wardrive")))return null;const a=i(e.text);return a?{latitude:a.lat,longitude:a.lon,name:e.senderName||"Wardrive Ping",prefix:((n=e.senderName)==null?void 0:n.slice(0,2).toUpperCase())||"WD",nodeType:"wardrive"}:null}function C(e,a){const t=e.payload_type??e.type;if(t===o.TRACE){const n=h(e);if(n)return{kind:"trace",data:n,snrValues:n.snrValues}}if(t===o.ADVERT){const n=N(e);if(n)return{kind:"advert",data:n.data,sourceNode:n.sourceNode}}if(t===o.GRP_TXT&&a){const n=i(a.text),r=T(a);return{kind:"grp_txt",decoded:a,wardriveCoords:n,wardriveSourceNode:r}}if(t===o.CONTROL){const n=_(e);if(n)return{kind:"control",data:n}}if(t===o.ANON_REQ){const n=R(e);if(n)return{kind:"anon_req",data:n}}return{kind:"generic"}}function _(e){if((e.payload_type??e.type)!==o.CONTROL||!e.payload)return null;try{const t=d(e.payload);return f(t)}catch{return null}}function R(e){if((e.payload_type??e.type)!==o.ANON_REQ||!e.payload)return null;try{const t=d(e.payload),n=p(t);if(!n)return null;const r=n.senderPublicKey.slice(0,2).toUpperCase();return{...n,prefix:r}}catch{return null}}export{h as a,C as d,i as p}; +import{c7 as o,cc as d,fu as s,ft as c,hf as y,hg as f,hh as p}from"./index-CdntfUUz.js";function h(e){const a=e.payload_type??e.type;if(a!==o.TRACE||!e.payload)return null;try{const t=d(e.payload);let n=[];if(e._traceSnrPath!=null&&e._traceSnrPath.length>0)n=e._traceSnrPath;else if(e.raw_packet){const r=s(e.raw_packet,a);r&&r.length>0&&(n=r)}return c(t,n)}catch{return null}}function N(e){if((e.payload_type??e.type)!==o.ADVERT||!e.payload)return null;try{const t=d(e.payload),n=y(t);if(!n)return null;const r=n.publicKey.slice(0,2).toUpperCase(),l={...n,prefix:r};let u=null;return n.latitude&&n.longitude&&(u={latitude:n.latitude,longitude:n.longitude,name:n.name||`Node ${r||"??"}`,prefix:r,publicKey:n.publicKey}),{data:l,sourceNode:u}}catch{return null}}function i(e){if(!e)return null;const a=e.trim(),t=/(-?\d+\.?\d*)\s*[,\s]\s*(-?\d+\.?\d*)/,n=a.match(t);if(!n)return null;const r=parseFloat(n[1]),l=parseFloat(n[2]);return isNaN(r)||isNaN(l)||r<-90||r>90||l<-180||l>180||r===0&&l===0?null:{lat:r,lon:l}}function T(e){var t,n;if(!e.decrypted||!((t=e.channelName)!=null&&t.toLowerCase().includes("wardrive")))return null;const a=i(e.text);return a?{latitude:a.lat,longitude:a.lon,name:e.senderName||"Wardrive Ping",prefix:((n=e.senderName)==null?void 0:n.slice(0,2).toUpperCase())||"WD",nodeType:"wardrive"}:null}function C(e,a){const t=e.payload_type??e.type;if(t===o.TRACE){const n=h(e);if(n)return{kind:"trace",data:n,snrValues:n.snrValues}}if(t===o.ADVERT){const n=N(e);if(n)return{kind:"advert",data:n.data,sourceNode:n.sourceNode}}if(t===o.GRP_TXT&&a){const n=i(a.text),r=T(a);return{kind:"grp_txt",decoded:a,wardriveCoords:n,wardriveSourceNode:r}}if(t===o.CONTROL){const n=_(e);if(n)return{kind:"control",data:n}}if(t===o.ANON_REQ){const n=R(e);if(n)return{kind:"anon_req",data:n}}return{kind:"generic"}}function _(e){if((e.payload_type??e.type)!==o.CONTROL||!e.payload)return null;try{const t=d(e.payload);return f(t)}catch{return null}}function R(e){if((e.payload_type??e.type)!==o.ANON_REQ||!e.payload)return null;try{const t=d(e.payload),n=p(t);if(!n)return null;const r=n.senderPublicKey.slice(0,2).toUpperCase();return{...n,prefix:r}}catch{return null}}export{h as a,C as d,i as p}; diff --git a/frontend/dist/assets/pencil--wb87xjW.js b/frontend/dist/assets/pencil-DwKQKROy.js similarity index 90% rename from frontend/dist/assets/pencil--wb87xjW.js rename to frontend/dist/assets/pencil-DwKQKROy.js index 2b25c273..e91b0e70 100644 --- a/frontend/dist/assets/pencil--wb87xjW.js +++ b/frontend/dist/assets/pencil-DwKQKROy.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/ping-Chyw2B4c.js b/frontend/dist/assets/ping-D6oK6s8c.js similarity index 95% rename from frontend/dist/assets/ping-Chyw2B4c.js rename to frontend/dist/assets/ping-D6oK6s8c.js index f5133c51..3e429c8a 100644 --- a/frontend/dist/assets/ping-Chyw2B4c.js +++ b/frontend/dist/assets/ping-D6oK6s8c.js @@ -1 +1 @@ -import{dy as f}from"./index-CAHLMlrb.js";async function p(s,r=10){const t=await f("/api/ping_neighbor",{method:"POST",body:JSON.stringify({target_id:s,timeout:r})});if(!t.success||!t.data||t.data.rssi!==0)return t;const o=Math.min(r,10),a=await f("/api/ping_neighbor",{method:"POST",body:JSON.stringify({target_id:s,timeout:o})});return a.success&&a.data&&a.data.rssi!==0?a:{success:!1,error:"No response"}}const y=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];async function h(s,r=1){const t=s.toLowerCase(),o=r*2;for(const a of y)try{const e=await f(`/api/adverts_by_contact_type?contact_type=${encodeURIComponent(a)}&hours=168`),c=e.success&&e.data?e.data:e,n=(Array.isArray(c)?c:[]).find(i=>i.node_name&&i.node_name.toLowerCase()===t);if(n&&n.pubkey)return`0x${n.pubkey.substring(0,o)}`}catch{continue}return null}function m(s){return s.rssi!==0}function _(s){return m(s)?s.rtt_ms>500||s.rssi<-120?"Poor":s.rtt_ms>250||s.rssi<-100?"Fair":s.rtt_ms>100||s.rssi<-80?"Good":"Excellent":"None"}async function l(s,r=10,t=1){if(r<1||r>60)return{success:!1,error:"Timeout must be 1-60 seconds"};let o;const a=t*2,e=s.match(/^0x([0-9a-fA-F]{1,6})$/i),c=e?null:s.match(/^([0-9a-fA-F]{1,2})$/),d=(e==null?void 0:e[1])??(c==null?void 0:c[1]);if(d)o=`0x${d.padStart(a,"0")}`;else{const u=await h(s,t);if(!u)return{success:!1,error:`Node '${s}' not found`};o=u}const n=await p(o,r);if(!n.success||!n.data)return{success:!1,error:n.error||"Ping failed"};const i=_(n.data);return{success:!0,data:{...n.data,quality:i}}}export{l as a,m as h,p}; +import{dy as f}from"./index-CdntfUUz.js";async function p(s,r=10){const t=await f("/api/ping_neighbor",{method:"POST",body:JSON.stringify({target_id:s,timeout:r})});if(!t.success||!t.data||t.data.rssi!==0)return t;const o=Math.min(r,10),a=await f("/api/ping_neighbor",{method:"POST",body:JSON.stringify({target_id:s,timeout:o})});return a.success&&a.data&&a.data.rssi!==0?a:{success:!1,error:"No response"}}const y=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];async function h(s,r=1){const t=s.toLowerCase(),o=r*2;for(const a of y)try{const e=await f(`/api/adverts_by_contact_type?contact_type=${encodeURIComponent(a)}&hours=168`),c=e.success&&e.data?e.data:e,n=(Array.isArray(c)?c:[]).find(i=>i.node_name&&i.node_name.toLowerCase()===t);if(n&&n.pubkey)return`0x${n.pubkey.substring(0,o)}`}catch{continue}return null}function m(s){return s.rssi!==0}function _(s){return m(s)?s.rtt_ms>500||s.rssi<-120?"Poor":s.rtt_ms>250||s.rssi<-100?"Fair":s.rtt_ms>100||s.rssi<-80?"Good":"Excellent":"None"}async function l(s,r=10,t=1){if(r<1||r>60)return{success:!1,error:"Timeout must be 1-60 seconds"};let o;const a=t*2,e=s.match(/^0x([0-9a-fA-F]{1,6})$/i),c=e?null:s.match(/^([0-9a-fA-F]{1,2})$/),d=(e==null?void 0:e[1])??(c==null?void 0:c[1]);if(d)o=`0x${d.padStart(a,"0")}`;else{const u=await h(s,t);if(!u)return{success:!1,error:`Node '${s}' not found`};o=u}const n=await p(o,r);if(!n.success||!n.data)return{success:!1,error:n.error||"Ping failed"};const i=_(n.data);return{success:!0,data:{...n.data,quality:i}}}export{l as a,m as h,p}; diff --git a/frontend/dist/assets/plus-Be4DsW2a.js b/frontend/dist/assets/plus-BHawoJ76.js similarity index 87% rename from frontend/dist/assets/plus-Be4DsW2a.js rename to frontend/dist/assets/plus-BHawoJ76.js index 3a9ae103..f0683f1c 100644 --- a/frontend/dist/assets/plus-Be4DsW2a.js +++ b/frontend/dist/assets/plus-BHawoJ76.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/primitives-B7bSO4E3.js b/frontend/dist/assets/primitives-Bl26dfm-.js similarity index 99% rename from frontend/dist/assets/primitives-B7bSO4E3.js rename to frontend/dist/assets/primitives-Bl26dfm-.js index 80765745..3ccb4d92 100644 --- a/frontend/dist/assets/primitives-B7bSO4E3.js +++ b/frontend/dist/assets/primitives-Bl26dfm-.js @@ -1 +1 @@ -import{bW as P,eo as v,bS as $,bR as w,cc as z,ft as B,fu as M,j as r,r as h,fd as O,fe as V,ff as D}from"./index-CAHLMlrb.js";function _(t){const e=t&3,s=t>>2&15,n=t>>6&3;return[{bits:"0-1",field:"Route Type",value:$(e),binary:(e&3).toString(2).padStart(2,"0")},{bits:"2-5",field:"Payload Type",value:w(s),binary:(s&15).toString(2).padStart(4,"0")},{bits:"6-7",field:"Version",value:n.toString(),binary:(n&3).toString(2).padStart(2,"0")}]}function U(t){if(!t||t.length<4)return null;const e=P.fromHex(t);if(!e.success||!e.packet)return null;const s=e.packet,n=_(s.header),o=t.slice(0,2);let a=2,i="";s.hasTransportCodes()&&(i=t.slice(2,10),a=10);const l=t.slice(a,a+2),d=a+2,x=d+s.pathLen*2,f=t.slice(d,x),p=t.slice(x),m=v(s),c=Math.floor(a/2),u=Math.floor(d/2);return{packet:s,headerHex:o,headerFields:n,transportCodesHex:i,pathLengthHex:l,pathDataHex:f,payloadHex:p,pathLenByteOffset:c,pathByteOffset:u,payloadStartByte:Math.floor(x/2),decoded:m}}function F(t){if(!t||t.length<8)return null;const e=parseInt(t.slice(0,2),16),s=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16),o=parseInt(t.slice(6,8),16);return isNaN(e)||isNaN(s)||isNaN(n)||isNaN(o)?null:((e|s<<8|n<<16|o<<24)>>>0).toString(16).toUpperCase().padStart(8,"0")}function R(t){return t>=10?"excellent":t>=5?"good":t>=0?"fair":t>=-5?"poor":"critical"}function L(t){if(t._traceSnrPath!=null&&t._traceSnrPath.length>0)return t._traceSnrPath;if(t.raw_packet){const e=t.payload_type??t.type,s=M(t.raw_packet,e);if(s&&s.length>0)return s}return[]}function E(t){if(!t.payload)return null;try{const e=z(t.payload),s=L(t),n=B(e,s);return n?{packet:t,decoded:n,timestamp:t.timestamp??0,hopCount:n.snrValues.length,rssi:t.rssi,snr:t.snr}:null}catch{return null}}function I(t){const e=new Map;for(const s of t){const n=E(s);if(!n)continue;const o=n.decoded.traceTag,a=e.get(o)||[];a.push(n),e.set(o,a)}for(const[s,n]of e)n.sort((o,a)=>o.timestamp-a.timestamp),e.set(s,n);return e}function Q(t,e){if(e.length===0)return{traceTag:t,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 s=[...e].sort((c,u)=>c.timestamp-u.timestamp),n=s.reduce((c,u)=>u.hopCount>c.hopCount?u:c,s[0]),o=s[0].timestamp,a=s[s.length-1].timestamp,i=n.decoded.pathHashes,l=i.length,d=n.hopCount,x=n.decoded.isComplete,f=[],p=n.decoded.snrValues;for(let c=0;c0){const c=Math.min(...p),u=Math.max(...p),j=p.reduce((C,T)=>C+T,0)/p.length,S=p.indexOf(c),k=p.indexOf(u);m={minSnr:c,maxSnr:u,avgSnr:j,weakestLinkPosition:S,strongestLinkPosition:k}}return{traceTag:t,traceTagValue:n.decoded.traceTagValue,targetPath:i,targetHopCount:l,observations:s,observationCount:s.length,firstSeen:o,lastSeen:a,duration:a-o,isComplete:x,maxHopsObserved:d,progressPercent:l>0?Math.round(d/l*100):0,bestObservation:n,hopStats:f,linkQuality:m,srcHash:n.packet.src_hash,dstHash:n.packet.dst_hash}}const g={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(g).map(([t,e])=>[t,e.text]));const b=h.createContext("");function W({prefix:t,children:e}){return r.jsx(b.Provider,{value:t,children:e})}function N(){return h.useContext(b)}function A({children:t,color:e="zinc"}){var s;return r.jsx("span",{className:`inline-flex items-center px-1.5 py-px rounded-full text-[9px] font-mono font-medium leading-tight ${((s=g[e])==null?void 0:s.chip)??g.zinc.chip}`,children:t})}function K({fn:t,value:e,color:s="zinc"}){var a;const n=N(),o=n?`${n}(${t})`:t;return r.jsxs("span",{title:o,className:"inline-flex items-baseline gap-0 font-mono",children:[r.jsx("span",{className:"text-fg-muted/40",children:t}),r.jsx("span",{className:"text-fg-muted/20",children:"("}),e?r.jsx("span",{className:((a=g[s])==null?void 0:a.text)??g.zinc.text,children:e}):r.jsx("span",{className:"text-fg-muted/20",children:"·"}),r.jsx("span",{className:"text-fg-muted/20",children:")"})]})}function q({label:t,children:e,mono:s=!0,padY:n=!1}){const o=N(),a=t.trim(),i=o?`${o}(${a})`:a;return r.jsxs("div",{className:`flex items-center gap-2 ${n?"py-1":"py-0.5"}`,children:[r.jsx("dt",{className:"text-fg-muted shrink-0 w-28 text-right",children:t}),r.jsx("dd",{title:i,className:s?"text-fg-primary break-all":"text-fg-primary",children:e})]})}function G({value:t,className:e}){const s=typeof t=="number"?`0x${t.toString(16).toUpperCase().padStart(2,"0")}`:t.startsWith("0x")?t:`0x${t}`;return r.jsx("span",{className:e??"text-sys-blue",children:s})}function Y({value:t}){const e=typeof t=="number"?t.toString(16).toUpperCase().padStart(2,"0"):t.replace(/^0x/i,"").toUpperCase();return r.jsxs("span",{className:"px-1 py-px rounded bg-zinc-500/15 text-fg-secondary font-mono text-[11px]",children:["0x",e]})}function J({value:t}){return r.jsx("span",{className:"px-1 py-px rounded bg-zinc-500/10 text-fg-muted font-mono text-[10px]",children:t.toString(2).padStart(8,"0")})}function X({raw:t,children:e}){return r.jsxs("span",{className:"inline-flex items-center gap-1.5 flex-wrap",children:[r.jsx("span",{className:"font-mono text-fg-muted",children:t}),r.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),e]})}const y={blue:"text-sys-blue",amber:"text-sys-amber",green:"text-sys-green",teal:"text-sys-teal",purple:"text-sys-purple"};function Z({hops:t,hexPrefix:e,color:s="amber"}){if(t.length===0)return r.jsx("span",{className:"text-fg-muted italic",children:"∅ zero-hop"});const n=y[s]??y.amber;return r.jsxs("span",{className:"inline-flex items-center gap-1 flex-wrap",children:[e&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-mono text-fg-muted text-[10px]",children:e}),r.jsx("span",{className:"text-fg-muted/40 text-[10px] mx-0.5",children:"→"})]}),t.map((o,a)=>r.jsxs("span",{className:"inline-flex items-center",children:[a>0&&r.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),r.jsx("span",{className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono text-[11px] ${n}`,children:o.toUpperCase()})]},a))]})}function tt({title:t}){return r.jsx("div",{className:"mt-2 pt-2 border-t border-edge-subtle",children:t&&r.jsx("p",{className:"text-sys-amber font-semibold mb-0.5",children:t})})}function et(t){if(!t||t<=0)return"never";const e=Math.floor(Date.now()/1e3)-t;return e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}function st(t){return t>0?"green":"zinc"}function nt({children:t,c:e}){return r.jsx("span",{className:e??"text-fg-muted",children:t})}function rt({tokens:t,label:e="emits"}){const s=t.filter(a=>a.value!=null&&a.value!=="");if(s.length===0)return null;const n=[];let o;for(let a=0;a{var x;if(a.type==="label")return r.jsx("span",{className:"text-[8px] text-fg-muted/40 uppercase tracking-wider font-mono",children:a.group},`g-${i}`);const l=a.token,d=l.raw?`${l.fn}(${l.raw} → ${l.value})`:`${l.fn}(${l.value})`;return r.jsx("span",{title:d,className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono cursor-default ${((x=g[l.color??"zinc"])==null?void 0:x.text)??g.zinc.text}`,children:l.value},a.idx)})})})]})})}export{g as A,J as B,A as C,Y as H,q as K,Z as P,X as R,W as S,K as T,rt as a,Q as b,tt as c,G as d,F as e,nt as f,I as g,et as h,U as p,st as s}; +import{bW as P,eo as v,bS as $,bR as w,cc as z,ft as B,fu as M,j as r,r as h,fd as O,fe as V,ff as D}from"./index-CdntfUUz.js";function _(t){const e=t&3,s=t>>2&15,n=t>>6&3;return[{bits:"0-1",field:"Route Type",value:$(e),binary:(e&3).toString(2).padStart(2,"0")},{bits:"2-5",field:"Payload Type",value:w(s),binary:(s&15).toString(2).padStart(4,"0")},{bits:"6-7",field:"Version",value:n.toString(),binary:(n&3).toString(2).padStart(2,"0")}]}function U(t){if(!t||t.length<4)return null;const e=P.fromHex(t);if(!e.success||!e.packet)return null;const s=e.packet,n=_(s.header),o=t.slice(0,2);let a=2,i="";s.hasTransportCodes()&&(i=t.slice(2,10),a=10);const l=t.slice(a,a+2),d=a+2,x=d+s.pathLen*2,f=t.slice(d,x),p=t.slice(x),m=v(s),c=Math.floor(a/2),u=Math.floor(d/2);return{packet:s,headerHex:o,headerFields:n,transportCodesHex:i,pathLengthHex:l,pathDataHex:f,payloadHex:p,pathLenByteOffset:c,pathByteOffset:u,payloadStartByte:Math.floor(x/2),decoded:m}}function F(t){if(!t||t.length<8)return null;const e=parseInt(t.slice(0,2),16),s=parseInt(t.slice(2,4),16),n=parseInt(t.slice(4,6),16),o=parseInt(t.slice(6,8),16);return isNaN(e)||isNaN(s)||isNaN(n)||isNaN(o)?null:((e|s<<8|n<<16|o<<24)>>>0).toString(16).toUpperCase().padStart(8,"0")}function R(t){return t>=10?"excellent":t>=5?"good":t>=0?"fair":t>=-5?"poor":"critical"}function L(t){if(t._traceSnrPath!=null&&t._traceSnrPath.length>0)return t._traceSnrPath;if(t.raw_packet){const e=t.payload_type??t.type,s=M(t.raw_packet,e);if(s&&s.length>0)return s}return[]}function E(t){if(!t.payload)return null;try{const e=z(t.payload),s=L(t),n=B(e,s);return n?{packet:t,decoded:n,timestamp:t.timestamp??0,hopCount:n.snrValues.length,rssi:t.rssi,snr:t.snr}:null}catch{return null}}function I(t){const e=new Map;for(const s of t){const n=E(s);if(!n)continue;const o=n.decoded.traceTag,a=e.get(o)||[];a.push(n),e.set(o,a)}for(const[s,n]of e)n.sort((o,a)=>o.timestamp-a.timestamp),e.set(s,n);return e}function Q(t,e){if(e.length===0)return{traceTag:t,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 s=[...e].sort((c,u)=>c.timestamp-u.timestamp),n=s.reduce((c,u)=>u.hopCount>c.hopCount?u:c,s[0]),o=s[0].timestamp,a=s[s.length-1].timestamp,i=n.decoded.pathHashes,l=i.length,d=n.hopCount,x=n.decoded.isComplete,f=[],p=n.decoded.snrValues;for(let c=0;c0){const c=Math.min(...p),u=Math.max(...p),j=p.reduce((C,T)=>C+T,0)/p.length,S=p.indexOf(c),k=p.indexOf(u);m={minSnr:c,maxSnr:u,avgSnr:j,weakestLinkPosition:S,strongestLinkPosition:k}}return{traceTag:t,traceTagValue:n.decoded.traceTagValue,targetPath:i,targetHopCount:l,observations:s,observationCount:s.length,firstSeen:o,lastSeen:a,duration:a-o,isComplete:x,maxHopsObserved:d,progressPercent:l>0?Math.round(d/l*100):0,bestObservation:n,hopStats:f,linkQuality:m,srcHash:n.packet.src_hash,dstHash:n.packet.dst_hash}}const g={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(g).map(([t,e])=>[t,e.text]));const b=h.createContext("");function W({prefix:t,children:e}){return r.jsx(b.Provider,{value:t,children:e})}function N(){return h.useContext(b)}function A({children:t,color:e="zinc"}){var s;return r.jsx("span",{className:`inline-flex items-center px-1.5 py-px rounded-full text-[9px] font-mono font-medium leading-tight ${((s=g[e])==null?void 0:s.chip)??g.zinc.chip}`,children:t})}function K({fn:t,value:e,color:s="zinc"}){var a;const n=N(),o=n?`${n}(${t})`:t;return r.jsxs("span",{title:o,className:"inline-flex items-baseline gap-0 font-mono",children:[r.jsx("span",{className:"text-fg-muted/40",children:t}),r.jsx("span",{className:"text-fg-muted/20",children:"("}),e?r.jsx("span",{className:((a=g[s])==null?void 0:a.text)??g.zinc.text,children:e}):r.jsx("span",{className:"text-fg-muted/20",children:"·"}),r.jsx("span",{className:"text-fg-muted/20",children:")"})]})}function q({label:t,children:e,mono:s=!0,padY:n=!1}){const o=N(),a=t.trim(),i=o?`${o}(${a})`:a;return r.jsxs("div",{className:`flex items-center gap-2 ${n?"py-1":"py-0.5"}`,children:[r.jsx("dt",{className:"text-fg-muted shrink-0 w-28 text-right",children:t}),r.jsx("dd",{title:i,className:s?"text-fg-primary break-all":"text-fg-primary",children:e})]})}function G({value:t,className:e}){const s=typeof t=="number"?`0x${t.toString(16).toUpperCase().padStart(2,"0")}`:t.startsWith("0x")?t:`0x${t}`;return r.jsx("span",{className:e??"text-sys-blue",children:s})}function Y({value:t}){const e=typeof t=="number"?t.toString(16).toUpperCase().padStart(2,"0"):t.replace(/^0x/i,"").toUpperCase();return r.jsxs("span",{className:"px-1 py-px rounded bg-zinc-500/15 text-fg-secondary font-mono text-[11px]",children:["0x",e]})}function J({value:t}){return r.jsx("span",{className:"px-1 py-px rounded bg-zinc-500/10 text-fg-muted font-mono text-[10px]",children:t.toString(2).padStart(8,"0")})}function X({raw:t,children:e}){return r.jsxs("span",{className:"inline-flex items-center gap-1.5 flex-wrap",children:[r.jsx("span",{className:"font-mono text-fg-muted",children:t}),r.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),e]})}const y={blue:"text-sys-blue",amber:"text-sys-amber",green:"text-sys-green",teal:"text-sys-teal",purple:"text-sys-purple"};function Z({hops:t,hexPrefix:e,color:s="amber"}){if(t.length===0)return r.jsx("span",{className:"text-fg-muted italic",children:"∅ zero-hop"});const n=y[s]??y.amber;return r.jsxs("span",{className:"inline-flex items-center gap-1 flex-wrap",children:[e&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"font-mono text-fg-muted text-[10px]",children:e}),r.jsx("span",{className:"text-fg-muted/40 text-[10px] mx-0.5",children:"→"})]}),t.map((o,a)=>r.jsxs("span",{className:"inline-flex items-center",children:[a>0&&r.jsx("span",{className:"text-fg-muted/40 text-[10px]",children:"→"}),r.jsx("span",{className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono text-[11px] ${n}`,children:o.toUpperCase()})]},a))]})}function tt({title:t}){return r.jsx("div",{className:"mt-2 pt-2 border-t border-edge-subtle",children:t&&r.jsx("p",{className:"text-sys-amber font-semibold mb-0.5",children:t})})}function et(t){if(!t||t<=0)return"never";const e=Math.floor(Date.now()/1e3)-t;return e<60?`${e}s ago`:e<3600?`${Math.floor(e/60)}m ago`:e<86400?`${Math.floor(e/3600)}h ago`:`${Math.floor(e/86400)}d ago`}function st(t){return t>0?"green":"zinc"}function nt({children:t,c:e}){return r.jsx("span",{className:e??"text-fg-muted",children:t})}function rt({tokens:t,label:e="emits"}){const s=t.filter(a=>a.value!=null&&a.value!=="");if(s.length===0)return null;const n=[];let o;for(let a=0;a{var x;if(a.type==="label")return r.jsx("span",{className:"text-[8px] text-fg-muted/40 uppercase tracking-wider font-mono",children:a.group},`g-${i}`);const l=a.token,d=l.raw?`${l.fn}(${l.raw} → ${l.value})`:`${l.fn}(${l.value})`;return r.jsx("span",{title:d,className:`inline-block border border-edge-subtle rounded px-1.5 py-0.5 font-mono cursor-default ${((x=g[l.color??"zinc"])==null?void 0:x.text)??g.zinc.text}`,children:l.value},a.idx)})})})]})})}export{g as A,J as B,A as C,Y as H,q as K,Z as P,X as R,W as S,K as T,rt as a,Q as b,tt as c,G as d,F as e,nt as f,I as g,et as h,U as p,st as s}; diff --git a/frontend/dist/assets/radio-group-DyBWNwhI.js b/frontend/dist/assets/radio-group-CSvEyiPf.js similarity index 98% rename from frontend/dist/assets/radio-group-DyBWNwhI.js rename to frontend/dist/assets/radio-group-CSvEyiPf.js index f723c5cb..fbaa82de 100644 --- a/frontend/dist/assets/radio-group-DyBWNwhI.js +++ b/frontend/dist/assets/radio-group-CSvEyiPf.js @@ -1,4 +1,4 @@ -import{b3 as _,gD as W,b4 as V,r as o,bB as te,bF as se,fS as ie,b6 as B,bC as ye,bD as Re,aV as M,ba as G,aY as Y,df as re,dh as U,di as ae,fN as je,bh as q,bj as Q,bw as T,bH as $e,b5 as we,bd as Ne,be as Pe,by as ne,bu as le,dd as oe,bf as de,bg as ue,bi as ce,a_ as ke,b1 as Te,e as Oe,j as s,c as d}from"./index-CAHLMlrb.js";import{u as De}from"./use-by-comparator-JYMD8MzS.js";var Ee=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(Ee||{});let Fe={0(e,t){let a=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Te(a,r=>r.element.current)}},1(e,t){let a=e.options.slice(),r=e.options.findIndex(i=>i.id===t.id);return r===-1?e:(a.splice(r,1),{...e,options:a})}},X=o.createContext(null);X.displayName="RadioGroupDataContext";function Z(e){let t=o.useContext(X);if(t===null){let a=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(a,Z),a}return t}let z=o.createContext(null);z.displayName="RadioGroupActionsContext";function J(e){let t=o.useContext(z);if(t===null){let a=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(a,J),a}return t}function Ge(e,t){return ke(t.type,Fe,e,t)}let Ce="div";function Ie(e,t){let a=o.useId(),r=te(),{id:i=`headlessui-radiogroup-${a}`,value:m,form:n,name:g,onChange:u,by:y,disabled:c=r||!1,defaultValue:x,tabIndex:b=0,...R}=e,$=De(y),[N,O]=o.useReducer(Ge,{options:[]}),p=N.options,[C,I]=se(),[D,S]=ie(),E=o.useRef(null),A=B(E,t),v=ye(x),[h,F]=Re(m,u,v),P=o.useMemo(()=>p.find(l=>!l.propsRef.current.disabled),[p]),w=o.useMemo(()=>p.some(l=>$(l.propsRef.current.value,h)),[p,h]),j=M(l=>{var L;if(c||$(l,h))return!1;let f=(L=p.find(k=>$(k.propsRef.current.value,l)))==null?void 0:L.propsRef.current;return f!=null&&f.disabled?!1:(F==null||F(l),!0)}),fe=M(l=>{if(!E.current)return;let L=p.filter(f=>f.propsRef.current.disabled===!1).map(f=>f.element.current);switch(l.key){case G.Enter:je(l.currentTarget);break;case G.ArrowLeft:case G.ArrowUp:if(l.preventDefault(),l.stopPropagation(),re(L,U.Previous|U.WrapAround)===ae.Success){let f=p.find(k=>Y(k.element.current));f&&j(f.propsRef.current.value)}break;case G.ArrowRight:case G.ArrowDown:if(l.preventDefault(),l.stopPropagation(),re(L,U.Next|U.WrapAround)===ae.Success){let f=p.find(k=>Y(k.element.current));f&&j(f.propsRef.current.value)}break;case G.Space:{l.preventDefault(),l.stopPropagation();let f=p.find(k=>Y(k.element.current));f&&j(f.propsRef.current.value)}break}}),ee=M(l=>(O({type:0,...l}),()=>O({type:1,id:l.id}))),me=o.useMemo(()=>({value:h,firstOption:P,containsCheckedOption:w,disabled:c,compare:$,tabIndex:b,...N}),[h,P,w,c,$,b,N]),be=o.useMemo(()=>({registerOption:ee,change:j}),[ee,j]),ge={ref:A,id:i,role:"radiogroup","aria-labelledby":C,"aria-describedby":D,onKeyDown:fe},xe=q({value:h}),ve=o.useCallback(()=>{if(v!==void 0)return j(v)},[j,v]),he=Q();return T.createElement(S,{name:"RadioGroup.Description"},T.createElement(I,{name:"RadioGroup.Label"},T.createElement(z.Provider,{value:be},T.createElement(X.Provider,{value:me},g!=null&&T.createElement($e,{disabled:c,data:{[g]:h||"on"},overrides:{type:"radio",checked:h!=null},form:n,onReset:ve}),he({ourProps:ge,theirProps:R,slot:xe,defaultTag:Ce,name:"RadioGroup"})))))}let Se="div";function Ae(e,t){var a;let r=Z("RadioGroup.Option"),i=J("RadioGroup.Option"),m=o.useId(),{id:n=`headlessui-radiogroup-option-${m}`,value:g,disabled:u=r.disabled||!1,autoFocus:y=!1,...c}=e,x=o.useRef(null),b=B(x,t),[R,$]=se(),[N,O]=ie(),p=ne({value:g,disabled:u});le(()=>i.registerOption({id:n,element:x,propsRef:p}),[n,i,x,p]);let C=M(w=>{var j;if(oe(w.currentTarget))return w.preventDefault();i.change(g)&&((j=x.current)==null||j.focus())}),I=((a=r.firstOption)==null?void 0:a.id)===n,{isFocusVisible:D,focusProps:S}=de({autoFocus:y}),{isHovered:E,hoverProps:A}=ue({isDisabled:u}),v=r.compare(r.value,g),h=ce({ref:b,id:n,role:"radio","aria-checked":v?"true":"false","aria-labelledby":R,"aria-describedby":N,"aria-disabled":u?!0:void 0,tabIndex:u?-1:v||!r.containsCheckedOption&&I?r.tabIndex:-1,onClick:u?void 0:C,autoFocus:y},S,A),F=q({checked:v,disabled:u,active:D,hover:E,focus:D,autofocus:y}),P=Q();return T.createElement(O,{name:"RadioGroup.Description"},T.createElement($,{name:"RadioGroup.Label"},P({ourProps:h,theirProps:c,slot:F,defaultTag:Se,name:"RadioGroup.Option"})))}let Le="span";function Me(e,t){var a;let r=Z("Radio"),i=J("Radio"),m=o.useId(),n=we(),g=te(),{id:u=n||`headlessui-radio-${m}`,value:y,disabled:c=r.disabled||g||!1,autoFocus:x=!1,...b}=e,R=o.useRef(null),$=B(R,t),N=Ne(),O=Pe(),p=ne({value:y,disabled:c});le(()=>i.registerOption({id:u,element:R,propsRef:p}),[u,i,R,p]);let C=M(P=>{var w;if(oe(P.currentTarget))return P.preventDefault();i.change(y)&&((w=R.current)==null||w.focus())}),{isFocusVisible:I,focusProps:D}=de({autoFocus:x}),{isHovered:S,hoverProps:E}=ue({isDisabled:c}),A=((a=r.firstOption)==null?void 0:a.id)===u,v=r.compare(r.value,y),h=ce({ref:$,id:u,role:"radio","aria-checked":v?"true":"false","aria-labelledby":N,"aria-describedby":O,"aria-disabled":c?!0:void 0,tabIndex:c?-1:v||!r.containsCheckedOption&&A?r.tabIndex:-1,autoFocus:x,onClick:c?void 0:C},D,E),F=q({checked:v,disabled:c,hover:S,focus:I,autofocus:x});return Q()({ourProps:h,theirProps:b,slot:F,defaultTag:Le,name:"Radio"})}let Ve=_(Ie),He=_(Ae),K=_(Me),Ue=V,We=W,Ke=Object.assign(Ve,{Option:He,Radio:K,Label:Ue,Description:We});/** +import{b3 as _,gD as W,b4 as V,r as o,bB as te,bF as se,fS as ie,b6 as B,bC as ye,bD as Re,aV as M,ba as G,aY as Y,df as re,dh as U,di as ae,fN as je,bh as q,bj as Q,bw as T,bH as $e,b5 as we,bd as Ne,be as Pe,by as ne,bu as le,dd as oe,bf as de,bg as ue,bi as ce,a_ as ke,b1 as Te,e as Oe,j as s,c as d}from"./index-CdntfUUz.js";import{u as De}from"./use-by-comparator-Dgy5yCaL.js";var Ee=(e=>(e[e.RegisterOption=0]="RegisterOption",e[e.UnregisterOption=1]="UnregisterOption",e))(Ee||{});let Fe={0(e,t){let a=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:Te(a,r=>r.element.current)}},1(e,t){let a=e.options.slice(),r=e.options.findIndex(i=>i.id===t.id);return r===-1?e:(a.splice(r,1),{...e,options:a})}},X=o.createContext(null);X.displayName="RadioGroupDataContext";function Z(e){let t=o.useContext(X);if(t===null){let a=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(a,Z),a}return t}let z=o.createContext(null);z.displayName="RadioGroupActionsContext";function J(e){let t=o.useContext(z);if(t===null){let a=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(a,J),a}return t}function Ge(e,t){return ke(t.type,Fe,e,t)}let Ce="div";function Ie(e,t){let a=o.useId(),r=te(),{id:i=`headlessui-radiogroup-${a}`,value:m,form:n,name:g,onChange:u,by:y,disabled:c=r||!1,defaultValue:x,tabIndex:b=0,...R}=e,$=De(y),[N,O]=o.useReducer(Ge,{options:[]}),p=N.options,[C,I]=se(),[D,S]=ie(),E=o.useRef(null),A=B(E,t),v=ye(x),[h,F]=Re(m,u,v),P=o.useMemo(()=>p.find(l=>!l.propsRef.current.disabled),[p]),w=o.useMemo(()=>p.some(l=>$(l.propsRef.current.value,h)),[p,h]),j=M(l=>{var L;if(c||$(l,h))return!1;let f=(L=p.find(k=>$(k.propsRef.current.value,l)))==null?void 0:L.propsRef.current;return f!=null&&f.disabled?!1:(F==null||F(l),!0)}),fe=M(l=>{if(!E.current)return;let L=p.filter(f=>f.propsRef.current.disabled===!1).map(f=>f.element.current);switch(l.key){case G.Enter:je(l.currentTarget);break;case G.ArrowLeft:case G.ArrowUp:if(l.preventDefault(),l.stopPropagation(),re(L,U.Previous|U.WrapAround)===ae.Success){let f=p.find(k=>Y(k.element.current));f&&j(f.propsRef.current.value)}break;case G.ArrowRight:case G.ArrowDown:if(l.preventDefault(),l.stopPropagation(),re(L,U.Next|U.WrapAround)===ae.Success){let f=p.find(k=>Y(k.element.current));f&&j(f.propsRef.current.value)}break;case G.Space:{l.preventDefault(),l.stopPropagation();let f=p.find(k=>Y(k.element.current));f&&j(f.propsRef.current.value)}break}}),ee=M(l=>(O({type:0,...l}),()=>O({type:1,id:l.id}))),me=o.useMemo(()=>({value:h,firstOption:P,containsCheckedOption:w,disabled:c,compare:$,tabIndex:b,...N}),[h,P,w,c,$,b,N]),be=o.useMemo(()=>({registerOption:ee,change:j}),[ee,j]),ge={ref:A,id:i,role:"radiogroup","aria-labelledby":C,"aria-describedby":D,onKeyDown:fe},xe=q({value:h}),ve=o.useCallback(()=>{if(v!==void 0)return j(v)},[j,v]),he=Q();return T.createElement(S,{name:"RadioGroup.Description"},T.createElement(I,{name:"RadioGroup.Label"},T.createElement(z.Provider,{value:be},T.createElement(X.Provider,{value:me},g!=null&&T.createElement($e,{disabled:c,data:{[g]:h||"on"},overrides:{type:"radio",checked:h!=null},form:n,onReset:ve}),he({ourProps:ge,theirProps:R,slot:xe,defaultTag:Ce,name:"RadioGroup"})))))}let Se="div";function Ae(e,t){var a;let r=Z("RadioGroup.Option"),i=J("RadioGroup.Option"),m=o.useId(),{id:n=`headlessui-radiogroup-option-${m}`,value:g,disabled:u=r.disabled||!1,autoFocus:y=!1,...c}=e,x=o.useRef(null),b=B(x,t),[R,$]=se(),[N,O]=ie(),p=ne({value:g,disabled:u});le(()=>i.registerOption({id:n,element:x,propsRef:p}),[n,i,x,p]);let C=M(w=>{var j;if(oe(w.currentTarget))return w.preventDefault();i.change(g)&&((j=x.current)==null||j.focus())}),I=((a=r.firstOption)==null?void 0:a.id)===n,{isFocusVisible:D,focusProps:S}=de({autoFocus:y}),{isHovered:E,hoverProps:A}=ue({isDisabled:u}),v=r.compare(r.value,g),h=ce({ref:b,id:n,role:"radio","aria-checked":v?"true":"false","aria-labelledby":R,"aria-describedby":N,"aria-disabled":u?!0:void 0,tabIndex:u?-1:v||!r.containsCheckedOption&&I?r.tabIndex:-1,onClick:u?void 0:C,autoFocus:y},S,A),F=q({checked:v,disabled:u,active:D,hover:E,focus:D,autofocus:y}),P=Q();return T.createElement(O,{name:"RadioGroup.Description"},T.createElement($,{name:"RadioGroup.Label"},P({ourProps:h,theirProps:c,slot:F,defaultTag:Se,name:"RadioGroup.Option"})))}let Le="span";function Me(e,t){var a;let r=Z("Radio"),i=J("Radio"),m=o.useId(),n=we(),g=te(),{id:u=n||`headlessui-radio-${m}`,value:y,disabled:c=r.disabled||g||!1,autoFocus:x=!1,...b}=e,R=o.useRef(null),$=B(R,t),N=Ne(),O=Pe(),p=ne({value:y,disabled:c});le(()=>i.registerOption({id:u,element:R,propsRef:p}),[u,i,R,p]);let C=M(P=>{var w;if(oe(P.currentTarget))return P.preventDefault();i.change(y)&&((w=R.current)==null||w.focus())}),{isFocusVisible:I,focusProps:D}=de({autoFocus:x}),{isHovered:S,hoverProps:E}=ue({isDisabled:c}),A=((a=r.firstOption)==null?void 0:a.id)===u,v=r.compare(r.value,y),h=ce({ref:$,id:u,role:"radio","aria-checked":v?"true":"false","aria-labelledby":N,"aria-describedby":O,"aria-disabled":c?!0:void 0,tabIndex:c?-1:v||!r.containsCheckedOption&&A?r.tabIndex:-1,autoFocus:x,onClick:c?void 0:C},D,E),F=q({checked:v,disabled:c,hover:S,focus:I,autofocus:x});return Q()({ourProps:h,theirProps:b,slot:F,defaultTag:Le,name:"Radio"})}let Ve=_(Ie),He=_(Ae),K=_(Me),Ue=V,We=W,Ke=Object.assign(Ve,{Option:He,Radio:K,Label:Ue,Description:We});/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/repeat-Dv_JF6au.js b/frontend/dist/assets/repeat-CYHoMir3.js similarity index 91% rename from frontend/dist/assets/repeat-Dv_JF6au.js rename to frontend/dist/assets/repeat-CYHoMir3.js index 6f087f4c..b8285630 100644 --- a/frontend/dist/assets/repeat-Dv_JF6au.js +++ b/frontend/dist/assets/repeat-CYHoMir3.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/rotate-ccw-Cav5SApM.js b/frontend/dist/assets/rotate-ccw-DyxXzFWc.js similarity index 89% rename from frontend/dist/assets/rotate-ccw-Cav5SApM.js rename to frontend/dist/assets/rotate-ccw-DyxXzFWc.js index a41c8f02..77c74ab3 100644 --- a/frontend/dist/assets/rotate-ccw-Cav5SApM.js +++ b/frontend/dist/assets/rotate-ccw-DyxXzFWc.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/rotate-cw-D7GjgDF3.js b/frontend/dist/assets/rotate-cw-CKh-yYEC.js similarity index 88% rename from frontend/dist/assets/rotate-cw-D7GjgDF3.js rename to frontend/dist/assets/rotate-cw-CKh-yYEC.js index d5302405..ae814d45 100644 --- a/frontend/dist/assets/rotate-cw-D7GjgDF3.js +++ b/frontend/dist/assets/rotate-cw-CKh-yYEC.js @@ -1,4 +1,4 @@ -import{e as t}from"./index-CAHLMlrb.js";/** +import{e as t}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/route-B8rlrav9.js b/frontend/dist/assets/route-CeOQcqdX.js similarity index 94% rename from frontend/dist/assets/route-B8rlrav9.js rename to frontend/dist/assets/route-CeOQcqdX.js index a1761e38..e7f835da 100644 --- a/frontend/dist/assets/route-B8rlrav9.js +++ b/frontend/dist/assets/route-CeOQcqdX.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/satellite-DvRQ8hgk.js b/frontend/dist/assets/satellite-DwUbYQYY.js similarity index 94% rename from frontend/dist/assets/satellite-DvRQ8hgk.js rename to frontend/dist/assets/satellite-DwUbYQYY.js index 6bb7ba02..db75d5b7 100644 --- a/frontend/dist/assets/satellite-DvRQ8hgk.js +++ b/frontend/dist/assets/satellite-DwUbYQYY.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/save-HCcOmjKD.js b/frontend/dist/assets/save-B0-dg8jU.js similarity index 91% rename from frontend/dist/assets/save-HCcOmjKD.js rename to frontend/dist/assets/save-B0-dg8jU.js index 7dee4d58..97738f03 100644 --- a/frontend/dist/assets/save-HCcOmjKD.js +++ b/frontend/dist/assets/save-B0-dg8jU.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/search-C1Hut7GR.js b/frontend/dist/assets/search-D8B8LMYr.js similarity index 87% rename from frontend/dist/assets/search-C1Hut7GR.js rename to frontend/dist/assets/search-D8B8LMYr.js index 4cb7dd52..78efa352 100644 --- a/frontend/dist/assets/search-C1Hut7GR.js +++ b/frontend/dist/assets/search-D8B8LMYr.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/setting-field-YD-YARg4.js b/frontend/dist/assets/setting-field-BzKIre35.js similarity index 98% rename from frontend/dist/assets/setting-field-YD-YARg4.js rename to frontend/dist/assets/setting-field-BzKIre35.js index 14df70c8..2e7093e1 100644 --- a/frontend/dist/assets/setting-field-YD-YARg4.js +++ b/frontend/dist/assets/setting-field-BzKIre35.js @@ -1 +1 @@ -import{r as t,j as e,c as r,fP as M,cY as O,a9 as H,a7 as R,bO as T,aE as U}from"./index-CAHLMlrb.js";import{W as X}from"./wand-sparkles-C18LiNtQ.js";import{P as z}from"./pencil--wb87xjW.js";const _=1500,D={stacked:"h-[38px]",inline:"h-[32px]"},F={stacked:"px-3",inline:"px-2.5"},I="rounded-lg";function Q({label:K,value:g,editValue:m,onSave:k,type:b="text",suffix:j,placeholder:A,readOnly:q=!1,layout:W="stacked",min:w,max:y,step:v,maxLength:l,description:u,tooltip:N,autoConfigured:c,className:x}){const[p,P]=t.useState(!1),[o,C]=t.useState(""),[n,s]=t.useState("idle"),E=t.useRef(null),h=t.useRef(!0),f=t.useRef(null),d=!q&&!!k;t.useEffect(()=>(h.current=!0,()=>{h.current=!1,f.current&&clearTimeout(f.current)}),[]);const a=t.useCallback(()=>{d&&(C(m??g),P(!0),s("idle"),requestAnimationFrame(()=>{var i;return(i=E.current)==null?void 0:i.select()}))},[d,m,g]),S=t.useCallback(()=>{P(!1),C(""),s("idle")},[]),Y=t.useCallback(async()=>{if(!k||n==="loading")return;if(o===(m??g)){S();return}f.current&&clearTimeout(f.current),s("loading");try{if(await k(o),!h.current)return;s("success"),P(!1),f.current=setTimeout(()=>{h.current&&s("idle")},_)}catch{if(!h.current)return;s("error"),f.current=setTimeout(()=>{h.current&&s("idle")},_)}},[k,o,m,g,S,n]),L=t.useCallback(i=>{i.key==="Enter"?(i.preventDefault(),Y()):i.key==="Escape"&&(i.preventDefault(),S())},[Y,S]);return W==="inline"?e.jsxs("div",{className:r("group flex items-center justify-between gap-3",x),children:[e.jsxs("div",{className:"flex items-center gap-1 truncate",children:[e.jsx("label",{className:"type-label text-fg-muted truncate",children:K}),N&&e.jsx(M,{content:N,placement:"top",children:e.jsx("span",{className:"text-fg-muted/50 hover:text-fg-muted cursor-help transition-colors flex-shrink-0",children:e.jsx(O,{className:"w-3 h-3"})})})]}),p?e.jsxs("div",{className:r(D.inline,I,F.inline,"flex items-center transition-all","bg-transparent border border-sys-blue/50 ring-1 ring-sys-blue/20","min-w-[100px]"),children:[e.jsx("input",{ref:E,type:b,value:o,onChange:i=>C(i.target.value),onKeyDown:L,placeholder:A,min:w,max:y,step:v,maxLength:l,disabled:n==="loading",className:r("bg-transparent text-fg-primary focus:outline-none type-data flex-1 min-w-0",j?"w-12 text-right":"w-full")}),j&&e.jsx("span",{className:"text-fg-muted type-data ml-1 shrink-0",children:j}),e.jsx("div",{className:"flex items-center gap-0.5 ml-2 shrink-0",children:n==="loading"?e.jsx(H,{className:"w-3.5 h-3.5 text-fg-muted animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:Y,className:"p-0.5 rounded hover:bg-sys-green/15 text-sys-green transition-colors",title:"Save (Enter)",children:e.jsx(R,{className:"w-3 h-3"})}),e.jsx("button",{onClick:S,className:"p-0.5 rounded hover:bg-sys-red/15 text-fg-muted hover:text-sys-red transition-colors",title:"Cancel (Esc)",children:e.jsx(T,{className:"w-3 h-3"})})]})})]}):e.jsxs("div",{className:r(D.inline,I,F.inline,"flex items-center justify-end transition-all min-w-[80px]","bg-input-bg border border-input-border",d&&"cursor-pointer hover:border-edge-strong"),onClick:d?a:void 0,children:[e.jsx("span",{className:"type-data text-fg-primary",children:g}),n==="success"&&e.jsx(R,{className:"w-3 h-3 text-sys-green ml-1.5 shrink-0"}),n==="error"&&e.jsx(T,{className:"w-3 h-3 text-sys-red ml-1.5 shrink-0"}),n==="idle"&&c&&e.jsx(X,{className:"w-3 h-3 text-sys-blue ml-1.5 shrink-0"}),n==="idle"&&!c&&d&&e.jsx(z,{className:"w-3 h-3 text-fg-muted ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]})]}):e.jsxs("div",{className:r("group",x),children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[e.jsx("label",{className:"type-label text-fg-muted",children:K}),N&&e.jsx(M,{content:N,placement:"top",children:e.jsx("span",{className:"text-fg-muted/50 hover:text-fg-muted cursor-help transition-colors flex-shrink-0",children:e.jsx(O,{className:"w-3 h-3"})})})]}),p?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:r(D.stacked,I,F.stacked,"flex items-center transition-all","bg-transparent border border-sys-blue/50 ring-1 ring-sys-blue/20"),children:[e.jsx("input",{ref:E,type:b,value:o,onChange:i=>C(i.target.value),onKeyDown:L,placeholder:A,min:w,max:y,step:v,maxLength:l,disabled:n==="loading",className:"w-full bg-transparent text-fg-primary focus:outline-none type-data flex-1 min-w-0"}),j&&e.jsx("span",{className:"text-fg-muted type-data ml-1 shrink-0",children:j}),e.jsx("div",{className:"flex items-center gap-0.5 ml-2 shrink-0",children:n==="loading"?e.jsx(H,{className:"w-3.5 h-3.5 text-fg-muted animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:Y,className:"p-1 rounded hover:bg-sys-green/15 text-sys-green transition-colors",title:"Save (Enter)",children:e.jsx(R,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:S,className:"p-1 rounded hover:bg-sys-red/15 text-fg-muted hover:text-sys-red transition-colors",title:"Cancel (Esc)",children:e.jsx(T,{className:"w-3.5 h-3.5"})})]})})]}),u&&e.jsx("p",{className:"type-data-xs text-fg-muted mt-1 ml-3",children:u})]}):e.jsxs("div",{className:r(D.stacked,I,F.stacked,"flex items-center transition-all","bg-input-bg border border-input-border",d&&"cursor-pointer hover:border-edge-strong"),onClick:d?a:void 0,children:[e.jsx("span",{className:"type-data text-fg-primary flex-1 whitespace-nowrap",children:g}),n==="success"&&e.jsx(R,{className:"w-3.5 h-3.5 text-sys-green shrink-0"}),n==="error"&&e.jsx(T,{className:"w-3.5 h-3.5 text-sys-red shrink-0"}),n==="idle"&&c&&e.jsx(X,{className:"w-3.5 h-3.5 text-sys-blue shrink-0"}),n==="idle"&&!c&&d&&e.jsx(z,{className:"w-3.5 h-3.5 text-fg-muted opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]})]})}function Z({label:K,value:g,editValue:m,options:k,onSave:b,readOnly:j=!1,layout:A="stacked",className:q}){const[W,w]=t.useState(!1),[y,v]=t.useState(""),[l,u]=t.useState("idle"),N=t.useRef(null),c=t.useRef(!0),x=t.useRef(null),p=!j&&!!b;t.useEffect(()=>(c.current=!0,()=>{c.current=!1,x.current&&clearTimeout(x.current)}),[]);const P=t.useCallback(()=>{p&&(v(String(m)),w(!0),u("idle"),requestAnimationFrame(()=>{var a;return(a=N.current)==null?void 0:a.focus()}))},[p,m]),o=t.useCallback(()=>{w(!1),v(""),u("idle")},[]),C=t.useCallback(async()=>{if(!(!b||l==="loading")){if(y===String(m)){o();return}x.current&&clearTimeout(x.current),u("loading");try{if(await b(y),!c.current)return;u("success"),w(!1),x.current=setTimeout(()=>{c.current&&u("idle")},_)}catch{if(!c.current)return;u("error"),x.current=setTimeout(()=>{c.current&&u("idle")},_)}}},[b,y,m,o,l]),n=t.useCallback(a=>{a.key==="Escape"&&(a.preventDefault(),o())},[o]),s=A==="inline",E=s?D.inline:D.stacked,h=s?F.inline:F.stacked,f=e.jsxs("div",{className:r(E,I,h,"flex items-center transition-all relative","bg-transparent border border-sys-blue/50 ring-1 ring-sys-blue/20",s&&"min-w-[100px]"),children:[e.jsx("select",{ref:N,value:y,onChange:a=>v(a.target.value),onKeyDown:n,disabled:l==="loading",className:r("bg-transparent text-fg-primary focus:outline-none appearance-none cursor-pointer type-data flex-1 min-w-0","pr-6"),children:k.map(a=>e.jsx("option",{value:a.value,children:a.label},String(a.value)))}),e.jsx(U,{className:"absolute right-auto w-3.5 h-3.5 text-fg-muted pointer-events-none",style:{right:l==="loading"?"2rem":"3.5rem"}}),e.jsx("div",{className:"flex items-center gap-0.5 ml-1 shrink-0",children:l==="loading"?e.jsx(H,{className:r("text-fg-muted animate-spin",s?"w-3 h-3":"w-3.5 h-3.5")}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:C,className:r("rounded hover:bg-sys-green/15 text-sys-green transition-colors",s?"p-0.5":"p-1"),title:"Save",children:e.jsx(R,{className:s?"w-3 h-3":"w-3.5 h-3.5"})}),e.jsx("button",{onClick:o,className:r("rounded hover:bg-sys-red/15 text-fg-muted hover:text-sys-red transition-colors",s?"p-0.5":"p-1"),title:"Cancel (Esc)",children:e.jsx(T,{className:s?"w-3 h-3":"w-3.5 h-3.5"})})]})})]}),d=e.jsxs("div",{className:r(E,I,h,"flex items-center transition-all","bg-input-bg border border-input-border",p&&"cursor-pointer hover:border-edge-strong",s?"justify-end min-w-[80px]":""),onClick:p?P:void 0,children:[e.jsx("span",{className:r("type-data text-fg-primary",!s&&"flex-1"),children:g}),l==="success"&&e.jsx(R,{className:r("text-sys-green shrink-0",s?"w-3 h-3 ml-1.5":"w-3.5 h-3.5")}),l==="error"&&e.jsx(T,{className:r("text-sys-red shrink-0",s?"w-3 h-3 ml-1.5":"w-3.5 h-3.5")}),l==="idle"&&p&&e.jsx(U,{className:r("text-fg-muted opacity-0 group-hover:opacity-100 transition-opacity shrink-0",s?"w-3 h-3 ml-1.5":"w-3.5 h-3.5")})]});return s?e.jsxs("div",{className:r("group flex items-center justify-between",q),children:[e.jsx("label",{className:"type-label text-fg-muted shrink-0",children:K}),W?f:d]}):e.jsxs("div",{className:r("group",q),children:[e.jsx("label",{className:"type-label text-fg-muted block mb-1",children:K}),W?f:d]})}export{Q as S,Z as a}; +import{r as t,j as e,c as r,fP as M,cY as O,a9 as H,a7 as R,bO as T,aE as U}from"./index-CdntfUUz.js";import{W as X}from"./wand-sparkles-By2ieoA5.js";import{P as z}from"./pencil-DwKQKROy.js";const _=1500,D={stacked:"h-[38px]",inline:"h-[32px]"},F={stacked:"px-3",inline:"px-2.5"},I="rounded-lg";function Q({label:K,value:g,editValue:m,onSave:k,type:b="text",suffix:j,placeholder:A,readOnly:q=!1,layout:W="stacked",min:w,max:y,step:v,maxLength:l,description:u,tooltip:N,autoConfigured:c,className:x}){const[p,P]=t.useState(!1),[o,C]=t.useState(""),[n,s]=t.useState("idle"),E=t.useRef(null),h=t.useRef(!0),f=t.useRef(null),d=!q&&!!k;t.useEffect(()=>(h.current=!0,()=>{h.current=!1,f.current&&clearTimeout(f.current)}),[]);const a=t.useCallback(()=>{d&&(C(m??g),P(!0),s("idle"),requestAnimationFrame(()=>{var i;return(i=E.current)==null?void 0:i.select()}))},[d,m,g]),S=t.useCallback(()=>{P(!1),C(""),s("idle")},[]),Y=t.useCallback(async()=>{if(!k||n==="loading")return;if(o===(m??g)){S();return}f.current&&clearTimeout(f.current),s("loading");try{if(await k(o),!h.current)return;s("success"),P(!1),f.current=setTimeout(()=>{h.current&&s("idle")},_)}catch{if(!h.current)return;s("error"),f.current=setTimeout(()=>{h.current&&s("idle")},_)}},[k,o,m,g,S,n]),L=t.useCallback(i=>{i.key==="Enter"?(i.preventDefault(),Y()):i.key==="Escape"&&(i.preventDefault(),S())},[Y,S]);return W==="inline"?e.jsxs("div",{className:r("group flex items-center justify-between gap-3",x),children:[e.jsxs("div",{className:"flex items-center gap-1 truncate",children:[e.jsx("label",{className:"type-label text-fg-muted truncate",children:K}),N&&e.jsx(M,{content:N,placement:"top",children:e.jsx("span",{className:"text-fg-muted/50 hover:text-fg-muted cursor-help transition-colors flex-shrink-0",children:e.jsx(O,{className:"w-3 h-3"})})})]}),p?e.jsxs("div",{className:r(D.inline,I,F.inline,"flex items-center transition-all","bg-transparent border border-sys-blue/50 ring-1 ring-sys-blue/20","min-w-[100px]"),children:[e.jsx("input",{ref:E,type:b,value:o,onChange:i=>C(i.target.value),onKeyDown:L,placeholder:A,min:w,max:y,step:v,maxLength:l,disabled:n==="loading",className:r("bg-transparent text-fg-primary focus:outline-none type-data flex-1 min-w-0",j?"w-12 text-right":"w-full")}),j&&e.jsx("span",{className:"text-fg-muted type-data ml-1 shrink-0",children:j}),e.jsx("div",{className:"flex items-center gap-0.5 ml-2 shrink-0",children:n==="loading"?e.jsx(H,{className:"w-3.5 h-3.5 text-fg-muted animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:Y,className:"p-0.5 rounded hover:bg-sys-green/15 text-sys-green transition-colors",title:"Save (Enter)",children:e.jsx(R,{className:"w-3 h-3"})}),e.jsx("button",{onClick:S,className:"p-0.5 rounded hover:bg-sys-red/15 text-fg-muted hover:text-sys-red transition-colors",title:"Cancel (Esc)",children:e.jsx(T,{className:"w-3 h-3"})})]})})]}):e.jsxs("div",{className:r(D.inline,I,F.inline,"flex items-center justify-end transition-all min-w-[80px]","bg-input-bg border border-input-border",d&&"cursor-pointer hover:border-edge-strong"),onClick:d?a:void 0,children:[e.jsx("span",{className:"type-data text-fg-primary",children:g}),n==="success"&&e.jsx(R,{className:"w-3 h-3 text-sys-green ml-1.5 shrink-0"}),n==="error"&&e.jsx(T,{className:"w-3 h-3 text-sys-red ml-1.5 shrink-0"}),n==="idle"&&c&&e.jsx(X,{className:"w-3 h-3 text-sys-blue ml-1.5 shrink-0"}),n==="idle"&&!c&&d&&e.jsx(z,{className:"w-3 h-3 text-fg-muted ml-1.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]})]}):e.jsxs("div",{className:r("group",x),children:[e.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[e.jsx("label",{className:"type-label text-fg-muted",children:K}),N&&e.jsx(M,{content:N,placement:"top",children:e.jsx("span",{className:"text-fg-muted/50 hover:text-fg-muted cursor-help transition-colors flex-shrink-0",children:e.jsx(O,{className:"w-3 h-3"})})})]}),p?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:r(D.stacked,I,F.stacked,"flex items-center transition-all","bg-transparent border border-sys-blue/50 ring-1 ring-sys-blue/20"),children:[e.jsx("input",{ref:E,type:b,value:o,onChange:i=>C(i.target.value),onKeyDown:L,placeholder:A,min:w,max:y,step:v,maxLength:l,disabled:n==="loading",className:"w-full bg-transparent text-fg-primary focus:outline-none type-data flex-1 min-w-0"}),j&&e.jsx("span",{className:"text-fg-muted type-data ml-1 shrink-0",children:j}),e.jsx("div",{className:"flex items-center gap-0.5 ml-2 shrink-0",children:n==="loading"?e.jsx(H,{className:"w-3.5 h-3.5 text-fg-muted animate-spin"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:Y,className:"p-1 rounded hover:bg-sys-green/15 text-sys-green transition-colors",title:"Save (Enter)",children:e.jsx(R,{className:"w-3.5 h-3.5"})}),e.jsx("button",{onClick:S,className:"p-1 rounded hover:bg-sys-red/15 text-fg-muted hover:text-sys-red transition-colors",title:"Cancel (Esc)",children:e.jsx(T,{className:"w-3.5 h-3.5"})})]})})]}),u&&e.jsx("p",{className:"type-data-xs text-fg-muted mt-1 ml-3",children:u})]}):e.jsxs("div",{className:r(D.stacked,I,F.stacked,"flex items-center transition-all","bg-input-bg border border-input-border",d&&"cursor-pointer hover:border-edge-strong"),onClick:d?a:void 0,children:[e.jsx("span",{className:"type-data text-fg-primary flex-1 whitespace-nowrap",children:g}),n==="success"&&e.jsx(R,{className:"w-3.5 h-3.5 text-sys-green shrink-0"}),n==="error"&&e.jsx(T,{className:"w-3.5 h-3.5 text-sys-red shrink-0"}),n==="idle"&&c&&e.jsx(X,{className:"w-3.5 h-3.5 text-sys-blue shrink-0"}),n==="idle"&&!c&&d&&e.jsx(z,{className:"w-3.5 h-3.5 text-fg-muted opacity-0 group-hover:opacity-100 transition-opacity shrink-0"})]})]})}function Z({label:K,value:g,editValue:m,options:k,onSave:b,readOnly:j=!1,layout:A="stacked",className:q}){const[W,w]=t.useState(!1),[y,v]=t.useState(""),[l,u]=t.useState("idle"),N=t.useRef(null),c=t.useRef(!0),x=t.useRef(null),p=!j&&!!b;t.useEffect(()=>(c.current=!0,()=>{c.current=!1,x.current&&clearTimeout(x.current)}),[]);const P=t.useCallback(()=>{p&&(v(String(m)),w(!0),u("idle"),requestAnimationFrame(()=>{var a;return(a=N.current)==null?void 0:a.focus()}))},[p,m]),o=t.useCallback(()=>{w(!1),v(""),u("idle")},[]),C=t.useCallback(async()=>{if(!(!b||l==="loading")){if(y===String(m)){o();return}x.current&&clearTimeout(x.current),u("loading");try{if(await b(y),!c.current)return;u("success"),w(!1),x.current=setTimeout(()=>{c.current&&u("idle")},_)}catch{if(!c.current)return;u("error"),x.current=setTimeout(()=>{c.current&&u("idle")},_)}}},[b,y,m,o,l]),n=t.useCallback(a=>{a.key==="Escape"&&(a.preventDefault(),o())},[o]),s=A==="inline",E=s?D.inline:D.stacked,h=s?F.inline:F.stacked,f=e.jsxs("div",{className:r(E,I,h,"flex items-center transition-all relative","bg-transparent border border-sys-blue/50 ring-1 ring-sys-blue/20",s&&"min-w-[100px]"),children:[e.jsx("select",{ref:N,value:y,onChange:a=>v(a.target.value),onKeyDown:n,disabled:l==="loading",className:r("bg-transparent text-fg-primary focus:outline-none appearance-none cursor-pointer type-data flex-1 min-w-0","pr-6"),children:k.map(a=>e.jsx("option",{value:a.value,children:a.label},String(a.value)))}),e.jsx(U,{className:"absolute right-auto w-3.5 h-3.5 text-fg-muted pointer-events-none",style:{right:l==="loading"?"2rem":"3.5rem"}}),e.jsx("div",{className:"flex items-center gap-0.5 ml-1 shrink-0",children:l==="loading"?e.jsx(H,{className:r("text-fg-muted animate-spin",s?"w-3 h-3":"w-3.5 h-3.5")}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:C,className:r("rounded hover:bg-sys-green/15 text-sys-green transition-colors",s?"p-0.5":"p-1"),title:"Save",children:e.jsx(R,{className:s?"w-3 h-3":"w-3.5 h-3.5"})}),e.jsx("button",{onClick:o,className:r("rounded hover:bg-sys-red/15 text-fg-muted hover:text-sys-red transition-colors",s?"p-0.5":"p-1"),title:"Cancel (Esc)",children:e.jsx(T,{className:s?"w-3 h-3":"w-3.5 h-3.5"})})]})})]}),d=e.jsxs("div",{className:r(E,I,h,"flex items-center transition-all","bg-input-bg border border-input-border",p&&"cursor-pointer hover:border-edge-strong",s?"justify-end min-w-[80px]":""),onClick:p?P:void 0,children:[e.jsx("span",{className:r("type-data text-fg-primary",!s&&"flex-1"),children:g}),l==="success"&&e.jsx(R,{className:r("text-sys-green shrink-0",s?"w-3 h-3 ml-1.5":"w-3.5 h-3.5")}),l==="error"&&e.jsx(T,{className:r("text-sys-red shrink-0",s?"w-3 h-3 ml-1.5":"w-3.5 h-3.5")}),l==="idle"&&p&&e.jsx(U,{className:r("text-fg-muted opacity-0 group-hover:opacity-100 transition-opacity shrink-0",s?"w-3 h-3 ml-1.5":"w-3.5 h-3.5")})]});return s?e.jsxs("div",{className:r("group flex items-center justify-between",q),children:[e.jsx("label",{className:"type-label text-fg-muted shrink-0",children:K}),W?f:d]}):e.jsxs("div",{className:r("group",q),children:[e.jsx("label",{className:"type-label text-fg-muted block mb-1",children:K}),W?f:d]})}export{Q as S,Z as a}; diff --git a/frontend/dist/assets/settings-2-DgwT7JNL.js b/frontend/dist/assets/settings-2-iRV0UHU5.js similarity index 89% rename from frontend/dist/assets/settings-2-DgwT7JNL.js rename to frontend/dist/assets/settings-2-iRV0UHU5.js index 8dfca215..25f299a7 100644 --- a/frontend/dist/assets/settings-2-DgwT7JNL.js +++ b/frontend/dist/assets/settings-2-iRV0UHU5.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/setup-DRFHoJbp.js b/frontend/dist/assets/setup-CORoXz0f.js similarity index 88% rename from frontend/dist/assets/setup-DRFHoJbp.js rename to frontend/dist/assets/setup-CORoXz0f.js index 5613f443..84fd504a 100644 --- a/frontend/dist/assets/setup-DRFHoJbp.js +++ b/frontend/dist/assets/setup-CORoXz0f.js @@ -1 +1 @@ -import{dy as e}from"./index-CAHLMlrb.js";async function t(){return e("/api/needs_setup")}async function a(){const r=await e("/api/hardware_options");return"success"in r?r:r.error?{success:!1,error:r.error}:{success:!0,data:r.hardware??[]}}async function n(){const r=await e("/api/radio_presets");return"success"in r?r:r.error?{success:!1,error:r.error}:{success:!0,data:r.presets??[]}}async function i(){return e("/api/serial_ports")}async function u(r){return e("/api/setup_wizard",{method:"POST",body:JSON.stringify(r)})}export{n as a,i as b,a as g,t as n,u as s}; +import{dy as e}from"./index-CdntfUUz.js";async function t(){return e("/api/needs_setup")}async function a(){const r=await e("/api/hardware_options");return"success"in r?r:r.error?{success:!1,error:r.error}:{success:!0,data:r.hardware??[]}}async function n(){const r=await e("/api/radio_presets");return"success"in r?r:r.error?{success:!1,error:r.error}:{success:!0,data:r.presets??[]}}async function i(){return e("/api/serial_ports")}async function u(r){return e("/api/setup_wizard",{method:"POST",body:JSON.stringify(r)})}export{n as a,i as b,a as g,t as n,u as s}; diff --git a/frontend/dist/assets/share-2-DIHBn1T5.js b/frontend/dist/assets/share-2-ceQyHw_t.js similarity index 91% rename from frontend/dist/assets/share-2-DIHBn1T5.js rename to frontend/dist/assets/share-2-ceQyHw_t.js index 1d305341..29dd1fb9 100644 --- a/frontend/dist/assets/share-2-DIHBn1T5.js +++ b/frontend/dist/assets/share-2-ceQyHw_t.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/shield-CxlpbCLH.js b/frontend/dist/assets/shield-CNxoSMJk.js similarity index 91% rename from frontend/dist/assets/shield-CxlpbCLH.js rename to frontend/dist/assets/shield-CNxoSMJk.js index bd27b08d..cb7362ec 100644 --- a/frontend/dist/assets/shield-CxlpbCLH.js +++ b/frontend/dist/assets/shield-CNxoSMJk.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/shield-check-DX3QVGvb.js b/frontend/dist/assets/shield-check-D7YYO1tX.js similarity index 92% rename from frontend/dist/assets/shield-check-DX3QVGvb.js rename to frontend/dist/assets/shield-check-D7YYO1tX.js index e74fdb93..3a21b7e6 100644 --- a/frontend/dist/assets/shield-check-DX3QVGvb.js +++ b/frontend/dist/assets/shield-check-D7YYO1tX.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/sparkles-GhffQ44V.js b/frontend/dist/assets/sparkles-CIoeyoky.js similarity index 93% rename from frontend/dist/assets/sparkles-GhffQ44V.js rename to frontend/dist/assets/sparkles-CIoeyoky.js index c8a61f99..b1eebdab 100644 --- a/frontend/dist/assets/sparkles-GhffQ44V.js +++ b/frontend/dist/assets/sparkles-CIoeyoky.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/system-CNkSqdfb.js b/frontend/dist/assets/system-MCOv6vDg.js similarity index 69% rename from frontend/dist/assets/system-CNkSqdfb.js rename to frontend/dist/assets/system-MCOv6vDg.js index 00a2ece9..c84aa44b 100644 --- a/frontend/dist/assets/system-CNkSqdfb.js +++ b/frontend/dist/assets/system-MCOv6vDg.js @@ -1 +1 @@ -import{dy as c}from"./index-CAHLMlrb.js";async function t(e){return c("/api/restart_service",{method:"POST",body:"{}",signal:e})}async function o(){return c("/api/check_pymc_console")}export{o as c,t as r}; +import{dy as c}from"./index-CdntfUUz.js";async function t(e){return c("/api/restart_service",{method:"POST",body:"{}",signal:e})}async function o(){return c("/api/check_pymc_console")}export{o as c,t as r}; diff --git a/frontend/dist/assets/target-CAfnTnyS.js b/frontend/dist/assets/target-D6g_GBrY.js similarity index 88% rename from frontend/dist/assets/target-CAfnTnyS.js rename to frontend/dist/assets/target-D6g_GBrY.js index 9849a798..fab451da 100644 --- a/frontend/dist/assets/target-CAfnTnyS.js +++ b/frontend/dist/assets/target-D6g_GBrY.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/thermometer-_L_juB2l.js b/frontend/dist/assets/thermometer-qsOxlDrM.js similarity index 88% rename from frontend/dist/assets/thermometer-_L_juB2l.js rename to frontend/dist/assets/thermometer-qsOxlDrM.js index 6bbd5c41..76401d75 100644 --- a/frontend/dist/assets/thermometer-_L_juB2l.js +++ b/frontend/dist/assets/thermometer-qsOxlDrM.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/timer-DIDXOFnU.js b/frontend/dist/assets/timer-nBNC7t-g.js similarity index 90% rename from frontend/dist/assets/timer-DIDXOFnU.js rename to frontend/dist/assets/timer-nBNC7t-g.js index c5478e45..fb33b8de 100644 --- a/frontend/dist/assets/timer-DIDXOFnU.js +++ b/frontend/dist/assets/timer-nBNC7t-g.js @@ -1,4 +1,4 @@ -import{e}from"./index-CAHLMlrb.js";/** +import{e}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/transport--H030bEh.js b/frontend/dist/assets/transport-DmJP2zwT.js similarity index 92% rename from frontend/dist/assets/transport--H030bEh.js rename to frontend/dist/assets/transport-DmJP2zwT.js index d67edb3f..b96a5afe 100644 --- a/frontend/dist/assets/transport--H030bEh.js +++ b/frontend/dist/assets/transport-DmJP2zwT.js @@ -1 +1 @@ -import{dy as s}from"./index-CAHLMlrb.js";async function r(){return s("/api/transport_keys")}async function c(o){return s("/api/transport_keys",{method:"POST",body:JSON.stringify(o)})}async function i(o,t){return s(`/api/transport_key/${o}`,{method:"PUT",body:JSON.stringify(t)})}async function p(o){return s(`/api/transport_key/${o}`,{method:"DELETE"})}async function l(){var o,t;try{const a=(t=(o=(await s("/api/stats")).config)==null?void 0:o.mesh)==null?void 0:t.unscoped_flood_allow;return typeof a!="boolean"?{success:!1,error:"Unscoped flood policy is unavailable"}:{success:!0,data:{unscoped_flood_allow:a}}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Unscoped flood policy is unavailable"}}}async function d(o){return s("/api/unscoped_flood_policy",{method:"POST",body:JSON.stringify({unscoped_flood_allow:o})})}export{l as a,c,p as d,r as g,d as s,i as u}; +import{dy as s}from"./index-CdntfUUz.js";async function r(){return s("/api/transport_keys")}async function c(o){return s("/api/transport_keys",{method:"POST",body:JSON.stringify(o)})}async function i(o,t){return s(`/api/transport_key/${o}`,{method:"PUT",body:JSON.stringify(t)})}async function p(o){return s(`/api/transport_key/${o}`,{method:"DELETE"})}async function l(){var o,t;try{const a=(t=(o=(await s("/api/stats")).config)==null?void 0:o.mesh)==null?void 0:t.unscoped_flood_allow;return typeof a!="boolean"?{success:!1,error:"Unscoped flood policy is unavailable"}:{success:!0,data:{unscoped_flood_allow:a}}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Unscoped flood policy is unavailable"}}}async function d(o){return s("/api/unscoped_flood_policy",{method:"POST",body:JSON.stringify({unscoped_flood_allow:o})})}export{l as a,c,p as d,r as g,d as s,i as u}; diff --git a/frontend/dist/assets/trash-2-ChI2Sf6Z.js b/frontend/dist/assets/trash-2-Ym16rcs6.js similarity index 91% rename from frontend/dist/assets/trash-2-ChI2Sf6Z.js rename to frontend/dist/assets/trash-2-Ym16rcs6.js index 26780244..55f1c325 100644 --- a/frontend/dist/assets/trash-2-ChI2Sf6Z.js +++ b/frontend/dist/assets/trash-2-Ym16rcs6.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/upload-N2aZrMEC.js b/frontend/dist/assets/upload-D2RzW6Z5.js similarity index 89% rename from frontend/dist/assets/upload-N2aZrMEC.js rename to frontend/dist/assets/upload-D2RzW6Z5.js index 9de1834e..7f3bf65d 100644 --- a/frontend/dist/assets/upload-N2aZrMEC.js +++ b/frontend/dist/assets/upload-D2RzW6Z5.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/use-by-comparator-JYMD8MzS.js b/frontend/dist/assets/use-by-comparator-Dgy5yCaL.js similarity index 80% rename from frontend/dist/assets/use-by-comparator-JYMD8MzS.js rename to frontend/dist/assets/use-by-comparator-Dgy5yCaL.js index 59846bf9..86b22d5a 100644 --- a/frontend/dist/assets/use-by-comparator-JYMD8MzS.js +++ b/frontend/dist/assets/use-by-comparator-Dgy5yCaL.js @@ -1 +1 @@ -import{r as l}from"./index-CAHLMlrb.js";function u(n,t){return n!==null&&t!==null&&typeof n=="object"&&typeof t=="object"&&"id"in n&&"id"in t?n.id===t.id:n===t}function f(n=u){return l.useCallback((t,o)=>{if(typeof n=="string"){let i=n;return(t==null?void 0:t[i])===(o==null?void 0:o[i])}return n(t,o)},[n])}export{f as u}; +import{r as l}from"./index-CdntfUUz.js";function u(n,t){return n!==null&&t!==null&&typeof n=="object"&&typeof t=="object"&&"id"in n&&"id"in t?n.id===t.id:n===t}function f(n=u){return l.useCallback((t,o)=>{if(typeof n=="string"){let i=n;return(t==null?void 0:t[i])===(o==null?void 0:o[i])}return n(t,o)},[n])}export{f as u}; diff --git a/frontend/dist/assets/use-text-value-B1ySk7If.js b/frontend/dist/assets/use-text-value-DFkKaUWL.js similarity index 93% rename from frontend/dist/assets/use-text-value-B1ySk7If.js rename to frontend/dist/assets/use-text-value-DFkKaUWL.js index b5131812..a47516d7 100644 --- a/frontend/dist/assets/use-text-value-B1ySk7If.js +++ b/frontend/dist/assets/use-text-value-DFkKaUWL.js @@ -1 +1 @@ -import{bk as c,r as o,aV as s}from"./index-CAHLMlrb.js";let a=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function f(r){var u,n;let e=(u=r.innerText)!=null?u:"",l=r.cloneNode(!0);if(!c(l))return e;let t=!1;for(let F of l.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))F.remove(),t=!0;let i=t?(n=l.innerText)!=null?n:"":e;return a.test(i)&&(i=i.replace(a,"")),i}function m(r){let u=r.getAttribute("aria-label");if(typeof u=="string")return u.trim();let n=r.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(l=>{let t=document.getElementById(l);if(t){let i=t.getAttribute("aria-label");return typeof i=="string"?i.trim():f(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return f(r).trim()}function g(r){let u=o.useRef(""),n=o.useRef("");return s(()=>{let e=r.current;if(!e)return"";let l=e.innerText;if(u.current===l)return n.current;let t=m(e).trim().toLowerCase();return u.current=l,n.current=t,t})}export{g as s}; +import{bk as c,r as o,aV as s}from"./index-CdntfUUz.js";let a=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function f(r){var u,n;let e=(u=r.innerText)!=null?u:"",l=r.cloneNode(!0);if(!c(l))return e;let t=!1;for(let F of l.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))F.remove(),t=!0;let i=t?(n=l.innerText)!=null?n:"":e;return a.test(i)&&(i=i.replace(a,"")),i}function m(r){let u=r.getAttribute("aria-label");if(typeof u=="string")return u.trim();let n=r.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map(l=>{let t=document.getElementById(l);if(t){let i=t.getAttribute("aria-label");return typeof i=="string"?i.trim():f(t).trim()}return null}).filter(Boolean);if(e.length>0)return e.join(", ")}return f(r).trim()}function g(r){let u=o.useRef(""),n=o.useRef("");return s(()=>{let e=r.current;if(!e)return"";let l=e.innerText;if(u.current===l)return n.current;let t=m(e).trim().toLowerCase();return u.current=l,n.current=t,t})}export{g as s}; diff --git a/frontend/dist/assets/use-tree-walker-DIk49Ly7.js b/frontend/dist/assets/use-tree-walker-DwujlxlX.js similarity index 84% rename from frontend/dist/assets/use-tree-walker-DIk49Ly7.js rename to frontend/dist/assets/use-tree-walker-DwujlxlX.js index db7462d7..f850e624 100644 --- a/frontend/dist/assets/use-tree-walker-DIk49Ly7.js +++ b/frontend/dist/assets/use-tree-walker-DwujlxlX.js @@ -1 +1 @@ -import{r as a,bu as d,da as E}from"./index-CAHLMlrb.js";function x(u,{container:e,accept:r,walk:t}){let n=a.useRef(r),c=a.useRef(t);a.useEffect(()=>{n.current=r,c.current=t},[r,t]),d(()=>{if(!e||!u)return;let o=E(e);if(!o)return;let f=n.current,l=c.current,i=Object.assign(p=>f(p),{acceptNode:f}),s=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)l(s.currentNode)},[e,u,n,c])}export{x as F}; +import{r as a,bu as d,da as E}from"./index-CdntfUUz.js";function x(u,{container:e,accept:r,walk:t}){let n=a.useRef(r),c=a.useRef(t);a.useEffect(()=>{n.current=r,c.current=t},[r,t]),d(()=>{if(!e||!u)return;let o=E(e);if(!o)return;let f=n.current,l=c.current,i=Object.assign(p=>f(p),{acceptNode:f}),s=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,i,!1);for(;s.nextNode();)l(s.currentNode)},[e,u,n,c])}export{x as F}; diff --git a/frontend/dist/assets/useMapViewStore-Dq-l5Xvs.js b/frontend/dist/assets/useMapViewStore-Ciaw6Y-k.js similarity index 97% rename from frontend/dist/assets/useMapViewStore-Dq-l5Xvs.js rename to frontend/dist/assets/useMapViewStore-Ciaw6Y-k.js index 18898d6f..46fdd409 100644 --- a/frontend/dist/assets/useMapViewStore-Dq-l5Xvs.js +++ b/frontend/dist/assets/useMapViewStore-Ciaw6Y-k.js @@ -1,4 +1,4 @@ -import{e as c,r as i,j as g,d2 as m,w as A,gN as h}from"./index-CAHLMlrb.js";import{A as w}from"./index-1IIqkHes.js";/** +import{e as c,r as i,j as g,d2 as m,w as A,gN as h}from"./index-CdntfUUz.js";import{A as w}from"./index-tm_sy7-t.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/usePipelineStore-3uhIJZso.js b/frontend/dist/assets/usePipelineStore-B9TPEPcv.js similarity index 98% rename from frontend/dist/assets/usePipelineStore-3uhIJZso.js rename to frontend/dist/assets/usePipelineStore-B9TPEPcv.js index 7d5ab1e2..ef7aba06 100644 --- a/frontend/dist/assets/usePipelineStore-3uhIJZso.js +++ b/frontend/dist/assets/usePipelineStore-B9TPEPcv.js @@ -1,3 +1,3 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CAHLMlrb.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); -import{ct as ne,cu as re,w as ce,cl as te,r as ie,_ as U,gO as de,at as K,fr as W,gP as le}from"./index-CAHLMlrb.js";import{c as he,m as j,i as z}from"./node-types-CcH5BFf0.js";function oe(e){if(!e||e.length<6)return null;const i=re(e);if(!i||i.offset>=e.length)return null;const n=e.slice(i.offset);return n.length>=38?n.slice(0,38):n}function q(e,i="name-only"){const n=e.decoded;if(!n||!n.decrypted)return null;if(n.macCorrupted)switch(i){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 ue(e){const i=e.indexOf("\0");if(i>0)return{senderName:e.slice(0,i),text:e.slice(i+1)};const n=e.indexOf(": ");if(n>0&&n<=32){const s=e.slice(0,n);if(!s.includes(` -`)&&!s.includes(": "))return{senderName:s,text:e.slice(n+2)}}return{senderName:null,text:e}}function pe(e){if(!e.companion_text)return null;const i=ue(e.companion_text),n=e.companion_channel_idx,s=e.companion_channel_name??(typeof n=="number"?`Channel ${n}`:null);return{senderName:i.senderName,channelName:s,channelHash:e._channelHash??null,text:i.text||null,corrupted:!1,decrypted:!0}}function J(e,i){var p;const n=new Map,s=new Map;for(const o of e){const _=o.payload_type??o.type;if(_!==ne.GRP_TXT)continue;const g=i.get(o.packet_hash);if(!((p=g==null?void 0:g.decoded)!=null&&p.decrypted)||g.decoded.macCorrupted)continue;const c=o._payloadHexPrefix??oe(o.raw_packet);c&&!n.has(c)&&n.set(c,g);const m=o.payload_length??o.length??0,a=Math.floor((o.timestamp??0)/60),y=`${_}:${m}:${a}`;s.has(y)||s.set(y,g)}return{byPayload:n,byApprox:s}}function fe(e,i,n,s="name-only"){const p=e.payload_type??e.type;if(p!==ne.GRP_TXT)return null;const o=i.get(e.packet_hash);if(o){const m=q(o,s);if(m)return m}const _=pe(e);if(_)return _;const g=e._payloadHexPrefix??oe(e.raw_packet),c=(g?n.byPayload.get(g):null)??n.byApprox.get(`${p}:${e.payload_length??e.length??0}:${Math.floor((e.timestamp??0)/60)}`);return c?q(c,s):null}function me(e){return e.name||e.node_name||null}function b(e,i,n,s,p,o,_){return{hash:e,type:i,name:n,isRepeater:i==="repeater",isCompanion:i==="companion",confident:s,advertObservations:p,topologyNeighborCount:o,topologyAffinity:_}}const se=Object.freeze(b(null,"unknown",null,!1,0,0,0)),ye=5,ge={disambiguationEnabled:!0,recencyDecayHours:12,zeroHopDecayHours:72,confidenceThreshold:.6,macCorruptedPolicy:"name-only"};function _e(e){const i=new Map,n=new Map,s=new Map,p=new Map,o=new Map,_=new Map,g=new Map;for(const[a,y]of Object.entries(e)){const l=he(y).type;i.set(a,l);const f=(a.startsWith("0x")?a.slice(2):a).toLowerCase();n.set(f,a);const w=K(a),H=me(y);let M=s.get(w);M||(M=[],s.set(w,M)),M.push({hash:a,name:H,type:l});const v=p.get(w)||{repeaters:0,others:0};if(l==="repeater"?v.repeaters++:v.others++,p.set(w,v),H){_.set(a,H);const P=H.toLowerCase(),D=g.get(P)??0,A=y.last_seen??0;(!o.has(P)||A>D)&&(o.set(P,a),g.set(P,A))}}const c=new Set,m=new Set;for(const[a,y]of p)y.repeaters>0&&y.others>0&&c.add(a),(y.repeaters>=2||y.others>=2)&&m.add(a);return{hashToType:i,pubKeyMap:n,prefixIndex:s,crossClassPrefixes:c,sameClassAmbiguous:m,nameToHash:o,hashToName:_}}function Z(e,i,n,s){const p=new Map(i),o=new Map,_=new Map,g=new Map,c=new Map,m=new Map;for(const a of e){const y=a.timestamp??0;if(a._advertSender){const l=n.get(a._advertSender)??a._advertSender,f=m.get(l);(!f||y>f.lastSeen)&&m.set(l,{lastSeen:y,name:a._advertName??(f==null?void 0:f.name)??null,nodeType:a._advertNodeType!=null?j(a._advertNodeType):(f==null?void 0:f.nodeType)??z(a.type??a.payload_type),latitude:a._advertLatitude??(f==null?void 0:f.latitude),longitude:a._advertLongitude??(f==null?void 0:f.longitude)})}else if(a.src_hash&&a.src_hash.length>8){const l=a.src_hash,f=m.get(l);f?y>f.lastSeen&&(f.lastSeen=y):m.set(l,{lastSeen:y,name:null,nodeType:z(a.type??a.payload_type)})}if(a._advertNodeType==null&&!a._advertName)continue;const N=a._advertSender;if(a._advertNodeType!=null){let l;if(N&&(l=n.get(N)),!l&&a.src_hash&&p.has(a.src_hash)&&(l=a.src_hash),l){const f=p.get(l);if(!f||f==="unknown"){const w=j(a._advertNodeType);w!=="unknown"&&p.set(l,w)}}}if(a._advertName&&N){const l=n.get(N)??N,f=a.timestamp??0,w=a._advertName.toLowerCase();if(!s.has(w)){const M=g.get(w)??0;(!o.has(w)||f>M)&&(o.set(w,l),g.set(w,f))}const H=c.get(l)??0;(!_.has(l)||f>H)&&(_.set(l,a._advertName),c.set(l,f))}}for(const[a,y]of m){const N=p.get(a);N&&N!=="unknown"&&y.nodeType==="unknown"&&(y.nodeType=N)}return{extendedHashToType:p,advertNameToHash:o,advertHashToName:_,discoveredNodes:m}}function k(e,i,n,s,p){var m;const o=new Map,_=new Map;if(i.size===0)return{decryptedNameToHash:o,decryptedHashToName:_};const{prefixIndex:g,nameToHash:c}=n;for(const a of e){if((a.type??a.payload_type)!==ye)continue;const N=i.get(a.packet_hash);if(!((m=N==null?void 0:N.decoded)!=null&&m.decrypted)||N.decoded.macCorrupted)continue;const l=N.decoded.senderName;if(!l)continue;const f=a.src_hash;if(!f)continue;const w=K(f);let H=p.get(w);if(!H){const v=g.get(w);(v==null?void 0:v.length)===1&&(H=v[0].hash)}if(!H&&f.length>4&&(H=f),!H)continue;const M=l.toLowerCase();!c.has(M)&&!s.has(M)&&o.set(M,H),_.has(H)||_.set(H,l)}return{decryptedNameToHash:o,decryptedHashToName:_}}function Ne(e,i,n,s,p,o,_,g,c,m,a){var $,O,F,G,R,T,S;const y=e.src_hash,N=g==null?void 0:g.get(e.packet_hash),l=(($=N==null?void 0:N.decoded)==null?void 0:$.senderName)??null,{nameToHash:f}=i;if(!y){const r=e.type??e.payload_type,t=z(r),h=e._advertName??null;if(l){const u=l.toLowerCase(),x=f.get(u)??s.get(u)??c.get(u);if(x){const C=n.get(x)??t;return b(x,C,l,!0)}return b(null,t!=="unknown"?t:"companion",l,!1)}if(e._advertSender){const{pubKeyMap:u,hashToName:x}=i,C=u.get(e._advertSender);if(C){const V=n.get(C)??t,ae=x.get(C)??p.get(C)??m.get(C)??null;return b(C,V,ae,!0)}const I=p.get(e._advertSender);if(I){const V=n.get(e._advertSender)??t;return b(e._advertSender,V,I,!0)}const Q=m.get(e._advertSender);if(Q){const V=n.get(e._advertSender)??t;return b(e._advertSender,V,Q,!0)}}if(t!=="unknown")return b(null,t,h,!1);if(e._advertNodeType!=null){const u=j(e._advertNodeType);if(u!=="unknown")return b(null,u,h,!1)}return h?b(null,"unknown",h,!1):se}const w=e.type??e.payload_type??-1,H=e._advertSender?`${y}\0${e._advertSender}`:`${y}\0${w}\0${l??""}`,M=a.get(H);if(M)return M;const v=K(y),{pubKeyMap:P,prefixIndex:D,crossClassPrefixes:A,sameClassAmbiguous:X}=i;let d;if(e._advertSender){const r=P.get(e._advertSender);if(r){const t=n.get(r)??"unknown",h=(O=D.get(v))==null?void 0:O.find(u=>u.hash===r);d=b(r,t,(h==null?void 0:h.name)??null,!0)}else if(e._advertNodeType!=null){const t=j(e._advertNodeType);t!=="unknown"&&(d=b(e._advertSender,t,e._advertName??null,!0))}else{const t=p.get(e._advertSender);if(t){const h=n.get(e._advertSender)??z(e.type??e.payload_type);d=b(e._advertSender,h,t,!0)}}}if(!d&&l){const r=D.get(v),t=r==null?void 0:r.find(h=>{var u;return((u=h.name)==null?void 0:u.toLowerCase())===l.toLowerCase()});if(t){const h=n.get(t.hash)??t.type;d=b(t.hash,h,t.name,!0)}else{const h=l.toLowerCase(),u=f.get(h)??s.get(h)??c.get(h);if(u){const x=n.get(u)??"unknown",C=(F=D.get(K(u)))==null?void 0:F.find(I=>I.hash===u);d=b(u,x,(C==null?void 0:C.name)??l,!0)}}}if(!d&&A.has(v)){const r=z(e.type??e.payload_type);if(r!=="unknown"){const t=(G=D.get(v))==null?void 0:G.find(h=>h.type===r);t&&(d=b(t.hash,r,t.name,!0))}if(!d&&e._advertNodeType!=null){const t=j(e._advertNodeType);if(t!=="unknown"){const h=(R=D.get(v))==null?void 0:R.find(u=>u.type===t);h&&(d=b(h.hash,t,h.name,!0))}}if(!d){const t=D.get(v),h=o.get(v),u=h?t==null?void 0:t.find(I=>I.hash===h):t==null?void 0:t[0],x=u?n.get(u.hash)??u.type:"unknown",C=!!h&&!!u&&u.hash===h;d=b((u==null?void 0:u.hash)??null,x,(u==null?void 0:u.name)??null,C)}}if(!d){const r=o.get(v);if(r){const t=n.get(r)??"unknown",h=(T=D.get(v))==null?void 0:T.find(u=>u.hash===r);d=b(r,t,(h==null?void 0:h.name)??null,!0)}}if(!d&&X.has(v)){const r=(S=D.get(v))==null?void 0:S[0];d=b((r==null?void 0:r.hash)??null,(r==null?void 0:r.type)??"unknown",(r==null?void 0:r.name)??null,!1)}if(!d){const r=D.get(v);if((r==null?void 0:r.length)===1){const t=r[0];d=b(t.hash,t.type,t.name,!0)}else d=b(null,z(w),null,!1)}const E=z(w);if(E!=="unknown"&&E!==d.type&&(d=b(d.hash,E,d.name,d.confident)),d.type==="unknown"&&e._advertNodeType!=null){const r=j(e._advertNodeType);r!=="unknown"&&(d=b(d.hash,r,d.name,d.confident))}if(d.hash){const r=_.get(v);if(r){const t=r.find(h=>h.hash===d.hash);if(t){let h=0;const u=e.original_path??e.forwarded_path;if(u&&Array.isArray(u)&&u.length>0&&t.totalForwarderObservations>0){const x=new Set;for(const C of u){const I=String(C).toUpperCase().slice(0,2);I.length>=2&&I!==v&&x.add(I)}if(x.size>0){let C=0;for(const I of x)t.forwarderPrefixes.has(I)&&C++;h=C/x.size}}d=b(d.hash,d.type,d.name,d.confident,t.advertCount,t.forwarderPrefixes.size,h)}}}if(d.name===null&&d.hash){const r=i.hashToName.get(d.hash)??p.get(d.hash)??m.get(d.hash)??null;r&&(d=b(d.hash,d.type,r,d.confident,d.advertObservations,d.topologyNeighborCount,d.topologyAffinity))}return a.set(H,d),d}const ve={hashToType:new Map,pubKeyMap:new Map,prefixIndex:new Map,crossClassPrefixes:new Set,sameClassAmbiguous:new Set,nameToHash:new Map,hashToName:new Map},Te={byPayload:new Map,byApprox:new Map},L=ce((e,i)=>({config:ge,neighborContext:ve,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:Te,_cache:new Map,_neighborFingerprint:"",_resolverFingerprint:"",_advertScanFingerprint:"",_decodedNameFingerprint:"",_inheritanceFingerprint:"",_decodedContentVersion:0,_lastProcessedQuantizedLen:0,resolveSource:n=>{const s=i();return s.config.disambiguationEnabled?Ne(n,s.neighborContext,s.extendedHashToType,s.advertNameToHash,s.advertHashToName,s.resolverMap,s.topologyProfiles,Y,s.decryptedNameToHash,s.decryptedHashToName,s._cache):se},getDecodedContent:n=>{const s=i(),p=te.getState().messages;return fe(n,p,s.contentInheritanceIndex,s.config.macCorruptedPolicy)},setConfig:n=>{const s={...i().config,...n};e({config:s,_cache:new Map}),B==null||B()},recompute:(n,s,p)=>{const o=i(),{config:_}=o,g=`${Object.keys(s).length}`;let c=o.neighborContext;const m=g!==o._neighborFingerprint;m&&(c=_e(s));const a=n.length>1e5?500:n.length>1e4?200:50,y=Math.floor(n.length/a)*a,N=o._lastProcessedQuantizedLen??0,l=!m&&N>0&&y>N,f=l?N:0,w=`${g}:${y}`;let H=o.extendedHashToType,M=o.advertNameToHash,v=o.advertHashToName,P=o.discoveredNodes;if(w!==o._advertScanFingerprint||m)if(l&&w!==o._advertScanFingerprint&&!m){const T=n.slice(f),S=Z(T,c.hashToType,c.pubKeyMap,c.nameToHash);H=new Map([...o.extendedHashToType,...S.extendedHashToType]),M=new Map([...o.advertNameToHash,...S.advertNameToHash]),v=new Map([...o.advertHashToName,...S.advertHashToName]),P=new Map([...o.discoveredNodes,...S.discoveredNodes])}else{const T=Z(n,c.hashToType,c.pubKeyMap,c.nameToHash);H=T.extendedHashToType,M=T.advertNameToHash,v=T.advertHashToName,P=T.discoveredNodes}const D=`${Object.keys(s).length}:${y}:${c.crossClassPrefixes.size}:${_.recencyDecayHours}:${_.zeroHopDecayHours}`;let A=o.resolverMap,X=o.topologyProfiles;if(D!==o._resolverFingerprint){const T=de(n,s,{recencyDecayHours:_.recencyDecayHours,zeroHopDecayHours:_.zeroHopDecayHours});A=T.resolver,X=T.topologyProfiles}const d=Math.floor(p.size/20)*20,E=`${y}:${d}:${D}`;let $=o.decryptedNameToHash,O=o.decryptedHashToName;if(E!==o._decodedNameFingerprint)if(l&&!m){const T=n.slice(f),S=k(T,p,c,M,A);$=new Map([...o.decryptedNameToHash,...S.decryptedNameToHash]),O=new Map([...o.decryptedHashToName,...S.decryptedHashToName])}else{const T=k(n,p,c,M,A);$=T.decryptedNameToHash,O=T.decryptedHashToName}{const T=[];for(const[S,r]of P)if(r.name===null){const t=c.hashToName.get(S)??v.get(S)??O.get(S)??null;t&&T.push([S,t])}if(T.length>0){P=new Map(P);for(const[S,r]of T){const t=P.get(S);P.set(S,{...t,name:r})}}}const F=new Map(A);for(const[T,S]of $){const r=K(S),t=c.prefixIndex.get(r);if(!t||t.length<=1)continue;const h=t.find(u=>{var x;return((x=u.name)==null?void 0:x.toLowerCase())===T});h&&F.get(r)!==h.hash&&F.set(r,h.hash)}for(const[T,S]of M){const r=K(S),t=c.prefixIndex.get(r);if(!t||t.length<=1)continue;const h=t.find(u=>{var x;return((x=u.name)==null?void 0:x.toLowerCase())===T});h&&F.get(r)!==h.hash&&F.set(r,h.hash)}const G=`${y}:${d}`;let R=o.contentInheritanceIndex;if(G!==o._inheritanceFingerprint)if(l&&!m){const T=n.slice(f),S=J(T,p),r=new Map([...S.byPayload,...o.contentInheritanceIndex.byPayload]),t=new Map([...S.byApprox,...o.contentInheritanceIndex.byApprox]);R={byPayload:r,byApprox:t}}else R=J(n,p);le(F),W.active&&W.emit("pipeline:disambig:recompute",{packets:n.length,neighbors:Object.keys(s).length,decoded:p.size,incremental:l}),e({neighborContext:c,extendedHashToType:H,advertNameToHash:M,advertHashToName:v,resolverMap:A,topologyProfiles:X,decryptedNameToHash:$,decryptedHashToName:O,srcHashResolverMap:F,discoveredNodes:P,contentInheritanceIndex:R,_cache:new Map,_neighborFingerprint:g,_resolverFingerprint:D,_advertScanFingerprint:w,_decodedNameFingerprint:E,_inheritanceFingerprint:G,_decodedContentVersion:o._decodedContentVersion+1,_lastProcessedQuantizedLen:y})}}));let Y=new Map,B=null;function ee(e,i){var p,o,_,g;if(!(i!=null&&i.public_key))return e;const n=i.public_key.toLowerCase(),s=n.startsWith("0x")?n.slice(2):n;for(const c of Object.keys(e))if((c.startsWith("0x")?c.slice(2):c).toLowerCase()===s)return e;return{...e,[i.public_key]:{name:i.node_name,node_name:i.node_name,contact_type:"Repeater",is_repeater:!0,last_seen:Date.now()/1e3,latitude:(o=(p=i.config)==null?void 0:p.repeater)==null?void 0:o.latitude,longitude:(g=(_=i.config)==null?void 0:_.repeater)==null?void 0:g.longitude,zero_hop:!0}}}if(typeof window<"u"){let e=function(){if(!n)return 150;const c=n.useStore.getState().packets.length;return c>1e5?1e3:c>1e4?500:150},i=function(){g&&clearTimeout(g),g=setTimeout(()=>{var l;if(g=null,!n||!s)return;const c=n.useStore.getState(),m=s.useDecodedMessagesStore.getState(),a=c.packets,y=ee(((l=c.stats)==null?void 0:l.neighbors)??{},c.stats),N=m.stableMessages;L.getState().recompute(a,y,N)},e())},n=null,s=null,p=[],o,_=new Map,g=null;B=i,setTimeout(()=>{U(()=>import("./index-CAHLMlrb.js").then(c=>c.hG),__vite__mapDeps([0,1])).then(c=>{var y,N;n=c,c.useStore.subscribe(l=>{var H,M;const f=l.packets!==p,w=((H=l.stats)==null?void 0:H.neighbors)!==o;(f||w)&&(p=l.packets,o=(M=l.stats)==null?void 0:M.neighbors,i())});const m=c.useStore.getState();p=m.packets,o=(y=m.stats)==null?void 0:y.neighbors;const a=ee(((N=m.stats)==null?void 0:N.neighbors)??{},m.stats);(p.length>0||Object.keys(a).length>0)&&L.getState().recompute(p,a,new Map)}),U(()=>import("./index-CAHLMlrb.js").then(c=>c.hF),__vite__mapDeps([0,1])).then(c=>{s=c,Y=c.useDecodedMessagesStore.getState().messages,c.useDecodedMessagesStore.subscribe(m=>{m.messages!==Y&&(Y=m.messages),m.stableMessages!==_&&(_=m.stableMessages,i())})})},0)}const Se=L;function be(){return L(e=>e.resolveSource)}function Me(){return L(e=>e.neighborContext)}function xe(){return L(e=>e.topologyProfiles)}function Ce(){return L(e=>e.advertNameToHash)}function Pe(){const e=L(s=>s.getDecodedContent),i=L(s=>s._decodedContentVersion),n=te(s=>s._successCount);return ie.useCallback(s=>e(s),[e,i,n])}function De(){return L(e=>e.config)}function Ie(){return L(e=>e.srcHashResolverMap)}function Le(){return L(e=>e.discoveredNodes)}export{ge as DEFAULT_PIPELINE_CONFIG,Ce as useAdvertNameToHash,Le as useDiscoveredNodes,Pe as useGetDecodedContent,Me as useNeighborContext,De as usePipelineConfig,Se as usePipelineStore,be as useResolveSource,Ie as useSrcHashResolverMap,xe as useTopologyProfiles}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CdntfUUz.js","assets/index-6Dqm8vG_.css"])))=>i.map(i=>d[i]); +import{ct as ne,cu as re,w as ce,cl as te,r as ie,_ as U,gO as de,at as K,fr as W,gP as le}from"./index-CdntfUUz.js";import{c as he,m as j,i as z}from"./node-types-rkAZo2WA.js";function oe(e){if(!e||e.length<6)return null;const i=re(e);if(!i||i.offset>=e.length)return null;const n=e.slice(i.offset);return n.length>=38?n.slice(0,38):n}function q(e,i="name-only"){const n=e.decoded;if(!n||!n.decrypted)return null;if(n.macCorrupted)switch(i){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 ue(e){const i=e.indexOf("\0");if(i>0)return{senderName:e.slice(0,i),text:e.slice(i+1)};const n=e.indexOf(": ");if(n>0&&n<=32){const s=e.slice(0,n);if(!s.includes(` +`)&&!s.includes(": "))return{senderName:s,text:e.slice(n+2)}}return{senderName:null,text:e}}function pe(e){if(!e.companion_text)return null;const i=ue(e.companion_text),n=e.companion_channel_idx,s=e.companion_channel_name??(typeof n=="number"?`Channel ${n}`:null);return{senderName:i.senderName,channelName:s,channelHash:e._channelHash??null,text:i.text||null,corrupted:!1,decrypted:!0}}function J(e,i){var p;const n=new Map,s=new Map;for(const o of e){const _=o.payload_type??o.type;if(_!==ne.GRP_TXT)continue;const g=i.get(o.packet_hash);if(!((p=g==null?void 0:g.decoded)!=null&&p.decrypted)||g.decoded.macCorrupted)continue;const c=o._payloadHexPrefix??oe(o.raw_packet);c&&!n.has(c)&&n.set(c,g);const m=o.payload_length??o.length??0,a=Math.floor((o.timestamp??0)/60),y=`${_}:${m}:${a}`;s.has(y)||s.set(y,g)}return{byPayload:n,byApprox:s}}function fe(e,i,n,s="name-only"){const p=e.payload_type??e.type;if(p!==ne.GRP_TXT)return null;const o=i.get(e.packet_hash);if(o){const m=q(o,s);if(m)return m}const _=pe(e);if(_)return _;const g=e._payloadHexPrefix??oe(e.raw_packet),c=(g?n.byPayload.get(g):null)??n.byApprox.get(`${p}:${e.payload_length??e.length??0}:${Math.floor((e.timestamp??0)/60)}`);return c?q(c,s):null}function me(e){return e.name||e.node_name||null}function b(e,i,n,s,p,o,_){return{hash:e,type:i,name:n,isRepeater:i==="repeater",isCompanion:i==="companion",confident:s,advertObservations:p,topologyNeighborCount:o,topologyAffinity:_}}const se=Object.freeze(b(null,"unknown",null,!1,0,0,0)),ye=5,ge={disambiguationEnabled:!0,recencyDecayHours:12,zeroHopDecayHours:72,confidenceThreshold:.6,macCorruptedPolicy:"name-only"};function _e(e){const i=new Map,n=new Map,s=new Map,p=new Map,o=new Map,_=new Map,g=new Map;for(const[a,y]of Object.entries(e)){const l=he(y).type;i.set(a,l);const f=(a.startsWith("0x")?a.slice(2):a).toLowerCase();n.set(f,a);const w=K(a),H=me(y);let M=s.get(w);M||(M=[],s.set(w,M)),M.push({hash:a,name:H,type:l});const v=p.get(w)||{repeaters:0,others:0};if(l==="repeater"?v.repeaters++:v.others++,p.set(w,v),H){_.set(a,H);const P=H.toLowerCase(),D=g.get(P)??0,A=y.last_seen??0;(!o.has(P)||A>D)&&(o.set(P,a),g.set(P,A))}}const c=new Set,m=new Set;for(const[a,y]of p)y.repeaters>0&&y.others>0&&c.add(a),(y.repeaters>=2||y.others>=2)&&m.add(a);return{hashToType:i,pubKeyMap:n,prefixIndex:s,crossClassPrefixes:c,sameClassAmbiguous:m,nameToHash:o,hashToName:_}}function Z(e,i,n,s){const p=new Map(i),o=new Map,_=new Map,g=new Map,c=new Map,m=new Map;for(const a of e){const y=a.timestamp??0;if(a._advertSender){const l=n.get(a._advertSender)??a._advertSender,f=m.get(l);(!f||y>f.lastSeen)&&m.set(l,{lastSeen:y,name:a._advertName??(f==null?void 0:f.name)??null,nodeType:a._advertNodeType!=null?j(a._advertNodeType):(f==null?void 0:f.nodeType)??z(a.type??a.payload_type),latitude:a._advertLatitude??(f==null?void 0:f.latitude),longitude:a._advertLongitude??(f==null?void 0:f.longitude)})}else if(a.src_hash&&a.src_hash.length>8){const l=a.src_hash,f=m.get(l);f?y>f.lastSeen&&(f.lastSeen=y):m.set(l,{lastSeen:y,name:null,nodeType:z(a.type??a.payload_type)})}if(a._advertNodeType==null&&!a._advertName)continue;const N=a._advertSender;if(a._advertNodeType!=null){let l;if(N&&(l=n.get(N)),!l&&a.src_hash&&p.has(a.src_hash)&&(l=a.src_hash),l){const f=p.get(l);if(!f||f==="unknown"){const w=j(a._advertNodeType);w!=="unknown"&&p.set(l,w)}}}if(a._advertName&&N){const l=n.get(N)??N,f=a.timestamp??0,w=a._advertName.toLowerCase();if(!s.has(w)){const M=g.get(w)??0;(!o.has(w)||f>M)&&(o.set(w,l),g.set(w,f))}const H=c.get(l)??0;(!_.has(l)||f>H)&&(_.set(l,a._advertName),c.set(l,f))}}for(const[a,y]of m){const N=p.get(a);N&&N!=="unknown"&&y.nodeType==="unknown"&&(y.nodeType=N)}return{extendedHashToType:p,advertNameToHash:o,advertHashToName:_,discoveredNodes:m}}function k(e,i,n,s,p){var m;const o=new Map,_=new Map;if(i.size===0)return{decryptedNameToHash:o,decryptedHashToName:_};const{prefixIndex:g,nameToHash:c}=n;for(const a of e){if((a.type??a.payload_type)!==ye)continue;const N=i.get(a.packet_hash);if(!((m=N==null?void 0:N.decoded)!=null&&m.decrypted)||N.decoded.macCorrupted)continue;const l=N.decoded.senderName;if(!l)continue;const f=a.src_hash;if(!f)continue;const w=K(f);let H=p.get(w);if(!H){const v=g.get(w);(v==null?void 0:v.length)===1&&(H=v[0].hash)}if(!H&&f.length>4&&(H=f),!H)continue;const M=l.toLowerCase();!c.has(M)&&!s.has(M)&&o.set(M,H),_.has(H)||_.set(H,l)}return{decryptedNameToHash:o,decryptedHashToName:_}}function Ne(e,i,n,s,p,o,_,g,c,m,a){var $,O,F,G,R,T,S;const y=e.src_hash,N=g==null?void 0:g.get(e.packet_hash),l=(($=N==null?void 0:N.decoded)==null?void 0:$.senderName)??null,{nameToHash:f}=i;if(!y){const r=e.type??e.payload_type,t=z(r),h=e._advertName??null;if(l){const u=l.toLowerCase(),x=f.get(u)??s.get(u)??c.get(u);if(x){const C=n.get(x)??t;return b(x,C,l,!0)}return b(null,t!=="unknown"?t:"companion",l,!1)}if(e._advertSender){const{pubKeyMap:u,hashToName:x}=i,C=u.get(e._advertSender);if(C){const V=n.get(C)??t,ae=x.get(C)??p.get(C)??m.get(C)??null;return b(C,V,ae,!0)}const I=p.get(e._advertSender);if(I){const V=n.get(e._advertSender)??t;return b(e._advertSender,V,I,!0)}const Q=m.get(e._advertSender);if(Q){const V=n.get(e._advertSender)??t;return b(e._advertSender,V,Q,!0)}}if(t!=="unknown")return b(null,t,h,!1);if(e._advertNodeType!=null){const u=j(e._advertNodeType);if(u!=="unknown")return b(null,u,h,!1)}return h?b(null,"unknown",h,!1):se}const w=e.type??e.payload_type??-1,H=e._advertSender?`${y}\0${e._advertSender}`:`${y}\0${w}\0${l??""}`,M=a.get(H);if(M)return M;const v=K(y),{pubKeyMap:P,prefixIndex:D,crossClassPrefixes:A,sameClassAmbiguous:X}=i;let d;if(e._advertSender){const r=P.get(e._advertSender);if(r){const t=n.get(r)??"unknown",h=(O=D.get(v))==null?void 0:O.find(u=>u.hash===r);d=b(r,t,(h==null?void 0:h.name)??null,!0)}else if(e._advertNodeType!=null){const t=j(e._advertNodeType);t!=="unknown"&&(d=b(e._advertSender,t,e._advertName??null,!0))}else{const t=p.get(e._advertSender);if(t){const h=n.get(e._advertSender)??z(e.type??e.payload_type);d=b(e._advertSender,h,t,!0)}}}if(!d&&l){const r=D.get(v),t=r==null?void 0:r.find(h=>{var u;return((u=h.name)==null?void 0:u.toLowerCase())===l.toLowerCase()});if(t){const h=n.get(t.hash)??t.type;d=b(t.hash,h,t.name,!0)}else{const h=l.toLowerCase(),u=f.get(h)??s.get(h)??c.get(h);if(u){const x=n.get(u)??"unknown",C=(F=D.get(K(u)))==null?void 0:F.find(I=>I.hash===u);d=b(u,x,(C==null?void 0:C.name)??l,!0)}}}if(!d&&A.has(v)){const r=z(e.type??e.payload_type);if(r!=="unknown"){const t=(G=D.get(v))==null?void 0:G.find(h=>h.type===r);t&&(d=b(t.hash,r,t.name,!0))}if(!d&&e._advertNodeType!=null){const t=j(e._advertNodeType);if(t!=="unknown"){const h=(R=D.get(v))==null?void 0:R.find(u=>u.type===t);h&&(d=b(h.hash,t,h.name,!0))}}if(!d){const t=D.get(v),h=o.get(v),u=h?t==null?void 0:t.find(I=>I.hash===h):t==null?void 0:t[0],x=u?n.get(u.hash)??u.type:"unknown",C=!!h&&!!u&&u.hash===h;d=b((u==null?void 0:u.hash)??null,x,(u==null?void 0:u.name)??null,C)}}if(!d){const r=o.get(v);if(r){const t=n.get(r)??"unknown",h=(T=D.get(v))==null?void 0:T.find(u=>u.hash===r);d=b(r,t,(h==null?void 0:h.name)??null,!0)}}if(!d&&X.has(v)){const r=(S=D.get(v))==null?void 0:S[0];d=b((r==null?void 0:r.hash)??null,(r==null?void 0:r.type)??"unknown",(r==null?void 0:r.name)??null,!1)}if(!d){const r=D.get(v);if((r==null?void 0:r.length)===1){const t=r[0];d=b(t.hash,t.type,t.name,!0)}else d=b(null,z(w),null,!1)}const E=z(w);if(E!=="unknown"&&E!==d.type&&(d=b(d.hash,E,d.name,d.confident)),d.type==="unknown"&&e._advertNodeType!=null){const r=j(e._advertNodeType);r!=="unknown"&&(d=b(d.hash,r,d.name,d.confident))}if(d.hash){const r=_.get(v);if(r){const t=r.find(h=>h.hash===d.hash);if(t){let h=0;const u=e.original_path??e.forwarded_path;if(u&&Array.isArray(u)&&u.length>0&&t.totalForwarderObservations>0){const x=new Set;for(const C of u){const I=String(C).toUpperCase().slice(0,2);I.length>=2&&I!==v&&x.add(I)}if(x.size>0){let C=0;for(const I of x)t.forwarderPrefixes.has(I)&&C++;h=C/x.size}}d=b(d.hash,d.type,d.name,d.confident,t.advertCount,t.forwarderPrefixes.size,h)}}}if(d.name===null&&d.hash){const r=i.hashToName.get(d.hash)??p.get(d.hash)??m.get(d.hash)??null;r&&(d=b(d.hash,d.type,r,d.confident,d.advertObservations,d.topologyNeighborCount,d.topologyAffinity))}return a.set(H,d),d}const ve={hashToType:new Map,pubKeyMap:new Map,prefixIndex:new Map,crossClassPrefixes:new Set,sameClassAmbiguous:new Set,nameToHash:new Map,hashToName:new Map},Te={byPayload:new Map,byApprox:new Map},L=ce((e,i)=>({config:ge,neighborContext:ve,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:Te,_cache:new Map,_neighborFingerprint:"",_resolverFingerprint:"",_advertScanFingerprint:"",_decodedNameFingerprint:"",_inheritanceFingerprint:"",_decodedContentVersion:0,_lastProcessedQuantizedLen:0,resolveSource:n=>{const s=i();return s.config.disambiguationEnabled?Ne(n,s.neighborContext,s.extendedHashToType,s.advertNameToHash,s.advertHashToName,s.resolverMap,s.topologyProfiles,Y,s.decryptedNameToHash,s.decryptedHashToName,s._cache):se},getDecodedContent:n=>{const s=i(),p=te.getState().messages;return fe(n,p,s.contentInheritanceIndex,s.config.macCorruptedPolicy)},setConfig:n=>{const s={...i().config,...n};e({config:s,_cache:new Map}),B==null||B()},recompute:(n,s,p)=>{const o=i(),{config:_}=o,g=`${Object.keys(s).length}`;let c=o.neighborContext;const m=g!==o._neighborFingerprint;m&&(c=_e(s));const a=n.length>1e5?500:n.length>1e4?200:50,y=Math.floor(n.length/a)*a,N=o._lastProcessedQuantizedLen??0,l=!m&&N>0&&y>N,f=l?N:0,w=`${g}:${y}`;let H=o.extendedHashToType,M=o.advertNameToHash,v=o.advertHashToName,P=o.discoveredNodes;if(w!==o._advertScanFingerprint||m)if(l&&w!==o._advertScanFingerprint&&!m){const T=n.slice(f),S=Z(T,c.hashToType,c.pubKeyMap,c.nameToHash);H=new Map([...o.extendedHashToType,...S.extendedHashToType]),M=new Map([...o.advertNameToHash,...S.advertNameToHash]),v=new Map([...o.advertHashToName,...S.advertHashToName]),P=new Map([...o.discoveredNodes,...S.discoveredNodes])}else{const T=Z(n,c.hashToType,c.pubKeyMap,c.nameToHash);H=T.extendedHashToType,M=T.advertNameToHash,v=T.advertHashToName,P=T.discoveredNodes}const D=`${Object.keys(s).length}:${y}:${c.crossClassPrefixes.size}:${_.recencyDecayHours}:${_.zeroHopDecayHours}`;let A=o.resolverMap,X=o.topologyProfiles;if(D!==o._resolverFingerprint){const T=de(n,s,{recencyDecayHours:_.recencyDecayHours,zeroHopDecayHours:_.zeroHopDecayHours});A=T.resolver,X=T.topologyProfiles}const d=Math.floor(p.size/20)*20,E=`${y}:${d}:${D}`;let $=o.decryptedNameToHash,O=o.decryptedHashToName;if(E!==o._decodedNameFingerprint)if(l&&!m){const T=n.slice(f),S=k(T,p,c,M,A);$=new Map([...o.decryptedNameToHash,...S.decryptedNameToHash]),O=new Map([...o.decryptedHashToName,...S.decryptedHashToName])}else{const T=k(n,p,c,M,A);$=T.decryptedNameToHash,O=T.decryptedHashToName}{const T=[];for(const[S,r]of P)if(r.name===null){const t=c.hashToName.get(S)??v.get(S)??O.get(S)??null;t&&T.push([S,t])}if(T.length>0){P=new Map(P);for(const[S,r]of T){const t=P.get(S);P.set(S,{...t,name:r})}}}const F=new Map(A);for(const[T,S]of $){const r=K(S),t=c.prefixIndex.get(r);if(!t||t.length<=1)continue;const h=t.find(u=>{var x;return((x=u.name)==null?void 0:x.toLowerCase())===T});h&&F.get(r)!==h.hash&&F.set(r,h.hash)}for(const[T,S]of M){const r=K(S),t=c.prefixIndex.get(r);if(!t||t.length<=1)continue;const h=t.find(u=>{var x;return((x=u.name)==null?void 0:x.toLowerCase())===T});h&&F.get(r)!==h.hash&&F.set(r,h.hash)}const G=`${y}:${d}`;let R=o.contentInheritanceIndex;if(G!==o._inheritanceFingerprint)if(l&&!m){const T=n.slice(f),S=J(T,p),r=new Map([...S.byPayload,...o.contentInheritanceIndex.byPayload]),t=new Map([...S.byApprox,...o.contentInheritanceIndex.byApprox]);R={byPayload:r,byApprox:t}}else R=J(n,p);le(F),W.active&&W.emit("pipeline:disambig:recompute",{packets:n.length,neighbors:Object.keys(s).length,decoded:p.size,incremental:l}),e({neighborContext:c,extendedHashToType:H,advertNameToHash:M,advertHashToName:v,resolverMap:A,topologyProfiles:X,decryptedNameToHash:$,decryptedHashToName:O,srcHashResolverMap:F,discoveredNodes:P,contentInheritanceIndex:R,_cache:new Map,_neighborFingerprint:g,_resolverFingerprint:D,_advertScanFingerprint:w,_decodedNameFingerprint:E,_inheritanceFingerprint:G,_decodedContentVersion:o._decodedContentVersion+1,_lastProcessedQuantizedLen:y})}}));let Y=new Map,B=null;function ee(e,i){var p,o,_,g;if(!(i!=null&&i.public_key))return e;const n=i.public_key.toLowerCase(),s=n.startsWith("0x")?n.slice(2):n;for(const c of Object.keys(e))if((c.startsWith("0x")?c.slice(2):c).toLowerCase()===s)return e;return{...e,[i.public_key]:{name:i.node_name,node_name:i.node_name,contact_type:"Repeater",is_repeater:!0,last_seen:Date.now()/1e3,latitude:(o=(p=i.config)==null?void 0:p.repeater)==null?void 0:o.latitude,longitude:(g=(_=i.config)==null?void 0:_.repeater)==null?void 0:g.longitude,zero_hop:!0}}}if(typeof window<"u"){let e=function(){if(!n)return 150;const c=n.useStore.getState().packets.length;return c>1e5?1e3:c>1e4?500:150},i=function(){g&&clearTimeout(g),g=setTimeout(()=>{var l;if(g=null,!n||!s)return;const c=n.useStore.getState(),m=s.useDecodedMessagesStore.getState(),a=c.packets,y=ee(((l=c.stats)==null?void 0:l.neighbors)??{},c.stats),N=m.stableMessages;L.getState().recompute(a,y,N)},e())},n=null,s=null,p=[],o,_=new Map,g=null;B=i,setTimeout(()=>{U(()=>import("./index-CdntfUUz.js").then(c=>c.hG),__vite__mapDeps([0,1])).then(c=>{var y,N;n=c,c.useStore.subscribe(l=>{var H,M;const f=l.packets!==p,w=((H=l.stats)==null?void 0:H.neighbors)!==o;(f||w)&&(p=l.packets,o=(M=l.stats)==null?void 0:M.neighbors,i())});const m=c.useStore.getState();p=m.packets,o=(y=m.stats)==null?void 0:y.neighbors;const a=ee(((N=m.stats)==null?void 0:N.neighbors)??{},m.stats);(p.length>0||Object.keys(a).length>0)&&L.getState().recompute(p,a,new Map)}),U(()=>import("./index-CdntfUUz.js").then(c=>c.hF),__vite__mapDeps([0,1])).then(c=>{s=c,Y=c.useDecodedMessagesStore.getState().messages,c.useDecodedMessagesStore.subscribe(m=>{m.messages!==Y&&(Y=m.messages),m.stableMessages!==_&&(_=m.stableMessages,i())})})},0)}const Se=L;function be(){return L(e=>e.resolveSource)}function Me(){return L(e=>e.neighborContext)}function xe(){return L(e=>e.topologyProfiles)}function Ce(){return L(e=>e.advertNameToHash)}function Pe(){const e=L(s=>s.getDecodedContent),i=L(s=>s._decodedContentVersion),n=te(s=>s._successCount);return ie.useCallback(s=>e(s),[e,i,n])}function De(){return L(e=>e.config)}function Ie(){return L(e=>e.srcHashResolverMap)}function Le(){return L(e=>e.discoveredNodes)}export{ge as DEFAULT_PIPELINE_CONFIG,Ce as useAdvertNameToHash,Le as useDiscoveredNodes,Pe as useGetDecodedContent,Me as useNeighborContext,De as usePipelineConfig,Se as usePipelineStore,be as useResolveSource,Ie as useSrcHashResolverMap,xe as useTopologyProfiles}; diff --git a/frontend/dist/assets/useReplayTick-Cnehmp7d.js b/frontend/dist/assets/useReplayTick-C7ZhPZyZ.js similarity index 97% rename from frontend/dist/assets/useReplayTick-Cnehmp7d.js rename to frontend/dist/assets/useReplayTick-C7ZhPZyZ.js index d7932477..49aa50de 100644 --- a/frontend/dist/assets/useReplayTick-Cnehmp7d.js +++ b/frontend/dist/assets/useReplayTick-C7ZhPZyZ.js @@ -1 +1 @@ -import{w as A,r as S}from"./index-CAHLMlrb.js";import{p as T}from"./payload-detail-CniY19rz.js";function E(t){const r=[];for(const n of t){if(n.is_outgoing)continue;const o=T(n.text);o&&r.push({lat:o.lat,lon:o.lon,timestampS:n.timestamp,senderName:n.sender_name??"Unknown",pathHops:n.path_hops,pathSnr:n.path_snr,pathRssi:n.path_rssi,msgSnr:n.msg_snr})}return r.sort((n,o)=>n.timestampS-o.timestampS),r}function v(t,r){if(t.length===0)return null;if(r<=t[0].timestampS)return{lo:0,hi:0,t:0};if(r>=t[t.length-1].timestampS){const i=t.length-1;return{lo:i,hi:i,t:0}}let n=0,o=t.length-1;for(;n>1;t[i].timestampS<=r?n=i:o=i}const e=t[o].timestampS-t[n].timestampS,a=e>0?(r-t[n].timestampS)/e:0;return{lo:n,hi:o,t:a}}function x(t,r,n,o,e){const a=e*e,i=a*e;return .5*(2*r+(-t+n)*e+(2*t-5*r+4*n-o)*a+(-t+3*r-3*n+o)*i)}function I(t,r,n,o){const e=Math.PI/180,a=(o-r)*e,i=Math.sin(a)*Math.cos(n*e),u=Math.cos(t*e)*Math.sin(n*e)-Math.sin(t*e)*Math.cos(n*e)*Math.cos(a);return(Math.atan2(i,u)*180/Math.PI+360)%360}function b(t,r){if(t.length===0)return null;const n=v(t,r);if(!n)return null;const{lo:o,hi:e,t:a}=n;if(o===e)return{lat:t[o].lat,lon:t[o].lon,bearing:null};const i=Math.max(0,o-1),u=o,h=e,g=Math.min(t.length-1,e+1),s=t[i],c=t[u],f=t[h],d=t[g];let m,p;i===u&&h===g?(m=c.lat+(f.lat-c.lat)*a,p=c.lon+(f.lon-c.lon)*a):(m=x(s.lat,c.lat,f.lat,d.lat,a),p=x(s.lon,c.lon,f.lon,d.lon,a));const P=I(c.lat,c.lon,f.lat,f.lon);return{lat:m,lon:p,bearing:P}}function $(t,r){const n=[];for(const e of t){if(e.timestampS>r)break;n.push([e.lon,e.lat])}const o=b(t,r);if(o&&n.length>0){const e=n[n.length-1];(Math.abs(e[0]-o.lon)>1e-7||Math.abs(e[1]-o.lat)>1e-7)&&n.push([o.lon,o.lat])}return n}function R(t,r){if(t.length===0)return null;if(t.length===1)return{lat:t[0].lat,lon:t[0].lon,bearing:null};const n=t.length-1,o=Math.max(0,Math.min(n,r)),e=Math.floor(o),a=Math.min(e+1,n),i=o-e;if(e===a)return{lat:t[e].lat,lon:t[e].lon,bearing:null};const u=Math.max(0,e-1),h=Math.min(n,a+1),g=t[u],s=t[e],c=t[a],f=t[h];let d,m;u===e&&a===h?(d=s.lat+(c.lat-s.lat)*i,m=s.lon+(c.lon-s.lon)*i):(d=x(g.lat,s.lat,c.lat,f.lat,i),m=x(g.lon,s.lon,c.lon,f.lon,i));const p=I(s.lat,s.lon,c.lat,c.lon);return{lat:d,lon:m,bearing:p}}function F(t,r){if(t.length===0)return[];const n=[],o=R(t,r);o&&n.push([o.lon,o.lat]);const e=Math.ceil(Math.max(0,r));for(let a=e;a0?`${n}:${String(o).padStart(2,"0")}:${String(e).padStart(2,"0")}`:`${o}:${String(e).padStart(2,"0")}`}const K=[2,5,10,20],M={isActive:!1,ownerKey:null,samples:[],isPlaying:!1,speed:5,currentIdx:0,currentTimeS:0,timeRange:{start:0,end:0}},l=A((t,r)=>({...M,startRewind:(n,o)=>{if(n.length<2){t({...M});return}const e=n.length-1,a={start:n[0].timestampS,end:n[e].timestampS};t({isActive:!0,ownerKey:o,samples:n,isPlaying:!0,speed:5,currentIdx:e,currentTimeS:a.end,timeRange:a})},togglePlay:()=>{var a;const{isPlaying:n,currentIdx:o,samples:e}=r();if(n)t({isPlaying:!1});else if(o<=0){const i=e.length-1;t({isPlaying:!0,currentIdx:i,currentTimeS:((a=e[i])==null?void 0:a.timestampS)??0})}else t({isPlaying:!0})},pause:()=>t({isPlaying:!1}),setSpeed:n=>t({speed:n}),seek:n=>{const{samples:o}=r();if(o.length<2)return;const e=o.length-1,a=Math.max(0,Math.min(e,n*e));t({currentIdx:a,currentTimeS:y(o,a)})},stopRewind:()=>t({...M}),tick:n=>{const{isPlaying:o,speed:e,currentIdx:a,samples:i}=r();if(!o||i.length<2)return;const u=e*(n/1e3),h=a-u;h<=0?t({currentIdx:0,currentTimeS:i[0].timestampS,isPlaying:!1}):t({currentIdx:h,currentTimeS:y(i,h)})}}));function y(t,r){if(t.length===0)return 0;const n=t.length-1,o=Math.max(0,Math.min(n,r)),e=Math.floor(o),a=Math.min(e+1,n);if(e===a)return t[e].timestampS;const i=o-e;return t[e].timestampS+i*(t[a].timestampS-t[e].timestampS)}const L=()=>l(t=>t.isActive),W=()=>l(t=>t.ownerKey),k=()=>l(t=>t.isPlaying),q=()=>l(t=>t.currentIdx),B=()=>l(t=>t.currentTimeS),D=()=>l(t=>t.speed),H=()=>l(t=>t.timeRange),N=()=>l(t=>t.samples);function j(){const{isActive:t,samples:r,currentIdx:n}=l.getState();return!t||r.length===0?null:R(r,n)}function O(){var e;const{isActive:t,samples:r,currentIdx:n}=l.getState();if(!t||r.length===0)return;const o=Math.round(Math.max(0,Math.min(r.length-1,n)));return(e=r[o])==null?void 0:e.pathHops}function U(){const t=k(),r=S.useRef(0),n=S.useRef(0);S.useEffect(()=>{if(!t){n.current=0;return}const o=l.getState().tick,e=a=>{if(n.current>0){const i=Math.min(a-n.current,100);o(i)}n.current=a,r.current=requestAnimationFrame(e)};return r.current=requestAnimationFrame(e),()=>{cancelAnimationFrame(r.current),n.current=0}},[t])}export{K as R,k as a,B as b,D as c,H as d,l as e,C as f,E as g,j as h,O as i,N as j,U as k,W as l,q as m,R as p,F as r,$ as t,L as u}; +import{w as A,r as S}from"./index-CdntfUUz.js";import{p as T}from"./payload-detail-D7dyXv-d.js";function E(t){const r=[];for(const n of t){if(n.is_outgoing)continue;const o=T(n.text);o&&r.push({lat:o.lat,lon:o.lon,timestampS:n.timestamp,senderName:n.sender_name??"Unknown",pathHops:n.path_hops,pathSnr:n.path_snr,pathRssi:n.path_rssi,msgSnr:n.msg_snr})}return r.sort((n,o)=>n.timestampS-o.timestampS),r}function v(t,r){if(t.length===0)return null;if(r<=t[0].timestampS)return{lo:0,hi:0,t:0};if(r>=t[t.length-1].timestampS){const i=t.length-1;return{lo:i,hi:i,t:0}}let n=0,o=t.length-1;for(;n>1;t[i].timestampS<=r?n=i:o=i}const e=t[o].timestampS-t[n].timestampS,a=e>0?(r-t[n].timestampS)/e:0;return{lo:n,hi:o,t:a}}function x(t,r,n,o,e){const a=e*e,i=a*e;return .5*(2*r+(-t+n)*e+(2*t-5*r+4*n-o)*a+(-t+3*r-3*n+o)*i)}function I(t,r,n,o){const e=Math.PI/180,a=(o-r)*e,i=Math.sin(a)*Math.cos(n*e),u=Math.cos(t*e)*Math.sin(n*e)-Math.sin(t*e)*Math.cos(n*e)*Math.cos(a);return(Math.atan2(i,u)*180/Math.PI+360)%360}function b(t,r){if(t.length===0)return null;const n=v(t,r);if(!n)return null;const{lo:o,hi:e,t:a}=n;if(o===e)return{lat:t[o].lat,lon:t[o].lon,bearing:null};const i=Math.max(0,o-1),u=o,h=e,g=Math.min(t.length-1,e+1),s=t[i],c=t[u],f=t[h],d=t[g];let m,p;i===u&&h===g?(m=c.lat+(f.lat-c.lat)*a,p=c.lon+(f.lon-c.lon)*a):(m=x(s.lat,c.lat,f.lat,d.lat,a),p=x(s.lon,c.lon,f.lon,d.lon,a));const P=I(c.lat,c.lon,f.lat,f.lon);return{lat:m,lon:p,bearing:P}}function $(t,r){const n=[];for(const e of t){if(e.timestampS>r)break;n.push([e.lon,e.lat])}const o=b(t,r);if(o&&n.length>0){const e=n[n.length-1];(Math.abs(e[0]-o.lon)>1e-7||Math.abs(e[1]-o.lat)>1e-7)&&n.push([o.lon,o.lat])}return n}function R(t,r){if(t.length===0)return null;if(t.length===1)return{lat:t[0].lat,lon:t[0].lon,bearing:null};const n=t.length-1,o=Math.max(0,Math.min(n,r)),e=Math.floor(o),a=Math.min(e+1,n),i=o-e;if(e===a)return{lat:t[e].lat,lon:t[e].lon,bearing:null};const u=Math.max(0,e-1),h=Math.min(n,a+1),g=t[u],s=t[e],c=t[a],f=t[h];let d,m;u===e&&a===h?(d=s.lat+(c.lat-s.lat)*i,m=s.lon+(c.lon-s.lon)*i):(d=x(g.lat,s.lat,c.lat,f.lat,i),m=x(g.lon,s.lon,c.lon,f.lon,i));const p=I(s.lat,s.lon,c.lat,c.lon);return{lat:d,lon:m,bearing:p}}function F(t,r){if(t.length===0)return[];const n=[],o=R(t,r);o&&n.push([o.lon,o.lat]);const e=Math.ceil(Math.max(0,r));for(let a=e;a0?`${n}:${String(o).padStart(2,"0")}:${String(e).padStart(2,"0")}`:`${o}:${String(e).padStart(2,"0")}`}const K=[2,5,10,20],M={isActive:!1,ownerKey:null,samples:[],isPlaying:!1,speed:5,currentIdx:0,currentTimeS:0,timeRange:{start:0,end:0}},l=A((t,r)=>({...M,startRewind:(n,o)=>{if(n.length<2){t({...M});return}const e=n.length-1,a={start:n[0].timestampS,end:n[e].timestampS};t({isActive:!0,ownerKey:o,samples:n,isPlaying:!0,speed:5,currentIdx:e,currentTimeS:a.end,timeRange:a})},togglePlay:()=>{var a;const{isPlaying:n,currentIdx:o,samples:e}=r();if(n)t({isPlaying:!1});else if(o<=0){const i=e.length-1;t({isPlaying:!0,currentIdx:i,currentTimeS:((a=e[i])==null?void 0:a.timestampS)??0})}else t({isPlaying:!0})},pause:()=>t({isPlaying:!1}),setSpeed:n=>t({speed:n}),seek:n=>{const{samples:o}=r();if(o.length<2)return;const e=o.length-1,a=Math.max(0,Math.min(e,n*e));t({currentIdx:a,currentTimeS:y(o,a)})},stopRewind:()=>t({...M}),tick:n=>{const{isPlaying:o,speed:e,currentIdx:a,samples:i}=r();if(!o||i.length<2)return;const u=e*(n/1e3),h=a-u;h<=0?t({currentIdx:0,currentTimeS:i[0].timestampS,isPlaying:!1}):t({currentIdx:h,currentTimeS:y(i,h)})}}));function y(t,r){if(t.length===0)return 0;const n=t.length-1,o=Math.max(0,Math.min(n,r)),e=Math.floor(o),a=Math.min(e+1,n);if(e===a)return t[e].timestampS;const i=o-e;return t[e].timestampS+i*(t[a].timestampS-t[e].timestampS)}const L=()=>l(t=>t.isActive),W=()=>l(t=>t.ownerKey),k=()=>l(t=>t.isPlaying),q=()=>l(t=>t.currentIdx),B=()=>l(t=>t.currentTimeS),D=()=>l(t=>t.speed),H=()=>l(t=>t.timeRange),N=()=>l(t=>t.samples);function j(){const{isActive:t,samples:r,currentIdx:n}=l.getState();return!t||r.length===0?null:R(r,n)}function O(){var e;const{isActive:t,samples:r,currentIdx:n}=l.getState();if(!t||r.length===0)return;const o=Math.round(Math.max(0,Math.min(r.length-1,n)));return(e=r[o])==null?void 0:e.pathHops}function U(){const t=k(),r=S.useRef(0),n=S.useRef(0);S.useEffect(()=>{if(!t){n.current=0;return}const o=l.getState().tick,e=a=>{if(n.current>0){const i=Math.min(a-n.current,100);o(i)}n.current=a,r.current=requestAnimationFrame(e)};return r.current=requestAnimationFrame(e),()=>{cancelAnimationFrame(r.current),n.current=0}},[t])}export{K as R,k as a,B as b,D as c,H as d,l as e,C as f,E as g,j as h,O as i,N as j,U as k,W as l,q as m,R as p,F as r,$ as t,L as u}; diff --git a/frontend/dist/assets/variants-DqP1b_He.js b/frontend/dist/assets/variants-Bez4f_xY.js similarity index 95% rename from frontend/dist/assets/variants-DqP1b_He.js rename to frontend/dist/assets/variants-Bez4f_xY.js index 3ed57bd7..4aff9d76 100644 --- a/frontend/dist/assets/variants-DqP1b_He.js +++ b/frontend/dist/assets/variants-Bez4f_xY.js @@ -1,4 +1,4 @@ -import{e as t,ex as a,ey as i}from"./index-CAHLMlrb.js";/** +import{e as t,ex as a,ey as i}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/wand-sparkles-C18LiNtQ.js b/frontend/dist/assets/wand-sparkles-By2ieoA5.js similarity index 93% rename from frontend/dist/assets/wand-sparkles-C18LiNtQ.js rename to frontend/dist/assets/wand-sparkles-By2ieoA5.js index 6a9c947f..e33577ba 100644 --- a/frontend/dist/assets/wand-sparkles-C18LiNtQ.js +++ b/frontend/dist/assets/wand-sparkles-By2ieoA5.js @@ -1,4 +1,4 @@ -import{e as a}from"./index-CAHLMlrb.js";/** +import{e as a}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/waves-BgBEByoN.js b/frontend/dist/assets/waves-C19BgMIP.js similarity index 92% rename from frontend/dist/assets/waves-BgBEByoN.js rename to frontend/dist/assets/waves-C19BgMIP.js index 0133fcbb..57b57862 100644 --- a/frontend/dist/assets/waves-BgBEByoN.js +++ b/frontend/dist/assets/waves-C19BgMIP.js @@ -1,4 +1,4 @@ -import{e as c}from"./index-CAHLMlrb.js";/** +import{e as c}from"./index-CdntfUUz.js";/** * @license lucide-react v0.559.0 - ISC * * This source code is licensed under the ISC license. diff --git a/frontend/dist/assets/webgl-device-QoBMYpnS-Ch-WmeRM.js b/frontend/dist/assets/webgl-device-QoBMYpnS-DeOuNIG2.js similarity index 99% rename from frontend/dist/assets/webgl-device-QoBMYpnS-Ch-WmeRM.js rename to frontend/dist/assets/webgl-device-QoBMYpnS-DeOuNIG2.js index eced710d..03a2cdd6 100644 --- a/frontend/dist/assets/webgl-device-QoBMYpnS-Ch-WmeRM.js +++ b/frontend/dist/assets/webgl-device-QoBMYpnS-DeOuNIG2.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-C36tfydu.js";import"./index-CAHLMlrb.js";import"./max-D9Y_Gk4E.js";import"./consumer-registry-Bsx-B9R6.js";import"./variants-DqP1b_He.js";import"./git-branch-BIN5tJ3h.js";import"./clock-DB7tKCHV.js";import"./database-BeT3SO6w.js";import"./badge-colors-Dl76Mz8m.js";import"./meshcore-tx-constants-DgpFTAmf.js";import"./WorkspaceNav-ClxMgBhr.js";import"./eye-DQ-O4VIh.js";import"./layers-CU7un-PT.js";import"./search-C1Hut7GR.js";import"./settings-2-DgwT7JNL.js";import"./rotate-ccw-Cav5SApM.js";import"./target-CAfnTnyS.js";import"./network-DsulLblE.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-wRRLz_lr.js";import"./index-CdntfUUz.js";import"./max-DUHCwm37.js";import"./consumer-registry-K46Bg-WH.js";import"./variants-Bez4f_xY.js";import"./git-branch-BfTP80e2.js";import"./clock-DKukpMjT.js";import"./database-D8ZiJ_7E.js";import"./badge-colors-Dl76Mz8m.js";import"./meshcore-tx-constants-DgpFTAmf.js";import"./WorkspaceNav-BZrtCI1_.js";import"./eye-Dc2SU7n8.js";import"./layers-80mLD98M.js";import"./search-D8B8LMYr.js";import"./settings-2-iRV0UHU5.js";import"./rotate-ccw-DyxXzFWc.js";import"./target-D6g_GBrY.js";import"./network-TeIBnbEp.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 vs 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 a8dc1f3e..43bd0674 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "pymc_console", - "version": "0.9.341", + "version": "0.9.342", "description": "Vite + React Dashboard for openHop Repeater", "private": true, "type": "module",