@synnaxlabs/pluto 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Toggle-BNABJ5M2.js → Toggle-BZQSuhA3.js} +2 -2
- package/dist/{Toggle-BKrbt8lh.cjs → Toggle-D7uuc8BY.cjs} +1 -1
- package/dist/{Video-CgaO8bTm.cjs → Video-BgaQjOlJ.cjs} +1 -1
- package/dist/{Video-B4UWip-3.js → Video-Com7iIjJ.js} +2 -2
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/css-DA2F4zE4.cjs +8 -0
- package/dist/{css-BUXMI9PB.js → css-qKD7ZG81.js} +1450 -1285
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +72 -69
- package/dist/external-B3j4WcRx.js +42 -0
- package/dist/{external-BEkAplsH.cjs → external-BH7AW9vg.cjs} +1 -1
- package/dist/{external-_ninRYLQ.js → external-BHDJdA7E.js} +10 -10
- package/dist/external-BaO1j7U1.cjs +1 -0
- package/dist/external-BatQDwpn.cjs +1 -0
- package/dist/external-Bfddv9ir.cjs +1 -0
- package/dist/{external-DLo-151g.js → external-Bnn6kifu.js} +206 -206
- package/dist/external-BoMP9V9w.js +14 -0
- package/dist/{external-DTLy0px_.js → external-Bor2llbx.js} +62 -62
- package/dist/external-Bp0LGk7L.cjs +1 -0
- package/dist/{external-BKOEKFd7.js → external-C0EjmEmQ.js} +25 -25
- package/dist/{external-BSeWLcfY.js → external-CBwmQS9D.js} +137 -122
- package/dist/external-CV0q6V-F.js +87 -0
- package/dist/external-CaehDJtX.cjs +1 -0
- package/dist/external-DLIuO7_6.cjs +1 -0
- package/dist/{external-W69NXl-R.js → external-DO--52ul.js} +26 -26
- package/dist/external-DZ9ZLLOd.cjs +1 -0
- package/dist/external-JI_JLXE9.cjs +46 -0
- package/dist/{external-BOvnkwzO.js → external-KX4HsfeC.js} +12 -12
- package/dist/external-LuDrHOj0.js +89 -0
- package/dist/{external-CGX7u75x.js → external-ObqQM9Wz.js} +2 -2
- package/dist/external-R1DnhHJ8.cjs +1 -0
- package/dist/external-iLU86byd.cjs +1 -0
- package/dist/external-iTOHqKBf.js +23 -0
- package/dist/external-ok-onqCX.cjs +1 -0
- package/dist/external-qAqWNZPd.cjs +1 -0
- package/dist/flex.cjs +1 -1
- package/dist/flex.js +1 -1
- package/dist/fontString-BpD7ezh8.cjs +1 -0
- package/dist/{fontString-D_jEa-uI.js → fontString-DXsCV3Wx.js} +2 -2
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +35 -7
- package/dist/index.js +32678 -21392
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/jsx-runtime-Dszzpdy0.cjs +22 -0
- package/dist/{jsx-runtime-C5mzlN2N.js → jsx-runtime-OVHDjVDe.js} +14 -14
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/main-20msMsI6.cjs +92 -0
- package/dist/{main-jKCzbrWn.js → main-ClIRTLfC.js} +17685 -17077
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/pluto.css +1 -1
- package/dist/provider-D295Uocj.cjs +52 -0
- package/dist/provider-DVqod4rl.cjs +83 -0
- package/dist/provider-RFk778pl.js +18803 -0
- package/dist/provider-laSzOgag.js +4673 -0
- package/dist/src/arc/Arc.d.ts +6 -0
- package/dist/src/arc/Arc.d.ts.map +1 -0
- package/dist/src/arc/external.d.ts +4 -0
- package/dist/src/arc/external.d.ts.map +1 -0
- package/dist/src/arc/handle/Core.d.ts +8 -0
- package/dist/src/arc/handle/Core.d.ts.map +1 -0
- package/dist/src/arc/handle/Sink.d.ts +5 -0
- package/dist/src/arc/handle/Sink.d.ts.map +1 -0
- package/dist/src/arc/handle/Source.d.ts +5 -0
- package/dist/src/arc/handle/Source.d.ts.map +1 -0
- package/dist/src/arc/handle/external.d.ts +3 -0
- package/dist/src/arc/handle/external.d.ts.map +1 -0
- package/dist/src/arc/handle/index.d.ts +2 -0
- package/dist/src/arc/handle/index.d.ts.map +1 -0
- package/dist/src/arc/index.d.ts +2 -0
- package/dist/src/arc/index.d.ts.map +1 -0
- package/dist/src/arc/queries.d.ts +89 -0
- package/dist/src/arc/queries.d.ts.map +1 -0
- package/dist/src/arc/stage/Base.d.ts +32 -0
- package/dist/src/arc/stage/Base.d.ts.map +1 -0
- package/dist/src/arc/stage/constant/Constant.d.ts +9 -0
- package/dist/src/arc/stage/constant/Constant.d.ts.map +1 -0
- package/dist/src/arc/stage/constant/Form.d.ts +2 -0
- package/dist/src/arc/stage/constant/Form.d.ts.map +1 -0
- package/dist/src/arc/stage/constant/external.d.ts +3 -0
- package/dist/src/arc/stage/constant/external.d.ts.map +1 -0
- package/dist/src/arc/stage/constant/index.d.ts +2 -0
- package/dist/src/arc/stage/constant/index.d.ts.map +1 -0
- package/dist/src/arc/stage/external.d.ts +4 -0
- package/dist/src/arc/stage/external.d.ts.map +1 -0
- package/dist/src/arc/stage/index.d.ts +2 -0
- package/dist/src/arc/stage/index.d.ts.map +1 -0
- package/dist/src/arc/stage/operator/Operator.d.ts +17 -0
- package/dist/src/arc/stage/operator/Operator.d.ts.map +1 -0
- package/dist/src/arc/stage/operator/external.d.ts +242 -0
- package/dist/src/arc/stage/operator/external.d.ts.map +1 -0
- package/dist/src/arc/stage/operator/index.d.ts +2 -0
- package/dist/src/arc/stage/operator/index.d.ts.map +1 -0
- package/dist/src/arc/stage/read/Form.d.ts +3 -0
- package/dist/src/arc/stage/read/Form.d.ts.map +1 -0
- package/dist/src/arc/stage/read/Read.d.ts +10 -0
- package/dist/src/arc/stage/read/Read.d.ts.map +1 -0
- package/dist/src/arc/stage/read/external.d.ts +9 -0
- package/dist/src/arc/stage/read/external.d.ts.map +1 -0
- package/dist/src/arc/stage/read/index.d.ts +2 -0
- package/dist/src/arc/stage/read/index.d.ts.map +1 -0
- package/dist/src/arc/stage/registry.d.ts +11 -0
- package/dist/src/arc/stage/registry.d.ts.map +1 -0
- package/dist/src/arc/stage/select/Select.d.ts +2 -0
- package/dist/src/arc/stage/select/Select.d.ts.map +1 -0
- package/dist/src/arc/stage/select/external.d.ts +12 -0
- package/dist/src/arc/stage/select/external.d.ts.map +1 -0
- package/dist/src/arc/stage/select/index.d.ts +2 -0
- package/dist/src/arc/stage/select/index.d.ts.map +1 -0
- package/dist/src/arc/stage/source/Form.d.ts +3 -0
- package/dist/src/arc/stage/source/Form.d.ts.map +1 -0
- package/dist/src/arc/stage/source/Source.d.ts +10 -0
- package/dist/src/arc/stage/source/Source.d.ts.map +1 -0
- package/dist/src/arc/stage/source/external.d.ts +9 -0
- package/dist/src/arc/stage/source/external.d.ts.map +1 -0
- package/dist/src/arc/stage/source/index.d.ts +2 -0
- package/dist/src/arc/stage/source/index.d.ts.map +1 -0
- package/dist/src/arc/stage/stable/Form.d.ts +2 -0
- package/dist/src/arc/stage/stable/Form.d.ts.map +1 -0
- package/dist/src/arc/stage/stable/StableFor.d.ts +9 -0
- package/dist/src/arc/stage/stable/StableFor.d.ts.map +1 -0
- package/dist/src/arc/stage/stable/external.d.ts +3 -0
- package/dist/src/arc/stage/stable/external.d.ts.map +1 -0
- package/dist/src/arc/stage/stable/index.d.ts +2 -0
- package/dist/src/arc/stage/stable/index.d.ts.map +1 -0
- package/dist/src/arc/stage/status/Change.d.ts +21 -0
- package/dist/src/arc/stage/status/Change.d.ts.map +1 -0
- package/dist/src/arc/stage/status/Form.d.ts +3 -0
- package/dist/src/arc/stage/status/Form.d.ts.map +1 -0
- package/dist/src/arc/stage/status/external.d.ts +7 -0
- package/dist/src/arc/stage/status/external.d.ts.map +1 -0
- package/dist/src/arc/stage/status/index.d.ts +2 -0
- package/dist/src/arc/stage/status/index.d.ts.map +1 -0
- package/dist/src/arc/stage/types/index.d.ts +2 -0
- package/dist/src/arc/stage/types/index.d.ts.map +1 -0
- package/dist/src/arc/stage/types/spec.d.ts +25 -0
- package/dist/src/arc/stage/types/spec.d.ts.map +1 -0
- package/dist/src/button/color.d.ts +1 -2
- package/dist/src/button/color.d.ts.map +1 -1
- package/dist/src/channel/AliasInput.d.ts +3 -3
- package/dist/src/channel/AliasInput.d.ts.map +1 -1
- package/dist/src/channel/LinePlot.d.ts +4 -4
- package/dist/src/channel/LinePlot.d.ts.map +1 -1
- package/dist/src/channel/Select.d.ts +5 -5
- package/dist/src/channel/Select.d.ts.map +1 -1
- package/dist/src/channel/queries.d.ts +37 -70
- package/dist/src/channel/queries.d.ts.map +1 -1
- package/dist/src/css/bem.d.ts +1 -2
- package/dist/src/css/bem.d.ts.map +1 -1
- package/dist/src/dialog/Frame.d.ts.map +1 -1
- package/dist/src/divider/Divider.d.ts +1 -1
- package/dist/src/divider/Divider.d.ts.map +1 -1
- package/dist/src/ether.d.ts +2 -2
- package/dist/src/ether.d.ts.map +1 -1
- package/dist/src/flux/Provider.d.ts.map +1 -1
- package/dist/src/flux/aether/external.d.ts +1 -1
- package/dist/src/flux/aether/external.d.ts.map +1 -1
- package/dist/src/flux/aether/provider.d.ts +1 -1
- package/dist/src/flux/aether/provider.d.ts.map +1 -1
- package/dist/src/flux/core/external.d.ts +1 -0
- package/dist/src/flux/core/external.d.ts.map +1 -1
- package/dist/src/flux/core/store.d.ts +19 -13
- package/dist/src/flux/core/store.d.ts.map +1 -1
- package/dist/src/flux/core/streamer.d.ts +1 -1
- package/dist/src/flux/core/streamer.d.ts.map +1 -1
- package/dist/src/flux/core/types.d.ts +42 -0
- package/dist/src/flux/core/types.d.ts.map +1 -0
- package/dist/src/flux/external.d.ts +1 -1
- package/dist/src/flux/external.d.ts.map +1 -1
- package/dist/src/flux/form.d.ts +29 -127
- package/dist/src/flux/form.d.ts.map +1 -1
- package/dist/src/flux/list.d.ts +28 -228
- package/dist/src/flux/list.d.ts.map +1 -1
- package/dist/src/flux/result.d.ts +32 -90
- package/dist/src/flux/result.d.ts.map +1 -1
- package/dist/src/flux/retrieve.d.ts +47 -176
- package/dist/src/flux/retrieve.d.ts.map +1 -1
- package/dist/src/flux/update.d.ts +45 -134
- package/dist/src/flux/update.d.ts.map +1 -1
- package/dist/src/form/Context.d.ts +2 -2
- package/dist/src/form/Context.d.ts.map +1 -1
- package/dist/src/form/Context.spec.d.ts +2 -0
- package/dist/src/form/Context.spec.d.ts.map +1 -0
- package/dist/src/group/queries.d.ts +18 -18
- package/dist/src/group/queries.d.ts.map +1 -1
- package/dist/src/hardware/device/Select.d.ts +2 -2
- package/dist/src/hardware/device/Select.d.ts.map +1 -1
- package/dist/src/hardware/device/queries.d.ts +369 -9
- package/dist/src/hardware/device/queries.d.ts.map +1 -1
- package/dist/src/hardware/rack/Select.d.ts +3 -3
- package/dist/src/hardware/rack/Select.d.ts.map +1 -1
- package/dist/src/hardware/rack/queries.d.ts +15 -11
- package/dist/src/hardware/rack/queries.d.ts.map +1 -1
- package/dist/src/hardware/task/queries.d.ts +70 -17
- package/dist/src/hardware/task/queries.d.ts.map +1 -1
- package/dist/src/hooks/useRequiredContext.d.ts.map +1 -1
- package/dist/src/hooks/useRequiredContext.spec.d.ts +2 -0
- package/dist/src/hooks/useRequiredContext.spec.d.ts.map +1 -0
- package/dist/src/icon/Modbus.d.ts +2 -0
- package/dist/src/icon/Modbus.d.ts.map +1 -0
- package/dist/src/icon/registry.d.ts +16 -3
- package/dist/src/icon/registry.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/Boolean.d.ts +3 -2
- package/dist/src/input/Boolean.d.ts.map +1 -1
- package/dist/src/input/Checkbox.d.ts +2 -3
- package/dist/src/input/Checkbox.d.ts.map +1 -1
- package/dist/src/input/DateTime.d.ts +1 -18
- package/dist/src/input/DateTime.d.ts.map +1 -1
- package/dist/src/input/Switch.d.ts +2 -3
- package/dist/src/input/Switch.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts +2 -1
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/input/external.d.ts +0 -1
- package/dist/src/input/external.d.ts.map +1 -1
- package/dist/src/label/Select.d.ts +5 -5
- package/dist/src/label/Select.d.ts.map +1 -1
- package/dist/src/label/queries.d.ts +35 -20
- package/dist/src/label/queries.d.ts.map +1 -1
- package/dist/src/{vis/lineplot → lineplot}/Axis.d.ts +3 -3
- package/dist/src/lineplot/Axis.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/Legend.d.ts +1 -1
- package/dist/src/lineplot/Legend.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/Line.d.ts +2 -2
- package/dist/src/lineplot/Line.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/LinePlot.d.ts +3 -3
- package/dist/src/lineplot/LinePlot.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/Title.d.ts +1 -1
- package/dist/src/lineplot/Title.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/Viewport.d.ts +1 -1
- package/dist/src/lineplot/Viewport.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/aether/BoundQuerier.d.ts +1 -1
- package/dist/src/lineplot/aether/BoundQuerier.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/aether/LinePlot.d.ts +5 -5
- package/dist/src/lineplot/aether/LinePlot.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/aether/XAxis.d.ts +3 -3
- package/dist/src/lineplot/aether/XAxis.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/aether/YAxis.d.ts +2 -2
- package/dist/src/lineplot/aether/YAxis.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/aether/axis.d.ts +6 -6
- package/dist/src/lineplot/aether/axis.d.ts.map +1 -0
- package/dist/src/lineplot/aether/external.d.ts.map +1 -0
- package/dist/src/lineplot/aether/index.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/external.d.ts +1 -0
- package/dist/src/lineplot/external.d.ts.map +1 -0
- package/dist/src/lineplot/index.d.ts.map +1 -0
- package/dist/src/lineplot/queries.d.ts +33 -0
- package/dist/src/lineplot/queries.d.ts.map +1 -0
- package/dist/src/lineplot/queries.spec.d.ts +2 -0
- package/dist/src/lineplot/queries.spec.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/range/Annotation.d.ts +1 -1
- package/dist/src/lineplot/range/Annotation.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/range/Provider.d.ts +2 -2
- package/dist/src/lineplot/range/Provider.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/range/aether/annotation.d.ts +3 -3
- package/dist/src/lineplot/range/aether/annotation.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/range/aether/external.d.ts +1 -1
- package/dist/src/lineplot/range/aether/external.d.ts.map +1 -0
- package/dist/src/lineplot/range/aether/index.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/range/aether/provider.d.ts +10 -10
- package/dist/src/lineplot/range/aether/provider.d.ts.map +1 -0
- package/dist/src/lineplot/range/external.d.ts.map +1 -0
- package/dist/src/lineplot/range/index.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/tooltip/Tooltip.d.ts +1 -1
- package/dist/src/lineplot/tooltip/Tooltip.d.ts.map +1 -0
- package/dist/src/lineplot/tooltip/aether/index.d.ts.map +1 -0
- package/dist/src/{vis/lineplot → lineplot}/tooltip/aether/tooltip.d.ts +4 -4
- package/dist/src/lineplot/tooltip/aether/tooltip.d.ts.map +1 -0
- package/dist/src/lineplot/tooltip/index.d.ts.map +1 -0
- package/dist/src/lineplot/useBoundQuerier.d.ts.map +1 -0
- package/dist/src/list/Frame.d.ts +16 -1
- package/dist/src/list/Frame.d.ts.map +1 -1
- package/dist/src/list/pager.d.ts +7 -1
- package/dist/src/list/pager.d.ts.map +1 -1
- package/dist/src/list/useCombinedData.d.ts.map +1 -1
- package/dist/src/list/useKeysData.d.ts.map +1 -1
- package/dist/src/list/useMapData.d.ts.map +1 -1
- package/dist/src/list/useStaticData.d.ts.map +1 -1
- package/dist/src/{vis/log → log}/Log.d.ts +2 -2
- package/dist/src/log/Log.d.ts.map +1 -0
- package/dist/src/{vis/log → log}/aether/Log.d.ts +4 -4
- package/dist/src/log/aether/Log.d.ts.map +1 -0
- package/dist/src/log/aether/index.d.ts.map +1 -0
- package/dist/src/log/external.d.ts +3 -0
- package/dist/src/log/external.d.ts.map +1 -0
- package/dist/src/log/index.d.ts +2 -0
- package/dist/src/log/index.d.ts.map +1 -0
- package/dist/src/log/queries.d.ts +33 -0
- package/dist/src/log/queries.d.ts.map +1 -0
- package/dist/src/log/queries.spec.d.ts +2 -0
- package/dist/src/log/queries.spec.d.ts.map +1 -0
- package/dist/src/menu/ContextMenu.d.ts.map +1 -1
- package/dist/src/ontology/aether/index.d.ts +2 -0
- package/dist/src/ontology/aether/index.d.ts.map +1 -0
- package/dist/src/ontology/aether/queries.d.ts +15 -0
- package/dist/src/ontology/aether/queries.d.ts.map +1 -0
- package/dist/src/ontology/external.d.ts +1 -0
- package/dist/src/ontology/external.d.ts.map +1 -1
- package/dist/src/ontology/queries.d.ts +27 -23
- package/dist/src/ontology/queries.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts +13 -0
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
- package/dist/src/ranger/Breadcrumb.d.ts +3 -1
- package/dist/src/ranger/Breadcrumb.d.ts.map +1 -1
- package/dist/src/ranger/CreateIcon.d.ts +3 -0
- package/dist/src/ranger/CreateIcon.d.ts.map +1 -0
- package/dist/src/ranger/Select.d.ts +4 -14
- package/dist/src/ranger/Select.d.ts.map +1 -1
- package/dist/src/ranger/SelectStage.d.ts +7 -0
- package/dist/src/ranger/SelectStage.d.ts.map +1 -0
- package/dist/src/ranger/StageIcon.d.ts +8 -0
- package/dist/src/ranger/StageIcon.d.ts.map +1 -0
- package/dist/src/ranger/aether/index.d.ts.map +1 -1
- package/dist/src/ranger/aether/queries.d.ts +2 -2
- package/dist/src/ranger/aether/queries.d.ts.map +1 -1
- package/dist/src/ranger/external.d.ts +5 -1
- package/dist/src/ranger/external.d.ts.map +1 -1
- package/dist/src/ranger/queries.d.ts +41 -41
- package/dist/src/ranger/queries.d.ts.map +1 -1
- package/dist/src/ranger/stage.d.ts +20 -0
- package/dist/src/ranger/stage.d.ts.map +1 -0
- package/dist/src/ranger/stage.spec.d.ts +2 -0
- package/dist/src/ranger/stage.spec.d.ts.map +1 -0
- package/dist/src/resize/Core.d.ts.map +1 -1
- package/dist/src/schematic/Schematic.d.ts +6 -0
- package/dist/src/schematic/Schematic.d.ts.map +1 -0
- package/dist/src/schematic/edge/Edge.d.ts +15 -0
- package/dist/src/schematic/edge/Edge.d.ts.map +1 -0
- package/dist/src/schematic/edge/connector/connector.d.ts.map +1 -0
- package/dist/src/schematic/edge/connector/connector.spec.d.ts.map +1 -0
- package/dist/src/schematic/edge/connector/index.d.ts.map +1 -0
- package/dist/src/schematic/edge/index.d.ts +3 -0
- package/dist/src/schematic/edge/index.d.ts.map +1 -0
- package/dist/src/schematic/edge/paths.d.ts +28 -0
- package/dist/src/schematic/edge/paths.d.ts.map +1 -0
- package/dist/src/schematic/external.d.ts +3 -0
- package/dist/src/schematic/external.d.ts.map +1 -1
- package/dist/src/schematic/queries.d.ts +43 -0
- package/dist/src/schematic/queries.d.ts.map +1 -0
- package/dist/src/schematic/queries.spec.d.ts +2 -0
- package/dist/src/schematic/queries.spec.d.ts.map +1 -0
- package/dist/src/schematic/symbol/Custom.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Forms.d.ts +1 -0
- package/dist/src/schematic/symbol/Forms.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Primitives.d.ts +1 -1
- package/dist/src/schematic/symbol/Primitives.d.ts.map +1 -1
- package/dist/src/schematic/symbol/Symbols.d.ts +11 -1
- package/dist/src/schematic/symbol/Symbols.d.ts.map +1 -1
- package/dist/src/schematic/symbol/queries.d.ts +20 -19
- package/dist/src/schematic/symbol/queries.d.ts.map +1 -1
- package/dist/src/schematic/symbol/registry.d.ts +2 -1
- package/dist/src/schematic/symbol/registry.d.ts.map +1 -1
- package/dist/src/select/Dialog.d.ts +1 -1
- package/dist/src/select/Dialog.d.ts.map +1 -1
- package/dist/src/select/Frame.d.ts +4 -1
- package/dist/src/select/Frame.d.ts.map +1 -1
- package/dist/src/select/ListItem.d.ts.map +1 -1
- package/dist/src/select/MultipleTrigger.d.ts +5 -2
- package/dist/src/select/MultipleTrigger.d.ts.map +1 -1
- package/dist/src/showcase/DividerShowcase.d.ts.map +1 -1
- package/dist/src/showcase/InputShowcase.d.ts +1 -1
- package/dist/src/showcase/InputShowcase.d.ts.map +1 -1
- package/dist/src/showcase/SelectShowcase.d.ts.map +1 -1
- package/dist/src/showcase/TagShowcase.d.ts.map +1 -1
- package/dist/src/state/state.d.ts +2 -1
- package/dist/src/state/state.d.ts.map +1 -1
- package/dist/src/status/CreateIcon.d.ts +1 -0
- package/dist/src/status/CreateIcon.d.ts.map +1 -0
- package/dist/src/status/Select.d.ts +12 -0
- package/dist/src/status/Select.d.ts.map +1 -0
- package/dist/src/status/SelectVariant.d.ts +7 -0
- package/dist/src/status/SelectVariant.d.ts.map +1 -0
- package/dist/src/status/aether/aggregator.d.ts +3 -25
- package/dist/src/status/aether/aggregator.d.ts.map +1 -1
- package/dist/src/status/aether/errorHandler.d.ts +1 -1
- package/dist/src/status/aether/errorHandler.d.ts.map +1 -1
- package/dist/src/status/{Aggregator.d.ts → core/Aggregator.d.ts} +4 -4
- package/dist/src/status/core/Aggregator.d.ts.map +1 -0
- package/dist/src/status/core/Aggregator.spec.d.ts.map +1 -0
- package/dist/src/status/core/CreateIcon.d.ts +3 -0
- package/dist/src/status/core/CreateIcon.d.ts.map +1 -0
- package/dist/src/status/{Indicator.d.ts → core/Indicator.d.ts} +1 -1
- package/dist/src/status/core/Indicator.d.ts.map +1 -0
- package/dist/src/status/{Notification.d.ts → core/Notification.d.ts} +3 -3
- package/dist/src/status/core/Notification.d.ts.map +1 -0
- package/dist/src/status/core/Notification.spec.d.ts.map +1 -0
- package/dist/src/status/core/SelectVariant.d.ts +7 -0
- package/dist/src/status/core/SelectVariant.d.ts.map +1 -0
- package/dist/src/status/core/Summary.d.ts +12 -0
- package/dist/src/status/core/Summary.d.ts.map +1 -0
- package/dist/src/status/core/colors.d.ts.map +1 -0
- package/dist/src/status/core/external.d.ts +8 -0
- package/dist/src/status/core/external.d.ts.map +1 -0
- package/dist/src/status/core/index.d.ts +2 -0
- package/dist/src/status/core/index.d.ts.map +1 -0
- package/dist/src/status/external.d.ts +3 -5
- package/dist/src/status/external.d.ts.map +1 -1
- package/dist/src/status/index.d.ts.map +1 -1
- package/dist/src/status/queries.d.ts +64 -0
- package/dist/src/status/queries.d.ts.map +1 -0
- package/dist/src/status/queries.spec.d.ts +2 -0
- package/dist/src/status/queries.spec.d.ts.map +1 -0
- package/dist/src/synnax/Provider.d.ts +8 -5
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/table/external.d.ts +1 -0
- package/dist/src/table/external.d.ts.map +1 -1
- package/dist/src/table/queries.d.ts +35 -0
- package/dist/src/table/queries.d.ts.map +1 -0
- package/dist/src/table/queries.spec.d.ts +2 -0
- package/dist/src/table/queries.spec.d.ts.map +1 -0
- package/dist/src/tag/Tags.d.ts +1 -1
- package/dist/src/tag/Tags.d.ts.map +1 -1
- package/dist/src/telem/aether/noop.d.ts.map +1 -1
- package/dist/src/telem/aether/remote.d.ts +4 -4
- package/dist/src/telem/aether/telem.d.ts +1 -1
- package/dist/src/telem/aether/telem.d.ts.map +1 -1
- package/dist/src/telem/client/streamer.d.ts +1 -0
- package/dist/src/telem/client/streamer.d.ts.map +1 -1
- package/dist/src/telem/control/Chip.d.ts.map +1 -1
- package/dist/src/telem/control/aether/chip.d.ts +9 -32
- package/dist/src/telem/control/aether/chip.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/telem/control/aether/indicator.d.ts +15 -38
- package/dist/src/telem/control/aether/indicator.d.ts.map +1 -1
- package/dist/src/telem/external.d.ts +1 -0
- package/dist/src/telem/external.d.ts.map +1 -1
- package/dist/src/telem/text/TimeRange.d.ts +10 -0
- package/dist/src/telem/text/TimeRange.d.ts.map +1 -0
- package/dist/src/telem/text/TimeRange.spec.d.ts +2 -0
- package/dist/src/telem/text/TimeRange.spec.d.ts.map +1 -0
- package/dist/src/telem/text/TimeSpan.d.ts +10 -0
- package/dist/src/telem/text/TimeSpan.d.ts.map +1 -0
- package/dist/src/telem/text/TimeSpan.spec.d.ts +2 -0
- package/dist/src/telem/text/TimeSpan.spec.d.ts.map +1 -0
- package/dist/src/telem/text/TimeSpanSince.d.ts +11 -0
- package/dist/src/telem/text/TimeSpanSince.d.ts.map +1 -0
- package/dist/src/telem/text/TimeStamp.d.ts +12 -0
- package/dist/src/telem/text/TimeStamp.d.ts.map +1 -0
- package/dist/src/telem/text/TimeStamp.spec.d.ts +2 -0
- package/dist/src/telem/text/TimeStamp.spec.d.ts.map +1 -0
- package/dist/src/telem/text/external.d.ts +5 -0
- package/dist/src/telem/text/external.d.ts.map +1 -0
- package/dist/src/telem/text/index.d.ts +2 -0
- package/dist/src/telem/text/index.d.ts.map +1 -0
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/external.d.ts +0 -1
- package/dist/src/text/external.d.ts.map +1 -1
- package/dist/src/tooltip/Dialog.d.ts.map +1 -1
- package/dist/src/tree/Context.d.ts +13 -0
- package/dist/src/tree/Context.d.ts.map +1 -0
- package/dist/src/tree/Item.d.ts +2 -3
- package/dist/src/tree/Item.d.ts.map +1 -1
- package/dist/src/tree/Tree.d.ts +2 -2
- package/dist/src/tree/Tree.d.ts.map +1 -1
- package/dist/src/tree/core.d.ts +2 -1
- package/dist/src/tree/core.d.ts.map +1 -1
- package/dist/src/tree/core.spec.d.ts +2 -0
- package/dist/src/tree/core.spec.d.ts.map +1 -0
- package/dist/src/user/index.d.ts +2 -0
- package/dist/src/user/index.d.ts.map +1 -0
- package/dist/src/user/queries.d.ts +50 -0
- package/dist/src/user/queries.d.ts.map +1 -0
- package/dist/src/user/queries.spec.d.ts +2 -0
- package/dist/src/user/queries.spec.d.ts.map +1 -0
- package/dist/src/viewport/use.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +16 -4
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/types.d.ts +6 -49
- package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
- package/dist/src/vis/diagram/external.d.ts +1 -1
- package/dist/src/vis/diagram/external.d.ts.map +1 -1
- package/dist/src/vis/diagram/useTriggers.d.ts +12 -0
- package/dist/src/vis/diagram/useTriggers.d.ts.map +1 -0
- package/dist/src/vis/diagram/util.d.ts +2 -0
- package/dist/src/vis/diagram/util.d.ts.map +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
- package/dist/src/vis/draw2d/index.d.ts +16 -6
- package/dist/src/vis/draw2d/index.d.ts.map +1 -1
- package/dist/src/vis/gauge/aether/gauge.d.ts +297 -0
- package/dist/src/vis/gauge/aether/gauge.d.ts.map +1 -0
- package/dist/src/vis/gauge/aether/index.d.ts +2 -0
- package/dist/src/vis/gauge/aether/index.d.ts.map +1 -0
- package/dist/src/vis/gauge/index.d.ts +2 -0
- package/dist/src/vis/gauge/index.d.ts.map +1 -0
- package/dist/src/vis/gauge/use.d.ts +84 -0
- package/dist/src/vis/gauge/use.d.ts.map +1 -0
- package/dist/src/vis/text/atlas.d.ts.map +1 -1
- package/dist/src/vis/value/TelemForm.d.ts.map +1 -1
- package/dist/src/workspace/queries.d.ts +37 -4
- package/dist/src/workspace/queries.d.ts.map +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theme.css +1593 -1594
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/units-CLbZ5ejs.cjs +1 -0
- package/dist/{units-BPvO622s.js → units-WtYBE1br.js} +1 -1
- package/dist/useKeysData-DXXVQfXZ.js +18 -0
- package/dist/useKeysData-Do63LaI0.cjs +1 -0
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +20 -20
- package/README.md +0 -35
- package/dist/Animated-B9bcEALW.js +0 -27
- package/dist/Animated-EQN_Zecr.cjs +0 -1
- package/dist/LinePlot-82qQ7-BC.js +0 -6263
- package/dist/LinePlot-Do2q5AyX.cjs +0 -53
- package/dist/css-CmXY6iPo.cjs +0 -8
- package/dist/eraser-C1jjA5cv.cjs +0 -63
- package/dist/eraser-DXDDmPgV.js +0 -14108
- package/dist/external-5DC2xiKR.cjs +0 -1
- package/dist/external-65blLb4-.js +0 -42
- package/dist/external-B8KPEzPt.cjs +0 -1
- package/dist/external-BIykXq97.cjs +0 -1
- package/dist/external-Bqmws2bv.cjs +0 -1
- package/dist/external-CFsDBQGs.cjs +0 -1
- package/dist/external-CJKfUQ-9.cjs +0 -1
- package/dist/external-CPW2TrSs.js +0 -124
- package/dist/external-CijGOPm7.cjs +0 -1
- package/dist/external-DCQ725nK.cjs +0 -1
- package/dist/external-DWfn7Yhk.cjs +0 -1
- package/dist/external-DcNW5o-8.cjs +0 -1
- package/dist/external-Gh_0tAJ0.js +0 -24
- package/dist/external-J1Ji-Eku.js +0 -92
- package/dist/external-SQa3Pr0s.js +0 -44
- package/dist/external-kaUzEm1U.cjs +0 -46
- package/dist/external-mOr1FzAd.cjs +0 -1
- package/dist/fontString-4EFXWlQp.cjs +0 -1
- package/dist/jsx-runtime-CITbqOLs.cjs +0 -22
- package/dist/main-2qH2bggR.cjs +0 -92
- package/dist/src/flux/core/params.d.ts +0 -31
- package/dist/src/flux/core/params.d.ts.map +0 -1
- package/dist/src/input/TextArea.d.ts +0 -25
- package/dist/src/input/TextArea.d.ts.map +0 -1
- package/dist/src/ranger/TimeRangeChip.d.ts +0 -10
- package/dist/src/ranger/TimeRangeChip.d.ts.map +0 -1
- package/dist/src/status/Aggregator.d.ts.map +0 -1
- package/dist/src/status/Aggregator.spec.d.ts.map +0 -1
- package/dist/src/status/Indicator.d.ts.map +0 -1
- package/dist/src/status/Notification.d.ts.map +0 -1
- package/dist/src/status/Notification.spec.d.ts.map +0 -1
- package/dist/src/status/Summary.d.ts +0 -8
- package/dist/src/status/Summary.d.ts.map +0 -1
- package/dist/src/status/colors.d.ts.map +0 -1
- package/dist/src/text/DateTime.d.ts +0 -12
- package/dist/src/text/DateTime.d.ts.map +0 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts +0 -15
- package/dist/src/vis/diagram/edge/Edge.d.ts.map +0 -1
- package/dist/src/vis/diagram/edge/connector/connector.d.ts.map +0 -1
- package/dist/src/vis/diagram/edge/connector/connector.spec.d.ts.map +0 -1
- package/dist/src/vis/diagram/edge/connector/index.d.ts.map +0 -1
- package/dist/src/vis/diagram/edge/index.d.ts +0 -2
- package/dist/src/vis/diagram/edge/index.d.ts.map +0 -1
- package/dist/src/vis/diagram/edge/paths.d.ts +0 -18
- package/dist/src/vis/diagram/edge/paths.d.ts.map +0 -1
- package/dist/src/vis/lineplot/Axis.d.ts.map +0 -1
- package/dist/src/vis/lineplot/Legend.d.ts.map +0 -1
- package/dist/src/vis/lineplot/Line.d.ts.map +0 -1
- package/dist/src/vis/lineplot/LinePlot.d.ts.map +0 -1
- package/dist/src/vis/lineplot/Title.d.ts.map +0 -1
- package/dist/src/vis/lineplot/Viewport.d.ts.map +0 -1
- package/dist/src/vis/lineplot/aether/BoundQuerier.d.ts.map +0 -1
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts.map +0 -1
- package/dist/src/vis/lineplot/aether/XAxis.d.ts.map +0 -1
- package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +0 -1
- package/dist/src/vis/lineplot/aether/axis.d.ts.map +0 -1
- package/dist/src/vis/lineplot/aether/external.d.ts.map +0 -1
- package/dist/src/vis/lineplot/aether/index.d.ts.map +0 -1
- package/dist/src/vis/lineplot/external.d.ts.map +0 -1
- package/dist/src/vis/lineplot/index.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/Annotation.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/Provider.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/aether/annotation.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/aether/external.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/aether/index.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/aether/provider.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/external.d.ts.map +0 -1
- package/dist/src/vis/lineplot/range/index.d.ts.map +0 -1
- package/dist/src/vis/lineplot/tooltip/Tooltip.d.ts.map +0 -1
- package/dist/src/vis/lineplot/tooltip/aether/index.d.ts.map +0 -1
- package/dist/src/vis/lineplot/tooltip/aether/tooltip.d.ts.map +0 -1
- package/dist/src/vis/lineplot/tooltip/index.d.ts.map +0 -1
- package/dist/src/vis/lineplot/useBoundQuerier.d.ts.map +0 -1
- package/dist/src/vis/log/Log.d.ts.map +0 -1
- package/dist/src/vis/log/aether/Log.d.ts.map +0 -1
- package/dist/src/vis/log/aether/index.d.ts.map +0 -1
- package/dist/src/vis/log/index.d.ts +0 -2
- package/dist/src/vis/log/index.d.ts.map +0 -1
- package/dist/units-DkdMPsxa.cjs +0 -1
- package/dist/useKeysData-B1kiZOOw.js +0 -14
- package/dist/useKeysData-G9Mk3mA6.cjs +0 -1
- /package/dist/src/{vis/lineplot → lineplot}/aether/external.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/aether/index.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/index.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/range/aether/index.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/range/external.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/range/index.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/tooltip/aether/index.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/tooltip/index.d.ts +0 -0
- /package/dist/src/{vis/lineplot → lineplot}/useBoundQuerier.d.ts +0 -0
- /package/dist/src/{vis/log → log}/aether/index.d.ts +0 -0
- /package/dist/src/{vis/diagram → schematic}/edge/connector/connector.d.ts +0 -0
- /package/dist/src/{vis/diagram → schematic}/edge/connector/connector.spec.d.ts +0 -0
- /package/dist/src/{vis/diagram → schematic}/edge/connector/index.d.ts +0 -0
- /package/dist/src/status/{Aggregator.spec.d.ts → core/Aggregator.spec.d.ts} +0 -0
- /package/dist/src/status/{Notification.spec.d.ts → core/Notification.spec.d.ts} +0 -0
- /package/dist/src/status/{colors.d.ts → core/colors.d.ts} +0 -0
|
@@ -1,38 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import O, { z as a } from "zod";
|
|
2
|
+
const or = (t) => O.union([
|
|
3
|
+
O.union([O.null(), O.undefined()]).transform(() => []),
|
|
4
|
+
t.array()
|
|
5
|
+
]), Sn = (t) => Array.isArray(t) ? t : t == null ? [] : [t], ur = (t, e) => {
|
|
6
|
+
if (Array.isArray(e))
|
|
7
|
+
return e.reduce((s, i) => ur(s, i), t ?? []);
|
|
8
|
+
if (t == null) return [e];
|
|
9
|
+
const r = t.findIndex((s) => s == e), n = [...t];
|
|
10
|
+
return r === -1 ? n.push(e) : n[r] = e, n;
|
|
11
|
+
}, Nn = ((t, e) => {
|
|
12
|
+
if (t != null)
|
|
13
|
+
return Array.isArray(e) ? t.filter((r) => !e.includes(r)) : t.filter((r) => r != e);
|
|
14
|
+
}), lr = (t, e) => {
|
|
15
|
+
if (Array.isArray(e))
|
|
16
|
+
return e.reduce((s, i) => lr(s, i), t ?? []);
|
|
17
|
+
if (t == null) return [e];
|
|
18
|
+
const r = t.findIndex((s) => s.key === e.key), n = [...t];
|
|
19
|
+
return r === -1 ? n.push(e) : n[r] = e, n;
|
|
20
|
+
}, In = ((t, e) => {
|
|
21
|
+
if (t != null)
|
|
22
|
+
return Array.isArray(e) ? t.filter((r) => !e.includes(r.key)) : t.filter((r) => r.key !== e);
|
|
23
|
+
}), pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24
|
+
__proto__: null,
|
|
25
|
+
nullableZ: or,
|
|
26
|
+
remove: Nn,
|
|
27
|
+
removeKeyed: In,
|
|
28
|
+
toArray: Sn,
|
|
29
|
+
upsert: ur,
|
|
30
|
+
upsertKeyed: lr
|
|
31
|
+
}, Symbol.toStringTag, { value: "Module" })), Mn = (t) => {
|
|
3
32
|
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
4
33
|
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
5
|
-
},
|
|
6
|
-
const e = (r, n =
|
|
34
|
+
}, Ye = (t) => {
|
|
35
|
+
const e = (r, n = lt) => {
|
|
7
36
|
if (typeof r == "string") return t(r);
|
|
8
37
|
if (Array.isArray(r)) return r.map((o) => e(o, n));
|
|
9
|
-
if (!
|
|
10
|
-
n =
|
|
38
|
+
if (!rt(r)) return r;
|
|
39
|
+
n = Un(n);
|
|
11
40
|
const s = {}, i = r;
|
|
12
41
|
return "toJSON" in i && typeof i.toJSON == "function" ? e(i.toJSON(), n) : (Object.keys(i).forEach((o) => {
|
|
13
|
-
let
|
|
14
|
-
const
|
|
15
|
-
n.recursive && (
|
|
42
|
+
let h = i[o];
|
|
43
|
+
const f = t(o);
|
|
44
|
+
n.recursive && (rt(h) ? Qt(h) || (h = e(h, n)) : n.recursiveInArray && Kt(h) && (h = [...h].map((l) => {
|
|
16
45
|
let d = l;
|
|
17
|
-
return
|
|
18
|
-
}))), s[
|
|
46
|
+
return rt(l) ? Qt(d) || (d = e(l, n)) : Kt(l) && (d = e({ key: l }, n).key), d;
|
|
47
|
+
}))), s[f] = h;
|
|
19
48
|
}), s);
|
|
20
49
|
};
|
|
21
50
|
return e;
|
|
22
|
-
},
|
|
51
|
+
}, St = Ye(Mn), An = (t) => (
|
|
23
52
|
// Don't convert the first character and don't convert a character that is after a
|
|
24
53
|
// non-alphanumeric character
|
|
25
54
|
t.replace(
|
|
26
55
|
/([a-z0-9])([A-Z])/g,
|
|
27
56
|
(e, r, n) => `${r}_${n.toLowerCase()}`
|
|
28
57
|
)
|
|
29
|
-
),
|
|
58
|
+
), cr = Ye(An), hr = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), En = [Number, String, Uint8Array], lt = {
|
|
30
59
|
recursive: !0,
|
|
31
60
|
recursiveInArray: !0
|
|
32
|
-
},
|
|
61
|
+
}, Un = (t = lt) => (t.recursive == null ? t = lt : t.recursiveInArray ??= !1, t), Kt = (t) => t != null && Array.isArray(t), rt = (t) => t != null && typeof t == "object" && !Array.isArray(t), Qt = (t) => En.some((e) => t instanceof e), Bn = (t) => t.replace(/[\s_]+/g, "-").replace(
|
|
33
62
|
/([a-z0-9])([A-Z])/g,
|
|
34
63
|
(e, r, n) => `${r}-${n.toLowerCase()}`
|
|
35
|
-
).toLowerCase(),
|
|
64
|
+
).toLowerCase(), jn = Ye(Bn), Cn = (t) => {
|
|
36
65
|
if (t.length === 0) return t;
|
|
37
66
|
let e = t.replace(/[_-]/g, " ");
|
|
38
67
|
return e = e.replace(
|
|
@@ -42,15 +71,15 @@ const fn = (t) => {
|
|
|
42
71
|
/([A-Z]+)([A-Z][a-z])/g,
|
|
43
72
|
(r, n, s) => `${n} ${s}`
|
|
44
73
|
), e = e.replace(/\s+/g, " ").trim(), e = e.replace(/\b\w/g, (r) => r.toUpperCase()), e;
|
|
45
|
-
},
|
|
74
|
+
}, Rn = Ye(Cn), mu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
46
75
|
__proto__: null,
|
|
47
|
-
camelToSnake:
|
|
48
|
-
capitalize:
|
|
49
|
-
snakeToCamel:
|
|
50
|
-
toKebab:
|
|
51
|
-
toProperNoun:
|
|
76
|
+
camelToSnake: cr,
|
|
77
|
+
capitalize: hr,
|
|
78
|
+
snakeToCamel: St,
|
|
79
|
+
toKebab: jn,
|
|
80
|
+
toProperNoun: Rn
|
|
52
81
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
53
|
-
let
|
|
82
|
+
let Ln = class {
|
|
54
83
|
contentType = "application/json";
|
|
55
84
|
decoder;
|
|
56
85
|
encoder;
|
|
@@ -64,15 +93,15 @@ let On = class {
|
|
|
64
93
|
return this.decodeString(this.decoder.decode(e), r);
|
|
65
94
|
}
|
|
66
95
|
decodeString(e, r) {
|
|
67
|
-
const n = JSON.parse(e), s =
|
|
96
|
+
const n = JSON.parse(e), s = St(n);
|
|
68
97
|
return r != null ? r.parse(s) : s;
|
|
69
98
|
}
|
|
70
99
|
encodeString(e) {
|
|
71
|
-
const r =
|
|
100
|
+
const r = cr(e);
|
|
72
101
|
return JSON.stringify(r, (n, s) => ArrayBuffer.isView(s) ? Array.from(s) : typeof s == "bigint" ? s.toString() : s);
|
|
73
102
|
}
|
|
74
103
|
};
|
|
75
|
-
const
|
|
104
|
+
const ct = new Ln(), ht = (t) => [...new Set(t)], Dn = (t, e, r = !0) => {
|
|
76
105
|
const n = /* @__PURE__ */ new Map();
|
|
77
106
|
return t.forEach((s) => {
|
|
78
107
|
const i = e(s);
|
|
@@ -82,12 +111,12 @@ const st = new On(), it = (t) => [...new Set(t)], vn = (t, e, r = !0) => {
|
|
|
82
111
|
}
|
|
83
112
|
n.set(i, s);
|
|
84
113
|
}), Array.from(n.values());
|
|
85
|
-
},
|
|
114
|
+
}, bu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
86
115
|
__proto__: null,
|
|
87
|
-
by:
|
|
88
|
-
unique:
|
|
89
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
90
|
-
let
|
|
116
|
+
by: Dn,
|
|
117
|
+
unique: ht
|
|
118
|
+
}, Symbol.toStringTag, { value: "Module" })), B = (t) => t != null && typeof t == "object" && "value" in t;
|
|
119
|
+
let re = class {
|
|
91
120
|
/** The underlying primitive value */
|
|
92
121
|
value;
|
|
93
122
|
constructor(e) {
|
|
@@ -107,8 +136,8 @@ let ee = class {
|
|
|
107
136
|
return this.value.toString();
|
|
108
137
|
}
|
|
109
138
|
};
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
139
|
+
const Nt = (t) => t != null && typeof t == "object" && "toString" in t, fr = (t) => {
|
|
140
|
+
if (Nt(t)) return t?.toString().length === 0;
|
|
112
141
|
switch (typeof t) {
|
|
113
142
|
case "string":
|
|
114
143
|
return t.length === 0;
|
|
@@ -125,15 +154,15 @@ const Ot = (t) => t != null && typeof t == "object" && "toString" in t, er = (t)
|
|
|
125
154
|
default:
|
|
126
155
|
return !1;
|
|
127
156
|
}
|
|
128
|
-
},
|
|
157
|
+
}, Pn = (t) => !fr(t), $u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
129
158
|
__proto__: null,
|
|
130
|
-
ValueExtension:
|
|
131
|
-
isCrudeValueExtension:
|
|
132
|
-
isNonZero:
|
|
133
|
-
isStringer:
|
|
134
|
-
isZero:
|
|
135
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
136
|
-
const r =
|
|
159
|
+
ValueExtension: re,
|
|
160
|
+
isCrudeValueExtension: B,
|
|
161
|
+
isNonZero: Pn,
|
|
162
|
+
isStringer: Nt,
|
|
163
|
+
isZero: fr
|
|
164
|
+
}, Symbol.toStringTag, { value: "Module" })), We = (t, e = !1) => {
|
|
165
|
+
const r = Nt(t) ? "stringer" : typeof t;
|
|
137
166
|
let n;
|
|
138
167
|
switch (r) {
|
|
139
168
|
case "string":
|
|
@@ -157,83 +186,83 @@ const Ot = (t) => t != null && typeof t == "object" && "toString" in t, er = (t)
|
|
|
157
186
|
default:
|
|
158
187
|
return console.warn(`sortFunc: unknown type ${r}`), () => -1;
|
|
159
188
|
}
|
|
160
|
-
return e ?
|
|
161
|
-
},
|
|
162
|
-
const n =
|
|
189
|
+
return e ? gr(n) : n;
|
|
190
|
+
}, kn = (t, e, r) => {
|
|
191
|
+
const n = We(e[t], r);
|
|
163
192
|
return (s, i) => n(s[t], i[t]);
|
|
164
|
-
},
|
|
193
|
+
}, qn = (t, e) => t.length !== e.length ? t.length - e.length : t.every((r, n) => r === e[n]) ? 0 : -1, dr = (t, e) => {
|
|
165
194
|
if (t.length !== e.length) return t.length - e.length;
|
|
166
195
|
if (t.length === 0) return 0;
|
|
167
|
-
const r =
|
|
196
|
+
const r = We(t[0]), n = [...t].sort(r), s = [...e].sort(r);
|
|
168
197
|
return n.every((i, o) => i === s[o]) ? 0 : -1;
|
|
169
|
-
},
|
|
170
|
-
const r =
|
|
171
|
-
return
|
|
172
|
-
},
|
|
198
|
+
}, zn = (t, e) => {
|
|
199
|
+
const r = ht(t), n = ht(e);
|
|
200
|
+
return dr(r, n);
|
|
201
|
+
}, Zn = (t, e) => t === e ? 0 : t === "first" && e === "last" ? 1 : -1, gr = (t) => (e, r) => t(r, e), ae = 0, Ue = -1, Be = 1, pr = (t) => t < ae, mr = (t) => t > ae, Fn = (t) => t >= ae, yr = (t) => t === ae, Yn = (t, e) => {
|
|
173
202
|
const r = /([a-zA-Z]+)|(\d+)/g, n = t.replace(/[\s_.-]+/g, "").match(r), s = e.replace(/[\s_.-]+/g, "").match(r);
|
|
174
203
|
if (!n || !s) return 0;
|
|
175
204
|
for (let i = 0; i < Math.min(n.length, s.length); i++) {
|
|
176
|
-
const o = n[i],
|
|
177
|
-
if (isNaN(Number(o)) && isNaN(Number(
|
|
178
|
-
const
|
|
179
|
-
if (
|
|
180
|
-
} else if (!isNaN(Number(o)) && !isNaN(Number(
|
|
181
|
-
const
|
|
182
|
-
if (
|
|
205
|
+
const o = n[i], h = s[i];
|
|
206
|
+
if (isNaN(Number(o)) && isNaN(Number(h))) {
|
|
207
|
+
const f = o.localeCompare(h);
|
|
208
|
+
if (f !== 0) return f;
|
|
209
|
+
} else if (!isNaN(Number(o)) && !isNaN(Number(h))) {
|
|
210
|
+
const f = Number(o) - Number(h);
|
|
211
|
+
if (f !== 0) return f;
|
|
183
212
|
} else return isNaN(Number(o)) ? -1 : 1;
|
|
184
213
|
}
|
|
185
214
|
return n.length - s.length;
|
|
186
|
-
},
|
|
215
|
+
}, Ou = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
187
216
|
__proto__: null,
|
|
188
|
-
EQUAL:
|
|
189
|
-
GREATER_THAN:
|
|
190
|
-
LESS_THAN:
|
|
191
|
-
isEqualTo:
|
|
192
|
-
isGreaterThan:
|
|
193
|
-
isGreaterThanEqual:
|
|
194
|
-
isLessThan:
|
|
195
|
-
newF:
|
|
196
|
-
newFieldF:
|
|
197
|
-
order:
|
|
198
|
-
primitiveArrays:
|
|
199
|
-
reverseF:
|
|
200
|
-
stringsWithNumbers:
|
|
201
|
-
uniqueUnorderedPrimitiveArrays:
|
|
202
|
-
unorderedPrimitiveArrays:
|
|
203
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
217
|
+
EQUAL: ae,
|
|
218
|
+
GREATER_THAN: Be,
|
|
219
|
+
LESS_THAN: Ue,
|
|
220
|
+
isEqualTo: yr,
|
|
221
|
+
isGreaterThan: mr,
|
|
222
|
+
isGreaterThanEqual: Fn,
|
|
223
|
+
isLessThan: pr,
|
|
224
|
+
newF: We,
|
|
225
|
+
newFieldF: kn,
|
|
226
|
+
order: Zn,
|
|
227
|
+
primitiveArrays: qn,
|
|
228
|
+
reverseF: gr,
|
|
229
|
+
stringsWithNumbers: Yn,
|
|
230
|
+
uniqueUnorderedPrimitiveArrays: zn,
|
|
231
|
+
unorderedPrimitiveArrays: dr
|
|
232
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = a.tuple([a.number(), a.number()]);
|
|
204
233
|
a.tuple([a.bigint(), a.bigint()]);
|
|
205
|
-
const
|
|
234
|
+
const It = a.object({ width: a.number(), height: a.number() }), Wn = a.object({
|
|
206
235
|
signedWidth: a.number(),
|
|
207
236
|
signedHeight: a.number()
|
|
208
|
-
}),
|
|
209
|
-
a.enum(
|
|
210
|
-
const
|
|
211
|
-
a.enum(
|
|
212
|
-
const
|
|
213
|
-
a.enum(
|
|
214
|
-
const
|
|
215
|
-
a.enum(
|
|
216
|
-
const
|
|
217
|
-
a.union([
|
|
218
|
-
a.union([
|
|
219
|
-
const
|
|
237
|
+
}), Vn = ["width", "height"];
|
|
238
|
+
a.enum(Vn);
|
|
239
|
+
const Gn = ["start", "center", "end"], Hn = ["signedWidth", "signedHeight"];
|
|
240
|
+
a.enum(Hn);
|
|
241
|
+
const ye = a.object({ x: a.number(), y: a.number() }), br = a.object({ clientX: a.number(), clientY: a.number() }), Ge = ["x", "y"], Mt = a.enum(Ge), At = ["top", "right", "bottom", "left"], Xn = a.enum(At), He = ["left", "right"], Et = a.enum(He), Xe = ["top", "bottom"], Ut = a.enum(Xe), Bt = ["center"], ft = a.enum(Bt), Jn = [...At, ...Bt], jt = a.enum(Jn);
|
|
242
|
+
a.enum(Gn);
|
|
243
|
+
const Kn = ["first", "last"];
|
|
244
|
+
a.enum(Kn);
|
|
245
|
+
const wr = a.object({ lower: a.number(), upper: a.number() }), Qn = a.object({ lower: a.bigint(), upper: a.bigint() });
|
|
246
|
+
a.union([wr, Ve]);
|
|
247
|
+
a.union([Qn, Ve]);
|
|
248
|
+
const _n = a.enum([...Mt.options, ...jt.options]);
|
|
220
249
|
a.enum(["x", "left", "right"]);
|
|
221
250
|
a.enum(["y", "top", "bottom"]);
|
|
222
|
-
const
|
|
251
|
+
const es = a.union([Mt, jt, a.instanceof(String)]), oe = (t) => (e, r) => {
|
|
223
252
|
if (typeof e == "bigint") {
|
|
224
|
-
if (
|
|
253
|
+
if (ke(r))
|
|
225
254
|
return t(e, BigInt(r));
|
|
226
255
|
const n = t(Number(e), Number(r));
|
|
227
256
|
return typeof n == "number" ? BigInt(Math.round(n)) : n;
|
|
228
257
|
}
|
|
229
258
|
return t(Number(e), Number(r));
|
|
230
|
-
},
|
|
259
|
+
}, Z = oe((t, e) => t - e), ue = oe((t, e) => t + e), ts = (t, e, r = 1e-4) => Math.abs(t - e) < r, dt = (t, e) => {
|
|
231
260
|
const r = typeof t == "bigint", n = typeof e == "bigint";
|
|
232
|
-
return r && n ? t === e : r &&
|
|
233
|
-
},
|
|
261
|
+
return r && n ? t === e : r && ke(e) ? t === BigInt(e) : n && ke(t) ? e === BigInt(t) : t === e;
|
|
262
|
+
}, rs = (t) => {
|
|
234
263
|
const e = 10 ** Math.floor(Math.log10(t));
|
|
235
264
|
return Math.round(t / e) * e;
|
|
236
|
-
},
|
|
265
|
+
}, $r = oe((t, e) => t <= e ? t : e), ke = (t) => typeof t == "bigint" ? !0 : Number.isInteger(t), ns = oe((t, e) => t >= e ? t : e), Or = (t) => typeof t == "bigint" ? t < 0n ? -t : t : t < 0 ? -t : t, R = oe((t, e) => t * e), ve = oe((t, e) => t / e), b = (t, e, r) => {
|
|
237
266
|
const n = {};
|
|
238
267
|
if (typeof e == "object" && (r = e, e = void 0), r = { makeValid: !0, ...r }, typeof t == "number" || typeof t == "bigint")
|
|
239
268
|
e != null ? (n.lower = t, n.upper = e) : (n.lower = typeof t == "bigint" ? 0n : 0, n.upper = t);
|
|
@@ -242,64 +271,64 @@ const Pn = a.union([xt, It, a.instanceof(String)]), ie = (t) => (e, r) => {
|
|
|
242
271
|
[n.lower, n.upper] = t;
|
|
243
272
|
} else
|
|
244
273
|
n.lower = t.lower, n.upper = t.upper;
|
|
245
|
-
return r?.makeValid ?
|
|
246
|
-
},
|
|
274
|
+
return r?.makeValid ? vr(n) : n;
|
|
275
|
+
}, ss = Object.freeze({ lower: 0, upper: 0 }), is = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), as = Object.freeze({ lower: 0, upper: 1 }), os = Object.freeze({ lower: -1, upper: 1 }), us = (t, e) => {
|
|
247
276
|
if (t == null && e == null) return !0;
|
|
248
277
|
if (t == null || e == null) return !1;
|
|
249
278
|
const r = b(t), n = b(e);
|
|
250
279
|
return r?.lower === n?.lower && r?.upper === n?.upper;
|
|
251
|
-
},
|
|
280
|
+
}, vr = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, gt = (t, e) => {
|
|
252
281
|
const r = b(t);
|
|
253
282
|
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
254
|
-
},
|
|
283
|
+
}, L = (t, e) => {
|
|
255
284
|
const r = b(t);
|
|
256
285
|
if (typeof e == "number" || typeof e == "bigint")
|
|
257
286
|
return e >= r.lower && e < r.upper;
|
|
258
287
|
const n = b(e);
|
|
259
288
|
return n.lower >= r.lower && n.upper <= r.upper;
|
|
260
|
-
},
|
|
289
|
+
}, ls = (t, e) => {
|
|
261
290
|
const r = b(t), n = b(e);
|
|
262
|
-
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 :
|
|
263
|
-
},
|
|
291
|
+
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : L(r, n.upper) || L(r, n.lower) || L(n, r.upper) || L(n, r.lower);
|
|
292
|
+
}, Te = (t) => {
|
|
264
293
|
const e = b(t);
|
|
265
294
|
return e.upper - e.lower;
|
|
266
|
-
},
|
|
295
|
+
}, cs = (t) => {
|
|
267
296
|
const e = b(t);
|
|
268
297
|
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
269
|
-
},
|
|
270
|
-
const e =
|
|
298
|
+
}, hs = (t) => {
|
|
299
|
+
const e = Te(t);
|
|
271
300
|
return typeof e == "number" ? e === 0 : e === 0n;
|
|
272
|
-
},
|
|
301
|
+
}, fs = (t) => {
|
|
273
302
|
const e = b(t);
|
|
274
303
|
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
275
|
-
},
|
|
304
|
+
}, ds = (t) => {
|
|
276
305
|
const e = b(t);
|
|
277
306
|
return (e.upper + e.lower) / 2;
|
|
278
|
-
},
|
|
307
|
+
}, Tr = (t) => ({
|
|
279
308
|
lower: Math.min(...t.map((e) => b(e).lower)),
|
|
280
309
|
upper: Math.max(...t.map((e) => b(e).upper))
|
|
281
|
-
}),
|
|
310
|
+
}), gs = (t) => ({
|
|
282
311
|
lower: Math.max(...t.map((e) => b(e).lower)),
|
|
283
312
|
upper: Math.min(...t.map((e) => b(e).upper))
|
|
284
|
-
}),
|
|
313
|
+
}), ps = (t) => {
|
|
285
314
|
const e = b(t), r = typeof e.lower == "bigint";
|
|
286
|
-
return Array.from({ length: Number(
|
|
287
|
-
},
|
|
288
|
-
const r = t.map((i) => b(i)), n = r.findIndex((i) =>
|
|
315
|
+
return Array.from({ length: Number(Te(t)) }, (n, s) => r ? e.lower + BigInt(s) : e.lower + s);
|
|
316
|
+
}, pt = (t, e) => {
|
|
317
|
+
const r = t.map((i) => b(i)), n = r.findIndex((i) => L(i, e) || e < i.lower);
|
|
289
318
|
if (n === -1) return { index: t.length, position: 0 };
|
|
290
319
|
const s = r[n];
|
|
291
|
-
return
|
|
292
|
-
},
|
|
320
|
+
return L(s, e) ? { index: n, position: Number(e - s.lower) } : { index: n, position: 0 };
|
|
321
|
+
}, nt = {
|
|
293
322
|
removeBefore: 0,
|
|
294
323
|
removeAfter: 0,
|
|
295
324
|
insertInto: 0,
|
|
296
325
|
deleteInBetween: 0
|
|
297
|
-
},
|
|
326
|
+
}, ms = (t, e) => {
|
|
298
327
|
const r = t.map((l) => b(l)), n = b(e);
|
|
299
|
-
if (r.length === 0) return
|
|
300
|
-
const s =
|
|
301
|
-
if (s.index === t.length) return { ...
|
|
302
|
-
if (i.index === 0) return { ...
|
|
328
|
+
if (r.length === 0) return nt;
|
|
329
|
+
const s = pt(r, n.lower), i = pt(r, n.upper);
|
|
330
|
+
if (s.index === t.length) return { ...nt, insertInto: t.length };
|
|
331
|
+
if (i.index === 0) return { ...nt, removeAfter: i.position };
|
|
303
332
|
if (s.index === i.index)
|
|
304
333
|
return s.position !== 0 && i.position !== 0 ? null : {
|
|
305
334
|
removeAfter: i.position,
|
|
@@ -307,326 +336,333 @@ const Pn = a.union([xt, It, a.instanceof(String)]), ie = (t) => (e, r) => {
|
|
|
307
336
|
insertInto: s.index,
|
|
308
337
|
deleteInBetween: 0
|
|
309
338
|
};
|
|
310
|
-
let o = i.index - s.index,
|
|
311
|
-
return s.position !== 0 ? (o -= 1,
|
|
312
|
-
removeBefore:
|
|
339
|
+
let o = i.index - s.index, h = s.index, f = Z(Number(Te(r[s.index])), s.position);
|
|
340
|
+
return s.position !== 0 ? (o -= 1, h += 1) : f = 0, {
|
|
341
|
+
removeBefore: f,
|
|
313
342
|
removeAfter: i.position,
|
|
314
|
-
insertInto:
|
|
343
|
+
insertInto: h,
|
|
315
344
|
deleteInBetween: o
|
|
316
345
|
};
|
|
317
|
-
},
|
|
318
|
-
const n = t.map((
|
|
346
|
+
}, xr = (t, e, r) => {
|
|
347
|
+
const n = t.map((h) => b(h)), s = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
319
348
|
if (s === 0) return e;
|
|
320
349
|
let i = r, o = e;
|
|
321
|
-
for (;
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
const
|
|
350
|
+
for (; dt(i, 0) === !1; ) {
|
|
351
|
+
const h = n.findIndex((f) => s > 0 ? o >= f.lower && o < f.upper : o > f.lower && o <= f.upper);
|
|
352
|
+
if (h !== -1) {
|
|
353
|
+
const f = n[h];
|
|
325
354
|
let l;
|
|
326
|
-
if (s > 0 ? l =
|
|
327
|
-
const d =
|
|
328
|
-
if (o =
|
|
355
|
+
if (s > 0 ? l = Z(f.upper, o) : l = Z(o, f.lower), l > 0) {
|
|
356
|
+
const d = $r(Or(i), l);
|
|
357
|
+
if (o = ue(
|
|
329
358
|
o,
|
|
330
359
|
s > 0 ? d : -d
|
|
331
|
-
), i =
|
|
360
|
+
), i = Z(i, s > 0 ? d : -d), dt(i, 0)) return o;
|
|
332
361
|
continue;
|
|
333
362
|
}
|
|
334
363
|
}
|
|
335
364
|
if (s > 0) {
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
365
|
+
const f = n.filter((l) => l.lower > o);
|
|
366
|
+
if (f.length > 0) o = f[0].lower;
|
|
338
367
|
else return o;
|
|
339
368
|
} else {
|
|
340
|
-
const
|
|
341
|
-
if (
|
|
342
|
-
o =
|
|
369
|
+
const f = n.filter((l) => l.upper < o);
|
|
370
|
+
if (f.length > 0)
|
|
371
|
+
o = f[f.length - 1].upper;
|
|
343
372
|
else return o;
|
|
344
373
|
}
|
|
345
374
|
}
|
|
346
375
|
return o;
|
|
347
|
-
},
|
|
376
|
+
}, Sr = (t, e, r) => {
|
|
348
377
|
const n = t.map((o) => b(o));
|
|
349
378
|
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
350
379
|
const s = e < r ? b([e, r]) : b([r, e]);
|
|
351
380
|
let i = typeof e == "bigint" ? 0n : 0;
|
|
352
381
|
for (const o of n) {
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
355
|
-
const l =
|
|
382
|
+
const h = o.lower > s.lower ? o.lower : s.lower, f = o.upper < s.upper ? o.upper : s.upper;
|
|
383
|
+
if (h < f) {
|
|
384
|
+
const l = f - h;
|
|
356
385
|
i = i + l;
|
|
357
386
|
}
|
|
358
387
|
}
|
|
359
388
|
return i;
|
|
360
|
-
},
|
|
389
|
+
}, vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
361
390
|
__proto__: null,
|
|
362
|
-
CLIP:
|
|
363
|
-
DECIMAL:
|
|
364
|
-
INFINITE:
|
|
365
|
-
ZERO:
|
|
366
|
-
bounds:
|
|
367
|
-
buildInsertionPlan:
|
|
368
|
-
clamp:
|
|
391
|
+
CLIP: os,
|
|
392
|
+
DECIMAL: as,
|
|
393
|
+
INFINITE: is,
|
|
394
|
+
ZERO: ss,
|
|
395
|
+
bounds: wr,
|
|
396
|
+
buildInsertionPlan: ms,
|
|
397
|
+
clamp: gt,
|
|
369
398
|
construct: b,
|
|
370
|
-
contains:
|
|
371
|
-
distance:
|
|
372
|
-
equals:
|
|
373
|
-
findInsertPosition:
|
|
374
|
-
isFinite:
|
|
375
|
-
isZero:
|
|
376
|
-
linspace:
|
|
377
|
-
makeValid:
|
|
378
|
-
max:
|
|
379
|
-
mean:
|
|
380
|
-
min:
|
|
381
|
-
overlapsWith:
|
|
382
|
-
span:
|
|
383
|
-
spanIsZero:
|
|
384
|
-
traverse:
|
|
385
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
399
|
+
contains: L,
|
|
400
|
+
distance: Sr,
|
|
401
|
+
equals: us,
|
|
402
|
+
findInsertPosition: pt,
|
|
403
|
+
isFinite: fs,
|
|
404
|
+
isZero: cs,
|
|
405
|
+
linspace: ps,
|
|
406
|
+
makeValid: vr,
|
|
407
|
+
max: Tr,
|
|
408
|
+
mean: ds,
|
|
409
|
+
min: gs,
|
|
410
|
+
overlapsWith: ls,
|
|
411
|
+
span: Te,
|
|
412
|
+
spanIsZero: hs,
|
|
413
|
+
traverse: xr
|
|
414
|
+
}, Symbol.toStringTag, { value: "Module" })), Nr = _n, z = (t) => Ge.includes(t) ? t : Xe.includes(t) ? "y" : "x", ys = (t) => z(t) === "x" ? "y" : "x", bs = (t) => z(t) === "x" ? "width" : "height", ws = (t) => z(t) === "x" ? "left" : "top", $s = (t) => Nr.safeParse(t).success, Os = (t) => z(t) === "x" ? "signedWidth" : "signedHeight", vs = (t) => t === "center" ? !1 : z(t) === "x", Ts = (t) => z(t) === "y", xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
386
415
|
__proto__: null,
|
|
387
|
-
DIRECTIONS:
|
|
388
|
-
construct:
|
|
389
|
-
crude:
|
|
390
|
-
dimension:
|
|
391
|
-
direction:
|
|
392
|
-
isDirection:
|
|
393
|
-
isX:
|
|
394
|
-
isY:
|
|
395
|
-
location:
|
|
396
|
-
signedDimension:
|
|
397
|
-
swap:
|
|
398
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
416
|
+
DIRECTIONS: Ge,
|
|
417
|
+
construct: z,
|
|
418
|
+
crude: Nr,
|
|
419
|
+
dimension: bs,
|
|
420
|
+
direction: Mt,
|
|
421
|
+
isDirection: $s,
|
|
422
|
+
isX: vs,
|
|
423
|
+
isY: Ts,
|
|
424
|
+
location: ws,
|
|
425
|
+
signedDimension: Os,
|
|
426
|
+
swap: ys
|
|
427
|
+
}, Symbol.toStringTag, { value: "Module" })), Ss = Et, Ns = Ut, Is = ft, Ms = {
|
|
399
428
|
top: "bottom",
|
|
400
429
|
right: "left",
|
|
401
430
|
bottom: "top",
|
|
402
431
|
left: "right",
|
|
403
432
|
center: "center"
|
|
404
|
-
},
|
|
433
|
+
}, As = {
|
|
405
434
|
top: "left",
|
|
406
435
|
right: "top",
|
|
407
436
|
bottom: "right",
|
|
408
437
|
left: "bottom",
|
|
409
438
|
center: "center"
|
|
410
|
-
},
|
|
411
|
-
const e =
|
|
439
|
+
}, Es = es, H = (t) => t instanceof String || !Ge.includes(t) ? t : t === "x" ? "left" : "top", Us = (t) => Ms[H(t)], Bs = (t) => As[H(t)], be = (t) => {
|
|
440
|
+
const e = H(t);
|
|
412
441
|
return e === "top" || e === "bottom" ? "y" : "x";
|
|
413
|
-
},
|
|
414
|
-
x:
|
|
415
|
-
y:
|
|
416
|
-
}),
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
442
|
+
}, js = a.object({
|
|
443
|
+
x: Et.or(ft),
|
|
444
|
+
y: Ut.or(ft)
|
|
445
|
+
}), Ir = a.object({ x: Et, y: Ut }), xe = Object.freeze({ x: "left", y: "top" }), Ct = Object.freeze({ x: "right", y: "top" }), Je = Object.freeze({ x: "left", y: "bottom" }), Rt = Object.freeze({ x: "right", y: "bottom" }), Lt = Object.freeze({ x: "center", y: "center" }), Dt = Object.freeze({ x: "center", y: "top" }), Pt = Object.freeze({ x: "center", y: "bottom" }), kt = Object.freeze({ x: "right", y: "center" }), qt = Object.freeze({ x: "left", y: "center" }), Cs = Object.freeze([
|
|
446
|
+
qt,
|
|
447
|
+
kt,
|
|
448
|
+
Dt,
|
|
449
|
+
Pt,
|
|
421
450
|
xe,
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
]),
|
|
451
|
+
Ct,
|
|
452
|
+
Je,
|
|
453
|
+
Rt,
|
|
454
|
+
Lt
|
|
455
|
+
]), zt = (t, e) => t.x === e.x && t.y === e.y, Rs = (t, e) => {
|
|
427
456
|
if (typeof e == "object") {
|
|
428
457
|
let r = !0;
|
|
429
458
|
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
430
459
|
}
|
|
431
460
|
return t.x === e || t.y === e;
|
|
432
|
-
},
|
|
461
|
+
}, Mr = (t) => [t.x, t.y], je = (t) => be(H(t)) === "x", Ls = (t) => be(H(t)) === "y", Ds = (t) => `${t.x}${hr(t.y)}`, Ps = (t, e) => {
|
|
433
462
|
let r, n;
|
|
434
|
-
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r =
|
|
463
|
+
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = H(t), n = H(e ?? t)), be(r) === be(n) && r !== "center" && n !== "center")
|
|
435
464
|
throw new Error(
|
|
436
465
|
`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
|
|
437
466
|
);
|
|
438
|
-
const s = { ...
|
|
439
|
-
return r === "center" ?
|
|
440
|
-
},
|
|
467
|
+
const s = { ...Lt };
|
|
468
|
+
return r === "center" ? je(n) ? [s.x, s.y] = [n, r] : [s.x, s.y] = [r, n] : n === "center" ? je(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r] : je(r) ? [s.x, s.y] = [r, n] : [s.x, s.y] = [n, r], s;
|
|
469
|
+
}, ks = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
441
470
|
__proto__: null,
|
|
442
|
-
BOTTOM_CENTER:
|
|
443
|
-
BOTTOM_LEFT:
|
|
444
|
-
BOTTOM_RIGHT:
|
|
445
|
-
CENTER:
|
|
446
|
-
CENTER_LEFT:
|
|
447
|
-
CENTER_LOCATIONS:
|
|
448
|
-
CENTER_RIGHT:
|
|
449
|
-
OUTER_LOCATIONS:
|
|
450
|
-
TOP_CENTER:
|
|
471
|
+
BOTTOM_CENTER: Pt,
|
|
472
|
+
BOTTOM_LEFT: Je,
|
|
473
|
+
BOTTOM_RIGHT: Rt,
|
|
474
|
+
CENTER: Lt,
|
|
475
|
+
CENTER_LEFT: qt,
|
|
476
|
+
CENTER_LOCATIONS: Bt,
|
|
477
|
+
CENTER_RIGHT: kt,
|
|
478
|
+
OUTER_LOCATIONS: At,
|
|
479
|
+
TOP_CENTER: Dt,
|
|
451
480
|
TOP_LEFT: xe,
|
|
452
|
-
TOP_RIGHT:
|
|
453
|
-
XY_LOCATIONS:
|
|
454
|
-
X_LOCATIONS:
|
|
455
|
-
Y_LOCATIONS:
|
|
456
|
-
center:
|
|
457
|
-
construct:
|
|
458
|
-
constructXY:
|
|
459
|
-
corner:
|
|
460
|
-
crude:
|
|
461
|
-
direction:
|
|
462
|
-
isX:
|
|
463
|
-
isY:
|
|
464
|
-
location:
|
|
465
|
-
outer:
|
|
466
|
-
rotate90:
|
|
467
|
-
swap:
|
|
468
|
-
x:
|
|
469
|
-
xy:
|
|
470
|
-
xyCouple:
|
|
471
|
-
xyEquals:
|
|
472
|
-
xyMatches:
|
|
473
|
-
xyToString:
|
|
474
|
-
y:
|
|
475
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
481
|
+
TOP_RIGHT: Ct,
|
|
482
|
+
XY_LOCATIONS: Cs,
|
|
483
|
+
X_LOCATIONS: He,
|
|
484
|
+
Y_LOCATIONS: Xe,
|
|
485
|
+
center: Is,
|
|
486
|
+
construct: H,
|
|
487
|
+
constructXY: Ps,
|
|
488
|
+
corner: Ir,
|
|
489
|
+
crude: Es,
|
|
490
|
+
direction: be,
|
|
491
|
+
isX: je,
|
|
492
|
+
isY: Ls,
|
|
493
|
+
location: jt,
|
|
494
|
+
outer: Xn,
|
|
495
|
+
rotate90: Bs,
|
|
496
|
+
swap: Us,
|
|
497
|
+
x: Ss,
|
|
498
|
+
xy: js,
|
|
499
|
+
xyCouple: Mr,
|
|
500
|
+
xyEquals: zt,
|
|
501
|
+
xyMatches: Rs,
|
|
502
|
+
xyToString: Ds,
|
|
503
|
+
y: Ns
|
|
504
|
+
}, Symbol.toStringTag, { value: "Module" })), mt = a.union([
|
|
476
505
|
a.number(),
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
506
|
+
ye,
|
|
507
|
+
Ve,
|
|
508
|
+
It,
|
|
509
|
+
Wn,
|
|
510
|
+
br
|
|
482
511
|
]), v = (t, e) => {
|
|
483
512
|
if (typeof t == "string") {
|
|
484
513
|
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
485
514
|
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
486
515
|
}
|
|
487
516
|
return typeof t == "number" ? { x: t, y: e ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
|
|
488
|
-
},
|
|
517
|
+
}, q = Object.freeze({ x: 0, y: 0 }), Ar = Object.freeze({ x: 1, y: 1 }), qs = Object.freeze({ x: 1 / 0, y: 1 / 0 }), zs = Object.freeze({ x: NaN, y: NaN }), qe = (t, e, r = 0) => {
|
|
489
518
|
const n = v(t), s = v(e);
|
|
490
519
|
return r === 0 ? n.x === s.x && n.y === s.y : Math.abs(n.x - s.x) <= r && Math.abs(n.y - s.y) <= r;
|
|
491
|
-
},
|
|
520
|
+
}, Zs = (t) => qe(t, q), Zt = (t, e, r) => {
|
|
492
521
|
const n = v(t), s = v(e, r);
|
|
493
522
|
return { x: n.x * s.x, y: n.y * s.y };
|
|
494
|
-
},
|
|
523
|
+
}, Er = (t, e) => {
|
|
495
524
|
const r = v(t);
|
|
496
525
|
return { x: r.x + e, y: r.y };
|
|
497
|
-
},
|
|
526
|
+
}, Ur = (t, e) => {
|
|
498
527
|
const r = v(t);
|
|
499
528
|
return { x: r.x, y: r.y + e };
|
|
500
|
-
},
|
|
529
|
+
}, we = (t, e, r, ...n) => {
|
|
501
530
|
if (typeof e == "string") {
|
|
502
531
|
if (typeof r != "number") throw new Error("The value must be a number.");
|
|
503
|
-
return e === "x" ?
|
|
532
|
+
return e === "x" ? Er(t, r) : Ur(t, r);
|
|
504
533
|
}
|
|
505
534
|
if (typeof e == "object" && "x" in e && typeof e.x == "string") {
|
|
506
535
|
const s = v(r), i = v(t);
|
|
507
536
|
return e.x === "left" ? s.x = -s.x : e.x === "center" && (s.x = 0), e.y === "top" ? s.y = -s.y : e.y === "center" && (s.y = 0), { x: i.x + s.x, y: i.y + s.y };
|
|
508
537
|
}
|
|
509
|
-
return [t, e, r ??
|
|
538
|
+
return [t, e, r ?? q, ...n].reduce((s, i) => {
|
|
510
539
|
const o = v(i);
|
|
511
540
|
return { x: s.x + o.x, y: s.y + o.y };
|
|
512
|
-
},
|
|
513
|
-
},
|
|
541
|
+
}, q);
|
|
542
|
+
}, Fs = (t, e, r) => {
|
|
514
543
|
const n = v(t);
|
|
515
544
|
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
516
|
-
},
|
|
545
|
+
}, Ys = (t, e) => {
|
|
517
546
|
const r = v(t), n = v(e);
|
|
518
547
|
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
519
|
-
},
|
|
548
|
+
}, Ws = (t, e) => {
|
|
520
549
|
const r = v(t), n = v(e);
|
|
521
550
|
return { x: n.x - r.x, y: n.y - r.y };
|
|
522
|
-
},
|
|
551
|
+
}, Vs = (t) => {
|
|
523
552
|
const e = v(t);
|
|
524
553
|
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
525
|
-
},
|
|
554
|
+
}, Gs = (t) => {
|
|
526
555
|
const e = v(t);
|
|
527
556
|
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
528
|
-
},
|
|
557
|
+
}, Hs = (t) => {
|
|
529
558
|
const e = v(t);
|
|
530
559
|
return [e.x, e.y];
|
|
531
|
-
},
|
|
560
|
+
}, Xs = (t) => {
|
|
532
561
|
const e = v(t);
|
|
533
562
|
return { left: e.x, top: e.y };
|
|
534
|
-
},
|
|
563
|
+
}, yt = (t, e = 0) => {
|
|
535
564
|
const r = v(t);
|
|
536
|
-
return {
|
|
537
|
-
|
|
565
|
+
return {
|
|
566
|
+
x: Number(r.x.toFixed(e)),
|
|
567
|
+
y: Number(r.y.toFixed(e))
|
|
568
|
+
};
|
|
569
|
+
}, ce = (t, e) => {
|
|
538
570
|
const r = v(t), n = v(e);
|
|
539
571
|
return { x: r.x - n.x, y: r.y - n.y };
|
|
540
|
-
},
|
|
572
|
+
}, he = (t) => {
|
|
541
573
|
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
542
574
|
return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
|
|
543
|
-
},
|
|
575
|
+
}, Br = (t) => {
|
|
544
576
|
const e = v(t), r = Math.hypot(e.x, e.y);
|
|
545
577
|
return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
|
|
546
|
-
},
|
|
547
|
-
const e = t.reduce((r, n) =>
|
|
548
|
-
return
|
|
549
|
-
},
|
|
578
|
+
}, jr = (...t) => {
|
|
579
|
+
const e = t.reduce((r, n) => we(r, n), q);
|
|
580
|
+
return Zt(e, 1 / t.length);
|
|
581
|
+
}, Js = (t, e) => {
|
|
550
582
|
const r = [];
|
|
551
583
|
for (let n = 0; n < t.length; n++) {
|
|
552
584
|
const s = t[n];
|
|
553
|
-
let i, o,
|
|
585
|
+
let i, o, h, f;
|
|
554
586
|
if (n === 0) {
|
|
555
|
-
const l = t[n + 1], d =
|
|
556
|
-
o =
|
|
587
|
+
const l = t[n + 1], d = ce(l, s);
|
|
588
|
+
o = he(d), h = o, f = e;
|
|
557
589
|
} else if (n === t.length - 1) {
|
|
558
|
-
const l = t[n - 1], d =
|
|
559
|
-
i =
|
|
590
|
+
const l = t[n - 1], d = ce(s, l);
|
|
591
|
+
i = he(d), h = i, f = e;
|
|
560
592
|
} else {
|
|
561
|
-
const l = t[n - 1], d = t[n + 1],
|
|
562
|
-
i =
|
|
563
|
-
const
|
|
564
|
-
(
|
|
565
|
-
),
|
|
566
|
-
|
|
593
|
+
const l = t[n - 1], d = t[n + 1], m = ce(s, l), p = ce(d, s);
|
|
594
|
+
i = he(m), o = he(p);
|
|
595
|
+
const A = Math.acos(
|
|
596
|
+
(m.x * p.x + m.y * p.y) / (Math.hypot(m.x, m.y) * Math.hypot(p.x, p.y))
|
|
597
|
+
), U = Math.sin(A / 2);
|
|
598
|
+
U === 0 ? f = e : f = e / U, h = Br(jr(i, o));
|
|
567
599
|
}
|
|
568
|
-
r.push(
|
|
600
|
+
r.push(Zt(h, f));
|
|
569
601
|
}
|
|
570
602
|
return r;
|
|
571
|
-
},
|
|
603
|
+
}, Ks = (t) => {
|
|
572
604
|
const e = v(t);
|
|
573
605
|
return { x: e.y, y: e.x };
|
|
574
|
-
},
|
|
606
|
+
}, bt = (t) => {
|
|
575
607
|
const e = v(t);
|
|
576
608
|
return { x: Math.round(e.x), y: Math.round(e.y) };
|
|
577
|
-
},
|
|
609
|
+
}, Qs = (t) => {
|
|
610
|
+
const e = v(t);
|
|
611
|
+
return { x: 1 / e.x, y: 1 / e.y };
|
|
612
|
+
}, Tu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
578
613
|
__proto__: null,
|
|
579
|
-
INFINITY:
|
|
580
|
-
NAN:
|
|
581
|
-
ONE:
|
|
582
|
-
ZERO:
|
|
583
|
-
average:
|
|
584
|
-
calculateMiters:
|
|
585
|
-
clientXY:
|
|
614
|
+
INFINITY: qs,
|
|
615
|
+
NAN: zs,
|
|
616
|
+
ONE: Ar,
|
|
617
|
+
ZERO: q,
|
|
618
|
+
average: jr,
|
|
619
|
+
calculateMiters: Js,
|
|
620
|
+
clientXY: br,
|
|
586
621
|
construct: v,
|
|
587
|
-
couple:
|
|
588
|
-
crudeZ:
|
|
589
|
-
css:
|
|
590
|
-
distance:
|
|
591
|
-
equals:
|
|
592
|
-
isFinite:
|
|
593
|
-
isNan:
|
|
594
|
-
isZero:
|
|
595
|
-
normal:
|
|
596
|
-
normalize:
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
622
|
+
couple: Hs,
|
|
623
|
+
crudeZ: mt,
|
|
624
|
+
css: Xs,
|
|
625
|
+
distance: Ys,
|
|
626
|
+
equals: qe,
|
|
627
|
+
isFinite: Gs,
|
|
628
|
+
isNan: Vs,
|
|
629
|
+
isZero: Zs,
|
|
630
|
+
normal: he,
|
|
631
|
+
normalize: Br,
|
|
632
|
+
reciprocal: Qs,
|
|
633
|
+
round: bt,
|
|
634
|
+
scale: Zt,
|
|
635
|
+
set: Fs,
|
|
636
|
+
sub: ce,
|
|
637
|
+
swap: Ks,
|
|
638
|
+
translate: we,
|
|
639
|
+
translateX: Er,
|
|
640
|
+
translateY: Ur,
|
|
641
|
+
translation: Ws,
|
|
642
|
+
truncate: yt,
|
|
643
|
+
xy: ye
|
|
644
|
+
}, Symbol.toStringTag, { value: "Module" })), Ne = a.union([a.number(), a.string()]), _s = a.object({
|
|
645
|
+
top: Ne,
|
|
646
|
+
left: Ne,
|
|
647
|
+
width: Ne,
|
|
648
|
+
height: Ne
|
|
649
|
+
}), ei = a.object({
|
|
614
650
|
left: a.number(),
|
|
615
651
|
top: a.number(),
|
|
616
652
|
right: a.number(),
|
|
617
653
|
bottom: a.number()
|
|
618
|
-
}),
|
|
619
|
-
one:
|
|
620
|
-
two:
|
|
621
|
-
root:
|
|
622
|
-
}),
|
|
654
|
+
}), ti = a.object({
|
|
655
|
+
one: ye,
|
|
656
|
+
two: ye,
|
|
657
|
+
root: Ir
|
|
658
|
+
}), Cr = { one: q, two: q, root: xe }, ri = { one: q, two: Ar, root: Je }, Rr = (t, e) => ({
|
|
623
659
|
one: t.one,
|
|
624
660
|
two: t.two,
|
|
625
661
|
root: e ?? t.root
|
|
626
|
-
}),
|
|
662
|
+
}), x = (t, e, r = 0, n = 0, s) => {
|
|
627
663
|
const i = {
|
|
628
|
-
one: { ...
|
|
629
|
-
two: { ...
|
|
664
|
+
one: { ...q },
|
|
665
|
+
two: { ...q },
|
|
630
666
|
root: s ?? xe
|
|
631
667
|
};
|
|
632
668
|
if (typeof t == "number") {
|
|
@@ -641,219 +677,219 @@ const Pn = a.union([xt, It, a.instanceof(String)]), ie = (t) => (e, r) => {
|
|
|
641
677
|
x: i.one.x + e.signedWidth,
|
|
642
678
|
y: i.one.y + e.signedHeight
|
|
643
679
|
} : i.two = e, i));
|
|
644
|
-
},
|
|
645
|
-
const n =
|
|
680
|
+
}, ni = (t, e, r) => {
|
|
681
|
+
const n = x(t);
|
|
646
682
|
if (typeof e == "string") {
|
|
647
683
|
if (r == null) throw new Error("Invalid arguments for resize");
|
|
648
|
-
const s =
|
|
649
|
-
return
|
|
684
|
+
const s = z(e);
|
|
685
|
+
return x(
|
|
650
686
|
n.one,
|
|
651
687
|
void 0,
|
|
652
|
-
s === "x" ? r :
|
|
688
|
+
s === "x" ? r : X(n),
|
|
653
689
|
s === "y" ? r : J(n),
|
|
654
690
|
n.root
|
|
655
691
|
);
|
|
656
692
|
}
|
|
657
|
-
return
|
|
658
|
-
},
|
|
659
|
-
const n =
|
|
693
|
+
return x(n.one, e, void 0, void 0, n.root);
|
|
694
|
+
}, si = (t, e, r = !0) => {
|
|
695
|
+
const n = x(t);
|
|
660
696
|
let s = (i, o) => i < o;
|
|
661
|
-
return r && (s = (i, o) => i <= o), "one" in e ? s(
|
|
662
|
-
},
|
|
663
|
-
width:
|
|
697
|
+
return r && (s = (i, o) => i <= o), "one" in e ? s(V(n), V(e)) && s(_(e), _(n)) && s(G(n), G(e)) && s(ee(e), ee(n)) : s(V(n), e.x) && s(e.x, _(n)) && s(G(n), e.y) && s(e.y, ee(n));
|
|
698
|
+
}, ii = (t, e) => qe(t.one, e.one) && qe(t.two, e.two) && zt(t.root, e.root), Lr = (t) => ({
|
|
699
|
+
width: X(t),
|
|
664
700
|
height: J(t)
|
|
665
|
-
}),
|
|
666
|
-
signedWidth:
|
|
667
|
-
signedHeight:
|
|
668
|
-
}),
|
|
669
|
-
top:
|
|
670
|
-
left:
|
|
671
|
-
width:
|
|
701
|
+
}), ai = (t) => ({
|
|
702
|
+
signedWidth: Ke(t),
|
|
703
|
+
signedHeight: Qe(t)
|
|
704
|
+
}), oi = (t) => ({
|
|
705
|
+
top: G(t),
|
|
706
|
+
left: V(t),
|
|
707
|
+
width: X(t),
|
|
672
708
|
height: J(t)
|
|
673
|
-
}),
|
|
674
|
-
const n =
|
|
709
|
+
}), Ft = (t, e, r = !1) => {
|
|
710
|
+
const n = z(e) === "y" ? Qe(t) : Ke(t);
|
|
675
711
|
return r ? n : Math.abs(n);
|
|
676
|
-
},
|
|
677
|
-
const r =
|
|
712
|
+
}, F = (t, e) => {
|
|
713
|
+
const r = x(t);
|
|
678
714
|
return {
|
|
679
|
-
x: e.x === "center" ?
|
|
680
|
-
y: e.y === "center" ?
|
|
715
|
+
x: e.x === "center" ? wt(r).x : te(r, e.x),
|
|
716
|
+
y: e.y === "center" ? wt(r).y : te(r, e.y)
|
|
681
717
|
};
|
|
682
|
-
},
|
|
683
|
-
const r =
|
|
684
|
-
return
|
|
685
|
-
},
|
|
686
|
-
const e =
|
|
718
|
+
}, te = (t, e) => {
|
|
719
|
+
const r = x(t), n = Mr(r.root).includes(e) ? Math.min : Math.max;
|
|
720
|
+
return He.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
721
|
+
}, ui = (t) => kr(t) === 0, X = (t) => Ft(t, "x"), J = (t) => Ft(t, "y"), Ke = (t) => {
|
|
722
|
+
const e = x(t);
|
|
687
723
|
return e.two.x - e.one.x;
|
|
688
|
-
},
|
|
689
|
-
const e =
|
|
724
|
+
}, Qe = (t) => {
|
|
725
|
+
const e = x(t);
|
|
690
726
|
return e.two.y - e.one.y;
|
|
691
|
-
},
|
|
692
|
-
x:
|
|
693
|
-
y:
|
|
694
|
-
}),
|
|
695
|
-
const e =
|
|
696
|
-
return e.root.x === "left" ?
|
|
697
|
-
},
|
|
698
|
-
const e =
|
|
699
|
-
return e.root.y === "top" ?
|
|
700
|
-
},
|
|
701
|
-
const e =
|
|
727
|
+
}, Dr = (t) => F(t, xe), li = (t) => F(t, Dt), ci = (t) => F(t, Ct), hi = (t) => F(t, Je), fi = (t) => F(t, Pt), di = (t) => F(t, Rt), gi = (t) => F(t, qt), pi = (t) => F(t, kt), _ = (t) => te(t, "right"), ee = (t) => te(t, "bottom"), V = (t) => te(t, "left"), G = (t) => te(t, "top"), wt = (t) => we(Dr(t), {
|
|
728
|
+
x: Ke(t) / 2,
|
|
729
|
+
y: Qe(t) / 2
|
|
730
|
+
}), Yt = (t) => {
|
|
731
|
+
const e = x(t);
|
|
732
|
+
return e.root.x === "left" ? V(e) : _(e);
|
|
733
|
+
}, Wt = (t) => {
|
|
734
|
+
const e = x(t);
|
|
735
|
+
return e.root.y === "top" ? G(e) : ee(e);
|
|
736
|
+
}, mi = (t) => ({ x: Yt(t), y: Wt(t) }), Ce = (t) => {
|
|
737
|
+
const e = x(t);
|
|
702
738
|
return { lower: e.one.x, upper: e.two.x };
|
|
703
|
-
},
|
|
704
|
-
const e =
|
|
739
|
+
}, Re = (t) => {
|
|
740
|
+
const e = x(t);
|
|
705
741
|
return { lower: e.one.y, upper: e.two.y };
|
|
706
|
-
},
|
|
707
|
-
const r =
|
|
742
|
+
}, yi = (t, e) => Rr(t, e), bi = (t, e) => {
|
|
743
|
+
const r = x(t), n = He.includes(e) ? "x" : Xe.includes(e) ? "y" : null;
|
|
708
744
|
if (n === null) throw new Error(`Invalid location: ${e}`);
|
|
709
745
|
const s = e === "top" || e === "left" ? Math.min : Math.max, i = { ...r.one }, o = { ...r.two };
|
|
710
746
|
return i[n] = s(r.one[n], r.two[n]), o[n] = s(r.one[n], r.two[n]), [i, o];
|
|
711
|
-
},
|
|
712
|
-
const r =
|
|
713
|
-
return
|
|
714
|
-
},
|
|
747
|
+
}, wi = (t, e) => {
|
|
748
|
+
const r = x(t), n = x(e), s = Yt(n) + (X(n) - X(r)) / 2, i = Wt(n) + (J(n) - J(r)) / 2;
|
|
749
|
+
return x({ x: s, y: i }, Lr(r));
|
|
750
|
+
}, Pr = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, $i = (t) => X(t) / J(t), Oi = (t, e, r) => {
|
|
715
751
|
if (typeof e == "string") {
|
|
716
752
|
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
717
|
-
const s =
|
|
753
|
+
const s = z(e);
|
|
718
754
|
e = v(s, r);
|
|
719
755
|
}
|
|
720
|
-
const n =
|
|
721
|
-
return
|
|
722
|
-
|
|
723
|
-
|
|
756
|
+
const n = x(t);
|
|
757
|
+
return x(
|
|
758
|
+
we(n.one, e),
|
|
759
|
+
we(n.two, e),
|
|
724
760
|
void 0,
|
|
725
761
|
void 0,
|
|
726
762
|
n.root
|
|
727
763
|
);
|
|
728
|
-
},
|
|
729
|
-
const r = Math.max(
|
|
730
|
-
return r > s || n > i ?
|
|
731
|
-
},
|
|
732
|
-
const r =
|
|
733
|
-
return
|
|
734
|
-
|
|
735
|
-
|
|
764
|
+
}, vi = (t, e) => {
|
|
765
|
+
const r = Math.max(V(t), V(e)), n = Math.max(G(t), G(e)), s = Math.min(_(t), _(e)), i = Math.min(ee(t), ee(e));
|
|
766
|
+
return r > s || n > i ? Cr : x({ x: r, y: n }, { x: s, y: i }, void 0, void 0, t.root);
|
|
767
|
+
}, kr = (t) => X(t) * J(t), Ti = (t, e) => {
|
|
768
|
+
const r = x(t);
|
|
769
|
+
return x(
|
|
770
|
+
yt(r.one, e),
|
|
771
|
+
yt(r.two, e),
|
|
736
772
|
void 0,
|
|
737
773
|
void 0,
|
|
738
774
|
r.root
|
|
739
775
|
);
|
|
740
|
-
},
|
|
741
|
-
const o = { x: t, y: e },
|
|
742
|
-
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2,
|
|
743
|
-
},
|
|
744
|
-
const e =
|
|
745
|
-
return
|
|
746
|
-
},
|
|
776
|
+
}, xi = (t, e, r, n, s, i) => {
|
|
777
|
+
const o = { x: t, y: e }, h = { x: t + r, y: e + n };
|
|
778
|
+
return s.x !== i.x && (s.x === "center" ? (o.x -= r / 2, h.x -= r / 2) : (o.x -= r, h.x -= r)), s.y !== i.y && (s.y === "center" ? (o.y -= n / 2, h.y -= n / 2) : (o.y -= n, h.y -= n)), x(o, h, void 0, void 0, i);
|
|
779
|
+
}, Si = (t) => {
|
|
780
|
+
const e = x(t);
|
|
781
|
+
return x(bt(e.one), bt(e.two), void 0, void 0, e.root);
|
|
782
|
+
}, xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
747
783
|
__proto__: null,
|
|
748
|
-
DECIMAL:
|
|
749
|
-
ZERO:
|
|
750
|
-
area:
|
|
751
|
-
areaIsZero:
|
|
752
|
-
aspect:
|
|
753
|
-
bottom:
|
|
754
|
-
bottomCenter:
|
|
755
|
-
bottomLeft:
|
|
756
|
-
bottomRight:
|
|
757
|
-
box:
|
|
758
|
-
center:
|
|
759
|
-
centerLeft:
|
|
760
|
-
centerRight:
|
|
761
|
-
construct:
|
|
762
|
-
constructWithAlternateRoot:
|
|
763
|
-
contains:
|
|
764
|
-
copy:
|
|
765
|
-
css:
|
|
766
|
-
cssBox:
|
|
767
|
-
dim:
|
|
768
|
-
dims:
|
|
769
|
-
domRect:
|
|
770
|
-
edgePoints:
|
|
771
|
-
equals:
|
|
784
|
+
DECIMAL: ri,
|
|
785
|
+
ZERO: Cr,
|
|
786
|
+
area: kr,
|
|
787
|
+
areaIsZero: ui,
|
|
788
|
+
aspect: $i,
|
|
789
|
+
bottom: ee,
|
|
790
|
+
bottomCenter: fi,
|
|
791
|
+
bottomLeft: hi,
|
|
792
|
+
bottomRight: di,
|
|
793
|
+
box: ti,
|
|
794
|
+
center: wt,
|
|
795
|
+
centerLeft: gi,
|
|
796
|
+
centerRight: pi,
|
|
797
|
+
construct: x,
|
|
798
|
+
constructWithAlternateRoot: xi,
|
|
799
|
+
contains: si,
|
|
800
|
+
copy: Rr,
|
|
801
|
+
css: oi,
|
|
802
|
+
cssBox: _s,
|
|
803
|
+
dim: Ft,
|
|
804
|
+
dims: Lr,
|
|
805
|
+
domRect: ei,
|
|
806
|
+
edgePoints: bi,
|
|
807
|
+
equals: ii,
|
|
772
808
|
height: J,
|
|
773
|
-
intersection:
|
|
774
|
-
isBox:
|
|
775
|
-
left:
|
|
776
|
-
loc:
|
|
777
|
-
positionInCenter:
|
|
778
|
-
reRoot:
|
|
779
|
-
resize:
|
|
780
|
-
right:
|
|
781
|
-
root:
|
|
782
|
-
round:
|
|
783
|
-
signedDims:
|
|
784
|
-
signedHeight:
|
|
785
|
-
signedWidth:
|
|
786
|
-
top:
|
|
787
|
-
topCenter:
|
|
788
|
-
topLeft:
|
|
789
|
-
topRight:
|
|
790
|
-
translate:
|
|
791
|
-
truncate:
|
|
792
|
-
width:
|
|
793
|
-
x:
|
|
794
|
-
xBounds:
|
|
795
|
-
xyLoc:
|
|
796
|
-
y:
|
|
797
|
-
yBounds:
|
|
798
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
809
|
+
intersection: vi,
|
|
810
|
+
isBox: Pr,
|
|
811
|
+
left: V,
|
|
812
|
+
loc: te,
|
|
813
|
+
positionInCenter: wi,
|
|
814
|
+
reRoot: yi,
|
|
815
|
+
resize: ni,
|
|
816
|
+
right: _,
|
|
817
|
+
root: mi,
|
|
818
|
+
round: Si,
|
|
819
|
+
signedDims: ai,
|
|
820
|
+
signedHeight: Qe,
|
|
821
|
+
signedWidth: Ke,
|
|
822
|
+
top: G,
|
|
823
|
+
topCenter: li,
|
|
824
|
+
topLeft: Dr,
|
|
825
|
+
topRight: ci,
|
|
826
|
+
translate: Oi,
|
|
827
|
+
truncate: Ti,
|
|
828
|
+
width: X,
|
|
829
|
+
x: Yt,
|
|
830
|
+
xBounds: Ce,
|
|
831
|
+
xyLoc: F,
|
|
832
|
+
y: Wt,
|
|
833
|
+
yBounds: Re
|
|
834
|
+
}, Symbol.toStringTag, { value: "Module" })), qr = a.object({ signedWidth: a.number(), signedHeight: a.number() }), Ni = a.union([It, qr, ye, Ve]), Ii = { width: 0, height: 0 }, Mi = { width: 1, height: 1 }, D = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, Ai = (t, e) => {
|
|
799
835
|
if (e == null) return !1;
|
|
800
|
-
const r =
|
|
836
|
+
const r = D(t), n = D(e);
|
|
801
837
|
return r.width === n.width && r.height === n.height;
|
|
802
|
-
},
|
|
803
|
-
const e =
|
|
838
|
+
}, Ei = (t) => {
|
|
839
|
+
const e = D(t);
|
|
804
840
|
return { width: e.height, height: e.width };
|
|
805
|
-
},
|
|
806
|
-
const e =
|
|
841
|
+
}, Ui = (t) => {
|
|
842
|
+
const e = D(t);
|
|
807
843
|
return `0 0 ${e.width} ${e.height}`;
|
|
808
|
-
},
|
|
809
|
-
const e =
|
|
844
|
+
}, Bi = (t) => {
|
|
845
|
+
const e = D(t);
|
|
810
846
|
return [e.width, e.height];
|
|
811
|
-
},
|
|
812
|
-
width: Math.max(...t.map((e) =>
|
|
813
|
-
height: Math.max(...t.map((e) =>
|
|
814
|
-
}),
|
|
815
|
-
width: Math.min(...t.map((e) =>
|
|
816
|
-
height: Math.min(...t.map((e) =>
|
|
817
|
-
}),
|
|
818
|
-
const r =
|
|
847
|
+
}, ji = (t) => ({
|
|
848
|
+
width: Math.max(...t.map((e) => D(e).width)),
|
|
849
|
+
height: Math.max(...t.map((e) => D(e).height))
|
|
850
|
+
}), Ci = (t) => ({
|
|
851
|
+
width: Math.min(...t.map((e) => D(e).width)),
|
|
852
|
+
height: Math.min(...t.map((e) => D(e).height))
|
|
853
|
+
}), Ri = (t, e) => {
|
|
854
|
+
const r = D(t);
|
|
819
855
|
return { width: r.width * e, height: r.height * e };
|
|
820
|
-
},
|
|
856
|
+
}, Su = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
821
857
|
__proto__: null,
|
|
822
|
-
DECIMAL:
|
|
823
|
-
ZERO:
|
|
824
|
-
construct:
|
|
825
|
-
couple:
|
|
826
|
-
crude:
|
|
827
|
-
dimensions:
|
|
828
|
-
equals:
|
|
829
|
-
max:
|
|
830
|
-
min:
|
|
831
|
-
scale:
|
|
832
|
-
signed:
|
|
833
|
-
svgViewBox:
|
|
834
|
-
swap:
|
|
835
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
858
|
+
DECIMAL: Mi,
|
|
859
|
+
ZERO: Ii,
|
|
860
|
+
construct: D,
|
|
861
|
+
couple: Bi,
|
|
862
|
+
crude: Ni,
|
|
863
|
+
dimensions: It,
|
|
864
|
+
equals: Ai,
|
|
865
|
+
max: ji,
|
|
866
|
+
min: Ci,
|
|
867
|
+
scale: Ri,
|
|
868
|
+
signed: qr,
|
|
869
|
+
svgViewBox: Ui,
|
|
870
|
+
swap: Ei
|
|
871
|
+
}, Symbol.toStringTag, { value: "Module" })), Li = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, Di = a.object({ offset: mt, scale: mt }), Pi = a.object({ offset: a.number(), scale: a.number() }), ki = (t) => (e, r, n, s) => r === "dimension" ? [e, n] : [
|
|
836
872
|
e,
|
|
837
873
|
s ? n - t : n + t
|
|
838
|
-
],
|
|
874
|
+
], qi = (t) => (e, r, n, s) => [
|
|
839
875
|
e,
|
|
840
876
|
s ? n / t : n * t
|
|
841
|
-
],
|
|
877
|
+
], zi = (t) => (e, r, n) => {
|
|
842
878
|
if (e === null) return [t, n];
|
|
843
|
-
const { lower: s, upper: i } = e, { lower: o, upper:
|
|
844
|
-
if (r === "dimension") return [t, n * (l /
|
|
845
|
-
const d = (n - s) * (l /
|
|
879
|
+
const { lower: s, upper: i } = e, { lower: o, upper: h } = t, f = i - s, l = h - o;
|
|
880
|
+
if (r === "dimension") return [t, n * (l / f)];
|
|
881
|
+
const d = (n - s) * (l / f) + o;
|
|
846
882
|
return [t, d];
|
|
847
|
-
},
|
|
883
|
+
}, Zi = (t) => (e, r, n) => [t, n], Fi = () => (t, e, r) => {
|
|
848
884
|
if (t === null) throw new Error("cannot invert without bounds");
|
|
849
885
|
if (e === "dimension") return [t, r];
|
|
850
886
|
const { lower: n, upper: s } = t;
|
|
851
887
|
return [t, s - (r - n)];
|
|
852
|
-
},
|
|
888
|
+
}, Yi = (t) => (e, r, n) => {
|
|
853
889
|
const { lower: s, upper: i } = t;
|
|
854
|
-
return n =
|
|
890
|
+
return n = Li(n, s, i), [e, n];
|
|
855
891
|
};
|
|
856
|
-
let
|
|
892
|
+
let $t = class se {
|
|
857
893
|
ops = [];
|
|
858
894
|
currBounds = null;
|
|
859
895
|
currType = null;
|
|
@@ -867,7 +903,7 @@ let gt = class re {
|
|
|
867
903
|
* @param value - The amount to translate by.
|
|
868
904
|
*/
|
|
869
905
|
static translate(e) {
|
|
870
|
-
return new
|
|
906
|
+
return new se().translate(e);
|
|
871
907
|
}
|
|
872
908
|
/**
|
|
873
909
|
* @returns a new scale with a magnification as its first operation. Any number provided
|
|
@@ -875,10 +911,10 @@ let gt = class re {
|
|
|
875
911
|
* @param value - The amount to translate by.
|
|
876
912
|
*/
|
|
877
913
|
static magnify(e) {
|
|
878
|
-
return new
|
|
914
|
+
return new se().magnify(e);
|
|
879
915
|
}
|
|
880
916
|
static scale(e, r) {
|
|
881
|
-
return new
|
|
917
|
+
return new se().scale(e, r);
|
|
882
918
|
}
|
|
883
919
|
/**
|
|
884
920
|
* @returns a copy of the scale with a translation as its next operation. Any
|
|
@@ -887,7 +923,7 @@ let gt = class re {
|
|
|
887
923
|
* @param value - The amount to translate by.
|
|
888
924
|
*/
|
|
889
925
|
translate(e) {
|
|
890
|
-
const r = this.new(), n =
|
|
926
|
+
const r = this.new(), n = ki(e);
|
|
891
927
|
return n.type = "translate", r.ops.push(n), r;
|
|
892
928
|
}
|
|
893
929
|
/**
|
|
@@ -897,23 +933,23 @@ let gt = class re {
|
|
|
897
933
|
* @param value - The amount to magnify by.
|
|
898
934
|
*/
|
|
899
935
|
magnify(e) {
|
|
900
|
-
const r = this.new(), n =
|
|
936
|
+
const r = this.new(), n = qi(e);
|
|
901
937
|
return n.type = "magnify", r.ops.push(n), r;
|
|
902
938
|
}
|
|
903
939
|
scale(e, r) {
|
|
904
|
-
const n = b(e, r), s = this.new(), i =
|
|
940
|
+
const n = b(e, r), s = this.new(), i = zi(n);
|
|
905
941
|
return i.type = "scale", s.ops.push(i), s;
|
|
906
942
|
}
|
|
907
943
|
clamp(e, r) {
|
|
908
|
-
const n = b(e, r), s = this.new(), i =
|
|
944
|
+
const n = b(e, r), s = this.new(), i = Yi(n);
|
|
909
945
|
return i.type = "clamp", s.ops.push(i), s;
|
|
910
946
|
}
|
|
911
947
|
reBound(e, r) {
|
|
912
|
-
const n = b(e, r), s = this.new(), i =
|
|
948
|
+
const n = b(e, r), s = this.new(), i = Zi(n);
|
|
913
949
|
return i.type = "re-bound", s.ops.push(i), s;
|
|
914
950
|
}
|
|
915
951
|
invert() {
|
|
916
|
-
const e =
|
|
952
|
+
const e = Fi();
|
|
917
953
|
e.type = "invert";
|
|
918
954
|
const r = this.new();
|
|
919
955
|
return r.ops.push(e), r;
|
|
@@ -925,7 +961,7 @@ let gt = class re {
|
|
|
925
961
|
return this.exec("dimension", e);
|
|
926
962
|
}
|
|
927
963
|
new() {
|
|
928
|
-
const e = new
|
|
964
|
+
const e = new se();
|
|
929
965
|
return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
|
|
930
966
|
}
|
|
931
967
|
exec(e, r) {
|
|
@@ -939,9 +975,9 @@ let gt = class re {
|
|
|
939
975
|
e.ops.reverse();
|
|
940
976
|
const r = [];
|
|
941
977
|
return e.ops.forEach((n, s) => {
|
|
942
|
-
if (n.type === "scale" || r.some(([o,
|
|
978
|
+
if (n.type === "scale" || r.some(([o, h]) => s >= o && s <= h))
|
|
943
979
|
return;
|
|
944
|
-
const i = e.ops.findIndex((o,
|
|
980
|
+
const i = e.ops.findIndex((o, h) => o.type === "scale" && h > s);
|
|
945
981
|
i !== -1 && r.push([s, i]);
|
|
946
982
|
}), r.forEach(([n, s]) => {
|
|
947
983
|
const i = e.ops.slice(n, s);
|
|
@@ -951,34 +987,34 @@ let gt = class re {
|
|
|
951
987
|
get transform() {
|
|
952
988
|
return { scale: this.dim(1), offset: this.pos(0) };
|
|
953
989
|
}
|
|
954
|
-
static IDENTITY = new
|
|
955
|
-
},
|
|
990
|
+
static IDENTITY = new se();
|
|
991
|
+
}, Wi = class P {
|
|
956
992
|
x;
|
|
957
993
|
y;
|
|
958
994
|
currRoot;
|
|
959
|
-
constructor(e = new
|
|
995
|
+
constructor(e = new $t(), r = new $t(), n = null) {
|
|
960
996
|
this.x = e, this.y = r, this.currRoot = n;
|
|
961
997
|
}
|
|
962
998
|
static translate(e, r) {
|
|
963
|
-
return new
|
|
999
|
+
return new P().translate(e, r);
|
|
964
1000
|
}
|
|
965
1001
|
static translateX(e) {
|
|
966
|
-
return new
|
|
1002
|
+
return new P().translateX(e);
|
|
967
1003
|
}
|
|
968
1004
|
static translateY(e) {
|
|
969
|
-
return new
|
|
1005
|
+
return new P().translateY(e);
|
|
970
1006
|
}
|
|
971
1007
|
static clamp(e) {
|
|
972
|
-
return new
|
|
1008
|
+
return new P().clamp(e);
|
|
973
1009
|
}
|
|
974
1010
|
static magnify(e) {
|
|
975
|
-
return new
|
|
1011
|
+
return new P().magnify(e);
|
|
976
1012
|
}
|
|
977
1013
|
static scale(e) {
|
|
978
|
-
return new
|
|
1014
|
+
return new P().scale(e);
|
|
979
1015
|
}
|
|
980
1016
|
static reBound(e) {
|
|
981
|
-
return new
|
|
1017
|
+
return new P().reBound(e);
|
|
982
1018
|
}
|
|
983
1019
|
translate(e, r) {
|
|
984
1020
|
const n = v(e, r), s = this.copy();
|
|
@@ -998,22 +1034,22 @@ let gt = class re {
|
|
|
998
1034
|
}
|
|
999
1035
|
scale(e) {
|
|
1000
1036
|
const r = this.copy();
|
|
1001
|
-
if (
|
|
1037
|
+
if (Pr(e)) {
|
|
1002
1038
|
const n = this.currRoot;
|
|
1003
|
-
return r.currRoot = e.root, n != null && !
|
|
1039
|
+
return r.currRoot = e.root, n != null && !zt(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(Ce(e)), r.y = r.y.scale(Re(e)), r;
|
|
1004
1040
|
}
|
|
1005
1041
|
return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
|
|
1006
1042
|
}
|
|
1007
1043
|
reBound(e) {
|
|
1008
1044
|
const r = this.copy();
|
|
1009
|
-
return r.x = this.x.reBound(
|
|
1045
|
+
return r.x = this.x.reBound(Ce(e)), r.y = this.y.reBound(Re(e)), r;
|
|
1010
1046
|
}
|
|
1011
1047
|
clamp(e) {
|
|
1012
1048
|
const r = this.copy();
|
|
1013
|
-
return r.x = this.x.clamp(
|
|
1049
|
+
return r.x = this.x.clamp(Ce(e)), r.y = this.y.clamp(Re(e)), r;
|
|
1014
1050
|
}
|
|
1015
1051
|
copy() {
|
|
1016
|
-
const e = new
|
|
1052
|
+
const e = new P();
|
|
1017
1053
|
return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
|
|
1018
1054
|
}
|
|
1019
1055
|
reverse() {
|
|
@@ -1027,7 +1063,7 @@ let gt = class re {
|
|
|
1027
1063
|
return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
|
|
1028
1064
|
}
|
|
1029
1065
|
box(e) {
|
|
1030
|
-
return
|
|
1066
|
+
return x(
|
|
1031
1067
|
this.pos(e.one),
|
|
1032
1068
|
this.pos(e.two),
|
|
1033
1069
|
0,
|
|
@@ -1041,62 +1077,62 @@ let gt = class re {
|
|
|
1041
1077
|
offset: this.pos({ x: 0, y: 0 })
|
|
1042
1078
|
};
|
|
1043
1079
|
}
|
|
1044
|
-
static IDENTITY = new
|
|
1080
|
+
static IDENTITY = new P();
|
|
1045
1081
|
};
|
|
1046
|
-
const
|
|
1082
|
+
const Nu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1047
1083
|
__proto__: null,
|
|
1048
|
-
Scale:
|
|
1049
|
-
XY:
|
|
1050
|
-
crudeXYTransform:
|
|
1051
|
-
transform:
|
|
1084
|
+
Scale: $t,
|
|
1085
|
+
XY: Wi,
|
|
1086
|
+
crudeXYTransform: Di,
|
|
1087
|
+
transform: Pi
|
|
1052
1088
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1053
|
-
let
|
|
1089
|
+
let zr = (t, e = 21) => (r = e) => {
|
|
1054
1090
|
let n = "", s = r | 0;
|
|
1055
1091
|
for (; s--; )
|
|
1056
1092
|
n += t[Math.random() * t.length | 0];
|
|
1057
1093
|
return n;
|
|
1058
1094
|
};
|
|
1059
|
-
const
|
|
1095
|
+
const Zr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", Vi = `0123456789${Zr}`, Fr = 11, Gi = zr(Zr, 1), Hi = zr(Vi, Fr - 1), Vt = () => `${Gi()}${Hi()}`, Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1060
1096
|
__proto__: null,
|
|
1061
|
-
LENGTH:
|
|
1062
|
-
create:
|
|
1063
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1097
|
+
LENGTH: Fr,
|
|
1098
|
+
create: Vt
|
|
1099
|
+
}, Symbol.toStringTag, { value: "Module" })), Xi = (t, e) => (r) => r instanceof e || typeof r == "object" && r !== null && "discriminator" in r && r.discriminator === t, Ji = 2 ** 8 - 1, Ki = 2 ** 16 - 1, Qi = 2 ** 32 - 1, _i = 2n ** 64n - 1n, ea = 2 ** 64 - 1, ta = -128, ra = 2 ** 7 - 1, na = -32768, sa = 2 ** 15 - 1, ia = -2147483648, aa = 2 ** 31 - 1, oa = -(2n ** 63n), ze = 2n ** 63n - 1n, ua = -9223372036854776e3, Yr = 2 ** 63 - 1, la = a.enum(["static", "dynamic"]), _t = 365, Ie = 30, ca = a.union([
|
|
1064
1100
|
a.tuple([a.int()]),
|
|
1065
1101
|
a.tuple([a.int(), a.int().min(1).max(12)]),
|
|
1066
1102
|
a.tuple([a.int(), a.int().min(1).max(12), a.int().min(1).max(31)])
|
|
1067
|
-
]),
|
|
1068
|
-
const r = new
|
|
1103
|
+
]), Wr = (t, e) => {
|
|
1104
|
+
const r = new $(e);
|
|
1069
1105
|
if (![
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1106
|
+
c.DAY,
|
|
1107
|
+
c.HOUR,
|
|
1108
|
+
c.MINUTE,
|
|
1109
|
+
c.SECOND,
|
|
1110
|
+
c.MILLISECOND,
|
|
1111
|
+
c.MICROSECOND,
|
|
1112
|
+
c.NANOSECOND
|
|
1077
1113
|
].some((s) => s.equals(r)))
|
|
1078
1114
|
throw new Error(
|
|
1079
1115
|
"Invalid argument for remainder. Must be an even TimeSpan or Timestamp"
|
|
1080
1116
|
);
|
|
1081
1117
|
const n = t.valueOf() % r.valueOf();
|
|
1082
|
-
return t instanceof
|
|
1118
|
+
return t instanceof $ ? new $(n) : new c(n);
|
|
1083
1119
|
};
|
|
1084
|
-
let
|
|
1120
|
+
let $ = class g extends re {
|
|
1085
1121
|
constructor(e, r = "UTC") {
|
|
1086
|
-
if (e == null) super(
|
|
1122
|
+
if (e == null) super(g.now().valueOf());
|
|
1087
1123
|
else if (e instanceof Date)
|
|
1088
|
-
super(BigInt(e.getTime()) *
|
|
1124
|
+
super(BigInt(e.getTime()) * g.MILLISECOND.valueOf());
|
|
1089
1125
|
else if (typeof e == "string")
|
|
1090
|
-
super(
|
|
1091
|
-
else if (Array.isArray(e)) super(
|
|
1126
|
+
super(g.parseDateTimeString(e, r).valueOf());
|
|
1127
|
+
else if (Array.isArray(e)) super(g.parseDate(e));
|
|
1092
1128
|
else {
|
|
1093
1129
|
let n = 0n;
|
|
1094
|
-
e instanceof Number && (e = e.valueOf()), r === "local" && (n =
|
|
1130
|
+
e instanceof Number && (e = e.valueOf()), r === "local" && (n = g.utcOffset.valueOf()), typeof e == "number" && (isFinite(e) ? e === Yr ? e = ze : e = Math.trunc(e) : (isNaN(e) && (e = 0), e === 1 / 0 ? e = g.MAX : e = g.MIN)), B(e) && (e = e.value), super(BigInt(e.valueOf()) + n);
|
|
1095
1131
|
}
|
|
1096
1132
|
}
|
|
1097
1133
|
static parseDate([e = 1970, r = 1, n = 1]) {
|
|
1098
1134
|
const s = new Date(e, r - 1, n, 0, 0, 0, 0);
|
|
1099
|
-
return new
|
|
1135
|
+
return new g(BigInt(s.getTime()) * g.MILLISECOND.valueOf()).truncate(g.DAY).valueOf();
|
|
1100
1136
|
}
|
|
1101
1137
|
/**
|
|
1102
1138
|
* @returns the primitive value of the TimeStamp. Overrides standard JS valueOf()
|
|
@@ -1107,49 +1143,22 @@ let w = class f extends ee {
|
|
|
1107
1143
|
}
|
|
1108
1144
|
static parseTimeString(e, r = "UTC") {
|
|
1109
1145
|
const [n, s, i] = e.split(":");
|
|
1110
|
-
let o = "00",
|
|
1111
|
-
i != null && ([o,
|
|
1112
|
-
let
|
|
1113
|
-
return r === "local" && (
|
|
1146
|
+
let o = "00", h = "00";
|
|
1147
|
+
i != null && ([o, h] = i.split("."));
|
|
1148
|
+
let f = g.hours(parseInt(n ?? "00")).add(g.minutes(parseInt(s ?? "00"))).add(g.seconds(parseInt(o ?? "00"))).add(g.milliseconds(parseInt(h ?? "00")));
|
|
1149
|
+
return r === "local" && (f = f.add(g.utcOffset)), f.valueOf();
|
|
1114
1150
|
}
|
|
1115
1151
|
static parseDateTimeString(e, r = "UTC") {
|
|
1116
1152
|
if (!e.includes("/") && !e.includes("-"))
|
|
1117
|
-
return
|
|
1153
|
+
return g.parseTimeString(e, r);
|
|
1118
1154
|
const n = new Date(e);
|
|
1119
|
-
return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new
|
|
1120
|
-
BigInt(n.getTime()) *
|
|
1155
|
+
return e.includes(":") || n.setUTCHours(0, 0, 0, 0), new g(
|
|
1156
|
+
BigInt(n.getTime()) * g.MILLISECOND.valueOf(),
|
|
1121
1157
|
r
|
|
1122
1158
|
).valueOf();
|
|
1123
1159
|
}
|
|
1124
|
-
/**
|
|
1125
|
-
* Formats the TimeStamp as a string in the specified format.
|
|
1126
|
-
*
|
|
1127
|
-
* @param format - The format to use for the string representation.
|
|
1128
|
-
* @param tzInfo - The timezone to use when creating the string representation.
|
|
1129
|
-
* @returns A string representation of the TimeStamp in the specified format.
|
|
1130
|
-
*/
|
|
1131
|
-
fString(e = "ISO", r = "UTC") {
|
|
1132
|
-
switch (e) {
|
|
1133
|
-
case "ISODate":
|
|
1134
|
-
return this.toISOString(r).slice(0, 10);
|
|
1135
|
-
case "ISOTime":
|
|
1136
|
-
return this.toISOString(r).slice(11, 23);
|
|
1137
|
-
case "time":
|
|
1138
|
-
return this.timeString(!1, r);
|
|
1139
|
-
case "preciseTime":
|
|
1140
|
-
return this.timeString(!0, r);
|
|
1141
|
-
case "date":
|
|
1142
|
-
return this.dateString();
|
|
1143
|
-
case "preciseDate":
|
|
1144
|
-
return `${this.dateString()} ${this.timeString(!0, r)}`;
|
|
1145
|
-
case "dateTime":
|
|
1146
|
-
return `${this.dateString()} ${this.timeString(!1, r)}`;
|
|
1147
|
-
default:
|
|
1148
|
-
return this.toISOString(r);
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
1160
|
toISOString(e = "UTC") {
|
|
1152
|
-
return e === "UTC" ? this.date().toISOString() : this.sub(
|
|
1161
|
+
return e === "UTC" ? this.date().toISOString() : this.sub(g.utcOffset).date().toISOString();
|
|
1153
1162
|
}
|
|
1154
1163
|
timeString(e = !1, r = "UTC") {
|
|
1155
1164
|
const n = this.toISOString(r);
|
|
@@ -1161,8 +1170,8 @@ let w = class f extends ee {
|
|
|
1161
1170
|
}
|
|
1162
1171
|
/** @returns The UTC offset for the time zone of the machine. */
|
|
1163
1172
|
static get utcOffset() {
|
|
1164
|
-
return new
|
|
1165
|
-
BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) *
|
|
1173
|
+
return new c(
|
|
1174
|
+
BigInt((/* @__PURE__ */ new Date()).getTimezoneOffset()) * g.MINUTE.valueOf()
|
|
1166
1175
|
);
|
|
1167
1176
|
}
|
|
1168
1177
|
/**
|
|
@@ -1171,7 +1180,7 @@ let w = class f extends ee {
|
|
|
1171
1180
|
* @param other - The other timestamp.
|
|
1172
1181
|
*/
|
|
1173
1182
|
static since(e) {
|
|
1174
|
-
return new
|
|
1183
|
+
return new g().span(e);
|
|
1175
1184
|
}
|
|
1176
1185
|
/** @returns A JavaScript Date object representing the TimeStamp. */
|
|
1177
1186
|
date() {
|
|
@@ -1184,7 +1193,7 @@ let w = class f extends ee {
|
|
|
1184
1193
|
* @returns True if the TimeStamps are equal, false otherwise.
|
|
1185
1194
|
*/
|
|
1186
1195
|
equals(e) {
|
|
1187
|
-
return this.valueOf() === new
|
|
1196
|
+
return this.valueOf() === new g(e).valueOf();
|
|
1188
1197
|
}
|
|
1189
1198
|
/**
|
|
1190
1199
|
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
@@ -1204,7 +1213,7 @@ let w = class f extends ee {
|
|
|
1204
1213
|
* valid, regardless of the TimeStamp order.
|
|
1205
1214
|
*/
|
|
1206
1215
|
range(e) {
|
|
1207
|
-
return new
|
|
1216
|
+
return new Q(this, e).makeValid();
|
|
1208
1217
|
}
|
|
1209
1218
|
/**
|
|
1210
1219
|
* Creates a TimeRange starting at the TimeStamp and spanning the given
|
|
@@ -1233,7 +1242,7 @@ let w = class f extends ee {
|
|
|
1233
1242
|
* otherwise.
|
|
1234
1243
|
*/
|
|
1235
1244
|
after(e) {
|
|
1236
|
-
return this.valueOf() > new
|
|
1245
|
+
return this.valueOf() > new g(e).valueOf();
|
|
1237
1246
|
}
|
|
1238
1247
|
/**
|
|
1239
1248
|
* Checks if the TimeStamp is after or equal to the given TimeStamp.
|
|
@@ -1243,7 +1252,7 @@ let w = class f extends ee {
|
|
|
1243
1252
|
* false otherwise.
|
|
1244
1253
|
*/
|
|
1245
1254
|
afterEq(e) {
|
|
1246
|
-
return this.valueOf() >= new
|
|
1255
|
+
return this.valueOf() >= new g(e).valueOf();
|
|
1247
1256
|
}
|
|
1248
1257
|
/**
|
|
1249
1258
|
* Checks if the TimeStamp is before the given TimeStamp.
|
|
@@ -1253,7 +1262,7 @@ let w = class f extends ee {
|
|
|
1253
1262
|
* otherwise.
|
|
1254
1263
|
*/
|
|
1255
1264
|
before(e) {
|
|
1256
|
-
return this.valueOf() < new
|
|
1265
|
+
return this.valueOf() < new g(e).valueOf();
|
|
1257
1266
|
}
|
|
1258
1267
|
/**
|
|
1259
1268
|
* Checks if TimeStamp is before or equal to the current timestamp.
|
|
@@ -1263,7 +1272,7 @@ let w = class f extends ee {
|
|
|
1263
1272
|
* false otherwise.
|
|
1264
1273
|
*/
|
|
1265
1274
|
beforeEq(e) {
|
|
1266
|
-
return this.valueOf() <= new
|
|
1275
|
+
return this.valueOf() <= new g(e).valueOf();
|
|
1267
1276
|
}
|
|
1268
1277
|
/**
|
|
1269
1278
|
* Adds a TimeSpan to the TimeStamp.
|
|
@@ -1273,7 +1282,7 @@ let w = class f extends ee {
|
|
|
1273
1282
|
* TimeSpan.
|
|
1274
1283
|
*/
|
|
1275
1284
|
add(e) {
|
|
1276
|
-
return new
|
|
1285
|
+
return new g(ue(this.valueOf(), new c(e).valueOf()));
|
|
1277
1286
|
}
|
|
1278
1287
|
/**
|
|
1279
1288
|
* Subtracts a TimeSpan from the TimeStamp.
|
|
@@ -1283,43 +1292,43 @@ let w = class f extends ee {
|
|
|
1283
1292
|
* TimeSpan.
|
|
1284
1293
|
*/
|
|
1285
1294
|
sub(e) {
|
|
1286
|
-
return new
|
|
1295
|
+
return new g(Z(this.valueOf(), new c(e).valueOf()));
|
|
1287
1296
|
}
|
|
1288
1297
|
/**
|
|
1289
1298
|
* @returns the floating point number of hours since the unix epoch to the timestamp
|
|
1290
1299
|
* value.
|
|
1291
1300
|
*/
|
|
1292
1301
|
get hours() {
|
|
1293
|
-
return Number(this.valueOf()) / Number(
|
|
1302
|
+
return Number(this.valueOf()) / Number(c.HOUR.valueOf());
|
|
1294
1303
|
}
|
|
1295
1304
|
/**
|
|
1296
1305
|
* @returns the floating point number of minutes since the unix epoch to the timestamp
|
|
1297
1306
|
* value.
|
|
1298
1307
|
*/
|
|
1299
1308
|
get minutes() {
|
|
1300
|
-
return Number(this.valueOf()) / Number(
|
|
1309
|
+
return Number(this.valueOf()) / Number(c.MINUTE.valueOf());
|
|
1301
1310
|
}
|
|
1302
1311
|
/**
|
|
1303
1312
|
* @returns the floating point number of days since the unix epoch to the timestamp
|
|
1304
1313
|
* value.
|
|
1305
1314
|
*/
|
|
1306
1315
|
get days() {
|
|
1307
|
-
return Number(this.valueOf()) / Number(
|
|
1316
|
+
return Number(this.valueOf()) / Number(c.DAY.valueOf());
|
|
1308
1317
|
}
|
|
1309
1318
|
/**
|
|
1310
1319
|
* @returns the floating point number of seconds since the unix epoch to the timestamp
|
|
1311
1320
|
* value.
|
|
1312
1321
|
*/
|
|
1313
1322
|
get seconds() {
|
|
1314
|
-
return Number(this.valueOf()) / Number(
|
|
1323
|
+
return Number(this.valueOf()) / Number(c.SECOND.valueOf());
|
|
1315
1324
|
}
|
|
1316
1325
|
/** @returns the floating point number of milliseconds since the unix epoch. */
|
|
1317
1326
|
get milliseconds() {
|
|
1318
|
-
return Number(this.valueOf()) / Number(
|
|
1327
|
+
return Number(this.valueOf()) / Number(g.MILLISECOND.valueOf());
|
|
1319
1328
|
}
|
|
1320
1329
|
/** @returns the floating point number of microseconds since the unix epoch. */
|
|
1321
1330
|
get microseconds() {
|
|
1322
|
-
return Number(this.valueOf()) / Number(
|
|
1331
|
+
return Number(this.valueOf()) / Number(g.MICROSECOND.valueOf());
|
|
1323
1332
|
}
|
|
1324
1333
|
/**
|
|
1325
1334
|
* @returns the floating point number of nanoseconds since the unix epoch.
|
|
@@ -1339,7 +1348,7 @@ let w = class f extends ee {
|
|
|
1339
1348
|
*/
|
|
1340
1349
|
setYear(e) {
|
|
1341
1350
|
const r = this.date();
|
|
1342
|
-
return r.setUTCFullYear(e), new
|
|
1351
|
+
return r.setUTCFullYear(e), new g(r);
|
|
1343
1352
|
}
|
|
1344
1353
|
/** @returns the integer month that the timestamp corresponds to with its year. */
|
|
1345
1354
|
get month() {
|
|
@@ -1351,7 +1360,7 @@ let w = class f extends ee {
|
|
|
1351
1360
|
*/
|
|
1352
1361
|
setMonth(e) {
|
|
1353
1362
|
const r = this.date();
|
|
1354
|
-
return r.setUTCMonth(e), new
|
|
1363
|
+
return r.setUTCMonth(e), new g(r);
|
|
1355
1364
|
}
|
|
1356
1365
|
/** @returns the integer day that the timestamp corresponds to within its month. */
|
|
1357
1366
|
get day() {
|
|
@@ -1363,7 +1372,7 @@ let w = class f extends ee {
|
|
|
1363
1372
|
*/
|
|
1364
1373
|
setDay(e) {
|
|
1365
1374
|
const r = this.date();
|
|
1366
|
-
return r.setUTCDate(e), new
|
|
1375
|
+
return r.setUTCDate(e), new g(r);
|
|
1367
1376
|
}
|
|
1368
1377
|
/**
|
|
1369
1378
|
* @returns the integer hour that the timestamp corresponds to within its day.
|
|
@@ -1383,7 +1392,7 @@ let w = class f extends ee {
|
|
|
1383
1392
|
*/
|
|
1384
1393
|
setLocalHour(e) {
|
|
1385
1394
|
const r = this.date();
|
|
1386
|
-
return r.setHours(e), new
|
|
1395
|
+
return r.setHours(e), new g(r);
|
|
1387
1396
|
}
|
|
1388
1397
|
/**
|
|
1389
1398
|
* @returns a copy of the timestamp with the hour changed.
|
|
@@ -1391,7 +1400,7 @@ let w = class f extends ee {
|
|
|
1391
1400
|
*/
|
|
1392
1401
|
setHour(e) {
|
|
1393
1402
|
const r = this.date();
|
|
1394
|
-
return r.setUTCHours(e), new
|
|
1403
|
+
return r.setUTCHours(e), new g(r);
|
|
1395
1404
|
}
|
|
1396
1405
|
/** @returns the integer minute that the timestamp corresponds to within its hour. */
|
|
1397
1406
|
get minute() {
|
|
@@ -1403,7 +1412,7 @@ let w = class f extends ee {
|
|
|
1403
1412
|
*/
|
|
1404
1413
|
setMinute(e) {
|
|
1405
1414
|
const r = this.date();
|
|
1406
|
-
return r.setUTCMinutes(e), new
|
|
1415
|
+
return r.setUTCMinutes(e), new g(r);
|
|
1407
1416
|
}
|
|
1408
1417
|
/**
|
|
1409
1418
|
* @returns the integer second that the timestamp corresponds to within its
|
|
@@ -1418,11 +1427,11 @@ let w = class f extends ee {
|
|
|
1418
1427
|
*/
|
|
1419
1428
|
setSecond(e) {
|
|
1420
1429
|
const r = this.date();
|
|
1421
|
-
return r.setUTCSeconds(e), new
|
|
1430
|
+
return r.setUTCSeconds(e), new g(r);
|
|
1422
1431
|
}
|
|
1423
1432
|
/**
|
|
1424
|
-
* @
|
|
1425
|
-
*
|
|
1433
|
+
* @returns the integer millisecond that the timestamp corresponds to within its
|
|
1434
|
+
* second.
|
|
1426
1435
|
*/
|
|
1427
1436
|
get millisecond() {
|
|
1428
1437
|
return this.date().getUTCMilliseconds();
|
|
@@ -1433,11 +1442,34 @@ let w = class f extends ee {
|
|
|
1433
1442
|
*/
|
|
1434
1443
|
setMillisecond(e) {
|
|
1435
1444
|
const r = this.date();
|
|
1436
|
-
return r.setUTCMilliseconds(e), new
|
|
1445
|
+
return r.setUTCMilliseconds(e), new g(r);
|
|
1437
1446
|
}
|
|
1438
|
-
/**
|
|
1439
|
-
|
|
1440
|
-
|
|
1447
|
+
/**
|
|
1448
|
+
* Returns a string representation of the TimeStamp.
|
|
1449
|
+
*
|
|
1450
|
+
* @param format - Optional format for the string representation. Defaults to "ISO".
|
|
1451
|
+
* @param tzInfo - Optional timezone info. Defaults to "UTC".
|
|
1452
|
+
* @returns A string representation of the TimeStamp.
|
|
1453
|
+
*/
|
|
1454
|
+
toString(e = "ISO", r = "UTC") {
|
|
1455
|
+
switch (e) {
|
|
1456
|
+
case "ISODate":
|
|
1457
|
+
return this.toISOString(r).slice(0, 10);
|
|
1458
|
+
case "ISOTime":
|
|
1459
|
+
return this.toISOString(r).slice(11, 23);
|
|
1460
|
+
case "time":
|
|
1461
|
+
return this.timeString(!1, r);
|
|
1462
|
+
case "preciseTime":
|
|
1463
|
+
return this.timeString(!0, r);
|
|
1464
|
+
case "date":
|
|
1465
|
+
return this.dateString();
|
|
1466
|
+
case "preciseDate":
|
|
1467
|
+
return `${this.dateString()} ${this.timeString(!0, r)}`;
|
|
1468
|
+
case "dateTime":
|
|
1469
|
+
return `${this.dateString()} ${this.timeString(!1, r)}`;
|
|
1470
|
+
default:
|
|
1471
|
+
return this.toISOString(r);
|
|
1472
|
+
}
|
|
1441
1473
|
}
|
|
1442
1474
|
/**
|
|
1443
1475
|
* @returns A new TimeStamp that is the remainder of the TimeStamp divided by the
|
|
@@ -1451,11 +1483,11 @@ let w = class f extends ee {
|
|
|
1451
1483
|
* @example TimeStamp.now().remainder(TimeStamp.DAY) // => TimeStamp representing the current day
|
|
1452
1484
|
*/
|
|
1453
1485
|
remainder(e) {
|
|
1454
|
-
return
|
|
1486
|
+
return Wr(this, e);
|
|
1455
1487
|
}
|
|
1456
1488
|
/** @returns true if the day portion TimeStamp is today, false otherwise. */
|
|
1457
1489
|
get isToday() {
|
|
1458
|
-
return this.truncate(
|
|
1490
|
+
return this.truncate(c.DAY).equals(g.now().truncate(c.DAY));
|
|
1459
1491
|
}
|
|
1460
1492
|
/**
|
|
1461
1493
|
* Truncates the TimeStamp to the nearest multiple of the given span.
|
|
@@ -1472,7 +1504,7 @@ let w = class f extends ee {
|
|
|
1472
1504
|
* JavaScript can do).
|
|
1473
1505
|
*/
|
|
1474
1506
|
static now() {
|
|
1475
|
-
return new
|
|
1507
|
+
return new g(/* @__PURE__ */ new Date());
|
|
1476
1508
|
}
|
|
1477
1509
|
/**
|
|
1478
1510
|
* Finds the maximum timestamp among the provided timestamps.
|
|
@@ -1481,9 +1513,9 @@ let w = class f extends ee {
|
|
|
1481
1513
|
* @returns The maximum (latest) timestamp from the input.
|
|
1482
1514
|
*/
|
|
1483
1515
|
static max(...e) {
|
|
1484
|
-
let r =
|
|
1516
|
+
let r = g.MIN;
|
|
1485
1517
|
for (const n of e) {
|
|
1486
|
-
const s = new
|
|
1518
|
+
const s = new g(n);
|
|
1487
1519
|
s.after(r) && (r = s);
|
|
1488
1520
|
}
|
|
1489
1521
|
return r;
|
|
@@ -1495,9 +1527,9 @@ let w = class f extends ee {
|
|
|
1495
1527
|
* @returns The minimum (earliest) timestamp from the input.
|
|
1496
1528
|
*/
|
|
1497
1529
|
static min(...e) {
|
|
1498
|
-
let r =
|
|
1530
|
+
let r = g.MAX;
|
|
1499
1531
|
for (const n of e) {
|
|
1500
|
-
const s = new
|
|
1532
|
+
const s = new g(n);
|
|
1501
1533
|
s.before(r) && (r = s);
|
|
1502
1534
|
}
|
|
1503
1535
|
return r;
|
|
@@ -1509,62 +1541,62 @@ let w = class f extends ee {
|
|
|
1509
1541
|
* @returns A TimeStamp representing the given number of nanoseconds.
|
|
1510
1542
|
*/
|
|
1511
1543
|
static nanoseconds(e, r = "UTC") {
|
|
1512
|
-
return new
|
|
1544
|
+
return new g(e, r);
|
|
1513
1545
|
}
|
|
1514
1546
|
/** One nanosecond after the unix epoch */
|
|
1515
|
-
static NANOSECOND =
|
|
1547
|
+
static NANOSECOND = g.nanoseconds(1);
|
|
1516
1548
|
/** @returns a new TimeStamp n microseconds after the unix epoch */
|
|
1517
1549
|
static microseconds(e, r = "UTC") {
|
|
1518
|
-
return
|
|
1550
|
+
return g.nanoseconds(e * 1e3, r);
|
|
1519
1551
|
}
|
|
1520
1552
|
/** One microsecond after the unix epoch */
|
|
1521
|
-
static MICROSECOND =
|
|
1553
|
+
static MICROSECOND = g.microseconds(1);
|
|
1522
1554
|
/** @returns a new TimeStamp n milliseconds after the unix epoch */
|
|
1523
1555
|
static milliseconds(e, r = "UTC") {
|
|
1524
|
-
return
|
|
1556
|
+
return g.microseconds(e * 1e3, r);
|
|
1525
1557
|
}
|
|
1526
1558
|
/** One millisecond after the unix epoch */
|
|
1527
|
-
static MILLISECOND =
|
|
1559
|
+
static MILLISECOND = g.milliseconds(1);
|
|
1528
1560
|
/** @returns a new TimeStamp n seconds after the unix epoch */
|
|
1529
1561
|
static seconds(e, r = "UTC") {
|
|
1530
|
-
return
|
|
1562
|
+
return g.milliseconds(e * 1e3, r);
|
|
1531
1563
|
}
|
|
1532
1564
|
/** One second after the unix epoch */
|
|
1533
|
-
static SECOND =
|
|
1565
|
+
static SECOND = g.seconds(1);
|
|
1534
1566
|
/** @returns a new TimeStamp n minutes after the unix epoch */
|
|
1535
1567
|
static minutes(e, r = "UTC") {
|
|
1536
|
-
return
|
|
1568
|
+
return g.seconds(e * 60, r);
|
|
1537
1569
|
}
|
|
1538
1570
|
/** One minute after the unix epoch */
|
|
1539
|
-
static MINUTE =
|
|
1571
|
+
static MINUTE = g.minutes(1);
|
|
1540
1572
|
/** @returns a new TimeStamp n hours after the unix epoch */
|
|
1541
1573
|
static hours(e, r = "UTC") {
|
|
1542
|
-
return
|
|
1574
|
+
return g.minutes(e * 60, r);
|
|
1543
1575
|
}
|
|
1544
1576
|
/** One hour after the unix epoch */
|
|
1545
|
-
static HOUR =
|
|
1577
|
+
static HOUR = g.hours(1);
|
|
1546
1578
|
/** @returns a new TimeStamp n days after the unix epoch */
|
|
1547
1579
|
static days(e, r = "UTC") {
|
|
1548
|
-
return
|
|
1580
|
+
return g.hours(e * 24, r);
|
|
1549
1581
|
}
|
|
1550
1582
|
/** One day after the unix epoch */
|
|
1551
|
-
static DAY =
|
|
1583
|
+
static DAY = g.days(1);
|
|
1552
1584
|
/** The maximum possible value for a timestamp */
|
|
1553
|
-
static MAX = new
|
|
1585
|
+
static MAX = new g(ze);
|
|
1554
1586
|
/** The minimum possible value for a timestamp */
|
|
1555
|
-
static MIN = new
|
|
1587
|
+
static MIN = new g(0);
|
|
1556
1588
|
/** The unix epoch */
|
|
1557
|
-
static ZERO = new
|
|
1589
|
+
static ZERO = new g(0);
|
|
1558
1590
|
/** A zod schema for validating timestamps */
|
|
1559
1591
|
static z = a.union([
|
|
1560
|
-
a.instanceof(
|
|
1561
|
-
a.object({ value: a.bigint() }).transform((e) => new
|
|
1562
|
-
a.string().transform((e) => new
|
|
1563
|
-
a.number().transform((e) => new
|
|
1564
|
-
a.bigint().transform((e) => new
|
|
1565
|
-
a.date().transform((e) => new
|
|
1566
|
-
a.custom((e) => e instanceof
|
|
1567
|
-
|
|
1592
|
+
a.instanceof(g),
|
|
1593
|
+
a.object({ value: a.bigint() }).transform((e) => new g(e.value)),
|
|
1594
|
+
a.string().transform((e) => new g(BigInt(e))),
|
|
1595
|
+
a.number().transform((e) => new g(e)),
|
|
1596
|
+
a.bigint().transform((e) => new g(e)),
|
|
1597
|
+
a.date().transform((e) => new g(e)),
|
|
1598
|
+
a.custom((e) => e instanceof c).transform((e) => new g(e)),
|
|
1599
|
+
ca.transform((e) => new g(e))
|
|
1568
1600
|
]);
|
|
1569
1601
|
/**
|
|
1570
1602
|
* Sorts two timestamps.
|
|
@@ -1577,9 +1609,10 @@ let w = class f extends ee {
|
|
|
1577
1609
|
static sort(e, r) {
|
|
1578
1610
|
return Number(e.valueOf() - r.valueOf());
|
|
1579
1611
|
}
|
|
1580
|
-
}
|
|
1612
|
+
};
|
|
1613
|
+
class c extends re {
|
|
1581
1614
|
constructor(e) {
|
|
1582
|
-
typeof e == "number" && (e = Math.trunc(e.valueOf())),
|
|
1615
|
+
typeof e == "number" && (e = Math.trunc(e.valueOf())), B(e) && (e = e.value), super(BigInt(e.valueOf()));
|
|
1583
1616
|
}
|
|
1584
1617
|
/**
|
|
1585
1618
|
* Creates a TimeSpan representing the given number of seconds.
|
|
@@ -1588,7 +1621,7 @@ let w = class f extends ee {
|
|
|
1588
1621
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1589
1622
|
*/
|
|
1590
1623
|
static fromSeconds(e) {
|
|
1591
|
-
return e instanceof
|
|
1624
|
+
return e instanceof c ? e : e instanceof st ? e.period : e instanceof $ ? new c(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? c.seconds(e) : new c(e));
|
|
1592
1625
|
}
|
|
1593
1626
|
/**
|
|
1594
1627
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
@@ -1597,7 +1630,7 @@ let w = class f extends ee {
|
|
|
1597
1630
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1598
1631
|
*/
|
|
1599
1632
|
static fromMilliseconds(e) {
|
|
1600
|
-
return e instanceof
|
|
1633
|
+
return e instanceof c ? e : e instanceof st ? e.period : e instanceof $ ? new c(e) : (B(e) && (e = e.value), ["number", "bigint"].includes(typeof e) ? c.milliseconds(e) : new c(e));
|
|
1601
1634
|
}
|
|
1602
1635
|
/**
|
|
1603
1636
|
* @returns the primitive value of the TimeSpan. Overrides standard JS valueOf()
|
|
@@ -1613,7 +1646,7 @@ let w = class f extends ee {
|
|
|
1613
1646
|
* @returns True if the TimeSpan is less than the other TimeSpan, false otherwise.
|
|
1614
1647
|
*/
|
|
1615
1648
|
lessThan(e) {
|
|
1616
|
-
return this.valueOf() < new
|
|
1649
|
+
return this.valueOf() < new c(e).valueOf();
|
|
1617
1650
|
}
|
|
1618
1651
|
/**
|
|
1619
1652
|
* Checks if the TimeSpan is greater than another TimeSpan.
|
|
@@ -1622,7 +1655,7 @@ let w = class f extends ee {
|
|
|
1622
1655
|
* @returns True if the TimeSpan is greater than the other TimeSpan, false otherwise.
|
|
1623
1656
|
*/
|
|
1624
1657
|
greaterThan(e) {
|
|
1625
|
-
return this.valueOf() > new
|
|
1658
|
+
return this.valueOf() > new c(e).valueOf();
|
|
1626
1659
|
}
|
|
1627
1660
|
/**
|
|
1628
1661
|
* Checks if the TimeSpan is less than or equal to another TimeSpan.
|
|
@@ -1631,7 +1664,7 @@ let w = class f extends ee {
|
|
|
1631
1664
|
* @returns True if the TimeSpan is less than or equal to the other TimeSpan, false otherwise.
|
|
1632
1665
|
*/
|
|
1633
1666
|
lessThanOrEqual(e) {
|
|
1634
|
-
return this.valueOf() <= new
|
|
1667
|
+
return this.valueOf() <= new c(e).valueOf();
|
|
1635
1668
|
}
|
|
1636
1669
|
/**
|
|
1637
1670
|
* Checks if the TimeSpan is greater than or equal to another TimeSpan.
|
|
@@ -1640,7 +1673,7 @@ let w = class f extends ee {
|
|
|
1640
1673
|
* @returns True if the TimeSpan is greater than or equal to the other TimeSpan, false otherwise.
|
|
1641
1674
|
*/
|
|
1642
1675
|
greaterThanOrEqual(e) {
|
|
1643
|
-
return this.valueOf() >= new
|
|
1676
|
+
return this.valueOf() >= new c(e).valueOf();
|
|
1644
1677
|
}
|
|
1645
1678
|
/**
|
|
1646
1679
|
* Calculates the remainder of the TimeSpan when divided by another TimeSpan.
|
|
@@ -1649,7 +1682,7 @@ let w = class f extends ee {
|
|
|
1649
1682
|
* @returns A new TimeSpan representing the remainder.
|
|
1650
1683
|
*/
|
|
1651
1684
|
remainder(e) {
|
|
1652
|
-
return
|
|
1685
|
+
return Wr(this, e);
|
|
1653
1686
|
}
|
|
1654
1687
|
/**
|
|
1655
1688
|
* Truncates the TimeSpan to the nearest multiple of the given span.
|
|
@@ -1658,19 +1691,79 @@ let w = class f extends ee {
|
|
|
1658
1691
|
* @returns A new TimeSpan that is truncated to the nearest multiple of the given span.
|
|
1659
1692
|
*/
|
|
1660
1693
|
truncate(e) {
|
|
1661
|
-
return new
|
|
1694
|
+
return new c(
|
|
1662
1695
|
BigInt(Math.trunc(Number(this.valueOf() / e.valueOf()))) * e.valueOf()
|
|
1663
1696
|
);
|
|
1664
1697
|
}
|
|
1665
1698
|
/**
|
|
1666
1699
|
* Returns a string representation of the TimeSpan.
|
|
1667
1700
|
*
|
|
1701
|
+
* @param format - Optional format for the string representation. Defaults to "full".
|
|
1702
|
+
* - "full": Shows all non-zero units with full precision (e.g., "2d 3h 45m 12s 500ms")
|
|
1703
|
+
* - "semantic": Shows 1-2 most significant units (e.g., "2d 3h")
|
|
1668
1704
|
* @returns A string representation of the TimeSpan.
|
|
1669
1705
|
*/
|
|
1670
|
-
toString() {
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1706
|
+
toString(e = "full") {
|
|
1707
|
+
if (e === "semantic") return this.toSemanticString();
|
|
1708
|
+
const r = this.truncate(c.DAY), n = this.truncate(c.HOUR), s = this.truncate(c.MINUTE), i = this.truncate(c.SECOND), o = this.truncate(c.MILLISECOND), h = this.truncate(c.MICROSECOND), f = this.truncate(c.NANOSECOND), l = r, d = n.sub(r), m = s.sub(n), p = i.sub(s), A = o.sub(i), U = h.sub(o), C = f.sub(h);
|
|
1709
|
+
let w = "";
|
|
1710
|
+
return l.isZero || (w += `${l.days}d `), d.isZero || (w += `${d.hours}h `), m.isZero || (w += `${m.minutes}m `), p.isZero || (w += `${p.seconds}s `), A.isZero || (w += `${A.milliseconds}ms `), U.isZero || (w += `${U.microseconds}µs `), C.isZero || (w += `${C.nanoseconds}ns`), w.trim();
|
|
1711
|
+
}
|
|
1712
|
+
toSemanticString() {
|
|
1713
|
+
const e = this.valueOf() < 0n ? -this.valueOf() : this.valueOf(), r = new c(e), n = this.valueOf() < 0n;
|
|
1714
|
+
if (r.valueOf() === 0n) return "0s";
|
|
1715
|
+
if (r.lessThan(c.SECOND)) return "< 1s";
|
|
1716
|
+
const s = r.days, i = r.hours, o = r.minutes, h = r.seconds, f = Math.floor(s / _t), l = Math.floor(s / Ie), d = Math.floor(s / 7), m = Math.floor(s), p = Math.floor(i), A = Math.floor(o), U = Math.floor(h), C = n ? "-" : "";
|
|
1717
|
+
if (f >= 1) {
|
|
1718
|
+
let w = `${f}y`;
|
|
1719
|
+
if (f < 2) {
|
|
1720
|
+
const N = Math.floor(
|
|
1721
|
+
s % _t / Ie
|
|
1722
|
+
);
|
|
1723
|
+
N > 0 && (w += ` ${N}mo`);
|
|
1724
|
+
}
|
|
1725
|
+
return C + w;
|
|
1726
|
+
}
|
|
1727
|
+
if (d >= 1 && s < Ie && s % 7 === 0) {
|
|
1728
|
+
let w = `${d}w`;
|
|
1729
|
+
const N = Math.floor(s % 7), K = Math.floor(i - d * 7 * 24);
|
|
1730
|
+
return d < 2 && (N > 0 ? w += ` ${N}d` : K > 0 && K < 24 && (w += ` ${K}h`)), C + w;
|
|
1731
|
+
}
|
|
1732
|
+
if (l >= 1) {
|
|
1733
|
+
let w = `${l}mo`;
|
|
1734
|
+
if (l < 3) {
|
|
1735
|
+
const N = Math.floor(s % Ie);
|
|
1736
|
+
N > 0 && (w += ` ${N}d`);
|
|
1737
|
+
}
|
|
1738
|
+
return C + w;
|
|
1739
|
+
}
|
|
1740
|
+
if (d >= 1) {
|
|
1741
|
+
let w = `${d}w`;
|
|
1742
|
+
const N = Math.floor(s % 7), K = Math.floor(i - d * 7 * 24);
|
|
1743
|
+
return d < 2 && (N > 0 ? w += ` ${N}d` : K > 0 && K < 24 && (w += ` ${K}h`)), C + w;
|
|
1744
|
+
}
|
|
1745
|
+
if (m >= 1) {
|
|
1746
|
+
let w = `${m}d`;
|
|
1747
|
+
const N = Math.floor(i - m * 24);
|
|
1748
|
+
return m < 2 && N > 0 && (w += ` ${N}h`), C + w;
|
|
1749
|
+
}
|
|
1750
|
+
if (p >= 1) {
|
|
1751
|
+
let w = `${p}h`;
|
|
1752
|
+
if (p < 3) {
|
|
1753
|
+
const N = Math.floor(o - p * 60);
|
|
1754
|
+
N > 0 && (w += ` ${N}m`);
|
|
1755
|
+
}
|
|
1756
|
+
return C + w;
|
|
1757
|
+
}
|
|
1758
|
+
if (A >= 1) {
|
|
1759
|
+
let w = `${A}m`;
|
|
1760
|
+
if (A < 5) {
|
|
1761
|
+
const N = Math.floor(h - A * 60);
|
|
1762
|
+
N > 0 && (w += ` ${N}s`);
|
|
1763
|
+
}
|
|
1764
|
+
return C + w;
|
|
1765
|
+
}
|
|
1766
|
+
return `${C}${U}s`;
|
|
1674
1767
|
}
|
|
1675
1768
|
/**
|
|
1676
1769
|
* Multiplies the TimeSpan by a scalar value.
|
|
@@ -1679,7 +1772,7 @@ let w = class f extends ee {
|
|
|
1679
1772
|
* @returns A new TimeSpan that is this TimeSpan multiplied by the provided value.
|
|
1680
1773
|
*/
|
|
1681
1774
|
mult(e) {
|
|
1682
|
-
return new
|
|
1775
|
+
return new c(R(this.valueOf(), e));
|
|
1683
1776
|
}
|
|
1684
1777
|
/**
|
|
1685
1778
|
* Divides the TimeSpan by a scalar value.
|
|
@@ -1688,31 +1781,31 @@ let w = class f extends ee {
|
|
|
1688
1781
|
* @returns A new TimeSpan that is this TimeSpan divided by the provided value.
|
|
1689
1782
|
*/
|
|
1690
1783
|
div(e) {
|
|
1691
|
-
return new
|
|
1784
|
+
return new c(ve(this.valueOf(), e));
|
|
1692
1785
|
}
|
|
1693
1786
|
/** @returns the decimal number of days in the TimeSpan. */
|
|
1694
1787
|
get days() {
|
|
1695
|
-
return Number(this.valueOf()) / Number(
|
|
1788
|
+
return Number(this.valueOf()) / Number(c.DAY.valueOf());
|
|
1696
1789
|
}
|
|
1697
1790
|
/** @returns the decimal number of hours in the TimeSpan. */
|
|
1698
1791
|
get hours() {
|
|
1699
|
-
return Number(this.valueOf()) / Number(
|
|
1792
|
+
return Number(this.valueOf()) / Number(c.HOUR.valueOf());
|
|
1700
1793
|
}
|
|
1701
1794
|
/** @returns the decimal number of minutes in the TimeSpan. */
|
|
1702
1795
|
get minutes() {
|
|
1703
|
-
return Number(this.valueOf()) / Number(
|
|
1796
|
+
return Number(this.valueOf()) / Number(c.MINUTE.valueOf());
|
|
1704
1797
|
}
|
|
1705
1798
|
/** @returns The number of seconds in the TimeSpan. */
|
|
1706
1799
|
get seconds() {
|
|
1707
|
-
return Number(this.valueOf()) / Number(
|
|
1800
|
+
return Number(this.valueOf()) / Number(c.SECOND.valueOf());
|
|
1708
1801
|
}
|
|
1709
1802
|
/** @returns The number of milliseconds in the TimeSpan. */
|
|
1710
1803
|
get milliseconds() {
|
|
1711
|
-
return Number(this.valueOf()) / Number(
|
|
1804
|
+
return Number(this.valueOf()) / Number(c.MILLISECOND.valueOf());
|
|
1712
1805
|
}
|
|
1713
1806
|
/** @returns The number of microseconds in the TimeSpan. */
|
|
1714
1807
|
get microseconds() {
|
|
1715
|
-
return Number(this.valueOf()) / Number(
|
|
1808
|
+
return Number(this.valueOf()) / Number(c.MICROSECOND.valueOf());
|
|
1716
1809
|
}
|
|
1717
1810
|
/** @returns The number of nanoseconds in the TimeSpan. */
|
|
1718
1811
|
get nanoseconds() {
|
|
@@ -1732,7 +1825,7 @@ let w = class f extends ee {
|
|
|
1732
1825
|
* @returns True if the TimeSpans are equal, false otherwise.
|
|
1733
1826
|
*/
|
|
1734
1827
|
equals(e) {
|
|
1735
|
-
return this.valueOf() === new
|
|
1828
|
+
return this.valueOf() === new c(e).valueOf();
|
|
1736
1829
|
}
|
|
1737
1830
|
/**
|
|
1738
1831
|
* Adds a TimeSpan to the TimeSpan.
|
|
@@ -1740,7 +1833,7 @@ let w = class f extends ee {
|
|
|
1740
1833
|
* @returns A new TimeSpan representing the sum of the two TimeSpans.
|
|
1741
1834
|
*/
|
|
1742
1835
|
add(e) {
|
|
1743
|
-
return new
|
|
1836
|
+
return new c(this.valueOf() + new c(e).valueOf());
|
|
1744
1837
|
}
|
|
1745
1838
|
/**
|
|
1746
1839
|
* Creates a TimeSpan representing the duration between the two timestamps.
|
|
@@ -1748,7 +1841,7 @@ let w = class f extends ee {
|
|
|
1748
1841
|
* @param other
|
|
1749
1842
|
*/
|
|
1750
1843
|
sub(e) {
|
|
1751
|
-
return new
|
|
1844
|
+
return new c(this.valueOf() - new c(e).valueOf());
|
|
1752
1845
|
}
|
|
1753
1846
|
/**
|
|
1754
1847
|
* Creates a TimeSpan representing the given number of nanoseconds.
|
|
@@ -1757,10 +1850,10 @@ let w = class f extends ee {
|
|
|
1757
1850
|
* @returns A TimeSpan representing the given number of nanoseconds.
|
|
1758
1851
|
*/
|
|
1759
1852
|
static nanoseconds(e = 1) {
|
|
1760
|
-
return new
|
|
1853
|
+
return new c(e);
|
|
1761
1854
|
}
|
|
1762
1855
|
/** A nanosecond. */
|
|
1763
|
-
static NANOSECOND =
|
|
1856
|
+
static NANOSECOND = c.nanoseconds(1);
|
|
1764
1857
|
/**
|
|
1765
1858
|
* Creates a TimeSpan representing the given number of microseconds.
|
|
1766
1859
|
*
|
|
@@ -1768,10 +1861,10 @@ let w = class f extends ee {
|
|
|
1768
1861
|
* @returns A TimeSpan representing the given number of microseconds.
|
|
1769
1862
|
*/
|
|
1770
1863
|
static microseconds(e = 1) {
|
|
1771
|
-
return
|
|
1864
|
+
return c.nanoseconds(R(e, 1e3));
|
|
1772
1865
|
}
|
|
1773
1866
|
/** A microsecond. */
|
|
1774
|
-
static MICROSECOND =
|
|
1867
|
+
static MICROSECOND = c.microseconds(1);
|
|
1775
1868
|
/**
|
|
1776
1869
|
* Creates a TimeSpan representing the given number of milliseconds.
|
|
1777
1870
|
*
|
|
@@ -1779,10 +1872,10 @@ let w = class f extends ee {
|
|
|
1779
1872
|
* @returns A TimeSpan representing the given number of milliseconds.
|
|
1780
1873
|
*/
|
|
1781
1874
|
static milliseconds(e = 1) {
|
|
1782
|
-
return
|
|
1875
|
+
return c.microseconds(R(e, 1e3));
|
|
1783
1876
|
}
|
|
1784
1877
|
/** A millisecond. */
|
|
1785
|
-
static MILLISECOND =
|
|
1878
|
+
static MILLISECOND = c.milliseconds(1);
|
|
1786
1879
|
/**
|
|
1787
1880
|
* Creates a TimeSpan representing the given number of seconds.
|
|
1788
1881
|
*
|
|
@@ -1790,10 +1883,10 @@ let w = class f extends ee {
|
|
|
1790
1883
|
* @returns A TimeSpan representing the given number of seconds.
|
|
1791
1884
|
*/
|
|
1792
1885
|
static seconds(e = 1) {
|
|
1793
|
-
return
|
|
1886
|
+
return c.milliseconds(R(e, 1e3));
|
|
1794
1887
|
}
|
|
1795
1888
|
/** A second. */
|
|
1796
|
-
static SECOND =
|
|
1889
|
+
static SECOND = c.seconds(1);
|
|
1797
1890
|
/**
|
|
1798
1891
|
* Creates a TimeSpan representing the given number of minutes.
|
|
1799
1892
|
*
|
|
@@ -1801,10 +1894,10 @@ let w = class f extends ee {
|
|
|
1801
1894
|
* @returns A TimeSpan representing the given number of minutes.
|
|
1802
1895
|
*/
|
|
1803
1896
|
static minutes(e = 1) {
|
|
1804
|
-
return
|
|
1897
|
+
return c.seconds(R(e, 60));
|
|
1805
1898
|
}
|
|
1806
1899
|
/** A minute. */
|
|
1807
|
-
static MINUTE =
|
|
1900
|
+
static MINUTE = c.minutes(1);
|
|
1808
1901
|
/**
|
|
1809
1902
|
* Creates a TimeSpan representing the given number of hours.
|
|
1810
1903
|
*
|
|
@@ -1812,10 +1905,10 @@ let w = class f extends ee {
|
|
|
1812
1905
|
* @returns A TimeSpan representing the given number of hours.
|
|
1813
1906
|
*/
|
|
1814
1907
|
static hours(e) {
|
|
1815
|
-
return
|
|
1908
|
+
return c.minutes(R(e, 60));
|
|
1816
1909
|
}
|
|
1817
1910
|
/** Represents an hour. */
|
|
1818
|
-
static HOUR =
|
|
1911
|
+
static HOUR = c.hours(1);
|
|
1819
1912
|
/**
|
|
1820
1913
|
* Creates a TimeSpan representing the given number of days.
|
|
1821
1914
|
*
|
|
@@ -1823,30 +1916,30 @@ let w = class f extends ee {
|
|
|
1823
1916
|
* @returns A TimeSpan representing the given number of days.
|
|
1824
1917
|
*/
|
|
1825
1918
|
static days(e) {
|
|
1826
|
-
return
|
|
1919
|
+
return c.hours(R(e, 24));
|
|
1827
1920
|
}
|
|
1828
1921
|
/** Represents a day. */
|
|
1829
|
-
static DAY =
|
|
1922
|
+
static DAY = c.days(1);
|
|
1830
1923
|
/** The maximum possible value for a TimeSpan. */
|
|
1831
|
-
static MAX = new
|
|
1924
|
+
static MAX = new c(ze);
|
|
1832
1925
|
/** The minimum possible value for a TimeSpan. */
|
|
1833
|
-
static MIN = new
|
|
1926
|
+
static MIN = new c(0);
|
|
1834
1927
|
/** The zero value for a TimeSpan. */
|
|
1835
|
-
static ZERO = new
|
|
1836
|
-
/** A zod schema for validating and transforming
|
|
1928
|
+
static ZERO = new c(0);
|
|
1929
|
+
/** A zod schema for validating and transforming time spans */
|
|
1837
1930
|
static z = a.union([
|
|
1838
|
-
a.object({ value: a.bigint() }).transform((e) => new
|
|
1839
|
-
a.string().transform((e) => new
|
|
1840
|
-
a.number().transform((e) => new
|
|
1841
|
-
a.bigint().transform((e) => new
|
|
1842
|
-
a.instanceof(
|
|
1843
|
-
a.instanceof(
|
|
1844
|
-
a.custom((e) => e instanceof
|
|
1931
|
+
a.object({ value: a.bigint() }).transform((e) => new c(e.value)),
|
|
1932
|
+
a.string().transform((e) => new c(BigInt(e))),
|
|
1933
|
+
a.number().transform((e) => new c(e)),
|
|
1934
|
+
a.bigint().transform((e) => new c(e)),
|
|
1935
|
+
a.instanceof(c),
|
|
1936
|
+
a.instanceof($).transform((e) => new c(e)),
|
|
1937
|
+
a.custom((e) => e instanceof st).transform((e) => new c(e))
|
|
1845
1938
|
]);
|
|
1846
|
-
}
|
|
1847
|
-
class
|
|
1939
|
+
}
|
|
1940
|
+
let st = class j extends re {
|
|
1848
1941
|
constructor(e) {
|
|
1849
|
-
|
|
1942
|
+
B(e) && (e = e.value), super(e.valueOf());
|
|
1850
1943
|
}
|
|
1851
1944
|
/** @returns a pretty string representation of the rate in the format "X Hz". */
|
|
1852
1945
|
toString() {
|
|
@@ -1854,7 +1947,7 @@ class E extends ee {
|
|
|
1854
1947
|
}
|
|
1855
1948
|
/** @returns The number of seconds in the Rate. */
|
|
1856
1949
|
equals(e) {
|
|
1857
|
-
return this.valueOf() === new
|
|
1950
|
+
return this.valueOf() === new j(e).valueOf();
|
|
1858
1951
|
}
|
|
1859
1952
|
/**
|
|
1860
1953
|
* Calculates the period of the Rate as a TimeSpan.
|
|
@@ -1862,7 +1955,7 @@ class E extends ee {
|
|
|
1862
1955
|
* @returns A TimeSpan representing the period of the Rate.
|
|
1863
1956
|
*/
|
|
1864
1957
|
get period() {
|
|
1865
|
-
return
|
|
1958
|
+
return c.seconds(1 / this.valueOf());
|
|
1866
1959
|
}
|
|
1867
1960
|
/**
|
|
1868
1961
|
* Calculates the number of samples in the given TimeSpan at this rate.
|
|
@@ -1871,7 +1964,7 @@ class E extends ee {
|
|
|
1871
1964
|
* @returns The number of samples in the given TimeSpan at this rate.
|
|
1872
1965
|
*/
|
|
1873
1966
|
sampleCount(e) {
|
|
1874
|
-
return new
|
|
1967
|
+
return new c(e).seconds * this.valueOf();
|
|
1875
1968
|
}
|
|
1876
1969
|
/**
|
|
1877
1970
|
* Calculates the number of bytes in the given TimeSpan at this rate.
|
|
@@ -1881,7 +1974,7 @@ class E extends ee {
|
|
|
1881
1974
|
* @returns The number of bytes in the given TimeSpan at this rate.
|
|
1882
1975
|
*/
|
|
1883
1976
|
byteCount(e, r) {
|
|
1884
|
-
return this.sampleCount(e) * new
|
|
1977
|
+
return this.sampleCount(e) * new M(r).valueOf();
|
|
1885
1978
|
}
|
|
1886
1979
|
/**
|
|
1887
1980
|
* Calculates a TimeSpan given the number of samples at this rate.
|
|
@@ -1890,7 +1983,7 @@ class E extends ee {
|
|
|
1890
1983
|
* @returns A TimeSpan that corresponds to the given number of samples.
|
|
1891
1984
|
*/
|
|
1892
1985
|
span(e) {
|
|
1893
|
-
return
|
|
1986
|
+
return c.seconds(e / this.valueOf());
|
|
1894
1987
|
}
|
|
1895
1988
|
/**
|
|
1896
1989
|
* Calculates a TimeSpan given the number of bytes at this rate.
|
|
@@ -1900,7 +1993,7 @@ class E extends ee {
|
|
|
1900
1993
|
* @returns A TimeSpan that corresponds to the given number of bytes.
|
|
1901
1994
|
*/
|
|
1902
1995
|
byteSpan(e, r) {
|
|
1903
|
-
return this.span(e.valueOf() / new
|
|
1996
|
+
return this.span(e.valueOf() / new M(r).valueOf());
|
|
1904
1997
|
}
|
|
1905
1998
|
/**
|
|
1906
1999
|
* Adds another Rate to this Rate.
|
|
@@ -1909,7 +2002,7 @@ class E extends ee {
|
|
|
1909
2002
|
* @returns A new Rate representing the sum of the two rates.
|
|
1910
2003
|
*/
|
|
1911
2004
|
add(e) {
|
|
1912
|
-
return new
|
|
2005
|
+
return new j(ue(this.valueOf(), new j(e).valueOf()));
|
|
1913
2006
|
}
|
|
1914
2007
|
/**
|
|
1915
2008
|
* Subtracts another Rate from this Rate.
|
|
@@ -1918,7 +2011,7 @@ class E extends ee {
|
|
|
1918
2011
|
* @returns A new Rate representing the difference of the two rates.
|
|
1919
2012
|
*/
|
|
1920
2013
|
sub(e) {
|
|
1921
|
-
return new
|
|
2014
|
+
return new j(Z(this.valueOf(), new j(e).valueOf()));
|
|
1922
2015
|
}
|
|
1923
2016
|
/**
|
|
1924
2017
|
* Multiplies this Rate by a scalar value.
|
|
@@ -1927,7 +2020,7 @@ class E extends ee {
|
|
|
1927
2020
|
* @returns A new Rate representing this Rate multiplied by the value.
|
|
1928
2021
|
*/
|
|
1929
2022
|
mult(e) {
|
|
1930
|
-
return new
|
|
2023
|
+
return new j(R(this.valueOf(), e));
|
|
1931
2024
|
}
|
|
1932
2025
|
/**
|
|
1933
2026
|
* Divides this Rate by a scalar value.
|
|
@@ -1936,7 +2029,7 @@ class E extends ee {
|
|
|
1936
2029
|
* @returns A new Rate representing this Rate divided by the value.
|
|
1937
2030
|
*/
|
|
1938
2031
|
div(e) {
|
|
1939
|
-
return new
|
|
2032
|
+
return new j(ve(this.valueOf(), e));
|
|
1940
2033
|
}
|
|
1941
2034
|
/**
|
|
1942
2035
|
* Creates a Rate representing the given number of Hz.
|
|
@@ -1945,7 +2038,7 @@ class E extends ee {
|
|
|
1945
2038
|
* @returns A Rate representing the given number of Hz.
|
|
1946
2039
|
*/
|
|
1947
2040
|
static hz(e) {
|
|
1948
|
-
return new
|
|
2041
|
+
return new j(e);
|
|
1949
2042
|
}
|
|
1950
2043
|
/**
|
|
1951
2044
|
* Creates a Rate representing the given number of kHz.
|
|
@@ -1954,15 +2047,14 @@ class E extends ee {
|
|
|
1954
2047
|
* @returns A Rate representing the given number of kHz.
|
|
1955
2048
|
*/
|
|
1956
2049
|
static khz(e) {
|
|
1957
|
-
return
|
|
2050
|
+
return j.hz(e * 1e3);
|
|
1958
2051
|
}
|
|
1959
2052
|
/** A zod schema for validating and transforming rates */
|
|
1960
2053
|
static z = a.union([
|
|
1961
|
-
a.number().transform((e) => new
|
|
1962
|
-
a.instanceof(
|
|
2054
|
+
a.number().transform((e) => new j(e)),
|
|
2055
|
+
a.instanceof(j)
|
|
1963
2056
|
]);
|
|
1964
|
-
}
|
|
1965
|
-
let I = class M extends ee {
|
|
2057
|
+
}, M = class E extends re {
|
|
1966
2058
|
/**
|
|
1967
2059
|
* Creates a Density representing the given number of bytes per value.
|
|
1968
2060
|
*
|
|
@@ -1971,7 +2063,7 @@ let I = class M extends ee {
|
|
|
1971
2063
|
* @returns A Density representing the given number of bytes per value.
|
|
1972
2064
|
*/
|
|
1973
2065
|
constructor(e) {
|
|
1974
|
-
|
|
2066
|
+
B(e) && (e = e.value), super(e.valueOf());
|
|
1975
2067
|
}
|
|
1976
2068
|
/**
|
|
1977
2069
|
* Calculates the number of values in the given Size.
|
|
@@ -1989,7 +2081,7 @@ let I = class M extends ee {
|
|
|
1989
2081
|
* @returns A Size representing the given number of values.
|
|
1990
2082
|
*/
|
|
1991
2083
|
size(e) {
|
|
1992
|
-
return new
|
|
2084
|
+
return new Ze(e * this.valueOf());
|
|
1993
2085
|
}
|
|
1994
2086
|
/**
|
|
1995
2087
|
* Adds another Density to this Density.
|
|
@@ -1998,7 +2090,7 @@ let I = class M extends ee {
|
|
|
1998
2090
|
* @returns A new Density representing the sum of the two densities.
|
|
1999
2091
|
*/
|
|
2000
2092
|
add(e) {
|
|
2001
|
-
return new
|
|
2093
|
+
return new E(ue(this.valueOf(), new E(e).valueOf()));
|
|
2002
2094
|
}
|
|
2003
2095
|
/**
|
|
2004
2096
|
* Subtracts another Density from this Density.
|
|
@@ -2007,7 +2099,7 @@ let I = class M extends ee {
|
|
|
2007
2099
|
* @returns A new Density representing the difference of the two densities.
|
|
2008
2100
|
*/
|
|
2009
2101
|
sub(e) {
|
|
2010
|
-
return new
|
|
2102
|
+
return new E(Z(this.valueOf(), new E(e).valueOf()));
|
|
2011
2103
|
}
|
|
2012
2104
|
/**
|
|
2013
2105
|
* Multiplies this Density by a scalar value.
|
|
@@ -2016,7 +2108,7 @@ let I = class M extends ee {
|
|
|
2016
2108
|
* @returns A new Density representing this Density multiplied by the value.
|
|
2017
2109
|
*/
|
|
2018
2110
|
mult(e) {
|
|
2019
|
-
return new
|
|
2111
|
+
return new E(R(this.valueOf(), e));
|
|
2020
2112
|
}
|
|
2021
2113
|
/**
|
|
2022
2114
|
* Divides this Density by a scalar value.
|
|
@@ -2025,26 +2117,26 @@ let I = class M extends ee {
|
|
|
2025
2117
|
* @returns A new Density representing this Density divided by the value.
|
|
2026
2118
|
*/
|
|
2027
2119
|
div(e) {
|
|
2028
|
-
return new
|
|
2120
|
+
return new E(ve(this.valueOf(), e));
|
|
2029
2121
|
}
|
|
2030
2122
|
/** Unknown/Invalid Density. */
|
|
2031
|
-
static UNKNOWN = new
|
|
2123
|
+
static UNKNOWN = new E(0);
|
|
2032
2124
|
/** 128 bits per value. */
|
|
2033
|
-
static BIT128 = new
|
|
2125
|
+
static BIT128 = new E(16);
|
|
2034
2126
|
/** 64 bits per value. */
|
|
2035
|
-
static BIT64 = new
|
|
2127
|
+
static BIT64 = new E(8);
|
|
2036
2128
|
/** 32 bits per value. */
|
|
2037
|
-
static BIT32 = new
|
|
2129
|
+
static BIT32 = new E(4);
|
|
2038
2130
|
/** 16 bits per value. */
|
|
2039
|
-
static BIT16 = new
|
|
2131
|
+
static BIT16 = new E(2);
|
|
2040
2132
|
/** 8 bits per value. */
|
|
2041
|
-
static BIT8 = new
|
|
2133
|
+
static BIT8 = new E(1);
|
|
2042
2134
|
/** A zod schema for validating and transforming densities */
|
|
2043
2135
|
static z = a.union([
|
|
2044
|
-
a.number().transform((e) => new
|
|
2045
|
-
a.instanceof(
|
|
2136
|
+
a.number().transform((e) => new E(e)),
|
|
2137
|
+
a.instanceof(E)
|
|
2046
2138
|
]);
|
|
2047
|
-
},
|
|
2139
|
+
}, Q = class k {
|
|
2048
2140
|
/**
|
|
2049
2141
|
* The starting TimeStamp of the TimeRange.
|
|
2050
2142
|
*
|
|
@@ -2070,11 +2162,11 @@ let I = class M extends ee {
|
|
|
2070
2162
|
* @param end - A TimeStamp representing the end of the range.
|
|
2071
2163
|
*/
|
|
2072
2164
|
constructor(e, r) {
|
|
2073
|
-
typeof e == "object" && "start" in e ? (this.start = new
|
|
2165
|
+
typeof e == "object" && "start" in e ? (this.start = new $(e.start), this.end = new $(e.end)) : (this.start = new $(e), this.end = new $(r));
|
|
2074
2166
|
}
|
|
2075
2167
|
/** @returns The TimeSpan occupied by the TimeRange. */
|
|
2076
2168
|
get span() {
|
|
2077
|
-
return new
|
|
2169
|
+
return new c(this.end.valueOf() - this.start.valueOf());
|
|
2078
2170
|
}
|
|
2079
2171
|
/**
|
|
2080
2172
|
* Checks if the timestamp is valid i.e. the start is before the end.
|
|
@@ -2093,12 +2185,12 @@ let I = class M extends ee {
|
|
|
2093
2185
|
return this.isValid ? this : this.swap();
|
|
2094
2186
|
}
|
|
2095
2187
|
/**
|
|
2096
|
-
* Checks if the TimeRange
|
|
2188
|
+
* Checks if the TimeRange is zero (both start and end are TimeStamp.ZERO).
|
|
2097
2189
|
*
|
|
2098
|
-
* @returns True if
|
|
2190
|
+
* @returns True if both start and end are TimeStamp.ZERO, false otherwise.
|
|
2099
2191
|
*/
|
|
2100
2192
|
get isZero() {
|
|
2101
|
-
return this.
|
|
2193
|
+
return this.start.isZero && this.end.isZero;
|
|
2102
2194
|
}
|
|
2103
2195
|
/**
|
|
2104
2196
|
* @returns the TimeRange as a numeric object with start and end properties.
|
|
@@ -2112,7 +2204,7 @@ let I = class M extends ee {
|
|
|
2112
2204
|
* @returns A TimeRange with the start and end swapped.
|
|
2113
2205
|
*/
|
|
2114
2206
|
swap() {
|
|
2115
|
-
return new
|
|
2207
|
+
return new k(this.end, this.start);
|
|
2116
2208
|
}
|
|
2117
2209
|
get numericBounds() {
|
|
2118
2210
|
return {
|
|
@@ -2126,7 +2218,7 @@ let I = class M extends ee {
|
|
|
2126
2218
|
* @param other - The TimeRange to compare to.
|
|
2127
2219
|
* @returns True if the TimeRange is equal to the given TimeRange.
|
|
2128
2220
|
*/
|
|
2129
|
-
equals(e, r =
|
|
2221
|
+
equals(e, r = c.ZERO) {
|
|
2130
2222
|
if (r.isZero)
|
|
2131
2223
|
return this.start.equals(e.start) && this.end.equals(e.end);
|
|
2132
2224
|
let n = this.start.sub(e.start).valueOf(), s = this.end.sub(e.end).valueOf();
|
|
@@ -2146,7 +2238,7 @@ let I = class M extends ee {
|
|
|
2146
2238
|
* @returns A pretty string representation of the TimeRange.
|
|
2147
2239
|
*/
|
|
2148
2240
|
toPrettyString() {
|
|
2149
|
-
return `${this.start.
|
|
2241
|
+
return `${this.start.toString("preciseDate")} - ${this.span.toString()}`;
|
|
2150
2242
|
}
|
|
2151
2243
|
/**
|
|
2152
2244
|
* Checks if the two time ranges overlap. If the two time ranges are equal, returns
|
|
@@ -2159,16 +2251,16 @@ let I = class M extends ee {
|
|
|
2159
2251
|
* checking for overlap.
|
|
2160
2252
|
* @returns True if the two TimeRanges overlap, false otherwise.
|
|
2161
2253
|
*/
|
|
2162
|
-
overlapsWith(e, r =
|
|
2254
|
+
overlapsWith(e, r = c.ZERO) {
|
|
2163
2255
|
e = e.makeValid();
|
|
2164
2256
|
const n = this.makeValid();
|
|
2165
2257
|
if (this.equals(e)) return !0;
|
|
2166
2258
|
if (e.end.equals(n.start) || n.end.equals(e.start)) return !1;
|
|
2167
|
-
const s =
|
|
2168
|
-
return i.before(s) ? !1 : new
|
|
2259
|
+
const s = $.max(n.start, e.start), i = $.min(n.end, e.end);
|
|
2260
|
+
return i.before(s) ? !1 : new c(i.sub(s)).greaterThanOrEqual(r);
|
|
2169
2261
|
}
|
|
2170
2262
|
contains(e) {
|
|
2171
|
-
return e instanceof
|
|
2263
|
+
return e instanceof k ? this.contains(e.start) && this.contains(e.end) : this.start.beforeEq(e) && this.end.after(e);
|
|
2172
2264
|
}
|
|
2173
2265
|
/**
|
|
2174
2266
|
* Returns a new TimeRange that is bound by the given TimeRange.
|
|
@@ -2182,25 +2274,23 @@ let I = class M extends ee {
|
|
|
2182
2274
|
* console.log(bounded); // TimeRange(1500, 2000)
|
|
2183
2275
|
*/
|
|
2184
2276
|
boundBy(e) {
|
|
2185
|
-
const r = new
|
|
2277
|
+
const r = new k(this.start, this.end);
|
|
2186
2278
|
return e.start.after(this.start) && (r.start = e.start), e.start.after(this.end) && (r.end = e.start), e.end.before(this.end) && (r.end = e.end), e.end.before(this.start) && (r.start = e.end), r;
|
|
2187
2279
|
}
|
|
2188
2280
|
static max(...e) {
|
|
2189
|
-
return new
|
|
2190
|
-
|
|
2191
|
-
|
|
2281
|
+
return new k(
|
|
2282
|
+
$.min(...e.map((r) => r.start)),
|
|
2283
|
+
$.max(...e.map((r) => r.end))
|
|
2192
2284
|
);
|
|
2193
2285
|
}
|
|
2194
2286
|
/** The maximum possible time range. */
|
|
2195
|
-
static MAX = new
|
|
2196
|
-
/** The minimum possible time range. */
|
|
2197
|
-
static MIN = new U(w.MAX, w.MIN);
|
|
2287
|
+
static MAX = new k($.MIN, $.MAX);
|
|
2198
2288
|
/** A time range whose start and end are both zero. */
|
|
2199
|
-
static ZERO = new
|
|
2289
|
+
static ZERO = new k($.ZERO, $.ZERO);
|
|
2200
2290
|
/** A zod schema for validating and transforming time ranges */
|
|
2201
2291
|
static z = a.union([
|
|
2202
|
-
a.object({ start:
|
|
2203
|
-
a.instanceof(
|
|
2292
|
+
a.object({ start: $.z, end: $.z }).transform((e) => new k(e.start, e.end)),
|
|
2293
|
+
a.instanceof(k)
|
|
2204
2294
|
]);
|
|
2205
2295
|
/**
|
|
2206
2296
|
* Sorts two time ranges. The range with the earlier start time is considered less than
|
|
@@ -2214,7 +2304,7 @@ let I = class M extends ee {
|
|
|
2214
2304
|
* equal.
|
|
2215
2305
|
*/
|
|
2216
2306
|
static sort(e, r) {
|
|
2217
|
-
return
|
|
2307
|
+
return $.sort(e.start, r.start) || $.sort(e.end, r.end);
|
|
2218
2308
|
}
|
|
2219
2309
|
/**
|
|
2220
2310
|
* Simplify takes the list of `TimeRange`s, makes all of them valid, sorts them, and
|
|
@@ -2224,17 +2314,17 @@ let I = class M extends ee {
|
|
|
2224
2314
|
* @returns A list of simplified `TimeRange`s.
|
|
2225
2315
|
*/
|
|
2226
2316
|
static simplify(e) {
|
|
2227
|
-
return e.map((r) => r.makeValid()).sort((r, n) =>
|
|
2228
|
-
if (n.isZero) return r;
|
|
2317
|
+
return e.map((r) => r.makeValid()).sort((r, n) => k.sort(r, n)).reduce((r, n) => {
|
|
2318
|
+
if (n.span.isZero) return r;
|
|
2229
2319
|
if (r.length === 0)
|
|
2230
2320
|
return r.push(n), r;
|
|
2231
2321
|
const s = r[r.length - 1];
|
|
2232
|
-
return s.overlapsWith(n) || s.end.equals(n.start) ? s.end =
|
|
2322
|
+
return s.overlapsWith(n) || s.end.equals(n.start) ? s.end = $.max(s.end, n.end) : r.push(n), r;
|
|
2233
2323
|
}, []);
|
|
2234
2324
|
}
|
|
2235
|
-
},
|
|
2325
|
+
}, S = class u extends re {
|
|
2236
2326
|
constructor(e) {
|
|
2237
|
-
if (
|
|
2327
|
+
if (B(e) && (e = e.value), e instanceof u || typeof e == "string" || typeof e.valueOf() == "string")
|
|
2238
2328
|
super(e.valueOf());
|
|
2239
2329
|
else {
|
|
2240
2330
|
const r = u.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);
|
|
@@ -2264,9 +2354,10 @@ let I = class M extends ee {
|
|
|
2264
2354
|
matches(...e) {
|
|
2265
2355
|
return e.some((r) => this.equals(r));
|
|
2266
2356
|
}
|
|
2267
|
-
/** @returns a string representation of the DataType.
|
|
2268
|
-
|
|
2269
|
-
|
|
2357
|
+
/** @returns a string representation of the DataType. If short is true, a 1-4
|
|
2358
|
+
* character representation (i64, str, etc.) is returned instead. */
|
|
2359
|
+
toString(e = !1) {
|
|
2360
|
+
return e ? u.SHORT_STRINGS.get(this.valueOf()) ?? this.valueOf() : this.valueOf();
|
|
2270
2361
|
}
|
|
2271
2362
|
/**
|
|
2272
2363
|
* @returns true if the DataType has a variable density.
|
|
@@ -2370,11 +2461,11 @@ let I = class M extends ee {
|
|
|
2370
2461
|
static UINT16 = new u("uint16");
|
|
2371
2462
|
/** Represents a 8-bit unsigned integer value. */
|
|
2372
2463
|
static UINT8 = new u("uint8");
|
|
2373
|
-
/** Represents a boolean value.
|
|
2374
|
-
static BOOLEAN =
|
|
2464
|
+
/** Represents a boolean value. Stored as a 8-bit unsigned integer. */
|
|
2465
|
+
static BOOLEAN = new u("boolean");
|
|
2375
2466
|
/** Represents a 64-bit unix epoch. */
|
|
2376
2467
|
static TIMESTAMP = new u("timestamp");
|
|
2377
|
-
/** Represents a UUID data type */
|
|
2468
|
+
/** Represents a UUID data type. */
|
|
2378
2469
|
static UUID = new u("uuid");
|
|
2379
2470
|
/** Represents a string data type. Strings have an unknown density, and are separate
|
|
2380
2471
|
* by a newline character. */
|
|
@@ -2411,20 +2502,20 @@ let I = class M extends ee {
|
|
|
2411
2502
|
[BigInt64Array.name, u.INT64]
|
|
2412
2503
|
]);
|
|
2413
2504
|
static DENSITIES = /* @__PURE__ */ new Map([
|
|
2414
|
-
[u.UINT8.toString(),
|
|
2415
|
-
[u.UINT16.toString(),
|
|
2416
|
-
[u.UINT32.toString(),
|
|
2417
|
-
[u.UINT64.toString(),
|
|
2418
|
-
[u.FLOAT32.toString(),
|
|
2419
|
-
[u.FLOAT64.toString(),
|
|
2420
|
-
[u.INT8.toString(),
|
|
2421
|
-
[u.INT16.toString(),
|
|
2422
|
-
[u.INT32.toString(),
|
|
2423
|
-
[u.INT64.toString(),
|
|
2424
|
-
[u.TIMESTAMP.toString(),
|
|
2425
|
-
[u.STRING.toString(),
|
|
2426
|
-
[u.JSON.toString(),
|
|
2427
|
-
[u.UUID.toString(),
|
|
2505
|
+
[u.UINT8.toString(), M.BIT8],
|
|
2506
|
+
[u.UINT16.toString(), M.BIT16],
|
|
2507
|
+
[u.UINT32.toString(), M.BIT32],
|
|
2508
|
+
[u.UINT64.toString(), M.BIT64],
|
|
2509
|
+
[u.FLOAT32.toString(), M.BIT32],
|
|
2510
|
+
[u.FLOAT64.toString(), M.BIT64],
|
|
2511
|
+
[u.INT8.toString(), M.BIT8],
|
|
2512
|
+
[u.INT16.toString(), M.BIT16],
|
|
2513
|
+
[u.INT32.toString(), M.BIT32],
|
|
2514
|
+
[u.INT64.toString(), M.BIT64],
|
|
2515
|
+
[u.TIMESTAMP.toString(), M.BIT64],
|
|
2516
|
+
[u.STRING.toString(), M.UNKNOWN],
|
|
2517
|
+
[u.JSON.toString(), M.UNKNOWN],
|
|
2518
|
+
[u.UUID.toString(), M.BIT128]
|
|
2428
2519
|
]);
|
|
2429
2520
|
/** All the data types. */
|
|
2430
2521
|
static ALL = [
|
|
@@ -2444,31 +2535,48 @@ let I = class M extends ee {
|
|
|
2444
2535
|
u.STRING,
|
|
2445
2536
|
u.JSON
|
|
2446
2537
|
];
|
|
2538
|
+
static SHORT_STRINGS = /* @__PURE__ */ new Map([
|
|
2539
|
+
[u.UINT8.toString(), "u8"],
|
|
2540
|
+
[u.UINT16.toString(), "u16"],
|
|
2541
|
+
[u.UINT32.toString(), "u32"],
|
|
2542
|
+
[u.UINT64.toString(), "u64"],
|
|
2543
|
+
[u.INT8.toString(), "i8"],
|
|
2544
|
+
[u.INT16.toString(), "i16"],
|
|
2545
|
+
[u.INT32.toString(), "i32"],
|
|
2546
|
+
[u.INT64.toString(), "i64"],
|
|
2547
|
+
[u.FLOAT32.toString(), "f32"],
|
|
2548
|
+
[u.FLOAT64.toString(), "f64"],
|
|
2549
|
+
[u.BOOLEAN.toString(), "bool"],
|
|
2550
|
+
[u.TIMESTAMP.toString(), "ts"],
|
|
2551
|
+
[u.UUID.toString(), "uuid"],
|
|
2552
|
+
[u.STRING.toString(), "str"],
|
|
2553
|
+
[u.JSON.toString(), "json"]
|
|
2554
|
+
]);
|
|
2447
2555
|
static BIG_INT_TYPES = [u.INT64, u.UINT64, u.TIMESTAMP];
|
|
2448
2556
|
/** A zod schema for a DataType. */
|
|
2449
2557
|
static z = a.union([
|
|
2450
2558
|
a.string().transform((e) => new u(e)),
|
|
2451
2559
|
a.instanceof(u)
|
|
2452
2560
|
]);
|
|
2453
|
-
},
|
|
2561
|
+
}, Ze = class y extends re {
|
|
2454
2562
|
constructor(e) {
|
|
2455
|
-
|
|
2563
|
+
B(e) && (e = e.value), super(e.valueOf());
|
|
2456
2564
|
}
|
|
2457
2565
|
/** @returns true if the Size is larger than the other size. */
|
|
2458
2566
|
largerThan(e) {
|
|
2459
|
-
return
|
|
2567
|
+
return B(e) && (e = e.value), this.valueOf() > e.valueOf();
|
|
2460
2568
|
}
|
|
2461
2569
|
/** @returns true if the Size is smaller than the other size. */
|
|
2462
2570
|
smallerThan(e) {
|
|
2463
|
-
return
|
|
2571
|
+
return B(e) && (e = e.value), this.valueOf() < e.valueOf();
|
|
2464
2572
|
}
|
|
2465
2573
|
/** @returns a new Size representing the sum of the two Sizes. */
|
|
2466
2574
|
add(e) {
|
|
2467
|
-
return
|
|
2575
|
+
return B(e) && (e = e.value), new y(ue(this.valueOf(), e.valueOf()));
|
|
2468
2576
|
}
|
|
2469
2577
|
/** @returns a new Size representing the difference of the two Sizes. */
|
|
2470
2578
|
sub(e) {
|
|
2471
|
-
return
|
|
2579
|
+
return B(e) && (e = e.value), new y(Z(this.valueOf(), e.valueOf()));
|
|
2472
2580
|
}
|
|
2473
2581
|
/**
|
|
2474
2582
|
* Multiplies this Size by a scalar value.
|
|
@@ -2477,7 +2585,7 @@ let I = class M extends ee {
|
|
|
2477
2585
|
* @returns A new Size representing this Size multiplied by the value.
|
|
2478
2586
|
*/
|
|
2479
2587
|
mult(e) {
|
|
2480
|
-
return new
|
|
2588
|
+
return new y(R(this.valueOf(), e));
|
|
2481
2589
|
}
|
|
2482
2590
|
/**
|
|
2483
2591
|
* Divides this Size by a scalar value.
|
|
@@ -2486,39 +2594,39 @@ let I = class M extends ee {
|
|
|
2486
2594
|
* @returns A new Size representing this Size divided by the value.
|
|
2487
2595
|
*/
|
|
2488
2596
|
div(e) {
|
|
2489
|
-
return new
|
|
2597
|
+
return new y(ve(this.valueOf(), e));
|
|
2490
2598
|
}
|
|
2491
2599
|
/** @returns a new Size representing the truncated value of the Size. */
|
|
2492
2600
|
truncate(e) {
|
|
2493
|
-
return new
|
|
2494
|
-
Math.trunc(this.valueOf() / new
|
|
2601
|
+
return new y(
|
|
2602
|
+
Math.trunc(this.valueOf() / new y(e).valueOf()) * new y(e).valueOf()
|
|
2495
2603
|
);
|
|
2496
2604
|
}
|
|
2497
2605
|
/** @returns a new Size representing the remainder of the Size. */
|
|
2498
2606
|
remainder(e) {
|
|
2499
|
-
return
|
|
2607
|
+
return y.bytes(this.valueOf() % new y(e).valueOf());
|
|
2500
2608
|
}
|
|
2501
2609
|
/** @returns the number of gigabytes in the Size. */
|
|
2502
2610
|
get gigabytes() {
|
|
2503
|
-
return this.valueOf() /
|
|
2611
|
+
return this.valueOf() / y.GIGABYTE.valueOf();
|
|
2504
2612
|
}
|
|
2505
2613
|
/** @returns the number of megabytes in the Size. */
|
|
2506
2614
|
get megabytes() {
|
|
2507
|
-
return this.valueOf() /
|
|
2615
|
+
return this.valueOf() / y.MEGABYTE.valueOf();
|
|
2508
2616
|
}
|
|
2509
2617
|
/** @returns the number of kilobytes in the Size. */
|
|
2510
2618
|
get kilobytes() {
|
|
2511
|
-
return this.valueOf() /
|
|
2619
|
+
return this.valueOf() / y.KILOBYTE.valueOf();
|
|
2512
2620
|
}
|
|
2513
2621
|
/** @returns the number of terabytes in the Size. */
|
|
2514
2622
|
get terabytes() {
|
|
2515
|
-
return this.valueOf() /
|
|
2623
|
+
return this.valueOf() / y.TERABYTE.valueOf();
|
|
2516
2624
|
}
|
|
2517
2625
|
/** @returns a nicely formatted string representation of the Size. */
|
|
2518
2626
|
toString() {
|
|
2519
|
-
const e = this.truncate(
|
|
2520
|
-
let
|
|
2521
|
-
return o.isZero || (
|
|
2627
|
+
const e = this.truncate(y.TERABYTE), r = this.truncate(y.GIGABYTE), n = this.truncate(y.MEGABYTE), s = this.truncate(y.KILOBYTE), i = this.truncate(y.BYTE), o = e, h = r.sub(e), f = n.sub(r), l = s.sub(n), d = i.sub(s);
|
|
2628
|
+
let m = "";
|
|
2629
|
+
return o.isZero || (m += `${o.terabytes}TB `), h.isZero || (m += `${h.gigabytes}GB `), f.isZero || (m += `${f.megabytes}MB `), l.isZero || (m += `${l.kilobytes}KB `), (!d.isZero || m === "") && (m += `${d.valueOf()}B`), m.trim();
|
|
2522
2630
|
}
|
|
2523
2631
|
/**
|
|
2524
2632
|
* Creates a Size from the given number of bytes.
|
|
@@ -2527,10 +2635,10 @@ let I = class M extends ee {
|
|
|
2527
2635
|
* @returns A Size representing the given number of bytes.
|
|
2528
2636
|
*/
|
|
2529
2637
|
static bytes(e = 1) {
|
|
2530
|
-
return new
|
|
2638
|
+
return new y(e);
|
|
2531
2639
|
}
|
|
2532
2640
|
/** A single byte */
|
|
2533
|
-
static BYTE = new
|
|
2641
|
+
static BYTE = new y(1);
|
|
2534
2642
|
/**
|
|
2535
2643
|
* Creates a Size from the given number if kilobytes.
|
|
2536
2644
|
*
|
|
@@ -2538,10 +2646,10 @@ let I = class M extends ee {
|
|
|
2538
2646
|
* @returns A Size representing the given number of kilobytes.
|
|
2539
2647
|
*/
|
|
2540
2648
|
static kilobytes(e = 1) {
|
|
2541
|
-
return
|
|
2649
|
+
return y.bytes(new y(e).valueOf() * 1e3);
|
|
2542
2650
|
}
|
|
2543
2651
|
/** A kilobyte */
|
|
2544
|
-
static KILOBYTE =
|
|
2652
|
+
static KILOBYTE = y.kilobytes(1);
|
|
2545
2653
|
/**
|
|
2546
2654
|
* Creates a Size from the given number of megabytes.
|
|
2547
2655
|
*
|
|
@@ -2549,10 +2657,10 @@ let I = class M extends ee {
|
|
|
2549
2657
|
* @returns A Size representing the given number of megabytes.
|
|
2550
2658
|
*/
|
|
2551
2659
|
static megabytes(e = 1) {
|
|
2552
|
-
return
|
|
2660
|
+
return y.kilobytes(new y(e).valueOf() * 1e3);
|
|
2553
2661
|
}
|
|
2554
2662
|
/** A megabyte */
|
|
2555
|
-
static MEGABYTE =
|
|
2663
|
+
static MEGABYTE = y.megabytes(1);
|
|
2556
2664
|
/**
|
|
2557
2665
|
* Creates a Size from the given number of gigabytes.
|
|
2558
2666
|
*
|
|
@@ -2560,10 +2668,10 @@ let I = class M extends ee {
|
|
|
2560
2668
|
* @returns A Size representing the given number of gigabytes.
|
|
2561
2669
|
*/
|
|
2562
2670
|
static gigabytes(e = 1) {
|
|
2563
|
-
return
|
|
2671
|
+
return y.megabytes(new y(e).valueOf() * 1e3);
|
|
2564
2672
|
}
|
|
2565
2673
|
/** A gigabyte */
|
|
2566
|
-
static GIGABYTE =
|
|
2674
|
+
static GIGABYTE = y.gigabytes(1);
|
|
2567
2675
|
/**
|
|
2568
2676
|
* Creates a Size from the given number of terabytes.
|
|
2569
2677
|
*
|
|
@@ -2571,23 +2679,27 @@ let I = class M extends ee {
|
|
|
2571
2679
|
* @returns A Size representing the given number of terabytes.
|
|
2572
2680
|
*/
|
|
2573
2681
|
static terabytes(e) {
|
|
2574
|
-
return
|
|
2682
|
+
return y.gigabytes(new y(e).valueOf() * 1e3);
|
|
2575
2683
|
}
|
|
2576
2684
|
/** A terabyte. */
|
|
2577
|
-
static TERABYTE =
|
|
2685
|
+
static TERABYTE = y.terabytes(1);
|
|
2578
2686
|
/** The zero value for Size */
|
|
2579
|
-
static ZERO = new
|
|
2687
|
+
static ZERO = new y(0);
|
|
2580
2688
|
/** A zod schema for a Size. */
|
|
2581
2689
|
static z = a.union([
|
|
2582
|
-
a.number().transform((e) => new
|
|
2583
|
-
a.instanceof(
|
|
2690
|
+
a.number().transform((e) => new y(e)),
|
|
2691
|
+
a.instanceof(y)
|
|
2584
2692
|
]);
|
|
2585
2693
|
/** @returns true if the Size is zero. */
|
|
2586
2694
|
get isZero() {
|
|
2587
2695
|
return this.valueOf() === 0;
|
|
2588
2696
|
}
|
|
2589
2697
|
};
|
|
2590
|
-
|
|
2698
|
+
a.object({
|
|
2699
|
+
start: a.number(),
|
|
2700
|
+
end: a.number()
|
|
2701
|
+
});
|
|
2702
|
+
const Mu = a.union([
|
|
2591
2703
|
a.instanceof(Uint8Array),
|
|
2592
2704
|
a.instanceof(Uint16Array),
|
|
2593
2705
|
a.instanceof(Uint32Array),
|
|
@@ -2598,40 +2710,65 @@ const qo = a.union([
|
|
|
2598
2710
|
a.instanceof(Int16Array),
|
|
2599
2711
|
a.instanceof(Int32Array),
|
|
2600
2712
|
a.instanceof(BigInt64Array)
|
|
2601
|
-
]),
|
|
2713
|
+
]), Vr = (t) => {
|
|
2602
2714
|
const e = typeof t;
|
|
2603
|
-
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof
|
|
2604
|
-
},
|
|
2605
|
-
function
|
|
2606
|
-
return typeof t == "string" &&
|
|
2715
|
+
return e === "string" || e === "number" || e === "boolean" || e === "bigint" || t instanceof $ || t instanceof c || t instanceof Date;
|
|
2716
|
+
}, ha = (t, e, r, n = 0) => t.usesBigInt && !e.usesBigInt ? Number(r) - Number(n) : !t.usesBigInt && e.usesBigInt ? BigInt(r.valueOf()) - BigInt(n.valueOf()) : Le(r, -n), Le = (t, e) => e == 0 ? t : t == 0 ? e : typeof t == "bigint" && typeof e == "bigint" || typeof t == "number" && typeof e == "number" ? t + e : Number(t) + Number(e), fa = "00000000-0000-0000-0000-000000000000", da = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
2717
|
+
function ga(t) {
|
|
2718
|
+
return typeof t == "string" && da.test(t);
|
|
2607
2719
|
}
|
|
2608
|
-
const
|
|
2720
|
+
const I = [];
|
|
2609
2721
|
for (let t = 0; t < 256; ++t)
|
|
2610
|
-
|
|
2611
|
-
function
|
|
2612
|
-
return (
|
|
2722
|
+
I.push((t + 256).toString(16).slice(1));
|
|
2723
|
+
function Gr(t, e = 0) {
|
|
2724
|
+
return (I[t[e + 0]] + I[t[e + 1]] + I[t[e + 2]] + I[t[e + 3]] + "-" + I[t[e + 4]] + I[t[e + 5]] + "-" + I[t[e + 6]] + I[t[e + 7]] + "-" + I[t[e + 8]] + I[t[e + 9]] + "-" + I[t[e + 10]] + I[t[e + 11]] + I[t[e + 12]] + I[t[e + 13]] + I[t[e + 14]] + I[t[e + 15]]).toLowerCase();
|
|
2613
2725
|
}
|
|
2614
|
-
function
|
|
2615
|
-
const r =
|
|
2616
|
-
if (!
|
|
2726
|
+
function pa(t, e = 0) {
|
|
2727
|
+
const r = Gr(t, e);
|
|
2728
|
+
if (!ga(r))
|
|
2617
2729
|
throw TypeError("Stringified UUID is invalid");
|
|
2618
2730
|
return r;
|
|
2619
2731
|
}
|
|
2620
|
-
|
|
2621
|
-
const
|
|
2622
|
-
|
|
2732
|
+
let it;
|
|
2733
|
+
const ma = new Uint8Array(16);
|
|
2734
|
+
function ya() {
|
|
2735
|
+
if (!it) {
|
|
2736
|
+
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2737
|
+
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2738
|
+
it = crypto.getRandomValues.bind(crypto);
|
|
2739
|
+
}
|
|
2740
|
+
return it(ma);
|
|
2741
|
+
}
|
|
2742
|
+
const ba = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), er = { randomUUID: ba };
|
|
2743
|
+
function wa(t, e, r) {
|
|
2744
|
+
t = t || {};
|
|
2745
|
+
const n = t.random ?? t.rng?.() ?? ya();
|
|
2746
|
+
if (n.length < 16)
|
|
2747
|
+
throw new Error("Random bytes length must be >= 16");
|
|
2748
|
+
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Gr(n);
|
|
2749
|
+
}
|
|
2750
|
+
function $a(t, e, r) {
|
|
2751
|
+
return er.randomUUID && !t ? er.randomUUID() : wa(t);
|
|
2752
|
+
}
|
|
2753
|
+
const Oa = () => $a(), Gt = (t, e) => pa(t, e), va = fa, Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2754
|
+
__proto__: null,
|
|
2755
|
+
ZERO: va,
|
|
2756
|
+
create: Oa,
|
|
2757
|
+
parse: Gt
|
|
2758
|
+
}, Symbol.toStringTag, { value: "Module" })), Y = -1, Ot = {
|
|
2759
|
+
[Symbol.iterator]: () => Ot,
|
|
2623
2760
|
next: () => ({ done: !0, value: void 0 })
|
|
2624
|
-
},
|
|
2761
|
+
}, Ta = a.string().transform(
|
|
2625
2762
|
(t) => new Uint8Array(
|
|
2626
2763
|
atob(t).split("").map((e) => e.charCodeAt(0))
|
|
2627
2764
|
).buffer
|
|
2628
|
-
),
|
|
2765
|
+
), xa = a.union([a.null(), a.undefined()]).transform(() => new Uint8Array().buffer), vt = 10, Hr = (t, e) => {
|
|
2629
2766
|
if (t === "number" && !e.isNumeric)
|
|
2630
2767
|
throw new Error(`cannot convert series of type ${e.toString()} to number`);
|
|
2631
2768
|
if (t === "bigint" && !e.usesBigInt)
|
|
2632
2769
|
throw new Error(`cannot convert series of type ${e.toString()} to bigint`);
|
|
2633
|
-
},
|
|
2634
|
-
let
|
|
2770
|
+
}, Xr = "sy_x_telem_series";
|
|
2771
|
+
let Jr = class W {
|
|
2635
2772
|
/**
|
|
2636
2773
|
* A unique identifier for the series. If specified by the user, it is their
|
|
2637
2774
|
* responsibility to ensure that it is unique. If not specified, a new ID will be
|
|
@@ -2642,7 +2779,7 @@ let Lr = class F {
|
|
|
2642
2779
|
* A discriminator used for identifying instances of the series class even
|
|
2643
2780
|
* when bundlers mangle the class name.
|
|
2644
2781
|
*/
|
|
2645
|
-
discriminator =
|
|
2782
|
+
discriminator = Xr;
|
|
2646
2783
|
/** The data type of the series. */
|
|
2647
2784
|
dataType;
|
|
2648
2785
|
/**
|
|
@@ -2658,7 +2795,7 @@ let Lr = class F {
|
|
|
2658
2795
|
/** The underlying data. */
|
|
2659
2796
|
_data;
|
|
2660
2797
|
/** The time range occupied by the series' data. */
|
|
2661
|
-
timeRange =
|
|
2798
|
+
timeRange = Q.ZERO;
|
|
2662
2799
|
/**
|
|
2663
2800
|
* Alignment defines the location of the series relative to other series in a logical
|
|
2664
2801
|
* group. Useful for defining the position of the series within a channel's data.
|
|
@@ -2687,22 +2824,22 @@ let Lr = class F {
|
|
|
2687
2824
|
* can be constructed into a series.
|
|
2688
2825
|
*/
|
|
2689
2826
|
static crudeZ = a.object({
|
|
2690
|
-
timeRange:
|
|
2691
|
-
dataType:
|
|
2827
|
+
timeRange: Q.z.optional(),
|
|
2828
|
+
dataType: S.z,
|
|
2692
2829
|
alignment: a.coerce.bigint().optional(),
|
|
2693
2830
|
data: a.union([
|
|
2694
|
-
|
|
2695
|
-
|
|
2831
|
+
Ta,
|
|
2832
|
+
xa,
|
|
2696
2833
|
a.instanceof(ArrayBuffer),
|
|
2697
2834
|
a.instanceof(Uint8Array)
|
|
2698
2835
|
]),
|
|
2699
|
-
glBufferUsage:
|
|
2836
|
+
glBufferUsage: la.optional().default("static").optional()
|
|
2700
2837
|
});
|
|
2701
2838
|
/**
|
|
2702
2839
|
* A zod schema that validates and constructs a series from it's crude
|
|
2703
2840
|
* representation.
|
|
2704
2841
|
*/
|
|
2705
|
-
static z =
|
|
2842
|
+
static z = W.crudeZ.transform((e) => new W(e));
|
|
2706
2843
|
/**
|
|
2707
2844
|
* The Series constructor accepts either a SeriesArgs object or a CrudeSeries value.
|
|
2708
2845
|
*
|
|
@@ -2777,30 +2914,30 @@ let Lr = class F {
|
|
|
2777
2914
|
* @throws Error if data type cannot be inferred from input
|
|
2778
2915
|
*/
|
|
2779
2916
|
constructor(e) {
|
|
2780
|
-
|
|
2917
|
+
Sa(e) && (e = { data: e }), e.data ??= [];
|
|
2781
2918
|
const {
|
|
2782
2919
|
dataType: r,
|
|
2783
2920
|
timeRange: n,
|
|
2784
2921
|
sampleOffset: s = 0,
|
|
2785
2922
|
glBufferUsage: i = "static",
|
|
2786
2923
|
alignment: o = 0n,
|
|
2787
|
-
alignmentMultiple:
|
|
2788
|
-
key:
|
|
2924
|
+
alignmentMultiple: h = 1n,
|
|
2925
|
+
key: f = Vt(),
|
|
2789
2926
|
data: l
|
|
2790
2927
|
} = e;
|
|
2791
|
-
if (
|
|
2928
|
+
if (Kr(l)) {
|
|
2792
2929
|
const p = l;
|
|
2793
2930
|
this.key = p.key, this.dataType = p.dataType, this.sampleOffset = p.sampleOffset, this.gl = p.gl, this._data = p._data, this.timeRange = p.timeRange, this.alignment = p.alignment, this.alignmentMultiple = p.alignmentMultiple, this.cachedMin = p.cachedMin, this.cachedMax = p.cachedMax, this.writePos = p.writePos, this._refCount = p._refCount, this.cachedLength = p.cachedLength;
|
|
2794
2931
|
return;
|
|
2795
2932
|
}
|
|
2796
|
-
const d =
|
|
2797
|
-
if (r != null) this.dataType = new
|
|
2933
|
+
const d = Vr(l), m = Array.isArray(l);
|
|
2934
|
+
if (r != null) this.dataType = new S(r);
|
|
2798
2935
|
else {
|
|
2799
2936
|
if (l instanceof ArrayBuffer)
|
|
2800
2937
|
throw new Error(
|
|
2801
2938
|
"cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type."
|
|
2802
2939
|
);
|
|
2803
|
-
if (
|
|
2940
|
+
if (m || d) {
|
|
2804
2941
|
let p = l;
|
|
2805
2942
|
if (!d) {
|
|
2806
2943
|
if (l.length === 0)
|
|
@@ -2809,38 +2946,38 @@ let Lr = class F {
|
|
|
2809
2946
|
);
|
|
2810
2947
|
p = l[0];
|
|
2811
2948
|
}
|
|
2812
|
-
if (typeof p == "string") this.dataType =
|
|
2813
|
-
else if (typeof p == "number") this.dataType =
|
|
2814
|
-
else if (typeof p == "bigint") this.dataType =
|
|
2815
|
-
else if (typeof p == "boolean") this.dataType =
|
|
2816
|
-
else if (p instanceof
|
|
2817
|
-
this.dataType =
|
|
2818
|
-
else if (typeof p == "object") this.dataType =
|
|
2949
|
+
if (typeof p == "string") this.dataType = S.STRING;
|
|
2950
|
+
else if (typeof p == "number") this.dataType = S.FLOAT64;
|
|
2951
|
+
else if (typeof p == "bigint") this.dataType = S.INT64;
|
|
2952
|
+
else if (typeof p == "boolean") this.dataType = S.BOOLEAN;
|
|
2953
|
+
else if (p instanceof $ || p instanceof Date || p instanceof $)
|
|
2954
|
+
this.dataType = S.TIMESTAMP;
|
|
2955
|
+
else if (typeof p == "object") this.dataType = S.JSON;
|
|
2819
2956
|
else
|
|
2820
2957
|
throw new Error(
|
|
2821
2958
|
`cannot infer data type of ${typeof p} when constructing a Series from a JS array`
|
|
2822
2959
|
);
|
|
2823
|
-
} else this.dataType = new
|
|
2960
|
+
} else this.dataType = new S(l);
|
|
2824
2961
|
}
|
|
2825
|
-
if (!
|
|
2826
|
-
else if (
|
|
2962
|
+
if (!m && !d) this._data = l;
|
|
2963
|
+
else if (m && l.length === 0)
|
|
2827
2964
|
this._data = new this.dataType.Array([]).buffer;
|
|
2828
2965
|
else {
|
|
2829
2966
|
let p = d ? [l] : l;
|
|
2830
|
-
const
|
|
2831
|
-
(
|
|
2967
|
+
const A = p[0];
|
|
2968
|
+
(A instanceof $ || A instanceof Date || A instanceof c) && (p = p.map((U) => new $(U).valueOf())), this.dataType.equals(S.STRING) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(`${p.join(`
|
|
2832
2969
|
`)}
|
|
2833
|
-
`).buffer) : this.dataType.equals(
|
|
2834
|
-
`${p.map((
|
|
2970
|
+
`).buffer) : this.dataType.equals(S.JSON) ? (this.cachedLength = p.length, this._data = new TextEncoder().encode(
|
|
2971
|
+
`${p.map((U) => ct.encodeString(U)).join(`
|
|
2835
2972
|
`)}
|
|
2836
2973
|
`
|
|
2837
|
-
).buffer) : this.dataType.usesBigInt && typeof
|
|
2838
|
-
p.map((
|
|
2839
|
-
).buffer : !this.dataType.usesBigInt && typeof
|
|
2974
|
+
).buffer) : this.dataType.usesBigInt && typeof A == "number" ? this._data = new this.dataType.Array(
|
|
2975
|
+
p.map((U) => BigInt(Math.round(U)))
|
|
2976
|
+
).buffer : !this.dataType.usesBigInt && typeof A == "bigint" ? this._data = new this.dataType.Array(
|
|
2840
2977
|
p.map(Number)
|
|
2841
2978
|
).buffer : this._data = new this.dataType.Array(p).buffer;
|
|
2842
2979
|
}
|
|
2843
|
-
this.key =
|
|
2980
|
+
this.key = f, this.alignment = o, this.alignmentMultiple = h, this.sampleOffset = s ?? 0, this.timeRange = n ?? Q.ZERO, this.gl = {
|
|
2844
2981
|
control: null,
|
|
2845
2982
|
buffer: null,
|
|
2846
2983
|
prevBuffer: 0,
|
|
@@ -2857,7 +2994,7 @@ let Lr = class F {
|
|
|
2857
2994
|
static alloc({ capacity: e, dataType: r, ...n }) {
|
|
2858
2995
|
if (e === 0)
|
|
2859
2996
|
throw new Error("[Series] - cannot allocate an array of length 0");
|
|
2860
|
-
const s = new new
|
|
2997
|
+
const s = new new S(r).Array(e), i = new W({ data: s.buffer, dataType: r, ...n });
|
|
2861
2998
|
return i.writePos = 0, i;
|
|
2862
2999
|
}
|
|
2863
3000
|
/**
|
|
@@ -2947,16 +3084,16 @@ let Lr = class F {
|
|
|
2947
3084
|
* @returns An array of values parsed from the JSON series.
|
|
2948
3085
|
*/
|
|
2949
3086
|
parseJSON(e) {
|
|
2950
|
-
if (!this.dataType.equals(
|
|
3087
|
+
if (!this.dataType.equals(S.JSON))
|
|
2951
3088
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
2952
|
-
return this.toStrings().map((r) => e.parse(
|
|
3089
|
+
return this.toStrings().map((r) => e.parse(ct.decodeString(r)));
|
|
2953
3090
|
}
|
|
2954
3091
|
/**
|
|
2955
3092
|
* Returns the capacity of the series in bytes.
|
|
2956
3093
|
* @returns The size of the underlying buffer in bytes.
|
|
2957
3094
|
*/
|
|
2958
3095
|
get byteCapacity() {
|
|
2959
|
-
return new
|
|
3096
|
+
return new Ze(this.underlyingData.byteLength);
|
|
2960
3097
|
}
|
|
2961
3098
|
/**
|
|
2962
3099
|
* Returns the capacity of the series in samples.
|
|
@@ -2972,7 +3109,7 @@ let Lr = class F {
|
|
|
2972
3109
|
* @returns The size of the data in bytes.
|
|
2973
3110
|
*/
|
|
2974
3111
|
get byteLength() {
|
|
2975
|
-
return this.writePos === Y ? this.byteCapacity : this.dataType.isVariable ? new
|
|
3112
|
+
return this.writePos === Y ? this.byteCapacity : this.dataType.isVariable ? new Ze(this.writePos) : this.dataType.density.size(this.writePos);
|
|
2976
3113
|
}
|
|
2977
3114
|
/**
|
|
2978
3115
|
* Returns the number of samples in this array.
|
|
@@ -2988,7 +3125,7 @@ let Lr = class F {
|
|
|
2988
3125
|
let e = 0;
|
|
2989
3126
|
const r = [0];
|
|
2990
3127
|
return this.data.forEach((n, s) => {
|
|
2991
|
-
n ===
|
|
3128
|
+
n === vt && (e++, r.push(s + 1));
|
|
2992
3129
|
}), this._cachedIndexes = r, this.cachedLength = e, e;
|
|
2993
3130
|
}
|
|
2994
3131
|
/**
|
|
@@ -3004,8 +3141,8 @@ let Lr = class F {
|
|
|
3004
3141
|
if (this.dataType.equals(e)) return this;
|
|
3005
3142
|
const n = new e.Array(this.length);
|
|
3006
3143
|
for (let s = 0; s < this.length; s++)
|
|
3007
|
-
n[s] =
|
|
3008
|
-
return new
|
|
3144
|
+
n[s] = ha(this.dataType, e, this.data[s], r);
|
|
3145
|
+
return new W({
|
|
3009
3146
|
data: n.buffer,
|
|
3010
3147
|
dataType: e,
|
|
3011
3148
|
timeRange: this.timeRange,
|
|
@@ -3016,7 +3153,7 @@ let Lr = class F {
|
|
|
3016
3153
|
}
|
|
3017
3154
|
calcRawMax() {
|
|
3018
3155
|
if (this.length === 0) return -1 / 0;
|
|
3019
|
-
if (this.dataType.equals(
|
|
3156
|
+
if (this.dataType.equals(S.TIMESTAMP))
|
|
3020
3157
|
this.cachedMax = this.data[this.data.length - 1];
|
|
3021
3158
|
else if (this.dataType.usesBigInt) {
|
|
3022
3159
|
const e = this.data;
|
|
@@ -3034,11 +3171,11 @@ let Lr = class F {
|
|
|
3034
3171
|
calcMax() {
|
|
3035
3172
|
if (this.dataType.isVariable)
|
|
3036
3173
|
throw new Error("cannot calculate maximum on a variable length data type");
|
|
3037
|
-
return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(),
|
|
3174
|
+
return this.writePos === 0 ? -1 / 0 : (this.cachedMax ??= this.calcRawMax(), Le(this.cachedMax, this.sampleOffset));
|
|
3038
3175
|
}
|
|
3039
3176
|
calcRawMin() {
|
|
3040
3177
|
if (this.length === 0) return 1 / 0;
|
|
3041
|
-
if (this.dataType.equals(
|
|
3178
|
+
if (this.dataType.equals(S.TIMESTAMP)) this.cachedMin = this.data[0];
|
|
3042
3179
|
else if (this.dataType.usesBigInt) {
|
|
3043
3180
|
const e = this.data;
|
|
3044
3181
|
this.cachedMin = e.reduce((r, n) => r < n ? r : n);
|
|
@@ -3055,7 +3192,7 @@ let Lr = class F {
|
|
|
3055
3192
|
calcMin() {
|
|
3056
3193
|
if (this.dataType.isVariable)
|
|
3057
3194
|
throw new Error("cannot calculate minimum on a variable length data type");
|
|
3058
|
-
return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(),
|
|
3195
|
+
return this.writePos === 0 ? 1 / 0 : (this.cachedMin ??= this.calcRawMin(), Le(this.cachedMin, this.sampleOffset));
|
|
3059
3196
|
}
|
|
3060
3197
|
/** @returns the bounds of the series. */
|
|
3061
3198
|
get bounds() {
|
|
@@ -3081,18 +3218,18 @@ let Lr = class F {
|
|
|
3081
3218
|
}
|
|
3082
3219
|
at(e, r = !1) {
|
|
3083
3220
|
if (this.dataType.isVariable) return this.atVariable(e, r ?? !1);
|
|
3084
|
-
if (this.dataType.equals(
|
|
3221
|
+
if (this.dataType.equals(S.UUID)) return this.atUUID(e, r);
|
|
3085
3222
|
e < 0 && (e = this.length + e);
|
|
3086
3223
|
const n = this.data[e];
|
|
3087
3224
|
if (n == null) {
|
|
3088
3225
|
if (r === !0) throw new Error(`[series] - no value at index ${e}`);
|
|
3089
3226
|
return;
|
|
3090
3227
|
}
|
|
3091
|
-
return
|
|
3228
|
+
return Le(n, this.sampleOffset);
|
|
3092
3229
|
}
|
|
3093
3230
|
atUUID(e, r) {
|
|
3094
3231
|
e < 0 && (e = this.length + e);
|
|
3095
|
-
const n =
|
|
3232
|
+
const n = Gt(
|
|
3096
3233
|
new Uint8Array(this.buffer, e * this.dataType.density.valueOf())
|
|
3097
3234
|
);
|
|
3098
3235
|
if (n == null) {
|
|
@@ -3108,7 +3245,7 @@ let Lr = class F {
|
|
|
3108
3245
|
else {
|
|
3109
3246
|
e < 0 && (e = this.length + e);
|
|
3110
3247
|
for (let o = 0; o < this.data.length; o++)
|
|
3111
|
-
if (this.data[o] ===
|
|
3248
|
+
if (this.data[o] === vt) {
|
|
3112
3249
|
if (e === 0) {
|
|
3113
3250
|
s = o;
|
|
3114
3251
|
break;
|
|
@@ -3121,7 +3258,7 @@ let Lr = class F {
|
|
|
3121
3258
|
}
|
|
3122
3259
|
}
|
|
3123
3260
|
const i = this.data.slice(n, s);
|
|
3124
|
-
return this.dataType.equals(
|
|
3261
|
+
return this.dataType.equals(S.STRING) ? new TextDecoder().decode(i) : St(JSON.parse(new TextDecoder().decode(i)));
|
|
3125
3262
|
}
|
|
3126
3263
|
/**
|
|
3127
3264
|
* @returns the index of the first sample that is greater than or equal to the given value.
|
|
@@ -3130,7 +3267,7 @@ let Lr = class F {
|
|
|
3130
3267
|
*/
|
|
3131
3268
|
binarySearch(e) {
|
|
3132
3269
|
let r = 0, n = this.length - 1;
|
|
3133
|
-
const s =
|
|
3270
|
+
const s = We(e);
|
|
3134
3271
|
for (; r <= n; ) {
|
|
3135
3272
|
const i = Math.floor((r + n) / 2), o = s(this.at(i, !0), e);
|
|
3136
3273
|
if (o === 0) return i;
|
|
@@ -3146,7 +3283,7 @@ let Lr = class F {
|
|
|
3146
3283
|
* be the same buffer previously passed to {@method acquire} or {@method updateGLBuffer}.
|
|
3147
3284
|
*/
|
|
3148
3285
|
updateGLBuffer(e) {
|
|
3149
|
-
if (this.gl.control = e, !this.dataType.equals(
|
|
3286
|
+
if (this.gl.control = e, !this.dataType.equals(S.FLOAT32) && !this.dataType.equals(S.UINT8))
|
|
3150
3287
|
throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");
|
|
3151
3288
|
const { buffer: r, bufferUsage: n, prevBuffer: s } = this.gl;
|
|
3152
3289
|
if (r == null && (this.gl.buffer = e.createBuffer()), this.writePos !== s)
|
|
@@ -3162,7 +3299,7 @@ let Lr = class F {
|
|
|
3162
3299
|
), this.gl.prevBuffer = Y;
|
|
3163
3300
|
}
|
|
3164
3301
|
as(e) {
|
|
3165
|
-
return
|
|
3302
|
+
return Hr(e, this.dataType), this;
|
|
3166
3303
|
}
|
|
3167
3304
|
/** @returns a digest containing information about the series. */
|
|
3168
3305
|
get digest() {
|
|
@@ -3171,8 +3308,8 @@ let Lr = class F {
|
|
|
3171
3308
|
dataType: this.dataType.toString(),
|
|
3172
3309
|
sampleOffset: this.sampleOffset,
|
|
3173
3310
|
alignment: {
|
|
3174
|
-
lower:
|
|
3175
|
-
upper:
|
|
3311
|
+
lower: rr(this.alignmentBounds.lower),
|
|
3312
|
+
upper: rr(this.alignmentBounds.upper),
|
|
3176
3313
|
multiple: this.alignmentMultiple
|
|
3177
3314
|
},
|
|
3178
3315
|
timeRange: this.timeRange.toString(),
|
|
@@ -3210,10 +3347,10 @@ let Lr = class F {
|
|
|
3210
3347
|
}
|
|
3211
3348
|
[Symbol.iterator]() {
|
|
3212
3349
|
if (this.dataType.isVariable) {
|
|
3213
|
-
const e = new
|
|
3214
|
-
return this.dataType.equals(
|
|
3350
|
+
const e = new Na(this);
|
|
3351
|
+
return this.dataType.equals(S.JSON) ? new Ia(e) : e;
|
|
3215
3352
|
}
|
|
3216
|
-
return this.dataType.equals(
|
|
3353
|
+
return this.dataType.equals(S.UUID) ? new Ma(this) : new Aa(this);
|
|
3217
3354
|
}
|
|
3218
3355
|
/**
|
|
3219
3356
|
* Returns a slice of the series from start to end.
|
|
@@ -3240,7 +3377,7 @@ let Lr = class F {
|
|
|
3240
3377
|
* @returns An iterator over the specified range.
|
|
3241
3378
|
*/
|
|
3242
3379
|
subIterator(e, r) {
|
|
3243
|
-
return new
|
|
3380
|
+
return new tr(this, e, r ?? this.length);
|
|
3244
3381
|
}
|
|
3245
3382
|
/**
|
|
3246
3383
|
* Returns an iterator over a portion of the series based on alignment.
|
|
@@ -3254,12 +3391,12 @@ let Lr = class F {
|
|
|
3254
3391
|
), s = Math.ceil(
|
|
3255
3392
|
Number(r - this.alignment) / Number(this.alignmentMultiple)
|
|
3256
3393
|
);
|
|
3257
|
-
return new
|
|
3394
|
+
return new tr(this, n, s);
|
|
3258
3395
|
}
|
|
3259
3396
|
subBytes(e, r) {
|
|
3260
3397
|
if (e >= 0 && (r == null || r >= this.byteLength.valueOf())) return this;
|
|
3261
3398
|
const n = this.data.subarray(e, r);
|
|
3262
|
-
return new
|
|
3399
|
+
return new W({
|
|
3263
3400
|
data: n,
|
|
3264
3401
|
dataType: this.dataType,
|
|
3265
3402
|
timeRange: this.timeRange,
|
|
@@ -3271,7 +3408,7 @@ let Lr = class F {
|
|
|
3271
3408
|
sliceSub(e, r, n) {
|
|
3272
3409
|
if (r <= 0 && (n == null || n >= this.length)) return this;
|
|
3273
3410
|
let s;
|
|
3274
|
-
return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new
|
|
3411
|
+
return e ? s = this.data.subarray(r, n) : s = this.data.slice(r, n), new W({
|
|
3275
3412
|
data: s,
|
|
3276
3413
|
dataType: this.dataType,
|
|
3277
3414
|
timeRange: this.timeRange,
|
|
@@ -3286,10 +3423,10 @@ let Lr = class F {
|
|
|
3286
3423
|
* @returns A new series with the specified alignment.
|
|
3287
3424
|
*/
|
|
3288
3425
|
reAlign(e) {
|
|
3289
|
-
return new
|
|
3426
|
+
return new W({
|
|
3290
3427
|
data: this.buffer,
|
|
3291
3428
|
dataType: this.dataType,
|
|
3292
|
-
timeRange:
|
|
3429
|
+
timeRange: Q.ZERO,
|
|
3293
3430
|
sampleOffset: this.sampleOffset,
|
|
3294
3431
|
glBufferUsage: "static",
|
|
3295
3432
|
alignment: e
|
|
@@ -3313,21 +3450,20 @@ let Lr = class F {
|
|
|
3313
3450
|
return e += "])", e;
|
|
3314
3451
|
}
|
|
3315
3452
|
};
|
|
3316
|
-
const
|
|
3317
|
-
class
|
|
3453
|
+
const Sa = (t) => t == null ? !1 : Array.isArray(t) || t instanceof ArrayBuffer || ArrayBuffer.isView(t) && !(t instanceof DataView) || t instanceof Jr ? !0 : Vr(t), Kr = Xi(Xr, Jr);
|
|
3454
|
+
let tr = class {
|
|
3318
3455
|
series;
|
|
3319
3456
|
end;
|
|
3320
3457
|
index;
|
|
3321
3458
|
constructor(e, r, n) {
|
|
3322
3459
|
this.series = e;
|
|
3323
3460
|
const s = b(0, e.length + 1);
|
|
3324
|
-
this.end =
|
|
3461
|
+
this.end = gt(s, n), this.index = gt(s, r);
|
|
3325
3462
|
}
|
|
3326
3463
|
next() {
|
|
3327
3464
|
return this.index >= this.end ? { done: !0, value: void 0 } : { done: !1, value: this.series.at(this.index++, !0) };
|
|
3328
3465
|
}
|
|
3329
|
-
}
|
|
3330
|
-
let Fi = class {
|
|
3466
|
+
}, Na = class {
|
|
3331
3467
|
series;
|
|
3332
3468
|
index;
|
|
3333
3469
|
decoder;
|
|
@@ -3340,11 +3476,11 @@ let Fi = class {
|
|
|
3340
3476
|
}
|
|
3341
3477
|
next() {
|
|
3342
3478
|
const e = this.index, r = this.series.data;
|
|
3343
|
-
for (; this.index < r.length && r[this.index] !==
|
|
3479
|
+
for (; this.index < r.length && r[this.index] !== vt; ) this.index++;
|
|
3344
3480
|
const n = this.index;
|
|
3345
3481
|
return e === n ? { done: !0, value: void 0 } : (this.index++, { done: !1, value: this.decoder.decode(this.series.buffer.slice(e, n)) });
|
|
3346
3482
|
}
|
|
3347
|
-
},
|
|
3483
|
+
}, Ia = class Qr {
|
|
3348
3484
|
wrapped;
|
|
3349
3485
|
static schema = a.record(a.string(), a.unknown());
|
|
3350
3486
|
constructor(e) {
|
|
@@ -3354,25 +3490,26 @@ let Fi = class {
|
|
|
3354
3490
|
const e = this.wrapped.next();
|
|
3355
3491
|
return e.done === !0 ? { done: !0, value: void 0 } : {
|
|
3356
3492
|
done: !1,
|
|
3357
|
-
value:
|
|
3493
|
+
value: ct.decodeString(e.value, Qr.schema)
|
|
3358
3494
|
};
|
|
3359
3495
|
}
|
|
3360
|
-
},
|
|
3496
|
+
}, Ma = class {
|
|
3361
3497
|
series;
|
|
3362
3498
|
index;
|
|
3363
3499
|
data;
|
|
3364
3500
|
density;
|
|
3365
3501
|
constructor(e) {
|
|
3366
|
-
if (!e.dataType.equals(
|
|
3502
|
+
if (!e.dataType.equals(S.UUID))
|
|
3367
3503
|
throw new Error("cannot create a UUID series iterator for a non-UUID series");
|
|
3368
|
-
this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density =
|
|
3504
|
+
this.series = e, this.index = 0, this.data = new Uint8Array(e.buffer), this.density = S.UUID.density.valueOf();
|
|
3369
3505
|
}
|
|
3370
3506
|
next() {
|
|
3371
3507
|
if (this.index >= this.series.length) return { done: !0, value: void 0 };
|
|
3372
|
-
const e =
|
|
3508
|
+
const e = Gt(this.data, this.index * this.density);
|
|
3373
3509
|
return this.index++, { done: !1, value: e };
|
|
3374
3510
|
}
|
|
3375
|
-
}
|
|
3511
|
+
};
|
|
3512
|
+
class Aa {
|
|
3376
3513
|
series;
|
|
3377
3514
|
index;
|
|
3378
3515
|
constructor(e) {
|
|
@@ -3384,7 +3521,8 @@ let Fi = class {
|
|
|
3384
3521
|
value: this.series.at(this.index++, !0)
|
|
3385
3522
|
};
|
|
3386
3523
|
}
|
|
3387
|
-
}
|
|
3524
|
+
}
|
|
3525
|
+
class ju {
|
|
3388
3526
|
/** The array of series in this collection */
|
|
3389
3527
|
series;
|
|
3390
3528
|
/**
|
|
@@ -3437,14 +3575,14 @@ let Fi = class {
|
|
|
3437
3575
|
this.series = e;
|
|
3438
3576
|
}
|
|
3439
3577
|
as(e) {
|
|
3440
|
-
return
|
|
3578
|
+
return Hr(e, this.dataType), this;
|
|
3441
3579
|
}
|
|
3442
3580
|
/**
|
|
3443
3581
|
* Returns the data type of the series in this collection. If the collection is empty,
|
|
3444
3582
|
* returns DataType.UNKNOWN.
|
|
3445
3583
|
*/
|
|
3446
3584
|
get dataType() {
|
|
3447
|
-
return this.series.length === 0 ?
|
|
3585
|
+
return this.series.length === 0 ? S.UNKNOWN : this.series[0].dataType;
|
|
3448
3586
|
}
|
|
3449
3587
|
/**
|
|
3450
3588
|
* Returns the combined time range of all series in the collection. If the collection
|
|
@@ -3452,7 +3590,7 @@ let Fi = class {
|
|
|
3452
3590
|
* series to the end of the last series.
|
|
3453
3591
|
*/
|
|
3454
3592
|
get timeRange() {
|
|
3455
|
-
return this.series.length === 0 ?
|
|
3593
|
+
return this.series.length === 0 ? Q.ZERO : new Q(
|
|
3456
3594
|
this.series[0].timeRange.start,
|
|
3457
3595
|
this.series[this.series.length - 1].timeRange.end
|
|
3458
3596
|
);
|
|
@@ -3479,7 +3617,7 @@ let Fi = class {
|
|
|
3479
3617
|
const r = () => new Error(
|
|
3480
3618
|
`cannot push a ${e.dataType.toString()} series to a ${this.dataType.toString()} multi-series`
|
|
3481
3619
|
), n = e.dataType.equals(this.dataType);
|
|
3482
|
-
if (
|
|
3620
|
+
if (Kr(e)) {
|
|
3483
3621
|
if (this.series.length !== 0 && !n) throw r();
|
|
3484
3622
|
this.series.push(e);
|
|
3485
3623
|
} else {
|
|
@@ -3497,7 +3635,7 @@ let Fi = class {
|
|
|
3497
3635
|
}
|
|
3498
3636
|
atAlignment(e, r) {
|
|
3499
3637
|
for (const n of this.series)
|
|
3500
|
-
if (
|
|
3638
|
+
if (L(n.alignmentBounds, e))
|
|
3501
3639
|
return n.atAlignment(e, r);
|
|
3502
3640
|
if (r) throw new Error(`[series] - no value at alignment ${e}`);
|
|
3503
3641
|
}
|
|
@@ -3516,7 +3654,7 @@ let Fi = class {
|
|
|
3516
3654
|
* @returns An iterator over the specified range.
|
|
3517
3655
|
*/
|
|
3518
3656
|
subIterator(e, r) {
|
|
3519
|
-
return new
|
|
3657
|
+
return new at(this, e, r ?? this.length);
|
|
3520
3658
|
}
|
|
3521
3659
|
/**
|
|
3522
3660
|
* Returns an iterator over a portion of the multi-series based on alignment.
|
|
@@ -3526,13 +3664,13 @@ let Fi = class {
|
|
|
3526
3664
|
*/
|
|
3527
3665
|
subAlignmentIterator(e, r) {
|
|
3528
3666
|
if (e >= this.alignmentBounds.upper || r <= this.alignmentBounds.lower)
|
|
3529
|
-
return
|
|
3667
|
+
return Ot;
|
|
3530
3668
|
let n = 0;
|
|
3531
3669
|
for (let i = 0; i < this.series.length; i++) {
|
|
3532
3670
|
const o = this.series[i];
|
|
3533
3671
|
if (e < o.alignment) break;
|
|
3534
3672
|
if (e >= o.alignmentBounds.upper) n += o.length;
|
|
3535
|
-
else if (
|
|
3673
|
+
else if (L(o.alignmentBounds, e)) {
|
|
3536
3674
|
n += Math.ceil(
|
|
3537
3675
|
Number(e - o.alignment) / Number(o.alignmentMultiple)
|
|
3538
3676
|
);
|
|
@@ -3544,14 +3682,14 @@ let Fi = class {
|
|
|
3544
3682
|
const o = this.series[i];
|
|
3545
3683
|
if (r < o.alignment) break;
|
|
3546
3684
|
if (r >= o.alignmentBounds.upper) s += o.length;
|
|
3547
|
-
else if (
|
|
3685
|
+
else if (L(o.alignmentBounds, r)) {
|
|
3548
3686
|
s += Math.ceil(
|
|
3549
3687
|
Number(r - o.alignment) / Number(o.alignmentMultiple)
|
|
3550
3688
|
);
|
|
3551
3689
|
break;
|
|
3552
3690
|
}
|
|
3553
3691
|
}
|
|
3554
|
-
return new
|
|
3692
|
+
return new at(this, n, s);
|
|
3555
3693
|
}
|
|
3556
3694
|
/**
|
|
3557
3695
|
* Returns an iterator over the specified alignment range and span.
|
|
@@ -3560,19 +3698,19 @@ let Fi = class {
|
|
|
3560
3698
|
* @returns An iterator over the specified range.
|
|
3561
3699
|
*/
|
|
3562
3700
|
subAlignmentSpanIterator(e, r) {
|
|
3563
|
-
if (e >= this.alignmentBounds.upper) return
|
|
3701
|
+
if (e >= this.alignmentBounds.upper) return Ot;
|
|
3564
3702
|
r = Math.min(r, Number(this.distance(e, this.alignmentBounds.upper)));
|
|
3565
3703
|
let n = 0;
|
|
3566
3704
|
for (let s = 0; s < this.series.length; s++) {
|
|
3567
3705
|
const i = this.series[s];
|
|
3568
3706
|
if (e < i.alignment) break;
|
|
3569
3707
|
if (e >= i.alignmentBounds.upper) n += i.length;
|
|
3570
|
-
else if (
|
|
3708
|
+
else if (L(i.alignmentBounds, e)) {
|
|
3571
3709
|
n += Number(e - i.alignment);
|
|
3572
3710
|
break;
|
|
3573
3711
|
}
|
|
3574
3712
|
}
|
|
3575
|
-
return new
|
|
3713
|
+
return new at(this, n, n + r);
|
|
3576
3714
|
}
|
|
3577
3715
|
/**
|
|
3578
3716
|
* Updates the WebGL buffer for all series in the collection.
|
|
@@ -3585,13 +3723,13 @@ let Fi = class {
|
|
|
3585
3723
|
* Returns the bounds containing the minimum and maximum values across all series.
|
|
3586
3724
|
*/
|
|
3587
3725
|
get bounds() {
|
|
3588
|
-
return
|
|
3726
|
+
return Tr(this.series.map((e) => e.bounds));
|
|
3589
3727
|
}
|
|
3590
3728
|
/**
|
|
3591
3729
|
* Returns the sum of the byte lengths of all series.
|
|
3592
3730
|
*/
|
|
3593
3731
|
get byteLength() {
|
|
3594
|
-
return new
|
|
3732
|
+
return new Ze(this.series.reduce((e, r) => e + r.byteLength.valueOf(), 0));
|
|
3595
3733
|
}
|
|
3596
3734
|
/**
|
|
3597
3735
|
* Returns a combined typed array containing all data from all series.
|
|
@@ -3612,7 +3750,7 @@ let Fi = class {
|
|
|
3612
3750
|
*/
|
|
3613
3751
|
traverseAlignment(e, r) {
|
|
3614
3752
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3615
|
-
return
|
|
3753
|
+
return xr(n, e, r);
|
|
3616
3754
|
}
|
|
3617
3755
|
/**
|
|
3618
3756
|
* Acquires a reference to the WebGL buffer for all series.
|
|
@@ -3635,7 +3773,7 @@ let Fi = class {
|
|
|
3635
3773
|
*/
|
|
3636
3774
|
distance(e, r) {
|
|
3637
3775
|
const n = this.series.map((s) => s.alignmentBounds);
|
|
3638
|
-
return
|
|
3776
|
+
return Sr(n, e, r);
|
|
3639
3777
|
}
|
|
3640
3778
|
/**
|
|
3641
3779
|
* Parses a JSON multi-series into an array of values using the provided zod schema.
|
|
@@ -3645,7 +3783,7 @@ let Fi = class {
|
|
|
3645
3783
|
* @returns An array of values parsed from the JSON series.
|
|
3646
3784
|
*/
|
|
3647
3785
|
parseJSON(e) {
|
|
3648
|
-
if (!this.dataType.equals(
|
|
3786
|
+
if (!this.dataType.equals(S.JSON))
|
|
3649
3787
|
throw new Error("cannot parse non-JSON series as JSON");
|
|
3650
3788
|
return this.series.flatMap((r) => r.parseJSON(e));
|
|
3651
3789
|
}
|
|
@@ -3658,7 +3796,7 @@ let Fi = class {
|
|
|
3658
3796
|
next() {
|
|
3659
3797
|
return { done: !0, value: void 0 };
|
|
3660
3798
|
}
|
|
3661
|
-
} : new
|
|
3799
|
+
} : new Ea(this.series);
|
|
3662
3800
|
}
|
|
3663
3801
|
/**
|
|
3664
3802
|
* Returns an array of the values in the multi-series as strings.
|
|
@@ -3668,8 +3806,8 @@ let Fi = class {
|
|
|
3668
3806
|
toStrings() {
|
|
3669
3807
|
return this.series.flatMap((e) => e.toStrings());
|
|
3670
3808
|
}
|
|
3671
|
-
}
|
|
3672
|
-
class
|
|
3809
|
+
}
|
|
3810
|
+
let Ea = class {
|
|
3673
3811
|
series;
|
|
3674
3812
|
seriesIndex;
|
|
3675
3813
|
internal;
|
|
@@ -3683,8 +3821,7 @@ class Hi {
|
|
|
3683
3821
|
[Symbol.iterator]() {
|
|
3684
3822
|
return this;
|
|
3685
3823
|
}
|
|
3686
|
-
}
|
|
3687
|
-
let et = class {
|
|
3824
|
+
}, at = class {
|
|
3688
3825
|
series;
|
|
3689
3826
|
index;
|
|
3690
3827
|
end;
|
|
@@ -3698,51 +3835,51 @@ let et = class {
|
|
|
3698
3835
|
return this;
|
|
3699
3836
|
}
|
|
3700
3837
|
};
|
|
3701
|
-
const
|
|
3838
|
+
const rr = (t) => {
|
|
3702
3839
|
const e = t >> 32n, r = t & 0xffffffffn;
|
|
3703
3840
|
return { domain: e, sample: r };
|
|
3704
3841
|
};
|
|
3705
3842
|
a.object({ key: a.string(), value: a.string() });
|
|
3706
|
-
const
|
|
3843
|
+
const Ua = a.record(
|
|
3707
3844
|
a.union([a.number(), a.string(), a.symbol()]),
|
|
3708
3845
|
a.unknown()
|
|
3709
|
-
),
|
|
3846
|
+
), Ht = (t) => Object.entries(t), Ba = (t, e) => Object.fromEntries(Ht(t).map(([r, n]) => [r, e(n, r)])), ja = (t) => Object.fromEntries(Ht(t).filter(([e, r]) => r !== void 0)), Ca = (t, ...e) => {
|
|
3710
3847
|
const r = { ...t };
|
|
3711
3848
|
for (const n of e) delete r[n];
|
|
3712
3849
|
return r;
|
|
3713
|
-
},
|
|
3850
|
+
}, Lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3714
3851
|
__proto__: null,
|
|
3715
|
-
entries:
|
|
3716
|
-
map:
|
|
3717
|
-
omit:
|
|
3718
|
-
purgeUndefined:
|
|
3719
|
-
unknownZ:
|
|
3720
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3852
|
+
entries: Ht,
|
|
3853
|
+
map: Ba,
|
|
3854
|
+
omit: Ca,
|
|
3855
|
+
purgeUndefined: ja,
|
|
3856
|
+
unknownZ: Ua
|
|
3857
|
+
}, Symbol.toStringTag, { value: "Module" })), _r = () => typeof process < "u" && process.versions != null && process.versions.node != null ? "node" : typeof window > "u" || window.document === void 0 ? "webworker" : "browser", Ra = _r(), en = ["macOS", "Windows", "Linux"], La = ["macos", "windows", "linux"], Da = {
|
|
3721
3858
|
macos: "macOS",
|
|
3722
3859
|
windows: "Windows",
|
|
3723
3860
|
linux: "Linux"
|
|
3724
|
-
},
|
|
3725
|
-
a.enum(
|
|
3726
|
-
),
|
|
3861
|
+
}, Pa = a.enum(en).or(
|
|
3862
|
+
a.enum(La).transform((t) => Da[t])
|
|
3863
|
+
), ka = () => {
|
|
3727
3864
|
if (typeof window > "u") return;
|
|
3728
3865
|
const t = window.navigator.userAgent.toLowerCase();
|
|
3729
3866
|
if (t.includes("mac")) return "macOS";
|
|
3730
3867
|
if (t.includes("win")) return "Windows";
|
|
3731
3868
|
if (t.includes("linux")) return "Linux";
|
|
3732
3869
|
};
|
|
3733
|
-
let
|
|
3734
|
-
const
|
|
3870
|
+
let ot;
|
|
3871
|
+
const qa = ((t = {}) => {
|
|
3735
3872
|
const { force: e, default: r } = t;
|
|
3736
|
-
return e ??
|
|
3737
|
-
},
|
|
3873
|
+
return e ?? ot ?? (ot = ka(), ot ?? r);
|
|
3874
|
+
}), Du = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3738
3875
|
__proto__: null,
|
|
3739
|
-
OPERATING_SYSTEMS:
|
|
3740
|
-
RUNTIME:
|
|
3741
|
-
detect:
|
|
3742
|
-
getOS:
|
|
3743
|
-
osZ:
|
|
3744
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3745
|
-
class
|
|
3876
|
+
OPERATING_SYSTEMS: en,
|
|
3877
|
+
RUNTIME: Ra,
|
|
3878
|
+
detect: _r,
|
|
3879
|
+
getOS: qa,
|
|
3880
|
+
osZ: Pa
|
|
3881
|
+
}, Symbol.toStringTag, { value: "Module" })), za = (...t) => t.map(tn).join(""), tn = (t) => (t.endsWith("/") || (t += "/"), t.startsWith("/") && (t = t.slice(1)), t), Za = (t) => t.endsWith("/") ? t.slice(0, -1) : t;
|
|
3882
|
+
class De {
|
|
3746
3883
|
protocol;
|
|
3747
3884
|
host;
|
|
3748
3885
|
port;
|
|
@@ -3754,7 +3891,7 @@ class je {
|
|
|
3754
3891
|
* @param pathPrefix - A path prefix to use for all requests. Defaults to "".
|
|
3755
3892
|
*/
|
|
3756
3893
|
constructor({ host: e, port: r, protocol: n = "", pathPrefix: s = "" }) {
|
|
3757
|
-
this.protocol = n, this.host = e, this.port = r, this.path =
|
|
3894
|
+
this.protocol = n, this.host = e, this.port = r, this.path = tn(s);
|
|
3758
3895
|
}
|
|
3759
3896
|
/**
|
|
3760
3897
|
* Replaces creates a new URL with the specified properties replaced.
|
|
@@ -3762,7 +3899,7 @@ class je {
|
|
|
3762
3899
|
* @returns a new URL.
|
|
3763
3900
|
*/
|
|
3764
3901
|
replace(e) {
|
|
3765
|
-
return new
|
|
3902
|
+
return new De({
|
|
3766
3903
|
host: e.host ?? this.host,
|
|
3767
3904
|
port: e.port ?? this.port,
|
|
3768
3905
|
protocol: e.protocol ?? this.protocol,
|
|
@@ -3775,106 +3912,121 @@ class je {
|
|
|
3775
3912
|
* @returns a new URL.
|
|
3776
3913
|
*/
|
|
3777
3914
|
child(e) {
|
|
3778
|
-
return new
|
|
3915
|
+
return new De({
|
|
3779
3916
|
...this,
|
|
3780
|
-
pathPrefix:
|
|
3917
|
+
pathPrefix: za(this.path, e)
|
|
3781
3918
|
});
|
|
3782
3919
|
}
|
|
3783
3920
|
/** @returns a string representation of the url */
|
|
3784
3921
|
toString() {
|
|
3785
|
-
return
|
|
3922
|
+
return Za(
|
|
3786
3923
|
`${this.protocol}://${this.host}:${this.port}/${this.path}`
|
|
3787
3924
|
);
|
|
3788
3925
|
}
|
|
3789
|
-
static UNKNOWN = new
|
|
3926
|
+
static UNKNOWN = new De({ host: "unknown", port: 0 });
|
|
3790
3927
|
}
|
|
3791
|
-
const
|
|
3928
|
+
const Fa = 2, Ya = 3, Wa = 2, Va = (t, e) => {
|
|
3792
3929
|
if (Number.isNaN(t) || !Number.isFinite(t)) return t;
|
|
3793
|
-
const r =
|
|
3930
|
+
const r = Te(e);
|
|
3794
3931
|
if (r == 0) return t;
|
|
3795
3932
|
let n;
|
|
3796
|
-
r >= 1e3 ? n =
|
|
3933
|
+
r >= 1e3 ? n = Fa : r >= 1 ? n = Ya : n = Math.ceil(-Math.log10(r)) + Wa;
|
|
3797
3934
|
const s = 10 ** n;
|
|
3798
3935
|
return Math.round(t * s) / s;
|
|
3799
|
-
},
|
|
3936
|
+
}, Pu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3800
3937
|
__proto__: null,
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3938
|
+
MAX_INT16: sa,
|
|
3939
|
+
MAX_INT32: aa,
|
|
3940
|
+
MAX_INT64: ze,
|
|
3941
|
+
MAX_INT64_NUMBER: Yr,
|
|
3942
|
+
MAX_INT8: ra,
|
|
3943
|
+
MAX_UINT16: Ki,
|
|
3944
|
+
MAX_UINT32: Qi,
|
|
3945
|
+
MAX_UINT64: _i,
|
|
3946
|
+
MAX_UINT64_NUMBER: ea,
|
|
3947
|
+
MAX_UINT8: Ji,
|
|
3948
|
+
MIN_INT16: na,
|
|
3949
|
+
MIN_INT32: ia,
|
|
3950
|
+
MIN_INT64: oa,
|
|
3951
|
+
MIN_INT64_NUMBER: ua,
|
|
3952
|
+
MIN_INT8: ta,
|
|
3953
|
+
abs: Or,
|
|
3954
|
+
add: ue,
|
|
3955
|
+
closeTo: ts,
|
|
3956
|
+
div: ve,
|
|
3957
|
+
equal: dt,
|
|
3958
|
+
isInteger: ke,
|
|
3959
|
+
max: ns,
|
|
3960
|
+
min: $r,
|
|
3961
|
+
mult: R,
|
|
3962
|
+
roundBySpan: Va,
|
|
3963
|
+
roundToNearestMagnitude: rs,
|
|
3964
|
+
sub: Z
|
|
3813
3965
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3814
3966
|
a.object({
|
|
3815
|
-
baseInterval:
|
|
3967
|
+
baseInterval: c.z.optional(),
|
|
3816
3968
|
maxRetries: a.number().optional(),
|
|
3817
3969
|
scale: a.number().optional()
|
|
3818
3970
|
});
|
|
3819
|
-
const
|
|
3971
|
+
const Ga = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, Fe = a.string().regex(Ga), ie = a.number().min(0).max(255), rn = a.number().min(0).max(1), _e = a.tuple([ie, ie, ie, rn]), Ha = a.tuple([ie, ie, ie]), Xa = a.object({ rgba255: _e }), Ja = a.number().min(0).max(360), Ka = a.number().min(0).max(100), Qa = a.number().min(0).max(100), nn = a.tuple([Ja, Ka, Qa, rn]), et = a.union([Fe, Ha, _e, nn, Xa]), tt = et.transform((t) => T(t)), _a = (t) => tt.safeParse(t).success, eo = (t) => _e.safeParse(t).success, to = ((t) => {
|
|
3820
3972
|
if (t == null) return;
|
|
3821
|
-
const e =
|
|
3822
|
-
if (e.success) return
|
|
3973
|
+
const e = tt.safeParse(t);
|
|
3974
|
+
if (e.success) return an(e.data);
|
|
3823
3975
|
if (typeof t == "string") return t;
|
|
3824
3976
|
throw e.error;
|
|
3825
|
-
},
|
|
3826
|
-
if (t =
|
|
3977
|
+
}), T = (t, e = 1) => {
|
|
3978
|
+
if (t = et.parse(t), typeof t == "string") return Pe(t, e);
|
|
3827
3979
|
if (Array.isArray(t)) {
|
|
3828
3980
|
if (t.length < 3 || t.length > 4)
|
|
3829
3981
|
throw new Error(`Invalid color: [${t.join(", ")}]`);
|
|
3830
3982
|
return t.length === 3 ? [...t, e] : t;
|
|
3831
3983
|
}
|
|
3832
3984
|
return t.rgba255;
|
|
3833
|
-
},
|
|
3985
|
+
}, sn = (t, e) => {
|
|
3834
3986
|
if (t == null || e == null) return t == e;
|
|
3835
|
-
const r =
|
|
3987
|
+
const r = T(t), n = T(e);
|
|
3836
3988
|
return r.every((s, i) => s === n[i]);
|
|
3837
|
-
},
|
|
3989
|
+
}, ro = ((t) => {
|
|
3838
3990
|
if (t == null) return;
|
|
3839
|
-
const [e, r, n, s] =
|
|
3840
|
-
return `#${
|
|
3841
|
-
},
|
|
3842
|
-
const [e, r, n, s] =
|
|
3991
|
+
const [e, r, n, s] = T(t);
|
|
3992
|
+
return `#${Me(e)}${Me(r)}${Me(n)}${s === 1 ? "" : Me(s * 255)}`;
|
|
3993
|
+
}), an = (t) => {
|
|
3994
|
+
const [e, r, n, s] = T(t);
|
|
3843
3995
|
return `rgba(${e}, ${r}, ${n}, ${s})`;
|
|
3844
|
-
},
|
|
3845
|
-
const [e, r, n] =
|
|
3996
|
+
}, no = (t) => `rgb(${on(t)})`, on = (t) => {
|
|
3997
|
+
const [e, r, n] = T(t);
|
|
3846
3998
|
return `${e}, ${r}, ${n}`;
|
|
3847
|
-
},
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
],
|
|
3852
|
-
const [r, n, s] =
|
|
3999
|
+
}, so = (t) => [...Xt(t), me(t)], Xt = (t) => [
|
|
4000
|
+
de(t) / 255,
|
|
4001
|
+
ge(t) / 255,
|
|
4002
|
+
pe(t) / 255
|
|
4003
|
+
], de = (t) => T(t)[0], ge = (t) => T(t)[1], pe = (t) => T(t)[2], me = (t) => T(t)[3], io = (t) => sn(Jt, t), ao = (t) => mo(T(t)), oo = (t, e) => {
|
|
4004
|
+
const [r, n, s] = T(t);
|
|
3853
4005
|
if (e > 100)
|
|
3854
4006
|
throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
|
|
3855
4007
|
return e > 1 && (e /= 100), [r, n, s, e];
|
|
3856
|
-
},
|
|
3857
|
-
const [e, r, n] =
|
|
4008
|
+
}, $e = (t) => {
|
|
4009
|
+
const [e, r, n] = Xt(t).map(
|
|
3858
4010
|
(s) => s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4
|
|
3859
4011
|
);
|
|
3860
4012
|
return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
3861
|
-
},
|
|
3862
|
-
const [e, r, n] =
|
|
4013
|
+
}, uo = (t) => {
|
|
4014
|
+
const [e, r, n] = Xt(t);
|
|
3863
4015
|
return 1 - (Math.max(e, r, n) - Math.min(e, r, n));
|
|
3864
|
-
},
|
|
3865
|
-
const r =
|
|
4016
|
+
}, Tt = (t, e) => {
|
|
4017
|
+
const r = T(t), n = T(e), s = $e(r), i = $e(n);
|
|
3866
4018
|
return (Math.max(s, i) + 0.5) / (Math.min(s, i) + 0.5);
|
|
3867
|
-
},
|
|
4019
|
+
}, lo = (t, ...e) => {
|
|
3868
4020
|
if (e.length === 0)
|
|
3869
4021
|
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
3870
|
-
const r =
|
|
3871
|
-
return
|
|
3872
|
-
},
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
t.length === 8 ?
|
|
3877
|
-
]),
|
|
4022
|
+
const r = T(t), [n] = e.sort((s, i) => Tt(r, i) - Tt(r, s));
|
|
4023
|
+
return T(n);
|
|
4024
|
+
}, co = (t) => $e(t) < 0.5, ho = (t) => $e(t) > 0.5, Pe = (t, e = 1) => (t = Fe.parse(t), t = fo(t), [
|
|
4025
|
+
Ae(t, 0),
|
|
4026
|
+
Ae(t, 2),
|
|
4027
|
+
Ae(t, 4),
|
|
4028
|
+
t.length === 8 ? Ae(t, 6) / 255 : e
|
|
4029
|
+
]), Jt = [0, 0, 0, 0], Me = (t) => Math.floor(t).toString(16).padStart(2, "0"), Ae = (t, e) => parseInt(t.slice(e, e + 2), 16), fo = (t) => t.startsWith("#") ? t.slice(1) : t, nr = {
|
|
3878
4030
|
black: "#000000",
|
|
3879
4031
|
white: "#ffffff",
|
|
3880
4032
|
red: "#ff0000",
|
|
@@ -3906,16 +4058,16 @@ const ha = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ke = a.string().regex(ha), ne = a.n
|
|
|
3906
4058
|
khaki: "#f0e68c",
|
|
3907
4059
|
crimson: "#dc143c",
|
|
3908
4060
|
transparent: "transparent"
|
|
3909
|
-
},
|
|
4061
|
+
}, go = (t) => {
|
|
3910
4062
|
if (!t) return;
|
|
3911
4063
|
const e = t.trim().toLowerCase();
|
|
3912
4064
|
if (!(e === "transparent" || e === "none")) {
|
|
3913
4065
|
if (e.startsWith("#")) {
|
|
3914
4066
|
if (e.length === 4) {
|
|
3915
4067
|
const r = e[1], n = e[2], s = e[3], i = `#${r}${r}${n}${n}${s}${s}`;
|
|
3916
|
-
if (
|
|
4068
|
+
if (Fe.safeParse(i).success) return Pe(i);
|
|
3917
4069
|
}
|
|
3918
|
-
return (e.length === 7 || e.length === 9) &&
|
|
4070
|
+
return (e.length === 7 || e.length === 9) && Fe.safeParse(e).success ? Pe(e) : void 0;
|
|
3919
4071
|
}
|
|
3920
4072
|
if (e.startsWith("rgb")) {
|
|
3921
4073
|
const r = e.match(
|
|
@@ -3926,252 +4078,256 @@ const ha = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ke = a.string().regex(ha), ne = a.n
|
|
|
3926
4078
|
return [parseInt(n), parseInt(s), parseInt(i), o ? parseFloat(o) : 1];
|
|
3927
4079
|
}
|
|
3928
4080
|
}
|
|
3929
|
-
if (
|
|
4081
|
+
if (nr[e]) return Pe(nr[e]);
|
|
3930
4082
|
}
|
|
3931
|
-
},
|
|
3932
|
-
t =
|
|
4083
|
+
}, po = (t) => {
|
|
4084
|
+
t = nn.parse(t);
|
|
3933
4085
|
let [e, r, n] = t;
|
|
3934
4086
|
const s = t[3];
|
|
3935
4087
|
e /= 360, r /= 100, n /= 100;
|
|
3936
|
-
let i, o,
|
|
4088
|
+
let i, o, h;
|
|
3937
4089
|
if (r === 0)
|
|
3938
|
-
i = o =
|
|
4090
|
+
i = o = h = n;
|
|
3939
4091
|
else {
|
|
3940
|
-
const
|
|
3941
|
-
i =
|
|
4092
|
+
const f = n < 0.5 ? n * (1 + r) : n + r - n * r, l = 2 * n - f;
|
|
4093
|
+
i = ut(l, f, e + 1 / 3), o = ut(l, f, e), h = ut(l, f, e - 1 / 3);
|
|
3942
4094
|
}
|
|
3943
|
-
return [Math.round(i * 255), Math.round(o * 255), Math.round(
|
|
3944
|
-
},
|
|
3945
|
-
t =
|
|
4095
|
+
return [Math.round(i * 255), Math.round(o * 255), Math.round(h * 255), s];
|
|
4096
|
+
}, ut = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), mo = (t) => {
|
|
4097
|
+
t = _e.parse(t);
|
|
3946
4098
|
let [e, r, n] = t;
|
|
3947
4099
|
const s = t[3];
|
|
3948
4100
|
e /= 255, r /= 255, n /= 255;
|
|
3949
4101
|
const i = Math.max(e, r, n), o = Math.min(e, r, n);
|
|
3950
|
-
let
|
|
4102
|
+
let h, f, l = (i + o) / 2;
|
|
3951
4103
|
if (i === o)
|
|
3952
|
-
|
|
4104
|
+
h = f = 0;
|
|
3953
4105
|
else {
|
|
3954
4106
|
const d = i - o;
|
|
3955
|
-
|
|
4107
|
+
f = l > 0.5 ? d / (2 - i - o) : d / (i + o), i === e ? h = (r - n) / d + (r < n ? 6 : 0) : i === r ? h = (n - e) / d + 2 : h = (e - r) / d + 4, h /= 6;
|
|
3956
4108
|
}
|
|
3957
|
-
return
|
|
3958
|
-
},
|
|
4109
|
+
return h *= 360, f *= 100, l *= 100, [Math.round(h), Math.round(f), Math.round(l), s];
|
|
4110
|
+
}, yo = T("#000000"), bo = T("#ffffff"), un = a.object({
|
|
3959
4111
|
key: a.string(),
|
|
3960
|
-
color:
|
|
4112
|
+
color: et,
|
|
3961
4113
|
position: a.number(),
|
|
3962
4114
|
switched: a.boolean().optional()
|
|
3963
|
-
}),
|
|
3964
|
-
if (t.length === 0) return
|
|
3965
|
-
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return
|
|
4115
|
+
}), wo = a.array(un), $o = (t, e) => {
|
|
4116
|
+
if (t.length === 0) return Jt;
|
|
4117
|
+
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return T(t[0].color);
|
|
3966
4118
|
if (e >= t[t.length - 1].position)
|
|
3967
|
-
return
|
|
4119
|
+
return T(t[t.length - 1].color);
|
|
3968
4120
|
for (let r = 0; r < t.length - 1; r++) {
|
|
3969
4121
|
const n = t[r], s = t[r + 1];
|
|
3970
4122
|
if (e < n.position || e > s.position) continue;
|
|
3971
|
-
if (e === n.position) return
|
|
3972
|
-
if (e === s.position) return
|
|
3973
|
-
const i = (e - n.position) / (s.position - n.position), o =
|
|
3974
|
-
|
|
4123
|
+
if (e === n.position) return T(n.color);
|
|
4124
|
+
if (e === s.position) return T(s.color);
|
|
4125
|
+
const i = (e - n.position) / (s.position - n.position), o = T(n.color), h = T(s.color), f = Math.round(
|
|
4126
|
+
de(o) + i * (de(h) - de(o))
|
|
3975
4127
|
), l = Math.round(
|
|
3976
|
-
|
|
4128
|
+
ge(o) + i * (ge(h) - ge(o))
|
|
3977
4129
|
), d = Math.round(
|
|
3978
|
-
|
|
3979
|
-
),
|
|
3980
|
-
return
|
|
4130
|
+
pe(o) + i * (pe(h) - pe(o))
|
|
4131
|
+
), m = me(o) + i * (me(h) - me(o));
|
|
4132
|
+
return T([f, l, d, m]);
|
|
3981
4133
|
}
|
|
3982
|
-
return
|
|
3983
|
-
},
|
|
4134
|
+
return T(t[t.length - 1].color);
|
|
4135
|
+
}, Oo = a.object({
|
|
3984
4136
|
key: a.string(),
|
|
3985
4137
|
name: a.string(),
|
|
3986
|
-
color:
|
|
3987
|
-
}),
|
|
4138
|
+
color: tt
|
|
4139
|
+
}), vo = a.object({
|
|
3988
4140
|
key: a.string(),
|
|
3989
4141
|
name: a.string(),
|
|
3990
|
-
swatches: a.array(
|
|
3991
|
-
}),
|
|
4142
|
+
swatches: a.array(Oo)
|
|
4143
|
+
}), To = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3992
4144
|
__proto__: null,
|
|
3993
|
-
BLACK:
|
|
3994
|
-
WHITE:
|
|
3995
|
-
ZERO:
|
|
3996
|
-
aValue:
|
|
3997
|
-
bValue:
|
|
3998
|
-
colorZ:
|
|
3999
|
-
construct:
|
|
4000
|
-
contrast:
|
|
4001
|
-
crudeZ:
|
|
4002
|
-
cssString:
|
|
4003
|
-
equals:
|
|
4004
|
-
fromCSS:
|
|
4005
|
-
fromGradient:
|
|
4006
|
-
fromHSLA:
|
|
4007
|
-
gValue:
|
|
4008
|
-
gradientZ:
|
|
4009
|
-
grayness:
|
|
4010
|
-
hex:
|
|
4011
|
-
hsla:
|
|
4012
|
-
isColor:
|
|
4013
|
-
isCrude:
|
|
4014
|
-
isDark:
|
|
4015
|
-
isLight:
|
|
4016
|
-
isZero:
|
|
4017
|
-
luminance:
|
|
4018
|
-
paletteZ:
|
|
4019
|
-
pickByContrast:
|
|
4020
|
-
rValue:
|
|
4021
|
-
rgbCSS:
|
|
4022
|
-
rgbString:
|
|
4023
|
-
rgba1:
|
|
4024
|
-
rgbaCSS:
|
|
4025
|
-
setAlpha:
|
|
4026
|
-
stopZ:
|
|
4027
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4028
|
-
lower:
|
|
4029
|
-
upper:
|
|
4030
|
-
},
|
|
4145
|
+
BLACK: yo,
|
|
4146
|
+
WHITE: bo,
|
|
4147
|
+
ZERO: Jt,
|
|
4148
|
+
aValue: me,
|
|
4149
|
+
bValue: pe,
|
|
4150
|
+
colorZ: tt,
|
|
4151
|
+
construct: T,
|
|
4152
|
+
contrast: Tt,
|
|
4153
|
+
crudeZ: et,
|
|
4154
|
+
cssString: to,
|
|
4155
|
+
equals: sn,
|
|
4156
|
+
fromCSS: go,
|
|
4157
|
+
fromGradient: $o,
|
|
4158
|
+
fromHSLA: po,
|
|
4159
|
+
gValue: ge,
|
|
4160
|
+
gradientZ: wo,
|
|
4161
|
+
grayness: uo,
|
|
4162
|
+
hex: ro,
|
|
4163
|
+
hsla: ao,
|
|
4164
|
+
isColor: eo,
|
|
4165
|
+
isCrude: _a,
|
|
4166
|
+
isDark: co,
|
|
4167
|
+
isLight: ho,
|
|
4168
|
+
isZero: io,
|
|
4169
|
+
luminance: $e,
|
|
4170
|
+
paletteZ: vo,
|
|
4171
|
+
pickByContrast: lo,
|
|
4172
|
+
rValue: de,
|
|
4173
|
+
rgbCSS: no,
|
|
4174
|
+
rgbString: on,
|
|
4175
|
+
rgba1: so,
|
|
4176
|
+
rgbaCSS: an,
|
|
4177
|
+
setAlpha: oo,
|
|
4178
|
+
stopZ: un
|
|
4179
|
+
}, Symbol.toStringTag, { value: "Module" })), ln = a.int().min(0).max(255), cn = 255, hn = 0, xo = {
|
|
4180
|
+
lower: hn,
|
|
4181
|
+
upper: cn + 1
|
|
4182
|
+
}, fn = a.object({
|
|
4031
4183
|
name: a.string(),
|
|
4032
4184
|
key: a.string()
|
|
4033
|
-
}),
|
|
4034
|
-
subject:
|
|
4185
|
+
}), Oe = (t) => a.object({
|
|
4186
|
+
subject: fn,
|
|
4035
4187
|
resource: t,
|
|
4036
|
-
authority:
|
|
4037
|
-
}),
|
|
4188
|
+
authority: ln
|
|
4189
|
+
}), So = (...t) => (e) => e.filter((r) => {
|
|
4038
4190
|
let n = !1;
|
|
4039
4191
|
return r.to != null && (n = t.includes(r.to.resource)), r.from != null && !n && (n = t.includes(r.from.resource)), n;
|
|
4040
|
-
}),
|
|
4041
|
-
from:
|
|
4192
|
+
}), dn = (t) => a.object({
|
|
4193
|
+
from: Oe(t),
|
|
4042
4194
|
to: a.null()
|
|
4043
|
-
}),
|
|
4195
|
+
}), gn = (t) => a.object({
|
|
4044
4196
|
from: a.null(),
|
|
4045
|
-
to:
|
|
4046
|
-
}),
|
|
4047
|
-
|
|
4048
|
-
|
|
4197
|
+
to: Oe(t)
|
|
4198
|
+
}), No = (t) => a.union([
|
|
4199
|
+
dn(t),
|
|
4200
|
+
gn(t),
|
|
4049
4201
|
a.object({
|
|
4050
|
-
from:
|
|
4051
|
-
to:
|
|
4202
|
+
from: Oe(t),
|
|
4203
|
+
to: Oe(t)
|
|
4052
4204
|
})
|
|
4053
|
-
]),
|
|
4205
|
+
]), ku = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4054
4206
|
__proto__: null,
|
|
4055
|
-
ABSOLUTE_AUTHORITY:
|
|
4056
|
-
AUTHORITY_BOUNDS:
|
|
4057
|
-
ZERO_AUTHORITY:
|
|
4058
|
-
acquireZ:
|
|
4059
|
-
authorityZ:
|
|
4060
|
-
filterTransfersByChannelKey:
|
|
4061
|
-
releaseZ:
|
|
4062
|
-
stateZ:
|
|
4063
|
-
subjectZ:
|
|
4064
|
-
transferZ:
|
|
4065
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4207
|
+
ABSOLUTE_AUTHORITY: cn,
|
|
4208
|
+
AUTHORITY_BOUNDS: xo,
|
|
4209
|
+
ZERO_AUTHORITY: hn,
|
|
4210
|
+
acquireZ: gn,
|
|
4211
|
+
authorityZ: ln,
|
|
4212
|
+
filterTransfersByChannelKey: So,
|
|
4213
|
+
releaseZ: dn,
|
|
4214
|
+
stateZ: Oe,
|
|
4215
|
+
subjectZ: fn,
|
|
4216
|
+
transferZ: No
|
|
4217
|
+
}, Symbol.toStringTag, { value: "Module" })), Io = (t) => Object.getOwnPropertySymbols(globalThis).includes(t), Mo = (t, e) => {
|
|
4066
4218
|
const r = Symbol.for(t);
|
|
4067
|
-
if (!
|
|
4219
|
+
if (!Io(r)) {
|
|
4068
4220
|
const n = e();
|
|
4069
4221
|
Object.defineProperty(globalThis, r, { value: n });
|
|
4070
4222
|
}
|
|
4071
4223
|
return () => globalThis[r];
|
|
4072
|
-
},
|
|
4073
|
-
static discriminator =
|
|
4074
|
-
discriminator =
|
|
4224
|
+
}, pn = "sy_x_error", Ao = (t) => (e) => e != null && typeof e == "object" && "type" in e && typeof e.type == "string" ? e.type.startsWith(t) : e instanceof Error ? e.message.startsWith(t) : typeof e != "string" ? !1 : e.startsWith(t), mn = (t) => class fe extends Error {
|
|
4225
|
+
static discriminator = pn;
|
|
4226
|
+
discriminator = fe.discriminator;
|
|
4075
4227
|
static TYPE = t;
|
|
4076
|
-
type =
|
|
4077
|
-
static matches =
|
|
4078
|
-
matches =
|
|
4228
|
+
type = fe.TYPE;
|
|
4229
|
+
static matches = Ao(t);
|
|
4230
|
+
matches = fe.matches;
|
|
4079
4231
|
constructor(r, n) {
|
|
4080
|
-
super(r, n), this.name =
|
|
4232
|
+
super(r, n), this.name = fe.TYPE;
|
|
4081
4233
|
}
|
|
4082
4234
|
static sub(r) {
|
|
4083
|
-
return
|
|
4235
|
+
return mn(`${t}.${r}`);
|
|
4084
4236
|
}
|
|
4085
|
-
},
|
|
4237
|
+
}, Eo = (t) => {
|
|
4086
4238
|
if (t == null || typeof t != "object") return !1;
|
|
4087
4239
|
const e = t;
|
|
4088
|
-
if (e.discriminator !==
|
|
4240
|
+
if (e.discriminator !== pn) return !1;
|
|
4089
4241
|
if (!("type" in e))
|
|
4090
4242
|
throw new Error(
|
|
4091
4243
|
`X Error is missing its type property: ${JSON.stringify(e)}`
|
|
4092
4244
|
);
|
|
4093
4245
|
return !0;
|
|
4094
|
-
},
|
|
4095
|
-
class
|
|
4246
|
+
}, le = "unknown", sr = "nil";
|
|
4247
|
+
class Uo {
|
|
4096
4248
|
providers = [];
|
|
4097
4249
|
register(e) {
|
|
4098
4250
|
this.providers.push(e);
|
|
4099
4251
|
}
|
|
4100
4252
|
encode(e) {
|
|
4101
|
-
if (e == null) return { type:
|
|
4102
|
-
if (
|
|
4253
|
+
if (e == null) return { type: sr, data: "" };
|
|
4254
|
+
if (Eo(e))
|
|
4103
4255
|
for (const r of this.providers) {
|
|
4104
4256
|
const n = r.encode(e);
|
|
4105
4257
|
if (n != null) return n;
|
|
4106
4258
|
}
|
|
4107
|
-
if (e instanceof Error) return { type:
|
|
4108
|
-
if (typeof e == "string") return { type:
|
|
4259
|
+
if (e instanceof Error) return { type: le, data: e.message };
|
|
4260
|
+
if (typeof e == "string") return { type: le, data: e };
|
|
4109
4261
|
try {
|
|
4110
|
-
return { type:
|
|
4262
|
+
return { type: le, data: JSON.stringify(e) };
|
|
4111
4263
|
} catch {
|
|
4112
|
-
return { type:
|
|
4264
|
+
return { type: le, data: "unable to encode error information" };
|
|
4113
4265
|
}
|
|
4114
4266
|
}
|
|
4115
4267
|
decode(e) {
|
|
4116
|
-
if (e == null || e.type ===
|
|
4117
|
-
if (e.type ===
|
|
4268
|
+
if (e == null || e.type === sr) return null;
|
|
4269
|
+
if (e.type === le) return new ir(e.data);
|
|
4118
4270
|
for (const r of this.providers) {
|
|
4119
4271
|
const n = r.decode(e);
|
|
4120
4272
|
if (n != null) return n;
|
|
4121
4273
|
}
|
|
4122
|
-
return new
|
|
4274
|
+
return new ir(e.data);
|
|
4123
4275
|
}
|
|
4124
4276
|
}
|
|
4125
|
-
|
|
4126
|
-
class
|
|
4277
|
+
Mo("synnax-error-registry", () => new Uo());
|
|
4278
|
+
class ir extends mn("unknown") {
|
|
4127
4279
|
}
|
|
4128
4280
|
a.object({ type: a.string(), data: a.string() });
|
|
4129
|
-
const
|
|
4130
|
-
jsonrpc:
|
|
4131
|
-
method:
|
|
4281
|
+
const qu = () => new Promise((t) => setTimeout(t, 0)), Bo = O.object({
|
|
4282
|
+
jsonrpc: O.literal("2.0"),
|
|
4283
|
+
method: O.string(),
|
|
4132
4284
|
// params should be z.union([z.record(z.string(), z.json()),
|
|
4133
4285
|
// z.array(z.json())]).optional() but the VSCode JSON RPC implementation uses a looser
|
|
4134
4286
|
// definition of params then in the JSON-RPC spec.
|
|
4135
|
-
params:
|
|
4136
|
-
id:
|
|
4137
|
-
}),
|
|
4138
|
-
jsonrpc:
|
|
4139
|
-
id:
|
|
4140
|
-
}),
|
|
4141
|
-
result:
|
|
4142
|
-
}),
|
|
4143
|
-
error:
|
|
4144
|
-
code:
|
|
4287
|
+
params: O.any().optional(),
|
|
4288
|
+
id: O.union([O.string(), O.number(), O.null()]).optional()
|
|
4289
|
+
}), yn = O.object({
|
|
4290
|
+
jsonrpc: O.literal("2.0"),
|
|
4291
|
+
id: O.union([O.string(), O.number(), O.null()])
|
|
4292
|
+
}), jo = yn.extend({
|
|
4293
|
+
result: O.json()
|
|
4294
|
+
}), Co = yn.extend({
|
|
4295
|
+
error: O.object({
|
|
4296
|
+
code: O.number().int(),
|
|
4145
4297
|
// This should be z.string(), but the VSCode JSON RPC implementation uses a looser
|
|
4146
4298
|
// definition of error than the JSON-RPC spec.
|
|
4147
|
-
message:
|
|
4148
|
-
data:
|
|
4299
|
+
message: O.string().optional(),
|
|
4300
|
+
data: O.json().optional()
|
|
4149
4301
|
})
|
|
4150
|
-
}),
|
|
4151
|
-
|
|
4152
|
-
const
|
|
4302
|
+
}), Ro = O.union([jo, Co]);
|
|
4303
|
+
O.union([Bo, Ro]);
|
|
4304
|
+
const Lo = O.uuid(), Do = O.object({
|
|
4305
|
+
key: Lo,
|
|
4306
|
+
name: O.string().min(1),
|
|
4307
|
+
color: O.string()
|
|
4308
|
+
}), Po = (t, e, r) => {
|
|
4153
4309
|
const n = t.get(e);
|
|
4154
4310
|
return n === void 0 ? (t.set(e, r), r) : n;
|
|
4155
|
-
},
|
|
4311
|
+
}, zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4156
4312
|
__proto__: null,
|
|
4157
|
-
getOrSetDefault:
|
|
4158
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4313
|
+
getOrSetDefault: Po
|
|
4314
|
+
}, Symbol.toStringTag, { value: "Module" })), xt = a.string().regex(/^\d+\.\d+\.\d+$/), Se = ((t, e, r = {}) => {
|
|
4159
4315
|
r.checkMajor ??= !0, r.checkMinor ??= !0, r.checkPatch ??= !0;
|
|
4160
|
-
const n =
|
|
4316
|
+
const n = xt.parse(t), s = xt.parse(e), [i, o, h] = n.split(".").map(Number), [f, l, d] = s.split(".").map(Number);
|
|
4161
4317
|
if (r.checkMajor) {
|
|
4162
|
-
if (i <
|
|
4163
|
-
if (i >
|
|
4318
|
+
if (i < f) return Ue;
|
|
4319
|
+
if (i > f) return Be;
|
|
4164
4320
|
}
|
|
4165
4321
|
if (r.checkMinor) {
|
|
4166
|
-
if (o < l) return
|
|
4167
|
-
if (o > l) return
|
|
4322
|
+
if (o < l) return Ue;
|
|
4323
|
+
if (o > l) return Be;
|
|
4168
4324
|
}
|
|
4169
4325
|
if (r.checkPatch) {
|
|
4170
|
-
if (
|
|
4171
|
-
if (
|
|
4326
|
+
if (h < d) return Ue;
|
|
4327
|
+
if (h > d) return Be;
|
|
4172
4328
|
}
|
|
4173
|
-
return
|
|
4174
|
-
},
|
|
4329
|
+
return ae;
|
|
4330
|
+
}), ko = (t, e, r = {}) => yr(Se(t, e, r)), bn = (t, e, r = {}) => mr(Se(t, e, r)), qo = (t, e, r = {}) => pr(Se(t, e, r)), zo = ({
|
|
4175
4331
|
name: t,
|
|
4176
4332
|
migrate: e
|
|
4177
4333
|
}) => (r) => {
|
|
@@ -4181,14 +4337,14 @@ const _a = (t, e, r) => {
|
|
|
4181
4337
|
} catch (n) {
|
|
4182
4338
|
throw console.log(`${t} failed to migrate from ${r.version}`), console.error(n), n;
|
|
4183
4339
|
}
|
|
4184
|
-
},
|
|
4340
|
+
}, Zo = ({
|
|
4185
4341
|
name: t,
|
|
4186
4342
|
migrations: e,
|
|
4187
4343
|
targetSchema: r,
|
|
4188
4344
|
defaultVersion: n,
|
|
4189
4345
|
def: s
|
|
4190
4346
|
}) => {
|
|
4191
|
-
const i = Object.keys(e).sort(
|
|
4347
|
+
const i = Object.keys(e).sort(Se).pop();
|
|
4192
4348
|
if (i == null)
|
|
4193
4349
|
return (l) => {
|
|
4194
4350
|
if (l.version ??= n, l.version !== s.version)
|
|
@@ -4204,13 +4360,13 @@ const _a = (t, e, r) => {
|
|
|
4204
4360
|
}
|
|
4205
4361
|
};
|
|
4206
4362
|
const o = Object.keys(e).length;
|
|
4207
|
-
let
|
|
4208
|
-
const
|
|
4363
|
+
let h = !1;
|
|
4364
|
+
const f = (l) => {
|
|
4209
4365
|
try {
|
|
4210
|
-
if (o === 0 ||
|
|
4211
|
-
return console.log(
|
|
4212
|
-
const d = l.version,
|
|
4213
|
-
return
|
|
4366
|
+
if (o === 0 || bn(l.version, i))
|
|
4367
|
+
return console.log(h ? `${t} ${l.version} now up to date` : `${t} version ${l.version} is up to date with target version ${s.version}`), l;
|
|
4368
|
+
const d = l.version, m = e[d], p = m(l);
|
|
4369
|
+
return h = !0, f(p);
|
|
4214
4370
|
} catch (d) {
|
|
4215
4371
|
return console.log(
|
|
4216
4372
|
`${t} failed to migrate from ${l.version} to ${i}`
|
|
@@ -4228,21 +4384,21 @@ const _a = (t, e, r) => {
|
|
|
4228
4384
|
return console.log(
|
|
4229
4385
|
`${t} version is null and no default version set. Exiting with default`
|
|
4230
4386
|
), s;
|
|
4231
|
-
return
|
|
4387
|
+
return f(l);
|
|
4232
4388
|
} catch (d) {
|
|
4233
4389
|
return console.log(`${t} failed to parse final result. Exiting with default`), console.error(d), s;
|
|
4234
4390
|
}
|
|
4235
4391
|
};
|
|
4236
|
-
},
|
|
4392
|
+
}, Zu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4237
4393
|
__proto__: null,
|
|
4238
|
-
compareSemVer:
|
|
4239
|
-
createMigration:
|
|
4240
|
-
migrator:
|
|
4241
|
-
semVerNewer:
|
|
4242
|
-
semVerOlder:
|
|
4243
|
-
semVerZ:
|
|
4244
|
-
versionsEqual:
|
|
4245
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4394
|
+
compareSemVer: Se,
|
|
4395
|
+
createMigration: zo,
|
|
4396
|
+
migrator: Zo,
|
|
4397
|
+
semVerNewer: bn,
|
|
4398
|
+
semVerOlder: qo,
|
|
4399
|
+
semVerZ: xt,
|
|
4400
|
+
versionsEqual: ko
|
|
4401
|
+
}, Symbol.toStringTag, { value: "Module" })), wn = ["standard", "scientific", "engineering"], Fo = a.enum(wn), Yo = (t, e, r) => {
|
|
4246
4402
|
if (Number.isNaN(t)) return "NaN";
|
|
4247
4403
|
if (t === 1 / 0) return "∞";
|
|
4248
4404
|
if (t === -1 / 0) return "-∞";
|
|
@@ -4251,28 +4407,32 @@ const _a = (t, e, r) => {
|
|
|
4251
4407
|
return e === 0 ? "0ᴇ0" : `0.${"0".repeat(e)}ᴇ0`;
|
|
4252
4408
|
let n;
|
|
4253
4409
|
return r === "scientific" ? n = Math.floor(Math.log10(Math.abs(t))) : n = Math.floor(Math.log10(Math.abs(t)) / 3) * 3, `${(t / 10 ** n).toFixed(e)}ᴇ${n}`;
|
|
4254
|
-
},
|
|
4410
|
+
}, Fu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4255
4411
|
__proto__: null,
|
|
4256
|
-
NOTATIONS:
|
|
4257
|
-
notationZ:
|
|
4258
|
-
stringifyNumber:
|
|
4259
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
4412
|
+
NOTATIONS: wn,
|
|
4413
|
+
notationZ: Fo,
|
|
4414
|
+
stringifyNumber: Yo
|
|
4415
|
+
}, Symbol.toStringTag, { value: "Module" })), Yu = (t) => Array.isArray(t) ? [...t] : typeof t == "object" && t !== null ? { ...t } : t, $n = a.enum([
|
|
4260
4416
|
"success",
|
|
4261
4417
|
"info",
|
|
4262
4418
|
"warning",
|
|
4263
4419
|
"error",
|
|
4264
4420
|
"loading",
|
|
4265
4421
|
"disabled"
|
|
4266
|
-
]),
|
|
4422
|
+
]), Wo = (t) => a.object({
|
|
4267
4423
|
key: a.string(),
|
|
4268
|
-
|
|
4424
|
+
name: a.string().default(""),
|
|
4425
|
+
variant: $n,
|
|
4269
4426
|
message: a.string(),
|
|
4270
4427
|
description: a.string().optional(),
|
|
4271
|
-
time:
|
|
4428
|
+
time: $.z,
|
|
4429
|
+
labels: or(Do).optional(),
|
|
4272
4430
|
details: t ?? a.unknown().optional()
|
|
4273
|
-
}),
|
|
4431
|
+
}), Vo = a.object({
|
|
4432
|
+
stack: a.string()
|
|
4433
|
+
}), Go = (t, e) => {
|
|
4274
4434
|
if (!(t instanceof Error)) throw t;
|
|
4275
|
-
return
|
|
4435
|
+
return On({
|
|
4276
4436
|
variant: "error",
|
|
4277
4437
|
message: e ?? t.message,
|
|
4278
4438
|
description: e != null ? t.message : void 0,
|
|
@@ -4280,37 +4440,39 @@ const _a = (t, e, r) => {
|
|
|
4280
4440
|
stack: t.stack ?? ""
|
|
4281
4441
|
}
|
|
4282
4442
|
});
|
|
4283
|
-
},
|
|
4284
|
-
key:
|
|
4285
|
-
time:
|
|
4443
|
+
}, On = (t) => ({
|
|
4444
|
+
key: Vt(),
|
|
4445
|
+
time: $.now(),
|
|
4446
|
+
name: "",
|
|
4286
4447
|
...t
|
|
4287
|
-
}),
|
|
4448
|
+
}), Ho = (t, e = []) => {
|
|
4288
4449
|
if (t != null)
|
|
4289
4450
|
return Array.isArray(e) ? e.includes(t) ? t : void 0 : e === t ? t : void 0;
|
|
4290
|
-
},
|
|
4451
|
+
}, Xo = (t, e = []) => {
|
|
4291
4452
|
if (t != null)
|
|
4292
4453
|
return Array.isArray(e) ? e.includes(t) ? void 0 : t : e === t ? void 0 : t;
|
|
4293
|
-
},
|
|
4454
|
+
}, Wu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4294
4455
|
__proto__: null,
|
|
4295
|
-
create:
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4456
|
+
create: On,
|
|
4457
|
+
exceptionDetailsSchema: Vo,
|
|
4458
|
+
fromException: Go,
|
|
4459
|
+
keepVariants: Ho,
|
|
4460
|
+
removeVariants: Xo,
|
|
4461
|
+
statusZ: Wo,
|
|
4462
|
+
variantZ: $n
|
|
4463
|
+
}, Symbol.toStringTag, { value: "Module" })), Jo = (t, e = "") => {
|
|
4302
4464
|
if (typeof t == "string") return t;
|
|
4303
4465
|
const r = t.length;
|
|
4304
4466
|
return r === 0 ? e : r === 1 ? t[0] : r === 2 ? `${t[0]} and ${t[1]}` : `${t.slice(0, -1).join(", ")}, and ${t[r - 1]}`;
|
|
4305
|
-
},
|
|
4467
|
+
}, Ko = (t) => {
|
|
4306
4468
|
const e = t.split(" "), r = /* @__PURE__ */ new Set(), n = e.map((o) => o.charAt(0).toLowerCase()).join("");
|
|
4307
4469
|
r.add(n.replace(/-/g, "_")), r.add(n.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_"));
|
|
4308
4470
|
const s = /\d+/g;
|
|
4309
|
-
t.match(s) && e.forEach((o,
|
|
4471
|
+
t.match(s) && e.forEach((o, h) => {
|
|
4310
4472
|
if (s.test(o)) {
|
|
4311
|
-
const
|
|
4312
|
-
r.add(
|
|
4313
|
-
|
|
4473
|
+
const f = e.map((l, d) => d !== h ? l.charAt(0).toLowerCase() : l).join("");
|
|
4474
|
+
r.add(f.replace(/-/g, "_")), r.add(
|
|
4475
|
+
f.replace(/(.)(.)/g, "$1_$2").replace(/-/g, "_")
|
|
4314
4476
|
);
|
|
4315
4477
|
}
|
|
4316
4478
|
});
|
|
@@ -4320,53 +4482,54 @@ const _a = (t, e, r) => {
|
|
|
4320
4482
|
return r.add(i.join("").replace(/-/g, "_")), r.add(i.join("_").replace(/-/g, "_")), Array.from(r).filter(
|
|
4321
4483
|
(o) => o.length >= 2 && o.length <= 12 && !/^\d/.test(o)
|
|
4322
4484
|
);
|
|
4323
|
-
},
|
|
4485
|
+
}, Qo = (t, e) => t.startsWith(e) ? t.slice(e.length) : t, _o = (t) => t.length === 0 ? t : t[t.length - 1] === "y" ? `${t.slice(0, -1)}ies` : t[t.length - 1] === "s" || t[t.length - 1] === "x" || t[t.length - 1] === "z" || t.endsWith("ch") || t.endsWith("sh") ? `${t}es` : `${t}s`, Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4324
4486
|
__proto__: null,
|
|
4325
|
-
createShortIdentifiers:
|
|
4326
|
-
naturalLanguageJoin:
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4487
|
+
createShortIdentifiers: Ko,
|
|
4488
|
+
naturalLanguageJoin: Jo,
|
|
4489
|
+
pluralName: _o,
|
|
4490
|
+
trimPrefix: Qo
|
|
4491
|
+
}, Symbol.toStringTag, { value: "Module" })), eu = new Error("request for lock canceled");
|
|
4492
|
+
var tu = function(t, e, r, n) {
|
|
4330
4493
|
function s(i) {
|
|
4331
4494
|
return i instanceof r ? i : new r(function(o) {
|
|
4332
4495
|
o(i);
|
|
4333
4496
|
});
|
|
4334
4497
|
}
|
|
4335
4498
|
return new (r || (r = Promise))(function(i, o) {
|
|
4336
|
-
function
|
|
4499
|
+
function h(d) {
|
|
4337
4500
|
try {
|
|
4338
4501
|
l(n.next(d));
|
|
4339
|
-
} catch (
|
|
4340
|
-
o(
|
|
4502
|
+
} catch (m) {
|
|
4503
|
+
o(m);
|
|
4341
4504
|
}
|
|
4342
4505
|
}
|
|
4343
|
-
function
|
|
4506
|
+
function f(d) {
|
|
4344
4507
|
try {
|
|
4345
4508
|
l(n.throw(d));
|
|
4346
|
-
} catch (
|
|
4347
|
-
o(
|
|
4509
|
+
} catch (m) {
|
|
4510
|
+
o(m);
|
|
4348
4511
|
}
|
|
4349
4512
|
}
|
|
4350
4513
|
function l(d) {
|
|
4351
|
-
d.done ? i(d.value) : s(d.value).then(
|
|
4514
|
+
d.done ? i(d.value) : s(d.value).then(h, f);
|
|
4352
4515
|
}
|
|
4353
4516
|
l((n = n.apply(t, e || [])).next());
|
|
4354
4517
|
});
|
|
4355
4518
|
};
|
|
4356
|
-
class
|
|
4357
|
-
constructor(e, r =
|
|
4519
|
+
class ru {
|
|
4520
|
+
constructor(e, r = eu) {
|
|
4358
4521
|
this._value = e, this._cancelError = r, this._queue = [], this._weightedWaiters = [];
|
|
4359
4522
|
}
|
|
4360
4523
|
acquire(e = 1, r = 0) {
|
|
4361
4524
|
if (e <= 0)
|
|
4362
4525
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4363
4526
|
return new Promise((n, s) => {
|
|
4364
|
-
const i = { resolve: n, reject: s, weight: e, priority: r }, o =
|
|
4527
|
+
const i = { resolve: n, reject: s, weight: e, priority: r }, o = vn(this._queue, (h) => r <= h.priority);
|
|
4365
4528
|
o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
|
|
4366
4529
|
});
|
|
4367
4530
|
}
|
|
4368
4531
|
runExclusive(e) {
|
|
4369
|
-
return
|
|
4532
|
+
return tu(this, arguments, void 0, function* (r, n = 1, s = 0) {
|
|
4370
4533
|
const [i, o] = yield this.acquire(n, s);
|
|
4371
4534
|
try {
|
|
4372
4535
|
return yield r(i);
|
|
@@ -4379,7 +4542,7 @@ class mo {
|
|
|
4379
4542
|
if (e <= 0)
|
|
4380
4543
|
throw new Error(`invalid weight ${e}: must be positive`);
|
|
4381
4544
|
return this._couldLockImmediately(e, r) ? Promise.resolve() : new Promise((n) => {
|
|
4382
|
-
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []),
|
|
4545
|
+
this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), nu(this._weightedWaiters[e - 1], { resolve: n, priority: r });
|
|
4383
4546
|
});
|
|
4384
4547
|
}
|
|
4385
4548
|
isLocked() {
|
|
@@ -4426,7 +4589,7 @@ class mo {
|
|
|
4426
4589
|
if (!n)
|
|
4427
4590
|
continue;
|
|
4428
4591
|
const s = n.findIndex((i) => i.priority <= e);
|
|
4429
|
-
(s === -1 ? n : n.splice(0, s)).forEach((i) => i.resolve());
|
|
4592
|
+
(s === -1 ? n : n.splice(0, s)).forEach(((i) => i.resolve()));
|
|
4430
4593
|
}
|
|
4431
4594
|
}
|
|
4432
4595
|
}
|
|
@@ -4434,49 +4597,49 @@ class mo {
|
|
|
4434
4597
|
return (this._queue.length === 0 || this._queue[0].priority < r) && e <= this._value;
|
|
4435
4598
|
}
|
|
4436
4599
|
}
|
|
4437
|
-
function
|
|
4438
|
-
const r =
|
|
4600
|
+
function nu(t, e) {
|
|
4601
|
+
const r = vn(t, (n) => e.priority <= n.priority);
|
|
4439
4602
|
t.splice(r + 1, 0, e);
|
|
4440
4603
|
}
|
|
4441
|
-
function
|
|
4604
|
+
function vn(t, e) {
|
|
4442
4605
|
for (let r = t.length - 1; r >= 0; r--)
|
|
4443
4606
|
if (e(t[r]))
|
|
4444
4607
|
return r;
|
|
4445
4608
|
return -1;
|
|
4446
4609
|
}
|
|
4447
|
-
var
|
|
4610
|
+
var su = function(t, e, r, n) {
|
|
4448
4611
|
function s(i) {
|
|
4449
4612
|
return i instanceof r ? i : new r(function(o) {
|
|
4450
4613
|
o(i);
|
|
4451
4614
|
});
|
|
4452
4615
|
}
|
|
4453
4616
|
return new (r || (r = Promise))(function(i, o) {
|
|
4454
|
-
function
|
|
4617
|
+
function h(d) {
|
|
4455
4618
|
try {
|
|
4456
4619
|
l(n.next(d));
|
|
4457
|
-
} catch (
|
|
4458
|
-
o(
|
|
4620
|
+
} catch (m) {
|
|
4621
|
+
o(m);
|
|
4459
4622
|
}
|
|
4460
4623
|
}
|
|
4461
|
-
function
|
|
4624
|
+
function f(d) {
|
|
4462
4625
|
try {
|
|
4463
4626
|
l(n.throw(d));
|
|
4464
|
-
} catch (
|
|
4465
|
-
o(
|
|
4627
|
+
} catch (m) {
|
|
4628
|
+
o(m);
|
|
4466
4629
|
}
|
|
4467
4630
|
}
|
|
4468
4631
|
function l(d) {
|
|
4469
|
-
d.done ? i(d.value) : s(d.value).then(
|
|
4632
|
+
d.done ? i(d.value) : s(d.value).then(h, f);
|
|
4470
4633
|
}
|
|
4471
4634
|
l((n = n.apply(t, e || [])).next());
|
|
4472
4635
|
});
|
|
4473
4636
|
};
|
|
4474
|
-
class
|
|
4637
|
+
class iu {
|
|
4475
4638
|
constructor(e) {
|
|
4476
|
-
this._semaphore = new
|
|
4639
|
+
this._semaphore = new ru(1, e);
|
|
4477
4640
|
}
|
|
4478
4641
|
acquire() {
|
|
4479
|
-
return
|
|
4642
|
+
return su(this, arguments, void 0, function* (e = 0) {
|
|
4480
4643
|
const [, r] = yield this._semaphore.acquire(1, e);
|
|
4481
4644
|
return r;
|
|
4482
4645
|
});
|
|
@@ -4497,34 +4660,34 @@ class bo {
|
|
|
4497
4660
|
return this._semaphore.cancel();
|
|
4498
4661
|
}
|
|
4499
4662
|
}
|
|
4500
|
-
class
|
|
4663
|
+
class Tn extends iu {
|
|
4501
4664
|
constructor(e) {
|
|
4502
4665
|
super(), Object.assign(this, e);
|
|
4503
4666
|
}
|
|
4504
4667
|
}
|
|
4505
|
-
const
|
|
4668
|
+
const au = (t) => new Tn(t), Gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4506
4669
|
__proto__: null,
|
|
4507
|
-
mutex:
|
|
4508
|
-
newMutex:
|
|
4670
|
+
mutex: Tn,
|
|
4671
|
+
newMutex: au
|
|
4509
4672
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
4510
|
-
function
|
|
4673
|
+
function xn(t) {
|
|
4511
4674
|
var e, r, n = "";
|
|
4512
4675
|
if (typeof t == "string" || typeof t == "number") n += t;
|
|
4513
4676
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
4514
4677
|
var s = t.length;
|
|
4515
|
-
for (e = 0; e < s; e++) t[e] && (r =
|
|
4678
|
+
for (e = 0; e < s; e++) t[e] && (r = xn(t[e])) && (n && (n += " "), n += r);
|
|
4516
4679
|
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
4517
4680
|
return n;
|
|
4518
4681
|
}
|
|
4519
|
-
function
|
|
4520
|
-
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e =
|
|
4682
|
+
function ou() {
|
|
4683
|
+
for (var t, e, r = 0, n = "", s = arguments.length; r < s; r++) (t = arguments[r]) && (e = xn(t)) && (n && (n += " "), n += e);
|
|
4521
4684
|
return n;
|
|
4522
4685
|
}
|
|
4523
|
-
const
|
|
4524
|
-
const e = (...r) =>
|
|
4525
|
-
return e.B = (...r) => t +
|
|
4686
|
+
const uu = ou, ne = "-", ar = "__", Ee = "--", lu = (t) => {
|
|
4687
|
+
const e = (...r) => uu(...r);
|
|
4688
|
+
return e.B = (...r) => t + ne + r.join(ne), e.E = (r) => t + ar + r, e.M = (...r) => t + Ee + r.join("-"), e.BM = (r, ...n) => e.B(r) + Ee + n.join("-"), e.BE = (r, ...n) => e.B(r) + ar + n.join(ne), e.BEM = (r, n, ...s) => e.BE(r, n) + Ee + s.join(ne), e.var = (...r) => Ee + t + ne + r.join(ne), e;
|
|
4526
4689
|
};
|
|
4527
|
-
class
|
|
4690
|
+
class cu {
|
|
4528
4691
|
rows = [];
|
|
4529
4692
|
columns = [];
|
|
4530
4693
|
prefix;
|
|
@@ -4553,55 +4716,57 @@ class $o {
|
|
|
4553
4716
|
};
|
|
4554
4717
|
}
|
|
4555
4718
|
}
|
|
4556
|
-
const
|
|
4719
|
+
const hu = (t, e) => Object.entries(e).forEach(
|
|
4557
4720
|
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
4558
|
-
),
|
|
4721
|
+
), fu = (t, e) => Array.from(t.style).forEach((r) => {
|
|
4559
4722
|
r.startsWith(e) && t.style.removeProperty(r);
|
|
4560
|
-
}),
|
|
4561
|
-
const e =
|
|
4562
|
-
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location",
|
|
4723
|
+
}), du = (t) => {
|
|
4724
|
+
const e = lu(t);
|
|
4725
|
+
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M("location", ks.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M("direction", xs.construct(r)), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r.toString()}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.applyVars = hu, e.removeVars = fu, e.newGridBuilder = (r) => new cu(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = ((r) => r != null && e.M(`shade-${r}`)), e.colorVar = (r) => {
|
|
4563
4726
|
if (!(r == null || r === !1))
|
|
4564
|
-
return typeof r == "number" ? `var(--${t}-gray-l${r})` :
|
|
4727
|
+
return typeof r == "number" ? `var(--${t}-gray-l${r})` : To.cssString(r);
|
|
4565
4728
|
}, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e.level = (r) => e.M(`level-${r}`), e;
|
|
4566
|
-
},
|
|
4729
|
+
}, Hu = du("pluto");
|
|
4567
4730
|
export {
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4731
|
+
ku as A,
|
|
4732
|
+
Yu as B,
|
|
4733
|
+
Hu as C,
|
|
4734
|
+
Iu as D,
|
|
4735
|
+
Vu as F,
|
|
4736
|
+
vu as H,
|
|
4737
|
+
ks as K,
|
|
4738
|
+
Pu as N,
|
|
4739
|
+
ju as O,
|
|
4740
|
+
Tu as Q,
|
|
4741
|
+
Li as R,
|
|
4742
|
+
Du as S,
|
|
4743
|
+
mu as U,
|
|
4744
|
+
Wu as V,
|
|
4745
|
+
Zu as W,
|
|
4746
|
+
Gu as X,
|
|
4747
|
+
Su as _,
|
|
4748
|
+
pu as a,
|
|
4749
|
+
Nu as b,
|
|
4750
|
+
bu as c,
|
|
4751
|
+
c as d,
|
|
4752
|
+
$u as e,
|
|
4753
|
+
S as f,
|
|
4754
|
+
Mu as g,
|
|
4755
|
+
Ze as h,
|
|
4756
|
+
Ou as i,
|
|
4757
|
+
xu as j,
|
|
4758
|
+
To as k,
|
|
4759
|
+
qu as l,
|
|
4760
|
+
Q as m,
|
|
4761
|
+
lu as n,
|
|
4762
|
+
ou as o,
|
|
4763
|
+
xs as p,
|
|
4764
|
+
Lu as q,
|
|
4765
|
+
$ as r,
|
|
4766
|
+
zu as s,
|
|
4767
|
+
Au as t,
|
|
4768
|
+
M as u,
|
|
4769
|
+
st as v,
|
|
4770
|
+
Jr as x,
|
|
4771
|
+
Fu as z
|
|
4607
4772
|
};
|