@rr0/ufoathome 0.203.0 → 0.204.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-embed-scene/SceneNames_en--zj8Tlec.js +1 -0
- package/dist-embed-scene/SceneNames_es-toWs7p7i.js +1 -0
- package/dist-embed-scene/SceneNames_fr-w4Xdplid.js +1 -0
- package/dist-embed-scene/SceneNames_it-Cwcscdx7.js +1 -0
- package/dist-embed-scene/rr0-scene.mjs +296 -296
- package/dist-embed-scene/sightingSchema-DoPVOlCB.js +1 -0
- package/dist-embed-sighting/{AdsbLolArchiveProvider-CsuxO9wl.js → AdsbLolArchiveProvider-BSewzrRe.js} +1 -1
- package/dist-embed-sighting/{AirshipEditor-DkDCkwGG.js → AirshipEditor-BiG7EYoB.js} +2 -2
- package/dist-embed-sighting/{AuroraEditor-C4tY9hXK.js → AuroraEditor-C1Y_zbNW.js} +1 -1
- package/dist-embed-sighting/{AuroraSimulation-C7LAHgWM.js → AuroraSimulation-B9GaDXC3.js} +2 -2
- package/dist-embed-sighting/{BallesterGuaspAssessor-BPaiHWd9.js → BallesterGuaspAssessor-BAXmW7XL.js} +1 -1
- package/dist-embed-sighting/BalloonEditor-D54CC7cn.js +24 -0
- package/dist-embed-sighting/{BeamEditor-DDzw-fB_.js → BeamEditor-SHXD10FH.js} +1 -1
- package/dist-embed-sighting/{BeamSystem-CsNwl_vM.js → BeamSystem-CP3J9Jgx.js} +1 -1
- package/dist-embed-sighting/{BirdEditor-BgNNcdhv.js → BirdEditor-BCit7Rs-.js} +1 -1
- package/dist-embed-sighting/{BirdFlock-DBgkxsxp.js → BirdFlock-DhsSOJTg.js} +1 -1
- package/dist-embed-sighting/{CaseReportExport--iqqhu1e.js → CaseReportExport-Dk3rKiVm.js} +2 -2
- package/dist-embed-sighting/{ContrailSystem-Di5w5IVi.js → ContrailSystem-70o5ynhD.js} +1 -1
- package/dist-embed-sighting/ControlPasses-DQMrWqA3.js +29 -0
- package/dist-embed-sighting/{CoverageAssessor-Cu9wP4ZB.js → CoverageAssessor-BdZ85Hmy.js} +1 -1
- package/dist-embed-sighting/{DroneEditor-5nuq52EG.js → DroneEditor-DwQsVj8U.js} +1 -1
- package/dist-embed-sighting/{DroneParameters-DHeJ7KyU.js → DroneParameters-91BBY10Y.js} +1 -1
- package/dist-embed-sighting/{Flightradar24Provider-p4a3_chL.js → Flightradar24Provider-NbfW-lDQ.js} +1 -1
- package/dist-embed-sighting/{GLTFLoader-fbsNsHlp.js → GLTFLoader-CTETHs7e.js} +1 -1
- package/dist-embed-sighting/GenerativeKitMessages-hgIQ_sST.js +1 -0
- package/dist-embed-sighting/{HeadlightSystem-Ce7sHylX.js → HeadlightSystem-ByKGq-30.js} +1 -1
- package/dist-embed-sighting/{HynekAssessor-DWDZGeLY.js → HynekAssessor-O1MFR79v.js} +1 -1
- package/dist-embed-sighting/LanternEditor-X0RgF4mn.js +24 -0
- package/dist-embed-sighting/{LaunchEditor-BGyLgkGS.js → LaunchEditor-oTKLz_5C.js} +1 -1
- package/dist-embed-sighting/{LaunchSimulation-DvexI06i.js → LaunchSimulation-ClRFO1uw.js} +1 -1
- package/dist-embed-sighting/{ModuleSession-_kHZ7Tx3.js → ModuleSession-SivjhuIl.js} +3 -3
- package/dist-embed-sighting/ModuleThree-TrytNggN.js +1 -0
- package/dist-embed-sighting/{NearestApproach-CONyx4c5.js → NearestApproach-BM7B5PuM.js} +1 -1
- package/dist-embed-sighting/{ParameterForm-DFHcolwG.js → ParameterForm-BghOJXLP.js} +1 -1
- package/dist-embed-sighting/{PoherAssessor-DI86qOCu.js → PoherAssessor-DZMtM2pW.js} +1 -1
- package/dist-embed-sighting/PoherMatrix-C2fcLqDH.js +1 -0
- package/dist-embed-sighting/PoherSelfCheck-PJvhaWFK.js +1 -0
- package/dist-embed-sighting/{RailwaySystem-DcJr9BY_.js → RailwaySystem-Dmx9y4gO.js} +1 -1
- package/dist-embed-sighting/{ReentryEditor-C6EJJf4l.js → ReentryEditor-DozmlO_l.js} +1 -1
- package/dist-embed-sighting/{ReentrySimulation-BFVBOWrm.js → ReentrySimulation-WXW1IU2E.js} +1 -1
- package/dist-embed-sighting/{ReferenceSystem-zTvTqp5y.js → ReferenceSystem-BD7gXBee.js} +1 -1
- package/dist-embed-sighting/{RoadMarkings-DvWjbrSf.js → RoadMarkings-Bp07bgso.js} +1 -1
- package/dist-embed-sighting/SceneNames_en-BarwWQKA.js +1 -0
- package/dist-embed-sighting/SceneNames_es-CEdDjAb4.js +1 -0
- package/dist-embed-sighting/SceneNames_fr-m5WHqg-1.js +1 -0
- package/dist-embed-sighting/SceneNames_it-D_H_iZnc.js +1 -0
- package/dist-embed-sighting/{SearchlightEditor-By5Z3ef7.js → SearchlightEditor-BGmKCBrG.js} +1 -1
- package/dist-embed-sighting/{SearchlightSystem-PEMBDW1s.js → SearchlightSystem-5FPRRIkH.js} +1 -1
- package/dist-embed-sighting/SightingMessages_en-DKFVZnDu.js +1 -0
- package/dist-embed-sighting/SightingMessages_es-DYQlWvm0.js +1 -0
- package/dist-embed-sighting/SightingMessages_fr-BygVDDY9.js +1 -0
- package/dist-embed-sighting/SightingMessages_it-BI7GnXPz.js +1 -0
- package/dist-embed-sighting/{SkyLantern-yYihsrun.js → SkyLantern-1Rqy6fNz.js} +1 -1
- package/dist-embed-sighting/{TraceSystem-1K0WblAK.js → TraceSystem-DDlP7sxl.js} +2 -2
- package/dist-embed-sighting/{UfoMessages_en-CwRXodRE.js → UfoMessages_en-DvUA0KYR.js} +1 -1
- package/dist-embed-sighting/{WaterSystem-1VlNXZnO.js → WaterSystem-Ik6QzyT_.js} +2 -2
- package/dist-embed-sighting/rr0-sighting.mjs +344 -325
- package/dist-embed-sighting/sightingSchema-DoPVOlCB.js +1 -0
- package/dist-embed-sighting/{trafficRuntime-BUvbWOcl.js → trafficRuntime-CjDwU1Lk.js} +1 -1
- package/dist-embed-sighting-editor/{AdsbLolArchiveProvider-DNYpHE9t.js → AdsbLolArchiveProvider-CNMGHqqx.js} +1 -1
- package/dist-embed-sighting-editor/{AirshipEditor-B_TQEcNk.js → AirshipEditor-BVlkWwdL.js} +1 -1
- package/dist-embed-sighting-editor/{AirshipFlight-zrtPXNvX.js → AirshipFlight-Cvl6xWPY.js} +1 -1
- package/dist-embed-sighting-editor/{Aurora-wHi_XgNK.js → Aurora-DOIRpjiG.js} +1 -1
- package/dist-embed-sighting-editor/{AuroraEditor-CHAo9LbG.js → AuroraEditor-B0tCM7E7.js} +1 -1
- package/dist-embed-sighting-editor/{AuroraSimulation-CMoKbd0k.js → AuroraSimulation-CX7V0obh.js} +1 -1
- package/dist-embed-sighting-editor/{BallesterGuaspAssessor-Bylahnc2.js → BallesterGuaspAssessor-DEJId5n8.js} +1 -1
- package/dist-embed-sighting-editor/{BalloonEditor-DOmOj25v.js → BalloonEditor-Drb5evP5.js} +1 -1
- package/dist-embed-sighting-editor/{BalloonFlight-DkhpbdZV.js → BalloonFlight-CGXmDbNq.js} +1 -1
- package/dist-embed-sighting-editor/{BeamEditor-CwC6pRPq.js → BeamEditor-DP2LNObR.js} +1 -1
- package/dist-embed-sighting-editor/{BeamSystem-Zsq9zuJa.js → BeamSystem-BCaOtm3H.js} +1 -1
- package/dist-embed-sighting-editor/{BirdEditor-DslUOI4x.js → BirdEditor-CbYZcYyG.js} +1 -1
- package/dist-embed-sighting-editor/{BirdFlock-BoXaV-S_.js → BirdFlock-Dv9Awhvf.js} +1 -1
- package/dist-embed-sighting-editor/{CaseElement-DFnjs2AU.js → CaseElement-4CRoH54h.js} +2 -2
- package/dist-embed-sighting-editor/{CaseReportExport-CX87uNr9.js → CaseReportExport-W1lO4CR3.js} +1 -1
- package/dist-embed-sighting-editor/{ContrailSystem-hUtlCEq-.js → ContrailSystem-ChbOVWp-.js} +1 -1
- package/dist-embed-sighting-editor/{ControlPasses-C8qq_tSL.js → ControlPasses-Dgz_D6DL.js} +1 -1
- package/dist-embed-sighting-editor/{CoverageAssessor-uzQnTEH8.js → CoverageAssessor-CcVuVsG0.js} +1 -1
- package/dist-embed-sighting-editor/{DroneEditor-M2V3FKbS.js → DroneEditor-D6k4gYj4.js} +1 -1
- package/dist-embed-sighting-editor/{DroneFlight-C1bur42A.js → DroneFlight-D-MWhrXa.js} +1 -1
- package/dist-embed-sighting-editor/{DroneParameters-DRfoxMx8.js → DroneParameters-CdQbwFKD.js} +1 -1
- package/dist-embed-sighting-editor/{Flightradar24Provider-BJDB9e9p.js → Flightradar24Provider-D_eLiI9k.js} +1 -1
- package/dist-embed-sighting-editor/{GLTFLoader-CQrldtm5.js → GLTFLoader-BIk0ozTu.js} +1 -1
- package/dist-embed-sighting-editor/{HeadlightSystem-BzXjwGDi.js → HeadlightSystem-C9tLjvpO.js} +1 -1
- package/dist-embed-sighting-editor/{HynekAssessor-Bpze0IeH.js → HynekAssessor-B4ej1xgG.js} +1 -1
- package/dist-embed-sighting-editor/{InterviewEditorElement-C6y-8Wze.js → InterviewEditorElement-Bo4OG2ig.js} +3 -3
- package/dist-embed-sighting-editor/{LanternEditor-6fXL9oHW.js → LanternEditor-Hd-8kmET.js} +1 -1
- package/dist-embed-sighting-editor/{LaserBeam-Cl4c8oJt.js → LaserBeam-Ca2QUeCT.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchEditor-C9swLaSJ.js → LaunchEditor-BykQEscN.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchPlume-CPBS4JLE.js → LaunchPlume-Dos-OyTV.js} +1 -1
- package/dist-embed-sighting-editor/{LaunchSimulation-zjImyFHC.js → LaunchSimulation-B0DgOoJM.js} +1 -1
- package/dist-embed-sighting-editor/{ModelSource-ZiTya13j.js → ModelSource-szsl2QtY.js} +1 -1
- package/dist-embed-sighting-editor/{ModelThumbnails-BKl0Wk33.js → ModelThumbnails-dnCeD6UT.js} +1 -1
- package/dist-embed-sighting-editor/{ModelViewer-ZZnOiYz4.js → ModelViewer-BNGSukqO.js} +1 -1
- package/dist-embed-sighting-editor/{ModuleConformance-CYQ-Mn8w.js → ModuleConformance-CEXxsL48.js} +2 -2
- package/dist-embed-sighting-editor/{ModuleSession-BklqVucx.js → ModuleSession-DOhPD2XZ.js} +2 -2
- package/dist-embed-sighting-editor/ModuleThree-BY0cNbGt.js +1 -0
- package/dist-embed-sighting-editor/{ModulesPanelElement-MEFltyZr.js → ModulesPanelElement-DTnJICg0.js} +3 -3
- package/dist-embed-sighting-editor/{NearestApproach-Bnx9Ld5_.js → NearestApproach-jDpDx7cm.js} +1 -1
- package/dist-embed-sighting-editor/{PoherAssessor-CNj_Nyci.js → PoherAssessor-yWlnEcoZ.js} +1 -1
- package/dist-embed-sighting-editor/{RailwaySystem-Dn-v2OAb.js → RailwaySystem-CAqOaX1c.js} +1 -1
- package/dist-embed-sighting-editor/{ReentryEditor-DPt4At81.js → ReentryEditor-CNLwoAIZ.js} +2 -2
- package/dist-embed-sighting-editor/{ReentrySimulation-DwaQrNN5.js → ReentrySimulation-Q-8h8lRK.js} +1 -1
- package/dist-embed-sighting-editor/{ReferenceSystem-DlaF5KWz.js → ReferenceSystem-B0tZDQ1-.js} +1 -1
- package/dist-embed-sighting-editor/SceneNames_en-CTJiUG-r.js +1 -0
- package/dist-embed-sighting-editor/SceneNames_es-DHZMjSqb.js +1 -0
- package/dist-embed-sighting-editor/SceneNames_fr-C36uyjbM.js +1 -0
- package/dist-embed-sighting-editor/SceneNames_it-BQJQm2rT.js +1 -0
- package/dist-embed-sighting-editor/{SearchlightEditor-CdTMwgER.js → SearchlightEditor-sQh92hx7.js} +1 -1
- package/dist-embed-sighting-editor/{SearchlightSystem-jipCae7J.js → SearchlightSystem-B_RPbGj4.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_en-BmqJK2u_.js → SightingEditorMessages_en-V_dJYjNb.js} +1 -1
- package/{dist-embed-ufoathome/SightingEditorMessages_es-avQMqPMq.js → dist-embed-sighting-editor/SightingEditorMessages_es-DauDuhPa.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_fr-ClEadK1E.js → SightingEditorMessages_fr-zxTvQa2I.js} +1 -1
- package/dist-embed-sighting-editor/{SightingEditorMessages_it-Co5behaA.js → SightingEditorMessages_it-vvaao68O.js} +1 -1
- package/dist-embed-sighting-editor/SightingElement-4YMo_us5.js +694 -0
- package/dist-embed-sighting-editor/{SightingFileEditor-Du3A9uZm.js → SightingFileEditor-tIOJTG_y.js} +1 -1
- package/dist-embed-sighting-editor/SightingLabels_en-dOsFjVRL.js +1 -0
- package/dist-embed-sighting-editor/SightingLabels_es-CKlP2BDO.js +1 -0
- package/dist-embed-sighting-editor/{SightingLabels_fr-D69zENbW.js → SightingLabels_fr-Cpkcf5_9.js} +1 -1
- package/{dist-embed-ufoathome/SightingLabels_it-COLZ2Qth.js → dist-embed-sighting-editor/SightingLabels_it-3127rMXm.js} +1 -1
- package/dist-embed-sighting-editor/{SightingMessages_en-CzICxNU3.js → SightingMessages_en-Drcr3k4V.js} +1 -1
- package/dist-embed-sighting-editor/{SightingMessages_es-CiVFZlgA.js → SightingMessages_es-BcaWM7Oy.js} +1 -1
- package/dist-embed-sighting-editor/{SightingMessages_fr-nopOVDa1.js → SightingMessages_fr-7IYuW095.js} +1 -1
- package/dist-embed-sighting-editor/{SightingMessages_it-Cu0nnPts.js → SightingMessages_it-BhDmZn6p.js} +1 -1
- package/dist-embed-sighting-editor/{SkyLantern-CYhqKOnv.js → SkyLantern-Cj60Cn9B.js} +1 -1
- package/dist-embed-sighting-editor/{TraceSystem-Bj0G3fL7.js → TraceSystem-BK0y5lRX.js} +2 -2
- package/dist-embed-sighting-editor/{WaterSystem-Cv4v7PXz.js → WaterSystem-DMeMEW3i.js} +2 -2
- package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +455 -434
- package/dist-embed-sighting-editor/sightingSchema-DoPVOlCB.js +1 -0
- package/dist-embed-sighting-editor/{trafficRuntime-BdBceXei.js → trafficRuntime-eGXY41n0.js} +1 -1
- package/dist-embed-ufoathome/{AdsbLolArchiveProvider-D169IKdZ.js → AdsbLolArchiveProvider-BJm3HMv9.js} +1 -1
- package/dist-embed-ufoathome/{Aurora-CP_Xi-9o.js → Aurora-DooZfol8.js} +1 -1
- package/dist-embed-ufoathome/{AuroraEditor-B_Rxo_6I.js → AuroraEditor-COl6Uq7r.js} +1 -1
- package/dist-embed-ufoathome/{AuroraSimulation-KHkJyuus.js → AuroraSimulation-8865pkCY.js} +1 -1
- package/dist-embed-ufoathome/{BallesterGuaspAssessor-58lmGHUw.js → BallesterGuaspAssessor-CKK5Iybb.js} +1 -1
- package/dist-embed-ufoathome/{BalloonEditor-CAKXO8DQ.js → BalloonEditor-BBAtMeVM.js} +1 -1
- package/dist-embed-ufoathome/{BeamEditor-BOsTgbHL.js → BeamEditor-D6I1zG9Z.js} +1 -1
- package/dist-embed-ufoathome/{BeamSystem-C7OL1VWr.js → BeamSystem-BI4-w_0X.js} +1 -1
- package/dist-embed-ufoathome/{BodyEditor-DZ9-YBfo.js → BodyEditor-yBNJy9AC.js} +1 -1
- package/dist-embed-ufoathome/{CaseEditorElement-BgT6HnpX.js → CaseEditorElement-CPt1laCe.js} +64 -61
- package/dist-embed-ufoathome/{CaseElement-DVXLO8mr.js → CaseElement-CTZ3YIL0.js} +3 -3
- package/dist-embed-ufoathome/{CaseReportExport-Dui5KDc5.js → CaseReportExport-UNmAQ_xa.js} +3 -3
- package/dist-embed-ufoathome/{ColumnResize-CO4e1m-q.js → ColumnResize-D6vA9JBg.js} +9 -9
- package/dist-embed-ufoathome/{ControlPasses-CJ2jMdlf.js → ControlPasses-Bwafi16d.js} +1 -1
- package/dist-embed-ufoathome/{CoverageAssessor-CzhOt6fv.js → CoverageAssessor-DINhJJFz.js} +1 -1
- package/dist-embed-ufoathome/{Flightradar24Provider-TCNh_VXc.js → Flightradar24Provider-BEVn6h-k.js} +1 -1
- package/dist-embed-ufoathome/{GLTFLoader-BaIfBICM.js → GLTFLoader-CqzCNjEl.js} +1 -1
- package/dist-embed-ufoathome/{GeoJsonExport-B5AFUVEM.js → GeoJsonExport-B4GBH7Ei.js} +1 -1
- package/dist-embed-ufoathome/GeographicFigures-wtF2TmIn.js +1 -0
- package/dist-embed-ufoathome/HynekAssessor-De0RmEd0.js +1 -0
- package/dist-embed-ufoathome/{InterviewEditorElement-o21YUvNz.js → InterviewEditorElement-BVfNqEBS.js} +4 -4
- package/dist-embed-ufoathome/{InterviewElement-K_oIXneA.js → InterviewElement-BBEmBs1S.js} +1 -1
- package/dist-embed-ufoathome/{KmlExport-BfiqE1s2.js → KmlExport-C8yk8C7s.js} +1 -1
- package/dist-embed-ufoathome/{LanternEditor-CepeoImr.js → LanternEditor-DEeA3Kf_.js} +1 -1
- package/dist-embed-ufoathome/{LaserBeam-IRXmv6wc.js → LaserBeam-BGs1pXaE.js} +1 -1
- package/dist-embed-ufoathome/LaunchEditor-CBEW_ih2.js +22 -0
- package/dist-embed-ufoathome/{LaunchPlume-CujlF3wZ.js → LaunchPlume-BbsUUQE0.js} +1 -1
- package/dist-embed-ufoathome/{LaunchSimulation-58_ZZy8q.js → LaunchSimulation-DJJaKJGV.js} +1 -1
- package/dist-embed-ufoathome/{ModelSource-Bz25TN6e.js → ModelSource-B2Ie3T9B.js} +1 -1
- package/dist-embed-ufoathome/{ModelThumbnails-CcYlw6gA.js → ModelThumbnails-BOfC5SZt.js} +1 -1
- package/dist-embed-ufoathome/{ModelViewer-CD90RTYi.js → ModelViewer-CXP4K0sx.js} +1 -1
- package/dist-embed-ufoathome/{ModulesPanelElement-DZxFsuuG.js → ModulesPanelElement-DPkBhz-Y.js} +2 -2
- package/dist-embed-ufoathome/NearestApproach-D2cz2_44.js +1 -0
- package/dist-embed-ufoathome/{PoherAssessor-BkCJ1UTQ.js → PoherAssessor-CNOuLGVz.js} +1 -1
- package/dist-embed-ufoathome/PoherMatrix-C2fcLqDH.js +1 -0
- package/dist-embed-ufoathome/PoherSelfCheck-DnXcStjH.js +1 -0
- package/dist-embed-ufoathome/{ReentryEditor-BjyUUZGU.js → ReentryEditor-BCQM22Ps.js} +1 -1
- package/dist-embed-ufoathome/{ReentrySimulation-5VI9Dla4.js → ReentrySimulation-BFhCb4sM.js} +1 -1
- package/dist-embed-ufoathome/{ReferenceSystem-C0ZXvatV.js → ReferenceSystem-aZKW97nH.js} +1 -1
- package/dist-embed-ufoathome/ScenarioReadings-_IkJEoIB.js +1 -0
- package/dist-embed-ufoathome/ScenarioSweep-DOvp2pYT.js +1 -0
- package/dist-embed-ufoathome/SceneNames_en-sRbx6EJZ.js +1 -0
- package/dist-embed-ufoathome/SceneNames_es-pnfHB-7D.js +1 -0
- package/dist-embed-ufoathome/SceneNames_fr-BtTlti4C.js +1 -0
- package/dist-embed-ufoathome/SceneNames_it-DQKwdCVD.js +1 -0
- package/dist-embed-ufoathome/{SearchlightEditor-DPU1PgfT.js → SearchlightEditor-C8Jwy1VZ.js} +1 -1
- package/dist-embed-ufoathome/{SearchlightSystem-m0a11CEu.js → SearchlightSystem-D2TFaVqO.js} +1 -1
- package/dist-embed-ufoathome/{ShareDialogElement-DqCoQwtn.js → ShareDialogElement-Dsc4v4jd.js} +150 -132
- package/dist-embed-ufoathome/Sighting-C1yj2-s5.js +1 -0
- package/dist-embed-ufoathome/{SightingEditorMessages_en-BmqJK2u_.js → SightingEditorMessages_en-V_dJYjNb.js} +1 -1
- package/{dist-embed-sighting-editor/SightingEditorMessages_es-avQMqPMq.js → dist-embed-ufoathome/SightingEditorMessages_es-DauDuhPa.js} +1 -1
- package/dist-embed-ufoathome/{SightingEditorMessages_fr-ClEadK1E.js → SightingEditorMessages_fr-zxTvQa2I.js} +1 -1
- package/dist-embed-ufoathome/{SightingEditorMessages_it-Co5behaA.js → SightingEditorMessages_it-vvaao68O.js} +1 -1
- package/dist-embed-ufoathome/SightingElement-CFItfa0b.js +694 -0
- package/dist-embed-ufoathome/{SightingFileEditor-DS1DRU2p.js → SightingFileEditor-D5_GwIsn.js} +1 -1
- package/dist-embed-ufoathome/SightingLabels_en-dOsFjVRL.js +1 -0
- package/dist-embed-ufoathome/SightingLabels_es-CKlP2BDO.js +1 -0
- package/dist-embed-ufoathome/{SightingLabels_fr-D69zENbW.js → SightingLabels_fr-Cpkcf5_9.js} +1 -1
- package/{dist-embed-sighting-editor/SightingLabels_it-COLZ2Qth.js → dist-embed-ufoathome/SightingLabels_it-3127rMXm.js} +1 -1
- package/dist-embed-ufoathome/{SightingMessages_en-CzICxNU3.js → SightingMessages_en-Drcr3k4V.js} +1 -1
- package/dist-embed-ufoathome/{SightingMessages_es-CiVFZlgA.js → SightingMessages_es-BcaWM7Oy.js} +1 -1
- package/dist-embed-ufoathome/{SightingMessages_fr-nopOVDa1.js → SightingMessages_fr-7IYuW095.js} +1 -1
- package/dist-embed-ufoathome/{SightingMessages_it-Cu0nnPts.js → SightingMessages_it-BhDmZn6p.js} +1 -1
- package/dist-embed-ufoathome/{TraceSystem-BLumvnJD.js → TraceSystem-_cZ6PZho.js} +1 -1
- package/dist-embed-ufoathome/{VideoButton-hYfTEunC.js → VideoButton-CeAdEi2m.js} +1 -1
- package/dist-embed-ufoathome/rr0-ufoathome.mjs +10 -10
- package/dist-embed-ufoathome/sightingSchema-DoPVOlCB.js +1 -0
- package/dist-embed-ufoathome/{surroundingsSources-BWHnZ_qg.js → surroundingsSources-B7gbT2Pb.js} +1 -1
- package/dist-embed-ufoathome/{trafficRuntime-Xpncp71U.js → trafficRuntime-BKNJgPC4.js} +2 -2
- package/package.json +1 -1
- package/dist-embed-scene/SceneNames_en-BFJsR6Cc.js +0 -1
- package/dist-embed-scene/SceneNames_es-BHBTwcJ3.js +0 -1
- package/dist-embed-scene/SceneNames_fr-CFsA4XeK.js +0 -1
- package/dist-embed-scene/SceneNames_it-DkIgwviv.js +0 -1
- package/dist-embed-scene/sightingSchema-9MogCcUd.js +0 -1
- package/dist-embed-sighting/BalloonEditor-CaWwqWKK.js +0 -24
- package/dist-embed-sighting/ControlPasses-Dr6eP2Mq.js +0 -29
- package/dist-embed-sighting/GenerativeKitMessages-NbyGMKAR.js +0 -1
- package/dist-embed-sighting/LanternEditor-Be5Io1J-.js +0 -24
- package/dist-embed-sighting/ModuleThree-BLNSm2eY.js +0 -1
- package/dist-embed-sighting/SceneNames_en-BlRTU7Hq.js +0 -1
- package/dist-embed-sighting/SceneNames_es-DMNd9trd.js +0 -1
- package/dist-embed-sighting/SceneNames_fr-DlMcv9D0.js +0 -1
- package/dist-embed-sighting/SceneNames_it-DqlWMlOE.js +0 -1
- package/dist-embed-sighting/SightingMessages_en-D3YVhgUj.js +0 -1
- package/dist-embed-sighting/SightingMessages_es-ME6FeTp-.js +0 -1
- package/dist-embed-sighting/SightingMessages_fr-BgXYuIq4.js +0 -1
- package/dist-embed-sighting/SightingMessages_it-DcE90eAl.js +0 -1
- package/dist-embed-sighting/sightingSchema-9MogCcUd.js +0 -1
- package/dist-embed-sighting-editor/ModuleThree-jNUgMjnf.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_en-c5zNw0Hi.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_es-CDjoBwy_.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_fr-CoZNmFu3.js +0 -1
- package/dist-embed-sighting-editor/SceneNames_it-CVEahBpq.js +0 -1
- package/dist-embed-sighting-editor/SightingElement-C6CT6DBZ.js +0 -693
- package/dist-embed-sighting-editor/SightingLabels_en-oIpytoq_.js +0 -1
- package/dist-embed-sighting-editor/SightingLabels_es-DUh1CTXl.js +0 -1
- package/dist-embed-sighting-editor/sightingSchema-9MogCcUd.js +0 -1
- package/dist-embed-ufoathome/GeographicFigures-DrlbDt4f.js +0 -1
- package/dist-embed-ufoathome/HynekAssessor-DaCcWwTH.js +0 -1
- package/dist-embed-ufoathome/LaunchEditor-C4hq0VUw.js +0 -22
- package/dist-embed-ufoathome/NearestApproach-DsszB5Rd.js +0 -1
- package/dist-embed-ufoathome/ScenarioReadings-CBWjF8TY.js +0 -1
- package/dist-embed-ufoathome/ScenarioSweep-MaryBOLs.js +0 -1
- package/dist-embed-ufoathome/SceneNames_en-7OZ7peGc.js +0 -1
- package/dist-embed-ufoathome/SceneNames_es-P5-Mavdi.js +0 -1
- package/dist-embed-ufoathome/SceneNames_fr-qzw0QzD0.js +0 -1
- package/dist-embed-ufoathome/SceneNames_it-Sqf8JFOd.js +0 -1
- package/dist-embed-ufoathome/Sighting-D-_IYi9n.js +0 -1
- package/dist-embed-ufoathome/SightingElement-CUrYpWRD.js +0 -693
- package/dist-embed-ufoathome/SightingLabels_en-oIpytoq_.js +0 -1
- package/dist-embed-ufoathome/SightingLabels_es-DUh1CTXl.js +0 -1
- package/dist-embed-ufoathome/sightingSchema-9MogCcUd.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkyLantern-DJT_Ibzh.js","./Obstacles-v9SkfBD7.js","./LanternEditor-
|
|
2
|
-
const hn="modulepreload",fn=function(n,t){return new URL(n,t).href},ze={},d=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let i=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=i(e.map(m=>{if(m=fn(m,r),m in ze)return;ze[m]=!0;const p=m.endsWith(".css"),f=p?'[rel="stylesheet"]':"";if(!!r)for(let E=a.length-1;E>=0;E--){const G=a[E];if(G.href===m&&(!p||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${f}`))return;const S=document.createElement("link");if(S.rel=p?"stylesheet":hn,p||(S.as="script"),S.crossOrigin="",S.href=m,c&&S.setAttribute("nonce",c),document.head.appendChild(S),p)return new Promise((E,G)=>{S.addEventListener("load",E),S.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},gn="rr0-read",wn="rr0-edit",xe="in-place",yn="rr0-mode";class Xs{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}class j{constructor(t){this.entries=t}static same(t,e){return typeof t=="number"&&typeof e=="number"?t===e||Math.abs(t-e)<=1e-9*Math.max(1,Math.abs(t),Math.abs(e)):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>j.same(r,e[s])):typeof t=="object"&&t!==null&&typeof e=="object"&&e!==null&&!Array.isArray(t)&&!Array.isArray(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>j.same(t[s],e[s])):t===e}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new j(new Map)}get size(){return this.entries.size}at(t){return this.entries.get(t)}paths(){return[...this.entries.keys()]}sourced(){return[...this.entries].filter(([,t])=>t.source!==void 0).map(([t,e])=>({path:t,basis:e.basis,source:e.source}))}interviewsCited(){const t=[];for(const{source:e}of this.sourced()){const r=e.said?.interview;r!==void 0&&!t.includes(r)&&t.push(r)}return t}pathsFromInterview(t){return this.sourced().filter(({source:e})=>e.said!==void 0&&e.said.interview===t).map(({path:e})=>e)}set(t,e){e.basis==="stated"&&e.rationale===void 0&&e.how===void 0&&e.range===void 0&&e.source===void 0?this.entries.delete(t):this.entries.set(t,e)}clear(t){for(const e of this.entries.keys())(e===t||e.startsWith(`${t}.`))&&this.entries.delete(e)}static strip(t){const e=new j(new Map);return{recording:j.stripValue(t,[],e),provenance:e}}static restore(t,e){if(e.size===0)return t;const r={...t},s=new Set([r]);for(const o of e.paths()){const i=e.at(o),a=o.split("."),l=j.writableHolderOf(r,a,s);if(!l)continue;const c=a[a.length-1],m=l[c];m!==void 0&&(i.of!==void 0&&!j.same(i.of,m)||(l[c]={value:m,...i.basis==="stated"?{}:{basis:i.basis},...i.rationale===void 0?{}:{rationale:i.rationale},...i.how===void 0?{}:{how:i.how},...i.range===void 0?{}:{range:i.range},...i.source===void 0?{}:{source:i.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return j.isWrapper(t)?(r.set(e.join("."),{basis:t.basis??"stated",...t.rationale===void 0?{}:{rationale:t.rationale},...t.how===void 0?{}:{how:t.how},...t.range===void 0?{}:{range:t.range},...t.source===void 0?{}:{source:t.source},of:t.value}),j.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>j.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,j.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const i=s[o];if(typeof i!="object"||i===null)return;if(r.has(i)){s=i;continue}const a=Array.isArray(i)?[...i]:{...i};r.add(a),s[o]=a,s=a}return s}}class bn extends Error{constructor(t,e,r){super(typeof e=="number"&&Number.isInteger(e)&&e>=1?`This ${t} file is in version ${e} of its format; this UFO@home reads version ${r}. Read it with the UFO@home that reads its version.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=r,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class ht{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=ht.CURRENT[t]){return`${ht.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static recording(t){return ht.check(t,"sighting")}static check(t,e){const r=ht.of(t),s=ht.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new bn(e,r,s);return t}}class _{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>_.itemsOf(t,r.key).length===0||_.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>_.itemsOf(t,r.key).length>0&&!_.computers.has(r)).map(r=>{let s=_.loading.get(r);return s||(s=r.compute().then(o=>{_.computers.set(r,o)}),s.catch(()=>_.loading.delete(r)),_.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=_.built.get(t);return e||(e=t.create(),_.built.set(t,e)),e}static itemsOf(t,e){const r=t?.[e];return Array.isArray(r)?r:[]}static computes(t,e){return e.some(r=>_.itemsOf(t,r.key).length>0)}static expand(t,e,r){return _.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!_.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const i=e.flatMap(a=>_.itemsOf(t,a.key).flatMap(l=>{const c=_.computers.get(a);if(!c)return[];const m=c(l,r),p=a.phenomenon?.(l);for(const f of m)s.set(f.id,a),p&&o.set(f.id,p);return m}));return{interpretation:{...t,bodies:[...t.bodies,...i]},kindOf:s,phenomenonOf:o}}static phenomena(t,e){const r=new Set;for(const s of e)for(const o of _.itemsOf(t,s.key)){const i=s.phenomenon?.(o);i&&r.add(i)}return r}static computedPart(t,e){const r={};for(const s of e){const o=_.itemsOf(t,s.key);o.length>0&&(r[s.key]=[...o])}return r}static saysNothing(t,e){return t.bodies.length===0&&t.title===void 0&&t.smoke===void 0&&e.every(r=>t[r.key]===void 0)}}const Js=Object.freeze(Object.defineProperty({__proto__:null,InterpretationKinds:_},Symbol.toStringTag,{value:"Module"}));class Zr extends Error{constructor(t,e,r,s){super(`Module "${t}" gives "${r}" at ${e}, which module "${s}" already gives`),this.moduleId=t,this.point=e,this.sourceId=r,this.ownerId=s,this.name="ModuleConflictError"}}class En{constructor(t){this.id=t}sources=[];owners=new Map;ownerOf(t){return this.owners.get(t)}conflict(t,e){for(const r of e){const s=this.owners.get(r.id);if(s!==void 0&&s!==t)return{sourceId:r.id,ownerId:s}}}provide(t,e){const r=this.conflict(t,e);if(r)throw new Zr(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===A.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==A.BUILT_IN):-1;s<0?this.sources.push(...e):this.sources.splice(s,0,...e);for(const o of e)this.owners.set(o.id,t);return this.sources}withdraw(t){for(let e=this.sources.length-1;e>=0;e--){const r=this.sources[e].id;this.owners.get(r)===t&&(this.sources.splice(e,1),this.owners.delete(r))}}}class A{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=A.points.get(t);return e||(e=new En(t),A.points.set(t,e)),e}static install(t){if(t.id===A.BUILT_IN)throw new Error(`"${A.BUILT_IN}" is the id of the built-in module`);const e=A.contributionsOf(t);for(const[o,i]of e){const a=A.point(o).conflict(t.id,i);if(a)throw new Zr(t.id,o,a.sourceId,a.ownerId)}const r=new Set(e.map(([o])=>o)),s=A.modules.get(t.id);if(s)for(const[o]of A.contributionsOf(s))r.add(o);for(const o of r)A.point(o).withdraw(t.id);for(const[o,i]of e)A.point(o).provide(t.id,i);A.modules.set(t.id,t);for(const o of r)A.announce(o)}static uninstall(t){const e=A.modules.get(t);if(e){A.modules.delete(t);for(const[r]of A.contributionsOf(e))A.point(r).withdraw(t),A.announce(r)}}static installed(){return[...A.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){A.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const Sn=["en","fr","es","it"];class N{static catalog(t){const e=new Map;return{load(r){const s=N.languageOf(r);let o=e.get(s);return o||(o=t[s](),e.set(s,o),o.catch(()=>e.delete(s))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,r)=>r===Symbol.toPrimitive?()=>"":r===Symbol.iterator?function*(){}:r==="toString"||r==="valueOf"?()=>"":r==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return Sn.includes(e)?e:"en"}}const xn=N.catalog({en:()=>d(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(n=>n.flareKindMessages_en),fr:()=>d(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(n=>n.flareKindMessages_fr),es:()=>d(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(n=>n.flareKindMessages_es),it:()=>d(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(n=>n.flareKindMessages_it)});class nt{constructor(t={}){this.options=t,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.wait=t.wait??(e=>new Promise(r=>setTimeout(r,e)))}static URL="https://historical-forecast-api.open-meteo.com/v1/forecast";static CREDIT="Open-Meteo historical forecast";static LEVELS=[850,700,600,500,400,300];static RETRIES=6;static RETRY_MS=2e3;days=new Map;fetchImpl;wait;async profile(t,e,r){const o=new Date(Math.floor(r.getTime()/36e5)*36e5),i=(r.getTime()-o.getTime())/36e5,a=await this.hourly(t,e,o);if(i<1e-6)return a;const l=await this.hourly(t,e,new Date(o.getTime()+36e5));return a.levels.length!==l.levels.length?i<.5?a:l:{...a,hour:r.toISOString().slice(0,16),levels:a.levels.map((c,m)=>{const[p,f]=X.vector(c.wind),[y,S]=X.vector(l.levels[m].wind);return{aboveGroundM:c.aboveGroundM+i*(l.levels[m].aboveGroundM-c.aboveGroundM),wind:X.fromVector(p+i*(y-p),f+i*(S-f))}})}}async hourly(t,e,r){const s=r.toISOString().slice(0,13)+":00",o=s.slice(0,10),i=`${t.toFixed(4)},${e.toFixed(4)},${o}`;let a=this.days.get(i);return a||(a=this.day(t,e,o,i),a.catch(()=>this.days.delete(i)),this.days.set(i,a)),nt.profileOf(await a,s)}static profileOf(t,e){const r=t.hourly,s=r.time.indexOf(e);if(s<0)throw new Error(`No wind for ${e} in the archive's answer`);const o=c=>(c+180)%360,i=[],a=r.wind_speed_10m?.[s],l=r.wind_direction_10m?.[s];typeof a=="number"&&typeof l=="number"&&i.push({aboveGroundM:10,wind:{towardDeg:o(l),speedMS:a}});for(const c of nt.LEVELS){const m=r[`geopotential_height_${c}hPa`]?.[s],p=r[`wind_speed_${c}hPa`]?.[s],f=r[`wind_direction_${c}hPa`]?.[s];if(typeof m!="number"||typeof p!="number"||typeof f!="number")continue;const y=m-t.elevation;y<=(i[i.length-1]?.aboveGroundM??0)||i.push({aboveGroundM:y,wind:{towardDeg:o(f),speedMS:p}})}if(i.length===0)throw new Error(`No wind for ${e} in the archive's answer`);return{lat:t.latitude,lng:t.longitude,elevationM:t.elevation,hour:e,levels:i,credit:nt.CREDIT}}async day(t,e,r,s){const o=await this.options.cache?.get(s);if(o)return JSON.parse(o);const i=["wind_speed_10m","wind_direction_10m",...nt.LEVELS.flatMap(c=>[`wind_speed_${c}hPa`,`wind_direction_${c}hPa`,`geopotential_height_${c}hPa`])],a=new URLSearchParams({latitude:String(t),longitude:String(e),start_date:r,end_date:r,hourly:i.join(","),wind_speed_unit:"ms",timezone:"GMT"}),l=`${this.options.url??nt.URL}?${a}`;for(let c=0;;c++){const m=await this.fetchImpl(l);if(m.ok){const p=await m.text();return await this.options.cache?.set(s,p),JSON.parse(p)}if((m.status===429||m.status>=500)&&c<nt.RETRIES){await this.wait(nt.RETRY_MS*2**c);continue}throw new Error(`The wind archive answered ${m.status} for ${s}`)}}}class X{static at(t,e){const r=t.levels;if(e<=r[0].aboveGroundM)return{...r[0].wind};for(let s=1;s<r.length;s++){const o=r[s-1],i=r[s];if(e<=i.aboveGroundM){const a=(e-o.aboveGroundM)/(i.aboveGroundM-o.aboveGroundM),[l,c]=X.vector(o.wind),[m,p]=X.vector(i.wind);return X.fromVector(l+a*(m-l),c+a*(p-c))}}return{...r[r.length-1].wind}}static vector(t){const e=t.towardDeg*Math.PI/180;return[t.speedMS*Math.sin(e),t.speedMS*Math.cos(e)]}static fromVector(t,e){return{towardDeg:(Math.atan2(t,e)*180/Math.PI+360)%360,speedMS:Math.hypot(t,e)}}static rounded(t){return{towardDeg:Math.round(t.towardDeg)%360,speedMS:Math.round(t.speedMS*100)/100}}}const Zs=Object.freeze(Object.defineProperty({__proto__:null,OpenMeteoWindProfiles:nt,Winds:X},Symbol.toStringTag,{value:"Module"})),vn=X.rounded,We={key:"flares",messages:xn,phenomenon:()=>"DecoyFlare",inWind:(n,t)=>({...n,wind:vn(t.at(n.aircraft.altitudeM))}),compute:()=>d(async()=>{const{DecoyFlare:n}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:n}},[],import.meta.url).then(({DecoyFlare:n})=>t=>n.bodiesOf(t))},Mn=N.catalog({en:()=>d(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(n=>n.lanternKindMessages_en),fr:()=>d(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(n=>n.lanternKindMessages_fr),es:()=>d(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(n=>n.lanternKindMessages_es),it:()=>d(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(n=>n.lanternKindMessages_it)}),Ye=X.rounded,Xe={key:"lanterns",messages:Mn,phenomenon:()=>"SkyLantern",inWind:(n,t)=>{const e=n.site.altitudeM??0,r=n.windAloft?.atM??1e3;return{...n,wind:Ye(t.at(10)),windAloft:{...Ye(t.at(e+r)),atM:r}}},compute:()=>d(async()=>{const{SkyLantern:n}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:n}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{LanternEditor:n}=await import("./LanternEditor-CepeoImr.js");return{LanternEditor:n}},__vite__mapDeps([2,3,4,5,0,1,6,7,8]),import.meta.url).then(({LanternEditor:n})=>(t,e,r)=>new n(t,e,r))},An=N.catalog({en:()=>d(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(n=>n.birdKindMessages_en),fr:()=>d(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(n=>n.birdKindMessages_fr),es:()=>d(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(n=>n.birdKindMessages_es),it:()=>d(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(n=>n.birdKindMessages_it)}),Je={key:"birds",messages:An,phenomenon:()=>"Birds",compute:()=>d(async()=>{const{BirdFlock:n}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:n}},__vite__mapDeps([9,1]),import.meta.url).then(({BirdFlock:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{BirdEditor:n}=await import("./BirdEditor-CBVGyUnK.js");return{BirdEditor:n}},__vite__mapDeps([10,3,4,5,9,1,8,11]),import.meta.url).then(({BirdEditor:n})=>(t,e,r)=>new n(t,e,r))},Tn=N.catalog({en:()=>d(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(n=>n.droneKindMessages_en),fr:()=>d(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(n=>n.droneKindMessages_fr),es:()=>d(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_es),it:()=>d(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_it)}),Ze={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},Qe={key:"drones",messages:Tn,phenomenon:n=>Ze[n.airframe]??Ze.quadcopter,compute:()=>d(async()=>{const{DroneFlight:n}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:n}},__vite__mapDeps([12,13]),import.meta.url).then(({DroneFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{DroneEditor:n}=await import("./DroneEditor-7X9CM_3H.js");return{DroneEditor:n}},__vite__mapDeps([14,3,4,5,15,12,13,8,11]),import.meta.url).then(({DroneEditor:n})=>(t,e,r)=>new n(t,e,r))},In=N.catalog({en:()=>d(()=>import("./BalloonKindMessages_en-C6tZ-5gT.js"),[],import.meta.url).then(n=>n.balloonKindMessages_en),fr:()=>d(()=>import("./BalloonKindMessages_fr-C3QJIuDJ.js"),[],import.meta.url).then(n=>n.balloonKindMessages_fr),es:()=>d(()=>import("./BalloonKindMessages_es-BfoEjhe1.js"),[],import.meta.url).then(n=>n.balloonKindMessages_es),it:()=>d(()=>import("./BalloonKindMessages_it-CkO7mqHp.js"),[],import.meta.url).then(n=>n.balloonKindMessages_it)}),Qs=["round","star","heart","figure"];class pe{static HELIUM_KG_MOL=.0040026;static ALL=[{id:"hot-air",modelId:"ufoathome-balloon-hot-air",envelope:"open",launchVolumeM3:2550,maxVolumeM3:2550,massKg:540,dragCoefficient:.5,aspect:1.461,widthM:16.5,color:"#c8202f",stripeColor:"#f5c400",albedo:.4,burner:{heatingKS:1.2,coolingS:400,blastS:6,maxExcessK:100,flameCdM2:2e4,envelopeCdM2:40,color:"#ffb347"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"party",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.0115,maxVolumeM3:.0335,massKg:.0045,dragCoefficient:.47,aspect:1.13,color:"#d8263a",albedo:.35,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"led",modelId:"ufoathome-balloon-led",envelope:"elastic",launchVolumeM3:.0141,maxVolumeM3:.041,massKg:.0075,dragCoefficient:.47,aspect:1.115,color:"#ffffff",albedo:.5,glow:{candela:.5,color:"#ffffff"},phenomenon:"LedBalloon",durationS:3600},{id:"foil",modelId:"ufoathome-balloon-foil",envelope:"vented",launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,dragCoefficient:.6,aspect:1.034,widthM:.45,depthRatio:.267,color:"#c9cdd2",albedo:.85,finish:"mirror",spins:!0,shapes:{round:{modelId:"ufoathome-balloon-foil",aspect:1.034,widthM:.45,depthRatio:.267,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#c9cdd2"},star:{modelId:"ufoathome-balloon-foil-star",aspect:1.029,widthM:.5,depthRatio:.183,launchVolumeM3:.012,maxVolumeM3:.012,massKg:.009,color:"#e0b83a"},heart:{modelId:"ufoathome-balloon-foil-heart",aspect:.903,widthM:.5,depthRatio:.2,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#d81e3c"},figure:{modelId:"ufoathome-balloon-foil-figure",aspect:1.112,widthM:.8,depthRatio:.127,launchVolumeM3:.05,maxVolumeM3:.05,massKg:.03,color:"#f0a3c8"}},phenomenon:"FoilBalloon",durationS:3600},{id:"pilot",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.144,maxVolumeM3:.57,massKg:.045,dragCoefficient:.4,aspect:1.13,color:"#f0e6cf",albedo:.55,lamp:{candela:1,color:"#fff1c4"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:5400},{id:"weather",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:1.75,maxVolumeM3:118.9,massKg:.85,dragCoefficient:.3,aspect:1.13,color:"#f2ece0",albedo:.55,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:7200},{id:"stratospheric",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:219,maxVolumeM3:14e3,massKg:210,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"stratospheric-large",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:730,maxVolumeM3:15e4,massKg:700,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:140,phenomenon:"StratosphericBalloons",durationS:14400},{id:"superpressure",modelId:"ufoathome-balloon-latex",envelope:"superpressure",launchVolumeM3:45,maxVolumeM3:523,massKg:44,dragCoefficient:.4,aspect:1.13,color:"#eef1f4",albedo:.8,phenomenon:"StratosphericBalloons",durationS:10800},{id:"infrared",modelId:"ufoathome-balloon-stratospheric",envelope:"open",launchVolumeM3:2075,maxVolumeM3:45e3,massKg:150,dragCoefficient:.4,aspect:.91,color:"#9aa0a8",albedo:.4,insideExcessK:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"prank-candles",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:.25,maxVolumeM3:.25,massKg:.02,dragCoefficient:.6,aspect:1.515,widthM:.6,color:"#f4f4f4",albedo:.6,insideExcessK:60,spins:!0,sways:!0,flames:{count:4,candela:.5,color:"#ffb347",burnS:720,coolingS:15},phenomenon:"SkyLantern",durationS:1200},{id:"prank-flares",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:2,maxVolumeM3:2,massKg:.3,dragCoefficient:.6,aspect:1.515,widthM:1.2,color:"#2b2d30",albedo:.1,insideExcessK:80,spins:!0,sways:!0,flames:{count:1,candela:150,color:"#ff3a20",burnS:900,coolingS:30},phenomenon:"SkyLantern",durationS:1500},{id:"anti-hail",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.65,maxVolumeM3:8,massKg:.4,dragCoefficient:.35,aspect:1.13,color:"#f2ece0",albedo:.55,torch:{aboveM:600,candela:300,color:"#ff9a3c",burnS:90,fallMS:4},phenomenon:"ParachuteFlare",durationS:1200},{id:"solar",modelId:"ufoathome-balloon-latex",envelope:"open",launchVolumeM3:14,maxVolumeM3:14,massKg:.4,dragCoefficient:.47,aspect:1.13,color:"#151515",albedo:.05,insideExcessK:10,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"captive",modelId:"ufoathome-balloon-latex",envelope:"sealed",tethered:!0,launchVolumeM3:14,maxVolumeM3:14,massKg:8,dragCoefficient:.47,aspect:1.13,color:"#f4f4f4",albedo:.7,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600}];static byId(t){return pe.ALL.find(e=>e.id===t)}}const tr=X.rounded,er={key:"balloons",messages:In,phenomenon:n=>{const t=typeof n.balloon=="string"?n.balloon:n.balloon?.id;return(pe.byId(t)??pe.ALL[0]).phenomenon},inWind:(n,t)=>{const e=n.site.altitudeM??0;return{...n,wind:tr(t.at(10)),windsAloft:t.levels.filter(r=>r>e+10).map(r=>({...tr(t.at(r)),atM:Math.round(r-e)}))}},compute:()=>d(async()=>{const{BalloonFlight:n}=await import("./BalloonFlight-CvE7AHlm.js");return{BalloonFlight:n}},[],import.meta.url).then(({BalloonFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{BalloonEditor:n}=await import("./BalloonEditor-CAKXO8DQ.js");return{BalloonEditor:n}},__vite__mapDeps([16,3,4,5,15,12,13,17,6,7,8]),import.meta.url).then(({BalloonEditor:n})=>(t,e,r)=>new n(t,e,r))},Nn=N.catalog({en:()=>d(()=>import("./AirshipKindMessages_en-DzGapVTV.js"),[],import.meta.url).then(n=>n.airshipKindMessages_en),fr:()=>d(()=>import("./AirshipKindMessages_fr-BTXNsW5W.js"),[],import.meta.url).then(n=>n.airshipKindMessages_fr),es:()=>d(()=>import("./AirshipKindMessages_es-TE93uMSC.js"),[],import.meta.url).then(n=>n.airshipKindMessages_es),it:()=>d(()=>import("./AirshipKindMessages_it-Cwa3MnJ-.js"),[],import.meta.url).then(n=>n.airshipKindMessages_it)}),de=(n,t,e,r=5)=>({"nav-left":{color:"#ff2a1a",candela:r,leds:[{at:n,radiusM:.06}]},"nav-right":{color:"#2aff5a",candela:r,leds:[{at:t,radiusM:.06}]},tail:{color:"#ffffff",candela:r,leds:[{at:e,radiusM:.06}]}});class he{static ALL=[{id:"blimp",modelId:"ufoathome-airship-blimp",sizeM:{widthM:14.72,lengthM:59.46,heightM:17.59},cruiseMS:15,maxSpeedMS:22,color:"#c9ccd1",finColor:"#1d3f8a",albedo:.6,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!0},lights:{...de([-1.22,-8.6,-9],[1.22,-8.6,-9],[0,0,29.7]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-10.15,-9],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"zeppelin-nt",modelId:"ufoathome-airship-zeppelin-nt",sizeM:{widthM:18.2,lengthM:75.11,heightM:19.55},cruiseMS:19,maxSpeedMS:35,color:"#eef0f2",finColor:"#eef0f2",albedo:.75,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!1},lights:{...de([-1.32,-8.4,-14],[1.32,-8.4,-14],[0,0,37.5]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-9.65,-14],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"lightship",modelId:"ufoathome-airship-lightship",sizeM:{widthM:10.16,lengthM:39.66,heightM:11.98},cruiseMS:13,maxSpeedMS:20,color:"#f4f4f2",finColor:"#f4f4f2",albedo:.7,glowCdM2:20,lights:de([-.82,-5.9,-6],[.82,-5.9,-6],[0,0,19.8]),sound:"light-piston",phenomenon:"Airship"},{id:"aerostat",modelId:"ufoathome-airship-aerostat",sizeM:{widthM:25.14,lengthM:63.6,heightM:27.05},cruiseMS:0,maxSpeedMS:0,tethered:!0,color:"#f2f2f0",finColor:"#f2f2f0",albedo:.7,lights:{nose:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-4.2,-30],radiusM:.12}]},stern:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-6.3,22],radiusM:.12}]}},phenomenon:"Airship"},{id:"rigid",modelId:"ufoathome-airship-rigid",sizeM:{widthM:33.38,lengthM:236.66,heightM:35.79},cruiseMS:32,maxSpeedMS:36,color:"#b9bcbf",finColor:"#b9bcbf",albedo:.55,lights:de([-3.02,-16.5,-80],[3.02,-16.5,-80],[0,0,118.3],10),sound:"piston-heavy",phenomenon:"Airship"}];static byId(t){return he.ALL.find(e=>e.id===t)}}const rr={key:"airships",messages:Nn,phenomenon:n=>{const t=typeof n.airship=="string"?n.airship:n.airship?.id;return(he.byId(t)??he.ALL[0]).phenomenon},compute:()=>d(async()=>{const{AirshipFlight:n}=await import("./AirshipFlight-6yYGIRn8.js");return{AirshipFlight:n}},__vite__mapDeps([18,12,13]),import.meta.url).then(({AirshipFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{AirshipEditor:n}=await import("./AirshipEditor-EBfUtSiB.js");return{AirshipEditor:n}},__vite__mapDeps([19,3,4,5,15,12,13,18,8,11]),import.meta.url).then(({AirshipEditor:n})=>(t,e,r)=>new n(t,e,r))},Qr=A.point("interpretations").provide(A.BUILT_IN,[{id:We.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>We},{id:Xe.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Xe},{id:Je.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Je},{id:Qe.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Qe},{id:er.key,name:"Balloons",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>er},{id:rr.key,name:"Airships",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>rr}]);class $e{static kinds(){return Qr.map(t=>_.of(t))}}const to=Object.freeze(Object.defineProperty({__proto__:null,INTERPRETATION_SOURCES:Qr,InterpretationRegistry:$e},Symbol.toStringTag,{value:"Module"}));class z{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return ht.check(t,"case")}static isCase(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Array.isArray(t.events)&&!("timeline"in t)}static sightingUrls(t,e){return(t.events??[]).filter(r=>r.eventType===z.SIGHTING_EVENT&&!r.interpretationOf&&typeof r.url=="string"&&r.url!=="").map(r=>new URL(r.url,e).href)}static accountIds(t,e,r,s){const o=(t.events??[]).filter(i=>i.eventType===z.SIGHTING_EVENT&&i.id!==void 0&&typeof i.url=="string"&&r!==void 0&&new URL(i.url,e).href===r).map(i=>i.id);return s!==void 0&&o.push(s),o}static interpretationEvents(t,e){const r=[e].flat().filter(s=>!!s);return r.length===0?[]:(t.events??[]).filter(s=>s.eventType===z.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==z.SIGHTING_EVENT||s.interpretationOf===void 0?!1:[s.interpretationOf].flat().some(o=>r.includes(o))).map(s=>s)}static problems(t,e){const r=t.events??[],s=new Set,o=new Set;for(const a of r)a.id!==void 0&&(s.has(a.id)&&o.add(a.id),s.add(a.id));const i=[];for(const a of r){const l=a.eventType===z.SIGHTING_EVENT?a.interpretationOf:a.eventType===z.INTERVIEW_EVENT?a.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&i.push({reading:a.url??a.id??"",reference:c})}return{duplicateIds:[...o],unresolved:i}}static async interpretationOf(t,e,r){if(t.bodies)return z.withModelsFrom(j.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,..._.computedPart(t,$e.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),i="timeline"in o&&o.interpretation?o.interpretation:o;return z.withModelsFrom(j.strip({title:t.title??i.title,bodies:i.bodies??[],smoke:i.smoke,findings:i.findings,..._.computedPart(i,$e.kinds())}).recording,s)}static withModelsFrom(t,e){return{...t,bodies:t.bodies.map(r=>r.model?.url?{...r,model:{...r.model,url:new URL(r.model.url,e).href}}:r)}}}class F{static files=new Map;static hold(t){for(const[e,r]of t)F.files.set(F.key(e),r)}static releaseCopies(){for(const[t,e]of F.files)e.local||F.files.delete(t)}static clear(){F.files.clear()}static localBase(){return new URL(`local/${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}/`,location.href).href}static read(t){const e=F.files.get(F.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&F.files.get(F.key(e))?.changed===!0)}static local(t){return t!==void 0&&F.files.get(F.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class Q{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static taken(t,e){const r={};if(t==="decor")return Array.isArray(e.decor)&&(r.decor=e.decor.filter(Q.surveyed)),r;for(const s of Q.KEYS[t])e[s]!==void 0&&(r[s]=e[s]);return r}static strip(t,e){if(t==="decor"){const r=Array.isArray(e.decor)?e.decor.filter(s=>!Q.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of Q.KEYS[t])delete e[r]}static put(t,e,r){if(t==="decor"){if(!Array.isArray(r.decor))return;const s=Array.isArray(e.decor)?e.decor.filter(o=>!Q.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of Q.KEYS[t])r[s]!==void 0&&(e[s]=r[s])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class tn{static NAMES=["relief","imagery","roads","water","railways","upperAir","map"];static TERRAIN=["relief","imagery","roads","water","railways"];static held(t,e){if(!t||t.live)return;const r=t[e];return r&&!r.live&&!r.refresh&&r.src!==void 0?r:void 0}static isLive(t,e){return t?.live===!0||t?.[e]?.live===!0}static annexName(t,e){const r=e==="relief"||e==="imagery"||e==="map"?"zip":"json",s=e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);return`${t}.${s}.${r}`}static isEmpty(t){return!t||!t.live&&tn.NAMES.every(e=>!t[e])&&Q.NAMES.every(e=>!t[e])}}class It extends Error{constructor(t,e,r){super(`${t}: ${e}${r===void 0?"":` (HTTP ${r})`}`),this.kind=t,this.url=e,this.status=r,this.name="SightingFetchError"}}class fe{static async recording(t){const e=F.read(t);if(e!==void 0)return e;const r=await fe.json(t);for(const s of Q.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const i=ht.recording(await fe.json(new URL(o.src,new URL(t,location.href)).href));Q.put(s,r,i)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=F.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new It("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new It("status",t,s.status);try{return await s.json()}catch{throw new It("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new It("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new It("cors",t)}catch{return new It("unreachable",t)}}}class Pe{constructor(t,e,r=()=>{}){this.place=t,this.changed=r,e&&this.adopt(e)}reader;editor;handed;get reading(){return this.reader!==void 0}get editorLoaded(){return this.editor!==void 0}adopt(t){this.editor=t,t.switcher=this,t.hasAttribute(xe)||t.setAttribute(xe,""),t.addEventListener(gn,e=>{e.preventDefault();const r=e.detail;this.handed=r.src,this.read(r)})}async read({src:t,track:e}){const[{register:r,CASE_ELEMENT_NAME:s,OPEN_EVENTS_ATTRIBUTE:o},{registerSighting:i,SIGHTING_ELEMENT_NAME:a}]=await Promise.all([d(()=>import("./CaseElement-DVXLO8mr.js"),__vite__mapDeps([20,21,22,6,7,23,3,4,13,24,25,1,26]),import.meta.url),d(()=>import("./SightingElement-CUrYpWRD.js"),__vite__mapDeps([26,22,6,7,23,3,4,13,24,25,1]),import.meta.url)]);i(),r();const l=z.isCase(F.read(t)??await fe.json(t)),c=document.createElement(l?s:a);c.setAttribute(xe,""),c.setAttribute("show-labels",""),l&&e&&c.setAttribute(o,Pe.fileKey(e)),c.setAttribute("src",t),c.addEventListener(wn,m=>{m.preventDefault(),this.edit(m.detail)}),this.reader?.remove(),this.place(c),this.editor&&(this.editor.hidden=!0),this.reader=c,this.changed({mode:"read",src:t,...e?{track:e}:{}})}async edit(t){const e=this.editor;if(e){if(this.dropReader(),F.releaseCopies(),e.hidden=!1,this.changed({mode:"edit"}),t?.src!==void 0&&t.src!==this.handed){this.load(e,t.src,t.track);return}t?.track&&await e.openTrack(t.track);return}const{register:r,CASE_EDITOR_ELEMENT_NAME:s}=await d(async()=>{const{register:i,CASE_EDITOR_ELEMENT_NAME:a}=await import("./CaseEditorElement-BgT6HnpX.js").then(l=>l.a);return{register:i,CASE_EDITOR_ELEMENT_NAME:a}},__vite__mapDeps([27,3,4,8,21,22,6,7,23,13,24,25,1,11,28,29,30,31]),import.meta.url);r();const o=document.createElement(s);this.adopt(o),t?.track&&o.setAttribute("track",t.track),t?.src?o.setAttribute("src",t.src):t?.start&&(o.caseStart=t.start),this.dropReader(),this.place(o),this.changed({mode:"edit"})}async open(t){const e=this.editor;if(this.reading||!e)return this.read({src:t});this.load(e,t)}load(t,e,r){this.handed=void 0,r?t.setAttribute("track",r):t.removeAttribute("track"),t.setAttribute("src",e)}async startNew(t){const e=this.editor;if(!e)return this.edit(t?{start:t}:void 0);this.reading&&await this.edit(),e.askBeforeReplacing(()=>{e.remove(),this.editor=void 0,this.edit(t?{start:t}:void 0)})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const Fe="rr0-input-file",en={inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load"},_n=`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./SkyLantern-DJT_Ibzh.js","./Obstacles-v9SkfBD7.js","./LanternEditor-DEeA3Kf_.js","./SaidPosition-OJEYhVKN.js","./GeoProjection-DvqDbRIx.js","./SkyEventEditorStyle-CvY_AhbI.js","./Sighting-C1yj2-s5.js","./VisualAids-DI-hEL46.js","./ParameterForm-XbqxCLRn.js","./BirdFlock-ByBkJV35.js","./BirdEditor-CBVGyUnK.js","./TimelineTracks-Daaqw9ly.js","./DroneFlight-CGNIh9XS.js","./Decor-Dn-cvniW.js","./DroneEditor-7X9CM_3H.js","./DroneParameters-CfTAaLCT.js","./BalloonEditor-BBAtMeVM.js","./BalloonFlight-CvE7AHlm.js","./AirshipFlight-6yYGIRn8.js","./AirshipEditor-EBfUtSiB.js","./CaseElement-CTZ3YIL0.js","./ColumnResize-D6vA9JBg.js","./ShareDialogElement-Dsc4v4jd.js","./three.module-CbaHqYFq.js","./RecordingIssue-BlWT8Xsu.js","./xyzImageryRaster-Dhxs0B26.js","./SightingElement-CFItfa0b.js","./CaseEditorElement-CPt1laCe.js","./PoherSelfCheck-DnXcStjH.js","./PoherMatrix-C2fcLqDH.js","./ReentryArchive-CeXHrU7L.js","./ReferenceTimeline-2kBldQeG.js","./upperAirSources-BU0pD84c.js","./Account-C4jhsVtN.js","./UfoMessages_en-D5OYWJ3K.js","./SightingEditorMessages_en-V_dJYjNb.js","./SightingLabels_en-dOsFjVRL.js","./SightingEditorMessages_fr-zxTvQa2I.js","./SightingLabels_fr-Cpkcf5_9.js","./SightingEditorMessages_es-DauDuhPa.js","./SightingLabels_es-CKlP2BDO.js","./SightingEditorMessages_it-vvaao68O.js","./SightingLabels_it-3127rMXm.js","./SightingMessages_en-Drcr3k4V.js","./SightingMessages_fr-7IYuW095.js","./SightingMessages_es-BcaWM7Oy.js","./SightingMessages_it-BhDmZn6p.js","./UfoAtHomeMessages_en-ByVu39KF.js","./ConsentMessages_en-DBKCeDAn.js","./UfoAtHomeMessages_fr-nTqRf0ZK.js","./ConsentMessages_fr-FGSpqzMc.js","./UfoAtHomeMessages_es-D9bLboxq.js","./ConsentMessages_es-Dby74lUq.js","./UfoAtHomeMessages_it-4cZC5-y5.js","./ConsentMessages_it-BJWfXH6I.js","./SceneNames_en-sRbx6EJZ.js","./SceneNames_fr-BtTlti4C.js","./SceneNames_es-pnfHB-7D.js","./SceneNames_it-DQKwdCVD.js","./ModuleSession-Dac4fD0X.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
const hn="modulepreload",fn=function(n,t){return new URL(n,t).href},ze={},d=function(t,e,r){let s=Promise.resolve();if(e&&e.length>0){let i=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const a=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),c=l?.nonce||l?.getAttribute("nonce");s=i(e.map(m=>{if(m=fn(m,r),m in ze)return;ze[m]=!0;const p=m.endsWith(".css"),f=p?'[rel="stylesheet"]':"";if(!!r)for(let E=a.length-1;E>=0;E--){const G=a[E];if(G.href===m&&(!p||G.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${m}"]${f}`))return;const S=document.createElement("link");if(S.rel=p?"stylesheet":hn,p||(S.as="script"),S.crossOrigin="",S.href=m,c&&S.setAttribute("nonce",c),document.head.appendChild(S),p)return new Promise((E,G)=>{S.addEventListener("load",E),S.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${m}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},gn="rr0-read",wn="rr0-edit",ve="in-place",yn="rr0-mode";class Xs{static ask(t,e,r){const s=new CustomEvent(e,{detail:r,bubbles:!0,composed:!0,cancelable:!0});return t.dispatchEvent(s),s.defaultPrevented}}class j{constructor(t){this.entries=t}static same(t,e){return typeof t=="number"&&typeof e=="number"?t===e||Math.abs(t-e)<=1e-9*Math.max(1,Math.abs(t),Math.abs(e)):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((r,s)=>j.same(r,e[s])):typeof t=="object"&&t!==null&&typeof e=="object"&&e!==null&&!Array.isArray(t)&&!Array.isArray(e)?[...new Set([...Object.keys(t),...Object.keys(e)])].every(s=>j.same(t[s],e[s])):t===e}static free(t){return t?.basis==="assumed"||t?.basis==="fitted"}static empty(){return new j(new Map)}get size(){return this.entries.size}at(t){return this.entries.get(t)}paths(){return[...this.entries.keys()]}sourced(){return[...this.entries].filter(([,t])=>t.source!==void 0).map(([t,e])=>({path:t,basis:e.basis,source:e.source}))}interviewsCited(){const t=[];for(const{source:e}of this.sourced()){const r=e.said?.interview;r!==void 0&&!t.includes(r)&&t.push(r)}return t}pathsFromInterview(t){return this.sourced().filter(({source:e})=>e.said!==void 0&&e.said.interview===t).map(({path:e})=>e)}set(t,e){e.basis==="stated"&&e.rationale===void 0&&e.how===void 0&&e.range===void 0&&e.source===void 0?this.entries.delete(t):this.entries.set(t,e)}clear(t){for(const e of this.entries.keys())(e===t||e.startsWith(`${t}.`))&&this.entries.delete(e)}static strip(t){const e=new j(new Map);return{recording:j.stripValue(t,[],e),provenance:e}}static restore(t,e){if(e.size===0)return t;const r={...t},s=new Set([r]);for(const o of e.paths()){const i=e.at(o),a=o.split("."),l=j.writableHolderOf(r,a,s);if(!l)continue;const c=a[a.length-1],m=l[c];m!==void 0&&(i.of!==void 0&&!j.same(i.of,m)||(l[c]={value:m,...i.basis==="stated"?{}:{basis:i.basis},...i.rationale===void 0?{}:{rationale:i.rationale},...i.how===void 0?{}:{how:i.how},...i.range===void 0?{}:{range:i.range},...i.source===void 0?{}:{source:i.source}}))}return r}static isWrapper(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}static stripValue(t,e,r){return j.isWrapper(t)?(r.set(e.join("."),{basis:t.basis??"stated",...t.rationale===void 0?{}:{rationale:t.rationale},...t.how===void 0?{}:{how:t.how},...t.range===void 0?{}:{range:t.range},...t.source===void 0?{}:{source:t.source},of:t.value}),j.stripValue(t.value,e,r)):Array.isArray(t)?t.map((s,o)=>j.stripValue(s,[...e,String(o)],r)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([s,o])=>[s,j.stripValue(o,[...e,s],r)])):t}static writableHolderOf(t,e,r){let s=t;for(const o of e.slice(0,-1)){const i=s[o];if(typeof i!="object"||i===null)return;if(r.has(i)){s=i;continue}const a=Array.isArray(i)?[...i]:{...i};r.add(a),s[o]=a,s=a}return s}}class bn extends Error{constructor(t,e,r){super(typeof e=="number"&&Number.isInteger(e)&&e>=1?`This ${t} file is in version ${e} of its format; this UFO@home reads version ${r}. Read it with the UFO@home that reads its version.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=r,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class ht{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=ht.CURRENT[t]){return`${ht.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static recording(t){return ht.check(t,"sighting")}static check(t,e){const r=ht.of(t),s=ht.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r!==s)throw new bn(e,r,s);return t}}class N{static built=new WeakMap;static computers=new WeakMap;static loading=new WeakMap;static loaded(t,e){return e.every(r=>N.itemsOf(t,r.key).length===0||N.computers.has(r))}static load(t,e){return Promise.all(e.filter(r=>N.itemsOf(t,r.key).length>0&&!N.computers.has(r)).map(r=>{let s=N.loading.get(r);return s||(s=r.compute().then(o=>{N.computers.set(r,o)}),s.catch(()=>N.loading.delete(r)),N.loading.set(r,s)),s.catch(()=>{})})).then(()=>{})}static of(t){let e=N.built.get(t);return e||(e=t.create(),N.built.set(t,e)),e}static itemsOf(t,e){const r=t?.[e];return Array.isArray(r)?r:[]}static computes(t,e){return e.some(r=>N.itemsOf(t,r.key).length>0)}static expand(t,e,r){return N.expandWithKinds(t,e,r).interpretation}static expandWithKinds(t,e,r){const s=new Map,o=new Map;if(!t||!N.computes(t,e))return{interpretation:t,kindOf:s,phenomenonOf:o};const i=e.flatMap(a=>N.itemsOf(t,a.key).flatMap(l=>{const c=N.computers.get(a);if(!c)return[];const m=c(l,r),p=a.phenomenon?.(l);for(const f of m)s.set(f.id,a),p&&o.set(f.id,p);return m}));return{interpretation:{...t,bodies:[...t.bodies,...i]},kindOf:s,phenomenonOf:o}}static phenomena(t,e){const r=new Set;for(const s of e)for(const o of N.itemsOf(t,s.key)){const i=s.phenomenon?.(o);i&&r.add(i)}return r}static computedPart(t,e){const r={};for(const s of e){const o=N.itemsOf(t,s.key);o.length>0&&(r[s.key]=[...o])}return r}static saysNothing(t,e){return t.bodies.length===0&&t.title===void 0&&t.smoke===void 0&&e.every(r=>t[r.key]===void 0)}}const Js=Object.freeze(Object.defineProperty({__proto__:null,InterpretationKinds:N},Symbol.toStringTag,{value:"Module"}));class Zr extends Error{constructor(t,e,r,s){super(`Module "${t}" gives "${r}" at ${e}, which module "${s}" already gives`),this.moduleId=t,this.point=e,this.sourceId=r,this.ownerId=s,this.name="ModuleConflictError"}}class En{constructor(t){this.id=t}sources=[];owners=new Map;ownerOf(t){return this.owners.get(t)}conflict(t,e){for(const r of e){const s=this.owners.get(r.id);if(s!==void 0&&s!==t)return{sourceId:r.id,ownerId:s}}}provide(t,e){const r=this.conflict(t,e);if(r)throw new Zr(t,this.id,r.sourceId,r.ownerId);this.withdraw(t);const s=t===A.BUILT_IN?this.sources.findIndex(o=>this.owners.get(o.id)!==A.BUILT_IN):-1;s<0?this.sources.push(...e):this.sources.splice(s,0,...e);for(const o of e)this.owners.set(o.id,t);return this.sources}withdraw(t){for(let e=this.sources.length-1;e>=0;e--){const r=this.sources[e].id;this.owners.get(r)===t&&(this.sources.splice(e,1),this.owners.delete(r))}}}class A{static BUILT_IN="ufoathome";static changes=new EventTarget;static points=new Map;static modules=new Map;static point(t){let e=A.points.get(t);return e||(e=new En(t),A.points.set(t,e)),e}static install(t){if(t.id===A.BUILT_IN)throw new Error(`"${A.BUILT_IN}" is the id of the built-in module`);const e=A.contributionsOf(t);for(const[o,i]of e){const a=A.point(o).conflict(t.id,i);if(a)throw new Zr(t.id,o,a.sourceId,a.ownerId)}const r=new Set(e.map(([o])=>o)),s=A.modules.get(t.id);if(s)for(const[o]of A.contributionsOf(s))r.add(o);for(const o of r)A.point(o).withdraw(t.id);for(const[o,i]of e)A.point(o).provide(t.id,i);A.modules.set(t.id,t);for(const o of r)A.announce(o)}static uninstall(t){const e=A.modules.get(t);if(e){A.modules.delete(t);for(const[r]of A.contributionsOf(e))A.point(r).withdraw(t),A.announce(r)}}static installed(){return[...A.modules.values()]}static contributionsOf(t){return Object.entries(t.contributes).filter(e=>Array.isArray(e[1])&&e[1].length>0)}static announce(t){A.changes.dispatchEvent(new CustomEvent("change",{detail:t}))}}const Sn=["en","fr","es","it"];class _{static catalog(t){const e=new Map;return{load(r){const s=_.languageOf(r);let o=e.get(s);return o||(o=t[s](),e.set(s,o),o.catch(()=>e.delete(s))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,r)=>r===Symbol.toPrimitive?()=>"":r===Symbol.iterator?function*(){}:r==="toString"||r==="valueOf"?()=>"":r==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return Sn.includes(e)?e:"en"}}const vn=_.catalog({en:()=>d(()=>import("./FlareKindMessages_en-j3CY_TxX.js"),[],import.meta.url).then(n=>n.flareKindMessages_en),fr:()=>d(()=>import("./FlareKindMessages_fr-B2MezoN2.js"),[],import.meta.url).then(n=>n.flareKindMessages_fr),es:()=>d(()=>import("./FlareKindMessages_es-CZgrFIOO.js"),[],import.meta.url).then(n=>n.flareKindMessages_es),it:()=>d(()=>import("./FlareKindMessages_it-CmZmb3RP.js"),[],import.meta.url).then(n=>n.flareKindMessages_it)});class nt{constructor(t={}){this.options=t,this.fetchImpl=t.fetchImpl??fetch.bind(globalThis),this.wait=t.wait??(e=>new Promise(r=>setTimeout(r,e)))}static URL="https://historical-forecast-api.open-meteo.com/v1/forecast";static CREDIT="Open-Meteo historical forecast";static LEVELS=[850,700,600,500,400,300];static RETRIES=6;static RETRY_MS=2e3;days=new Map;fetchImpl;wait;async profile(t,e,r){const o=new Date(Math.floor(r.getTime()/36e5)*36e5),i=(r.getTime()-o.getTime())/36e5,a=await this.hourly(t,e,o);if(i<1e-6)return a;const l=await this.hourly(t,e,new Date(o.getTime()+36e5));return a.levels.length!==l.levels.length?i<.5?a:l:{...a,hour:r.toISOString().slice(0,16),levels:a.levels.map((c,m)=>{const[p,f]=X.vector(c.wind),[y,S]=X.vector(l.levels[m].wind);return{aboveGroundM:c.aboveGroundM+i*(l.levels[m].aboveGroundM-c.aboveGroundM),wind:X.fromVector(p+i*(y-p),f+i*(S-f))}})}}async hourly(t,e,r){const s=r.toISOString().slice(0,13)+":00",o=s.slice(0,10),i=`${t.toFixed(4)},${e.toFixed(4)},${o}`;let a=this.days.get(i);return a||(a=this.day(t,e,o,i),a.catch(()=>this.days.delete(i)),this.days.set(i,a)),nt.profileOf(await a,s)}static profileOf(t,e){const r=t.hourly,s=r.time.indexOf(e);if(s<0)throw new Error(`No wind for ${e} in the archive's answer`);const o=c=>(c+180)%360,i=[],a=r.wind_speed_10m?.[s],l=r.wind_direction_10m?.[s];typeof a=="number"&&typeof l=="number"&&i.push({aboveGroundM:10,wind:{towardDeg:o(l),speedMS:a}});for(const c of nt.LEVELS){const m=r[`geopotential_height_${c}hPa`]?.[s],p=r[`wind_speed_${c}hPa`]?.[s],f=r[`wind_direction_${c}hPa`]?.[s];if(typeof m!="number"||typeof p!="number"||typeof f!="number")continue;const y=m-t.elevation;y<=(i[i.length-1]?.aboveGroundM??0)||i.push({aboveGroundM:y,wind:{towardDeg:o(f),speedMS:p}})}if(i.length===0)throw new Error(`No wind for ${e} in the archive's answer`);return{lat:t.latitude,lng:t.longitude,elevationM:t.elevation,hour:e,levels:i,credit:nt.CREDIT}}async day(t,e,r,s){const o=await this.options.cache?.get(s);if(o)return JSON.parse(o);const i=["wind_speed_10m","wind_direction_10m",...nt.LEVELS.flatMap(c=>[`wind_speed_${c}hPa`,`wind_direction_${c}hPa`,`geopotential_height_${c}hPa`])],a=new URLSearchParams({latitude:String(t),longitude:String(e),start_date:r,end_date:r,hourly:i.join(","),wind_speed_unit:"ms",timezone:"GMT"}),l=`${this.options.url??nt.URL}?${a}`;for(let c=0;;c++){const m=await this.fetchImpl(l);if(m.ok){const p=await m.text();return await this.options.cache?.set(s,p),JSON.parse(p)}if((m.status===429||m.status>=500)&&c<nt.RETRIES){await this.wait(nt.RETRY_MS*2**c);continue}throw new Error(`The wind archive answered ${m.status} for ${s}`)}}}class X{static at(t,e){const r=t.levels;if(e<=r[0].aboveGroundM)return{...r[0].wind};for(let s=1;s<r.length;s++){const o=r[s-1],i=r[s];if(e<=i.aboveGroundM){const a=(e-o.aboveGroundM)/(i.aboveGroundM-o.aboveGroundM),[l,c]=X.vector(o.wind),[m,p]=X.vector(i.wind);return X.fromVector(l+a*(m-l),c+a*(p-c))}}return{...r[r.length-1].wind}}static vector(t){const e=t.towardDeg*Math.PI/180;return[t.speedMS*Math.sin(e),t.speedMS*Math.cos(e)]}static fromVector(t,e){return{towardDeg:(Math.atan2(t,e)*180/Math.PI+360)%360,speedMS:Math.hypot(t,e)}}static rounded(t){return{towardDeg:Math.round(t.towardDeg)%360,speedMS:Math.round(t.speedMS*100)/100}}}const Zs=Object.freeze(Object.defineProperty({__proto__:null,OpenMeteoWindProfiles:nt,Winds:X},Symbol.toStringTag,{value:"Module"})),xn=X.rounded,We={key:"flares",messages:vn,phenomenon:()=>"DecoyFlare",inWind:(n,t)=>({...n,wind:xn(t.at(n.aircraft.altitudeM))}),compute:()=>d(async()=>{const{DecoyFlare:n}=await import("./DecoyFlare-DUt1_LcW.js");return{DecoyFlare:n}},[],import.meta.url).then(({DecoyFlare:n})=>t=>n.bodiesOf(t))},Mn=_.catalog({en:()=>d(()=>import("./LanternKindMessages_en-CQXdJ-k6.js"),[],import.meta.url).then(n=>n.lanternKindMessages_en),fr:()=>d(()=>import("./LanternKindMessages_fr-D7tQa_tQ.js"),[],import.meta.url).then(n=>n.lanternKindMessages_fr),es:()=>d(()=>import("./LanternKindMessages_es-BOO6kPjs.js"),[],import.meta.url).then(n=>n.lanternKindMessages_es),it:()=>d(()=>import("./LanternKindMessages_it-B8J-29Mj.js"),[],import.meta.url).then(n=>n.lanternKindMessages_it)}),Ye=X.rounded,Xe={key:"lanterns",messages:Mn,phenomenon:()=>"SkyLantern",inWind:(n,t)=>{const e=n.site.altitudeM??0,r=n.windAloft?.atM??1e3;return{...n,wind:Ye(t.at(10)),windAloft:{...Ye(t.at(e+r)),atM:r}}},compute:()=>d(async()=>{const{SkyLantern:n}=await import("./SkyLantern-DJT_Ibzh.js");return{SkyLantern:n}},__vite__mapDeps([0,1]),import.meta.url).then(({SkyLantern:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{LanternEditor:n}=await import("./LanternEditor-DEeA3Kf_.js");return{LanternEditor:n}},__vite__mapDeps([2,3,4,5,0,1,6,7,8]),import.meta.url).then(({LanternEditor:n})=>(t,e,r)=>new n(t,e,r))},An=_.catalog({en:()=>d(()=>import("./BirdKindMessages_en-c_-L7frF.js"),[],import.meta.url).then(n=>n.birdKindMessages_en),fr:()=>d(()=>import("./BirdKindMessages_fr-C1TuqqEj.js"),[],import.meta.url).then(n=>n.birdKindMessages_fr),es:()=>d(()=>import("./BirdKindMessages_es-8Zo2t0o4.js"),[],import.meta.url).then(n=>n.birdKindMessages_es),it:()=>d(()=>import("./BirdKindMessages_it-DQZcrCkf.js"),[],import.meta.url).then(n=>n.birdKindMessages_it)}),Je={key:"birds",messages:An,phenomenon:()=>"Birds",compute:()=>d(async()=>{const{BirdFlock:n}=await import("./BirdFlock-ByBkJV35.js").then(t=>t.b);return{BirdFlock:n}},__vite__mapDeps([9,1]),import.meta.url).then(({BirdFlock:n})=>(t,e)=>n.bodiesOf(t,e?.obstacles)),editor:()=>d(async()=>{const{BirdEditor:n}=await import("./BirdEditor-CBVGyUnK.js");return{BirdEditor:n}},__vite__mapDeps([10,3,4,5,9,1,8,11]),import.meta.url).then(({BirdEditor:n})=>(t,e,r)=>new n(t,e,r))},Tn=_.catalog({en:()=>d(()=>import("./DroneKindMessages_en-CLygXcsv.js"),[],import.meta.url).then(n=>n.droneKindMessages_en),fr:()=>d(()=>import("./DroneKindMessages_fr-CAX15_pk.js"),[],import.meta.url).then(n=>n.droneKindMessages_fr),es:()=>d(()=>import("./DroneKindMessages_es-B9XFRYnQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_es),it:()=>d(()=>import("./DroneKindMessages_it-CSGsCaJQ.js"),[],import.meta.url).then(n=>n.droneKindMessages_it)}),Ze={quadcopter:"ConsumerDrone",saucer:"ConsumerDrone","fixed-wing":"MilitaryDrone"},Qe={key:"drones",messages:Tn,phenomenon:n=>Ze[n.airframe]??Ze.quadcopter,compute:()=>d(async()=>{const{DroneFlight:n}=await import("./DroneFlight-CGNIh9XS.js").then(t=>t.c);return{DroneFlight:n}},__vite__mapDeps([12,13]),import.meta.url).then(({DroneFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{DroneEditor:n}=await import("./DroneEditor-7X9CM_3H.js");return{DroneEditor:n}},__vite__mapDeps([14,3,4,5,15,12,13,8,11]),import.meta.url).then(({DroneEditor:n})=>(t,e,r)=>new n(t,e,r))},In=_.catalog({en:()=>d(()=>import("./BalloonKindMessages_en-C6tZ-5gT.js"),[],import.meta.url).then(n=>n.balloonKindMessages_en),fr:()=>d(()=>import("./BalloonKindMessages_fr-C3QJIuDJ.js"),[],import.meta.url).then(n=>n.balloonKindMessages_fr),es:()=>d(()=>import("./BalloonKindMessages_es-BfoEjhe1.js"),[],import.meta.url).then(n=>n.balloonKindMessages_es),it:()=>d(()=>import("./BalloonKindMessages_it-CkO7mqHp.js"),[],import.meta.url).then(n=>n.balloonKindMessages_it)}),Qs=["round","star","heart","figure"];class he{static HELIUM_KG_MOL=.0040026;static ALL=[{id:"hot-air",modelId:"ufoathome-balloon-hot-air",envelope:"open",launchVolumeM3:2550,maxVolumeM3:2550,massKg:540,dragCoefficient:.5,aspect:1.461,widthM:16.5,color:"#c8202f",stripeColor:"#f5c400",albedo:.4,burner:{heatingKS:1.2,coolingS:400,blastS:6,maxExcessK:100,flameCdM2:2e4,envelopeCdM2:40,color:"#ffb347"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"party",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.0115,maxVolumeM3:.0335,massKg:.0045,dragCoefficient:.47,aspect:1.13,color:"#d8263a",albedo:.35,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"led",modelId:"ufoathome-balloon-led",envelope:"elastic",launchVolumeM3:.0141,maxVolumeM3:.041,massKg:.0075,dragCoefficient:.47,aspect:1.115,color:"#ffffff",albedo:.5,glow:{candela:.5,color:"#ffffff"},phenomenon:"LedBalloon",durationS:3600},{id:"foil",modelId:"ufoathome-balloon-foil",envelope:"vented",launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,dragCoefficient:.6,aspect:1.034,widthM:.45,depthRatio:.267,color:"#c9cdd2",albedo:.85,finish:"mirror",spins:!0,shapes:{round:{modelId:"ufoathome-balloon-foil",aspect:1.034,widthM:.45,depthRatio:.267,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#c9cdd2"},star:{modelId:"ufoathome-balloon-foil-star",aspect:1.029,widthM:.5,depthRatio:.183,launchVolumeM3:.012,maxVolumeM3:.012,massKg:.009,color:"#e0b83a"},heart:{modelId:"ufoathome-balloon-foil-heart",aspect:.903,widthM:.5,depthRatio:.2,launchVolumeM3:.014,maxVolumeM3:.014,massKg:.01,color:"#d81e3c"},figure:{modelId:"ufoathome-balloon-foil-figure",aspect:1.112,widthM:.8,depthRatio:.127,launchVolumeM3:.05,maxVolumeM3:.05,massKg:.03,color:"#f0a3c8"}},phenomenon:"FoilBalloon",durationS:3600},{id:"pilot",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.144,maxVolumeM3:.57,massKg:.045,dragCoefficient:.4,aspect:1.13,color:"#f0e6cf",albedo:.55,lamp:{candela:1,color:"#fff1c4"},phenomenon:"WeatherBalloonsOrMongolfieres",durationS:5400},{id:"weather",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:1.75,maxVolumeM3:118.9,massKg:.85,dragCoefficient:.3,aspect:1.13,color:"#f2ece0",albedo:.55,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:7200},{id:"stratospheric",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:219,maxVolumeM3:14e3,massKg:210,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"stratospheric-large",modelId:"ufoathome-balloon-stratospheric",envelope:"vented",launchVolumeM3:730,maxVolumeM3:15e4,massKg:700,dragCoefficient:.4,aspect:.91,color:"#e9eef2",albedo:.8,ballastKg:140,phenomenon:"StratosphericBalloons",durationS:14400},{id:"superpressure",modelId:"ufoathome-balloon-latex",envelope:"superpressure",launchVolumeM3:45,maxVolumeM3:523,massKg:44,dragCoefficient:.4,aspect:1.13,color:"#eef1f4",albedo:.8,phenomenon:"StratosphericBalloons",durationS:10800},{id:"infrared",modelId:"ufoathome-balloon-stratospheric",envelope:"open",launchVolumeM3:2075,maxVolumeM3:45e3,massKg:150,dragCoefficient:.4,aspect:.91,color:"#9aa0a8",albedo:.4,insideExcessK:20,phenomenon:"StratosphericBalloons",durationS:10800},{id:"prank-candles",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:.25,maxVolumeM3:.25,massKg:.02,dragCoefficient:.6,aspect:1.515,widthM:.6,color:"#f4f4f4",albedo:.6,insideExcessK:60,spins:!0,sways:!0,flames:{count:4,candela:.5,color:"#ffb347",burnS:720,coolingS:15},phenomenon:"SkyLantern",durationS:1200},{id:"prank-flares",modelId:"ufoathome-balloon-prank",envelope:"open",launchVolumeM3:2,maxVolumeM3:2,massKg:.3,dragCoefficient:.6,aspect:1.515,widthM:1.2,color:"#2b2d30",albedo:.1,insideExcessK:80,spins:!0,sways:!0,flames:{count:1,candela:150,color:"#ff3a20",burnS:900,coolingS:30},phenomenon:"SkyLantern",durationS:1500},{id:"anti-hail",modelId:"ufoathome-balloon-latex",envelope:"elastic",launchVolumeM3:.65,maxVolumeM3:8,massKg:.4,dragCoefficient:.35,aspect:1.13,color:"#f2ece0",albedo:.55,torch:{aboveM:600,candela:300,color:"#ff9a3c",burnS:90,fallMS:4},phenomenon:"ParachuteFlare",durationS:1200},{id:"solar",modelId:"ufoathome-balloon-latex",envelope:"open",launchVolumeM3:14,maxVolumeM3:14,massKg:.4,dragCoefficient:.47,aspect:1.13,color:"#151515",albedo:.05,insideExcessK:10,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600},{id:"captive",modelId:"ufoathome-balloon-latex",envelope:"sealed",tethered:!0,launchVolumeM3:14,maxVolumeM3:14,massKg:8,dragCoefficient:.47,aspect:1.13,color:"#f4f4f4",albedo:.7,phenomenon:"WeatherBalloonsOrMongolfieres",durationS:3600}];static byId(t){return he.ALL.find(e=>e.id===t)}}const tr=X.rounded,er={key:"balloons",messages:In,phenomenon:n=>{const t=typeof n.balloon=="string"?n.balloon:n.balloon?.id;return(he.byId(t)??he.ALL[0]).phenomenon},inWind:(n,t)=>{const e=n.site.altitudeM??0;return{...n,wind:tr(t.at(10)),windsAloft:t.levels.filter(r=>r>e+10).map(r=>({...tr(t.at(r)),atM:Math.round(r-e)}))}},compute:()=>d(async()=>{const{BalloonFlight:n}=await import("./BalloonFlight-CvE7AHlm.js");return{BalloonFlight:n}},[],import.meta.url).then(({BalloonFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{BalloonEditor:n}=await import("./BalloonEditor-BBAtMeVM.js");return{BalloonEditor:n}},__vite__mapDeps([16,3,4,5,15,12,13,17,6,7,8]),import.meta.url).then(({BalloonEditor:n})=>(t,e,r)=>new n(t,e,r))},_n=_.catalog({en:()=>d(()=>import("./AirshipKindMessages_en-DzGapVTV.js"),[],import.meta.url).then(n=>n.airshipKindMessages_en),fr:()=>d(()=>import("./AirshipKindMessages_fr-BTXNsW5W.js"),[],import.meta.url).then(n=>n.airshipKindMessages_fr),es:()=>d(()=>import("./AirshipKindMessages_es-TE93uMSC.js"),[],import.meta.url).then(n=>n.airshipKindMessages_es),it:()=>d(()=>import("./AirshipKindMessages_it-Cwa3MnJ-.js"),[],import.meta.url).then(n=>n.airshipKindMessages_it)}),le=(n,t,e,r=5)=>({"nav-left":{color:"#ff2a1a",candela:r,leds:[{at:n,radiusM:.06}]},"nav-right":{color:"#2aff5a",candela:r,leds:[{at:t,radiusM:.06}]},tail:{color:"#ffffff",candela:r,leds:[{at:e,radiusM:.06}]}});class fe{static ALL=[{id:"blimp",modelId:"ufoathome-airship-blimp",sizeM:{widthM:14.72,lengthM:59.46,heightM:17.59},cruiseMS:15,maxSpeedMS:22,color:"#c9ccd1",finColor:"#1d3f8a",albedo:.6,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!0},lights:{...le([-1.22,-8.6,-9],[1.22,-8.6,-9],[0,0,29.7]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-10.15,-9],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"zeppelin-nt",modelId:"ufoathome-airship-zeppelin-nt",sizeM:{widthM:18.2,lengthM:75.11,heightM:19.55},cruiseMS:19,maxSpeedMS:35,color:"#eef0f2",finColor:"#eef0f2",albedo:.75,sign:{color:"#fff4d8",luminanceCdM2:150,lit:!1},lights:{...le([-1.32,-8.4,-14],[1.32,-8.4,-14],[0,0,37.5]),strobe:{color:"#ffffff",candela:400,hz:1,flashS:.06,leds:[{at:[0,-9.65,-14],radiusM:.08}]}},sound:"light-piston",phenomenon:"Airship"},{id:"lightship",modelId:"ufoathome-airship-lightship",sizeM:{widthM:10.16,lengthM:39.66,heightM:11.98},cruiseMS:13,maxSpeedMS:20,color:"#f4f4f2",finColor:"#f4f4f2",albedo:.7,glowCdM2:20,lights:le([-.82,-5.9,-6],[.82,-5.9,-6],[0,0,19.8]),sound:"light-piston",phenomenon:"Airship"},{id:"aerostat",modelId:"ufoathome-airship-aerostat",sizeM:{widthM:25.14,lengthM:63.6,heightM:27.05},cruiseMS:0,maxSpeedMS:0,tethered:!0,color:"#f2f2f0",finColor:"#f2f2f0",albedo:.7,lights:{nose:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-4.2,-30],radiusM:.12}]},stern:{color:"#ff2a1a",candela:2e3,hz:.5,flashS:.6,leds:[{at:[0,-6.3,22],radiusM:.12}]}},phenomenon:"Airship"},{id:"rigid",modelId:"ufoathome-airship-rigid",sizeM:{widthM:33.38,lengthM:236.66,heightM:35.79},cruiseMS:32,maxSpeedMS:36,color:"#b9bcbf",finColor:"#b9bcbf",albedo:.55,lights:le([-3.02,-16.5,-80],[3.02,-16.5,-80],[0,0,118.3],10),sound:"piston-heavy",phenomenon:"Airship"}];static byId(t){return fe.ALL.find(e=>e.id===t)}}const rr={key:"airships",messages:_n,phenomenon:n=>{const t=typeof n.airship=="string"?n.airship:n.airship?.id;return(fe.byId(t)??fe.ALL[0]).phenomenon},compute:()=>d(async()=>{const{AirshipFlight:n}=await import("./AirshipFlight-6yYGIRn8.js");return{AirshipFlight:n}},__vite__mapDeps([18,12,13]),import.meta.url).then(({AirshipFlight:n})=>t=>n.bodiesOf(t)),editor:()=>d(async()=>{const{AirshipEditor:n}=await import("./AirshipEditor-EBfUtSiB.js");return{AirshipEditor:n}},__vite__mapDeps([19,3,4,5,15,12,13,18,8,11]),import.meta.url).then(({AirshipEditor:n})=>(t,e,r)=>new n(t,e,r))},Qr=A.point("interpretations").provide(A.BUILT_IN,[{id:We.key,name:"Decoy flares",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>We},{id:Xe.key,name:"Sky lanterns",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Xe},{id:Je.key,name:"Birds",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Je},{id:Qe.key,name:"Drones",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>Qe},{id:er.key,name:"Balloons",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>er},{id:rr.key,name:"Airships",credit:"UFO@home",creditUrl:"https://ufoathome.org/docs/format/",create:()=>rr}]);class $e{static kinds(){return Qr.map(t=>N.of(t))}}const to=Object.freeze(Object.defineProperty({__proto__:null,INTERPRETATION_SOURCES:Qr,InterpretationRegistry:$e},Symbol.toStringTag,{value:"Module"}));class z{static SIGHTING_EVENT="sighting";static INTERPRETATION_EVENT="interpretation";static INTERVIEW_EVENT="interview";static check(t){return ht.check(t,"case")}static isCase(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&Array.isArray(t.events)&&!("timeline"in t)}static sightingUrls(t,e){return(t.events??[]).filter(r=>r.eventType===z.SIGHTING_EVENT&&!r.interpretationOf&&typeof r.url=="string"&&r.url!=="").map(r=>new URL(r.url,e).href)}static accountIds(t,e,r,s){const o=(t.events??[]).filter(i=>i.eventType===z.SIGHTING_EVENT&&i.id!==void 0&&typeof i.url=="string"&&r!==void 0&&new URL(i.url,e).href===r).map(i=>i.id);return s!==void 0&&o.push(s),o}static interpretationEvents(t,e){const r=[e].flat().filter(s=>!!s);return r.length===0?[]:(t.events??[]).filter(s=>s.eventType===z.INTERPRETATION_EVENT?s.sighting!==void 0&&r.includes(s.sighting):s.eventType!==z.SIGHTING_EVENT||s.interpretationOf===void 0?!1:[s.interpretationOf].flat().some(o=>r.includes(o))).map(s=>s)}static problems(t,e){const r=t.events??[],s=new Set,o=new Set;for(const a of r)a.id!==void 0&&(s.has(a.id)&&o.add(a.id),s.add(a.id));const i=[];for(const a of r){const l=a.eventType===z.SIGHTING_EVENT?a.interpretationOf:a.eventType===z.INTERVIEW_EVENT?a.interviewOf:void 0;if(l!==void 0)for(const c of[l].flat())!s.has(c)&&!e.includes(c)&&i.push({reading:a.url??a.id??"",reference:c})}return{duplicateIds:[...o],unresolved:i}}static async interpretationOf(t,e,r){if(t.bodies)return z.withModelsFrom(j.strip({title:t.title,bodies:t.bodies??[],smoke:t.smoke,findings:t.findings,...N.computedPart(t,$e.kinds())}).recording,e);if(!t.url)return{title:t.title,bodies:[]};const s=new URL(t.url,e).href,o=await r(s),i=j.strip("timeline"in o&&o.interpretation?o.interpretation:o).recording;return z.withModelsFrom({title:t.title??i.title,bodies:i.bodies??[],smoke:i.smoke,findings:i.findings,...N.computedPart(i,$e.kinds())},s)}static withModelsFrom(t,e){return{...t,bodies:t.bodies.map(r=>r.model?.url?{...r,model:{...r.model,url:new URL(r.model.url,e).href}}:r)}}}class F{static files=new Map;static hold(t){for(const[e,r]of t)F.files.set(F.key(e),r)}static releaseCopies(){for(const[t,e]of F.files)e.local||F.files.delete(t)}static clear(){F.files.clear()}static localBase(){return new URL(`local/${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}/`,location.href).href}static read(t){const e=F.files.get(F.key(t));return e===void 0?void 0:structuredClone(e.json)}static changed(...t){return t.some(e=>e!==void 0&&F.files.get(F.key(e))?.changed===!0)}static local(t){return t!==void 0&&F.files.get(F.key(t))?.local===!0}static key(t){const e=new URL(t,location.href);return e.hash="",e.href}}class Q{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static taken(t,e){const r={};if(t==="decor")return Array.isArray(e.decor)&&(r.decor=e.decor.filter(Q.surveyed)),r;for(const s of Q.KEYS[t])e[s]!==void 0&&(r[s]=e[s]);return r}static strip(t,e){if(t==="decor"){const r=Array.isArray(e.decor)?e.decor.filter(s=>!Q.surveyed(s)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of Q.KEYS[t])delete e[r]}static put(t,e,r){if(t==="decor"){if(!Array.isArray(r.decor))return;const s=Array.isArray(e.decor)?e.decor.filter(o=>!Q.surveyed(o)):[];e.decor=[...s,...r.decor];return}for(const s of Q.KEYS[t])r[s]!==void 0&&(e[s]=r[s])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class tn{static NAMES=["relief","imagery","roads","water","railways","upperAir","map"];static TERRAIN=["relief","imagery","roads","water","railways"];static held(t,e){if(!t||t.live)return;const r=t[e];return r&&!r.live&&!r.refresh&&r.src!==void 0?r:void 0}static isLive(t,e){return t?.live===!0||t?.[e]?.live===!0}static annexName(t,e){const r=e==="relief"||e==="imagery"||e==="map"?"zip":"json",s=e.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`);return`${t}.${s}.${r}`}static isEmpty(t){return!t||!t.live&&tn.NAMES.every(e=>!t[e])&&Q.NAMES.every(e=>!t[e])}}class xt extends Error{constructor(t,e,r){super(`${t}: ${e}${r===void 0?"":` (HTTP ${r})`}`),this.kind=t,this.url=e,this.status=r,this.name="SightingFetchError"}}class jt{static async recording(t){const e=F.read(t);if(e!==void 0)return e;const r=await jt.json(t);for(const s of Q.NAMES){const o=r?.snapshots?.[s];if(!(!o?.src||o.live))try{const i=ht.recording(await jt.json(new URL(o.src,new URL(t,location.href)).href));Q.put(s,r,i)}catch{}}return r}static async json(t){const e=new URL(t,location.href),r=F.read(e.href);if(r!==void 0)return r;if(location.protocol==="https:"&&e.protocol==="http:")throw new xt("mixed-content",t);let s;try{s=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!s.ok)throw new xt("status",t,s.status);try{return await s.json()}catch{throw new xt("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new xt("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new xt("cors",t)}catch{return new xt("unreachable",t)}}}const eo=Object.freeze(Object.defineProperty({__proto__:null,SightingFetch:jt,SightingFetchError:xt},Symbol.toStringTag,{value:"Module"}));class Pe{constructor(t,e,r=()=>{}){this.place=t,this.changed=r,e&&this.adopt(e)}reader;editor;handed;get reading(){return this.reader!==void 0}get editorLoaded(){return this.editor!==void 0}adopt(t){this.editor=t,t.switcher=this,t.hasAttribute(ve)||t.setAttribute(ve,""),t.addEventListener(gn,e=>{e.preventDefault();const r=e.detail;this.handed=r.src,this.read(r)})}async read({src:t,track:e}){const[{register:r,CASE_ELEMENT_NAME:s,OPEN_EVENTS_ATTRIBUTE:o},{registerSighting:i,SIGHTING_ELEMENT_NAME:a}]=await Promise.all([d(()=>import("./CaseElement-CTZ3YIL0.js"),__vite__mapDeps([20,21,22,6,7,23,3,4,13,24,25,1,26]),import.meta.url),d(()=>import("./SightingElement-CFItfa0b.js"),__vite__mapDeps([26,22,6,7,23,3,4,13,24,25,1]),import.meta.url)]);i(),r();const l=z.isCase(F.read(t)??await jt.json(t)),c=document.createElement(l?s:a);c.setAttribute(ve,""),c.setAttribute("show-labels",""),l&&e&&c.setAttribute(o,Pe.fileKey(e)),c.setAttribute("src",t),c.addEventListener(wn,m=>{m.preventDefault(),this.edit(m.detail)}),this.reader?.remove(),this.place(c),this.editor&&(this.editor.hidden=!0),this.reader=c,this.changed({mode:"read",src:t,...e?{track:e}:{}})}async edit(t){const e=this.editor;if(e){if(this.dropReader(),F.releaseCopies(),e.hidden=!1,this.changed({mode:"edit"}),t?.src!==void 0&&t.src!==this.handed){this.load(e,t.src,t.track);return}t?.track&&await e.openTrack(t.track);return}const{register:r,CASE_EDITOR_ELEMENT_NAME:s}=await d(async()=>{const{register:i,CASE_EDITOR_ELEMENT_NAME:a}=await import("./CaseEditorElement-CPt1laCe.js").then(l=>l.a);return{register:i,CASE_EDITOR_ELEMENT_NAME:a}},__vite__mapDeps([27,3,4,8,21,22,6,7,23,13,24,25,1,28,29,11,30,31,32,33]),import.meta.url);r();const o=document.createElement(s);this.adopt(o),t?.track&&o.setAttribute("track",t.track),t?.src?o.setAttribute("src",t.src):t?.start&&(o.caseStart=t.start),this.dropReader(),this.place(o),this.changed({mode:"edit"})}async open(t){const e=this.editor;if(this.reading||!e)return this.read({src:t});this.load(e,t)}load(t,e,r){this.handed=void 0,r?t.setAttribute("track",r):t.removeAttribute("track"),t.setAttribute("src",e)}async startNew(t){const e=this.editor;if(!e)return this.edit(t?{start:t}:void 0);this.reading&&await this.edit(),e.askBeforeReplacing(()=>{e.remove(),this.editor=void 0,this.edit(t?{start:t}:void 0)})}dropReader(){this.reader?.remove(),this.reader=void 0}static fileKey(t){return new URL(t,location.href).pathname.split("/").pop().replace(/\.json$/i,"")}}const Fe="rr0-input-file",en={inputFileFromFile:"from your disk",inputFileFromUrl:"from an address",inputFileModeHint:"Click to give it the other way: a file of yours, or an address",inputFileLoad:"Load"},Nn=`
|
|
3
3
|
rr0-input-file { display: inline-flex; align-items: center; gap: .3em; }
|
|
4
4
|
/* As the date's own switch (see DateInputElement): it reads as part of the label, before the field. */
|
|
5
5
|
rr0-input-file .input-file-mode { order: -1; font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .15em; }
|
|
@@ -8,8 +8,8 @@ rr0-input-file .input-file-mode:focus-visible { outline: 2px solid #4af; outline
|
|
|
8
8
|
/* As long as the address it holds, from 18em: an annex's is longer than that, and cut it says nothing of where it is. */
|
|
9
9
|
rr0-input-file input[type="url"] { field-sizing: content; min-width: 18em; max-width: min(100%, 60vw); }
|
|
10
10
|
rr0-input-file [hidden] { display: none !important; }
|
|
11
|
-
`;class rn extends HTMLElement{fileInput;urlInput;loadButton;modeButton;wording=en;shownMode="file";build(){if(this.fileInput)return;const t=this.getAttribute("name"),e=this.ownerDocument,r=e.createElement("style");r.textContent=
|
|
12
|
-
`)}`}static request(t,e){return new Promise((r,s)=>{const o=indexedDB.open(V.DATABASE,1);o.onupgradeneeded=()=>o.result.createObjectStore(V.STORE),o.onerror=()=>s(o.error),o.onsuccess=()=>{const i=o.result,a=i.transaction(V.STORE,t),l=e(a.objectStore(V.STORE));a.oncomplete=()=>{i.close(),r(l.result)},a.onerror=()=>{i.close(),s(a.error)}}})}}class
|
|
11
|
+
`;class rn extends HTMLElement{fileInput;urlInput;loadButton;modeButton;wording=en;shownMode="file";build(){if(this.fileInput)return;const t=this.getAttribute("name"),e=this.ownerDocument,r=e.createElement("style");r.textContent=Nn;const s=this.fileInput=e.createElement("input");s.type="file";const o=this.getAttribute("accept");o&&(s.accept=o),s.multiple=this.hasAttribute("multiple");const i=this.urlInput=e.createElement("input");i.type="url",i.placeholder=this.getAttribute("placeholder")??"https://…";const a=this.loadButton=e.createElement("button");a.type="button",a.hidden=this.hasAttribute("no-button");const l=this.modeButton=e.createElement("button");l.type="button",l.className="input-file-mode",t&&(s.id=`${t}-file`,i.id=`${t}-url`,a.id=`${t}-url-button`,l.id=`${t}-mode`),this.append(r,s,i,a,l),s.addEventListener("change",()=>{const c=[...s.files??[]];c.length!==0&&(this.pick({file:c[0],files:c}),this.hasAttribute("keep-file")||(s.value=""))}),s.addEventListener("click",c=>{const m=window.showOpenFilePicker;!this.hasAttribute("handles")||typeof m!="function"||(c.preventDefault(),this.pickHandles(m))}),a.addEventListener("click",()=>this.commitUrl()),i.addEventListener("keydown",c=>{c.key==="Enter"&&(c.preventDefault(),this.commitUrl())}),this.hasAttribute("no-button")&&i.addEventListener("change",()=>this.commitUrl()),l.addEventListener("click",()=>{this.mode=this.shownMode==="file"?"url":"file",(this.shownMode==="file"?s:i).focus()}),this.shownMode=this.getAttribute("mode")==="url"?"url":"file",this.render()}connectedCallback(){this.build()}async pickHandles(t){let e;try{const s=(this.getAttribute("accept")??"").split(",").map(o=>o.trim()).filter(o=>o.startsWith("."));e=await t({multiple:this.hasAttribute("multiple"),...s.length?{types:[{accept:{"application/json":s}}]}:{}})}catch{return}if(e.length===0)return;const r=await Promise.all(e.map(s=>s.getFile()));this.pick({file:r[0],files:r,handles:e})}commitUrl(){const t=this.urlInput.value.trim();t&&this.pick({url:t})}pick(t){this.dispatchEvent(new CustomEvent("filepick",{detail:t,bubbles:!0,composed:!0}))}render(){const t=this.shownMode==="file";this.fileInput.hidden=!t,this.urlInput.hidden=t,this.loadButton.hidden=t||this.hasAttribute("no-button"),this.modeButton.textContent=t?this.wording.inputFileFromFile:this.wording.inputFileFromUrl,this.modeButton.title=this.wording.inputFileModeHint,this.loadButton.textContent=this.wording.inputFileLoad}get mode(){return this.shownMode}set mode(t){this.build(),this.shownMode=t,this.render()}get url(){return this.build(),this.urlInput.value.trim()}set url(t){this.build(),this.urlInput.value=t,t&&(this.mode="url")}get file(){return this.build(),this.fileInput.files?.[0]??void 0}get value(){if(this.mode==="file"){const t=this.file;return t?{file:t}:void 0}return this.url?{url:this.url}:void 0}clear(){this.build(),this.fileInput.value="",this.urlInput.value=""}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.build(),this.toggleAttribute("disabled",t);for(const e of[this.fileInput,this.urlInput,this.loadButton,this.modeButton])e.disabled=t}openPicker(){this.build(),this.fileInput.click()}focus(){this.build(),(this.shownMode==="file"?this.fileInput:this.urlInput).focus()}get controls(){return this.build(),{file:this.fileInput,url:this.urlInput,load:this.loadButton,mode:this.modeButton}}set messages(t){this.wording=t,this.fileInput&&this.render()}set placeholder(t){this.build(),this.urlInput.placeholder=t}static async bytesOf(t,e=fetch.bind(globalThis)){if(t.file)return new Uint8Array(await new Promise((s,o)=>{const i=new FileReader;i.onload=()=>s(i.result),i.onerror=()=>o(i.error),i.readAsArrayBuffer(t.file)}));const r=await e(t.url);if(!r.ok)throw new Error(`${r.status} ${t.url}`);return new Uint8Array(await r.arrayBuffer())}}function nn(){customElements.get(Fe)||customElements.define(Fe,rn)}const ro=Object.freeze(Object.defineProperty({__proto__:null,INPUT_FILE_ELEMENT_NAME:Fe,InputFileElement:rn,inputFileMessages_en:en,register:nn},Symbol.toStringTag,{value:"Module"}));class V{static MAX=12;static DATABASE="rr0-ufoathome";static STORE="recent";static async list(){try{return(await V.request("readonly",e=>e.getAll())).sort((e,r)=>r.openedAt-e.openedAt)}catch{return[]}}static async add(t){try{const e=(await V.list()).filter(r=>V.key(r)!==V.key(t)).slice(0,V.MAX-1);await V.request("readwrite",r=>{r.clear();for(const s of[t,...e])r.put(s,V.key(s));return r.count()})}catch{}}static async remove(t){try{await V.request("readwrite",e=>e.delete(V.key(t)))}catch{}}static async files(t){if(t.kind==="copy")return t.copies.map(e=>new File([e.text],e.name,{type:"application/json"}));if(t.kind!=="address"){for(const e of t.handles){const r=await e.queryPermission?.({mode:"read"});if(r!==void 0&&r!=="granted"&&await e.requestPermission?.({mode:"read"})!=="granted")throw new Error(`${e.name} may not be read again`)}return Promise.all(t.handles.map(e=>e.getFile()))}}static key(t){return t.kind==="address"?`address ${t.url}`:`files ${[...t.kind==="handles"?t.handles.map(r=>r.name):t.copies.map(r=>r.name)].sort().join(`
|
|
12
|
+
`)}`}static request(t,e){return new Promise((r,s)=>{const o=indexedDB.open(V.DATABASE,1);o.onupgradeneeded=()=>o.result.createObjectStore(V.STORE),o.onerror=()=>s(o.error),o.onsuccess=()=>{const i=o.result,a=i.transaction(V.STORE,t),l=e(a.objectStore(V.STORE));a.oncomplete=()=>{i.close(),r(l.result)},a.onerror=()=>{i.close(),s(a.error)}}})}}class xe{static TOKENS=`
|
|
13
13
|
--ink: light-dark(#131a26, #e8ecf4);
|
|
14
14
|
--ink-dim: light-dark(#4c5a70, #a3adc2);
|
|
15
15
|
--ink-faint: light-dark(#78859b, #6f7b93);
|
|
@@ -114,7 +114,7 @@ ${t} :is(select:not([multiple]):not([size]), .rr0-select) {
|
|
|
114
114
|
:is(${s(q.INFO,t)}) { color: color-mix(in srgb, CanvasText 62%, transparent); }
|
|
115
115
|
:is(${s(q.WARNING,e)}) { color: color-mix(in srgb, #e48a00 72%, CanvasText); }
|
|
116
116
|
:is(${s(q.ERROR,r)}) { color: color-mix(in srgb, #e5322d 72%, CanvasText); }
|
|
117
|
-
`}static show(t,e,r="info"){t.textContent=e??"",t.hidden=!e,t.classList.toggle(q.INFO,r==="info"),t.classList.toggle(q.WARNING,r==="warning"),t.classList.toggle(q.ERROR,r==="error")}}class J{static given=new Map;static add(t,e){const r=decodeURIComponent(e.replace(/[?#].*$/,"").replace(/^.*\//,"")).replace(/\.json$/i,"")||"interview",s=t.name.replace(/[\\/:*?"<>|#%]+/g,"_").trim()||"file";let o=`${r}-files/${s}`;for(let i=2;J.given.has(new URL(encodeURI(o),e).href);i++)o=`${r}-files/${s.replace(/(\.[^.]*)?$/,`-${i}$1`)}`;return J.given.set(new URL(encodeURI(o),e).href,{blob:t}),{src:o,name:t.name,...t.type?{type:t.type}:{}}}static shown(t,e){const r=J.url(t,e),s=J.given.get(r);return s?(s.shown??=URL.createObjectURL(s.blob),s.shown):r}static fileName(t){return t.name??(decodeURIComponent(t.src.replace(/[?#].*$/,"").replace(/\/+$/,"").replace(/^.*\//,""))||t.src)}static isImage(t){return(t.type??"").startsWith("image/")||/\.(png|jpe?g|gif|webp|avif|svg)$/i.test(J.fileName(t))}static url(t,e){try{return new URL(/^[a-z][a-z0-9+.-]*:/i.test(t.src)?t.src:encodeURI(t.src),e??(typeof location>"u"?void 0:location.href)).href}catch{return t.src}}static blob(t){return J.given.get(t)?.blob}static clear(){for(const{shown:t}of J.given.values())t&&URL.revokeObjectURL(t);J.given.clear()}}class O{static withImages(t,e){const r=s=>s?.forEach(o=>{o.src=e(o.src)});for(const s of t.sections){r(s.images);for(const o of s.fields)r(o.images)}return t}static added=new Map;static ids(){return[...O.added.keys()]}static add(t){O.added.set(t.id,t)}static fetched=new Map;static async load(t){const e=O.added.get(t);if(e||!/[/:]|\.json$/i.test(t))return e;let r=O.fetched.get(t);return r||(r=fetch(t).then(s=>s.ok?s.json():void 0).then(s=>{if(!(!s||typeof s.id!="string"||!Array.isArray(s.sections)))return O.add(O.withImages(s,o=>new URL(o,t).href)),s}).catch(()=>{}),O.fetched.set(t,r)),r}static fields(t){return t.sections.flatMap(e=>e.fields)}static field(t,e){return O.fields(t).find(r=>r.id===e)}static text(t,e){if(t===void 0)return"";if(typeof t=="string")return t;const r=t;return(e&&r[e])??Object.values(r)[0]??""}static interview(t,e={},r){const s=e.witnesses?.length===1?e.witnesses[0]:void 0;return{version:1,...t.language?{language:t.language}:{},title:t.title,medium:"questionnaire",questionnaire:{id:t.id,...t.version?{version:t.version}:{},...r?{recipient:r}:{}},...s?{interviewOf:s.id}:{},speakers:{interviewer:{role:"interviewer",...e.by?.[0]!==void 0?{by:{people:e.by[0]}}:{}},witness:{role:"witness",...s?{title:s.label,of:s.id}:{}}},transcription:{method:"manual"},proofreading:{interviewer:{status:"pending"},witness:{status:"pending"}},segments:O.fields(t).map(o=>({speaker:"interviewer",field:o.id,text:O.text(o.question,t.language)}))}}static answerOf(t,e){return O.answerTurn(t,e)?.text}static filesOf(t,e){return O.answerTurn(t,e)?.files??[]}static answerTurn(t,e){return t.segments.find(r=>r.field===e&&t.speakers[r.speaker]?.role==="witness")}static fileName(t){return J.fileName(t)}static answerFiles(t,e,r,s){O.answer(t,e,r.map(o=>O.fileName(o)).join("; "),s,void 0,r)}static answer(t,e,r,s,o,i){const a=Object.entries(t.speakers).find(([,f])=>f.role==="witness")?.[0]??"witness";t.speakers[a]||(t.speakers[a]={role:"witness"});const l=t.segments.findIndex(f=>f.field===e&&t.speakers[f.speaker]?.role==="witness"),c=r.trim(),m=f=>{const{text:y,redacted:S,files:E,...G}=f;return o?{...G,redacted:o}:{...G,text:c,...i?.length?{files:i}:{}}};if(l>=0){c===""?t.segments.splice(l,1):t.segments[l]=m(t.segments[l]);return}if(c==="")return;let p=t.segments.findIndex(f=>f.field===e&&t.speakers[f.speaker]?.role!=="witness");if(p<0){const f=Object.entries(t.speakers).find(([,y])=>y.role==="interviewer")?.[0]??"interviewer";t.speakers[f]||(t.speakers[f]={role:"interviewer"}),t.segments.push({speaker:f,field:e,text:s??e}),p=t.segments.length-1}t.segments.splice(p+1,0,m({speaker:a,field:e}))}}const ro=Object.freeze(Object.defineProperty({__proto__:null,QuestionnaireTemplates:O},Symbol.toStringTag,{value:"Module"}));class L{static FORMAT=1;static read=new Map;static async install(t){for(const r of t.questionnaires??[])O.add(r);const e=t.starts.flatMap(r=>r.questionnaires??[]).filter(r=>L.isAddress(r));await Promise.all([...new Set(e)].map(r=>O.load(r)))}static load(t,e=fetch.bind(globalThis)){const r=new URL(t,typeof location>"u"?void 0:location.href).href;let s=L.read.get(r);return s||(s=(async()=>{const o=await e(r);if(!o.ok)throw new Error(`${r}: HTTP ${o.status}`);return L.check(await o.json(),r,"page")})(),s.catch(()=>L.read.delete(r)),L.read.set(r,s)),s}static check(t,e,r="page",s){const o=t;if(o===null||typeof o!="object"||!Array.isArray(o.starts))throw new Error(`${e}: not a UFO@home case template`);if(typeof o.format=="number"&&o.format>L.FORMAT)throw new Error(`${e}: format ${o.format} is newer than ${L.FORMAT}`);const i=m=>new URL(m,e).href,a=L.recipientOf(o.recipient,e),l=o.starts.filter(m=>typeof m?.id=="string").map(m=>({...m,...a?{recipient:a}:{},...m.questionnaires?{questionnaires:m.questionnaires.filter(p=>typeof p=="string").map(p=>L.isAddress(p)?i(p):p)}:{},...m.modules?{modules:m.modules.filter(p=>typeof p=="string").map(i)}:{}}));if(l.length===0)throw new Error(`${e}: a case template offers no start`);const c=Array.isArray(o.questionnaires)?o.questionnaires.filter(m=>typeof m?.id=="string"&&Array.isArray(m.sections)).map(m=>O.withImages(structuredClone(m),p=>/^[a-z][a-z0-9+.-]*:/i.test(p)?p:i(p))):void 0;return{format:1,id:typeof o.id=="string"?o.id:e,title:o.title??o.id??e,...o.modules?{modules:o.modules.filter(m=>typeof m=="string").map(i)}:{},...a?{recipient:a}:{},...c?.length?{questionnaires:c}:{},starts:l,url:e,origin:r,...s?{fileName:s}:{}}}static recipientOf(t,e){if(t===void 0)return;const r=t?.publicKey;if(typeof t.id!="string"||!r||r.kty!=="RSA"||typeof r.n!="string")throw new Error(`${e}: its recipient has no RSA public key`);if(r.d!==void 0)throw new Error(`${e}: its recipient gives a private key, which must never be published`);const{kty:s,n:o,e:i,alg:a}=r;return{id:t.id,name:t.name??t.id,publicKey:{kty:s,n:o,e:i,...a?{alg:a}:{}},...typeof t.email=="string"&&/^[^@\s]+@[^@\s]+$/.test(t.email)?{email:t.email}:{}}}static isAddress(t){return/[/:]|\.json$/i.test(t)}static step(t){return t.start??(t.questionnaires?.length?"questionnaire":"observation")}}class U{static KEY="rr0-case-template";static read(t=U.storage()){try{const e=U.record(t);return e?U.parse(e.text,e.name,e.url):void 0}catch{return}}static parse(t,e,r){const s=r??(typeof location>"u"?"https://localhost/":location.href);return L.check(JSON.parse(t),s,r?"address":"file",e)}static keep(t,e,r=U.storage(),s){const o=U.parse(t,e,s);if(!r)throw new Error("No storage in this browser");return r.setItem(U.KEY,JSON.stringify({name:e,text:t,...s?{url:s}:{}})),o}static forget(t=U.storage()){try{t?.removeItem(U.KEY)}catch{}}static record(t){const e=t?.getItem(U.KEY);return e?JSON.parse(e):void 0}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class H extends Error{}class we{constructor(t){this.name=t}validate(t){return!0}}class sn extends we{min;max;constructor(t,e,r){super(t),this.min=e,this.max=r}validate(t){if(typeof t!="number")throw new H(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new H(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class v{name;min;max;duration;subUnit;validator;constructor(t,e,r,s,o=new sn(t,e,r)){this.name=t,this.min=e,this.max=r,this.subUnit=s,this.duration=s?(s.max-s.min+1)*s.duration:1,this.validator=o}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class Ue{millisecond;second;minute;hour;day;month;year}class Gn extends Ue{}class on extends Gn{millisecond=new v("millisecond",0,999,void 0);second=new v("second",0,59,this.millisecond);minute=new v("minute",0,59,this.second);hour=new v("hour",0,23,this.minute);day=new v("day",1,31,this.hour);month=new v("month",1,12,this.day);year=new v("year",0,9999,this.month)}const w=new on;class an extends sn{constructor(t=1,e=12){super("month",t,e)}}class _t extends v{static Month28=new _t(28);static Month29=new _t(29);static ThirtyDays=new _t(30);static ThirtyOneDays=new _t(31);constructor(t,e=new an(1,t)){super("month",1,t,w.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new H("Unsupported month",t,e)}}}class tt{static instance=new tt;render(t){return t.value.toString()}}class B{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new we(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=tt.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class h{static#t=new Map;static register(t,e){h.#t.set(t,e)}static get(t){const e=h.#t.get(t);if(!e)throw new H(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Ot extends B{constructor(t=new Date().getFullYear(),e=w.year){super(t,e)}static fromString(t,e=h.get(Ot)){return new Ot(e.parse(t))}}class rt extends tt{static default=new rt("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class Vt extends B{constructor(t=new Date().getMonth()+1,e=w.month){super(t,e)}static fromString(t,e=h.get(Vt)){return new Vt(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class $t extends B{constructor(t=new Date().getDate(),e=w.day){super(t,e)}static fromString(t,e=h.get($t)){const r=e.parse(t);return new $t(r)}toString(t=rt.default){return super.toString(t)}}class Ft extends B{constructor(t=new Date().getHours(),e=w.hour){super(t,e)}static fromString(t,e=h.get(Ft)){return new Ft(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class Dt extends B{constructor(t=new Date().getMinutes(),e=w.minute){super(t,e)}static fromString(t,e=h.get(Dt)){return new Dt(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class Pt extends B{constructor(t=new Date().getSeconds(),e=w.second){super(t,e)}static fromString(t,e=h.get(Pt)){return new Pt(e.parse(t),w.second)}toString(t=rt.default){return super.toString(t)}}class xt extends B{static renderer=new rt("0",3);constructor(t,e=w.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=xt.renderer){return super.toString(t)}}class kn{render(t){return t.toString()}}class Rn extends kn{render(t){const e=t.value,r=Math.abs(e),s=Math.floor(r/60),o=r%60;if(s===0&&o===0)return"Z";{const i=e<0?"-":"+",a=s.toString().padStart(2,"0"),l=o>0?":"+o.toString().padEnd(2,"0"):"";return i+a+l}}}class St{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=h.get(St),r=void 0){const s=e.parse(t,r);return new St(s)}toString(t=new Rn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class P{static timeshift(t,e){return t+(P.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:r,day:s}=t,o=t.hour??12;if(![e,r,s].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const i=P.rule(e);if(!i)return!1;const a=P.rank(r,s,o);return a>=P.rank(i.start.month,i.start.day,2)&&a<P.rank(i.end.month,i.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:P.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:P.sunday(t,3,2)},end:{month:11,day:P.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:P.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:P.sunday(t,4,-1)},end:e}}static sunday(t,e,r){const s=new Date(Date.UTC(2e3,e-1,1));s.setUTCFullYear(t);const o=1+(7-s.getUTCDay())%7;if(r>0)return o+7*(r-1);const i=[31,P.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let a=o;for(;a+7<=i;)a+=7;return a}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,r){return(t*100+e)*100+r}}const On={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},Vn={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},$n={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Fn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Dn={name:"PT",timeshift:n=>P.timeshift(-480,n),title:"Pacific Time (US)"},Pn={name:"MT",timeshift:n=>P.timeshift(-420,n),title:"Mountain Time (US)"},Un={name:"CT",timeshift:n=>P.timeshift(-360,n),title:"Central Time (US)"},Bn={name:"ET",timeshift:n=>P.timeshift(-300,n),title:"Eastern Time (US)"},Ln={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},jn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Cn={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},Kn={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},Hn={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},qn={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},zn={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},Wn={name:"Z",timeshift:"Z",title:"UTC"},Yn={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},Xn={name:"BST",timeshift:"+01",title:"British Summer Time"},Jn={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},Zn={name:"CET",timeshift:"+01",title:"Central European Time"},Qn={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},ts={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},es={name:"BJT",timeshift:"+08",title:"Beijing Time"},rs={name:"CST",timeshift:"-06",title:"Central Standard Time"},ns={name:"JST",timeshift:"+09",title:"Japan Standard Time"},ss={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},os={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},is={name:"LST",timeshift:"?",title:"Local Sideral Time"},nr=[qn,ss,Hn,es,Xn,rs,jn,Zn,Jn,Un,Ln,Kn,Cn,Bn,Yn,ts,ns,is,$n,Qn,Fn,Pn,os,Vn,On,Dn,zn,Wn];class ye{static instance=new ye;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const r=[];t.hour&&r.push(this.renderComponent(t,"hour")),t.minute&&r.push(this.renderComponent(t,"minute")),t.second&&r.push(this.renderSecond(t));const s=e.join("-"),o=t.timeshift?t.timeshift.toString():"",i=r.join(":")+o;return s+(i.length>0?"T"+i:"")}}class vt extends H{constructor(t="method is abstract"){super(t)}}class Be{units;constructor(t){this.units=t}newYear(t){throw new vt}newMonth(t){throw new vt}newDay(t){throw new vt}newHour(t){throw new vt}newMinute(t){throw new vt}newSecond(t){throw new vt}}class as extends Ue{millisecond=new v("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new v("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new v("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new v("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new v("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new v("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new v("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const ue=new as;class be{static instance=new be;render(t){const e=Y.toSpec(t);let r="P";const s=e.years;s&&(r+=s.toString()+"Y");const o=e.months;o&&(r+=o.toString(tt.instance)+"MM");const i=e.days;i&&(r+=i.toString(tt.instance)+"D");const a=e.hours;a&&(r+=a.toString(tt.instance)+"H");const l=e.minutes;l&&(r+=l.toString(tt.instance)+"M");const c=e.seconds;return c&&(r+=c.toString(tt.instance)+"S"),r}}class Y extends B{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*w.year.duration:0)+(t.months?t.months*w.month.duration:0)+(t.days?t.days*w.day.duration:0)+(t.hours?t.hours*w.hour.duration:0)+(t.minutes?t.minutes*w.minute.duration:0)+(t.seconds?t.seconds*w.second.duration:0)},new v("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=cs){let r=typeof t=="number"?t:t.value;const s=r>0?1:-1;r=Math.abs(r);const o={},i=r/w.year.duration,a=Math.floor(i);a>0&&(o.years=e.newYear(s*a),r-=a*w.year.duration);const l=r/w.month.duration,c=Math.floor(l);c>0&&(o.months=e.newMonth(s*c),r-=c*w.month.duration);const m=r/w.day.duration,p=Math.floor(m);p>0&&(o.days=e.newDay(s*p),r-=p*w.day.duration);const f=r/w.hour.duration,y=Math.floor(f);y>0&&(o.hours=e.newHour(s*y),r-=y*w.hour.duration);const S=r/w.minute.duration,E=Math.floor(S);E>0&&(o.minutes=e.newMinute(s*E),r-=E*w.minute.duration);const G=r/w.second.duration,mt=Math.floor(s*G);return mt>0&&(o.seconds=e.newSecond(mt)),o}static fromString(t,e=h.get(Y)){return new Y(e.parse(t))}static between(t,e){const r=e.getTime(),s=t.getTime();return new Y(r-s)}toSpec(){return Y.toSpec(this)}toString(t=be.instance){return t.render(this)}}class un extends Be{constructor(t){super(t)}newYear(t){return new Ot(t,this.units.year)}newMonth(t){return new Vt(t,this.units.month)}newDay(t){return new $t(t,this.units.day)}newHour(t){return new Ft(t,this.units.hour)}newMinute(t){return new Dt(t,this.units.minute)}newSecond(t){return new Pt(t,this.units.second)}newMillisecond(t){return new xt(t,this.units.millisecond)}newTimeshift(t){return new St(typeof t=="number"?t:t.value)}}const us=new un(w),cs=new un(ue);class D{#t;#e;#r;#n;#s;#o;#i;#a;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:D.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof B?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof B?t:this.factory.newMonth(t)}get day(){return this.#r}set day(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newDay(t):!t||t.start||t instanceof B?t:this.factory.newDay(t)}get hour(){return this.#n}set hour(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newHour(t):!t||t.start||t instanceof B?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof B?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof B?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof B)?this.factory.newMillisecond(t):t}get timeshift(){return this.#a}set timeshift(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof St)?this.factory.newTimeshift(t):t}get factory(){return us}static fromString(t,e=h.get(D)){const{year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m}=e.parse(t);return new D({year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new D({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return D.fromString(r)}#u(t){if(this.constructor.name!==t.constructor.name)throw new we(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new Y(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new D(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=ye.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const r=this.month?.toSpec();r&&(t.month=r);const s=this.day?.toSpec();s&&(t.day=s);const o=this.hour?.toSpec();o&&(t.hour=o);const i=this.minute?.toSpec();i&&(t.minute=i);const a=this.second?.toSpec();a&&(t.second=a);const l=this.millisecond?.toSpec();l&&(t.millisecond=l);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class Le{static instance=new Le;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class jt{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=D.fromString(t)),t&&!(t instanceof D)&&!(t instanceof Y))throw new H("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=D.fromString(t)),t&&!(t instanceof D)&&!(t instanceof Y))throw new H("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=h.get(jt)){const{start:r,end:s}=e.parse(t);return new jt(r,s)}toString(t=Le.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class ce extends tt{static instance=new ce(rt.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class et extends B{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=ce.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class cn extends on{year=new v("year",-9999,9999,this.month);yearExtended=new v("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const me=new cn;class ft extends et{constructor(t,e=me.year){super(t,e)}static fromString(t,e=me.year,r=h.get(ft)){const s=r.parse(t),o=s.value.start;if(t.startsWith("Y")&&(e=me.yearExtended),o!==void 0){const i=new ft(Object.assign({...s},{value:Math.max(o,e.min)})),a=new ft(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new ft(s,e)}}class dn extends we{monthValidator=new an;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class gt extends et{constructor(t,e=new v(w.month.name,1,24,w.day,new dn)){super(t,e)}static fromString(t,e=h.get(gt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.month;const i=new gt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new gt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new gt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class wt extends et{constructor(t,e=w.day){super(t,e)}static fromString(t,e=h.get(wt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.day;const i=new wt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new wt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new wt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class yt extends et{constructor(t,e=w.hour){super(t,e)}static fromString(t,e=h.get(yt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.hour;const i=new yt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new yt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new yt(r)}}class bt extends et{constructor(t,e=w.minute){super(t,e)}static fromString(t,e=h.get(bt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.minute,i=new bt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new bt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new bt(r)}toString(t=ce.instance){return super.toString(t)}}class Et extends et{constructor(t,e=w.second){super(t,e)}static fromString(t,e=h.get(Et)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.second,i=new Et(Object.assign({...r},{value:Math.max(s,o.min)})),a=new Et(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new Et(r)}}class Tt extends St{static fromString(t,e=h.get(Tt),r=void 0){return new Tt(e.parse(t,r))}}class ln extends Be{constructor(t){super(t)}newYear(t){return new ft(t,this.units.year)}newMonth(t){return new gt(t,this.units.month)}newDay(t){return new wt(t,this.units.day)}newHour(t){return new yt(t,this.units.hour)}newMinute(t){return new bt(t,this.units.minute)}newSecond(t){return new Et(t,this.units.second)}newMillisecond(t){return new xt(t,this.units.millisecond)}newTimeshift(t){return new Tt(typeof t=="number"?t:t.value)}}const ds=new ln(me),ls=new ln(ue);class C extends D{constructor(t){super(t)}get factory(){return ds}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new C({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static fromString(t,e=h.get(C)){const r=e.parse(t);return new C(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return C.fromString(r)}clone(){return new C(this.toSpec())}}const $=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class Ee extends be{static instance=new Ee;render(t){return super.render(t)}}class R extends et{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:R.getValue(t,$.year)+R.getValue(t,$.month)+R.getValue(t,$.day)+R.getValue(t,$.hour)+R.getValue(t,$.minute)+R.getValue(t,$.second),uncertain:R.getBoolean(t,$.uncertain),approximate:R.getBoolean(t,"approximate")},ue.millisecond)}static getBoolean(t,e){return t[e]||t[$.year+"s"]?.[e]||t[$.month+"s"]?.[e]||t[$.day+"s"]?.[e]||t[$.hour+"s"]?.[e]||t[$.minute+"s"]?.[e]||t[$.second+"s"]?.[e]||!1}static getValue(t,e){let r=0,s=t[e+"s"];if(s instanceof et?s=s.value:typeof t=="number"&&(s=t),s){const o=w[e];r=s*o.duration}return r}static toSpec(t,e=ls){return{...Y.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=h.get(R)){const r=e.parse(t);return new R(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new R(r-s)}toString(t=Ee.instance){return super.toString(t)}toSpec(){return R.toSpec(this)}}class Ct extends jt{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=C.fromString(t)),t&&!(t instanceof C)&&!(t instanceof R))throw new H("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=C.fromString(t)),t&&!(t instanceof C)&&!(t instanceof R))throw new H("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Ct)){const{start:r,end:s}=e.parse(t);return new Ct(r,s)}}class Bt extends et{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class ms extends cn{year=new v("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const De=new ms;class st extends Bt{constructor(t,e=De.year){super(t,e)}static fromString(t,e=De.year,r=h.get(st)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new st(Object.assign({...s},{value:Math.max(o,e.min)})),a=new st(Object.assign({...s},{value:Math.min(s.value.end,e.max)})),l={start:i,end:a},c=s.value.estimate;return c&&(l.estimate=c),l}else return new st(s)}}class ps extends dn{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class ot extends Bt{constructor(t,e=new v(w.month.name,1,41,w.day,new ps)){super(t,e)}static fromString(t,e=h.get(ot)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.month,i=new ot(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ot(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ot(r)}toString(t){return super.toString(t).padStart(2,"0")}}class it extends Bt{constructor(t,e=w.day){super(t,e)}static fromString(t,e=h.get(it)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.day,i=new it(Object.assign({...r},{value:Math.max(s,o.min)})),a=new it(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new it(r)}toString(t){return super.toString(t).padStart(2,"0")}}class at extends Bt{constructor(t,e=w.hour){super(t,e)}static fromString(t,e=h.get(at)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.hour,i=new at(Object.assign({...r},{value:Math.max(s,o.min)})),a=new at(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new at(r)}}class ut extends Bt{constructor(t,e=w.minute){super(t,e)}static fromString(t,e=h.get(ut)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.minute,i=new ut(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ut(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ut(r)}}class ct extends Bt{constructor(t,e=w.second){super(t,e)}static fromString(t,e=w.second,r=h.get(ct)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new ct(Object.assign({...s},{value:Math.max(o,e.min)})),a=new ct(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new ct(s,e)}}class mn extends Tt{}class hs extends ce{qualifier(){return""}}class pt extends ye{static instance=new pt;static valueRenderer=new hs(rt.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const r=t[e],s=pt.names.slice(pt.names.indexOf(e)+1).map(a=>t[a]).filter(Boolean),o=pt.qualifier(r.uncertainComponent,r.approximateComponent),i=pt.qualifier(r.uncertainGroup&&!r.uncertainComponent&&!s.some(a=>a.uncertain),r.approximateGroup&&!r.approximateComponent&&!s.some(a=>a.approximate));return o+r.toString(pt.valueRenderer)+i}}class pn extends Be{constructor(t){super(t)}newYear(t){return new st(t,this.units.year)}newMonth(t){return new ot(t,this.units.month)}newDay(t){return new it(t,this.units.day)}newHour(t){return new at(t,this.units.hour)}newMinute(t){return new ut(t,this.units.minute)}newSecond(t){return new ct(t,this.units.second)}newMillisecond(t){return new xt(t,this.units.millisecond)}newTimeshift(t){return new mn(typeof t=="number"?t:t.value)}}const fs=new pn(De),gs=new pn(ue);class K extends C{constructor(t){super(t)}toString(t=pt.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return fs}static fromDate(t){return new K({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static fromString(t,e=h.get(K)){const r=e.parse(t);return new K(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return K.fromString(r)}clone(){return new K(this.toSpec())}}class dt{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new H(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new vt(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class Gt extends Ee{static instance=new Gt;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=Gt.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let r=e+"P";for(const[s,o]of Gt.designators){const i=t.components[s];i&&(r+=Gt.qualifier(i.uncertainComponent,i.approximateComponent)+i.value+o)}return r}}class k extends R{#t;constructor(t){if(super(typeof t=="number"?t:{value:k.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},ue.millisecond),typeof t!="number"){const e={};for(const r of k.componentNames)t[r]instanceof et&&(e[r]=t[r]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return k.getValue(t,$.year)+k.getValue(t,$.month)+k.getValue(t,$.day)+k.getValue(t,$.hour)+k.getValue(t,$.minute)+k.getValue(t,$.second)}static toSpec(t,e=gs){const r=R.toSpec(t,e);if(t instanceof k&&t.hasQualifiedComponent)for(const s of k.componentNames)delete r[s],t.components[s]&&(r[s]=t.components[s]);return r}static fromString(t,e=h.get(k)){const r=e.parse(t);return new k(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new k(r-s)}toSpec(){return k.toSpec(this)}toString(t=Gt.instance){return super.toString(t)}}class Kt extends Ct{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=K.fromString(t)),t&&!(t instanceof K)&&!(t instanceof k))throw new H("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=K.fromString(t)),t&&!(t instanceof K)&&!(t instanceof k))throw new H("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Kt)){const{start:r,end:s}=e.parse(t);return new Kt(r,s)}}class ge extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const r of this)if(r.toString()===e)return!0;return!1}static fromString(t,e=h.get(ge)){const{exclusive:r,values:s}=e.parse(t);return new ge(s,r)}}class lt extends dt{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return lt.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new H(`${this.name} cannot be negative`);return super.parse(t)}}class u{static groupName(...t){return t.reduce((e,r)=>e?e+r.charAt(0).toUpperCase()+r.substring(1):r,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return u.optional(u.group(t,...e))}static optionalNonCapturingGroup(...t){return u.optional(u.nonCapturingGroup(...t))}static numberGroup(t,e,r,s="\\d"){return u.group(t,`${r||""}[${s}]${e}`)}}const sr="yearValue";class Ht extends lt{static format(t=""){return u.numberGroup(u.groupName(t,sr),"{4}",void 0)}constructor(){super(sr,Ht.format())}}const or="monthValue";class qt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,or),"{1,2}",void 0)}constructor(){super(or,qt.format())}}const ir="dayValue";class kt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ir),"{1,2}",void 0)}constructor(){super(ir,kt.format())}}const ar="hourValue";class Rt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ar),"{1,2}",void 0)}constructor(){super(ar,Rt.format())}}const ur="minuteValue";class zt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ur),"{1,2}",void 0)}constructor(){super(ur,zt.format())}}const cr="secondValue";class Wt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,cr),"{1,2}",void 0)}constructor(){super(cr,Wt.format())}}const dr="timeshiftValue",lr="shiftHour",mr="shiftMinute";class Ut extends dt{static format(t=""){return nr.map(e=>e.name).join("|")+"|"+u.nonCapturingGroup(u.group(t+lr,u.numberGroup(u.groupName(t,dr),"{2}","[+-]")),u.optionalNonCapturingGroup(":?",u.numberGroup(u.groupName(t,mr),"{2}",void 0)))}constructor(){super(dr,Ut.format())}parse(t,e){let r=0;const s=nr.find(o=>o.name===t);if(s){if(typeof s.timeshift=="function")try{return s.timeshift(e??{})}catch(o){throw new H(`The time zone ${t} depends on the date: ${o.message}`)}t=s.timeshift}if(t!=="Z"){const o=this.regexGroups(t),i=o[lr];i&&(r+=parseInt(i,10)*60);const a=o[mr];a&&(r+=parseInt(a,10))}return r}}const pr="year",hr="month",fr="day",gr="hour",wr="minute",yr="second",br="millisecond",Er="timeshift";class Mt extends dt{static format(t=""){return u.group(u.groupName(t,pr),Ht.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,hr),qt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,fr),kt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,gr),Rt.format(t)),":?",u.group(u.groupName(t,wr),zt.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,yr),Wt.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,br),"\\d+"))),"\\s*",u.optionalGroup(u.groupName(t,Er),Ut.format(t)))))}constructor(){super("date",Mt.format())}parse(t){const e=this.regexGroups(t),r=e[pr],s=e[hr],o=e[fr],i=e[gr],a=e[wr],l=e[yr],c=e[br],m=e[Er],p=r?new Ot(Ht.read(r)):void 0,f=s?qt.read(s):void 0;return{year:p,month:f?new Vt(f,_t.create(f.value,p?.value)):void 0,day:o?new $t(kt.read(o)):void 0,hour:i?new Ft(Rt.read(i)):void 0,minute:a?new Dt(zt.read(a)):void 0,second:l?new Pt(Wt.read(l)):void 0,millisecond:c?xt.parseFraction(c):void 0,timeshift:m?St.fromString(m,new Ut,{year:p?.value,month:f?.value,day:o?kt.read(o).value:void 0,hour:i?Rt.read(i).value:void 0}):void 0}}}const Sr="years",Me="months",ws="days",xr="hours",vr="minutes",Mr="seconds";class je extends dt{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Sr),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Me),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,ws),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,xr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,vr),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Mr),"+",void 0,"\\d"),"S")}constructor(){super("duration",je.format())}parseGroups(t){return{years:t[Sr],months:t[Me],days:t[Me],hours:t[xr],minutes:t[vr],seconds:t[Mr]}}}const Ae="start",Te="end";class Ce extends dt{static format=u.group(Ae,Mt.format(Ae))+"/"+u.group(Te,Mt.format(Te));constructor(){super("interval",Ce.format)}parse(t){const e=this.regexGroups(t),r=e[Ae],s=e[Te];return{start:r?D.fromString(r,new Mt):void 0,end:s?D.fromString(s,new Mt):void 0}}}h.register(D,()=>new Mt);h.register($t,()=>new kt);h.register(Y,()=>new je);h.register(Ft,()=>new Rt);h.register(jt,()=>new Ce);h.register(Dt,()=>new zt);h.register(Vt,()=>new qt);h.register(Pt,()=>new Wt);h.register(St,()=>new Ut);h.register(Ot,()=>new Ht);class M extends lt{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=M.uncertainGroup+M.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return u.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(u.groupName(M.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(M.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(M.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,r){return u.numberGroup(t,e,r,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],r;return e.charAt(0)==="-"?(r=-1,e=e.substring(1)):r=1,{valueStr:e,sign:r}}parseGroups(t){const{valueStr:e,sign:r}=this.getValueAndSign(t);let s=0,o;for(o=0;o<e.length;o++){const c=e[o];if(c==="X")break;s=s*10+parseInt(c,10)}if(o<e.length){let c=1;for(let f=0;f<e.length-o;f++)c*=10;const m=r*s*c,p=m+c-1;s={start:m,end:p}}else s*=r;const i=t[u.groupName(M.uncertainAndApproximateGroup,this.name)],a=t[u.groupName(M.approximateGroup,this.name)]||i,l=t[u.groupName(M.uncertainGroup,this.name)]||i;return{value:s,approximate:a?!!a:!1,uncertain:l?!!l:!1}}}const Ar="yearValue";class Yt extends M{constructor(){super(Ar,Yt.format())}static format(t=""){return"Y?"+M.numberFormat(u.groupName(t,Ar),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Tr="monthValue";class Xt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Tr),"{1,2}",void 0)}constructor(){super(Tr,Xt.format())}}const Ir="dayValue";class Jt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Ir),"{1,2}",void 0)}constructor(){super(Ir,Jt.format())}}const Nr="hourValue";class Zt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Nr),"{1,2}",void 0)}constructor(){super(Nr,Zt.format())}}const _r="minuteValue";class Qt extends M{static format(t=""){return M.numberFormat(u.groupName(t,_r),"{1,2}",void 0)}constructor(){super(_r,Qt.format())}}const Gr="secondValue";class te extends M{static format(t=""){return M.numberFormat(u.groupName(t,Gr),"{1,2}",void 0)}constructor(){super(Gr,te.format())}}class ee extends Ut{}class T extends dt{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=T.format()){super("date",t)}static format(t=""){return u.group(u.groupName(t,T.yearGroup),Yt.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,T.monthGroup),Xt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,T.dayGroup),Jt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,T.hourGroup),Zt.format(t)),":",u.group(u.groupName(t,T.minuteGroup),Qt.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,T.secondGroup),te.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,T.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,T.timeshiftGroup),ee.format(t)))))}parseGroups(t){const e=t[T.millisecondGroup],r=e?xt.parseFraction(e):void 0,s=t[T.secondGroup],o=s?Et.fromString(s,new te):void 0,i=t[T.minuteGroup];let a;i&&(a=bt.fromString(i,new Qt),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[T.hourGroup];let c;l&&(c=yt.fromString(l,new Zt),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[T.dayGroup];let p;m&&(p=wt.fromString(m,new Jt),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[T.monthGroup];let y;f&&(y=gt.fromString(f,new Xt),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[T.yearGroup];let E;S&&(E=ft.fromString(S,void 0,new Yt),E.uncertain=E.uncertain||y?.uncertain||!1,E.approximate=E.approximate||y?.approximate||!1);const G=t[T.timeshiftGroup],mt=G?Tt.fromString(G,new ee,{year:E?.value,month:y?.value,day:p?.value,hour:c?.value}):void 0;return{year:E,month:y,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:mt}}}const kr="years",Rr="months",Or="days",Vr="hours",$r="minutes",Fr="seconds";class At extends M{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,kr),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Rr),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Or),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Vr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,$r),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Fr),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",At.format())}parseGroups(t){return{years:t[kr],months:t[Rr],days:t[Or],hours:t[Vr],minutes:t[$r],seconds:t[Fr],uncertain:!!t[M.uncertainGroup],approximate:!!t[M.approximateGroup]}}}const ys="dates",Ie="start",Ne="end",Dr="durations",_e="durationMin",Ge="durationMax";class Ke extends dt{static format=u.group(ys,u.optionalGroup(Ie,u.group("openStart","\\.\\.")+"|"+T.format(Ie))+"/"+u.optionalGroup(Ne,u.group("openEnd","\\.\\.")+"|"+T.format(Ne)))+"|"+u.group(Dr,u.group(_e,At.format(_e))+"/"+u.group(Ge,At.format(Ge)));constructor(t="interval",e=Ke.format){super(t,e)}parseGroups(t){let e,r;if(t[Dr]){const o=t[_e];e=R.fromString(o,new At);const i=t[Ge];r=R.fromString(i,new At)}else{const o=t[Ie];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=C.fromString(o,new T)}const i=t[Ne];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=C.fromString(i,new T)}}return{start:e,end:r}}}h.register(C,()=>new T);h.register(wt,()=>new Jt);h.register(R,()=>new At);h.register(yt,()=>new Zt);h.register(Ct,()=>new Ke);h.register(bt,()=>new Qt);h.register(gt,()=>new Xt);h.register(Et,()=>new te);h.register(Tt,()=>new ee);h.register(ft,()=>new Yt);class b extends M{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=b.uncertainGroup+b.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,r){return this.qualifierFormat(u.groupName(b.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(b.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(b.uncertainAndApproximateGroup,t),"%")+M.numberFormat(t,e,r)}parseGroups(t){const e=super.parseGroups(t),r=t[u.groupName(b.uncertainAndApproximateGroup,this.name)];return(t[u.groupName(b.uncertainGroup,this.name)]||r)&&(e.uncertainComponent=!0),(t[u.groupName(b.approximateGroup,this.name)]||r)&&(e.approximateComponent=!0),e}}const Lt="yearValue",Pr="exp",Ur="signif";class re extends b{constructor(){super(Lt,re.format())}static format(t=""){return"Y?"+u.nonCapturingGroup(u.group(u.groupName(t,Pr),"[-]?\\d+E\\d+")+"|"+b.numberFormat(u.groupName(t,Lt),"+","[-]?")+u.optionalGroup(u.groupName(t,Ur),"S\\d+"))}parseGroups(t){const e=t[Pr];if(e){const i=e.indexOf("E"),a=parseInt(e.substring(i+1),10),c=parseInt(e.substring(0,i),10)*Math.pow(10,a);t[Lt]=c.toString()}const r=t[Ur],s=t[Lt];if(r){const i=parseInt(r.substring(1),10),{valueStr:a,sign:l}=this.getValueAndSign(t);let c="";for(let m=0;m<a.length;m++)c+=m<i?a.charAt(m):"X";t[Lt]=(l<0?"-":"")+c}const o=super.parseGroups(t);return r&&(o.value.estimate=parseInt(s,10)),o}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Br="monthValue";class ne extends b{static format(t=""){return b.numberFormat(u.groupName(t,Br),"{1,2}",void 0)}constructor(){super(Br,ne.format())}}const Lr="dayValue";class se extends b{static format(t=""){return b.numberFormat(u.groupName(t,Lr),"{1,2}",void 0)}constructor(){super(Lr,se.format())}}const jr="hourValue";class oe extends b{static format(t=""){return b.numberFormat(u.groupName(t,jr),"{1,2}",void 0)}constructor(){super(jr,oe.format())}}const Cr="secondValue";class ie extends b{static format(t=""){return b.numberFormat(u.groupName(t,Cr),"{1,2}",void 0)}constructor(){super(Cr,ie.format())}}const Kr="minuteValue";class ae extends b{static format(t=""){return b.numberFormat(u.groupName(t,Kr),"{1,2}",void 0)}constructor(){super(Kr,ae.format())}}class bs extends ee{}class x extends dt{static yearGroup=T.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",x.format())}static format(t=""){return u.group(u.groupName(t,x.yearGroup),re.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,x.monthGroup),ne.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,x.dayGroup),se.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,x.hourGroup),oe.format(t)),":",u.group(u.groupName(t,x.minuteGroup),ae.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,x.secondGroup),ie.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,x.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,x.timeshiftGroup),bs.format(t)))))}parseGroups(t){const e=t[x.millisecondGroup],r=e?xt.parseFraction(e):void 0,s=t[x.secondGroup];let o;s&&(o=ct.fromString(s,void 0,new ie),o.uncertain=o?.uncertain||!1,o.approximate=o?.approximate||!1);const i=t[x.minuteGroup];let a;i&&(a=ut.fromString(i,new ae),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[x.hourGroup];let c;l&&(c=at.fromString(l,new oe),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[x.dayGroup];let p;m&&(p=it.fromString(m,new se),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[x.monthGroup];let y;f&&(y=ot.fromString(f,new ne),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[x.yearGroup];let E;S&&(E=st.fromString(S,void 0,new re),E.uncertain=E.uncertain||y?.uncertain||!1,E.approximate=E.approximate||y?.approximate||!1);const G=t[x.timeshiftGroup],mt=G?mn.fromString(G,new ee,{year:E?.value,month:y?.value,day:p?.value,hour:c?.value}):void 0;return{year:E,month:y,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:mt}}}const Hr="durationValue";class He extends b{static format(t=""){return"^"+b.numberFormat(u.groupName(t,Hr),"+",void 0)}constructor(){super(Hr,He.format())}}class Es extends Ue{millisecond=new v("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new v("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new v("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new v("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new v("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new v("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new v("year",0,Number.MAX_SAFE_INTEGER,this.month)}const Nt=new Es;class g extends b{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new He;static componentFormat(t,e,r,s,o=""){const i=u.group(u.groupName(t,g.quantityGroup(e)),b.numberFormat(u.groupName(t,r),"+",void 0,"\\d"));return u.group(u.groupName(t,e),i,s,o)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",g.format())}static format(t=""){const e=u.groupName(t,g.durationGroup);return this.qualifierFormat(u.groupName(b.uncertainGroup,e),"?")+this.qualifierFormat(u.groupName(b.approximateGroup,e),"~")+this.qualifierFormat(u.groupName(b.uncertainAndApproximateGroup,e),"%")+"P"+u.optional(g.componentFormat(t,g.yearsGroup,x.yearGroup,"Y"))+u.optionalNonCapturingGroup(g.componentFormat(t,g.monthsGroup,x.monthGroup,"MM")+"|"+g.componentFormat(t,g.isoMonthsGroup,"isoMonth","M",g.isoMonthsLookahead))+u.optional(g.componentFormat(t,g.daysGroup,x.dayGroup,"D"))+"T?"+u.optional(g.componentFormat(t,g.hoursGroup,x.hourGroup,"H"))+u.optional(g.componentFormat(t,g.minutesGroup,x.minuteGroup,"M"))+u.optional(g.componentFormat(t,g.secondsGroup,x.secondGroup,"S"))+u.optionalGroup(u.groupName(t,g.suffixGroup),"[?~%]")}static parseComponent(t,e,r){const s=g.componentParser.parse(t);return new e(s,r)}parseGroups(t){const e=t[g.quantityGroup(g.secondsGroup)];let r;e&&(r=g.parseComponent(e,ct,Nt.second),r.uncertain=!!t[u.groupName(b.uncertainGroup,g.secondsGroup)]||!1,r.approximate=!!t[u.groupName(b.approximateGroup,g.secondsGroup)]||!1);const s=t[g.quantityGroup(g.minutesGroup)];let o;s&&(o=g.parseComponent(s,ut,Nt.minute),o.uncertain=o.uncertain||r?.uncertain||!1,o.approximate=o.approximate||r?.approximate||!1);const i=t[g.quantityGroup(g.hoursGroup)];let a;i&&(a=g.parseComponent(i,at,Nt.hour),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[g.quantityGroup(g.daysGroup)];let c;l&&(c=g.parseComponent(l,it,Nt.day),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[g.quantityGroup(g.monthsGroup)]||t[g.quantityGroup(g.isoMonthsGroup)];let p;m&&(p=g.parseComponent(m,ot,Nt.month),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[g.quantityGroup(g.yearsGroup)];let y;f&&(y=g.parseComponent(f,st,Nt.year),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[g.suffixGroup],E=!!t[u.groupName(b.uncertainAndApproximateGroup,g.durationGroup)]||S==="%",G=E||!!t[u.groupName(b.uncertainGroup,g.durationGroup)]||S==="?",mt=E||!!t[u.groupName(b.approximateGroup,g.durationGroup)]||S==="~";return{years:y,months:p,days:c,hours:a,minutes:o,seconds:r,uncertain:G,approximate:mt}}}const Ss="dates",ke="start",Re="end",qr="durations",Oe="durationMin",Ve="durationMax";class Se extends dt{static format=u.group(Ss,u.optionalGroup(ke,u.group("openStart","\\.\\.")+"|"+x.format(ke))+"/"+u.optionalGroup(Re,u.group("openEnd","\\.\\.")+"|"+x.format(Re)))+"|"+u.group(qr,u.group(Oe,g.format(Oe))+"/"+u.group(Ve,g.format(Ve)));constructor(t="interval",e=Se.format){super(t,e)}parseGroups(t){let e,r;if(t[qr]){const o=t[Oe];e=k.fromString(o,new g);const i=t[Ve];r=k.fromString(i,new g)}else{const o=t[ke];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=K.fromString(o,new x)}const i=t[Re];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=K.fromString(i,new x)}}return{start:e,end:r}}}class xs{parse(t){t=t.trim();const e=t.startsWith("["),s=t.substring(1,t.length-1).split(","),o=[];for(const i of s){let a;i.includes("..")?a=Kt.fromString(i.replace("..","/"),new Se):a=K.fromString(i,new x),o.push(a)}return{values:o,exclusive:e}}}h.register(K,()=>new x);h.register(it,()=>new se);h.register(k,()=>new g);h.register(at,()=>new oe);h.register(Kt,()=>new Se);h.register(ut,()=>new ae);h.register(ot,()=>new ne);h.register(ct,()=>new ie);h.register(ge,()=>new xs);h.register(st,()=>new re);class W{constructor(t){this.preferences=t}read(t){var e,r;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const o of this.preferences){const i=(e=t[o])!==null&&e!==void 0?e:t[W.base(o)];if(i)return i}const s=new Set(this.preferences.map(o=>W.base(o)));for(const[o,i]of Object.entries(t))if(i&&s.has(W.base(o)))return i;return(r=Object.values(t).find(o=>o))!==null&&r!==void 0?r:void 0}write(t,e,r){var s,o;const i=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return i;const a={...t},l=(o=(s=Object.keys(a).find(c=>c===r))!==null&&s!==void 0?s:Object.keys(a).find(c=>W.base(c)===W.base(r)))!==null&&o!==void 0?o:r;return i===void 0?delete a[l]:a[l]=i,Object.keys(a).length===0?void 0:a}static base(t){return t.toLowerCase().split("-")[0]}}W.any=new W([]);var zr;(function(n){n.abductee="abductee",n.actor="actor",n.artist="artist",n.anthropologist="anthropologist",n.archeologist="archeologist",n.astronaut="astronaut",n.astronomer="astronomer",n.astrologist="astrologist",n.astrophysicist="astrophysicist",n.banker="banker",n.barman="barman",n.biologist="biologist",n.biochemist="biochemist",n.biophysicist="biophysicist",n.bishop="bishop",n.businessman="businessman",n.botanist="botanist",n.cameraman="cameraman",n.chemist="chemist",n.contactee="contactee",n.cryptozoologist="cryptozoologist",n.dentist="dentist",n.director="director",n.diplomat="diplomat",n.diver="diver",n.electronics="electronics",n.engineer="engineer",n.ethnologist="ethnologist",n.exobiologist="exobiologist",n.farmer="farmer",n.firefighter="firefighter",n.flightAttendant="flightAttendant",n.geologist="geologist",n.geophysicist="geophysicist",n.geographer="geographer",n.historian="historian",n.houseWife="houseWife",n.hypnotherapist="hypnotherapist",n.illusionist="illusionist",n.journalist="journalist",n.judge="judge",n.lawyer="lawyer",n.leader="leader",n.librarian="librarian",n.logger="logger",n.mathematician="mathematician",n.mechanic="mechanic",n.meteorologist="meteorologist",n.military="military",n.musician="musician",n.neurologist="neurologist",n.neuroscientist="neuroscientist",n.neuropsychiatrist="neuropsychiatrist",n.nurse="nurse",n.oceanographer="oceanographer",n.painter="painter",n.parapsychologist="parapsychologist",n.philosopher="philosopher",n.photographer="photographer",n.physician="physician",n.physicist="physicist",n.pilot="pilot",n.politician="politician",n.policeman="policeman",n.priest="priest",n.producer="producer",n.prospector="prospector",n.psychologist="psychologist",n.psychiatrist="psychiatrist",n.radioastronomer="radioastronomer",n.radioamateur="radioamateur",n.salesman="salesman",n.sailor="sailor",n.sociologist="sociologist",n.softwareEngineer="softwareEngineer",n.stuntman="stuntman",n.taxiDriver="taxiDriver",n.teacher="teacher",n.telegrapher="telegrapher",n.truckDriver="truckDriver",n.ufologist="ufologist",n.ufoWitness="ufoWitness",n.ufoWitness2="ufoWitness2",n.worker="worker",n.writer="writer"})(zr||(zr={}));var Wr;(function(n){n.neutral="neutral",n.male="male",n.female="female"})(Wr||(Wr={}));class vs extends Error{constructor(t,e){super(t),this.cause=e}}class qe extends vs{constructor(t=qe.defaultMessage,e){super(t,e)}}qe.defaultMessage="Assertion failed";var Yr;(function(n){n.country="country",n.region="region",n.department="department",n.city="city",n.company="company"})(Yr||(Yr={}));var Xr;(function(n){n.at="at",n.au="au",n.ar="ar",n.be="be",n.br="br",n.ca="ca",n.ch="ch",n.cn="cn",n.cl="cl",n.co="co",n.cy="cy",n.de="de",n.dk="dk",n.do="do",n.dz="dz",n.gr="gr",n.ec="ec",n.eg="eg",n.es="es",n.fi="fi",n.fr="fr",n.ga="ga",n.ge="ge",n.hu="hu",n.in="in",n.ie="ie",n.ir="ir",n.il="il",n.it="it",n.jp="jp",n.kr="kr",n.ma="ma",n.mx="mx",n.my="my",n.mz="mz",n.nl="nl",n.no="no",n.nz="nz",n.pa="pa",n.pe="pe",n.ph="ph",n.pl="pl",n.pt="pt",n.ro="ro",n.ru="ru",n.sc="sc",n.tr="tr",n.ua="ua",n.uk="uk",n.us="us",n.sa="sa",n.se="se",n.su="su",n.tn="tn",n.tw="tw",n.ve="ve",n.za="za"})(Xr||(Xr={}));class I{static KEY="rr0-module-consent";static originOf(t){try{return new URL(t,typeof location>"u"?void 0:location.href).origin}catch{return t}}static granted(t,e=I.storage()){const r=I.originOf(t);return typeof location<"u"&&r===location.origin?!0:I.list(e).includes(r)}static list(t=I.storage()){try{const e=JSON.parse(t?.getItem(I.KEY)??"[]");return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}catch{return[]}}static grant(t,e=I.storage()){const r=[...new Set([...I.list(e),...t.map(s=>I.originOf(s))])];try{e?.setItem(I.KEY,JSON.stringify(r))}catch{}}static revoke(t,e=I.storage()){const r=I.originOf(t);try{e?.setItem(I.KEY,JSON.stringify(I.list(e).filter(s=>s!==r)))}catch{}}static revokeUnused(t,e,r=I.storage()){const s=new Set(e.map(o=>I.originOf(o)));for(const o of t)s.has(I.originOf(o))||I.revoke(o,r)}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}const Ms=`
|
|
117
|
+
`}static show(t,e,r="info"){t.textContent=e??"",t.hidden=!e,t.classList.toggle(q.INFO,r==="info"),t.classList.toggle(q.WARNING,r==="warning"),t.classList.toggle(q.ERROR,r==="error")}}class J{static given=new Map;static add(t,e){const r=decodeURIComponent(e.replace(/[?#].*$/,"").replace(/^.*\//,"")).replace(/\.json$/i,"")||"interview",s=t.name.replace(/[\\/:*?"<>|#%]+/g,"_").trim()||"file";let o=`${r}-files/${s}`;for(let i=2;J.given.has(new URL(encodeURI(o),e).href);i++)o=`${r}-files/${s.replace(/(\.[^.]*)?$/,`-${i}$1`)}`;return J.given.set(new URL(encodeURI(o),e).href,{blob:t}),{src:o,name:t.name,...t.type?{type:t.type}:{}}}static shown(t,e){const r=J.url(t,e),s=J.given.get(r);return s?(s.shown??=URL.createObjectURL(s.blob),s.shown):r}static fileName(t){return t.name??(decodeURIComponent(t.src.replace(/[?#].*$/,"").replace(/\/+$/,"").replace(/^.*\//,""))||t.src)}static isImage(t){return(t.type??"").startsWith("image/")||/\.(png|jpe?g|gif|webp|avif|svg)$/i.test(J.fileName(t))}static url(t,e){try{return new URL(/^[a-z][a-z0-9+.-]*:/i.test(t.src)?t.src:encodeURI(t.src),e??(typeof location>"u"?void 0:location.href)).href}catch{return t.src}}static blob(t){return J.given.get(t)?.blob}static clear(){for(const{shown:t}of J.given.values())t&&URL.revokeObjectURL(t);J.given.clear()}}class O{static withImages(t,e){const r=s=>s?.forEach(o=>{o.src=e(o.src)});for(const s of t.sections){r(s.images);for(const o of s.fields)r(o.images)}return t}static added=new Map;static ids(){return[...O.added.keys()]}static add(t){O.added.set(t.id,t)}static fetched=new Map;static async load(t){const e=O.added.get(t);if(e||!/[/:]|\.json$/i.test(t))return e;let r=O.fetched.get(t);return r||(r=fetch(t).then(s=>s.ok?s.json():void 0).then(s=>{if(!(!s||typeof s.id!="string"||!Array.isArray(s.sections)))return O.add(O.withImages(s,o=>new URL(o,t).href)),s}).catch(()=>{}),O.fetched.set(t,r)),r}static fields(t){return t.sections.flatMap(e=>e.fields)}static field(t,e){return O.fields(t).find(r=>r.id===e)}static text(t,e){if(t===void 0)return"";if(typeof t=="string")return t;const r=t;return(e&&r[e])??Object.values(r)[0]??""}static interview(t,e={},r){const s=e.witnesses?.length===1?e.witnesses[0]:void 0;return{version:1,...t.language?{language:t.language}:{},title:t.title,medium:"questionnaire",questionnaire:{id:t.id,...t.version?{version:t.version}:{},...r?{recipient:r}:{}},...s?{interviewOf:s.id}:{},speakers:{interviewer:{role:"interviewer",...e.by?.[0]!==void 0?{by:{people:e.by[0]}}:{}},witness:{role:"witness",...s?{title:s.label,of:s.id}:{}}},transcription:{method:"manual"},proofreading:{interviewer:{status:"pending"},witness:{status:"pending"}},segments:O.fields(t).map(o=>({speaker:"interviewer",field:o.id,text:O.text(o.question,t.language)}))}}static answerOf(t,e){return O.answerTurn(t,e)?.text}static filesOf(t,e){return O.answerTurn(t,e)?.files??[]}static answerTurn(t,e){return t.segments.find(r=>r.field===e&&t.speakers[r.speaker]?.role==="witness")}static fileName(t){return J.fileName(t)}static answerFiles(t,e,r,s){O.answer(t,e,r.map(o=>O.fileName(o)).join("; "),s,void 0,r)}static answer(t,e,r,s,o,i){const a=Object.entries(t.speakers).find(([,f])=>f.role==="witness")?.[0]??"witness";t.speakers[a]||(t.speakers[a]={role:"witness"});const l=t.segments.findIndex(f=>f.field===e&&t.speakers[f.speaker]?.role==="witness"),c=r.trim(),m=f=>{const{text:y,redacted:S,files:E,...G}=f;return o?{...G,redacted:o}:{...G,text:c,...i?.length?{files:i}:{}}};if(l>=0){c===""?t.segments.splice(l,1):t.segments[l]=m(t.segments[l]);return}if(c==="")return;let p=t.segments.findIndex(f=>f.field===e&&t.speakers[f.speaker]?.role!=="witness");if(p<0){const f=Object.entries(t.speakers).find(([,y])=>y.role==="interviewer")?.[0]??"interviewer";t.speakers[f]||(t.speakers[f]={role:"interviewer"}),t.segments.push({speaker:f,field:e,text:s??e}),p=t.segments.length-1}t.segments.splice(p+1,0,m({speaker:a,field:e}))}}const no=Object.freeze(Object.defineProperty({__proto__:null,QuestionnaireTemplates:O},Symbol.toStringTag,{value:"Module"}));class L{static FORMAT=1;static read=new Map;static async install(t){for(const r of t.questionnaires??[])O.add(r);const e=t.starts.flatMap(r=>r.questionnaires??[]).filter(r=>L.isAddress(r));await Promise.all([...new Set(e)].map(r=>O.load(r)))}static load(t,e=fetch.bind(globalThis)){const r=new URL(t,typeof location>"u"?void 0:location.href).href;let s=L.read.get(r);return s||(s=(async()=>{const o=await e(r);if(!o.ok)throw new Error(`${r}: HTTP ${o.status}`);return L.check(await o.json(),r,"page")})(),s.catch(()=>L.read.delete(r)),L.read.set(r,s)),s}static check(t,e,r="page",s){const o=t;if(o===null||typeof o!="object"||!Array.isArray(o.starts))throw new Error(`${e}: not a UFO@home case template`);if(typeof o.format=="number"&&o.format>L.FORMAT)throw new Error(`${e}: format ${o.format} is newer than ${L.FORMAT}`);const i=m=>new URL(m,e).href,a=L.recipientOf(o.recipient,e),l=o.starts.filter(m=>typeof m?.id=="string").map(m=>({...m,...a?{recipient:a}:{},...m.questionnaires?{questionnaires:m.questionnaires.filter(p=>typeof p=="string").map(p=>L.isAddress(p)?i(p):p)}:{},...m.modules?{modules:m.modules.filter(p=>typeof p=="string").map(i)}:{}}));if(l.length===0)throw new Error(`${e}: a case template offers no start`);const c=Array.isArray(o.questionnaires)?o.questionnaires.filter(m=>typeof m?.id=="string"&&Array.isArray(m.sections)).map(m=>O.withImages(structuredClone(m),p=>/^[a-z][a-z0-9+.-]*:/i.test(p)?p:i(p))):void 0;return{format:1,id:typeof o.id=="string"?o.id:e,title:o.title??o.id??e,...o.modules?{modules:o.modules.filter(m=>typeof m=="string").map(i)}:{},...a?{recipient:a}:{},...c?.length?{questionnaires:c}:{},starts:l,url:e,origin:r,...s?{fileName:s}:{}}}static recipientOf(t,e){if(t===void 0)return;const r=t?.publicKey;if(typeof t.id!="string"||!r||r.kty!=="RSA"||typeof r.n!="string")throw new Error(`${e}: its recipient has no RSA public key`);if(r.d!==void 0)throw new Error(`${e}: its recipient gives a private key, which must never be published`);const{kty:s,n:o,e:i,alg:a}=r;return{id:t.id,name:t.name??t.id,publicKey:{kty:s,n:o,e:i,...a?{alg:a}:{}},...typeof t.email=="string"&&/^[^@\s]+@[^@\s]+$/.test(t.email)?{email:t.email}:{}}}static isAddress(t){return/[/:]|\.json$/i.test(t)}static step(t){return t.start??(t.questionnaires?.length?"questionnaire":"observation")}}class U{static KEY="rr0-case-template";static read(t=U.storage()){try{const e=U.record(t);return e?U.parse(e.text,e.name,e.url):void 0}catch{return}}static parse(t,e,r){const s=r??(typeof location>"u"?"https://localhost/":location.href);return L.check(JSON.parse(t),s,r?"address":"file",e)}static keep(t,e,r=U.storage(),s){const o=U.parse(t,e,s);if(!r)throw new Error("No storage in this browser");return r.setItem(U.KEY,JSON.stringify({name:e,text:t,...s?{url:s}:{}})),o}static forget(t=U.storage()){try{t?.removeItem(U.KEY)}catch{}}static record(t){const e=t?.getItem(U.KEY);return e?JSON.parse(e):void 0}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}class H extends Error{}class we{constructor(t){this.name=t}validate(t){return!0}}class sn extends we{min;max;constructor(t,e,r){super(t),this.min=e,this.max=r}validate(t){if(typeof t!="number")throw new H(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new H(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class x{name;min;max;duration;subUnit;validator;constructor(t,e,r,s,o=new sn(t,e,r)){this.name=t,this.min=e,this.max=r,this.subUnit=s,this.duration=s?(s.max-s.min+1)*s.duration:1,this.validator=o}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class Ue{millisecond;second;minute;hour;day;month;year}class Gn extends Ue{}class on extends Gn{millisecond=new x("millisecond",0,999,void 0);second=new x("second",0,59,this.millisecond);minute=new x("minute",0,59,this.second);hour=new x("hour",0,23,this.minute);day=new x("day",1,31,this.hour);month=new x("month",1,12,this.day);year=new x("year",0,9999,this.month)}const w=new on;class an extends sn{constructor(t=1,e=12){super("month",t,e)}}class Nt extends x{static Month28=new Nt(28);static Month29=new Nt(29);static ThirtyDays=new Nt(30);static ThirtyOneDays=new Nt(31);constructor(t,e=new an(1,t)){super("month",1,t,w.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new H("Unsupported month",t,e)}}}class tt{static instance=new tt;render(t){return t.value.toString()}}class B{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new we(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=tt.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class h{static#t=new Map;static register(t,e){h.#t.set(t,e)}static get(t){const e=h.#t.get(t);if(!e)throw new H(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Ot extends B{constructor(t=new Date().getFullYear(),e=w.year){super(t,e)}static fromString(t,e=h.get(Ot)){return new Ot(e.parse(t))}}class rt extends tt{static default=new rt("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class Vt extends B{constructor(t=new Date().getMonth()+1,e=w.month){super(t,e)}static fromString(t,e=h.get(Vt)){return new Vt(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class $t extends B{constructor(t=new Date().getDate(),e=w.day){super(t,e)}static fromString(t,e=h.get($t)){const r=e.parse(t);return new $t(r)}toString(t=rt.default){return super.toString(t)}}class Ft extends B{constructor(t=new Date().getHours(),e=w.hour){super(t,e)}static fromString(t,e=h.get(Ft)){return new Ft(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class Dt extends B{constructor(t=new Date().getMinutes(),e=w.minute){super(t,e)}static fromString(t,e=h.get(Dt)){return new Dt(e.parse(t))}toString(t=rt.default){return super.toString(t)}}class Pt extends B{constructor(t=new Date().getSeconds(),e=w.second){super(t,e)}static fromString(t,e=h.get(Pt)){return new Pt(e.parse(t),w.second)}toString(t=rt.default){return super.toString(t)}}class vt extends B{static renderer=new rt("0",3);constructor(t,e=w.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=vt.renderer){return super.toString(t)}}class kn{render(t){return t.toString()}}class Rn extends kn{render(t){const e=t.value,r=Math.abs(e),s=Math.floor(r/60),o=r%60;if(s===0&&o===0)return"Z";{const i=e<0?"-":"+",a=s.toString().padStart(2,"0"),l=o>0?":"+o.toString().padEnd(2,"0"):"";return i+a+l}}}class St{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=h.get(St),r=void 0){const s=e.parse(t,r);return new St(s)}toString(t=new Rn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class P{static timeshift(t,e){return t+(P.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:r,day:s}=t,o=t.hour??12;if(![e,r,s].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const i=P.rule(e);if(!i)return!1;const a=P.rank(r,s,o);return a>=P.rank(i.start.month,i.start.day,2)&&a<P.rank(i.end.month,i.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:P.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:P.sunday(t,3,2)},end:{month:11,day:P.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:P.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:P.sunday(t,4,-1)},end:e}}static sunday(t,e,r){const s=new Date(Date.UTC(2e3,e-1,1));s.setUTCFullYear(t);const o=1+(7-s.getUTCDay())%7;if(r>0)return o+7*(r-1);const i=[31,P.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let a=o;for(;a+7<=i;)a+=7;return a}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,r){return(t*100+e)*100+r}}const On={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},Vn={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},$n={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Fn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Dn={name:"PT",timeshift:n=>P.timeshift(-480,n),title:"Pacific Time (US)"},Pn={name:"MT",timeshift:n=>P.timeshift(-420,n),title:"Mountain Time (US)"},Un={name:"CT",timeshift:n=>P.timeshift(-360,n),title:"Central Time (US)"},Bn={name:"ET",timeshift:n=>P.timeshift(-300,n),title:"Eastern Time (US)"},Ln={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},jn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Cn={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},Kn={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},Hn={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},qn={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},zn={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},Wn={name:"Z",timeshift:"Z",title:"UTC"},Yn={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},Xn={name:"BST",timeshift:"+01",title:"British Summer Time"},Jn={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},Zn={name:"CET",timeshift:"+01",title:"Central European Time"},Qn={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},ts={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},es={name:"BJT",timeshift:"+08",title:"Beijing Time"},rs={name:"CST",timeshift:"-06",title:"Central Standard Time"},ns={name:"JST",timeshift:"+09",title:"Japan Standard Time"},ss={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},os={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},is={name:"LST",timeshift:"?",title:"Local Sideral Time"},nr=[qn,ss,Hn,es,Xn,rs,jn,Zn,Jn,Un,Ln,Kn,Cn,Bn,Yn,ts,ns,is,$n,Qn,Fn,Pn,os,Vn,On,Dn,zn,Wn];class ye{static instance=new ye;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const r=[];t.hour&&r.push(this.renderComponent(t,"hour")),t.minute&&r.push(this.renderComponent(t,"minute")),t.second&&r.push(this.renderSecond(t));const s=e.join("-"),o=t.timeshift?t.timeshift.toString():"",i=r.join(":")+o;return s+(i.length>0?"T"+i:"")}}class Mt extends H{constructor(t="method is abstract"){super(t)}}class Be{units;constructor(t){this.units=t}newYear(t){throw new Mt}newMonth(t){throw new Mt}newDay(t){throw new Mt}newHour(t){throw new Mt}newMinute(t){throw new Mt}newSecond(t){throw new Mt}}class as extends Ue{millisecond=new x("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new x("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new x("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new x("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new x("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new x("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new x("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const ce=new as;class be{static instance=new be;render(t){const e=Y.toSpec(t);let r="P";const s=e.years;s&&(r+=s.toString()+"Y");const o=e.months;o&&(r+=o.toString(tt.instance)+"MM");const i=e.days;i&&(r+=i.toString(tt.instance)+"D");const a=e.hours;a&&(r+=a.toString(tt.instance)+"H");const l=e.minutes;l&&(r+=l.toString(tt.instance)+"M");const c=e.seconds;return c&&(r+=c.toString(tt.instance)+"S"),r}}class Y extends B{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*w.year.duration:0)+(t.months?t.months*w.month.duration:0)+(t.days?t.days*w.day.duration:0)+(t.hours?t.hours*w.hour.duration:0)+(t.minutes?t.minutes*w.minute.duration:0)+(t.seconds?t.seconds*w.second.duration:0)},new x("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=cs){let r=typeof t=="number"?t:t.value;const s=r>0?1:-1;r=Math.abs(r);const o={},i=r/w.year.duration,a=Math.floor(i);a>0&&(o.years=e.newYear(s*a),r-=a*w.year.duration);const l=r/w.month.duration,c=Math.floor(l);c>0&&(o.months=e.newMonth(s*c),r-=c*w.month.duration);const m=r/w.day.duration,p=Math.floor(m);p>0&&(o.days=e.newDay(s*p),r-=p*w.day.duration);const f=r/w.hour.duration,y=Math.floor(f);y>0&&(o.hours=e.newHour(s*y),r-=y*w.hour.duration);const S=r/w.minute.duration,E=Math.floor(S);E>0&&(o.minutes=e.newMinute(s*E),r-=E*w.minute.duration);const G=r/w.second.duration,mt=Math.floor(s*G);return mt>0&&(o.seconds=e.newSecond(mt)),o}static fromString(t,e=h.get(Y)){return new Y(e.parse(t))}static between(t,e){const r=e.getTime(),s=t.getTime();return new Y(r-s)}toSpec(){return Y.toSpec(this)}toString(t=be.instance){return t.render(this)}}class un extends Be{constructor(t){super(t)}newYear(t){return new Ot(t,this.units.year)}newMonth(t){return new Vt(t,this.units.month)}newDay(t){return new $t(t,this.units.day)}newHour(t){return new Ft(t,this.units.hour)}newMinute(t){return new Dt(t,this.units.minute)}newSecond(t){return new Pt(t,this.units.second)}newMillisecond(t){return new vt(t,this.units.millisecond)}newTimeshift(t){return new St(typeof t=="number"?t:t.value)}}const us=new un(w),cs=new un(ce);class D{#t;#e;#r;#n;#s;#o;#i;#a;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:D.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof B?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof B?t:this.factory.newMonth(t)}get day(){return this.#r}set day(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newDay(t):!t||t.start||t instanceof B?t:this.factory.newDay(t)}get hour(){return this.#n}set hour(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newHour(t):!t||t.start||t instanceof B?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof B?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof B?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof B)?this.factory.newMillisecond(t):t}get timeshift(){return this.#a}set timeshift(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof St)?this.factory.newTimeshift(t):t}get factory(){return us}static fromString(t,e=h.get(D)){const{year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m}=e.parse(t);return new D({year:r,month:s,day:o,hour:i,minute:a,second:l,millisecond:c,timeshift:m})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new D({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return D.fromString(r)}#u(t){if(this.constructor.name!==t.constructor.name)throw new we(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new Y(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new D(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=ye.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const r=this.month?.toSpec();r&&(t.month=r);const s=this.day?.toSpec();s&&(t.day=s);const o=this.hour?.toSpec();o&&(t.hour=o);const i=this.minute?.toSpec();i&&(t.minute=i);const a=this.second?.toSpec();a&&(t.second=a);const l=this.millisecond?.toSpec();l&&(t.millisecond=l);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class Le{static instance=new Le;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class Ct{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=D.fromString(t)),t&&!(t instanceof D)&&!(t instanceof Y))throw new H("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=D.fromString(t)),t&&!(t instanceof D)&&!(t instanceof Y))throw new H("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Ct)){const{start:r,end:s}=e.parse(t);return new Ct(r,s)}toString(t=Le.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class de extends tt{static instance=new de(rt.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class et extends B{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=de.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class cn extends on{year=new x("year",-9999,9999,this.month);yearExtended=new x("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const pe=new cn;class ft extends et{constructor(t,e=pe.year){super(t,e)}static fromString(t,e=pe.year,r=h.get(ft)){const s=r.parse(t),o=s.value.start;if(t.startsWith("Y")&&(e=pe.yearExtended),o!==void 0){const i=new ft(Object.assign({...s},{value:Math.max(o,e.min)})),a=new ft(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new ft(s,e)}}class dn extends we{monthValidator=new an;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class gt extends et{constructor(t,e=new x(w.month.name,1,24,w.day,new dn)){super(t,e)}static fromString(t,e=h.get(gt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.month;const i=new gt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new gt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new gt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class wt extends et{constructor(t,e=w.day){super(t,e)}static fromString(t,e=h.get(wt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.day;const i=new wt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new wt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new wt(r)}toString(t){return super.toString(t).padStart(2,"0")}}class yt extends et{constructor(t,e=w.hour){super(t,e)}static fromString(t,e=h.get(yt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){let o=w.hour;const i=new yt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new yt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new yt(r)}}class bt extends et{constructor(t,e=w.minute){super(t,e)}static fromString(t,e=h.get(bt)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.minute,i=new bt(Object.assign({...r},{value:Math.max(s,o.min)})),a=new bt(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new bt(r)}toString(t=de.instance){return super.toString(t)}}class Et extends et{constructor(t,e=w.second){super(t,e)}static fromString(t,e=h.get(Et)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.second,i=new Et(Object.assign({...r},{value:Math.max(s,o.min)})),a=new Et(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new Et(r)}}class It extends St{static fromString(t,e=h.get(It),r=void 0){return new It(e.parse(t,r))}}class ln extends Be{constructor(t){super(t)}newYear(t){return new ft(t,this.units.year)}newMonth(t){return new gt(t,this.units.month)}newDay(t){return new wt(t,this.units.day)}newHour(t){return new yt(t,this.units.hour)}newMinute(t){return new bt(t,this.units.minute)}newSecond(t){return new Et(t,this.units.second)}newMillisecond(t){return new vt(t,this.units.millisecond)}newTimeshift(t){return new It(typeof t=="number"?t:t.value)}}const ds=new ln(pe),ls=new ln(ce);class C extends D{constructor(t){super(t)}get factory(){return ds}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new C({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static fromString(t,e=h.get(C)){const r=e.parse(t);return new C(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return C.fromString(r)}clone(){return new C(this.toSpec())}}const $=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class Ee extends be{static instance=new Ee;render(t){return super.render(t)}}class R extends et{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:R.getValue(t,$.year)+R.getValue(t,$.month)+R.getValue(t,$.day)+R.getValue(t,$.hour)+R.getValue(t,$.minute)+R.getValue(t,$.second),uncertain:R.getBoolean(t,$.uncertain),approximate:R.getBoolean(t,"approximate")},ce.millisecond)}static getBoolean(t,e){return t[e]||t[$.year+"s"]?.[e]||t[$.month+"s"]?.[e]||t[$.day+"s"]?.[e]||t[$.hour+"s"]?.[e]||t[$.minute+"s"]?.[e]||t[$.second+"s"]?.[e]||!1}static getValue(t,e){let r=0,s=t[e+"s"];if(s instanceof et?s=s.value:typeof t=="number"&&(s=t),s){const o=w[e];r=s*o.duration}return r}static toSpec(t,e=ls){return{...Y.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=h.get(R)){const r=e.parse(t);return new R(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new R(r-s)}toString(t=Ee.instance){return super.toString(t)}toSpec(){return R.toSpec(this)}}class Kt extends Ct{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=C.fromString(t)),t&&!(t instanceof C)&&!(t instanceof R))throw new H("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=C.fromString(t)),t&&!(t instanceof C)&&!(t instanceof R))throw new H("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Kt)){const{start:r,end:s}=e.parse(t);return new Kt(r,s)}}class Bt extends et{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class ms extends cn{year=new x("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const De=new ms;class st extends Bt{constructor(t,e=De.year){super(t,e)}static fromString(t,e=De.year,r=h.get(st)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new st(Object.assign({...s},{value:Math.max(o,e.min)})),a=new st(Object.assign({...s},{value:Math.min(s.value.end,e.max)})),l={start:i,end:a},c=s.value.estimate;return c&&(l.estimate=c),l}else return new st(s)}}class ps extends dn{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class ot extends Bt{constructor(t,e=new x(w.month.name,1,41,w.day,new ps)){super(t,e)}static fromString(t,e=h.get(ot)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.month,i=new ot(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ot(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ot(r)}toString(t){return super.toString(t).padStart(2,"0")}}class it extends Bt{constructor(t,e=w.day){super(t,e)}static fromString(t,e=h.get(it)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.day,i=new it(Object.assign({...r},{value:Math.max(s,o.min)})),a=new it(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new it(r)}toString(t){return super.toString(t).padStart(2,"0")}}class at extends Bt{constructor(t,e=w.hour){super(t,e)}static fromString(t,e=h.get(at)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.hour,i=new at(Object.assign({...r},{value:Math.max(s,o.min)})),a=new at(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new at(r)}}class ut extends Bt{constructor(t,e=w.minute){super(t,e)}static fromString(t,e=h.get(ut)){const r=e.parse(t),s=r.value.start;if(s!==void 0){const o=w.minute,i=new ut(Object.assign({...r},{value:Math.max(s,o.min)})),a=new ut(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:i,end:a}}else return new ut(r)}}class ct extends Bt{constructor(t,e=w.second){super(t,e)}static fromString(t,e=w.second,r=h.get(ct)){const s=r.parse(t),o=s.value.start;if(o!==void 0){const i=new ct(Object.assign({...s},{value:Math.max(o,e.min)})),a=new ct(Object.assign({...s},{value:Math.min(s.value.end,e.max)}));return{start:i,end:a}}else return new ct(s,e)}}class mn extends It{}class hs extends de{qualifier(){return""}}class pt extends ye{static instance=new pt;static valueRenderer=new hs(rt.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const r=t[e],s=pt.names.slice(pt.names.indexOf(e)+1).map(a=>t[a]).filter(Boolean),o=pt.qualifier(r.uncertainComponent,r.approximateComponent),i=pt.qualifier(r.uncertainGroup&&!r.uncertainComponent&&!s.some(a=>a.uncertain),r.approximateGroup&&!r.approximateComponent&&!s.some(a=>a.approximate));return o+r.toString(pt.valueRenderer)+i}}class pn extends Be{constructor(t){super(t)}newYear(t){return new st(t,this.units.year)}newMonth(t){return new ot(t,this.units.month)}newDay(t){return new it(t,this.units.day)}newHour(t){return new at(t,this.units.hour)}newMinute(t){return new ut(t,this.units.minute)}newSecond(t){return new ct(t,this.units.second)}newMillisecond(t){return new vt(t,this.units.millisecond)}newTimeshift(t){return new mn(typeof t=="number"?t:t.value)}}const fs=new pn(De),gs=new pn(ce);class K extends C{constructor(t){super(t)}toString(t=pt.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return fs}static fromDate(t){return new K({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:D.timeshiftOf(t)})}static fromString(t,e=h.get(K)){const r=e.parse(t);return new K(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return K.fromString(r)}clone(){return new K(this.toSpec())}}class dt{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new H(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new Mt(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class Gt extends Ee{static instance=new Gt;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=Gt.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let r=e+"P";for(const[s,o]of Gt.designators){const i=t.components[s];i&&(r+=Gt.qualifier(i.uncertainComponent,i.approximateComponent)+i.value+o)}return r}}class k extends R{#t;constructor(t){if(super(typeof t=="number"?t:{value:k.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},ce.millisecond),typeof t!="number"){const e={};for(const r of k.componentNames)t[r]instanceof et&&(e[r]=t[r]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return k.getValue(t,$.year)+k.getValue(t,$.month)+k.getValue(t,$.day)+k.getValue(t,$.hour)+k.getValue(t,$.minute)+k.getValue(t,$.second)}static toSpec(t,e=gs){const r=R.toSpec(t,e);if(t instanceof k&&t.hasQualifiedComponent)for(const s of k.componentNames)delete r[s],t.components[s]&&(r[s]=t.components[s]);return r}static fromString(t,e=h.get(k)){const r=e.parse(t);return new k(r)}static between(t,e){const r=e.getTime(),s=t.getTime();return new k(r-s)}toSpec(){return k.toSpec(this)}toString(t=Gt.instance){return super.toString(t)}}class Ht extends Kt{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=K.fromString(t)),t&&!(t instanceof K)&&!(t instanceof k))throw new H("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=K.fromString(t)),t&&!(t instanceof K)&&!(t instanceof k))throw new H("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Ht)){const{start:r,end:s}=e.parse(t);return new Ht(r,s)}}class ge extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const r of this)if(r.toString()===e)return!0;return!1}static fromString(t,e=h.get(ge)){const{exclusive:r,values:s}=e.parse(t);return new ge(s,r)}}class lt extends dt{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return lt.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new H(`${this.name} cannot be negative`);return super.parse(t)}}class u{static groupName(...t){return t.reduce((e,r)=>e?e+r.charAt(0).toUpperCase()+r.substring(1):r,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return u.optional(u.group(t,...e))}static optionalNonCapturingGroup(...t){return u.optional(u.nonCapturingGroup(...t))}static numberGroup(t,e,r,s="\\d"){return u.group(t,`${r||""}[${s}]${e}`)}}const sr="yearValue";class qt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,sr),"{4}",void 0)}constructor(){super(sr,qt.format())}}const or="monthValue";class zt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,or),"{1,2}",void 0)}constructor(){super(or,zt.format())}}const ir="dayValue";class kt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ir),"{1,2}",void 0)}constructor(){super(ir,kt.format())}}const ar="hourValue";class Rt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ar),"{1,2}",void 0)}constructor(){super(ar,Rt.format())}}const ur="minuteValue";class Wt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,ur),"{1,2}",void 0)}constructor(){super(ur,Wt.format())}}const cr="secondValue";class Yt extends lt{static format(t=""){return u.numberGroup(u.groupName(t,cr),"{1,2}",void 0)}constructor(){super(cr,Yt.format())}}const dr="timeshiftValue",lr="shiftHour",mr="shiftMinute";class Ut extends dt{static format(t=""){return nr.map(e=>e.name).join("|")+"|"+u.nonCapturingGroup(u.group(t+lr,u.numberGroup(u.groupName(t,dr),"{2}","[+-]")),u.optionalNonCapturingGroup(":?",u.numberGroup(u.groupName(t,mr),"{2}",void 0)))}constructor(){super(dr,Ut.format())}parse(t,e){let r=0;const s=nr.find(o=>o.name===t);if(s){if(typeof s.timeshift=="function")try{return s.timeshift(e??{})}catch(o){throw new H(`The time zone ${t} depends on the date: ${o.message}`)}t=s.timeshift}if(t!=="Z"){const o=this.regexGroups(t),i=o[lr];i&&(r+=parseInt(i,10)*60);const a=o[mr];a&&(r+=parseInt(a,10))}return r}}const pr="year",hr="month",fr="day",gr="hour",wr="minute",yr="second",br="millisecond",Er="timeshift";class At extends dt{static format(t=""){return u.group(u.groupName(t,pr),qt.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,hr),zt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,fr),kt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,gr),Rt.format(t)),":?",u.group(u.groupName(t,wr),Wt.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,yr),Yt.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,br),"\\d+"))),"\\s*",u.optionalGroup(u.groupName(t,Er),Ut.format(t)))))}constructor(){super("date",At.format())}parse(t){const e=this.regexGroups(t),r=e[pr],s=e[hr],o=e[fr],i=e[gr],a=e[wr],l=e[yr],c=e[br],m=e[Er],p=r?new Ot(qt.read(r)):void 0,f=s?zt.read(s):void 0;return{year:p,month:f?new Vt(f,Nt.create(f.value,p?.value)):void 0,day:o?new $t(kt.read(o)):void 0,hour:i?new Ft(Rt.read(i)):void 0,minute:a?new Dt(Wt.read(a)):void 0,second:l?new Pt(Yt.read(l)):void 0,millisecond:c?vt.parseFraction(c):void 0,timeshift:m?St.fromString(m,new Ut,{year:p?.value,month:f?.value,day:o?kt.read(o).value:void 0,hour:i?Rt.read(i).value:void 0}):void 0}}}const Sr="years",Me="months",ws="days",vr="hours",xr="minutes",Mr="seconds";class je extends dt{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Sr),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Me),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,ws),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,vr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,xr),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Mr),"+",void 0,"\\d"),"S")}constructor(){super("duration",je.format())}parseGroups(t){return{years:t[Sr],months:t[Me],days:t[Me],hours:t[vr],minutes:t[xr],seconds:t[Mr]}}}const Ae="start",Te="end";class Ce extends dt{static format=u.group(Ae,At.format(Ae))+"/"+u.group(Te,At.format(Te));constructor(){super("interval",Ce.format)}parse(t){const e=this.regexGroups(t),r=e[Ae],s=e[Te];return{start:r?D.fromString(r,new At):void 0,end:s?D.fromString(s,new At):void 0}}}h.register(D,()=>new At);h.register($t,()=>new kt);h.register(Y,()=>new je);h.register(Ft,()=>new Rt);h.register(Ct,()=>new Ce);h.register(Dt,()=>new Wt);h.register(Vt,()=>new zt);h.register(Pt,()=>new Yt);h.register(St,()=>new Ut);h.register(Ot,()=>new qt);class M extends lt{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=M.uncertainGroup+M.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return u.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(u.groupName(M.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(M.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(M.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,r){return u.numberGroup(t,e,r,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],r;return e.charAt(0)==="-"?(r=-1,e=e.substring(1)):r=1,{valueStr:e,sign:r}}parseGroups(t){const{valueStr:e,sign:r}=this.getValueAndSign(t);let s=0,o;for(o=0;o<e.length;o++){const c=e[o];if(c==="X")break;s=s*10+parseInt(c,10)}if(o<e.length){let c=1;for(let f=0;f<e.length-o;f++)c*=10;const m=r*s*c,p=m+c-1;s={start:m,end:p}}else s*=r;const i=t[u.groupName(M.uncertainAndApproximateGroup,this.name)],a=t[u.groupName(M.approximateGroup,this.name)]||i,l=t[u.groupName(M.uncertainGroup,this.name)]||i;return{value:s,approximate:a?!!a:!1,uncertain:l?!!l:!1}}}const Ar="yearValue";class Xt extends M{constructor(){super(Ar,Xt.format())}static format(t=""){return"Y?"+M.numberFormat(u.groupName(t,Ar),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Tr="monthValue";class Jt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Tr),"{1,2}",void 0)}constructor(){super(Tr,Jt.format())}}const Ir="dayValue";class Zt extends M{static format(t=""){return M.numberFormat(u.groupName(t,Ir),"{1,2}",void 0)}constructor(){super(Ir,Zt.format())}}const _r="hourValue";class Qt extends M{static format(t=""){return M.numberFormat(u.groupName(t,_r),"{1,2}",void 0)}constructor(){super(_r,Qt.format())}}const Nr="minuteValue";class te extends M{static format(t=""){return M.numberFormat(u.groupName(t,Nr),"{1,2}",void 0)}constructor(){super(Nr,te.format())}}const Gr="secondValue";class ee extends M{static format(t=""){return M.numberFormat(u.groupName(t,Gr),"{1,2}",void 0)}constructor(){super(Gr,ee.format())}}class re extends Ut{}class T extends dt{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=T.format()){super("date",t)}static format(t=""){return u.group(u.groupName(t,T.yearGroup),Xt.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,T.monthGroup),Jt.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,T.dayGroup),Zt.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,T.hourGroup),Qt.format(t)),":",u.group(u.groupName(t,T.minuteGroup),te.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,T.secondGroup),ee.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,T.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,T.timeshiftGroup),re.format(t)))))}parseGroups(t){const e=t[T.millisecondGroup],r=e?vt.parseFraction(e):void 0,s=t[T.secondGroup],o=s?Et.fromString(s,new ee):void 0,i=t[T.minuteGroup];let a;i&&(a=bt.fromString(i,new te),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[T.hourGroup];let c;l&&(c=yt.fromString(l,new Qt),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[T.dayGroup];let p;m&&(p=wt.fromString(m,new Zt),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[T.monthGroup];let y;f&&(y=gt.fromString(f,new Jt),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[T.yearGroup];let E;S&&(E=ft.fromString(S,void 0,new Xt),E.uncertain=E.uncertain||y?.uncertain||!1,E.approximate=E.approximate||y?.approximate||!1);const G=t[T.timeshiftGroup],mt=G?It.fromString(G,new re,{year:E?.value,month:y?.value,day:p?.value,hour:c?.value}):void 0;return{year:E,month:y,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:mt}}}const kr="years",Rr="months",Or="days",Vr="hours",$r="minutes",Fr="seconds";class Tt extends M{static format(t=""){return"P"+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,kr),"+",void 0,"\\d"),"Y")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Rr),"+",void 0,"\\d"),"MM")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Or),"+",void 0,"\\d"),"D")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Vr),"+",void 0,"\\d"),"H")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,$r),"+",void 0,"\\d"),"M")+u.optionalNonCapturingGroup(u.numberGroup(u.groupName(t,Fr),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",Tt.format())}parseGroups(t){return{years:t[kr],months:t[Rr],days:t[Or],hours:t[Vr],minutes:t[$r],seconds:t[Fr],uncertain:!!t[M.uncertainGroup],approximate:!!t[M.approximateGroup]}}}const ys="dates",Ie="start",_e="end",Dr="durations",Ne="durationMin",Ge="durationMax";class Ke extends dt{static format=u.group(ys,u.optionalGroup(Ie,u.group("openStart","\\.\\.")+"|"+T.format(Ie))+"/"+u.optionalGroup(_e,u.group("openEnd","\\.\\.")+"|"+T.format(_e)))+"|"+u.group(Dr,u.group(Ne,Tt.format(Ne))+"/"+u.group(Ge,Tt.format(Ge)));constructor(t="interval",e=Ke.format){super(t,e)}parseGroups(t){let e,r;if(t[Dr]){const o=t[Ne];e=R.fromString(o,new Tt);const i=t[Ge];r=R.fromString(i,new Tt)}else{const o=t[Ie];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=C.fromString(o,new T)}const i=t[_e];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=C.fromString(i,new T)}}return{start:e,end:r}}}h.register(C,()=>new T);h.register(wt,()=>new Zt);h.register(R,()=>new Tt);h.register(yt,()=>new Qt);h.register(Kt,()=>new Ke);h.register(bt,()=>new te);h.register(gt,()=>new Jt);h.register(Et,()=>new ee);h.register(It,()=>new re);h.register(ft,()=>new Xt);class b extends M{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=b.uncertainGroup+b.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,r){return this.qualifierFormat(u.groupName(b.uncertainGroup,t),"?")+this.qualifierFormat(u.groupName(b.approximateGroup,t),"~")+this.qualifierFormat(u.groupName(b.uncertainAndApproximateGroup,t),"%")+M.numberFormat(t,e,r)}parseGroups(t){const e=super.parseGroups(t),r=t[u.groupName(b.uncertainAndApproximateGroup,this.name)];return(t[u.groupName(b.uncertainGroup,this.name)]||r)&&(e.uncertainComponent=!0),(t[u.groupName(b.approximateGroup,this.name)]||r)&&(e.approximateComponent=!0),e}}const Lt="yearValue",Pr="exp",Ur="signif";class ne extends b{constructor(){super(Lt,ne.format())}static format(t=""){return"Y?"+u.nonCapturingGroup(u.group(u.groupName(t,Pr),"[-]?\\d+E\\d+")+"|"+b.numberFormat(u.groupName(t,Lt),"+","[-]?")+u.optionalGroup(u.groupName(t,Ur),"S\\d+"))}parseGroups(t){const e=t[Pr];if(e){const i=e.indexOf("E"),a=parseInt(e.substring(i+1),10),c=parseInt(e.substring(0,i),10)*Math.pow(10,a);t[Lt]=c.toString()}const r=t[Ur],s=t[Lt];if(r){const i=parseInt(r.substring(1),10),{valueStr:a,sign:l}=this.getValueAndSign(t);let c="";for(let m=0;m<a.length;m++)c+=m<i?a.charAt(m):"X";t[Lt]=(l<0?"-":"")+c}const o=super.parseGroups(t);return r&&(o.value.estimate=parseInt(s,10)),o}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Br="monthValue";class se extends b{static format(t=""){return b.numberFormat(u.groupName(t,Br),"{1,2}",void 0)}constructor(){super(Br,se.format())}}const Lr="dayValue";class oe extends b{static format(t=""){return b.numberFormat(u.groupName(t,Lr),"{1,2}",void 0)}constructor(){super(Lr,oe.format())}}const jr="hourValue";class ie extends b{static format(t=""){return b.numberFormat(u.groupName(t,jr),"{1,2}",void 0)}constructor(){super(jr,ie.format())}}const Cr="secondValue";class ae extends b{static format(t=""){return b.numberFormat(u.groupName(t,Cr),"{1,2}",void 0)}constructor(){super(Cr,ae.format())}}const Kr="minuteValue";class ue extends b{static format(t=""){return b.numberFormat(u.groupName(t,Kr),"{1,2}",void 0)}constructor(){super(Kr,ue.format())}}class bs extends re{}class v extends dt{static yearGroup=T.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",v.format())}static format(t=""){return u.group(u.groupName(t,v.yearGroup),ne.format(t))+u.optionalNonCapturingGroup("-",u.group(u.groupName(t,v.monthGroup),se.format(t)),u.optionalNonCapturingGroup("-",u.group(u.groupName(t,v.dayGroup),oe.format(t)),u.optionalNonCapturingGroup("[T ]",u.group(u.groupName(t,v.hourGroup),ie.format(t)),":",u.group(u.groupName(t,v.minuteGroup),ue.format(t)),u.optionalNonCapturingGroup(":",u.group(u.groupName(t,v.secondGroup),ae.format(t)),u.optionalNonCapturingGroup("[.,]",u.group(u.groupName(t,v.millisecondGroup),"\\d+"))),u.optionalGroup(u.groupName(t,v.timeshiftGroup),bs.format(t)))))}parseGroups(t){const e=t[v.millisecondGroup],r=e?vt.parseFraction(e):void 0,s=t[v.secondGroup];let o;s&&(o=ct.fromString(s,void 0,new ae),o.uncertain=o?.uncertain||!1,o.approximate=o?.approximate||!1);const i=t[v.minuteGroup];let a;i&&(a=ut.fromString(i,new ue),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[v.hourGroup];let c;l&&(c=at.fromString(l,new ie),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[v.dayGroup];let p;m&&(p=it.fromString(m,new oe),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[v.monthGroup];let y;f&&(y=ot.fromString(f,new se),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[v.yearGroup];let E;S&&(E=st.fromString(S,void 0,new ne),E.uncertain=E.uncertain||y?.uncertain||!1,E.approximate=E.approximate||y?.approximate||!1);const G=t[v.timeshiftGroup],mt=G?mn.fromString(G,new re,{year:E?.value,month:y?.value,day:p?.value,hour:c?.value}):void 0;return{year:E,month:y,day:p,hour:c,minute:a,second:o,millisecond:r,timeshift:mt}}}const Hr="durationValue";class He extends b{static format(t=""){return"^"+b.numberFormat(u.groupName(t,Hr),"+",void 0)}constructor(){super(Hr,He.format())}}class Es extends Ue{millisecond=new x("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new x("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new x("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new x("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new x("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new x("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new x("year",0,Number.MAX_SAFE_INTEGER,this.month)}const _t=new Es;class g extends b{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new He;static componentFormat(t,e,r,s,o=""){const i=u.group(u.groupName(t,g.quantityGroup(e)),b.numberFormat(u.groupName(t,r),"+",void 0,"\\d"));return u.group(u.groupName(t,e),i,s,o)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",g.format())}static format(t=""){const e=u.groupName(t,g.durationGroup);return this.qualifierFormat(u.groupName(b.uncertainGroup,e),"?")+this.qualifierFormat(u.groupName(b.approximateGroup,e),"~")+this.qualifierFormat(u.groupName(b.uncertainAndApproximateGroup,e),"%")+"P"+u.optional(g.componentFormat(t,g.yearsGroup,v.yearGroup,"Y"))+u.optionalNonCapturingGroup(g.componentFormat(t,g.monthsGroup,v.monthGroup,"MM")+"|"+g.componentFormat(t,g.isoMonthsGroup,"isoMonth","M",g.isoMonthsLookahead))+u.optional(g.componentFormat(t,g.daysGroup,v.dayGroup,"D"))+"T?"+u.optional(g.componentFormat(t,g.hoursGroup,v.hourGroup,"H"))+u.optional(g.componentFormat(t,g.minutesGroup,v.minuteGroup,"M"))+u.optional(g.componentFormat(t,g.secondsGroup,v.secondGroup,"S"))+u.optionalGroup(u.groupName(t,g.suffixGroup),"[?~%]")}static parseComponent(t,e,r){const s=g.componentParser.parse(t);return new e(s,r)}parseGroups(t){const e=t[g.quantityGroup(g.secondsGroup)];let r;e&&(r=g.parseComponent(e,ct,_t.second),r.uncertain=!!t[u.groupName(b.uncertainGroup,g.secondsGroup)]||!1,r.approximate=!!t[u.groupName(b.approximateGroup,g.secondsGroup)]||!1);const s=t[g.quantityGroup(g.minutesGroup)];let o;s&&(o=g.parseComponent(s,ut,_t.minute),o.uncertain=o.uncertain||r?.uncertain||!1,o.approximate=o.approximate||r?.approximate||!1);const i=t[g.quantityGroup(g.hoursGroup)];let a;i&&(a=g.parseComponent(i,at,_t.hour),a.uncertain=a.uncertain||o?.uncertain||!1,a.approximate=a.approximate||o?.approximate||!1);const l=t[g.quantityGroup(g.daysGroup)];let c;l&&(c=g.parseComponent(l,it,_t.day),c.uncertain=c.uncertain||a?.uncertain||!1,c.approximate=c.approximate||a?.approximate||!1);const m=t[g.quantityGroup(g.monthsGroup)]||t[g.quantityGroup(g.isoMonthsGroup)];let p;m&&(p=g.parseComponent(m,ot,_t.month),p.uncertain=p.uncertain||c?.uncertain||!1,p.approximate=p.approximate||c?.approximate||!1);const f=t[g.quantityGroup(g.yearsGroup)];let y;f&&(y=g.parseComponent(f,st,_t.year),y.uncertain=y.uncertain||p?.uncertain||!1,y.approximate=y.approximate||p?.approximate||!1);const S=t[g.suffixGroup],E=!!t[u.groupName(b.uncertainAndApproximateGroup,g.durationGroup)]||S==="%",G=E||!!t[u.groupName(b.uncertainGroup,g.durationGroup)]||S==="?",mt=E||!!t[u.groupName(b.approximateGroup,g.durationGroup)]||S==="~";return{years:y,months:p,days:c,hours:a,minutes:o,seconds:r,uncertain:G,approximate:mt}}}const Ss="dates",ke="start",Re="end",qr="durations",Oe="durationMin",Ve="durationMax";class Se extends dt{static format=u.group(Ss,u.optionalGroup(ke,u.group("openStart","\\.\\.")+"|"+v.format(ke))+"/"+u.optionalGroup(Re,u.group("openEnd","\\.\\.")+"|"+v.format(Re)))+"|"+u.group(qr,u.group(Oe,g.format(Oe))+"/"+u.group(Ve,g.format(Ve)));constructor(t="interval",e=Se.format){super(t,e)}parseGroups(t){let e,r;if(t[qr]){const o=t[Oe];e=k.fromString(o,new g);const i=t[Ve];r=k.fromString(i,new g)}else{const o=t[ke];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=K.fromString(o,new v)}const i=t[Re];switch(i){case void 0:r=null;break;case"..":r=void 0;break;default:r=K.fromString(i,new v)}}return{start:e,end:r}}}class vs{parse(t){t=t.trim();const e=t.startsWith("["),s=t.substring(1,t.length-1).split(","),o=[];for(const i of s){let a;i.includes("..")?a=Ht.fromString(i.replace("..","/"),new Se):a=K.fromString(i,new v),o.push(a)}return{values:o,exclusive:e}}}h.register(K,()=>new v);h.register(it,()=>new oe);h.register(k,()=>new g);h.register(at,()=>new ie);h.register(Ht,()=>new Se);h.register(ut,()=>new ue);h.register(ot,()=>new se);h.register(ct,()=>new ae);h.register(ge,()=>new vs);h.register(st,()=>new ne);class W{constructor(t){this.preferences=t}read(t){var e,r;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const o of this.preferences){const i=(e=t[o])!==null&&e!==void 0?e:t[W.base(o)];if(i)return i}const s=new Set(this.preferences.map(o=>W.base(o)));for(const[o,i]of Object.entries(t))if(i&&s.has(W.base(o)))return i;return(r=Object.values(t).find(o=>o))!==null&&r!==void 0?r:void 0}write(t,e,r){var s,o;const i=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return i;const a={...t},l=(o=(s=Object.keys(a).find(c=>c===r))!==null&&s!==void 0?s:Object.keys(a).find(c=>W.base(c)===W.base(r)))!==null&&o!==void 0?o:r;return i===void 0?delete a[l]:a[l]=i,Object.keys(a).length===0?void 0:a}static base(t){return t.toLowerCase().split("-")[0]}}W.any=new W([]);var zr;(function(n){n.abductee="abductee",n.actor="actor",n.artist="artist",n.anthropologist="anthropologist",n.archeologist="archeologist",n.astronaut="astronaut",n.astronomer="astronomer",n.astrologist="astrologist",n.astrophysicist="astrophysicist",n.banker="banker",n.barman="barman",n.biologist="biologist",n.biochemist="biochemist",n.biophysicist="biophysicist",n.bishop="bishop",n.businessman="businessman",n.botanist="botanist",n.cameraman="cameraman",n.chemist="chemist",n.contactee="contactee",n.cryptozoologist="cryptozoologist",n.dentist="dentist",n.director="director",n.diplomat="diplomat",n.diver="diver",n.electronics="electronics",n.engineer="engineer",n.ethnologist="ethnologist",n.exobiologist="exobiologist",n.farmer="farmer",n.firefighter="firefighter",n.flightAttendant="flightAttendant",n.geologist="geologist",n.geophysicist="geophysicist",n.geographer="geographer",n.historian="historian",n.houseWife="houseWife",n.hypnotherapist="hypnotherapist",n.illusionist="illusionist",n.journalist="journalist",n.judge="judge",n.lawyer="lawyer",n.leader="leader",n.librarian="librarian",n.logger="logger",n.mathematician="mathematician",n.mechanic="mechanic",n.meteorologist="meteorologist",n.military="military",n.musician="musician",n.neurologist="neurologist",n.neuroscientist="neuroscientist",n.neuropsychiatrist="neuropsychiatrist",n.nurse="nurse",n.oceanographer="oceanographer",n.painter="painter",n.parapsychologist="parapsychologist",n.philosopher="philosopher",n.photographer="photographer",n.physician="physician",n.physicist="physicist",n.pilot="pilot",n.politician="politician",n.policeman="policeman",n.priest="priest",n.producer="producer",n.prospector="prospector",n.psychologist="psychologist",n.psychiatrist="psychiatrist",n.radioastronomer="radioastronomer",n.radioamateur="radioamateur",n.salesman="salesman",n.sailor="sailor",n.sociologist="sociologist",n.softwareEngineer="softwareEngineer",n.stuntman="stuntman",n.taxiDriver="taxiDriver",n.teacher="teacher",n.telegrapher="telegrapher",n.truckDriver="truckDriver",n.ufologist="ufologist",n.ufoWitness="ufoWitness",n.ufoWitness2="ufoWitness2",n.worker="worker",n.writer="writer"})(zr||(zr={}));var Wr;(function(n){n.neutral="neutral",n.male="male",n.female="female"})(Wr||(Wr={}));class xs extends Error{constructor(t,e){super(t),this.cause=e}}class qe extends xs{constructor(t=qe.defaultMessage,e){super(t,e)}}qe.defaultMessage="Assertion failed";var Yr;(function(n){n.country="country",n.region="region",n.department="department",n.city="city",n.company="company"})(Yr||(Yr={}));var Xr;(function(n){n.at="at",n.au="au",n.ar="ar",n.be="be",n.br="br",n.ca="ca",n.ch="ch",n.cn="cn",n.cl="cl",n.co="co",n.cy="cy",n.de="de",n.dk="dk",n.do="do",n.dz="dz",n.gr="gr",n.ec="ec",n.eg="eg",n.es="es",n.fi="fi",n.fr="fr",n.ga="ga",n.ge="ge",n.hu="hu",n.in="in",n.ie="ie",n.ir="ir",n.il="il",n.it="it",n.jp="jp",n.kr="kr",n.ma="ma",n.mx="mx",n.my="my",n.mz="mz",n.nl="nl",n.no="no",n.nz="nz",n.pa="pa",n.pe="pe",n.ph="ph",n.pl="pl",n.pt="pt",n.ro="ro",n.ru="ru",n.sc="sc",n.tr="tr",n.ua="ua",n.uk="uk",n.us="us",n.sa="sa",n.se="se",n.su="su",n.tn="tn",n.tw="tw",n.ve="ve",n.za="za"})(Xr||(Xr={}));class I{static KEY="rr0-module-consent";static originOf(t){try{return new URL(t,typeof location>"u"?void 0:location.href).origin}catch{return t}}static granted(t,e=I.storage()){const r=I.originOf(t);return typeof location<"u"&&r===location.origin?!0:I.list(e).includes(r)}static list(t=I.storage()){try{const e=JSON.parse(t?.getItem(I.KEY)??"[]");return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}catch{return[]}}static grant(t,e=I.storage()){const r=[...new Set([...I.list(e),...t.map(s=>I.originOf(s))])];try{e?.setItem(I.KEY,JSON.stringify(r))}catch{}}static revoke(t,e=I.storage()){const r=I.originOf(t);try{e?.setItem(I.KEY,JSON.stringify(I.list(e).filter(s=>s!==r)))}catch{}}static revokeUnused(t,e,r=I.storage()){const s=new Set(e.map(o=>I.originOf(o)));for(const o of t)s.has(I.originOf(o))||I.revoke(o,r)}static storage(){try{return typeof localStorage>"u"?void 0:localStorage}catch{return}}}const Ms=`
|
|
118
118
|
.consent-dialog { width: min(32em, calc(100vw - 2em)); padding: 14px 16px; border: 1px solid var(--line-strong, #888); border-radius: 12px;
|
|
119
119
|
background: var(--ground-raised, Canvas); color: var(--ink, CanvasText); box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font: 400 14px/1.4 var(--sans, sans-serif); }
|
|
120
120
|
.consent-dialog:popover-open { position: fixed; inset: 0; margin: auto; height: fit-content; }
|
|
@@ -122,12 +122,12 @@ ${t} :is(select:not([multiple]):not([size]), .rr0-select) {
|
|
|
122
122
|
.consent-dialog p { margin: 0; }
|
|
123
123
|
.consent-dialog ul { margin: 6px 0 10px; padding-left: 1.2em; font-family: var(--mono, monospace); font-size: .85em; overflow-wrap: anywhere; }
|
|
124
124
|
.consent-dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
|
|
125
|
-
`;class As{static async ask(t,e,r){const s=[...new Set(r.filter(S=>!I.granted(S)).map(S=>I.originOf(S)))];if(s.length===0)return!0;const o=(t instanceof ShadowRoot?t.host:t).ownerDocument,i=o.createElement("div");i.className="consent-dialog",i.id="consent",i.setAttribute("popover","manual"),i.setAttribute("role","dialog");const a=o.createElement("style");a.textContent=Ms;const l=o.createElement("h2");l.id="consent-heading",l.textContent=e?.consentHeading??"",i.setAttribute("aria-labelledby",l.id);const c=o.createElement("p");c.id="consent-text",c.textContent=e?.consentText??"";const m=o.createElement("ul");m.id="consent-origins",m.append(...s.map(S=>Object.assign(o.createElement("li"),{textContent:S})));const p=o.createElement("div");p.className="actions";const f=Object.assign(o.createElement("button"),{type:"button",id:"consent-without",className:"pill-btn",textContent:e?.consentWithout??""}),y=Object.assign(o.createElement("button"),{type:"button",id:"consent-run",className:"pill-btn primary",textContent:e?.consentRun??""});return p.append(f,y),i.append(a,l,c,m,p),t.getElementById?.("consent")?.remove(),t.append(i),new Promise(S=>{const E=G=>{try{i.hidePopover?.()}catch{}i.remove(),G&&I.grant(r),S(G)};y.addEventListener("click",()=>E(!0)),f.addEventListener("click",()=>E(!1));try{i.showPopover?.()}catch{}f.focus()})}}function Ts(n,t){for(const e of n){const r=e.toLowerCase().split("-")[0];if(t.includes(r))return r}return"en"}class
|
|
125
|
+
`;class As{static async ask(t,e,r){const s=[...new Set(r.filter(S=>!I.granted(S)).map(S=>I.originOf(S)))];if(s.length===0)return!0;const o=(t instanceof ShadowRoot?t.host:t).ownerDocument,i=o.createElement("div");i.className="consent-dialog",i.id="consent",i.setAttribute("popover","manual"),i.setAttribute("role","dialog");const a=o.createElement("style");a.textContent=Ms;const l=o.createElement("h2");l.id="consent-heading",l.textContent=e?.consentHeading??"",i.setAttribute("aria-labelledby",l.id);const c=o.createElement("p");c.id="consent-text",c.textContent=e?.consentText??"";const m=o.createElement("ul");m.id="consent-origins",m.append(...s.map(S=>Object.assign(o.createElement("li"),{textContent:S})));const p=o.createElement("div");p.className="actions";const f=Object.assign(o.createElement("button"),{type:"button",id:"consent-without",className:"pill-btn",textContent:e?.consentWithout??""}),y=Object.assign(o.createElement("button"),{type:"button",id:"consent-run",className:"pill-btn primary",textContent:e?.consentRun??""});return p.append(f,y),i.append(a,l,c,m,p),t.getElementById?.("consent")?.remove(),t.append(i),new Promise(S=>{const E=G=>{try{i.hidePopover?.()}catch{}i.remove(),G&&I.grant(r),S(G)};y.addEventListener("click",()=>E(!0)),f.addEventListener("click",()=>E(!1));try{i.showPopover?.()}catch{}f.focus()})}}function Ts(n,t){for(const e of n){const r=e.toLowerCase().split("-")[0];if(t.includes(r))return r}return"en"}class me{static preferencesFor(t){const e=navigator.languages??[],r=this.declaredFor(t);return r?[r,...e]:e}static declaredFor(t){for(let e=t;e;){const r=e.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const s=e.getRootNode();e=s instanceof ShadowRoot?s.host:void 0}}}const Is=["en","fr","es","it"],_s={en:()=>d(()=>import("./UfoMessages_en-D5OYWJ3K.js"),__vite__mapDeps([34,24]),import.meta.url).then(n=>n.ufoMessages_en),fr:()=>d(()=>import("./UfoMessages_fr-CGkQBn5r.js"),[],import.meta.url).then(n=>n.ufoMessages_fr),es:()=>d(()=>import("./UfoMessages_es-CO-v8Jl6.js"),[],import.meta.url).then(n=>n.ufoMessages_es),it:()=>d(()=>import("./UfoMessages_it-BScqxIaH.js"),[],import.meta.url).then(n=>n.ufoMessages_it)},so=_.catalog(_s),Ns={en:()=>d(()=>import("./SightingEditorMessages_en-V_dJYjNb.js"),__vite__mapDeps([35,36]),import.meta.url).then(n=>n.sightingEditorMessages_en),fr:()=>d(()=>import("./SightingEditorMessages_fr-zxTvQa2I.js"),__vite__mapDeps([37,38]),import.meta.url).then(n=>n.sightingEditorMessages_fr),es:()=>d(()=>import("./SightingEditorMessages_es-DauDuhPa.js"),__vite__mapDeps([39,40]),import.meta.url).then(n=>n.sightingEditorMessages_es),it:()=>d(()=>import("./SightingEditorMessages_it-vvaao68O.js"),__vite__mapDeps([41,42]),import.meta.url).then(n=>n.sightingEditorMessages_it)},Gs=_.catalog(Ns);function oo(n){return Gs.load(n)}const ks={en:()=>d(()=>import("./SightingMessages_en-Drcr3k4V.js"),__vite__mapDeps([43,36]),import.meta.url).then(n=>n.sightingMessages_en),fr:()=>d(()=>import("./SightingMessages_fr-7IYuW095.js"),__vite__mapDeps([44,38]),import.meta.url).then(n=>n.sightingMessages_fr),es:()=>d(()=>import("./SightingMessages_es-BcaWM7Oy.js"),__vite__mapDeps([45,40]),import.meta.url).then(n=>n.sightingMessages_es),it:()=>d(()=>import("./SightingMessages_it-BhDmZn6p.js"),__vite__mapDeps([46,42]),import.meta.url).then(n=>n.sightingMessages_it)},io=_.catalog(ks),Rs={en:()=>d(()=>import("./CaseMessages_en-BC0lku35.js"),[],import.meta.url).then(n=>n.caseMessages_en),fr:()=>d(()=>import("./CaseMessages_fr-D_6J6ONO.js"),[],import.meta.url).then(n=>n.caseMessages_fr),es:()=>d(()=>import("./CaseMessages_es-Cbktn5vj.js"),[],import.meta.url).then(n=>n.caseMessages_es),it:()=>d(()=>import("./CaseMessages_it-CYyww4oG.js"),[],import.meta.url).then(n=>n.caseMessages_it)},Os=_.catalog(Rs);function ao(n){return Os.load(n)}const Vs={en:()=>d(()=>import("./UfoAtHomeMessages_en-ByVu39KF.js"),__vite__mapDeps([47,48]),import.meta.url).then(n=>n.ufoAtHomeMessages_en),fr:()=>d(()=>import("./UfoAtHomeMessages_fr-nTqRf0ZK.js"),__vite__mapDeps([49,50]),import.meta.url).then(n=>n.ufoAtHomeMessages_fr),es:()=>d(()=>import("./UfoAtHomeMessages_es-D9bLboxq.js"),__vite__mapDeps([51,52]),import.meta.url).then(n=>n.ufoAtHomeMessages_es),it:()=>d(()=>import("./UfoAtHomeMessages_it-4cZC5-y5.js"),__vite__mapDeps([53,54]),import.meta.url).then(n=>n.ufoAtHomeMessages_it)},$s=_.catalog(Vs);function Fs(n){return $s.load(n)}const Ds={en:()=>d(()=>import("./ShareMessages_en-B43x8LgJ.js"),[],import.meta.url).then(n=>n.shareMessages_en),fr:()=>d(()=>import("./ShareMessages_fr-CzZyVbbX.js"),[],import.meta.url).then(n=>n.shareMessages_fr),es:()=>d(()=>import("./ShareMessages_es-DZCJojSc.js"),[],import.meta.url).then(n=>n.shareMessages_es),it:()=>d(()=>import("./ShareMessages_it-C_Z6eDQK.js"),[],import.meta.url).then(n=>n.shareMessages_it)},uo=_.catalog(Ds);function co(n){switch(n){case"fr":return d(()=>import("./TagNames_fr-Dnqq6HQ5.js"),[],import.meta.url).then(t=>t.tagNames_fr);case"es":return d(()=>import("./TagNames_es-BfnMpc3D.js"),[],import.meta.url).then(t=>t.tagNames_es);case"it":return d(()=>import("./TagNames_it-n6E4EGYO.js"),[],import.meta.url).then(t=>t.tagNames_it);default:return Promise.resolve({})}}const Ps={en:()=>d(()=>import("./BodyEditorMessages_en-CckxSS1L.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_en),fr:()=>d(()=>import("./BodyEditorMessages_fr-638ypdqf.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_fr),es:()=>d(()=>import("./BodyEditorMessages_es-B8GlFFBo.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_es),it:()=>d(()=>import("./BodyEditorMessages_it-SKpMkHFI.js"),[],import.meta.url).then(n=>n.bodyEditorMessages_it)},Us={en:()=>d(()=>import("./CaseEditorMessages_en-pog3M_U6.js"),[],import.meta.url).then(n=>n.caseEditorMessages_en),fr:()=>d(()=>import("./CaseEditorMessages_fr-BOKVeIXM.js"),[],import.meta.url).then(n=>n.caseEditorMessages_fr),es:()=>d(()=>import("./CaseEditorMessages_es-Dz1N0VpM.js"),[],import.meta.url).then(n=>n.caseEditorMessages_es),it:()=>d(()=>import("./CaseEditorMessages_it-BKAkbKq-.js"),[],import.meta.url).then(n=>n.caseEditorMessages_it)},Bs={en:()=>d(()=>import("./ReadingSensitivityMessages_en-ChQHFyxb.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_en),fr:()=>d(()=>import("./ReadingSensitivityMessages_fr-Dl4a8udu.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_fr),es:()=>d(()=>import("./ReadingSensitivityMessages_es-BbFqHsvR.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_es),it:()=>d(()=>import("./ReadingSensitivityMessages_it-CwiJfUo_.js"),[],import.meta.url).then(n=>n.readingSensitivityMessages_it)},lo=_.catalog(Bs),Ls={en:()=>d(()=>import("./HvsMessages_en-BiLhEAxJ.js"),[],import.meta.url).then(n=>n.hvsMessages_en),fr:()=>d(()=>import("./HvsMessages_fr-DkvE2qm1.js"),[],import.meta.url).then(n=>n.hvsMessages_fr),es:()=>d(()=>import("./HvsMessages_es-Cbj_6eFs.js"),[],import.meta.url).then(n=>n.hvsMessages_es),it:()=>d(()=>import("./HvsMessages_it-BIJ87Uyb.js"),[],import.meta.url).then(n=>n.hvsMessages_it)},mo=_.catalog(Ls),js={en:()=>d(()=>import("./ScenarioSweepMessages_en-Bf4BscDU.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_en),fr:()=>d(()=>import("./ScenarioSweepMessages_fr-DlPsO6oI.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_fr),es:()=>d(()=>import("./ScenarioSweepMessages_es-CBHQfuRB.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_es),it:()=>d(()=>import("./ScenarioSweepMessages_it-DANW3_la.js"),[],import.meta.url).then(n=>n.scenarioSweepMessages_it)},po=_.catalog(js),Cs={en:()=>d(()=>import("./CaseExportMessages_en-jHlu58Y7.js"),[],import.meta.url).then(n=>n.caseExportMessages_en),fr:()=>d(()=>import("./CaseExportMessages_fr-sDfEgjWg.js"),[],import.meta.url).then(n=>n.caseExportMessages_fr),es:()=>d(()=>import("./CaseExportMessages_es-dCQQFgjq.js"),[],import.meta.url).then(n=>n.caseExportMessages_es),it:()=>d(()=>import("./CaseExportMessages_it-BJaglZtP.js"),[],import.meta.url).then(n=>n.caseExportMessages_it)},ho=_.catalog(Cs),Ks={en:()=>d(()=>import("./InterviewMessages_en-Ikx6GjEd.js"),[],import.meta.url).then(n=>n.interviewMessages_en),fr:()=>d(()=>import("./InterviewMessages_fr-DT0gXAKD.js"),[],import.meta.url).then(n=>n.interviewMessages_fr),es:()=>d(()=>import("./InterviewMessages_es-DKWWyrnb.js"),[],import.meta.url).then(n=>n.interviewMessages_es),it:()=>d(()=>import("./InterviewMessages_it-CF_9MYPt.js"),[],import.meta.url).then(n=>n.interviewMessages_it)},fo=_.catalog(Ks),go=_.catalog(Us),wo=_.catalog(Ps),Hs=_.catalog({en:()=>d(()=>import("./SceneNames_en-sRbx6EJZ.js"),__vite__mapDeps([55,7]),import.meta.url).then(n=>n.sceneNames_en),fr:()=>d(()=>import("./SceneNames_fr-BtTlti4C.js"),__vite__mapDeps([56,7]),import.meta.url).then(n=>n.sceneNames_fr),es:()=>d(()=>import("./SceneNames_es-pnfHB-7D.js"),__vite__mapDeps([57,7]),import.meta.url).then(n=>n.sceneNames_es),it:()=>d(()=>import("./SceneNames_it-DQKwdCVD.js"),__vite__mapDeps([58,7]),import.meta.url).then(n=>n.sceneNames_it)});function yo(n){return Hs.load(n)}const bo=_.catalog({en:()=>d(()=>import("./CloudEditorMessages_en-SmcRKW1O.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_en),fr:()=>d(()=>import("./CloudEditorMessages_fr-SvL-CR04.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_fr),es:()=>d(()=>import("./CloudEditorMessages_es-DFCuS9Qg.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_es),it:()=>d(()=>import("./CloudEditorMessages_it-BvfiHWV9.js"),[],import.meta.url).then(n=>n.cloudEditorMessages_it)}),Jr="rr0-ufoathome",qs='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round"><path d="M8 3v10M3 8h10"/></svg>',zs='<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4.5h4l1.5 1.5H14v6.5H2z"/></svg>',Ws=`
|
|
126
126
|
<style>
|
|
127
|
-
:host { display: block; ${
|
|
127
|
+
:host { display: block; ${xe.TOKENS} }
|
|
128
128
|
:host([hidden]) { display: none; }
|
|
129
|
-
${
|
|
130
|
-
${
|
|
129
|
+
${xe.HEAD}
|
|
130
|
+
${xe.fields(".open-menu")}
|
|
131
131
|
${q.CSS}
|
|
132
132
|
.bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
|
|
133
133
|
.bar .status { margin-right: auto; }
|
|
@@ -185,4 +185,4 @@ ${q.CSS}
|
|
|
185
185
|
<p id="template-hint" class="hint"></p>
|
|
186
186
|
</div>
|
|
187
187
|
<slot></slot>
|
|
188
|
-
`;class Z extends HTMLElement{switcher=new Pe(t=>this.append(t),void 0,t=>this.dispatchEvent(new CustomEvent(yn,{detail:t,bubbles:!0,composed:!0})));shadow;messages;started=!1;constructor(){super(),nn(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=Ws,this.byId("new").addEventListener("click",()=>void this.startNew()),this.byId("open").addEventListener("click",()=>{this.placeMenu(),this.showRecent(),this.showTemplate()}),this.byId("open-file").addEventListener("filepick",t=>{this.closeMenu(),this.openPick(t.detail)}),this.byId("template-file").addEventListener("filepick",t=>void this.keepTemplate(t.detail)),this.byId("template-forget").addEventListener("click",()=>void this.forgetTemplate())}connectedCallback(){if(window.addEventListener("resize",this.fitHeight),this.fitHeight(),this.started)return;this.started=!0,this.localeLoaded=this.loadLocale();const t=this.getAttribute("src")??void 0,e=this.getAttribute("track")??void 0,r=t&&this.getAttribute("mode")!=="edit"?this.switcher.read({src:t,...e?{track:e}:{}}):this.switcher.edit({...t?{src:t}:{},...e?{track:e}:{}});this.ready=r.catch(()=>this.say(this.messages?.openFailed,"error")),this.loadKeptTemplate(),t||this.ready.then(()=>this.startUnderTemplate()),this.ready.then(this.fitHeight)}disconnectedCallback(){window.removeEventListener("resize",this.fitHeight)}fitHeight=()=>{const t=this.byId("open").closest(".bar").getBoundingClientRect().bottom+window.scrollY;this.style.setProperty("--rr0-editor-height",`calc(100dvh - ${Math.round(t+12)}px)`)};ready=Promise.resolve();async openFiles(t,e){const r=(await Promise.all(t.map(async i=>{const a=await Z.textOf(i);try{return{name:i.name,text:a,json:JSON.parse(a)}}catch{return}}))).filter(i=>i!==void 0);if(r.length===0){this.say(this.messages?.noJson,"warning");return}const s=F.localBase();F.hold(new Map(r.map(i=>[new URL(i.name,s).href,{json:i.json,changed:!1,local:!0}])));const o=r.find(i=>z.isCase(i.json))??r[0];this.say(void 0),await this.switcher.open(new URL(o.name,s).href),await V.add(e&&e.length?{kind:"handles",name:o.name,openedAt:Date.now(),handles:e}:{kind:"copy",name:o.name,openedAt:Date.now(),copies:r.map(({name:i,text:a})=>({name:i,text:a}))})}static textOf(t){return new Promise((e,r)=>{const s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>r(s.error),s.readAsText(t)})}async openAddress(t){const e=new URL(t,location.href).href;this.say(void 0),await this.switcher.open(e),await V.add({kind:"address",name:decodeURIComponent(new URL(e).pathname.split("/").pop()||e),openedAt:Date.now(),url:e})}async openPick(t){try{t.url!==void 0?await this.openAddress(t.url):await this.openFiles(t.files??[t.file],t.handles)}catch{this.say(this.messages?.openFailed,"error")}}async reopen(t){this.closeMenu();try{t.kind==="address"?await this.openAddress(t.url):await this.openFiles(await V.files(t),t.kind==="handles"?t.handles:void 0)}catch{this.say(this.messages?.openFailed,"error")}}async startNew(){let t;try{t=await this.template()}catch{this.say(this.messages?.caseTemplateFailed,"error");return}if(!t)return this.switcher.startNew();this.say(void 0),await this.offer(t)}async template(){const t=U.read();if(t)return t;const e=this.getAttribute("case-template");return e?L.load(e):void 0}async offer(t){await L.install(t);const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([57,25,4]),import.meta.url);if(e.shared.require(t.modules,t.url,Z.runsScripts(t)),t.starts.length===1)return this.start(t.starts[0],t);this.showStarts(t)}async startUnderTemplate(){let t;try{t=await this.template()}catch{this.say(this.messages?.caseTemplateFailed,"error");return}t&&await this.offer(t)}async start(t,e){if(this.closeStarts(),t.modules?.length){const{ModuleSession:r}=await d(async()=>{const{ModuleSession:s}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:s}},__vite__mapDeps([57,25,4]),import.meta.url);await r.shared.require(t.modules,void 0,e?Z.runsScripts(e):!0)}await this.switcher.startNew(t)}static runsScripts(t){return t.origin==="page"||Z.moduleUrls(t).every(e=>I.granted(e))}static moduleUrls(t){return[...new Set([...t.modules??[],...t.starts.flatMap(e=>e.modules??[])])]}async loadKeptTemplate(){const t=U.read();if(!t||(await L.install(t).catch(()=>{}),!t.modules?.length))return;const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([57,25,4]),import.meta.url);e.shared.require(t.modules,t.url,Z.runsScripts(t))}async forgetTemplate(){const t=U.read();if(U.forget(),t){const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([57,25,4]),import.meta.url);I.revokeUnused(Z.moduleUrls(t),e.shared.list().filter(r=>r.addedByPerson).map(r=>r.url))}await this.showTemplate()}async keepTemplate(t){await this.localeLoaded;const e=this.messages;let r;try{if(t.url!==void 0){const l=new URL(t.url,location.href).href,c=await fetch(l);if(!c.ok)throw new Error(`${l}: HTTP ${c.status}`);r=U.keep(await c.text(),decodeURIComponent(l.replace(/[?#].*$/,"").replace(/^.*\//,"")),void 0,l)}else r=U.keep(await Z.textOf(t.file),t.file.name)}catch{this.say(e?.caseTemplateFailed,"error"),await this.showTemplate();return}const s=Z.moduleUrls(r),o=s.length>0&&await As.ask(this.shadow,e,s),a=new W(le.preferencesFor(this)).read(r.title)??r.id;if(this.say([e?.templateKept.replace("{title}",a),s.length===0?void 0:o?e?.templateModulesRun:e?.templateModulesWithoutScripts].filter(Boolean).join(" ")),await L.install(r).catch(()=>{}),s.length>0){const{ModuleSession:l}=await d(async()=>{const{ModuleSession:c}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:c}},__vite__mapDeps([57,25,4]),import.meta.url);l.shared.require(r.modules,r.url,o)}await this.showTemplate()}async showTemplate(){await this.localeLoaded;const t=this.messages;if(!t)return;const e=new W(le.preferencesFor(this));let r;try{r=await this.template()}catch{r=void 0}const s=r?e.read(r.title)??r.id:"";this.byId("template-now").textContent=r?r.origin==="file"?t.templateFromFile.replace("{title}",s).replace("{file}",r.fileName??""):r.origin==="address"?t.templateFromAddress.replace("{title}",s).replace("{url}",r.url):t.templateFromPage.replace("{title}",s):t.templateNone,this.byId("template-forget").hidden=r===void 0||r.origin==="page"}showStarts(t){const e=new W(le.preferencesFor(this));this.byId("starts-heading").textContent=e.read(t.title)??"",this.byId("starts").replaceChildren(...t.starts.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.dataset.start=o.id;const l=document.createElement("span");if(l.className="name",l.textContent=e.read(o.title)??"",a.append(l),o.description){const c=document.createElement("span");c.className="what",c.textContent=e.read(o.description)??"",a.append(c)}return a.addEventListener("click",()=>void this.start(o,t)),i.append(a),i}));const r=this.byId("new-menu"),s=this.byId("new").getBoundingClientRect();r.style.top=`${Math.round(s.bottom+6)}px`,r.style.right=`${Math.max(8,Math.round(window.innerWidth-s.right))}px`;try{r.showPopover?.()}catch{}}closeStarts(){const t=this.byId("new-menu");try{t.hidePopover?.()}catch{}}async showRecent(){const t=this.messages,e=await V.list();this.byId("recent").replaceChildren(...e.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.className="reopen";const l=document.createElement("span");l.className="name",l.textContent=o.name;const c=document.createElement("span");c.className="how";const m=new Date(o.openedAt).toLocaleString(this.language,{dateStyle:"medium",timeStyle:"short"}),p=o.kind==="address"?t?.recentAddress:o.kind==="handles"?t?.recentHandles:t?.recentCopy;c.textContent=`${m} · ${p??""}`,a.title=o.kind==="address"?o.url:o.name,a.append(l,c),a.addEventListener("click",()=>void this.reopen(o));const f=document.createElement("button");return f.type="button",f.className="remove",f.textContent="×",f.title=t?.recentRemove??"",f.setAttribute("aria-label",t?.recentRemove??""),f.addEventListener("click",()=>void V.remove(o).then(()=>this.showRecent())),i.append(a,f),i}));const s=this.byId("recent-none");s.hidden=e.length>0}placeMenu(){const t=this.byId("open").getBoundingClientRect(),e=this.byId("open-menu");e.style.top=`${Math.round(t.bottom+6)}px`,e.style.right=`${Math.max(8,Math.round(window.innerWidth-t.right))}px`}closeMenu(){const t=this.byId("open-menu");try{t.hidePopover?.()}catch{}}say(t,e="info"){const r=this.byId("status");q.show(r,t,e)}language="en";localeLoaded=Promise.resolve();async loadLocale(){this.language=Ts(le.preferencesFor(this),Is);const t=this.messages=await Fs(this.language);this.byId("label-new").textContent=t.newFile,this.byId("new").title=t.newFileHint,this.byId("label-open").textContent=t.open,this.byId("open").title=t.openHint,this.byId("open-together").textContent=t.openTogether,this.byId("recent-heading").textContent=t.recentHeading,this.byId("recent-none").textContent=t.recentNone,this.byId("open-file").messages=t,this.byId("template-file").messages=t,this.byId("template-heading").textContent=t.templateHeading,this.byId("template-hint").textContent=t.templateLoadHint,this.byId("template-forget").textContent=t.templateForget}byId(t){return this.shadow.getElementById(t)}}function Ys(){customElements.get(Jr)||customElements.define(Jr,Z)}Ys();export{X as $,gn as A,co as B,z as C,lo as D,wn as E,ht as F,po as G,le as H,J as I,no as J,ao as K,I as L,N as M,K as N,F as O,j as P,O as Q,Xs as R,W as S,x as T,Is as U,pe as V,Qs as W,he as X,ho as Y,so as Z,d as _,fe as a,As as a0,go as a1,Js as a2,Zs as a3,to as a4,eo as a5,ro as a6,oo as b,uo as c,wo as d,mo as e,yo as f,A as g,ve as h,q as i,tn as j,Q as k,io as l,Fe as m,bn as n,It as o,rn as p,_ as q,nn as r,Ts as s,$e as t,Gs as u,xe as v,Pe as w,yn as x,L as y,fo as z};
|
|
188
|
+
`;class Z extends HTMLElement{switcher=new Pe(t=>this.append(t),void 0,t=>this.dispatchEvent(new CustomEvent(yn,{detail:t,bubbles:!0,composed:!0})));shadow;messages;started=!1;constructor(){super(),nn(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.innerHTML=Ws,this.byId("new").addEventListener("click",()=>void this.startNew()),this.byId("open").addEventListener("click",()=>{this.placeMenu(),this.showRecent(),this.showTemplate()}),this.byId("open-file").addEventListener("filepick",t=>{this.closeMenu(),this.openPick(t.detail)}),this.byId("template-file").addEventListener("filepick",t=>void this.keepTemplate(t.detail)),this.byId("template-forget").addEventListener("click",()=>void this.forgetTemplate())}connectedCallback(){if(window.addEventListener("resize",this.fitHeight),this.fitHeight(),this.started)return;this.started=!0,this.localeLoaded=this.loadLocale();const t=this.getAttribute("src")??void 0,e=this.getAttribute("track")??void 0,r=t&&this.getAttribute("mode")!=="edit"?this.switcher.read({src:t,...e?{track:e}:{}}):this.switcher.edit({...t?{src:t}:{},...e?{track:e}:{}});this.ready=r.catch(()=>this.say(this.messages?.openFailed,"error")),this.loadKeptTemplate(),t||this.ready.then(()=>this.startUnderTemplate()),this.ready.then(this.fitHeight)}disconnectedCallback(){window.removeEventListener("resize",this.fitHeight)}fitHeight=()=>{const t=this.byId("open").closest(".bar").getBoundingClientRect().bottom+window.scrollY;this.style.setProperty("--rr0-editor-height",`calc(100dvh - ${Math.round(t+12)}px)`)};ready=Promise.resolve();async openFiles(t,e){const r=(await Promise.all(t.map(async i=>{const a=await Z.textOf(i);try{return{name:i.name,text:a,json:JSON.parse(a)}}catch{return}}))).filter(i=>i!==void 0);if(r.length===0){this.say(this.messages?.noJson,"warning");return}const s=F.localBase();F.hold(new Map(r.map(i=>[new URL(i.name,s).href,{json:i.json,changed:!1,local:!0}])));const o=r.find(i=>z.isCase(i.json))??r[0];this.say(void 0),await this.switcher.open(new URL(o.name,s).href),await V.add(e&&e.length?{kind:"handles",name:o.name,openedAt:Date.now(),handles:e}:{kind:"copy",name:o.name,openedAt:Date.now(),copies:r.map(({name:i,text:a})=>({name:i,text:a}))})}static textOf(t){return new Promise((e,r)=>{const s=new FileReader;s.onload=()=>e(s.result),s.onerror=()=>r(s.error),s.readAsText(t)})}async openAddress(t){const e=new URL(t,location.href).href;this.say(void 0),await this.switcher.open(e),await V.add({kind:"address",name:decodeURIComponent(new URL(e).pathname.split("/").pop()||e),openedAt:Date.now(),url:e})}async openPick(t){try{t.url!==void 0?await this.openAddress(t.url):await this.openFiles(t.files??[t.file],t.handles)}catch{this.say(this.messages?.openFailed,"error")}}async reopen(t){this.closeMenu();try{t.kind==="address"?await this.openAddress(t.url):await this.openFiles(await V.files(t),t.kind==="handles"?t.handles:void 0)}catch{this.say(this.messages?.openFailed,"error")}}async startNew(){let t;try{t=await this.template()}catch{this.say(this.messages?.caseTemplateFailed,"error");return}if(!t)return this.switcher.startNew();this.say(void 0),await this.offer(t)}async template(){const t=U.read();if(t)return t;const e=this.getAttribute("case-template");return e?L.load(e):void 0}async offer(t){await L.install(t);const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([59,25,4]),import.meta.url);if(e.shared.require(t.modules,t.url,Z.runsScripts(t)),t.starts.length===1)return this.start(t.starts[0],t);this.showStarts(t)}async startUnderTemplate(){let t;try{t=await this.template()}catch{this.say(this.messages?.caseTemplateFailed,"error");return}t&&await this.offer(t)}async start(t,e){if(this.closeStarts(),t.modules?.length){const{ModuleSession:r}=await d(async()=>{const{ModuleSession:s}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:s}},__vite__mapDeps([59,25,4]),import.meta.url);await r.shared.require(t.modules,void 0,e?Z.runsScripts(e):!0)}await this.switcher.startNew(t)}static runsScripts(t){return t.origin==="page"||Z.moduleUrls(t).every(e=>I.granted(e))}static moduleUrls(t){return[...new Set([...t.modules??[],...t.starts.flatMap(e=>e.modules??[])])]}async loadKeptTemplate(){const t=U.read();if(!t||(await L.install(t).catch(()=>{}),!t.modules?.length))return;const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([59,25,4]),import.meta.url);e.shared.require(t.modules,t.url,Z.runsScripts(t))}async forgetTemplate(){const t=U.read();if(U.forget(),t){const{ModuleSession:e}=await d(async()=>{const{ModuleSession:r}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:r}},__vite__mapDeps([59,25,4]),import.meta.url);I.revokeUnused(Z.moduleUrls(t),e.shared.list().filter(r=>r.addedByPerson).map(r=>r.url))}await this.showTemplate()}async keepTemplate(t){await this.localeLoaded;const e=this.messages;let r;try{if(t.url!==void 0){const l=new URL(t.url,location.href).href,c=await fetch(l);if(!c.ok)throw new Error(`${l}: HTTP ${c.status}`);r=U.keep(await c.text(),decodeURIComponent(l.replace(/[?#].*$/,"").replace(/^.*\//,"")),void 0,l)}else r=U.keep(await Z.textOf(t.file),t.file.name)}catch{this.say(e?.caseTemplateFailed,"error"),await this.showTemplate();return}const s=Z.moduleUrls(r),o=s.length>0&&await As.ask(this.shadow,e,s),a=new W(me.preferencesFor(this)).read(r.title)??r.id;if(this.say([e?.templateKept.replace("{title}",a),s.length===0?void 0:o?e?.templateModulesRun:e?.templateModulesWithoutScripts].filter(Boolean).join(" ")),await L.install(r).catch(()=>{}),s.length>0){const{ModuleSession:l}=await d(async()=>{const{ModuleSession:c}=await import("./ModuleSession-Dac4fD0X.js");return{ModuleSession:c}},__vite__mapDeps([59,25,4]),import.meta.url);l.shared.require(r.modules,r.url,o)}await this.showTemplate()}async showTemplate(){await this.localeLoaded;const t=this.messages;if(!t)return;const e=new W(me.preferencesFor(this));let r;try{r=await this.template()}catch{r=void 0}const s=r?e.read(r.title)??r.id:"";this.byId("template-now").textContent=r?r.origin==="file"?t.templateFromFile.replace("{title}",s).replace("{file}",r.fileName??""):r.origin==="address"?t.templateFromAddress.replace("{title}",s).replace("{url}",r.url):t.templateFromPage.replace("{title}",s):t.templateNone,this.byId("template-forget").hidden=r===void 0||r.origin==="page"}showStarts(t){const e=new W(me.preferencesFor(this));this.byId("starts-heading").textContent=e.read(t.title)??"",this.byId("starts").replaceChildren(...t.starts.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.dataset.start=o.id;const l=document.createElement("span");if(l.className="name",l.textContent=e.read(o.title)??"",a.append(l),o.description){const c=document.createElement("span");c.className="what",c.textContent=e.read(o.description)??"",a.append(c)}return a.addEventListener("click",()=>void this.start(o,t)),i.append(a),i}));const r=this.byId("new-menu"),s=this.byId("new").getBoundingClientRect();r.style.top=`${Math.round(s.bottom+6)}px`,r.style.right=`${Math.max(8,Math.round(window.innerWidth-s.right))}px`;try{r.showPopover?.()}catch{}}closeStarts(){const t=this.byId("new-menu");try{t.hidePopover?.()}catch{}}async showRecent(){const t=this.messages,e=await V.list();this.byId("recent").replaceChildren(...e.map(o=>{const i=document.createElement("li"),a=document.createElement("button");a.type="button",a.className="reopen";const l=document.createElement("span");l.className="name",l.textContent=o.name;const c=document.createElement("span");c.className="how";const m=new Date(o.openedAt).toLocaleString(this.language,{dateStyle:"medium",timeStyle:"short"}),p=o.kind==="address"?t?.recentAddress:o.kind==="handles"?t?.recentHandles:t?.recentCopy;c.textContent=`${m} · ${p??""}`,a.title=o.kind==="address"?o.url:o.name,a.append(l,c),a.addEventListener("click",()=>void this.reopen(o));const f=document.createElement("button");return f.type="button",f.className="remove",f.textContent="×",f.title=t?.recentRemove??"",f.setAttribute("aria-label",t?.recentRemove??""),f.addEventListener("click",()=>void V.remove(o).then(()=>this.showRecent())),i.append(a,f),i}));const s=this.byId("recent-none");s.hidden=e.length>0}placeMenu(){const t=this.byId("open").getBoundingClientRect(),e=this.byId("open-menu");e.style.top=`${Math.round(t.bottom+6)}px`,e.style.right=`${Math.max(8,Math.round(window.innerWidth-t.right))}px`}closeMenu(){const t=this.byId("open-menu");try{t.hidePopover?.()}catch{}}say(t,e="info"){const r=this.byId("status");q.show(r,t,e)}language="en";localeLoaded=Promise.resolve();async loadLocale(){this.language=Ts(me.preferencesFor(this),Is);const t=this.messages=await Fs(this.language);this.byId("label-new").textContent=t.newFile,this.byId("new").title=t.newFileHint,this.byId("label-open").textContent=t.open,this.byId("open").title=t.openHint,this.byId("open-together").textContent=t.openTogether,this.byId("recent-heading").textContent=t.recentHeading,this.byId("recent-none").textContent=t.recentNone,this.byId("open-file").messages=t,this.byId("template-file").messages=t,this.byId("template-heading").textContent=t.templateHeading,this.byId("template-hint").textContent=t.templateLoadHint,this.byId("template-forget").textContent=t.templateForget}byId(t){return this.shadow.getElementById(t)}}function Ys(){customElements.get(Jr)||customElements.define(Jr,Z)}Ys();export{X as $,gn as A,lo as B,z as C,mo as D,wn as E,ht as F,ho as G,me as H,J as I,so as J,uo as K,I as L,_ as M,K as N,F as O,j as P,O as Q,Xs as R,W as S,v as T,Is as U,he as V,Qs as W,fe as X,fo as Y,oo as Z,d as _,jt as a,As as a0,wo as a1,Js as a2,Zs as a3,to as a4,eo as a5,ro as a6,no as a7,io as b,co as c,yo as d,po as e,bo as f,A as g,xe as h,q as i,tn as j,Q as k,ao as l,Fe as m,bn as n,xt as o,rn as p,N as q,nn as r,Ts as s,$e as t,Gs as u,ve as v,Pe as w,yn as x,L as y,go as z};
|